Browse Source

Merge branch 'master' of gitea.intra.yunpaper.com:zhangqi/kuailelunwen_new_houtai into zq-perSliderMenu

pull/103/head
zq 3 weeks ago
parent
commit
13a2a548c7
  1. 20
      src/components/GuipRadio.vue
  2. 25
      src/components/pay/addPay.vue
  3. 28
      src/components/site/addSiteStep/step2.vue
  4. 64
      src/views/agent/siteBaseSetting.vue

20
src/components/GuipRadio.vue

@ -138,10 +138,16 @@ export default {
// //
const isSelected = this.getValue(option) === this.selectedValue; const isSelected = this.getValue(option) === this.selectedValue;
// selectedLabellabelKey // selectedLabel
return isSelected && option[this.selectedLabelKey] if (isSelected && option[this.selectedLabelKey]) {
? option[this.selectedLabelKey] return option[this.selectedLabelKey];
: option[this.labelKey] || option; }
// labelKey
if (typeof option === 'object' && this.labelKey in option) {
return option[this.labelKey];
}
return option;
}, },
getValue(option) { getValue(option) {
// //
@ -149,7 +155,11 @@ export default {
return option.key; return option.key;
} }
return option[this.valueKey] || option; // valueKey
if (typeof option === 'object' && this.valueKey in option) {
return option[this.valueKey];
}
return option;
}, },
// //
isDisabled(key) { isDisabled(key) {

25
src/components/pay/addPay.vue

@ -287,7 +287,7 @@ export default {
}).then(response => { }).then(response => {
this.$nextTick(() => { this.$nextTick(() => {
if (response.status) { if (response.status) {
this.init(); this.init(response.data);
this.$Message.success(response.info); this.$Message.success(response.info);
} else { } else {
@ -308,13 +308,12 @@ export default {
}).then(response => { }).then(response => {
this.$nextTick(() => { this.$nextTick(() => {
if (response.status) { if (response.status) {
this.init(response.data.payid);
if (this.isPayPublic == 1) { if (this.isPayPublic == 1) {
this.init();
this.$Message.success(response.info); this.$Message.success(response.info);
} else { } else {
window.open(response.data.authurl, '_blank'); window.open(response.data.authurl, '_blank');
} }
} else { } else {
this.$Message.error(response.info); this.$Message.error(response.info);
} }
@ -328,7 +327,7 @@ export default {
}).then(response => { }).then(response => {
this.$nextTick(() => { this.$nextTick(() => {
if (response.status) { if (response.status) {
this.init(); this.init(response.data);
this.$Message.success(response.info); this.$Message.success(response.info);
} else { } else {
this.$Message.error(response.info); this.$Message.error(response.info);
@ -356,10 +355,24 @@ export default {
handleClick(tab, event) { handleClick(tab, event) {
console.log(tab, event); console.log(tab, event);
}, },
init() { init(payid) {
this.addPayDialogVisible = false; this.addPayDialogVisible = false;
this.$emit('update:visible', false); this.$emit('update:visible', false);
this.resetForm(); // this.resetForm(); //
if(payid){
this.$http('POST', '/agentnew/ajax_get_payinfo', {
payid: payid,
}).then(response => {
this.$nextTick(() => {
if (response.status) {
this.$emit('update:data', response.data);
}
})
}).catch(error => {
console.error(error, 'error')
})
}
}, },
},watch: { },watch: {
visible(newVal) { visible(newVal) {

28
src/components/site/addSiteStep/step2.vue

@ -270,7 +270,7 @@
</el-form> </el-form>
</template> </template>
<addPay :payType="addPayType" :visible="isShowAddPay" @update:visible="handleEvent" <addPay :payType="addPayType" :visible="isShowAddPay" @update:visible="handleEvent" @update:data="handleUpdateEvent"
:taobaoAuthUrl="taobaoAuthUrl" :isExistSelfSupplys="isExistSelfSupplys" :pddAuthUrl="pddAuthUrl" :jdAuthUrl="jdAuthUrl"></addPay> :taobaoAuthUrl="taobaoAuthUrl" :isExistSelfSupplys="isExistSelfSupplys" :pddAuthUrl="pddAuthUrl" :jdAuthUrl="jdAuthUrl"></addPay>
</div> </div>
</div> </div>
@ -534,8 +534,30 @@ export default {
}, },
handleEvent(data) { handleEvent(data) {
this.isShowAddPay = data this.isShowAddPay = data
// this.getPayList() this.getPayList()
// this.getAddablePays() this.getAddablePays()
},
handleUpdateEvent(data) {
if (data.type == this.payTypeWeixin) {
this.bindWxpayId = data.payid
this.selectWxpay = data
}
if (data.type == this.payTypeAlipay) {
this.bindAlipayId = data.payid
this.selectAlipay = data
}
if (data.type == this.payTypeTaoBao) {
this.bindTaobaoId = data.payid
this.selectTaobao = data
}
if (data.type == this.payTypePdd) {
this.bindPddId = data.payid
this.selectPdd = data
}
if (data.type == this.payTypeJingdong) {
this.bindJdId = data.payid
this.selectJd = data
}
}, },
jumpStep(){ jumpStep(){
this.$router.push('/') this.$router.push('/')

64
src/views/agent/siteBaseSetting.vue

@ -68,6 +68,20 @@
<GroupFormBtns @cancel="cancelClick" @confirm="updateSiteDomain()" /> <GroupFormBtns @cancel="cancelClick" @confirm="updateSiteDomain()" />
</div> </div>
<div class="siteMessage flex-common" id="siteMessage2">
<h3>销售渠道</h3>
<el-form ref="domainFormRef">
<div class="flex-wrap">
<div class="flex-left">
<div class="flex mt12">
<GuipRadio v-model="saleChannel" :options="saleChannels" prop="key" label-key="name" value-key="channel" @change="changeSaleChannel" />
</div>
</div>
</div>
</el-form>
<GroupFormBtns @cancel="cancelClick" @confirm="updateSaleChannel()" />
</div>
<div class="siteMessage flex-common" id="siteMessage3"> <div class="siteMessage flex-common" id="siteMessage3">
<h3>收款方式<span>至少需要配置1种收款方式</span></h3> <h3>收款方式<span>至少需要配置1种收款方式</span></h3>
<el-form ref="formRef"> <el-form ref="formRef">
@ -290,7 +304,7 @@
</div> </div>
</div> </div>
<addPay :payType="addPayType" :visible="isShowAddPay" @update:visible="handleEvent" <addPay :payType="addPayType" :visible="isShowAddPay" @update:visible="handleEvent" @update:data="handleUpdateEvent"
:taobaoAuthUrl="taobaoAuthUrl" :isExistSelfSupplys="isExistSelfSupplys" :pddAuthUrl="pddAuthUrl" :jdAuthUrl="jdAuthUrl"></addPay> :taobaoAuthUrl="taobaoAuthUrl" :isExistSelfSupplys="isExistSelfSupplys" :pddAuthUrl="pddAuthUrl" :jdAuthUrl="jdAuthUrl"></addPay>
</div> </div>
</template> </template>
@ -394,6 +408,9 @@ export default {
{ required: true, message: '请设置站点域名', trigger: [] } { required: true, message: '请设置站点域名', trigger: [] }
], ],
}, },
saleChannels: [],
saleChannel: 0,
} }
}, },
computed: { computed: {
@ -516,6 +533,8 @@ export default {
this.siteDomain = response.data.domain; this.siteDomain = response.data.domain;
this.domainPrefix = response.data.domain_prefix this.domainPrefix = response.data.domain_prefix
this.domainName = response.data.domain_name this.domainName = response.data.domain_name
this.saleChannels = response.data.sale_channels;
this.saleChannel = Number(response.data.sale_channel);
if ( if (
response.data && response.data &&
@ -643,6 +662,9 @@ export default {
domainChange(){ domainChange(){
this.domainData.domainPrefix = this.domainPrefix this.domainData.domainPrefix = this.domainPrefix
}, },
changeSaleChannel(data) {
console.log(data, 'changeSaleChannel');
},
onSwitchChange(data) { onSwitchChange(data) {
console.log(data, '---'); console.log(data, '---');
}, },
@ -690,6 +712,28 @@ export default {
handleEvent(data) { handleEvent(data) {
this.isShowAddPay = data this.isShowAddPay = data
}, },
handleUpdateEvent(data){
if (data.type == this.payTypeWeixin) {
this.bindWxpayId = data.payid
this.selectWxpay = data
}
if (data.type == this.payTypeAlipay) {
this.bindAlipayId = data.payid
this.selectAlipay = data
}
if (data.type == this.payTypeTaoBao) {
this.bindTaobaoId = data.payid
this.selectTaobao = data
}
if (data.type == this.payTypePdd) {
this.bindPddId = data.payid
this.selectPdd = data
}
if (data.type == this.payTypeJingdong) {
this.bindJdId = data.payid
this.selectJd = data
}
},
handleEvent2(data) { handleEvent2(data) {
this.siteDomain = data.prefix + data.domain; this.siteDomain = data.prefix + data.domain;
this.domainPrefix = data.prefix this.domainPrefix = data.prefix
@ -739,6 +783,24 @@ export default {
}) })
} }
},
updateSaleChannel() {
this.$http('POST', '/agentnew/ajax_update_site_sale_channel', {
uid: this.$route.query.uid,
sale_channel: this.saleChannel,
}).then(response => {
this.$nextTick(() => {
if (response.status) {
this.$Message.success(response.info);
this.getSiteInfo();
} else {
this.$Message.error(response.info);
}
})
}).catch(error => {
console.error(error, 'error')
})
} }
} }

Loading…
Cancel
Save