Fix:订单取消支付问题
This commit is contained in:
@@ -324,7 +324,10 @@ export default {
|
||||
}
|
||||
getGiftCardSendOrder(this.orderKey, params).then(res => {
|
||||
uni.hideLoading();
|
||||
|
||||
const data = res.data;
|
||||
this.giftKey = data.giftCard.code;
|
||||
this.orderId = data.result.orderId || ''
|
||||
switch (data.status) {
|
||||
case "ORDER_EXIST":
|
||||
case "EXTEND_ORDER":
|
||||
@@ -353,8 +356,6 @@ export default {
|
||||
duration: 2000
|
||||
});
|
||||
this.isPayOk = true;
|
||||
this.giftKey = data.giftCard.code;
|
||||
this.orderId = data.result.orderId || ''
|
||||
break;
|
||||
case "WECHAT_H5_PAY":
|
||||
// H5支付
|
||||
@@ -365,16 +366,24 @@ export default {
|
||||
break;
|
||||
case "WECHAT_PAY":
|
||||
// 小程序支付
|
||||
weappPay(data.result.jsConfig).finally(() => {
|
||||
weappPay(data.result.jsConfig).then((e) => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
this.isPayOk = true;
|
||||
this.giftKey = data.giftCard.code;
|
||||
this.orderId = data.result.orderId || ''
|
||||
});
|
||||
|
||||
}).catch(err => {
|
||||
this.makeAgain()
|
||||
uni.showToast({
|
||||
title: '支付取消,请在我的礼品卡中完成支付',
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
});
|
||||
}).finally(() => {
|
||||
|
||||
})
|
||||
break;
|
||||
|
||||
case "WECHAT_APP_PAY":
|
||||
|
||||
@@ -55,6 +55,18 @@
|
||||
赠言:{{ item.message || '' }}
|
||||
</view>
|
||||
<!-- 状态 0-待领取 1-已全部领取 2-已失效 -->
|
||||
<button
|
||||
v-if="item.status === -1"
|
||||
class="btn"
|
||||
@click="goBuy(item)"
|
||||
>
|
||||
待付款
|
||||
<image
|
||||
:src="webUrl + '/icon/icon-gift-share.png'"
|
||||
class="icon"
|
||||
mode="widthFix"
|
||||
/>
|
||||
</button>
|
||||
<button
|
||||
v-if="item.status === 0"
|
||||
open-type="share"
|
||||
@@ -162,23 +174,40 @@
|
||||
ref="giftTips"
|
||||
:richText="giftNotice"
|
||||
/>
|
||||
<Payment v-model="pay" :types="payType" @checked="toPay" :balance="userInfo.nowMoney"></Payment>
|
||||
<passkeyborad
|
||||
:money="orderInfo.payPrice"
|
||||
showMoney
|
||||
:show="isShowPayPwdPop"
|
||||
ref='payPwdPop'
|
||||
@close="pwdPopClose"
|
||||
@finish="pwdPopFinish"
|
||||
></passkeyborad>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard'
|
||||
import {cancelOrderHandle, payOrderHandle, takeOrderHandle, yuePayOrderHandle, delOrderHandle} from "@/libs/order";
|
||||
import Payment from "@/components/Payment";
|
||||
import {
|
||||
giftCardReceiveList,
|
||||
giftCardSendList,
|
||||
giftNotice
|
||||
} from '@/api/giftList'
|
||||
import {mapGetters} from "vuex";
|
||||
import giftTips from '@/pkg_user/views/gift/components/giftTips.vue'
|
||||
export default {
|
||||
name: 'GiftLisPage',
|
||||
components: {
|
||||
giftTips
|
||||
giftTips,
|
||||
passkeyborad,
|
||||
Payment
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pay: false,
|
||||
payType: ["yue", "weixin"],
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
giftNotice: '',
|
||||
cateIndex: 0,
|
||||
@@ -193,11 +222,15 @@ export default {
|
||||
}
|
||||
],
|
||||
isLoad: false,
|
||||
from: this.$deviceType,
|
||||
sendList: [],
|
||||
receiveList: [],
|
||||
giftItem: {}
|
||||
giftItem: {},
|
||||
orderInfo: {},
|
||||
isShowPayPwdPop: false,
|
||||
}
|
||||
},
|
||||
computed: mapGetters(["userInfo"]),
|
||||
created() {
|
||||
giftNotice().then(res => {
|
||||
this.giftNotice = res.data
|
||||
@@ -212,9 +245,44 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
pwdPopFinish(payPwd) {
|
||||
this.payPassword = payPwd;
|
||||
|
||||
this.toYuePay(payPwd);
|
||||
|
||||
this.isShowPayPwdPop = false;
|
||||
},
|
||||
toYuePay(payPwd) {
|
||||
//网络请求
|
||||
yuePayOrderHandle(this.orderInfo.orderId, "yue", this.from, payPwd).then(res => {
|
||||
console.log(res);
|
||||
this.getGiftCardSendList()
|
||||
this.payPassword = "";
|
||||
})
|
||||
},
|
||||
pwdPopClose() {
|
||||
this.isShowPayPwdPop = false;
|
||||
},
|
||||
wechatPay(type) {
|
||||
payOrderHandle(this.orderInfo.orderId, type, this.from).then(res => {
|
||||
console.log(res);
|
||||
this.getGiftCardSendList()
|
||||
})
|
||||
},
|
||||
goBuy(order) {
|
||||
this.pay = true
|
||||
this.orderInfo = order
|
||||
},
|
||||
toPay(type) {
|
||||
//余额支付需要输入支付密码
|
||||
if (type == "yue") {
|
||||
this.isShowPayPwdPop = true;
|
||||
return;
|
||||
} else {
|
||||
this.wechatPay(type);
|
||||
}
|
||||
},
|
||||
shareGift(item) {
|
||||
console.log(item);
|
||||
|
||||
this.giftItem = item
|
||||
},
|
||||
cateItemClickHanlde(item, index) {
|
||||
|
||||
Reference in New Issue
Block a user