Browse Source

'最后的优惠卷BUG'

hfll
hflllll 2 months ago
parent
commit
781f3c9625
10 changed files with 307 additions and 172 deletions
  1. +22
    -0
      api/model/order.js
  2. +1
    -1
      components/order/OrderItem.vue
  3. +94
    -50
      mixins/order.js
  4. +39
    -43
      pages/index/cart.vue
  5. +7
    -6
      pages/index/order.vue
  6. +36
    -20
      pages_order/components/order/placeOrder.vue
  7. +5
    -2
      pages_order/mine/coupon.vue
  8. +27
    -4
      pages_order/mine/unbindTeam.vue
  9. +63
    -43
      pages_order/order/cartOrder.vue
  10. +13
    -3
      pages_order/order/newOrderDetail.vue

+ 22
- 0
api/model/order.js View File

@ -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',


+ 1
- 1
components/order/OrderItem.vue View File

@ -25,7 +25,7 @@
<view class="order-time">下单时间{{ order.createTime }}</view>
<view class="order-price">
<text>合计:</text>
<text class="price">{{ order.priceAll }}</text>
<text class="price">{{ order.pricePay }}</text>
</view>
</view>


+ 94
- 50
mixins/order.js View File

@ -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()
// })
// }
// }
// })
// },
}
}

+ 39
- 43
pages/index/cart.vue View File

