apply.vue 11 KB

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