Browse Source

Merge branch 'master' of http://gits.hdlkeji.com:3000/qcf/wx-qhb

mabaoyi 8 months ago
parent
commit
b9df6155a7
2 changed files with 141 additions and 34 deletions
  1. 7 2
      pageB/delivery.vue
  2. 134 32
      pageB/end.vue

+ 7 - 2
pageB/delivery.vue

@@ -151,7 +151,7 @@
 				rightname: '',
 				container_id: '',
 				unit_price: '',
-				number:''
+				number: ''
 			}
 		},
 		onLoad(options) {
@@ -263,7 +263,12 @@
 					this.$u.toast('请勾选协议')
 				} else {
 					uni.navigateTo({
-						url: '/pageB/end'
+						url: "/pageB/end?goodinfo=" + encodeURIComponent(JSON.stringify(this.goodinfo)) +
+							"&topadd=" + encodeURIComponent(JSON.stringify(
+								this.topadd)) + "&bottom=" + encodeURIComponent(JSON.stringify(this.bottomadd)) +
+							'&leftname=' + this
+							.leftname + "&rightname=" + this.rightname + "&container_id=" + this.container_id +
+							"&unit_price=" + this.unit_price
 					})
 				}
 			}

+ 134 - 32
pageB/end.vue

@@ -6,8 +6,8 @@
 			<image src="/static/images/index/back.png"
 				style="width: 750rpx;height: 1200rpx;position: absolute;top: 0;z-index: -1;left:-24rpx;" mode="">
 			</image>
-			<u-navbar :autoBack='true' title='寄快递' bgColor="rgba(248, 50, 36, 0.2)" :placeholder='true' :safeAreaInsetTop="true"
-				style="position: absolute;z-index: 110;background-color: rgba(0,0,0,0);">
+			<u-navbar :autoBack='true' title='寄快递' bgColor="rgba(248, 50, 36, 0.2)" :placeholder='true'
+				:safeAreaInsetTop="true" style="position: absolute;z-index: 110;background-color: rgba(0,0,0,0);">
 				<view class="u-nav-slot" slot="left" style="display: flex;">
 					<u-icon name="arrow-left" color="rgba(0, 0, 0, 1)" size="24" @click="uni.navigateBack()"></u-icon>
 				</view>
@@ -16,29 +16,29 @@
 			<view class="mail">
 				<view class="u-flex u-row-around" style="margin-top: 40rpx;padding: 0 80rpx;">
 					<view class="flexc">
-						<view class="entrepotname">东莞仓库</view>
-						<view class="adda">陈盼盼</view>
+						<view class="entrepotname">{{topadd.full_address}}</view>
+						<view class="adda">{{topadd.name}}</view>
 					</view>
 					<image src="/pageB/static/images/arrows.png" style="width: 130rpx;height: 10rpx;" mode=""></image>
 					<view class="flexc">
-						<view class="entrepotname">澳大利亚</view>
-						<view class="adda">Curtis Morris</view>
+						<view class="entrepotname">{{bottomadd.full_address}}</view>
+						<view class="adda">{{bottomadd.name}}</view>
 					</view>
 				</view>
 				<view class="boxinfo">
 					<view class="">
 						<text class="abouta">{{i18n.typeof}}:</text>
-						<text class="abouta" style='color:rgba(34, 34, 34, 1)'>日用品</text>
+						<text class="abouta" style='color:rgba(34, 34, 34, 1)'>{{goodinfo.goodname}}</text>
 						<text class="abouta" style='margin:0 16rpx'>|</text>
 						<text class="abouta">{{i18n.weight}}:</text>
-						<text class="abouta" style='color:rgba(34, 34, 34, 1)'>30.00kg</text>
+						<text class="abouta" style='color:rgba(34, 34, 34, 1)'>{{goodinfo.weight}}kg</text>
 						<text class="abouta" style='margin:0 16rpx'>|</text>
 						<text class="abouta">{{i18n.number}}:</text>
