shish 3 лет назад
Родитель
Сommit
c16cecb7fa

+ 1 - 1
mallApp/src/api/order/index.js

@@ -1,6 +1,6 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 import https from '@/plugins/luch-request_0.0.7/request'
 
 
-export const freight = async data => {
+export const freight = data => {
 	return https.get("/order/freight", data);
 	return https.get("/order/freight", data);
 };
 };
 
 

+ 0 - 23
mallApp/src/components/app-delivery.vue

@@ -41,11 +41,6 @@
 						<view class="uni-input" style="width:450upx;">{{form.reachPeriod}}<text style="margin-left:10upx;">前</text></view>
 						<view class="uni-input" style="width:450upx;">{{form.reachPeriod}}<text style="margin-left:10upx;">前</text></view>
 					</picker>
 					</picker>
       </tui-list-cell>
       </tui-list-cell>
-
-      <tui-list-cell class="line-cell" :hover="false">
-        <div class="tui-title">订花人电话</div>
-        <input v-model="form.bookMobile" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="bookMobile" placeholder="有问题方便联系您" type="number" />
-      </tui-list-cell>
     </div>
     </div>
 
 
     <div class="module-com gift-wrap input-line-wrap">
     <div class="module-com gift-wrap input-line-wrap">
@@ -126,7 +121,6 @@ export default {
         address: "", // 收花人城市
         address: "", // 收花人城市
         floor: "", // 收花人门楼号和牌号
         floor: "", // 收花人门楼号和牌号
         showAddress: "", // 收花人完整地址,从腾讯地图接口获取
         showAddress: "", // 收花人完整地址,从腾讯地图接口获取
-        bookMobile: "", // 订花人手机号
         reachDate: "", // 配送时间
         reachDate: "", // 配送时间
         reachPeriod: "12:00", // 配送时段,0上午1下午2晚上
         reachPeriod: "12:00", // 配送时段,0上午1下午2晚上
         cardInfo: "", // 贺卡信息
         cardInfo: "", // 贺卡信息
@@ -202,23 +196,6 @@ export default {
       this.form.address = e.label;
       this.form.address = e.label;
       this.form.province = e.provinceName;
       this.form.province = e.provinceName;
       this.form.city = e.cityName;
       this.form.city = e.cityName;
-    },
-    // 获取微信手机号
-    getWxMobile(e) {
-      if (e.detail.errMsg === "getPhoneNumber:ok") {
-        getWxPhone({
-          iv: e.detail.iv,
-          encryptedData: e.detail.encryptedData
-        }).then(res => {
-          console.log("用户信息", res);
-          uni.showToast({
-            icon: "success"
-          });
-          this.form.bookMobile = res.data.mobile;
-        });
-      } else {
-        this.$msg("获取信息失败!");
-      }
     }
     }
   }
   }
 };
 };

+ 81 - 53
mallApp/src/pages/billing/affirmGhs.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
-	<view class="affirm-page">
-		<view class="affirm-view overscroll">
+	<view class="app-main app-content">
+		<view class="affirm-view">
 			<form>
 			<form>
 				<view class="module-com">
 				<view class="module-com">
 					<view class="commodity-view">
 					<view class="commodity-view">
@@ -81,25 +81,36 @@
 						<text style="color: #3385FF">¥{{ modifyPrice }}</text>
 						<text style="color: #3385FF">¥{{ modifyPrice }}</text>
 					</tui-list-cell>
 					</tui-list-cell>
 
 
