diff --git a/src/App.vue b/src/App.vue index f6dda01..9f8fcd7 100755 --- a/src/App.vue +++ b/src/App.vue @@ -58,16 +58,6 @@ export default { mounted() { window.addEventListener('beforeunload', this.clearStorage); console.log(this.secondMenu,'secondMenu===='); - if (!this.secondMenu || this.secondMenu.length === 0 || Object.keys(this.secondMenu).length == 0) { - // 尝试从 localStorage 恢复 - console.log(savedData,'savedData'); - const savedData = localStorage.getItem('selectedServices'); - if (savedData) { - this.$store.commit('SET_SECOND_MENU', JSON.parse(savedData)); - } else { - this.$router.go(-1); - } - } }, beforeUnmount() { window.removeEventListener('beforeunload', this.clearStorage); diff --git a/src/components/SliderMenu.vue b/src/components/SliderMenu.vue index 95a2933..7f13e53 100644 --- a/src/components/SliderMenu.vue +++ b/src/components/SliderMenu.vue @@ -162,6 +162,12 @@ export default { // }, handleSelect(index, indexPath, menuItem) { if (menuItem.path && this.$route.path !== menuItem.path) { + //menu增加属性 external: true, + if(menuItem.external){ + // location.href= menuItem.path + window.open(menuItem.path, '_blank') + return + } this.$router.push(menuItem.path); } }, diff --git a/src/components/SliderScondThree.vue b/src/components/SliderScondThree.vue index b51b450..9023404 100644 --- a/src/components/SliderScondThree.vue +++ b/src/components/SliderScondThree.vue @@ -14,11 +14,9 @@ :class="['flex-between point gap8 menuListItem', activeFloor == item1[renderKeyNew.subtitle] ? 'curActive' : '']" :key="index1"> {{ item1[renderKeyNew.subtitle] }} - 设置价格中 + 设置价格中 {{ item1.unit_price }}元/{{ item1.unit_num }}字 - - - + {{ item1.unit_price }}元/篇 @@ -83,14 +81,11 @@ export default { menuList:{ handler(newVal, oldVal) { this.activeNames = newVal.map(item => item.type) - console.log( this.activeNames,' this.activeNames='); - // console.log(newVal, oldVal,'---====val'); // 初次加载或强制刷新时,oldVal为空 if (!oldVal || oldVal.length === 0) { this.setDefaultActive(newVal); return; } - // console.log(newVal,'newVal==='); // 检查当前高亮的菜单项是否仍然存在于新的menuList中 const currentItemExists = this.checkCurrentItem(newVal); // console.log(currentItemExists,'currentItemExists--'); @@ -151,7 +146,8 @@ export default { const subtitle = this.renderKeyNew.subtitle; this.activeFloor = menuList[0].list[0][subtitle] || menuList[0].list[0]?.componentsName || ''; this.componentsName = menuList[0].list[0]?.componentsName || ''; - this.currentMenuItem = menuList[0].list[0] + this.currentMenuItem = {...menuList[0].list[0]} + console.log('更新了'); store.commit('SET_CURRENTMENUITEM', menuList[0].list[0]); this.curIndex = 0; } @@ -235,8 +231,8 @@ export default { // }, 1000) // } setActiveCur(item1, item, index) { - console.log(item1,'===---item1'); - store.commit('SET_CURRENTMENUITEM', item1); + console.log(item1,item,'===---item1'); + store.commit('SET_CURRENTMENUITEM', {...item1,parentType:item.type}); this.currentMenuItem = item1; this.curIndex = index; let subtitle = this.renderKeyNew.subtitle; diff --git a/src/store/index.js b/src/store/index.js index 8c36200..04d7375 100755 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,94 +1,19 @@ import Vue from 'vue'; import Vuex from 'vuex'; - +// import createPersistedState from 'vuex-persistedstate'; Vue.use(Vuex) export default new Vuex.Store({ state: { - showSecondSide:false, + showSecondSide: false, showSidebar: false, showFooter: false, showHeader: false, showHeaderRight: false, menuList: [], //目录菜单 - // secondMenu:{ - // '1': { - // type: '1', - // name: '万方数字哈哈哈哈', - // is_select: false, - // list: [ - // { - // type: '29', - // name: '万方通用版44生生世世生生世世', - // is_select: true, - // //componentsName:'1-1' - // }, - // { - // type: '30', - // name: '通用说播版44', - // is_select: false, - // //componentsName:'1-2' - // }, - // { - // type: '32', - // name: '本科通用版44', - // is_select: false, - // //componentsName:'1-3' - // }, - // ] - // }, - // '3': { - // type: '3', - // name: '万方个哥哥个', - // is_select: true, - // list: [ - // { - // type: '6', - // name: '万方通用版a salads asides33', - // is_select: true, - // //componentsName:'2-2' - // }, - // { - // type: '27', - // name: '通用说播版33', - // is_select: true, - // //componentsName:'2-3' - // }, - // { - // type: '109', - // name: '本科通用版33', - // is_select: true, - // //componentsName:'2-4' - // }, - // ] - // }, - // '6': { - // type: '6', - // name: '万方', - // is_select: true, - // list: [ - // { - // type: '10', - // name: '万方通用版11', - // is_select: false, - // //componentsName:'3-4' - // }, - // { - // type: '11', - // name: '通用说播版11', - // is_select: true, - // //componentsName:'3-5' - // }, - // { - // type: '105', - // name: '本科通用版11', - // is_select: false, - // //componentsName:'3-4' - // }, - // ] - // }, - // }, - secondMenu:{},//第三种侧边栏 -- 可折叠、 切换显示 + secondMenu: {}, + + // secondMenu:{},//第三种侧边栏 -- 可折叠、 切换显示 showBreadcrumb: false, //是否展示面包屑 breadRightText: '', //是否展示面包屑 breadRightTextLink: '', //是否展示面包屑 @@ -96,18 +21,16 @@ export default new Vuex.Store({ addServiceList: [], //选中的服务 isLoading: false, //页面loading customize: false, //页面loading - componentsName:'', - currentMenuItem:null, - slidermenu:[], + componentsName: '', + currentMenuItem: null, + slidermenu: [], // 第二种侧边栏--单项可跳转 - rankMenuData: [ - { + rankMenuData: [{ name: '总利润', path: '', - img:'site/sitebase.svg', + img: 'site/sitebase.svg', imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '年排行', path: '/super/ranking/yearProfit' }, @@ -120,10 +43,9 @@ export default new Vuex.Store({ { name: '产品', path: '', - img:'site/sitebase.svg', + img: 'site/sitebase.svg', imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '毛利润排行', path: '/super/ranking/checkProfit' }, @@ -144,10 +66,9 @@ export default new Vuex.Store({ { name: '代理商', path: '', - img:'site/sitebase.svg', + img: 'site/sitebase.svg', imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '毛利润排行', path: '/super/ranking/agentProfit' }, @@ -164,10 +85,9 @@ export default new Vuex.Store({ { name: '设置', path: '', - img:'site/sitebase.svg', + img: 'site/sitebase.svg', imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '采购价', path: '/super/ranking/purchase' }, @@ -179,19 +99,17 @@ export default new Vuex.Store({ }, ], // 第一种侧边栏--可折叠、可跳转 - menuData: [ - { + menuData: [{ index: '1', title: '首页', - path:'/', + path: '/', icon: 'home', }, { index: '2', title: '订单列表', icon: 'orderList', - children: [ - { + children: [{ index: '2-1', title: '查重订单', path: '/agent/checkOrderList' @@ -213,32 +131,34 @@ export default new Vuex.Store({ title: '销售渠道', icon: 'channel', children: [{ - index: '3-1', - title: '站点列表', - path: '/agent/siteList' - }, - ] + index: '3-1', + title: '站点列表', + path: '/agent/siteList' + }, ] }, { index: '4', title: '财务', icon: 'Totalprofit', children: [{ - index: '4-1', - title: '收款方式', - path: '/agent/payList' - }, - ] + index: '4-1', + title: '收款方式', + path: '/agent/payList' + },{ + index: '4-2', + title: '代收款结算', + path:'http://admin.pengda.checkcopy.com/pay/payoff_list?tab=info', + external: true,//是否跳转外部链接 + } + ] } ], - siteSettingData1:[ - { + siteSettingData1: [{ name: '基本设置', path: '/agent/siteBaseSetting', - img:'site/sitebase.svg', + img: 'site/sitebase.svg', imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '站点信息', desc: 'siteMessage1' }, @@ -261,8 +181,7 @@ export default new Vuex.Store({ path: '/agent/sitePersonalization', img: 'site/gexinghua.svg', imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '网页模板', desc: 'siteMessage4' }, @@ -289,8 +208,7 @@ export default new Vuex.Store({ path: '/agent/siteMobileSetting', img: 'site/siteh5.svg', imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '微信H5', desc: 'siteMessage9' }, @@ -305,8 +223,7 @@ export default new Vuex.Store({ path: '/siteSetting/siteSem', img: 'site/sitesem.svg', imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: 'SEO设置', desc: 'siteMessage11' }, @@ -321,14 +238,13 @@ export default new Vuex.Store({ ] } ], - siteSettingData:[//第二种侧边栏 -- 点击单项进行页面滚动 + siteSettingData: [ //第二种侧边栏 -- 点击单项进行页面滚动 { name: '基本设置', path: '/agent/siteBaseSetting', - img:'site/sitebase.svg', + img: 'site/sitebase.svg', imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '站点信息', desc: 'siteMessage1' }, @@ -351,8 +267,7 @@ export default new Vuex.Store({ path: '/agent/sitePersonalization', img: 'site/gexinghua.svg', imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '网页模板', desc: 'siteMessage4' }, @@ -379,8 +294,7 @@ export default new Vuex.Store({ path: '/agent/siteMobileSetting', img: 'site/siteh5.svg', imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '微信H5', desc: 'siteMessage9' }, @@ -399,8 +313,7 @@ export default new Vuex.Store({ path: '/agent/siteSemSetting', img: 'site/sitesem.svg', imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: 'SEO设置', desc: 'siteMessage11' }, @@ -415,33 +328,32 @@ export default new Vuex.Store({ ] } ], - siteServiceSettingData:[//第二种侧边栏 -- 单项切换对应组件 + siteServiceSettingData: [ //第二种侧边栏 -- 单项切换对应组件 { name: '服务设置', - path: '',//设置为空 - img:'site/settingIcon.svg', - noToPath:true, + path: '', //设置为空 + img: 'site/settingIcon.svg', + noToPath: true, imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '价格设置', - desc: 'priceSet',//和组件名称、componentsName 一致 - componentsName:'priceSet'//和页面内引入的组件名称 、及上面desc 一致 + desc: 'priceSet', //和组件名称、componentsName 一致 + componentsName: 'priceSet' //和页面内引入的组件名称 、及上面desc 一致 }, { name: '收款设置', desc: 'paymentSet', - componentsName:'paymentSet' + componentsName: 'paymentSet' }, { name: '展示设置', desc: 'showSet', - componentsName:'showSet' + componentsName: 'showSet' }, { name: '页面品牌与色彩', desc: 'menuColorSet', - componentsName:'menuColorSet' + componentsName: 'menuColorSet' } ] }, @@ -449,18 +361,17 @@ export default new Vuex.Store({ name: 'SEO优化', path: '', img: 'site/sitesem.svg', - noToPath:true, + noToPath: true, imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '提交页SEO', desc: 'submitSeoSet', - componentsName:'submitSeoSet' + componentsName: 'submitSeoSet' }, { name: '报告页SEO', desc: 'reportSeoSet', - componentsName:'reportSeoSet' + componentsName: 'reportSeoSet' }, ] }, @@ -468,86 +379,79 @@ export default new Vuex.Store({ name: '域名与链接', path: '', img: 'site/form_link.svg', - noToPath:true, + noToPath: true, imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '独立域名', desc: 'domainSet', - componentsName:'domainSet' + componentsName: 'domainSet' }, { name: '自定义导航', desc: 'linkSet', - componentsName:'linkSet' + componentsName: 'linkSet' }, ] } ], - demoPageData:[ - { + demoPageData: [{ name: '支付授权', - path: '',//设置为空 - img:'site/pay.svg', - noToPath:true, + path: '', //设置为空 + img: 'site/pay.svg', + noToPath: true, imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { - name: '默认展示组件', - desc: 'Franchise1',//和组件名称、componentsName 一致 - componentsName:'Franchise1'//和页面内引入的组件名称 、及上面desc 一致 - } - ] + list: [{ + name: '默认展示组件', + desc: 'Franchise1', //和组件名称、componentsName 一致 + componentsName: 'Franchise1' //和页面内引入的组件名称 、及上面desc 一致 + }] }, { name: '支付设置', path: '', img: 'site/setting.svg', - noToPath:true, + noToPath: true, imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '平台退款', desc: 'Register', - componentsName:'Register' + componentsName: 'Register' }, { name: '管理证书', desc: 'Franchise', - componentsName:'Franchise' + componentsName: 'Franchise' }, ] }, ], - paySettingData:[ - { + paySettingData: [{ name: '支付授权', path: '/agent/payInfoSetting', - img:'site/pay.svg', + img: 'site/pay.svg', imgActive: require('@/assets/site/sitebase_active.svg'), list: [], - permission:[0,4,11,2,3] + permission: [0, 4, 11, 2, 3] }, { name: '钱款交易', path: '/agent/payCertSetting', - img:'site/pay_trade.svg', + img: 'site/pay_trade.svg', imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '管理证书', desc: 'siteMessage1', - permission:[2] + permission: [2] }, { name: '平台退款', desc: 'siteMessage2', - permission:[3,2] + permission: [3, 2] }, { name: '分账管理', desc: 'siteMessage3', - permission:[2] + permission: [2] }, ], }, @@ -556,21 +460,20 @@ export default new Vuex.Store({ path: '/agent/paySetting', img: 'site/setting.svg', imgActive: require('@/assets/site/sitebase_active.svg'), - list: [ - { + list: [{ name: '支付客服', desc: 'siteMessage4', - permission:[2] + permission: [2] }, { name: '启停收款方式', desc: 'siteMessage5', - permission:[0,4,11,3,2], + permission: [0, 4, 11, 3, 2], }, { name: '移除收款方式', desc: 'siteMessage6', - permission:[0,4,11,3,2], + permission: [0, 4, 11, 3, 2], }, ] }, @@ -654,23 +557,25 @@ export default new Vuex.Store({ }, }, mutations: { - SET_CURRENTMENUITEM(state,data){ + SET_CURRENTMENUITEM(state, data) { + // console.log(data,'=====data====currentMenuItem'); state.currentMenuItem = data && JSON.parse(JSON.stringify(data)); }, - SET_COMPONENTS_NAME(state,name){ + SET_COMPONENTS_NAME(state, name) { state.componentsName = name; }, - SET_SLIDER_MENU(state,type){ - if(typeof(type) == 'string'){ + SET_SLIDER_MENU(state, type) { + if (typeof (type) == 'string') { state.slidermenu = state[type] - }else{ + } else { state.slidermenu = type } }, - SET_SECOND_MENU(state,data){ + SET_SECOND_MENU(state, data) { state.secondMenu = data && JSON.parse(JSON.stringify(data)) + localStorage.setItem('selectedServices',JSON.stringify(data)) }, - SET_CUSTOMIZE(state,show) { + SET_CUSTOMIZE(state, show) { state.customize = show }, SHOW_LOADING(state) { @@ -712,6 +617,6 @@ export default new Vuex.Store({ getters: { menuData: state => state.menuData }, - + // plugins: [createPersistedState()], modules: {} }) \ No newline at end of file diff --git a/src/views/agent/siteAddChooseService.vue b/src/views/agent/siteAddChooseService.vue index 83dda80..c8a4258 100644 --- a/src/views/agent/siteAddChooseService.vue +++ b/src/views/agent/siteAddChooseService.vue @@ -116,6 +116,7 @@ export default { list.push({ type: type, name: this.type2name[type], + parentType:key }) }) @@ -127,7 +128,6 @@ export default { } }); store.commit('SET_SECOND_MENU', result); - localStorage.setItem('selectedServices',JSON.stringify(result)) this.$router.push(this.serviceAddUrl + '?uid=' + this.uid + '&prodid=' + this.prodid) }, // 初始化请求 diff --git a/src/views/agent/siteServiceAdd.vue b/src/views/agent/siteServiceAdd.vue index eae3310..2731944 100644 --- a/src/views/agent/siteServiceAdd.vue +++ b/src/views/agent/siteServiceAdd.vue @@ -27,19 +27,19 @@

- {{ }}人工摘要翻译 - {{ }}站点开通服务后,除了新增了翻译入口外,该站点的检测服务网页的右上角会显示翻译的广告宣传图,点击会跳转到已开启的翻译页面。 + {{siteInfo && currentMenuItem && siteInfo['ver2info'][currentMenuItem.parentType]['name'] }} + {{siteInfo && currentMenuItem && siteInfo['ver2info'][currentMenuItem.parentType]['desc'] }}

- {{ }} - {{ }} + {{ serviceAddInfo.type_name }} + {{ siteInfo&&siteInfo['type2info'][currentMenuItem.type]['introduce'] }}

-
+

电商禁止售卖降重类的商品,如果上架建议调整文案规避 @@ -65,7 +65,7 @@

-
+
利润分析 @@ -90,28 +90,6 @@
- - - - -
@@ -123,17 +101,10 @@
-
-
@@ -260,7 +231,7 @@
-
+
关联电商商品 @@ -344,6 +315,14 @@ export default { GuipButton, bindGoods, }, + beforeRouteLeave(to, from, next) { + if (!to.path.startsWith('/agent/siteServiceAdd')) { + console.log('=0000走了这里'); + // 重置侧边栏数据 + store.commit('SET_SECOND_MENU', {}); + } + next(); + }, data() { return { uid: 0, @@ -352,6 +331,7 @@ export default { serviceAddInfo: {}, service_unit:'', service_status: false, + relatedProducts:false, serviceInfo: {}, bindList: [], alertShow: true, @@ -371,7 +351,8 @@ export default { totalProfit: 0, pricePerThousand: 0, isValid: false - } + }, + siteInfo:null } }, @@ -388,7 +369,6 @@ export default { '$store.state.currentMenuItem': { handler(newVal) { this.menuItem = newVal; - console.log(this.menuItem,'this.menuItem==='); this.type = newVal.type //查询是否添加了此服务 this.getServiceInfo() @@ -413,11 +393,22 @@ export default { this.getServiceInfo() this.getServiceAddInfo(); } + if (!this.secondMenu || this.secondMenu.length === 0 || Object.keys(this.secondMenu).length == 0) { + // 尝试从 localStorage 恢复 + // console.log(savedData,'savedData'); + const savedData = localStorage.getItem('selectedServices'); + if (savedData) { + this.$store.commit('SET_SECOND_MENU', JSON.parse(savedData)); + } else { + this.$router.go(-1); + } + } console.log(this.menuItem,'menuItem===',this.currentMenuItem); // store.commit('SET_PAGETITLE', '站点信息'); - // this.getAddServiceList(); + this.getAddServiceList(); }, methods: { + extractedNumber() { const match = this.basePrice.match(/(\d+\.?\d*)/); return match ? parseFloat(match[0]) : 0; @@ -425,7 +416,6 @@ export default { priceBlur(){ const price = this.serviceAddInfo.supply_price.replace(/[^\d.]/g, ''); this.calculation = this.calculateProfitRate(this.serviceInfo.price, this.serviceInfo.unit_num, Number(price)); - console.log(this.calculation,'====val'); }, unitNameBlur(){ @@ -434,21 +424,21 @@ export default { this.alertShow = !this.alertShow }, //获得左侧菜单导航 - // getAddServiceList() { - // const that = this - // that.$http('POST', '/agentnew/ajax_get_service_add_list', { - // uid: that.uid, - // prodid: that.prodid, - // }).then(response => { - // that.$nextTick(() => { - // that.menuList = response.data - // store.commit('SET_SECOND_MENU', response.data); - // that.setMenuList() - // }) - // }).catch(error => { - // console.error(error, 'error') - // }) - // }, + getAddServiceList() { + const that = this + that.$http('POST', '/agentnew/ajax_get_service_add_list', { + uid: that.uid, + prodid: that.prodid, + }).then(response => { + that.$nextTick(() => { + that.siteInfo = response.data + // store.commit('SET_SECOND_MENU', response.data); + // that.setMenuList() + }) + }).catch(error => { + console.error(error, 'error') + }) + }, //获得要添加的服务信息 getServiceAddInfo() { this.serviceAddInfo = {} @@ -496,7 +486,6 @@ export default { if (response.status && response.data) { that.serviceInfo = response.data that.service_status = true - that.getServiceBindGoods() } }) @@ -563,6 +552,17 @@ export default { }, savePrice() { const that = this + let secondMenu = JSON.parse(JSON.stringify(this.secondMenu)); + let parentType = this.currentMenuItem.parentType; + secondMenu[parentType].list.forEach(item => { + if(item.type == this.currentMenuItem.type){ + item['unit_num'] = that.serviceInfo.unit_num + item['unit_price'] = that.serviceInfo.price + } + }) + console.log(secondMenu,'secondMenu===='); + store.commit('SET_SECOND_MENU', secondMenu); + //非字符计费 if(that.service_unit !== '0') { that.serviceInfo.unit_num = 1 @@ -579,8 +579,9 @@ export default { b_unit_price: that.serviceInfo.base_unit_price, }).then(response => { if (response.status) { + // store.commit('SET_SECOND_MENU', secondMenu); that.service_status = true - that.setMenuList(that.type, true) + // that.setMenuList(that.type, true) that.$message.success('保存成功'); return true; } @@ -616,7 +617,8 @@ export default { }).then(response => { if (response.status) { that.service_status = true - that.setMenuList(that.type, true) + this.relatedProducts = true; + // that.setMenuList(that.type, true) that.$message.success('保存成功'); return true; } diff --git a/src/views/agent/supplyList.vue b/src/views/agent/supplyList.vue index 1a979a1..974c944 100644 --- a/src/views/agent/supplyList.vue +++ b/src/views/agent/supplyList.vue @@ -4,10 +4,9 @@
+
{{ classifyId2Name[classify_id] }}
- {{ classifyId2Name[classify_id] }} - -
+
{{ ver2info[verid].name }} @@ -132,14 +131,18 @@ export default { display: flex; margin-bottom: 20px; margin-top: 20px; + gap: 12px; + flex-wrap: wrap; } .classify-title { font-family: Microsoft YaHei UI; font-size: 20px; font-weight: bold; + text-align: left; line-height: 26px; letter-spacing: 0.08em; + margin: 20px 0; color: #1E2226; } @@ -184,9 +187,7 @@ export default { } .ver-anchor-point { - /* 自动布局子元素 */ height: 28px; - /* 自动布局 */ display: flex; align-items: center; padding: 4px 10px; @@ -194,13 +195,14 @@ export default { z-index: 0; border-radius: 100px; white-space: nowrap; - /* text/text_white_1 */ background: #FFFFFF; box-sizing: border-box; - /* main/main_stardard */ + border: 1px solid transparent; + transition: all .3s; } .ver-anchor-point:hover { - border: 1px solid #006AFF; + border-color: #006AFF; + transition: all .3s; } .anchor { text-decoration: none;