diff --git a/src/pages/cart/cart.vue b/src/pages/cart/cart.vue index f3f1e12..0bd973e 100644 --- a/src/pages/cart/cart.vue +++ b/src/pages/cart/cart.vue @@ -167,8 +167,8 @@ export default { item.isChecked = false }) }, - onLoad: async function() { - }, + // onLoad: async function() { + // }, methods: { // 全选按钮 pClick() { diff --git a/src/pages/confirmOrder/confirmOrder.vue b/src/pages/confirmOrder/confirmOrder.vue index 16a5906..14eab55 100644 --- a/src/pages/confirmOrder/confirmOrder.vue +++ b/src/pages/confirmOrder/confirmOrder.vue @@ -334,7 +334,7 @@ export default { // return this.$store.state.cart.checkedCartLst // }, goodInfo() { - console.log('state', this.$store.state.read.goodInfo) + // console.log('state', this.$store.state.read.goodInfo) return this.$store.state.read.goodInfo }, skuInfo() { diff --git a/src/pages/myOrder/components/OrderCard.vue b/src/pages/myOrder/components/OrderCard.vue index 83fc7d4..1b0d46e 100644 --- a/src/pages/myOrder/components/OrderCard.vue +++ b/src/pages/myOrder/components/OrderCard.vue @@ -52,8 +52,8 @@ class="btns" v-if="status == '0'" > - <view class="btn-type1">取消订单</view> - <view class="btn-type2">去支付</view> + <view class="btn-type1" @click="cancleOrder">取消订单</view> + <view class="btn-type2" @click="paylog">去支付</view> </view> <view class="btns" @@ -141,6 +141,28 @@ }; }, methods:{ + cancleOrder() { + // const openid = uni.getStorageSync('openid') + // const uid = this.order.uid; + // const openid = openid; + // const keyname = this.orderInfo.order_info.keyname + // // console.log('keyname',this.orderInfo.keyname) + // uni.showModal({ + // title: "提示", + // content: "现在取消,订单不可恢复哦,确认取消吗?", + // success: function(res) { + // if (res.confirm) { + // store.dispatch("cancelOrder/cancel", { + // keyname: keyname, + // uid: uid, + // openid: openid + // }); + // } else if (res.cancel) { + // console.log("用户点击取消"); + // } + // } + // }); + }, toDetail(pid){ console.log('pid',pid) uni.navigateTo({ @@ -177,7 +199,7 @@ }) break; - case '2 || 3': + case '2' || '3': uni.navigateTo({ url:`../myOrderPaying/myOrderPaying?status=`+status+`&payId=`+payId, fail(errMsg) { diff --git a/src/pages/myOrderPaying/myOrderPaying.vue b/src/pages/myOrderPaying/myOrderPaying.vue index e3363d8..e51c7ce 100644 --- a/src/pages/myOrderPaying/myOrderPaying.vue +++ b/src/pages/myOrderPaying/myOrderPaying.vue @@ -1,11 +1,20 @@ <!-- 订单待付款 待收货 --> <template> - <view class="content"> + <view class="content"> + <view + class="headerBanner" + v-if="status == '2'||'3'" + > + <view class="bannerLeft"> + <view class="T1">订单已完成</view> + </view> + <image + src="../../static/car.png" + mode="aspectFill" + ></image> + </view> <!-- 待付款 --> - <view - class="order-time" - v-if="status == '0'" - > + <view class="order-time" v-if="status == '0'" > <text>请在</text> <uni-countdown color="#EC5D3B" @@ -13,24 +22,24 @@ :show-day="false" :hour="0" :second="getTime" - @timeup=timeup - ></uni-countdown> + @timeup=timeup > + </uni-countdown> + <text>内完成付款</text> - </view> - <!-- 待收货 --> - <view - class="headerBanner" - v-if="status == '1'" - > + </view> + + <view class="headerBanner" v-if="status == '1'"> <view class="bannerLeft"> <view class="T1">卖家已发货</view> - <view class="T2">还剩 确认收货</view> + <!-- <view class="T2">还剩 确认收货</view> --> </view> <image src="../../static/car.png" mode="aspectFill" ></image> - </view> + </view> + + <view class="order"> <view class="order-user"> <view class="order-user-head"> @@ -120,7 +129,17 @@ class="b2" @click="confirmOrder" >确认收货</button> - </view> + </view> + <view + class="order-confim" + v-if="status == '2'" + > + <button + class="b2" + @click="toDetail" + >再次购买</button> + </view> + </view> </template> @@ -146,10 +165,10 @@ export default { }; }, onLoad:async function ({payId,status,isPay}) { - // console.log('++++++++++++++++++',payId,status,isPay) this.payId = payId this.status = status this.isPay = isPay + console.log('++++++++++++++++++',this.status) const openid = uni.getStorageSync('openid') const uid = this.$store.state.user.userInfo.uid this.uid = uid @@ -197,8 +216,17 @@ export default { // console.log(totalDiscount) return totalDiscount; } - }, - methods: { + }, + + methods: { + //再次购买 暂时只支持跳转第一个商品 + toDetail(){ + const pid = this.orderInfo.order_info.list[0].pid + uni.navigateTo({ + url: '../details/details?pid='+pid, + fail: (res) => {console.log(res)}, + }); + }, // 取消订单 timeup() { this.cancleOrder(); @@ -272,7 +300,7 @@ export default { }) // 跳转订单详情页->状态 待收货 uni.reLaunch({ - url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=2&isPay=1`, + url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=1&isPay=1`, }) }, fail: (res) => { @@ -282,9 +310,9 @@ export default { showCancel: false, }) // 跳转订单详情页->刷新本页面 - uni.redirectTo({ - url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=1&isPay=1`, - }) + // uni.redirectTo({ + // url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`, + // }) }, complete: () => { uni.hideLoading() @@ -297,9 +325,9 @@ export default { }) console.log('支付失败') uni.hideLoading() - uni.redirectTo({ - url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=1&isPay=1`, - }) + // uni.redirectTo({ + // url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`, + // }) } })