becomeShop.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <view class="content">
  3. <view class="enterprise">
  4. <view class="enterprise-box">
  5. <view class="box-item">
  6. <view class="item-left">店铺名:</view>
  7. <view class="item-right"><input type="text" placeholder="请输入店铺名" v-model="name" /></view>
  8. </view>
  9. <view class="box-item">
  10. <view class="item-left">商家电话:</view>
  11. <view class="item-right"><input type="text" placeholder="请输入商家电话" v-model="telphone" /></view>
  12. </view>
  13. <view class="box-item">
  14. <view class="item-left">商家省市区:</view>
  15. <pickerAddress class="item-right" @change="onCityClick">{{ addressDetail || '请选择地址(点击选择地址)' }}</pickerAddress>
  16. </view>
  17. <view class="box-item" @click="getLocation">
  18. <view class="item-left">商家地址:</view>
  19. <view class="item-right"><input type="text" placeholder="请选择详细地址" v-model="showaddress" /></view>
  20. </view>
  21. </view>
  22. <view class="enterprise-box">
  23. <view class="box-item">
  24. <view class="item-left">联系人:</view>
  25. <view class="item-right"><input type="text" placeholder="请输入联系人" v-model="nameP" /></view>
  26. </view>
  27. <!-- <view class="box-item">
  28. <view class="item-left">联系电话:</view>
  29. <view class="item-right"><input type="text" placeholder="请输入联系电话" v-model="phone" /></view>
  30. </view> -->
  31. <view class="box-item">
  32. <view class="item-left">主营项目:</view>
  33. <view class="item-right"><input type="text" placeholder="请输入您的主营项目" v-model="introduction" /></view>
  34. </view>
  35. </view>
  36. <view class="enterprise-box">
  37. <view class="box-item">
  38. <view class="item-left">商户简介:</view>
  39. <view class="item-right"><input type="text" placeholder="请输入您的商户简介" v-model="introductory" /></view>
  40. </view>
  41. <view class="box-item">
  42. <view class="item-left">身份证:</view>
  43. <view class="item-right"><input type="text" placeholder="请输入您的身份证" v-model="Idcard" /></view>
  44. </view>
  45. <view class="box-item">
  46. <view class="item-left">推荐人id:</view>
  47. <view class="item-right"><input type="text" placeholder="请输入您的推荐人id" v-model="spared" /></view>
  48. </view>
  49. <view class="box-item1">
  50. <view class="item-left">店铺logo:</view>
  51. <view class="item-right">
  52. <image :src="cardimg" mode="" class="upload-img" @click.stop="imgsub" v-if="cardimg"></image>
  53. <image src="https://zhibo.liuniu946.com/img/phone.png" class="upload-img" mode="" v-if="!cardimg" @click.stop="imgsub"></image>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="enterprise-box">
  58. <view class="box-item1">
  59. <view class="item-left">营业执照:</view>
  60. <view class="item-right">
  61. <image :src="imgY" mode="" class="upload-img" @click.stop="imgsubY" v-if="imgY"></image>
  62. <image src="https://zhibo.liuniu946.com/img/phone.png" class="upload-img" mode="" v-if="!imgY" @click.stop="imgsubY"></image>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <!-- <view class="comfirm1" v-if="userInfo.company == 0">正在审核中</view>
  68. <view class="comfirm1" v-if="userInfo.company == 1">已通过</view>
  69. <view class="comfirm" v-else @click="comfirm">提交申请</view> -->
  70. <view class="comfirm" @click="comfirm">提交申请</view>
  71. </view>
  72. </template>
  73. <script>
  74. import pickerAddress from '@/components/wangding-pickerAddress/wangding-pickerAddress.vue';
  75. import { mapState, mapMutations } from 'vuex';
  76. import { upload, apply } from '@/api/order.js';
  77. export default {
  78. components: {
  79. pickerAddress
  80. },
  81. computed: {
  82. ...mapState(['userInfo'])
  83. },
  84. data() {
  85. return {
  86. imgY: '', //营业执照
  87. checked: false,
  88. name: '', //店铺名
  89. telphone: '', //商家电话
  90. introduction: '', //主营项目
  91. introductory: '', //简介
  92. Idcard: '', //身份证号码
  93. spared: '', //推荐人
  94. nameP: '', //联系人
  95. phone: '', //联系人电话
  96. showaddress: '', //详细地址
  97. addressDetail: '', //省市区
  98. cardimg: '', //店铺logo
  99. latitude: '',
  100. longitude: ''
  101. };
  102. },
  103. methods: {
  104. // 上传图片
  105. imgsub() {
  106. console.log('上传logo');
  107. upload({
  108. filename: ''
  109. }).then(data => {
  110. console.log('data', data);
  111. this.cardimg = data[0].url;
  112. });
  113. },
  114. // 上传图片
  115. imgsubY() {
  116. console.log('i上传营业执照');
  117. upload({
  118. filename: ''
  119. }).then(data => {
  120. this.imgY = data[0].url;
  121. });
  122. },
  123. check() {
  124. this.checked = !this.checked;
  125. },
  126. getLocation() {
  127. console.log('选择当前位置');
  128. let obj = this;
  129. uni.chooseLocation({
  130. success: function(res) {
  131. console.log('1111:' + res);
  132. console.log('位置名称:' + res.name);
  133. console.log('详细地址:' + res.address);
  134. console.log('纬度:' + res.latitude);
  135. console.log('经度:' + res.longitude);
  136. obj.latitude = res.latitude;
  137. obj.longitude = res.longitude;
  138. if (res.address) {
  139. obj.showaddress = res.address;
  140. } else {
  141. obj.showaddress = res.name;
  142. }
  143. }
  144. });
  145. },
  146. // 选中城市切换
  147. onCityClick({ data }) {
  148. this.addressDetail = data.join(',');
  149. },
  150. // 提交申请
  151. comfirm() {
  152. const obj = this;
  153. if (obj.name == '') {
  154. obj.$api.msg('请输入店铺名');
  155. return;
  156. }
  157. const reg1 = /^(\+?0?86-?)?1[\d]\d{9}$/;
  158. if (!reg1.test(obj.telphone)) {
  159. obj.$api.msg('请输入商家电话');
  160. return;
  161. }
  162. if (obj.introduction == '') {
  163. obj.$api.msg('请输入您的主营项目');
  164. return;
  165. }
  166. if (obj.introductory == '') {
  167. obj.$api.msg('请输入您的商铺简介');
  168. return;
  169. }
  170. if (obj.spared == '') {
  171. obj.$api.msg('请输入您的推荐人');
  172. return;
  173. }
  174. if (obj.Idcard == '') {
  175. obj.$api.msg('请输入身份证号');
  176. return;
  177. }
  178. if (obj.nameP == '') {
  179. obj.$api.msg('请输入联系人');
  180. return;
  181. }
  182. if (obj.adress == '') {
  183. obj.$api.msg('请选择详细地址');
  184. return;
  185. }
  186. if (obj.addressDetail == '') {
  187. obj.$api.msg('请选择省市区');
  188. return;
  189. }
  190. if (obj.cardimg == '') {
  191. obj.$api.msg('请上传店铺LOGO');
  192. return;
  193. }
  194. if (obj.imgY == '') {
  195. obj.$api.msg('请上传营业执照');
  196. return;
  197. }
  198. apply({
  199. name: obj.name,
  200. introduction: obj.introductory,
  201. phone: obj.telphone,
  202. address: obj.addressDetail,
  203. detailed_address: obj.showaddress,
  204. image: obj.cardimg,
  205. latitude: obj.latitude,
  206. longitude: obj.longitude,
  207. leader: obj.nameP,
  208. id_card: obj.Idcard,
  209. job: obj.introduction,
  210. cert: obj.imgY,
  211. spread_uid: obj.spared
  212. })
  213. .then(e => {
  214. uni.showToast({
  215. title: '申请成功,请耐心等待审核',
  216. icon: 'success',
  217. duration: 2000
  218. });
  219. })
  220. .catch(function(e) {
  221. console.log('出错了');
  222. console.log(e);
  223. });
  224. }
  225. }
  226. };
  227. </script>
  228. <style lang="scss">
  229. .content {
  230. }
  231. .enterprise-box {
  232. background-color: #ffffff;
  233. border-radius: 12rpx;
  234. width: 100%;
  235. margin-top: 24rpx;
  236. .box-item {
  237. display: flex;
  238. border-bottom: 1rpx solid #f0f0f0;
  239. padding: 32rpx 24rpx;
  240. align-items: center;
  241. &:nth-last-child(1) {
  242. border-bottom: none;
  243. }
  244. }
  245. .item-left {
  246. font-size: 28rpx;
  247. width: 160rpx;
  248. flex-shrink: 0;
  249. }
  250. .item-right {
  251. width: 100%;
  252. margin-left: 24rpx;
  253. font-size: 28rpx;
  254. display: flex;
  255. align-items: center;
  256. color: #999999;
  257. input {
  258. font-size: 28rpx;
  259. }
  260. image {
  261. width: 160rpx;
  262. height: 160rpx;
  263. margin-top: 24rpx;
  264. margin-left: 60rpx;
  265. }
  266. }
  267. .box-item1 {
  268. display: flex;
  269. border-bottom: 1rpx solid #f0f0f0;
  270. padding: 32rpx 24rpx;
  271. // align-items: center;
  272. &:nth-last-child(1) {
  273. border-bottom: none;
  274. }
  275. }
  276. }
  277. .comfirm {
  278. margin: 20rpx auto 0;
  279. border-radius: 80rpx;
  280. width: 650rpx;
  281. height: 80rpx;
  282. background: #5dbb7c;
  283. display: flex;
  284. justify-content: center;
  285. align-items: center;
  286. color: #ffffff;
  287. font-size: 36rpx;
  288. }
  289. .comfirm1 {
  290. margin: 0 auto;
  291. border-radius: 80rpx;
  292. width: 650rpx;
  293. height: 100rpx;
  294. background: #b1b1b1;
  295. display: flex;
  296. justify-content: center;
  297. align-items: center;
  298. color: #ffffff;
  299. font-size: 36rpx;
  300. }
  301. .checkbox {
  302. font-size: 32rpx;
  303. color: #eeeeee;
  304. background: #eeeeee;
  305. border-radius: 50px;
  306. }
  307. .checked {
  308. color: #fd4343;
  309. background: #ffffff;
  310. }
  311. .radio {
  312. padding-top: 5rpx;
  313. margin-right: 15rpx;
  314. }
  315. </style>