| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173 |
- <template>
- <view>
- <cu-custom :bgColor="title == '申请入驻' ? 'bg-gradual-blue1' : 'bg-fff'" :isBack="true">
- <block slot="content">{{ title }}</block>
- </cu-custom>
- <view class="progress" v-if="title == '申请入驻'">
- <view class="progress-style progress-bag">
- <view v-if="tab == 1" class="progress-icon"></view>
- <view v-if="tab == 2" class="progress-style progress-bag1">
- <view class="progress-icon1"></view>
- </view>
- <view v-if="tab == 3" class="progress-style progress-bag2">
- <view class="progress-icon1"></view>
- </view>
- </view>
- <view class="progress-title flex justify-between">
- <view :class="tab == '1' ? 'color' : ''">账户信息</view>
- <view :class="tab == '2' ? 'color' : ''">提交资料</view>
- <view :class="tab == '3' ? 'color' : ''">门店信息</view>
- </view>
- </view>
- <status v-else :status="form.status" :reason="form.reason" :updateTime="form.updateTime" :remark="form.remark"></status>
- <view v-if="tab == 1" :class="title == '申请入驻'?'tab-top':''">
- <form>
- <view class="borderRadiu" v-if="title == '申请入驻' && loginType == 3">
- <view class="flex cu-form-group margin-top1 ">
- <view class="content ">
- <text class="text-bold">推荐人邀请码</text>
- <i class="text-bg "></i>
- </view>
- </view>
- <view class=" cu-form-group ">
- <view class="title"> <span></span> 邀请码</view>
- <input placeholder="输入邀请码(选填)" v-model="form.referenceCode" name="input"
- :disabled="referenceCodeDisable"></input>
- </view>
- </view>
- <view class="borderRadiu" style="height: 67vh;overflow-y: auto;">
- <view class="flex cu-form-group margin-top1">
- <view class="content ">
- <text class="text-bold">提交经营主体资料</text>
- <i class="text-bg"></i>
- </view>
- </view>
- <view class="customize">
- <view class="title" style="text-align: center;">营业执照</view>
- <view style="border-bottom: 1px solid #EEEEEE;">
- <view class="business-img flex align-center">
- <image :src="businessLicenseImg ? businessLicenseImg : '/static/login/yingyezhizhao.png'" mode=""
- @click="businessChange('businessLicense')">
- </image>
- </view>
- </view>
- <view class="business-prompt">
- 请上传营业执照照片或复印件,复印件需加盖公司公章,仅支持jpg、png格式;图片需清晰、完整、无反光、无PS、无不相关水印、非拍屏
- </view>
- </view>
- <view class=" cu-form-group">
- <view class="title">主体类型</view>
- <view style="display: flex;width: 74%;justify-content: space-between;" @click="showSelectLocality = true">
- <view style="font-size: 30rpx;">
- <text v-if="typeLabel"> {{ typeLabel }}</text>
- <text v-else style="color: grey">请选择主体类型</text>
- </view>
- <u-icon name="arrow-right" style="margin-left: 17rpx;color: #C7C6CA"></u-icon>
- </view>
- <!-- <u-select v-model="showSelectLocality" :list="selectLocality" @confirm="confirmLocality"></u-select> -->
- </view>
- <view class="cu-form-group">
- <view class="title">公司名称</view>
- <input placeholder="请输入公司名称" v-model="form.corporateName" name="input"></input>
- </view>
- <view class="cu-form-group">
- <view class="title">统一代码</view>
- <input placeholder="请输入统一社会信用代码" v-model="form.creditCode" name="input"></input>
- </view>
- <view class="cu-form-group">
- <view class="title">证件期限 </view>
- <!-- <uni-data-checkbox v-model="form.lifespan" :localdata="lifespanOption"></uni-data-checkbox> -->
- <radio-group @change="typeChang($event, 'lifespanType')" v-model="form.lifespanType">
- <label class="margin-left-sm">
- <radio :class="form.lifespanType == '1' ? 'checked blue' : ''"
- :checked="form.lifespanType == '1' ? true : false" value="1"></radio>
- <!-- <checkbox class=' blue' :class="form.type?'checked':''" :checked="form.type?true:false" value="1"></checkbox> -->
- <text class="margin-left-sm">长期有效</text>
- </label>
- <label class="margin-left-sm">
- <radio :class="form.lifespanType == '2' ? 'checked blue' : ''"
- :checked="form.lifespanType == '2' ? true : false" value="2"></radio>
- <text class="margin-left-sm">固定期限</text>
- </label>
- </radio-group>
- </view>
- <view class="cu-form-group" v-if="form.lifespanType == 2">
- <view class="title">有效期起</view>
- <view style="display: flex;width: 74%;justify-content: space-between;" @click="selectDate">
- <view style="font-size: 30rpx;">
- <text v-if="form.lifespanBegin"> {{ form.lifespanBegin }}--{{form.lifespanEnd}}</text>
- <text v-else style="color: grey">请选择</text>
- </view>
- <u-icon name="arrow-right" style="margin-left: 17rpx;color: #C7C6CA"></u-icon>
- </view>
- <rangTime title="选择证件有效时间" ref="rangTime" :mode="mode" @onSubmit="onEndTimeChange" />
- </view>
- <view class="cu-form-group" style="display: block;">
- <view class="title">经营范围</view>
- <view class="scope" style="width: 100%;height: auto;">
- <u-input v-model="form.businessScope" type="textarea"
- style="width: 100%;min-height: 165rpx;max-height: 300rpx; background-color:#F7F8FC;padding: 0 16rpx;margin: 0;overflow-y: auto;" />
- </view>
- </view>
- </view>
- </form>
- </view>
- <view v-if="tab == 2" :class="title=='申请入驻'?'tab-top':''" :style="title == '店铺信息' ? 'margin-top: 120upx' : ''">
- <form>
- <view class="borderRadiu">
- <view class="flex cu-form-group margin-top1 ">
- <view class="content ">
- <text class="text-bold">法人信息</text>
- <i class="text-bg "></i>
- </view>
- </view>
- <view class="cu-form-group ">
- <view class="title">法人姓名</view>
- <input placeholder="请输入法人姓名" v-model="form.legalPerson" name="input"></input>
- </view>
- <view class="cu-form-group">
- <view class="title">法人证件号</view>
- <input placeholder="请输入法人证件号" v-model="form.legalPersonCode" name="input"></input>
- </view>
- <view class="customize">
- <view class="title">法人证件照片</view>
- <view style="padding: 16upx 0;border-bottom: 1px solid #EEEEEE;">
- <view class="flex upload justify-between">
- <view class="imgOcr-border">
- <image :src="identityOneImg ? identityOneImg : '/static/login/code1.png'" mode=""
- @click="businessChange('identityOne')"></image>
- </view>
- <view class="imgOcr-border">
- <image :src="identityTwoImg ? identityTwoImg : '/static/login/code2.png'" mode=""
- @click="businessChange('identityTwo')"></image>
- </view>
- </view>
- </view>
- <view class="business-prompt">
- <view>请上传中国大陆公民.身份证照片,仅支持jpg、png格式</view>
- <view>1、需提供与主体证照上一致的法人证件照片</view>
- <view>2、图片需清晰、完整、无反光、无PS、无不相关水印、非拍屏</view>
- <view>3、证件未过期</view>
- </view>
- </view>
- </view>
- </form>
- </view>
- <view v-if="tab == 3" :class="title == '申请入驻'?'tab-top':''" :style="title == '店铺信息' ? 'margin-top: 120upx' : ''">
- <form>
- <view class="borderRadiu">
- <view class="flex cu-form-group margin-top1">
- <view class="content ">
- <text class="text-bold">提交门店信息</text>
- <i class="text-bg "></i>
- </view>
- </view>
- <view class="cu-form-group">
- <view class="title">门店名称</view>
- <input placeholder="请输入门店名称" v-model="form.storeName" name="input"></input>
- </view>
- <view class="cu-form-group">
- <view class="title">所在地区</view>
- <view style="display: flex;width: 74%;justify-content: space-between;" @click="$refs.picker.show()">
- <view style="font-size: 30rpx;">
- <text v-if="form.locality"> {{ form.locality }}</text>
- <text v-else style="color: grey">请选择所在地区</text>
- </view>
- <u-icon name="arrow-right" style="margin-left: 17rpx;color: #C7C6CA"></u-icon>
- </view>
- </view>
- <view class="cu-form-group">
- <view class="title">门店地址</view>
- <input placeholder="请输入门店地址详细地址" v-model="form.address" name="input"></input>
- </view>
- <view class="cu-form-group">
- <view class="title">店铺面积</view>
- <input placeholder="请输入店铺面积" style="width: 200rpx !important;" v-model="form.storeExtent"
- name="input"></input>㎡
- </view>
- <view class=" booder-top" style="padding-bottom: 16upx" :style="{ display: mapIsHidden }"
- @click="selectAddress">
- <tdmap :allowSelection="false" :showCoordinates="false" :key="mapKey" style="height: 300rpx;"></tdmap>
- </view>
- </view>
- <view class="borderRadiu">
- <view class="flex cu-form-group margin-top1">
- <view class="content ">
- <text class="text-bold">提交门店负责人信息</text>
- <i class="text-bg "></i>
- </view>
- </view>
- <view class="cu-form-group">
- <view class="title">姓名</view>
- <input placeholder="门店负责人姓名" v-model="form.leaderName" name="input"></input>
- </view>
- <view class="cu-form-group">
- <view class="title">手机号</view>
- <input placeholder="门店负责人手机号" v-model="form.leaderPhone" name="input"></input>
- </view>
- </view>
- </form>
- </view>
- <view v-if="tab == 1" class="padding flex flex-direction sub-bottom">
- <button class="cu-btn bg-blue round " @click="tab = 2">下一步</button>
- </view>
- <view v-if="tab == 2 && title == '申请入驻'" class="padding flex sub-bottom">
- <button class="cu-btn round line-blue shadow" @click="tab = 1">上一步</button>
- <button style="margin-left: 12upx;width:77%" class="cu-btn bg-blue round " @click="tab = 3">下一步</button>
- </view>
- <view v-if="tab == 2 && title == '店铺信息'" class="padding flex sub-bottom" style="justify-content: space-around;">
- <!-- <button class="cu-btn line-gray shadow" style="width: 40%;"
- @click="$Router.push({ name: 'settings' })">取消</button> -->
- <button class="cu-btn round line-blue shadow" style="width: 48%;" @click="tab = 1">上一页</button>
- <button style="margin-left: 12upx;width:48%" class="cu-btn line-blue round shadow" @click="tab = 3">下一页</button>
- <!-- <button style="margin-left: 12upx;width:40%" class="cu-btn bg-blue " @click="sumbit">提交审核</button> -->
- </view>
- <view v-if="tab == 3" class="padding flex sub-bottom">
- <button class="cu-btn round line-blue shadow" @click="tab = 2">{{ title == '申请入驻' ? '上一步' : '上一页' }}</button>
- <button style="margin-left: 12upx;width:77%" class="cu-btn bg-blue round " @click="sumbit">提交审核</button>
- </view>
- <view class="cu-load load-modal" v-if="lodingshow">
- <image src="/static/logo.png" mode="aspectFit"></image>
- <view class="gray-text">加载中...</view>
- </view>
- <w-picker class="picker-style" :visible.sync="visible" ref="picker" mode="region" :value="form.locality"
- @confirm="onConfirm($event, 'region')"></w-picker>
- <selectType v-if="showSelectLocality" @transmitType="confirmLocality" @cutPopup="showSelectLocality = false">
- </selectType>
- </view>
- </template>
- <script>
- import {
- watch
- } from 'vue'
- import configService from '../../common/service/config.service'
- import regionPicker from "../../components/w-picker/region-picker.vue"
- import selectType from "../../components/selectType.vue"
- // import aMap from "./map.vue"
- import status from "../store/components/status.vue"
- import {
- ACCESS_TOKEN,
- USER_INFO
- } from "@/common/util/constants";
- import * as $p from "@/uni_modules/uni-easyinput/components/uni-easyinput/common";
- import rangTime from '../../components/dengrq-datetime-picker/dateSelector/index.vue'
- import tdmap from "@/pages/store/tdtuMap.vue"
- export default {
- components: {
- regionPicker,
- status,
- rangTime,
- selectType,
- // aMap
- tdmap
- },
- data() {
- return {
- imageList: [],
- mapIsHidden: false,
- latitude: 37.827066,
- longitude: 112.34988,
- // latitude: null, // 默认中心纬度(例如北京)
- // longitude: null, // 默认中心经度
- marker: [], // 初始为空数组
- title: '申请入驻',
- lodingshow: false,
- form: {
- name: null,
- type: 1,
- corporateName: null,
- creditCode: null,
- lifespanType: 1,
- lifespanBegin: this.timestampToTime(),
- lifespanEnd: '9999-12-31',
- lifespanBegin: null,
- lifespanEnd: null,
- businessLicense: null,
- legalPerson: null,
- legalPersonCode: null,
- storeName: null,
- country: null,
- locality: '',
- address: null,
- headPhoto: '',
- passWord: uni.getStorageSync('password'),
- phone: uni.getStorageSync('phone'),
- ordinaryUserId: null,
- storeExtent: null,
- longitude: '',
- latitude: '',
- typeLabel: null,
- businessScope: null
- },
- formName: {
- // name: '姓名',
- type: '主体类型',
- corporateName: '公司名称',
- creditCode: '统一代码',
- lifespanType: '有效期',
- // headPhoto: '门头照片',
- legalPerson: '法人姓名',
- legalPersonCode: '法人证件号',
- storeName: '门店名称',
- locality: '所在地区',
- address: '门店地址',
- businessLicense: '营业执照',
- businessScope: '经营范围',
- leaderName: '负责人姓名',
- leaderPhone: '负责人手机号',
- storeExtent: '店铺面积',
- // typeLabel: '主体类型'
- },
- tab: 1,
- supplierOption: [],
- businessLicenseImg: '',
- identityOneImg: '',
- identityTwoImg: '',
- visible: false,
- index: -1,
- // markers:[{
- // latitude: 37.827066,
- // longitude: 112.34988,
- // iconPath: '../../static/avatar_girl.png'
- // }]
- markers: [],
- headPhotoImg: [],
- loginType: '',
- showSelectLocality: false, //选择主体类型弹窗显隐
- mode: 1,
- typeLabel: '',
- referenceCodeDisable: false,
- mapKey: 1,
- }
- },
- watch: {
- visible(val) {
- if (!val) {
- this.mapIsHidden = 'block'
- }
- }
- },
- computed() {
- },
- onShow() {
- this.getCurrentLocation();
- this.markers = uni.getStorageSync('address') ? [Object.assign(uni.getStorageSync('address'), {
- iconPath: '../../static/boiaoji.png'
- })] : []
- let storageData = uni.getStorageSync('address');
- this.form.address = storageData.address
- this.form.latitude = storageData.lat || 37.855068;
- this.form.longitude = storageData.lng || 112.536392
- },
- async onLoad(data) {
-
- if (data.loginType) {
- // data.loginType =2 需要根据merchantId查询商户临时数据
- // data.loginType =3 不需要回显
- this.loginType = data.loginType;
- if (data.loginType === '3') {
- this.form.ordinaryUserId = data.ordinaryUserId;
- this.form.name = (data.name == null || data.name == 'null') ? "" : data.name,
- this.form.passWord = data.passWord;
- this.form.phone = data.phone;
- }
- //邀请入驻商家完善信息
- else if (data.loginType == 2) {
- this.merchantId = uni.getStorageSync(USER_INFO).merchantId;
- let res = await this.$http.get("/merchant/localMerchantInfo/queryAppInfoById?id=" + this.merchantId)
- console.log(res.data)
- let obj = res.data.result
- if (res.data.success) {
- this.title = '店铺信息'
- this.tab = 1
- obj.lifespanType = obj.lifespanType ? obj.lifespanType : '1'
- this.markers = this.form.longitude && this.form.latitude ? [{
- longitude: this.form.longitude,
- latitude: this.form.latitude,
- iconPath: '../../static/boiaoji.png'
- }] : []
- this.businessLicenseImg = obj.businessLicense
- this.identityOneImg = obj.identityOne
- this.identityTwoImg = obj.identityTwo
- this.headPhotoImg = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
- obj.headPhoto = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
- obj.locality = obj.locality ? obj.locality : ''
- this.switchType(obj.type)
- this.form = obj
- uni.setStorageSync('address', {
- lng: obj.longitude,
- lat: obj.latitude,
- address: obj.address
- });
- uni.setStorageSync('currentAddress', {
- name: obj.address
- });
- } else {
- this.$tip.toast(obj.data.message);
- }
- this.loginType = data.loginType
- }
- } else {
- if (data.params) {
- let obj = JSON.parse(decodeURIComponent(data.params));
- this.title = '店铺信息'
- this.tab = 1
- obj.lifespanType = obj.lifespanType ? obj.lifespanType : '1'
- this.markers = this.form.longitude && this.form.latitude ? [{
- longitude: this.form.longitude,
- latitude: this.form.latitude,
- iconPath: '../../static/boiaoji.png'
- }] : []
- this.businessLicenseImg = obj.businessLicense
- this.identityOneImg = obj.identityOne
- this.identityTwoImg = obj.identityTwo
- this.headPhotoImg = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
- obj.headPhoto = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
- obj.locality = obj.locality ? obj.locality : ''
- this.switchType(obj.type)
- this.form = obj
- }
- }
- },
- methods: {
- switchType(type) {
- const selectLocality = [{
- value: 1,
- label: '个人独资'
- },
- {
- value: 2,
- label: '个体工商户'
- },
- {
- value: 3,
- label: '有限责任公司'
- },
- {
- value: 4,
- label: '股份责任公司'
- },
- {
- value: 5,
- label: '合伙企业'
- }
- ];
- const item = selectLocality.find(item => item.value == type);
- if (item) {
- this.typeLabel = item.label;
- }
- },
- //选择位置
- selectAddress() {
- uni.navigateTo({
- url: '/pages/store/selectTdMap?url=' + '/pages/store/editStore'
- })
- },
- //选择主题类型
- confirmLocality(data) {
- console.log(data)
- this.form.type = data.value
- this.typeLabel = data.label
- this.showSelectLocality = false
- },
- //选择证件有效时间
- onEndTimeChange(val) {
- console.log(val)
- this.form.lifespanBegin = val.startDate
- this.form.lifespanEnd = val.endDate
- this.$forceUpdate(); // 强制刷新视图
- },
- //选择时间显示
- selectDate() {
- // this.isSelectDate = true
- this.$refs.rangTime.open()
- },
- getCurrentLocation() {
- uni.getStorage({
- key: 'currentAddress',
- success: (res) => {
- if (res.data && res.data.location) {
- let temp = res.data.location.split(',');
- this.latitude = temp[1];
- this.longitude = temp[0];
- this.marker = [{
- id: 0,
- latitude: temp[1],
- longitude: temp[0],
- title: res.data.name || '当前位置',
- iconPath: '../../static/boiaoji.png',
- width: 30,
- height: 30,
- callout: { // 添加标注说明
- content: res.data.name || '当前位置',
- color: '#000',
- fontSize: 12,
- borderRadius: 10,
- bgColor: '#fff',
- padding: 5,
- display: 'ALWAYS'
- }
- }];
- this.$forceUpdate();
- }
- },
- fail: () => {
- // 如果没有存储的位置,可以设置默认位置
- this.setDefaultLocation();
- }
- });
- },
- setDefaultLocation() {
- let that = this
- uni.getLocation({
- type: 'gcj02',
- success: function(res) {
- that.latitude = res.latitude;
- that.longitude = res.longitude;
- that.marker = [{
- id: 0,
- latitude: that.latitude,
- longitude: that.longitude,
- title: '默认位置',
- iconPath: '../../static/boiaoji.png',
- width: 30,
- height: 30
- }];
- },
- fail() {
- }
- });
- },
- handleMarkerTap() {
- const queryString = uni.getStorageSync('address') ? encodeURIComponent(JSON.stringify(uni.getStorageSync(
- 'address'))) : ''
- uni.navigateTo({
- url: `/pages/login/map?position=${queryString}`
- // url:'/pages/login/map'
- })
- },
- getFile(e) {
- let path = ''
- uni.uploadFile({
- url: configService.apiUrl + '/sys/common/upload',
- filePath: e,
- name: "file",
- formData: {
- 'biz': 'temp',
- },
- success: (files) => {
- let data = JSON.parse(files.data);
- if (data.success) {
- path = res.tempFilePaths
- }
- }
- })
- console.log(path, 88);
- return path
- },
- uploadAll() {
- if (this.imageList.length === 0) {
- uni.showToast({
- title: '请先选择图片',
- icon: 'none'
- });
- return;
- }
- uni.showLoading({
- title: '上传中...',
- mask: true
- });
- const uploadPromises = this.imageList.map((path, index) => {
- return new Promise((resolve, reject) => {
- uni.uploadFile({
- url: configService.apiUrl + '/sys/common/upload', // 替换为实际接口
- filePath: path,
- formData: {
- 'biz': 'temp',
- },
- name: 'file',
- success: (files) => {
- resolve(configService.apiUrl + '/' + JSON.parse(files.data).message)
- },
- fail: reject
- });
- });
- });
- Promise.all(uploadPromises)
- .then(results => {
- uni.hideLoading();
- this.imageList = []; // 清空已上传列表
- this.headPhotoImg = this.headPhotoImg.concat(results)
- this.form.headPhoto = this.form.headPhoto.concat(results)
- })
- .catch(error => {
- uni.hideLoading();
- });
- },
- ChooseImage() {
- uni.chooseImage({
- count: 5 - Number(this.headPhotoImg.length),
- sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ['album'], //从相册选择
- success: (res) => {
- if (res) {
- this.imageList = [...this.imageList, ...res.tempFilePaths];
- this.uploadAll()
- }
- }
- });
- },
- ViewImage(e) {
- uni.previewImage({
- urls: this.headPhotoImg,
- current: e.currentTarget.dataset.url
- });
- },
- DelImg(e) {
- uni.showModal({
- title: '提示',
- content: '确定要删除?',
- cancelText: '取消',
- confirmText: '确定',
- success: res => {
- if (res.confirm) {
- this.headPhotoImg.splice(e.currentTarget.dataset.index, 1)
- this.form.headPhoto.splice(e.currentTarget.dataset.index, 1)
- }
- }
- })
- },
- onConfirm(e) {
- this.mapIsHidden = false
- this.form.locality = e.result
- this.form.country = e.value[e.value.length - 1]
- },
- PickerChange(e) {
- this.form.purveyorId = this.supplierOption[e.detail.value].id
- },
- typeChang(e, val) {
- this.form[val] = e.detail.value
- },
- async businessChange(type) {
- let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
- count: 1,
- sizeType: ['compressed']
- });
- let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
- if (!size) {
- this.$refs.uToast.show({
- title: '上传图片大小不能超过 5MB!',
- type: 'error',
- })
- return false
- }
- if (chooseImageRes) {
- this.lodingshow = true;
- // this.$tip.loading()
- this[type + 'Img'] = chooseImageRes.tempFilePaths[0];
- uni.uploadFile({
- url: configService.apiUrl + '/sys/common/upload',
- filePath: chooseImageRes.tempFilePaths[0],
- name: "file",
- formData: {
- 'biz': 'temp',
- },
- success: (files) => {
- let data = JSON.parse(files.data);
- if (data.success) {
- this.form[type] = data.message
- if (type == 'businessLicense' || type == 'identityOne') {
- uni.uploadFile({
- url: configService.apiUrl +
- `${type == 'businessLicense' ? '/order/identify/businessLicense' : '/order/identify/idCard'}`,
- filePath: chooseImageRes.tempFilePaths[0],
- name: "image1",
- success: (uploadFileRes) => {
- let data1 = JSON.parse(uploadFileRes.data).result;
- let obj = {}
- if (type == 'businessLicense') {
- obj = {
- corporateName: data1.company ? data1.company : '', //公司名称
- creditCode: data1.socialCreditCode ? data1.socialCreditCode : '', //统一社会信用代码
- businessScope: data1.businessScope ? data1.businessScope : '', //经营范围
- lifespanBegin: data1.registerDate ? data1.registerDate.substr(0,
- 4) + '-' + data1.registerDate.substr(5, 2) + '-' + data1.registerDate
- .substr(8, 2) : '',
- lifespanEnd: data1.effectiveDate && data1.effectiveDate.includes('年') ? data1
- .effectiveDate.substr(0,
- 4) + '-' + data1.effectiveDate.substr(5, 2) + '-' + data1.effectiveDate
- .substr(8, 2) : '9999-12-31',
- lifespanType: data1.registerDate || data1.effectiveDate ? '2' : '1',
- }
- } else {
- obj = {
- legalPerson: data1.customerInfo.name ? data1.customerInfo.name : '', //法人姓名
- legalPersonCode: data1.customerInfo.identifyNumber ? data1.customerInfo
- .identifyNumber : '', //法人证件号
- }
- }
- this.$nextTick(() => {
- this.form = {
- ...this.form,
- ...obj,
- }
- // this.$set(this.form, obj);
- // this.form=Object.assign(this.form,obj)
- console.log(obj, this.form, 88888);
- })
- this.lodingshow = false;
- }
- });
- } else {
- this.lodingshow = false;
- }
- }
- }
- });
- } else {
- this.lodingshow = false;
- }
- },
- timestampToTime(timestamp) {
- // let date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
- let date = new Date(new Date()); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
- let Y = date.getFullYear() + '-';
- let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
- let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
- return Y + M + D;
- },
- sumbit() {
- if (this.title == '申请入驻') {
- if (this.loginType) {
- if (this.loginType === '3') {
- //普通用户没有商户新增
- for (let j in this.form) {
- if (!this.form[j]) {
- if (this.form['lifespanType'] == 2 && (this.form['lifespanBegin'] == null || this.form[
- 'lifespanEnd'] ==
- null)) {
- // this.$tip.alert('请选择日期!')
- uni.showToast({
- icon: 'none',
- title: '请选择日期!'
- })
- return
- }
- if (this.form['businessLicense'] == null) {
- // this.$tip.alert('请上传营业执照!')
- uni.showToast({
- icon: 'none',
- title: '请上传营业执照!'
- })
- return
- }
- if (this.formName[j]) {
- // this.$tip.alert(`请填写${this.formName[j]}!`)
- uni.showToast({
- icon: 'none',
- title: `请填写${this.formName[j]}!`
- })
- return
- }
- }
- }
- const isHttpOrHttpsone = /^https?:\/\//.test(this.form.identityOne)
- const isHttpOrHttpstwo = /^https?:\/\//.test(this.form.identityOne)
- const isbusinessLicense = /^https?:\/\//.test(this.form.businessLicense)
- if (!isHttpOrHttpsone) {
- this.form.identityOne = configService.apiUrl + '/' + this.form.identityOne
- }
- if (!isHttpOrHttpstwo) {
- this.form.identityTwo = configService.apiUrl + '/' + this.form.identityTwo
- }
- if (!isbusinessLicense) {
- this.form.businessLicense = configService.apiUrl + '/' + this.form.businessLicense
- }
- this.form.address = uni.getStorageSync('address').address
- this.form.latitude = uni.getStorageSync('address').lat
- this.form.longitude = uni.getStorageSync('address').lng
- let data = {
- ...this.form,
- source: 2,
- // headPhoto: Array.isArray(this.form.headPhoto) ? this.form.headPhoto.join(',') : this.form.headPhoto,
- longitude: this.markers.length > 0 ? this.markers[0].longitude : '',
- latitude: this.markers.length > 0 ? this.markers[0].latitude : ''
- }
- this.$http.post('/merchant/app/add', data).then(res => {
- if (res.data.code == 200) {
- //放入session
- const result = res.data.result
- const userInfo = result.userInfo
- uni.setStorageSync(ACCESS_TOKEN, result.token);
- uni.setStorageSync(USER_INFO, userInfo);
- this.$store.commit('SET_TOKEN', result.token)
- this.$store.commit('SET_NAME', {
- username: userInfo.username,
- realname: userInfo.realname
- })
- this.$store.commit('SET_AVATAR', userInfo.avatar)
- // #ifdef APP-PLUS
- uni.switchTab({
- url: '/pages/index/index'
- })
- // #endif
- // #ifndef APP-PLUS
- // this.$tip.success('登录成功!')
- uni.showToast({
- icon: 'none',
- title: '登录成功'
- })
- this.$Router.replaceAll({
- name: 'index'
- })
- // #endif
- } else {
- // this.$tip.error(res.data.message);
- uni.showToast({
- icon: 'none',
- title: res.data.message
- })
- }
- })
- } else if (this.loginType == 2) {
- const isHttpOrHttpsone = /^https?:\/\//.test(this.form.identityOne)
- const isHttpOrHttpstwo = /^https?:\/\//.test(this.form.identityOne)
- const isbusinessLicense = /^https?:\/\//.test(this.form.businessLicense)
- if (!isHttpOrHttpsone) {
- this.form.identityOne = configService.apiUrl + '/' + this.form.identityOne
- }
- if (!isHttpOrHttpstwo) {
- this.form.identityTwo = configService.apiUrl + '/' + this.form.identityTwo
- }
- if (!isbusinessLicense) {
- this.form.businessLicense = configService.apiUrl + '/' + this.form.businessLicense
- }
-
- this.form.address = uni.getStorageSync('address').address
- this.form.latitude = uni.getStorageSync('address').lat
- this.form.longitude = uni.getStorageSync('address').lng
- let data = {
- ...this.form,
- source: 2,
- id: uni.getStorageSync('login_user_info').merchantId
- // headPhoto: Array.isArray(this.form.headPhoto) ? this.form.headPhoto.join(',') : this.form.headPhoto,
- // longitude: this.markers.length > 0 ? this.markers[0].longitude : '',
- // latitude: this.markers.length > 0 ? this.markers[0].latitude : ''
- }
- // this.$http.post('/merchant/localMerchantInfo/edit', data).then(res => {
- this.$http.post('/merchant/localMerchantInfo/editMerchantInfo', data).then(res => {
- if (res.data.success) {
- // this.$tip.success(res.data.result || '成功')
- uni.showToast({
- icon: 'none',
- title: res.data.result || '成功'
- })
- uni.navigateBack({
- delta: 1 // 返回的页面数,默认为1
- })
- } else {
- // this.$tip.error(res.data.message);
- uni.showToast({
- icon: 'none',
- title: res.data.message
- })
- }
- })
- }
- }
- } else {
- // this.form.identityOne = configService.apiUrl+'/'+this.form.identityOne
- // this.form.identityTwo = configService.apiUrl+'/'+this.form.identityTwo
- const isHttpOrHttpsone = /^https?:\/\//.test(this.form.identityOne)
- const isHttpOrHttpstwo = /^https?:\/\//.test(this.form.identityOne)
- const isbusinessLicense = /^https?:\/\//.test(this.form.businessLicense)
- if (!isHttpOrHttpsone) {
- this.form.identityOne = configService.apiUrl + '/' + this.form.identityOne
- }
- if (!isHttpOrHttpstwo) {
- this.form.identityTwo = configService.apiUrl + '/' + this.form.identityTwo
- }
- if (!isbusinessLicense) {
- this.form.businessLicense = configService.apiUrl + '/' + this.form.businessLicense
- }
- this.form.address = uni.getStorageSync('address').address
- this.form.latitude = uni.getStorageSync('address').lat
- this.form.longitude = uni.getStorageSync('address').lng
- let data = {
- ...this.form,
- source: 2,
- headPhoto: Array.isArray(this.form.headPhoto) ? this.form.headPhoto.join(',') : this.form.headPhoto,
- // longitude: this.markers.length > 0 ? this.markers[0].longitude : '',
- // latitude: this.markers.length > 0 ? this.markers[0].latitude : ''
- }
- // this.$http.post('/merchant/localMerchantInfo/edit', data).then(res => {
- this.$http.post('/merchant/localMerchantInfo/editMerchantInfo', data).then(res => {
- console.log(res)
- if (res.data.success) {
- // this.$tip.success(res.data.result || '成功')
- uni.showToast({
- icon: 'none',
- title: res.data.result || '成功'
- })
- uni.navigateBack({
- delta: 1 // 返回的页面数,默认为1
- })
- } else {
- // this.$tip.error(res.data.message);
- uni.showToast({
- icon: 'none',
- title: res.data.message
- })
- }
- })
- }
- }
- }
- }
- </script>
- <style scoped lang="scss">
- page {
- background: #F8F8FA;
- }
- .cu-form-group .title {
- width: 154rpx;
- padding: 0;
- span {
- color: red;
- }
- }
- .cu-bg {
- background: linear-gradient(180deg, #D6E9FF 0%, #FFFFFF 100%);
- }
- .tab-top {
- margin-top: 78upx;
- padding: 26upx;
- }
- .borderRadiu {
- height: auto;
- border-radius: 8px;
- padding-bottom: 10px;
- background-color: #ffffff;
- // border-bottom: 1px solid #eee;
- }
- .sub-bottom {
- position: fixed;
- width: 100%;
- bottom: 0;
- background: #FFFFFF;
- border-top: 1px solid #EEEEEE;
- }
- .progress-status {
- position: fixed;
- width: 100%;
- z-index: 9999;
- padding: 26upx 42upx;
- background: #FFFFFF;
- .status {
- font-size: 38upx;
- color: #F6863E;
- font-weight: 500;
- margin-bottom: 10upx;
- text {
- margin-left: 5upx
- }
- image {
- vertical-align: text-top;
- width: 42upx;
- height: 42upx;
- }
- }
- }
- .progress {
- position: fixed;
- height: 96upx;
- width: 100%;
- z-index: 9999;
- background: #FFFFFF;
- padding: 20upx 30upx;
- .progress-title {
- margin-top: 16upx;
- font-size: 24upx;
- color: #999999;
- .color {
- color: #333333;
- }
- }
- .progress-style {
- width: 100%;
- height: 10upx;
- border-radius: 5px 5px 5px 5px;
- }
- .progress-bag {
- position: relative;
- background: rgba(68, 154, 255, 0.05);
- .progress-icon {
- position: absolute;
- margin-top: -1px;
- width: 12upx;
- height: 12upx;
- background: #449AFF;
- border-radius: 50%;
- box-shadow: 0px 0px 0px 7upx rgba(68, 154, 255, 0.3);
- }
- .progress-icon1 {
- position: absolute;
- margin-top: -1px;
- width: 12upx;
- height: 12upx;
- background: #449AFF;
- border-radius: 50%;
- left: 99%;
- box-shadow: 0px 0px 0px 7upx rgba(68, 154, 255, 0.3);
- }
- .progress-bag1 {
- width: 50%;
- position: absolute;
- background: rgba(68, 154, 255, 0.8);
- }
- .progress-bag2 {
- position: absolute;
- background: rgba(68, 154, 255, 0.8);
- }
- }
- }
- .customize {
- background-color: #fff;
- // border-top: 0.5px solid #eee;
- margin: 16upx 18upx;
- .title {
- font-size: 30upx;
- // padding: 10px;
- }
- .business-img {
- height: 218upx;
- width: 360upx;
- padding: 16upx;
- // padding-bottom: 16upx;
- background: url('/static/login/yingye2.png');
- margin: 16upx auto;
- background-size: cover;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .business-prompt {
- padding-top: 16upx;
- font-size: 20upx;
- color: #999999;
- }
- }
- .booder-top {
- border-bottom: 1px solid rgb(238, 238, 238);
- padding-top: 7px;
- }
- .img-border {
- padding: 15px 20px;
- }
- .upload {
- width: 100%;
- height: 188upx;
- // padding: 15px 20px;
- background-color: white;
- .imgOcr-border {
- position: relative;
- width: 48%;
- height: 100%;
- padding: 12upx;
- // background-color: #fff;
- background: url('/static/login/code3.png');
- background-size: cover;
- // box-shadow: 0px 4px 10px 0px #DAE3F4;
- image {
- width: 100%;
- // border-radius: 4px;
- height: 100%;
- }
- }
- }
- .picker-style {
- .w-picker-cnt .visible {
- position: absolute;
- z-index: 100000;
- }
- }
- ::v-deep .cu-form-group uni-textarea {
- margin: 0;
- }
- </style>
|