-					<tui-list-cell class="line-cell" :hover="false" :arrow="true">
-						<view class="tui-title ">配送时间</view>
-						<picker mode="date" :value="sendTimeWant" @change="bindDateChange" style="width:400upx;">
-						<view class="uni-input">{{sendTimeWant || '今天'}}</view>
+					<tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="form.sendType == 2">
+						<view class="tui-title ">配送日期</view>
+						<picker mode="date" :value="form.reachDate" @change="selTimeFn" class="tui-input">
+						<div v-if="form.reachDate">{{ form.reachDate }}</div>
+						<div v-else>今天</div>
+						</picker>
+					</tui-list-cell>
+
+					<tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="form.sendType == 2">
+						<div class="tui-title">配送时间</div>
+						<picker mode="multiSelector" :value="form.reachPeriod" :range="timeOptions" @change="bindTimeChange">
+							<view class="uni-input" style="width:450upx;">{{form.reachPeriod}}<text style="margin-left:10upx;">前</text></view>
 						</picker>
 						</picker>
 					</tui-list-cell>
 					</tui-list-cell>
 
 
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false">
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false">
-						<textarea style="height: 100upx" v-model="remark" placeholder="这里写备注"/>
+						<textarea style="height: 100upx" v-model="form.remark" placeholder="这里写备注"/>
 					</tui-list-cell>
 					</tui-list-cell>
 
 
 				</view>
 				</view>
 
 
 			</form>
 			</form>
+			
 		</view>
 		</view>
+
 		<view class="under-bar">
 		<view class="under-bar">
 			<view class="price-view"> </view>
 			<view class="price-view"> </view>
 			<button class="admin-button-com blue middle" style="border:none;height:68upx;margin-right:38upx;" @click="confirmForm">提交</button>
 			<button class="admin-button-com blue middle" style="border:none;height:68upx;margin-right:38upx;" @click="confirmForm">提交</button>
 		</view>
 		</view>
+
 	</view>
 	</view>
 </template>
 </template>
 <script>
 <script>
@@ -109,7 +120,7 @@ import { buyItem,freight } from "@/api/order"
 import { currentInfo } from "@/api/user"
 import { currentInfo } from "@/api/user"
 import { mapActions, mapGetters } from "vuex";
 import { mapActions, mapGetters } from "vuex";
 export default {
 export default {
-	name: "BillingAffirm",
+	name: "affirmGhs",
 	components: {
 	components: {
 		TuiListCell
 		TuiListCell
 	},
 	},
@@ -121,36 +132,34 @@ export default {
 			autoLoad: false,
 			autoLoad: false,
 			ghsInfo:'',
 			ghsInfo:'',
 			sendTimeWant:'',
 			sendTimeWant:'',
-			remark:'',
 			form: {
 			form: {
-				debt:1,
-				shopId: "",
-				shopName: "",
-				receiveProvince: "",
-				receiveCity: "",
-				receiveFloor: "",
-				receiveAddress: "",
-				receiveLong: "",
-				receiveLat: "",
+				reachDate: "",
+				reachPeriod: "12:00",
+				province: "",
+				city: "",
+				floor: "",
+				address: "",
+				long: "",
+				lat: "",
 				sendType: 2,
 				sendType: 2,
-				sendSide: "2",
-				sendDate: "",
-				sendTimeWant: "",
-				sendCost: "",
-				customId: "",
-				product: "",
-				packCost:0
+				remark:'',
+				packCost:0,
+				sendCost:0,
+				showAddress:''
 			},
 			},
 			showCustomer: false,
 			showCustomer: false,
 			today:'',
 			today:'',
 			monthLater:'',
 			monthLater:'',
-			modifyPrice:0,
 			userInfo:{
 			userInfo:{
 				lat:'',
 				lat:'',
 				long:'',
 				long:'',
 				fullAddress:'',
 				fullAddress:'',
 				showAddress:''
 				showAddress:''
-			}
+			},
+      		timeOptions: [
+				['00', '01', '02','03','04','05','06','07','08','09','10','11','12','13', '14','15','16','17','18','19','20','21','22','23'],
+				['00', '05', '10','15','20','25','30','35','40','45','50','55']
+		  	]
 		};
 		};
 	},
 	},
 	onShow() {
 	onShow() {
@@ -174,23 +183,53 @@ export default {
 			}
 			}
 		}
 		}
 		this.list = list
 		this.list = list
