From 5821c36429a5cbb1946e2e4b283d60bab3554680 Mon Sep 17 00:00:00 2001 From: pengda <1111@qq.com> Date: Mon, 21 Jul 2025 18:43:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=99=E7=82=B9=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/site/addSiteStep/step1.vue | 5 +- src/components/site/addSiteStep/step2.vue | 24 +++++++- src/components/site/addSiteStep/step3.vue | 91 +++++++++++++++++++++++++------ src/views/agent/siteAdd.vue | 2 +- 4 files changed, 101 insertions(+), 21 deletions(-) diff --git a/src/components/site/addSiteStep/step1.vue b/src/components/site/addSiteStep/step1.vue index cee02ec..41091bc 100644 --- a/src/components/site/addSiteStep/step1.vue +++ b/src/components/site/addSiteStep/step1.vue @@ -43,7 +43,7 @@

销售方向

- +
@@ -118,6 +118,9 @@ export default { domain: [ { required: true, message: '请设置站点域名', trigger: 'blur' } ], + site_type: [ + { required: true, message: '请选择站点类型', trigger: 'blur' } + ], }, channel_options: [ diff --git a/src/components/site/addSiteStep/step2.vue b/src/components/site/addSiteStep/step2.vue index f1baa7e..fd8b993 100644 --- a/src/components/site/addSiteStep/step2.vue +++ b/src/components/site/addSiteStep/step2.vue @@ -276,7 +276,7 @@
- 跳过 + 去首页 下一步
@@ -332,7 +332,7 @@ export default { bindWxpayId: 0, selectWxpay: null, - bindAlipayId: 10079, + bindAlipayId: null, selectAlipay: null, bindTaobaoId: 0, selectTaobao: null, @@ -365,6 +365,11 @@ export default { return false; } + if(this.siteInfo.sale_channel === '2'){ + this.$emit('handelStep', 3) + return false; + } + this.getSitePayIndex() this.getPayList() this.getAddablePays() @@ -536,9 +541,22 @@ export default { this.getAddablePays() }, jumpStep(){ - this.$emit('handelStep', 3) + this.$router.push('/') }, nextStep() { + if(this.siteInfo.sale_channel === '0' && !this.bindTaobaoId && !this.bindJdId){ + this.$Message.error('请绑定收款方式'); + return false + } + if(this.siteInfo.sale_channel === '1' && !this.bindWxpayId && !this.bindAlipayId){ + this.$Message.error('请绑定收款方式'); + return false + } + if(this.siteInfo.sale_channel === '3' && !this.bindPddId){ + this.$Message.error('请绑定收款方式'); + return false + } + var data = { uid: this.siteInfo.uid, open_processs: 4, diff --git a/src/components/site/addSiteStep/step3.vue b/src/components/site/addSiteStep/step3.vue index c98df49..f74e292 100644 --- a/src/components/site/addSiteStep/step3.vue +++ b/src/components/site/addSiteStep/step3.vue @@ -62,7 +62,7 @@ placement="bottom" trigger="manual" :append-to-body="false" :visible-arrow="true" popper-class="custom-popover" @show="popshow" >
- +

输入>0的数,越小排序越前;重复则新者优先;0则默认排序

取消 @@ -102,16 +102,18 @@ -
- 编辑 - 删除 -
+
@@ -125,14 +127,19 @@ + + + 确定要移除服务吗? +
-
- 跳过 +
+ 跳过 完成
@@ -179,6 +186,9 @@ export default { dialogVisible: false, //是否展示弹框 dialogTitle: "", //弹框标题 editRow:{}, + //删除二次确认 + dialogDelConfim: false, + delRow:{}, // 服务列表url serviceAddUrl: '/agent/siteAddFinally', @@ -202,8 +212,25 @@ export default { }, nextStep(){ //保存数据 + var data = { + uid: this.siteInfo.uid, + } - this.$emit('handelStep', 4) + this.$http('POST', '/agentnew/ajax_add_new_site_complete', data, { + headers: { + 'Auth': this.token + } + }).then(response => { + this.$nextTick(() => { + if (response.status) { + this.$emit('handelStep', 4) + return true; + } + this.$Message.error(response.info); + }) + }).catch(error => { + console.error(error, 'error') + }) }, // 获取服务列表 getSiteServiceList() { @@ -218,9 +245,11 @@ export default { } }).then(response => { that.tableLoading = false - that.$nextTick(() => { - that.serviceList = response.data.service_list - }) + if(response.status && response.data.length>0){ + that.$nextTick(() => { + that.serviceList = response.data.service_list + }) + } }).catch(error => { console.error(error, 'error') }) @@ -235,7 +264,38 @@ export default { serviceAdd(prodid){ this.$router.push(this.serviceAddUrl + '?uid=' + this.siteInfo.uid + '&prodid=' + prodid) }, - + //删除 + handleDelClick(row, index) { + this.dialogDelConfim = true + this.delRow.index = index + this.delRow.type = row.type + }, + handleDelCancel(){ + this.dialogDelConfim = false + }, + handleDelConfirm(){ + const that = this + this.dialogDelConfim = false + this.$http('POST', '/agentnew/ajax_del_service', { + uid: that.siteInfo.uid, + type: that.delRow.type + },{ + headers:{ + 'Auth': this.token + } + }).then(response => { + if(response.status){ + that.$message.success('删除成功'); + this.$nextTick(() => { + that.serviceList.splice(that.delRow.index, 1); + }) + return true; + } + that.$message.error(response.info); + }).catch(error => { + console.error(error, 'error') + }) + }, // 点击价格单元格时触发 handleEditClick(row, index, type) { // 关闭其他行的弹框 @@ -292,13 +352,11 @@ export default { if(res) row.price_desc = getServicePriceDesc(row.price, row.price_unit, row.price_unit_num); }, async onSwitchChange(row){ - console.log(row) let obj = {} obj.uid = this.siteInfo.uid obj.type = row.type obj.is_index_display = row.is_index_display const res = await this.saveRequest('/agentnew/ajax_update_service_show', obj) - console.log(res) if(!res) row.is_index_display = row.is_index_display === "1" ? "0" : "1" }, async saveSort(row){ @@ -308,8 +366,9 @@ export default { obj.sort_id = row.sort_id const res = await this.saveRequest('/agentnew/ajax_update_service_show', obj) if(res) { - row.sort_id = row.edit_sort_id; this.sortServiceList() + }else{ + this.getSiteServiceList() } }, sortServiceList() { diff --git a/src/views/agent/siteAdd.vue b/src/views/agent/siteAdd.vue index 86cc94c..518d98f 100644 --- a/src/views/agent/siteAdd.vue +++ b/src/views/agent/siteAdd.vue @@ -75,7 +75,7 @@ export default { token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTI2NDY1NDUsIm5iZiI6MTc1MjY0NjU0NSwiZXhwIjoxNzU1MjM4NTQ1LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.G-Is-x9qPMiV_urOlDPQVRjfAIozySxL5EK2k82d46k', siteInfo:{}, showAlert:true, - activeStep: '',//当前步骤条 + activeStep: '1',//当前步骤条 process: '', //进度默认为站点开通 prodid: '',//要添加的服务类型 stepDesc: {