Browse Source

修改售价同步侧边数据交互

pull/113/head
zq 7 days ago
parent
commit
aa9b7c2b95
  1. 10
      src/App.vue
  2. 6
      src/components/SliderMenu.vue
  3. 16
      src/components/SliderScondThree.vue
  4. 293
      src/store/index.js
  5. 2
      src/views/agent/siteAddChooseService.vue
  6. 118
      src/views/agent/siteServiceAdd.vue
  7. 18
      src/views/agent/supplyList.vue

10
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);

6
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);
}
},

16
src/components/SliderScondThree.vue

@ -14,11 +14,9 @@
:class="['flex-between point gap8 menuListItem', activeFloor == item1[renderKeyNew.subtitle] ? 'curActive' : '']"
:key="index1">
<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) && activeFloor == item1[renderKeyNew.subtitle]">设置价格中</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=""> -->
<span class="l-price-ing" v-if="item1.unit_price && !item1.unit_num">{{ item1.unit_price }}/</span>
</div>
</el-collapse-item>
</el-collapse>
@ -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;

293
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: {}
})

2
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)
},
//

118
src/views/agent/siteServiceAdd.vue

@ -27,19 +27,19 @@
<div class="flex">
<label>品牌名称</label>
<p>
<b>{{ }}人工摘要翻译</b>
{{ }}站点开通服务后除了新增了翻译入口外该站点的检测服务网页的右上角会显示翻译的广告宣传图点击会跳转到已开启的翻译页面
<b>{{siteInfo && currentMenuItem && siteInfo['ver2info'][currentMenuItem.parentType]['name'] }}</b>
{{siteInfo && currentMenuItem && siteInfo['ver2info'][currentMenuItem.parentType]['desc'] }}
</p>
</div>
<div class="flex">
<label>服务名称</label>
<p>
<b>{{ }}</b>
{{ }}
<b>{{ serviceAddInfo.type_name }}</b>
{{ siteInfo&&siteInfo['type2info'][currentMenuItem.type]['introduce'] }}
</p>
</div>
<!--需要 增加条件判断 -->
<div class="flex">
<div class="flex" v-if="serviceAddInfo.shop_price_set">
<label>注意事项</label>
<p class="warn">
电商禁止售卖降重类的商品如果上架建议调整文案规避
@ -65,7 +65,7 @@
</p>
</div>
</div>
<div class="common_scss green_back">
<div class="common_scss green_back" v-if="serviceAddInfo.web_price_set">
<div class="flex gap6">
<img src="@/assets/site/price3.svg" alt="">
<b class="green">利润分析</b>
@ -90,28 +90,6 @@
</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">
<el-form class="el-row demo-ruleForm" ref="formRef">
@ -123,17 +101,10 @@
<div class="flex-wrap">
<div class="flex-left">
<!-- <div class="flex-between mb12">
<div>售价设置</div>
</div> -->
<div class="column">
<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-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'">
<GuipInput v-model="serviceInfo.price" width="100%"
ref="GuipInput" :unit="'元/'+serviceAddInfo.unit_name"></GuipInput>
@ -260,7 +231,7 @@
</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">
<div class="price-top">
<span class="title">关联电商商品</span>
@ -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;
}

18
src/views/agent/supplyList.vue

@ -4,10 +4,9 @@
<PromptText text='平台针对不同品牌产品,已做了风险提醒义务,请安全规避销售。平台仅保障货品正版,针对有风险的产品,请具备安全销售方案后再开展销售。' :type="3" />
<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">
<span class="classify-title mr-20">{{ classifyId2Name[classify_id] }}</span>
<div class="ver-anchor-point flex mr-12" v-for="verid in vers" :key="verid">
<div class="ver-anchor-point flex" v-for="verid in vers" :key="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>
</a>
@ -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;

Loading…
Cancel
Save