You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

749 lines
24 KiB

<template>
<view class="certify-page b-flex-y b-flex-c">
<view class="c-main-view b-flex-y b-flex-c">
<view class="r-box">
<!-- <text class="rb-title">品牌信息</text> -->
<view class="rb-input-box rb-line b-flex-x b-flex-b" @click="showChangeNameModule=true">
<view class="rb-input-title b-flex-x">账号名称<text>*</text></view>
<input class="rb-input" disabled="true" v-model="form.account_name" type="text" placeholder="请输入小程序名称"
placeholder-class="input-hold-class"></input>
</view>
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">命名类型<text></text></view>
<view class="rb-radio b-flex-x">
<radio-group @change="wordSelect">
<radio value="1" :checked="form.account_name_type==1" style="transform:scale(0.9)" color="#009876">自选词汇</radio>
<radio value="2" :checked="form.account_name_type==2" style="transform:scale(0.9);margin-left: 40rpx;" color="#009876">商标命名</radio>
</radio-group>
</view>
</view>
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">认证类型<text></text></view>
<view class="rb-radio b-flex-x">
<radio-group @change="companySelect">
<radio value="1" :checked="form.customer_type==1" style="transform:scale(0.9)" color="#009876">企业</radio>
<radio value="12" :checked="form.customer_type==12" style="transform:scale(0.9);margin-left: 40rpx;" color="#009876">个体户</radio>
</radio-group>
</view>
</view>
<view class="rb-upload-box rb-line b-flex-y b-flex-s b-mt-0 b-pb-50">
<view class="rb-upload-title b-flex-x">主体资质材料(营业执照)<text>*</text></view>
<view class="rb-upload-list b-flex-x" @click="clickUploadImg(1)">
<view class="rb-upload-item b-flex-y b-flex-c">
<image class="rb-upload-bg" src="../../static/regist/upload_bg.png"
:src="localImg[1].url||'../../static/regist/upload_bg.png'"></image>
<image class="rb-upload-cam" src="../../static/regist/camera.png"></image>
<text class="rb-input-img-text">点击上传</text>
</view>
<!-- <view class="b-flex-as-e b-ml-40 b-t-24 b-t-green b-t-B b-t-U">重新上传</view> -->
</view>
</view>
<view v-if="show_hit_upload" class="rb-upload-box rb-line b-flex-y b-flex-s b-mt-0 b-pb-50">
<view class="rb-upload-title b-flex-x">名称涉及关键词(补充材料)<text></text></view>
<view class="rb-upload-list b-flex-x" @click="clickUploadImg(2)">
<view class="rb-upload-item b-flex-y b-flex-c">
<image class="rb-upload-bg" src="../../static/regist/upload_bg.png"
:src="localImg[2].url||'../../static/regist/upload_bg.png'"></image>
<image class="rb-upload-cam" src="../../static/regist/camera.png"></image>
<text class="rb-input-img-text">点击上传</text>
</view>
</view>
</view>
<view class="rb-upload-box b-flex-y b-flex-s b-mt-0 b-pb-20">
<view class="rb-upload-title b-flex-x">主体资质其他证明材料<text></text></view>
<view class="rb-upload-list b-flex-x" @click="clickUploadImg(3)">
<view class="rb-upload-item b-flex-y b-flex-c">
<image class="rb-upload-bg" src="../../static/regist/upload_bg.png"
:src="localImg[3].url||'../../static/regist/upload_bg.png'"></image>
<image class="rb-upload-cam" src="../../static/regist/camera.png"></image>
<text class="rb-input-img-text">点击上传</text>
</view>
</view>
</view>
</view>
<view class="r-box">
<text class="rb-title b-t-B">认证联系人</text>
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">姓名<text>*</text></view>
<input class="rb-input" v-model="form.contact_info.name" type="text" placeholder="请输入联系人姓名"
placeholder-class="input-hold-class"></input>
</view>
<view class="rb-input-box b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">邮箱<text>*</text></view>
<input class="rb-input" v-model="form.contact_info.email" type="text" placeholder="请输入联系人邮箱"
placeholder-class="input-hold-class"></input>
</view>
</view>
<view class="r-box">
<text class="rb-title b-t-B">发票信息</text>
<view class="rb-radio b-flex-x b-mt-50 b-mb-10">
<!-- checked -->
<radio-group @change="radioSelect">
<radio value="1" :checked="form.invoice_info.invoice_type==1" style="transform:scale(0.9)" color="#009876">不开发票</radio>
<radio value="2" :checked="form.invoice_info.invoice_type==2" style="transform:scale(0.9);margin-left: 40rpx;" color="#009876">电子普票</radio>
<radio value="3" :checked="form.invoice_info.invoice_type==3" style="transform:scale(0.9);margin-left: 40rpx;" color="#009876">增值税发票</radio>
</radio-group>
</view>
<block v-if="form.invoice_info.invoice_type==2">
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">纳税人识别号<text>*</text></view>
<input class="rb-input" v-model="form.invoice_info.electronic.id" type="text" placeholder="请输入"
placeholder-class="input-hold-class"></input>
</view>
<view class="rb-input-box b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">发票备注<text>*</text></view>
<input class="rb-input" v-model="form.invoice_info.electronic.desc" type="text" placeholder="请输入"
placeholder-class="input-hold-class"></input>
</view>
</block>
<block v-if="form.invoice_info.invoice_type==3">
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">企业电话<text>*</text></view>
<input class="rb-input" v-model="form.invoice_info.vat.enterprise_phone" type="text" placeholder="请输入"
placeholder-class="input-hold-class"></input>
</view>
<view class="rb-input-box rb-line b-flex-x b-flex-b" v-if="form.invoice_info.invoice_type>1">
<view class="rb-input-title b-flex-x">纳税识别号<text>*</text></view>
<input class="rb-input" v-model="form.invoice_info.vat.id" type="text" placeholder="请输入"
placeholder-class="input-hold-class"></input>
</view>
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">企业注册地址<text>*</text></view>
<input class="rb-input" v-model="form.invoice_info.vat.enterprise_address" type="text" placeholder="请输入"
placeholder-class="input-hold-class"></input>
</view>
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">企业开户银行<text>*</text></view>
<input class="rb-input" v-model="form.invoice_info.vat.bank_name" type="text" placeholder="请输入"
placeholder-class="input-hold-class"></input>
</view>
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">企业银行账号<text>*</text></view>
<input class="rb-input" v-model="form.invoice_info.vat.bank_account" type="text" placeholder="请输入"
placeholder-class="input-hold-class"></input>
</view>
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">发票邮寄地址邮编<text>*</text></view>
<input class="rb-input" v-model="form.invoice_info.vat.mailing_address" type="text" placeholder="请输入"
placeholder-class="input-hold-class"></input>
</view>
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">街道地址<text>*</text></view>
<input class="rb-input" v-model="form.invoice_info.vat.address" type="text" placeholder="请输入"
placeholder-class="input-hold-class"></input>
</view>
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">联系人<text>*</text></view>
<input class="rb-input" v-model="form.invoice_info.vat.name" type="text" placeholder="请输入"
placeholder-class="input-hold-class"></input>
</view>
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">联系电话<text>*</text></view>
<input class="rb-input" v-model="form.invoice_info.vat.phone" type="text" placeholder="请输入"
placeholder-class="input-hold-class"></input>
</view>
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">省份<text>*</text></view>
<input class="rb-input" v-model="form.invoice_info.vat.province" type="text" placeholder="请选择"
placeholder-class="input-hold-class"></input>
<!-- <text class="b-icon icon-right b-text-black-dd"></text> -->
</view>
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">城市<text>*</text></view>
<!-- disabled -->
<input class="rb-input" v-model="form.invoice_info.vat.city" type="text" placeholder="请选择"
placeholder-class="input-hold-class"></input>
<!-- <text class="b-icon icon-right b-text-black-dd"></text> -->
</view>
<view class="rb-input-box rb-line b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">县区<text>*</text></view>
<input class="rb-input" v-model="form.invoice_info.vat.district" type="text" placeholder="请选择"
placeholder-class="input-hold-class"></input>
<!-- <text class="b-icon icon-right b-text-black-dd"></text> -->
</view>
<view class="rb-input-box b-flex-x b-flex-b">
<view class="rb-input-title b-flex-x">发票备注<text>*</text></view>
<input class="rb-input" v-model="form.invoice_info.vat.desc" type="text" placeholder="请输入"
placeholder-class="input-hold-class"></input>
</view>
</block>
</view>
<view class="b-mt-40 b-mb-60">
<button @click="SubmitDraft"class="rb-regist-btn b-btn b-btn-green b-mr-10" style="width: 340rpx;height: 112rpx;">保存草稿</button>
<button @click="SubmitEvent"class="rb-regist-btn b-btn b-btn-green b-ml-10" style="width: 340rpx;height: 112rpx;">下一步</button>
</view>
</view>
<app-change-name-certify v-if="showChangeNameModule"
:appInfo="brandInfo" :appid="appid"
@sure="nameChange"
@close="showChangeNameModule = false"
></app-change-name-certify>
</view>
</template>
<script>
import util from '@/utils/util.js';
import { servers } from '@/js/server';
import party_api from '../../../party/js/api';
import miniappChangeNameCertify from '../../components/popup-content/miniapp-change-name-certify.vue';
import {
mapState
} from 'vuex'
export default {
components: {
"app-change-name-certify": miniappChangeNameCertify,
},
data() {
return {
showChangeNameModule:false, //小程序名称修改弹窗
brandInfo: {},
appid: "",
localImg: {
1: {
url: "",
mediaid: ""
},
2: {
url: "",
mediaid: ""
},
3: {
url: "",
mediaid: ""
}
},
form: {//auth_data
"account_name": "",
"account_name_type": 1,
"qualification": "",// string 否 非个人类型必填。主体资质材料 media_id 支持jpg,jpeg .bmp.gif .png格式,仅支持一张图片
"account_supplemental": [], // array<string> 否 名称命中关键词-补充材料 media_id 支持jpg,jpeg .bmp.gif .png格式,支持上传多张图片
"qualification_other": [], // array<string> 否 主体资质其他证明材料 media_id 支持jpg,jpeg .bmp.gif .png格式,最多上传10张图片
"auth_ident_material": [],
"auth_identification": "",
"contact_info": {
"email": "",
"name": ""
},
"customer_type": 1, //number 是 认证类型 企业为1,个体工商户 为12,个人是15
"invoice_info": {
"electronic": {
"desc": "",
"id": "",
},
"invoice_title": "",
"invoice_type": 1,//1不开发票 2电子普票 3增值税发票
"vat": {
"address": "",
"bank_account": "",
"bank_name": "",
"city": "",
"desc": "",
"district": "",
"enterprise_address": "",
"enterprise_phone": "",
"id": "",
"mailing_address": "",
"name": "",
"phone": "",
"province": ""
}
},
"pay_type": 2,
"service_appid": "",
"third_party_phone": ""
},
checkNameRes: "", //名称检测结果
}
},
async onLoad(opts) {
// console.log("onload-", this.brandInfo.brand.id)
console.log("onload-", opts)
let _brandInfo = await this.$store.dispatch('getBrandInfo');
console.log("_brandInfo:",_brandInfo)
this.brandInfo = _brandInfo
if(opts.appid)this.appid = opts.appid;
if(_brandInfo.brand.mini_wechat_appid)this.appid = _brandInfo.brand.mini_wechat_appid;
// util.showNone("onLoad")
// this.getAuthInfo()
this.getTempDraft()
},
onShow() {
},
computed: {
// ...mapState(['brandInfo',])
show_hit_upload(){
if(this.checkNameRes.data && this.checkNameRes.data.hit_condition){
return true
}
return false
}
},
watch: {
cartList() {
this.setCartConfirmStyle();
},
},
methods: {
nameChange(e){
console.log("nameChange",e)
this.form.account_name = e.name
this.checkNameRes = e.checkNameRes
this.showChangeNameModule = false
},
clickNameInput(){
},
setInfo(){
// if(!this.form.account_name){
// this.form.account_name = this.brandInfo.brand.mini_wechat_app_name
// }
},
radioSelect(e){
console.log(e.detail)
this.form.invoice_info.invoice_type = e.detail.value
},
wordSelect(e){
console.log(e.detail)
this.form.account_name_type = e.detail.value
},
companySelect(e){
console.log(e.detail)
this.form.customer_type = e.detail.value
},
setCallbackInfoToPage(){
//设置回显
},
SubmitDraft(){
this.setLocalImgMediaidToForm()
console.log("form", this.form)
this.editTempDraft()
},
SubmitEvent(){
this.setLocalImgMediaidToForm()
console.log("form", this.form)
this.editTempDraft()
this.wxauth()
// util.routeTo("/subpackage/party/pages/miniapp/certify_res","nT")
},
toCertifyRes(){
util.routeTo(`/subpackage/party/pages/miniapp/certify_res?appid=${this.appid}`,"nT")
},
wxauth(){//提交认证
// let _data = this.getGateWayJson('wxauth')
let _data = {//提交认证信息
"appid": this.appid,
"module": "/wxa/sec/wxaauth",
"method": "POST",
"form": {}
}
// console.log(33333,_data)
// delete _data['localImg']
_data.form['auth_data'] = this.form
console.log("wxautht提交:",_data)
servers.post({
url: party_api.gatewayDo,
data: _data,
isDefaultGet: false,
})
.then(res=>{
console.log("wxauth:", res.data)
let _res = res.data.data
if(res.data.code!=0){
util.showNone(res.data.message)
// return util.showNone("wxauth保存失败")
}else{
util.showNone("提交认证成功")
this.toCertifyRes()
return
}
})
.catch(err=>{
console.log("get_icp_entrance_info-err", err)
})
},
editTempDraft(){
let _data = this.getGateWayJson('wxauth')
_data.form['auth_data'] = this.form
_data.localImg = this.localImg
_data.temp_type = 0 //后台要求增加
servers.post({
url: party_api.editTempDraft,
data: _data,
isDefaultGet: false,
})
.then(res=>{
console.log("get_icp_entrance_info:", res.data)
let _res = res.data.data
if(res.data.code!=0){
return util.showNone("保存失败")
}else{
// this.icpInfo = _res.info
return util.showNone("保存成功")
}
})
.catch(err=>{
console.log("get_icp_entrance_info-err", err)
})
},
getTempDraft(){
let _data = this.getGateWayJson('getwxauth')
_data.temp_type = 0 //后台要求增加
servers.post({
url: party_api.getTempDraft,
data: _data,
isDefaultGet: false,
})
.then(res=>{
console.log("get_icp_entrance_info:", res.data)
let _res = res.data.data
if(res.data.code!=0){
return util.showNone("errcode:"+_res.errcode+"-"+_res.errmsg)
}else{
this.form = _res.form.auth_data
if(_res.localImg)this.localImg = _res.localImg
this.setInfo()
}
})
.catch(err=>{
console.log("get_icp_entrance_info-err", err)
})
},
getAuthInfo(){
util.showLoad()
servers.get({
url: party_api.getAuthInfo,
data: {
brand_id: this.brandInfo.brand.id
},
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad()
console.log(res)
this.form = res.data
})
},
getGateWayJson(jname){
let appid = this.appid
let _data = party_api["gatewayDoJson"][jname]
if(!appid){
console.error("当前page中: this.appid不存在")
return util.showNone("appid不存在")
}
if(!_data){
console.error("先去api.js定义透传数据:",jname)
return util.showNone("接口不存在")
}
console.log(555566666,_data)
_data.appid = appid;
return _data
},
async clickUploadImg(which){
// which 1:主体资质材料 2:名称涉及关键词 3:主体资质其他证明材料
//根据which,获取imgurl, 并转换为mediaid
this.localImg[which].url = await this.getLocalImg();
this.localImg[which].mediaid = await this.getUploadImgMediaId(this.localImg[which].url);
if(!this.localImg[which].mediaid)this.localImg[which].url=""
},
setLocalImgMediaidToForm(){
// "qualification": "dgd_3lNcp4NOfg9J2--l5e60x8mpGfFOStb3qeKxco0xSQQJxK6KYxlYkE9qZVF9",// string 否 非个人类型必填。主体资质材料 media_id 支持jpg,jpeg .bmp.gif .png格式,仅支持一张图片
// "account_supplemental": [], // array<string> 否 名称命中关键词-补充材料 media_id 支持jpg,jpeg .bmp.gif .png格式,支持上传多张图片
// "qualification_other": [], // array<string> 否 主体资质其他证明材料 media_id 支持jpg,jpeg .bmp.gif .png格式,最多上传10张图片
this.form.qualification = this.localImg[1].mediaid
this.form.account_supplemental = [this.localImg[2].mediaid]
this.form.qualification_other = [this.localImg[3].mediaid]
},
getUploadImgURL(tempFilePath){
return servers.uploadFile({
url: party_api.webUpload,
filePath: tempFilePath,
name: 'file',
formData: {}
})
.then(res=>{
console.log("uploadFile-res", res)
if(res.statusCode == 200){
// console.log("uploadFile-url 上传成功1", res.data.data.url)
let _data = JSON.parse(JSON.stringify(res.data))
console.log("uploadFile-url return type", typeof(_data))
// console.log("uploadFile-url 上传成功 接口真正数据", JSON.parse(_data))
_data = JSON.parse(_data).data
return _data.url
}
})
.catch(err=>{
console.log("uploadFile-err", err)
})
},
//从相册获取照片
getLocalImg() {
console.log("clickUploadImg");
return new Promise((resolve, reject) => {
uni.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: (res) => {
console.log("chooseImage", res)
let tempFilePaths = res.tempFilePaths[0];
resolve(tempFilePaths)
},
fail: (err) => {
console.log("chooseImage-err", err)
reject(err)
}
});
})
},
getUploadImgMediaId(tempFilePath){
let appid = this.appid
let _param_str = `module=/cgi-bin/media/upload&appid=${appid}`
let _url = party_api.gatewayDoDuplicate+"?"+_param_str
return servers.uploadFile({
url: _url,
filePath: tempFilePath,
name: 'image',
formData: {
'form.type':"image"
}
})
.then(res=>{
console.log("uploadFile-gatewayDoDuplicate-res", res)
if(res.statusCode == 200){
let _data = JSON.parse(JSON.stringify(res.data))
console.log("uploadFile-url return type", typeof(_data))
_data = JSON.parse(_data).data
console.log("uploadFile-gatewayDoDuplicate-上传成功 接口真正数据", _data)
return _data.media_id
}
})
.catch(err=>{
console.log("uploadFile-err", err)
})
},
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
@import '../../ui/maincss.scss';
page {
background-color: $b-color-gray-dd;
}
.certify-page {
.c-main-view {
width: 700rpx;
.r-box {
width: 100%;
background: #FFFFFF;
border-radius: 20rpx;
margin-top: 20rpx;
padding: 28rpx;
.rb-title {
font-size: 32rpx;
color: #333333;
}
.input-hold-class {
font-size: 28rpx;
color: #999999;
}
.rb-line {
border-bottom: 1rpx solid #E5E5E5;
}
.rb-upload-box{
.rb-upload-title{
font-size: 28rpx;
color: #333333;
margin: 26rpx 0 28rpx 0;
>text {
color: $b-color-red;
}
}
.rb-line {
border-bottom: 1rpx solid #E5E5E5;
}
.rb-upload-list{
width: 100%;
.rb-upload-item{
width: 168rpx;
height: 168rpx;
// position: relative;
.rb-upload-bg{
width: 168rpx;
height: 168rpx;
position: absolute;
}
.rb-upload-cam{
width: 48rpx;
height: 40rpx;
}
.rb-input-img-text{
font-size: 24rpx;
margin-top: 24rpx;
color: #1A1A1A;
z-index: 2;
}
}
.idcard-width-170{
width: 280rpx;
height: 170rpx;
.rb-upload-bg{
width: 280rpx;
height: 170rpx;
position: absolute;
}
}
}
}
.rb-regist-box{
width: 100%;
.rb-line {
border-bottom: 1rpx solid #E5E5E5;
}
>view{
// background-color: #9C9C9F;
width: 100%;
padding: 20rpx 0rpx 30rpx;
.rr-status{
font-size: 24rpx;
color: #EA5061;
width: 72rpx;
margin-left: 60rpx;
}
}
.rr-text{
padding-bottom: 40rpx;
font-size: 28rpx;
color: #1A1A1A;
}
.rb-class{
background: #F2F5F7;
border-radius: 10rpx;
padding-left: 32rpx;
margin-top: 20rpx;
>view{
font-size: 24rpx;
color: #333333;
padding: 10rpx 0;
>text{
margin-left: 15rpx;
}
}
}
}
.rb-input-box {
padding: 8rpx 0;
width: 100%;
// background-color: #E5E5E5;
.rb-input-title {
font-size: 28rpx;
color: #333333;
width: 188rpx;
position: absolute;
>text:last-child {
color: $b-color-red;
}
}
.rb-box-right{
// background-color: #999999;
>view{
color: $b-color-red;
margin-right: 20rpx;
}
}
.input-width-more{
font-size: 28rpx;
color: #333333;
// width: 168rpx;
// position: absolute;
>text:last-child {
color: $b-color-red;
}
width: 280rpx;
.certify-yes {
padding: 10rpx;
margin-left: 10rpx;
font-weight: 400;
font-size: 22rpx;
color: $b-color-green;
border: 1rpx solid $b-color-green;
border-radius: 6rpx;
}
.certify-no{
padding: 10rpx;
margin-left: 10rpx;
font-weight: 400;
font-size: 22rpx;
color: #9C9C9F;
border: 1rpx solid #9C9C9F;
border-radius: 6rpx;
}
}
.rb-input {
margin-left: 240rpx;
height: 80rpx;
font-size: 28rpx;
color: #333333;
}
.rb-radio{
margin-left: 240rpx;
height: 80rpx;
}
}
}
}
}
.container {
display: flex;
flex-direction: column;
width: 100vw;
height: 100vh;
padding-bottom: 0rpx;
padding-bottom: calc(0rpx + constant(safe-area-inset-bottom));
/* 兼容 iOS < 11.2 */
padding-bottom: calc(0rpx + env(safe-area-inset-bottom));
/* 兼容 iOS >= 11.2 */
}
</style>