修改订单页面相关逻辑

main
jinna 2 years ago
parent f1e32af7a5
commit fed5601cb8
  1. 138
      pages/pages_zhentou/myPage/address.vue
  2. 2
      pages/pages_zhentou/order/checkOrder.vue
  3. 74
      pages/pages_zhentou/order/order.vue

@ -9,8 +9,16 @@
<span class="name_txt">{{item.consignee}}</span>
<span class="phone_txt">{{item.phone}}</span>
</view>
<view class="bottom" style="color: #D73232;">
{{item.province}}{{item.city}}{{item.area}}{{item.address}}
<view class="bottom">
<view class="bottom_item" style="color: #D73232;">
{{item.province}}{{item.city}}{{item.area}}{{item.address}}
</view>
<view class="edit_box" @click.stop="handleEdit(item)">
<view class="img_box">
<image class="img" src="../../../static/image/edit.png" mode=""></image>
</view>
</view>
</view>
</view>
<view class="top_item" v-else>
@ -19,14 +27,17 @@
<span class="phone_txt">{{item.phone}}</span>
</view>
<view class="bottom">
{{item.province}}{{item.city}}{{item.area}}{{item.address}}
</view>
</view>
<view class="edit_box" @click.stop="handleEdit(item)">
<view class="img_box">
<image class="img" src="../../../static/image/edit.png" mode=""></image>
<view class="bottom_item">
{{item.province}}{{item.city}}{{item.area}}{{item.address}}
</view>
<view class="edit_box" @click.stop="handleEdit(item)">
<view class="img_box">
<image class="img" src="../../../static/image/edit.png" mode=""></image>
</view>
</view>
</view>
</view>
</view>
<view class="bottom_item">
<view class="no_checked_box" v-if="item.isDefault == 0" @click.stop="handleDefault(item)">
@ -74,9 +85,15 @@
<view class="left_item">
联系电话
</view>
<view class="right_item">
<uni-easyinput v-model="buyPhone" :inputBorder="false"
placeholder="请输入联系方式"></uni-easyinput>
<view class="right_item phone_item">
<view class="input_box">
<uni-easyinput v-model="buyPhone" :inputBorder="false"
placeholder="请输入联系方式"></uni-easyinput>
</view>
<view class="error_mess" v-if="!moblieVal">
请输入正确的联系方式
</view>
</view>
</view>
<view class="content_item">
@ -169,9 +186,17 @@
deProvince:'',
deCity:'',
deDistrict:'',
isDefaultAddress:''
isDefaultAddress:'',
moblieVal:true
}
},
watch:{
buyPhone(newVal){
const moblie = /^1(3|4|5|6|7|8|9)\d{9}$/;
this.moblieVal = moblie.test(newVal);
}
},
onLoad(options) {
console.log(options)
this.pageFrom = options.from;
@ -651,7 +676,9 @@
} else {
this.status = 'more';
}
} else {
}else if(res.data.code == 401){
this.doLogin(1)
}else {
uni.showToast({
title: res.data.msg,
icon: 'none'
@ -681,6 +708,12 @@
success: (res) => {
if (res.data.code == 200) {
uni.setStorageSync('token', res.data.data.access_token);
if(type == 1){
this.addressData = []
this.hasMore = true;
this.current = 0;
this.loadMore()
}
} else {
uni.showToast({
title: res.data.msg,
@ -712,7 +745,7 @@
.address_item {
width: 100%;
height: 255rpx;
// height: 255rpx;
border-bottom: 1rpx solid #F2F2F2;
display: flex;
flex-direction: column;
@ -721,6 +754,7 @@
width: 100%;
height: 25%;
display: flex;
margin-bottom: 30rpx;
align-items: center;
.no_checked_box {
@ -779,12 +813,14 @@
width: 100%;
height: 75%;
display: flex;
// margin-bottom: 40rpx;
.top_item {
width: 85%;
width: 100%;
margin-left: 30rpx;
.top {
width: 100%;
margin-top: 30rpx;
display: flex;
height: 40rpx;
@ -804,31 +840,45 @@
}
.bottom {
width: 484rpx;
height: 74rpx;
font-size: 26rpx;
color: #333;
margin-top: 20rpx;
line-height: 40rpx;
width: 100%;
display: flex;
.bottom_item{
width: 484rpx;
// height: 74rpx;
font-size: 26rpx;
color: #333;
margin-top: 20rpx;
line-height: 40rpx;
}
.edit_box {
height: 100%;
background-color: red;
display: flex;
align-items: center;
position: relative;
margin-left: 100rpx;
margin-top: 40rpx;
.img_box {
width: 44rpx;
height: 44rpx;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.img {
width: 100%;
height: 100%;
}
}
}
}
}
.edit_box {
height: 100%;
display: flex;
align-items: center;
.img_box {
width: 44rpx;
height: 44rpx;
}
.img {
width: 100%;
height: 100%;
}
}
}
}
@ -926,6 +976,22 @@
margin-left: 30rpx;
font-size: 26rpx;
color: #333;
&.phone_item{
flex-direction: column;
}
.input_box{
width: 100%;
}
.error_mess{
width: 100%;
text-align: left;
padding-left: 30rpx;
font-size: 20rpx;
color: #D73232;
}
.picker_box {
padding-left: 20rpx;

@ -43,7 +43,7 @@
</view>
</view>
</view>
<view class="address_box" @click="returnToAddress">
<view class="address_box">
<p class="info_title">收货地址</p>
<view class="address_top" v-if="addressInfo">
<view class="isflag" v-if="addressInfo.isDefaultAddress == 1">默认</view>

@ -83,12 +83,16 @@
userInfo: {}
}
},
onLoad() {
onShow() {
let userInfo = uni.getStorageSync('userInfo');
if (userInfo) {
this.userInfo = JSON.parse(userInfo);
this.hasMore = true
this.loadMore();
}
},
onLoad() {
},
methods: {
//
@ -222,10 +226,10 @@
title: '订单取消成功',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 500)
this.current = 0;
this.orderData = [];
this.hasMore = true;
this.loadMore();
} else if (res.data.code == 401) {
this.doLogin()
} else {
@ -243,6 +247,51 @@
});
},
//
handleConfirm(row) {
let params = {
id: this.orderId
}
uni.showModal({
title: '提示',
content: '确认收到该商品了吗?',
success: (res) => {
if (res.confirm) {
uni.request({
url: getApp().globalData.baseUrl +
'/blade-desk/order/confirmReceive?id=' + row.id,
method: "POST",
header: {
'Blade-Auth': 'bearer ' + uni.getStorageSync('token')
},
success: (res) => {
console.log(res)
if (res.data.code == 200) {
uni.showToast({
title: '收货成功',
icon: 'none'
})
this.current = 0;
this.orderData = [];
this.hasMore = true;
this.loadMore();
} else if (res.data.code == 401) {
this.doLogin()
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
}
})
} else if (res.cancel) {
}
}
});
},
//
handleDelete(row) {
uni.showModal({
@ -264,9 +313,10 @@
title: '订单删除成功',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 500)
this.current = 0;
this.orderData = [];
this.hasMore = true;
this.loadMore();
} else if (res.data.code == 401) {
this.doLogin()
} else {
@ -303,7 +353,7 @@
this.status = 'more';
}
} else if (res.data.code == 401) {
this.doLogin()
this.doLogin(1)
} else {
uni.showToast({
title: res.data.msg,
@ -346,6 +396,12 @@
success: (res) => {
if (res.data.code == 200) {
uni.setStorageSync('token', res.data.data.access_token);
if(type == 1){
this.current = 0;
this.orderData = [];
this.hasMore = true;
this.loadMore();
}
} else {
uni.showToast({
title: res.data.msg,

Loading…
Cancel
Save