Browse Source

下单逻辑调整

yuxingxing 2 years ago
parent
commit
e551256cad

+ 1 - 1
components/payment/index.vue

@@ -19,7 +19,7 @@
 				</view>
 				<view class="iconfont" :class="active == index ? 'icon-xuanzhong11 font-num' : 'icon-weixuan'"></view>
 			</view>
-			<view class="payMoney">{{ $t(`支付`) }}<span class="font-color">{{ $t(`¥`) }}<span
+			<view class="payMoney">{{ $t(`支付金额`) }}<span class="font-color">{{ $t(`¥`) }}<span
 						class="money">{{ totalPrice }}</span></span></view>
 			<view class="button bg-color acea-row row-center-wrapper" @click='goPay(number, paytype)'>{{ $t(`去付款`) }}
 			</view>

+ 5 - 6
pages/goods/orderGoods/index_mall.vue

@@ -5,7 +5,7 @@
 				<text class="pay-price">¥{{pay_price}}</text>
 			</text>
 		</view>
-		<view class='total' v-else-if="!split && !is_behalf">{{$t(`共`)}}{{totalNmu}}{{$t(`件商品`)}}</view>
+		<view class='total' v-else-if="!split && !is_behalf">{{$t(`共`)}}{{totalNum}}{{$t(`件商品`)}}</view>
 		<view class='total' v-else-if="split">
 			<text>{{$t(`订单包裹`)}} {{index + 1}}</text>
 			<view class="rig-btn" v-if="status_type === -1">
@@ -147,7 +147,7 @@
 		},
 		data() {
 			return {
-				totalNmu: 0,
+				totalNum: 0,
 				operationModel: false,
 				status: "",
 			};
@@ -158,17 +158,16 @@
 				nVal.forEach((item, index) => {
 					num += item.totalSales - 0
 				})
-				this.totalNmu = num
+				this.totalNum = num
 			}
 		},
 		mounted() {
 			let num = 0
 			this.$nextTick(() => {
 				this.cartInfo.forEach((item, index) => {
-					num += item.cart_num
+					num += item.totalSales - 0 
 				})
-				console.log(num)
-				this.$set(this, 'totalNmu', num)
+				this.$set(this, 'totalNum', num)
 			})
 
 		},

+ 367 - 319
pages/goods/order_confirm/index.vue

@@ -207,7 +207,7 @@
 			<view style='height:120rpx;'></view>
 			<view class='footer acea-row row-between-wrapper'>
 				<view>{{ $t(`合计`) }}:
-					<text class='font-color'>{{ $t(`¥`) }}{{ totalPrice || 0 }}</text>
+					<text class='font-color'>{{ $t(`¥`) }}{{ parseFloat(totalPrice).toFixed(2) || 0 }}</text>
 				</view>
 				<view class='settlement' style='z-index:100' @tap.stop="goPay" v-if="totalPrice > 0">{{ $t(`提交订单`) }}
 				</view>
@@ -226,8 +226,8 @@
 		<invoice-picker :inv-show="invShow" :inv-list="invList" :inv-checked="invChecked" :is-special="special_invoice"
 			:url-query="urlQuery" @inv-close="invClose" @inv-change="invChange" @inv-cancel="invCancel">
 		</invoice-picker>
-		<payment :payMode="cartArr" :pay_close="pay_close" :isCall="true" :totalPrice="totalPrice.toString()"
-			@changePayType="changePayType" @onChangeFun="onChangeFun"></payment>
+		<payment :payMode="cartArr" :pay_close="pay_close" :isCall="false" :totalPrice="parseFloat(totalPrice).toFixed(2)"
+			@changePayType="changePayType" @onChangeFun="onChangeFun" :order_id="orderKey"></payment>
 		<canvas canvas-id="canvas" v-if="canvasStatus"
 			:style="{ width: canvasWidth + 'px', height: canvasHeight + 'px', position: 'absolute', left: '-100000px', top: '-100000px' }"></canvas>
 
