apply.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  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"><view class="item-top">特权一</view></view>
  16. <view class="item"><view class="item-top">特权一</view></view>
  17. <view class="item"><view class="item-top">特权一</view></view>
  18. <view class="btn" @click="changeStep">立即申请成为店长</view>
  19. </template>
  20. <template v-if="isStep == 2">
  21. <view class="tab-wrapper">
  22. <view class="tab-item">
  23. <view class="itemx">
  24. <view class="item-tit">姓名:</view>
  25. <input type="text" v-model="name" placeholder="请输入您的姓名"/>
  26. </view>
  27. <view class="itemx">
  28. <view class="item-tit">推荐人编号:</view>
  29. <input type="text" v-model="speed_id" placeholder="请输入推荐人编号"/>
  30. </view>
  31. <view class="itemx">
  32. <view class="item-tit">联系方式:</view>
  33. <input type="text" v-model="phone" placeholder="请输入您的手机号"/>
  34. </view>
  35. <view class="itemx">
  36. <view class="item-tit">验证码:</view>
  37. <input type="text" v-model="code" placeholder="请输入验证码"/>
  38. <view class="code" @click="verification">{{ countDown == 0 ? '验证码' : countDown }}</view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="up-wrapper">
  43. 身份证正反面
  44. <view class="imgs">
  45. <view class="imgs-item">
  46. <image :src="sfzz" mode="" v-if="sfzz" @click.stop="upImg('sfzz')"></image>
  47. <image src="../../static/img/add.png" mode="" v-if="!sfzz" @click.stop="upImg('sfzz')"></image>
  48. </view>
  49. <view class="imgs-item">
  50. <image :src="sfzf" mode="" v-if="sfzf" @click.stop="upImg('sfzf')"></image>
  51. <image src="../../static/img/add.png" mode="" v-if="!sfzf" @click.stop="upImg('sfzf')"></image>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="up-wrapper">
  56. 营业执照
  57. <view class="imgs">
  58. <view class="imgs-item">
  59. <image :src="sfzz" mode="" v-if="sfzz" @click.stop="upImg(1)"></image>
  60. <image src="../../static/img/add.png" mode="" v-if="!sfzz" @click.stop="upImg(1)"></image>
  61. </view>
  62. <view class="imgs-item">
  63. <image :src="sfzf" mode="" v-if="sfzf" @click.stop="upImg(2)"></image>
  64. <image src="../../static/img/add.png" mode="" v-if="!sfzf" @click.stop="upImg(2)"></image>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="btn-tc">
  69. </view>
  70. <view class="sub-btn">
  71. 提交申请
  72. </view>
  73. </template>
  74. </view>
  75. </template>
  76. <script>
  77. import { register, verify } from '@/api/login.js';
  78. import { upload } from '@/api/user.js';
  79. export default {
  80. data() {
  81. return {
  82. time: '', //保存倒计时对象
  83. countDown: 0,//倒计时
  84. isStep: 1,
  85. name: '',
  86. speed_id: '',
  87. phone: '',
  88. code: '',
  89. sfzz: '', //身份证正面
  90. sfzf: '' //身份证反面
  91. };
  92. },
  93. watch:{
  94. countDown(i) {
  95. if (i == 0) {
  96. clearInterval(this.time);
  97. }
  98. }
  99. },
  100. methods: {
  101. changeStep() {
  102. this.isStep = 2;
  103. },
  104. upImg(item) {
  105. let obj = this;
  106. upload({
  107. filename: ''
  108. }).then(res => {
  109. console.log(res[0].url);
  110. obj[item] = res[0].url
  111. }).catch( err => {
  112. console.log(err)
  113. })
  114. },
  115. //发送验证码
  116. verification() {
  117. let obj = this;
  118. if (this.phone == '') {
  119. this.$api.msg('请输入电话号码');
  120. return;
  121. }
  122. if (this.phone.length < 11) {
  123. this.$api.msg('请输入正确的手机号');
  124. return;
  125. }
  126. // 判断是否在倒计时
  127. if (obj.countDown > 0) {
  128. return false;
  129. } else {
  130. obj.countDown = 60;
  131. obj.time = setInterval(() => {
  132. obj.countDown--;
  133. }, 1000);
  134. //调用验证码接口
  135. verify({
  136. phone: obj.phone,
  137. type: 'register'
  138. })
  139. .then(({ data }) => {})
  140. .catch(err => {
  141. console.log(err);
  142. });
  143. }
  144. },
  145. }
  146. };
  147. </script>
  148. <style lang="scss" scoped>
  149. .wrapper {
  150. height: 100%;
  151. }
  152. .top {
  153. position: relative;
  154. z-index: 2;
  155. margin: 0 auto 49rpx;
  156. width: 674rpx;
  157. height: 231rpx;
  158. background: linear-gradient(-23deg, #ffe7be, #fed591);
  159. border-radius: 10rpx;
  160. .top-tit {
  161. padding-top: 80rpx;
  162. text-align: center;
  163. font-size: 49rpx;
  164. font-family: Source Han Sans CN;
  165. font-weight: 500;
  166. color: #6A4714;
  167. }
  168. .top-btm {
  169. margin-top: 35rpx;
  170. font-size: 19rpx;
  171. font-family: Source Han Sans CN;
  172. font-weight: 400;
  173. color: #6A4714;
  174. text-align: center;
  175. display: flex;
  176. justify-content: center;
  177. align-items: center;
  178. text {
  179. display: inline-block;
  180. padding: 0 4rpx;
  181. }
  182. .hx {
  183. width: 66rpx;
  184. height: 1rpx;
  185. background: #81504A;
  186. }
  187. }
  188. }
  189. .item {
  190. margin: 44rpx auto;
  191. width: 674rpx;
  192. height: 176rpx;
  193. box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.2);
  194. border-radius: 10rpx;
  195. .item-top {
  196. width: 85rpx;
  197. line-height: 36rpx;
  198. background-color: #fed591;
  199. border-radius: 10rpx 18rpx 18rpx 0;
  200. text-align: center;
  201. font-size: 20rpx;
  202. font-family: Source Han Sans CN;
  203. font-weight: 400;
  204. color: #975f4a;
  205. }
  206. }
  207. .btn {
  208. margin: 0 auto;
  209. width: 606rpx;
  210. height: 80rpx;
  211. background: linear-gradient(-23deg, #ffe7be, #fed591);
  212. border-radius: 40rpx;
  213. font-size: 35rpx;
  214. font-family: Source Han Sans CN;
  215. font-weight: 400;
  216. color: #704e1c;
  217. line-height: 80rpx;
  218. text-align: center;
  219. }
  220. .tab-wrapper {
  221. padding: 20rpx 30rpx;
  222. background-color: #f2f3f5;
  223. .itemx {
  224. margin: 0 auto;
  225. width: 100%;
  226. background-color: #fff !important;
  227. height: 100rpx;
  228. display: flex;
  229. // width: 690px;
  230. border: 1px #f4f4f4 solid;
  231. .code {
  232. width: 150rpx;
  233. flex-shrink: 0;
  234. text-align: center;
  235. font-size: 28rpx;
  236. font-family: PingFang SC;
  237. font-weight: 500;
  238. color: #FF4C4C;
  239. line-height: 100rpx;
  240. }
  241. .item-tit {
  242. height: 100rpx;
  243. line-height: 100rpx;
  244. padding-left: 30rpx;
  245. width: 250rpx;
  246. font-size: 30rpx;
  247. font-family: PingFang SC;
  248. font-weight: 500;
  249. color: #666666;
  250. flex-shrink: 0;
  251. }
  252. input {
  253. width: 440rpx;
  254. padding-right: 20rpx;
  255. height: 100rpx;
  256. line-height: 100rpx;
  257. font-size: 30rpx;
  258. font-family: PingFang SC;
  259. font-weight: 500;
  260. color: #333333;
  261. }
  262. }
  263. }
  264. .up-wrapper {
  265. margin: auto;
  266. padding: 38rpx 21rpx;
  267. width: 690rpx;
  268. // height: 250rpx;
  269. background: #ffffff;
  270. border-radius: 10rpx;
  271. font-size: 28rpx;
  272. font-family: PingFang SC;
  273. font-weight: 500;
  274. color: #333333;
  275. .imgs {
  276. padding: 27rpx 70rpx;
  277. display: flex;
  278. justify-content: space-around;
  279. .imgs-item {
  280. height: 160rpx;
  281. width: 160rpx;
  282. image {
  283. width: 100%;
  284. height: 100%;
  285. }
  286. }
  287. }
  288. }
  289. .sub-btn {
  290. position: fixed;
  291. bottom: 0;
  292. width: 750rpx;
  293. height: 98rpx;
  294. background: linear-gradient(180deg, #FD4646, #FF3535);
  295. font-size: 36rpx;
  296. font-family: PingFang SC;
  297. font-weight: 500;
  298. color: #FFFFFF;
  299. line-height: 98rpx;
  300. text-align: center;
  301. }
  302. .btn-tc {
  303. height: 98rpx;
  304. }
  305. .top-box {
  306. position: relative;
  307. z-index: 1;
  308. image {
  309. width: 750rpx;
  310. height: 236rpx;
  311. position: absolute;
  312. top: 0;
  313. }
  314. }
  315. </style>