Commit 4128198c by chenwq

定向礼包路径和页面

1 parent b3edbf3e
......@@ -57,7 +57,7 @@ export default {
line-height: 36px;
}
#app {
padding: 0px 20px 20px 40px;
padding: 0px 20px 20px 20px;
// overflow-y: auto;
margin-right: 20px;
height: 100%;
......
......@@ -207,5 +207,17 @@ const staticRoutes = Object.freeze([{
component: resolve => require([`@/views/memberCenter/record.vue`], resolve),
meta: {}
},
{
name: 'giftBag',
path: '/giftBag/index',
component: resolve => require([`@/views/giftBag/index.vue`], resolve),
meta: {}
},
{
name: 'giftDetail',
path: '/giftBag/giftDetail',
component: resolve => require([`@/views/giftBag/giftDetail.vue`], resolve),
meta: {}
}
])
export default staticRoutes
\ No newline at end of file
<template>
<div>
</div>
</template>
<script>
export default {
name: 'giftDetail',
data() {
return {
};
},
mounted() {
},
methods: {
},
};
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<!-- 定向礼包-->
<template>
<div class="marketing p-t-20">
<div class="container">
<div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="default" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="commentRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button v-if="scope.scope.commentStatus == '0'" type="text" @click="handleRevoke(scope.scope)">发布</el-button>
<el-button v-if="scope.scope.commentStatus == '1'" type="text" @click="handleRevoke(scope.scope)">撤回</el-button>
<!-- <el-button type="text" @click="handleDetail(scope.scope)">查看</el-button> -->
<GLButton type="text" fn="评价详情" @click="handleDetail(scope.scope)">查看</GLButton>
<!-- <el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
export default {
name: 'giftList',
data() {
return {
size: 'small',
url: url,
searchForm: {
orderCode: '',
commentStatus: '',
createDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '评价日期',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '评价状态',
name: 'commentStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'commentStatusList'
},
{
label: '订单编号',
name: 'orderCode',
type: 'input',
maxlength: 17,
isClear: true
}
],
// 表格
getListApi: this.$apis.orderComment.getListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '订单编号',
prop: 'orderCode',
width: '200'
},
{
label: '评价日期',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '评价状态',
prop: 'commentStatus',
line: 1,
formatter: cellValue => {
return this.baseData.commentStatusList.find(item => item.confId == cellValue.commentStatus).confName
}
},
{
label: '评论人',
prop: 'customerName',
line: 1,
formatter: cellValue => {
return cellValue.customerName || '-'
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
baseData: {
commentStatusList: [
{
confId: '0',
confName: '未发布'
},
{
confId: '1',
confName: '已发布'
}
]
}
}
},
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) {
params.createStartDateStr = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.createEndDateStr = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
// 查看
handleDetail(row) {
this.$router.push({
path: '/orderComment/commentDetail',
query: {
id: row.id
}
})
},
// 发布/撤回
handleRevoke(row) {
var txt = row.commentStatus == '0' ? '发布' : '撤回'
this.secondConfirm(txt, '是否确认'+ txt +'该评论?', 'orderComment', 'changeCommentStatusApi', { id: row.id, commentStatus: row.commentStatus == '0' ? 1 : 0 })
},
handleDelete(row) {
this.secondConfirm('删除', '是否确认删除该评论?', 'orderComment', 'deleteCommentApi', { id: row.id })
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.commentRef.data.length ? (this.$refs.commentRef.tableHeightValues = '') : this.$refs.commentRef.setTableHeightFun()
},
handleSearch() {
this.$refs.commentRef.refreshTable()
},
handleReset() {
this.searchForm = {
orderCode: '',
commentStatus: '',
createDate: []
}
this.handleSearch()
}
}
}
</script>
<style scoped></style>
<!-- 定向礼包 -->
<template>
<div class="gift-bag">
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="定向礼包" name="giftList">
<gift-list></gift-list>
</el-tab-pane>
<el-tab-pane label="已领取" name="receivedGiftList">
<div class="p-t-20">已领取</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import giftList from './giftList.vue'
export default {
name: 'gitfBag',
data() {
return {
activeName: 'giftList'
}
},
components: {
giftList
},
mounted() { },
methods: {
handleTabClick() { }
}
}
</script>
<style>
.gift-bag .el-tabs__nav-wrap:after {
opacity: 0;
}
.gift-bag .el-tabs__item {
height: 20px !important;
line-height: 10px !important;
font-weight: 400;
font-size: 16px;
color: #717171;
height: 36px;
line-height: 36px;
}
.gift-bag .el-tabs__item:hover,
.gift-bag .el-tabs__item.is-active {
color: #5f5efb;
}
</style>
......@@ -163,7 +163,6 @@ export default {
}
})
},
// 查看
handleDetail(row) {
this.$router.push({
......@@ -209,7 +208,6 @@ export default {
})
}
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.commentRef.data.length ? (this.$refs.commentRef.tableHeightValues = '') : this.$refs.commentRef.setTableHeightFun()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!