shish hai 11 meses
pai
achega
b6c8ac0755

+ 38 - 37
mallApp/src/pages/billing/affirmGhs.vue

@@ -70,7 +70,7 @@
 							<text v-else style="color: #3385FF;width:100%;">到店取货,没有配送费</text>
 						</view>
 						<view v-if="form.sendType == 2">
-							<text style="color: #3385FF;width:100%;">请跑腿送送货,有配送费</text>
+							<text style="color: #3385FF;width:100%;">请跑腿送,有跑腿费</text>
 						</view>
 					</tui-list-cell>
 
@@ -78,7 +78,7 @@
 						<view class="tui-title">收花地址</view>
 						<view v-if="!$util.isEmpty(userInfo.lat) && !$util.isEmpty(userInfo.long)">
 							<view><text>{{userInfo.fullAddress}}</text></view>
-							<view><text>{{userInfo.showAddress}}</text></view>
+							<view v-if="userInfo.showAddress!=userInfo.fullAddress" style="color:#848181;"><text>{{userInfo.showAddress}}</text></view>
 						</view>
 						<view v-else>
 							<view><text style="color:#CCCCCC;">请填写地址</text></view>
@@ -135,9 +135,8 @@
 <script>
 import TuiListCell from "@/components/plugin/list-cell";
 import productMins from "@/mixins/cgProduct";
-import { buyItem,freight,newFreight } from "@/api/order"
+import { buyItem,newFreight } from "@/api/order"
 import { currentInfo } from "@/api/user"