-		this.calcPrice()
+
+		this.getUserInfo()
+
 	},
 	},
 	computed: {
 	computed: {
-		...mapGetters(["getLoginInfo"])
+		...mapGetters(["getLoginInfo"]),
+		modifyPrice(){
+			let price = this.allPrice.toFixed(2)
+			if(this.form.sendType == 2){
+				let sendCost = parseFloat(Number(this.form.sendCost))
+				price = Number(price) + Number(sendCost)
+			}
+			price = parseFloat(price)
+			return price
+		},
 	},
 	},
 	methods: {
 	methods: {
 		...mapActions(["initMerchantInfo"]),
 		...mapActions(["initMerchantInfo"]),
+		selTimeFn(e) {
+			this.form.reachDate = e.detail.value;
+		},
+		bindTimeChange(event){
+			let val = event.detail.value
+			let before = Number(val[0])
+			let after = Number(val[1])
+			let timeOptions = this.timeOptions
+			this.form.reachPeriod = timeOptions[0][before]+':'+timeOptions[1][after]
+		},
 		init(){
 		init(){
-			this.calcFreight()
-
+			this.getUserInfo()
+		},
+		getUserInfo(){
 			currentInfo().then(res=>{
 			currentInfo().then(res=>{
 				let that = this
 				let that = this
 				if(res.code == 1){
 				if(res.code == 1){
 					that.userInfo = res.data.info
 					that.userInfo = res.data.info
+					that.form.province = that.userInfo.province
+					that.form.city = that.userInfo.city
+					that.form.floor = that.userInfo.floor
+					that.form.address = that.userInfo.address
+					that.form.long = that.userInfo.long
+					that.form.lat = that.userInfo.lat
+					that.form.showAddress = that.userInfo.showAddress
+
+					that.calcSendCost()
 				}
 				}
 			})
 			})
-
 		},
 		},
 		modifyAddress(){
 		modifyAddress(){
       		this.$util.pageTo({ url: '/pages/user/modify'})
       		this.$util.pageTo({ url: '/pages/user/modify'})
@@ -199,10 +238,11 @@ export default {
 			this.form.sendType = num
 			this.form.sendType = num
 			if(num == 2){
 			if(num == 2){
 				//计算运费
 				//计算运费
-				this.calcFreight()
+				this.calcSendCost()
 			}
 			}
 		},
 		},
-		calcFreight() {
+		calcSendCost() {
+			let that = this
 			let weight = 0
 			let weight = 0
 			if(!this.$util.isEmpty(this.selectList)){
 			if(!this.$util.isEmpty(this.selectList)){
 				this.selectList.forEach((item,idx,arr) => {
 				this.selectList.forEach((item,idx,arr) => {
@@ -217,24 +257,13 @@ export default {
 				})
 				})
 			}
 			}
 			weight = Number(weight).toFixed(2)
 			weight = Number(weight).toFixed(2)
-
-			let params = {
-				account: this.options.account,
-				weight:weight
-			};
-			freight(params).then(res => {
+			freight({weight:weight,lat:that.userInfo.lat,long:that.userInfo.long}).then(res => {
 				if(res.code == 1){
 				if(res.code == 1){
-					this.form.sendCost = res.data.fee?parseFloat(res.data.fee):0
+					that.form.sendCost = res.data.fee?parseFloat(Number(res.data.fee)):0
 				}
 				}
 			});
 			});
 		},
 		},
-		calcPrice(){
-			let allPrice = this.allPrice.toFixed(2)
-			this.modifyPrice = Number(allPrice)
-			this.modifyPrice = parseFloat(this.modifyPrice)
-		},
 		confirmForm() {
 		confirmForm() {
-			let that = this
 			const product = this.selectList.map(ele => {
 			const product = this.selectList.map(ele => {
 				let unitType = 0
 				let unitType = 0
 				let num = ele.bigCount
 				let num = ele.bigCount
@@ -244,7 +273,7 @@ export default {
 				}
 				}
 				return { productId: ele.id, num:num,ptItemId:ele.itemId,property:1,unitType:unitType,property:1};
 				return { productId: ele.id, num:num,ptItemId:ele.itemId,property:1,unitType:unitType,property:1};
 			});
 			});
-			let params = { product: JSON.stringify(product),sendType:that.form.sendType }
+			let params = { product: JSON.stringify(product),...this.form }
 			if(this.$util.isEmpty(this.userInfo.lat) || this.$util.isEmpty(this.userInfo.long)){
 			if(this.$util.isEmpty(this.userInfo.lat) || this.$util.isEmpty(this.userInfo.long)){
 				this.$msg('请完善地址')
 				this.$msg('请完善地址')
 				return false
 				return false
@@ -269,15 +298,12 @@ export default {
 .admin-button-com {
 .admin-button-com {
 	margin-right: 20upx;
 	margin-right: 20upx;
 }
 }
-.affirm-page {
-	position: relative;
-	height: 100%;
-	display: flex;
-	flex-direction: column;
+.app-content {
 	.affirm-view {
 	.affirm-view {
 		flex: 1;
 		flex: 1;
 		padding: 20upx;
 		padding: 20upx;
 		background-color: #f0f2f6;
 		background-color: #f0f2f6;
+		margin-bottom:90upx;
 		.commodity-view {
 		.commodity-view {
 			display: flex;
 			display: flex;
 			flex-direction: column;
 			flex-direction: column;
@@ -393,6 +419,8 @@ export default {
 		}
 		}
 	}
 	}
 	.under-bar {
 	.under-bar {
+		position:fixed;
+		bottom:0upx;
 		display: flex;
 		display: flex;
 		justify-content: space-between;
 		justify-content: space-between;
 		align-items: center;
 		align-items: center;

+ 7 - 34
mallApp/src/pages/login/index.vue

@@ -5,14 +5,15 @@
         <view class="module-com input-line-wrap">
         <view class="module-com input-line-wrap">
           <view class="prompt-text" style="padding-top:20upx;margin-bottom:20upx;font-size:30upx;" >按以下操作进行登录:</view>
           <view class="prompt-text" style="padding-top:20upx;margin-bottom:20upx;font-size:30upx;" >按以下操作进行登录:</view>
           <tui-list-cell class="line-cell" :hover="false">
           <tui-list-cell class="line-cell" :hover="false">
-            <view class="tui-title" style="width:120upx;">手机号</view>
-            <view style="width:400upx;">{{form.mobile}}</view>
-            <button class="admin-button-com blue middle" style="border:none;" open-type="getPhoneNumber" @getphonenumber="getWxMobile" >帮我填</button>
+            <view class="tui-title" style="width:120upx;">昵称</view>
+            <input v-model="form.name" placeholder-class="phcolor" class="tui-input" name="name" placeholder="请输入昵称" maxlength="50" type="text" />
           </tui-list-cell>
           </tui-list-cell>
           <tui-list-cell class="line-cell" :hover="false">
           <tui-list-cell class="line-cell" :hover="false">
-            <view class="tui-title" style="width:120upx;">昵称</view>
-            <view style="width:400upx;">{{form.name}}</view>
-            <button class="admin-button-com blue middle" style="border:none;" @click="getWxAvatar" >帮我填</button>
+            <view class="tui-title" style="width:120upx;">手机号</view>
+            <view style="width:400upx;verticle-align:middle">
+              <button class="admin-button-com blue mini-btn" style="border:none;" open-type="getPhoneNumber" @getphonenumber="getWxMobile" >点击自动填写</button>
+              <text style="margin-left:5upx;">{{form.mobile}}</text>
+            </view>
           </tui-list-cell>
           </tui-list-cell>
           <view class="btn-wrap">
           <view class="btn-wrap">
             <button class="admin-button-com blue big" style="border:none;" formType="submit">登录</button>
             <button class="admin-button-com blue big" style="border:none;" formType="submit">登录</button>
@@ -68,7 +69,6 @@ export default {
             }else{
             }else{
               that.$util.pageTo({url: "/pages/login/result",type:2})
               that.$util.pageTo({url: "/pages/login/result",type:2})
             }
             }
-            
           }
           }
         }
         }
       })
       })
@@ -118,33 +118,6 @@ export default {
       } else {
       } else {
         this.$msg("获取手机失败");
         this.$msg("获取手机失败");
       }
       }
-    },
-    getWxAvatar() {
-		let currentMiniOpenId = uni.getStorageSync('miniOpenId')
-		uni.getUserProfile({
-			desc:'登录',
-			success:(res)=>{
-				getWxInfo({ iv: res.iv, encryptedData: res.encryptedData,miniOpenId:currentMiniOpenId }).then( subRes => {
-
-						if(subRes.data && subRes.data.hasNoOpenId && subRes.data.hasNoOpenId == 1){
-							uni.showModal({
-								title: '提示',
-								content: '网络异常,请重试一次',
-								success: function (res) {
-									if (res.confirm) {
-										console.log('用户点击确定')
-									}
-								}
-							})
-							return false
-						}
-						this.form.name = subRes.data.nickName
-						uni.showToast({ title:'获取成功', icon: "success" })
-
-					}
-				)
-			}
-		})
     }
     }
   }
   }
 };
 };

