Applicationshop.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view>
  3. <!-- <titlenav></titlenav> -->
  4. <view class="page">
  5. <view class="page-top">
  6. <view class="text1 text2">您还没有店铺</view>
  7. <view class="text1">立即创建一个店铺吧</view>
  8. <view class="text3">申请所填信息仅用于平台店家审核使用,决不做其他用途</view>
  9. <view class="text3 text4">填写店铺信息</view>
  10. </view>
  11. <u-cell-group :border="false">
  12. <u-field name="店家名称" label="店家名称" placeholder="请输入您店铺的名称" v-model="form.storeName" />
  13. <u-field name="详细地址" label="详细地址" placeholder="请输入详细地址"v-model="form.address" />
  14. <u-field name="经营品类" label="经营品类" placeholder="请输入经营品类" v-model="form.management" />
  15. <u-field type="number" name="联系方式" label="联系方式" placeholder="请输入您的手机号码" v-model="form.phone" />
  16. <u-field type="text" label="法人姓名" placeholder="请输入真实姓名" v-model="form.name" />
  17. <u-field type="number" label="身份证号" placeholder="请输入18位身份证号" v-model="form.idNo" />
  18. <view class="imgBox">
  19. 身份证照片(正)
  20. <img-uploader ref="idNoImage" v-model="form.idNoImage"></img-uploader>
  21. </view>
  22. <view class="imgBox">
  23. 身份证照片(反)
  24. <img-uploader ref="idNoBackImage" v-model="form.idNoBackImage"></img-uploader>
  25. </view>
  26. <view class="imgBox">
  27. 营业执照
  28. <img-uploader class="imgBox2" ref="licenseImage" v-model="form.licenseImage"></img-uploader>
  29. </view>
  30. <view class="imgBox">
  31. 店铺环境
  32. <img-uploader class="imgBox2" ref="storeenvironment" v-model="form.storeenvironment"></img-uploader>
  33. </view>
  34. <view class="btn"><u-button block type="primary" :disabled="!next" @click="submit">提交审核</u-button></view>
  35. </u-cell-group>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import ImgUploader from '../components/ImgUploader.vue';
  41. import Titlenav from '../components/Titlenav.vue';
  42. import { mapState } from 'vuex';
  43. export default {
  44. components: { ImgUploader,Titlenav },
  45. data() {
  46. return {
  47. form: {
  48. storeName: '',
  49. phone: '',
  50. name: '',
  51. address: '',
  52. management: '',
  53. idNo: '',
  54. idNoImage: '',
  55. idNoBackImage: '',
  56. licenseImage: '',
  57. storeenvironment: ''
  58. },
  59. form2: {
  60. storeName: '',
  61. phone: '',
  62. name: '',
  63. address: '',
  64. management: '',
  65. idNo: '',
  66. idNoImage: '',
  67. idNoBackImage: '',
  68. licenseImage: '',
  69. storeenvironment: ''
  70. }
  71. };
  72. },
  73. computed: {
  74. ...mapState(['systemInfo']),
  75. next() {
  76. return (
  77. !!this.form.storeName &&
  78. !!this.form.phone &&
  79. !!this.form.name &&
  80. !!this.form.address &&
  81. !!this.form.management &&
  82. !!this.form.idNo &&
  83. !!this.form.idNoImage &&
  84. !!this.form.idNoBackImage &&
  85. !!this.form.licenseImage &&
  86. !!this.form.storeenvironment
  87. );
  88. }
  89. },
  90. methods: {
  91. submit() {
  92. console.log(this.form)
  93. if (!this.form.storeName) {
  94. this.toast('请输入店家名称');
  95. return;
  96. }
  97. if (!/^1[3-9]\d{9}$/.test(this.form.phone)) {
  98. this.toast('请输入正确手机号');
  99. return;
  100. }
  101. if (!this.form.name) {
  102. this.toast('请输入真实姓名');
  103. return;
  104. }
  105. if (!this.form.management) {
  106. this.toast('请输入经营品类');
  107. return;
  108. }
  109. if (!this.form.address) {
  110. this.toast('请输入详细地址');
  111. return;
  112. }
  113. if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.form.idNo)) {
  114. this.toast('请输入正确身份证');
  115. return;
  116. }
  117. if (!this.form.idNoImage) {
  118. this.toast('请上传身份证照片(正面照)');
  119. return;
  120. }
  121. if (!this.form.idNoBackImage) {
  122. this.toast('请上传身份证照片(反面照)');
  123. return;
  124. }
  125. if (!this.form.licenseImage) {
  126. this.toast('请上传营业执照');
  127. return;
  128. }
  129. if (!this.form.storeenvironment) {
  130. this.toast('请上传店铺环境');
  131. return;
  132. }
  133. let data = { ...this.form };
  134. if (!data.id) {
  135. data.userId = this.$store.state.userInfo.id;
  136. }
  137. // data.status = 'CREATED';
  138. // this.showLoading();
  139. // this.$http.postJson('/storeAuthentication/save', data).then(res => {
  140. // this.toast('申请成功', 'success');
  141. // setTimeout(() => {
  142. // wx.redirectTo({
  143. // url: '/pages/store/review'
  144. // });
  145. // }, 1500);
  146. // });
  147. },
  148. loginMethods() {
  149. // console.log('init');
  150. // this.$http
  151. // .postJson('/storeAuthentication/all', {
  152. // query: { userId: this.$store.state.userInfo.id, del: false }
  153. // })
  154. // .then(res => {
  155. // if (!res.empty) {
  156. // this.form2 = res.content[0];
  157. // this.form = res.content[0];
  158. // this.$refs.idNoImage.setFile(res.content[0].idNoImage);
  159. // this.$refs.idNoBackImage.setFile(res.content[0].idNoBackImage);
  160. // this.$refs.licenseImage.setFile(res.content[0].licenseImage);
  161. // this.$refs.storeenvironment.setFile(res.content[0].storeenvironment);
  162. // }
  163. // });
  164. }
  165. }
  166. };
  167. </script>
  168. <style lang="scss" scoped>
  169. /deep/ .u-btn {
  170. height: 48px;
  171. font-size: 14px;
  172. margin: 6px 0;
  173. }
  174. .page {
  175. padding-bottom: 100px;
  176. }
  177. .page-top {
  178. padding-left: 30px;
  179. .text1 {
  180. font-size: 24px;
  181. font-weight: bold;
  182. color: #000000;
  183. line-height: 33px;
  184. &.text2 {
  185. margin-top: 10px;
  186. }
  187. }
  188. .text3 {
  189. font-size: 13px;
  190. font-weight: 400;
  191. color: #aaabad;
  192. line-height: 22px;
  193. margin-top: 9px;
  194. &.text4 {
  195. font-size: 16px;
  196. font-weight: bold;
  197. margin-top: 30px;
  198. }
  199. }
  200. }
  201. .imgBox {
  202. display: flex;
  203. margin: 20px 0 20px 30px;
  204. font-size: 14px;
  205. font-weight: bold;
  206. color: #000000;
  207. line-height: 28px;
  208. .imgBox2 {
  209. margin-left: 40px;
  210. }
  211. }
  212. /deep/ .u-field {
  213. padding: 26px 0;
  214. margin: 0 30px;
  215. }
  216. /deep/.u-label {
  217. color: #000000;
  218. font-size: 14px;
  219. font-weight: bold;
  220. flex: 0 0 74px !important;
  221. }
  222. /deep/ .uni-input-placeholder {
  223. font-size: 13px;
  224. font-weight: 400;
  225. color: #aaabad;
  226. line-height: 24px;
  227. }
  228. .btn {
  229. position: fixed;
  230. left: 0;
  231. right: 0;
  232. bottom: 0;
  233. z-index: 100;
  234. padding: 6px 43px;
  235. padding-bottom: 34px;
  236. padding-bottom: calc(34px + constant(safe-area-inset-bottom)); // 兼容 IOS<11.2
  237. padding-bottom: calc(34px + env(safe-area-inset-bottom)); // 兼容 IOS>=11.2
  238. background-color: #FFFFFF;
  239. }
  240. </style>