index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view>
  3. //申请创客
  4. <!-- #ifdef MP-ALIPAY -->
  5. <u-navbar title="申请创客" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" leftIconSize="0" />
  6. <!-- #endif -->
  7. <!-- #ifdef MP-WEIXIN -->
  8. <u-navbar title="申请创客" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
  9. <!-- #endif -->
  10. <!-- #ifndef MP-WEIXIN || MP-ALIPAY -->
  11. <view v-if="pagesNum > 1">
  12. <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="申请创客" />
  13. </view>
  14. <view v-else>
  15. <u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" :border="true" title="申请创客">
  16. <view class="nav-left flex" slot="left" @click="$toIndex()">
  17. <u-icon name="arrow-left" size="20" color="#333"></u-icon>
  18. </view>
  19. </u-navbar>
  20. </view>
  21. <!-- #endif -->
  22. <view class="creator">
  23. <u-form labelPosition="left" ref="form" labelWidth="90">
  24. <u-form-item label="姓名:" borderBottom required>
  25. <u-input v-model="form.name" border="none" placeholder="请输入姓名" maxlength="10"></u-input>
  26. </u-form-item>
  27. <u-form-item label="手机号码:" borderBottom required>
  28. <u-input v-model="form.phone" type="number" border="none" placeholder="请输入手机号码"></u-input>
  29. </u-form-item>
  30. <u-form-item label="所在地区:" borderBottom @click="selectArea">
  31. <u-input v-model="form.cityShow" border="none" disabled disabledColor="#ffffff" placeholder="请选择地区">
  32. </u-input>
  33. <u-icon slot="right" name="arrow-right"></u-icon>
  34. </u-form-item>
  35. <u-form-item label="行业资源:" :borderBottom="false">
  36. <u-textarea v-model="form.resource" placeholder="请输入行业资源" count></u-textarea>
  37. </u-form-item>
  38. </u-form>
  39. </view>
  40. <!-- 操作按钮 -->
  41. <view class="save-btn">
  42. <button :loading="loading" type="default" @click="saveCreator">提交</button>
  43. </view>
  44. <view class="tip">
  45. <view class="tip-text">
  46. 申请成为盲票创客 利用业余时间 推广您公司、家附近门店商户,创客和门店都无需投资、销售额分佣、长期收益 点击提交按钮后,客服会联系您。
  47. </view>
  48. <view class="tip-phone">
  49. <image src="../static/phone.png" mode=""></image>
  50. <view class="">
  51. 咨询电话:400-081-1913
  52. </view>
  53. </view>
  54. </view>
  55. <area-picker :area-show="areaShow" @cancel="cancel" @confirmArea="confirmArea" />
  56. </view>
  57. </template>
  58. <script>
  59. import $http from '@/utils/request.js'
  60. import AreaPicker from '../../components/area-picker/area-picker.vue'
  61. export default {
  62. components: {
  63. AreaPicker
  64. },
  65. data() {
  66. return {
  67. loading: false,
  68. form: {
  69. phone: '',
  70. name: '',
  71. cityShow: '', //省市区拼接
  72. resource: '', //行业资源
  73. provinceId: '', // 省ID/编码
  74. province: '', // 省
  75. cityId: '', // 市ID/编码
  76. city: '', // 市
  77. areaId: '', // 区ID/编码
  78. area: '', // 区
  79. },
  80. areaShow: false,
  81. pagesNum: '',
  82. }
  83. },
  84. onShow() {
  85. this.pagesNum = getCurrentPages().length
  86. },
  87. methods: {
  88. //打开地址选项
  89. selectArea() {
  90. this.areaShow = true
  91. },
  92. //隐藏地址选项
  93. cancel() {
  94. this.areaShow = false
  95. },
  96. confirmArea(obj) {
  97. this.form.province = obj.province
  98. this.form.provinceId = obj.provinceId
  99. this.form.city = obj.city
  100. this.form.cityId = obj.cityId
  101. this.form.area = obj.area
  102. this.form.areaId = obj.areaId
  103. this.form.cityShow = obj.cityShow
  104. this.areaShow = false
  105. },
  106. //提交
  107. saveCreator() {
  108. if(this.loading) return
  109. this.loading = true
  110. let _this = this
  111. if (!_this.form.name) {
  112. this.loading = false
  113. uni.$u.toast('请输入姓名');
  114. return
  115. }
  116. if (!_this.form.phone) {
  117. this.loading = false
  118. uni.$u.toast('请输入手机号码');
  119. return
  120. }
  121. const rule = /^[1][0-9][0-9]{9}$/
  122. if (!rule.test(_this.form.phone)) {
  123. this.loading = false
  124. uni.$u.toast('请输入正确的手机号');
  125. return
  126. }
  127. $http.post('/api/v1/mp/admin/channel/apply/submit', this.form).then(res => {
  128. if (res.code == 0) {
  129. uni.$u.toast('提交成功');
  130. setTimeout(() => {
  131. this.loading = false
  132. uni.navigateBack({
  133. delta: 1
  134. })
  135. }, 1000)
  136. }else {
  137. this.loading = false
  138. }
  139. })
  140. },
  141. }
  142. }
  143. </script>
  144. <style lang="scss" scoped>
  145. .creator {
  146. background-color: #FFFFFF;
  147. padding: 10rpx 40rpx 0rpx;
  148. }
  149. .save-btn {
  150. margin-top: 20rpx;
  151. padding: 50rpx 20rpx;
  152. ::v-deep button {
  153. line-height: 76rpx;
  154. font-size: 28rpx;
  155. height: 76rpx;
  156. color: #fff;
  157. background-color: $uni-bg-color;
  158. border: none;
  159. border-radius: 100rpx;
  160. }
  161. }
  162. .tip {
  163. padding: 40rpx 40rpx 0;
  164. line-height: 46rpx;
  165. font-size: 26rpx;
  166. color: #999;
  167. &-phone {
  168. text-align: center;
  169. margin-top: 60rpx;
  170. image {
  171. width: 40rpx;
  172. height: 40rpx;
  173. vertical-align: top;
  174. margin-top: 4rpx;
  175. }
  176. view {
  177. display: inline-block;
  178. margin-left: 10rpx;
  179. }
  180. }
  181. }
  182. </style>