Files
Hfive/pages/index/information.vue
魏啾 56863dd624 H5
2024-04-30 18:07:59 +08:00

435 lines
12 KiB
Vue

<template>
<view class="Box">
<view class="Box_box_O">
<view class="Box_box flex-between">
<view>请填写公司名字</view>
<view class="Box_box_input"><input type="text" :disabled="disabled" v-model="form.title"
placeholder="请填写" data-key="mobile" /></view>
</view>
<view class="Box_box flex-between">
<view>请填写法人姓名</view>
<view class="Box_box_input"><input type="text" :disabled='disabled' v-model="form.legal_person_name"
placeholder="请填写" data-key="mobile" /></view>
</view>
<view class="Box_box flex-between">
<view>请填写法人手机号</view>
<view class="Box_box_input"><input type="text" :disabled='disabled' v-model="form.phone"
placeholder="请填写" data-key="mobile" /></view>
</view>
<view class="Box_box flex-between">
<view>电子税局账号</view>
<view class="Box_box_input"><input type="text" :disabled='disabled' v-model="form.dlzh"
placeholder="请填写" data-key="mobile" /></view>
</view>
<view class="Box_box flex-between">
<view>电子税局密码</view>
<view class="Box_box_input"><input type="text" :disabled='disabled' v-model="form.dlmm"
placeholder="请填写" data-key="mobile" /></view>
</view>
<view class="Box_box flex-between" @click="showpicker = true">
<view>省份</view>
<view class="flex-start">
{{form.provinceno_name || ''}}<u-icon name="arrow-right" color="#999999" size="16"></u-icon>
</view>
</view>
<view class="Box_box flex-between">
<view>邀请码</view>
<view class="Box_box_input"><input type="text" :disabled='disabled' v-model="form.code"
placeholder="请填写" data-key="mobile" /></view>
</view>
</view>
<view class="Box_box_T">
<view class="Box_box_T_o">请上传法人身份证图片</view>
<view class="flex-colum" style="width: 100%;">
<view class="Box_box_d" v-if="form.id_card_straight" @click="Upload(0)">
<image :src="form.id_card_straight" mode=""></image>
</view>
<view v-else class="Box_box_Ts" @click="Upload(0)"></view>
</view>
<view class="Box_box_T_o">请上传法人国徽身份证图片</view>
<view class="flex-colum" style="width: 100%;">
<view class="Box_box_d" v-if="form.id_card_reverse" @click="Upload(1)">
<image :src="form.id_card_reverse" mode=""></image>
</view>
<view v-else class="Box_box_Ts" @click="Upload(1)"></view>
</view>
<view class="Box_box_T_o">请拍摄并上传你的营业执照</view>
<view class="flex-colum" style="width: 100%;">
<view class="Box_box_d" v-if="form.business_license" @click="Upload(2)">
<image :src="form.business_license" mode=""></image>
</view>
<view v-else class="Box_box_Ts" @click="Upload(2)"></view>
</view>
</view>
<view class="preservation flex-colum">
<view v-if="form.status == '2'" style="width: 100%; color: #FF2B2B; padding: 28rpx 0;word-wrap: break-word;">
拒接原因:({{form.no|| ''}})</view>
<view v-if="disabled" class="preservation_boxs">审核中</view>
<view v-else class="preservation_box" @tap="$u.throttle(saveMerchantBaseInfoV2, 1000)">提交</view>
</view>
<u-picker :show="showpicker" :columns="columns" @confirm='confirm' keyName="name"
@cancel='showpicker = false'></u-picker>
</view>
</template>
<script>
import selectaddress from '@/components/yixuan-selectAddress/yixuan-selectAddress.vue';
export default {
components: {
selectaddress
},
data() {
return {
showpicker: false,
disabled: true,
Uploadurlnumber: '',
namelang: '',
merchantAuditStatus: '',
columns: [
],
form: {
store_id: uni.getStorageSync('userId'),
title: '',
id_card_straight: '',
id_card_reverse: '',
business_license: '',
phone: '',
legal_person_name: '',
no: '',
provinceno: '',
provinceno_name: '',
dlzh: '',
dlmm: '',
code: '',
}
};
},
onLoad(e) {
console.log(e.store)
let data = uni.getStorageSync('form')
if (data.status == '0') {
this.disabled = true
} else {
this.disabled = false
}
if (data.phone) {
this.form.store_id = uni.getStorageSync('userId')
this.form.title = data.title
this.form.status = data.status
this.form.id_card_straight = data.id_card_straight
this.form.id_card_reverse = data.id_card_reverse
this.form.business_license = data.business_license
this.form.phone = data.phone
this.form.legal_person_name = data.legal_person_name
this.form.no = data.no
this.form.dlzh = data.dlzh
this.form.dlmm = data.dlmm
this.form.code = data.invitation
this.form.provinceno = data.provinceno
this.form.provinceno_name = data.provinceno_name
}
},
onShow() {
this.onShowdata()
},
methods: {
onShowdata(){
uni.request({
url: uni.conf.baseUrl + 'szzpy/getprovinceno',
data: this.form,
method: 'POST', //请求方式,必须为大写
success: res => {
if (res.data.data) {
this.columns = [res.data.data]
}
},
fail(res) {
uni.showToast({
title: res.data.message || res.data.msg,
icon: 'none',
success: () => {
uni.pro.hideLoading();
}
});
}
});
},
confirm(e) {
console.log('confirm', e)
this.form.provinceno_name = e.value[0].name
this.form.provinceno = e.value[0].code
this.showpicker = false
},
Upload(i) {
if (this.disabled) {
return false;
} else {
this.Uploadurlnumber = i;
uni.chooseImage({
count: 1, //默认9
sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], //从相册选择,和摄像头功能,默认二者都有
success: res => {
uni.pro.showLoading({
title: '上传中',
mask: true
});
var thisimgUrlcaca = res.tempFilePaths[0];
var that = this;
uni.uploadFile({
url: 'https://cashieradmin.sxczgkj.cn' + '/api/qiNiuContent',
filePath: thisimgUrlcaca,
name: 'file', // 后端接收的文件名
header: {
userId: uni.cache.get('userId'),
token: uni.cache.get('token'),
myLoginName: uni.cache.get('myLoginName')
},
success: res => {
var thisdata_ = JSON.parse(res.data);
uni.showToast({
title: '上传成功',
icon: 'none',
success: () => {
uni.pro.hideLoading();
console.log(thisdata_.data[0]);
if (this.Uploadurlnumber == 0) {
this.$set(this.form,
'id_card_straight', thisdata_
.data[0])
} else if (this.Uploadurlnumber == 1) {
this.$set(this.form, 'id_card_reverse',
thisdata_.data[0])
} else {
this.$set(this.form,
'business_license', thisdata_
.data[0])
}
console.log(this.form)
}
});
},
fail: err => {
uni.pro.hideLoading();
uni.showToast({
title: thisdata_.message || thisdata_.msg,
icon: 'none',
});
}
});
}
});
}
},
async saveMerchantBaseInfoV2() {
console.log(this.form)
if (this.form.title == null || this.form.title == '') {
uni.showToast({
title: '请填写公司名字',
icon: 'none'
});
return false;
}
if (this.form.phone == null || this.form.phone == '') {
uni.showToast({
title: '请填写法人手机号',
icon: 'none'
});
return false;
}
if (this.form.legal_person_name == null || this.form.legal_person_name == '') {
uni.showToast({
title: '请填写法人姓名',
icon: 'none'
});
return false;
}
if (this.form.id_card_straight == null || this.form.id_card_straight == '') {
uni.showToast({
title: '请上传身份证人像面',
icon: 'none'
});
return false;
}
if (this.form.id_card_reverse == null || this.form.id_card_reverse == '') {
uni.showToast({
title: '请上传身份证国徽面',
icon: 'none'
});
return false;
}
if (this.form.business_license == null || this.form.business_license == '') {
uni.showToast({
title: '请上传营业执照',
icon: 'none'
});
return false;
}
if (this.form.provinceno == null || this.form.provinceno == '') {
uni.showToast({
title: '请选择省份编码',
icon: 'none'
});
return false;
}
if (this.form.dlzh == null || this.form.dlzh == '') {
uni.showToast({
title: '请填写电子税局账号',
icon: 'none'
});
return false;
}
if (this.form.dlmm == null || this.form.dlmm == '') {
uni.showToast({
title: '请填写电子税局账密码',
icon: 'none'
});
return false;
}
if (this.form.code == null || this.form.code == '') {
uni.showToast({
title: '请填写邀请码',
icon: 'none'
});
return false;
}
// if (/[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/ig
// .test(this.form.alias)) {
// uni.showToast({
// title: '请不要输入Emoji!!!',
// icon: 'none'
// });
// return false;
// }
uni.request({
url: uni.conf.baseUrl + 'store/storeinfo',
data: this.form,
method: 'POST', //请求方式,必须为大写
success: res => {
uni.showToast({
title: res.data.message || res.data.msg,
icon: 'none',
success: () => {
uni.pro.hideLoading();
}
});
if (res.data.code == 1) {
setTimeout(() => {
uni.cache.set('form','');
uni.reLaunch({
url: '/pages/index/index'
});
// uni.navigateBack();
}, 2000);
}
console.log(res)
// this.form = res.data.data
console.log('接口返回------', res);
},
fail(res) {
uni.showToast({
title: res.data.message || res.data.msg,
icon: 'none',
success: () => {
uni.pro.hideLoading();
}
});
}
});
}
}
};
</script>
<style lang="scss">
page {
background: #fff;
}
.Box {
.Box_box_O {
padding: 0 28rpx;
.Box_box {
text-align: right;
padding: 24rpx;
border-bottom: 1px solid #e5e5e5;
font-size: 28rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #333333;
.Box_box_input {
width: 60%;
}
}
}
.Box_box_T {
padding: 0 28rpx;
border-top: 16rpx solid #e5e5e5;
.Box_box_T_o {
padding: 28rpx 0;
text-align: center;
}
.flex-colum {
image {
width: 396rpx;
height: 240rpx;
}
padding-bottom: 16rpx;
border-bottom: 1px solid #e5e5e5;
.Box_box_Ts {
width: 396rpx;
height: 240rpx;
background: #ffffff;
border-radius: 8rpx;
border: 2rpx dashed #707070;
background: url(@/static/my2.png) no-repeat;
background-position: 50% 50%;
background-size: 50%;
}
}
}
.preservation {
width: 100%;
padding: 50rpx;
.preservation_box {
width: 70%;
height: 72rpx;
background: #288efb;
text-align: center;
line-height: 72rpx;
border-radius: 50rpx;
font-size: 36rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #ffffff;
}
.preservation_boxs {
width: 70%;
height: 72rpx;
background: #999999;
text-align: center;
line-height: 72rpx;
border-radius: 50rpx;
font-size: 36rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #ffffff;
}
}
}
</style>