Browse Source

收款设置

pull/66/head
rainbro 5 days ago
parent
commit
d997f5811c
  1. 313
      src/views/agent/paySetting.vue

313
src/views/agent/paySetting.vue

@ -4,31 +4,86 @@
<div class="site-setting-wrap min-flex-right">
<div class="siteMessage flex-common">
<h3>支付授权</h3>
<el-form>
<div class="flex-wrap" v-if="payType==payTypeWeixin">
<el-form v-if="payType==payTypeTaoBao">
<div class="flex-wrap">
<div class="flex-left" style="max-width:100%">
<div class="beforeNotice">
<h4 class="flex"> <img src="@/assets/site/siteSemInfo_Icon.svg" alt=""> 前期准备事项</h4>
<p class="mt12 flex">
请确保使用要添加的淘宝主账号登录并授权
</p>
<p class="mt10 flex">
如未购买快乐帮手服务或已过期会跳转到购买服务页面
</p>
</div>
</div>
</div>
</el-form>
<el-form v-else-if="payType==payTypeWeixin">
<div class="flex-wrap">
<div class="flex-left">
<el-form>
<GuipFormItem column="column" class="mb24" label="1. 公司简称">
<span class="desc" slot="formRight">请输入公司简称便于您区分账号所属公司</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="payinfo.short_name" prop="company_short_name" placeholder="6字以内">
</GuipInput>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="2. 支付商户号(mch_id)">
<span class="desc" slot="formRight"><a href='https://pay.weixin.qq.com/' target='_blank'>微信支付平台</a>账户中心商户信息微信支付商户号</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="payinfo.mch_id" prop="mch_id" placeholder="请输入商户号">
</GuipInput>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="3. 微信支付秘钥">
<span class="desc" slot="formRight"><a href='https://pay.weixin.qq.com/' target='_blank'>微信支付平台</a>账号中心账户设置API安全APIv2密钥<p class="mt10">注意支付密钥不能设置为纯数字</p></span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="payinfo.apiv2" prop="payinfo.apiv2" placeholder="请输入微信支付秘钥">
</GuipInput>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="4. 公众号APPID">
<span class="desc" slot="formRight"><a href='https://mp.weixin.qq.com/' target='_blank'>公众平台</a>设置与开发基本配置公众号开发信息开发者IDAPPID</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="payinfo.appid" prop="payinfo.appid" placeholder="请输入公众号APPID">
</GuipInput>
</GuipFormItem>
</div>
<div class="flex-line"></div>
<div class="flex-right">
<div class="preview">
<div class="preview-title">
<p>预览支付二维码</p>
</div>
<div class="preview-content">
</div>
</div>
</div>
</div>
</el-form>
<el-form v-else-if="payType==payTypeAlipay">
<div class="flex-wrap">
<div class="flex-left">
<div v-if="payinfo.is_pay_public==0">
<GuipFormItem column="column" class="mb24" label="1. 公司简称">
<span class="desc" slot="formRight">请输入公司简称便于您区分账号所属公司</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="payinfo.short_name" prop="company_short_name" placeholder="6字以内">
</GuipInput>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="payinfo.short_name" placeholder="6字以内"></GuipInput>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="2. 支付商户号(mch_id)">
<span class="desc" slot="formRight"><a href='https://pay.weixin.qq.com/' target='_blank'>微信支付平台</a>账户中心商户信息微信支付商户号</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="payinfo.mch_id" prop="mch_id" placeholder="请输入商户号">
</GuipInput>
<GuipFormItem column="column" class="mb24" label="2. 公司支付宝账号">
<span class="desc" slot="formRight">仅支持已签约 当面付 功能的公司支付宝</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="payinfo.account" placeholder="请输入公司支付宝账号"></GuipInput>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="3. 微信支付秘钥">
<span class="desc" slot="formRight"><a href='https://pay.weixin.qq.com/' target='_blank'>微信支付平台</a>账号中心账户设置API安全APIv2密钥<p class="mt10">注意支付密钥不能设置为纯数字</p></span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="payinfo.apiv2" prop="payinfo.apiv2" placeholder="请输入微信支付秘钥">
</GuipInput>
</div>
<div v-if="payinfo.is_pay_public==1">
<div class="beforeNotice">
<h4 class="flex"> <img src="@/assets/site/siteSemInfo_Icon.svg" alt=""> 须知</h4>
<p class="mt12">使用平台支付宝支付平台收取5%的服务费</p>
<p class="mt12 flex">使用平台支付宝支付真实姓名必须和支付宝账号实名认证姓名统一</p>
</div>
<GuipFormItem column="column" class="mb24" label="1. 收款人姓名">
<span class="desc" slot="formRight">请输入支付宝绑定的银行卡的持卡人姓名</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="payinfo.receive_payment_name" placeholder="6字以内"></GuipInput>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="4. 公众号APPID">
<span class="desc" slot="formRight"><a href='https://mp.weixin.qq.com/' target='_blank'>公众平台</a>设置与开发基本配置公众号开发信息开发者IDAPPID</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="payinfo.appid" prop="payinfo.appid" placeholder="请输入公众号APPID">
</GuipInput>
<GuipFormItem column="column" class="mb24" label="2. 收款支付宝账号">
<span class="desc" slot="formRight">请输入有效账号</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="payinfo.receive_payment_account" placeholder="请输入有效收款支付宝账号"></GuipInput>
</GuipFormItem>
</el-form>
</div>
</div>
<div class="flex-line"></div>
<div class="flex-right">
@ -43,11 +98,42 @@
</div>
</div>
</el-form>
<el-form v-else-if="payType==payTypePdd">
<div class="flex-wrap">
<div class="flex-left" style="max-width:100%">
<div class="beforeNotice">
<h4 class="flex"> <img src="@/assets/site/siteSemInfo_Icon.svg" alt=""> 前期准备事项</h4>
<p class="mt12 flex">主账号登录并授权<a :href="payinfo.authurl" class="flex" target="_blank"><img src="@/assets/site/form_linkActive.svg" alt="">去授权</a></p>
<p class="mt12 flex gray">如未购买快乐帮手服务或已过期会跳转到购买服务页面</p>
<p class="mt5 flex gray">授权成功后点击下方同步授权</p>
</div>
<GuipFormItem column="column" class="mb24" label="账号名称">
<!-- <span class="desc" slot="formRight">账号名称</span> -->
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="payinfo.account" placeholder="请输入账号名称"></GuipInput>
</GuipFormItem>
</div>
</div>
</el-form>
<el-form v-else-if="payType==payTypeJingdong">
<div class="flex-wrap">
<div class="flex-left" style="max-width:100%">
<div class="beforeNotice">
<h4 class="flex"> <img src="@/assets/site/siteSemInfo_Icon.svg" alt=""> 前期准备事项</h4>
<p class="mt12 flex">请确保使用要添加的京东主账号登录并授权</p>
<p class="mt10 flex">如未购买快乐论文检测服务服务或已过期会跳转到购买服务页面</p>
</div>
<GuipFormItem column="column" class="mb24" label="账号名称">
<!-- <span class="desc" slot="formRight">账号名称</span> -->
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="payinfo.account" placeholder="请输入账号名称"></GuipInput>
</GuipFormItem>
</div>
</div>
</el-form>
</div>
</div>
<div class="register-btns">
<GuipButton type="system" :btnstyle="{ width: '144px', height: '46px' }">取消</GuipButton>
<GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="addPayment">保存</GuipButton>
<GuipButton type="system" :btnstyle="{ width: '144px', height: '46px' }" @click="cancle">取消</GuipButton>
<GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="addPayment">{{ confirmText }}</GuipButton>
</div>
</div>
@ -98,6 +184,7 @@ export default {
payTypeAlipay: PAY_TYPE_ALIPAY,
payTypeJingdong: PAY_TYPE_JINGDONG,
payTypePdd: PAY_TYPE_PDD,
confirmText: '保存',
}
},
computed: {
@ -124,6 +211,11 @@ export default {
this.$nextTick(() => {
this.payinfo = response.data
this.payType = response.data.type
if (this.payType == PAY_TYPE_TAOBAO || this.payType == PAY_TYPE_JINGDONG) {
this.confirmText = '去授权';
} else if (this.payType == PAY_TYPE_PDD) {
this.confirmText = '同步授权';
}
})
}).catch(error => {
console.error(error, 'error')
@ -132,7 +224,7 @@ export default {
//
addPayment() {
if (this.payType == PAY_TYPE_TAOBAO) {
window.open(this.taobaoAuthUrl, '_blank');
window.open(this.payinfo.authurl, '_blank');
} else if (this.payType == PAY_TYPE_WEIXIN) {
this.$http('POST', '/agentnew/ajax_add_weixinpay', {
@ -149,7 +241,6 @@ export default {
this.$nextTick(() => {
if (response.status) {
this.$Message.success(response.info);
this.getPayList();
} else {
this.$Message.error(response.info);
}
@ -160,11 +251,12 @@ export default {
} else if (this.payType == PAY_TYPE_ALIPAY) {
this.$http('POST', '/agentnew/ajax_add_alipay', {
company_short_name: this.company_short_name,
alipay_account: this.alipay_account,
is_pay_public: this.isPayPublic,
receive_payment_account: this.receive_payment_account,
receive_payment_name: this.receive_payment_name
payid: this.$route.query.payid,
company_short_name: this.payinfo.short_name,
alipay_account: this.payinfo.account,
is_pay_public: this.payinfo.is_pay_public,
receive_payment_account: this.payinfo.receive_payment_account,
receive_payment_name: this.payinfo.receive_payment_name
}, {
headers: {
'Auth': this.token
@ -172,13 +264,10 @@ export default {
}).then(response => {
this.$nextTick(() => {
if (response.status) {
if (this.isPayPublic == 1) {
this.$Message.success(response.info);
this.getPayList();
this.receive_payment_account = ''
this.receive_payment_name = ''
if (this.payinfo.is_pay_public == 1) {
this.$Message.success(response.info);
} else {
window.open(response.data.authurl, '_blank');
window.open(response.data.authurl, '_blank');
}
} else {
@ -190,7 +279,7 @@ export default {
})
} else if (this.payType == PAY_TYPE_PDD) {
this.$http('POST', '/agentnew/ajax_add_pddpay', {
shop_name: this.pdd_shop_name,
shop_name: this.payinfo.account,
}, {
headers: {
'Auth': this.token
@ -199,9 +288,6 @@ export default {
this.$nextTick(() => {
if (response.status) {
this.$Message.success(response.info);
this.getPayList();
this.pdd_shop_name = ''
} else {
this.$Message.error(response.info);
}
@ -210,96 +296,15 @@ export default {
console.error(error, 'error')
})
} else if (this.payType == PAY_TYPE_JINGDONG) {
window.open(this.jdAuthUrl, '_blank');
}
},
//
toggleDrop(e){
this.$refs.dropDomain.toggleDropdown(e)
},
changeSelectIp(item) {
//
this.selectedItem1 = { ...item };
},
//
getSiteInfo() {
const that = this
that.siteInfo = []
this.$http('POST', '/agentnew/ajax_get_site_info', {
uid: this.$route.query.uid,
}, {
headers: {
'Auth': this.token
}
}).then(response => {
this.$nextTick(() => {
that.siteInfo = response.data
})
}).catch(error => {
console.error(error, 'error')
})
},
updateSiteInfo() {
this.$http('POST', '/agentnew/ajax_update_site_info', {
uid: this.$route.query.uid,
short_name: this.siteInfo.short_name,
company_name: this.siteInfo.company_name,
company_phone: this.siteInfo.phone_num,
}, {
headers: {
'Auth': this.token
}
}).then(response => {
this.$nextTick(() => {
if (response.status) {
this.$Message.success(response.info);
} else {
this.$Message.error(response.info);
}
})
}).catch(error => {
console.error(error, 'error')
})
},
cancleUpdateSiteInfo() {
this.getSiteInfo();
},
changeNormalWeixin() {
},
changeSelectWeixin(item, flag) {
if (flag) {
this.select_placeholder_weixin = this.options_weixin_null.desc;
return
window.open(this.payinfo.authurl, '_blank');
}
this.selectedItem = { ...item };
console.log(this.selectedItem, 'this.selectedItem====');
},
//
domain_radioChange(type) {
console.log(type, '--');
},
onSwitchChange(data) {
console.log(data, '---');
handleClick(tab, event) {
console.log(tab, event);
},
submitForm(form) {
console.log(this.$refs[form], '-----');
this.$refs[form].validate((valid) => {
console.log(this[form], '======formxinxi');
if (valid) {
alert('提交成功!');
} else {
return false;
}
});
},
cancelClick() {
console.log('quxiao');
},
confirmClick(type) {
console.log(type, '确认');
cancle() {
this.getPayment();
}
}
}
</script>
@ -352,6 +357,68 @@ a {
height: 200px;
}
.beforeNotice {
h4 {
margin: 0;
gap: 8px;
}
margin-bottom: 18px;
text-align: left;
box-sizing: border-box;
padding: 20px 14px;
border-radius: 4px;
/* middle/middle_blue_1 */
background: #F2F7FF;
/* middle/middle_blue_3 */
border: 1px solid #BFDAFF;
div {
margin-top: 2px;
padding-left: 23px;
p {
color: #8A9099;
}
}
p {
color: #1E2226;
i {
font-style: normal;
}
&:last-child {
display: flex;
align-items: stretch;
b {
font-weight: normal;
color: #8A9099;
display: inline-flex;
img {
margin-left: 4px;
}
}
}
}
a {
text-decoration: none;
color: #006AFF;
margin-right: 10px;
img {
margin-left: 5px;
margin-right: 5px;
}
}
}
.siteMessage {
border-radius: 4px;

Loading…
Cancel
Save