定制表单页面样式修改,订单页面添加地址修改

main
jinna 2 years ago
parent f9256d2364
commit c1e0283e8f
  1. 990
      pages/pages_zhentou/form/form.vue
  2. 77
      pages/pages_zhentou/homePage/homePage.vue
  3. 121
      pages/pages_zhentou/myPage/address.vue
  4. 309
      pages/pages_zhentou/order/checkOrder.vue
  5. 123
      pages/pages_zhentou/order/order.vue

File diff suppressed because it is too large Load Diff

@ -4,13 +4,25 @@
<image class="img" mode="widthFix" :src="bgSrc"></image>
<!-- <img class="img" src="../../../static/image/bag.jpg" mode=""></img> -->
</view>
<view class="per_box" @click="turnMyPage">
<view class="image_box">
<image class="img" src="../../../static/image/person.png" mode=""></image>
<view class="per_box">
<view class="my_box" @click="turnMyPage">
<view class="image_box">
<image class="img" src="../../../static/image/person.png" mode=""></image>
</view>
<view class="per_txt">
我的
</view>
</view>
<view class="per_txt">
我的
<view class="line"></view>
<view class="service_box" @click="turnShouhou">
<view class="image_box">
<image class="img" src="../../../static/image/icon-contact.png" mode=""></image>
</view>
<view class="per_txt">
客服
</view>
</view>
</view>
<view class="bottom_box">
<!-- <button class="btn" @click="addForm">填写报名单其他渠道已购买</button> -->
@ -73,6 +85,12 @@
url: "/pages/pages_zhentou/myPage/myPage"
})
},
//
turnShouhou() {
uni.navigateTo({
url: "/pages/pages_zhentou/contact/contact"
})
},
//
addForm() {
uni.switchTab({
@ -186,7 +204,7 @@
.per_box {
width: 70rpx;
height: 118rpx;
height: 242rpx;
background: rgba(255, 255, 255, 0.8);
border-radius: 20rpx 20rpx 20rpx 20rpx;
position: fixed;
@ -197,17 +215,50 @@
align-items: center;
justify-content: center;
cursor: pointer;
.line{
width: 43rpx;
height: 2rpx;
background: #000;
margin: 16rpx 0;
}
.my_box{
width: 70rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.image_box {
width: 44rpx;
height: 44rpx;
.image_box {
width: 44rpx;
height: 44rpx;
.img {
width: 100%;
height: 100%;
.img {
width: 100%;
height: 100%;
}
}
}
.service_box{
width: 70rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.image_box {
width: 44rpx;
height: 44rpx;
.img {
width: 100%;
height: 100%;
}
}
}
.per_txt {
margin-top: 10rpx;
color: #333;

@ -3,7 +3,17 @@
<view class="address_box">
<view class="address_item" v-for="(item,index) in addressData" :key="index">
<view class="top_box" @click="turnToOrder(item)">
<view class="top_item">
<view class="top_item" v-if="item.address == deAddress && item.consignee == deConsignee && item.phone == dePhone &&
item.province == deProvince && item.city == deCity && item.area == deDistrict && item.isDefault == isDefaultAddress">
<view class="top">
<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>
</view>
<view class="top_item" v-else>
<view class="top">
<span class="name_txt">{{item.consignee}}</span>
<span class="phone_txt">{{item.phone}}</span>
@ -12,14 +22,14 @@
{{item.province}}{{item.city}}{{item.area}}{{item.address}}
</view>
</view>
<view class="edit_box" @click="handleEdit(item)">
<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 class="bottom_item">
<view class="no_checked_box" v-if="item.isDefault == 0" @click="handleDefault(item)">
<view class="no_checked_box" v-if="item.isDefault == 0" @click.stop="handleDefault(item)">
<view class="no_checked"></view>
<p class="no_default">设为默认</p>
</view>
@ -151,11 +161,28 @@
title: '',
addressId: '',
userInfo: {},
pageFrom: ''
pageFrom: '',
orderId:'',
deAddress:'',
deConsignee:'',
dePhone:'',
deProvince:'',
deCity:'',
deDistrict:'',
isDefaultAddress:''
}
},
onLoad(options) {
console.log(options)
this.pageFrom = options.from;
this.orderId = options.orderId;
this.deAddress = options.address;
this.deConsignee = options.consignee;
this.dePhone = options.phone;
this.deProvince = options.province;
this.deCity = options.city;
this.deDistrict = options.area;
this.isDefaultAddress = options.isDefaultAddress;
this.getData()
let userInfo = uni.getStorageSync('userInfo');
if (userInfo) {
@ -207,6 +234,13 @@
this.hasMore = true;
this.current = 0;
this.loadMore()
}else if (res.data.code == 401) {
this.doLogin()
}else{
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
}
})
@ -247,6 +281,8 @@
this.hasMore = true;
this.current = 0;
this.loadMore()
}else if (res.data.code == 401) {
this.doLogin()
} else {
uni.showToast({
title: res.data.msg,
@ -339,6 +375,8 @@
this.hasMore = true;
this.current = 0;
this.loadMore()
}else if (res.data.code == 401) {
this.doLogin()
} else {
uni.showToast({
title: res.data.msg,
@ -384,6 +422,8 @@
this.hasMore = true;
this.current = 0;
this.loadMore()
}else if (res.data.code == 401) {
this.doLogin()
} else {
uni.showToast({
title: res.data.msg,
@ -410,6 +450,48 @@
uni.setStorageSync('address', JSON.stringify(item))
uni.navigateBack();
}
}else if(this.pageFrom == 'order'){
var pages = getCurrentPages(); //
var currPage = pages[pages.length - 1]; //
var prevPage = pages[pages.length - 2];
if (prevPage.route == 'pages/pages_zhentou/order/checkOrder') {
console.log('111')
let params ={
id:this.orderId,
consignee:item.consignee,
consigneePhone:item.phone,
address:item.address,
province:item.province,
city:item.city,
district:item.area,
isDefaultAddress:item.isDefault
}
console.log(params)
uni.request({
url:getApp().globalData.baseUrl + "/blade-desk/order/updateAddress?id=" + this.orderId + '&consignee=' + item.consignee +
'&consigneePhone=' + item.phone + '&address=' + item.address + '&province=' + item.province + '&city=' + item.city +
'&district=' + item.area + '&isDefaultAddress=' + item.isDefault,
method:"POST",
header:{
'Blade-Auth': 'bearer ' + uni.getStorageSync('token')
},
// params:params,
success:(res) =>{
console.log(res)
if(res.data.code == 200){
uni.setStorageSync('orderId', this.orderId);
uni.navigateBack();
}else if (res.data.code == 401) {
this.doLogin()
}else{
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
}
})
}
}
},
//
@ -580,6 +662,37 @@
}
},
//
doLogin(type) {
uni.showLoading({
title: '登录中',
mask: true
});
uni.request({
url: getApp().globalData.baseUrl + '/blade-auth/getToken',
method: 'POST',
data: {
openId: getApp().globalData.openId,
phone: this.phone
},
header: {
'Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0'
},
success: (res) => {
if (res.data.code == 200) {
uni.setStorageSync('token', res.data.data.access_token);
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
},
complete: () => {
uni.hideLoading();
}
})
}
}
}
</script>

@ -43,6 +43,19 @@
</view>
</view>
</view>
<view class="address_box" @click="returnToAddress">
<p class="info_title">收货地址</p>
<view class="address_top" v-if="addressInfo">
<view class="isflag" v-if="addressInfo.isDefaultAddress == 1">默认</view>
<view class="txt">{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}</view>
</view>
<view class="address_des" v-if="addressInfo">{{addressInfo.address}}</view>
<view class="address_des" style="color: #666;font-weight: normal;" v-else>请填写收货地址</view>
<view class="address_user" v-if="addressInfo">
<text class="user_name">{{addressInfo.consignee}}</text>
<text class="user_phone">{{addressInfo.consigneePhone}}</text>
</view>
</view>
<view class="order_info">
<p class="info_title">订单信息</p>
<p class="info_mess">
@ -71,13 +84,15 @@
</view>
</view>
<view class="btn_box">
<p class="btn" @click="handleWuliu" v-if="orderData.status == 2 || orderData.status == 3 || orderData.status == 4">查看物流</p>
<p class="btn confirm" v-if="orderData.status == 3" @click="handleConfirm">确认收货</p>
<p class="btn" @click="handleWuliu"
v-if="orderData.status == 3 || orderData.status == 4">查看物流</p>
<p class="btn" v-if="orderData.status == 1" @click="cancelOrder">取消订单</p>
<p class="btn" v-if="orderData.status == 2" @click="returnToAddress">修改地址</p>
<p class="btn" v-if="orderData.status == 0" @click="handleDelete">删除订单</p>
<p class="btn confirm" v-if="orderData.status == 3" @click="handleConfirm">确认收货</p>
<p class="btn confirm" v-if="orderData.status == 1">立即支付</p>
<!-- <p class="btn confirm info" v-if="orderData.status == 3" @click="handleInfo(item)">完善定制信息</p> -->
<p class="btn confirm info" v-if="orderData.status == 2" @click="handleInfo">完善定制信息</p>
<p class="btn" v-if="orderData.status == 0" @click="handleDelete">删除订单</p>
<p class="btn confirm" v-if="orderData.status == 0" @click="clickCustom">再次定制</p>
</view>
</view>
@ -88,8 +103,18 @@
data() {
return {
imgPrefix: getApp().globalData.imgPrefix,
orderData:{},
orderId:''
orderData: {},
orderId: '',
addressInfo: null,
}
},
onShow() {
if (uni.getStorageSync('orderId')) {
this.orderId = uni.getStorageSync('orderId');
if (this.orderId) {
this.getDetail();
uni.removeStorageSync('orderId');
}
}
},
onLoad(options) {
@ -99,54 +124,78 @@
console.log('进入模块')
},
methods: {
returnToAddress() {
uni.navigateTo({
url: "/pages/pages_zhentou/myPage/address?consignee=" + this.addressInfo.consignee +
"&phone=" + this.addressInfo.consigneePhone +
"&province=" + this.addressInfo.province + '&city=' + this.addressInfo.city + '&area=' +
this.addressInfo.district + '&from=order' +
'&isDefaultAddress=' + this.addressInfo.isDefaultAddress + "&orderId=" + this.orderId +
'&address=' + this.addressInfo.address
})
},
//
getDetail(){
getDetail() {
uni.request({
// + this.orderId
url: getApp().globalData.baseUrl + '/blade-desk/order/detail?id=' + this.orderId,
method:'GET',
header:{
method: 'GET',
header: {
'Blade-Auth': 'bearer ' + uni.getStorageSync('token')
},
success: (res) => {
console.log(res)
if(res.data.code == 200){
if (res.data.code == 200) {
this.orderData = res.data.data;
}else{
this.addressInfo = {
consignee: res.data.data.consignee,
consigneePhone: res.data.data.consigneePhone,
address: res.data.data.address,
province: res.data.data.province,
city: res.data.data.city,
district: res.data.data.district,
isDefaultAddress: res.data.data.isDefaultAddress,
}
} else if (res.data.code == 401) {
this.doLogin()
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
}
})
},
//
cancelOrder(){
cancelOrder() {
uni.showModal({
title: '提示',
content: '确认取消该订单?',
success: (res) => {
if (res.confirm) {
uni.request({
url:getApp().globalData.baseUrl + '/blade-desk/order/cancel?id=' + this.orderId,
method:'POST',
header:{
url: getApp().globalData.baseUrl + '/blade-desk/order/cancel?id=' +
this.orderId,
method: 'POST',
header: {
'Blade-Auth': 'bearer ' + uni.getStorageSync('token')
},
success: (res) => {
console.log(res)
if(res.data.code == 200){
if (res.data.code == 200) {
uni.showToast({
title: '订单取消成功',
icon: 'none'
})
setTimeout(() =>{
setTimeout(() => {
uni.navigateBack()
},500)
}else{
}, 500)
} else if (res.data.code == 401) {
this.doLogin()
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
@ -155,15 +204,15 @@
}
})
} else if (res.cancel) {
}
}
});
},
//
handleConfirm(){
handleConfirm() {
let params = {
id:this.orderId
id: this.orderId
}
uni.showModal({
title: '提示',
@ -171,22 +220,25 @@
success: (res) => {
if (res.confirm) {
uni.request({
url:getApp().globalData.baseUrl + '/blade-desk/order/confirmReceive?id=' + this.orderId,
method:"POST",
header:{
url: getApp().globalData.baseUrl +
'/blade-desk/order/confirmReceive?id=' + this.orderId,
method: "POST",
header: {
'Blade-Auth': 'bearer ' + uni.getStorageSync('token')
},
success:(res) =>{
success: (res) => {
console.log(res)
if(res.data.code == 200){
if (res.data.code == 200) {
uni.showToast({
title: '收货成功',
icon: 'none'
})
setTimeout(() =>{
setTimeout(() => {
uni.navigateBack()
},500)
}else{
}, 500)
} else if (res.data.code == 401) {
this.doLogin()
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
@ -195,41 +247,46 @@
}
})
} else if (res.cancel) {
}
}
});
},
//
handleWuliu(){
handleWuliu() {
uni.navigateTo({
url:"/pages/pages_zhentou/order/express?logisticsNo=" + this.orderData.logisticsNo + '&company=' + this.orderData.logisticsCompany + '&companyCode=' + this.orderData.logisticsCompanyCode
url: "/pages/pages_zhentou/order/express?logisticsNo=" + this.orderData.logisticsNo +
'&company=' + this.orderData.logisticsCompany + '&companyCode=' + this.orderData
.logisticsCompanyCode
})
},
//
handleDelete(){
handleDelete() {
uni.showModal({
title: '提示',
content: '确认删除订单吗?',
success: (res) => {
if (res.confirm) {
uni.request({
url:getApp().globalData.baseUrl + '/blade-desk/order/remove?ids=' + this.orderId,
method:"POST",
header:{
url: getApp().globalData.baseUrl + '/blade-desk/order/remove?ids=' +
this.orderId,
method: "POST",
header: {
'Blade-Auth': 'bearer ' + uni.getStorageSync('token')
},
success: (res) => {
console.log(res)
if(res.data.code == 200){
if (res.data.code == 200) {
uni.showToast({
title: '订单删除成功',
icon: 'none'
})
setTimeout(() =>{
setTimeout(() => {
uni.navigateBack()
},500)
}else{
}, 500)
} else if (res.data.code == 401) {
this.doLogin()
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
@ -237,29 +294,60 @@
}
}
})
} else if (res.cancel) {
}
} else if (res.cancel) {}
}
});
},
//
clickCustom(){
clickCustom() {
uni.navigateTo({
url: '/pages/pages_zhentou/order/confirmOrder'
})
},
// ,
handleInfo(){
handleInfo() {
uni.navigateTo({
url:"/pages/pages_zhentou/form/form?phone=" + this.orderData.buyerPhone + '&pageFrom=order' + '&orderNo='+ this.orderData.orderNo + '&orderNum=' + this.orderData.goodsNum
url: "/pages/pages_zhentou/form/form?phone=" + this.orderData.buyerPhone + '&pageFrom=order' +
'&orderNo=' + this.orderData.orderNo + '&orderNum=' + this.orderData.goodsNum
})
},
//
returnToServe(){
returnToServe() {
uni.navigateTo({
url:"/pages/pages_zhentou/contact/contact"
url: "/pages/pages_zhentou/contact/contact"
})
},
//
doLogin(type) {
uni.showLoading({
title: '登录中',
mask: true
});
uni.request({
url: getApp().globalData.baseUrl + '/blade-auth/getToken',
method: 'POST',
data: {
openId: getApp().globalData.openId,
phone: this.phone
},
header: {
'Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0'
},
success: (res) => {
if (res.data.code == 200) {
uni.setStorageSync('token', res.data.data.access_token);
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
},
complete: () => {
uni.hideLoading();
}
})
}
}
}
</script>
@ -416,40 +504,114 @@
}
}
}
.order_info{
.address_box {
width: 690rpx;
background: #FFFFFF;
border-radius: 30rpx 30rpx 30rpx 30rpx;
margin: 0 auto;
margin-top: 30rpx;
padding: 30rpx 0;
padding-left: 30rpx;
.info_title {
font-size: 28rpx;
color: #333;
}
.address_top {
display: flex;
align-items: center;
margin-top: 30rpx;
.isflag {
width: 60rpx;
color: #D73232;
font-size: 20rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
line-height: 30rpx;
text-align: center;
background: #FFFFFF;
border-radius: 10rpx;
border: 1rpx solid #D73232;
margin-right: 12rpx;
}
.txt {
line-height: 32rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
}
}
.address_des {
line-height: 40rpx;
font-size: 28rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #333333;
word-break: break-all;
margin: 20rpx 0;
}
.address_user {
display: flex;
align-items: center;
line-height: 33rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
.user_name {
color: #333333;
}
.user_phone {
color: #999999;
margin-left: 10rpx;
}
}
}
.order_info {
width: 690rpx;
height: auto;
background: #FFFFFF;
border-radius: 30rpx 30rpx 30rpx 30rpx;
margin:0 auto;
margin: 0 auto;
margin-top: 30rpx;
padding-bottom: 30rpx;
.info_title{
.info_title {
font-size: 28rpx;
color: #333;
padding-left: 30rpx;
padding-top: 30rpx;
}
.info_mess{
.info_mess {
padding-left: 30rpx;
margin-top: 30rpx;
display: flex;
width: 100%;
.left_info{
.left_info {
width: 130rpx;
font-size: 26rpx;
color: #666;
}
.right_info{
.right_info {
margin-left: 28rpx;
}
}
}
.sh_box{
.sh_box {
width: 690rpx;
height: 90rpx;
background: #FFFFFF;
@ -459,24 +621,25 @@
align-items: center;
justify-content: center;
margin-top: 30rpx;
.sh_img{
.sh_img {
width: 44rpx;
height: 44rpx;
.img{
.img {
width: 100%;
height: 100%;
}
}
.sh_txt{
.sh_txt {
font-size: 26rpx;
color: #333;
margin-left: 10rpx;
}
}
.btn_box{
.btn_box {
width: 100%;
height: 160rpx;
background: #FFFFFF;
@ -484,8 +647,8 @@
bottom: 0;
display: flex;
justify-content: flex-end;
.btn{
.btn {
width: 161rpx;
height: 60rpx;
background: #FFFFFF;
@ -498,13 +661,13 @@
align-items: center;
justify-content: center;
color: #666666;
&.confirm{
&.confirm {
border: 1rpx solid #D73232;
color: #D73232;
}
&.info{
&.info {
width: 210rpx;
}
}

@ -45,7 +45,8 @@
</view> -->
<view class="pay_box">
<p class="pay_txt">实付款</p>
<p class="mon_txt"><span style="font-size: 22rpx;"></span><span style="font-size: 34rpx;">699.0</span></p>
<p class="mon_txt"><span style="font-size: 22rpx;"></span><span
style="font-size: 34rpx;">699.0</span></p>
</view>
<view class="btn_box">
<p class="btn" v-if="item.status == 3 || item.status == 4" @click.stop="handleWuliu(item)">查看物流</p>
@ -84,14 +85,14 @@
},
onLoad() {
let userInfo = uni.getStorageSync('userInfo');
if(userInfo) {
if (userInfo) {
this.userInfo = JSON.parse(userInfo);
this.loadMore();
}
},
methods: {
//
clickCustom(){
clickCustom() {
uni.navigateTo({
url: '/pages/pages_zhentou/order/confirmOrder'
})
@ -99,25 +100,29 @@
//
doPaySuccess(orderNo) {
uni.request({
url:getApp().globalData.baseUrl + '/blade-desk/order/paySuccessCallback',
method:'POST',
url: getApp().globalData.baseUrl + '/blade-desk/order/paySuccessCallback',
method: 'POST',
data: {
id: orderNo
},
header:{
header: {
'Blade-Auth': 'bearer ' + uni.getStorageSync('token')
},
success: (res) => {
if(res.data.code == 200){
if (res.data.code == 200) {
uni.showToast({
title: '订单支付成功',
icon: 'none'
})
let idx = this.orderData.findIndex(item => { return item.id == orderNo; })
if(idx > -1) {
let idx = this.orderData.findIndex(item => {
return item.id == orderNo;
})
if (idx > -1) {
this.orderData[idx].status = 2;
}
}else{
} else if (res.data.code == 401) {
this.doLogin()
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
@ -155,10 +160,9 @@
paySign: res.data.data.paySign,
success: (res1) => {
console.log(res1)
if(res1.errMsg == 'requestPayment:ok') {
if (res1.errMsg == 'requestPayment:ok') {
this.doPaySuccess(orderInfo.id);
}
else{
} else {
uni.showToast({
title: '支付失败',
icon: 'none'
@ -169,6 +173,8 @@
console.log(res2)
}
})
} else if (res.data.code == 401) {
this.doLogin()
} else {
uni.showToast({
title: res.data.msg,
@ -184,40 +190,45 @@
//
handleWuliu(row) {
uni.navigateTo({
url: "/pages/pages_zhentou/order/express?logisticsNo=" + row.logisticsNo + '&company=' + row.logisticsCompany + '&companyCode=' +row.logisticsCompanyCode
url: "/pages/pages_zhentou/order/express?logisticsNo=" + row.logisticsNo + '&company=' + row
.logisticsCompany + '&companyCode=' + row.logisticsCompanyCode
})
},
// ,
handleInfo(item){
handleInfo(item) {
uni.navigateTo({
url:"/pages/pages_zhentou/form/form?phone=" + item.buyerPhone + '&pageFrom=order' + '&orderNo='+ item.orderNo + '&orderNum=' + item.goodsNum
url: "/pages/pages_zhentou/form/form?phone=" + item.buyerPhone + '&pageFrom=order' +
'&orderNo=' + item.orderNo + '&orderNum=' + item.goodsNum
})
},
//
cancelOrder(row){
cancelOrder(row) {
uni.showModal({
title: '提示',
content: '确认取消该订单?',
success: (res) => {
if (res.confirm) {
uni.request({
url:getApp().globalData.baseUrl + '/blade-desk/order/cancel?id=' + row.id,
method:'POST',
header:{
url: getApp().globalData.baseUrl + '/blade-desk/order/cancel?id=' + row
.id,
method: 'POST',
header: {
'Blade-Auth': 'bearer ' + uni.getStorageSync('token')
},
success: (res) => {
console.log(res)
if(res.data.code == 200){
if (res.data.code == 200) {
uni.showToast({
title: '订单取消成功',
icon: 'none'
})
setTimeout(() =>{
setTimeout(() => {
uni.navigateBack()
},500)
}else{
}, 500)
} else if (res.data.code == 401) {
this.doLogin()
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
@ -226,36 +237,39 @@
}
})
} else if (res.cancel) {
}
}
});
},
//
handleDelete(row){
handleDelete(row) {
uni.showModal({
title: '提示',
content: '确认删除订单吗?',
success: (res) => {
if (res.confirm) {
uni.request({
url:getApp().globalData.baseUrl + '/blade-desk/order/remove?ids=' + row.id,
method:"POST",
header:{
url: getApp().globalData.baseUrl + '/blade-desk/order/remove?ids=' +
row.id,
method: "POST",
header: {
'Blade-Auth': 'bearer ' + uni.getStorageSync('token')
},
success: (res) => {
console.log(res)
if(res.data.code == 200){
if (res.data.code == 200) {
uni.showToast({
title: '订单删除成功',
icon: 'none'
})
setTimeout(() =>{
setTimeout(() => {
uni.navigateBack()
},500)
}else{
}, 500)
} else if (res.data.code == 401) {
this.doLogin()
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
@ -263,8 +277,7 @@
}
}
})
} else if (res.cancel) {
}
} else if (res.cancel) {}
}
});
},
@ -273,7 +286,8 @@
this.current = this.current + 1;
this.status = 'loading';
uni.request({
url: getApp().globalData.baseUrl + '/blade-desk/order/page?buyerPhone=' + this.userInfo.phone + '&status=' + this.active + '&current=' + this.current + '&size=' + this
url: getApp().globalData.baseUrl + '/blade-desk/order/page?buyerPhone=' + this.userInfo
.phone + '&status=' + this.active + '&current=' + this.current + '&size=' + this
.size,
method: 'GET',
header: {
@ -288,6 +302,8 @@
} else {
this.status = 'more';
}
} else if (res.data.code == 401) {
this.doLogin()
} else {
uni.showToast({
title: res.data.msg,
@ -311,6 +327,37 @@
url: "/pages/pages_zhentou/order/checkOrder?id=" + row.id
})
},
//
doLogin(type) {
uni.showLoading({
title: '登录中',
mask: true
});
uni.request({
url: getApp().globalData.baseUrl + '/blade-auth/getToken',
method: 'POST',
data: {
openId: getApp().globalData.openId,
phone: this.phone
},
header: {
'Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0'
},
success: (res) => {
if (res.data.code == 200) {
uni.setStorageSync('token', res.data.data.access_token);
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
},
complete: () => {
uni.hideLoading();
}
})
}
}
}
</script>

Loading…
Cancel
Save