zhaoxw 4 vuotta sitten
vanhempi
commit
372e79a0a3

+ 2 - 1
config/api.js

@@ -1,6 +1,7 @@
 // const WX_API_BASE = 'https://www.qianjiadi.com/'
 // const WX_API_BASE = 'http://ch.jihengcc.cn:17080/'
-const WX_API_BASE = 'https://test.jihengcc.cn/'
+// const WX_API_BASE = 'https://test.jihengcc.cn/'
+const WX_API_BASE = 'https://www.qianjiadi.com/'
 
 module.exports = {
 	//  微信登录

+ 10 - 4
pages/cart/cart.vue

@@ -136,10 +136,10 @@
 			},
 			//  数量减
 			numSub(item, site) {
-				// if (site.buyNum > 1) {
+				if (site.buyNum > 1) {
 					site.buyNum--
 					this.setCartNum(item, site)
-				// }
+				}
 			},
 			//  数量加
 			numAdd(item, site) {
@@ -246,11 +246,17 @@
 	}
 </script>
 
-<style lang="less" scoped>
+<style>
 	page {
 		width: 100%;
 		height: 100%;
 	}
+</style>
+<style lang="less" scoped>
+	// page {
+	// 	width: 100%;
+	// 	height: 100%;
+	// }
 
 	.container {
 		width: 100%;
@@ -496,7 +502,7 @@
 				height: 32px;
 				line-height: 32px;
 				padding: 0;
-				margin: 10px 0 0 0;
+				margin: 10px 15px 0 0;
 				float: right;
 				border-color: #52A63A !important;
 				background-color: #FFFFFF !important;

+ 39 - 21
pagesGood/orderPay.vue

@@ -55,7 +55,7 @@
 					 v-if="orderType == 1">
 						<view>
 							<text class="order-text-left">{{coupon.couponName}}</text>
-							<text class="order-text-right">-¥{{coupon.discountAmount}}</text>
+							<text class="order-text-right">{{couponList.length ? ('-¥'+coupon.discountAmount) : '无可用优惠券'}}</text>
 						</view>
 					</u-cell-item>
 					<u-field label="备注" v-model="notes" placeholder="请输入备注" :border-bottom="false" label-align="right" label-width="170"
@@ -131,6 +131,7 @@
 				couponList: [],
 				notes: '',
 				paySum: 0,
+				mineIntegral: {}
 			}
 		},
 		onLoad(options) {
@@ -162,7 +163,7 @@
 			}
 			if (this.orderType == 1) {
 				NET.request(API.getIntegral, {}, 'POST').then(res => {
-					this.mineIntegral = res.data.usableIntegral
+					this.integral = res.data.usableIntegral
 				}).catch(error => {
 					this.$refs.uTips.show({
 						title: '获取个人积分失败',
@@ -176,7 +177,7 @@
 					this.couponList = res.data
 				}).catch(error => {
 					this.$refs.uTips.show({
-						title: '获取优惠券列表失败',
+						title: res.msg,
 						type: 'warning',
 					})
 				})
@@ -228,6 +229,9 @@
 			},
 			//  显示优惠券弹窗
 			showCoupon() {
+				if (!this.couponList.length) {
+					return
+				}
 				this.$refs.popup.open()
 			},
 			//  选择优惠券
@@ -291,30 +295,44 @@
 						//  备注
 						notes: this.notes,
 					}, 'POST').then(res => {
-						uni.requestPayment({
-							provider: 'wxpay',
-							timeStamp: res.data.timeStamp,
-							nonceStr: res.data.nonceStr,
-							package: res.data.packageValue,
-							signType: res.data.signType,
-							paySign: res.data.paySign,
-							success: (payRes) => {
-								console.log('success:' + JSON.stringify(payRes));
+						if (res.isSuccess) {
+							if (res.data) {
+								uni.requestPayment({
+									provider: 'wxpay',
+									timeStamp: res.data.timeStamp,
+									nonceStr: res.data.nonceStr,
+									package: res.data.packageValue,
+									signType: res.data.signType,
+									paySign: res.data.paySign,
+									success: (payRes) => {
+										console.log('success:' + JSON.stringify(payRes));
+										uni.reLaunch({
+											url: '/pagesMain/paySuccess'
+										});
+									},
+									fail: (error) => {
+										console.log('fail:' + JSON.stringify(error));
+										this.$refs.uTips.show({
+											title: '支付失败',
+											type: 'warning',
+										})
+										setTimeout(() => {
+											uni.reLaunch({
+												url: '/pagesMain/orderList?type=' + 1
+											});
+										}, 1000)
+									}
+								})
+							} else {
 								uni.reLaunch({
 									url: '/pagesMain/paySuccess'
 								});
-							},
-							fail: (error) => {
-								console.log('fail:' + JSON.stringify(error));
-								this.$refs.uTips.show({
-									title: '支付失败',
-									type: 'warning',
-								})
 							}
-						})
+						}
 					}).catch(error => {
+						console.log('error提交订单失败:', error);
 						this.$refs.uTips.show({
-							title: '提交订单失败',
+							title: error.data.msg,
 							type: 'warning',
 						})
 					})

+ 12 - 3
pagesMain/entrustList.vue

@@ -64,9 +64,18 @@
 					pageIndex: this.pageIndex,
 					pageSize: 10,
 				}, 'POST').then(res => {
-					this.isOver = res.data.list.length != 10
-					this.plantList = this.plantList.concat(res.data.list)
-					this.entrustTotle = res.data.total
+					if (res.isSuccess) {
+						if (res.data.list.length) {
+							this.isOver = res.data.list.length != 10
+							this.plantList = this.plantList.concat(res.data.list)
+							this.entrustTotle = res.data.total
+						} else {
+							this.$refs.uTips.show({
+								title: '当前无委托订单',
+								type: 'warning',
+							})
+						}
+					}
 				}).catch(error => {
 					this.$refs.uTips.show({
 						title: '获取委托列表失败',

+ 26 - 13
pagesMain/orderDetail.vue

@@ -44,7 +44,7 @@
 				<u-cell-group :border="false">
 					<u-cell-item title="商品金额" :value="'¥' + orderData.orderSum" :arrow="false" :border-bottom="false"></u-cell-item>
 					<u-cell-item title="积分抵扣" :value="'-¥' + orderData.integralAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1"></u-cell-item>
-					<u-cell-item title="优惠" :value="'-¥' + orderData.couponDiscountAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1"></u-cell-item>
+					<u-cell-item title="优惠" :value="'-¥' + orderData.couponDiscountAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1"></u-cell-item>
 					<u-cell-item title="备注" :value="orderData.notes" :arrow="false" :border-bottom="false"></u-cell-item>
 				</u-cell-group>
 			</view>
@@ -79,7 +79,7 @@
 			<view class="info-content-box">
 				<view class="order-info-row">订单编号:{{orderData.orderCode}}</view>
 				<view class="order-info-row">创建时间:{{orderData.addOrderTime}}</view>
-				<view class="order-info-row" v-if="orderData.orderStatus > 1 && orderData.orderStatus != 6">支付时间:{{orderData.payTime}}</view>
+				<view class="order-info-row" v-if="orderData.orderStatus > 1 && orderData.orderStatus != 6">支付时间:{{orderData.payTime ? orderData.payTime : orderData.addOrderTime}}</view>
 				<view class="order-info-row" v-if="orderData.orderStatus > 2 && orderData.orderStatus != 6">发货时间:{{orderData.sendTime}}</view>
 				<view class="order-info-row" v-if="orderData.orderStatus > 3 && orderData.orderStatus != 6">收货时间:{{orderData.confirmTime}}</view>
 				<view class="order-info-row" v-if="orderData.orderStatus == 6">取消时间:{{orderData.cancelTime}}</view>
@@ -159,15 +159,27 @@
 						}]
 						break;
 					case '2':
-						this.buttonGroup = [{
-							text: '申请售后',
-							backgroundColor: '#75BD60',
-							color: '#fff'
-						}, {
-							text: '自助采摘',
-							backgroundColor: '#52A63A',
-							color: '#fff'
-						}]
+					    var someVaule = this.orderData.merchantInfoResVO.products.some(v => {
+							Number(v.productType)
+							return v.productType == 1
+						})
+					    if (!someVaule) {
+						    this.buttonGroup = [{
+						    	text: '申请售后',
+						    	backgroundColor: '#75BD60',
+						    	color: '#fff'
+						    }, {
+						    	text: '自助采摘',
+						    	backgroundColor: '#52A63A',
+						    	color: '#fff'
+						    }]
+						} else {
+							this.buttonGroup = [{
+								text: '申请售后',
+								backgroundColor: '#75BD60',
+								color: '#fff'
+							}]
+						}
 						break;
 					case '3':
 						this.buttonGroup = [{
@@ -205,19 +217,20 @@
 						color: '#fff'
 					})
 				}
+			this.getOrderType()
 			}).catch(error => {
 				this.$refs.uTips.show({
 					title: error.data.msg,
 					type: 'warning',
 				})
 			})
