Преглед изворни кода

feat:新增送货页面逻辑

storeBelieveInLight пре 1 година
родитељ
комит
2cde5c52cc

+ 20 - 36
shop/commodity/components/fillLogisticsInfo.vue

@@ -2,55 +2,39 @@
2 2
   <view class="logistics-information">
3 3
     <view class="logistics-information__text">填写物流信息</view>
4 4
     <view class="logistics-information__form">
5
-	  <reInputItemVue 
6
-	  placeholder="请手动输入或扫描二维码"
7
-	   name="物流单号"
8
-	   @change="changeInput"
9
-	   >
10
-		  <image
11
-		    slot="next"
12
-		    src="/static/images/new_ui/qcode.png"
13
-		    mode=""
14
-		    class="image-box"
15
-		    @click="handleQrcode"
16
-		  ></image>
17
-	  </reInputItemVue>
18
-      <view class="form_item">
19
-        <view class="form_item--left"> 物流公司 </view>
20
-        <view class="form_item--right">
21
-          <view class="upop" @click="handleSelect">
22
-            <view class="title xcv">{{ logistics }}</view>
23
-            <image src="/static/images/new_ui/arrow-right.png" mode=""></image>
24
-          </view>
25
-        </view>
26
-      </view>
5
+      <reInputItemVue
6
+        placeholder="请手动输入或扫描二维码"
7
+        name="物流单号"
8
+        @change="changeInput"
9
+      >
10
+        <image
11
+          slot="next"
12
+          src="/static/images/new_ui/qcode.png"
13
+          mode=""
14
+          class="image-box"
15
+          @click="handleQrcode"
16
+        ></image>
17
+      </reInputItemVue>
18
+      <popupSelectItemVue @click-tabs="handleClick"></popupSelectItemVue>
27 19
     </view>
28
-    <popupSelectVue
29
-      ref="popup"
30
-      :value.sync="logisticsValue"
31
-      @tabs="handleClick"
32
-    />
33 20
   </view>
34 21
 </template>
35 22
 
36 23
 <script>
37
-import popupSelectVue from "./popupSelect.vue";
38 24
 import reInputItemVue from "./reInputItem/reInputItem.vue";
25
+import popupSelectItemVue from "./popupSelectItem/popupSelectItem.vue";
39 26
 export default {
40
-  components: { popupSelectVue ,reInputItemVue},
27
+  components: { reInputItemVue, popupSelectItemVue },
41 28
   data() {
42
-    return {
43
-      logisticsValue: "", //物流
44
-      logisticsLabel: "",
45
-    };
29
+    return {};
46 30
   },
47 31
   methods: {
48 32
     handleQrcode() {
49 33
       console.log("handleQrcode");
50 34
     },
51
-	changeInput(val){
52
-		console.log(val,"物流单号")
53
-	},
35
+    changeInput(val) {
36
+      console.log(val, "物流单号");
37
+    },
54 38
     handleSelect() {
55 39
       this.$refs.popup.open();
56 40
     },

+ 144 - 0
shop/commodity/components/popupSelectItem/popupSelectItem.vue

@@ -0,0 +1,144 @@
1
+<template>
2
+      <view class="form_item">
3
+        <view class="form_item--left"> {{name}} </view>
4
+        <view class="form_item--right">
5
+          <view class="upop" @click="handleSelect">
6
+            <view class="title xcv">{{ logistics }}</view>
7
+            <image src="/static/images/new_ui/arrow-right.png" mode=""></image>
8
+          </view>
9
+        </view>
10
+		<popupSelectVue
11
+		  ref="popup"
12
+		  :value.sync="logisticsValue"
13
+		  :selectData="selectData"
14
+		  @tabs="handleClick"
15
+		  :title="title"
16
+		  
17
+		/>
18
+      </view>
19
+</template>
20
+
21
+<script>
22
+	import popupSelectVue from '../popupSelect.vue';
23
+	export default {
24
+		components: { popupSelectVue },
25
+		props: {
26
+		  name: {
27
+		    type: String,
28
+		    default: "物流公司",
29
+		  },
30
+		  defaultLabel:{
31
+			  type: String,
32
+			  default: "请选择物流公司",
33
+		  },
34
+		  title: {
35
+		        type: String,
36
+		        default: "物流公司信息",
37
+		      },
38
+		      value: {
39
+		        type: [String, Number],
40
+		        default: "",
41
+		      },
42
+		  	selectData:{
43
+		  		type:Array,
44
+		  		default:()=>{
45
+		  			return [
46
+		    { value: 0, text: "顺丰速运", code: "SF" },
47
+		    { value: 1, text: "中通快递", code: "ZTO" },
48
+		    { value: 2, text: "韵达快递", code: "YUNDA" },
49
+		    { value: 3, text: "申通快递", code: "STO" },
50
+		    { value: 4, text: "EMS邮政", code: "EMS" },
51
+		    { value: 5, text: "圆通速递", code: "YTO" },
52
+		    { value: 6, text: "DHL国际", code: "DHL" },
53
+		    { value: 7, text: "京东物流", code: "JD" },
54
+		    { value: 8, text: "FedEx联邦", code: "FDX" },
55
+		    { value: 9, text: "UPS联合包裹", code: "UPS" },
56
+		    { value: 10, text: "德邦快递", code: "DEPPON" },
57
+		    { value: 11, text: "百世快递", code: "BEST" },
58
+		    { value: 12, text: "极兔速递", code: "J&T" },
59
+		    { value: 13, text: "TNT快递", code: "TNT" },
60
+		    { value: 14, text: "跨越速运", code: "KYE" }
61
+		  ]
62
+		  		}
63
+		  	}
64
+		},
65
+		data() {
66
+			return {
67
+				logisticsValue: "", //物流
68
+				logisticsLabel:""
69
+				
70
+			};
71
+		},
72
+		methods:{
73
+			handleClick({ selected, item, index }) {
74
+			  this.logisticsValue = selected;
75
+			  this.logisticsLabel = item.text;
76
+			  this.$emit("click-tabs",{ selected, item, index })
77
+			},
78
+			handleSelect() {
79
+			  this.$refs.popup.open();
80
+			},
81
+		},
82
+		computed: {
83
+		  logistics() {
84
+		    return this.logisticsLabel || this.defaultLabel;
85
+		  },
86
+		},
87
+	}
88
+</script>
89
+
90
+<style lang="scss" scoped>
91
+.form_item {
92
+  background: #ffffff;
93
+  display: flex;
94
+  align-items: center;
95
+  justify-content: space-between;
96
+  height: 100rpx;
97
+  // border-bottom: 2rpx solid #e5e5e5;
98
+  &--left {
99
+    max-width: 200rpx;
100
+    font-family: PingFangSC, PingFang SC;
101
+    font-weight: 400;
102
+    font-size: 30rpx;
103
+    color: #333333;
104
+    line-height: 30rpx;
105
+  }
106
+  &--right {
107
+    flex: 1;
108
+    padding-left: 50rpx;
109
+    padding-right: 12rpx;
110
+    text-align: right;
111
+    .title {
112
+      font-family: PingFangSC, PingFang SC;
113
+      font-weight: 400;
114
+      font-size: 28rpx;
115
+      color: #999999;
116
+    }
117
+    .upop {
118
+      display: flex;
119
+      width: 100%;
120
+      align-items: center;
121
+      justify-content: flex-end;
122
+      image {
123
+        width: 30rpx;
124
+        height: 30rpx;
125
+        margin-left: 5rpx;
126
+      }
127
+      .image-box {
128
+        width: 40rpx;
129
+        height: 38rpx;
130
+      }
131
+    }
132
+    .upop_input {
133
+      padding: 15rpx 10rpx;
134
+      flex: 1;
135
+    }
136
+    .xcv {
137
+      flex: 1;
138
+    }
139
+  }
140
+  &:last-child {
141
+    border-bottom: none;
142
+  }
143
+}
144
+</style>

+ 12 - 12
shop/commodity/components/reInputItem/reInputItem.vue

@@ -8,12 +8,12 @@
8 8
       <view class="upop">
9 9
         <input
10 10
           type="text"
11
-           class="title upop_input"
12
-		   v-model="valueData"
11
+          class="title upop_input"
12
+          v-model="valueData"
13 13
           :placeholder="placeholder"
14
-		  @input="changeInput"
14
+          @input="changeInput"
15 15
         />
16
-		<slot name="next"></slot>
16
+        <slot name="next"></slot>
17 17
       </view>
18 18
     </view>
19 19
   </view>
@@ -33,14 +33,14 @@ export default {
33 33
   },
34 34
   data() {
35 35
     return {
36
-		valueData:""
37
-	};
36
+      valueData: "",
37
+    };
38
+  },
39
+  methods: {
40
+    changeInput() {
41
+      this.$emit("change", this.valueData);
42
+    },
38 43
   },
39
-  methods:{
40
-	  changeInput(){
41
-		  this.$emit("change",this.valueData)
42
-	  }
43
-  }
44 44
 };