-						<text class="abouta" style='color:rgba(34, 34, 34, 1)'>20件</text>
+						<text class="abouta" style='color:rgba(34, 34, 34, 1)'>{{goodinfo.number}}件</text>
 					</view>
 					<view class="" style="margin-top: 20rpx;">
 						<text class="abouta">{{i18n.flow}}:</text>
-						<text class="abouta" style='color:rgba(34, 34, 34, 1)'>{{i18n.Marinetank}}</text>
+						<text class="abouta" style='color:rgba(34, 34, 34, 1)'>{{rightname}}</text>
 					</view>
 				</view>
 			</view>
@@ -51,29 +51,46 @@
 					</view>
 					<view class=" u-row-between left"
 						style="flex: 1;margin-left: 28rpx;border-bottom:2rpx solid rgba(151, 151, 151, 0.08) ;display: flex;">
-						<view class="u-row-between " style="">
+						<view v-if="JSON.stringify(topadd)==='{}'" class="u-row-between " style="">
 							<view class="pople">{{i18n.sender}}</view>
 							<view class="jiadd" style="margin-top: 14rpx;">{{i18n.informat}}</view>
 						</view>
-						<view class="u-flex">
+						<view v-else class="u-row-between " style="" @click="send">
+							<view class="">
+								<text class="topname">{{topadd.name}}</text>
+								<text class="topaddress"
+									style="margin-left: 8rpx;">{{replacePhoneToStar(topadd.mobile)}}</text>
+							</view>
+							<view class="topaddress" style="margin-top: 14rpx;">{{topadd.full_address}}</view>
+						</view>
+						<view class="u-flex" @click.stop="addbook(0)">
 							<view class="" style="color: rgba(151, 151, 151, 1);">|</view>
 							<text class="right">{{i18n.addressbook}}</text>
 						</view>
 					</view>
 				</view>
 				<view class="left u-flex"
-					style="display: flex;margin-top: 26rpx;border-bottom:2rpx solid rgba(151, 151, 151, 0.08)" @click="recipe">
+					style="display: flex;margin-top: 26rpx;border-bottom:2rpx solid rgba(151, 151, 151, 0.08)"
+					@click="recipe">
 					<view class="u-row-between left" style="display: flex;flex-direction: column;">
 						<image src="/static/express/shou.png" style='width: 40rpx;;height:40rpx ;' mode=""></image>
 						<!-- <image src="../../static/express/change.png" style='width: 40rpx;;height:40rpx ;' mode=""> -->
 						</image>
 					</view>
 					<view class=" u-row-between left" style="flex: 1;margin-left: 28rpx;display: flex;">
-						<view class="u-row-between " style="">
+						<view v-if="JSON.stringify(bottomadd)==='{}'" class="u-row-between " style="">
 							<view class="pople">{{i18n.recipient}}</view>
 							<view class="jiadd" style="margin-top: 14rpx;">{{i18n.informat}}</view>
 						</view>
-						<view class="u-flex">
+						<view v-else class="u-row-between " style="" @click="send">
+							<view class="">
+								<text class="topname">{{bottomadd.name}}</text>
+								<text class="topaddress"
+									style="margin-left: 8rpx;">{{replacePhoneToStar(bottomadd.mobile)}}</text>
+							</view>
+							<view class="topaddress" style="margin-top: 14rpx;">{{bottomadd.full_address}}</view>
+						</view>
+						<view class="u-flex" @click.stop="addbook(1)">
 							<view class="" style="color: rgba(151, 151, 151, 1);">|</view>
 							<text class="right">{{i18n.addressbook}}</text>
 						</view>
