Bläddra i källkod

v1.0.2改版更新

xiebaomin 2 år sedan
förälder
incheckning
b4b0cc05a5

+ 1 - 2
pages/goods/components/cm-unit-popup.vue

@@ -171,11 +171,10 @@ export default {
 				this.productCount = this.handleMinNumber
 			} else if (_value < this.handleMinNumber) {
 				this.productCount = this.handleMinNumber
-			} else if (_value > this.handleStock) {
-				this.productCount = this.handleStock
 			} else {
 				this.productCount = e.detail.value
 			}
+            console.log(this.productCount)
 		},
 		handleConfirm(type) {
 			if (this.hasLogin) {

+ 21 - 12
pages/user/order/components/freight-popup.vue

@@ -7,7 +7,6 @@
                 <text>{{ freightText }}</text>
                 <text
                     class="cell-more iconfont icon-xiangyou"
-                    v-if="infoData.designatedFlag !== 1"
                     @click="showPopup"
                 ></text>
             </view>
@@ -16,7 +15,7 @@
         <tui-bottom-popup :radius="true" :show="popupShow">
             <view class="freight-title">运费设置</view>
             <view class="freight-content">
-                <radio-group @change="radioChange">
+                <radio-group @change="radioChange" v-if="designatedFlag()">
                     <label v-for="(item, index) in radioItems" :key="index">
                         <radio
                             style="transform:scale(0.7)"
@@ -31,7 +30,7 @@
                     </label>
                 </radio-group>
                 <view class="freight-form">
-                    <view class="freight-form-item" v-if="infoData.designatedFlag !== 2">
+                    <view class="freight-form-item" v-if="infoData.designatedFlag !== 2 && infoData.coldChain > 0">
                         <view>冷链运输费</view>
                         <view style="position: relative;">
                             ¥{{ this.infoData.coldChain.toFixed(2) }}
@@ -43,7 +42,7 @@
                             ></radio>
                         </view>
                     </view>
-                    <block>
+                    <block v-if="newPostAge() !== 0">
                         <view class="freight-form-item" v-if="isCPay">
                             <view>其他运费</view>
                             <view>{{ '¥' + postAge().toFixed(2) }}</view>
@@ -55,11 +54,8 @@
                     </block>
                     <view class="freight-form-item">
                         <view>总运费</view>
-                        <view style="color: #F94B4B;display: flex;">
-                            <view class="" v-if="allPostage === 0">
-                                到付
-                            </view>
-                            <view style="display: flex;" v-else>
+                        <view style="color: #F94B4B;">
+                            <view style="display: flex;" v-if="allPostage !== 0 || isCPay">
                                 <count-up
                                     :num="allPostage.toFixed(2)"
@@ -69,6 +65,9 @@
                                     color="#F94B4B"
                                 ></count-up>
                             </view>
+                            <text v-else>
+                                到付
+                            </text>
                         </view>
                     </view>
                 </view>
@@ -129,9 +128,8 @@ export default {
     computed: {
         // 总运费
         allPostage() {
-            console.log(111)
             this.freightText =
-                this.postAge() + (this.isCheck ? this.infoData.coldChain : 0) === 0
+                (this.postAge() + (this.isCheck ? this.infoData.coldChain : 0) === 0) && !this.isCPay
                     ? '到付'
                     : '¥' + (this.postAge() + (this.isCheck ? this.infoData.coldChain : 0)).toFixed(2)
             return this.postAge() + (this.infoData.isColdChina ? this.infoData.coldChain : 0)
@@ -149,13 +147,24 @@ export default {
             this.popupShow = true
             this.$emit('showFreight', true)
         },
+        // 是否到付
         postAgeFlag(e) {
             return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].postageFlag === e
         },
+        // 初始运费
         postAge() {
-            if (this.isCPay) return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].postage
+            if (this.isCPay) return this.newPostAge()
             else return 0
         },
+        // 新运费
+        newPostAge() {
+            return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].postage
+        },
+        // 是否运费切换
+        designatedFlag(index) {
+            return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].designatedFlag !== 1
+        },
+        // 按钮切换
         radioChange($event) {
             console.log('切换运费')
             this.isCPay = !this.isCPay

+ 1 - 1
pages/user/order/components/goodsList.vue

@@ -131,7 +131,7 @@ export default {
         changeFreight($event) {
             this.goodsCloneData[$event[0]] = $event[1]
             this.goodsCloneData[$event[0]].totalPrice = this.goodsCloneData[$event[0]].originalPrice + $event[2]
-            this.goodsCloneData[$event[0]].postage = $event[1].postageFlag === 2 ? 0 : $event[1].postage
+            this.goodsCloneData[$event[0]].postage = $event[1].postageFlag === 2 ? 0 : JSON.parse(uni.getStorageSync('goodsData'))[$event[0]].postage
             this.$emit('handleGoodList', this.goodsCloneData)
             console.log('goodsCloneData', this.goodsCloneData)
         }

+ 10 - 7
pages/user/order/order-details.vue

@@ -110,6 +110,7 @@ export default {
 			state: 0,
 			userId: '',
 			orderId: '',
+            shopOrderId: '',
 			shareCode: '', //分享码
 			shareType: '', //分享登录页过来记录的状态
 			cellPhone: '', //客服电话
@@ -155,6 +156,7 @@ export default {
 		console.log(option)
 		this.shareType = option.type
 		this.orderId = option.orderId
+        this.shopOrderId = option.shopOrderId
 		if (this.shareType === 'share') {
 			this.state = 0
 			this.isOrderShare = true
@@ -204,7 +206,7 @@ export default {
 			try {
 				const userInfo = await this.$api.getStorage()
 				this.userId = userInfo.userId ? userInfo.userId : 0
-				const res = await this.OrderService.QueryOrderDetails({ shopOrderId: this.orderId, userId: this.userId })
+				const res = await this.OrderService.QueryOrderDetails({ shopOrderId: this.shopOrderId, orderId: this.orderId, userId: this.userId })
 				const data = res.data
 				this.skeletonShow = true
 				this.orderInfo = data.shopOrder
@@ -262,12 +264,13 @@ export default {
 			this.OrderService.OrderPaymentValidation({ shopOrderId: data.orderId })
 				.then(response => {
 					let data = response.data
-					if (data.onlinePayFlag == 1) {
-						// 只能线下
-						this.$api.navigateTo(`/pages/user/pay/card-under?orderId=${data.orderId}`)
-					} else {
-						this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${data.orderId}`)
-					}
+                    console.log(data)
+					// if (data.onlinePayFlag == 1) {
+					// 	// 只能线下
+					// 	this.$api.navigateTo(`/pages/user/pay/card-under?orderId=${data.orderId}`)
+					// } else {
+					this.$api.navigateTo(`/pages/user/order/order-pay-list?shopOrderId=${data.shopOrderId}`)
+					// }
 				})
 				.catch(error => {
 					this.$util.msg(error.msg, 2000)

+ 4 - 4
pages/user/order/order-list.vue

@@ -78,7 +78,7 @@
                                         </view>
                                         <view
                                             class="goods-item"
-                                            @click.stop="detail(shop.shopOrderId)"
+                                            @click.stop="detail(shop.shopOrderId, shop.orderId)"
                                         >
                                             <view class="goods-pros-t">
                                                 <view class="pros-img tui-skeleton-fillet">
@@ -389,10 +389,10 @@ export default {
                 this.getOnReachBottomData(this.currentTab)
             }
         },
-        detail(orderId) {
+        detail(shopOrderId, orderId) {
             //订单详情跳转
             this.isModalLayer = true
-            this.$api.navigateTo(`/pages/user/order/order-details?state=${this.currentTab}&orderId=${orderId}`)
+            this.$api.navigateTo(`/pages/user/order/order-details?state=${this.currentTab}&shopOrderId=${shopOrderId}`)
         },
         handButtonConfirm(data) {
             console.log(data)
@@ -426,7 +426,7 @@ export default {
             //监听根据付款状态做操作
             try {
                 const res = await this.OrderService.OrderPaymentValidation({ shopOrderId: this.handleOrderId })
-                this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${res.data.orderId}`)
+                this.$api.navigateTo(`/pages/user/order/order-pay-list?shopOrderId=${res.data.shopOrderId}`)
                 // if (res.data.onlinePayFlag == 1) {
                 //     // 只能线下
                 //     this.$api.navigateTo(`/pages/user/pay/card-under?orderId=${this.handleOrderId}`)

+ 12 - 3
pages/user/order/order-pay-list.vue

@@ -81,6 +81,7 @@ export default {
         return {
             orderId: 0,
             showPayUnder: false,
+            shopOrderId: 0,
             skeletonShow: true,
             list: []
         }
@@ -102,12 +103,20 @@ export default {
         initData(e) {
             console.log(e)
             this.orderId = e.orderId
+            this.shopOrderId = e.shopOrderId
             this.payOrderId = '#' + e.orderId + '#'
-            this.PayOrderShoporders(this.orderId)
+            this.PayOrderShoporders(this.orderId, this.shopOrderId)
         },
-        async PayOrderShoporders(orderId) {
+        async PayOrderShoporders(orderId, shopOrderId) {
             try {
-                const res = await this.PayService.PayOrderShoporders({ orderId: orderId })
+                let params = {}
+                if(orderId) {
+                    params = { orderId }
+                }
+                if(shopOrderId) {
+                    params = { shopOrderId }
+                }
+                const res = await this.PayService.PayOrderShoporders(params)
                 this.list = res.data
                 // this.PayOrderCheckoutCounter(orderId)
                 this.skeletonShow = false

+ 2 - 2
pages/user/pay/card-order.vue

@@ -123,7 +123,7 @@
 							</view>
 						</view> -->
 					</view>
-					<view class="pay-statustext">
+					<!-- <view class="pay-statustext">
 						<view class="pay-statustext-inner">
 							<view class="pay-icon"> <text class="iconfont icon-gantanhao-yuankuang"></text> </view>
 							<view class="pay-text">
@@ -132,7 +132,7 @@
 								>
 							</view>
 						</view>
-					</view>
+					</view> -->
 				</view>
 				<view class="pay-button" :style="{ paddingBottom: isIphoneX ? '68rpx' : '24rpx' }">
 					<view

+ 2 - 2
pages/user/pay/success.vue

@@ -95,10 +95,10 @@
 				})
 			},
 			toAgainPay(){
-				this.$api.reLaunch(`/pages/user/order/order-pay-list?orderId=${this.orderId}`)
+				this.$api.reLaunch(`/pages/user/order/order-pay-list?shopOrderId=${this.shopOrderId}`)
 			},
 			details(){
-				this.$api.reLaunch('/pages/user/order/order-details?type=share&orderId='+this.shopOrderId)
+				this.$api.reLaunch('/pages/user/order/order-details?type=share&shopOrderId='+this.shopOrderId)
 			}
 		},
 		onShow() {