|
@@ -44,7 +44,7 @@
|
|
</view>
|
|
</view>
|
|
<button class="bottomBtn" @click="pay()" :disabled="btnNo">确认支付</button>
|
|
<button class="bottomBtn" @click="pay()" :disabled="btnNo">确认支付</button>
|
|
|
|
|
|
- <u-modal v-model="showModal" confirm-text="返回购物车" cancel-text="知道了" cancel-color="#666666" confirm-color="rgba(0, 122, 255, 1);" :show-confirm-button="showConfirmButton" :show-cancel-button="true" :content="modalMsg" @cancel="modalCancel()" @confirm="modalConfirm()" ref="uModal" ></u-modal>
|
|
|
|
|
|
+ <u-modal v-model="showModal" :confirm-text="confirmText" cancel-text="知道了" cancel-color="#666666" confirm-color="rgba(0, 122, 255, 1);" :show-confirm-button="showConfirmButton" :show-cancel-button="true" :content="modalMsg" @cancel="modalCancel()" @confirm="modalConfirm()" ref="uModal" ></u-modal>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
</template>
|
|
</template>
|
|
@@ -77,7 +77,8 @@ export default {
|
|
fromCart:'',
|
|
fromCart:'',
|
|
hasPaying:false,
|
|
hasPaying:false,
|
|
showConfirmButton:false,
|
|
showConfirmButton:false,
|
|
- totalPrice:0
|
|
|
|
|
|
+ totalPrice:0,
|
|
|
|
+ confirmText:''
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onPullDownRefresh(){
|
|
onPullDownRefresh(){
|
|
@@ -125,6 +126,7 @@ export default {
|
|
let data = {goodsList:list}
|
|
let data = {goodsList:list}
|
|
|
|
|
|
this.$api.placeSmallOrder(data).then(res => {
|
|
this.$api.placeSmallOrder(data).then(res => {
|
|
|
|
+ console.log(res,'res')
|
|
if(res.data.code==200){
|
|
if(res.data.code==200){
|
|
uni.setStorageSync('updateCart',1) //提醒刷新购物车
|
|
uni.setStorageSync('updateCart',1) //提醒刷新购物车
|
|
let data = res.data.data
|
|
let data = res.data.data
|
|
@@ -136,6 +138,7 @@ export default {
|
|
paySign: data.sign,
|
|
paySign: data.sign,
|
|
timeStamp: String(data.timeStamp),
|
|
timeStamp: String(data.timeStamp),
|
|
success: function (res) {
|
|
success: function (res) {
|
|
|
|
+
|
|
self.btnNo = false
|
|
self.btnNo = false
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
url: `/pages2/order/confirm_success?sn=${data.orderSn}&isBk=${self.isBK}`
|
|
url: `/pages2/order/confirm_success?sn=${data.orderSn}&isBk=${self.isBK}`
|
|
@@ -153,12 +156,15 @@ export default {
|
|
this.modalMsg = res.data.msg;
|
|
this.modalMsg = res.data.msg;
|
|
this.showConfirmButton = true;
|
|
this.showConfirmButton = true;
|
|
this.confirmText = "跳转到【我的订单】\n查看未支付订单";
|
|
this.confirmText = "跳转到【我的订单】\n查看未支付订单";
|
|
|
|
+ this.showModal = true;
|
|
} else if(res.data.code == 511) { //511 重复购买
|
|
} else if(res.data.code == 511) { //511 重复购买
|
|
self.btnNo = false
|
|
self.btnNo = false
|
|
this.modalMsg = res.data.msg;
|
|
this.modalMsg = res.data.msg;
|
|
this.showConfirmButton = true;
|
|
this.showConfirmButton = true;
|
|
|
|
+ this.showModal = true;
|
|
|
|
|
|
if(this.fromCart) {
|
|
if(this.fromCart) {
|
|
|
|
+ console.log(this.fromCart)
|
|
this.confirmText = "返回购物车";
|
|
this.confirmText = "返回购物车";
|
|
} else {
|
|
} else {
|
|
this.confirmText = "继续选课";
|
|
this.confirmText = "继续选课";
|
|
@@ -176,9 +182,17 @@ export default {
|
|
this.showModal = false;
|
|
this.showModal = false;
|
|
},
|
|
},
|
|
modalConfirm() {
|
|
modalConfirm() {
|
|
- uni.switchTab({
|
|
|
|
- url:'/pages/shopping/shoppingCart'
|
|
|
|
- })
|
|
|
|
|
|
+ if(this.fromCart) {
|
|
|
|
+
|
|
|
|
+ uni.switchTab({
|
|
|
|
+ url:'/pages/shopping/shoppingCart'
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ uni.switchTab({
|
|
|
|
+ url:'/pages/course/index'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
getOpenid(code){
|
|
getOpenid(code){
|
|
let self = this
|
|
let self = this
|