@ -1,7 +1,12 @@
<template>
<view class="page">
<navbar></navbar>
<text class="control-text" @tap="isManaged = !isManaged">{{ isManaged ? '退出管理' : '管理' }}</text>
<!-- 白色字体 -->
<navbar title="购物车" color="#fff" />
<!-- 悬浮管理按钮 -->
<view class="float-manage-btn" @tap="isManaged = !isManaged" v-if="cartData.records && cartData.records.length">
<text>{{ isManaged ? '完成' : '管理' }}</text>
</view>
<view class="cart-items">
<uv-checkbox-group shape="circle" v-model="checkboxValue">
@ -53,10 +58,6 @@
<text v-if="!isManaged" style="font-size: 24rpx; color: #999;">已选{{ checkboxValue.length }}</text>
<text v-if="!isManaged">合计</text>
<text v-if="!isManaged" class="total-price">¥{{ (totalPrice).toFixed(2) }}</text>
<!-- <view v-if="isManaged" class="checkout-btn checkbox-collect" @tap="addCollect">
<text>添加收藏</text>
</view> -->
</view>
<view v-if="!isManaged" class="checkout-btn checkbox-primary" @tap="checkout">
<text>去下单</text>
@ -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 {
<style lang="scss" scoped>
.page {
// background-color: #f5f5f5;
// padding-bottom: 120rpx;
// background-color: red;
position: relative;
.cart-items {
.cart-item {
@ -338,7 +324,7 @@ export default {
justify-content: flex-end;
font-size: 28rpx;
margin-right: 20rpx;
// background-color: red;
.total-price {
color: $uni-color-second;
font-size: 32rpx;
@ -365,14 +351,24 @@ export default {
background-color: $uni-color-fourth;
}
}
.control-text{
position: absolute;
right: 150rpx;
top: calc(env(safe-area-inset-bottom) + 40rpx);
font-size: 26rpx;
color: #fff;
z-index: 10000;
/* 悬浮管理按钮 */
.float-manage-btn {
position: fixed;
right: 30rpx;
top: 200rpx;
padding: 15rpx 30rpx;
background-color: rgba(255, 255, 255, 0.9);
border-radius: 40rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
z-index: 100;
border: 2rpx solid #019245;
text {
font-size: 28rpx;
color: #019245;
font-weight: 500;
}
}
}
</style>

+ 7
- 6
pages/index/order.vue View File

@ -6,8 +6,8 @@
<!-- 搜索框 -->
<view style="background-color: #fff; padding: 12rpx 20rpx 0rpx; ">
<uv-search placeholder="搜索商品名" v-model="keyword" :showAction="false" actionText="" height="80rpx" animation
bgColor="#F5F5F5" inputAlign="center" color="#000" placeholderColor="#979797"
searchIconSize="50rpx" @search="handleSearch"></uv-search>
bgColor="#F5F5F5" inputAlign="center" color="#000" placeholderColor="#979797" searchIconSize="50rpx"
@search="handleSearch" @clickIcon="handleSearch" />
</view>
<!-- 订单筛选 -->
@ -34,8 +34,9 @@
<!-- 订单列表 -->
<view class="order-list" v-else>
<OrderItem v-for="(order, index) in orderList" :key="order.id" :order="order" @cancel="handleCancelOrder(order.id)"
@pick="handlePickOrder(order.id)" @pay="goToOrderDetail(order)" @click="goToOrderDetail(order)" />
<OrderItem v-for="(order, index) in orderList" :key="order.id" :order="order"
@cancel="handleCancelOrder(order.id)" @pick="handlePickOrder(order.id)" @pay="goToOrderDetail(order)"
@click="goToOrderDetail(order)" />
<view style="margin-top: 200rpx; min-width: 700rpx;">
<uv-empty mode="order" v-if="orderList.length == 0" />
</view>
@ -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


+ 36
- 20
pages_order/components/order/placeOrder.vue View File

@ -7,14 +7,13 @@
<image src="@/static/image/多人下单.webp" mode="aspectFit" class="place-order-title-image" />
<text class="number">{{ item.sales }}</text><text class="text">人下单</text>
<view class="place-order-title-close" @click="close">
<uv-icon name="close" size="40rpx"></uv-icon>
<uv-icon name="close" size="40rpx" />
</view>
</view>
<!-- 选择取餐地点 -->
<view class="place-order-address" @click="gotoPickupPoint">
<uv-icon name="map-fill" color="#019245" size="55rpx">
</uv-icon>
<uv-icon name="map-fill" color="#019245" size="55rpx" />
<text style="font-size: 42rpx;" v-show="!pickupPoint">
请选择取餐地点
@ -23,11 +22,11 @@
<view class="place-order-address-content-name">
{{ pickupPoint.name }}{{ pickupPoint.phone }}
</view>
<view class="place-order-address-content-address"> {{ pickupPoint.area }} {{ pickupPoint.address }} </view>
<view class="place-order-address-content-address"> {{ pickupPoint.area }} {{ pickupPoint.address
}} </view>
</view>
<view class="place-order-address-arrow">
<uv-icon name="arrow-right" size="40rpx">
</uv-icon>
<uv-icon name="arrow-right" size="40rpx" />
</view>
</view>
@ -38,7 +37,8 @@
<image :src="item.image" mode="aspectFill" class="item-image"></image>
<view style="font-size: 36rpx;">
<view>{{ item.name }}</view>
<view style="color: red; ">{{ item.price }}</view>
<view style="color: red; ">{{ priceAll }}</view>
<view style="color: red; ">实付{{ pricePay }}</view>
<view style="margin-top: 30rpx;">
<uv-number-box v-model="value" button-size="36"></uv-number-box>
</view>
@ -47,7 +47,7 @@
<!-- 选项框 -->
<uv-radio-group v-model="payMethod">
<view class="option-box" >
<view class="option-box">
<view class="option-box-item">
<uv-icon name="weixin-circle-fill" size="70rpx" color="#019245" />
<text style="flex: 1;">
@ -59,9 +59,10 @@
<uv-icon name="red-packet" size="70rpx" color="#019245" />
<text style="flex: 1;">
账户余额
<text style="color: gray; margin-left: 20rpx;">(余额: {{ userInfo.balance ? userInfo.balance.toFixed(2) : 0 }})</text>
<text style="color: gray; margin-left: 20rpx;">(余额: {{ userInfo.balance ?
userInfo.balance.toFixed(2) : 0 }})</text>
</text>
<uv-radio activeColor="#019245" size="40rpx" name="1" />
<uv-radio activeColor="#019245" size="40rpx" name="1" :disabled="userInfo.balance < pricePay" />
</view>
</view>
</uv-radio-group>
@ -72,9 +73,11 @@
<view class="discount">
<text style="font-size: 35rpx;">优惠</text>
<view style="display: flex; align-items: center; gap: 20rpx" @click="gotoCoupon">
<image src="@/static/image/券.webp" mode="aspectFill" class="discount-image" />
<text>{{ couponData.couponId_dictText || '请选择您的优惠卷' }}</text>
<text style="color: red;">-{{ couponData.discount || 0 }}</text>
<image src="@/static/image/券.webp" mode="aspectFill" class="discount-image"
v-if="couponData.id" />
<text v-if="couponData.id">{{ couponData.couponId_dictText || '优惠卷' }}</text>
<text v-else style="color: gray;">请选择您的优惠卷</text>
<text style="color: red;" v-if="couponData.discount">-{{ couponData.discount || 0 }}</text>
</view>
</view>
@ -102,7 +105,7 @@
</template>
<script>
import { mapState } from 'vuex'
import { mapState, mapMutations } from 'vuex'
export default {
name: 'placeOrder',
data() {
@ -122,16 +125,19 @@ export default {
},
computed: {
...mapState(['userInfo']),
...mapState(['couponData']),
...mapState(['userInfo', 'couponData']),
priceAll () {
return this.item.price * this.value
},
goodss () {
return `${this.item.id},${this.value},${this.priceAll};`
},
pricePay () {
return (this.priceAll - ( this.couponData.discount || 0 )) > 0 ? (this.priceAll - ( this.couponData.discount || 0 )) : 0.01
}
},
methods: {
...mapMutations(['clearCouponData']),
//
gotoCoupon() {
this.$utils.navigateTo('/pages_order/mine/coupon?usein=1')
@ -186,11 +192,11 @@ export default {
})
this.$api('createOrder', {
priceAll: this.priceAll,
pricePay: this.priceAll - ( this.couponData.discount || 0 ),
pricePay: this.pricePay,
pricePreferential: this.couponData.discount || 0,
payType: this.payMethod,
leaderId: this.pickupPoint.id,
couponId: this.couponData.id || '',
userCouponId: this.couponData.id || '',
goodss: this.goodss,
remark: this.remark
}, res => {
@ -199,16 +205,25 @@ export default {
if (this.payMethod == '0') {
uni.requestPaymentWxPay(res)
.then(n => {
setTimeout(uni.redirectTo, 700, {
setTimeout(uni.redirectTo, 500, {
url: '/pages/index/order?tabIndex=1'
})
})
.catch(err => {
uni.showToast({
title: '支付失败',
icon: 'error'
})
setTimeout(uni.redirectTo, 500, {
url: '/pages/index/order?tabIndex=0'
})
})
}else {
uni.showToast({
title: '下单成功',
icon: 'success'
})
setTimeout(uni.redirectTo, 700, {
setTimeout(uni.redirectTo, 500, {
url: '/pages/index/order?tabIndex=1'
})
}
@ -221,6 +236,7 @@ export default {
},
beforeDestroy() {
uni.$off('updatePickupPoint');
this.clearCouponData();
}
}
</script>


+ 5
- 2
pages_order/mine/coupon.vue View File

@ -4,7 +4,7 @@
<navbar title="优惠券" leftClick @leftClick="$utils.navigateBack" bgColor="#019245" color="#fff" />
<!-- 标签页 -->
<uv-sticky bgColor="#fff">
<uv-sticky bgColor="#fff" v-if="!usein">
<uv-tabs :list="tabs" @change="changeTab" :scrollable="false" lineColor="#019245"
:activeStyle="{color: '#019245' }" lineWidth="80" lineHeight="6" :inactiveStyle="{color: '#333'}"
:itemStyle="{height: '90rpx'}" />
@ -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


+ 27
- 4
pages_order/mine/unbindTeam.vue View File

@ -23,7 +23,10 @@
<text>{{ currentPickupPoint.phone }}</text>
</view>
</view>
<view class="select-btn" @click="deleteLeader">
<view v-if="currentPickupPoint.bindStatus == '0'" class="cancel-btn" disabled>
<text>解绑中...</text>
</view>
<view v-else class="select-btn" @click="deleteLeader">
<text>解绑</text>
</view>
@ -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;


+ 63
- 43
pages_order/order/cartOrder.vue View File

@ -68,7 +68,7 @@
<view class="discount-item" @click="gotoCoupon">
<view class="discount-left">
<image src="@/static/image/券.webp" mode="aspectFill" class="coupon-icon" v-if="couponData.couponId" />
<view :style="{ color: couponData.couponId ? 'inherit' : '#ccc' }">{{ couponData.couponId_dictText || '点击选择优惠卷->' }}
<view :style="{ color: couponData.couponId ? 'inherit' : 'gray' }">{{ couponData.couponId_dictText || '请选择优惠卷' }}
</view>
<text class="discount-amount">{{ couponData.discount ? ('-' + couponData.discount) : '' }}</text>
</view>
@ -81,7 +81,7 @@
<text>备注</text>
</view>
<view class="remark-content">
<input type="text" v-model="orderDetail.remark"
<input type="text" v-model="remark"
placeholder="请输入您要备注的内容" placeholder-style="font-size: 28rpx" />
</view>
</view>
@ -94,11 +94,10 @@
<text class="payment-name">微信支付</text>
<uv-radio activeColor="#019245" size="40rpx" name="0" />
</view>
<view class="payment-item">
<view class="payment-item" >
<uv-icon name="red-packet" size="70rpx" color="#019245" />
<text class="payment-name">账户余额<text class="balance-text">(余额: {{ userInfo.balance
}})</text></text>
<uv-radio activeColor="#019245" size="40rpx" name="1" />
<text class="payment-name">账户余额<text class="balance-text">(余额: {{ (userInfo.balance || 0).toFixed(2) || 0 }})</text></text>
<uv-radio activeColor="#019245" size="40rpx" name="1" :disabled="userInfo.balance < pricePay"/>
</view>
</view>
</uv-radio-group>
@ -112,7 +111,7 @@
</text>
<text class="total-price">{{ (pricePay || 0).toFixed(2) || 0 }}</text>
</view>
<view class="pay-button" @tap="handlePay">立即下单</view>
<view class="pay-button" @tap="handlePay(orderParams)">立即下单</view>
</view>
</view>
</view>
@ -120,8 +119,10 @@
<script>
import navbar from '@/components/base/navbar.vue'
import order from '@/mixins/order.js'
import { mapState, mapMutations } from 'vuex'
export default {
mixins: [order],
components: {
navbar
},
@ -131,6 +132,7 @@ export default {
showAllFoods: false,
teamLeader: {},
thePriceAll: 0,
remark: ''
}
},
computed: {
@ -140,13 +142,27 @@ export default {
},
pricePay() {
return this.cartData.priceAll - (this.couponData.discount || 0)
return (this.cartData.priceAll - (this.couponData.discount || 0)) > 0.01 ? (this.cartData.priceAll - (this.couponData.discount || 0)) : 0.01
},
// goodId,goodNum;goodId2,goodsNum
goodss() {
return this.cartData.sendData.map(item => {
return `${item.goodsId},${item.num},${item.goods.price * item.num}`
}).join(';')
},
//
orderParams() {
return {
priceAll: this.cartData.priceAll,
pricePay: this.pricePay,
pricePreferential: this.couponData.discount || 0,
payType: this.payMethod,
leaderId: this.teamLeader.id,
goodss: this.goodss,
userCouponId: this.couponData.couponId || '',
remark: this.remark || ''
}
}
},
@ -154,7 +170,7 @@ export default {
this.getLeaderData()
},
onHide() {
beforeDestroy() {
this.clearCouponData()
},
methods: {
@ -194,40 +210,44 @@ export default {
})
},
//
handlePay() {
uni.showLoading({
title: '支付处理中...'
})
this.$api('createOrder', {
priceAll: this.cartData.priceAll,
pricePay: this.pricePay,
pricePreferential: this.couponData.discount || 0,
payType: this.payMethod,
leaderId: this.teamLeader.id,
goodss: this.goodss
}, 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'
})
})
} else {
uni.showToast({
title: '下单成功',
icon: 'success'
})
setTimeout(uni.redirectTo, 700, {
url: '/pages/index/order?tabIndex=1'
})
}
}
})
},
// handlePay() {
// uni.showLoading({
// title: '...'
// })
// this.$api('createOrder', {
// ...this.orderParams
// }, 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: 'success'
// })
// setTimeout(uni.redirectTo, 700, {
// url: '/pages/index/order?tabIndex=1'
// })
// }
// }
// })
// },
//
gotoCoupon() {
//


+ 13
- 3
pages_order/order/newOrderDetail.vue View File

@ -77,7 +77,7 @@
<image src="@/static/image/券.webp" mode="aspectFill" class="coupon-icon" />
<view>新用户立减</view>
</view>
<text v-if="orderDetail.pricePreferential" class="discount-amount">{{orderDetail.pricePreferential}}</text>
<text v-if="orderDetail.pricePreferential" class="discount-amount"> - {{orderDetail.pricePreferential}}</text>
<text v-else class="none-discount-amount">未使用优惠卷</text>
</view>
@ -167,6 +167,7 @@
this.getOrderDetail(options.id)
}
},
methods: {
...mapMutations([ 'clearCouponData']),
//
@ -200,11 +201,20 @@
if (res.code === 200) {
if (this.payMethod == '0') {
uni.requestPaymentWxPay(res)
.then(( ) => {
setTimeout(uni.redirectTo, 700, {
.then(n => {
setTimeout(uni.redirectTo, 500, {
url: '/pages/index/order?tabIndex=1'
})
})
.catch(err => {
uni.showToast({
title: '支付失败',
icon: 'error'
})
setTimeout(uni.redirectTo, 500, {
url: '/pages/index/order?tabIndex=0'
})
})
} else {
uni.showModal({
title: '提示',


Loading…
Cancel
Save