lalala 6 anni fa
parent
commit
f49ce7b931

+ 134 - 101
mobile-code/src/components/app-delivery.vue

@@ -8,7 +8,7 @@
 				<input v-model="form.receiveUserName" placeholder-class="phcolor" class="tui-input" name="receiveUserName" placeholder="请输入姓名" />
 			</tui-list-cell>
 			<tui-list-cell class="line-cell" :hover="false">
-				<div class="tui-title">电话</div>
+				<div class="tui-title">收花人电话</div>
 				<input v-model="form.receiveMobile" placeholder-class="phcolor" class="tui-input" name="receiveMobile" placeholder="请输入电话" type="number" />
 			</tui-list-cell>
 			<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="openAddres">
@@ -69,9 +69,17 @@
 					</div>
 				</div>
 			</tui-list-cell>
+			<block v-if="form.anonymous">
+				<tui-list-cell class="line-cell" :hover="false">
+					<div class="none-name-delivery flex-center">
+						<checkbox class="ljd-checkbox" @change="anonymityChange"></checkbox>
+						<span class="none-name-text">匿名派送</span>
+					</div>
+				</tui-list-cell>
+			</block>
 		</div>
 		<!-- 备注 -->
-		<div class="module-com">
+		<div class="module-com remark-wrap">
 			<tui-list-cell class="line-cell" :hover="false">
 				<div class="tui-title">备注</div>
 				<input v-model="form.remark" placeholder-class="phcolor" class="tui-input" name="remark" placeholder="(选填)" />
