|
|
@ -1,12 +1,17 @@ |
|
|
|
<template> |
|
|
|
<view class="content"> |
|
|
|
<view class="content" style="padding-bottom: 90rpx;"> |
|
|
|
|
|
|
|
<mNavbar |
|
|
|
:leftClick="toLeft" |
|
|
|
/> |
|
|
|
|
|
|
|
<view class="banner"></view> |
|
|
|
|
|
|
|
<view class="b-relative" style="width: 710rpx;height: 310rpx; margin: -174rpx auto 0;"> |
|
|
|
<image src="/static/ms/settled.png" style="width: 710rpx;height: 310rpx;"></image> |
|
|
|
<image src="/static/ms/1120.jpg" style="width: 710rpx;height: 310rpx; |
|
|
|
border-radius: 20rpx;"></image> |
|
|
|
<view class="banner-font"> |
|
|
|
<image style="width: 380rpx;height: 98rpx;" src="/static/ms/fontjszm.png"></image> |
|
|
|
技师招募 |
|
|
|
</view> |
|
|
|
<view class="font-3">打造专业的技术服务</view> |
|
|
|
<view class="banner-button">立即联系我们>></view> |
|
|
@ -22,10 +27,7 @@ |
|
|
|
<view class="item-line flex"> |
|
|
|
<view class="before"></view> |
|
|
|
<view class="label">技师性别</view> |
|
|
|
<van-radio-group v-model="technician.sex" direction="horizontal"> |
|
|
|
<van-radio name="男">男</van-radio> |
|
|
|
<van-radio name="女">女</van-radio> |
|
|
|
</van-radio-group> |
|
|
|
<input placeholder="请选择性别" v-model="technician.sex"/> |
|
|
|
</view> |
|
|
|
<view class="item-line flex"> |
|
|
|
<view class="before"></view> |
|
|
@ -46,8 +48,9 @@ |
|
|
|
<view class="before"></view> |
|
|
|
<view class="label" style="width: 100%">请上传本人近期照片</view> |
|
|
|
</view> |
|
|
|
<view v-if="!technician.image" @click="fileUploads" class="upload"> |
|
|
|
<uni-icons type="plusempty" size="80rpx" color="#37bea7"/> |
|
|
|
<view v-if="!technician.image" @click="fileUploads" class="upload b-relative"> |
|
|
|
<uni-icons type="plusempty" size="80rpx" color="#6e3009" |
|
|
|
style="position: absolute; top: 50rpx; left: 60rpx;" /> |
|
|
|
</view> |
|
|
|
<view v-else @click="fileUploads" class="upload b-relative"> |
|
|
|
<image class="upload-img" :src="technician.image" mode="aspectFill"></image> |
|
|
@ -65,26 +68,35 @@ |
|
|
|
<script> |
|
|
|
import OSS from "ali-oss" |
|
|
|
import { v4 as uuidv4 } from 'uuid'; |
|
|
|
import { showDialog } from 'vant'; |
|
|
|
|
|
|
|
import mNavbar from '@/components/base/m-navbar.vue' |
|
|
|
export default { |
|
|
|
components : { |
|
|
|
mNavbar |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
technician: { |
|
|
|
id : '', |
|
|
|
name : '', |
|
|
|
sex : '男', |
|
|
|
sex : '', |
|
|
|
phone : '', |
|
|
|
age : '', |
|
|
|
city : '', |
|
|
|
image : '', |
|
|
|
phone : '' |
|
|
|
image : '' |
|
|
|
}, |
|
|
|
ossOption: { |
|
|
|
region : 'oss-cn-shenzhen', |
|
|
|
accessKey: 'LTAI5tMan18fjJPUtr3Aim2W', |
|
|
|
secretKey: 'lhALqqgYijc115wY8c1KfTYkbSnq5I', |
|
|
|
endpoint: 'oss-cn-shenzhen.aliyuncs.com', |
|
|
|
bucketName: 'mangoimageapplet', |
|
|
|
staticDomain: 'https://dianpin-img.xzaiyp.top' |
|
|
|
}, |
|
|
|
imgs : [] |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow(){ |
|
|
|
this.getTenFans() |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getUserInfo() { //获取用户信息 |
|
|
@ -104,13 +116,19 @@ |
|
|
|
} |
|
|
|
this.$api('addOrUpdateMsgTer', this.technician, res => { |
|
|
|
if (res.code == 200) { |
|
|
|
showDialog({ |
|
|
|
title: this.technician.id ? '修改入驻' : '技师入驻', |
|
|
|
message: this.technician.id ? '技师入驻修改成功' : '技师入驻提交成功', |
|
|
|
}).then(() => { |
|
|
|
uni.switchTab({ |
|
|
|
url: '/pages/index/index' |
|
|
|
}) |
|
|
|
uni.showModal({ |
|
|
|
title: '技师入驻', |
|
|
|
content: '技师入驻提交成功', |
|
|
|
confirmText : '确认', |
|
|
|
cancelText : '取消', |
|
|
|
showCancel: false,//没有取消按钮的弹框 |
|
|
|
success: function (res) { |
|
|
|
if (res.confirm) { |
|
|
|
uni.switchTab({ |
|
|
|
url: '/pages/index/center' |
|
|
|
}) |
|
|
|
} else if (res.cancel) {} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
@ -118,21 +136,21 @@ |
|
|
|
parameterVerification(){ //验证用户参数合法性 |
|
|
|
let { name , sex , phone , age , city , image } = this.technician |
|
|
|
if(name.trim() == ''){ |
|
|
|
return { title : '请填写技师姓名' , auth : false } |
|
|
|
return { title : '请填写用户名' , auth : false } |
|
|
|
}else if(sex.trim() == ''){ |
|
|
|
return { title : '请选择性别' , auth : false } |
|
|
|
}else if(phone.trim() == ''){ |
|
|
|
return { title : '请填写手机号' , auth : false } |
|
|
|
}else if(!age){ |
|
|
|
return { title : '请填写年龄' , auth : false } |
|
|
|
}else if(phone){ |
|
|
|
if(!/^1(3|4[0-9]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9\d)\d{8}$/.test(phone)){ |
|
|
|
return { title : '手机号格式不合法' , auth : false } |
|
|
|
} |
|
|
|
}else if(age){ |
|
|
|
return { title : '请填写手机号' , auth : false } |
|
|
|
}else if(city.trim() == ''){ |
|
|
|
return { title : '请填写意向城市' , auth : false } |
|
|
|
}else if(image.trim() == ''){ |
|
|
|
return { title : '请上传近期照片' , auth : false } |
|
|
|
}else if(phone.trim() != ''){ |
|
|
|
if(!this.$utils.verificationPhone(phone)){ |
|
|
|
return { title : '手机号格式不合法' , auth : false } |
|
|
|
} |
|
|
|
} |
|
|
|
return { title : '验证通过' , auth : true } |
|
|
|
}, |
|
|
@ -145,6 +163,14 @@ |
|
|
|
success: (res) => { |
|
|
|
let resultPromise = []; |
|
|
|
|
|
|
|
//上传多张图片逻辑 |
|
|
|
// res.tempFiles.forEach(file => { |
|
|
|
// resultPromise.push(this.uploadFileToOSS(file)); |
|
|
|
// }) |
|
|
|
// Promise.all(resultPromise).then(imgPathArr => { |
|
|
|
// this.imgs = imgPathArr |
|
|
|
// }) |
|
|
|
|
|
|
|
//上传单张图片逻辑 |
|
|
|
this.uploadFileToOSS(res.tempFiles[0]).then(imgPath => { |
|
|
|
this.technician.image = imgPath; |
|
|
@ -152,49 +178,43 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
getTenFans(){ //获取我推荐的技师记录 |
|
|
|
this.$api('getTenFans', {}, res => { |
|
|
|
if (res.code == 200) { |
|
|
|
if(res.result.length > 0){ |
|
|
|
let { id , name , sex , age , city , image , phone } = res.result[0]; |
|
|
|
this.technician = { id ,name , sex , age , city , image , phone } |
|
|
|
} |
|
|
|
} |
|
|
|
toLeft(){ |
|
|
|
uni.switchTab({ |
|
|
|
url: '/pages/index/center' |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style> |
|
|
|
<style scoped lang="scss"> |
|
|
|
body { |
|
|
|
background-color: #f5f5f5; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.banner { |
|
|
|
width: 100vw; |
|
|
|
height: calc(392rpx - 160rpx); |
|
|
|
background: linear-gradient(38deg, #4899a6 44%, #60bda2 100%); |
|
|
|
background: linear-gradient(to right, #ecb978, #ffe6ed); |
|
|
|
color: $uni-color; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.banner-font { |
|
|
|
width: 292rpx; |
|
|
|
width: 692rpx; |
|
|
|
height: 142rpx; |
|
|
|
font-size: 72rpx; |
|
|
|
line-height: 66rpx; |
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; |
|
|
|
font-weight: 400; |
|
|
|
font-weight: 900; |
|
|
|
text-align: left; |
|
|
|
color: #ffffff; |
|
|
|
letter-spacing: -1; |
|
|
|
text-shadow: 0px 6px 6px 0px rgba(0, 165, 141, 0.70); |
|
|
|
|
|
|
|
letter-spacing: 20rpx; |
|
|
|
position: absolute; |
|
|
|
left: 52rpx; |
|
|
|
top: 34rpx; |
|
|
|
left: 0; |
|
|
|
text-align: center; |
|
|
|
top: 84rpx; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.font-3 { |
|
|
|
height: 28rpx; |
|
|
|
line-height: 28rpx; |
|
|
@ -203,13 +223,13 @@ |
|
|
|
font-weight: 400; |
|
|
|
text-align: left; |
|
|
|
color: #ffffff; |
|
|
|
|
|
|
|
|
|
|
|
text-shadow: 0 4rpx 6rpx 0 rgba(0, 165, 141, 0.70); |
|
|
|
position: absolute; |
|
|
|
left: 52rpx; |
|
|
|
top: 138rpx; |
|
|
|
top: 228rpx; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.banner-button { |
|
|
|
width: 240rpx; |
|
|
|
height: 56rpx; |
|
|
@ -217,29 +237,29 @@ |
|
|
|
background: #ffdb75; |
|
|
|
border-radius: 24rpx; |
|
|
|
box-shadow: 0 6rpx 6rpx 0 rgba(17, 106, 93, 0.23); |
|
|
|
|
|
|
|
|
|
|
|
position: absolute; |
|
|
|
left: 52rpx; |
|
|
|
right: 52rpx; |
|
|
|
top: 220rpx; |
|
|
|
|
|
|
|
|
|
|
|
font-size: 24rpx; |
|
|
|
font-family: PingFang SC, PingFang SC-Bold; |
|
|
|
font-weight: 700; |
|
|
|
text-align: center; |
|
|
|
color: #26c591; |
|
|
|
color: $uni-color; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.item-card { |
|
|
|
width: calc(710rpx - 40rpx); |
|
|
|
height: 840rpx; |
|
|
|
background: #ffffff; |
|
|
|
border-radius: 16rpx; |
|
|
|
|
|
|
|
|
|
|
|
margin: 40rpx auto 20rpx; |
|
|
|
padding: 1rpx 20rpx; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.item-line { |
|
|
|
height: 60rpx; |
|
|
|
font-size: 28rpx; |
|
|
@ -249,50 +269,50 @@ |
|
|
|
color: #333333; |
|
|
|
margin-top: 40rpx; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.item-line .before { |
|
|
|
content: ""; |
|
|
|
width: 8rpx; |
|
|
|
height: 30rpx; |
|
|
|
background: #4fd3bc; |
|
|
|
background: $uni-color; |
|
|
|
border-radius: 4rpx; |
|
|
|
margin-right: 10rpx; |
|
|
|
margin-top: 15rpx; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.item-line .label { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
width: 152rpx; |
|
|
|
height: 60rpx; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.item-line input { |
|
|
|
width: 456rpx; |
|
|
|
height: 60rpx; |
|
|
|
line-height: 60rpx; |
|
|
|
background: #f5f5f5; |
|
|
|
border-radius: 12rpx; |
|
|
|
|
|
|
|
|
|
|
|
font-size: 24rpx; |
|
|
|
font-family: PingFang SC, PingFang SC-Medium; |
|
|
|
font-weight: 500; |
|
|
|
text-align: left; |
|
|
|
color: #939393; |
|
|
|
|
|
|
|
|
|
|
|
padding: 0 20rpx; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.upload { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
width: 200rpx; |
|
|
|
height: 200rpx; |
|
|
|
background: rgba(245, 245, 245, 0.82); |
|
|
|
border: 2rpx dashed #99dcd0; |
|
|
|
background: rgba($uni-color, 0.22); |
|
|
|
border: 2rpx dashed $uni-color; |
|
|
|
border-radius: 16rpx; |
|
|
|
|
|
|
|
|
|
|
|
margin: 10rpx 12rpx; |
|
|
|
} |
|
|
|
|
|
|
@ -302,22 +322,22 @@ |
|
|
|
border: 2rpx dashed #ccc; |
|
|
|
margin: 2rpx; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.button-submit { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
width: 596rpx; |
|
|
|
height: 90rpx; |
|
|
|
background: linear-gradient(180deg, #6fdfbe, #5ac796); |
|
|
|
border-radius: 46rpx; |
|
|
|
|
|
|
|
|
|
|
|
margin: 20rpx auto; |
|
|
|
|
|
|
|
|
|
|
|
font-size: 28rpx; |
|
|
|
font-family: PingFang SC, PingFang SC-Regular; |
|
|
|
font-weight: 400; |
|
|
|
text-align: center; |
|
|
|
color: #ffffff; |
|
|
|
background: $uni-bg-color; |
|
|
|
color: $uni-color; |
|
|
|
} |
|
|
|
</style> |