apply.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. <template>
  2. <view class="wrapper">
  3. <template v-if="isStep == 1">
  4. <view class="top-box" style="height: 135rpx;">
  5. <image src="../../static/img/vip-bg.png" mode=""></image>
  6. </view>
  7. <view class="top">
  8. <view class="top-tit">
  9. 鑫旺新零售VIP店长
  10. </view>
  11. <view class="top-btm">
  12. <!-- <text class="hx"></text><text>累计业绩达到12W可申请成为店长</text><text class="hx"></text> -->
  13. </view>
  14. </view>
  15. <view class="item">
  16. <view class="item-top">特权一</view>
  17. <view class="item-tit">
  18. 享受六五折拿货价
  19. <view class="line"></view>
  20. </view>
  21. <view class="item-info">
  22. <view class="info-y"></view>
  23. <view class="info">所有商品享受六五折的拿货价</view>
  24. </view>
  25. </view>
  26. <view class="item">
  27. <view class="item-top">特权二</view>
  28. <view class="item-tit">
  29. 销售奖励
  30. <view class="line"></view>
  31. </view>
  32. <view class="item-info">
  33. <view class="info-y"></view>
  34. <view class="info">推广更多会员享受更多销售奖励</view>
  35. </view>
  36. </view>
  37. <view class="item">
  38. <view class="item-top">特权三</view>
  39. <view class="item-tit">
  40. 区代业绩奖励
  41. <view class="line"></view>
  42. </view>
  43. <view class="item-info">
  44. <view class="info-y"></view>
  45. <view class="info">推广更多店长将有资格成为区代,享受更多业绩奖励</view>
  46. </view>
  47. </view>
  48. <view class="more">
  49. <image src="../../static/icon/i-left.png" mode=""></image>
  50. <view class="more-tit">
  51. 更多店长特权持续开放中,敬请期待
  52. </view>
  53. <image src="../../static/icon/i-right.png" mode=""></image>
  54. </view>
  55. <view class="btn" @click="changeStep">立即申请成为店长</view>
  56. </template>
  57. <template v-if="isStep == 2">
  58. <view class="tab-wrapper">
  59. <view class="tab-item">
  60. <view class="itemx">
  61. <view class="item-tit">姓名:</view>
  62. <input type="text" v-model="name" placeholder="请输入您的姓名"/>
  63. </view>
  64. <view class="itemx">
  65. <view class="item-tit">推荐人编号:</view>
  66. <input type="text" v-model="speed_id" placeholder="" disabled/>
  67. </view>
  68. <view class="itemx">
  69. <view class="item-tit">联系方式:</view>
  70. <input type="text" v-model="phone" placeholder="请输入您的手机号"/>
  71. </view>
  72. <view class="itemx">
  73. <view class="item-tit">店铺名称:</view>
  74. <input type="text" v-model="merchant_name" placeholder="请输入店铺名称"/>
  75. </view>
  76. </view>
  77. </view>
  78. <view class="up-wrapper">
  79. 身份证正反面
  80. <view class="imgs">
  81. <view class="imgs-item">
  82. <image :src="sfzz" mode="" v-if="sfzz" @click.stop="upImg('sfzz')"></image>
  83. <image src="../../static/img/add.png" mode="" v-if="!sfzz" @click.stop="upImg('sfzz')"></image>
  84. </view>
  85. <view class="imgs-item">
  86. <image :src="sfzf" mode="" v-if="sfzf" @click.stop="upImg('sfzf')"></image>
  87. <image src="../../static/img/add.png" mode="" v-if="!sfzf" @click.stop="upImg('sfzf')"></image>
  88. </view>
  89. </view>
  90. </view>
  91. <view class="up-wrapper">
  92. 营业执照
  93. <view class="imgs">
  94. <view class="imgs-item">
  95. <image :src="sfzz" mode="" v-if="yyzz" @click.stop="upImg('yyzz')"></image>
  96. <image src="../../static/img/add.png" mode="" v-if="!yyzz" @click.stop="upImg('yyzz')"></image>
  97. </view>
  98. </view>
  99. </view>
  100. <view class="btn-tc">
  101. </view>
  102. <view class="sub-btn" @click="sub">
  103. 提交申请
  104. </view>
  105. </template>
  106. </view>
  107. </template>
  108. <script>
  109. import { mapState, mapMutations } from 'vuex';
  110. import { register, verify } from '@/api/login.js';
  111. import { upload ,enter} from '@/api/user.js';
  112. export default {
  113. data() {
  114. return {
  115. time: '', //保存倒计时对象
  116. countDown: 0,//倒计时
  117. isStep: 1,
  118. name: '',
  119. speed_id: '',
  120. phone: '',
  121. // code: '',
  122. sfzz: '', //身份证正面
  123. sfzf: '', //身份证反面
  124. yyzz: '',//营业执照
  125. merchant_name: '',//店铺名称
  126. };
  127. },
  128. onLoad() {
  129. let obj = this
  130. obj.speed_id = uni.getStorageSync('spread') || '';
  131. if(obj.speed_id == '') {
  132. obj.speed_id = obj.userInfo.spread_uid || ''
  133. }
  134. },
  135. computed: {
  136. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  137. },
  138. watch:{
  139. countDown(i) {
  140. if (i == 0) {
  141. clearInterval(this.time);
  142. }
  143. }
  144. },
  145. methods: {
  146. changeStep() {
  147. this.isStep = 2;
  148. },
  149. upImg(item) {
  150. let obj = this;
  151. upload({
  152. filename: ''
  153. }).then(res => {
  154. console.log(res[0].url);
  155. obj[item] = res[0].url
  156. }).catch( err => {
  157. console.log(err)
  158. })
  159. },
  160. //发送验证码
  161. verification() {
  162. let obj = this;
  163. if (this.phone == '') {
  164. this.$api.msg('请输入电话号码');
  165. return;
  166. }
  167. if (this.phone.length < 11) {
  168. this.$api.msg('请输入正确的手机号');
  169. return;
  170. }
  171. // 判断是否在倒计时
  172. if (obj.countDown > 0) {
  173. return false;
  174. } else {
  175. obj.countDown = 60;
  176. obj.time = setInterval(() => {
  177. obj.countDown--;
  178. }, 1000);
  179. //调用验证码接口
  180. verify({
  181. phone: obj.phone,
  182. type: 'register'
  183. })
  184. .then(({ data }) => {})
  185. .catch(err => {
  186. console.log(err);
  187. });
  188. }
  189. },
  190. //提交
  191. sub() {
  192. let obj = this
  193. if(obj.name == '') {
  194. obj.$api.msg('请输入姓名')
  195. return
  196. }
  197. if(obj.phone == '') {
  198. obj.$api.msg('请输入联系方式')
  199. return
  200. }
  201. if (this.phone.length < 11) {
  202. this.$api.msg('请输入正确的手机号');
  203. return;
  204. }
  205. if(obj.sfzz == '') {
  206. obj.$api.msg('请上传身份证证件照')
  207. return
  208. }
  209. if(obj.sfzf == '') {
  210. obj.$api.msg('请上传身份证证件照')
  211. return
  212. }
  213. if(obj.yyzz == '') {
  214. obj.$api.msg('请上传营业执照')
  215. return
  216. }
  217. if(obj.merchant_name == '') {
  218. obj.$api.msg('请输入店铺名称')
  219. return
  220. }
  221. let card_id = obj.sfzz + ',' + obj.sfzf
  222. uni.showLoading({
  223. title: '提交中...',
  224. mask: true
  225. })
  226. enter({
  227. type: 1,
  228. merchant_name: obj.merchant_name,
  229. link_user: obj.name,
  230. link_tel: obj.phone,
  231. spread_uid: obj.speed_id,
  232. charter: obj.yyzz,
  233. card_id: card_id
  234. }).then( res => {
  235. uni.hideLoading()
  236. uni.showToast({
  237. title: '提交成功',
  238. duration: 2000
  239. });
  240. setTimeout(()=> {
  241. uni.navigateBack({})
  242. },2000)
  243. console.log(res)
  244. }).catch( err => {
  245. uni.hideLoading()
  246. console.log(err)
  247. })
  248. }
  249. }
  250. };
  251. </script>
  252. <style lang="scss" scoped>
  253. .wrapper {
  254. height: 100%;
  255. }
  256. .top {
  257. position: relative;
  258. z-index: 2;
  259. margin: 0 auto 49rpx;
  260. width: 674rpx;
  261. height: 231rpx;
  262. background: linear-gradient(-23deg, #ffe7be, #fed591);
  263. border-radius: 10rpx;
  264. .top-tit {
  265. padding-top: 80rpx;
  266. text-align: center;
  267. font-size: 49rpx;
  268. font-family: Source Han Sans CN;
  269. font-weight: 500;
  270. color: #6A4714;
  271. }
  272. .top-btm {
  273. margin-top: 35rpx;
  274. font-size: 19rpx;
  275. font-family: Source Han Sans CN;
  276. font-weight: 400;
  277. color: #6A4714;
  278. text-align: center;
  279. display: flex;
  280. justify-content: center;
  281. align-items: center;
  282. text {
  283. display: inline-block;
  284. padding: 0 4rpx;
  285. }
  286. .hx {
  287. width: 66rpx;
  288. height: 1rpx;
  289. background: #81504A;
  290. }
  291. }
  292. }
  293. .item {
  294. margin: 44rpx auto;
  295. width: 674rpx;
  296. // height: 176rpx;
  297. box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.2);
  298. border-radius: 10rpx;
  299. padding-bottom: 40rpx;
  300. .item-top {
  301. width: 85rpx;
  302. line-height: 36rpx;
  303. background-color: #fed591;
  304. border-radius: 10rpx 18rpx 18rpx 0;
  305. text-align: center;
  306. font-size: 20rpx;
  307. font-family: Source Han Sans CN;
  308. font-weight: 400;
  309. color: #975f4a;
  310. }
  311. .item-tit {
  312. display: inline-block;
  313. padding: 0 10rpx;
  314. font-size: 26rpx;
  315. font-family: Source Han Sans CN;
  316. font-weight: 500;
  317. color: #202020;
  318. margin-left: 68rpx;
  319. margin-top: 20rpx;
  320. .line {
  321. // width: 197rpx;
  322. margin-top: -10rpx;
  323. height: 15rpx;
  324. background: #FFF0C5;
  325. }
  326. }
  327. .item-info {
  328. display: flex;
  329. align-items: flex-start;
  330. padding-left: 68rpx;
  331. padding-top: 15rpx;
  332. // align-items: center;
  333. font-size: 21rpx;
  334. font-family: Source Han Sans CN;
  335. font-weight: 400;
  336. color: #6F6F6F;
  337. line-height: 40rpx;
  338. .info-y {
  339. width: 24rpx;
  340. height: 24rpx;
  341. background: #343238;
  342. border-radius: 50%;
  343. margin-right: 14rpx;
  344. margin-top: 8rpx;
  345. flex-shrink: 0;
  346. }
  347. .info {
  348. padding-right: 20rpx;
  349. }
  350. }
  351. }
  352. .btn {
  353. margin: 20rpx auto;
  354. width: 606rpx;
  355. height: 80rpx;
  356. background: linear-gradient(-23deg, #ffe7be, #fed591);
  357. border-radius: 40rpx;
  358. font-size: 35rpx;
  359. font-family: Source Han Sans CN;
  360. font-weight: 400;
  361. color: #704e1c;
  362. line-height: 80rpx;
  363. text-align: center;
  364. }
  365. .tab-wrapper {
  366. padding: 20rpx 30rpx;
  367. background-color: #f2f3f5;
  368. .itemx {
  369. margin: 0 auto;
  370. width: 100%;
  371. background-color: #fff !important;
  372. height: 100rpx;
  373. display: flex;
  374. // width: 690px;
  375. border: 1px #f4f4f4 solid;
  376. .code {
  377. width: 150rpx;
  378. flex-shrink: 0;
  379. text-align: center;
  380. font-size: 28rpx;
  381. font-family: PingFang SC;
  382. font-weight: 500;
  383. color: #FF4C4C;
  384. line-height: 100rpx;
  385. }
  386. .item-tit {
  387. height: 100rpx;
  388. line-height: 100rpx;
  389. padding-left: 30rpx;
  390. width: 250rpx;
  391. font-size: 30rpx;
  392. font-family: PingFang SC;
  393. font-weight: 500;
  394. color: #666666;
  395. flex-shrink: 0;
  396. }
  397. input {
  398. width: 440rpx;
  399. padding-right: 20rpx;
  400. height: 100rpx;
  401. line-height: 100rpx;
  402. font-size: 30rpx;
  403. font-family: PingFang SC;
  404. font-weight: 500;
  405. color: #333333;
  406. }
  407. }
  408. }
  409. .up-wrapper {
  410. margin: auto;
  411. padding: 38rpx 21rpx;
  412. width: 690rpx;
  413. // height: 250rpx;
  414. background: #ffffff;
  415. border-radius: 10rpx;
  416. font-size: 28rpx;
  417. font-family: PingFang SC;
  418. font-weight: 500;
  419. color: #333333;
  420. .imgs {
  421. padding: 27rpx 70rpx;
  422. display: flex;
  423. justify-content: space-around;
  424. .imgs-item {
  425. height: 160rpx;
  426. width: 160rpx;
  427. image {
  428. width: 100%;
  429. height: 100%;
  430. }
  431. }
  432. }
  433. }
  434. .sub-btn {
  435. position: fixed;
  436. bottom: 0;
  437. width: 750rpx;
  438. height: 98rpx;
  439. background: linear-gradient(180deg, #FD4646, #FF3535);
  440. font-size: 36rpx;
  441. font-family: PingFang SC;
  442. font-weight: 500;
  443. color: #FFFFFF;
  444. line-height: 98rpx;
  445. text-align: center;
  446. }
  447. .btn-tc {
  448. height: 98rpx;
  449. }
  450. .top-box {
  451. position: relative;
  452. z-index: 1;
  453. image {
  454. width: 750rpx;
  455. height: 236rpx;
  456. position: absolute;
  457. top: 0;
  458. }
  459. }
  460. .more {
  461. display: flex;
  462. align-items: center;
  463. justify-content: center;
  464. font-size: 21rpx;
  465. font-family: Source Han Sans CN;
  466. font-weight: 400;
  467. color: #6F6F6F;
  468. height: 40rpx;
  469. line-height: 40rpx;
  470. image {
  471. height: 15rpx;
  472. width: 40rpx;
  473. }
  474. view {
  475. padding: 0 8rpx;
  476. }
  477. }
  478. </style>