zq-orderListTwo-0813 #112

Merged
zhangqi merged 5 commits from zq-orderListTwo-0813 into master 2 months ago
  1. 23
      src/App.vue
  2. 1
      src/assets/serviceIcon/activeImg_choose.svg
  3. 1
      src/assets/site/price1.svg
  4. 1
      src/assets/site/price2.svg
  5. 1
      src/assets/site/price3.svg
  6. 439
      src/components/SliderScondThree.vue
  7. 697
      src/components/site/addSiteStep/step1.vue
  8. 12
      src/components/site/serviceSetting/domainSet.vue
  9. 21
      src/router/index.js
  10. 2
      src/style/theme/common.scss
  11. 427
      src/views/agent/siteAddChooseService.vue
  12. 338
      src/views/agent/siteServiceAdd.vue
  13. 18
      src/views/agent/siteServiceList.vue
  14. 1
      src/views/agent/supplyList.vue

23
src/App.vue

@ -10,9 +10,10 @@
<el-container :class="(showHeader ? 'short-container' : '')">
<!-- 侧边栏 -->
<SliderMenu v-if="showSidebar" :menuData="slidermenu" :customize="customize"></SliderMenu>
<SliderScond v-if="showSecondSide" :menuData="secondMenu" ></SliderScond>
<!-- <SliderScond v-if="showSecondSide" :menuData="secondMenu" ></SliderScond> -->
<SliderScondThree v-if="showSecondSide" :menuData="secondMenu" ></SliderScondThree>
<!-- :renderKey="{}" 覆盖内部取值 可存储至store 修改获取-->
<el-container class="main-right-content">
<el-container :class="['main-right-content',showSecondSide ? 'main-right-content2':'']">
<!-- 面包屑导航 -->
<Breadcrumb />
<el-main class="app-content">
@ -34,7 +35,7 @@ import Header from './components/Header.vue';
import Breadcrumb from './components/Breadcrumb.vue';
// import loadingAnimation from '@/assets/loadingAni.json' // JSON
import GlobalLoading from '@/components/GlobalLoading1.vue'
import SliderScond from '@/components/SliderScond.vue'
import SliderScondThree from '@/components/SliderScondThree.vue'
// import ContentWithLoading from '@/components/ContentWithLoading'
export default {
data() {
@ -44,7 +45,7 @@ export default {
},
components: {
GlobalLoading,
SliderScond,
SliderScondThree,
// ContentWithLoading,
SliderMenu,
// Footer,
@ -56,6 +57,17 @@ 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);
@ -101,6 +113,9 @@ export default {
flex-direction: column;
min-width: 1042px;
}
.main-right-content2{
min-width: 990px;
}
::v-deep .el-container .el-main {

1
src/assets/serviceIcon/activeImg_choose.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="14" height="14" viewBox="0 0 14 14"><g><g><rect x="0" y="0" width="14" height="14" rx="7" fill="#006AFF" fill-opacity="1"/><rect x="0.5" y="0.5" width="13" height="13" rx="6.5" fill-opacity="0" stroke-opacity="1" stroke="#FFFFFF" fill="none" stroke-width="1"/></g><g><rect x="2.380126953125" y="2.3798828125" width="9.239999771118164" height="9.239999771118164" rx="4.619999885559082" fill="#FFFFFF" fill-opacity="1"/><rect x="2.710126966238022" y="2.709882825613022" width="8.57999974489212" height="8.57999974489212" rx="4.28999987244606" fill-opacity="0" stroke-opacity="1" stroke="#006AFF" fill="none" stroke-width="0.6600000262260437"/></g></g></svg>

After

Width:  |  Height:  |  Size: 771 B

1
src/assets/site/price1.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_827_029976"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath><linearGradient x1="0.94976806640625" y1="0.9587570428848267" x2="0.1639928761548255" y2="-0.013538789885776559" id="master_svg1_3_10240"><stop offset="0%" stop-color="#006AFF" stop-opacity="1"/><stop offset="100%" stop-color="#4D97FF" stop-opacity="1"/></linearGradient></defs><g clip-path="url(#master_svg0_827_029976)"><g><path d="M12.039581265625,11.2C11.204380265625,12.583467,9.665180165625,13.4368,7.999047265625,13.44C6.331847165625,13.4368,4.792647365625,12.583467,3.956380865625,11.2C3.825079665625,11.003482,3.817214965625,10.749328,3.936114065625,10.545067C4.0598354656249995,10.336885,4.285998865625,10.211375,4.528113865625,10.216534C4.773447065625,10.219733,4.996380365625,10.352,5.109446965625,10.56C5.707847165625,11.5488,6.807580465625,12.157867,7.999046765625,12.160001C9.189447365625,12.157867,10.288112665625,11.5488,10.885446265625,10.56C11.007995265625,10.358182,11.227472265625,10.235486,11.463581265625,10.2368C11.699426265625,10.234432,11.919248265625,10.355882,12.042780265625,10.5568C12.162336265625,10.754748,12.161512265625,11.002849,12.040647265625,11.2M13.872114265625,3.2000003L1.861447365625,3.2000003C1.128647325625,3.2000003,0.534513950325,3.7706668,0.533447265625,4.4746666L0.533447265625,14.7232C0.533447265625,15.4272,1.128647325625,16,1.861447365625,16L13.872114265625,16C14.605980265625,15.998934,15.199047265625,15.428267,15.200113265625,14.724267L15.200113265625,4.4757338C15.200113265625,3.7717335,14.604913265625,3.2010667,13.872114265625,3.2000003ZM7.866780265625,1.2800001C8.969713165625,1.2800001,9.866781265625,2.1418667,9.866781265625,3.2L11.200113265625,3.2C11.200113265625,1.4357333,9.704647065625,0,7.866780765625,0C6.028914965625,0,4.533447265625,1.4357336,4.533447265625,3.2000003L5.866780765625,3.2000003C5.866780765625,2.1418669,6.763847365625,1.2800003,7.866780265625,1.2800001Z" fill="url(#master_svg1_3_10240)" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

1
src/assets/site/price2.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_827_030015"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath><linearGradient x1="0.94976806640625" y1="0.9587570428848267" x2="0.049243539926359964" y2="0.08606825837055598" id="master_svg1_3_10240"><stop offset="0%" stop-color="#006AFF" stop-opacity="1"/><stop offset="100%" stop-color="#4D97FF" stop-opacity="1"/></linearGradient></defs><g clip-path="url(#master_svg0_827_030015)"><g><path d="M15.2639619140625,13.80803725Q15.2639619140625,14.11203625,15.1599619140625,14.37603625Q15.0559619140625,14.64003625,14.8639619140625,14.84003625Q14.6719629140625,15.04003625,14.4159619140625,15.15203625Q14.1599619140625,15.26403725,13.8559619140625,15.26403725L2.2399618140625,15.26403725Q1.9359619140625,15.26403725,1.6639619440625,15.15203625Q1.3919619940625,15.04003625,1.1839619240625,14.84003625Q0.9759618640625,14.64003625,0.8559619140625,14.37603625Q0.735961973667145,14.11203625,0.7359619140625,13.80803725L0.7359619140625,5.82403655Q0.7359619140625,5.216037050000001,1.1599618840625001,4.792036749999999Q1.5839617840625,4.368036549999999,2.1919618140625,4.3680369500000005L13.8079619140625,4.3680369500000005Q14.4159609140625,4.3680369500000005,14.8399609140625,4.792036749999999Q15.2639609140625,5.21603655,15.2639609140625,5.82403655L15.2639609140625,8.00003715L11.6319609140625,8.00003715Q11.0239609140625,8.00003715,10.5999613140625,8.416036649999999Q10.1759615140625,8.83203605,10.1759615140625,9.44003675Q10.1919613140625,9.85603715,10.3519611140625,10.17603685Q10.4799614140625,10.44803715,10.7759609140625,10.67203715Q11.0719609140625,10.89603715,11.6319609140625,10.89603715L15.2639609140625,10.89603715L15.2639619140625,13.80803725ZM13.0879619140625,3.63203745L5.8239627140625,3.63203745Q6.6879625140625,3.18403745,7.4559626140625,2.76803735Q8.1279626140625,2.41603735,8.7839622140625,2.0640373199999997Q9.4399624140625,1.7120373199999999,9.8079624140625,1.5200372899999999Q10.3679628140625,1.216037273,10.8079629140625,1.240037322Q11.2479619140625,1.264037371,11.5519629140625,1.3920372699999999Q11.9039629140625,1.56803727,12.1599629140625,1.85603726L13.0879619140625,3.63203745ZM10.9119619140625,9.44003675Q10.9119619140625,9.13603685,11.1199619140625,8.92803665Q11.3279619140625,8.72003655,11.6319619140625,8.72003655Q11.9359619140625,8.72003655,12.1439619140625,8.92803665Q12.3519619140625,9.13603685,12.3519619140625,9.44003675Q12.3519619140625,9.74403665,12.1439619140625,9.96003625Q11.9359619140625,10.17603585,11.6319619140625,10.17603585Q11.3279619140625,10.17603585,11.1199619140625,9.96003625Q10.9119619140625,9.74403665,10.9119619140625,9.44003675Z" fill="url(#master_svg1_3_10240)" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

1
src/assets/site/price3.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_827_030042"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_827_030042)"><g><path d="M6.1838849,9.16500420625L3.50055146,9.16500420625C3.15021825,9.16500420625,2.908551455,8.81433720625,3.033218145,8.48717070625L5.6995518,1.4885039362499999C5.7734005,1.29465341625,5.9592773999999995,1.16653573513,6.1667182,1.16650390625L10.6660519,1.16650390625C11.0210514,1.16650390625,11.263052,1.52617061625,11.1290522,1.85500395625L9.5765524,5.66567090625L12.4992189,5.66567090625C12.9290524,5.66567090625,13.158385,6.17233750625,12.8748856,6.49533750625L5.7092192,14.66033690625C5.3608858999999995,15.05733690625,4.7150524,14.71333690625,4.850219,14.20283590625L6.1838849,9.16500420625Z" fill="#00C261" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 959 B

439
src/components/SliderScondThree.vue

@ -0,0 +1,439 @@
<template>
<el-collapse v-model="activeNames" @change="handleChange">
<el-collapse-item v-for="(item, index) in menuList" :key="index" :name="item[renderKeyNew.domName]">
<template #title>
<div class="flex-between gap8 collapse-item">
<div class="flex gap8 ">
<GuipToolTip :content="item[renderKeyNew.menuTitle]">
<div class="flex gap8 menu-name"><img width="20px" :src="require('@/assets/serviceIcon/ver_'+item.type+'.svg')" alt=""><span >{{ item[renderKeyNew.menuTitle] }}</span></div>
</GuipToolTip>
</div>
</div>
</template>
<div v-for="(item1, index1) in item.list" @click="setActiveCur(item1, item, index)"
: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" 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=""> -->
</div>
</el-collapse-item>
</el-collapse>
</template>
<script>
import store from '../store';
import GuipToolTip from "@/components/GuipToolTip.vue";
export default {
options: { styleIsolation: "shared" },
props: {
menuData: {
type: [Array, Object],
required: true
},
//
renderKey: {
type: [Object],
default: () => {}
}
},
data() {
return {
activeNames: [],// name
curIndex: 0,
activeFloor: '',
scrollLock: false,
componentsName: '',
currentMenuItem:{}
};
},
computed: {
// options
menuList() {
let flag = Array.isArray(this.menuData || []);
let data = this.menuData || []
if (!flag) {
data = Object.values(this.menuData)
return data
}
return this.menuData;
},
renderKeyNew() {
return Object.assign({
menuTitle: 'name',//
subtitle: 'name',//
selected: 'is_select',//绿
SubSelected: 'is_select',//绿
domName: 'type',//dom
domAppend: 'section_' //dom
// dom = domAppend + domName id
}, this.renderKey);
},
},
components: {
GuipToolTip
},
watch: {
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--');
//
if (!currentItemExists) {
this.setDefaultActive(newVal);
}
},
immediate: true
}
},
mounted() {
this.$nextTick(() => {
//
this.scrollContainer = document.querySelector('.main-content') ||
document.getElementById('main-content') ||
window;
if (this.scrollContainer) {
this.scrollContainer.addEventListener('scroll', this.handleScroll);
this.calculateFloorOffsets();
} else {
console.error('未找到滚动容器');
}
});
},
beforeDestroy() {
if (this.scrollContainer) {
this.scrollContainer.removeEventListener('scroll', this.handleScroll);
}
},
methods: {
unit_desc(item){
console.log(item,'====item');
let str = ''
return str
},
checkCurrentItem(newMenuList) {
const subtitle = this.renderKeyNew.subtitle;
//
if (!this.activeFloor) return false;
// menuList
for (const item of newMenuList) {
if (item.list) {
const found = item.list.some(subItem =>
subItem[subtitle] === this.activeFloor ||
subItem.componentsName === this.activeFloor
);
if (found) return true;
}
}
return false;
},
setDefaultActive(menuList) {
//
if (menuList && menuList.length > 0 && menuList[0].list && menuList[0].list.length > 0) {
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]
store.commit('SET_CURRENTMENUITEM', menuList[0].list[0]);
this.curIndex = 0;
}
},
handleChange(val) {
console.log("面板状态变化:", val);
},
handleTitleClick() {
console.log("标题点击");
},
random() {
var randomNumber = Math.random();
return randomNumber
},
calculateFloorOffsets() {
this.menuList.forEach(item => {
item.list?.forEach(every => {
const el = document.getElementById(every.desc);
if (el) {
//
every.offsetTop = el.getBoundingClientRect().top + window.pageYOffset;
}
});
});
},
handleScroll() {
if (this.scrollLock || !this.menuList[this.curIndex]?.list) return;
const scrollPosition = this.getScrollPosition();
let activeFloor = null;
console.log(this.curIndex, scrollPosition, 'this.curIndex===');
//
// for (let i = this.menuList[this.curIndex].list.length - 1; i >= 0; i--) {
// const item = this.menuList[this.curIndex].list[i];
// if (scrollPosition + 100 >= (item.offsetTop || 0)) { // 100
// activeFloor = item.desc;
// break;
// }
// }
//
for (let i = 0; i < this.menuList[this.curIndex].list.length; i++) {
const item = this.menuList[this.curIndex].list[i];
if (scrollPosition + 100 >= (item.offsetTop || 0)) { // 100
activeFloor = item.desc;
break;
}
}
if (activeFloor && this.activeFloor !== activeFloor) {
this.activeFloor = activeFloor;
}
},
getScrollPosition() {
if (this.scrollContainer === window) {
return window.pageYOffset || document.documentElement.scrollTop;
}
return this.scrollContainer.scrollTop;
},
// setActiveCur(dom, item) {
// if (this.$route.path != item.path) {
// this.$router.push(item.path)
// store.commit('SET_PAGETITLE', item.name);
// }
// setTimeout(() => {
// this.activeFloor = dom;
// this.setHighActive(dom)
// }, 500)
// },
// setHighActive(dom) {
// this.scrollLock = true;
// const ele = document.getElementById(dom)
// if (!ele) return
// ele.classList.add('ceshi')
// ele.scrollIntoView({ behavior: 'smooth', block: 'start' })
// setTimeout(() => {
// ele.classList.remove('ceshi')
// }, 1000)
// }
setActiveCur(item1, item, index) {
console.log(item1,'===---item1');
store.commit('SET_CURRENTMENUITEM', item1);
this.currentMenuItem = item1;
this.curIndex = index;
let subtitle = this.renderKeyNew.subtitle;
let domName = this.renderKeyNew.domName;
let componentsName = item1?.componentsName;
//
if (componentsName) {
this.activeFloor = componentsName;
//
store.commit('SET_COMPONENTS_NAME', componentsName);
return
}
this.scrollLock = true;
this.activeFloor = item1[subtitle];
this.$nextTick(() => {
this.setHighActive(item1[domName]);
setTimeout(() => {
this.scrollLock = false;
}, 1000);
});
},
setHighActive(dom) {
const ele = document.getElementById(this.renderKeyNew.domAppend + dom);
if (ele) {
ele.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
}
}
};
</script>
<style scoped lang="scss">
/* 自定义折叠图标 */
::v-deep .el-collapse-item__header .el-collapse-item__arrow {
display: none !important;
}
::v-deep .el-collapse-item__header {
max-width: 162px;
}
.arrow_img {
width: 14px;
height: 14px;
}
.arrow_img.is-active {
transform: rotate(90deg);
}
.collapse-item {
width: 100%;
}
.menu-name {
font-size: 14px;
font-weight: normal;
letter-spacing: 0.08em;
color: #1E2226;
padding: 11px 0;
height: 40px;
line-height: 18px;
width: 100%;
// max-width: 96px;
box-sizing: border-box;
span{
// max-width: 50px;
// width: 50px;
text-align: left;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.l-price-ed{
width: auto;
height: 23px;
display: flex;
flex-direction: column;
padding: 5px 8px;
gap: 10px;
z-index: 1;
border-radius: 4px;
background: #F2F3F5;
}
.menuListItem {
padding: 0 15px 0 16px;
display: flex;
justify-content: space-between;
align-items: center;
font-family: Microsoft YaHei UI;
gap: 8px;
min-width: 0; /* 重要:防止flex容器溢出 */
}
.curActive_ing{
display: none !important;
opacity: 0;
}
.menuListItem .l-menu-name {
// flex: 1; /* */
min-width: 0; /* 重要:允许文本截断 */
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #8A9099;
padding: 7px 0;
height: 36px;
box-sizing: border-box;
}
.menuListItem .l-price-ing {
flex-shrink: 0;
min-width: 84px;
height: 23px;
display: flex;
flex-direction: column;
justify-content: center;
padding: 5px 8px;
box-sizing: border-box;
border-radius: 4px;
background: #BFDAFF;
opacity: 1;
white-space: nowrap;
font-family: Microsoft YaHei;
font-size: 12px;
font-weight: normal;
line-height: 13px;
letter-spacing: 0.08em;
color: #8A9099;
background: #F2F3F5;
}
.menuListItem{
padding: 0 15px 0 16px;
}
.curActive {
.curActive_ing{
display: block !important;
opacity: 1;
}
background: #F2F7FF;
.l-menu-name {
color: #006AFF;
font-weight: bold;
}
.l-price-ing{
opacity: 1;
display: block;
color: #006AFF;
white-space: nowrap;
background: #BFDAFF;
}
.l-price-ed{
color: #006AFF;
background: #BFDAFF;
}
}
.menu-select {
width: 8px;
height: 8px;
border-radius: 100%;
background: #00C261;
}
.el-collapse {
min-width: 210px;
max-width: 210px;
background-color: #fff;
height: 100%;
overflow-y: auto;
padding: 21px 0px 21px 0px;
box-sizing: border-box;
box-shadow: 0px 0px 11px 2px rgba(147, 147, 147, 0.11);
}
.selected {
width: 20px;
height: 14px;
}
::v-deep .el-collapse-item__header {
height: 40px;
border-bottom: none;
padding: 0 15px 0 16px;
}
::v-deep .el-collapse-item__content {
padding-bottom: 0;
}
::v-deep .el-collapse-item__wrap {
border-bottom: none;
}
</style>

697
src/components/site/addSiteStep/step1.vue

@ -6,36 +6,38 @@
<h3>站点信息</h3>
<div class="flex-wrap">
<div class="flex-left">
<GuipFormItem column="column" class="mb24">
<div slot="formLeft">站点简称</div>
<div slot="formRight" class="desc">一个站点对应一个销售渠道定义好名字好区分</div>
<GuipInput slot="formDom" ref="GuipInput" prop="short_name" :maxlength="10" :showWordLimit="true"
v-model="formData.short_name" placeholder="仅自己区分站点销售渠道,客户看不到" />
</GuipFormItem>
<GuipFormItem column="column" class="channel-radio">
<div slot="formLeft">销售渠道</div>
<span slot="formRight" class="desc">{{formData.sale_channel_label}}</span>
<GuipRadio slot="formDom" v-model="formData.sale_channel" :options="formData.sale_channels"
prop="sale_channel" :rules="formRules.sale_channel" @change="radioChange" />
</GuipFormItem>
<GuipInput label="站点简称" class="column" ref="GuipInput" prop="short_name"
desc="一个站点对应一个销售渠道,定义好名字好区分" :maxlength="10" :showWordLimit="true"
v-model="formData.short_name" placeholder="仅自己区分站点销售渠道,客户看不到" />
<GuipRadio label="销售渠道" class="column" :desc="formData.sale_channel_label"
v-model="formData.sale_channel" :options="formData.sale_channels" prop="sale_channel"
:rules="formRules.sale_channel" @change="radioChange" />
</div>
<div class="flex-line"></div>
<div class="flex-right">
<GuipFormItem column="column" class="mb24">
<div slot="formLeft">域名来源</div>
<GuipRadio slot="formDom" v-model="formData.domain_type" :options="formData.domain_types" prop="domain"/>
<GuipRadio slot="formDom" v-model="formData.domain_type"
:options="formData.domain_types" prop="domain" />
</GuipFormItem>
<GuipFormItem column="column" v-if="formData.domain_type==='1'">
<!-- <GuipFormItem column="column" v-if="formData.domain_type === '1'">
<div slot="formLeft">域名设置</div>
<GuipInput slot="formDom" ref="GuipInput" prop="domain_prefix" placeholder="仅支持数字、字母"
v-model="formData.domain_prefix" :rules="formRules.domain_prefix" class="w540">
<i slot="suffix" v-if="formData.domain_prefix" class="el-icon-close" @click="handleClear"></i>
<span slot="appendshow">{{formData.plat_domain}}</span>
<GuipInput slot="formDom" v-if="formData.domain_type === '1'" label="域名设置" ref="GuipInput" prop="domain_prefix" placeholder="仅支持数字、字母"
v-model="formData.domain_prefix" :rules="formRules.domain_prefix" class="w540">
<i slot="suffix" v-if="formData.domain_prefix" class="el-icon-close"
@click="handleClear"></i>
<span slot="appendshow">{{ formData.plat_domain }}</span>
</GuipInput>
</GuipFormItem>
<GuipFormItem column="column" v-if="formData.domain_type==='2'">
<div slot="formLeft">域名设置</div>
<domainBind ref="domainBind" slot="formDom" :defaultPrefix="formData.domain_prefix" :defaultDomain="formData.domain_name" @handleEvent="handleChangeDomain" />
</GuipFormItem> -->
<GuipInput v-if="formData.domain_type === '1'" label="域名设置" ref="GuipInput" prop="domain_prefix" placeholder="仅支持数字、字母"
v-model="formData.domain_prefix" :rules="formRules.domain_prefix" class="column w540">
<i slot="suffix" v-if="formData.domain_prefix" class="el-icon-close"
@click="handleClear"></i>
<span slot="appendshow">{{ formData.plat_domain }}</span>
</GuipInput>
<GuipFormItem column="column" :required="true" label="域名设置" v-if="formData.domain_type === '2'">
<domainBind ref="domainBind" slot="formDom" :defaultPrefix="formData.domain_prefix"
:defaultDomain="formData.domain_name" @handleEvent="handleChangeDomain" />
</GuipFormItem>
</div>
</div>
@ -46,20 +48,22 @@
<div class="flex-left">
<p class="flex-left-desc">销售方向</p>
<div class="flex mt12">
<GuipRadio v-model="formData.site_type" :options="formData.site_types" :rules="formRules.sale_channel" prop="site_type" @change="radioTypeChange" />
<GuipRadio v-model="formData.site_type" :options="formData.site_types"
:rules="formRules.sale_channel" prop="site_type" @change="radioTypeChange" />
</div>
<div class="tem-home">
<div class="tem-home-top">
<img :src="formData.picture?formData.picture:require('@/assets/register/tem-img-normal.png')" alt="">
<img :src="formData.picture ? formData.picture : require('@/assets/register/tem-img-normal.png')"
alt="">
</div>
<div class="tem-home-bottom">
<input type="hidden" v-model="formData.site_tpl">
<b>{{formData.site_tpl_name}}</b>
<b>{{ formData.site_tpl_name }}</b>
<div>
<!-- <div class="tem-look" @click="previewTpl">-->
<!-- <img src="@/assets/register/look-tem.svg" alt="">-->
<!-- 预览-->
<!-- </div>-->
<!-- <div class="tem-look" @click="previewTpl">-->
<!-- <img src="@/assets/register/look-tem.svg" alt="">-->
<!-- 预览-->
<!-- </div>-->
<div @click="changeTpl">
<img src="@/assets/register/edit-tem.svg" alt="">
修改
@ -89,8 +93,10 @@
</div>
</div>
<div class="register-btns">
<GuipButton v-if="skip" type="ignore" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">跳过</GuipButton>
<GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="saveConfirm">下一步</GuipButton>
<GuipButton v-if="skip" type="ignore" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">
跳过</GuipButton>
<GuipButton ref="nextStepRef1" type="primary" :btnstyle="{ width: '144px', height: '46px' }"
@click="saveConfirm">下一步</GuipButton>
</div>
</el-form>
</div>
@ -105,341 +111,380 @@ import domainBind from "@/components/domainBind.vue";
import db from '@/utils/indexedDBUtil'
export default {
name: 'domainSet',
props: {
siteInfo: {
type: Object,
required: true
},
skip: {
type: Boolean,
required: false
}
},
components: {
domainBind,
GuipFormItem, GuipRadio, GuipInput,
GuipButton
},
data(){
return {
showAlert: false,
formData: {
short_name: '',
sale_channel: '',
sale_channel_label: '',
site_type: '',
site_tpl: '',
site_tpl_name: '',
site_tpl_ico: '',
site_tpl_logo: '',
picture:'',
not_finished_uid: '',
plat_domain: '',
domain_type: '',
domain_prefix: '',
domain_name: '',
sale_channels:{},
sale_channels_label:{},
domain_types:{},
site_types:{},
site_type_tpl:{},
},
formRules: {
short_name: [
{ required: true, message: '请输入站点简称', trigger: 'blur' }
],
sale_channel: [
{ required: true, message: '请选择销售渠道', trigger: 'blur' }
],
domain_prefix: [
{ required: true, message: '请设置站点域名', trigger: 'blur' }
],
site_type: [
{ required: true, message: '请选择站点类型', trigger: 'blur' }
],
name: 'domainSet',
props: {
siteInfo: {
type: Object,
required: true
},
}
},
computed: {
submitData() {
let domain = "";
if (this.formData.domain_type === '1') {
domain = this.formData.domain_prefix + this.formData.plat_domain
} else if (this.formData.domain_type === '2') {
domain = this.formData.domain_prefix + this.formData.domain_name
skip: {
type: Boolean,
required: false
}
},
components: {
domainBind,
GuipFormItem, GuipRadio, GuipInput,
GuipButton
},
data() {
return {
short_name: this.formData.short_name,
domain: domain,
sale_channel: this.formData.sale_channel,
site_type: this.formData.site_type,
site_tpl: this.formData.site_tpl,
not_finished_uid: this.formData.not_finished_uid,
ico: this.formData.site_tpl_ico,
logo: this.formData.site_tpl_logo,
showAlert: false,
formData: {
short_name: '',
sale_channel: '',
sale_channel_label: '',
site_type: '',
site_tpl: '',
site_tpl_name: '',
site_tpl_ico: '',
site_tpl_logo: '',
picture: '',
not_finished_uid: '',
plat_domain: '',
domain_type: '',
domain_prefix: '',
domain_name: '',
sale_channels: {},
sale_channels_label: {},
domain_types: {},
site_types: {},
site_type_tpl: {},
},
formRules: {
short_name: [
{ required: true, message: '请输入站点简称', trigger: 'blur' }
],
sale_channel: [
{ required: true, message: '请选择销售渠道', trigger: 'blur' }
],
domain_prefix: [
{ required: true, message: '请设置站点域名', trigger: 'blur' }
],
site_type: [
{ required: true, message: '请选择站点类型', trigger: 'blur' }
],
},
}
},
},
mounted() {
const formData = JSON.parse(localStorage.getItem('formData'))
if(formData){
this.formData = formData;
localStorage.removeItem('formData')
this.getSiteTplSet()
return true;
}
computed: {
submitData() {
let domain = "";
if (this.formData.domain_type === '1') {
domain = this.formData.domain_prefix + this.formData.plat_domain
} else if (this.formData.domain_type === '2') {
domain = this.formData.domain_prefix + this.formData.domain_name
}
return {
short_name: this.formData.short_name,
domain: domain,
sale_channel: this.formData.sale_channel,
site_type: this.formData.site_type,
site_tpl: this.formData.site_tpl,
not_finished_uid: this.formData.not_finished_uid,
ico: this.formData.site_tpl_ico,
logo: this.formData.site_tpl_logo,
}
},
},
mounted() {
const formData = JSON.parse(localStorage.getItem('formData'))
if (formData) {
this.formData = formData;
localStorage.removeItem('formData')
this.getSiteTplSet()
return true;
}
if(this.skip && !localStorage.getItem('showAlert')) this.showAlert = true
this.getAddInfo()
},
methods:{
hideAlert(){
this.showAlert = false
localStorage.setItem('showAlert', false)
},
async getSiteTplSet(){
const siteTplInfo = JSON.parse(localStorage.getItem('site_tpl_info'))
if(siteTplInfo){
this.formData.site_tpl = siteTplInfo.site_tpl
this.formData.site_tpl_name = siteTplInfo.site_tpl_name
this.formData.picture = siteTplInfo.picture
}
if (this.skip && !localStorage.getItem('showAlert')) this.showAlert = true
this.getAddInfo()
},
methods: {
hideAlert() {
this.showAlert = false
localStorage.setItem('showAlert', false)
},
async getSiteTplSet() {
const siteTplInfo = JSON.parse(localStorage.getItem('site_tpl_info'))
if (siteTplInfo) {
this.formData.site_tpl = siteTplInfo.site_tpl
this.formData.site_tpl_name = siteTplInfo.site_tpl_name
this.formData.picture = siteTplInfo.picture
}
const ico = await db.get('ico')
if(ico) this.formData.site_tpl_ico = ico
const logo = await db.get('logo')
if(logo) this.formData.site_tpl_logo = logo
},
getAddInfo() {
const that = this
this.$http('POST', '/agentnew/ajax_get_site_add_info', {}).then(response => {
if(response.status){
const addInfo = response.data
that.formData.sale_channels = addInfo.sale_channels
that.formData.sale_channels_label = addInfo.sale_channels_label
const ico = await db.get('ico')
if (ico) this.formData.site_tpl_ico = ico
const logo = await db.get('logo')
if (logo) this.formData.site_tpl_logo = logo
},
getAddInfo() {
const that = this
this.$http('POST', '/agentnew/ajax_get_site_add_info', {}).then(response => {
if (response.status) {
const addInfo = response.data
that.formData.sale_channels = addInfo.sale_channels
that.formData.sale_channels_label = addInfo.sale_channels_label
that.formData.domain_type = String(addInfo.domain_type)
that.formData.domain_types = addInfo.domain_types
that.formData.plat_domain = addInfo.plat_domain
that.formData.domain_type = String(addInfo.domain_type)
that.formData.domain_types = addInfo.domain_types
that.formData.plat_domain = addInfo.plat_domain
that.formData.site_type = String(addInfo.site_type)
that.formData.site_types = addInfo.site_types
that.formData.site_type_tpl = addInfo.site_type_tpl
if(that.formData.site_type){
that.formData.site_tpl = this.formData.site_type_tpl[this.formData.site_type].site_tpl
that.formData.site_tpl_name = this.formData.site_type_tpl[this.formData.site_type].site_tpl_name
that.formData.picture = this.formData.site_type_tpl[this.formData.site_type].picture
}
that.formData.site_type = String(addInfo.site_type)
that.formData.site_types = addInfo.site_types
that.formData.site_type_tpl = addInfo.site_type_tpl
if (that.formData.site_type) {
that.formData.site_tpl = this.formData.site_type_tpl[this.formData.site_type].site_tpl
that.formData.site_tpl_name = this.formData.site_type_tpl[this.formData.site_type].site_tpl_name
that.formData.picture = this.formData.site_type_tpl[this.formData.site_type].picture
}
if(Object.keys(that.siteInfo).length>0){
that.$nextTick(() => {
that.formData.short_name = that.siteInfo.short_name
that.formData.sale_channel = String(that.siteInfo.sale_channel)
that.formData.site_type = String(that.siteInfo.site_type)
that.formData.site_tpl = that.siteInfo.site_tpl
that.formData.site_tpl_name = that.siteInfo.site_tpl_name
that.formData.picture = that.siteInfo.picture
that.formData.not_finished_uid = that.siteInfo.uid
if (Object.keys(that.siteInfo).length > 0) {
that.$nextTick(() => {
that.formData.short_name = that.siteInfo.short_name
that.formData.sale_channel = String(that.siteInfo.sale_channel)
that.formData.site_type = String(that.siteInfo.site_type)
that.formData.site_tpl = that.siteInfo.site_tpl
that.formData.site_tpl_name = that.siteInfo.site_tpl_name
that.formData.picture = that.siteInfo.picture
that.formData.not_finished_uid = that.siteInfo.uid
that.formData.domain_type = String(that.siteInfo.domain_type)
that.formData.domain_prefix = that.siteInfo.domain_prefix;
that.formData.domain_name = that.siteInfo.domain_name;
})
}
return true
}
that.$message.error(response.info);
}).catch(error => {
console.error(error, 'error')
})
},
radioChange(){
const labels = this.formData.sale_channels_label;
const value = this.formData.sale_channel;
this.formData.sale_channel_label = labels && labels[value] ? labels[value] : '';
},
radioTypeChange(){
if(this.formData.site_type){
this.formData.site_tpl = this.formData.site_type_tpl[this.formData.site_type].site_tpl
this.formData.site_tpl_name = this.formData.site_type_tpl[this.formData.site_type].site_tpl_name
this.formData.picture = this.formData.site_type_tpl[this.formData.site_type].picture
}
},
handleClear() {
this.formData.domain_prefix = '';
},
handleChangeDomain(data) {
this.formData.domain_prefix = data.prefix
this.formData.domain_name = data.domain
},
// previewTpl(){
// window.open('http://'+this.siteInfo.domain, '_blank');
// },
changeTpl(){
if(this.formData.site_type === ''){
this.$message.warning('请选择站点类型');
return false;
}
localStorage.setItem('formData', JSON.stringify(this.formData))
if(this.formData.not_finished_uid){
this.$router.push(`/agent/siteTemplate?uid=${this.formData.not_finished_uid}`)
}else{
this.$router.push(`/agent/siteTemplate?site_type=${this.formData.site_type}`)
}
},
jumpStep(){
this.$router.push('/')
},
saveConfirm() {
const that = this
let formValid = false;
that.$refs.formRef.validate((valid) => {
formValid = valid
});
that.formData.domain_type = String(that.siteInfo.domain_type)
that.formData.domain_prefix = that.siteInfo.domain_prefix;
that.formData.domain_name = that.siteInfo.domain_name;
})
}
return true
}
that.$message.error(response.info);
}).catch(error => {
console.error(error, 'error')
})
},
radioChange() {
const labels = this.formData.sale_channels_label;
const value = this.formData.sale_channel;
this.formData.sale_channel_label = labels && labels[value] ? labels[value] : '';
},
radioTypeChange() {
if (this.formData.site_type) {
this.formData.site_tpl = this.formData.site_type_tpl[this.formData.site_type].site_tpl
this.formData.site_tpl_name = this.formData.site_type_tpl[this.formData.site_type].site_tpl_name
this.formData.picture = this.formData.site_type_tpl[this.formData.site_type].picture
}
},
handleClear() {
this.formData.domain_prefix = '';
},
handleChangeDomain(data) {
this.formData.domain_prefix = data.prefix
this.formData.domain_name = data.domain
},
// previewTpl(){
// window.open('http://'+this.siteInfo.domain, '_blank');
// },
changeTpl() {
if (this.formData.site_type === '') {
this.$message.warning('请选择站点类型');
return false;
}
localStorage.setItem('formData', JSON.stringify(this.formData))
if (this.formData.not_finished_uid) {
this.$router.push(`/agent/siteTemplate?uid=${this.formData.not_finished_uid}`)
} else {
this.$router.push(`/agent/siteTemplate?site_type=${this.formData.site_type}`)
}
},
jumpStep() {
this.$router.push('/')
},
validateFunc(fields){
const that = this
let flag = false
//
if(Array.isArray(fields)){
fields.forEach(field => {
if (flag) return
//
field.validate('', (error) => {
if (error) {
// label
const label = field.label;
const prop = field.prop;
let domainValid = false;
if(that.formData.domain_type === '2'){
that.$refs.domainBind.$refs.bindFormRef.validate(valid => {
domainValid = valid
})
}else{
domainValid = true
}
flag = true;
console.log('label',prop, label);
if (!label) return
that.$positionMessage({
type: 'error',
message: label + '不得为空',
target: that.$refs.nextStepRef1, // DOM
position: 'top'
})
}
});
});
}
},
saveConfirm() {
const that = this
let formValid = false;
let fields = that.$refs.formRef.fields;
that.validateFunc(fields)
that.$refs.formRef.validate((valid) => {
formValid = valid
});
let domainValid = false;
if (that.formData.domain_type === '2') {
that.$refs.domainBind.$refs.bindFormRef.validate(valid => {
domainValid = valid
})
that.$positionMessage({
type: 'error',
message: '域名设置不得为空',
target: that.$refs.nextStepRef1, // DOM
position: 'top'
})
} else {
domainValid = true
}
if (formValid && domainValid) {
that.$http('POST', '/agentnew/ajax_add_new_site', that.submitData).then(async response => {
if(response.status && response.data.uid){
await that.deleteSiteTplData()
if (formValid && domainValid) {
that.$http('POST', '/agentnew/ajax_add_new_site', that.submitData).then(async response => {
if (response.status && response.data.uid) {
await that.deleteSiteTplData()
that.formData.uid = response.data.uid
that.$emit('handelSiteInfo', that.formData)
that.formData.uid = response.data.uid
that.$emit('handelSiteInfo', that.formData)
if(that.formData.sale_channel === '2'){
//
that.$emit('handelStep', 3)
}else{
that.$emit('handelStep', 2)
}
return true;
}
that.$message.error(response.info);
}).catch(error => {
console.error(error, 'error')
})
}
},
async deleteSiteTplData(){
localStorage.removeItem('activeStep')
localStorage.removeItem('site_tpl_info')
await db.remove('ico')
await db.remove('logo')
},
}
if (that.formData.sale_channel === '2') {
//
that.$emit('handelStep', 3)
} else {
that.$emit('handelStep', 2)
}
return true;
}
that.$message.error(response.info);
}).catch(error => {
console.error(error, 'error')
})
}
},
async deleteSiteTplData() {
localStorage.removeItem('activeStep')
localStorage.removeItem('site_tpl_info')
await db.remove('ico')
await db.remove('logo')
},
}
}
</script>
<style lang="scss" scoped>
.w540{
width: 540px;
.w540 {
width: 540px;
}
.mt20{
margin-top: 20px;
.mt20 {
margin-top: 20px;
}
.step1-wrap{
padding-bottom: 12px;
.step1-wrap {
padding-bottom: 12px;
}
.tem-home {
width: 100%;
border-radius: 4px;
opacity: 1;
background: #FFFFFF;
/* middle/middle_line_1 */
border: 1px solid #DFE2E6;
.tem-home-top {
width: 100%;
height: 255px;
overflow: hidden;
img{
width: 100%;
}
}
border-radius: 4px;
opacity: 1;
background: #FFFFFF;
/* middle/middle_line_1 */
border: 1px solid #DFE2E6;
.tem-home-bottom {
display: flex;
align-items: center;
padding: 22px 32px;
justify-content: space-between;
.tem-home-top {
width: 100%;
height: 255px;
overflow: hidden;
.tem-look {
margin-right: 36px;
img {
width: 100%;
}
}
div {
display: flex;
align-items: center;
.tem-home-bottom {
display: flex;
align-items: center;
padding: 22px 32px;
justify-content: space-between;
img {
margin-right: 6px;
}
.tem-look {
margin-right: 36px;
}
div {
display: flex;
align-items: center;
img {
margin-right: 6px;
}
}
}
}
}
::v-deep{
.el-input-group__append{
width: 175px;
letter-spacing: 0.08em;
}
::v-deep {
.el-input-group__append {
width: 175px;
letter-spacing: 0.08em;
}
.channel-radio .el-radio-group{
text-align: left;
}
.channel-radio .el-radio{
min-width: 120px;
line-height: 16px;
}
.channel-radio .el-radio-group {
text-align: left;
}
.channel-radio .el-radio {
min-width: 120px;
line-height: 16px;
}
}
.register-btns {
position: sticky;
left: 0;
bottom: 0;
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
background: #FFFFFF;
padding: 16px 0px;
/* 蓝色阴影_常规 */
box-shadow: 0px 4px 16px 0px rgba(17, 55, 143, 0.12);
z-index: 999;
box-sizing: border-box;
position: sticky;
left: 0;
bottom: 0;
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
background: #FFFFFF;
padding: 16px 0px;
/* 蓝色阴影_常规 */
box-shadow: 0px 4px 16px 0px rgba(17, 55, 143, 0.12);
z-index: 999;
box-sizing: border-box;
button:nth-child(1) {
margin-right: 56px;
}
button:nth-child(1) {
margin-right: 56px;
}
}
.register-top {
position: sticky;
left: 0;
bottom: 78px;
width: 100%;
align-items: center;
padding: 20px 0;
background: linear-gradient(270deg, #F6EEF7 3%, #EDE9FB 97%);
color: #23242B;
letter-spacing: 0.08em;
line-height: 32px;
z-index: 999;
box-sizing: border-box;
.register-top-left {
display: flex;
position: sticky;
left: 0;
bottom: 78px;
width: 100%;
align-items: center;
gap: 10px;
}
padding: 20px 0;
background: linear-gradient(270deg, #F6EEF7 3%, #EDE9FB 97%);
color: #23242B;
letter-spacing: 0.08em;
line-height: 32px;
z-index: 999;
box-sizing: border-box;
.register-top-left {
display: flex;
align-items: center;
gap: 10px;
}
}
</style>

12
src/components/site/serviceSetting/domainSet.vue

@ -6,16 +6,16 @@
<div class="flex-common">
<div class="domain-area">
<el-form class="el-row demo-ruleForm" ref="formRef">
<div class="flex domain-info">
<span>当前服务域名</span><span>{{info.domain}}</span>
</div>
<div class="domain-from">域名来源</div>
<div class="domain-radio">
<GuipRadio v-model="domain_type" :options="domain_types"/>
</div>
<div class="flex domain-info">
<span>当前服务域名</span><span>{{info.domain}}</span>
</div>
<domainBind ref="domainBind" v-if="domain_type === '2'" label="域名设置"
<domainBind ref="domainBind" v-if="domain_type === '2'" label="独立域名"
:defaultPrefix="newDomain.prefix" :defaultDomain="newDomain.domain" @handleEvent="handleEvent"/>
</el-form>
</div>
@ -121,7 +121,7 @@ export default {
font-size: 14px;
letter-spacing: 0.08em;
color: #1E2226;
margin-bottom: 12px;
margin-bottom: 16px;
}
.domain-radio{

21
src/router/index.js

@ -9,7 +9,7 @@ const whiteSecondSider = [
];
const blackSliderList = [
'/franchise', '/agreement', '/customizeDoc', '/agent/siteAdd', '/agent/siteServiceList', '/agent/siteTemplate','/agent/siteAddFinally','/agent/siteServiceAdd', '/agent/supplyList',
'/agent/domainList'
'/agent/domainList','/agent/siteAddChooseService'
, '/agent/noticeList'
];
// 一级路由
@ -24,7 +24,7 @@ const blackHeaderRightList = [
];
const blackFooterList = [
'/', '/franchise','/agreement', '/customizeDoc','/agent/siteAdd', '/agent/payInfoSetting','/agent/siteServiceEdit','/agent/siteAddFinally','/agent/siteServiceAdd',
'/agent/siteTemplate'
'/agent/siteTemplate','/agent/siteAddChooseService'
];
// const whiteSlideList = ['/', '/ui',
// '/agent/siteList',
@ -184,12 +184,23 @@ const routes = [{
}
},
{
path: '/agent/siteAddChooseService',
name: '服务列表-添加',
isFirst: true,
component: () => import( /* webpackChunkName: "siteServiceAdd" */ '../views/agent/siteAddChooseService.vue'),
meta: {
title: '添加服务',
breadcrumbParent: '服务列表',
// hideBreadcrumb: true // 一级页面不显示面包屑
}
},
{
path: '/agent/siteServiceAdd',
name: '服务列表-添加',
isFirst: true,
component: () => import( /* webpackChunkName: "siteServiceAdd" */ '../views/agent/siteServiceAdd.vue'),
meta: {
title: '添加服务',
title: '设置价格',
breadcrumbParent: '服务列表',
// hideBreadcrumb: true // 一级页面不显示面包屑
}
@ -529,7 +540,7 @@ const router = new VueRouter({
})
router.beforeEach((to, from, next) => {
// 有关路由跳转时,部分状态重置
store.commit('SET_SECOND_MENU', []);
// store.commit('SET_SECOND_MENU', []);
if(store.state.componentsName){
store.commit('SET_COMPONENTS_NAME', '');
}
@ -581,7 +592,7 @@ router.beforeEach((to, from, next) => {
router.afterEach(() => {
// 清除存储的currentMenuItem
if(!store.state.showSecondSide && store.state.currentMenuItem){
store.commit('SET_CURRENTMENUITEM',null);
// store.commit('SET_CURRENTMENUITEM',null);
}
// 添加延迟确保过渡效果

2
src/style/theme/common.scss

@ -78,7 +78,7 @@ body {
cursor: pointer;
transition: all .3s;
&:hover {
& > *:hover {
transition: all .3s;
color: #006AFF !important;
}

427
src/views/agent/siteAddChooseService.vue

@ -0,0 +1,427 @@
<template>
<div class="">
<div class="addService_wrap">
<div class="addServicetop">
<h3 class="classify-title">添加查重服务</h3>
<b>选择品牌</b>
<p class="ver-desc">{{ }}</p>
<!-- 分类导航 -->
<!-- 暂时注释 修改时放开即可 -->
<!-- <el-scrollbar v-if="menuList">
<ul>
<li v-for="(item, index) in menuList" :key="item.name" @click="scrollToCategory(index)"
:class="['normal_service', activeCategory == index ? 'active_service' : '']">
<span class="flex">
<img :src="require('@/assets/serviceIcon/ver_'+item.type+'.svg')" alt="">
{{ item.name }}
</span>
<img class="activeImg" src="@/assets/serviceIcon/activeImg_choose.svg" alt="">
</li>
</ul>
</el-scrollbar> -->
</div>
<!-- 内容 -->
<div class="addServicebot" ref="content">
<b>选择服务</b>
<div class="flex operateCheck">
<div class="checkboxAll">
<el-checkbox @change="handleSelectAllChange" v-model="selectAll"
:indeterminate="isIndeterminate">全选</el-checkbox>
</div>
<span class="totalCount">{{ addlist.length }}已选{{ serviceTotal }}</span>
</div>
<ul :key="datenow" v-if="addlist.length > 0">
<li v-for="item in addlist" :key="item.name"
:class="item.checked ? 'service-active' : ''">
<div class="service-name-item flex-between">
<span>{{ item.name }}</span>
<input type="checkbox" :id="`item-${item.id}`" v-model="item.checked"
@change="updateSelectedCount" />
</div>
<p class="service-desc-item">{{ }}</p>
<p class="service-price-item"><i>¥</i><span>{{ item.price }}</span> / {{ item.word }}</p>
</li>
</ul>
</div>
</div>
<div class="bottom flex">
<GuipButton type="system" size="page" @click="cancel">取消</GuipButton>
<GuipButton type="primary" size="page" @click="nextGoSettingPrice">确定去设置售价</GuipButton>
<p>已选<b>{{ serviceTotal }}</b>项服务</p>
</div>
</div>
</template>
<script>
import store from '@/store';
import GuipButton from '@/components/GuipButton.vue';
export default {
name: 'siteServiceAdd',
props: [''],
components: {
GuipButton,
},
data() {
return {
selectAll: false,
isIndeterminate: false,
datenow:Date.now(),
serviceTotal:0,
activeCategory:0,
uid: 0,
type: 0,
prodid: 0,
menuList:null,
addlist:[
],
serviceAddUrl: '/agent/siteServiceAdd',
}
},
watch: {
},
created() {
if (!this.$route.query.uid && !this.$route.query.prodid) {
this.$message.error('非法请求');
this.$router.push('/agent/siteAdd')
}
this.uid = this.$route.query.uid
this.prodid = this.$route.query.prodid
// this.loadPddSDK()
},
mounted() {
store.commit('SET_PAGETITLE', '站点信息');
this.getAddServiceList();
},
computed: {
//
selectedCount() {
const newaddlist = JSON.parse(JSON.stringify(this.addlist))
if(!newaddlist.length)return 0
let list = []
newaddlist.forEach(item => {
if (item.checked) {
list.push(item)
}
})
return list.length;
},
},
methods: {
cancel(){
this.$router.go(-1)
},
updateSelectedCount() {
this.serviceTotal = this.addlist.filter(item => item.checked).length;
this.$set(this.menuList[this.activeCategory],'list',this.addlist)
const allSelected = this.serviceTotal === this.addlist.length;
const noneSelected = this.serviceTotal === 0;
this.selectAll = allSelected;
this.isIndeterminate = !noneSelected && !allSelected;
this.datenow = Date.now()
},
nextGoSettingPrice() {
const result = {};
Object.entries(this.menuList).forEach(([key, category]) => {
//
const selectedList = category.list.filter(item => item.checked);
//
if (category.checked || selectedList.length > 0) {
result[key] = {
...category,
list: selectedList
};
}
});
store.commit('SET_SECOND_MENU', result);
localStorage.setItem('selectedServices',JSON.stringify(result))
this.$router.push(this.serviceAddUrl + '?uid=' + this.uid + '&prodid=' + this.prodid)
},
//
getAddServiceList() {
const that = this
that.$http('POST', '/agentnew/ajax_get_service_add_list', {
uid: that.uid,
prodid: that.prodid,
}).then(response => {
that.$nextTick(() => {
console.log(response,'response===');
//
// that.menuList = response.data
// that.activeCategory = Object.keys(response.data)[0];
// that.setMenuList()
})
}).catch(error => {
console.error(error, 'error')
})
},
setMenuList(type, status) {
this.addNum = 0
Object.values(this.menuList).forEach((item) => {
let ver_select = false
item.list.forEach((item1) => {
item1.checked = false
if (item1.type === type) {
item1.is_select = status
}
if (item1.is_select === true) {
ver_select = true
this.addNum++
}
})
if (ver_select) item.is_select = true
})
this.serviceTotal = 0;
this.scrollToCategory(this.activeCategory)
},
scrollToCategory(index) {
this.activeCategory = index;
this.addlist = this.menuList[index]['list']
this.serviceTotal = this.addlist.filter(item => item.checked).length;
console.log(this.addlist,'addlist===');
// const element = this.$refs[`category-${index}`][0];
// element.scrollIntoView({ behavior: 'smooth' });
},
handleSelectAllChange(){
this.addlist.forEach(item =>{
if(item.checked == !this.selectAll){
item.checked = !item.checked;
}
})
this.serviceTotal = this.addlist.filter(item => item.checked).length;
},
}
}
</script>
<style lang="scss">
.ver-desc{
font-size: 14px;
font-weight: 400;
line-height: normal;
letter-spacing: .08em;
color: #8a8c99;
margin: 12px 0;
}
.operateCheck{
margin: 24px 0 12px 0;
}
.totalCount {
font-size: 12px;
font-weight: normal;
line-height: 13px;
letter-spacing: 0.08em;
color: #8A9099;
margin-left: 12px;
}
.classify-title{
font-size: 20px;
font-weight: bold;
line-height: 26px;
letter-spacing: 0.08em;
color: #1E2226;
}
.addService_wrap {
text-align: left;
background-color: #fff;
padding: 36px;
margin: 12px;
.addServicetop {
// display: flex;
// justify-content: space-between;
// align-items: center;
// position: absolute;
// top: 12px;
// left: 24px;
// width: 963.43px;
b {
font-size: 14px;
font-weight: bold;
letter-spacing: 0.08em;
color: #1E2226;
}
ul {
display: flex;
padding-left: 0px;
gap: 8px;
li {
cursor: pointer;
list-style-type: none;
display: flex;
align-items: center;
display: flex;
white-space: nowrap;
min-width: 181.71px;
height: 46px;
box-sizing: border-box;
}
.normal_service {
letter-spacing: 0.08em;
color: #23242B;
border-radius: 6px;
background: #F2F7FF;
justify-content: space-between;
padding: 14px 10px;
img {
width: 30px;
height: 30px;
margin-right: 8px;
}
.activeImg{
width: 14px;
height: 14px;
display: none;
}
}
.active_service {
transition: all .3s;
color: #fff;
font-weight: bold;
box-sizing: border-box;
background: linear-gradient(285deg, #006AFF 4%, #4D97FF 92%);
box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.16);
.activeImg{
display: block;
}
}
}
}
.addServicebot {
overflow-y: auto;
max-height: 380px;
margin-top: 24px;
ul {
display: grid;
grid-gap: 14px;
grid-template-columns: repeat(auto-fit, 260px);
padding-left: 0;
margin: 20px 0 0;
li {
list-style-type: none;
width: 260px;
height: 126px;
border-radius: 4px;
opacity: 1;
padding: 14px 10px;
background: #FFFFFF;
box-sizing: border-box;
border: 1px solid #DFE2E6;
cursor: pointer;
transition: all .3s;
}
li:hover {
background: #F6F7FA;
transition: all .3s;
}
}
.service-active {
border: 1px solid #006AFF;
}
.service-desc {
font-size: 14px;
font-weight: normal;
letter-spacing: 0.08em;
font-variation-settings: "opsz" auto;
color: #8A8C99;
margin: 6px 0 8px;
}
.service-name-item {
font-size: 14px;
letter-spacing: 0.08em;
color: #1E2226;
}
.service-desc-item {
font-size: 12px;
font-weight: normal;
line-height: 17px;
letter-spacing: 0.03em;
font-variation-settings: "opsz" auto;
color: #8A9099;
margin: 14px 0 12px;
display: -webkit-box;
-webkit-line-clamp: 2;
/* 注意:这不是一个标准的CSS属性,仅在WebKit浏览器中有效 */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
height: 34px;
}
.service-price-item {
font-size: 12px;
line-height: 16px;
letter-spacing: 0.08em;
font-variation-settings: "opsz" auto;
color: #8A9099;
i {
font-style: normal;
color: #1E2226;
}
span {
color: #1E2226;
font-size: 20px;
font-weight: normal;
line-height: 20px;
}
}
.category-section {
padding: 20px;
h3 {
margin: 0;
font-size: 16px;
font-weight: normal;
letter-spacing: 0.08em;
color: #1E2226;
img {
width: 30px;
height: 30px;
margin-right: 8px;
}
}
}
}
}
.bottom {
justify-content: center;
align-items: center;
position: fixed;
bottom: 0;
width: 100%;
background: #fff;
padding: 16px 44px;
box-sizing: border-box;
p {
font-size: 14px;
font-weight: normal;
line-height: normal;
text-align: center;
letter-spacing: 0.08em;
font-variation-settings: "opsz" auto;
display: inline-block;
margin-left: 24px;
}
}
</style>

338
src/views/agent/siteServiceAdd.vue

@ -1,7 +1,7 @@
<template>
<div class="serviceAdd-wrap">
<div class="ml12 mr12 overFlow-wrap">
<PromptText text="如何添加服务?" :type="2" class="add-info">
<!-- <PromptText text="如何添加服务?" :type="2" class="add-info">
<template #next_desc>
<div class="alert-more flex gap12" :class="alertShow ? '' : 'alert-more-hide'" @click="handleAlert">
<div v-if="alertShow">收起</div>
@ -17,9 +17,81 @@
<div class="flex gap10">3.全部开启后点击底部 [返回服务列表] </div>
</div>
</template>
</PromptText>
</PromptText> -->
<div class="flex-common service_info">
<div class="service_info_wrap common_scss">
<div class="title flex gap6">
<img src="@/assets/site/price1.svg" alt="">
<b class="blue">服务信息</b>
</div>
<div class="flex">
<label>品牌名称</label>
<p>
<b>{{ }}人工摘要翻译</b>
{{ }}站点开通服务后除了新增了翻译入口外该站点的检测服务网页的右上角会显示翻译的广告宣传图点击会跳转到已开启的翻译页面
</p>
</div>
<div class="flex">
<label>服务名称</label>
<p>
<b>{{ }}</b>
{{ }}
</p>
</div>
<!--需要 增加条件判断 -->
<div class="flex">
<label>注意事项</label>
<p class="warn">
电商禁止售卖降重类的商品如果上架建议调整文案规避
</p>
</div>
</div>
<div class="flex-between gap24">
<div class="common_scss">
<div class="flex gap6">
<img src="@/assets/site/price2.svg" alt="">
<b class="blue">价格信息</b>
</div>
<div class="flex">
<label>进货价格</label>
<p>
{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}
</p>
</div>
<div class="flex" v-if="serviceAddInfo && serviceAddInfo.prompt && serviceAddInfo.prompt.title">
<label>售价规则</label>
<p>
{{ serviceAddInfo.prompt.title }}
</p>
</div>
</div>
<div class="common_scss green_back">
<div class="flex gap6">
<img src="@/assets/site/price3.svg" alt="">
<b class="green">利润分析</b>
</div>
<div class="flex">
<label>利润率</label>
<p v-if="service_unit == '1'">
因售卖单位设置为篇利率无法计算
</p>
<p v-if="service_unit == '0'">
{{ calculation.profitRate }}%因单位进制差异利率为约数
</p>
</div>
<div class="flex">
<label>利润额</label>
<p v-if="service_unit == '1'">因售卖单位设置为篇利润额无法计算</p>
<p v-if="service_unit == '0'">
每1000字赚{{ calculation.profitPerUnit }}因单位进制差异金额为约数
</p>
</div>
</div>
</div>
</div>
<div class="service-title flex-between" v-if="serviceAddInfo && serviceAddInfo.ver_type">
<!-- <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>
@ -28,9 +100,9 @@
<span class="service-status-close" @click="handleDelServiceClick">关闭服务</span>
<span class="service-status-desc">已开启</span>
</div>
</div>
</div> -->
<PromptText v-if="serviceAddInfo && serviceAddInfo.prompt && serviceAddInfo.prompt.title" :text='serviceAddInfo.prompt.title' :type="1"
<!-- <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">
@ -38,39 +110,42 @@
{{ item }}</div>
</div>
</template>
</PromptText>
</PromptText> -->
<!-- 网页售价 -->
<div class="flex-common 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">
<div class="price-top">
<span class="title">网页支付与售价</span>
<span class="desc"
v-if="serviceAddInfo.supply_price">供货价{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span>
<span class="title">网页售价</span>
<!-- <span class="desc"
v-if="serviceAddInfo.supply_price">供货价{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span> -->
</div>
<div class="flex-wrap">
<div class="flex-left">
<div class="flex-between mb12">
<div>售价管理</div>
</div>
<div class="flex-between">
<div class="short-width" v-if="Object.keys(serviceAddInfo.set_units).length>1">
<!-- <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> -->
<div class="short-width" v-if="service_unit !== '0'">
<GuipInput v-model="serviceInfo.price" width="100%"
ref="GuipInput" :unit="'元/'+serviceAddInfo.unit_name"></GuipInput>
</div>
</div>
<div class="flex-between mt12" v-if="service_unit === '0'">
<div class="flex-between" v-if="service_unit === '0'">
<div class="short-width">
<GuipInput width="100%" v-model="serviceInfo.price" ref="GuipInput" unit="元">
<GuipInput width="100%" v-model="serviceInfo.price" ref="GuipInput" unit="元" @blur="priceBlur">
</GuipInput>
</div>
<div class="short-width">
<GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" :unit="serviceAddInfo.unit_name">
<GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" :unit="serviceAddInfo.unit_name" @blur="priceBlur">
</GuipInput>
</div>
</div>
@ -121,20 +196,23 @@
<el-form class="el-row demo-ruleForm" ref="formRef">
<div class="price-top">
<span class="title">{{ serviceAddInfo.shop_name }}支付管理</span>
<span class="desc"
v-if="serviceAddInfo.supply_price && !serviceAddInfo.web_price_set">供货价{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span>
<!-- <span class="desc"
v-if="serviceAddInfo.supply_price && !serviceAddInfo.web_price_set">供货价{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span> -->
</div>
<div class="flex-wrap">
<div class="flex-left">
<div class="flex-between mb12">
<div>售价管理</div>
<div>售价设置</div>
</div>
<div class="flex-between">
<div class="short-width" v-if="Object.keys(serviceAddInfo.set_units).length>1">
<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> -->
<div class="short-width" v-if="service_unit !== '0'">
<GuipInput v-model="serviceInfo.unit_piece" width="100%"
ref="GuipInput" :unit="'件/'+serviceAddInfo.unit_name"></GuipInput>
@ -235,17 +313,18 @@
</GuipDialog>
</div>
<div class="register-btns flex gap12">
<span class="service-open-num">已开启 {{addNum}} 服务</span><GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">返回服务列表</GuipButton>
<!-- <span class="service-open-num">已开启 {{addNum}} 服务</span><GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">返回服务列表</GuipButton> -->
<GuipButton type="system" size="page" @click="jumpStep">取消</GuipButton>
<GuipButton type="primary" size="page" @click="jumpStep">设置下一项服务</GuipButton>
</div>
</div>
</template>
<script>
import store from '@/store';
import { mapState } from 'vuex';
import GuipButton from "@/components/GuipButton.vue";
import PromptText from "@/components/PromptText.vue";
import GuipSelect from "@/components/GuipSelect.vue";
// import PromptText from "@/components/PromptText.vue";
// import GuipSelect from "@/components/GuipSelect.vue";
import GuipInput from "@/components/GuipInput.vue";
import bindGoods from "@/components/bindGoods.vue";
import GuipDialog from "@/components/GuipDialog.vue";
@ -260,8 +339,8 @@ export default {
ValueAdded,
GuipDialog,
GuipInput,
GuipSelect,
PromptText,
// GuipSelect,
// PromptText,
GuipButton,
bindGoods,
},
@ -284,19 +363,39 @@ export default {
dialogDelBindConfim: false,
delRow: {},
dialogDelServiceConfim: false,
addNum: 0
addNum: 0,
rateNum:null,
calculation: {
profitRate: 0,
profitPerUnit: 0,
totalProfit: 0,
pricePerThousand: 0,
isValid: false
}
}
},
computed: {
...mapState(['pageTitle']) // VuexshowSidebar
...mapState(['pageTitle','secondMenu','currentMenuItem']), // VuexshowSidebar
// menuItem() {
// return this.$store.state.currentMenuItem;
// }
formatted() {
return this.formatProfitResult(this.calculation);
}
},
watch: {
'$store.state.currentMenuItem'(newVal) {
this.type = newVal.type
//
this.getServiceInfo()
this.getServiceAddInfo();
},
'$store.state.currentMenuItem': {
handler(newVal) {
this.menuItem = newVal;
console.log(this.menuItem,'this.menuItem===');
this.type = newVal.type
//
this.getServiceInfo()
this.getServiceAddInfo();
},
deep: true //
}
},
created() {
if (!this.$route.query.uid && !this.$route.query.prodid) {
@ -305,33 +404,51 @@ export default {
}
this.uid = this.$route.query.uid
this.prodid = this.$route.query.prodid
this.loadPddSDK()
},
mounted() {
store.commit('SET_PAGETITLE', '站点信息');
this.getAddServiceList();
if(this.currentMenuItem){
this.type = this.currentMenuItem.type
//
this.getServiceInfo()
this.getServiceAddInfo();
}
console.log(this.menuItem,'menuItem===',this.currentMenuItem);
// store.commit('SET_PAGETITLE', '');
// this.getAddServiceList();
},
methods: {
extractedNumber() {
const match = this.basePrice.match(/(\d+\.?\d*)/);
return match ? parseFloat(match[0]) : 0;
},
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(){
},
handleAlert() {
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.menuList = response.data
// store.commit('SET_SECOND_MENU', response.data);
// that.setMenuList()
// })
// }).catch(error => {
// console.error(error, 'error')
// })
// },
//
getServiceAddInfo() {
this.serviceAddInfo = {}
@ -355,6 +472,7 @@ export default {
text: that.serviceAddInfo.site_short_name,
link: that.serviceAddInfo.site_domain
});
this.priceBlur()
})
return true
}
@ -404,7 +522,8 @@ export default {
})
},
handleUnitName(){
this.serviceAddInfo.unit_name = this.serviceAddInfo.set_units[this.service_unit]
this.serviceAddInfo.unit_name = this.serviceAddInfo.set_units[this.service_unit];
console.log(this.serviceAddInfo.unit_name,'this.serviceAddInfo.unit_name====---999');
},
handleDelServiceClick() {
this.dialogDelServiceConfim = true
@ -428,7 +547,7 @@ export default {
})
return true;
}
that.$message.error(response.info);
that.$Message.error(response.info);
}).catch(error => {
console.error(error, 'error')
})
@ -438,6 +557,9 @@ export default {
this.serviceInfo.unit_num = ''
this.serviceInfo.base_unit_price = ''
this.serviceInfo.base_unit_num = ''
// !!
this.rateNum = ''
},
savePrice() {
const that = this
@ -617,10 +739,110 @@ export default {
console.error(error, 'error')
})
},
calculateProfitRate(price, num, baseCost = 2.4) {
//
if (!price || !num || price <= 0 || num <= 0) {
return {
profitRate: 0,
profitPerUnit: 0,
totalProfit: 0,
pricePerThousand: 0,
isValid: false
};
}
try {
// 1000
const pricePerThousand = (price / num) * 1000;
console.log(pricePerThousand,'pricePerThousand==');
//
const profitRate = ((pricePerThousand - baseCost) / baseCost) * 100;
console.log(profitRate,'profitRate==');
// 1000
const profitPerUnit = pricePerThousand - baseCost;
//
const totalProfit = (profitPerUnit / 1000) * num;
return {
profitRate: Number(profitRate.toFixed(2)), //
profitPerUnit: Number(profitPerUnit.toFixed(2)), // 1000
totalProfit: Number(totalProfit.toFixed(2)), //
pricePerThousand: Number(pricePerThousand.toFixed(2)), // 1000
isValid: true
};
} catch (error) {
console.error('计算利率时出错:', error);
return {
profitRate: 0,
profitPerUnit: 0,
totalProfit: 0,
pricePerThousand: 0,
isValid: false
};
}
}
}
}
</script>
<style lang="scss" scoped>
.service_info{
display: flex;
flex-direction: column;
gap: 24px;
}
.gap6{
gap: 6px;
}
.warn{
font-size: 12px;
font-weight: normal;
line-height: 17px;
letter-spacing: 0.03em;
color: #FF4D4F !important;
}
.service_info_wrap{
}
.common_scss{
width: 100%;
flex: 1;
color: #626573;
font-size: 12px;
letter-spacing: 0.08em;
background: #F2F7FF;
display: flex;
flex-direction: column;
padding: 14px 16px;
gap: 10px;
box-sizing: border-box;
b{
color: #23242B;
}
p{
color: #23242B;
text-align: left;
}
.blue{
color: #006AFF;
}
.green{
color: #00C261;
}
label{
white-space: nowrap;
}
}
.gap24{
gap: 24px;
width: 100%;
align-items: stretch;
}
.green_back{
background: #EFFFE0;
}
.serviceAdd-wrap{
height: 100%;
display: flex;

18
src/views/agent/siteServiceList.vue

@ -21,7 +21,7 @@
<!-- page content -->
<el-form>
<GuipTable :tableData="serviceList" ref="multipleTable" :loading="tableLoading"
@selection-change="handleSelectionChange" @select="handleSelect">
@selection-change="handleSelectionChange" @select="handleSelect" :row-class-name="setRowStyle">
<el-table-column type="selection" width="100">
<template slot="header">
<span class="selection-header-text">选择</span>
@ -211,7 +211,7 @@ export default {
delRows:[],
// url
serviceAddUrl: '/agent/siteServiceAdd',
serviceAddUrl: '/agent/siteAddChooseService',
// url
serviceEditUrl: '/agent/siteServiceEdit',
// url
@ -234,6 +234,15 @@ export default {
},
},
methods: {
setRowStyle({ row }) {
// specialBack
console.log(row);
// row
// if (row.price === '2.00') {
// return 'specialBack';
// }
return '';
},
jumpAdd(prodid){
this.$router.push(this.serviceAddUrl + '?uid=' + this.uid + '&prodid=' + prodid)
},
@ -515,6 +524,11 @@ export default {
}
</script>
<style lang="scss" scoped>
::v-deep .specialBack{
background-color: #FAFAFA !important;
color: #626573;
opacity: .6;
}
::v-deep .custom-popover {
position: fixed !important;
// max-height: 290px;

1
src/views/agent/supplyList.vue

@ -193,6 +193,7 @@ export default {
gap: 4px;
z-index: 0;
border-radius: 100px;
white-space: nowrap;
/* text/text_white_1 */
background: #FFFFFF;
box-sizing: border-box;

Loading…
Cancel
Save