| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174 |
- <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" :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 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"></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,
- address: '',
- 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
- this.form.longitude = storageData.lng
- },
- 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>
|