+ 6 - 28
mallApp/src/pages/order/buy.vue

@@ -22,14 +22,6 @@
       <block v-if="form.sendType == 2">
       <block v-if="form.sendType == 2">
         <app-delivery-module ref="appDelivery" @changeAddress="changeAddress" />
         <app-delivery-module ref="appDelivery" @changeAddress="changeAddress" />
       </block>
       </block>
-      <block v-if="form.sendType == 1">
-				<view class="module-com input-line-wrap">
-					<tui-list-cell class="line-cell" :hover="false">
-					<view class="tui-title">手机号</view>
-					<input v-model="bookMobile" placeholder-class="phcolor" class="tui-input" name="bookMobile" placeholder="请输入手机号" maxlength="50" type="text" />
-					</tui-list-cell>
-        </view>
-      </block>
 
 
       <view class="module-com input-line-wrap" v-if="form.sendType == 2">
       <view class="module-com input-line-wrap" v-if="form.sendType == 2">
         <tui-list-cell class="line-cell" :hover="false">
         <tui-list-cell class="line-cell" :hover="false">
@@ -92,9 +84,9 @@ export default {
         goodsStyleId: "",
         goodsStyleId: "",
         goodsNum: "",
         goodsNum: "",
         couponId: "0",
         couponId: "0",
-        receiveLat: "",
-        receiveLong: "",
-        sendType:2
+        sendType:2,
+        lat:'',
+        long:''
       },
       },
       discountArr: false,
       discountArr: false,
       freightPrice: 0,
       freightPrice: 0,
