宜轩到家/服务到家第三版,换个颜色
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

342 lines
8.2 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <view class="content" style="padding-bottom: 90rpx;">
  3. <mNavbar
  4. :leftClick="toLeft"
  5. />
  6. <view class="banner"></view>
  7. <view class="b-relative" style="width: 710rpx;height: 310rpx; margin: -174rpx auto 0;">
  8. <image src="/static/ms/1120.jpg" style="width: 710rpx;height: 310rpx;
  9. border-radius: 20rpx;"></image>
  10. <view class="banner-font">
  11. 技师招募
  12. </view>
  13. <view class="font-3">打造专业的技术服务</view>
  14. <view class="banner-button">立即联系我们>></view>
  15. </view>
  16. <view>
  17. <view class="item-card">
  18. <view class="item-line flex">
  19. <view class="before"></view>
  20. <view class="label">技师姓名</view>
  21. <input placeholder="请输入姓名" v-model="technician.name" />
  22. </view>
  23. <view class="item-line flex">
  24. <view class="before"></view>
  25. <view class="label">技师性别</view>
  26. <input placeholder="请选择性别" v-model="technician.sex"/>
  27. </view>
  28. <view class="item-line flex">
  29. <view class="before"></view>
  30. <view class="label">联系方式</view>
  31. <input placeholder="请输入联系方式" v-model="technician.phone" />
  32. </view>
  33. <view class="item-line flex">
  34. <view class="before"></view>
  35. <view class="label">技师年龄</view>
  36. <input placeholder="请输入技师年龄" type="number" v-model.number="technician.age" />
  37. </view>
  38. <view class="item-line flex">
  39. <view class="before"></view>
  40. <view class="label">意向城市</view>
  41. <input placeholder="请输入意向工作城市" v-model="technician.city" />
  42. </view>
  43. <view class="item-line flex">
  44. <view class="before"></view>
  45. <view class="label" style="width: 100%">请上传本人近期照片</view>
  46. </view>
  47. <view v-if="!technician.image" @click="fileUploads" class="upload b-relative">
  48. <uni-icons type="plusempty" size="80rpx" color="#6e3009"
  49. style="position: absolute; top: 50rpx; left: 60rpx;" />
  50. </view>
  51. <view v-else @click="fileUploads" class="upload b-relative">
  52. <image class="upload-img" :src="technician.image" mode="aspectFill"></image>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="b-fiexd">
  57. <view @click="addOrUpdateMsgTer" class="button-submit">提交</view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import OSS from "ali-oss"
  63. import { v4 as uuidv4 } from 'uuid';
  64. import mNavbar from '@/components/base/m-navbar.vue'
  65. export default {
  66. components : {
  67. mNavbar
  68. },
  69. data() {
  70. return {
  71. technician: {
  72. name : '',
  73. sex : '',
  74. phone : '',
  75. age : '',
  76. city : '',
  77. image : ''
  78. },
  79. ossOption: {
  80. region : 'oss-cn-shenzhen',
  81. accessKey: 'LTAI5tMan18fjJPUtr3Aim2W',
  82. secretKey: 'lhALqqgYijc115wY8c1KfTYkbSnq5I',
  83. endpoint: 'oss-cn-shenzhen.aliyuncs.com',
  84. bucketName: 'mangoimageapplet',
  85. staticDomain: 'https://dianpin-img.xzaiyp.top'
  86. },
  87. imgs : []
  88. }
  89. },
  90. onShow(){
  91. },
  92. methods: {
  93. getUserInfo() { //获取用户信息
  94. this.$api('getUserInfo', {}, res => {
  95. if (res.code == 200) {
  96. this.userInfo = res.result;
  97. }
  98. })
  99. },
  100. addOrUpdateMsgTer() { //新增修改技师入驻信息
  101. let isOk = this.parameterVerification()
  102. if(!isOk.auth){
  103. return uni.showToast({
  104. title : isOk.title,
  105. icon : 'none'
  106. })
  107. }
  108. this.$api('addOrUpdateMsgTer', this.technician, res => {
  109. if (res.code == 200) {
  110. uni.showModal({
  111. title: '技师入驻',
  112. content: '技师入驻提交成功',
  113. confirmText : '确认',
  114. cancelText : '取消',
  115. showCancel: false,//没有取消按钮的弹框
  116. success: function (res) {
  117. if (res.confirm) {
  118. uni.switchTab({
  119. url: '/pages/index/center'
  120. })
  121. } else if (res.cancel) {}
  122. }
  123. });
  124. }
  125. })
  126. },
  127. parameterVerification(){ //验证用户参数合法性
  128. let { name , sex , phone , age , city , image } = this.technician
  129. if(name.trim() == ''){
  130. return { title : '请填写用户名' , auth : false }
  131. }else if(sex.trim() == ''){
  132. return { title : '请选择性别' , auth : false }
  133. }else if(phone.trim() == ''){
  134. return { title : '请填写手机号' , auth : false }
  135. }else if(phone){
  136. if(!/^1(3|4[0-9]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9\d)\d{8}$/.test(phone)){
  137. return { title : '手机号格式不合法' , auth : false }
  138. }
  139. }else if(age){
  140. return { title : '请填写手机号' , auth : false }
  141. }else if(city.trim() == ''){
  142. return { title : '请填写意向城市' , auth : false }
  143. }else if(image.trim() == ''){
  144. return { title : '请上传近期照片' , auth : false }
  145. }
  146. return { title : '验证通过' , auth : true }
  147. },
  148. fileUploads() { //上传文件
  149. uni.chooseImage({
  150. count: 1, // 默认9,设置为1表示单选
  151. sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
  152. sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
  153. success: (res) => {
  154. let resultPromise = [];
  155. //上传多张图片逻辑
  156. // res.tempFiles.forEach(file => {
  157. // resultPromise.push(this.uploadFileToOSS(file));
  158. // })
  159. // Promise.all(resultPromise).then(imgPathArr => {
  160. // this.imgs = imgPathArr
  161. // })
  162. //上传单张图片逻辑
  163. this.uploadFileToOSS(res.tempFiles[0]).then(imgPath => {
  164. this.technician.image = imgPath;
  165. })
  166. }
  167. });
  168. },
  169. toLeft(){
  170. uni.switchTab({
  171. url: '/pages/index/center'
  172. })
  173. }
  174. }
  175. }
  176. </script>
  177. <style scoped lang="scss">
  178. body {
  179. background-color: #f5f5f5;
  180. }
  181. .banner {
  182. width: 100vw;
  183. height: calc(392rpx - 160rpx);
  184. background: linear-gradient(to right, #ecb978, #ffe6ed);
  185. color: $uni-color;
  186. }
  187. .banner-font {
  188. width: 692rpx;
  189. height: 142rpx;
  190. font-size: 72rpx;
  191. line-height: 66rpx;
  192. font-weight: 900;
  193. text-align: left;
  194. color: #ffffff;
  195. letter-spacing: 20rpx;
  196. position: absolute;
  197. left: 0;
  198. text-align: center;
  199. top: 84rpx;
  200. }
  201. .font-3 {
  202. height: 28rpx;
  203. line-height: 28rpx;
  204. font-size: 24rpx;
  205. font-family: PingFang SC, PingFang SC-Regular;
  206. font-weight: 400;
  207. text-align: left;
  208. color: #ffffff;
  209. text-shadow: 0 4rpx 6rpx 0 rgba(0, 165, 141, 0.70);
  210. position: absolute;
  211. left: 52rpx;
  212. top: 228rpx;
  213. }
  214. .banner-button {
  215. width: 240rpx;
  216. height: 56rpx;
  217. line-height: 56rpx;
  218. background: #ffdb75;
  219. border-radius: 24rpx;
  220. box-shadow: 0 6rpx 6rpx 0 rgba(17, 106, 93, 0.23);
  221. position: absolute;
  222. right: 52rpx;
  223. top: 220rpx;
  224. font-size: 24rpx;
  225. font-family: PingFang SC, PingFang SC-Bold;
  226. font-weight: 700;
  227. text-align: center;
  228. color: $uni-color;
  229. }
  230. .item-card {
  231. width: calc(710rpx - 40rpx);
  232. height: 840rpx;
  233. background: #ffffff;
  234. border-radius: 16rpx;
  235. margin: 40rpx auto 20rpx;
  236. padding: 1rpx 20rpx;
  237. }
  238. .item-line {
  239. height: 60rpx;
  240. font-size: 28rpx;
  241. font-family: PingFang SC, PingFang SC-Bold;
  242. font-weight: 700;
  243. text-align: left;
  244. color: #333333;
  245. margin-top: 40rpx;
  246. }
  247. .item-line .before {
  248. content: "";
  249. width: 8rpx;
  250. height: 30rpx;
  251. background: $uni-color;
  252. border-radius: 4rpx;
  253. margin-right: 10rpx;
  254. margin-top: 15rpx;
  255. }
  256. .item-line .label {
  257. display: flex;
  258. align-items: center;
  259. width: 152rpx;
  260. height: 60rpx;
  261. }
  262. .item-line input {
  263. width: 456rpx;
  264. height: 60rpx;
  265. line-height: 60rpx;
  266. background: #f5f5f5;
  267. border-radius: 12rpx;
  268. font-size: 24rpx;
  269. font-family: PingFang SC, PingFang SC-Medium;
  270. font-weight: 500;
  271. text-align: left;
  272. color: #939393;
  273. padding: 0 20rpx;
  274. }
  275. .upload {
  276. display: flex;
  277. align-items: center;
  278. justify-content: center;
  279. width: 200rpx;
  280. height: 200rpx;
  281. background: rgba($uni-color, 0.22);
  282. border: 2rpx dashed $uni-color;
  283. border-radius: 16rpx;
  284. margin: 10rpx 12rpx;
  285. }
  286. .upload-img{
  287. width: calc(100% - 4rpx);
  288. height: calc(100% - 4rpx);
  289. border: 2rpx dashed #ccc;
  290. margin: 2rpx;
  291. }
  292. .button-submit {
  293. display: flex;
  294. align-items: center;
  295. justify-content: center;
  296. width: 596rpx;
  297. height: 90rpx;
  298. border-radius: 46rpx;
  299. margin: 20rpx auto;
  300. font-size: 28rpx;
  301. font-family: PingFang SC, PingFang SC-Regular;
  302. font-weight: 400;
  303. text-align: center;
  304. background: $uni-bg-color;
  305. color: $uni-color;
  306. }
  307. </style>