增加订单详情加价在配送中状态可见,修改实物券领取成功之后跳转优惠券列表
This commit is contained in:
parent
ba06f7792a
commit
caba0ea421
@ -11,6 +11,9 @@ Page({
|
||||
activityId:'',
|
||||
detailLoading:false,
|
||||
getting:true,
|
||||
hasProduct:false,
|
||||
reveivedSuccess:false,
|
||||
|
||||
|
||||
isShowModal:false,
|
||||
errorMsg:''
|
||||
@ -20,14 +23,14 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
const { miniProgram } = wx.getAccountInfoSync();
|
||||
const envVersion = miniProgram.envVersion;
|
||||
if(envVersion=='develop'){
|
||||
this.setData({
|
||||
activityId:2
|
||||
})
|
||||
return;
|
||||
}
|
||||
// const { miniProgram } = wx.getAccountInfoSync();
|
||||
// const envVersion = miniProgram.envVersion;
|
||||
// if(envVersion=='develop'){
|
||||
// this.setData({
|
||||
// activityId:2
|
||||
// })
|
||||
// return;
|
||||
// }
|
||||
this.setData({
|
||||
activityId:options.id
|
||||
});
|
||||
@ -45,6 +48,7 @@ Page({
|
||||
});
|
||||
this.setData({
|
||||
isShowModal:true,
|
||||
reveivedSuccess:true,
|
||||
errorMsg:'恭喜您已领取成功!'
|
||||
})
|
||||
}).catch((e)=>{
|
||||
@ -58,9 +62,15 @@ Page({
|
||||
})
|
||||
},
|
||||
navToIndex(){
|
||||
wx.reLaunch({
|
||||
url: '/pages/help/index/index',
|
||||
})
|
||||
if(this.data.hasProduct){
|
||||
wx.reLaunch({
|
||||
url: '/pages/my/coupon/index',
|
||||
})
|
||||
}else{
|
||||
wx.reLaunch({
|
||||
url: '/pages/help/index/index',
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
@ -73,14 +83,17 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
//放在onshow里是因为去登录回来之后要继续执行这些操作
|
||||
this.setData({
|
||||
detailLoading:true
|
||||
})
|
||||
commonApi.activities.detail(this.data.activityId).then((data)=>{
|
||||
const hasProduct = !!data.coupons.find((item)=>item.coupon_type=='PRODUCT');
|
||||
this.setData({
|
||||
detailLoading:false,
|
||||
getting:false,
|
||||
detail:data
|
||||
detail:data,
|
||||
hasProduct
|
||||
});
|
||||
return userApi.coupon.check(this.data.activityId);
|
||||
}).then((data)=>{
|
||||
|
||||
@ -28,5 +28,7 @@
|
||||
</view>
|
||||
<image src="/assets/imgs/login/main.png" class="bottom-img"/>
|
||||
|
||||
<modal-view titleText="{{errorMsg}}" okButtonText="回到首页" cancelButtonText="再想想"
|
||||
bind:ok="navToIndex" model:show="{{isShowModal}}"/>
|
||||
<modal-view titleText="{{errorMsg}}"
|
||||
okButtonText="{{hasProduct&&reveivedSuccess?'去兑换':'回到首页'}}"
|
||||
cancelButtonText="再想想"
|
||||
bind:ok="navToIndex" show="{{isShowModal}}"/>
|
||||
@ -3,16 +3,13 @@
|
||||
bindrefresherrefresh="getOrderDetail" refresher-triggered="{{refresherTriggered}}"
|
||||
enhanced show-scrollbar="{{false}}">
|
||||
<view class="order-status {{orderDetail.order.status}}">{{merchantOrderStatusKV[orderDetail.order.status]}}</view>
|
||||
<view class="page-container prd-info">
|
||||
<view class="head">
|
||||
<view class="center">
|
||||
<view class="name">{{orderDetail.product_name}}</view>
|
||||
<view class="tags">
|
||||
<view class="tag" wx:for="{{orderDetail.product_tags}}" wx:key="index">{{item}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="money money-normal">{{orderDetail.order_amount}}</view>
|
||||
<view class="page-container address-self" wx:if="{{orderDetail.product.delivery_time_type=='SCHEDULED'}}">
|
||||
<view class="title">
|
||||
<view>自提点</view>
|
||||
<view class="time">3月2日 <label class="yellow">09:00~20:00</label></view>
|
||||
</view>
|
||||
<view class="spliter"></view>
|
||||
<view class="address">{{orderDetail.merchant.address}}</view>
|
||||
<block wx:if="{{qrcodeUrl}}">
|
||||
<view class="qrcode" bind:tap="goToSuccess">
|
||||
<image src="{{qrcodeUrl}}" class="image"/>
|
||||
@ -21,7 +18,7 @@
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<view class="page-container address">
|
||||
<view class="page-container address" wx:else>
|
||||
<view class="title">送货地址</view>
|
||||
<view class="spliter"></view>
|
||||
<view class="text1">
|
||||
@ -46,27 +43,38 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="page-container product">
|
||||
<view class="title">商品信息</view>
|
||||
<view class="spliter"></view>
|
||||
<view class="info">
|
||||
<image class="avatar" src="{{orderDetail.product.optimized_image_url}}"/>
|
||||
<view class="center">
|
||||
<view class="c-top">
|
||||
<view class="name">{{orderDetail.product.name}}</view>
|
||||
<view class="qty">x {{orderDetail.order.qty}}</view>
|
||||
</view>
|
||||
<view class="money money-normal">{{orderDetail.product.product_price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="page-container order-info">
|
||||
<view class="title">订单信息</view>
|
||||
<view class="spliter"></view>
|
||||
<view class="kv">
|
||||
<view class="key">交易订单</view>
|
||||
<view class="value">{{orderDetail.order_id}}</view>
|
||||
<view class="key">订单编号</view>
|
||||
<view class="value">{{orderDetail.order.order_id}}</view>
|
||||
<view class="copy-area" bind:tap="copyOrderId">
|
||||
<view class="copy">复制</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="kv">
|
||||
<view class="key">订单状态</view>
|
||||
<view class="value">{{merchantOrderStatusKV[orderDetail.status]}}</view>
|
||||
</view>
|
||||
<view class="kv">
|
||||
<view class="key">交易方式</view>
|
||||
<view class="value">微信支付</view>
|
||||
</view>
|
||||
<view class="kv">
|
||||
<view class="key">下单时间</view>
|
||||
<view class="value">{{orderDetail.create_time}}</view>
|
||||
<view class="value">{{orderDetail.order.create_time}}</view>
|
||||
</view>
|
||||
<view class="kv">
|
||||
<view class="key">订单金额</view>
|
||||
<view class="value money">{{orderDetail.order.order_amount}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="scroll-view-dispatch"></view>
|
||||
|
||||
@ -27,43 +27,35 @@
|
||||
font-size:32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.page-container .title .time{
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.page-container .title .yellow{
|
||||
color:#FF8C12;
|
||||
}
|
||||
.page-container .spliter{
|
||||
margin:24rpx 0;
|
||||
}
|
||||
.prd-info{
|
||||
.address-self{
|
||||
padding:46rpx 40rpx;
|
||||
}
|
||||
.prd-info .head{
|
||||
display: flex;
|
||||
.address-self .address{
|
||||
color:#555;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.prd-info .head .image{
|
||||
width:120rpx;height:120rpx;
|
||||
.address-self .qrcode{
|
||||
width:300rpx;height:300rpx;
|
||||
margin: 60rpx auto 0;
|
||||
}
|
||||
.prd-info .head .center{
|
||||
flex: 1;
|
||||
}
|
||||
.prd-info .head .money{
|
||||
margin-top:10rpx;
|
||||
}
|
||||
.prd-info .head .tags{
|
||||
margin-top:22rpx;
|
||||
}
|
||||
.prd-info .spliter{
|
||||
margin:20rpx 0 30rpx 0;
|
||||
}
|
||||
.prd-info .qrcode{
|
||||
width:400rpx;height:400rpx;
|
||||
margin: 54rpx auto 0;
|
||||
background-color: #999;
|
||||
}
|
||||
.prd-info .qrcode .image{
|
||||
.address-self .qrcode .image{
|
||||
width:100%;height:100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.prd-info .code-tips{
|
||||
font-size: 30rpx;
|
||||
color: #999999;
|
||||
.address-self .code-tips{
|
||||
font-size: 28rpx;
|
||||
color: #555;
|
||||
text-align: center;
|
||||
margin-top:30rpx;
|
||||
}
|
||||
@ -82,6 +74,7 @@
|
||||
.merchant .info{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-top:16rpx;
|
||||
}
|
||||
.merchant .avatar{
|
||||
width:84rpx;height:84rpx;
|
||||
@ -111,25 +104,44 @@
|
||||
padding:4rpx;
|
||||
}
|
||||
|
||||
.product .info{
|
||||
display: flex;
|
||||
}
|
||||
.product .avatar{
|
||||
width:150rpx;height:150rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
.product .center{
|
||||
flex:1;
|
||||
margin-left:20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
height: 130rpx;
|
||||
padding:10rpx 0;
|
||||
}
|
||||
.product .c-top{
|
||||
display:flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.product .c-top .qty{
|
||||
font-size: 36rpx;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
|
||||
.order-info .kv{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height:58rpx;
|
||||
}
|
||||
.order-info .spliter{
|
||||
margin:28rpx 0 18rpx 0;
|
||||
}
|
||||
.order-info .kv .key{
|
||||
font-size: 26rpx;
|
||||
color: #888888;
|
||||
}
|
||||
.order-info .kv .value{
|
||||
font-size: 28rpx;
|
||||
font-size: 32rpx;
|
||||
margin-left:30rpx;
|
||||
flex:1;
|
||||
display:flex;
|
||||
align-items: center;
|
||||
}
|
||||
.order-info .kv .copy-area{
|
||||
padding:10rpx;
|
||||
@ -142,14 +154,8 @@
|
||||
line-height: 36rpx;
|
||||
padding:0 14rpx;
|
||||
}
|
||||
.order-info .kv .tag{
|
||||
border: 1rpx solid #ff0000;
|
||||
color: #ff0000;
|
||||
font-size: 24rpx;
|
||||
border-radius: 8rpx;
|
||||
line-height: 40rpx;
|
||||
padding:0 10rpx;
|
||||
margin-left: 32rpx;
|
||||
.order-info .money{
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
原因:<label class="tips">{{orderDetail.cancel_reason}}</label>
|
||||
</view>
|
||||
<navigator url="/pages/order/markup/index?orderid={{orderDetail.orderid}}"
|
||||
class="order-tips right-arrow" wx:if="{{orderDetail.order_additional_fee&&orderDetail.order_additional_fee.result=='PENDING'}}">
|
||||
class="order-tips right-arrow" wx:if="{{(orderDetail.status==orderStatus.received||orderDetail.status==orderStatus.delivering)&&orderDetail.order_additional_fee&&orderDetail.order_additional_fee.result=='PENDING'}}">
|
||||
申请:<label class="tips">配送员发起了加价申请,请查看</label>
|
||||
</navigator>
|
||||
<view class="page-container sender" wx:if="{{orderDetail.deliveryman_user_id}}">
|
||||
|
||||
@ -188,15 +188,15 @@ Page({
|
||||
skip:this.data.pager.tab3.pageIndex*this.data.pager.tab3.limit,
|
||||
limit:this.data.pager.tab3.limit
|
||||
}).then((data)=>{
|
||||
data.map((item)=>{
|
||||
data.items.map((item)=>{
|
||||
if(item.product_tags){
|
||||
item.product_tags = item.product_tags.split(',');
|
||||
}
|
||||
});
|
||||
if(this.data.pager.tab3.pageIndex==0){
|
||||
this.data.couponList = data;
|
||||
this.data.couponList = data.items;
|
||||
}else{
|
||||
this.data.couponList = this.data.couponList.concat(data);
|
||||
this.data.couponList = this.data.couponList.concat(data.items);
|
||||
}
|
||||
this.data.pager.tab3.loading = false;
|
||||
this.data.pager.tab3.pageIndex++;
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10rpx 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.choose-community .icon{
|
||||
width:16rpx;height:10rpx;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user