settledMerchants.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <view class="content">
  3. <view v-if="state == 0">
  4. <view class="box">
  5. <view class="title">商家信息</view>
  6. <view class="hflex acenter jbetween cell">
  7. <view class="left">商家名称</view>
  8. <u-input v-model="info.name" border="none" placeholder="请输入商家名称" inputAlign="right"></u-input>
  9. </view>
  10. <view class="hflex acenter jbetween cell">
  11. <view class="left">商家地址</view>
  12. <u-input v-model="info.address" border="none" placeholder="请选择" inputAlign="right"></u-input>
  13. </view>
  14. <view class="hflex acenter jbetween cell">
  15. <view class="left">联系人</view>
  16. <u-input v-model="info.contacts" border="none" placeholder="请输入联系人姓名" inputAlign="right"></u-input>
  17. </view>
  18. <view class="hflex acenter jbetween cell">
  19. <view class="left">联系电话</view>
  20. <u-input v-model="info.phone" border="none" placeholder="请输入联系电话" inputAlign="right"></u-input>
  21. </view>
  22. <view class="vflex cell" style="border: none;">
  23. <view class="left">商家简介</view>
  24. <u--textarea v-model="info.introduction" placeholder="在此输入商家简介内容" ></u--textarea>
  25. </view>
  26. </view>
  27. <view class="box">
  28. <view class="cell" style="border: none;padding: none;">
  29. <view class="img_title">上传营业执照</view>
  30. <view class="upload_img vflex acenter jcenter">
  31. <u-upload :fileList="info.fileList1" @afterRead="afterRead" @delete="deletePic" :maxCount="1" name="1" multiple :previewFullImage="true" width="550rpx" height="324rpx">
  32. <image src="/static/images/comment//upload-business.png" style="width: 550rpx;height: 324rpx;"></image>
  33. </u-upload>
  34. <view class="hflex acenter ">
  35. <u-icon name="camera" color="#999999" size="16"></u-icon>
  36. <view class="">点击上传营业执照</view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="hflex acenter">
  42. <u-checkbox-group @change="checkboxChange">
  43. <u-checkbox v-model="agree" shape="circle"></u-checkbox>
  44. </u-checkbox-group>
  45. <view class="text">阅读并同意<span class="read" @click="open">《商家入驻规则》</span></view>
  46. </view>
  47. <view class="button hflex acenter jcenter" @click="settled">
  48. <view>立即入驻</view>
  49. </view>
  50. </view>
  51. <view v-if="state == 1">
  52. <view class="box1 vflex acenter jcenter">
  53. <image src="/static/images/comment/wait.png" class="box1_img"></image>
  54. <view class="box1_title">审核中</view>
  55. <view class="box1_subTitle">预计审核时间3个工作日</view>
  56. <view class="box1_subTitle">请留意当前页面变动</view>
  57. <view class="btn" @click="result">返回</view>
  58. </view>
  59. </view>
  60. <view v-if="state == 2">
  61. <view class="box1 vflex acenter jcenter">
  62. <image src="/static/images/comment/error.png" class="box1_img"></image>
  63. <view class="box1_title">审核失败</view>
  64. <view class="box1_subTitle">驳回原因</view>
  65. <view class="box1_subTitle">{{reason}}<span style="color: #506dff;margin-left: 8rpx;" @click="edit">立即修改></span></view>
  66. <view class="btn" @click="result">返回</view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import $api from '@/static/js/api.js'
  73. var that = ''
  74. export default {
  75. data() {
  76. return {
  77. info: {
  78. name: '',
  79. address: '',
  80. contacts: '',
  81. phone: '',
  82. introduction: '',
  83. fileList1: [],
  84. },
  85. agree: false,
  86. state: 0
  87. }
  88. },
  89. onLoad() {
  90. that = this
  91. },
  92. methods: {
  93. // 删除图片
  94. deletePic(event) {
  95. // that.userInfo.imgList.splice(event.index, 1)
  96. console.log(event)
  97. this.info[`fileList${event.name}`].splice(event.index, 1)
  98. },
  99. // 新增图片
  100. async afterRead(event) {
  101. console.log(`fileList${event.name}`);
  102. console.log(this.info[`fileList${event.name}`]);
  103. let lists = [].concat(event.file)
  104. let fileListLen = this.info[`fileList${event.name}`].length
  105. lists.map((item) => {
  106. this.info[`fileList${event.name}`].push({
  107. ...item,
  108. status: 'uploading',
  109. message: '上传中'
  110. })
  111. })
  112. for (let i = 0; i < lists.length; i++) {
  113. const result = await this.uploadFilePromise(lists[i].url)
  114. let item = this.info[`fileList${event.name}`][fileListLen]
  115. this.info[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  116. status: 'success',
  117. message: '',
  118. url: result
  119. }))
  120. fileListLen++
  121. }
  122. },
  123. // 上传图片
  124. uploadFilePromise(url) {
  125. return new Promise((resolve, reject) => {
  126. let a = uni.uploadFile({
  127. url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
  128. filePath: url,
  129. name: 'file',
  130. formData: {
  131. user: 'test'
  132. },
  133. success: (res) => {
  134. setTimeout(() => {
  135. resolve(res.data.data)
  136. }, 1000)
  137. }
  138. });
  139. })
  140. },
  141. // 阅读并同意
  142. checkboxChange(n) {
  143. that.agree = !that.agree
  144. },
  145. settled() {
  146. if ($api.formCheck(that.info.name,'required')&&$api.formCheck(that.info.address,'required')&&$api.formCheck(that.info.contacts,'required')&&$api.formCheck(that.info.phone,'phone')&&$api.formCheck(that.info.introduction,'required')) {
  147. if(that.agree) {
  148. that.state = 1
  149. }else {
  150. $api.info('请先阅读并同意《商家入驻规则》')
  151. }
  152. }
  153. },
  154. result() {
  155. $api.jump('/pages/tabbar/mine/mine',3)
  156. }
  157. },
  158. }
  159. </script>
  160. <style lang="scss" scoped>
  161. .content::v-deep {
  162. background: #F4F4F4;
  163. padding: 20rpx 30rpx;
  164. .box {
  165. width: 100%;
  166. background: #FFFFFF;
  167. border-radius: 28rpx;
  168. padding: 28rpx 20rpx;
  169. box-sizing: border-box;
  170. margin-bottom: 16rpx;
  171. .title {
  172. font-size: 28rpx;
  173. color: #222222;
  174. }
  175. .cell {
  176. width: 100%;
  177. padding: 20rpx 0 28rpx;
  178. border-bottom: 1rpx solid #f4f4f4;
  179. .left {
  180. font-size: 28rpx;
  181. color: #222;
  182. position: relative;
  183. padding-left: 10rpx;
  184. }
  185. .left::before {
  186. content: "*";
  187. position: absolute;
  188. top: 0rpx;
  189. left: -5rpx;
  190. color: #FF0D0D;
  191. font-size: 20rpx;
  192. }
  193. .u-input {
  194. font-size: 28rpx;
  195. color: #222;
  196. }
  197. .img_title {
  198. font-size: 28rpx;
  199. color: #444;
  200. }
  201. .upload_img {
  202. width: 670rpx;
  203. height: 404rpx;
  204. background-color: #fff;
  205. border-radius: 20rpx;
  206. margin: 28rpx 0 0;
  207. padding: 20rpx 0;
  208. border: 1rpx dashed #e0e0e0;
  209. }
  210. .u-upload__wrap {
  211. display: flex;
  212. align-items: center !important;
  213. justify-content: center !important;
  214. }
  215. .u-textarea {
  216. margin: 28rpx auto 0;
  217. background-color: #f4f4f4;
  218. border-radius: 28rpx;
  219. box-sizing: border-box;
  220. padding: 24rpx;
  221. width: 610rpx;
  222. }
  223. }
  224. }
  225. .text {
  226. font-size: 24rpx;
  227. color: #9c9c9c;
  228. }
  229. .read {
  230. color: #2a63f3;
  231. }
  232. .button {
  233. width: 100%;
  234. height: 88rpx;
  235. background-color: #506dff;
  236. border-radius: 50rpx;
  237. box-shadow: 0 4rpx 28rpx 0 rgba(132,123,255,0.4);
  238. font-size: 40rpx;
  239. color: #fff;
  240. margin: 40rpx 0 36rpx;
  241. }
  242. .box1 {
  243. width: 100%;
  244. // height: 100vh;
  245. background-color: #fff;
  246. padding-bottom: 80rpx;
  247. .box1_img {
  248. width: 124rpx;
  249. height: 124rpx;
  250. margin: 108rpx 0 40rpx;
  251. }
  252. .box1_title {
  253. font-size: 32rpx;
  254. color: #222;
  255. margin-bottom: 24rpx;
  256. }
  257. .box1_subTitle {
  258. margin: 12rpx 0;
  259. font-size: 26rpx;
  260. color: #999999;
  261. }
  262. .btn {
  263. width: 530rpx;
  264. height: 88rpx;
  265. background-color: #506dff;
  266. color: #fff;
  267. text-align: center;
  268. line-height: 88rpx;
  269. border-radius: 44rpx;
  270. font-size: 36rpx;
  271. margin-top: 122rpx;
  272. }
  273. }
  274. }
  275. </style>