@@ -444,6 +444,7 @@ export default {
 			tab: 3,
 			url: 1
 		});
+		console.log(options);
 		this.num = options.num || 0;
 		this.goodsSpecId = options.goodsSpecId || 0;
 		this.couponId = options.couponId || 0;
@@ -609,11 +610,75 @@ export default {
 			this.pay_close = false;
 		},
 		goPay() {
-			this.pay_close = true;
+			let that = this
+			uni.showLoading({
+				title: that.$t(`下单中`)
+			});
+			postBeforeCheck({
+				goodsSpecId: this.goodsSpecId,
+				num: this.num,
+				userAddressId: this.addressId
+			}).then(function (res) {
+				//验证是否可下单
+				if (res.code == 200) {
+					that.freight = res.data.freight - 0
+					that.totalPrice = res.data.freight - 0
+					that.cartInfo.forEach(e => {
+						that.totalPrice += (e.salePrice - 0) * (that.num - 0)
+					})
+					that.orderCreate()
+				} else {
+					this.totalPrice = 0
+					that.$util.Tips({
+						title: that.$t(`所选商品属性不支持下单`),
+						success: () => {
+							uni.hideLoading();
+							// that.getCartCount(true);
+						},
+					});
+				}
+			})
+		},
+		orderCreate(){
+			let that = this
+			postOrderSubmit({
+				distributeMode: 1,
+				goodsList: [{
+					goodsId: that.cartId,
+					goodsNum: that.num,
+					goodsSpecIds: that.goodsSpecId
+				}],
+				payType: 1,
+				remark: that.remark,
+				settleType: 1,
+				userAddressId: that.addressInfo.id,
+				wlPrice: that.freight
+			}).then(res => {
+				that.orderKey = res.data.orderNo,
+				uni.hideLoading();
+				that.pay_close = true;
+			}).catch(err => {
+				uni.hideLoading();
+				return that.$util.Tips({
+					title: err
+				});
+			});
+			
 		},
 		payCheck(type) {
 			this.payType = type;
-			this.SubOrder();
+			console.log(this.payType);
+			let url = '/pages/goods/order_pay_status/index?order_id=' + this.orderKey + '&msg=' + "支付成功" +
+						'&type=3' + '&totalPrice=' + this.totalPrice
+			uni.showToast({
+				title: that.$t(`支付成功`)
+			})
+			setTimeout(res => {
+				uni.redirectTo({
+					url: url
+				})
+			}, 1000)
+			// this.SubOrder();
 		},
 		/**
 		 * 获取门店列表数据
@@ -651,7 +716,7 @@ export default {
 		},
 		changePayType(type) {
 			this.payType = type
-			this.computedPrice()
+			// this.computedPrice()
 		},
 		computedPrice: function () {
 			let that = this
@@ -677,23 +742,6 @@ export default {
 					});
 				}
 			})
-			// postOrderComputed(this.orderKey, {
-			// 	addressId: this.addressId,
-			// 	useIntegral: this.useIntegral ? 1 : 0,
-			// 	couponId: this.couponId,
-			// 	shipping_type: parseInt(shippingType) + 1,
-			// 	payType: this.payType
-			// }).then(res => {
-			// 	let result = res.data.result;
-			// 	if (result) {
-			// 		this.totalPrice = result.pay_price;
-			// 		this.integral_price = result.deduction_price;
-			// 		this.coupon_price = result.coupon_price;
-			// 		this.integral = this.useIntegral ? result.SurplusIntegral : this.usable_integral;
-			// 		this.$set(this.priceGroup, 'storePostage', shippingType == 1 ? 0 : result.pay_postage);
-			// 		this.$set(this.priceGroup, 'storePostageDiscount', result.storePostageDiscount);
-			// 	}
-			// })
 		},
 		addressType(e) {
 			let index = e;
@@ -818,7 +866,7 @@ export default {
 			});
 			getGoodsDetail({ id: that.cartId })
 				.then((res) => {
-					this.cartInfo = []
+					that.cartInfo = []
 					let porject = res.data
 					//找出选择的规格
 					porject.goodsSpecList.forEach(element => {
@@ -826,10 +874,10 @@ export default {
 							porject.unit = element.spceName
 						}
 					});
-					porject.totalSales = this.num
+					porject.totalSales = that.num
 					// 计算总价
-					this.totalPrice = (this.num - 0) * (porject.salePrice - 0) + this.freight
-					this.cartInfo.push(porject)
+					that.totalPrice = (that.num - 0) * (porject.salePrice - 0) + that.freight - 0
+					that.cartInfo.push(porject)
 					uni.hideLoading()
 				})
 				.catch((err) => {
@@ -996,298 +1044,298 @@ export default {
 		},
 		payment(data) {
 			let that = this;
-			postOrderSubmit({
-				distributeMode: 1,
-				goodsList: [{
-					goodsId: that.cartId,
-					goodsNum: that.num,
-					goodsSpecIds: that.goodsSpecId
-				}],
-				payType: 1,
-				remark: that.remark,
-				settleType: 1,
-				userAddressId: that.addressInfo.id,
-				wlPrice: that.freight
-			}).then(res => {
-				let status = "",
-					orderId = res.data.orderNo,
-					jsConfig = {},
-					goPages = '/pages/goods/order_pay_status/index?order_id=' + orderId + '&msg=' + "支付成功" +
-						'&type=3' + '&totalPrice=' + this.totalPrice
-						that.toPay = true;
-						uni.requestPayment({
-							provider: 'wxpay',
-							orderInfo: jsConfig,
-							success: (e) => {
-								let url = goPages;
-								uni.showToast({
-									title: that.$t(`支付成功`)
-								})
-								setTimeout(res => {
-									uni.redirectTo({
-										url: url
-									})
-								}, 2000)
-							},
-							fail: (e) => {
-								let url = '/pages/goods/order_pay_status/index?order_id=' +
-									orderId +
-									'&msg=' + that.$t(`支付失败`);
-								uni.showModal({
-									content: that.$t(`支付失败`),
-									showCancel: false,
-									success: function (res) {
-										if (res.confirm) {
-											uni.redirectTo({
-												url: url
-											})
-										} else if (res.cancel) { }
-									}
-								})
-							},
-							complete: () => {
-								uni.hideLoading();
-							},
-						});
-				switch (status) {
-					case 'ORDER_EXIST':
-					case 'EXTEND_ORDER':
-					case 'PAY_ERROR':
-						uni.hideLoading();
-						return that.$util.Tips({
-							title: res.msg
-						}, {
-							tab: 5,
-							url: goPages
-						});
-						break;
-					case 'SUCCESS':
-						uni.hideLoading();
-						if ((that.BargainId || that.combinationId || that.pinkId || that.seckillId || that
-							.discountId) && data.payType != 'friend')
-							return that.$util.Tips({
-								title: res.msg,
-								icon: 'success'
-							}, {
-								tab: 4,
-								url: goPages
-							});
-						return that.$util.Tips({
-							title: res.msg,
-							icon: 'success'
-						}, {
-							tab: 4,
-							url: data.payType == 'friend' ? friendPay : goPages
-						});
-						break;
-					case 'WECHAT_PAY':
-						that.toPay = true;
-						// #ifdef MP
-						/* that.toPay = true; */
-						let mp_pay_name = ''
-						if (uni.requestOrderPayment) {
-							mp_pay_name = 'requestOrderPayment'
-						} else {
-							mp_pay_name = 'requestPayment'
-						}
-						uni[mp_pay_name]({
-							timeStamp: jsConfig.timestamp,
-							nonceStr: jsConfig.nonceStr,
-							package: jsConfig.package,
-							signType: jsConfig.signType,
-							paySign: jsConfig.paySign,
-							success: function (res) {
-								uni.hideLoading();
-								if (that.BargainId || that.combinationId || that.pinkId || that
-									.seckillId || that.discountId)
-									return that.$util.Tips({
-										title: that.$t(`支付成功`),
-										icon: 'success'
-									}, {
-										tab: 4,
-										url: goPages
-									});
-								return that.$util.Tips({
-									title: that.$t(`支付成功`),
-									icon: 'success'
-								}, {
-									tab: 5,
-									url: goPages
-								});
-							},
-							fail: function (e) {
-								uni.hideLoading();
-								return that.$util.Tips({
-									title: that.$t(`取消支付`)
-								}, {
-									tab: 5,
-									url: goPages + '&status=2'
-								});
-							},
-							complete: function (e) {
-								uni.hideLoading();
-								//关闭当前页面跳转至订单状态
-								if (res.errMsg == 'requestPayment:cancel' || e.errMsg ==
-									'requestOrderPayment:cancel') return that.$util
-										.Tips({
-											title: that.$t(`取消支付`)
-										}, {
-											tab: 5,
-											url: goPages + '&status=2'
-										});
-							},
-						})
-						// #endif
-						// #ifdef H5
-						this.$wechat.pay(res.data.result.jsConfig).then(res => {
-							return that.$util.Tips({
-								title: that.$t(`支付成功`),
-								icon: 'success'
-							}, {
-								tab: 5,
-								url: goPages
-							});
-						}).catch(res => {
-							if (!this.$wechat.isWeixin()) {
-								uni.redirectTo({
-									url: goPages + '&msg=' + that.$t(`支付失败`) + '&status=2'
-									// '&msg=支付失败&status=2'
-								})
-							}
-							if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
-								title: that.$t(`取消支付`)
-							}, {
-								tab: 5,
-								url: goPages + '&status=2'
-							});
-						})
-						// #endif
-						// #ifdef APP-PLUS
-						uni.requestPayment({
-							provider: 'wxpay',
-							orderInfo: jsConfig,
-							success: (e) => {
-								let url = goPages;
-								uni.showToast({
-									title: that.$t(`支付成功`)
-								})
-								setTimeout(res => {
-									uni.redirectTo({
-										url: url
-									})
-								}, 2000)
-							},
-							fail: (e) => {
-								let url = '/pages/goods/order_pay_status/index?order_id=' +
-									orderId +
-									'&msg=' + that.$t(`支付失败`);
-								uni.showModal({
-									content: that.$t(`支付失败`),
-									showCancel: false,
-									success: function (res) {
-										if (res.confirm) {
-											uni.redirectTo({
-												url: url
-											})
-										} else if (res.cancel) { }
-									}
-								})
-							},
-							complete: () => {
-								uni.hideLoading();
-							},
-						});
-						// #endif
-						break;
-					case 'PAY_DEFICIENCY':
-						uni.hideLoading();
-						//余额不足
-						return that.$util.Tips({
-							title: res.msg
-						}, {
-							tab: 5,
-							url: goPages + '&status=1'
-						});
-						break;
-					case "WECHAT_H5_PAY":
-						uni.hideLoading();
-						that.$util.Tips({
-							title: that.$t(`订单创建成功`)
-						}, {
-							tab: 4,
-							url: goPages + '&status=0'
-						});
-						setTimeout(() => {
-							location.href = res.data.result.jsConfig.mweb_url;
-						}, 2000);
-						break;
-
-					case 'ALIPAY_PAY':
-						//#ifdef H5
-						if (this.from === 'weixin') {
-							uni.redirectTo({
-								url: `/pages/users/alipay_invoke/index?id=${orderId}&pay_key=${res.data.result.pay_key}`
-							});
-						} else {
-							uni.hideLoading();
-							that.formContent = res.data.result.jsConfig;
-							that.$nextTick(() => {
-								document.getElementById('alipaysubmit').submit();
-							})
-						}
-						//#endif
-						// #ifdef MP
-						uni.navigateTo({
-							url: `/pages/users/alipay_invoke/index?id=${orderId}&link=${jsConfig.qrCode}`
-						});
-						// #endif
-						// #ifdef APP-PLUS
-						uni.requestPayment({
-							provider: 'alipay',
-							orderInfo: jsConfig,
-							success: (e) => {
-								uni.showToast({
-									title: that.$t(`支付成功`)
-								})
-								let url = '/pages/goods/order_pay_status/index?order_id=' +
-									orderId +
-									'&msg=' + that.$t(`支付成功`);
-								setTimeout(res => {
-									uni.redirectTo({
-										url: url
-									})
-								}, 2000)
-
-							},
-							fail: (e) => {
-								let url = '/pages/goods/order_pay_status/index?order_id=' +
-									orderId +
-									'&msg=' + that.$t(`支付失败`);
-								uni.showModal({
-									content: that.$t(`支付失败`),
-									showCancel: false,
-									success: function (res) {
-										if (res.confirm) {
-											uni.redirectTo({
-												url: url
-											})
-										} else if (res.cancel) { }
-									}
-								})
-							},
-							complete: () => {
-								uni.hideLoading();
-							},
-						});
-						// #endif
-						break;
-				}
-			}).catch(err => {
-				uni.hideLoading();
-				return that.$util.Tips({
-					title: err
-				});
-			});
+			// postOrderSubmit({
+			// 	distributeMode: 1,
+			// 	goodsList: [{
+			// 		goodsId: that.cartId,
+			// 		goodsNum: that.num,
+			// 		goodsSpecIds: that.goodsSpecId
+			// 	}],
+			// 	payType: 1,
+			// 	remark: that.remark,
+			// 	settleType: 1,
+			// 	userAddressId: that.addressInfo.id,
+			// 	wlPrice: that.freight
+			// }).then(res => {
+			// 	let status = "",
+			// 		orderId = res.data.orderNo,
+			// 		jsConfig = {},
+			// 		goPages = '/pages/goods/order_pay_status/index?order_id=' + orderId + '&msg=' + "支付成功" +
+			// 			'&type=3' + '&totalPrice=' + this.totalPrice
+			// 			that.toPay = true;
+			// 			uni.requestPayment({
+			// 				provider: 'wxpay',
+			// 				orderInfo: jsConfig,
+			// 				success: (e) => {
+			// 					let url = goPages;
+			// 					uni.showToast({
+			// 						title: that.$t(`支付成功`)
+			// 					})
+			// 					setTimeout(res => {
+			// 						uni.redirectTo({
+			// 							url: url
+			// 						})
+			// 					}, 2000)
+			// 				},
+			// 				fail: (e) => {
+			// 					let url = '/pages/goods/order_pay_status/index?order_id=' +
+			// 						orderId +
+			// 						'&msg=' + that.$t(`支付失败`);
+			// 					uni.showModal({
+			// 						content: that.$t(`支付失败`),
+			// 						showCancel: false,
+			// 						success: function (res) {
+			// 							if (res.confirm) {
+			// 								uni.redirectTo({
+			// 									url: url
+			// 								})
+			// 							} else if (res.cancel) { }
+			// 						}
+			// 					})
+			// 				},
+			// 				complete: () => {
+			// 					uni.hideLoading();
+			// 				},
+			// 			});
+			// 	switch (status) {
+			// 		case 'ORDER_EXIST':
+			// 		case 'EXTEND_ORDER':
+			// 		case 'PAY_ERROR':
+			// 			uni.hideLoading();
+			// 			return that.$util.Tips({
+			// 				title: res.msg
+			// 			}, {
+			// 				tab: 5,
+			// 				url: goPages
+			// 			});
+			// 			break;
+			// 		case 'SUCCESS':
+			// 			uni.hideLoading();
+			// 			if ((that.BargainId || that.combinationId || that.pinkId || that.seckillId || that
+			// 				.discountId) && data.payType != 'friend')
+			// 				return that.$util.Tips({
+			// 					title: res.msg,
+			// 					icon: 'success'
+			// 				}, {
+			// 					tab: 4,
+			// 					url: goPages
+			// 				});
+			// 			return that.$util.Tips({
+			// 				title: res.msg,
+			// 				icon: 'success'
+			// 			}, {
+			// 				tab: 4,
+			// 				url: data.payType == 'friend' ? friendPay : goPages
+			// 			});
+			// 			break;
+			// 		case 'WECHAT_PAY':
+			// 			that.toPay = true;
+			// 			// #ifdef MP
+			// 			/* that.toPay = true; */
+			// 			let mp_pay_name = ''
+			// 			if (uni.requestOrderPayment) {
+			// 				mp_pay_name = 'requestOrderPayment'
+			// 			} else {
+			// 				mp_pay_name = 'requestPayment'
+			// 			}
+			// 			uni[mp_pay_name]({
+			// 				timeStamp: jsConfig.timestamp,
+			// 				nonceStr: jsConfig.nonceStr,
+			// 				package: jsConfig.package,
+			// 				signType: jsConfig.signType,
+			// 				paySign: jsConfig.paySign,
+			// 				success: function (res) {
+			// 					uni.hideLoading();
+			// 					if (that.BargainId || that.combinationId || that.pinkId || that
+			// 						.seckillId || that.discountId)
+			// 						return that.$util.Tips({
+			// 							title: that.$t(`支付成功`),
+			// 							icon: 'success'
+			// 						}, {
+			// 							tab: 4,
+			// 							url: goPages
+			// 						});
+			// 					return that.$util.Tips({
+			// 						title: that.$t(`支付成功`),
+			// 						icon: 'success'
+			// 					}, {
+			// 						tab: 5,
+			// 						url: goPages
+			// 					});
+			// 				},
+			// 				fail: function (e) {
+			// 					uni.hideLoading();
+			// 					return that.$util.Tips({
+			// 						title: that.$t(`取消支付`)
+			// 					}, {
+			// 						tab: 5,
+			// 						url: goPages + '&status=2'
+			// 					});
+			// 				},
+			// 				complete: function (e) {
+			// 					uni.hideLoading();
+			// 					//关闭当前页面跳转至订单状态
+			// 					if (res.errMsg == 'requestPayment:cancel' || e.errMsg ==
+			// 						'requestOrderPayment:cancel') return that.$util
+			// 							.Tips({
+			// 								title: that.$t(`取消支付`)
+			// 							}, {
+			// 								tab: 5,
+			// 								url: goPages + '&status=2'
+			// 							});
+			// 				},
+			// 			})
+			// 			// #endif
+			// 			// #ifdef H5
+			// 			this.$wechat.pay(res.data.result.jsConfig).then(res => {
+			// 				return that.$util.Tips({
+			// 					title: that.$t(`支付成功`),
+			// 					icon: 'success'
+			// 				}, {
+			// 					tab: 5,
+			// 					url: goPages
+			// 				});
+			// 			}).catch(res => {
+			// 				if (!this.$wechat.isWeixin()) {
+			// 					uni.redirectTo({
+			// 						url: goPages + '&msg=' + that.$t(`支付失败`) + '&status=2'
+			// 						// '&msg=支付失败&status=2'
+			// 					})
+			// 				}
+			// 				if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
+			// 					title: that.$t(`取消支付`)
+			// 				}, {
+			// 					tab: 5,
+			// 					url: goPages + '&status=2'
+			// 				});
+			// 			})
+			// 			// #endif
+			// 			// #ifdef APP-PLUS
+			// 			uni.requestPayment({
+			// 				provider: 'wxpay',
+			// 				orderInfo: jsConfig,
+			// 				success: (e) => {
+			// 					let url = goPages;
+			// 					uni.showToast({
+			// 						title: that.$t(`支付成功`)
+			// 					})
+			// 					setTimeout(res => {
+			// 						uni.redirectTo({
+			// 							url: url
+			// 						})
+			// 					}, 2000)
+			// 				},
+			// 				fail: (e) => {
+			// 					let url = '/pages/goods/order_pay_status/index?order_id=' +
+			// 						orderId +
+			// 						'&msg=' + that.$t(`支付失败`);
+			// 					uni.showModal({
+			// 						content: that.$t(`支付失败`),
+			// 						showCancel: false,
+			// 						success: function (res) {
+			// 							if (res.confirm) {
+			// 								uni.redirectTo({
+			// 									url: url
+			// 								})
+			// 							} else if (res.cancel) { }
+			// 						}
+			// 					})
+			// 				},
+			// 				complete: () => {
+			// 					uni.hideLoading();
+			// 				},
+			// 			});
+			// 			// #endif
+			// 			break;
+			// 		case 'PAY_DEFICIENCY':
+			// 			uni.hideLoading();
+			// 			//余额不足
+			// 			return that.$util.Tips({
+			// 				title: res.msg
+			// 			}, {
+			// 				tab: 5,
+			// 				url: goPages + '&status=1'
+			// 			});
+			// 			break;
+			// 		case "WECHAT_H5_PAY":
+			// 			uni.hideLoading();
+			// 			that.$util.Tips({
+			// 				title: that.$t(`订单创建成功`)
+			// 			}, {
+			// 				tab: 4,
+			// 				url: goPages + '&status=0'
+			// 			});
+			// 			setTimeout(() => {
+			// 				location.href = res.data.result.jsConfig.mweb_url;
+			// 			}, 2000);
+			// 			break;
+
+			// 		case 'ALIPAY_PAY':
+			// 			//#ifdef H5
+			// 			if (this.from === 'weixin') {
+			// 				uni.redirectTo({
+			// 					url: `/pages/users/alipay_invoke/index?id=${orderId}&pay_key=${res.data.result.pay_key}`
+			// 				});
+			// 			} else {
+			// 				uni.hideLoading();
+			// 				that.formContent = res.data.result.jsConfig;
+			// 				that.$nextTick(() => {
+			// 					document.getElementById('alipaysubmit').submit();
+			// 				})
+			// 			}
+			// 			//#endif
+			// 			// #ifdef MP
+			// 			uni.navigateTo({
+			// 				url: `/pages/users/alipay_invoke/index?id=${orderId}&link=${jsConfig.qrCode}`
+			// 			});
+			// 			// #endif
+			// 			// #ifdef APP-PLUS
+			// 			uni.requestPayment({
+			// 				provider: 'alipay',
+			// 				orderInfo: jsConfig,
+			// 				success: (e) => {
+			// 					uni.showToast({
+			// 						title: that.$t(`支付成功`)
+			// 					})
+			// 					let url = '/pages/goods/order_pay_status/index?order_id=' +
+			// 						orderId +
+			// 						'&msg=' + that.$t(`支付成功`);
+			// 					setTimeout(res => {
+			// 						uni.redirectTo({
+			// 							url: url
+			// 						})
+			// 					}, 2000)
+
+			// 				},
+			// 				fail: (e) => {
+			// 					let url = '/pages/goods/order_pay_status/index?order_id=' +
+			// 						orderId +
+			// 						'&msg=' + that.$t(`支付失败`);
+			// 					uni.showModal({
+			// 						content: that.$t(`支付失败`),
+			// 						showCancel: false,
+			// 						success: function (res) {
+			// 							if (res.confirm) {
+			// 								uni.redirectTo({
+			// 									url: url
+			// 								})
+			// 							} else if (res.cancel) { }
+			// 						}
+			// 					})
+			// 				},
+			// 				complete: () => {
+			// 					uni.hideLoading();
+			// 				},
+			// 			});
+			// 			// #endif
+			// 			break;
+			// 	}
+			// }).catch(err => {
+			// 	uni.hideLoading();
+			// 	return that.$util.Tips({
+			// 		title: err
+			// 	});
+			// });
 		},
 		clickTextArea() {
 			this.$refs.textarea.focus()

+ 1 - 40
pages/goods_details/index.vue

@@ -255,41 +255,6 @@
 				@tabCouponType="tabCouponType">
 			</couponListWindow>
 			<!-- 分享按钮 -->
-			<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
-				<!-- #ifndef MP -->
-				<button class="item" hover-class="none" v-if="weixinStatus === true" @click="H5ShareBox = true">
-					<view class="iconfont icon-weixin3"></view>
-					<view class="">{{ $t(`发送给朋友`) }}</view>
-				</button>
-				<!-- #endif -->
-				<!-- #ifdef MP -->
-				<button class="item" open-type="share" hover-class="none" @click="goFriend">
-					<view class="iconfont icon-weixin3"></view>
-					<view class="">{{ $t(`发送给朋友`) }}</view>
-				</button>
-				<!-- #endif -->
-				<!-- #ifdef H5  -->
-				<div class="item copy-data" v-if="storeInfo.command_word != ''"
-					:data-clipboard-text="storeInfo.command_word">
-					<view class="iconfont icon-fuzhikouling"></view>
-					<text>{{ $t(`复制口令`) }}</text>
-				</div>
-				<!-- #endif -->
-				<!-- #ifdef APP-PLUS -->
-				<view class="item" @click="appShare('WXSceneSession')">
-					<view class="iconfont icon-weixin3"></view>
-					<view class="">{{ $t(`微信好友`) }}</view>
-				</view>
-				<view class="item" @click="appShare('WXSenceTimeline')">
-					<view class="iconfont icon-pengyouquan"></view>
-					<view class="">{{ $t(`微信朋友圈`) }}</view>
-				</view>
-				<!-- #endif -->
-				<button class="item" hover-class="none" @click="goPoster">
-					<view class="iconfont icon-haibao"></view>
-					<view class="">{{ $t(`生成海报`) }}</view>
-				</button>
-			</view>
 			<view class="mask" v-if="posters" @click="listenerActionClose"></view>
 			<!-- #ifdef MP -->
 			<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
@@ -312,8 +277,6 @@
 			<view class="share-box" v-if="H5ShareBox">
 				<image :src="imgHost + '/statics/images/share-info.png'" @click="H5ShareBox = false"></image>
 			</view>
-			<kefuIcon :ids="parseInt(id)" :routineContact="routineContact" :storeInfo="storeInfo" :goodsCon="1">
-			</kefuIcon>
 			<!-- #ifdef H5 || APP-PLUS -->
 			<zb-code ref="qrcode" :show="codeShow" :cid="cid" :val="codeVal" :size="size" :unit="unit"
 				:background="background" :foreground="foreground" :pdground="pdground" :icon="codeIcon"
@@ -825,14 +788,12 @@ export default {
 			let stock = productSelect.totalStock || 0;
 			if (changeValue) {
 				this.attr.productSelect.totalSales++;
-				// this.attr.productSelect.totalStock--;
 				if (this.attr.productSelect.totalSales > stock) {
 					this.$set(this.attr.productSelect, "totalSales", stock ? stock : 1);
 					this.$set(this, "totalSales", stock ? stock : 1);
 				}
 			} else {
 				this.attr.productSelect.totalSales--;
-				// this.attr.productSelect.totalStock++;
 				if (this.attr.productSelect.totalSales < 1) {
 					this.$set(this.attr.productSelect, "totalSales", 1);
 					this.$set(this, "totalSales", 1);
@@ -1132,7 +1093,7 @@ export default {
 		goCat: function (news) {
 			let that = this
 			that.currentPage = false;
-			this.storeInfo.totalSales = 1
+			this.storeInfo.totalSales = this.attr.productSelect.totalSales
 			this.$set(this.attr, "productSelect", this.storeInfo);
 			//打开属性
 			if (that.attrValue) {