Commit bc1dd45c by 王志慧 Committed by chenwq

commit

1 parent 69a61b66
...@@ -26,7 +26,7 @@ html { ...@@ -26,7 +26,7 @@ html {
.live-room .container { .live-room .container {
background: #ffffff; background: #ffffff;
margin: 20px 0px; margin: 20px 0;
padding: 15px 20px; padding: 15px 20px;
box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.1); box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.1);
} }
...@@ -130,7 +130,7 @@ html { ...@@ -130,7 +130,7 @@ html {
} }
.marketing .f-right { .marketing .f-right {
float: right; float: right;
} }
.marketing .footer-btns { .marketing .footer-btns {
...@@ -204,33 +204,33 @@ html { ...@@ -204,33 +204,33 @@ html {
} }
.table-popover-block { .table-popover-block {
position: relative; position: relative;
height: 160px !important; height: 160px !important;
overflow: hidden; overflow: hidden;
border-width: 0 !important; border-width: 0 !important;
padding: 0 !important; padding: 0 !important;
margin-bottom: 10px !important; margin-bottom: 10px !important;
} }
.table-popover-block.el-popper .popper__arrow { .table-popover-block.el-popper .popper__arrow {
display: none !important; display: none !important;
} }
.table-popover-img { .table-popover-img {
width: 100%; width: 100%;
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
.marketing .pointer { .marketing .pointer {
cursor: pointer; cursor: pointer;
} }
.marketing .w-100-percent, .marketing .w-100-percent,
.marketing .img-w-100 { .marketing .img-w-100 {
width: 100%; width: 100%;
} }
.marketing .img-60 { .marketing .img-60 {
...@@ -263,7 +263,9 @@ html { ...@@ -263,7 +263,9 @@ html {
.marketing .m-t-10 { .marketing .m-t-10 {
margin-top: 10px; margin-top: 10px;
} }
.marketing .m-b-8 {
margin-bottom: 8px;
}
.marketing .m-b-10 { .marketing .m-b-10 {
margin-bottom: 10px; margin-bottom: 10px;
} }
...@@ -375,13 +377,24 @@ html { ...@@ -375,13 +377,24 @@ html {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.marketing .flex-align {
display: flex;
align-items: center;
}
.marketing .flex-top {
display: flex;
align-items: flex-start;
}
.marketing .flex-center { .marketing .flex-center {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.marketing .flex-between {
display: flex;
justify-content:space-between;
align-items: center;
}
.marketing .flex-grow { .marketing .flex-grow {
flex: 1; flex: 1;
} }
...@@ -526,5 +539,19 @@ html { ...@@ -526,5 +539,19 @@ html {
color: #5850ff; color: #5850ff;
font-size: 16px; font-size: 16px;
} }
.marketing .text-14 {
font-size: 14px;
}
.marketing .color-3 {
color: #333333;
}
.marketing .line-20 {
line-height: 20px;
}
.marketin .weight-5 {
font-weight: 500;
}
.marketin .weight-4 {
font-weight: 400;
}
/* tab */ /* tab */
...@@ -19,8 +19,8 @@ export const fetchConfig = function (isEnv = true) { ...@@ -19,8 +19,8 @@ export const fetchConfig = function (isEnv = true) {
// } // }
//return window.fetch('https://', {}).then(res => res.json()) //return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' }) // request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
return new Http().get('https://oss-config.test.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config') // return new Http().get('https://oss-config.test.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config')
// return new Http().get('https://oss-config.dev.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config') return new Http().get('https://oss-config.dev.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config')
} }
export const config = { export const config = {
install(vue, cfg) { install(vue, cfg) {
......
...@@ -24,7 +24,7 @@ export async function start() { ...@@ -24,7 +24,7 @@ export async function start() {
// .forEach(item => { // .forEach(item => {
// urlParams[item.split('=')[0]] = item.split('=')[1] // urlParams[item.split('=')[0]] = item.split('=')[1]
// }) // })
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : 'scrm-base-0958821a-6542-474e-b057-74a1192a25f2-rop' var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : ''
Vue.prototype.$http2 = new Http({ response, request: request2, sign, secret, alert: message.error, headers: { token } }) Vue.prototype.$http2 = new Http({ response, request: request2, sign, secret, alert: message.error, headers: { token } })
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } }) Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
// 集团版集团账号 // 集团版集团账号
......
...@@ -386,11 +386,13 @@ export default { ...@@ -386,11 +386,13 @@ export default {
}, },
handleGiftAdd() { handleGiftAdd() {
console.log(this.couponObj,'')
this.selectedGiftList = JSON.parse(JSON.stringify(this.couponObj)) this.selectedGiftList = JSON.parse(JSON.stringify(this.couponObj))
this.handleGiftClose() this.handleGiftClose()
}, },
handleGiftConfirm(selectedData) { handleGiftConfirm(selectedData) {
console.log(selectedData)
this.handleGiftClose() this.handleGiftClose()
this.couponObj = selectedData this.couponObj = selectedData
this.recoveryTotalPrice() this.recoveryTotalPrice()
......
<template> <template>
<div class="live-room"> <div class="marketing">
<tip-panel panelWidth="616px" panelMinHeight="40px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel> <div class="btnWrap">
<div class="live-room container"> <!-- <el-button :size="size" type="primary" @click="handleCreate" icon="el-icon-plus">创建套餐</el-button> -->
<div class="btnWrap"> <GLButton type="primary" @click="handleCreate" size="small" icon="el-icon-plus" fn="创建套餐" mode="el-button">创建套餐</GLButton>
<!-- <el-button :size="size" type="primary" @click="handleCreate" icon="el-icon-plus">创建套餐</el-button> --> <!-- <el-button :size="size" @click="showViewer = true">查看示例效果</el-button> -->
<GLButton type="primary" @click="handleCreate" size="small" icon="el-icon-plus" fn="创建套餐" mode="el-button">创建套餐</GLButton> <el-image-viewer
<el-button :size="size" @click="showViewer = true">查看示例效果</el-button> v-if="showViewer"
<el-image-viewer :on-close="
v-if="showViewer" () => {
:on-close=" showViewer = false
() => { }
showViewer = false "
} :url-list="srcList"
" style="padding:4%;"
:url-list="srcList" />
style="padding:4%;" </div>
/> <tip-panel class="list-panel" panelMinHeight="40px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel>
<template v-if="merchantModel == 1 && accountLevel == 4">
<div class="setmeal-tabs flex-default m-t-10">
<template v-for="(tab, index) in tabList">
<div :class="['tab', tab.checked ? 'active' : '']" @click="changeTab(index)" :key="index">{{ tab.text }}</div>
</template>
</div> </div>
</template>
<div class="live-room container">
<GLTable ref="memberSetMealRef" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="memberSetMealRef" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="list" slot-scope="scope"> <span slot="list" slot-scope="scope">
<div v-for="(item, index) in scope.scope.list" :key="index">{{ item.couponName }}×{{ item.serviceQuantity }}</div> <div class="content-meal">
<div class="text-14 color-3 line-20 weight-5 m-b-10">套餐内容</div>
<template v-for="(item, index) in scope.scope.list">
<div class="flex-top m-b-8" :key="index">
<div class="content-meal-logo"><img src="@/assets/setmeal/serve.png" alt="" /></div>
<div class="flex-align content-meal-list">
<div class="every color-3 text-14 weight-4 line-20" v-for="i in 2" :key="i">{{ item.couponName }}×{{ item.serviceQuantity }}</div>
<div class="every color-3 text-14 weight-4 line-20" v-for="i in 2" :key="i">终身机油套餐券 ×1</div>
</div>
</div>
</template>
</div>
</span> </span>
<span class="table-btns" slot="optionsFun" slot-scope="scope" :data="scope.scope"> <span class="table-btns" slot="optionsFun" slot-scope="scope" :data="scope.scope">
<GLButton type="text" @click="handleDelete(scope.scope)" fn="置顶推荐">置顶推荐</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="取消置顶">取消置顶</GLButton>
<template v-if="scope.scope.state === 0"> <template v-if="scope.scope.state === 0">
<!-- <el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button> <!-- <el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button>
<el-button type="text" @click="handleUpOption(scope.scope)">上架</el-button> <el-button type="text" @click="handleUpOption(scope.scope)">上架</el-button>
...@@ -89,13 +110,24 @@ export default { ...@@ -89,13 +110,24 @@ export default {
surl: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/memberCase.png', surl: 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/memberCase.png',
srcList: ['https://img01.glsx.com.cn/weapp/resource/saas/scrm/memberCase.png'], srcList: ['https://img01.glsx.com.cn/weapp/resource/saas/scrm/memberCase.png'],
isFirstShow: false, isFirstShow: false,
panelContent: '会员套餐:将已经创建好的会员服务打包成一个套餐售卖给客户。', panelContent: '会员套餐将会展示在小程序端【会员开通】页,客户开通会员时可选择性通过购买套餐方式开通会员或直接付费开通会员。',
size: 'small', size: 'small',
getListApi: getSetMealListApi, getListApi: getSetMealListApi,
searchForm: { searchForm: {
merchantId: 44184606 merchantId: 44184606
// merchantName // merchantName
}, },
tabList: [
{
text: '本店套餐',
checked: false
},
{
text: '集团套餐',
checked: true
}
],
activetab: 1,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数 // 表格参数
tableParams: { tableParams: {
...@@ -103,31 +135,40 @@ export default { ...@@ -103,31 +135,40 @@ export default {
// tableOption: true, // tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '',
prop: '',
columnattrs: {
type: 'expand'
},
addHtml: 'list'
},
{
label: '套餐名称', label: '套餐名称',
prop: 'packageName', prop: 'packageName',
width: '180' width: '180'
}, },
{ {
label: '套餐售价', label: '套餐售价/元',
prop: 'packagePrice', prop: 'packagePrice',
line: 1 line: 1
}, },
{ {
label: '套餐总价',
prop: 'referencePrice'
},
{
label: '套餐内容',
prop: 'list',
addHtml: 'list'
},
{
label: '说明', label: '说明',
prop: 'notes', prop: 'notes',
width: 160, width: 160,
line: 4 line: 4
}, },
{ {
label: '购买人数',
prop: 'packagePrice',
line: 1
},
{
label: '套餐总价',
prop: 'referencePrice'
},
{
label: '状态', label: '状态',
prop: 'state', prop: 'state',
width: '80', width: '80',
...@@ -147,14 +188,47 @@ export default { ...@@ -147,14 +188,47 @@ export default {
stateList: stateList stateList: stateList
}, },
//查看示例 --弹窗 //查看示例 --弹窗
isDialogVisible: false isDialogVisible: false,
merchantModel: 1, //集团:1,门店:2
accountLevel: 0 //1,2,3,4工厂,省代,市代,门店
} }
}, },
created() { created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
// this.merchantId = this.$globalState.session.merchantId
this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel
// this.userType = this.$globalState.session.userType
}
this.dynamicFile()
this.getLoginCountFun() this.getLoginCountFun()
}, },
mounted() {}, mounted() {},
methods: { methods: {
dynamicFile() {
const { activetab, merchantModel, accountLevel } = this
const saleParam = {
label: '在本店售出数量',
prop: 'packagePrice'
}
const referencePrice = {
label: '套餐总价',
prop: 'referencePrice'
}
//&& merchantModel == 1 && accountLevel == 4
if (activetab == 1) {
this.tableParams.tableColumns.splice(5, 1, saleParam)
} else {
this.tableParams.tableColumns.splice(5, 1, referencePrice)
}
},
changeTab(index) {
this.activetab = index
this.tabList.forEach(item => (item.checked = false))
this.tabList[index].checked = true
this.dynamicFile()
},
previewPic() { previewPic() {
this.$refs.previewImg.showViewer = true this.$refs.previewImg.showViewer = true
}, },
...@@ -264,7 +338,7 @@ export default { ...@@ -264,7 +338,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.btnWrap { .btnWrap {
margin-bottom: 20px; margin: 10px 0;
} }
/deep/ .el-dialog__header { /deep/ .el-dialog__header {
...@@ -321,4 +395,60 @@ export default { ...@@ -321,4 +395,60 @@ export default {
height: 40px; height: 40px;
font-size: 40px; font-size: 40px;
} }
/deep/ .el-table__expanded-cell {
padding: 0;
}
.list-panel {
/deep/ .initPanel {
margin: 0px;
}
}
.setmeal-tabs {
cursor: pointer;
width: auto;
position: relative;
left: calc(100% - 196px);
.tab {
background: #fafafa;
border-radius: 4px 4px 0px 0px;
border: 1px solid #eeedff;
padding: 13px 20px;
color: #37383a;
line-height: 14px;
font-size: 14px;
width: auto;
}
.active {
color: #5850ff;
}
}
.content-meal {
padding: 17px 0 9px 16px;
&-logo {
width: 59px;
height: 22px;
margin-right: 20px;
img {
width: 100%;
}
}
&-list {
width: calc(100% - 86px);
flex-wrap: wrap;
.every {
margin-right: 80px;
display: flex;
align-items: center;
}
.every::before {
content: '';
width: 6px;
height: 6px;
background: #5850ff;
border-radius: 50%;
margin-right: 7px;
display: inline-block;
}
}
}
</style> </style>
<template> <template>
<div class="live-room"> <div class="marketing live-room">
<div class="topMsg"> <div class="topMsg">
<p class="pageTitle" v-if="!id">创建套餐</p> <p class="pageTitle" v-if="!id">创建套餐</p>
<p class="pageTitle" v-else>编辑套餐</p> <p class="pageTitle" v-else>编辑套餐</p>
<el-button type="primary" size="small" @click="goBack">返回</el-button> <el-button type="primary" size="small" @click="goBack">返回</el-button>
</div> </div>
<div class="live-room container"> <div class="live-room container marketing ">
<el-form ref="ruleForm" :rules="rules" :model="ruleForm" label-width="120px" class="demo-ruleForm"> <el-form ref="ruleForm" :rules="rules" :model="ruleForm" label-width="120px" class="demo-ruleForm">
<el-form-item size="small" label="套餐名称" prop="packageName" style="width: 440px"> <el-form-item size="small" label="套餐名称" prop="packageName" style="width: 440px">
<el-input size="small" v-model="ruleForm.packageName" maxlength="20" placeholder="请输入套餐名称"></el-input> <el-input size="small" v-model="ruleForm.packageName" maxlength="15" placeholder="请输入套餐名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item size="small" label="套餐内容" class="is-required"> <el-form-item size="small" label="服务内容" class="is-required">
<el-button @click="openDialog" size="small" icon="el-icon-plus">选择服务</el-button> <el-button @click="handleGiftAdd" size="small" class="default-blue-btn">选择服务</el-button>
<div class="allChoseWrap" v-if="this.choseItemList.length > 0"> <div class="allChoseWrap" v-if="this.choseItemList.length > 0">
<!-- choseItemList --> <!-- choseItemList -->
<div class="choseItem" v-for="(item, index) in choseItemList" :key="index"> <div class="choseItem" v-for="(item, index) in choseItemList" :key="index">
...@@ -26,18 +26,6 @@ ...@@ -26,18 +26,6 @@
<span>{{ totalPrice }}元</span> <span>{{ totalPrice }}元</span>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item size="small" label="售价" prop="packagePrice" style="width: 315px">
<el-input size="small" v-model="ruleForm.packagePrice" placeholder="请输入" @keyup.native="ruleForm.packagePrice = oninput(ruleForm.packagePrice)">
<!-- <template slot="append">元</template> -->
<span slot="suffix" class="suffix-label">元</span>
</el-input>
</el-form-item>
<el-form-item size="small" label="计价器" prop="switchStatus">
<el-switch v-model="ruleForm.switchStatus" active-color="#5850ff" active-text="开" inactive-text="关"></el-switch>
<span class="calcValueMsg">开启后,小程序端套餐详情将展示该信息</span>
</el-form-item>
<template v-if="ruleForm.switchStatus"> <template v-if="ruleForm.switchStatus">
<div class="shopValuePanel"> <div class="shopValuePanel">
<div class="setmealName">套餐服务</div> <div class="setmealName">套餐服务</div>
...@@ -57,6 +45,18 @@ ...@@ -57,6 +45,18 @@
<span class="price">{{ totalShopPrice }}元</span> <span class="price">{{ totalShopPrice }}元</span>
</div> </div>
</template> </template>
<el-form-item size="small" label="套餐售价" prop="packagePrice" style="width: 315px">
<el-input size="small" v-model="ruleForm.packagePrice" placeholder="请输入套餐售价" @keyup.native="ruleForm.packagePrice = oninput(ruleForm.packagePrice)">
<!-- <template slot="append">元</template> -->
<span slot="suffix" class="suffix-label">元</span>
</el-input>
</el-form-item>
<template v-if="accountLevel == 4">
<el-form-item size="small" label="计价器" prop="switchStatus">
<el-switch v-model="ruleForm.switchStatus" active-color="#5850ff" active-text="开" inactive-text="关"></el-switch>
<span class="calcValueMsg">开启后,小程序端套餐详情将展示该信息</span>
</el-form-item>
</template>
<el-form-item size="small" label="说明" prop="notes" style="width: 670px"> <el-form-item size="small" label="说明" prop="notes" style="width: 670px">
<el-input size="small" :rows="6" type="textarea" v-model="ruleForm.notes" placeholder="请输入" maxlength="200" show-word-limit></el-input> <el-input size="small" :rows="6" type="textarea" v-model="ruleForm.notes" placeholder="请输入" maxlength="200" show-word-limit></el-input>
...@@ -131,16 +131,18 @@ ...@@ -131,16 +131,18 @@
<div>当前有内容信息未保存,是否继续返回?</div> <div>当前有内容信息未保存,是否继续返回?</div>
</div> </div>
</glsx-dialog> </glsx-dialog>
<select-gift-dialog v-if="isSelectGiftVisible" :isSelectGiftVisible="isSelectGiftVisible" :selectedGiftList="selectedMealList" @handleGiftConfirm="handleGiftConfirm" @handleGiftClose="handleGiftClose"></select-gift-dialog>
</div> </div>
</template> </template>
<script> <script>
import glsxDialog from '@/components/glsx-dialog' import glsxDialog from '@/components/glsx-dialog'
import { getSetmealService, createSetMeal, getServiceInfo, updateSetMeal, configSetMeal } from '@/api/modules/setmeal' import { getSetmealService, createSetMeal, getServiceInfo, updateSetMeal, configSetMeal } from '@/api/modules/setmeal'
import selectGiftDialog from '../giftBag/selectGiftDialog.vue'
export default { export default {
components: { components: {
glsxDialog glsxDialog,
selectGiftDialog
}, },
data() { data() {
return { return {
...@@ -168,8 +170,38 @@ export default { ...@@ -168,8 +170,38 @@ export default {
isTipDialogVisible: false, isTipDialogVisible: false,
selectNum: 0, selectNum: 0,
totalPrice: 0, totalPrice: 0,
//选择服务弹窗
isSelectGiftVisible: false,
selectedMealList:[],
couponObj: {
// 折扣券
discount: {
label: '折扣券',
discountType: 2,
list: []
},
// 代金券
cash: {
label: '代金券',
discountType: 3,
list: []
},
// 兑换券
exchange: {
label: '兑换券',
discountType: 4,
list: []
},
// 会员服务
service: {
label: '会员服务',
discountType: 7,
list: []
}
},
copyTotalPrice: 0, //用于检查页面信息是否改动 copyTotalPrice: 0, //用于检查页面信息是否改动
id: this.$route.query.id || 0 id: this.$route.query.id || 0,
accountLevel: 0 //1,2,3,4工厂,省代,市代,门店
} }
}, },
computed: { computed: {
...@@ -190,6 +222,7 @@ export default { ...@@ -190,6 +222,7 @@ export default {
//运行在qiankun容器中 //运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId this.merchantId = this.$globalState.session.merchantId
this.merchantName = this.$globalState.session.merchantName this.merchantName = this.$globalState.session.merchantName
this.accountLevel = this.$globalState.session.accountLevel
} }
this.getSetmealServiceFun() //获取服务套餐,执行完了之后去获取编辑详情 this.getSetmealServiceFun() //获取服务套餐,执行完了之后去获取编辑详情
...@@ -213,6 +246,20 @@ export default { ...@@ -213,6 +246,20 @@ export default {
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
}, },
methods: { methods: {
handleGiftAdd() {
console.log(this.couponObj)
this.selectedMealList = JSON.parse(JSON.stringify(this.couponObj))
this.handleGiftClose()
},
handleGiftClose() {
this.isSelectGiftVisible = !this.isSelectGiftVisible
},
handleGiftConfirm(selectedData) {
this.handleGiftClose()
this.couponObj = selectedData
this.recoveryTotalPrice()
this.recoveryGiftList()
},
openDialog() { openDialog() {
this.allItemList.forEach(item => { this.allItemList.forEach(item => {
item.serviceQuantity = 0 item.serviceQuantity = 0
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!