|
|
@@ -22,18 +22,10 @@
|
|
|
<uni-forms-item label="店铺名称" required name="name">
|
|
|
<uni-easyinput v-model="formData.name" type="text" placeholder="请输入店铺名称" />
|
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item label="店铺全称" required name="full_name">
|
|
|
- <uni-easyinput v-model="formData.full_name" type="text" placeholder="请输入营业执照相同公司全称" />
|
|
|
- </uni-forms-item>
|
|
|
- <uni-forms-item label="统一社会信用代码" required name="credit_code">
|
|
|
- <uni-easyinput v-model="formData.credit_code" type="text" placeholder="请输入统一社会信用代码" />
|
|
|
- </uni-forms-item>
|
|
|
+
|
|
|
<uni-forms-item label="商家logo" required name="logo">
|
|
|
<upimg v-model="formData.logo"/>
|
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item label="商家资质" required name="qualification">
|
|
|
- <upimg v-model="formData.qualification" :count="6"/>
|
|
|
- </uni-forms-item>
|
|
|
<uni-forms-item label="商家账号" required name="mobile">
|
|
|
<uni-easyinput v-model="formData.mobile" type="text" placeholder="请输入商家账号,即茶付宝账号" />
|
|
|
</uni-forms-item>
|
|
|
@@ -77,12 +69,39 @@
|
|
|
<uni-forms-item label="联系电话" required name="phone">
|
|
|
<uni-easyinput v-model="formData.phone" type="text" placeholder="请输入联系电话" />
|
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item label="商家微信" required name="we_chat">
|
|
|
+ <!-- <uni-forms-item label="商家微信" required name="we_chat">
|
|
|
<uni-easyinput v-model="formData.we_chat" type="text" placeholder="请输入商家微信" />
|
|
|
- </uni-forms-item>
|
|
|
+ </uni-forms-item> -->
|
|
|
<!-- <uni-forms-item label="开票类型" required name="billing_type">
|
|
|
<uni-data-select v-model="formData.billing_type" :localdata="TypeDesc.billing_type" placeholder="请选择开票类型"></uni-data-select>
|
|
|
</uni-forms-item> -->
|
|
|
+ <uni-forms-item label="商家资质" required name="qualification">
|
|
|
+ <upimg v-model="formData.qualification" :count="1"/>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="店铺全称" required name="full_name">
|
|
|
+ <uni-easyinput v-model="formData.full_name" type="text" placeholder="请输入营业执照相同公司全称" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="统一社会信用代码" required name="credit_code">
|
|
|
+ <uni-easyinput v-model="formData.credit_code" type="text" placeholder="请输入统一社会信用代码" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="身份证照" required name="idcard_img">
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
+ <upimg v-model="formData.idcard_front_img" :count="1" desc="身份证正面照" style="margin-right: 8rpx;"/>
|
|
|
+ <upimg v-model="formData.idcard_back_img" :count="1" desc="身份证反面照"/>
|
|
|
+ </div>
|
|
|
+ </uni-forms-item>
|
|
|
+ <div style="margin-bottom: 44rpx;">
|
|
|
+ 结算信息:
|
|
|
+ </div>
|
|
|
+ <uni-forms-item label="开户类型" required name="user_type">
|
|
|
+ <radio-group @change="radioChange" style="padding-top: 10rpx;">
|
|
|
+ <label class="radio" v-for="(item, index) in TypeDesc.user_type" :key="index">
|
|
|
+ <radio :value="item.value" :checked="index === current" style="transform:scale(0.7)" >
|
|
|
+ <span style="font-size: 36rpx;">{{ item.text }}</span>
|
|
|
+ </radio>
|
|
|
+ </label>
|
|
|
+ </radio-group>
|
|
|
+ </uni-forms-item>
|
|
|
<uni-forms-item label="开户银行" required name="account_name">
|
|
|
<uni-easyinput v-model="formData.account_name" type="text" placeholder="请输入开户银行全称" />
|
|
|
</uni-forms-item>
|
|
|
@@ -98,6 +117,9 @@
|
|
|
<uni-forms-item label="开户手机" required name="open_phone">
|
|
|
<uni-easyinput v-model="formData.open_phone" type="text" placeholder="请输入开户手机号码" />
|
|
|
</uni-forms-item>
|
|
|
+ <uni-forms-item label="附件" required name="back_business_img" v-if="formData.user_type == 2">
|
|
|
+ <upimg v-model="formData.back_business_img" :count="1" desc="银行许可证照"/>
|
|
|
+ </uni-forms-item>
|
|
|
|
|
|
<uni-forms-item label="商家简介" required name="summary">
|
|
|
<uni-easyinput v-model="formData.summary" type="textarea" autoHeight placeholder="请输入商家简介" />
|
|
|
@@ -133,7 +155,16 @@ export default {
|
|
|
userinfo: uni.getStorageSync("userinfo"),
|
|
|
formData: {
|
|
|
user_id: uni.getStorageSync("userinfo").user_id,
|
|
|
- user_val: uni.getStorageSync("userinfo").nickname+'/'+uni.getStorageSync("userinfo").mobile
|
|
|
+ user_val: uni.getStorageSync("userinfo").nickname+'/'+uni.getStorageSync("userinfo").mobile,
|
|
|
+ user_type: 0,
|
|
|
+ company_address: "",
|
|
|
+ business_scope: "",
|
|
|
+ credit_date: "",
|
|
|
+ full_name: "",
|
|
|
+ credit_code: "",
|
|
|
+ fileNo: "",
|
|
|
+ back_business_img: "",
|
|
|
+ merUserId: "",
|
|
|
},
|
|
|
saleValue: uni.getStorageSync("userinfo").nickname+'/'+uni.getStorageSync("userinfo").mobile,
|
|
|
rules: {
|
|
|
@@ -153,7 +184,7 @@ export default {
|
|
|
latitude: { rules: [{ required: true, errorMessage: '请输入纬度' }] },
|
|
|
contact: { rules: [{ required: true, errorMessage: '请输入联系人' }] },
|
|
|
phone: { rules: [{ required: true, errorMessage: '请输入联系电话' }] },
|
|
|
- we_chat: { rules: [{ required: true, errorMessage: '商家微信' }] },
|
|
|
+ // we_chat: { rules: [{ required: true, errorMessage: '商家微信' }] },
|
|
|
// billing_type: { rules: [{ required: true, errorMessage: '请选择开票类型' }] },
|
|
|
bank: { rules: [{ required: true, errorMessage: '请输入开户行' }] },
|
|
|
card_no: { rules: [{ required: true, errorMessage: '请输入银行卡号' }] },
|
|
|
@@ -166,6 +197,9 @@ export default {
|
|
|
settled: { rules: [{ required: true, errorMessage: '请上传入驻协议' }] },
|
|
|
full_name: { rules: [{ required: true, errorMessage: '请输入营业执照相同公司全称' }] },
|
|
|
credit_code: { rules: [{ required: true, errorMessage: '请输入统一社会信用代码' }] },
|
|
|
+ user_type: { rules: [{ required: true, errorMessage: '请选择开户类型' }] },
|
|
|
+ idcard_img: { rules: [{ required: true, errorMessage: '请完整上传身份证正反面照' }] },
|
|
|
+ back_business_img: { rules: [{ required: true, errorMessage: '请上传开户银行许可证照' }] },
|
|
|
},
|
|
|
TypeDesc: {},
|
|
|
address: {
|
|
|
@@ -177,7 +211,8 @@ export default {
|
|
|
userAddress: "",
|
|
|
submitType: 0, //0新增 1修改
|
|
|
salesmanSearch: "",
|
|
|
- salesmanList: []
|
|
|
+ salesmanList: [],
|
|
|
+ current: 0
|
|
|
};
|
|
|
},
|
|
|
watch:{
|
|
|
@@ -191,16 +226,100 @@ export default {
|
|
|
if(value){
|
|
|
this.salesmanSearchFn(value)
|
|
|
}
|
|
|
+ },
|
|
|
+
|
|
|
+ // 识别营业执照信息
|
|
|
+ 'formData.qualification'(val){
|
|
|
+ console.log(val,"识别营业执照信息");
|
|
|
+ let that = this;
|
|
|
+ if (val) {
|
|
|
+ post("v1/merchant/business",{license: val}).then(res=>{
|
|
|
+ console.log(res.data,that.formData);
|
|
|
+ if (res.code == 0 && res.data) {
|
|
|
+ let result = res.data
|
|
|
+ console.log(result,"result");
|
|
|
+ that.formData.company_address = result.address
|
|
|
+ that.formData.business_scope = result.business
|
|
|
+ that.formData.credit_date = result.valid_date == '长期' ? '20991231' : result.valid_date
|
|
|
+ that.formData.full_name = result.company
|
|
|
+ that.formData.credit_code = result.reg_num
|
|
|
+ console.log(that.formData,"that.formData");
|
|
|
+ }else{
|
|
|
+ return that.$toast("该营业执照识别不出信息")
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ // 识别身份证信息
|
|
|
+ 'formData.idcard_front_img'(val){
|
|
|
+ console.log(val,"识别身份证信息");
|
|
|
+ let that = this;
|
|
|
+ if (val) {
|
|
|
+ post("v1/merchant/idcard",{idcard: val}).then(res=>{
|
|
|
+ console.log(res.data,that.formData);
|
|
|
+ if (res.code == 0 && res.data) {
|
|
|
+ let result = res.data
|
|
|
+ console.log(result,"result");
|
|
|
+ that.formData.card_id = result.number
|
|
|
+ that.formData.account_holder = result.name
|
|
|
+ console.log(that.formData,"that.formData");
|
|
|
+ }else{
|
|
|
+ return that.$toast("该营业执照识别不出信息")
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 上传附件(银行许可证照)后即获取fileNo
|
|
|
+ 'formData.back_business_img'(val){
|
|
|
+ console.log(val,"获取fileNo");
|
|
|
+ let that = this;
|
|
|
+ if (val) {
|
|
|
+ let arr = []
|
|
|
+ arr.push(this.formData.back_business_img)
|
|
|
+ arr.push(this.formData.idcard_front_img)
|
|
|
+ arr.push(this.formData.idcard_back_img)
|
|
|
+ arr.push(val)
|
|
|
+ console.log(arr);
|
|
|
+ post("v1/merchant/bankCard",{bank_card: arr}).then(res=>{
|
|
|
+ console.log(res.data,that.formData);
|
|
|
+ if (res.code == 0 && res.data) {
|
|
|
+ let result = res.data
|
|
|
+ console.log(result,"result");
|
|
|
+ that.formData.fileNo = result.fileNo
|
|
|
+ that.formData.merUserId = result.merUserId
|
|
|
+ console.log(that.formData,"that.formData");
|
|
|
+ }else{
|
|
|
+ this.formData.back_business_img = ""
|
|
|
+ return that.$toast(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
submit() {
|
|
|
let that = this
|
|
|
+ console.log(!!this.formData.idcard_front_img && !!this.formData.idcard_back_img,"000");
|
|
|
+ if (!!this.formData.idcard_front_img && !!this.formData.idcard_back_img) {
|
|
|
+ this.formData.idcard_img = "11"
|
|
|
+ }else {
|
|
|
+ this.formData.idcard_img = ""
|
|
|
+ }
|
|
|
+ console.log(this.formData.idcard_img);
|
|
|
+ if (this.formData.user_type == 0) {
|
|
|
+ if (this.formData.card_no.length!=16 && this.formData.card_no.length!=17 && this.formData.card_no.length!=19) {
|
|
|
+ return this.$toast("银行卡卡号长度有误")
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ console.log(this.$refs.form);
|
|
|
this.$refs.form.validate().then((res) => {
|
|
|
- let da = Object.assign({},this.formData);
|
|
|
- da.discount = this.$h.Div(da.discount, 100);
|
|
|
- if(this.submitType == 1){
|
|
|
- post("v1/merchant/edit",{ ...da,shop_id: this.formData.id }).then(res=>{
|
|
|
+ let da = Object.assign({},that.formData);
|
|
|
+ da.discount = that.$h.Div(da.discount, 100);
|
|
|
+ console.log(JSON.stringify(da));
|
|
|
+ if(that.submitType == 1){
|
|
|
+ post("v1/merchant/edit",{ ...da }).then(res=>{
|
|
|
if (res.code == 0) {
|
|
|
that.$toast("修改成功,请关注审核状态")
|
|
|
setTimeout(() => {
|
|
|
@@ -234,7 +353,12 @@ export default {
|
|
|
async getTypeDesc() {
|
|
|
let res = await post("v1/merchant/typeDesc");
|
|
|
if (res.code == 0) {
|
|
|
- this.TypeDesc = res.data
|
|
|
+ this.TypeDesc = res.data,
|
|
|
+ this.TypeDesc.user_type.forEach((val,idx) => {
|
|
|
+ if(val.value == this.formData.user_type){
|
|
|
+ this.current = idx
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
btnClick() {
|
|
|
@@ -262,6 +386,17 @@ export default {
|
|
|
this.$set(this.formData, "longitude", adres.lng)
|
|
|
this.$set(this.formData, "latitude", adres.lat)
|
|
|
},
|
|
|
+ radioChange(evt) {
|
|
|
+ console.log(evt);
|
|
|
+ for (let i = 0; i < this.TypeDesc.user_type.length; i++) {
|
|
|
+ if (this.TypeDesc.user_type[i].value == evt.detail.value) {
|
|
|
+ this.current = i;
|
|
|
+ this.formData.user_type = evt.detail.value;
|
|
|
+ console.log(this.formData.user_type);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
onReady() {
|
|
|
this.$refs.form.setRules(this.rules);
|
|
|
@@ -273,6 +408,8 @@ export default {
|
|
|
if (res.code == 0) {
|
|
|
this.formData = res.data;
|
|
|
this.saleValue = this.formData.user_val
|
|
|
+ this.formData.idcard_img = !!this.formData.idcard_front_img && !!this.formData.idcard_back_img
|
|
|
+ console.log(this.formData);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -396,4 +533,14 @@ export default {
|
|
|
text-align: center;
|
|
|
margin-bottom: 50rpx;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+// ::v-deep .uni-forms-item__content{
|
|
|
+// display: flex !important;
|
|
|
+// align-self: center !important;
|
|
|
+// }
|
|
|
+radio span{
|
|
|
+ font-size: 28rpx;
|
|
|
+}
|
|
|
+
|
|
|
</style>
|