@@ -118,11 +135,36 @@
 			return {
 				deal: -1,
 				checkboxValue1: [],
-				expname: ''
+				expname: '',
+				language: 'zh-CN',
+				goodinfo: {},
+				topadd: {},
+				bottomadd: {},
+				leftname: '',
+				rightname: '',
+				container_id: '',
+				unit_price: '',
+				number: '',
+				sum: ""
 			}
 		},
 		onLoad(options) {
-
+			this.goodinfo = JSON.parse(decodeURIComponent(options.goodinfo))
+			this.topadd = JSON.parse(decodeURIComponent(options.topadd))
+			this.bottomadd = JSON.parse(decodeURIComponent(options.bottom))
+			this.leftname = options.leftname
+			this.rightname = options.rightname
+			this.container_id = options.container_id
+			this.unit_price = options.unit_price
+			this.number = options.number
+			this.sum = Number(this.goodinfo.number) * Number(this.goodinfo.weight) * Number(this.unit_price)
+			console.log(this.goodinfo.number);
+			console.log(this.sum);
+		},
+		onShow() {
+			if (uni.getStorageSync('language') != '') {
+				this.language = uni.getStorageSync('language')
+			}
 		},
 		computed: {
 			i18n() {
@@ -130,6 +172,61 @@
 			}
 		},
 		methods: {
+			creatorder() {
+				uni.$u.http.post('/api/express-order/common-create', {
+					from_address_id: this.topadd.id, //1	是	String	寄件地址ID
+					to_address_id: this.bottomadd.id, //2	是	String	收件地址ID
+					container_id: this.container_id, //1	是	String	货柜ID
+					goods_name: this.goodinfo.name, //樱桃	是	String	商品信息名称
+					goods_num: this.goodinfo.number, //100	是	String	商品数量
+					goods_weight: this.goodinfo.weight, //20	是	String	商品重量
+					goods_length: '', //30	是	String	商品体积: 长
+					goods_width: '', //	40	是	String	商品体积: 宽
+					goods_height: '', //	237	是	String	商品体积: 高
+					goods_type: 'normal', //normal	是	String	商品类型: normal. 正常商品, special. 特殊商品
+				}).then((res) => {
+					uni.navigateTo({
+						url: '/pageA/payorder?sum=' + this.sum
+					})
+				}).catch(() => {
+
+				})
+			},
+			toexpress() {
+				uni.navigateTo({
+					url: '/pageB/expresstype',
+					events: {
+						todcp: (res) => {
+							this.expname = res
+						}
+					}
+				})
+			},
+			//正则匹配手机号
+			replacePhoneToStar: function(phone) {
+				if (phone) {
+					return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
+				}
+			},
+			//地址薄
+			addbook(index) {
+				var that = this
+				uni.navigateTo({
+					url: "/pageC/addressManagement/addressManagement?index=" + index,
+					events: {
+						getadd(res) {
+							if (index == 0) {
+								that.topadd = res
+								console.log('topadd', that.topadd);
+							} else {
+								that.bottomadd = res
+								console.log('bottom', that.bottomadd);
+								that.province_id = that.bottomadd.province_id
+							}
+						}
+					}
+				})
+			},
 			send() {
 				uni.navigateTo({
 					url: '/pageB/Senderinfor'
@@ -140,29 +237,34 @@
 					url: '/pageB/recipientinfo'
 				})
 			},
-			payorder(){
-				uni.navigateTo({
-					url:'/pageA/payorder'
-				})
-			},
 			checkboxChange(n) {
 				console.log('change', n);
 			},
-			toexpress() {
-				uni.navigateTo({
-					url: '/pageB/expresstype',
-					events: {
-						todcp: (res) => {
-							this.expname = res
-						}
-					}
-				})
-			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
+	.topname {
+		font-family: PingFangSC, PingFang SC;
+		font-weight: 500;
+		font-size: 30rpx;
+		color: #222222;
+		line-height: 42rpx;
+		text-align: left;
+		font-style: normal;
+	}
+
+	.topaddress {
+		font-family: PingFangSC, PingFang SC;
+		font-weight: 400;
+		font-size: 26rpx;
+		color: #777777;
+		line-height: 36rpx;
+		text-align: left;
+		font-style: normal;
+	}
+
 	.selection {
 		font-family: PingFangSC, PingFang SC;
 		font-weight: 400;