Commit 03d3a6a0 authored by 和慭琛's avatar 和慭琛

入驻信息页 添加:师傅数量 地图可选定位 接口对接 100%

parent f3366d32
......@@ -17,7 +17,7 @@
<text class="numberText">{{progress}}</text>
</view>
<view class="topicView">
<text class="topicText">{{currentItem.topic}}</text>
<text class="topicText">{{currentItem.question.content}}</text>
</view>
<view class="itemView" v-for="(item,ikey) in currentItem.answerList":key="ikey">
<text :class="item.isSelect ? 'itemText selectedColor' : 'itemText defaultColor' "
......@@ -41,7 +41,7 @@
export default {
data() {
return {
examId:1,
examId:2,
userExamId:0,
userAnswerIds:'',
isStart:false,
......@@ -98,7 +98,7 @@
console.log('获取考试信息 成功')
console.log(res)
if(res.statusCode==401){
if(res.statusCode==401 || res.statusCode==403 ){
uni.navigateTo({
url:'/pages/login/wxlogin'
})
......
......@@ -27,12 +27,57 @@
<!-- <i class="iconfont icon-xiangyou"></i> -->
</view>
<view class="tips">(必选项)选择你从事电工工作的工龄</view>
<view class="item item-input flex u-row-between">
<!--view class="item item-input flex u-row-between">
<label class="label">详细地址:</label>
<u-icon name="map" color="#999" size="34"></u-icon>
<!-- <input placeholder="请输入您的电话" v-model="baseInfo.mobile" class="input flex1" /> -->
</view-->
<!--view class="tips">{{baseInfo.address}}</view-->
<view class="itemView">
<view class="itemTitleView">
<text class="itemTitle">师傅数量</text>
<!--text class="itemRedStar">*</text-->
</view>
<input
class="itemInput"
@input="countInput"
maxlength="5"
v-model="name"
type=""
value=""
placeholder="请输入师傅数量"
placeholder-style='color:#CCCCCC;font-size:32rpx;'/>
</view>
<view class="tips bottom_padding_80">(必选项)选择你从事电工工作的工龄</view>
<view class="newAddressView">
<view class="newAddressTitleView" @click="locationClick()">
<view class="address">
<text class="itemTitle">详细地址</text>
<!--text class="itemRedStar">*</text-->
</view>
<view class="right-margin-40">
<u-icon name="map" color="#999" size="34"></u-icon>
<text class="blueColor">定位</text>
</view>
</view>
<view class="addressBackView">
<textarea
class="addressTextAreaView"
maxlength="300"
v-model="baseInfo.address"
auto-height="true"
value=""
placeholder="请输入详细服务地址"
placeholder-style='color:#CCCCCC;font-size:28rpx;'/>
</view>
</view>
<view class="tips">{{baseInfo.address}}</view>
</view>
<view class="seat"></view>
<view class="btn-wrap flex-xc">
......@@ -57,12 +102,14 @@
mobile: "",
service_area: [],
working_age: "",
worker_num:"",
address:''
},
saving: false,
areaTxts: [],
workingAgeTxt: '',
protocolContent: ''
protocolContent: '',
address:''
}
},
onLoad(e) {
......@@ -122,6 +169,33 @@
};
t()
},
//师傅数量
countInput(e){
this.baseInfo.worker_num = e.detail.value
},
//定位点击
locationClick:function(){
let that = this
uni.chooseLocation({
success: function (res) {
// console.log('位置名称:' + res.name);
// console.log('详细地址:' + res.address);
// console.log('纬度:' + res.latitude);
// console.log('经度:' + res.longitude);
that.baseInfo.address = res.address + res.name
//that.address = res.address + res.name
},fail: function (res) {
uni.showToast({
title:'定位失败'
})
}
});
},
gopage(url) {
uni.navigateTo({
url,
......@@ -194,6 +268,8 @@
return false;
}
},
};
const flagArr = Object.keys(baseInfo).some((key) => {
// 返回验证失败的数组
......@@ -210,6 +286,10 @@
return !flagArr || flagArr.length < 1;
},
submitBaseInfo() {
this.newSubmitBaseInfo()
return
const baseInfo = this.baseInfo;
if (!this.checkBaseInfo()) {
return;
......@@ -243,6 +323,87 @@
})
}, 2000)
},
newSubmitBaseInfo: function(){
const baseInfo = this.baseInfo;
if (!this.checkBaseInfo()) {
return;
}
this.saving = true;
uni.showLoading({
title: '加载中'
});
const params = {
...baseInfo,
}
params.service_area = baseInfo.service_area.join(',')
let that = this
uni.request({
url: 'http://rest-u.yunya.com/v1/settled/save-info',
method: 'POST',
data: {
name: params.name,
mobile: params.mobile,
service_area: params.service_area,
working_age: params.working_age,
worker_num:params.worker_num,
address:params.address,
access_token:getApp().globalData.token
},
success: (res) => {
uni.hideLoading()
console.log('提交 入驻信息 成功')
console.log(res)
if(res.statusCode==401){
uni.navigateTo({
url:'/pages/login/wxlogin'
})
return
}
if(res.statusCode==200){
console.log('提交 入驻信息 成功 200')
uni.showToast({
title: '入驻基本信息提交成功',
icon: 'success'
});
let timer = setTimeout(() => {
clearTimeout(timer)
uni.navigateTo({
url:'/pages/settle/file'
})
}, 2000)
}else{
uni.showToast({
icon:'none',
title:res.data.message
})
}
},
fail: (e) => {
uni.hideLoading()
uni.showToast({
icon:'none',
title:'提交入驻信息失败'
})
console.log('提交 入驻信息 失败')
console.log(e)
}
})
},
},
}
</script>
......@@ -419,6 +580,109 @@
}
}
}
.itemView {
background-color: #FFFFFF;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 100%;
height: 104rpx;
}
.itemTitleView{
background-color: #FFFFFF;
width: 30%;
height: 102rpx;
display: flex;
flex-direction: row;
align-items: center;
}
.borderBottom{
border-bottom: 1rpx solid #CCCCCC;
}
.itemTitle {
background-color: #FFFFFF;
margin-left: 30rpx;
font-size: 32rpx;
font-weight: bold;
color: #333333;
}
.itemRedStar {
font-size: 32rpx;
color: #D02B2B;
}
.itemInput {
background-color: #FFFFFF;
margin-right: 30rpx;
height: 70rpx;
width: 70%;
text-align: right;
font-size: 32rpx;
}
.newAddressView{
margin-top: 60rpx;
background-color: #FFFFFF;
width: 100%;
display: flex;
flex-direction: column;
padding-bottom: 30rpx;
}
.newAddressTitleView{
height: 64rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.itemTitle {
background-color: #FFFFFF;
margin-left: 30rpx;
font-size: 32rpx;
font-weight: bold;
color: #333333;
}
.itemRedStar {
font-size: 32rpx;
color: #D02B2B;
}
.addressBackView{
background-color: #FFFFFF;
width: 690rpx;
border: 2rpx solid #F3F3F3;
margin-left: 30rpx;
padding-bottom: 24prx;
}
.addressTextAreaView{
background-color: #FFFFFF;
width: 640rpx;
height: 40rpx;
margin-top: 24rpx;
margin-left: 24rpx;
font-size: 28rpx;
line-height: 40rpx;
padding-bottom: 20rpx;
}
.right-margin-40{
margin-right: 40rpx;
}
.blueColor{
color: #007AFF;
}
/* .back_view{
background-color: #FFFFFF;
......
......@@ -274,23 +274,30 @@
const res = await this.$u.api.getSettleArea(params)
console.log('res:')
console.log(res)
console.log('res.status:')
console.log(res.status)
console.log('res.statusCode:')
console.log(res.statusCode)
console.log('level:')
console.log(level)
uni.hideLoading()
if (res.status != 200) {
// if (res.status != 200) {
// return;
// }
if (!res) {
return;
}
if (!level) {
console.log('res.data:')
console.log(res.data)
this.areaList = res.data
const parmas = [res.data[0].id, 1]
// this.areaList = res.data
// const parmas = [res.data[0].id, 1]
this.areaList = res
const parmas = [res[0].id, 1]
this.getareaList(...parmas)
} else {
this.$set(areaList[provinceIndex], 'children', res.data)
// this.$set(areaList[provinceIndex], 'children', res.data)
this.$set(areaList[provinceIndex], 'children', res)
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment