enterprise.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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">
  8. <input type="text" placeholder="请输入企业全称" v-model="name" />
  9. </view>
  10. </view>
  11. <view class="box-item">
  12. <view class="item-left">商家电话:</view>
  13. <view class="item-right">
  14. <input type="text" placeholder="请输入商家电话" v-model="telphone" />
  15. </view>
  16. </view>
  17. <view class="box-item">
  18. <view class="item-left">主营项目:</view>
  19. <view class="item-right">
  20. <input type="text" placeholder="请输入您的主营项目" v-model="introduction" />
  21. </view>
  22. </view>
  23. </view>
  24. <view class="enterprise-box">
  25. <view class="box-item">
  26. <view class="item-left">联系人:</view>
  27. <view class="item-right">
  28. <input type="text" placeholder="请输入联系人" v-model="nameP"/>
  29. </view>
  30. </view>
  31. <view class="box-item">
  32. <view class="item-left">联系手机:</view>
  33. <view class="item-right">
  34. <input type="text" placeholder="请输入联系电话" v-model="phone"/>
  35. </view>
  36. </view>
  37. <view class="box-item">
  38. <view class="item-left">商家地址:</view>
  39. <view class="item-right">
  40. <input type="text" placeholder="请输入详细地址" v-model="adress"/>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="enterprise-box">
  45. <view class="box-item">
  46. <view class="item-left">店铺名称:</view>
  47. <view class="item-right">
  48. <input type="text" placeholder="请输入店铺名称" v-model="nameS"/>
  49. </view>
  50. </view>
  51. <view class="box-item1">
  52. <view class="item-left">店铺logo:</view>
  53. <view class="item-right">
  54. <image :src="cardimg" mode="" class="upload-img" @click.stop="imgsub" v-if="cardimg"></image>
  55. <image src="https://zhibo.liuniu946.com/img/phone.png" class="upload-img" mode="" v-if="!cardimg" @click.stop="imgsub"></image>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="enterprise-box">
  60. <view class="box-item1">
  61. <view class="item-left">营业执照:</view>
  62. <view class="item-right">
  63. <image :src="imgY" mode="" class="upload-img" @click.stop="imgsubY" v-if="imgY"></image>
  64. <image src="https://zhibo.liuniu946.com/img/phone.png" class="upload-img" mode="" v-if="!imgY" @click.stop="imgsubY"></image>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="agree" @click="check">
  69. <label class="radio"><view class="iconfont iconroundcheckfill checkbox" :class="{ checked: checked }"></view></label>
  70. <view>我已阅读并同意<text class="tip">《企业店铺入驻协议》</text></view>
  71. </view>
  72. </view>
  73. <!-- <view class="comfirm" @click="navTo('/pages/freeShop/success')"> -->
  74. <!-- <view class="comfirm" @click="comfirm">
  75. 提交申请
  76. </view> -->
  77. <view class="comfirm1" v-if="userInfo.company == 0">
  78. 正在审核中
  79. </view>
  80. <view class="comfirm1" v-if="userInfo.company == 1">
  81. 已通过
  82. </view>
  83. <view class="comfirm" v-else @click="comfirm" >
  84. 提交申请
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. import { mapState, mapMutations } from 'vuex';
  90. import {
  91. uploads,applyQ
  92. } from '@/api/apply.js';
  93. export default{
  94. computed: {
  95. ...mapState(['userInfo']),
  96. },
  97. data(){
  98. return{
  99. imgY: '',
  100. checked: false,
  101. name:'',
  102. telphone:'',
  103. introduction:'',
  104. nameP:'',
  105. phone:'',
  106. adress:'',
  107. nameS:'',
  108. cardimg:'',
  109. }
  110. },
  111. methods:{
  112. // 上传图片
  113. imgsub() {
  114. console.log('上传logo')
  115. uploads({
  116. filename: ''
  117. }).then(data => {
  118. console.log("data",data);
  119. this.cardimg = data[0].url;
  120. })
  121. },
  122. // 上传图片
  123. imgsubY() {
  124. console.log('i上传营业执照')
  125. uploads({
  126. filename: ''
  127. }).then(data => {
  128. this.imgY = data[0].url;
  129. })
  130. },
  131. check() {
  132. this.checked = !this.checked;
  133. },
  134. // 提交申请
  135. comfirm(){
  136. const obj = this;
  137. if (obj.name == '') {
  138. obj.$api.msg('请输入企业全称');
  139. return;
  140. }
  141. const reg1 = /^(\+?0?86-?)?1[\d]\d{9}$/;
  142. if (!reg1.test(obj.telphone)) {
  143. obj.$api.msg('请输入商家电话');
  144. return;
  145. }
  146. if (obj.name == '') {
  147. obj.$api.msg('');
  148. return;
  149. }
  150. if (obj.introduction == '') {
  151. obj.$api.msg('请输入您的主营项目');
  152. return;
  153. }
  154. if (obj.nameP == '') {
  155. obj.$api.msg('请输入联系人');
  156. return;
  157. }
  158. const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
  159. if (!reg.test(obj.phone)) {
  160. obj.$api.msg('请填写正确的手机号码');
  161. return;
  162. }
  163. if (obj.adress == '') {
  164. obj.$api.msg('请输入详细地址');
  165. return;
  166. }
  167. if (obj.nameS == '') {
  168. obj.$api.msg('请输入店铺名称');
  169. return;
  170. }
  171. if (obj.cardimg== '') {
  172. obj.$api.msg('请上传店铺LOGO');
  173. return;
  174. }
  175. if (obj.imgY== '') {
  176. obj.$api.msg('请上传营业执照');
  177. return;
  178. }
  179. // imgY
  180. // nameS cardimg
  181. applyQ({
  182. type: 4,
  183. address: obj.address,
  184. jobs: obj.introduction,
  185. license: obj.imgY,
  186. company_name: obj.name,
  187. company_phone: obj.telphone,
  188. name: obj.nameS,
  189. introduction: obj.introduction,
  190. image: obj.cardimg,
  191. phone: obj.phone,
  192. }).then(e => {
  193. obj.name = '';
  194. uni.navigateTo({
  195. url: '/pages/wallet/tjSuccess'
  196. });
  197. }).catch(function(e) {
  198. console.log('出错了')
  199. console.log(e);
  200. });
  201. }
  202. }
  203. }
  204. </script>
  205. <style lang="scss">
  206. .content{
  207. }
  208. .enterprise{
  209. padding: 0 24rpx 24rpx;
  210. }
  211. .enterprise-box{
  212. background-color: #FFFFFF;
  213. border-radius: 12rpx;
  214. width: 100%;
  215. margin-top: 24rpx;
  216. .box-item{
  217. display: flex;
  218. border-bottom: 1rpx solid #f0f0f0;
  219. padding: 32rpx 24rpx;
  220. align-items: center;
  221. &:nth-last-child(1){
  222. border-bottom: none;
  223. }
  224. }
  225. .item-left{
  226. font-size: 28rpx;
  227. width: 160rpx;
  228. flex-shrink: 0;
  229. }
  230. .item-right{
  231. width: 100%;
  232. margin-left: 24rpx;
  233. font-size: 28rpx;
  234. display: flex;
  235. align-items: center;
  236. color: #999999;
  237. input{
  238. font-size: 28rpx;
  239. }
  240. image{
  241. width: 160rpx;
  242. height: 160rpx;
  243. margin-top: 24rpx;
  244. margin-left: 60rpx;
  245. }
  246. }
  247. .box-item1{
  248. display: flex;
  249. border-bottom: 1rpx solid #f0f0f0;
  250. padding: 32rpx 24rpx;
  251. // align-items: center;
  252. &:nth-last-child(1){
  253. border-bottom: none;
  254. }
  255. }
  256. }
  257. .agree{
  258. padding: 24rpx 0;
  259. display: flex;
  260. align-items: center;
  261. font-size: 24rpx;
  262. color: #333333;
  263. .tip{
  264. color: #ff0000;
  265. }
  266. }
  267. .comfirm{
  268. width: 100%;
  269. height: 100rpx;
  270. background: linear-gradient(180deg, #FD4646, #FF3535);
  271. display: flex;
  272. justify-content: center;
  273. align-items: center;
  274. color: #FFFFFF;
  275. font-size: 36rpx;
  276. }
  277. .comfirm1{
  278. width: 100%;
  279. height: 100rpx;
  280. background: #b1b1b1;
  281. display: flex;
  282. justify-content: center;
  283. align-items: center;
  284. color: #FFFFFF;
  285. font-size: 36rpx;
  286. }
  287. .checkbox {
  288. font-size: 32rpx;
  289. color: #EEEEEE;
  290. background: #EEEEEE;
  291. border-radius: 50px;
  292. }
  293. .checked {
  294. color: #FD4343;
  295. background:#FFFFFF;
  296. }
  297. .radio {
  298. padding-top: 5rpx;
  299. margin-right: 15rpx;
  300. }
  301. </style>