shop_uniapp/bundle_b/pages/local_settled/index.vue
2024-06-28 17:49:40 +08:00

715 lines
21 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="store-settled" :style="{'backgroundColor': bgColor}">
<view class="content login" v-if="!isLogin">
<router-link to="/pages/login/login">
<view class="white br60 flex row-center btn">
<image class="mr10" src="https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/icon_wechat.png"></image>
<text>去登录</text>
</view>
</router-link>
</view>
<view v-else class="content">
<view class="apply-form bg-white" v-if="storeState == 0">
<view class="text-center wait-pass">
<view>
<u-icon name="hourglass" color="#b7b7b7" size="92"></u-icon>
</view>
<view>
已提交,待审核
</view>
</view>
</view>
<view v-else-if="storeState == 1" >
<view class="text-center pass">
<view>
<u-icon name="checkmark-circle" color="#1BA035" size="92"></u-icon>
</view>
<view>
审核通过
</view>
</view>
</view>
<view v-else-if="storeState == -1 || storeState == 2" class="apply-form bg-white">
<view v-if="storeState == 2" class="bold text-center no-pass">
审核失败,请重新提交
</view>
<view class="bold lg apply-form-info">
商户信息
</view>
<!-- 地区号 -->
<!-- <view class="apply-form-item">
<u-field label="地区号" v-model="form.rgiNo" label-width="160" placeholder="请输入地区号" required />
</view> -->
<!-- 管辖网点号 -->
<!-- <view class="apply-form-item">
<u-field label="管辖网点号" v-model="form.dominationBankNo" label-width="160" placeholder="请输入管辖网点号" required />
</view> -->
<!-- 营业执照 -->
<view class="apply-form-item">
<u-field label="营业执照" label-width="160" placeholder="请上传营业执照" :border-bottom="false"
required disabled />
<view class="apply-form-upload" @click="uploadImage" v-if="form.businessLicense">
<image :src="form.businessLicense" mode="aspectFit"></image>
</view>
<view class="apply-form-upload" @click="uploadImage" v-else>
<u-icon name="plus" color="#e2e2e2" size="48" top="28"></u-icon>
</view>
</view>
<!-- 商户证件类型 -->
<!-- <view class="apply-form-item" @tap="showCrftType1=true">
<u-field label="商户证件类型" v-model="crftType1Label" label-width="160" style="flex: 1;" placeholder="请选择商户证件类型"
required disabled>
<u-icon name="arrow-right" slot="right" size="28" />
</u-field>
</view> -->
<!-- 证件号码 -->
<!-- <view class="apply-form-item">
<u-field label="证件号码" v-model="form.crftNo1" label-width="160" placeholder="请输入证件号码" required />
</view> -->
<view class="apply-form-item">
<u-field label="信用代码" v-model="form.crftNo1" label-width="160" placeholder="请输入统一社会信用代码" required />
</view>
<!-- 法人/负责人名称 -->
<!-- <view class="apply-form-item">
<u-field label="法人名称" v-model="form.crftName2" label-width="160" placeholder="请输入法人/负责人名称" required />
</view> -->
<view class="apply-form-item">
<u-field label="手持身份证" label-width="160" placeholder="请上传手持身份证" :border-bottom="false"
required disabled />
<view class="apply-form-upload" @click="uploadHandCard" v-if="form.idCard">
<image :src="form.idCard" mode="aspectFit"></image>
</view>
<view class="apply-form-upload" @click="uploadHandCard" v-else>
<u-icon name="plus" color="#e2e2e2" size="48" top="28"></u-icon>
</view>
</view>
<!-- 法人/负责人证件类型 -->
<!-- <view class="apply-form-item" @tap="showCrftType2=true">
<u-field label="法人证件类型" v-model="crftType2Label" label-width="160" style="flex: 1;" placeholder="请选择法人/负责人证件类型"
required disabled>
<u-icon name="arrow-right" slot="right" size="28" />
</u-field>
</view> -->
<!-- 法人/负责人证件号 -->
<!-- <view class="apply-form-item">
<u-field label="法人证件号" v-model="form.crftNo2" label-width="160" placeholder="请输入法人/负责人证件号码" required />
</view> -->
<!-- 商户地址 -->
<!-- view class="apply-form-item">
<u-field label="商户地址" v-model="form.lidaddr" label-width="160" placeholder="请输入商户地址(营业执照地址)" required />
</view> -->
<!-- 商户中文名称 -->
<!-- <view class="apply-form-item">
<u-field label="商户中文名称" v-model="form.chnsName" label-width="160" placeholder="请输入特约商户中文名称" required />
</view> -->
<!-- 商户英文名称 -->
<!-- <view class="apply-form-item">
<u-field label="商户英文名称" v-model="form.englName" label-width="160" placeholder="请输入特约商户英文名称" required />
</view>
-->
<!-- 门店名称/商户简称 -->
<!-- <view class="apply-form-item">
<u-field label="门店名称/商户简称" v-model="form.shortName" label-width="160" placeholder="请输入门店名称/商户简称" required />
</view> -->
<!-- 邮政编码(实际营业地址) -->
<!-- <view class="apply-form-item">
<u-field label="邮政编码" v-model="form.postCode" label-width="160" placeholder="请输入邮政编码(实际营业地址)" required />
</view> -->
<!-- 商户联系人 -->
<view class="apply-form-item">
<u-field label="商户联系人" v-model="form.name" label-width="160" placeholder="请输入商户联系人" required />
</view>
<!-- 联系电话 -->
<view class="apply-form-item">
<u-field label="联系电话" v-model="form.empowerPhone" label-width="160" placeholder="请输入联系电话" required />
</view>
<!-- 关联企业网银 -->
<!-- <view class="apply-form-item custom-apply-form-block">
<view class="custom-apply-form-item flex">
<view class="required">*</view>
<view class="info-text">关联企业网银</view>
</view>
<view>
<u-radio-group class="custom-apply-form-radio" v-model="ebankConFlagValue">
<u-radio @change="choseEbankConFlag" :name="1" :active-color="colorConfig.primary">是</u-radio>
<u-radio @change="choseEbankConFlag" :name="2" :active-color="colorConfig.primary">否</u-radio>
</u-radio-group>
</view>
</view> -->
<!--开通商户之家 -->
<!-- view class="apply-form-item custom-apply-form-block">
<view class="custom-apply-form-item flex">
<view class="required">*</view>
<view class="info-text">开通商户之家</view>
</view>
<view>
<u-radio-group class="custom-apply-form-radio" v-model="shopHomeConFlagValue">
<u-radio @change="choseShopHomeConFlag" :name="1" :active-color="colorConfig.primary">是</u-radio>
<u-radio @change="choseShopHomeConFlag" :name="2" :active-color="colorConfig.primary">否</u-radio>
</u-radio-group>
</view>
</view> -->
<!-- 开通商户之家管理员 -->
<!-- <view class="apply-form-item custom-apply-form-block">
<view class="custom-apply-form-item flex">
<view class="required">*</view>
<view class="info-text">商户之家管理员</view>
</view>
<view>
<u-radio-group class="custom-apply-form-radio" v-model="mcssAdminFlagValue">
<u-radio @change="choseMcssAdminFlag" :name="1" :active-color="colorConfig.primary">是</u-radio>
<u-radio @change="choseMcssAdminFlag" :name="2" :active-color="colorConfig.primary">否</u-radio>
</u-radio-group>
</view>
</view> -->
<!-- 可以受理信用卡 -->
<!-- <view class="apply-form-item custom-apply-form-block">
<view class="custom-apply-form-item flex">
<view class="required">*</view>
<view class="info-text">受理信用卡</view>
</view>
<view>
<u-radio-group class="custom-apply-form-radio" v-model="creditSwitchValue">
<u-radio @change="choseCreditSwitch" :name="1" :active-color="colorConfig.primary">是</u-radio>
<u-radio @change="choseCreditSwitch" :name="2" :active-color="colorConfig.primary">否</u-radio>
</u-radio-group>
</view>
</view> -->
<!-- 消费结算账户类型 -->
<!-- <view class="apply-form-item" @tap="showAccntType1=true">
<u-field label="结算账户类型" v-model="accntType1Label" label-width="160" placeholder="请选结算账户类型"
required disabled>
<u-icon name="arrow-right" slot="right" size="28" />
</u-field>
</view> -->
<!-- 消费结算卡号/账户 -->
<!-- <view class="apply-form-item">
<u-field label="消费结算卡号/账户" v-model="form.accntNo1" label-width="160" placeholder="请输入消费结算卡号/账户" required />
</view> -->
<!-- 定位 -->
<view class="apply-form-item">
<u-field label="地理位置" type="textarea" label-width="160" placeholder="获取位置信息" required v-model="form.address">
<view slot="right" class="primary send-code-btn br60 flex row-center" @tap="reLocationFunc">
<view class="xs">获取位置</view>
</view>
</u-field>
</view>
<!-- 同意协议 -->
<view class="apply-form-item flex m-t-10">
<u-checkbox shape="circle" :active-color="colorConfig.primary" v-model="isAgree">
<text class="sm">已阅读并同意</text>
</u-checkbox>
<router-link :to="{path: '/bundle/pages/server_explan/server_explan', query: {type: 6}}">
<text class="primary sm">《入驻协议》</text>
</router-link>
</view>
<!-- 提交申请 -->
<view style="padding: 30rpx 20rpx 30rpx 0;">
<button type="primary" size="lg" class="br60" @tap="onSubmit">提交申请</button>
</view>
<!-- 查阅记录 -->
<!-- <router-link to="/bundle/pages/settled_recode/settled_recode">
<view class="flex row-center muted">
<u-icon name="order" size="32" />
<view class="m-l-10">查看提交记录</view>
</view>
</router-link> -->
</view>
</view>
<u-select v-model="showCrftType1" mode="single-column" value-name="id" label-name="name" :list="crftType1List"
@confirm="confirmCrftType1"></u-select>
<u-select v-model="showCrftType2" mode="single-column" value-name="id" label-name="name" :list="crftType2List"
@confirm="confirmCrftType2"></u-select>
<u-select v-model="showAccntType1" mode="single-column" value-name="id" label-name="name" :list="accntType1List"
@confirm="confirmAccntType1"></u-select>
<tabbar></tabbar>
</view>
</template>
<script>
import { mapActions, mapMutations, mapGetters } from 'vuex'
import { ossUpload } from '@/js_sdk/jason-alioss-upload/oss.js'
import {
getLocalLifeTemplateId,
getLocalStore,
addLocalStore
} from "@/api/shop"
import {
baseURL
} from '@/config/app'
import {
sendSms,
getMnpNotice
} from '@/api/app'
import {
SMSType
} from '@/utils/type'
export default {
data() {
return {
form: {
rgiNo: '',
dominationBankNo: '',
crftType1:'',
businessLicense: '',
crftNo1:'',
crftName2:'',
crftType2:'',
crftNo2:'',
lidaddr:'',
chnsName:'',
englName:'',
shortName:'',
postCode:'',
merconat:'',
mertel:'',
ebankConFlag: 2,
shopHomeConFlag: 2,
mcssAdminFlag: 2,
postCode:'',
creditSwitch: 2,
accntType1:'',
accntNo1:'',
address: '',
idCard: '',
idBack: ''
},
// 商户证件类型
showCrftType1: false,
crftType1Label:'',
// 商户证件类型列表
crftType1List:[
{id: 101, name: '营业执照(企业法人)'},
{id: 110, name: '营业执照(个体工商户)'},
{id: 0, name: '个人身份证'},
{id: 100, name: '全国组织机构代码证书'},
{id: 102, name: '行政机关'},
{id: 103, name: '社会团体法人登记证书'},
{id: 104, name: '军队单位开户核准通知书'},
{id: 105, name: '武警部队单位开户核准通知书'},
{id: 106, name: '下属机构(具有主管单位批文号)'},
{id: 107, name: '其他(法人证件类型)'},
{id: 108, name: '商业登记证'},
{id: 109, name: '公司注册证'},
],
// 法人/负责任人证件类型
showCrftType2: false,
crftType2Label:'',
crftType2List:[
{id: 0, name: '身份证'},
{id: 1, name: '护照'},
{id: 2, name: '军官证'},
{id: 3, name: '士兵证'},
{id: 4, name: '港澳台居民往来通行证'},
{id: 5, name: '临时身份证'},
{id: 6, name: '户口本'},
{id: 7, name: '其他(个人证件类型)'},
{id: 9, name: '警官证'},
{id: 12, name: '外国人居留证'},
{id: 21, name: '边民出入境通行证'},
],
// 关联企业网银 1 = 是 2 = 否
ebankConFlagValue: 2,
// 开通商户之家
shopHomeConFlagValue: 2,
// 开通商户之家管理员
mcssAdminFlagValue: 2,
// 可以受理信用卡
creditSwitchValue: 2,
// 消费结算账户类型
showAccntType1: false,
accntType1Label: '',
accntType1List:[
{id: 0, name: '往来账户'},
{id: 1, name: '个人信用卡'},
{id: 2, name: '他行结算户'},
{id: 3, name: '个人借记卡'},
{id: 4, name: '智富通卡'},
{id: 5, name: '活期户'},
{id: 6, name: '账户管家'},
{id: 7, name: '内部户'},
{id: 9, name: '安心托管账户'}
],
isAgree: false,
codeTips: '',
shopCategory: [],
action: baseURL + '/api/file/formimage',
fileList: [],
storeState: -1,
bgColor: '#FA844C',
localShop: []
}
},
onLoad() {
if (!this.isLogin) {
this.bgColor = '#ffffff';
}
this.getLocalStore()
},
methods: {
...mapActions(['initLocationFunc']),
...mapMutations(['setCityInfo']),
async getLocalStore() {
await getLocalStore().then((res) => {
if (res.data.local) {
this.localShop = res.data.local
this.storeState = res.data.local.store_state
if (this.storeState == -1 || this.storeState == 2) {
this.bgColor = '#FA844C'
} else {
this.bgColor = '#ffffff';
}
}
})
},
// 证件类型
confirmCrftType1(e) {
const {value, label} = e[0]
this.form.crftType1 = value
this.crftType1Label = label
},
// 法人/负责人身份证件类型
confirmCrftType2(e) {
const {value, label} = e[0]
this.form.crftType2 = value
this.crftType2Label = label
},
// 关联企业网银
choseEbankConFlag(e) {
this.form.ebankConFlag = e;
},
// 开通商户之家
choseShopHomeConFlag(e) {
this.form.shopHomeConFlag = e;
},
// 开通商户之家管理员
choseMcssAdminFlag(e) {
this.form.shopHomeConFlag = e;
},
// 可以受理信用卡
choseCreditSwitch(e) {
this.form.creditSwitch = e;
},
// 结算账户类型
confirmAccntType1(e) {
const {value, label} = e[0]
this.form.accntType1 = value
this.accntType1Label = label
},
// 上传营业执照
uploadImage(){
uni.chooseImage({
count: 1,
success: async (file) => {
uni.showLoading({
title: '上传中...'
})
const {success,data} = await ossUpload(file.tempFilePaths[0], file.tempFiles[0].path, 'local_life_bussines_license/')
if(success) {
this.form.businessLicense = data
uni.hideLoading()
} else {
uni.showToast({icon:'none', title: '上传失败'})
uni.hideLoading()
}
}
})
},
// 上传手持身份证
uploadHandCard() {
uni.chooseImage({
count: 1,
success: async (file) => {
uni.showLoading({
title: '上传中...'
})
const {success,data} = await ossUpload(file.tempFilePaths[0], file.tempFiles[0].path, 'local_life_idcard/')
if(success) {
this.form.idCard = data
uni.hideLoading()
} else {
uni.showToast({icon:'none', title: '上传失败'})
uni.hideLoading()
}
}
})
},
// 上传身份证反面
uploadIdCardBackend() {
uni.chooseImage({
count: 1,
success: async (file) => {
uni.showLoading({
title: '上传中...'
})
const {success,data} = await ossUpload(file.tempFilePaths[0], file.tempFiles[0].path, 'local_life_idcard/')
if(success) {
this.form.idBack = data
uni.hideLoading()
} else {
uni.showToast({icon:'none', title: '上传失败'})
uni.hideLoading()
}
}
})
},
// 提交表单
async onSubmit() {
const {form, isAgree, fileList} = this
const {businessLicense, crftNo1, idCard, name, empowerPhone, address} = this.form
const latitude = this.cityInfo.gcj02_lat
const longitude = this.cityInfo.gcj02_lng
let lstore_id = 0
if (this.localShop) {
lstore_id = this.localShop.lstore_id
}
// let flag = true;
// Object.keys(submitObj).forEach((key) => {
// if (submitObj[key] === '') {
// this.$toast({
// title: '请完善上方表单信息'
// })
// flag = false;
// return flag;
// }
// })
if (!businessLicense) return this.$toast({
title: '请先上传营业执照'
})
if (!crftNo1) return this.$toast({
title: '请填写社会信用代码'
})
if (!idCard) return this.$toast({
title: '请上传手持身份证'
})
if (!name) return this.$toast({
title: '请填写商户联系人'
})
if (!empowerPhone) return this.$toast({
title: '请填写联系电话'
})
if (!address) return this.$toast({
title: '请填写地理位置'
})
if (!isAgree) return this.$toast({
title: '请先同意《入驻协议》'
})
// #ifdef MP-WEIXIN
// await this.getAuthMsg();
//#endif
const {
data,
code,
msg
} = await addLocalStore({businessLicense, crftNo1, idCard, name, empowerPhone, address, lstore_id, latitude, longitude})
if(code == 1) {
this.$toast({
title: msg
})
setTimeout(() => {
this.storeState = 0;
this.bgColor = '#ffffff';
}, 500)
}
},
getAuthMsg() {
return new Promise(resolve => {
getLocalLifeTemplateId().then((res) => {
if (res.code == 1) {
uni.requestSubscribeMessage({
tmplIds: res.id,
});
}
})
});
},
async reLocationFunc() {
this.isLoading = true;
await this.initLocationFunc();
this.isLoading = false;
},
},
computed: {
...mapGetters(['cityInfo', 'isLogin'])
},
watch: {
cityInfo: {
handler(val) {
this.form.address = this.cityInfo.address
},
deep: true
}
}
}
</script>
<style lang="scss">
.store-settled {
min-height: 100vh;
background-repeat: no-repeat;
background-size: 100% auto;
overflow: hidden;
.content {
margin-top: 20rpx;
padding: 0 20rpx 31rpx;
.wait-pass {
&>view:last-child {
font-weight: bold;
margin-top: 20rpx;
font-size: 14px;
color: #b7b7b7;
}
}
.pass {
&>view:last-child {
font-weight: bold;
margin-top: 20rpx;
font-size: 14px;
color: #1BA035;
}
}
.no-pass {color: #FF2C3C;}
.apply-form {
border-radius: 8px;
padding: 20rpx 0 30rpx 26rpx;
.apply-form-info {
margin-left: 12rpx;
}
.custom-apply-form-block {
border-bottom: 1px solid #f1f1f1;
width: 100%;
justify-content: flex-start;
}
.custom-apply-form-item {
margin-left: 12rpx;
justify-content: flex-start;
flex: 0 0 80px;
padding: 4rpx 0rpx;
margin-top: 12rpx;
.required {
color: #FF2C3C;
margin-right: 4rpx;
}
}
.custom-apply-form-item + view {
margin-left: 12rpx;
padding: 4rpx 0;
}
.apply-form-upload {
width: 120rpx;
height: 120rpx;
text-align: center;
border: 1px solid #d2d2d2;
margin-left: 12rpx;
image {
width: 120rpx;
height: 120rpx;
}
}
.apply-form-item {
.send-code-btn {
height: 56rpx;
width: 188rpx;
border: 1rpx solid $-color-primary;
}
}
.primary-btn {
width: 100%;
height: 88rpx;
background-color: $-color-primary;
}
}
}
.login {
background: #fff;
text-align: center;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.btn {
background-color: #09BB07;
width: 280rpx;
line-height: 70rpx;
margin: 40rpx auto 0;
image {
width: 50rpx;
height: 50rpx;
}
}
}
}
</style>