diff --git a/api/model/order.js b/api/model/order.js
index 579550b..7b81393 100644
--- a/api/model/order.js
+++ b/api/model/order.js
@@ -14,6 +14,28 @@ const api = {
method: 'GET',
limit: 500
},
+
+ // 优惠券-领取优惠券
+ fetchCoupon: {
+ url: '/teambuy/coupon/fetchCoupon',
+ method: 'POST',
+ limit: 500
+ },
+
+ // 优惠券-查看可领取的优惠券
+ queryFetchCouponList: {
+ url: '/teambuy/coupon/queryFetchCouponList',
+ method: 'GET',
+ limit: 500
+ },
+
+ // 优惠券-使用优惠券
+ // useCoupon: {
+ // url: '/teambuy/coupon/useCoupon',
+ // method: 'POST',
+ // limit: 500
+ // },
+
// 订单- 查询团餐订单列表 - 详情
queryLeaderOrderList: {
url: '/teambuy/order/queryLeaderOrderList',
diff --git a/components/order/OrderItem.vue b/components/order/OrderItem.vue
index d41da98..4027d10 100644
--- a/components/order/OrderItem.vue
+++ b/components/order/OrderItem.vue
@@ -25,7 +25,7 @@
下单时间:{{ order.createTime }}
合计:
- ¥{{ order.priceAll }}
+ ¥{{ order.pricePay }}
diff --git a/mixins/order.js b/mixins/order.js
index b1650dd..5306c24 100644
--- a/mixins/order.js
+++ b/mixins/order.js
@@ -8,63 +8,107 @@ export default {
computed: {
},
methods: {
- // 立即支付
- toPayOrder(item){
- let api = ''
-
- // if([0, 1].includes(item.shopState)){
- // api = 'createOrderTwo'
- // }else{
- api = 'createSumOrderAgain'
- // }
-
- this.$api(api, {
- orderId : item.id,
- addressId : item.addressId
+ // 支付接口
+ handlePay(orderParams) {
+ uni.showLoading({
+ title: '支付处理中...'
+ })
+ if (!orderParams.userCouponId) {
+ // 没有优惠卷 则不传
+ delete orderParams.userCouponId
+ }
+ this.$api('createOrder', {
+ ...orderParams
}, res => {
- if(res.code == 200){
- uni.requestPaymentWxPay(res)
- .then(res => {
+ uni.hideLoading()
+ if (res.code === 200) {
+ if (this.payMethod == '0') {
+ uni.requestPaymentWxPay(res)
+ .then(n => {
+ setTimeout(uni.redirectTo, 700, {
+ url: '/pages/index/order?tabIndex=1'
+ })
+ })
+ .catch(err => {
+ uni.showToast({
+ title: '支付失败',
+ icon: 'error'
+ })
+ setTimeout(uni.redirectTo, 700, {
+ url: '/pages/index/order?tabIndex=0'
+ })
+ })
+ } else {
uni.showToast({
- title: '支付成功',
- icon: 'none'
+ title: '下单成功',
+ icon: 'success'
})
- this.getData()
- }).catch(n => {
- this.getData()
- })
- }
- })
- },
- // 确认收货
- confirmOrder(item){
- uni.showModal({
- title: '您收到货了吗?',
- success : e => {
- if(e.confirm){
- this.$api('confirmOrder', {
- orderId : item.id,
- }, res => {
- this.getData()
- })
- }
- }
- })
- },
- // 取消订单
- cancelOrder(item){
- uni.showModal({
- title: '确认取消订单吗?',
- success : e => {
- if(e.confirm){
- this.$api('cancelOrder', {
- orderId : item.id,
- }, res => {
- this.getData()
+ setTimeout(uni.redirectTo, 700, {
+ url: '/pages/index/order?tabIndex=1'
})
}
}
})
},
+
+
+ // 立即支付
+ // toPayOrder(item){
+ // let api = ''
+
+ // // if([0, 1].includes(item.shopState)){
+ // // api = 'createOrderTwo'
+ // // }else{
+ // api = 'createSumOrderAgain'
+ // // }
+
+ // this.$api(api, {
+ // orderId : item.id,
+ // addressId : item.addressId
+ // }, res => {
+ // if(res.code == 200){
+ // uni.requestPaymentWxPay(res)
+ // .then(res => {
+ // uni.showToast({
+ // title: '支付成功',
+ // icon: 'none'
+ // })
+ // this.getData()
+ // }).catch(n => {
+ // this.getData()
+ // })
+ // }
+ // })
+ // },
+ // 确认收货
+ // confirmOrder(item){
+ // uni.showModal({
+ // title: '您收到货了吗?',
+ // success : e => {
+ // if(e.confirm){
+ // this.$api('confirmOrder', {
+ // orderId : item.id,
+ // }, res => {
+ // this.getData()
+ // })
+ // }
+ // }
+ // })
+ // },
+ // // 取消订单
+ // cancelOrder(item){
+ // uni.showModal({
+ // title: '确认取消订单吗?',
+ // success : e => {
+ // if(e.confirm){
+ // this.$api('cancelOrder', {
+ // orderId : item.id,
+ // }, res => {
+ // this.getData()
+ // })
+ // }
+ // }
+ // })
+ // },
}
}
\ No newline at end of file
diff --git a/pages/index/cart.vue b/pages/index/cart.vue
index d5c4cf2..d50f870 100644
--- a/pages/index/cart.vue
+++ b/pages/index/cart.vue
@@ -1,7 +1,12 @@
-
- {{ isManaged ? '退出管理' : '管理' }}
+
+
+
+
+
+ {{ isManaged ? '完成' : '管理' }}
+
@@ -53,10 +58,6 @@
已选{{ checkboxValue.length }}个,
合计
¥{{ (totalPrice).toFixed(2) }}
-
-
去下单
@@ -105,7 +106,7 @@ export default {
}, 0)
},
deleteCartIds(){
- return this.checkboxValue.join(';')
+ return this.checkboxValue.join(',')
}
},
methods: {
@@ -134,12 +135,10 @@ export default {
}else{
this.checkboxValue = this.cartData.records.map(item => item.id)
}
- // this.updateCart();
},
increaseQuantity(item) {
item.num += 1;
this.modifyCart(item, 1)
- // this.updateCart();
},
decreaseQuantity(item) {
if (item.num > 1) {
@@ -165,31 +164,20 @@ export default {
url: '/pages_order/order/cartOrder'
});
},
- // // 添加收藏
- // addCollect(){
- // if (!this.checkboxValue.length) {
- // uni.showToast({
- // title: '请选择商品',
- // icon: 'none'
- // });
- // return;
- // }
- // uni.showLoading({
- // title: '添加收藏中...'
- // })
- // setTimeout(() => {
- // uni.hideLoading()
- // uni.showToast({
- // title: '添加收藏成功',
- // })
- // // 编写收藏函数的调用
- // }, 800)
- // },
// 删除购物车
deleteCart(){
+ if (!this.checkboxValue.length) {
+ uni.showToast({
+ title: '请选择商品',
+ icon: 'error'
+ });
+ return;
+ }
+
uni.showModal({
title: '提示',
- content: '确定删除购物车?',
+ content: '确定删除所选商品?',
+ confirmColor: '#019245',
success: (res) => {
if (res.confirm) {
this.$api('deleteShopcar', {
@@ -199,9 +187,10 @@ export default {
uni.showToast({
title: '删除成功',
icon: 'success',
- duration: 1000
+ duration: 1000,
})
this.getCartData()
+ this.checkboxValue = []
}
})
}
@@ -217,9 +206,6 @@ export default {
diff --git a/pages/index/order.vue b/pages/index/order.vue
index 7dc7c21..7c28d12 100644
--- a/pages/index/order.vue
+++ b/pages/index/order.vue
@@ -6,8 +6,8 @@
+ bgColor="#F5F5F5" inputAlign="center" color="#000" placeholderColor="#979797" searchIconSize="50rpx"
+ @search="handleSearch" @clickIcon="handleSearch" />
@@ -34,8 +34,9 @@
-
+
@@ -197,9 +198,9 @@
}
},
methods: {
- handleSearch(value) {
+ handleSearch() {
this.$api('queryMemberOrderList', {
- title: value
+ title: this.keyword
}, res => {
if (res.code == 200) {
this.memberOrderList = res.result.records
diff --git a/pages_order/components/order/placeOrder.vue b/pages_order/components/order/placeOrder.vue
index 49883af..847b8c4 100644
--- a/pages_order/components/order/placeOrder.vue
+++ b/pages_order/components/order/placeOrder.vue
@@ -7,14 +7,13 @@
{{ item.sales }}人下单
-
+
-
-
+
请选择取餐地点
@@ -23,11 +22,11 @@
{{ pickupPoint.name }},{{ pickupPoint.phone }}
- {{ pickupPoint.area }} {{ pickupPoint.address }}
+ {{ pickupPoint.area }} {{ pickupPoint.address
+ }}
-
-
+
@@ -38,7 +37,8 @@
{{ item.name }}
- ¥{{ item.price }}
+ ¥{{ priceAll }}
+ 实付¥{{ pricePay }}
@@ -47,7 +47,7 @@
-
+
@@ -59,9 +59,10 @@
账户余额
- (余额: ¥{{ userInfo.balance ? userInfo.balance.toFixed(2) : 0 }})
+ (余额: ¥{{ userInfo.balance ?
+ userInfo.balance.toFixed(2) : 0 }})
-
+
@@ -72,9 +73,11 @@
优惠
-
- {{ couponData.couponId_dictText || '请选择您的优惠卷' }}
- -¥{{ couponData.discount || 0 }}
+
+ {{ couponData.couponId_dictText || '优惠卷' }}
+ 请选择您的优惠卷
+ -¥{{ couponData.discount || 0 }}
@@ -102,7 +105,7 @@
diff --git a/pages_order/mine/coupon.vue b/pages_order/mine/coupon.vue
index f0b5a21..0c64763 100644
--- a/pages_order/mine/coupon.vue
+++ b/pages_order/mine/coupon.vue
@@ -4,7 +4,7 @@
-
+
@@ -78,6 +78,7 @@ export default {
// 切换标签页
changeTab(item) {
this.currentTab = item.index
+ this.getCoupon()
},
// 使用优惠券
@@ -86,6 +87,7 @@ export default {
uni.showModal({
title: '提示',
content: `确定使用面值${coupon.discount}元的优惠券吗?`,
+ confirmColor: '#019245',
success: (res) => {
// 模拟使用优惠券
uni.showLoading({
@@ -115,7 +117,8 @@ export default {
getCoupon() {
this.$api('queryCouponList', {
pageNo: 1,
- pageSize: 10000
+ pageSize: 10000,
+ status: this.currentTab
}, res => {
if (res.code === 200){
this.allCoupons = res.result.records
diff --git a/pages_order/mine/unbindTeam.vue b/pages_order/mine/unbindTeam.vue
index af6b968..1b55b8c 100644
--- a/pages_order/mine/unbindTeam.vue
+++ b/pages_order/mine/unbindTeam.vue
@@ -23,7 +23,10 @@
{{ currentPickupPoint.phone }}
-
+
+ 解绑中...
+
+
解绑
@@ -107,8 +110,9 @@ export default {
uni.showToast({
title: `${res.message}`
})
+ this.getLeaderList()
}
- this.getLeaderList()
+
})
}
}
@@ -133,6 +137,7 @@ export default {
title: `${res.message}`,
icon: 'success',
})
+ this.getLeaderList()
}
})
}
@@ -142,15 +147,18 @@ export default {
},
getLeaderList() {
// this.currentPickupPoint = currentPickupPoint
+ // this.nearbyPickupPoints = []
+ // this.currentPickupPoint = {}
+ this.isBind = true
this.$api('queryLeaderList', {}, res => {
if (res.code == 200) {
this.nearbyPickupPoints = res.result.records
}
})
this.$api('queryMyLeader', {}, res => {
- if (res.code == 200) {
+ if (res.code == 200 && res.result.bindStatus !== '2') {
this.currentPickupPoint = res.result
- } else if (res.code == 500 || !res.result) {
+ } else if (res.code == 500 || !res.result || res.result.bindStatus == '2') {
this.isBind = false
}
})
@@ -241,6 +249,21 @@ export default {
transform: translateY(-50%);
}
+// 隔一层会灰雾雾的效果
+.cancel-btn {
+ background-color: $uni-color-second;
+ color: #fff;
+ width: 120rpx;
+ height: 60rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border-radius: 10rpx;
+ align-self: center;
+ font-size: 24rpx;
+ opacity: 0.7;
+}
+
.select-btn {
background-color: $uni-color;
color: #fff;
diff --git a/pages_order/order/cartOrder.vue b/pages_order/order/cartOrder.vue
index b6365ac..6564f6f 100644
--- a/pages_order/order/cartOrder.vue
+++ b/pages_order/order/cartOrder.vue
@@ -68,7 +68,7 @@
- {{ couponData.couponId_dictText || '点击选择优惠卷->' }}
+ {{ couponData.couponId_dictText || '请选择优惠卷' }}
{{ couponData.discount ? ('-' + couponData.discount) : '' }}
@@ -81,7 +81,7 @@
备注
@@ -94,11 +94,10 @@
微信支付
-
+
- 账户余额(余额: ¥{{ userInfo.balance
- }})
-
+ 账户余额(余额: ¥{{ (userInfo.balance || 0).toFixed(2) || 0 }})
+
@@ -112,7 +111,7 @@
¥{{ (pricePay || 0).toFixed(2) || 0 }}
- 立即下单
+ 立即下单
@@ -120,8 +119,10 @@