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