rainbro 3 months ago
parent
commit
9441278e61
  1. 12187
      package-lock.json
  2. BIN
      src/assets/site/invalid.png
  3. BIN
      src/assets/site/show_and_hide.png
  4. 1
      src/assets/site/star-active-icon.svg
  5. 1
      src/assets/site/star-icon.svg
  6. 3
      src/components/SliderMenu.vue
  7. 48
      src/components/SliderScond.vue
  8. 18
      src/components/bindGoods.vue
  9. 15
      src/components/paymentMethod.vue
  10. 16
      src/components/site/addSiteStep/step2.vue
  11. 362
      src/components/site/addSiteStep/step3.vue
  12. 2
      src/components/site/serviceSetting/priceSet.vue
  13. 2
      src/router/index.js
  14. 4
      src/store/index.js
  15. 988
      src/views/agent/siteServiceAdd.vue
  16. 82
      src/views/agent/siteServiceList.vue

12187
package-lock.json

File diff suppressed because it is too large

BIN
src/assets/site/invalid.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
src/assets/site/show_and_hide.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

1
src/assets/site/star-active-icon.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.505903244018555" height="16.001562118530273" viewBox="0 0 16.505903244018555 16.001562118530273"><g transform="matrix(1,0,0,-1,0,32.00312423706055)"><path d="M9.15,31.440662118530273Q8.86875,31.971862118530275,8.24375,32.00316211853027Q7.65,31.971862118530275,7.3375,31.440662118530273L5.3375,27.315662118530273L0.8375,26.628162118530273Q0.24375,26.534362118530275,0.05625,25.97187211853027Q-0.13125,25.37812211853027,0.30625,24.94062211853027L3.55625,21.72187211853027L2.775,17.159372118530275Q2.7125,16.565625118530274,3.18125,16.190625118530274Q3.68125,15.846875118530274,4.24375,16.128125118530274L8.24375,18.253122118530275L12.275,16.128125118530274Q12.8062,15.846875118530274,13.3062,16.190625118530274Q13.8062,16.565625118530274,13.7125,17.159372118530275L12.9625,21.72187211853027L16.2125,24.94062211853027Q16.6187,25.37812211853027,16.4625,25.97187211853027Q16.2437,26.534362118530275,15.65,26.628162118530273L11.15,27.315662118530273L9.15,31.440662118530273Z" fill="#1677FF" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

1
src/assets/site/star-icon.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.505903244018555" height="16.001562118530273" viewBox="0 0 16.505903244018555 16.001562118530273"><g transform="matrix(1,0,0,-1,0,32.00312423706055)"><path d="M9.15,31.440662118530273Q8.86875,31.971862118530275,8.24375,32.00316211853027Q7.65,31.971862118530275,7.3375,31.440662118530273L5.3375,27.315662118530273L0.8375,26.628162118530273Q0.24375,26.534362118530275,0.05625,25.97187211853027Q-0.13125,25.37812211853027,0.30625,24.94062211853027L3.55625,21.72187211853027L2.775,17.159372118530275Q2.7125,16.565625118530274,3.18125,16.190625118530274Q3.68125,15.846875118530274,4.24375,16.128125118530274L8.24375,18.253122118530275L12.275,16.128125118530274Q12.8062,15.846875118530274,13.3062,16.190625118530274Q13.8062,16.565625118530274,13.7125,17.159372118530275L12.9625,21.72187211853027L16.2125,24.94062211853027Q16.6187,25.37812211853027,16.4625,25.97187211853027Q16.2437,26.534362118530275,15.65,26.628162118530273L11.15,27.315662118530273L9.15,31.440662118530273Z" fill="#9CA3AF" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

3
src/components/SliderMenu.vue

