apply.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view class="content">
  3. <view class="main">
  4. <view class="tilte">
  5. 开通免费网店
  6. </view>
  7. <view class="details">
  8. 网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明。
  9. 网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明。
  10. 网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明。
  11. 网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明网店开通的说明开通权益内容说明。网店开通的说明开通权益内容说明。
  12. </view>
  13. </view>
  14. <view class="btn1" v-if="userInfo.store_info">
  15. 已有网店
  16. </view>
  17. <view class="btn" v-else @click="comfirm" >
  18. 确认申请
  19. </view>
  20. <uni-popup ref="popup" type="center" @click="close">
  21. <view class="popup_row">
  22. <view class="title">
  23. <view class="title-left">
  24. 请输入您的手机号,开通免费网店!
  25. </view>
  26. <view class="cancel" @click="cancel">
  27. <!-- <image src="../../static/img/cancel1.png" mode=""></image> -->
  28. </view>
  29. </view>
  30. <view class="inpBox">
  31. <input type="text" value="" placeholder="请输入您的手机号" v-model="to_phone"/>
  32. </view>
  33. <view class="inpedit">
  34. 可在方框中修改您的手机号
  35. </view>
  36. <view class="inpBox">
  37. <input type="text" value="" placeholder="请输入您的身份证号" v-model="Idcard"/>
  38. </view>
  39. <view class="inpedit">
  40. 可在方框中修改您的身份证号
  41. </view>
  42. <view class="comfirm">
  43. <view class="comfirm1" @click="comfirm1()">
  44. 确认
  45. </view>
  46. </view>
  47. </view>
  48. </uni-popup>
  49. </view>
  50. </template>
  51. <script>
  52. import { mapState, mapMutations } from 'vuex';
  53. import { apply } from '@/api/apply.js';
  54. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  55. import { xgxx } from '@/api/team.js'
  56. export default{
  57. components: {
  58. uniPopup,
  59. },
  60. data(){
  61. return{
  62. to_phone:'',
  63. Idcard:''
  64. }
  65. },
  66. computed: {
  67. ...mapState(['userInfo']),
  68. },
  69. onLoad() {
  70. if(this.userInfo.phone != ''){
  71. this.to_phone = this.userInfo.phone
  72. };
  73. if(this.userInfo.card_id != ''){
  74. this.Idcard = this.userInfo.card_id
  75. };
  76. const value = uni.getStorageSync('mystore');
  77. this.mystore = value
  78. console.log('申请免费网店this.mystore',this.mystore)
  79. },
  80. methods:{
  81. // 提交
  82. comfirm(){
  83. this.$refs.popup.open();
  84. console.log(this.userInfo);
  85. },
  86. comfirm1:function () {
  87. let obj = this
  88. if ( obj.to_phone.toString().trim() == '' ){
  89. obj.$api.msg('请填写正确的手机号码');
  90. // uni.showModal({
  91. // title:'输入框为空',
  92. // // content:JSON.stringify(obj)
  93. // })
  94. } else {
  95. console.log('obj.to_phone1111',obj.to_phone)
  96. const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
  97. if (!reg.test(obj.to_phone)) {
  98. obj.$api.msg('请填写正确的手机号码');
  99. return;
  100. }
  101. let reg1 =
  102. /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/
  103. if (!reg1.test(obj.Idcard)) {
  104. obj.$api.msg('请填写正确的身份证信息');
  105. return;
  106. }
  107. xgxx({
  108. card_id: obj.Idcard,
  109. }).then(e =>{
  110. console.log(e)
  111. }).catch(e => {
  112. console.log(e)
  113. })
  114. apply({
  115. name: obj.userInfo.nickname + "的网店",
  116. introduction: obj.userInfo.nickname + "的网店",
  117. image: obj.userInfo.avatar,
  118. phone: obj.to_phone || '',
  119. card: obj.Idcard || '',
  120. type: 1})
  121. .then(({ data }) =>{
  122. console.log(data)
  123. uni.navigateTo({
  124. url:'/pages/freeShop/success'
  125. });
  126. })
  127. .catch((err) => {
  128. console.log(err);
  129. })
  130. }
  131. },
  132. }
  133. }
  134. </script>
  135. <style lang="scss">
  136. .content{
  137. width: 100%;
  138. height: 100%;
  139. }
  140. .tilte{
  141. font-size: 34rpx;
  142. font-weight: 400;
  143. color: #333333;
  144. line-height: 40rpx;
  145. text-align: center;
  146. padding: 16rpx 0 0;
  147. }
  148. .details{
  149. padding: 12rpx 24rpx 24rpx;
  150. text-indent: 44rpx;
  151. font-size: 26rpx;
  152. line-height: 40rpx;
  153. }
  154. .btn{
  155. width: 674rpx;
  156. height: 88rpx;
  157. background: linear-gradient(180deg, #FD4646, #FF3535);
  158. border-radius: 44rpx;
  159. display: flex;
  160. justify-content: center;
  161. align-items: center;
  162. color: #FFFFFF;
  163. margin: 180rpx auto;
  164. font-size: 36rpx;
  165. }
  166. .btn1{
  167. width: 674rpx;
  168. height: 88rpx;
  169. background: #b1b1b1;
  170. border-radius: 44rpx;
  171. display: flex;
  172. justify-content: center;
  173. align-items: center;
  174. color: #FFFFFF;
  175. margin: 180rpx auto;
  176. font-size: 36rpx;
  177. }
  178. .popup_row{
  179. // margin-top: 108rpx;
  180. height: 660rpx;
  181. border-radius: 25rpx;
  182. width: 100%;
  183. padding: 24rpx;
  184. background-color: #f8f8f8;
  185. z-index: 999;
  186. .title{
  187. margin-top: 24rpx;
  188. border-bottom: 2rpx solid #F2F2F2;
  189. color: #E63931;
  190. font-size: 32rpx;
  191. padding-left: 4rpx;
  192. padding-bottom: 16rpx;
  193. display: flex;
  194. justify-content: space-between;
  195. // align-items: center;
  196. .cancel{
  197. margin-left: 52rpx;
  198. width: 36rpx;
  199. height: 36rpx;
  200. image{
  201. width: 36rpx;
  202. height: 36rpx;
  203. }
  204. }
  205. }
  206. .inpBox{
  207. margin-top: 52rpx;
  208. border: 2px solid #f2f2f2;
  209. padding: 12rpx 24rpx;
  210. color: #FF9797;
  211. border-radius: 8rpx;
  212. .input-placeholder {
  213. // height: 70rpx;
  214. font-size: 32rpx;
  215. color: #FF9797;
  216. }
  217. }
  218. .inpedit{
  219. margin-top: 24rpx;
  220. margin-left: 14rpx;
  221. font-size: 28rpx;
  222. color: #FF9797;
  223. }
  224. .comfirm{
  225. display: flex;
  226. justify-content: flex-end;
  227. margin-top: 54rpx;
  228. .comfirm1{
  229. padding: 12rpx 24rpx;
  230. border-radius: 12rpx;
  231. color: #FFFFFF;
  232. background-color: #E63931;
  233. }
  234. }
  235. }
  236. </style>