diff --git a/src/components/paymentMethod.vue b/src/components/paymentMethod.vue index 579220e..8ac2009 100644 --- a/src/components/paymentMethod.vue +++ b/src/components/paymentMethod.vue @@ -14,7 +14,7 @@ - + @@ -46,8 +46,7 @@ export default { }, }, methods:{ - onSwitchChange(data){ - data.status = data.status === 1 ? 0 : 1; + onSwitchChange(){ this.$emit('confirm', this.list) }, onEnd() { diff --git a/src/components/site/addSiteStep/step1.vue b/src/components/site/addSiteStep/step1.vue index cee02ec..38c2396 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: [ @@ -237,13 +240,16 @@ export default { }).then(response => { if(response.status && response.data.uid){ that.formData.uid = response.data.uid - this.$emit('handelSiteInfo', that.formData) + that.formData.domain_type = that.domainType + that.formData.domain_prefix = that.domainPrefix + that.formData.domain_name = that.domainName + that.$emit('handelSiteInfo', that.formData) - if(this.formData.sale_channel === '2'){ + if(that.formData.sale_channel === '2'){ //自用站点无需设置收款方式 - this.$emit('handelStep', 3) + that.$emit('handelStep', 3) }else{ - this.$emit('handelStep', 2) + that.$emit('handelStep', 2) } return true; } diff --git a/src/components/site/addSiteStep/step2.vue b/src/components/site/addSiteStep/step2.vue index f1baa7e..d4eea0e 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() @@ -410,7 +415,9 @@ export default { }, // 获取支付列表 getPayList() { - this.$http('POST', '/agentnew/ajax_get_pay_list', {},{ + this.$http('POST', '/agentnew/ajax_get_pay_list', { + uid: this.siteInfo.uid + },{ headers:{ 'Auth': this.token } @@ -503,10 +510,8 @@ export default { changeSelectAlipay(item) { this.bindAlipayId = item.payid; this.selectAlipay = item; - console.log(this.bindWxpayId, 'bindWxpayId'); this.selectedItem = { ...item }; - console.log(this.selectedItem, 'this.selectedItem===='); }, changeSelectTaobao(item) { this.bindTaobaoId = item.payid; @@ -536,19 +541,28 @@ export default { this.getAddablePays() }, jumpStep(){ - this.$emit('handelStep', 3) + this.$router.push('/') }, nextStep() { var data = { uid: this.siteInfo.uid, open_processs: 4, - pay_config: { - 0: this.bindTaobaoId, - 2: this.bindWxpayId, - 3: this.bindAlipayId, - 4: this.bindJdId, - 11: this.bindPddId, - }, + pay_config: {}, + } + if(this.siteInfo.sale_channel === '0'){ + if(this.isJd && this.bindJdId) data.pay_config = { 4: this.bindJdId } + if(!this.isJd && this.bindTaobaoId) data.pay_config = { 0: this.bindTaobaoId } + } + if(this.siteInfo.sale_channel === '1'){ + if(this.bindWxpayId) data.pay_config = { 2: this.bindWxpayId } + if(this.bindAlipayId) data.pay_config = { 3: this.bindAlipayId } + } + if(this.siteInfo.sale_channel === '3'){ + if(this.bindPddId) data.pay_config = { 11: this.bindPddId } + } + if(Object.keys(data.pay_config).length === 0) { + this.$Message.error('请绑定收款方式'); + return false } this.$http('POST', '/agentnew/ajax_update_site_pay', data, { diff --git a/src/components/site/addSiteStep/step3.vue b/src/components/site/addSiteStep/step3.vue index c98df49..3131905 100644 --- a/src/components/site/addSiteStep/step3.vue +++ b/src/components/site/addSiteStep/step3.vue @@ -3,22 +3,20 @@

服务列表

-
- 添加查重服务 - 添加写作辅助 - 添加AIGC +
+ 添加{{item}}
- - + + @@ -55,14 +53,13 @@ - @@ -43,6 +197,9 @@ import GuipButton from "@/components/GuipButton.vue"; import GuipInput from "@/components/GuipInput.vue"; import GuipSelect from "@/components/GuipSelect.vue"; +import bindGoods from "@/components/bindGoods.vue"; +import GuipDialog from "@/components/GuipDialog.vue"; +import PromptText from "@/components/PromptText.vue"; export default { name: 'priceSet', @@ -55,92 +212,241 @@ export default { components: { GuipSelect, GuipInput, - GuipButton + GuipButton, + PromptText, + bindGoods, + GuipDialog }, data(){ return { token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTI2NDY1NDUsIm5iZiI6MTc1MjY0NjU0NSwiZXhwIjoxNzU1MjM4NTQ1LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.G-Is-x9qPMiV_urOlDPQVRjfAIozySxL5EK2k82d46k', info:{}, - //添加按钮样式 - saveBtnStyleObj: { - width: '144px', - height: '46px', - borderRadius: '4px', - background: '#006AFF', - }, - options: [{ - value: '选项1', - label1: '黄金hhhhhh', - id1: '1', - id2: '啊11哈哈', - label: '黄金糕' - }, { - value: '选项2', - id1: '12', - id2: '啊22哈哈', - label1: '双皮奶hhhhhhhhh', - label: '双皮奶' - }, { - value: '选项3', - id1: '13', - id2: '啊33哈哈', - label1: '蚵仔煎hhhhhhhhh', - label: '蚵仔煎' - }, { - value: '选项4', - id1: '14', - id2: '啊444哈哈', - label1: '双皮奶hhhhhhhhh', - label: '龙须面' - }, { - value: '选项5', - id1: '155', - id2: '啊55哈哈', - label1: '双皮奶hhhhhhhhh', - label: '北京烤鸭' - }], - form: { - username: '', - language: '', - domain_set: '', - domainSuffix: '11', - domainSuffix1: '.chachongz.com', - card: '1', - input1: '跨年的烟火,绽放天空', - input2: '', - input3: '', - }, + uid: 0, + type: 0, + serviceAddInfo:{}, + service_unit:'', + bindList: [], + showBind: false, + pati: '', + pageCode: '', + dialogDelBindConfim: false, } }, mounted() { this.info = JSON.parse(JSON.stringify(this.serviceInfo)) + if(Object.keys(this.info).length>0){ + this.uid = this.info.uid + this.type = this.info.type + this.getServiceAddInfo() + this.getServiceBindGoods() + } }, methods:{ - saveConfirm() { - let obj = {} - obj.uid = this.info.uid - obj.type = this.info.type - obj.logo_bgcolor = this.tabColor.replace('#','') - obj.link_btn_color = this.themeColor.replace('#','') - obj.selected_nav_bgcolor = this.navColor.replace('#','') - + //获得要添加的服务信息 + getServiceAddInfo() { + const that = this + that.$http('POST', '/agentnew/ajax_get_service_add_info', { + uid: that.uid, + type: that.type, + }, { + headers: { + 'Auth': this.token + } + }).then(response => { + if (response.status) { + that.$nextTick(() => { + that.serviceAddInfo = response.data + that.service_unit = that.serviceAddInfo.unit + //拼多多渠道查询商品所需参数初始化 + if (that.serviceAddInfo.shop_name === '拼多多') this.initPddParam(that.uid) + }) + return true + } + that.$message.error(response.info); + }).catch(error => { + console.error(error, 'error') + }) + }, + //查询绑定的宝贝 + getServiceBindGoods() { const that = this - this.$http('POST', '/agentnew/ajax_update_service_style', obj,{ - headers:{ + that.$http('POST', '/agentnew/ajax_get_service_bind_goods', { + uid: that.uid, + type: that.type, + }, { + headers: { 'Auth': this.token } }).then(response => { - if(response.status){ + if (response.status && response.data) { + that.$nextTick(() => { + that.bindList = response.data + }) + } + }).catch(error => { + console.error(error, 'error') + }) + }, + handleUnitName(){ + this.serviceAddInfo.unit_name = this.serviceAddInfo.set_units[this.service_unit] + }, + resetPrice() { + this.info.price = '' + this.info.unit_num = '' + this.info.b_unit_price = '' + this.info.b_unit_num = '' + }, + savePrice() { + const that = this + //非字符计费 + if(that.service_unit !== '0') { + that.info.unit_num = 1 + that.info.base_unit_num = '' + that.info.base_unit_price = '' + } + this.$http('POST', "/agentnew/ajax_set_service_price", { + uid: that.uid, + type: that.type, + unit: that.service_unit, + unit_num: that.info.unit_num, + unit_price: that.info.price, + b_unit_num: that.info.base_unit_num, + b_unit_price: that.info.base_unit_price, + }, { + headers: { + 'Auth': this.token + } + }).then(response => { + if (response.status) { that.$message.success('保存成功'); + return true; + } + that.$message.error(response.info); + }).catch(error => { + console.error(error, 'error') + }) + }, + resetShopPrice() { + this.info.unit_piece = '' + this.info.unit_num = '' + this.info.b_unit_piece = '' + this.info.b_unit_num = '' + }, + saveShopPrice() { + const that = this + //非字符计费 单位默认为 1 + //非字符计费 + if(that.service_unit !== '0') { + that.info.unit_num = 1 + that.info.base_unit_num = '' + that.info.base_unit_piece = '' + } + this.$http('POST', "/agentnew/ajax_set_service_price", { + uid: that.uid, + type: that.type, + unit: that.service_unit, + unit_num: that.info.unit_num, + unit_piece: that.info.unit_piece, + b_unit_num: that.info.base_unit_num, + b_unit_piece: that.info.base_unit_piece, + }, { + headers: { + 'Auth': this.token + } + }).then(response => { + if (response.status) { + that.$message.success('保存成功'); + return true; + } + that.$message.error(response.info); + }).catch(error => { + console.error(error, 'error') + }) + }, + //------绑定相关 start------ + bindGoods() { + this.showBind = true + }, + handleBind(bindRes) { + this.showBind = false + if (bindRes) this.getServiceBindGoods() + }, + async getPddPageCode(uid) { + const that = this + return await that.$http('POST', '/agentnew/ajax_get_pdd_page_code', { + uid: uid, + }, { + headers: { + 'Auth': this.token + } + }).then(response => { + return response.data + }).catch(error => { + console.error(error, 'error') + }) + }, + async initPddParam(uid) { + if (typeof window.PDD_OPEN_init === 'function') { + this.pageCode = await this.getPddPageCode(uid) - let color_info = {} - color_info.logo_bgcolor = obj.logo_bgcolor - color_info.link_btn_color = obj.link_btn_color - color_info.selected_nav_bgcolor = obj.selected_nav_bgcolor - that.info.color_info = color_info - - that.$emit('saveEvent', that.info) + await window.PDD_OPEN_init({ code: this.pageCode }) + this.pati = await window.PDD_OPEN_getPati() + } else { + console.error('PDD_OPEN_init 不存在,SDK 未正确加载'); + } + }, + handleDelBindClick(row, index) { + this.dialogDelBindConfim = true + this.delRow.index = index + this.delRow.row = row + }, + handleDelBindCancel() { + this.dialogDelBindConfim = false + }, + handleDelBindConfirm() { + const that = this + this.dialogDelBindConfim = false + this.$http('POST', '/agentnew/ajax_del_bind_service_goods', { + uid: that.uid, + type: that.type, + numiid: that.delRow.row.num_iid, + skuid: that.delRow.row.sku_id, + paytype: that.delRow.row.pay_type, + }, { + headers: { + 'Auth': this.token + } + }).then(response => { + if (response.status) { + that.$message.success('删除成功'); + this.$nextTick(() => { + that.bindList.splice(that.delRow.index, 1); + }) + return true; + } + that.$message.error(response.info); + }).catch(error => { + console.error(error, 'error') + }) + }, + handleDefaultConfirm(id) { + const that = this + this.$http('POST', '/agentnew/ajax_default_bind_setting', { + uid: that.uid, + type: that.type, + id: id, + }, { + headers: { + 'Auth': this.token + } + }).then(response => { + if (response.status) { + that.$message.success('设置成功'); + that.bindList.forEach((item) => { + item.is_default = '0' + if (item.id === id) item.is_default = '1' + }); return true; } that.$message.error(response.info); @@ -148,27 +454,126 @@ export default { console.error(error, 'error') }) }, + //------绑定相关 end------ } } \ No newline at end of file diff --git a/src/components/site/serviceSetting/reportSeoSet.vue b/src/components/site/serviceSetting/reportSeoSet.vue index 5a3db23..0c74482 100644 --- a/src/components/site/serviceSetting/reportSeoSet.vue +++ b/src/components/site/serviceSetting/reportSeoSet.vue @@ -11,7 +11,7 @@
- diff --git a/src/components/site/serviceSetting/showSet.vue b/src/components/site/serviceSetting/showSet.vue index 4253d10..be7f320 100644 --- a/src/components/site/serviceSetting/showSet.vue +++ b/src/components/site/serviceSetting/showSet.vue @@ -14,12 +14,12 @@
- - @@ -50,8 +50,8 @@

控制首页是否显示本服务

- +
@@ -61,8 +61,8 @@

本服务检测页面是否展示价格

- +
@@ -75,8 +75,8 @@

开启即上推荐位

- +
@@ -179,9 +179,6 @@ export default { saveBack(){ this.saveSuccess = false }, - onSwitchChange(attr){ - this.info[attr] = this.info[attr] === 1 ? 0 : 1 - }, saveConfirm() { let obj = {} obj.uid = this.info.uid diff --git a/src/components/site/serviceSetting/submitSeoSet.vue b/src/components/site/serviceSetting/submitSeoSet.vue index 74b8892..8ef984f 100644 --- a/src/components/site/serviceSetting/submitSeoSet.vue +++ b/src/components/site/serviceSetting/submitSeoSet.vue @@ -11,7 +11,7 @@
- diff --git a/src/views/agent/siteAdd.vue b/src/views/agent/siteAdd.vue index d16e586..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: { @@ -154,7 +154,7 @@ export default { handelStep(step){ if(step === 4){ //跳转主页面 - this.$message.success('保存成功'); + this.$router.push('/agent/siteList') return true; } diff --git a/src/views/agent/siteAddFinally.vue b/src/views/agent/siteAddFinally.vue deleted file mode 100644 index 4f93203..0000000 --- a/src/views/agent/siteAddFinally.vue +++ /dev/null @@ -1,422 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/agent/siteBaseSetting.vue b/src/views/agent/siteBaseSetting.vue index 528805d..b7cde36 100644 --- a/src/views/agent/siteBaseSetting.vue +++ b/src/views/agent/siteBaseSetting.vue @@ -533,7 +533,7 @@ export default { // 获取支付列表 getPayList() { this.$http('POST', '/agentnew/ajax_get_pay_list', { - gid: this.gid, + uid: this.$route.query.uid, },{ headers:{ 'Auth': this.token diff --git a/src/views/agent/siteServiceAdd.vue b/src/views/agent/siteServiceAdd.vue index a433fb9..c7dd44f 100644 --- a/src/views/agent/siteServiceAdd.vue +++ b/src/views/agent/siteServiceAdd.vue @@ -1,7 +1,7 @@