From 46e6a2b43b042963953b4d1d6a36e0cee69962b0 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期一, 27 四月 2026 20:03:16 +0800
Subject: [PATCH] 小程序端和PC端bug修复
---
small-program/pages/store-apply/store-apply.vue | 892 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 822 insertions(+), 70 deletions(-)
diff --git a/small-program/pages/store-apply/store-apply.vue b/small-program/pages/store-apply/store-apply.vue
index bfeeddf..aa0aec8 100644
--- a/small-program/pages/store-apply/store-apply.vue
+++ b/small-program/pages/store-apply/store-apply.vue
@@ -16,27 +16,37 @@
<view v-if="currentStep === 1" class="form-card">
<text class="card-title">闂ㄥ簵淇℃伅</text>
- <text class="register-no">娉ㄥ唽鎵嬫満鍙凤細18155114565</text>
+ <text class="register-no">娉ㄥ唽鎵嬫満鍙凤細{{ userInfo.telephone || '' }}</text>
<view class="form-group">
<view class="label-row"><text class="label">闂ㄥ簵鍚嶇О</text><text class="required">*</text></view>
- <input class="text-input" :value="previewMode === 'filled' ? '涓搧蹇繍鍗楃珯鏃楄埌搴�' : ''" placeholder="璇疯緭鍏ラ棬搴楀悕绉�" placeholder-class="placeholder" />
+ <input class="text-input" v-model="form.name" placeholder="璇疯緭鍏ラ棬搴楀悕绉�" placeholder-style="color: #c1c7d0;" />
</view>
<view class="divider"></view>
<view class="form-group select-group">
<view class="label-row"><text class="label">鎵�鍦ㄥ煄甯�</text><text class="required">*</text></view>
- <view class="select-row">
- <text class="select-text" :class="{ placeholder: previewMode === 'empty' }">{{ previewMode === 'filled' ? '瀹夊窘鐪�/鍚堣偉甯�/搴愰槼鍖�' : '璇烽�夋嫨鐪佸競鍖�' }}</text>
+ <view class="select-row" @click="showAreaPicker = true">
+ <text class="select-text" :class="{ placeholder: !fullAreaName }">{{ fullAreaName || '璇烽�夋嫨鐪佸競鍖�' }}</text>
<u-icon name="arrow-right" size="18" color="#9FA6B2"></u-icon>
</view>
</view>
+ <u-picker
+ :show="showAreaPicker"
+ v-if="areaList && areaList.length > 0"
+ ref="uPicker"
+ confirmColor="#10B2FA"
+ keyName="text"
+ :columns="areaColumns"
+ @confirm="confirmArea"
+ @change="changeAreaHandler"
+ @cancel="showAreaPicker = false" />
<view class="divider"></view>
<view class="form-group select-group">
<view class="label-row"><text class="label">闂ㄥ簵鍦板潃</text><text class="required">*</text></view>
- <view class="select-row">
- <text class="select-text" :class="{ placeholder: previewMode === 'empty' }">{{ previewMode === 'filled' ? '涔濆崕灞辫矾201鍙�' : '璇烽�夋嫨鍦板潃' }}</text>
+ <view class="select-row" @click="chooseAddress">
+ <text class="select-text" :class="{ placeholder: !form.address }">{{ form.address || '璇烽�夋嫨鍦板潃' }}</text>
<u-icon name="arrow-right" size="18" color="#9FA6B2"></u-icon>
</view>
</view>
@@ -44,14 +54,14 @@
<view class="form-group">
<view class="label-row"><text class="label">鑱旂郴浜�</text><text class="required">*</text></view>
- <input class="text-input" :value="previewMode === 'filled' ? '鑻忕湢鐪�' : ''" placeholder="璇疯緭鍏ヨ仈绯讳汉濮撳悕" placeholder-class="placeholder" />
+ <input class="text-input" v-model="form.linkName" placeholder="璇疯緭鍏ヨ仈绯讳汉濮撳悕" placeholder-style="color: #c1c7d0;" />
</view>
<view class="divider"></view>
<view class="form-group phone-group">
<view class="label-row"><text class="label">鑱旂郴浜虹數璇�</text><text class="required">*</text></view>
<view class="input-with-icon">
- <input class="text-input" :value="previewMode === 'filled' ? '18155114565' : '18155114565'" placeholder="璇疯緭鍏ヨ仈绯讳汉鐢佃瘽" placeholder-class="placeholder" />
+ <input class="text-input" type="number" maxlength="11" v-model="form.linkPhone" placeholder="璇疯緭鍏ヨ仈绯讳汉鐢佃瘽" placeholder-style="color: #c1c7d0;" />
<view class="clear-icon"></view>
</view>
</view>
@@ -59,7 +69,7 @@
<view class="form-group">
<view class="label-row"><text class="label">鑱旂郴浜鸿韩浠借瘉鍙�</text><text class="required">*</text></view>
- <input class="text-input" :value="previewMode === 'filled' ? '340198273482934298' : ''" placeholder="璇疯緭鍏ヨ仈绯讳汉鐢佃瘽" placeholder-class="placeholder" />
+ <input class="text-input" type="idcard" maxlength="18" v-model="form.idcard" placeholder="璇疯緭鍏ヨ仈绯讳汉韬唤璇佸彿" placeholder-style="color: #c1c7d0;" />
</view>
<view class="divider"></view>
@@ -69,15 +79,13 @@
<text class="upload-tip">鏈�澶氫笂浼�3寮犵収鐗�</text>
</view>
<view class="upload-grid">
- <view class="upload-box">
+ <view class="upload-box" @click="chooseStoreFrontImage">
<image class="upload-icon" src="/static/image/btn_upload@2x.png" mode="widthFix"></image>
</view>
- <template v-if="previewMode === 'filled'">
- <view v-for="n in 2" :key="n" class="image-box">
- <image class="preview-image" src="" mode="aspectFill"></image>
- <text class="image-mark">鍒犳帀</text>
- </view>
- </template>
+ <view v-for="(item, index) in uploadedImagesStoreFront" :key="index" class="image-box" @click="deleteStoreFrontImage(index)">
+ <image class="preview-image" :src="item.url" mode="aspectFill"></image>
+ <text class="image-mark">鍒犳帀</text>
+ </view>
</view>
</view>
@@ -87,15 +95,13 @@
<text class="upload-tip">鏈�澶氫笂浼�3寮犵収鐗�</text>
</view>
<view class="upload-grid">
- <view class="upload-box">
+ <view class="upload-box" @click="chooseIdCardImage">
<image class="upload-icon" src="/static/image/btn_upload@2x.png" mode="widthFix"></image>
</view>
- <template v-if="previewMode === 'filled'">
- <view v-for="n in 3" :key="n" class="image-box">
- <image class="preview-image" src="" mode="aspectFill"></image>
- <text class="image-mark">鍒犳帀</text>
- </view>
- </template>
+ <view v-for="(item, index) in uploadedImagesIdCard" :key="index" class="image-box" @click="deleteIdCardImage(index)">
+ <image class="preview-image" :src="item.url" mode="aspectFill"></image>
+ <text class="image-mark">鍒犳帀</text>
+ </view>
</view>
</view>
@@ -105,8 +111,12 @@
<text class="upload-tip">鏈�澶氫笂浼�3寮犵収鐗�</text>
</view>
<view class="upload-grid">
- <view class="upload-box">
+ <view class="upload-box" @click="choosePermitImage">
<image class="upload-icon" src="/static/image/btn_upload@2x.png" mode="widthFix"></image>
+ </view>
+ <view v-for="(item, index) in uploadedImagesPermit" :key="index" class="image-box" @click="deletePermitImage(index)">
+ <image class="preview-image" :src="item.url" mode="aspectFill"></image>
+ <text class="image-mark">鍒犳帀</text>
</view>
</view>
</view>
@@ -118,15 +128,21 @@
<view class="form-group subject-first-group">
<view class="label-row"><text class="label">闂ㄥ簵绫诲瀷</text><text class="required">*</text></view>
<view class="switch-row type-switch-row">
- <view class="switch-pill" :class="{ active: qualificationType === 'personal' }" @tap="qualificationType = 'personal'">涓汉</view>
- <view class="switch-pill" :class="{ active: qualificationType === 'company' }" @tap="qualificationType = 'company'">浼佷笟</view>
+ <view class="switch-pill" :class="{ active: form.companyType ===0 }" @tap="form.companyType =0">涓汉</view>
+ <view class="switch-pill" :class="{ active: form.companyType ===1}" @tap="form.companyType =1">浼佷笟</view>
</view>
</view>
- <template v-if="qualificationType === 'personal'">
+ <template v-if="form.companyType ===0">
<view class="form-group compact-group">
<view class="label-row"><text class="label">鏀粯瀹濊处鍙�</text><text class="required">*</text></view>
- <input class="text-input" :value="previewMode === 'filled' ? '18155114565@alipay.com' : ''" placeholder="璇疯緭鍏ヤ釜浜烘敮浠樺疂璐﹀彿" placeholder-class="placeholder" />
+ <input class="text-input" v-model="form.aliAccount" placeholder="璇疯緭鍏ヤ釜浜烘敮浠樺疂璐﹀彿" placeholder-class="placeholder" />
+ </view>
+ <view class="divider"></view>
+
+ <view class="form-group compact-group">
+ <view class="label-row"><text class="label">鏀粯瀹濆鍚�</text><text class="required">*</text></view>
+ <input class="text-input" v-model="form.aliName" placeholder="璇疯緭鍏ユ敮浠樺疂濮撳悕" placeholder-class="placeholder" />
</view>
<view class="divider"></view>
@@ -135,13 +151,15 @@
<view class="label-row"><text class="label">韬唤璇佹鍙嶉潰</text><text class="required">*</text></view>
</view>
<view class="upload-grid double-upload-grid">
- <view class="upload-box id-upload-box">
- <image class="camera-icon" src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
- <text class="upload-text">涓婁紶浜哄儚闈�</text>
+ <view class="upload-box id-upload-box" @click="chooseIdCardFront">
+ <image v-if="!form.idcardImg" class="camera-icon" src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
+ <image v-else class="preview-image" :src="idcardImgUrl" mode="aspectFill"></image>
+ <text v-if="!form.idcardImg" class="upload-text">涓婁紶浜哄儚闈�</text>
</view>
- <view class="upload-box id-upload-box">
- <image class="camera-icon" src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
- <text class="upload-text">涓婁紶鍥藉窘闈�</text>
+ <view class="upload-box id-upload-box" @click="chooseIdCardBack">
+ <image v-if="!form.idcardImgBack" class="camera-icon" src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
+ <image v-else class="preview-image" :src="idcardImgBackUrl" mode="aspectFill"></image>
+ <text v-if="!form.idcardImgBack" class="upload-text">涓婁紶鍥藉窘闈�</text>
</view>
</view>
</view>
@@ -152,15 +170,13 @@
<text class="upload-tip">鏈�澶氫笂浼�3寮犵収鐗�</text>
</view>
<view class="upload-grid">
- <view class="upload-box">
+ <view class="upload-box" @click="chooseLaborContractImage">
<image class="upload-icon" src="/static/image/btn_upload@2x.png" mode="widthFix"></image>
</view>
- <template v-if="previewMode === 'filled'">
- <view v-for="n in 3" :key="n" class="image-box">
- <image class="preview-image" src="" mode="aspectFill"></image>
- <text class="image-mark">鍒犳帀</text>
- </view>
- </template>
+ <view v-for="(item, index) in uploadedLaborContractImages" :key="index" class="image-box" @click="deleteLaborContractImage(index)">
+ <image class="preview-image" :src="item.url" mode="aspectFill"></image>
+ <text class="image-mark">鍒犳帀</text>
+ </view>
</view>
</view>
@@ -170,15 +186,13 @@
<text class="upload-tip">鏈�澶氫笂浼�3寮犵収鐗�</text>
</view>
<view class="upload-grid">
- <view class="upload-box">
+ <view class="upload-box" @click="chooseSocialSecurityImage">
<image class="upload-icon" src="/static/image/btn_upload@2x.png" mode="widthFix"></image>
</view>
- <template v-if="previewMode === 'filled'">
- <view class="image-box">
- <image class="preview-image" src="" mode="aspectFill"></image>
- <text class="image-mark">鍒犳帀</text>
- </view>
- </template>
+ <view v-for="(item, index) in uploadedSocialSecurityImages" :key="index" class="image-box" @click="deleteSocialSecurityImage(index)">
+ <image class="preview-image" :src="item.url" mode="aspectFill"></image>
+ <text class="image-mark">鍒犳帀</text>
+ </view>
</view>
</view>
</template>
@@ -186,19 +200,29 @@
<template v-else>
<view class="form-group compact-group">
<view class="label-row"><text class="label">娉曚汉濮撳悕</text><text class="required">*</text></view>
- <input class="text-input" :value="previewMode === 'filled' ? '寮犲厜瀹�' : ''" placeholder="璇疯緭鍏ユ硶浜哄鍚�" placeholder-class="placeholder" />
+ <input class="text-input" v-model="form.legalPersonName" placeholder="璇疯緭鍏ユ硶浜哄鍚�" placeholder-style="color: #c1c7d0;" />
+ </view>
+ <view class="divider"></view>
+ <view class="form-group compact-group">
+ <view class="label-row"><text class="label">娉曚汉鎵嬫満鍙�</text><text class="required">*</text></view>
+ <input class="text-input" v-model="form.legalPersonPhone" placeholder="璇疯緭鍏ユ硶浜哄鍚�" placeholder-style="color: #c1c7d0;" />
+ </view>
+ <view class="divider"></view>
+ <view class="form-group compact-group">
+ <view class="label-row"><text class="label">浼佷笟鏀粯瀹濊处鍙�</text><text class="required">*</text></view>
+ <input class="text-input" v-model="form.aliAccount" placeholder="璇疯緭鍏ヤ紒涓氭敮浠樺疂璐﹀彿" placeholder-style="color: #c1c7d0;" />
</view>
<view class="divider"></view>
<view class="form-group compact-group">
- <view class="label-row"><text class="label">浼佷笟鏀粯瀹濊处鍙�</text><text class="required">*</text></view>
- <input class="text-input" :value="previewMode === 'filled' ? 'company@alipay.com' : ''" placeholder="璇疯緭鍏ヤ紒涓氭敮浠樺疂璐﹀彿" placeholder-class="placeholder" />
+ <view class="label-row"><text class="label">鏀粯瀹濆鍚�</text><text class="required">*</text></view>
+ <input class="text-input" v-model="form.aliName" placeholder="璇疯緭鍏ユ敮浠樺疂濮撳悕" placeholder-style="color: #c1c7d0;" />
</view>
<view class="divider"></view>
<view class="form-group compact-group">
<view class="label-row"><text class="label">娉曚汉韬唤璇佸彿</text><text class="required">*</text></view>
- <input class="text-input" :value="previewMode === 'filled' ? '340198273482934298' : ''" placeholder="璇疯緭鍏ユ硶浜鸿韩浠借瘉鍙风爜" placeholder-class="placeholder" />
+ <input class="text-input" v-model="form.legalPersonCard" placeholder="璇疯緭鍏ユ硶浜鸿韩浠借瘉鍙风爜" placeholder-style="color: #c1c7d0;" />
</view>
<view class="divider"></view>
@@ -207,13 +231,15 @@
<view class="label-row"><text class="label">娉曚汉韬唤璇佹鍙嶉潰</text><text class="required">*</text></view>
</view>
<view class="upload-grid double-upload-grid">
- <view class="upload-box id-upload-box">
- <image class="camera-icon" src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
- <text class="upload-text">涓婁紶浜哄儚闈�</text>
+ <view class="upload-box id-upload-box" @click="chooseLegalPersonCardFront">
+ <image v-if="!form.legalPersonCardFront" class="camera-icon" src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
+ <image v-else class="preview-image" :src=" legalPersonCardFrontUrl" mode="aspectFill"></image>
+ <text v-if="!form.legalPersonCardFront" class="upload-text">涓婁紶浜哄儚闈�</text>
</view>
- <view class="upload-box id-upload-box">
- <image class="camera-icon" src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
- <text class="upload-text">涓婁紶鍥藉窘闈�</text>
+ <view class="upload-box id-upload-box" @click="chooseLegalPersonCardBack">
+ <image v-if="!form.legalPersonCardBack" class="camera-icon" src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
+ <image v-else class="preview-image" :src="legalPersonCardBackUrl" mode="aspectFill"></image>
+ <text v-if="!form.legalPersonCardBack" class="upload-text">涓婁紶鍥藉窘闈�</text>
</view>
</view>
</view>
@@ -223,34 +249,734 @@
<view class="label-row"><text class="label">钀ヤ笟鎵х収</text><text class="required">*</text></view>
</view>
<view class="upload-grid">
- <view class="upload-box license-upload-box">
- <image class="camera-icon" src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
- <text class="upload-text">鐐瑰嚮涓婁紶</text>
+ <view class="upload-box license-upload-box" @click="chooseBusinessImage">
+ <image v-if="!form.businessImg" class="camera-icon" src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
+ <image v-else class="preview-image" :src="businessImgUrl" mode="aspectFill"></image>
+ <text v-if="!form.businessImg" class="upload-text">鐐瑰嚮涓婁紶</text>
</view>
</view>
</view>
</template>
+ <view class="agreement-row">
+ <image class="agree-icon" :src="agreed ? '/static/icon/ic_accept_sel@2x.png' : '/static/icon/ic_accept@2x.png'" mode="aspectFit" @tap="agreed = !agreed"></image>
+ <view class="agreement-text-wrap">
+ <text class="agreement-text">鎴戝凡闃呰骞跺悓鎰�</text>
+ <text class="agreement-link" @click="goToService(5)">銆婇闄╂壙璇恒��</text>
+ <text class="agreement-text">銆�</text>
+ <text class="agreement-link" @click="goToService(6)">銆婅鏉庡瘎瀛橀』鐭ャ��</text>
+ <text class="agreement-text">鍙�</text>
+ <text class="agreement-link" @click="goToService(7)">銆婁唬鐞嗙偣鍚堜綔鍗忚銆�</text>
+ </view>
+ </view>
</view>
<view class="bottom-btn-wrap">
<template v-if="currentStep === 1">
- <view class="next-btn">涓嬩竴姝�</view>
+ <view class="next-btn" @click="goToStep2">涓嬩竴姝�</view>
</template>
<template v-else>
- <view class="footer-btn footer-plain-btn">涓婁竴姝�</view>
- <view class="footer-btn footer-primary-btn">鎻愪氦鍏ラ┗鐢宠</view>
+ <view class="footer-btn footer-plain-btn" @click="currentStep = 1">涓婁竴姝�</view>
+ <view class="footer-btn footer-primary-btn" @click="submitApply">鎻愪氦鍏ラ┗鐢宠</view>
</template>
</view>
</view>
</template>
<script>
+ import { mapState } from 'vuex'
export default {
+ computed: {
+ ...mapState(['userInfo']),
+ fullAreaName() {
+ const arr = [this.form.provinceName, this.form.cityName, this.form.areaName].filter(Boolean)
+ return arr.join('/')
+ }
+ },
data() {
return {
+ agreed:false,
+ form: {
+ telephone: '',
+ companyType: 0,
+ name: '',
+ provinceName: '',
+ cityName: '',
+ areaName: '',
+ areaId: '',
+ longitude: '',
+ latitude: '',
+ address: '',
+ linkName: '',
+ linkPhone: '',
+ idcard: '',
+ storeFrontImgs: [],
+ storeInteriorImgs: [],
+ otherMaterialImgs: [],
+ idcardImg: '',
+ idcardImgBack: '',
+ laborContractImgs: [],
+ socialSecurityImgs: [],
+ legalPersonCard: '',
+ legalPersonCardFront: '',
+ legalPersonCardBack: '',
+ legalPersonName: '',
+ legalPersonPhone: '',
+ aliAccount: '',
+ aliName: '',
+ businessImg: ''
+ },
+ businessImgUrl:'',
+ idcardImgUrl: '',
+ idcardImgBackUrl: '',
+ legalPersonCardFrontUrl: '',
+ legalPersonCardBackUrl: '',
previewMode: 'filled',
- currentStep: 2,
- qualificationType: 'company'
+ imgPrefix: '',
+ currentStep: 1,
+ showAreaPicker: false,
+ areaList: [],
+ areaColumns: [],
+ uploadedImagesStoreFront: [],
+ uploadedImagesIdCard: [],
+ uploadedImagesBusiness: [],
+ uploadedImagesPermit: [],
+ uploadedLaborContractImages: [],
+ uploadedSocialSecurityImages: [],
+ storeFrontImages: [],
+ idCardImages: [],
+ permitImages: [],
+ laborContractImages: [],
+ socialSecurityImages: []
+ }
+ },
+ onLoad() {
+ this.form.telephone = this.userInfo.telephone || ''
+ this.getAreaList()
+ this.getMyShopData()
+ },
+ methods: {
+ goToStep2() {
+ if (!this.form.name) {
+ uni.showToast({ title: '璇疯緭鍏ラ棬搴楀悕绉�', icon: 'none' })
+ return
+ }
+ if (!this.form.areaId) {
+ uni.showToast({ title: '璇烽�夋嫨鎵�鍦ㄥ煄甯�', icon: 'none' })
+ return
+ }
+ if (!this.form.address) {
+ uni.showToast({ title: '璇烽�夋嫨闂ㄥ簵鍦板潃', icon: 'none' })
+ return
+ }
+ if (!this.form.linkName) {
+ uni.showToast({ title: '璇疯緭鍏ヨ仈绯讳汉', icon: 'none' })
+ return
+ }
+ if (!this.form.linkPhone) {
+ uni.showToast({ title: '璇疯緭鍏ヨ仈绯讳汉鐢佃瘽', icon: 'none' })
+ return
+ }
+ if (!this.form.idcard) {
+ uni.showToast({ title: '璇疯緭鍏ヨ仈绯讳汉韬唤璇佸彿', icon: 'none' })
+ return
+ }
+ if (!this.form.storeFrontImgs || this.form.storeFrontImgs.length === 0) {
+ uni.showToast({ title: '璇蜂笂浼犻棬搴楅棬澶寸収鐗�', icon: 'none' })
+ return
+ }
+ if (!this.form.storeInteriorImgs || this.form.storeInteriorImgs.length === 0) {
+ uni.showToast({ title: '璇蜂笂浼犻棬搴楀唴閮ㄦ嫑鐗�', icon: 'none' })
+ return
+ }
+ this.currentStep = 2
+ },
+ goToService(type) {
+ uni.navigateTo({
+ url: '/pages/rich-text/rich-text?type='+type
+ })
+ },
+ async submitApply() {
+ if (this.form.companyType === 0) {
+ if (!this.form.idcardImg) {
+ uni.showToast({ title: '璇蜂笂浼犺韩浠借瘉浜哄儚闈�', icon: 'none' })
+ return
+ }
+ if (!this.form.idcardImgBack) {
+ uni.showToast({ title: '璇蜂笂浼犺韩浠借瘉鍥藉窘闈�', icon: 'none' })
+ return
+ }
+ if (!this.form.aliAccount) {
+ uni.showToast({ title: '璇疯緭鍏ヤ釜浜烘敮浠樺疂璐﹀彿', icon: 'none' })
+ return
+ }
+ if (!this.form.aliName) {
+ uni.showToast({ title: '璇疯緭鍏ユ敮浠樺疂濮撳悕', icon: 'none' })
+ return
+ }
+ if (!this.form.laborContractImgs || this.form.laborContractImgs.length === 0) {
+ uni.showToast({ title: '璇蜂笂浼犲姵鍔ㄥ悎鍚�', icon: 'none' })
+ return
+ }
+ if (!this.form.socialSecurityImgs || this.form.socialSecurityImgs.length === 0) {
+ uni.showToast({ title: '璇蜂笂浼犵ぞ淇濈即绾宠瘉鏄�', icon: 'none' })
+ return
+ }
+ } else {
+ if (!this.form.legalPersonName) {
+ uni.showToast({ title: '璇疯緭鍏ユ硶浜哄鍚�', icon: 'none' })
+ return
+ }
+ if (!this.form.legalPersonPhone) {
+ uni.showToast({ title: '璇疯緭鍏ユ硶浜烘墜鏈哄彿', icon: 'none' })
+ return
+ }
+ if (!this.form.aliAccount) {
+ uni.showToast({ title: '璇疯緭鍏ヤ紒涓氭敮浠樺疂璐﹀彿', icon: 'none' })
+ return
+ }
+ if (!this.form.aliName) {
+ uni.showToast({ title: '璇疯緭鍏ユ敮浠樺疂濮撳悕', icon: 'none' })
+ return
+ }
+ if (!this.form.legalPersonCard) {
+ uni.showToast({ title: '璇疯緭鍏ユ硶浜鸿韩浠借瘉鍙�', icon: 'none' })
+ return
+ }
+ if (!this.form.legalPersonCardFront) {
+ uni.showToast({ title: '璇蜂笂浼犳硶浜鸿韩浠借瘉浜哄儚闈�', icon: 'none' })
+ return
+ }
+ if (!this.form.legalPersonCardBack) {
+ uni.showToast({ title: '璇蜂笂浼犳硶浜鸿韩浠借瘉鍥藉窘闈�', icon: 'none' })
+ return
+ }
+ if (!this.form.businessImg) {
+ uni.showToast({ title: '璇蜂笂浼犺惀涓氭墽鐓�', icon: 'none' })
+ return
+ }
+ this.form.idcardImgBack = this.form.legalPersonCardBack
+ this.form.idcardImg = this.form.legalPersonCardFront
+ }
+ if (!this.agreed) {
+ uni.showToast({ title: '璇峰厛闃呰骞跺悓鎰忓崗璁�', icon: 'none' })
+ return
+ }
+ uni.showLoading({ title: '鎻愪氦涓�...', mask: true })
+ try {
+ const res = await this.$u.api.applyShop(this.form)
+ uni.hideLoading()
+ if (res.code === 200) {
+ uni.showToast({ title: '鎻愪氦鎴愬姛', icon: 'success' })
+ setTimeout(() => {
+ uni.navigateBack()
+ }, 1500)
+ }else {
+ uni.showToast({ title: res.msg || '鎻愪氦澶辫触', icon: 'none' })
+ }
+ } catch (error) {
+ uni.hideLoading()
+ uni.showToast({ title: '鎻愪氦澶辫触', icon: 'none' })
+ }
+ },
+ async getMyShopData() {
+ try {
+ const res = await this.$u.api.getMyShop()
+ if (res.code === 200 && res.data) {
+ const data = res.data
+ const imgPrefix = data.imgPrefix || ''
+ this.imgPrefix = data.imgPrefix || ''
+ this.form.name = data.name || ''
+ this.form.provinceName = data.provinceName || ''
+ this.form.cityName = data.cityName || ''
+ this.form.areaName = data.areaName || ''
+ this.form.areaId = data.areaId || ''
+ this.form.address = data.address || ''
+ this.form.longitude = data.longitude || ''
+ this.form.latitude = data.latitude || ''
+ this.form.linkName = data.linkName || ''
+ this.form.linkPhone = data.linkPhone || ''
+ this.form.idcard = data.idcard || ''
+ this.form.aliAccount = data.aliAccount || ''
+ this.form.aliName = data.aliName || ''
+ this.form.companyType = data.companyType || 0
+ this.form.telephone = data.telephone || this.userInfo.telephone || ''
+ this.form.legalPersonName = data.legalPersonName || ''
+ this.form.legalPersonPhone = data.legalPersonPhone || ''
+ this.businessImgUrl=data.businessImgUrl||''
+ this.idcardImgUrl=data.idcardImgUrl||''
+ this.idcardImgBackUrl=data.idcardImgBackUrl||''
+ this.legalPersonCardFrontUrl=data.idcardImgUrl||''
+ this.legalPersonCardBackUrl=data.idcardImgBackUrl||''
+ this.qualificationType = data.companyType === 0 ? 'personal' : 'company'
+ if (data.storeFrontImgs) {
+ this.storeFrontImages = data.storeFrontImgUrls
+ this.uploadedImagesStoreFront = data.storeFrontImgUrls.map(url => ({ url }))
+ this.form.storeFrontImgs = data.storeFrontImgs
+ }
+ if (data.storeInteriorImgs) {
+ this.idCardImages = data.storeInteriorImgUrls
+ this.uploadedImagesIdCard = data.storeInteriorImgUrls.map(url => ({ url }))
+ this.form.storeInteriorImgs = data.storeInteriorImgs
+ }
+ if (data.otherMaterialImgs) {
+ this.permitImages = data.otherMaterialImgUrls
+ this.uploadedImagesPermit = data.otherMaterialImgUrls.map(url => ({ url }))
+ this.form.otherMaterialImgs = data.otherMaterialImgs
+ }
+ this.form.idcardImg = data.idcardImg || ''
+ this.form.idcardImgBack = data.idcardImgBack || ''
+ if (data.laborContractImgs) {
+ this.laborContractImages = data.laborContractImgUrls
+ this.uploadedLaborContractImages = data.laborContractImgUrls.map(url => ({ url }))
+ this.form.laborContractImgs = data.laborContractImgs
+ }
+ if (data.socialSecurityImgs) {
+ this.socialSecurityImages = data.socialSecurityImgUrls
+ this.uploadedSocialSecurityImages = data.socialSecurityImgUrls.map(url => ({ url }))
+ this.form.socialSecurityImgs = data.socialSecurityImgs
+ }
+ this.form.legalPersonCard = data.legalPersonCard || ''
+ this.form.legalPersonCardBack = data.legalPersonCardBack || ''
+ this.form.businessImg = data.businessImg || ''
+ }
+ } catch (error) {
+ console.log('鑾峰彇搴楅摵淇℃伅澶辫触', error)
+ }
+ },
+ getAreaList() {
+ this.$u.api.treeList({
+ type: 0,
+ flag: 1
+ }).then(res => {
+ if (res.code === 200) {
+ this.areaList = res.data
+ this.areaColumns[0] = this.areaList.map(item => {
+ return {
+ id: item.id,
+ text: item.name
+ }
+ })
+ this.areaColumns[1] = this.areaList[0].childList.map(item => {
+ return {
+ id: item.id,
+ text: item.name
+ }
+ })
+ this.areaColumns[2] = this.areaList[0].childList[0].childList.map(item => {
+ return {
+ id: item.id,
+ text: item.name
+ }
+ })
+ }
+ })
+ },
+ confirmArea(e) {
+ this.form.areaId = e.value[e.value.length - 1].id
+ this.form.areaName = e.value[0].text + '/' + e.value[1].text + '/' + e.value[2].text
+ this.showAreaPicker = false
+ },
+ chooseAddress() {
+ uni.chooseLocation({
+ success: (res) => {
+ this.form.address = res.address
+ this.form.longitude = res.longitude
+ this.form.latitude = res.latitude
+ }
+ })
+ },
+ changeAreaHandler(e) {
+ const { columnIndex, indexs, picker = this.$refs.uPicker } = e
+ if (columnIndex === 0) {
+ let city = this.areaList[indexs[0]].childList.map(item => {
+ return {
+ id: item.id,
+ text: item.name
+ }
+ })
+ let qu = this.areaList[indexs[0]].childList[0].childList.map(item => {
+ return {
+ id: item.id,
+ text: item.name
+ }
+ })
+ picker.setColumnValues(1, city)
+ picker.setColumnValues(2, qu)
+ } else if (columnIndex === 1) {
+ let qu = this.areaList[indexs[0]].childList[indexs[1]].childList.map(item => {
+ return {
+ id: item.id,
+ text: item.name
+ }
+ })
+ picker.setColumnValues(2, qu)
+ }
+ },
+ async uploadFiles(filePaths, maxCount = 9) {
+ if (!filePaths || filePaths.length === 0) {
+ return []
+ }
+ const limitedPaths = filePaths.slice(0, maxCount)
+ const uploadTasks = limitedPaths.map(filePath => {
+ return new Promise((resolve, reject) => {
+ uni.uploadFile({
+ url: this.$baseUrl + '/web/public/upload',
+ filePath: filePath,
+ name: 'file',
+ formData: {
+ folder: 'shop'
+ },
+ success: (res) => {
+ if (res.statusCode === 200) {
+ const data = JSON.parse(res.data)
+ if (data.code === 200) {
+ resolve(data.data)
+ } else {
+ reject(new Error(data.msg || '涓婁紶澶辫触'))
+ }
+ } else {
+ reject(new Error('涓婁紶澶辫触'))
+ }
+ },
+ fail: (err) => {
+ reject(err)
+ }
+ })
+ })
+ })
+ try {
+ const results = await Promise.all(uploadTasks)
+ return results
+ } catch (error) {
+ uni.showToast({
+ title: '涓婁紶澶辫触',
+ icon: 'none'
+ })
+ throw error
+ }
+ },
+ deleteStoreFrontImage(index) {
+ this.uploadedImagesStoreFront.splice(index, 1)
+ this.storeFrontImages.splice(index, 1)
+ this.form.storeFrontImgs = this.storeFrontImages.map(url => this.getShortPath(url))
+ },
+ async chooseStoreFrontImage() {
+ const maxCount = 3
+ const currentCount = this.storeFrontImages.length
+ const remainingCount = maxCount - currentCount
+ if (remainingCount <= 0) {
+ uni.showToast({
+ title: `鏈�澶氫笂浼�${maxCount}寮犲浘鐗嘸,
+ icon: 'none'
+ })
+ return
+ }
+ uni.chooseImage({
+ count: remainingCount,
+ sizeType: ['compressed'],
+ sourceType: ['album', 'camera'],
+ success: async (res) => {
+ const tempFilePaths = res.tempFilePaths
+ uni.showLoading({
+ title: '涓婁紶涓�...',
+ mask: true
+ })
+ try {
+ const uploadResults = await this.uploadFiles(tempFilePaths, maxCount)
+ const fullPaths = uploadResults.map(item => item.url || item.path || item)
+ this.uploadedImagesStoreFront = [...this.uploadedImagesStoreFront, ...fullPaths.map(url => ({ url }))]
+ this.storeFrontImages = [...this.storeFrontImages, ...fullPaths]
+ this.form.storeFrontImgs= [...this.form.storeFrontImgs, ...uploadResults.map(item => item.imgaddr)]
+ uni.hideLoading()
+ uni.showToast({
+ title: '涓婁紶鎴愬姛',
+ icon: 'success'
+ })
+ } catch (error) {
+ uni.hideLoading()
+ }
+ }
+ })
+ },
+ deleteIdCardImage(index) {
+ this.uploadedImagesIdCard.splice(index, 1)
+ this.idCardImages.splice(index, 1)
+ this.form.storeInteriorImgs = this.idCardImages.map(url => this.getShortPath(url))
+ },
+ async chooseIdCardImage() {
+ const maxCount = 2
+ const currentCount = this.idCardImages.length
+ const remainingCount = maxCount - currentCount
+ if (remainingCount <= 0) {
+ uni.showToast({
+ title: `鏈�澶氫笂浼�${maxCount}寮犲浘鐗嘸,
+ icon: 'none'
+ })
+ return
+ }
+ uni.chooseImage({
+ count: remainingCount,
+ sizeType: ['compressed'],
+ sourceType: ['album', 'camera'],
+ success: async (res) => {
+ const tempFilePaths = res.tempFilePaths
+ uni.showLoading({
+ title: '涓婁紶涓�...',
+ mask: true
+ })
+ try {
+ const uploadResults = await this.uploadFiles(tempFilePaths, maxCount)
+ const fullPaths = uploadResults.map(item => item.url || item.path || item)
+ this.uploadedImagesIdCard = [...this.uploadedImagesIdCard, ...fullPaths.map(url => ({ url }))]
+ this.idCardImages = [...this.idCardImages, ...fullPaths]
+ this.form.storeInteriorImgs= [...this.form.storeInteriorImgs, ...uploadResults.map(item => item.imgaddr)]
+ uni.hideLoading()
+ uni.showToast({
+ title: '涓婁紶鎴愬姛',
+ icon: 'success'
+ })
+ } catch (error) {
+ uni.hideLoading()
+ }
+ }
+ })
+ },
+ deleteBusinessImage(index) {
+ this.uploadedImagesBusiness.splice(index, 1)
+ this.businessImages.splice(index, 1)
+ this.form.businessImg = this.businessImages.map(url => this.getShortPath(url)).join(',')
+ },
+ async chooseBusinessImage() {
+ uni.chooseImage({
+ count: 1,
+ sizeType: ['compressed'],
+ sourceType: ['album', 'camera'],
+ success: async (res) => {
+ const tempFilePaths = res.tempFilePaths
+ uni.showLoading({
+ title: '涓婁紶涓�...',
+ mask: true
+ })
+ try {
+ const uploadResults = await this.uploadFiles(tempFilePaths, 1)
+ this.form.businessImg = uploadResults[0].imgaddr
+ this.businessImgUrl = uploadResults[0].url
+ console.log("=======================",this.businessImgUrl)
+ uni.hideLoading()
+ uni.showToast({
+ title: '涓婁紶鎴愬姛',
+ icon: 'success'
+ })
+ } catch (error) {
+ uni.hideLoading()
+ }
+ }
+ })
+ },
+ deletePermitImage(index) {
+ this.uploadedImagesPermit.splice(index, 1)
+ this.permitImages.splice(index, 1)
+ this.form.otherMaterialImgs = this.permitImages.map(url => this.getShortPath(url))
+ },
+ async choosePermitImage() {
+ const maxCount = 3
+ const currentCount = this.permitImages.length
+ const remainingCount = maxCount - currentCount
+ if (remainingCount <= 0) {
+ uni.showToast({
+ title: `鏈�澶氫笂浼�${maxCount}寮犲浘鐗嘸,
+ icon: 'none'
+ })
+ return
+ }
+ uni.chooseImage({
+ count: remainingCount,
+ sizeType: ['compressed'],
+ sourceType: ['album', 'camera'],
+ success: async (res) => {
+ const tempFilePaths = res.tempFilePaths
+ uni.showLoading({
+ title: '涓婁紶涓�...',
+ mask: true
+ })
+ try {
+ const uploadResults = await this.uploadFiles(tempFilePaths, maxCount)
+ const fullPaths = uploadResults.map(item => item.url || item.path || item)
+ this.uploadedImagesPermit = [...this.uploadedImagesPermit, ...fullPaths.map(url => ({ url }))]
+ this.permitImages = [...this.permitImages, ...fullPaths]
+ this.form.otherMaterialImgs= [...this.form.otherMaterialImgs, ...uploadResults.map(item => item.imgaddr)]
+ uni.hideLoading()
+ uni.showToast({
+ title: '涓婁紶鎴愬姛',
+ icon: 'success'
+ })
+ } catch (error) {
+ uni.hideLoading()
+ }
+ }
+ })
+ },
+ chooseIdCardFront() {
+ uni.chooseImage({
+ count: 1,
+ sizeType: ['compressed'],
+ sourceType: ['album', 'camera'],
+ success: async (res) => {
+ const tempFilePaths = res.tempFilePaths
+ uni.showLoading({ title: '涓婁紶涓�...', mask: true })
+ try {
+ const uploadResults = await this.uploadFiles(tempFilePaths, 1)
+ this.form.idcardImg = uploadResults[0].imgaddr || uploadResults[0].path || uploadResults[0]
+ this.idcardImgUrl = uploadResults[0].url || uploadResults[0].path || uploadResults[0]
+ uni.hideLoading()
+ uni.showToast({ title: '涓婁紶鎴愬姛', icon: 'success' })
+ } catch (error) {
+ uni.hideLoading()
+ }
+ }
+ })
+ },
+ chooseIdCardBack() {
+ uni.chooseImage({
+ count: 1,
+ sizeType: ['compressed'],
+ sourceType: ['album', 'camera'],
+ success: async (res) => {
+ const tempFilePaths = res.tempFilePaths
+ uni.showLoading({ title: '涓婁紶涓�...', mask: true })
+ try {
+ const uploadResults = await this.uploadFiles(tempFilePaths, 1)
+ this.form.idcardImgBack = uploadResults[0].imgaddr || uploadResults[0].path || uploadResults[0]
+ this.idcardImgBackUrl = uploadResults[0].url || uploadResults[0].path || uploadResults[0]
+ uni.hideLoading()
+ uni.showToast({ title: '涓婁紶鎴愬姛', icon: 'success' })
+ } catch (error) {
+ uni.hideLoading()
+ }
+ }
+ })
+ },
+ chooseLegalPersonCardFront() {
+ uni.chooseImage({
+ count: 1,
+ sizeType: ['compressed'],
+ sourceType: ['album', 'camera'],
+ success: async (res) => {
+ const tempFilePaths = res.tempFilePaths
+ uni.showLoading({ title: '涓婁紶涓�...', mask: true })
+ try {
+ const uploadResults = await this.uploadFiles(tempFilePaths, 1)
+ this.form.legalPersonCardFront = uploadResults[0].imgaddr || uploadResults[0].path || uploadResults[0]
+ this.legalPersonCardFrontUrl = uploadResults[0].url || uploadResults[0].path || uploadResults[0]
+ uni.hideLoading()
+ uni.showToast({ title: '涓婁紶鎴愬姛', icon: 'success' })
+ } catch (error) {
+ uni.hideLoading()
+ }
+ }
+ })
+ },
+ chooseLegalPersonCardBack() {
+ uni.chooseImage({
+ count: 1,
+ sizeType: ['compressed'],
+ sourceType: ['album', 'camera'],
+ success: async (res) => {
+ const tempFilePaths = res.tempFilePaths
+ uni.showLoading({ title: '涓婁紶涓�...', mask: true })
+ try {
+ const uploadResults = await this.uploadFiles(tempFilePaths, 1)
+ this.form.legalPersonCardBack = uploadResults[0].imgaddr || uploadResults[0].path || uploadResults[0]
+ this.legalPersonCardBackUrl = uploadResults[0].url || uploadResults[0].path || uploadResults[0]
+ uni.hideLoading()
+ uni.showToast({ title: '涓婁紶鎴愬姛', icon: 'success' })
+ } catch (error) {
+ uni.hideLoading()
+ }
+ }
+ })
+ },
+ deleteLaborContractImage(index) {
+ this.uploadedLaborContractImages.splice(index, 1)
+ this.laborContractImages.splice(index, 1)
+ this.form.laborContractImgs = this.laborContractImages.map(url => this.getShortPath(url))
+ },
+ async chooseLaborContractImage() {
+ const maxCount = 3
+ const currentCount = this.laborContractImages.length
+ const remainingCount = maxCount - currentCount
+ if (remainingCount <= 0) {
+ uni.showToast({ title: `鏈�澶氫笂浼�${maxCount}寮犲浘鐗嘸, icon: 'none' })
+ return
+ }
+ uni.chooseImage({
+ count: remainingCount,
+ sizeType: ['compressed'],
+ sourceType: ['album', 'camera'],
+ success: async (res) => {
+ const tempFilePaths = res.tempFilePaths
+ uni.showLoading({ title: '涓婁紶涓�...', mask: true })
+ try {
+ const uploadResults = await this.uploadFiles(tempFilePaths, maxCount)
+ const fullPaths = uploadResults.map(item => item.url || item.path || item)
+ this.uploadedLaborContractImages = [...this.uploadedLaborContractImages, ...fullPaths.map(url => ({ url }))]
+ this.laborContractImages = [...this.laborContractImages, ...fullPaths]
+ this.form.laborContractImgs= [...this.form.laborContractImgs, ...uploadResults.map(item => item.imgaddr)]
+ uni.hideLoading()
+ uni.showToast({ title: '涓婁紶鎴愬姛', icon: 'success' })
+ } catch (error) {
+ uni.hideLoading()
+ }
+ }
+ })
+ },
+ deleteSocialSecurityImage(index) {
+ this.uploadedSocialSecurityImages.splice(index, 1)
+ this.socialSecurityImages.splice(index, 1)
+ this.form.socialSecurityImgs = this.socialSecurityImages.map(url => this.getShortPath(url))
+ },
+ getShortPath(url) {
+ if (!url) return ''
+ if (url.startsWith('http')) {
+ return url.replace(this.imgPrefix, '')
+ }
+ return url
+ },
+ getFullPath(url) {
+ if (!url) return ''
+ if (url.startsWith('http')) {
+ return url
+ }
+ return (this.$baseUrl || '') + url
+ },
+ async chooseSocialSecurityImage() {
+ const maxCount = 3
+ const currentCount = this.socialSecurityImages.length
+ const remainingCount = maxCount - currentCount
+ if (remainingCount <= 0) {
+ uni.showToast({ title: `鏈�澶氫笂浼�${maxCount}寮犲浘鐗嘸, icon: 'none' })
+ return
+ }
+ uni.chooseImage({
+ count: remainingCount,
+ sizeType: ['compressed'],
+ sourceType: ['album', 'camera'],
+ success: async (res) => {
+ const tempFilePaths = res.tempFilePaths
+ uni.showLoading({ title: '涓婁紶涓�...', mask: true })
+ try {
+ const uploadResults = await this.uploadFiles(tempFilePaths, maxCount)
+ const fullPaths = uploadResults.map(item => item.url || item.path || item)
+ this.uploadedSocialSecurityImages = [...this.uploadedSocialSecurityImages, ...fullPaths.map(url => ({ url }))]
+ this.socialSecurityImages = [...this.socialSecurityImages, ...fullPaths]
+ this.form.socialSecurityImgs= [...this.form.socialSecurityImgs, ...uploadResults.map(item => item.imgaddr)]
+ uni.hideLoading()
+ uni.showToast({ title: '涓婁紶鎴愬姛', icon: 'success' })
+ } catch (error) {
+ uni.hideLoading()
+ }
+ }
+ })
}
}
}
@@ -588,7 +1314,33 @@
color: #666666;
margin-top: 12rpx;
}
+.agreement-row {
+ margin-top: 60rpx;
+ display: flex;
+ align-items: flex-start;
+ }
+ .agree-icon {
+ width: 34rpx;
+ height: 34rpx;
+ margin-top: 4rpx;
+ flex-shrink: 0;
+ }
+
+ .agreement-text-wrap {
+ margin-left: 14rpx;
+ flex: 1;
+ font-size: 24rpx;
+ line-height: 1.8;
+ }
+
+ .agreement-text {
+ color: #555555;
+ }
+
+ .agreement-link {
+ color: #2E68C4;
+ }
.preview-image {
width: 100%;
height: 100%;
@@ -600,12 +1352,12 @@
left: 0;
right: 0;
bottom: 0;
- height: 24rpx;
- line-height: 24rpx;
+ height: 40rpx;
+ line-height: 40rpx;
text-align: center;
- font-size: 16rpx;
+ font-size: 24rpx;
color: #ffffff;
- background: rgba(0, 0, 0, 0.4);
+ background: rgba(0,0,0,0.5);
}
.bottom-btn-wrap {
--
Gitblit v1.9.3