@@ -85,114 +93,126 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
-import TuiListCell from '@/components/plugin/list-cell'
-import AppDatePicker from '@/components/app-date-picker'
-// import AppTextarea from '@/components/app-textarea'
-import SimpleAddress from '@/components/plugin/simple-address'
-import AppAreaSel from '@/components/app-area-sel'
-export default {
-	name: 'app-delivery-module',
-	components: {
-		AppAreaSel,
-		TuiListCell,
-		AppDatePicker,
-		// AppTextarea,
-		SimpleAddress
-	},
-	data() {
-		return {
-			region: [],
-			showRegion: false,
-			form: {
-				receiveUserName: '', // 收花人姓名;到店自提的姓名
-				receiveMobile: '', // 收花人手机;到店自提的电话;
-				receiveProvince: '', // 收花人省份
-				receiveCity: '', // 收花人城市
-				receiveAddress: '', // 收花人城市
-				receiveFloor: '', // 收花人门楼号和牌号
-				receiveFullAddress: '', // 收花人完整地址,从腾讯地图接口获取
-				// bookName: '', // 订花人姓名
-				bookMobile: '', // 订花人手机号
-				reachTime: 0, // 配送时间
-				reachPeriod: '0', // 配送时段,0上午1下午2晚上
-				needCard: '1', // 是否要贺卡 0不要 1要
-				cardInfo: '', // 贺卡信息
-				remark: '' // 备注
-			},
-			region: {
-				latitude: 0,
-				longitude: 0
-			},
-			// 省市联动
-			cityPickerValueDefault: [0, 0]
-			// pickerText: ''
-		}
-	},
-	computed: {
-		...mapGetters({ orderShop: 'getOrderShop' })
-		// regionArr() {
-		// 	return this.$util.isEmpty(this.orderShop) ? [] : this.orderShop.region
-		// }
-	},
-	watch: {
-		orderShop(val) {
-			console.log('val', val)
-			this.form.receiveProvince = val.shop.shopProvince ? val.shop.shopProvince : ''
-			this.form.receiveCity = val.shop.shopCity ? val.shop.shopCity : ''
-		}
-	},
-	mounted() {
-		if (!this.$util.isEmpty(this.orderShop)) {
-			this.form.receiveProvince = this.orderShop.shop.shopProvince ? this.orderShop.shop.shopProvince : ''
-			this.form.receiveCity = this.orderShop.shop.shopCity ? this.orderShop.shop.shopCity : ''
-		}
-	},
-	methods: {
-		selTimeFn(e) {
-			this.form.reachTime = e.detail.value
+	import { mapGetters } from 'vuex'
+	import TuiListCell from '@/components/plugin/list-cell'
+	import AppDatePicker from '@/components/app-date-picker'
+	// import AppTextarea from '@/components/app-textarea'
+	import SimpleAddress from '@/components/plugin/simple-address'
+	import AppAreaSel from '@/components/app-area-sel'
+	export default {
+		name: 'app-delivery-module',
+		components: {
+			AppAreaSel,
+			TuiListCell,
+			AppDatePicker,
+			// AppTextarea,
+			SimpleAddress
 		},
-		// 选择地址
-		selRegionFn() {
-			if (!this.form.receiveCity) {
-				this.$msg('请先选择地址!')
-				return false
+		props: {
+			anonymous: {
+				type: Boolean,
+				default: false
 			}
-			this.showRegion = true
-			// let that = this
-			// uni.chooseLocation({
-			// 	success: res => {
-			// 		this.form.receiveFullAddress = res.address
-			// 		this.region.latitude = res.latitude
-			// 		this.region.longitude = res.longitude
-			// 	}
-			// })
 		},
-		changeAreaFn(e) {
-			console.log('changeAreaFn', e)
-			this.form.receiveFullAddress = e.address
-			this.region.latitude = e.location.lat
-			this.region.longitude = e.location.lng
+		data() {
+			return {
+				region: [],
+				showRegion: false,
+				form: {
+					receiveUserName: '', // 收花人姓名;到店自提的姓名
+					receiveMobile: '', // 收花人手机;到店自提的电话;
+					receiveProvince: '', // 收花人省份
+					receiveCity: '', // 收花人城市
+					receiveAddress: '', // 收花人城市
+					receiveFloor: '', // 收花人门楼号和牌号
+					receiveFullAddress: '', // 收花人完整地址,从腾讯地图接口获取
+					// bookName: '', // 订花人姓名
+					bookMobile: '', // 订花人手机号
+					reachTime: 0, // 配送时间
+					reachPeriod: '0', // 配送时段,0上午1下午2晚上
+					needCard: '1', // 是否要贺卡 0不要 1要
+					cardInfo: '', // 贺卡信息
+					remark: '' // 备注
+				},
+				region: {
+					latitude: 0,
+					longitude: 0
+				},
+				// 省市联动
+				cityPickerValueDefault: [0, 0]
+				// pickerText: ''
+			}
 		},
-		// -----
-		timeTodaySelFn(index) {
-			this.form.reachPeriod = index
+		computed: {
+			...mapGetters({ orderShop: 'getOrderShop' })
+			// regionArr() {
+			// 	return this.$util.isEmpty(this.orderShop) ? [] : this.orderShop.region
+			// }
 		},
-		needCardChange() {
-			this.form.needCard = this.form.needCard == 1 ? 0 : 1
+		watch: {
+			orderShop(val) {
+				console.log('val', val)
+				this.form.receiveProvince = val.shop.shopProvince ? val.shop.shopProvince : ''
+				this.form.receiveCity = val.shop.shopCity ? val.shop.shopCity : ''
+			}
 		},
-		// 省市联动
-		openAddres() {
-			this.$refs.simpleAddress.open()
+		mounted() {
+			if (!this.$util.isEmpty(this.orderShop)) {
+				this.form.receiveProvince = this.orderShop.shop.shopProvince ? this.orderShop.shop.shopProvince : ''
+				this.form.receiveCity = this.orderShop.shop.shopCity ? this.orderShop.shop.shopCity : ''
+			}
+			if (this.anonymous) {
+				this.form.anonymous = '0'
+			}
 		},
-		onCityConfirm(e) {
-			this.form.receiveAddress = e.label
-			this.form.receiveProvince = e.provinceName
-			this.form.receiveCity = e.cityName
-			// this.pickerText = JSON.stringify(e)
+		methods: {
+			selTimeFn(e) {
+				this.form.reachTime = e.detail.value
+			},
+			// 选择地址
+			selRegionFn() {
+				if (!this.form.receiveCity) {
+					this.$msg('请先选择地址!')
+					return false
+				}
+				this.showRegion = true
+				// let that = this
+				// uni.chooseLocation({
+				// 	success: res => {
+				// 		this.form.receiveFullAddress = res.address
+				// 		this.region.latitude = res.latitude
+				// 		this.region.longitude = res.longitude
+				// 	}
+				// })
+			},
+			changeAreaFn(e) {
+				console.log('changeAreaFn', e)
+				this.form.receiveFullAddress = e.address
+				this.region.latitude = e.location.lat
+				this.region.longitude = e.location.lng
+			},
+			// -----
+			timeTodaySelFn(index) {
+				this.form.reachPeriod = index
+			},
+			needCardChange() {
+				this.form.needCard = this.form.needCard == 1 ? 0 : 1
+			},
+			anonymityChange() {
+				this.form.anonymous = this.form.anonymous == 1 ? 0 : 1
+			},
+			// 省市联动
+			openAddres() {
+				this.$refs.simpleAddress.open()
+			},
+			onCityConfirm(e) {
+				this.form.receiveAddress = e.label
+				this.form.receiveProvince = e.provinceName
+				this.form.receiveCity = e.cityName
+				// this.pickerText = JSON.stringify(e)
+			}
 		}
 	}
-}
 </script>
 
 <style lang="scss" scoped>
@@ -252,5 +272,18 @@ export default {
 				margin-top: 40px;
 			}
 		}
+
+		// 匿名派送
+		.none-name-delivery {
+			// padding-left: 30px;
+			// padding: 26px 30px;
+			// margin-top: 40px;
+			margin-bottom: 20px;
+			background-color: #fff;
+			.none-name-text {
+				margin-left: 14px;
+				color: $fontColor2;
+			}
+		}
 	}
 </style>

+ 5 - 4
mobile-code/src/pages/pay/index.vue

@@ -55,15 +55,15 @@
 			</div>
 			<!-- 查看更多 -->
 			<block v-if="tabIndex == 1">
-				<app-delivery-module ref="appDelivery" />
+				<app-delivery-module ref="appDelivery" :anonymous="true" />
 			</block>
 			<!-- 匿名派送 -->
-			<block v-if="tabIndex == 1">
+			<!-- <block v-if="tabIndex == 1">
 				<div class="none-name-delivery flex-center">
 					<checkbox class="ljd-checkbox" @change="anonymityChange"></checkbox>
 					<span class="none-name-text">匿名派送</span>
 				</div>
-			</block>
+			</block> -->
 			<!-- 可选优惠 -->
 			<div class="module-com discount-wrap" v-if="!$util.isEmpty(shopUser) && shopUser.userAsset.member && shopUser.userAsset.getCouponNum">
 				<div class="module-tit">可选优惠</div>
@@ -149,7 +149,7 @@
 					payPassword: ''
 				},
 				appendFrm: {
-					anonymity: '0', // 是否匿名 0不 1要
+					// anonymity: '0', // 是否匿名 0不 1要
 					sendDistance: '', // 配送距离,根据腾讯js进行计算
 					// goodsId: '', // 【商城下单特有字段】商品id
 					// goodsStyleId: '', // 【商城下单特有字段】商品款式id
@@ -401,6 +401,7 @@
 			// padding-left: 30px;
 			padding: 26px 30px;
 			// margin-top: 40px;
+			margin-bottom: 20px;
 			background-color: #fff;
 			.none-name-text {
 				margin-left: 14px;

+ 7 - 7
mobile-code/src/static/css/reset.scss

@@ -124,13 +124,13 @@ image {
 }
 
 // 支付页样式修改
-.pay-wrap {
-    .delivery-wrap {
-        .gift-wrap {
-            margin-bottom: 0 !important;
-        }
-    }
-}
+// .pay-wrap {
+//     .delivery-wrap {
+//         .remark-wrap {
+//             margin-bottom: 0 !important;
+//         }
+//     }
+// }
 
 uni-button::after {
     border: none;