Commit 664c9429 by 李长胜

会员中心提交代码

1 parent 9e77a7ea
import { http } from '@/main'
// const defaultPath = 'scrm.api.live.'
const getCenterListApi = params => {
// params.method = `${defaultPath}goods.list`
params.method = `scrm.api.equity.card.merchant.record.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getMoreMerchant = params => {
// params.method = `${defaultPath}goods.list`
params.method = `scrm.api.equity.third.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//获取上方卡片的相关信息
const getCardContent = params => {
params.method = `scrm.api.equity.card.get.by.merchant.id`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateCardContent = params => {
params.method = `scrm.api.equity.card.class.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
export { getCenterListApi,getMoreMerchant ,updateCardContent,getCardContent}
\ No newline at end of file \ No newline at end of file
import { http } from '@/main'
// const defaultPath = 'scrm.api.live.'
const getOrderListApi = params => {
// params.method = `${defaultPath}goods.list`
params.method = `scrm.api.equity.merchant.order.list.with.page`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
export { getOrderListApi }
\ No newline at end of file \ No newline at end of file
import { http } from '@/main'
// const defaultPath = 'scrm.api.live.'
const getRecordListApi = params => {
// params.method = `${defaultPath}goods.list`
params.method = `scrm.api.coupon.verification.code.verification.list`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
// const auditGoodApi = params => {
// params.method = `${defaultPath}audit.goods`
// return http({
// url: 'rop-scrm-live/router',
// method: 'POST',
// data: params,
// sign: true,
// returnAll: true
// })
// }
// const getGoodInfoApi = params => {
// params.method = `${defaultPath}get.good.by.id`
// return http({
// url: 'rop-scrm-live/router',
// method: 'POST',
// data: params,
// sign: true
// })
// }
// const getGoodGroupInfoApi = params => {
// params.method = `${defaultPath}get.good.group.by.id`
// return http({
// url: 'rop-scrm-live/router',
// method: 'POST',
// data: params,
// sign: true
// })
// }
// const insertGoodApi = params => {
// params.method = `${defaultPath}insert.good`
// return http({
// url: 'rop-scrm-live/router',
// method: 'POST',
// data: params,
// sign: true,
// returnAll: true
// })
// }
// const insertGoodGroupApi = params => {
// params.method = `${defaultPath}insert.good.group`
// return http({
// url: 'rop-scrm-live/router',
// method: 'POST',
// data: params,
// sign: true,
// returnAll: true
// })
// }
// const deleteGoodApi = params => {
// params.method = `${defaultPath}delete.goods`
// return http({
// url: 'rop-scrm-live/router',
// method: 'POST',
// data: params,
// sign: true,
// returnAll: true
// })
// }
export { getRecordListApi }
import { http } from '@/main'
// const defaultPath = 'scrm.api.live.'
const getServiceListApi = params => {
params.method = `scrm.api.coupon.list.merchant`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
//生效、生效
const effectiveService = params => {
params.method = `scrm.api.coupon.effective`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
//删除
const deleteService = params => {
params.method = `scrm.api.coupon.delete`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
//删除
const createService = params => {
params.method = `scrm.api.coupon.create`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
//编辑、查看
const detailService = params => {
params.method = `scrm.api.coupon.detail`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
})
}
//修改
const updateService = params => {
params.method = `scrm.api.coupon.update`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
export { getServiceListApi,effectiveService, deleteService,createService,detailService,updateService}
\ No newline at end of file \ No newline at end of file
import { http } from '@/main'
// const defaultPath = 'scrm.api.live.'
const getSetMealListApi = params => {
// params.method = `${defaultPath}goods.list`
params.method = `scrm.api.equity.package.info.list.with.page`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const deleteSetMeal = params => {
params.method = `scrm.api.equity.package.info.delete`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
const getSetmealService = params=>{
params.method = `scrm.api.coupon.list.merchant`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
//获取编辑详情的接口
const getServiceInfo = params=>{
params.method = `scrm.api.equity.package.info.select`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
//创建套餐的接口
const createSetMeal = params => {
params.method = `scrm.api.equity.package.info.insert`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
const updateSetMeal = params => {
params.method = `scrm.api.equity.package.info.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
//不知道啥作用,老接口有调
const configSetMeal = params => {
params.method = `scrm.api.equity.package.service.config`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
//上下架
const upDownPackage = params => {
params.method = `scrm.api.equity.package.info.shelves`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
export { getSetMealListApi,deleteSetMeal,getSetmealService,getServiceInfo,createSetMeal,upDownPackage,updateSetMeal,configSetMeal }
\ No newline at end of file \ No newline at end of file
...@@ -75,4 +75,98 @@ const auditStatusList = [{ ...@@ -75,4 +75,98 @@ const auditStatusList = [{
} }
] ]
export { limitPrice, liveStatusList, auditStatusList }
\ No newline at end of file \ No newline at end of file
//会员中心得状态list
const statusList=[
// {
// confId: '',
// confName: '全部'
// },
{
confId: 1,
confName: '生效中'
},
{
confId: 2,
confName: '已失效'
}
]
//会员订单类型字典
const orderTypesList=[
{
confId: 1,
confName: '套餐'
},
{
confId: 2,
confName: '会员卡'
}
]
const orderStatusList=[
// 2: '待收货',
// 3: '已完成',
// 4: '售后中',
// 5: '退款失败',
// 6: '已经退款',
{
confId: 2,
confName: '待收货'
},
{
confId: 3,
confName: '已完成'
},
{
confId: 4,
confName: '售后中'
},
{
confId: 5,
confName: '退款失败'
},
{
confId: 2,
confName: '已经退款'
},
]
const serviceStatusList=[
{
confId: 1,
confName: '未生效'
},
{
confId: 2,
confName: '生效中'
},
{
confId: 3,
confName: '已失效'
}
]
const memberTypeList=[
{
confId: 1,
confName: '正式会员'
},
{
confId: 2,
confName: '试用会员'
}
]
const stateList=[
{
confId: 0,
confName: '待上架'
},
{
confId: 1,
confName: '在售中'
},
{
confId: 2,
confName: '已下架'
},
]
export { limitPrice, liveStatusList, auditStatusList,statusList ,serviceStatusList,
memberTypeList,stateList,orderTypesList,orderStatusList}
\ No newline at end of file \ No newline at end of file
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<slot></slot> <slot></slot>
<div slot="footer"> <div slot="footer">
<slot name="btn-start"></slot> <slot name="btn-start"></slot>
<el-button type="primary" :size="btnSize" @click="handleConfirm">{{ btnOkLabel }}</el-button> <el-button type="primary" v-if="!noBtnOk" :size="btnSize" @click="handleConfirm">{{ btnOkLabel }}</el-button>
<el-button v-if="!noCancel" :size="btnSize" @click="handleClose">取消</el-button> <el-button v-if="!noCancel" :size="btnSize" @click="handleClose">{{btnCanelLabel}}</el-button>
<slot name="btn-middle"></slot> <slot name="btn-middle"></slot>
</div> </div>
</el-dialog> </el-dialog>
...@@ -42,6 +42,14 @@ export default { ...@@ -42,6 +42,14 @@ export default {
type: String, type: String,
default: '确定' default: '确定'
}, },
btnCancelLabel: {
type: String,
default: '取消'
},
noBtnOk: {
type: Boolean,
default: false
},
noCancel: { noCancel: {
type: Boolean, type: Boolean,
default: false default: false
......
<template>
<div>
<div class="initPanel" :style="{ width: panelWidth, minHeight: panelMinHeight }">
{{ panelContent }}
<img src="@/assets/Shape.png" alt="" />
<i class="el-icon-close" @click="closeInitPanel"></i>
</div>
</div>
</template>
<script>
export default {
props: {
panelWidth: {
type: String,
default: ''
},
panelMinHeight: {
type: String,
default: '20px'
},
panelContent: {
type: String,
default: '请传入面板内容'
}
},
data() {
return {}
},
methods: {
closeInitPanel() {
this.$emit('closePanel')
}
}
}
</script>
<style lang="scss" scoped>
.initPanel {
margin-left: 40px;
position: relative;
margin-top: 20px;
box-sizing: border-box;
background: #e6e9ff;
border: 1px solid #5850ff;
border-radius: 4px;
padding: 10px 38px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 20px;
img {
position: absolute;
left: 16px;
top: 13px;
}
i {
position: absolute;
top: 14px;
right: 18px;
width: 9px;
height: 9px;
cursor: pointer;
}
}
</style>
...@@ -135,6 +135,60 @@ const staticRoutes = Object.freeze([ ...@@ -135,6 +135,60 @@ const staticRoutes = Object.freeze([
path: '/customerTransform/detaiCustomeGroup', path: '/customerTransform/detaiCustomeGroup',
component: resolve => require([`@/views/customerTransform/detaiCustomeGroup.vue`], resolve), component: resolve => require([`@/views/customerTransform/detaiCustomeGroup.vue`], resolve),
meta: {} meta: {}
} },
{
name: 'memberCenter',
path: '/memberCenter/index',
component: resolve => require([`@/views/memberCenter/index.vue`], resolve),
meta: {}
},
{
name: 'center',
path: '/memberCenter/center',
component: resolve => require([`@/views/memberCenter/center.vue`], resolve),
meta: {}
},
{
name: 'service',
path: '/memberCenter/service',
component: resolve => require([`@/views/memberCenter/service.vue`], resolve),
meta: {}
},
{
name: 'serviceAddUpdateLook',
path: '/memberCenter/serviceAddUpdateLook',
component: resolve => require([`@/views/memberCenter/serviceAddUpdateLook.vue`], resolve),
meta: {}
},
{
name: 'setmeal',
path: '/memberCenter/setmeal',
component: resolve => require([`@/views/memberCenter/setmeal.vue`], resolve),
meta: {}
},
{
name: 'setmealAddUpdate',
path: '/memberCenter/setmealAddUpdate',
component: resolve => require([`@/views/memberCenter/setmealAddUpdate.vue`], resolve),
meta: {}
},
{
name: 'order',
path: '/memberCenter/order',
component: resolve => require([`@/views/memberCenter/order.vue`], resolve),
meta: {}
},
{
name: 'orderDetail',
path: '/memberCenter/orderDetail',
component: resolve => require([`@/views/memberCenter/orderDetail.vue`], resolve),
meta: {}
},
{
name: 'record',
path: '/memberCenter/record',
component: resolve => require([`@/views/memberCenter/record.vue`], resolve),
meta: {}
},
]) ])
export default staticRoutes export default staticRoutes
export function dateFormat (dateTime, format = 'YYYY-MM-DD HH:mm') {
const date = new Date(dateTime)
const config = {
YYYY: date.getFullYear(),
MM: date.getMonth() + 1, //getMonth() 方法根据本地时间返回指定日期的月份(从 0 到 11)
DD: date.getDate(),
HH: date.getHours(),
mm: date.getMinutes(),
ss: date.getSeconds()
}
for (const key in config) {
format = format.replace(key, config[key])
}
return format
}
\ No newline at end of file \ No newline at end of file
<!-- 会员中心主页 -->
<template>
<div class="live-room">
<div class="container live-room">
<!-- <div class="titles">
<div v-for="(item, index) in titles" :key="index" class="tabItem" :class="{ activeTab: currentIndex === index }" @click="tabClick(index)">{{ item }}</div>
</div>
<template v-if="currentIndex == 0">
<Center></Center>
</template>
<template v-if="currentIndex == 1">
<Service></Service>
</template>
<template v-if="currentIndex == 2">
<SetMeal></SetMeal>
</template>
<template v-if="currentIndex == 3">
<Order></Order>
</template>
<template v-if="currentIndex == 4">
<Record></Record>
</template> -->
</div>
</div>
</template>
<script>
// import glsxDialog from '@/components/glsx-dialog'
// import Center from '@/views/memberCenter/childs/center'
// import Service from '@/views/memberCenter/childs/service'
// import SetMeal from '@/views/memberCenter/childs/setMeal'
// import Order from '@/views/memberCenter/childs/order'
// import Record from '@/views/memberCenter/childs/record'
export default {
name: 'memberCenter',
// components: {
// Record,
// Center,
// Service,
// SetMeal,
// Order
// },
data() {
return {
currentIndex: 0,
titles: ['会员中心', '会员服务', '会员套餐', '订单', '核销记录']
}
},
// components: {
// glsxDialog,
// glsxTable
// },
created() {
this.$router.push('/memberCenter/center')
},
mounted() {},
methods: {
tabClick(index) {
this.currentIndex = index
}
}
}
</script>
<style>
.live-room .titles {
display: flex;
justify-content: space-around;
/* align-items: center; */
width: 500px;
}
.live-room .tabItem {
font-size: 14px;
padding-bottom: 6px;
color: #717171;
cursor: pointer;
}
.live-room .activeTab {
color: #5850ff;
border-bottom: 2px solid #5850ff;
/* background-color: #fff; */
}
</style>
<template>
<div class="live-room">
<div class="live-room container">
<div class="flex">
<el-form :inline="true" style="width:100%" :model="searchForm" label-width="100px" label-position="right">
<el-row>
<el-form-item size="small" label="订单编号">
<el-input :size="size" v-model="searchForm.orderCode" placeholder="请输入订单编号" clearable></el-input>
</el-form-item>
<el-form-item size="small" label="名称">
<el-input :size="size" v-model="searchForm.packageName" placeholder="请输入名称" clearable></el-input>
</el-form-item>
<el-form-item size="small" label="类型">
<el-select size="small" v-model="searchForm.orderType" placeholder="请选择">
<el-option v-for="item in orderTypeList" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item size="small" label="用户信息">
<el-input :size="size" v-model="searchForm.userInfo" placeholder="请输入用户名或手机号" clearable></el-input>
</el-form-item>
<el-form-item size="small" label="下单时间">
<el-date-picker :size="size" v-model="searchForm.daterange" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions || {}"></el-date-picker>
</el-form-item>
<el-form-item size="small" style="float:right">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-row>
</el-form>
</div>
<GLTable ref="memberOrderRef" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<!-- <span slot="shareImgUrl" slot-scope="scope">
<img class="img-60" :src="scope.scope.shareImgUrl" />
</span> -->
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleDetail(scope.scope)">详情</el-button>
</span>
</GLTable>
</div>
</div>
</template>
<script>
import { orderTypesList, orderStatusList } from '@/common/constant'
import { getOrderListApi } from '@/api/modules/order'
export default {
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
},
size: 'small',
searchForm: {
// name: '',
// daterange:''
// orderType: ''
},
searchFormTable: {},
orderTypeList: [
{
dictValue: '',
dictLabel: '全部'
},
{
dictValue: 1,
dictLabel: '套餐'
},
{
dictValue: 2,
dictLabel: '会员卡'
}
],
// 表格组件
getListApi: getOrderListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '名称',
prop: 'packageName',
width: '180'
// formatter: cellValue => {
// return cellValue.startTime + '-' + cellValue.endTime
// }
},
{
label: '类型',
prop: 'orderType',
formatter: cellValue => {
return this.baseDataList.orderTypesList.find(item => item.confId == cellValue.orderType).confName
}
},
{
label: '价格',
prop: 'originalPrice'
},
{
label: '实收金额',
prop: 'realPayPrice',
line: 1
},
{
label: '订单状态',
prop: 'orderStatus',
width: '80',
formatter: cellValue => {
return this.baseDataList.orderStatusList.find(item => item.confId == cellValue.orderStatus).confName
}
},
{
label: '下单时间',
prop: 'createDate',
line: 1
},
{
label: '用户信息',
prop: 'accountName',
line: 1
},
{
label: '订单号',
prop: 'orderCode',
line: 1
}
]
},
baseDataList: {
orderTypesList: orderTypesList,
orderStatusList: orderStatusList
}
}
},
methods: {
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchFormTable.daterange) {
this.searchFormTable.startTime = this.searchForm.daterange[0] + ' 00:00:00'
this.searchFormTable.endTime = this.searchForm.daterange[1] + ' 23:59:59'
} else {
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
}
delete this.searchFormTable.daterange
resolve()
})
},
handleDetail(row) {
this.$router.push({
path: '/memberCenter/orderDetail',
query: {
id: row.id,
detail: row
}
})
},
handleSearch() {
this.$refs.memberOrderRef.refreshTable()
},
handleReset() {
this.searchForm = {}
this.handleSearch()
}
}
}
</script>
<style lang="scss" scoped>
.el-range-editor.is-active,
.el-range-editor.is-active:hover {
border-color: #5850ff;
width: 215px;
}
.el-range-editor--small.el-input__inner {
width: 215px;
}
</style>
<template>
<div class="live-room">
<div class="live-room container">
<div class="topMsg">
<div class="orderNo">订单编号:{{ detail.orderCode }}</div>
<div class="orderTime">下单时间:{{ detail.createDate }}</div>
<el-button type="primary" size="small" class="backBtn" @click="goBack">
返回
</el-button>
</div>
<div class="midMsgWrap">
<div class="midMsgTitle">
<span>支付信息</span>
<span>用户信息</span>
<span>服务名称</span>
<span>已核/总次数</span>
</div>
<div class="midMsgContent">
<div class="item">
<div>付款状态:已付款</div>
<div>付款金额:{{ detail.realPayPrice }}元</div>
<div>付款方式:微信支付</div>
<div>付款时间:{{ detail.createDate }}</div>
</div>
<div class="item">
<div class="userName">用户名称:{{ detail.accountName }}</div>
<div class="phoneNumber">用户手机号:{{ detail.mobile }}</div>
</div>
<div class="item">
<div v-for="(item, index) in detail.list" :key="index">{{ item.serviceName }}</div>
</div>
<div class="item">
<!-- <div>8/12次</div>
<div>0/1次</div>
<div>0/3次</div> -->
<div v-for="(item, index) in detail.list" :key="index">{{ item.serviceAmount }}/{{ item.serviceCount }}次</div>
</div>
</div>
</div>
<div id="tableWrap">
<el-table :data="tableData" style="width: 100%" :header-cell-style="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<el-table-column label="商品名称" align="center">
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.couponList" :key="index">{{ item.couponName }}</div>
</template>
</el-table-column>
<el-table-column label="类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.orderType == 1 ? '套餐' : '权益卡' }}</span>
</template>
</el-table-column>
<el-table-column label="有效期" align="center" v-if="detail.orderType == 2">
<template slot-scope="scope">
<span>{{ scope.row.effectiveNum == '-1' ? '无限制' : scope.row.effectiveNum + '天' }}</span>
</template>
</el-table-column>
<el-table-column prop="originalPrice" label="单价/元" align="center"></el-table-column>
<el-table-column prop="amount" label="数量" align="center"></el-table-column>
<el-table-column prop="totalPrice" label="小计/元" align="center"></el-table-column>
<el-table-column prop="realPayPrice" label="实收金额" align="center">
<template slot-scope="scope">
<span style="color:#EB4E4E">{{ scope.row.realPayPrice }}</span>
</template>
</el-table-column>
<el-table-column prop="orderStatus" label="状态" align="center">
<template slot-scope="scope">
<span>{{ scope.row.orderStatus == 2 ? '待收货' : scope.row.orderStatus == 3 ? '已完成' : scope.row.orderStatus == 4 ? '售后中' : scope.row.orderStatus == 2 ? '退款失败' : scope.row.orderStatus == 2 ? '已退款' : '' }}</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
tableData: [{}],
detail: this.$route.query.detail
}
},
created() {
this.setTableData()
},
mounted() {
this.$nextTick(() => {
let clientHeight = document.documentElement.clientHeight
let offsettop = document.getElementById('tableWrap').offsetTop
document.getElementById('tableWrap').style.minHeight = clientHeight - offsettop - 120 + 'px'
})
},
methods: {
setTableData() {
this.$set(this.tableData[0], 'couponList', this.detail.couponList)
this.$set(this.tableData[0], 'orderType', this.detail.orderType)
this.$set(this.tableData[0], 'effectiveNum', this.detail.effectiveNum)
this.$set(this.tableData[0], 'originalPrice', this.detail.originalPrice)
this.$set(this.tableData[0], 'amount', 1)
this.$set(this.tableData[0], 'totalPrice', this.detail.originalPrice)
this.$set(this.tableData[0], 'realPayPrice', this.detail.realPayPrice)
this.$set(this.tableData[0], 'orderStatus', this.detail.orderStatus)
console.log(this.tableData[0], '表格数据')
},
goBack() {
console.log(this.detail, 'gggg')
this.$router.go(-1)
}
}
}
</script>
<style lang="scss" scoped>
.container {
padding-top: 0px;
.topMsg {
display: flex;
height: 56px;
align-items: center;
position: relative;
.orderNo,
.orderTime {
font-size: 14px;
font-weight: 400;
color: #333333;
}
.orderNo {
position: absolute;
left: 50px;
}
.orderTime {
position: absolute;
left: 350px;
}
.backBtn {
position: absolute;
right: 0;
}
}
.midMsgWrap {
border-bottom: 1px solid#DCDFE6;
margin-bottom: 30px;
.midMsgTitle {
display: flex;
height: 56px;
align-items: center;
background-color: #f4f6fc;
padding-left: 50px;
span {
font-size: 14px;
font-weight: 700;
color: #333333;
flex: 1;
}
}
.midMsgContent {
padding-left: 50px;
display: flex;
height: 150px;
.item {
padding-top: 20px;
font-size: 14px;
font-weight: 400;
color: #666666;
flex: 1;
div {
margin-bottom: 10px;
}
.userName {
text-indent: 1em;
}
}
}
}
}
</style>
<template>
<div class="live-room">
<div class="live-room container">
<div class="flex">
<!-- <el-form>
<el-form-item>
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增直播</el-button>
</el-form-item>
</el-form> -->
<el-form :inline="true" style="width:100%" :model="searchForm" label-width="100px" label-position="right">
<el-row>
<!-- <el-col :span="6"></el-col> -->
<el-form-item size="small" label="服务名称">
<el-input :size="size" v-model="searchForm.couponName" placeholder="请输入服务名称" clearable></el-input>
</el-form-item>
<el-form-item size="small" label="核销用户">
<el-input :size="size" v-model="searchForm.userReq" placeholder="请输入核销用户" clearable></el-input>
</el-form-item>
<el-form-item size="small" label="核销员">
<el-input :size="size" v-model="searchForm.verificationOperator" placeholder="请输入核销员" clearable></el-input>
</el-form-item>
</el-row>
<el-row>
<el-form-item size="small" label="关联订单号">
<el-input :size="size" v-model="searchForm.orderCode" placeholder="请输入关联订单号" clearable></el-input>
</el-form-item>
<el-form-item size="small" label="核销日期">
<!-- verificationTimeStart verificationTimeEnd -->
<!-- <el-input :size="size" v-model="searchForm.name" placeholder="请输入核销员" clearable></el-input> -->
<el-date-picker :size="size" v-model="searchForm.daterange" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions || {}"></el-date-picker>
</el-form-item>
<el-form-item size="small" style="float:right">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-row>
</el-form>
</div>
<GLTable ref="memberRecordRef" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="verificationTime" slot-scope="scope">
<span>{{ dateFormatFun(scope.scope.verificationTime) }}</span>
</span>
</GLTable>
</div>
</div>
</template>
<script>
import { getRecordListApi } from '@/api/modules/record'
import { dateFormat } from '@/utils/index.js'
export default {
name: 'record',
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
},
size: 'small',
searchForm: {
// couponId:222 //卷id
//userCouponId //用户卷id
// name: '',
// daterange:''
couponName: '',
userReq: '',
verificationOperator: '',
orderCode: '',
merchantId: 44184606
},
// 44187877
searchFormTable: {},
// 表格组件
getListApi: getRecordListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '服务名称',
prop: 'couponName',
width: '180'
// formatter: cellValue => {
// return cellValue.startTime + '-' + cellValue.endTime
// }
},
{
label: '剩余待核销次数',
prop: 'residueAmount',
line: 1
},
{
label: '核销员',
prop: 'verificationOperator'
},
{
label: '关联订单号',
prop: 'orderCode',
line: 1
},
{
label: '核销日期',
prop: 'verificationTime',
line: 1,
addHtml: 'verificationTime'
}
// {
// label: '直播状态',
// prop: 'liveStatus',
// width: '80'
// // formatter: cellValue => {
// // return this.baseDataList.liveStatusList.find(item => item.confId == cellValue.liveStatus).confName
// // }
// }
]
}
// baseDataList: {
// liveStatusList: liveStatusList
// }
}
},
methods: {
dateFormatFun(date) {
return dateFormat(date)
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchFormTable.daterange) {
this.searchFormTable.verificationTimeStart = this.searchForm.daterange[0]
this.searchFormTable.verificationTimeEnd = this.searchForm.daterange[1]
} else {
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
}
delete this.searchFormTable.daterange
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
if (!this.$refs.memberRecordRef.data.length) {
this.$refs.memberRecordRef.setTableHeightFun()
}
},
// handleShare(row) {
// getLiveShareApi({ id: row.id }).then(res => {
// console.log(res)
// this.isShareVisible = !this.isShareVisible
// this.shareForm = res
// })
// },
handleShareClose() {
// this.handleShare()
this.isShareVisible = !this.isShareVisible
},
handleDetail(row) {
this.$router.push({
name: 'ServicesLiveRoomLiveControl',
params: {
id: row.id
}
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
// console.log(row)
// this.$history.push('services/liveRoom/editLiveRoom', { addOrEdit: addOrEdit, row: row || {} })
// this.eventBus.$emit('editRoom', {
// addOrEdit: addOrEdit,
// id: row ? row.id : ''
// })
this.$router.push({
name: 'ServicesLiveRoomEditLiveRoom',
params: {
addOrEdit: addOrEdit,
id: row ? row.id : '-1'
}
// name: 'editLiveRoom',
// path: '/liveRoom/editLiveRoom'
})
},
handleSearch() {
this.$refs.memberRecordRef.refreshTable()
},
handleReset() {
this.searchForm = { merchantId: 44184606 }
this.handleSearch()
}
}
}
</script>
<style lang="scss" scoped>
.el-range-editor.is-active,
.el-range-editor.is-active:hover {
border-color: #5850ff;
width: 215px;
}
.el-range-editor--small.el-input__inner {
width: 215px;
}
</style>
<template>
<div class="live-room">
<!-- //提示面板组件 -->
<tip-panel panelWidth="616px" panelMinHeight="60px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel>
<div class="live-room container">
<el-form :inline="true" style="width:100%" :model="searchForm" label-width="100px" label-position="right">
<el-row>
<el-form-item size="small">
<el-button :size="size" type="primary" icon="el-icon-plus" @click="handleCreate">创建服务</el-button>
</el-form-item>
<el-form-item size="small" label="服务名称">
<el-input :size="size" v-model="searchForm.couponName" placeholder="请输入服务名称" clearable></el-input>
</el-form-item>
<el-form-item size="small" style="float:right">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-row>
</el-form>
<GLTable ref="memberServiceRef" @setTableFinishFun="setTableFinishFun" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="useType" slot-scope="scope">
<span>{{ toRestrictLabelText(scope.scope) }}</span>
</span>
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<template v-if="scope.scope.status == 2">
<el-button type="text" @click="handleLossOption(scope.scope)">失效</el-button>
<el-button type="text" @click="handleLook(scope.scope)">查看</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</template>
<template v-else-if="scope.scope.status == 3">
<el-button type="text" @click="handleLook(scope.scope)">查看</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</template>
<template v-else>
<el-button type="text" @click="handleTakeOption(scope.scope)">生效</el-button>
<el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</template>
</span>
</GLTable>
</div>
</div>
</template>
<script>
import { getServiceListApi, effectiveService, deleteService } from '@/api/modules/service'
import { serviceStatusList } from '@/common/constant'
import tipPanel from '@/components/tipPanel/index.vue'
export default {
components: {
tipPanel
},
data() {
return {
isFirstShow: true,
panelContent: '会员服务:是由门店根据自店服务项目创建的线上服务券,如“一年十二次洗车券”、“陶瓷镀膜”等,客户购买后可到店出示服务券享受服务,门店扫码进行次数核销。',
size: 'small',
getListApi: getServiceListApi,
searchForm: {
couponName: '',
merchantId: 44184606
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableOption: true,
tableColumns: [
{
label: '服务名称',
prop: 'couponName',
width: '180'
},
{
label: '会员价(元)',
prop: 'vipPrice',
line: 1
},
{
label: '有效期',
prop: 'effectiveType',
addHtml: 'effectiveType'
},
{
label: '使用限制',
prop: 'useType',
addHtml: 'useType'
},
{
label: '剩余库存',
prop: 'residueAmount',
line: 1
// addHtml: 'activeTime'
},
{
label: '状态',
prop: 'status',
width: '80',
formatter: cellValue => {
return this.baseDataList.serviceStatusList.find(item => item.confId == cellValue.status).confName
}
},
{
label: '创建时间',
prop: 'createdDate',
line: 1
}
]
},
baseDataList: {
serviceStatusList: serviceStatusList
},
merchantId: 44184606
}
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
}
},
methods: {
closePanel() {
this.isFirstShow = false
},
toLabelText(row) {
switch (row.effectiveType) {
case 3:
return '无有效期'
case 2:
return row.effectiveStartTime ? row.effectiveStartTime.split(' ')[0] + '-' + row.effectiveEndTime.split(' ')[0] : ''
case 1:
return row.effectiveDays + '天'
}
},
toRestrictLabelText(row) {
switch (row.useType) {
case 0:
return '无限制'
case 1:
return row.useAmount
case 2:
return '每' + row.useLimitDays + '天可以使用' + row.useAmount + '次'
}
},
handleReset() {
this.searchForm = { couponName: '', merchantId: 44184606 }
this.handleSearch()
},
handleSearch() {
this.$refs.memberServiceRef.refreshTable()
},
setTableFinishFun(content) {
console.log(content, this.$refs.memberServiceRef.data.length, '获取数据')
//接收到的数据为空
if (!this.$refs.memberServiceRef.data.length) {
this.$refs.memberServiceRef.setTableHeightFun()
}
},
//创建服务
handleCreate() {
this.$router.push({
path: '/memberCenter/serviceAddUpdateLook'
})
},
//失效
handleLossOption(row) {
this.$messageBox.confirm('是否失效该服务?', '失效', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
effectiveService({ couponId: row.id, status: 3 }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
}
})
},
//生效
handleTakeOption(row) {
effectiveService({ couponId: row.id, status: 2 }).then(res => {
this.$message({
message: res.code == '0' ? '生效成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
},
handleEdit(row) {
this.$router.push({
path: '/memberCenter/serviceAddUpdateLook',
query: {
couponId: row.id,
title: '编辑'
}
})
},
handleLook(row) {
this.$router.push({
path: '/memberCenter/serviceAddUpdateLook',
query: {
couponId: row.id,
title: '查看'
}
})
},
handleDelete(row) {
this.$messageBox.confirm('是否删除该服务?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
deleteService({ couponId: row.id, merchantId: this.merchantId }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
}
})
}
}
}
</script>
<style lang="scss" scoped></style>
<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>
<el-button :size="size" @click="isDialogVisible = true">查看示例效果</el-button>
</div>
<GLTable ref="memberSetMealRef" :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>
</span>
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<template v-if="scope.scope.state === 0">
<el-button type="text" @click="handleUpOption(scope.scope)">上架</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</template>
<template v-else-if="scope.scope.state === 1">
<el-button type="text" @click="handleDownOption(scope.scope)">下架</el-button>
<el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button>
</template>
<template v-else>
<el-button type="text" @click="handleUpOption(scope.scope)">上架</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</template>
</span>
</GLTable>
</div>
<glsx-dialog title="示例效果" width="1142px" :noBtnOk="true" btnCancelLabel="关闭" btnSize="small" :isVisible="isDialogVisible" :showClose="false" @closeDialog="handleClose" @confirmDialog="handleClose">
<div class="content-body">
<div class="content-item col1">
<div class="subTitle">
1、管理后台先创建套餐
</div>
<div class="imageWrap">
<img src="@/assets/table.png" alt="" />
</div>
</div>
<div class="content-item col2">
<div class="subTitle">
2、小程序端进行展示
</div>
<div class="twoImageWrap">
<img src="@/assets/card1.png" alt="" />
<img src="@/assets/card2.png" alt="" />
</div>
</div>
</div>
</glsx-dialog>
</div>
</template>
<script>
import glsxDialog from '@/components/glsx-dialog'
import { getSetMealListApi, deleteSetMeal, upDownPackage } from '@/api/modules/setmeal'
import { stateList } from '@/common/constant'
import tipPanel from '@/components/tipPanel/index.vue'
export default {
components: {
tipPanel,
glsxDialog
},
data() {
return {
isFirstShow: true,
panelContent: '会员套餐:将已经创建好的会员服务打包成一个套餐售卖给客户。',
size: 'small',
getListApi: getSetMealListApi,
searchForm: {
merchantId: 44184606
// merchantName
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '套餐名称',
prop: 'packageName',
width: '180'
},
{
label: '套餐售价',
prop: 'packagePrice',
line: 1
},
{
label: '套餐总价',
prop: 'referencePrice'
},
{
label: '套餐内容',
prop: 'list',
addHtml: 'list'
},
{
label: '说明',
prop: 'notes'
// line: 1
},
{
label: '状态',
prop: 'state',
width: '80',
formatter: cellValue => {
return this.baseDataList.stateList.find(item => item.confId == cellValue.state).confName
}
}
]
},
baseDataList: {
stateList: stateList
},
//查看示例 --弹窗
isDialogVisible: false
}
},
methods: {
closePanel() {
this.isFirstShow = false
},
handleReset() {
this.searchForm = {
merchantId: 44184606
}
this.handleSearch()
},
handleSearch() {
this.$refs.memberSetMealRef.refreshTable()
},
//创建套餐
handleCreate() {
this.$router.push('/memberCenter/setmealAddUpdate')
},
handleClose() {
this.isDialogVisible = !this.isDialogVisible
},
//上架
handleUpOption(row) {
var params = {}
params.id = row.id
params.state = 1
upDownPackage(params).then(res => {
this.$message({
message: res.code == '0' ? '上架成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
},
handleDownOption(row) {
var params = {}
params.id = row.id
params.state = 2
this.$messageBox.confirm('下架后将隐藏且客户不能购买该套餐,已经购买的客户仍继续享有该套餐的服务?', '下架', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
upDownPackage(params).then(res => {
this.$message({
message: res.code == '0' ? '下架成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
}
})
},
handleEdit(row) {
this.$router.push({ path: '/memberCenter/setmealAddUpdate', query: { id: row.id } })
},
// 查看示例效果
handleLook(row) {},
handleDelete(row) {
this.$messageBox.confirm('是否删除该套餐?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
deleteSetMeal({ id: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
.btnWrap {
margin-bottom: 20px;
}
/deep/ .el-dialog__header .el-dialog__title {
font-size: 16px;
font-weight: 700;
color: #000000;
}
/deep/ .el-dialog__body {
border-top: 1px solid #e6e6e6;
border-bottom: 1px solid #e6e6e6;
padding: 20px 25px;
.content-body {
display: flex;
.col2 {
margin-left: 40px;
}
.content-item {
.subTitle {
margin-bottom: 20px;
font-size: 18px;
font-weight: 700;
color: #000000;
}
}
}
}
/deep/ .el-dialog__footer {
text-align: center;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!