Commit 6c8000fe authored by 和慭琛's avatar 和慭琛

bug-fix

parent e7cf7cae
......@@ -25,8 +25,7 @@
//domain_Name: 'http://192.168.0.208:37080',
token:'',
//RTOKEN45f41a3053238cb72b3b72fe14df8d7040c9f502
openId:'',
//RTOKEN45f41a3053238cb72b3b72fe14df8d7040c9f502
//定位 图标
icon_location:'https://qn-static.banshouhui.com/take_order/icon/location.png',
......@@ -95,7 +94,9 @@
configCompletion:'',
protocolContent:'',
settledInfo:null,
signUrl:'',
},
......@@ -136,26 +137,7 @@
},
methods: {
async getBaseInfo(vm,callBack){
console.log('getbaseifno')
uni.showLoading({
title:'加载中……'
})
const res = await vm.$u.api.getSettleBaseInfo()
if (!res.status) {
uni.showToast({
title: res.message || '获取基本信息错误',
icon: 'none'
});
return false;
}
this.globalData.settledInfo = res.data
console.log(res.data,'res.data')
callBack(vm,res.data)
uni.hideLoading()
return res.data
},
initAPIneedToken: function() {
......
......@@ -10,6 +10,9 @@
// apiUrl: 'http://rest-u.yunya.com',
// fileUrl: 'https://s-fa.banshouhui.com',
// }
//yore
/*
let ucenterUrl = {
apiUrl: 'https://rest-u.banshouhui.com', //php端域名请求头
xueUrl:'https://xue.banshouhui.com', //学院
......@@ -18,19 +21,19 @@ let ucenterUrl = {
let systemUrl = {
apiUrl:'https://system.banshouhui.com', //java端域名请求头
}
*/
/* --------------------------- prod end --------------------------- */
/* --------------------------- test begin --------------------------- */
ucenterUrl = {
let ucenterUrl = {
apiUrl: 'https://rest-u.test.ibanshou.cn',
xueUrl:'https://xue.test.ibanshou.cn', //学院
banshou:'https://m.test.ibanshou.cn/', //扳手app
}
systemUrl = {
let systemUrl = {
apiUrl:'https://system.dev.banshouhui.com'
}
// askUrl = {
......
......@@ -2,16 +2,16 @@
<view class="content">
<view class="title">入驻基本信息</view>
<view class="base-list">
<view class="item item-input flex-yc">
<!--view class="item item-input flex-yc">
<label class="label">姓名</label>
<span class="required">*</span>
<input placeholder="请输入您的姓名" v-model.trim="baseInfo.name" class="input flex1" />
</view>
<view class="item item-input flex u-row-between">
</view-->
<!--view class="item item-input flex u-row-between">
<label class="label">电话</label>
<span class="required">*</span>
<input placeholder="请输入您的电话" v-model="baseInfo.mobile" class="input flex1" />
</view>
</view-->
<view class="item item-select u-row-between" @click="gopage('/pages/settle/select?selectType=area')">
<view class="label">接单城市:</view>
<p class="u-flex-1 u-text-right txt">{{ areaTxts.join(',') || "" }}</p>
......@@ -48,7 +48,7 @@
placeholder="请输入师傅数量"
placeholder-style='color:#CCCCCC;font-size:32rpx;'/>
</view>
<view class="tips bottom_padding_80">(必选项)选择你从事电工工作的工龄</view>
<view class="tips bottom_padding_80">(选填项)输入可投入交付服务的人员数量</view>
......@@ -122,7 +122,8 @@
computed: {
submitStatus() {
const baseInfo = this.baseInfo
const flag = baseInfo.name && baseInfo.mobile && baseInfo.service_area && baseInfo.working_age !== ''
//baseInfo.name && baseInfo.mobile &&
const flag = baseInfo.service_area && baseInfo.working_age !== ''
return flag && !this.saving;
},
},
......@@ -222,8 +223,11 @@
});
},
checkBaseInfo() {
console.log('非空判断-checkBaseInfo-this.baseInfo:')
console.log(this.baseInfo)
const baseInfo = this.baseInfo;
let rulesObj = {
/*
name: function(value) {
if (!value) {
uni.showToast({
......@@ -250,8 +254,11 @@
return false;
}
},
*/
service_area: function(value) {
if (!value) {
console.log('接单城市非空判断-value.length:')
console.log(value.length)
if (!value || value.length==0) {
uni.showToast({
title: '请选择您的接单城市',
icon: 'none'
......@@ -268,6 +275,16 @@
return false;
}
},
//address
address: function(value) {
if (value === '') {
uni.showToast({
title: '请选择您的地址',
icon: 'none'
});
return false;
}
},
};
......@@ -287,8 +304,8 @@
},
submitBaseInfo() {
// this.newSubmitBaseInfo()
// return
this.newSubmitBaseInfo()
return
const baseInfo = this.baseInfo;
if (!this.checkBaseInfo()) {
......@@ -305,12 +322,17 @@
const res = this.$u.api.submitSettleBaseInfo(params)
this.saving = false;
uni.hideLoading()
if (res) {
if (res.status != 200) {
uni.showToast({
title: '入驻基本信息提交成功',
icon: 'success'
title: res.message,
icon: 'none'
});
return;
}
uni.showToast({
title: '入驻基本信息提交成功',
icon: 'success'
});
let timer = setTimeout(() => {
clearTimeout(timer)
uni.navigateTo({
......@@ -320,84 +342,86 @@
},
// newSubmitBaseInfo: function(){
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(',')
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)
//http://rest-u.yunya.com
let that = this
uni.request({
url: 'https://rest-u.test.ibanshou.cn/v1/settled/save-info'
+'?access-token='+getApp().globalData.token,
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==401){
uni.navigateTo({
url:'/pages/login/wxlogin'
})
return
}
// if(res.statusCode==200){
// console.log('提交 入驻信息 成功 200')
if(res.statusCode==200){
console.log('提交 入驻信息 成功 200')
// uni.showToast({
// title: '入驻基本信息提交成功',
// icon: 'success'
// });
// let timer = setTimeout(() => {
// clearTimeout(timer)
// uni.navigateTo({
// url:'/pages/settle/file'
// })
// }, 2000)
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
// })
}else{
uni.showToast({
icon:'none',
title:res.data.message
})
// }
}
// },
// fail: (e) => {
// uni.hideLoading()
// uni.showToast({
// icon:'none',
// title:'提交入驻信息失败'
// })
// console.log('提交 入驻信息 失败')
// console.log(e)
// }
// })
},
fail: (e) => {
uni.hideLoading()
uni.showToast({
icon:'none',
title:'提交入驻信息失败'
})
console.log('提交 入驻信息 失败')
console.log(e)
}
})
// },
},
},
}
......@@ -423,6 +447,13 @@
line-height: 44rpx;
color: #333;
font-size: 32rpx;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.required {
......@@ -550,13 +581,14 @@
/*提交按钮*/
.btn-wrap {
position: fixed;
// margin: px2rem(36);
left: 0;
right: 0;
bottom: 0;
//position: fixed;
//left: 0;
//right: 0;
//bottom: 0;
padding: 30rpx 0;
background: #f3f3f3;
width: 100%;
.btn-submit {
width: 600rpx;
......
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