Browse Source

fix: 暂存

Hello小健 2 months ago
parent
commit
725ca9812f
2 changed files with 79 additions and 30 deletions
  1. 1 1
      pages/waybillDeliveryOrder/index.vue
  2. 78 29
      pages/waybillDeliveryOrder/orderInfo.vue

+ 1 - 1
pages/waybillDeliveryOrder/index.vue

@@ -5,7 +5,7 @@
 		<view class="item" v-for="(item, i) in waybillDelivery" :key="i" @click="itemClick(item)">
 			<view class="order-no">
 				<text>
-					{{ item.order_no }}
+					派送单号: {{ item.order_no }}
 				</text>
 				<image @click="copyOrderNo(item.order_no)" class="icon" src="/static/copy.png" mode="aspectFill" />
 			</view>

+ 78 - 29
pages/waybillDeliveryOrder/orderInfo.vue

@@ -1,5 +1,53 @@
 <template>
-	<view>
+	<view class="info">
+		<view class="order-no">
+			<text>派送单号: {{ item.order_no }}</text>
+			<image @click="copyString(item.order_no)" class="icon" src="/static/copy.png" mode="aspectFill" />
+		</view>
+		<view class="box-card">
+			<view class="label-icon">
+				<text class="label-title">地址信息</text>
+			</view>
+			<view class="label-content">
+				<text>
+					{{ item!.address.first_name + ' ' + item!.address.last_name }}
+					<br />
+				</text>
+				<text v-if="item!.address.mobile">
+					+{{ item!.address.mobile_code + ' ' + item!.address.mobile }}
+					<br />
+				</text>
+				<text v-if="item!.address.email">
+					{{ item!.address.email }}
+					<br />
+				</text>
+				<text>
+					{{ item!.address.address_line_1 }}
+					<br />
+				</text>
+				<text v-if="item!.address.address_line_2">
+					{{ item!.address.address_line_2 }}
+					<br />
+				</text>
+				<text v-if="item!.address.address_line_3">
+					{{ item!.address.address_line_3 }}
+					<br />
+				</text>
+				<text>
+					{{ item!.address.city + ' ' + item!.address.district }}
+					<br />
+				</text>
+				<text>
+					{{ item!.address.province }}
+					<br />
+				</text>
+				<text>
+					{{ item!.address.zip_code }}
+					<br />
+				</text>
+			</view>
+		</view>
+
 		<uni-popup ref="messageRef" type="message">
 			<uni-popup-message :type="messageType" :message="messageText" :duration="2000"></uni-popup-message>
 		</uni-popup>
@@ -16,38 +64,39 @@ const waybillDelivery = ref([]);
 const messageType = ref();
 const messageText = ref();
 const messageRef = ref();
-const selectItem = ref();
+const item = ref();
 
-// const getInfo = (id: any) => {
-// 	loading.value = true;
-// 	uni.request({
-// 		url: pickupWaybillDeliveryOrderURL + '/edit?id=' + id,
-// 		method: 'GET',
-// 		header: {
-// 			batoken: token.value
-// 		},
-// 		success: ({ data }: any) => {
-// 			loading.value = false;
-// 			console.log(data);
-// 			if (data.code == 1) {
-// 				waybillDelivery.value = data.data.list;
-// 			} else {
-// 				messageType.value = 'error';
-// 				messageText.value = data.msg;
-// 				messageRef.value.open();
-// 			}
-// 		},
-// 		fail: (err) => {
-// 			loading.value = false;
-// 		}
-// 	});
-// };
 onLoad((query) => {
 	token.value = uni.getStorageSync('token');
-	selectItem.value = uni.getStorageSync('selectItem');
-
+	item.value = uni.getStorageSync('selectItem');
+	console.log(item.value);
 	// getInfo(query.id);
 });
+
+const copyString = (str: string) => {
+	uni.setClipboardData({
+		data: str,
+		success: function () {
+			uni.showToast({
+				title: '复制成功',
+				icon: 'success',
+				duration: 2000
+			});
+		},
+		fail: function () {
+			console.log('复制失败');
+		}
+	});
+};
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.info {
+	padding: 20rpx;
+	.icon {
+		margin-left: 5rpx;
+		width: 24rpx;
+		height: 24rpx;
+	}
+}
+</style>