123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278 |
- <template>
- <view class="content">
- <view v-if="state == 0">
- <view class="box">
- <view class="title">商家信息</view>
- <view class="hflex acenter jbetween cell">
- <view class="left">商家名称</view>
- <u-input v-model="info.name" border="none" placeholder="请输入商家名称" inputAlign="right"></u-input>
- </view>
- <view class="hflex acenter jbetween cell">
- <view class="left">商家地址</view>
- <u-input v-model="info.address" border="none" placeholder="请选择" inputAlign="right"></u-input>
- </view>
- <view class="hflex acenter jbetween cell">
- <view class="left">联系人</view>
- <u-input v-model="info.contacts" border="none" placeholder="请输入联系人姓名" inputAlign="right"></u-input>
- </view>
- <view class="hflex acenter jbetween cell">
- <view class="left">联系电话</view>
- <u-input v-model="info.phone" border="none" placeholder="请输入联系电话" inputAlign="right"></u-input>
- </view>
- <view class="vflex cell" style="border: none;">
- <view class="left">商家简介</view>
- <u--textarea v-model="info.introduction" placeholder="在此输入商家简介内容" ></u--textarea>
- </view>
-
- </view>
- <view class="box">
- <view class="cell" style="border: none;padding: none;">
- <view class="img_title">上传营业执照</view>
- <view class="upload_img vflex acenter jcenter">
- <u-upload :fileList="info.fileList1" @afterRead="afterRead" @delete="deletePic" :maxCount="1" name="1" multiple :previewFullImage="true" width="550rpx" height="324rpx">
- <image src="/static/images/comment//upload-business.png" style="width: 550rpx;height: 324rpx;"></image>
- </u-upload>
- <view class="hflex acenter ">
- <u-icon name="camera" color="#999999" size="16"></u-icon>
- <view class="">点击上传营业执照</view>
- </view>
- </view>
- </view>
- </view>
- <view class="hflex acenter">
- <u-checkbox-group @change="checkboxChange">
- <u-checkbox v-model="agree" shape="circle"></u-checkbox>
- </u-checkbox-group>
- <view class="text">阅读并同意<span class="read" @click="open">《商家入驻规则》</span></view>
- </view>
- <view class="button hflex acenter jcenter" @click="settled">
- <view>立即入驻</view>
- </view>
- </view>
- <view v-if="state == 1">
- <view class="box1 vflex acenter jcenter">
- <image src="/static/images/comment/wait.png" class="box1_img"></image>
- <view class="box1_title">审核中</view>
- <view class="box1_subTitle">预计审核时间3个工作日</view>
- <view class="box1_subTitle">请留意当前页面变动</view>
- <view class="btn" @click="result">返回</view>
- </view>
- </view>
- <view v-if="state == 2">
- <view class="box1 vflex acenter jcenter">
- <image src="/static/images/comment/error.png" class="box1_img"></image>
- <view class="box1_title">审核失败</view>
- <view class="box1_subTitle">驳回原因</view>
- <view class="box1_subTitle">{{reason}}<span style="color: #506dff;margin-left: 8rpx;" @click="edit">立即修改></span></view>
- <view class="btn" @click="result">返回</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import $api from '@/static/js/api.js'
- var that = ''
- export default {
- data() {
- return {
- info: {
- name: '',
- address: '',
- contacts: '',
- phone: '',
- introduction: '',
- fileList1: [],
- },
- agree: false,
- state: 0
- }
- },
- onLoad() {
- that = this
- },
- methods: {
-
- deletePic(event) {
-
- console.log(event)
- this.info[`fileList${event.name}`].splice(event.index, 1)
- },
-
- async afterRead(event) {
- console.log(`fileList${event.name}`);
- console.log(this.info[`fileList${event.name}`]);
- let lists = [].concat(event.file)
- let fileListLen = this.info[`fileList${event.name}`].length
- lists.map((item) => {
- this.info[`fileList${event.name}`].push({
- ...item,
- status: 'uploading',
- message: '上传中'
- })
- })
- for (let i = 0; i < lists.length; i++) {
- const result = await this.uploadFilePromise(lists[i].url)
- let item = this.info[`fileList${event.name}`][fileListLen]
- this.info[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
- status: 'success',
- message: '',
- url: result
- }))
- fileListLen++
- }
- },
-
- uploadFilePromise(url) {
- return new Promise((resolve, reject) => {
- let a = uni.uploadFile({
- url: 'http://192.168.2.21:7001/upload',
- filePath: url,
- name: 'file',
- formData: {
- user: 'test'
- },
- success: (res) => {
- setTimeout(() => {
- resolve(res.data.data)
- }, 1000)
- }
- });
- })
- },
-
- checkboxChange(n) {
- that.agree = !that.agree
- },
- settled() {
- 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')) {
- if(that.agree) {
- that.state = 1
- }else {
- $api.info('请先阅读并同意《商家入驻规则》')
- }
- }
- },
- result() {
- $api.jump('/pages/tabbar/mine/mine',3)
- }
- },
- }
- </script>
- <style lang="scss" scoped>
- .content::v-deep {
- background: #F4F4F4;
- padding: 20rpx 30rpx;
- .box {
- width: 100%;
- background: #FFFFFF;
- border-radius: 28rpx;
- padding: 28rpx 20rpx;
- box-sizing: border-box;
- margin-bottom: 16rpx;
- .title {
- font-size: 28rpx;
- color: #222222;
- }
- .cell {
- width: 100%;
- padding: 20rpx 0 28rpx;
- border-bottom: 1rpx solid #f4f4f4;
- .left {
- font-size: 28rpx;
- color: #222;
- position: relative;
- padding-left: 10rpx;
- }
- .left::before {
- content: "*";
- position: absolute;
- top: 0rpx;
- left: -5rpx;
- color: #FF0D0D;
- font-size: 20rpx;
- }
- .u-input {
- font-size: 28rpx;
- color: #222;
- }
- .img_title {
- font-size: 28rpx;
- color: #444;
- }
- .upload_img {
- width: 670rpx;
- height: 404rpx;
- background-color: #fff;
- border-radius: 20rpx;
- margin: 28rpx 0 0;
- padding: 20rpx 0;
- border: 1rpx dashed #e0e0e0;
- }
- .u-upload__wrap {
- display: flex;
- align-items: center !important;
- justify-content: center !important;
- }
- .u-textarea {
- margin: 28rpx auto 0;
- background-color: #f4f4f4;
- border-radius: 28rpx;
- box-sizing: border-box;
- padding: 24rpx;
- width: 610rpx;
- }
- }
- }
- .text {
- font-size: 24rpx;
- color: #9c9c9c;
- }
- .read {
- color: #2a63f3;
- }
- .button {
- width: 100%;
- height: 88rpx;
- background-color: #506dff;
- border-radius: 50rpx;
- box-shadow: 0 4rpx 28rpx 0 rgba(132,123,255,0.4);
- font-size: 40rpx;
- color: #fff;
- margin: 40rpx 0 36rpx;
- }
- .box1 {
- width: 100%;
- // height: 100vh;
- background-color: #fff;
- padding-bottom: 80rpx;
- .box1_img {
- width: 124rpx;
- height: 124rpx;
- margin: 108rpx 0 40rpx;
- }
- .box1_title {
- font-size: 32rpx;
- color: #222;
- margin-bottom: 24rpx;
- }
- .box1_subTitle {
- margin: 12rpx 0;
- font-size: 26rpx;
- color: #999999;
- }
- .btn {
- width: 530rpx;
- height: 88rpx;
- background-color: #506dff;
- color: #fff;
- text-align: center;
- line-height: 88rpx;
- border-radius: 44rpx;
- font-size: 36rpx;
- margin-top: 122rpx;
- }
- }
- }
- </style>
|