first_join.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. <template>
  2. <view class="join">
  3. <view class="banner">
  4. <image src="../../static/other/banner.png" mode=""></image>
  5. </view>
  6. <view class="top">
  7. <view class="content">
  8. <view class="page-section">
  9. <view class="name">您的姓名</view>
  10. <view class="inp">
  11. <!-- <input class="weui-input" v-model="form.cName" placeholder="请输入姓名,最多四个字" /> -->
  12. <u-input v-model="form.cName" :type="type" placeholder="输入您的姓名" maxlength='4' />
  13. </view>
  14. </view>
  15. <view class="page-section">
  16. <view class="name">您的性别</view>
  17. <u-radio-group v-model="changeSex" @change="radioGroupChange">
  18. <u-radio @change="radioChange" v-for="(item, index) in sex" :key="index" :name="item.label"
  19. :disabled="item.disabled">
  20. {{item.label}}
  21. </u-radio>
  22. </u-radio-group>
  23. <!-- <view class="sex" @click="isShow = true">
  24. {{changeSex}}
  25. <u-select v-model="isShow" :list="sex" @confirm="confirm"></u-select>
  26. </view> -->
  27. </view>
  28. <view class="page-section">
  29. <view class="name">手机号:</view>
  30. <view class="inp">
  31. <!-- <input class="weui-input" v-model="form.cPhone" placeholder="请输入手机号" /> -->
  32. <u-input v-model="form.cPhone" placeholder="请输入手机号" maxlength='11' />
  33. </view>
  34. </view>
  35. <view class="page-section">
  36. <view class="name">入驻城市</view>
  37. <view class="inp select" @click="show = true">
  38. <text>{{form.city}}</text>
  39. <img src="../../static/identify/down.png" alt="" />
  40. <!-- <view class="city" @click="selectCity" v-if="form.city == ''">
  41. 入驻城市
  42. </view>
  43. <view class="city" @click="selectCity" v-else>
  44. {{form.city}}
  45. </view> -->
  46. <!-- <view class="city" v-if="form.city == ''">
  47. 选择所在城市(自动定位)
  48. </view> -->
  49. <!-- <view class="city" v-else @click="goCity"> -->
  50. <!-- <view class="city" v-else>
  51. {{form.city}}市
  52. </view> -->
  53. <!-- <input class="weui-input" v-model="form.cNickName" placeholder="请输入昵称" /> -->
  54. <!-- <u-input v-model="form.cNickName" :type="type" placeholder="请输入昵称" maxlength = '4'/> -->
  55. </view>
  56. <u-select v-model="show" :list="citylist" @confirm="select"></u-select>
  57. </view>
  58. <!-- <view class="page-section">
  59. <view class="name">您所在的位置:</view>
  60. <view class="weui-cells weui-cells_after-title location" @click="getAddress">
  61. <text class="point" v-if="!form.address">请选择</text>
  62. <text class="point active" v-else>{{form.address}}{{form.name}}</text>
  63. </view>
  64. </view> -->
  65. <view class="updata" style="border:0;">
  66. <view class="name">工作形象照</view>
  67. <view class="title">
  68. 请上传本人近期照片,图片大小不超过10M (建议清晰正脸照)
  69. </view>
  70. <view class="images">
  71. <u-upload :action="uploadUrl" :header="header" :max-count="2" :file-list="LifeList"
  72. @on-success="handleUploadSuccess" @on-remove="handleUploadRemove"></u-upload>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="submits">
  77. <text>平台不会通过任何渠道泄漏你的个人信息,请放心输入</text>
  78. <view class="btn" @click="submit">
  79. 申请成为商户
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. import {
  87. addEngineer,
  88. project,
  89. UpdateEngine,
  90. engineDetail,
  91. getInfo,
  92. imgUpload,
  93. getCityList
  94. } from '../.././api/index.js'
  95. import uUpload from 'uview-ui/components/u-upload/u-upload.vue';
  96. export default {
  97. data() {
  98. return {
  99. citylist: [],
  100. show: false,
  101. isLogin: false,
  102. type: 'text',
  103. LifeList: [],
  104. // uploadUrl: 'https://test.baoxianzhanggui.com/nightFragrance/common/upload',
  105. uploadUrl:'https://city.baoxianzhanggui.com/nightFragrance/common/upload',
  106. isShow: false,
  107. sex: [{
  108. value: '1',
  109. label: '男'
  110. },
  111. {
  112. value: '0',
  113. label: '女'
  114. }
  115. ],
  116. changeSex: '女',
  117. form: {
  118. id: '',
  119. cName: '',
  120. cNickName: '',
  121. cPortrait: '',
  122. cPhone: '',
  123. cJianjie: '',
  124. nSex: 0,
  125. cSfzImg: [],
  126. cImgList: [],
  127. latitude: '',
  128. longitude: '',
  129. name: '0',
  130. address: '',
  131. cOpenId: '',
  132. cBhList: '',
  133. city: '请选择'
  134. },
  135. token: '',
  136. }
  137. },
  138. onLoad() {
  139. uni.getStorage({
  140. key: 'access-token',
  141. success() {
  142. this.isLogin = true
  143. }
  144. })
  145. },
  146. onShow() {
  147. this.getinfo()
  148. this.getCity()
  149. // let city = uni.getStorageSync('selectCity')
  150. // let lastCity = city.charAt(city.length - 1)
  151. // lastCity == '市' ? this.form.city = city.slice(0, -1) : this.form.city = city
  152. // this.form.city = uni.getStorageSync('selectCity')
  153. },
  154. methods: {
  155. //选择性别
  156. radioChange(e) {
  157. this.changeSex = e[0].label
  158. this.form.nSex = e[0].value
  159. },
  160. //上传生活照
  161. handleUploadSuccess(response) {
  162. this.form.cImgList.push(response.fileName)
  163. },
  164. handleUploadRemove(index) {
  165. this.urlImg.splice(index, 1);
  166. this.form.cImgList.splice(index, 1)
  167. },
  168. goCity() {
  169. uni.navigateTo({
  170. url: '/pages/identify/city?type=' + 'indent'
  171. })
  172. },
  173. getAddress() {
  174. uni.chooseLocation({
  175. success: res => {
  176. this.form.name = res.name;
  177. this.form.latitude = res.latitude;
  178. this.form.longitude = res.longitude;
  179. // this.form.address = res.address
  180. }
  181. });
  182. },
  183. getinfo() {
  184. getInfo().then(res => {
  185. if (res.data.code == 200) {
  186. this.isLogin = true
  187. // this.info = res.data.data,
  188. // this.dBalance = res.data.data.dBalance.toFixed(2)
  189. } else if (res.data.code == 401) {
  190. uni.showModal({
  191. title: '请先登录!',
  192. success: (res) => {
  193. if (res.confirm) {
  194. uni.switchTab({
  195. url: '/pages/my/my'
  196. })
  197. } else if (res.cancel) {
  198. return
  199. }
  200. }
  201. })
  202. }
  203. })
  204. },
  205. //提交
  206. submit() {
  207. var that = this
  208. // var openids = uni.getStorageSync('wx_copenid')
  209. // this.form.cOpenId = openids
  210. // this.form.cAddress =this.form.cAddress
  211. // this.form.nSex = this.index
  212. // this.form.cImgList = this.urlImg
  213. // this.form.cSfzImg = this.idCard
  214. // that.data.form.cBhList = that.data.form.cBhList.join(", ")
  215. if (this.form.cName == '') {
  216. uni.showToast({
  217. title: '请输入您的姓名',
  218. icon: 'none'
  219. })
  220. return
  221. }
  222. if (!/^1[3456789]\d{9}$/.test(this.form.cPhone)) {
  223. uni.showToast({
  224. title: '请输入正确的手机号',
  225. icon: 'none'
  226. });
  227. return;
  228. }
  229. if (this.form.city == '') {
  230. uni.showToast({
  231. title: '请选择所在城市',
  232. icon: 'none'
  233. });
  234. return
  235. }
  236. if (this.form.cImgList.length < 1) {
  237. uni.showToast({
  238. title: '最少上传一张生活照片',
  239. icon: 'none'
  240. });
  241. return
  242. } else {
  243. addEngineer(this.form).then(res => {
  244. if (res.data.code == 200) {
  245. uni.showToast({
  246. title: "申请成功",
  247. })
  248. setTimeout(() => {
  249. uni.navigateBack()
  250. }, 1000)
  251. } else if (res.data.code == 401) {
  252. uni.showModal({
  253. title: '请先登录!',
  254. success: (res) => {
  255. if (res.confirm) {
  256. uni.switchTab({
  257. url: '/pages/my/my'
  258. })
  259. } else if (res.cancel) {
  260. return
  261. }
  262. }
  263. })
  264. } else {
  265. uni.showToast({
  266. title: res.data.msg,
  267. icon: 'none'
  268. })
  269. }
  270. })
  271. }
  272. },
  273. getCity() {
  274. getCityList().then(res => {
  275. this.citylist = res.data.data.map(({
  276. deptId,
  277. deptName
  278. }) => ({
  279. value: deptId,
  280. label: deptName
  281. }))
  282. });
  283. },
  284. selectCity() {
  285. this.show = true
  286. },
  287. select(e) {
  288. this.form.city = e[0].label
  289. this.form.deptId = e[0].value
  290. },
  291. },
  292. computed: {
  293. header() {
  294. return {
  295. Authorization: `tf: ${this.token}`, // 携带Token的请求头
  296. };
  297. },
  298. },
  299. mounted() {
  300. this.token = uni.getStorageSync('access-token'); // 假设token保存在本地缓存中
  301. }
  302. }
  303. </script>
  304. <style lang="scss" scoped>
  305. ::v-deep .uni-input-wrapper {
  306. width: 150px;
  307. text-align: right;
  308. }
  309. ::v-deep .u-input__input {
  310. min-height: 14px !important;
  311. }
  312. .join {
  313. width: 100%;
  314. .banner {
  315. width: 100%;
  316. height: 424rpx;
  317. image {
  318. width: 100%;
  319. height: 100%;
  320. }
  321. }
  322. .top {
  323. width: 100%;
  324. height: 100px;
  325. padding: 32rpx;
  326. box-sizing: border-box;
  327. margin-top: 44rpx;
  328. background-color: #FDFDFD;
  329. .content {
  330. width: 100%;
  331. height: auto;
  332. padding: 24rpx 32rpx;
  333. box-sizing: border-box;
  334. background: #FFFFFF;
  335. box-shadow: 0px 4px 12px 0px rgba(209, 168, 88, 0.1);
  336. border-radius: 24px 24px 24px 24px;
  337. .page-section {
  338. width: 100%;
  339. margin-bottom: 32rpx;
  340. // height: 80rpx;
  341. // padding: 20rpx 0px;
  342. // display: flex;
  343. // align-items: center;
  344. // justify-content: space-between;
  345. // border-bottom: 1px solid #ccc;
  346. font-size: 28rpx;
  347. .name {
  348. width: 31%;
  349. }
  350. .inp {
  351. width: 100%;
  352. height: 64rpx;
  353. border-radius: 8rpx 8rpx 8rpx 8rpx;
  354. border: 2rpx solid #EEEEEE;
  355. padding: 0px 24rpx;
  356. box-sizing: border-box;
  357. margin-top: 20rpx;
  358. //
  359. ::v-deep .u-input {
  360. width: 100% !important;
  361. height: 100% !important;
  362. .u-input__input {
  363. width: 100% !important;
  364. height: 100% !important;
  365. .uni-input-wrapper {
  366. width: 100% !important;
  367. height: 100% !important;
  368. text-align: left;
  369. }
  370. }
  371. }
  372. }
  373. .select{
  374. width: 100%;
  375. display: flex;
  376. justify-content: space-between;
  377. align-items: center;
  378. text{
  379. width: auto;
  380. color: #333333;
  381. }
  382. img{
  383. width: 28rpx;
  384. height: 28rpx;
  385. }
  386. }
  387. }
  388. .updata {
  389. margin-top: 20rpx;
  390. width: 100%;
  391. font-size: 28rpx;
  392. .images {
  393. margin-top: 20rpx;
  394. }
  395. .title{
  396. font-size: 22rpx;
  397. color: #999999;
  398. }
  399. }
  400. }
  401. .submits {
  402. width: 100%;
  403. margin-top: 28rpx;
  404. text{
  405. display: block;
  406. width: 100%;
  407. text-align: center;
  408. font-size: 22rpx;
  409. color: #999999;
  410. }
  411. .btn {
  412. width: 90%;
  413. height: 84rpx;
  414. text-align: center;
  415. background: linear-gradient( 90deg, #BFA061 0%, #BD9961 100%);
  416. border-radius: 14rpx 14rpx 14rpx 14rpx;
  417. margin: 16rpx auto;
  418. line-height: 84rpx;
  419. color: #ffffff;
  420. }
  421. }
  422. }
  423. }
  424. </style>