|
|
|
|
@ -8,6 +8,9 @@ |
|
|
|
|
<img class="top_img" :src="imgPrefix + 'top.png'" alt=""> |
|
|
|
|
</view> |
|
|
|
|
<view class="top_content"> |
|
|
|
|
<view class="num_box" v-if="orderNum > 1"> |
|
|
|
|
表单{{currentNum}} |
|
|
|
|
</view> |
|
|
|
|
<view class="title"> |
|
|
|
|
枕头定制信息表 |
|
|
|
|
</view> |
|
|
|
|
@ -111,6 +114,11 @@ |
|
|
|
|
</uni-forms-item> |
|
|
|
|
</uni-forms> |
|
|
|
|
<button class="btn_box" @click="submit('valiForm')">提交</button> |
|
|
|
|
<view class="button_box"> |
|
|
|
|
<p class="button" @click="handlePrev" v-if="currentNum > 1">上一个</p> |
|
|
|
|
<p class="button" @click="jumpOver">跳过</p> |
|
|
|
|
<p class="button" @click="handleNext" v-if="currentNum < orderNum">下一个</p> |
|
|
|
|
</view> |
|
|
|
|
<!-- <uni-popup ref="popup" background-color="#fff" @change="change"> |
|
|
|
|
<picker :range="locationArr" @change="cityChange" mode="multiSelector" @columnchange="columnchange" |
|
|
|
|
:value="multiIndex"> |
|
|
|
|
@ -334,6 +342,11 @@ |
|
|
|
|
value: 2 |
|
|
|
|
}, ], |
|
|
|
|
isDisabled:false, |
|
|
|
|
orderNo:'', |
|
|
|
|
orderNum:'', |
|
|
|
|
orderData:[], |
|
|
|
|
currentNum:null, |
|
|
|
|
pageFrom:'' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onShow(){ |
|
|
|
|
@ -367,13 +380,106 @@ |
|
|
|
|
// console.log(this.a) |
|
|
|
|
this.getData() |
|
|
|
|
console.log(options) |
|
|
|
|
if(options.pageFrom == 'order'){ |
|
|
|
|
this.phoneNumber = options.phone |
|
|
|
|
this.getInfo() |
|
|
|
|
} |
|
|
|
|
this.orderNo = options.orderNo |
|
|
|
|
this.orderNum = options.orderNum |
|
|
|
|
this.pageFrom = options.pageFrom |
|
|
|
|
// if(options.pageFrom == 'order'){ |
|
|
|
|
// this.phoneNumber = options.phone |
|
|
|
|
// // this.getInfo() |
|
|
|
|
// } |
|
|
|
|
this.getOrderInfo() |
|
|
|
|
// this.getCurrentArea('北京市') |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 根据订单号获取已填写的订单信息 |
|
|
|
|
getOrderInfo(type){ |
|
|
|
|
uni.request({ |
|
|
|
|
url:getApp().globalData.baseUrl + '/blade-desk/custom-made-info/list-by-order-no?orderNo=' + this.orderNo, |
|
|
|
|
method:'GET', |
|
|
|
|
header:{ |
|
|
|
|
'Blade-Auth': 'bearer ' + uni.getStorageSync('token') |
|
|
|
|
}, |
|
|
|
|
success:(res) =>{ |
|
|
|
|
console.log(res) |
|
|
|
|
this.orderData = res.data.data; |
|
|
|
|
if(type == 'save'){ |
|
|
|
|
if(this.orderData.length == this.orderNum){ |
|
|
|
|
if(this.pageFrom == 'order'){ |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
url:"/pages/pages_zhentou/order/order" |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
uni.redirectTo({ |
|
|
|
|
url:"/pages/pages_zhentou/order/order" |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
this.currentNum = this.orderData.length + 1; |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
if(this.orderData.length == this.orderNum){ |
|
|
|
|
this.currentNum = 1; |
|
|
|
|
this.valiFormData = this.orderData[0] |
|
|
|
|
this.valiFormData.neckShoulderWidth = this.valiFormData.neckShoulderWidth == -1 ? '' : this.valiFormData.neckShoulderWidth; |
|
|
|
|
this.valiFormData.neckLength = this.valiFormData.neckLength == -1 ? '' : this.valiFormData.neckLength; |
|
|
|
|
this.valiFormData.ageRange = this.valiFormData.ageRange == -1 ? '' : this.valiFormData.ageRange; |
|
|
|
|
this.valiFormData.sleepLength = this.valiFormData.sleepLength == -1 ? '' : this.valiFormData.sleepLength; |
|
|
|
|
this.valiFormData.cervicalVertebra = this.valiFormData.cervicalVertebra == -1 ? '' : this.valiFormData.cervicalVertebra; |
|
|
|
|
this.valiFormData.otherNeed = this.valiFormData.otherNeed == -1 ? '' : this.valiFormData.otherNeed; |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
this.currentNum = this.orderData.length + 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handlePrev(){ |
|
|
|
|
// console.log(this.currentNum - 2) |
|
|
|
|
this.currentNum = this.currentNum - 1; |
|
|
|
|
this.valiFormData = this.orderData[this.currentNum - 1]; |
|
|
|
|
if(!this.valiFormData){ |
|
|
|
|
this.valiFormData = {} |
|
|
|
|
}else{ |
|
|
|
|
this.valiFormData.neckShoulderWidth = this.valiFormData.neckShoulderWidth == -1 ? '' : this.valiFormData.neckShoulderWidth; |
|
|
|
|
this.valiFormData.neckLength = this.valiFormData.neckLength == -1 ? '' : this.valiFormData.neckLength; |
|
|
|
|
this.valiFormData.ageRange = this.valiFormData.ageRange == -1 ? '' : this.valiFormData.ageRange; |
|
|
|
|
this.valiFormData.sleepLength = this.valiFormData.sleepLength == -1 ? '' : this.valiFormData.sleepLength; |
|
|
|
|
this.valiFormData.cervicalVertebra = this.valiFormData.cervicalVertebra == -1 ? '' : this.valiFormData.cervicalVertebra; |
|
|
|
|
this.valiFormData.otherNeed = this.valiFormData.otherNeed == -1 ? '' : this.valiFormData.otherNeed; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
jumpOver(){ |
|
|
|
|
if(this.pageFrom == 'order'){ |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
url:"/pages/pages_zhentou/order/order" |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
uni.redirectTo({ |
|
|
|
|
url:"/pages/pages_zhentou/order/order" |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleNext(){ |
|
|
|
|
console.log(this.currentNum) |
|
|
|
|
this.currentNum = this.currentNum + 1 |
|
|
|
|
this.valiFormData = this.orderData[this.currentNum - 1]; |
|
|
|
|
if(!this.valiFormData){ |
|
|
|
|
console.log('123') |
|
|
|
|
this.valiFormData = {} |
|
|
|
|
}else{ |
|
|
|
|
console.log('456') |
|
|
|
|
this.valiFormData.neckShoulderWidth = this.valiFormData.neckShoulderWidth == -1 ? '' : this.valiFormData.neckShoulderWidth; |
|
|
|
|
this.valiFormData.neckLength = this.valiFormData.neckLength == -1 ? '' : this.valiFormData.neckLength; |
|
|
|
|
this.valiFormData.ageRange = this.valiFormData.ageRange == -1 ? '' : this.valiFormData.ageRange; |
|
|
|
|
this.valiFormData.sleepLength = this.valiFormData.sleepLength == -1 ? '' : this.valiFormData.sleepLength; |
|
|
|
|
this.valiFormData.cervicalVertebra = this.valiFormData.cervicalVertebra == -1 ? '' : this.valiFormData.cervicalVertebra; |
|
|
|
|
this.valiFormData.otherNeed = this.valiFormData.otherNeed == -1 ? '' : this.valiFormData.otherNeed; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 获取表单信息 |
|
|
|
|
getInfo(){ |
|
|
|
|
uni.request({ |
|
|
|
|
@ -504,7 +610,7 @@ |
|
|
|
|
}, |
|
|
|
|
submit(ref) { |
|
|
|
|
this.$refs[ref].validate().then(res => { |
|
|
|
|
// console.log(this.baseFormData); |
|
|
|
|
console.log(this.valiFormData); |
|
|
|
|
let params = {}; |
|
|
|
|
params = { |
|
|
|
|
username: this.valiFormData.username, |
|
|
|
|
@ -524,8 +630,11 @@ |
|
|
|
|
sleepLength: this.valiFormData.sleepLength, |
|
|
|
|
cervicalVertebra: this.valiFormData.cervicalVertebra, |
|
|
|
|
otherNeed: this.valiFormData.otherNeed, |
|
|
|
|
} |
|
|
|
|
orderNo:this.orderNo, |
|
|
|
|
id:this.valiFormData.id ? this.valiFormData.id : '' |
|
|
|
|
} |
|
|
|
|
console.log(getApp().globalData.baseUrl) |
|
|
|
|
|
|
|
|
|
uni.request({ |
|
|
|
|
url: getApp().globalData.baseUrl + '/blade-desk/custom-made-info/save', |
|
|
|
|
data: params, |
|
|
|
|
@ -541,7 +650,8 @@ |
|
|
|
|
this.multiIndex[0, 0, 0]; |
|
|
|
|
this.city = '' |
|
|
|
|
this.province = ''; |
|
|
|
|
this.district = '' |
|
|
|
|
this.district = ''; |
|
|
|
|
this.getOrderInfo('save') |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '提交失败', |
|
|
|
|
@ -553,21 +663,6 @@ |
|
|
|
|
reject(res) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
// NET.request1(API.save, params, 'post').then(res => { |
|
|
|
|
|
|
|
|
|
// console.log(res) |
|
|
|
|
// if (res.code == 200) { |
|
|
|
|
// uni.showToast({ |
|
|
|
|
// title: '提交成功', |
|
|
|
|
// icon: 'none' |
|
|
|
|
// }); |
|
|
|
|
// this.valiFormData = {}, |
|
|
|
|
// this.multiIndex[0, 0, 0]; |
|
|
|
|
// this.city = '' |
|
|
|
|
// this.province = ''; |
|
|
|
|
// this.district = '' |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log('err', err); |
|
|
|
|
}) |
|
|
|
|
@ -772,6 +867,15 @@ |
|
|
|
|
|
|
|
|
|
.top_content { |
|
|
|
|
padding: 30rpx; |
|
|
|
|
|
|
|
|
|
.num_box{ |
|
|
|
|
font-family: inherit; |
|
|
|
|
font-size: 40rpx; |
|
|
|
|
font-weight: normal; |
|
|
|
|
color: rgb(7, 0, 89); |
|
|
|
|
text-align: left; |
|
|
|
|
margin-bottom: 16rpx; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.title { |
|
|
|
|
font-family: inherit; |
|
|
|
|
@ -814,6 +918,24 @@ |
|
|
|
|
margin-top: 64rpx; |
|
|
|
|
margin-bottom: 64rpx; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.button_box{ |
|
|
|
|
width: 100%; |
|
|
|
|
height: 60rpx; |
|
|
|
|
display: flex; |
|
|
|
|
align-self: center; |
|
|
|
|
justify-content: space-between; |
|
|
|
|
// padding: 0 60rpx; |
|
|
|
|
.button{ |
|
|
|
|
width: 100rpx; |
|
|
|
|
height: 60rpx; |
|
|
|
|
background: red; |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
justify-content: center; |
|
|
|
|
// margin: 0 60rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.uni-forms-item { |
|
|
|
|
|
|
|
|
|
|