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.

341 lines
8.3 KiB

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