45 45
 </script>
46 46
 
@@ -53,7 +53,7 @@ export default {
53 53
   height: 100rpx;
54 54
   // border-bottom: 2rpx solid #e5e5e5;
55 55
   &--left {
56
-    width: 120rpx;
56
+    max-width: 200rpx;
57 57
     font-family: PingFangSC, PingFang SC;
58 58
     font-weight: 400;
59 59
     font-size: 30rpx;

+ 2 - 1
shop/commodity/order.vue

@@ -159,8 +159,9 @@
159 159
 				console.log("發貨",v)
160 160
 				const url = {
161 161
 					"sendGoods":`./sendoutgoods?order_id=${v.order_id}&status=${v.status}&indexs=${this.indexs}&goodsCustomType=${type}`,//立即发货
162
-					"delivered":``,//已送达
162
+					"delivered":`./sendoutgoods?order_id=${v.order_id}&status=${v.status}&indexs=${this.indexs}&goodsCustomType=deliverGoods`,//已送达
163 163
 					"logistics":``,//查看物流
164
+					"deliverGoods":`./sendoutgoods?order_id=${v.order_id}&status=${v.status}&indexs=${this.indexs}&goodsCustomType=${type}`,//送貨
164 165
 					"pickup":`./sendoutgoods?order_id=${v.order_id}&status=${v.status}&indexs=${this.indexs}&goodsCustomType=${type}`,//立即自提
165 166
 				}
166 167
 				let redirectToUrl = url[type] || url["logistics"]

+ 145 - 83
shop/commodity/sendoutgoods.vue

@@ -1,95 +1,157 @@
1 1
 <template>
2
-	<view class="order-send-out-goods">
3
-		<headersVue @headerJump="topgi" :header-title="headerTitle"></headersVue>
4
-		<view class="order-send-out-goods__content">
5
-			<shipmentGoodsCardVue :title="shipmentGoodsTitle"/>
6
-			<orderDetailSendCardVue class="custom_class"/>
7
-			<fillLogisticsInfoVue class="custom_class" v-if="goodsCustomType==='sendGoods'"/>
8
-			<reInputItemVue v-if="goodsCustomType==='pickup'" class="inputInfo" ></reInputItemVue>
9
-			<view class="btn-box">
10
-			  <button type="primary" class="send-goods" v-if="goodsCustomType==='sendGoods'">发货</button>
11
-			  <button type="primary" class="send-goods" v-if="goodsCustomType==='pickup'">自提</button>
12
-			</view>
13
-		</view>
14
-	</view>
2
+  <view class="order-send-out-goods">
3
+    <headersVue @headerJump="topgi" :header-title="headerTitle"></headersVue>
4
+    <view class="order-send-out-goods__content">
5
+      <shipmentGoodsCardVue :title="shipmentGoodsTitle" />
6
+      <orderDetailSendCardVue class="custom_class" />
7
+      <fillLogisticsInfoVue
8
+        class="custom_class"
9
+        v-if="goodsCustomType === 'sendGoods'"
10
+      />
11
+      <reInputItemVue
12
+        v-if="goodsCustomType === 'pickup'"
13
+        class="inputInfo"
14
+      ></reInputItemVue>
15
+	  <reInputItemVue
16
+	    v-if="goodsCustomType === 'pickup'"
17
+	    class="inputInfo"
18
+	  ></reInputItemVue>
19
+	  <popupSelectItemVue  
20
+	  v-if="goodsCustomType === 'deliverGoods'"
21
+	    class="inputInfo"
22
+		defaultLabel="请选择送货人员"
23
+		name="送货人员信息"
24
+		title="送货人员信息"
25
+		:selectData="selectData"
26
+		@click-tabs="clickTabs"
27
+		></popupSelectItemVue>
28
+      <view class="btn-box">
29
+        <button
30
+          type="primary"
31
+          class="send-goods"
32
+          v-if="goodsCustomType === 'sendGoods'"
33
+        >
34
+          发货
35
+        </button>
36
+        <button
37
+          type="primary"
38
+          class="send-goods"
39
+          v-if="goodsCustomType === 'pickup'"
40
+        >
41
+          自提
42
+        </button>
43
+      </view>
44
+    </view>
45
+  </view>
15 46
 </template>
16 47
 
17 48
 <script>
18
-	import shipmentGoodsCardVue from './components/shipmentGoodsCard.vue'
19
-	import orderDetailSendCardVue from './components/orderDetailSendCard.vue'
20
-	import fillLogisticsInfoVue from './components/fillLogisticsInfo.vue'
21
-	import headersVue from '../components/headers/headers.vue'
22
-	import reInputItemVue from './components/reInputItem/reInputItem.vue'
23
-	export default {
24
-		components:{shipmentGoodsCardVue,orderDetailSendCardVue,fillLogisticsInfoVue,headersVue,reInputItemVue},
25
-		data() {
26
-			return {
27
-				indexs: '',
28
-				status: '',
29
-				order_id: '', //订单ID
30
-				headerTitle:"发货",
31
-				shipmentGoodsTitle:"发货商品",
32
-				goodsCustomType:"sendGoods"
33
-			}
34
-		},
35
-		onLoad(e) {
36
-			this.order_id = e.order_id
37
-			this.indexs = e.indexs
38
-			this.status = e.status
39
-			this.goodsCustomType = e.goodsCustomType
40
-			this.headerTitle = this.goodsCustomType==="sendGoods"?"发货":'自提'
41
-			this.shipmentGoodsTitle = this.goodsCustomType==="sendGoods"?"发货商品":'自提商品'
42
-		},
43
-		methods: {
44
-			topgi(){
45
-               uni.redirectTo({
46
-					url: './order?status=' + this.status + '&index=' + this.indexs
47
-					// url: './order'
48
-				});
49
-			}
50
-		}
49
+import shipmentGoodsCardVue from "./components/shipmentGoodsCard.vue";
50
+import orderDetailSendCardVue from "./components/orderDetailSendCard.vue";
51
+import fillLogisticsInfoVue from "./components/fillLogisticsInfo.vue";
52
+import headersVue from "../components/headers/headers.vue";
53
+import reInputItemVue from "./components/reInputItem/reInputItem.vue";
54
+import popupSelectItemVue from "./components/popupSelectItem/popupSelectItem.vue";
55
+export default {
56
+  components: {
57
+    shipmentGoodsCardVue,
58
+    orderDetailSendCardVue,
59
+    fillLogisticsInfoVue,
60
+    headersVue,
61
+    reInputItemVue,
62
+	popupSelectItemVue
63
+  },
64
+  data() {
65
+    return {
66
+		selectData:[
67
+  { value: 0, text: "张伟" },
68
+  { value: 1, text: "王芳" },
69
+  { value: 2, text: "李强" },
70
+  { value: 3, text: "刘洋" },
71
+  { value: 4, text: "陈静" },
72
+  { value: 5, text: "杨勇" },
73
+  { value: 6, text: "黄丽" },
74
+  { value: 7, text: "周杰" },
75
+  { value: 8, text: "徐敏" },
76
+  { value: 9, text: "吴涛" },
77
+  { value: 10, text: "孙莉" },
78
+  { value: 11, text: "马强" },
79
+  { value: 12, text: "胡月" },
80
+  { value: 13, text: "林浩" },
81
+  { value: 14, text: "何婷" }
82
+],
83
+      indexs: "",
84
+      status: "",
85
+      order_id: "", //订单ID
86
+      headerTitle: "发货",
87
+      shipmentGoodsTitle: "发货商品",
88
+      goodsCustomType: "sendGoods",
89
+      headerTitleMap: {
90
+        deliverGoods: "送货",
91
+        sendGoods: "发货",
92
+        pickup: "自提",
93
+      },
94
+      shipmentGoodsTitleMap: {
95
+        deliverGoods: "发货商品",
96
+        sendGoods: "发货商品",
97
+        pickup: "自提商品",
98
+      },
99
+    };
100
+  },
101
+  onLoad(e) {
102
+    this.order_id = e.order_id;
103
+    this.indexs = e.indexs;
104
+    this.status = e.status;
105
+    this.goodsCustomType = e.goodsCustomType;
106
+    this.headerTitle = this.headerTitleMap[this.goodsCustomType];
107
+    this.shipmentGoodsTitle = this.shipmentGoodsTitleMap[this.goodsCustomType];
108
+  },
109
+  methods: {
110
+    topgi() {
111
+      uni.redirectTo({
112
+        url: "./order?status=" + this.status + "&index=" + this.indexs,
113
+        // url: './order'
114
+      });
115
+    },
116
+	clickTabs({ selected, item, index }){
117
+		console.log("clickTabs", selected, item, index)
51 118
 	}
119
+  },
120
+};
52 121
 </script>
53 122
 <style>
54
-	page {
55
-		background-color: #F7F8FC;
56
-	}
123
+page {
124
+  background-color: #f7f8fc;
125
+}
57 126
 </style>
58 127
 <style scoped lang="scss">
59
-	.order-send-out-goods{
60
-		width: 100%;
61
-		height: 100%;
62
-		display: flex;
63
-		flex-direction: column;
64
-		align-items: center;
65
-	&__content{
66
-		width: 100%;
67
-		margin: 130rpx 0 50rpx;
68
-		.btn-box{
69
-			width: 100%;
70
-			position: fixed;
71
-			
72
-           bottom:30rpx;
73
-		   .send-goods{
74
-			   margin:0 32rpx;
75
-		   }
76
-		}
77
-		
78
-	}
79
-	
80
-	.custom_class{
81
-		margin-top: 26rpx;
82
-	}
83
-	
84
-	
85
-	
86
-	}
87
-	
88
-	
89
-	.inputInfo{
90
-		margin-top:26rpx;
91
-		padding:0 26rpx;
92
-	}
128
+.order-send-out-goods {
129
+  width: 100%;
130
+  height: 100%;
131
+  display: flex;
132
+  flex-direction: column;
133
+  align-items: center;
134
+  &__content {
135
+    width: 100%;
136
+    margin: 130rpx 0 50rpx;
137
+    .btn-box {
138
+      width: 100%;
139
+      position: fixed;
140
+
141
+      bottom: 30rpx;
142
+      .send-goods {
143
+        margin: 0 32rpx;
144
+      }
145
+    }
146
+  }
93 147
 
148
+  .custom_class {
149
+    margin-top: 26rpx;
150
+  }
151
+}
94 152
 
153
+.inputInfo {
154
+  margin-top: 26rpx;
155
+  padding: 0 26rpx;
156
+}
95 157
 </style>