@ -282,4 +282,5 @@ export default {
// .el-menu--collapse .el-submenu.is-opened > .el-menu { // .el-menu--collapse .el-submenu.is-opened > .el-menu {
// opacity: 0; // opacity: 0;
// height: 0; // height: 0;
// }</style> // }
</style>

48
src/components/SliderScond.vue

@ -77,11 +77,23 @@ export default {
GuipToolTip GuipToolTip
}, },
watch: { watch: {
menuList(newVal) { menuList:{
let subtitle = this.renderKeyNew.subtitle; handler(newVal, oldVal) {
this.activeFloor = newVal[this.curIndex]?.list?.[0][subtitle]; // oldVal
this.componentsName = newVal[this.curIndex]?.list?.[0]?.componentsName || ''; if (!oldVal || oldVal.length === 0) {
store.commit('SET_CURRENTMENUITEM', newVal[this.curIndex]?.list?.[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() { mounted() {
@ -105,6 +117,32 @@ export default {
} }
}, },
methods: { methods: {
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 || '';
store.commit('SET_CURRENTMENUITEM', menuList[0].list[0]);
this.curIndex = 0;
}
},
handleChange(val) { handleChange(val) {
console.log("面板状态变化:", val); console.log("面板状态变化:", val);
}, },

18
src/components/bindGoods.vue

@ -1,13 +1,11 @@
<template> <template>
<GuipDialog :dialogVisible="dialogVisible" :showFooterButton="list.length>0" <GuipDialog :dialogVisible="showBind" :showFooterButton="list.length>0"
title="搜索商品" @confirm="handleConfirm" @cancel="handleCancel" @close="handleCancel"> title="搜索商品" @confirm="handleConfirm" @cancel="handleCancel" @close="handleCancel">
<div class="domain-wrap"> <div class="domain-wrap">
<el-form class="el-row demo-ruleForm" ref="formRef"> <el-form class="el-row demo-ruleForm" ref="formRef">
<div class="flex flex-between"> <div class="flex flex-between">
<GuipInput width="420px" v-model="keywords"> <GuipInput width="420px" v-model="keywords">
<GuipToolTip slot="suffix"> <img class="flex" slot="suffix" src="@/assets/site/input_search.svg"/>
<img src="@/assets/site/input_search.svg"/>
</GuipToolTip>
</GuipInput> </GuipInput>
<GuipButton type="primary" @click="handleSearch()">搜索</GuipButton> <GuipButton type="primary" @click="handleSearch()">搜索</GuipButton>
</div> </div>
@ -33,24 +31,21 @@
</template> </template>
<script> <script>
import GuipDialog from "@/components/GuipDialog.vue"; import GuipDialog from "@/components/GuipDialog.vue";
import GuipToolTip from "@/components/GuipToolTip.vue";
import GuipInput from "@/components/GuipInput.vue"; import GuipInput from "@/components/GuipInput.vue";
import GuipButton from "@/components/GuipButton.vue"; import GuipButton from "@/components/GuipButton.vue";
import GuipSelect from "@/components/GuipSelect.vue"; import GuipSelect from "@/components/GuipSelect.vue";
export default { export default {
name: '', name: '',
props:['uid','type','pdd_pati','pdd_pagecode'], props:['showBind','uid','type','pdd_pati','pdd_pagecode'],
components: { components: {
GuipSelect, GuipSelect,
GuipButton, GuipButton,
GuipInput, GuipInput,
GuipToolTip,
GuipDialog GuipDialog
}, },
data(){ data(){
return { return {
dialogVisible: true,
keywords: '', keywords: '',
loading: false, loading: false,
list: [], list: [],
@ -61,7 +56,6 @@ export default {
}, },
methods:{ methods:{
handleConfirm(){ handleConfirm(){
this.dialogVisible = false;
const that = this const that = this
this.$http('POST', '/agentnew/ajax_bind_service_goods', { this.$http('POST', '/agentnew/ajax_bind_service_goods', {
uid: that.uid, uid: that.uid,
@ -74,7 +68,7 @@ export default {
}).then(response => { }).then(response => {
if(response.status){ if(response.status){
that.$message.success('绑定成功'); that.$message.success('绑定成功');
this.$emit('handleBind', this.bindData) this.$emit('handleBind', true)
return true; return true;
} }
that.$message.error(response.info); that.$message.error(response.info);
@ -83,8 +77,7 @@ export default {
}) })
}, },
handleCancel(){ handleCancel(){
this.dialogVisible = false; this.$emit('handleBind', false)
this.$emit('handleBind', this.bindData)
}, },
handleSearch(){ handleSearch(){
const that = this const that = this
@ -158,7 +151,6 @@ export default {
.el-empty{ .el-empty{
padding: 20px 0; padding: 20px 0;
} }
.goods-list{ .goods-list{
max-height: 400px; max-height: 400px;
overflow-y: scroll; overflow-y: scroll;

15
src/components/paymentMethod.vue

@ -3,10 +3,11 @@
<draggable v-model="list" @start="drag=true" @end="onEnd" :move="checkMove" handle=".drag-handle" > <draggable v-model="list" @start="drag=true" @end="onEnd" :move="checkMove" handle=".drag-handle" >
<div class="payment-item" v-for="(item, index) in list" :key="item.name"> <div class="payment-item" v-for="(item, index) in list" :key="item.name">
<dl :class="index === list.length - 1 ? '' : 'drag-handle'"> <dl :class="index === list.length - 1 ? '' : 'drag-handle'">
<img v-if="item.pay_type == '1'" src="@/assets/register/card_pay.png" alt=""> <img v-if="item.pay_type === 0" src="@/assets/register/taobao.svg" alt="">
<img v-if="item.pay_type == '2'" src="@/assets/register/weixin_pay.png" alt=""> <img v-if="item.pay_type === 1" src="@/assets/register/card_pay.png" alt="">
<img v-if="item.pay_type == '3'" src="@/assets/register/zhifubao_pay.png" alt=""> <img v-if="item.pay_type === 2" src="@/assets/register/weixin.svg" alt="">
<img v-if="item.pay_type == '4'" src="@/assets/register/taobao_pay.png" alt=""> <img v-if="item.pay_type === 3" src="@/assets/register/zhifubao.svg" alt="">
<img v-if="item.pay_type === 11" src="@/assets/register/pinduoduo.svg" alt="">
<dd> <dd>
<p class="pay-name">{{ item.name }}</p> <p class="pay-name">{{ item.name }}</p>
<p v-if="item.account" class="pay-account">{{ item.account }}</p> <p v-if="item.account" class="pay-account">{{ item.account }}</p>
@ -32,12 +33,6 @@ export default {
}, },
data(){ data(){
return { return {
payImg:{
'1':'@/assets/register/weixin_pay.png',
'2':'@/assets/register/zhifubao_pay.png',
'3':'@/assets/register/taobao_pay.png',
'4':'@/assets/register/jingdong_pay.png',
},
list:[], list:[],
drag: false, drag: false,
} }

16
src/components/site/addSiteStep/step2.vue

@ -11,7 +11,7 @@
<div class="flex-left"> <div class="flex-left">
<div class="shopadd-wrap" v-if="!taobaoList.length"> <div class="shopadd-wrap" v-if="!taobaoList.length">
<p class="shopadd-title">店铺授权</p> <p class="shopadd-title">店铺授权</p>
<div class="flex flex-between shopadd-area"> <div class="flex-between shopadd-area">
<div> <div>
<p>请确保使用要添加的淘宝主账号登录并授权</p> <p>请确保使用要添加的淘宝主账号登录并授权</p>
<p>如未购买快乐帮手服务或已过期会跳转到购买服务页面</p> <p>如未购买快乐帮手服务或已过期会跳转到购买服务页面</p>
@ -34,7 +34,7 @@
</template> </template>
<template #normal> <template #normal>
<div class="flex flex-between noraml-jump"> <div class="flex-between noraml-jump">
<div class="left"> <div class="left">
<b>添加新店铺</b> <b>添加新店铺</b>
<p class="one">请确保使用要添加的淘宝主账号登录并授权</p> <p class="one">请确保使用要添加的淘宝主账号登录并授权</p>
@ -81,7 +81,7 @@
<!-- 自定义下拉选项 --> <!-- 自定义下拉选项 -->
<template #normal> <template #normal>
<div class="flex flex-between noraml-jump"> <div class="flex-between noraml-jump">
<div class="left"> <div class="left">
<b>绑定新微信收款</b> <b>绑定新微信收款</b>
<p class="one">需要使用您公司的微信支付</p> <p class="one">需要使用您公司的微信支付</p>
@ -125,7 +125,7 @@
</template> </template>
<template #normal> <template #normal>
<div class="flex flex-between noraml-jump"> <div class="flex-between noraml-jump">
<div class="left"> <div class="left">
<b>绑定新支付宝收款</b> <b>绑定新支付宝收款</b>
<p class="one">需要使用您公司的支付宝支付</p> <p class="one">需要使用您公司的支付宝支付</p>
@ -159,7 +159,7 @@
<div class="flex-left"> <div class="flex-left">
<div class="shopadd-wrap" v-if="pddList.length"> <div class="shopadd-wrap" v-if="pddList.length">
<p class="shopadd-title">店铺授权</p> <p class="shopadd-title">店铺授权</p>
<div class="flex flex-between shopadd-area"> <div class="flex-between shopadd-area">
<div> <div>
<p>请确保使用要添加的拼多多主账号登录并授权</p> <p>请确保使用要添加的拼多多主账号登录并授权</p>
<p>如未购买快乐帮手服务或已过期会跳转到购买服务页面</p> <p>如未购买快乐帮手服务或已过期会跳转到购买服务页面</p>
@ -182,7 +182,7 @@
</template> </template>
<template #normal> <template #normal>
<div class="flex flex-between noraml-jump"> <div class="flex-between noraml-jump">
<div class="left"> <div class="left">
<b>绑定新拼多多店铺</b> <b>绑定新拼多多店铺</b>
<p class="one">如未购买快乐帮手服务或已过期会跳转到购买服务页面</p> <p class="one">如未购买快乐帮手服务或已过期会跳转到购买服务页面</p>
@ -218,7 +218,7 @@
<div class="flex-left"> <div class="flex-left">
<div class="shopadd-wrap" v-if="!jdList.length"> <div class="shopadd-wrap" v-if="!jdList.length">
<p class="shopadd-title">店铺授权</p> <p class="shopadd-title">店铺授权</p>
<div class="flex flex-between shopadd-area"> <div class="flex-between shopadd-area">
<div> <div>
<p>请确保使用要添加的京东主账号登录并授权</p> <p>请确保使用要添加的京东主账号登录并授权</p>
<p>如未购买快乐论文检测服务服务或已过期会跳转到购买服务页面</p> <p>如未购买快乐论文检测服务服务或已过期会跳转到购买服务页面</p>
@ -241,7 +241,7 @@
</template> </template>
<template #normal> <template #normal>
<div class="flex flex-between noraml-jump"> <div class="flex-between noraml-jump">
<div class="left"> <div class="left">
<b>绑定新京东店铺</b> <b>绑定新京东店铺</b>
<p class="one">如未购买快乐论文检测服务服务或已过期会跳转到购买服务页面</p> <p class="one">如未购买快乐论文检测服务服务或已过期会跳转到购买服务页面</p>

362
src/components/site/addSiteStep/step3.vue

@ -12,7 +12,7 @@
<div> <div>
<div class="flex-common table-wrap"> <div class="flex-common table-wrap">
<el-form> <el-form>
<GuipTable :border="true" :tableData="tableData" :loading="tableLoading"> <GuipTable :border="true" :tableData="serviceList" :loading="tableLoading">
<el-table-column prop="name" fixed="left" label="检测服务" width="200"> <el-table-column prop="name" fixed="left" label="检测服务" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex nowrap "> <div class="flex nowrap ">
@ -22,42 +22,32 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="stock" label="今日供货价" min-width="138">
<template slot-scope="scope"> <el-table-column prop="supply_price_desc" label="今日供货价"></el-table-column>
<div class="flex cell_render">
<span>¥{{ scope.row.stock }}/</span> <el-table-column prop="price_desc" label="售价">
</div>
</template>
</el-table-column>
<el-table-column prop="price" label="售价" width="300">
<template #default="{ row,$index }"> <template #default="{ row,$index }">
<el-popover v-model="row.pricePopoverVisible" :ref="`pricePopover-${row.id}`" <el-popover v-model="row.pricePopoverVisible" :ref="`pricePopover-${row.type}`"
placement="bottom" trigger="manual" :append-to-body="false" :visible-arrow="true" placement="bottom" trigger="manual" :append-to-body="false" :visible-arrow="true"
popper-class="custom-popover" @show="popshow" > popper-class="custom-popover" @show="popshow" >
<div style="text-align: center"> <div style="text-align: center">
<GuipInput ref="GuipInput" v-if="!row.word" width="252px" v-model="row.edit_price" label="售价" <div class="flex">
placeholder="请输入售价" unit="元"> <GuipInput ref="GuipInput" width="133px" v-model="row.price" label="售价" placeholder="请输入售价" :unit="row.price_unit"></GuipInput>
</GuipInput> <template v-if="row.price_unit_num>1">
<div v-else class="flex"> <span class="shortspan">/</span>
<GuipInput ref="GuipInput" width="133px" v-model="row.edit_price" label="售价" placeholder="请输入售价" <GuipInput ref="GuipInput" width="133px" v-model="row.price_unit_num" unit="字符">
unit="元"> </GuipInput>
</GuipInput> </template>
<span class="shortspan">/</span>
<GuipInput ref="GuipInput" width="133px" v-model="row.edit_word" placeholder="请输入字符" unit="字符">
</GuipInput>
</div> </div>
<div class="flex" style="text-align: right; margin-top: 32px;justify-content: flex-end;"> <div class="flex" style="text-align: right; margin-top: 32px;justify-content: flex-end;">
<GuipButton size="medium" @click="cancelEdit(row, 'price')">取消</GuipButton> <GuipButton size="medium" @click="cancelEdit(row, 'price')">取消</GuipButton>
<GuipButton type="primary" @click="savePrice(row, 'price')" size="medium">确定</GuipButton> <GuipButton type="primary" @click="saveEdit(row, 'price')" size="medium">确定</GuipButton>
</div> </div>
</div> </div>
<template #reference> <template #reference>
<div class="flex cell_render" @click="handlePriceClick(row,$index,'price')"> <div class="flex cell_render" @click="handleEditClick(row,$index,'price')">
<span v-if="row.word" :key="random()">¥{{ row.price }}/{{ row.word }}</span> <span :key="random()">{{ row.price_desc }}</span>
<span v-else :key="random()">¥{{ row.price }}/</span> <svg-icon :size="16" :path="require('@/assets/site/tableEdit.svg')" :color="'#8A9099'"
<span>测试用一下</span>
<span>随便写的</span>
<svg-icon :size="16" :path="require('@/assets/register/tableEdit.svg')" :color="'#8A9099'"
:hoverColor="'#006AFF'" /> :hoverColor="'#006AFF'" />
</div> </div>
</template> </template>
@ -65,71 +55,58 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="num" label="排序" min-width="95">
<el-table-column prop="sort_id" label="排序">
<template #default="{ row,$index }"> <template #default="{ row,$index }">
<!-- <el-tooltip :manual="true" v-model="row.numPopoverVisible" placement="top" effect="light"> <el-popover v-model="row.sortPopoverVisible" :ref="`popover-${row.type}`"
<template #content>
<div style="text-align: center">
<GuipInput ref="GuipInput" width="252px" v-model="row.edit_num" label="排序" placeholder="请输入数字">
</GuipInput>
<p
style="width: 252px;margin-left: 40px;text-align: right;color: #8A9099;letter-spacing: 0.08em;">
输入0的数越小排序越前重复则新者优先0则默认排序</p>
<div class="flex" style="text-align: right; margin-top: 32px;justify-content: flex-end;">
<GuipButton size="medium" @click="cancelEdit(row, 'num')">取消</GuipButton>
<GuipButton type="primary" @click="savePrice(row, 'num')" size="medium">确定</GuipButton>
</div>
</div>
</template>
<div class="flex cell_render" @click="row.numPopoverVisible = true">
<span>{{ row.num }}</span>
<svg-icon :size="16" :path="require('@/assets/register/tableEdit.svg')" :color="'#8A9099'"
:hoverColor="'#006AFF'" />
</div>
</el-tooltip> -->
<el-popover v-model="row.numPopoverVisible" :ref="`popover-${row.id}`"
placement="bottom" trigger="manual" :append-to-body="false" :visible-arrow="true" placement="bottom" trigger="manual" :append-to-body="false" :visible-arrow="true"
popper-class="custom-popover" @show="popshow" > popper-class="custom-popover" @show="popshow" >
<!-- <el-popover v-model="row.numPopoverVisible" placement="top" class="single-popover" trigger="manual" :append-to-body="false" :ref="`popover-${row.id}`"> --> <div style="text-align: center">
<div style="text-align: center" :visible-arrow="true"> <GuipInput ref="GuipInput" width="252px" v-model="row.edit_sort_id" label="排序" placeholder="请输入数字"></GuipInput>
<GuipInput ref="GuipInput" width="252px" v-model="row.edit_num" label="排序" placeholder="请输入数字"> <p style="width: 252px;margin-left: 40px;text-align: right;color: #8A9099;letter-spacing: 0.08em;">输入0的数越小排序越前重复则新者优先0则默认排序</p>
</GuipInput>
<p
style="width: 252px;margin-left: 40px;text-align: right;color: #8A9099;letter-spacing: 0.08em;">
输入0的数越小排序越前重复则新者优先0则默认排序</p>
<div class="flex" style="text-align: right; margin-top: 32px;justify-content: flex-end;"> <div class="flex" style="text-align: right; margin-top: 32px;justify-content: flex-end;">
<GuipButton size="medium" @click="cancelEdit(row, 'num')">取消</GuipButton> <GuipButton size="medium" @click="cancelEdit(row, 'sort')">取消</GuipButton>
<GuipButton type="primary" @click="savePrice(row, 'num')" size="medium">确定</GuipButton> <GuipButton type="primary" @click="saveEdit(row, 'sort')" size="medium">确定</GuipButton>
</div> </div>
</div> </div>
<span slot="reference" @click="handlePriceClick(row,$index,'num')"> <template #reference>
<div class="flex cell_render"> <div class="flex cell_render" @click="handleEditClick(row,$index,'sort')">
<GuipToolTip :content="row.num"> <span :key="random()">{{ row.sort_id }}</span>
<span class="nowrap">{{ row.num }}</span> <svg-icon :size="16" :path="require('@/assets/site/tableEdit.svg')" :color="'#8A9099'"
</GuipToolTip> :hoverColor="'#006AFF'" />
<svg-icon :size="16" :path="require('@/assets/register/tableEdit.svg')" :color="'#8A9099'" </div>
:hoverColor="'#006AFF'" /> </template>
</div>
</span>
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="stock" label="收款方式" min-width="258">
<el-table-column prop="payment_method_desc" label="收款方式">
<template slot-scope="scope">
<div class="flex cell_render">
<span class="default-pay-method">{{scope.row.payment_method_desc}}</span>
<svg-icon :size="16" :path="require('@/assets/site/tableEdit.svg')" :color="'#8A9099'" :hoverColor="'#006AFF'" />
</div>
</template>
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex cell_render"> <div class="flex cell_render">
<span :class="(scope.row.payment == '0' ? 'normal_payment' : 'self_payment')"> <span :class="(scope.row.payment_method_desc == '默认站点支付' ? 'normal_payment' : 'self_payment')">
{{ scope.row.payment == '0' ? '默认站点支付' : '自定义支付' }}</span> {{ scope.row.payment_method_desc == '默认站点支付' ? '默认站点支付' : '自定义支付' }}
</span>
<svg-icon :size="16" :path="require('@/assets/register/tableEdit.svg')" <svg-icon :size="16" :path="require('@/assets/register/tableEdit.svg')"
:color="'#8A9099'" :hoverColor="'#006AFF'" /> @click="popPayMentModal(scope.row)" :color="'#8A9099'" :hoverColor="'#006AFF'" />
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="stock" fixed="right" label="上首页" min-width="160">
<el-table-column prop="sort_id" label="上首页">
<template slot-scope="scope"> <template slot-scope="scope">
<GuipSwitch :modelValue="scope.row.homeFlag"> <div class="flex cell_render">
</GuipSwitch> <GuipSwitch :modelValue="scope.row.is_index_display" active-value="1" inactive-value="0" @change="onSwitchChange(scope.row)"></GuipSwitch>
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" min-width="150px"> <el-table-column label="操作" fixed="right" min-width="150px">
<div class="flex"> <div class="flex">
<el-button type="text">编辑</el-button> <el-button type="text">编辑</el-button>
@ -140,8 +117,14 @@
<el-pagination background @size-change='handleSizeChange' @current-change='handleCurrentChange' <el-pagination background @size-change='handleSizeChange' @current-change='handleCurrentChange'
:current-page="currentPage" :page-size=pageSize layout="prev, pager, next,jumper" :current-page="currentPage" :page-size=pageSize layout="prev, pager, next,jumper"
:total="tableData.length"> :total="serviceList.length">
</el-pagination> </el-pagination>
<GuipDialog :dialogVisible="dialogVisible" :title="dialogTitle" :show-close-button="false" @confirm="handleConfirm"
@cancel="handleCancel" type="center" >
<PromptText text='按住左侧图标,上下拖动可进行排序,平台卡券只能放到最后。' :type="1" class="mb24 mt12"/>
<PaymentMethod :paymentList="payList" @confirm="confirmPayment"/>
</GuipDialog>
</el-form> </el-form>
</div> </div>
@ -156,13 +139,15 @@
</template> </template>
<script> <script>
import GuipButton from "@/components/GuipButton.vue"; import GuipButton from "@/components/GuipButton.vue";
import GuipInput from "@/components/GuipInput.vue"; import GuipInput from "@/components/GuipInput.vue";
import GuipToolTip from "@/components/GuipToolTip.vue";
import SvgIcon from "@/components/SvgIcon.vue"; import SvgIcon from "@/components/SvgIcon.vue";
import GuipSwitch from "@/components/GuipSwitch.vue"; import GuipSwitch from "@/components/GuipSwitch.vue";
import GuipTable from "@/components/GuipTable.vue"; import GuipTable from "@/components/GuipTable.vue";
import {getServicePriceDesc} from "@/utils/common";
import PaymentMethod from "@/components/paymentMethod.vue";
import GuipDialog from "@/components/GuipDialog.vue";
import PromptText from "@/components/PromptText.vue";
export default { export default {
name: 'domainSet', name: 'domainSet',
@ -173,20 +158,30 @@ export default {
} }
}, },
components: { components: {
GuipTable, GuipSwitch, SvgIcon, GuipToolTip, GuipInput, PromptText, GuipDialog, PaymentMethod,
GuipTable, GuipSwitch, SvgIcon, GuipInput,
GuipButton GuipButton
}, },
data(){ data(){
return { return {
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTI2NDY1NDUsIm5iZiI6MTc1MjY0NjU0NSwiZXhwIjoxNzU1MjM4NTQ1LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.G-Is-x9qPMiV_urOlDPQVRjfAIozySxL5EK2k82d46k', token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTI2NDY1NDUsIm5iZiI6MTc1MjY0NjU0NSwiZXhwIjoxNzU1MjM4NTQ1LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.G-Is-x9qPMiV_urOlDPQVRjfAIozySxL5EK2k82d46k',
tableData:[], serviceList:[],
tableLoading:false, tableLoading:false,
currentPage: 1, // currentPage: 1, //
pageSize: 2, // pageSize: 2, //
total: 0, // total: 0, //
//
payList: [],
//
popoverFlag:false,
//
dialogVisible: false, //
dialogTitle: "", //
editRow:{},
// url // url
serviceAddUrl: '/agent/siteAddService', serviceAddUrl: '/agent/siteAddFinally',
} }
}, },
mounted() { mounted() {
@ -195,8 +190,13 @@ export default {
this.$emit('handelStep', 1) this.$emit('handelStep', 1)
return false; return false;
} }
this.getSiteServiceList()
}, },
methods:{ methods:{
random() {
return Math.random();
},
jumpStep(){ jumpStep(){
this.$emit('handelStep', 4) this.$emit('handelStep', 4)
}, },
@ -205,7 +205,26 @@ export default {
this.$emit('handelStep', 4) this.$emit('handelStep', 4)
}, },
//
getSiteServiceList() {
this.tableLoading = true
const that = this
that.serviceList = []
that.$http('POST', '/agentnew/ajax_get_service_list', {
uid: that.siteInfo.uid,
},{
headers:{
'Auth': that.token
}
}).then(response => {
that.tableLoading = false
that.$nextTick(() => {
that.serviceList = response.data.service_list
})
}).catch(error => {
console.error(error, 'error')
})
},
handleSizeChange(val) { handleSizeChange(val) {
this.pageSize = val this.pageSize = val
@ -217,54 +236,173 @@ export default {
this.$router.push(this.serviceAddUrl + '?uid=' + this.siteInfo.uid + '&prodid=' + prodid) this.$router.push(this.serviceAddUrl + '?uid=' + this.siteInfo.uid + '&prodid=' + prodid)
}, },
//
handleEditClick(row, index, type) {
//
this.popoverFlag = true;
this.serviceList.forEach((item, i) => {
if (i !== index) {
item[type + 'PopoverVisible'] = false;
}
});
//
row[type + 'PopoverVisible'] = true;
},
popshow() {
var ariaEls = document.querySelectorAll('.el-popover')
ariaEls.forEach((item) => {
item.removeAttribute('aria-hidden')
})
ariaEls = document.querySelectorAll('.el-radio__original')
ariaEls.forEach((item) => {
item.removeAttribute('aria-hidden')
})
},
//
saveEdit(row, type) {
row[type + 'PopoverVisible'] = false; //
if(type == 'price') this.savePrice(row)
if(type == 'sort') this.saveSort(row)
},
//
cancelEdit(row, type) {
row[type + 'PopoverVisible'] = false;
this.popoverFlag = false
// row[type + '_popover'] = false; //
// this.$Message.info('');
},
async savePrice(row){
if (row.price === '') {
this.$message.warning('价格不能为空');
return;
}
let obj = {}
obj.uid = this.siteInfo.uid
obj.type = row.type
obj.unit_num = row.price_unit_num
if(row.price_unit == '元'){
obj.unit_price = row.price
}else{
obj.unit_piece = row.price
}
const res = await this.saveRequest('/agentnew/ajax_set_service_price', obj)
if(res) row.price_desc = getServicePriceDesc(row.price, row.price_unit, row.price_unit_num);
handleEvent(data){
this.newDomain = data
}, },
saveConfirm() { async onSwitchChange(row){
console.log(row)
let obj = {} let obj = {}
obj.uid = this.info.uid obj.uid = this.siteInfo.uid
obj.type = this.info.type obj.type = row.type
if(this.domainFrom === '1'){ obj.is_index_display = row.is_index_display
if(!this.newDomain.prefix || !this.newDomain.domain) return false const res = await this.saveRequest('/agentnew/ajax_update_service_show', obj)
obj.domain = this.newDomain.prefix + this.newDomain.domain console.log(res)
}else{ if(!res) row.is_index_display = row.is_index_display === "1" ? "0" : "1"
obj.domain = '' },
async saveSort(row){
let obj = {}
obj.uid = this.siteInfo.uid
obj.type = row.type
obj.sort_id = row.sort_id
const res = await this.saveRequest('/agentnew/ajax_update_service_show', obj)
if(res) {
row.sort_id = row.edit_sort_id;
this.sortServiceList()
} }
},
sortServiceList() {
const sortable = this.serviceList
.map((row, i) => ({ row, i }))
.filter(item => item.row.sort_id > 0)
.sort((a, b) => a.row.sort_id - b.row.sort_id);
let i = 0;
this.serviceList = this.serviceList.map(row => {
if (row.sort_id > 0) {
return sortable[i++].row;
}
return row;
});
},
async saveRequest(url, obj){
const that = this const that = this
this.$http('POST', '/agentnew/ajax_update_service_domain', obj,{ return await this.$http('POST', url, obj,{
headers:{ headers:{
'Auth': this.token 'Auth': this.token
} }
}).then(response => { }).then(response => {
if(response.status){ if(response.status){
that.$message.success('保存成功'); that.$message.success('保存成功');
//
const protocol = new URL(that.info.domain).protocol;
if(this.domainFrom === '1'){
that.info.domain = protocol + "//" +obj.domain;
that.info.ser_domain = protocol + "//" +obj.domain;
}else{
that.info.domain = that.info.site_domain;
that.info.ser_domain = '';
}
that.$emit('saveEvent', that.info)
return true; return true;
} }
that.$message.error(response.info); that.$message.error(response.info);
return false;
}).catch(error => { }).catch(error => {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
popPayMentModal(row){
this.dialogVisible = true;
this.dialogTitle = row.type_desc + '-收款方式'
this.editRow = row
this.getPayList(row.type)
},
//
getPayList(type) {
const that = this
that.payList = []
this.$http('POST', '/agentnew/ajax_get_service_pay_list', {
uid: that.siteInfo.uid,
type: type,
},{
headers:{
'Auth': this.token
}
}).then(response => {
this.$nextTick(() => {
that.payList = response.data.paylist
})
}).catch(error => {
console.error(error, 'error')
})
},
confirmPayment(payList){
this.payList = payList
},
//
async handleConfirm() {
this.dialogVisible = false;
let obj = {}
obj.uid = this.siteInfo.uid
obj.type = this.editRow.type
obj.info = ""
let hasClose = false
this.payList.forEach((row) => {
if(row.status == 1) {
let value = row.pay_type
if(row.id) value += ',' + row.id
obj.info = obj.info + ';' + value;
}else{
hasClose = true
}
});
obj.info = obj.info.substr(1, obj.info.length-1);
await this.saveRequest('/agentnew/ajax_payment_switch', obj, this.editRow)
const res = await this.saveRequest('/agentnew/ajax_payment_switch', obj, this.editRow)
if(res && hasClose) {
this.editRow.payment_method_desc = '自定义支付';
}
},
//
handleCancel() {
this.dialogVisible = false;
},
} }
} }
</script> </script>
@ -292,4 +430,12 @@ export default {
} }
} }
} }
.custom-popover {
position: fixed !important;
// max-height: 290px;
// overflow-y: auto;
margin-top: 0 !important;
margin-left: 0 !important;
transform: none !important;
}
</style> </style>

2
src/components/site/serviceSetting/priceSet.vue

@ -10,7 +10,7 @@
<div class="flex-wrap"> <div class="flex-wrap">
<div class="flex-left"> <div class="flex-left">
<div class="set-item"> <div class="set-item">
<div class="set-title flex flex-between"> <div class="set-title flex-between">
<p>售价管理</p> <p>售价管理</p>
<p>供货价格3.5/</p> <p>供货价格3.5/</p>
</div> </div>

2
src/router/index.js

@ -132,7 +132,7 @@ const routes = [{
path: '/agent/siteAddFinally', path: '/agent/siteAddFinally',
name: '添加站点-添加服务', name: '添加站点-添加服务',
isFirst: true, isFirst: true,
component: () => import( /* webpackChunkName: "siteList" */ '../views/agent/siteAddFinally.vue'), component: () => import( /* webpackChunkName: "siteList" */ '../views/agent/siteServiceAdd.vue'),
meta: { meta: {
title: '添加服务', title: '添加服务',
breadcrumbParent: '添加站点', breadcrumbParent: '添加站点',

4
src/store/index.js

@ -567,7 +567,7 @@ export default new Vuex.Store({
}, },
mutations: { mutations: {
SET_CURRENTMENUITEM(state,data){ SET_CURRENTMENUITEM(state,data){
state.currentMenuItem = JSON.parse(JSON.stringify(data)); state.currentMenuItem = data && JSON.parse(JSON.stringify(data));
}, },
SET_COMPONENTS_NAME(state,name){ SET_COMPONENTS_NAME(state,name){
state.componentsName = name; state.componentsName = name;
@ -576,7 +576,7 @@ export default new Vuex.Store({
state.slidermenu = state[type] state.slidermenu = state[type]
}, },
SET_SECOND_MENU(state,data){ SET_SECOND_MENU(state,data){
state.secondMenu = JSON.parse(JSON.stringify(data)) state.secondMenu = data && JSON.parse(JSON.stringify(data))
}, },
SET_CUSTOMIZE(state,show) { SET_CUSTOMIZE(state,show) {
state.customize = show state.customize = show

988
src/views/agent/siteServiceAdd.vue

File diff suppressed because it is too large

82
src/views/agent/siteServiceList.vue

@ -89,7 +89,7 @@
placement="bottom" trigger="manual" :append-to-body="false" :visible-arrow="true" placement="bottom" trigger="manual" :append-to-body="false" :visible-arrow="true"
popper-class="custom-popover" @show="popshow" > popper-class="custom-popover" @show="popshow" >
<div style="text-align: center"> <div style="text-align: center">
<GuipInput ref="GuipInput" width="252px" v-model="row.sort_id" label="排序" placeholder="请输入数字"></GuipInput> <GuipInput ref="GuipInput" width="252px" v-model="row.edit_sort_id" label="排序" placeholder="请输入数字"></GuipInput>
<p style="width: 252px;margin-left: 40px;text-align: right;color: #8A9099;letter-spacing: 0.08em;">输入0的数越小排序越前重复则新者优先0则默认排序</p> <p style="width: 252px;margin-left: 40px;text-align: right;color: #8A9099;letter-spacing: 0.08em;">输入0的数越小排序越前重复则新者优先0则默认排序</p>
<div class="flex" style="text-align: right; margin-top: 32px;justify-content: flex-end;"> <div class="flex" style="text-align: right; margin-top: 32px;justify-content: flex-end;">
<GuipButton size="medium" @click="cancelEdit(row, 'sort')">取消</GuipButton> <GuipButton size="medium" @click="cancelEdit(row, 'sort')">取消</GuipButton>
@ -372,25 +372,24 @@ export default {
saveEdit(row, type) { saveEdit(row, type) {
row[type + 'PopoverVisible'] = false; // row[type + 'PopoverVisible'] = false; //
if(type == 'price') this.savePrice(row) if(type == 'price') this.savePrice(row)
if(type == 'sort') this.saveUpdateInfo(row, true) if(type == 'sort') this.saveSort(row)
}, },
// //
cancelEdit(row, type) { cancelEdit(row, type) {
row[type + 'PopoverVisible'] = false; row[type + 'PopoverVisible'] = false;
this.popoverFlag = false this.popoverFlag = false
// row[type + '_popover'] = false; // // row[type + '_popover'] = false; //
this.$Message.info('已取消编辑'); // this.$Message.info('');
}, },
random() { random() {
var randomNumber = Math.random(); var randomNumber = Math.random();
return randomNumber return randomNumber
}, },
savePrice(row){ async savePrice(row){
if (row.price === '') { if (row.price === '') {
this.$message.warning('价格不能为空'); this.$message.warning('价格不能为空');
return; return;
} }
row.price_desc = getServicePriceDesc(row.price, row.price_unit, row.price_unit_num);
let obj = {} let obj = {}
obj.uid = this.uid obj.uid = this.uid
@ -402,43 +401,28 @@ export default {
obj.unit_piece = row.price obj.unit_piece = row.price
} }
this.saveRequest('/agentnew/ajax_set_service_price', obj, row) const res = await this.saveRequest('/agentnew/ajax_set_service_price', obj)
if(res) row.price_desc = getServicePriceDesc(row.price, row.price_unit, row.price_unit_num);
}, },
onSwitchChange(row){ async onSwitchChange(row){
row.is_index_display = row.is_index_display == "1" ? "0" : "1" console.log(row)
this.saveUpdateInfo(row)
},
saveUpdateInfo(row, resort = false){
let obj = {} let obj = {}
obj.uid = this.uid obj.uid = this.uid
obj.type = row.type obj.type = row.type
obj.sort_id = row.sort_id
obj.is_index_display = row.is_index_display obj.is_index_display = row.is_index_display
obj.is_display_price = row.is_display_price const res = await this.saveRequest('/agentnew/ajax_update_service_show', obj)
obj.is_recommend = row.is_recommend if(!res) row.is_index_display = row.is_index_display === "1" ? "0" : "1"
this.saveRequest('/agentnew/ajax_update_service_show', obj, row, resort)
}, },
saveRequest(url, obj, row, resort = false){ async saveSort(row){
const that = this let obj = {}
this.$http('POST', url, obj,{ obj.uid = this.uid
headers:{ obj.type = row.type
'Auth': this.token obj.sort_id = row.sort_id
} const res = await this.saveRequest('/agentnew/ajax_update_service_show', obj)
}).then(response => { if(res) {
if(response.status){ row.sort_id = row.edit_sort_id;
that.$message.success('保存成功'); this.sortServiceList()
this.$nextTick(() => { }
that.$set(that.serviceList, row)
if(resort){
this.sortServiceList()
}
})
return true;
}
that.$message.error(response.info);
}).catch(error => {
console.error(error, 'error')
})
}, },
sortServiceList() { sortServiceList() {
const sortable = this.serviceList const sortable = this.serviceList
@ -454,6 +438,23 @@ export default {
return row; return row;
}); });
}, },
async saveRequest(url, obj){
const that = this
return await this.$http('POST', url, obj,{
headers:{
'Auth': this.token
}
}).then(response => {
if(response.status){
that.$message.success('保存成功');
return true;
}
that.$message.error(response.info);
return false;
}).catch(error => {
console.error(error, 'error')
})
},
popPayMentModal(row){ popPayMentModal(row){
this.dialogVisible = true; this.dialogVisible = true;
this.dialogTitle = row.type_desc + '-收款方式' this.dialogTitle = row.type_desc + '-收款方式'
@ -483,7 +484,7 @@ export default {
this.payList = payList this.payList = payList
}, },
// //
handleConfirm() { async handleConfirm() {
this.dialogVisible = false; this.dialogVisible = false;
let obj = {} let obj = {}
@ -504,9 +505,10 @@ export default {
}); });
obj.info = obj.info.substr(1, obj.info.length-1); obj.info = obj.info.substr(1, obj.info.length-1);
if(hasClose) this.editRow.payment_method_desc = '自定义支付'; const res = await this.saveRequest('/agentnew/ajax_payment_switch', obj, this.editRow)
if(res && hasClose) {
this.saveRequest('/agentnew/ajax_payment_switch', obj, this.editRow) this.editRow.payment_method_desc = '自定义支付';
}
}, },
// //
handleCancel() { handleCancel() {

Loading…
Cancel
Save