-// import { mapActions, mapGetters } from "vuex";
 export default {
 	name: "affirmGhs",
 	components: {
@@ -192,7 +191,6 @@ export default {
 		this.getUserInfo()
 	},
 	computed: {
-		// removed unused getLoginInfo
 		modifyPrice(){
 			let price = Number(this.allPrice) || 0
 			if(this.form.sendType == 2){
@@ -200,11 +198,19 @@ export default {
 			} else if (this.form.sendType == 0){
 				price = price + Number(this.form.packCost || 0)
 			}
+			price = price.toFixed(2)
 			return parseFloat(price)
 		},
 	},
+	onLoad(){
+		if(this.option.account){
+			uni.setStorageSync('account',this.option.account)
+		}
+		if(this.option.hdId){
+			uni.setStorageSync('hdId',this.option.hdId)
+		}
+	},
 	methods: {
-		// removed unused initMerchantInfo
 		selTimeFn(e) {
 			this.form.reachDate = e.detail.value;
 		},
@@ -225,7 +231,6 @@ export default {
 					this.form.sendType = 0
 				}
 			}
-			//this.getUserInfo()
 		},
 		getUserInfo(){
 			currentInfo().then(res=>{
@@ -241,12 +246,16 @@ export default {
 					that.form.lat = that.userInfo.lat
 					that.form.showAddress = that.userInfo.showAddress
 					that.form.hasMap = that.userInfo.hasMap || 0
-					that.calcSendCost()
+					if(that.form.hasMap == 1 && this.form.sendType == 2){
+						that.calcSendCost()
+					}
 				}
 			}).catch(()=>{})
 		},
 		modifyAddress(){
-      		this.$util.pageTo({ url: '/pages/user/modify?hasMap='+this.form.hasMap})
+			let account = this.option.account
+			let hdId = this.option.hdId
+      		this.$util.pageTo({ url: '/pages/user/address?account='+account+'&hdId='+hdId})
 		},
 		changeSendType(num){
 			this.form.sendType = num
@@ -272,15 +281,15 @@ export default {
 			}
 			weight = Number(weight).toFixed(2)
 			// 无地址或重量为 0 时,设为 0 并返回
-			if (this.$util.isEmpty(that.userInfo.lat) || this.$util.isEmpty(that.userInfo.long) || Number(weight) <= 0) {
+			if (this.$util.isEmpty(that.userInfo.lat) || this.$util.isEmpty(that.userInfo.long)) {
 				that.form.sendCost = 0
+				this.$msg('请填写地址')
 				return
 			}
-			// freight({weight:weight,lat:that.userInfo.lat,long:that.userInfo.long}).then(res => {
-			// 	if(res.code == 1){
-			// 		that.form.sendCost = res.data.fee?parseFloat(Number(res.data.fee)):0
-			// 	}
-			// }).catch(()=>{});
+			if(Number(weight) <= 0){
+				this.$msg('商品没有重量,无法使用跑腿')
+				return false
+			}
 			// newFreight
 			let packageNum = that.allCountFun && that.allCountFun.bigLength ? Number(that.allCountFun.bigLength) : 1
 			let cargoName = '花材'
@@ -320,37 +329,29 @@ export default {
 					return false
 				}
 			}
-			if(this.form.sendType == 2 && this.form.sendCost <= 0) {
-				this.$msg('选择请跑腿送,必须获取运费')
-				return false
-			}
-			if(this.form.sendType == 2 && this.form.hasMap == 0) {
-				this.$msg('由于地图定位服务停用,无法使用请跑腿送')
-				return false
+			if(this.form.sendType == 2) {
+				if(this.form.hasMap == 0){
+					this.$msg('跑腿送已停用,请换其它方式')
+					return false
+				}
+				if(Number(this.form.sendCost) <= 0){
+					this.$msg('没有获取到跑腿费')
+					return false
+				}
 			}
 			uni.showLoading({mask:true})
 			buyItem(params).then(res => {
 				uni.hideLoading()
 				if(res.code && res.code == 1){
 					let account = this.option.account ? this.option.account : 0
-					let totalPrice = Number(res.data.totalPrice)
-					if (this.form.sendType == 2) { // 当是请跑腿送时,总价格得加上运费
-						totalPrice =+ Number(this.form.sendCost)
-					}
-					
-					if (Math.abs(totalPrice - this.modifyPrice) < 0.001) {
-						res.data.totalPrice = totalPrice
-					}else{
-						this.$msg('运费计算错误')
-						return
-					}
-					this.$util.pageTo({ url: "/pages/callback/pay", type: 2, query: { pageStatus: 1, ...res.data, hdId: hdId, account: account } })
+					let getPayType = res.data.getPayType?res.data.getPayType:0
+					let totalPrice = res.data.totalPrice?res.data.totalPrice:0
+					let orderSn = res.data.orderSn?res.data.orderSn:''
+					this.$util.pageTo({url:"/pages/callback/pay?account="+account+'&hdId='+hdId+'&pageStatus=1&getPayType='+getPayType+'&totalPrice='+totalPrice+'&orderSn='+orderSn,type:2})
 				}
 				this.removeMemory()
 			}).catch((e)=>{
-				console.log('buyItem error: ', e)
-				uni.hideLoading()
-				this.removeMemory()
+				this.$msg('下单失败,请重试')
 			})
 		},
 		modifyItem() {

+ 1 - 3
mallApp/src/pages/item/components/subItem.vue

@@ -31,9 +31,7 @@
 				<view class="open-bx" >
 					<i class="iconfont iconjian" @click.stop="delEvent()" v-if="bigCount > 0 || smallCount > 0"></i>
 					<text class="num">
-						<text v-if="bigCount > 0 || smallCount > 0">{{ `${bigCount}` }}</text>
-						<text v-if="smallCount > 0">/</text>
-						<text v-if="smallCount > 0">{{ `${smallCount}` }}</text>
+						<text v-if="bigCount > 0" style="font-weight:bold;color:#3385ff;">{{ `${bigCount}` }}</text>
 					</text>
 					<i class="iconfont iconzeng" @click.stop="addEvents()"></i>
 				</view>

+ 9 - 0
mallApp/src/pages/user/address.vue

@@ -67,6 +67,15 @@ export default {
 	},
 	onLoad() {
 		this.getUserInfo()
+
+		//这个必须保留,否则客户花材商城下单改地址后返回,页面获取运费会报错
+		if(this.option.account){
+			uni.setStorageSync('account',this.option.account)
+		}
+		if(this.option.hdId){
+			uni.setStorageSync('hdId',this.option.hdId)
+		}
+
 	},
 	methods: {
 		init() {