Commit 87c0ca9e authored by 李俊赕's avatar 李俊赕

基本信息页-页面搭建

parent ad702724
......@@ -241,6 +241,10 @@
"name": "拍照小工具", //模式名称
"path": "pages/photo/try", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},{
"name": "考试", //模式名称
"path": "pages/exam/index", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}]
}
......
<template>
<view class="back_view">
入驻基本信息
<view class="content">
<view class="title">入驻基本信息</view>
<view class="base-list">
<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">
<label class="label">电话</label>
<span class="required">*</span>
<input placeholder="请输入您的电话" v-model="baseInfo.mobile" class="input flex1" />
</view>
<view class="item item-select u-row-between" @click="areaBoxShow = true">
<view class="label">接单城市:</view>
<p class="flex1 u-text-right txt">{{ areaSelectTxtArr.join(',') || "广东人" }}</p>
<i class="iconfont icon-xiangyou"></i>
</view>
<view class="tips">(必选项)选择你可以服务的城市,可选多个</view>
<view class="item item-select flex-yc" @click="ageBoxShow = true">
<view class="label">电工工龄(年):</view>
<p class="flex1 u-text-right" v-show="baseInfo.working_age !== ''">
{{ workingAgeTxt }}
</p>
<i class="iconfont icon-xiangyou"></i>
</view>
<view class="tips">(必选项)选择你从事电工工作的工龄</view>
</view>
<view class="seat"></view>
<view class="btn-wrap flex-xc">
<button class="btn-submit" :disabled="!submitStatus" @click="submitBaseInfo">
确定
</button>
</view>
</view>
</template>
......@@ -8,34 +40,253 @@
export default {
data() {
return {
protocolContent:''
baseInfo: {
name: "",
mobile: "",
service_area: [],
working_age: "",
},
submitStatus: false,
saving: false,
areaSelectTxtArr:[],
protocolContent: ''
}
},
onLoad(e) {
if(e && e.activeService && e.activeService.length>0){
if (e && e.activeService && e.activeService.length > 0) {
//console.log(e.activeService)
this.activeService = e.activeService
}
},
computed: {
submitStatus() {
const baseInfo = this.baseInfo
const flag = baseInfo.name && baseInfo.mobile && baseInfo.service_area && baseInfo.working_age !== ''
return flag && !this.saving;
},
},
methods: {
//拨打客服 点击
phoneCallClick: function (phone) {
phoneCallClick: function(phone) {
uni.makePhoneCall({
phoneNumber: phone
phoneNumber: phone
});
},
}
submitBaseInfo() {
const baseInfo = this.baseInfo;
if (!this.checkBaseInfo()) {
return;
}
this.saving = true;
uni.showLoading({
title: '加载中'
});
const params = {
...baseInfo,
}
params.service_area = baseInfo.service_area.join(',')
api.post("@u/v1/h5/settled/save-info", params).then((res) => {
this.saving = false;
uni.hideLoading()
if (res.status != 200) {
return;
}
uni.showToast({
title: '入驻基本信息提交成功',
icon: 'success'
});
let timer = setTimeout(() => {
clearTimeout(timer)
// this.$router.push({
// path: '/activity/settled_2021/file_info',
// query: {
// id: res.data.id,
// ...this.$route.query
// }
// })
}, 2000)
}).catch((res) => {
this.saving = false;
Indicator.close();
MessageBox("提示", res.message);
});
},
},
}
</script>
<style>
.back_view{
<style lang="scss">
.base-list {
.item {
display: flex;
margin-bottom: 58rpx;
padding: 28rpx 30rpx;
width: 100%;
height: 100rpx;
font-size: 32rpx;
background-color: #fff;
.label {
color: #333;
font-size: 32rpx;
}
.txt {
line-height: 44rpx;
color: #333;
font-size: 32rpx;
}
.required {
margin: 0 6rpx;
color: red;
font-size: 32rpx;
}
.iconfont {
color: #999;
}
}
.tips {
margin-top: 20rpx;
padding: 0 30rpx;
line-height: 40rpx;
font-size: 28rpx;
color: #666;
&+.id-identity-box {
margin-top: -38rpx;
margin-bottom: 40rpx;
}
}
.id-identity-box {
.txt {
padding-top: 8rpx;
line-height: 40rpx;
font-size: 28rpx;
color: #666;
&:first-child {
margin-top: -58rpx;
padding-top: 12rpx;
}
.red {
color: red;
}
}
// &.tips{
// margin-bottom:0!important;
// }
}
.item+.tips {
margin-top: -38rpx;
margin-bottom: 58rpx;
}
/*选择内容*/
.item-select {
font-size: 30rpx;
color: #333;
font-weight: 500;
justify-content: space-between;
border-bottom: 1rpx solid #f5f5f5;
}
.flex1 {
flex: 1 !important;
&.txt {
white-space: nowrap;
max-width: 450rpx;
overflow: hidden;
text-overflow: ellipsis;
}
}
.item-input {
overflow: hidden;
input {
text-align: right;
line-height: 44rpx;
width: 100%;
font-size: 30rpx;
color: #333;
font-weight: 400;
}
.input-readonly {
font-size: 30rpx;
color: #999;
font-weight: 400;
}
input::-webkit-input-placeholder {
font-size: 30rpx;
color: #999;
font-weight: 400;
}
input:-moz-placeholder {
font-size: 30rpx;
color: #999;
font-weight: 400;
}
input:-ms-input-placeholder {
font-size: 30rpx;
color: #999;
font-weight: 400;
}
}
}
.title {
padding: 30rpx 0 40rpx;
text-align: center;
line-height: 50rpx;
font-size: 36rpx;
color: #333;
font-weight: bold;
}
.seat {
padding-bottom: 144rpx;
}
/*提交按钮*/
.btn-wrap {
position: fixed;
// margin: px2rem(36);
left: 0;
right: 0;
bottom: 0;
padding: 30rpx 0;
background: #f3f3f3;
.btn-submit {
width: 600rpx;
// left: 5%;
// bottom: px2rem(36);
height: 104rpx;
line-height: 104rpx;
background: #2272ff;
font-size: 32rpx;
color: #fff;
&:disabled {
border: 2rpx solid #999;
background-color: #f3f3f3;
color: #999;
}
}
}
/* .back_view{
background-color: #FFFFFF;
position: absolute;
top: 0;
......@@ -44,5 +295,5 @@
display: flex;
flex-direction: column;
}
*/
</style>
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