-			this.getOrderType()
+			// this.getOrderType()
 		},
 		onShow() {},
 		methods: {
 			//  获取订单类型
 			getOrderType() {
-				switch (this.orderData.orderStatus) {
+				switch (this.orderData.orderStatus) {					
 					case 1:
 						this.orderType = {
 							title: '等待买家付款',

+ 2 - 2
pagesMain/orderItem.vue

@@ -28,8 +28,8 @@
 			 v-if="tabIndex == 2" @click.stop="handleOrder(1)">取消订单</u-button>
 			<u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
 			 v-if="tabIndex == 2" @click.stop="handleOrder(2)">立即支付</u-button>
-			<u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
-			 v-if="tabIndex != 1 && tabIndex != 2" @click.stop="handleOrder(3)">申请售后</u-button>
+			<!-- <u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
+			 v-if="tabIndex != 1 && tabIndex != 2" @click.stop="handleOrder(3)">申请售后</u-button> -->
 			<u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
 			 v-if="tabIndex == 3 && pickHandle" @click.stop="handleOrder(4)">自助采摘</u-button>
 			<u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"

+ 12 - 2
pagesMain/plantList.vue

@@ -50,9 +50,19 @@
 					pageIndex: this.pageIndex,
 					pageSize: 10,
 				}, 'GET').then(res => {
-					this.isOver = res.data.list.length != 10
-					this.plantList = this.plantList.concat(res.data.list)
+					if (res.isSuccess) {
+						if (res.data.list) {
+							this.isOver = res.data.list.length != 10
+							this.plantList = this.plantList.concat(res.data.list)
+						} else {
+							this.$refs.uTips.show({
+								title: res.msg,
+								type: 'warning',
+							})
+						}
+					}
 				}).catch(error => {
+					console.log(error)
 					this.$refs.uTips.show({
 						title: '获取共享种植列表失败',
 						type: 'warning',