@@ -102,8 +94,7 @@ export default {
       showDistance: 0,
       showDistance: 0,
       goodsTotalPrice: 0,
       goodsTotalPrice: 0,
       memberDiscount: 1,
       memberDiscount: 1,
-      couponDiscountAmount: 0,
-      bookMobile:''
+      couponDiscountAmount: 0
     };
     };
   },
   },
   mounted() {},
   mounted() {},
@@ -144,6 +135,8 @@ export default {
     changeAddress() {
     changeAddress() {
       let lat = this.$refs.appDelivery.region.latitude;
       let lat = this.$refs.appDelivery.region.latitude;
       let long = this.$refs.appDelivery.region.longitude;
       let long = this.$refs.appDelivery.region.longitude;
+      this.form.lat = lat
+      this.form.long = long
       getUserDistance({ lat: lat, lng: long }).then(res => {
       getUserDistance({ lat: lat, lng: long }).then(res => {
         this.freightPrice = res.data.fee?parseFloat(res.data.fee):0;
         this.freightPrice = res.data.fee?parseFloat(res.data.fee):0;
         this.showDistance = res.data.showDistance;
         this.showDistance = res.data.showDistance;
@@ -171,21 +164,6 @@ export default {
           this.$msg("请填写地址");
           this.$msg("请填写地址");
           return false;
           return false;
         }
         }
-        let bookMobile = form.bookMobile;
-        if (this.$util.isEmpty(bookMobile)) {
-          this.$msg("请填写订花人电话");
-          return false;
-        }
-      }else{
-        if(this.$util.isEmpty(this.bookMobile)){
-          this.$msg('请填写手机号')
-          return false;
-        }
-        if(this.$util.checkMobile(this.bookMobile) == false){
-          this.$msg('手机号填写错误')
-          return false;
-        }
-        form = {bookMobile:this.bookMobile}
       }
       }
       uni.showLoading({mask:true})
       uni.showLoading({mask:true})
       createOrder({...form, ...this.form}).then(res => {
       createOrder({...form, ...this.form}).then(res => {