|
@@ -16,10 +16,6 @@
|
|
|
<goods-list ref='goods' v-if="isRequest" :shopOrderData="shopOrderData" :information="information" @popupClick="hanldePopupFn"></goods-list>
|
|
|
<!-- 订单信息 -->
|
|
|
<order-information ref="information" v-if="isRequest" :information="information"></order-information>
|
|
|
- <!-- 支付记录 -->
|
|
|
- <payment-record ref="payment" v-if="isRequest" :discernReceiptList="discernReceiptList" :receiptAmount="receiptAmount"></payment-record>
|
|
|
- <!-- 退款记录 -->
|
|
|
- <refund-record ref="refund" v-if="isRequest" :returnedPurchaseList="returnedPurchaseList" :returnedPurchaseFee="returnedPurchaseFee"></refund-record>
|
|
|
<!-- 底部button -->
|
|
|
<order-button ref="orderButton"
|
|
|
v-if= "isRequest"
|
|
@@ -30,13 +26,34 @@
|
|
|
</order-button>
|
|
|
</view>
|
|
|
<!-- 操作弹窗 -->
|
|
|
- <tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :content="contentModalText" color="#333" :size="32" shape="circle" :maskClosable="false"></tui-modal>
|
|
|
+ <tui-modal :show="modal" @click="handleClick" @cancel="hideMobel(1)" :content="contentModalText" color="#333" :size="32" shape="circle" :maskClosable="false"></tui-modal>
|
|
|
+ <!-- 再次购买订单商品全部下架弹窗 -->
|
|
|
+ <tui-modal :show="modal2" @click="handleClick2" @cancel="hideMobel(2)" shape="circle" content="订单内商品已全部下架,不能购买!" :button="button"></tui-modal>
|
|
|
+ <!-- 再次购买部分商品失效弹窗 -->
|
|
|
+ <tui-modal :show="modal3" @cancel="hideMobel(3)" :custom="true">
|
|
|
+ <view class="tui-modal-custom">
|
|
|
+ <view class="tui-modal-custom-text">
|
|
|
+ <view class="title">以下商品已失效,不能进行购买;是否先将其他商品加入购物车?</view>
|
|
|
+ <scroll-view scroll-y class="tui-modal-custom-list">
|
|
|
+ <view class="custom-list" v-for="(invalid,index) in invalidList" :key="index">
|
|
|
+ <view class="custom-list-image"><image :src="invalid.productImage" mode=""></image></view>
|
|
|
+ <view class="custom-list-name">{{ invalid.name }}</view>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+ <view class="tui-modal-button">
|
|
|
+ <button class="modal-button cancel" @click="hideMobel(3)">我再想想</button>
|
|
|
+ <button class="modal-button confirm" @click="handleClick3">加入购物车</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </tui-modal>
|
|
|
<!-- 促销活动弹窗 -->
|
|
|
<activi-popup :Promotion="handlerPros" :popupShow="popupShow"></activi-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import authorize from '@/common/config/authorize.js'
|
|
|
import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
|
|
|
import orderAddress from '@/components/cm-module/orderDetails/orderAddress' //地址信息
|
|
|
import goodsList from '@/components/cm-module/orderDetails/goodsList' //商品列表
|
|
@@ -96,8 +113,17 @@
|
|
|
orderSubmitType:false,//自主订单
|
|
|
userId:0,
|
|
|
modal:false,
|
|
|
+ modal2:false,
|
|
|
+ modal3:false,
|
|
|
OperationType:'',
|
|
|
- contentModalText:''
|
|
|
+ contentModalText:'',
|
|
|
+ button: [
|
|
|
+ {
|
|
|
+ text: '确定',
|
|
|
+ type:'danger'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ invalidList:[]
|
|
|
}
|
|
|
},
|
|
|
onLoad(option){
|
|
@@ -207,12 +233,11 @@
|
|
|
this.isModalLayer = true;
|
|
|
this.$api.navigateTo('/pages/user/order/order-logistics?orderId='+data.orderId)
|
|
|
break;
|
|
|
+ case 'again':
|
|
|
+ this.handBuyAgainInfo()
|
|
|
+ break;
|
|
|
case 'pay':
|
|
|
- if(data.order.onlinePayFlag == '0'){
|
|
|
- this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderId=${data.orderId}`)
|
|
|
- }else{
|
|
|
- this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${data.order.pendingPayments}&orderId=${data.orderId}`)
|
|
|
- }
|
|
|
+ this.MiniWxPayFor(data.order)
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
@@ -233,11 +258,62 @@
|
|
|
}
|
|
|
this.modal = false;
|
|
|
},
|
|
|
+ handleClick2(){
|
|
|
+ this.modal2 = false;
|
|
|
+ },
|
|
|
+ handleClick3(){
|
|
|
+ this.handShoppingAgainCart()
|
|
|
+ this.modal3 = false
|
|
|
+ },
|
|
|
+ hideMobel(index) {
|
|
|
+ switch(index){
|
|
|
+ case 1:this.modal = false;break;
|
|
|
+ case 2:this.modal2 = false;break;
|
|
|
+ case 3:this.modal3 = false;break;
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ handBuyAgainInfo(){//再次购买初始化查询订单商品信息
|
|
|
+ this.OrderService.GetOrderBuyAgain(
|
|
|
+ {
|
|
|
+ orderId:this.orderId,
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(response =>{
|
|
|
+ this.handShoppingAgainCart()
|
|
|
+ })
|
|
|
+ .catch(error =>{
|
|
|
+ console.log(error.data)
|
|
|
+ if(error.data && error.data.length > 0){
|
|
|
+ this.modal3 = true
|
|
|
+ this.invalidList = error.data
|
|
|
+ }else{
|
|
|
+ this.modal2 = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handShoppingAgainCart(){ //一键加入购物车
|
|
|
+ this.ProductService.ShoppingAgainCart(
|
|
|
+ {
|
|
|
+ orderId:this.orderId,
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(response => {
|
|
|
+ this.ProductService.QueryShoppingQuantity({userId:this.userId}).then(response => {
|
|
|
+ this.$api.switchTabTo('/pages/tabBar/cart/index');
|
|
|
+ }).catch(error =>{
|
|
|
+ console.log('查询购物车数量错误信息',error)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(error =>{
|
|
|
+ this.$util.msg(error.msg,2000);
|
|
|
+ })
|
|
|
+ },
|
|
|
handOrderConfirm (id){//确认收货
|
|
|
this.OrderService.ConfirmReceipt({orderId:id}).then(response =>{
|
|
|
this.$util.msg(response.msg,2000,true,'success');
|
|
|
setTimeout(() => {
|
|
|
- this.GetOrderDetaileData(this.currentTab)
|
|
|
+ this.GetOrderDatainit(this.currentTab)
|
|
|
},2000)
|
|
|
}).catch(error =>{
|
|
|
this.$util.msg(error.msg,2000)
|
|
@@ -247,12 +323,8 @@
|
|
|
this.OrderService.DeleteOrder({orderId:id}).then(response =>{
|
|
|
this.$util.msg(response.msg,2000,true,'success');
|
|
|
setTimeout(() => {
|
|
|
- if(this.shareType ==='share'){
|
|
|
- this.$api.redirectTo('/pages/index/index')
|
|
|
- }else{
|
|
|
- this.$api.redirectTo(`/pages/user/order/order-list?type=detele&state=${this.state}`)
|
|
|
- }
|
|
|
- },500)
|
|
|
+ this.GetOrderDatainit(this.currentTab)
|
|
|
+ },2000)
|
|
|
}).catch(error =>{
|
|
|
this.$util.msg(error.msg,2000)
|
|
|
})
|
|
@@ -261,14 +333,50 @@
|
|
|
this.OrderService.CancelOrder({orderId:id}).then(response =>{
|
|
|
this.$util.msg(response.msg,2000,true,'success');
|
|
|
setTimeout(() => {
|
|
|
- this.GetOrderDetaileData(this.currentTab)
|
|
|
+ this.GetOrderDatainit(this.currentTab)
|
|
|
},2000)
|
|
|
}).catch(error =>{
|
|
|
this.$util.msg(error.msg,2000)
|
|
|
})
|
|
|
},
|
|
|
- handlSearchPath(){
|
|
|
- this.$api.navigateTo('/pages/user/order/search-order')
|
|
|
+ async MiniWxPayFor(data){
|
|
|
+ const wechatCode = await authorize.getCode('weixin')
|
|
|
+ this.PayService.WeChatMiniWxPay(
|
|
|
+ {
|
|
|
+ payAmount:data.payableAmount*100,
|
|
|
+ payWay:"WEIXIN",
|
|
|
+ code:wechatCode,
|
|
|
+ orderId:data.orderId
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(response =>{
|
|
|
+ let PayInfo = JSON.parse(response.data.data.payInfo);
|
|
|
+ this.WxRequestPayment(PayInfo)
|
|
|
+ })
|
|
|
+ .catch(error =>{
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ WxRequestPayment(data){
|
|
|
+ let self = this
|
|
|
+ wx.requestPayment({
|
|
|
+ 'timeStamp': data.timeStamp,
|
|
|
+ 'nonceStr': data.nonceStr,
|
|
|
+ 'package': data.package,
|
|
|
+ 'signType': data.signType,
|
|
|
+ 'paySign': data.paySign,
|
|
|
+ 'success':function(res){
|
|
|
+ wx.reLaunch({url: '/pages/tabBar/index/index'});
|
|
|
+ },
|
|
|
+ 'fail':function(res){
|
|
|
+ console.log(res)
|
|
|
+ console.log('ORDERiD',self.hanldOrder)
|
|
|
+ self.$api.redirectTo(`/pages/user/order/success?data=${JSON.stringify({data:self.hanldOrder.order})}`)
|
|
|
+ },
|
|
|
+ 'complete':function(res){
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
hanldePopupFn(data){//监听活动内容
|
|
|
this.popupShow = true
|
|
@@ -418,5 +526,78 @@
|
|
|
color: $color-system;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ .tui-modal-custom-text{
|
|
|
+ min-height: 300rpx;
|
|
|
+ margin-bottom: 30rpx;
|
|
|
+ .title{
|
|
|
+ width: 100%;
|
|
|
+ height: auto;
|
|
|
+ font-size: $font-size-30;
|
|
|
+ text-align: justify;
|
|
|
+ color: #333333;
|
|
|
+ line-height: 40rpx;
|
|
|
+ margin-bottom: 30rpx;
|
|
|
+ }
|
|
|
+ .tui-modal-custom-list{
|
|
|
+ width: 100%;
|
|
|
+ height: 350rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ .custom-list{
|
|
|
+ width: 100%;
|
|
|
+ height: 117rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ float: left;
|
|
|
+ padding: 15rpx 0;
|
|
|
+ .custom-list-image{
|
|
|
+ width: 86rpx;
|
|
|
+ height: 86rpx;
|
|
|
+ float: left;
|
|
|
+ border-radius: 6rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border: 1px solid #e1e1e1;
|
|
|
+ image{
|
|
|
+ width: 84rpx;
|
|
|
+ height: 84rpx;
|
|
|
+ border-radius: 6rpx;
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .custom-list-name{
|
|
|
+ width: 400rpx;
|
|
|
+ height: 86rpx;
|
|
|
+ float: right;
|
|
|
+ line-height: 43rpx;
|
|
|
+ font-size: $font-size-26;
|
|
|
+ color: #666666;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ overflow: hidden;
|
|
|
+ display: -webkit-box;
|
|
|
+ -webkit-line-clamp: 2;
|
|
|
+ line-clamp: 2;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .tui-modal-button{
|
|
|
+ width: 100%;
|
|
|
+ height: 72rpx;
|
|
|
+ display: flex;
|
|
|
+ .modal-button{
|
|
|
+ width: 200rpx;
|
|
|
+ height: 72rpx;
|
|
|
+ line-height: 72rpx;
|
|
|
+ border-radius: 36rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ &.cancel{
|
|
|
+ border: 1px solid #b2b2b2;
|
|
|
+ background: #FFFFFF;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
+ &.confirm{
|
|
|
+ background: $btn-confirm;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|