Commit ef9e09c2 by 王志慧

commit

1 parent 9e9a4bc2
......@@ -26,7 +26,7 @@ html {
.live-room .container {
background: #ffffff;
margin: 20px 0px;
margin: 20px 0;
padding: 15px 20px;
box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.1);
}
......@@ -130,7 +130,7 @@ html {
}
.marketing .f-right {
float: right;
float: right;
}
.marketing .footer-btns {
......@@ -169,32 +169,32 @@ html {
}
.table-popover-block {
position: relative;
height: 160px !important;
overflow: hidden;
border-width: 0 !important;
padding: 0 !important;
margin-bottom: 10px !important;
position: relative;
height: 160px !important;
overflow: hidden;
border-width: 0 !important;
padding: 0 !important;
margin-bottom: 10px !important;
}
.table-popover-block.el-popper .popper__arrow {
display: none !important;
display: none !important;
}
.table-popover-img {
width: 100%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.marketing .pointer {
cursor: pointer;
cursor: pointer;
}
.marketing .img-w-100 {
width: 100%;
width: 100%;
}
.marketing .img-60 {
......@@ -223,7 +223,9 @@ html {
.marketing .m-t-10 {
margin-top: 10px;
}
.marketing .m-b-8 {
margin-bottom: 8px;
}
.marketing .m-b-10 {
margin-bottom: 10px;
}
......@@ -326,13 +328,24 @@ html {
display: flex;
flex-wrap: wrap;
}
.marketing .flex-align {
display: flex;
align-items: center;
}
.marketing .flex-top {
display: flex;
align-items: flex-start;
}
.marketing .flex-center {
display: flex;
justify-content: center;
align-items: center;
}
.marketing .flex-between {
display: flex;
justify-content:space-between;
align-items: center;
}
.marketing .flex-grow {
flex: 1;
}
......@@ -469,5 +482,19 @@ html {
color: #5850ff;
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 */
......@@ -19,8 +19,8 @@ export const fetchConfig = function (isEnv = true) {
// }
//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' })
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.test.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 = {
install(vue, cfg) {
......
......@@ -24,7 +24,7 @@ export async function start() {
// .forEach(item => {
// 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.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
......
......@@ -386,11 +386,13 @@ export default {
},
handleGiftAdd() {
console.log(this.couponObj,'')
this.selectedGiftList = JSON.parse(JSON.stringify(this.couponObj))
this.handleGiftClose()
},
handleGiftConfirm(selectedData) {
console.log(selectedData)
this.handleGiftClose()
this.couponObj = selectedData
this.recoveryTotalPrice()
......
<template>
<div class="live-room">
<tip-panel panelWidth="616px" panelMinHeight="40px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel>
<div class="live-room container">
<div class="btnWrap">
<!-- <el-button :size="size" type="primary" @click="handleCreate" icon="el-icon-plus">创建套餐</el-button> -->
<GLButton type="primary" @click="handleCreate" size="small" icon="el-icon-plus" fn="创建套餐" mode="el-button">创建套餐</GLButton>
<el-button :size="size" @click="showViewer = true">查看示例效果</el-button>
<el-image-viewer
v-if="showViewer"
:on-close="
() => {
showViewer = false
}
"
:url-list="srcList"
style="padding:4%;"
/>
<div class="marketing">
<div class="btnWrap">
<!-- <el-button :size="size" type="primary" @click="handleCreate" icon="el-icon-plus">创建套餐</el-button> -->
<GLButton type="primary" @click="handleCreate" size="small" icon="el-icon-plus" fn="创建套餐" mode="el-button">创建套餐</GLButton>
<!-- <el-button :size="size" @click="showViewer = true">查看示例效果</el-button> -->
<el-image-viewer
v-if="showViewer"
:on-close="
() => {
showViewer = false
}
"
: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>
</template>
<div class="live-room container">
<GLTable ref="memberSetMealRef" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<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 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">
<!-- <el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button>
<el-button type="text" @click="handleUpOption(scope.scope)">上架</el-button>
......@@ -89,13 +110,24 @@ export default {
surl: '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,
panelContent: '会员套餐:将已经创建好的会员服务打包成一个套餐售卖给客户。',
panelContent: '会员套餐将会展示在小程序端【会员开通】页,客户开通会员时可选择性通过购买套餐方式开通会员或直接付费开通会员。',
size: 'small',
getListApi: getSetMealListApi,
searchForm: {
merchantId: 44184606
// merchantName
},
tabList: [
{
text: '本店套餐',
checked: false
},
{
text: '集团套餐',
checked: true
}
],
activetab: 1,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
......@@ -103,31 +135,40 @@ export default {
// tableOption: true,
tableColumns: [
{
label: '',
prop: '',
columnattrs: {
type: 'expand'
},
addHtml: 'list'
},
{
label: '套餐名称',
prop: 'packageName',
width: '180'
},
{
label: '套餐售价',
label: '套餐售价/元',
prop: 'packagePrice',
line: 1
},
{
label: '套餐总价',
prop: 'referencePrice'
},
{
label: '套餐内容',
prop: 'list',
addHtml: 'list'
},
{
label: '说明',
prop: 'notes',
width: 160,
line: 4
},
{
label: '购买人数',
prop: 'packagePrice',
line: 1
},
{
label: '套餐总价',
prop: 'referencePrice'
},
{
label: '状态',
prop: 'state',
width: '80',
......@@ -147,14 +188,47 @@ export default {
stateList: stateList
},
//查看示例 --弹窗
isDialogVisible: false
isDialogVisible: false,
merchantModel: 1, //集团:1,门店:2
accountLevel: 0 //1,2,3,4工厂,省代,市代,门店
}
},
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()
},
mounted() {},
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() {
this.$refs.previewImg.showViewer = true
},
......@@ -264,7 +338,7 @@ export default {
<style lang="scss" scoped>
.btnWrap {
margin-bottom: 20px;
margin: 10px 0;
}
/deep/ .el-dialog__header {
......@@ -321,4 +395,60 @@ export default {
height: 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>
<template>
<div class="live-room">
<div class="marketing live-room">
<div class="topMsg">
<p class="pageTitle" v-if="!id">创建套餐</p>
<p class="pageTitle" v-else>编辑套餐</p>
<el-button type="primary" size="small" @click="goBack">返回</el-button>
</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-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 size="small" label="套餐内容" class="is-required">
<el-button @click="openDialog" size="small" icon="el-icon-plus">选择服务</el-button>
<el-form-item size="small" label="服务内容" class="is-required">
<el-button @click="handleGiftAdd" size="small" class="default-blue-btn">选择服务</el-button>
<div class="allChoseWrap" v-if="this.choseItemList.length > 0">
<!-- choseItemList -->
<div class="choseItem" v-for="(item, index) in choseItemList" :key="index">
......@@ -26,18 +26,6 @@
<span>{{ totalPrice }}元</span>
</div>
</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">
<div class="shopValuePanel">
<div class="setmealName">套餐服务</div>
......@@ -57,6 +45,18 @@
<span class="price">{{ totalShopPrice }}元</span>
</div>
</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-input size="small" :rows="6" type="textarea" v-model="ruleForm.notes" placeholder="请输入" maxlength="200" show-word-limit></el-input>
......@@ -131,16 +131,18 @@
<div>当前有内容信息未保存,是否继续返回?</div>
</div>
</glsx-dialog>
<select-gift-dialog v-if="isSelectGiftVisible" :isSelectGiftVisible="isSelectGiftVisible" :selectedGiftList="selectedMealList" @handleGiftConfirm="handleGiftConfirm" @handleGiftClose="handleGiftClose"></select-gift-dialog>
</div>
</template>
<script>
import glsxDialog from '@/components/glsx-dialog'
import { getSetmealService, createSetMeal, getServiceInfo, updateSetMeal, configSetMeal } from '@/api/modules/setmeal'
import selectGiftDialog from '../giftBag/selectGiftDialog.vue'
export default {
components: {
glsxDialog
glsxDialog,
selectGiftDialog
},
data() {
return {
......@@ -168,8 +170,38 @@ export default {
isTipDialogVisible: false,
selectNum: 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, //用于检查页面信息是否改动
id: this.$route.query.id || 0
id: this.$route.query.id || 0,
accountLevel: 0 //1,2,3,4工厂,省代,市代,门店
}
},
computed: {
......@@ -190,6 +222,7 @@ export default {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
this.merchantName = this.$globalState.session.merchantName
this.accountLevel = this.$globalState.session.accountLevel
}
this.getSetmealServiceFun() //获取服务套餐,执行完了之后去获取编辑详情
......@@ -213,6 +246,20 @@ export default {
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
},
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() {
this.allItemList.forEach(item => {
item.serviceQuantity = 0
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!