Browse Source

Merge pull request '修改售价同步侧边数据交互' (#113) from zq-orderListTwo-0813 into master

Reviewed-on: #113
pull/116/head
zhangqi 1 week ago
parent
commit
ff8cb0e3d4
  1. 10
      src/App.vue
  2. 6
      src/components/SliderMenu.vue
  3. 16
      src/components/SliderScondThree.vue
  4. 175
      src/store/index.js
  5. 2
      src/views/agent/siteAddChooseService.vue
  6. 114
      src/views/agent/siteServiceAdd.vue
  7. 18
      src/views/agent/supplyList.vue

10
src/App.vue

@ -58,16 +58,6 @@ export default {
mounted() { mounted() {
window.addEventListener('beforeunload', this.clearStorage); window.addEventListener('beforeunload', this.clearStorage);
console.log(this.secondMenu,'secondMenu===='); 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() { beforeUnmount() {
window.removeEventListener('beforeunload', this.clearStorage); window.removeEventListener('beforeunload', this.clearStorage);

6
src/components/SliderMenu.vue

@ -162,6 +162,12 @@ export default {
// }, // },
handleSelect(index, indexPath, menuItem) { handleSelect(index, indexPath, menuItem) {
if (menuItem.path && this.$route.path !== menuItem.path) { 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); this.$router.push(menuItem.path);
} }
}, },

16
src/components/SliderScondThree.vue

@ -14,11 +14,9 @@
:class="['flex-between point gap8 menuListItem', activeFloor == item1[renderKeyNew.subtitle] ? 'curActive' : '']" :class="['flex-between point gap8 menuListItem', activeFloor == item1[renderKeyNew.subtitle] ? 'curActive' : '']"
:key="index1"> :key="index1">
<span class="l-menu-name">{{ item1[renderKeyNew.subtitle] }}</span> <span class="l-menu-name">{{ item1[renderKeyNew.subtitle] }}</span>
<span class="l-price-ing curActive_ing" v-if="!currentMenuItem.unit_price && !currentMenuItem.unit_num">设置价格中</span> <span class="l-price-ing curActive_ing" v-if="!item1.unit_price && !item1.unit_num">设置价格中</span>
<span class="l-price-ing" v-if="item1.unit_price && item1.unit_num">{{ item1.unit_price }}/{{ item1.unit_num }}</span> <span class="l-price-ing" v-if="item1.unit_price && item1.unit_num">{{ item1.unit_price }}/{{ item1.unit_num }}</span>
<!-- <span class="l-price-ing" v-if="(!item1.unit_price || !item1.unit_num) && activeFloor == item1[renderKeyNew.subtitle]">设置价格中</span> --> <span class="l-price-ing" v-if="item1.unit_price && !item1.unit_num">{{ item1.unit_price }}/</span>
<!-- <span class="l-price-ed">{{unit_desc(item)}}</span> -->
<!-- <img v-if="item1[renderKeyNew.SubSelected]" class="selected" src="../assets/menu/is_selected.png" alt=""> -->
</div> </div>
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
@ -83,14 +81,11 @@ export default {
menuList:{ menuList:{
handler(newVal, oldVal) { handler(newVal, oldVal) {
this.activeNames = newVal.map(item => item.type) this.activeNames = newVal.map(item => item.type)
console.log( this.activeNames,' this.activeNames=');
// console.log(newVal, oldVal,'---====val');
// oldVal // oldVal
if (!oldVal || oldVal.length === 0) { if (!oldVal || oldVal.length === 0) {
this.setDefaultActive(newVal); this.setDefaultActive(newVal);
return; return;
} }
// console.log(newVal,'newVal===');
// menuList // menuList
const currentItemExists = this.checkCurrentItem(newVal); const currentItemExists = this.checkCurrentItem(newVal);
// console.log(currentItemExists,'currentItemExists--'); // console.log(currentItemExists,'currentItemExists--');
@ -151,7 +146,8 @@ export default {
const subtitle = this.renderKeyNew.subtitle; const subtitle = this.renderKeyNew.subtitle;
this.activeFloor = menuList[0].list[0][subtitle] || menuList[0].list[0]?.componentsName || ''; this.activeFloor = menuList[0].list[0][subtitle] || menuList[0].list[0]?.componentsName || '';
this.componentsName = 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]); store.commit('SET_CURRENTMENUITEM', menuList[0].list[0]);
this.curIndex = 0; this.curIndex = 0;
} }
@ -235,8 +231,8 @@ export default {
// }, 1000) // }, 1000)
// } // }
setActiveCur(item1, item, index) { setActiveCur(item1, item, index) {
console.log(item1,'===---item1'); console.log(item1,item,'===---item1');
store.commit('SET_CURRENTMENUITEM', item1); store.commit('SET_CURRENTMENUITEM', {...item1,parentType:item.type});
this.currentMenuItem = item1; this.currentMenuItem = item1;
this.curIndex = index; this.curIndex = index;
let subtitle = this.renderKeyNew.subtitle; let subtitle = this.renderKeyNew.subtitle;

175
src/store/index.js

@ -1,6 +1,6 @@
import Vue from 'vue'; import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
// import createPersistedState from 'vuex-persistedstate';
Vue.use(Vuex) Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
@ -11,84 +11,9 @@ export default new Vuex.Store({
showHeader: false, showHeader: false,
showHeaderRight: false, showHeaderRight: false,
menuList: [], //目录菜单 menuList: [], //目录菜单
// secondMenu:{ secondMenu: {},
// '1': {
// type: '1', // secondMenu:{},//第三种侧边栏 -- 可折叠、 切换显示
// 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:{},//第三种侧边栏 -- 可折叠、 切换显示
showBreadcrumb: false, //是否展示面包屑 showBreadcrumb: false, //是否展示面包屑
breadRightText: '', //是否展示面包屑 breadRightText: '', //是否展示面包屑
breadRightTextLink: '', //是否展示面包屑 breadRightTextLink: '', //是否展示面包屑
@ -100,14 +25,12 @@ export default new Vuex.Store({
currentMenuItem: null, currentMenuItem: null,
slidermenu: [], slidermenu: [],
// 第二种侧边栏--单项可跳转 // 第二种侧边栏--单项可跳转
rankMenuData: [ rankMenuData: [{
{
name: '总利润', name: '总利润',
path: '', path: '',
img: 'site/sitebase.svg', img: 'site/sitebase.svg',
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '年排行', name: '年排行',
path: '/super/ranking/yearProfit' path: '/super/ranking/yearProfit'
}, },
@ -122,8 +45,7 @@ export default new Vuex.Store({
path: '', path: '',
img: 'site/sitebase.svg', img: 'site/sitebase.svg',
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '毛利润排行', name: '毛利润排行',
path: '/super/ranking/checkProfit' path: '/super/ranking/checkProfit'
}, },
@ -146,8 +68,7 @@ export default new Vuex.Store({
path: '', path: '',
img: 'site/sitebase.svg', img: 'site/sitebase.svg',
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '毛利润排行', name: '毛利润排行',
path: '/super/ranking/agentProfit' path: '/super/ranking/agentProfit'
}, },
@ -166,8 +87,7 @@ export default new Vuex.Store({
path: '', path: '',
img: 'site/sitebase.svg', img: 'site/sitebase.svg',
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '采购价', name: '采购价',
path: '/super/ranking/purchase' path: '/super/ranking/purchase'
}, },
@ -179,8 +99,7 @@ export default new Vuex.Store({
}, },
], ],
// 第一种侧边栏--可折叠、可跳转 // 第一种侧边栏--可折叠、可跳转
menuData: [ menuData: [{
{
index: '1', index: '1',
title: '首页', title: '首页',
path: '/', path: '/',
@ -190,8 +109,7 @@ export default new Vuex.Store({
index: '2', index: '2',
title: '订单列表', title: '订单列表',
icon: 'orderList', icon: 'orderList',
children: [ children: [{
{
index: '2-1', index: '2-1',
title: '查重订单', title: '查重订单',
path: '/agent/checkOrderList' path: '/agent/checkOrderList'
@ -216,8 +134,7 @@ export default new Vuex.Store({
index: '3-1', index: '3-1',
title: '站点列表', title: '站点列表',
path: '/agent/siteList' path: '/agent/siteList'
}, }, ]
]
}, },
{ {
index: '4', index: '4',
@ -227,18 +144,21 @@ export default new Vuex.Store({
index: '4-1', index: '4-1',
title: '收款方式', title: '收款方式',
path: '/agent/payList' path: '/agent/payList'
}, },{
index: '4-2',
title: '代收款结算',
path:'http://admin.pengda.checkcopy.com/pay/payoff_list?tab=info',
external: true,//是否跳转外部链接
}
] ]
} }
], ],
siteSettingData1:[ siteSettingData1: [{
{
name: '基本设置', name: '基本设置',
path: '/agent/siteBaseSetting', path: '/agent/siteBaseSetting',
img: 'site/sitebase.svg', img: 'site/sitebase.svg',
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '站点信息', name: '站点信息',
desc: 'siteMessage1' desc: 'siteMessage1'
}, },
@ -261,8 +181,7 @@ export default new Vuex.Store({
path: '/agent/sitePersonalization', path: '/agent/sitePersonalization',
img: 'site/gexinghua.svg', img: 'site/gexinghua.svg',
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '网页模板', name: '网页模板',
desc: 'siteMessage4' desc: 'siteMessage4'
}, },
@ -289,8 +208,7 @@ export default new Vuex.Store({
path: '/agent/siteMobileSetting', path: '/agent/siteMobileSetting',
img: 'site/siteh5.svg', img: 'site/siteh5.svg',
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '微信H5', name: '微信H5',
desc: 'siteMessage9' desc: 'siteMessage9'
}, },
@ -305,8 +223,7 @@ export default new Vuex.Store({
path: '/siteSetting/siteSem', path: '/siteSetting/siteSem',
img: 'site/sitesem.svg', img: 'site/sitesem.svg',
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: 'SEO设置', name: 'SEO设置',
desc: 'siteMessage11' desc: 'siteMessage11'
}, },
@ -327,8 +244,7 @@ export default new Vuex.Store({
path: '/agent/siteBaseSetting', path: '/agent/siteBaseSetting',
img: 'site/sitebase.svg', img: 'site/sitebase.svg',
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '站点信息', name: '站点信息',
desc: 'siteMessage1' desc: 'siteMessage1'
}, },
@ -351,8 +267,7 @@ export default new Vuex.Store({
path: '/agent/sitePersonalization', path: '/agent/sitePersonalization',
img: 'site/gexinghua.svg', img: 'site/gexinghua.svg',
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '网页模板', name: '网页模板',
desc: 'siteMessage4' desc: 'siteMessage4'
}, },
@ -379,8 +294,7 @@ export default new Vuex.Store({
path: '/agent/siteMobileSetting', path: '/agent/siteMobileSetting',
img: 'site/siteh5.svg', img: 'site/siteh5.svg',
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '微信H5', name: '微信H5',
desc: 'siteMessage9' desc: 'siteMessage9'
}, },
@ -399,8 +313,7 @@ export default new Vuex.Store({
path: '/agent/siteSemSetting', path: '/agent/siteSemSetting',
img: 'site/sitesem.svg', img: 'site/sitesem.svg',
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: 'SEO设置', name: 'SEO设置',
desc: 'siteMessage11' desc: 'siteMessage11'
}, },
@ -422,8 +335,7 @@ export default new Vuex.Store({
img: 'site/settingIcon.svg', img: 'site/settingIcon.svg',
noToPath: true, noToPath: true,
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '价格设置', name: '价格设置',
desc: 'priceSet', //和组件名称、componentsName 一致 desc: 'priceSet', //和组件名称、componentsName 一致
componentsName: 'priceSet' //和页面内引入的组件名称 、及上面desc 一致 componentsName: 'priceSet' //和页面内引入的组件名称 、及上面desc 一致
@ -451,8 +363,7 @@ export default new Vuex.Store({
img: 'site/sitesem.svg', img: 'site/sitesem.svg',
noToPath: true, noToPath: true,
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '提交页SEO', name: '提交页SEO',
desc: 'submitSeoSet', desc: 'submitSeoSet',
componentsName: 'submitSeoSet' componentsName: 'submitSeoSet'
@ -470,8 +381,7 @@ export default new Vuex.Store({
img: 'site/form_link.svg', img: 'site/form_link.svg',
noToPath: true, noToPath: true,
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '独立域名', name: '独立域名',
desc: 'domainSet', desc: 'domainSet',
componentsName: 'domainSet' componentsName: 'domainSet'
@ -484,20 +394,17 @@ export default new Vuex.Store({
] ]
} }
], ],
demoPageData:[ demoPageData: [{
{
name: '支付授权', name: '支付授权',
path: '', //设置为空 path: '', //设置为空
img: 'site/pay.svg', img: 'site/pay.svg',
noToPath: true, noToPath: true,
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '默认展示组件', name: '默认展示组件',
desc: 'Franchise1', //和组件名称、componentsName 一致 desc: 'Franchise1', //和组件名称、componentsName 一致
componentsName: 'Franchise1' //和页面内引入的组件名称 、及上面desc 一致 componentsName: 'Franchise1' //和页面内引入的组件名称 、及上面desc 一致
} }]
]
}, },
{ {
name: '支付设置', name: '支付设置',
@ -505,8 +412,7 @@ export default new Vuex.Store({
img: 'site/setting.svg', img: 'site/setting.svg',
noToPath: true, noToPath: true,
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '平台退款', name: '平台退款',
desc: 'Register', desc: 'Register',
componentsName: 'Register' componentsName: 'Register'
@ -519,8 +425,7 @@ export default new Vuex.Store({
] ]
}, },
], ],
paySettingData:[ paySettingData: [{
{
name: '支付授权', name: '支付授权',
path: '/agent/payInfoSetting', path: '/agent/payInfoSetting',
img: 'site/pay.svg', img: 'site/pay.svg',
@ -533,8 +438,7 @@ export default new Vuex.Store({
path: '/agent/payCertSetting', path: '/agent/payCertSetting',
img: 'site/pay_trade.svg', img: 'site/pay_trade.svg',
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '管理证书', name: '管理证书',
desc: 'siteMessage1', desc: 'siteMessage1',
permission: [2] permission: [2]
@ -556,8 +460,7 @@ export default new Vuex.Store({
path: '/agent/paySetting', path: '/agent/paySetting',
img: 'site/setting.svg', img: 'site/setting.svg',
imgActive: require('@/assets/site/sitebase_active.svg'), imgActive: require('@/assets/site/sitebase_active.svg'),
list: [ list: [{
{
name: '支付客服', name: '支付客服',
desc: 'siteMessage4', desc: 'siteMessage4',
permission: [2] permission: [2]
@ -655,6 +558,7 @@ export default new Vuex.Store({
}, },
mutations: { mutations: {
SET_CURRENTMENUITEM(state, data) { SET_CURRENTMENUITEM(state, data) {
// console.log(data,'=====data====currentMenuItem');
state.currentMenuItem = data && JSON.parse(JSON.stringify(data)); state.currentMenuItem = data && JSON.parse(JSON.stringify(data));
}, },
SET_COMPONENTS_NAME(state, name) { SET_COMPONENTS_NAME(state, name) {
@ -669,6 +573,7 @@ export default new Vuex.Store({
}, },
SET_SECOND_MENU(state, data) { SET_SECOND_MENU(state, data) {
state.secondMenu = data && JSON.parse(JSON.stringify(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 state.customize = show
@ -712,6 +617,6 @@ export default new Vuex.Store({
getters: { getters: {
menuData: state => state.menuData menuData: state => state.menuData
}, },
// plugins: [createPersistedState()],
modules: {} modules: {}
}) })

2
src/views/agent/siteAddChooseService.vue

@ -116,6 +116,7 @@ export default {
list.push({ list.push({
type: type, type: type,
name: this.type2name[type], name: this.type2name[type],
parentType:key
}) })
}) })
@ -127,7 +128,6 @@ export default {
} }
}); });
store.commit('SET_SECOND_MENU', result); store.commit('SET_SECOND_MENU', result);
localStorage.setItem('selectedServices',JSON.stringify(result))
this.$router.push(this.serviceAddUrl + '?uid=' + this.uid + '&prodid=' + this.prodid) this.$router.push(this.serviceAddUrl + '?uid=' + this.uid + '&prodid=' + this.prodid)
}, },
// //

114
src/views/agent/siteServiceAdd.vue

@ -27,19 +27,19 @@
<div class="flex"> <div class="flex">
<label>品牌名称</label> <label>品牌名称</label>
<p> <p>
<b>{{ }}人工摘要翻译</b> <b>{{siteInfo && currentMenuItem && siteInfo['ver2info'][currentMenuItem.parentType]['name'] }}</b>
{{ }}站点开通服务后除了新增了翻译入口外该站点的检测服务网页的右上角会显示翻译的广告宣传图点击会跳转到已开启的翻译页面 {{siteInfo && currentMenuItem && siteInfo['ver2info'][currentMenuItem.parentType]['desc'] }}
</p> </p>
</div> </div>
<div class="flex"> <div class="flex">
<label>服务名称</label> <label>服务名称</label>
<p> <p>
<b>{{ }}</b> <b>{{ serviceAddInfo.type_name }}</b>
{{ }} {{ siteInfo&&siteInfo['type2info'][currentMenuItem.type]['introduce'] }}
</p> </p>
</div> </div>
<!--需要 增加条件判断 --> <!--需要 增加条件判断 -->
<div class="flex"> <div class="flex" v-if="serviceAddInfo.shop_price_set">
<label>注意事项</label> <label>注意事项</label>
<p class="warn"> <p class="warn">
电商禁止售卖降重类的商品如果上架建议调整文案规避 电商禁止售卖降重类的商品如果上架建议调整文案规避
@ -65,7 +65,7 @@
</p> </p>
</div> </div>
</div> </div>
<div class="common_scss green_back"> <div class="common_scss green_back" v-if="serviceAddInfo.web_price_set">
<div class="flex gap6"> <div class="flex gap6">
<img src="@/assets/site/price3.svg" alt=""> <img src="@/assets/site/price3.svg" alt="">
<b class="green">利润分析</b> <b class="green">利润分析</b>
@ -90,28 +90,6 @@
</div> </div>
</div> </div>
<!-- <div class="service-title flex-between" v-if="serviceAddInfo && serviceAddInfo.ver_type">
<div class="service-name flex gap12">
<img :src="require('@/assets/serviceIcon/ver_'+serviceAddInfo.ver_type+'.svg')" alt="">
<span>{{ serviceAddInfo.ver_name }}_{{ serviceAddInfo.type_name }}</span>
</div>
<div class="service-status" v-if="service_status">
<span class="service-status-close" @click="handleDelServiceClick">关闭服务</span>
<span class="service-status-desc">已开启</span>
</div>
</div> -->
<!-- <PromptText v-if="serviceAddInfo && serviceAddInfo.prompt && serviceAddInfo.prompt.title" :text='serviceAddInfo.prompt.title' :type="1"
class="mb12">
<template #desc v-if="serviceAddInfo.prompt.content">
<div class="alert-more-info mt12">
<div class="flex mb10" v-for="item in serviceAddInfo.prompt.content" :key="item">
{{ item }}</div>
</div>
</template>
</PromptText> -->
<!-- 网页售价 --> <!-- 网页售价 -->
<div class="flex-common mt12 mb12 price-set" v-if="serviceAddInfo.web_price_set"> <div class="flex-common mt12 mb12 price-set" v-if="serviceAddInfo.web_price_set">
<el-form class="el-row demo-ruleForm" ref="formRef"> <el-form class="el-row demo-ruleForm" ref="formRef">
@ -123,17 +101,10 @@
<div class="flex-wrap"> <div class="flex-wrap">
<div class="flex-left"> <div class="flex-left">
<!-- <div class="flex-between mb12">
<div>售价设置</div>
</div> -->
<div class="column"> <div class="column">
<el-tabs v-if="Object.keys(serviceAddInfo.set_units).length>1" v-model="service_unit" @tab-click="handleUnitName"> <el-tabs v-if="Object.keys(serviceAddInfo.set_units).length>1" v-model="service_unit" @tab-click="handleUnitName">
<el-tab-pane v-for="item in Object.keys(serviceAddInfo.set_units)" :label="'按'+serviceAddInfo.set_units[item] + '售卖'" :name="item" :key="item"></el-tab-pane> <el-tab-pane v-for="item in Object.keys(serviceAddInfo.set_units)" :label="'按'+serviceAddInfo.set_units[item] + '售卖'" :name="item" :key="item"></el-tab-pane>
</el-tabs> </el-tabs>
<!-- <div class="short-width" v-if="Object.keys(serviceAddInfo.set_units).length>1">
<GuipSelect width="100%" v-model="service_unit" placeholder="选择计费方式"
:options="serviceAddInfo.set_units" @change="handleUnitName"/>
</div> -->
<div class="short-width" v-if="service_unit !== '0'"> <div class="short-width" v-if="service_unit !== '0'">
<GuipInput v-model="serviceInfo.price" width="100%" <GuipInput v-model="serviceInfo.price" width="100%"
ref="GuipInput" :unit="'元/'+serviceAddInfo.unit_name"></GuipInput> ref="GuipInput" :unit="'元/'+serviceAddInfo.unit_name"></GuipInput>
@ -260,7 +231,7 @@
</div> </div>
<!-- 店铺商品绑定--> <!-- 店铺商品绑定-->
<div class="flex-common mb12 price-set" v-if="serviceAddInfo.shop_price_set"> <div class="flex-common mb12 price-set" v-if="relatedProducts">
<el-form class="el-row demo-ruleForm" ref="formRef"> <el-form class="el-row demo-ruleForm" ref="formRef">
<div class="price-top"> <div class="price-top">
<span class="title">关联电商商品</span> <span class="title">关联电商商品</span>
@ -344,6 +315,14 @@ export default {
GuipButton, GuipButton,
bindGoods, bindGoods,
}, },
beforeRouteLeave(to, from, next) {
if (!to.path.startsWith('/agent/siteServiceAdd')) {
console.log('=0000走了这里');
//
store.commit('SET_SECOND_MENU', {});
}
next();
},
data() { data() {
return { return {
uid: 0, uid: 0,
@ -352,6 +331,7 @@ export default {
serviceAddInfo: {}, serviceAddInfo: {},
service_unit:'', service_unit:'',
service_status: false, service_status: false,
relatedProducts:false,
serviceInfo: {}, serviceInfo: {},
bindList: [], bindList: [],
alertShow: true, alertShow: true,
@ -371,7 +351,8 @@ export default {
totalProfit: 0, totalProfit: 0,
pricePerThousand: 0, pricePerThousand: 0,
isValid: false isValid: false
} },
siteInfo:null
} }
}, },
@ -388,7 +369,6 @@ export default {
'$store.state.currentMenuItem': { '$store.state.currentMenuItem': {
handler(newVal) { handler(newVal) {
this.menuItem = newVal; this.menuItem = newVal;
console.log(this.menuItem,'this.menuItem===');
this.type = newVal.type this.type = newVal.type
// //
this.getServiceInfo() this.getServiceInfo()
@ -413,11 +393,22 @@ export default {
this.getServiceInfo() this.getServiceInfo()
this.getServiceAddInfo(); 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); console.log(this.menuItem,'menuItem===',this.currentMenuItem);
// store.commit('SET_PAGETITLE', ''); // store.commit('SET_PAGETITLE', '');
// this.getAddServiceList(); this.getAddServiceList();
}, },
methods: { methods: {
extractedNumber() { extractedNumber() {
const match = this.basePrice.match(/(\d+\.?\d*)/); const match = this.basePrice.match(/(\d+\.?\d*)/);
return match ? parseFloat(match[0]) : 0; return match ? parseFloat(match[0]) : 0;
@ -425,7 +416,6 @@ export default {
priceBlur(){ priceBlur(){
const price = this.serviceAddInfo.supply_price.replace(/[^\d.]/g, ''); const price = this.serviceAddInfo.supply_price.replace(/[^\d.]/g, '');
this.calculation = this.calculateProfitRate(this.serviceInfo.price, this.serviceInfo.unit_num, Number(price)); this.calculation = this.calculateProfitRate(this.serviceInfo.price, this.serviceInfo.unit_num, Number(price));
console.log(this.calculation,'====val');
}, },
unitNameBlur(){ unitNameBlur(){
@ -434,21 +424,21 @@ export default {
this.alertShow = !this.alertShow this.alertShow = !this.alertShow
}, },
// //
// getAddServiceList() { getAddServiceList() {
// const that = this const that = this
// that.$http('POST', '/agentnew/ajax_get_service_add_list', { that.$http('POST', '/agentnew/ajax_get_service_add_list', {
// uid: that.uid, uid: that.uid,
// prodid: that.prodid, prodid: that.prodid,
// }).then(response => { }).then(response => {
// that.$nextTick(() => { that.$nextTick(() => {
// that.menuList = response.data that.siteInfo = response.data
// store.commit('SET_SECOND_MENU', response.data); // store.commit('SET_SECOND_MENU', response.data);
// that.setMenuList() // that.setMenuList()
// }) })
// }).catch(error => { }).catch(error => {
// console.error(error, 'error') console.error(error, 'error')
// }) })
// }, },
// //
getServiceAddInfo() { getServiceAddInfo() {
this.serviceAddInfo = {} this.serviceAddInfo = {}
@ -496,7 +486,6 @@ export default {
if (response.status && response.data) { if (response.status && response.data) {
that.serviceInfo = response.data that.serviceInfo = response.data
that.service_status = true that.service_status = true
that.getServiceBindGoods() that.getServiceBindGoods()
} }
}) })
@ -563,6 +552,17 @@ export default {
}, },
savePrice() { savePrice() {
const that = this 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') { if(that.service_unit !== '0') {
that.serviceInfo.unit_num = 1 that.serviceInfo.unit_num = 1
@ -579,8 +579,9 @@ export default {
b_unit_price: that.serviceInfo.base_unit_price, b_unit_price: that.serviceInfo.base_unit_price,
}).then(response => { }).then(response => {
if (response.status) { if (response.status) {
// store.commit('SET_SECOND_MENU', secondMenu);
that.service_status = true that.service_status = true
that.setMenuList(that.type, true) // that.setMenuList(that.type, true)
that.$message.success('保存成功'); that.$message.success('保存成功');
return true; return true;
} }
@ -616,7 +617,8 @@ export default {
}).then(response => { }).then(response => {
if (response.status) { if (response.status) {
that.service_status = true that.service_status = true
that.setMenuList(that.type, true) this.relatedProducts = true;
// that.setMenuList(that.type, true)
that.$message.success('保存成功'); that.$message.success('保存成功');
return true; return true;
} }

18
src/views/agent/supplyList.vue

@ -4,10 +4,9 @@
<PromptText text='平台针对不同品牌产品,已做了风险提醒义务,请安全规避销售。平台仅保障货品正版,针对有风险的产品,请具备安全销售方案后再开展销售。' :type="3" /> <PromptText text='平台针对不同品牌产品,已做了风险提醒义务,请安全规避销售。平台仅保障货品正版,针对有风险的产品,请具备安全销售方案后再开展销售。' :type="3" />
<div class="supply-list" v-for="(vers, classify_id) in classifyId2Vers" :key="classify_id"> <div class="supply-list" v-for="(vers, classify_id) in classifyId2Vers" :key="classify_id">
<div class="classify-title mr-20">{{ classifyId2Name[classify_id] }}</div>
<div class="classify"> <div class="classify">
<span class="classify-title mr-20">{{ classifyId2Name[classify_id] }}</span> <div class="ver-anchor-point flex" v-for="verid in vers" :key="verid">
<div class="ver-anchor-point flex mr-12" v-for="verid in vers" :key="verid">
<a class="flex anchor" href="javascript:;" @click="scrollToAnchor(verid)"> <a class="flex anchor" href="javascript:;" @click="scrollToAnchor(verid)">
<img class="ver-icon" :src="require('@/assets/serviceIcon/ver_'+verid+'.svg')" alt="" style="width:20px"><span>{{ ver2info[verid].name }}</span> <img class="ver-icon" :src="require('@/assets/serviceIcon/ver_'+verid+'.svg')" alt="" style="width:20px"><span>{{ ver2info[verid].name }}</span>
</a> </a>
@ -132,14 +131,18 @@ export default {
display: flex; display: flex;
margin-bottom: 20px; margin-bottom: 20px;
margin-top: 20px; margin-top: 20px;
gap: 12px;
flex-wrap: wrap;
} }
.classify-title { .classify-title {
font-family: Microsoft YaHei UI; font-family: Microsoft YaHei UI;
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
text-align: left;
line-height: 26px; line-height: 26px;
letter-spacing: 0.08em; letter-spacing: 0.08em;
margin: 20px 0;
color: #1E2226; color: #1E2226;
} }
@ -184,9 +187,7 @@ export default {
} }
.ver-anchor-point { .ver-anchor-point {
/* 自动布局子元素 */
height: 28px; height: 28px;
/* 自动布局 */
display: flex; display: flex;
align-items: center; align-items: center;
padding: 4px 10px; padding: 4px 10px;
@ -194,13 +195,14 @@ export default {
z-index: 0; z-index: 0;
border-radius: 100px; border-radius: 100px;
white-space: nowrap; white-space: nowrap;
/* text/text_white_1 */
background: #FFFFFF; background: #FFFFFF;
box-sizing: border-box; box-sizing: border-box;
/* main/main_stardard */ border: 1px solid transparent;
transition: all .3s;
} }
.ver-anchor-point:hover { .ver-anchor-point:hover {
border: 1px solid #006AFF; border-color: #006AFF;
transition: all .3s;
} }
.anchor { .anchor {
text-decoration: none; text-decoration: none;

Loading…
Cancel
Save