|
|
@@ -1,36 +1,36 @@
|
|
|
<template>
|
|
|
<div class="container">
|
|
|
- <subOrder
|
|
|
- :list="userOrderDetailList"
|
|
|
- :productMoney="productMoney"
|
|
|
- :type="pageType"
|
|
|
- @changeMessage="changeMessage"
|
|
|
- ></subOrder>
|
|
|
+ <subOrder :list="userOrderDetailList" :productMoney="productMoney"
|
|
|
+ :type="pageType" @changeMessage="changeMessage"></subOrder>
|
|
|
|
|
|
<div class="card">
|
|
|
<div class="cardItem">
|
|
|
<div class="name">支付方式</div>
|
|
|
- <!-- <div class="val">微信支付</div> -->
|
|
|
- <div class="val">
|
|
|
+ <div class="val">微信支付</div>
|
|
|
+ <!-- <div class="val">
|
|
|
余额支付
|
|
|
<small>(测试阶段)</small>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
<div v-if="pageType == 'submit'">
|
|
|
<div class="cardItem">
|
|
|
<div class="name">优惠券</div>
|
|
|
<!-- <div class="val">微信支付</div> -->
|
|
|
<div class="val" @click="goUse">
|
|
|
- <span class="youhui" v-if="couponId">-{{couponMoney}}</span>
|
|
|
- <span class="canUse" v-else-if="canUseLength>0">{{canUseLength}}张优惠券可用</span>
|
|
|
+ <span class="youhui"
|
|
|
+ v-if="couponId">-{{couponMoney}}</span>
|
|
|
+ <span class="canUse"
|
|
|
+ v-else-if="canUseLength>0">{{canUseLength}}张优惠券可用</span>
|
|
|
<span class="cantUse" v-else>无可用优惠券</span>
|
|
|
- <img class="more" src="/static/images/icon_inter.png" alt />
|
|
|
+ <img class="more" src="/static/images/icon_inter.png"
|
|
|
+ alt />
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="cardItem" v-if="activeMoney">
|
|
|
<div class="name">
|
|
|
- <img src="/static/images/icon_manjian.png" class='logo' alt="">
|
|
|
+ <img src="/static/images/icon_manjian.png" class='logo'
|
|
|
+ alt="">
|
|
|
<span>店铺满减优惠</span>
|
|
|
</div>
|
|
|
<!-- <div class="val">微信支付</div> -->
|
|
|
@@ -42,7 +42,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="tip">tips:测试阶段:支付用余额支付先行测试,余额默认无穷</div>
|
|
|
+ <!-- <div class="tip">tips:测试阶段:支付用余额支付先行测试,余额默认无穷</div> -->
|
|
|
|
|
|
<div class="fixBottom">
|
|
|
<span>总价:</span>
|
|
|
@@ -77,7 +77,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState(["userInfo", "couponId"]),
|
|
|
+ ...mapState(["userInfo", "couponId", "miniId"]),
|
|
|
productMoney() {
|
|
|
var money = 0;
|
|
|
if (this.pageType == "submit") {
|
|
|
@@ -422,8 +422,8 @@ export default {
|
|
|
this.delCart(0);
|
|
|
}
|
|
|
|
|
|
- if(this.couponId){
|
|
|
- data.userCouponId=this.couponId
|
|
|
+ if (this.couponId) {
|
|
|
+ data.userCouponId = this.couponId;
|
|
|
}
|
|
|
|
|
|
this.$http
|
|
|
@@ -464,28 +464,55 @@ export default {
|
|
|
mask: true
|
|
|
});
|
|
|
this.$http
|
|
|
- .post("userOrder/pay", {
|
|
|
+ .get("wx/unifiedOrder", {
|
|
|
orderId: this.orderId,
|
|
|
- coin: info.dealPrice,
|
|
|
+ coin: 0,
|
|
|
point: 0,
|
|
|
- cash: 0
|
|
|
+ cash: info.dealPrice,
|
|
|
+ openId: this.userInfo.openId,
|
|
|
+ miniId: this.miniId
|
|
|
})
|
|
|
.then(res => {
|
|
|
wx.hideLoading();
|
|
|
+
|
|
|
+ var that = this;
|
|
|
+
|
|
|
+ wx.requestPayment({
|
|
|
+ timeStamp: res.timestamp,
|
|
|
+ nonceStr: res.noncestr,
|
|
|
+ package: res.package,
|
|
|
+ signType: "HMAC-SHA256",
|
|
|
+ paySign: res.sign,
|
|
|
+ success(res) {
|
|
|
+ wx.redirectTo({
|
|
|
+ url:
|
|
|
+ "/pages/successPage/successPage?pageType=paySuccess&orderId=" +
|
|
|
+ that.orderId
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail(res) {
|
|
|
+ console.log(res);
|
|
|
+ wx.showToast({
|
|
|
+ title: "支付失败",
|
|
|
+ icon: "none",
|
|
|
+ duration: 1500
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ wx.navigateBack();
|
|
|
+ }, 1500);
|
|
|
+ }
|
|
|
+ });
|
|
|
if (res.success) {
|
|
|
- wx.redirectTo({
|
|
|
- url:
|
|
|
- "/pages/successPage/successPage?pageType=paySuccess&orderId=" +
|
|
|
- this.orderId
|
|
|
- });
|
|
|
+ // wx.redirectTo({
|
|
|
+ // url:
|
|
|
+ // "/pages/successPage/successPage?pageType=paySuccess&orderId=" +
|
|
|
+ // this.orderId
|
|
|
+ // });
|
|
|
// wx.showToast({
|
|
|
// title: '支付成功',
|
|
|
// icon: 'success',
|
|
|
// duration: 1500,
|
|
|
// });
|
|
|
- // setTimeout(() => {
|
|
|
- // wx.navigateBack();
|
|
|
- // }, 1500);
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: res.error,
|
|
|
@@ -529,7 +556,7 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
|
|
|
- .logo{
|
|
|
+ .logo {
|
|
|
width: 28px;
|
|
|
height: 16px;
|
|
|
margin-right: 6px;
|