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

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

@ -83,12 +83,16 @@
userInfo: {} userInfo: {}
} }
}, },
onLoad() { onShow() {
let userInfo = uni.getStorageSync('userInfo'); let userInfo = uni.getStorageSync('userInfo');
if (userInfo) { if (userInfo) {
this.userInfo = JSON.parse(userInfo); this.userInfo = JSON.parse(userInfo);
this.hasMore = true
this.loadMore(); this.loadMore();
} }
},
onLoad() {
}, },
methods: { methods: {
// //
@ -222,10 +226,10 @@
title: '订单取消成功', title: '订单取消成功',
icon: 'none' icon: 'none'
}) })
setTimeout(() => { this.current = 0;
uni.navigateBack() this.orderData = [];
}, 500) this.hasMore = true;
this.loadMore();
} else if (res.data.code == 401) { } else if (res.data.code == 401) {
this.doLogin() this.doLogin()
} else { } 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) { handleDelete(row) {
uni.showModal({ uni.showModal({
@ -264,9 +313,10 @@
title: '订单删除成功', title: '订单删除成功',
icon: 'none' icon: 'none'
}) })
setTimeout(() => { this.current = 0;
uni.navigateBack() this.orderData = [];
}, 500) this.hasMore = true;
this.loadMore();
} else if (res.data.code == 401) { } else if (res.data.code == 401) {
this.doLogin() this.doLogin()
} else { } else {
@ -303,7 +353,7 @@
this.status = 'more'; this.status = 'more';
} }
} else if (res.data.code == 401) { } else if (res.data.code == 401) {
this.doLogin() this.doLogin(1)
} else { } else {
uni.showToast({ uni.showToast({
title: res.data.msg, title: res.data.msg,
@ -346,6 +396,12 @@
success: (res) => { success: (res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
uni.setStorageSync('token', res.data.data.access_token); uni.setStorageSync('token', res.data.data.access_token);
if(type == 1){
this.current = 0;
this.orderData = [];
this.hasMore = true;
this.loadMore();
}
} else { } else {
uni.showToast({ uni.showToast({
title: res.data.msg, title: res.data.msg,

Loading…
Cancel
Save