Commit a12341f0 by 李伟康

提交代码

1 parent 9c723cca
......@@ -208,11 +208,13 @@ export default {
handleUploadChange(e, targetItem) {
var reader = new FileReader()
var file = e.srcElement.files[0]
var uploadType = targetItem.uploadType || 'img'
var uploadType = targetItem.uploadType || 'img',
IMGTYPE = ['image/jpeg', 'image/png', 'image/jpg']
if(targetItem.supportGif) IMGTYPE.push('image/gif')
// 默认1MB
const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize
const isType = uploadType == 'img' ? ['image/jpeg', 'image/png', 'image/jpg'].includes(file.type) : ['video/mp4'].includes(file.type)
const isType = uploadType == 'img' ? IMGTYPE.includes(file.type) : ['video/mp4'].includes(file.type)
const maxPhotoNum = targetItem.maxPhotoNum || 1
const wdithLt = targetItem.wdithLt || 300
const heightLt = targetItem.heightLt || 300
......
......@@ -5,26 +5,83 @@
<p class="edit-title">{{ routeInfo.activityName }}</p>
<div class="p-20">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="flex m-b-10 w-100-percent">
<span class="table-title"></span>
<el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button>
<div class="table-title">
已累计<template v-if="routeInfo.type != 2">{{decodeURI(routeInfo.name)}}</template>
<span>{{routeInfo.count || 0}}</span>
{{routeInfo.type == 2?'位访客':'次'}}
</div>
<el-button
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="browserRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="customerName" class="flex-align" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.customerAvatar" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.customerAvatar" />
<GLTable
ref="browserRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div
slot="customerName"
class="flex-align"
slot-scope="scope"
>
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.customerAvatar"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.customerAvatar"
/>
</el-popover>
<span class="m-l-10">{{ scope.scope.customerName }}</span>
</div>
<div slot="shareName" class="flex-align" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.shareAvatar" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.shareAvatar" />
<div
slot="shareName"
class="flex-align"
slot-scope="scope"
>
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.shareAvatar"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.shareAvatar"
/>
</el-popover>
<span class="m-l-10">{{ scope.scope.shareName }}</span>
</div>
......@@ -32,8 +89,14 @@
<!-- 表格区域 end -->
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" @click="handleJump">返回</el-button>
<div
class="footer"
:style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type="default"
@click="handleJump"
>返回</el-button>
</div>
</div>
</template>
......@@ -44,7 +107,7 @@ import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'browseList',
data() {
data () {
return {
size: 'small',
url: url,
......@@ -72,6 +135,12 @@ export default {
name: 'mobile',
type: 'input',
maxlength: 11
},
{
label: '分享人',
name: 'a',
type: 'input',
maxlength: 50
}
],
// 表格
......@@ -89,42 +158,101 @@ export default {
prop: 'mobile'
},
{
label: '来源',
label: '分享人',
prop: 'shareName',
addHtml: 'shareName'
},
{
label: '浏览次数',
prop: 'browseCount'
},
{
label: '浏览时间',
prop: 'lastBrowseDate',
width: '180'
}
]
}
}
},
created() {
this.routeInfo = this.$route.query
created () {
const lastTableColumns = [
{
label: '浏览时长',
prop: 'browseCount',
},
{
label: '进入页面时间',
prop: 'lastBrowseDate',
width: '180'
},
{
label: '离开页面时间',
prop: 'lastBrowseDate',
width: '180'
},
{
label: '订单状态',
prop: 'lastBrowseDate',
}
], {
query
} = this.$route,
name = {
1: '浏览',
2: '访客',
3: '分享',
}[query.type]
query.name = name
this.routeInfo = query
history.replaceState(null, null, `${window.location.href}&$title=${name}明细`)
if (query.type != 2) {
this.searchFormData.push({
label: '订单状态',
name: 'orderStatus',
type: 'select',
width: '215px',
optionList: [
{
confId: '',
confName: '全部'
},
{
confId: '2',
confName: '已付款'
},
{
confId: '3',
confName: '未付款'
}
],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'statusList'
})
if (query.type == 3) this.tableParams.tableColumns.push({
label: '分享时间',
prop: 'lastBrowseDate',
width: '180'
})
this.tableParams.tableColumns = [...this.tableParams.tableColumns, ...lastTableColumns]
} else this.tableParams.tableColumns = [...this.tableParams.tableColumns, {
label: '浏览次数',
prop: 'browseCount',
}, {
label: '最后浏览时间',
prop: 'lastBrowseDate',
width: '180'
}]
},
mounted() {
mounted () {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
},
methods: {
beforeSearchFn() {
beforeSearchFn () {
return new Promise(resolve => {
this.searchForm.activityId = this.routeInfo.id
resolve()
})
},
handleExport() {
handleExport () {
var params = this.$common.utils.deepClone(this.searchForm)
params.pageNum = 1
params.pageSize = 999999
......@@ -133,22 +261,22 @@ export default {
})
},
handleJump(path, row = {}) {
handleJump (path, row = {}) {
this.$router.push({
path: '/seckillActivity/crowdFundList'
})
},
setTableFinishFun() {
setTableFinishFun () {
//接收到的数据为空
this.$refs.browserRef.data.length ? (this.$refs.browserRef.tableHeightValues = '') : this.$refs.browserRef.setTableHeightFun()
},
handleSearch() {
handleSearch () {
this.$refs.browserRef.refreshTable()
},
handleReset() {
handleReset () {
this.searchForm = {
activityId: this.routeInfo.id,
customerName: '',
......@@ -160,4 +288,18 @@ export default {
}
</script>
<style scoped></style>
<style scoped lang="scss">
.edit-container {
.table-title {
font-weight: 400;
font-size: 14px;
color: #333333;
line-height: 20px;
display: flex;
align-items: center;
span {
color: #5850ff;
}
}
}
</style>
......@@ -136,7 +136,7 @@ export default {
maxlength: 20
},
{
label: '状态',
label: '活动状态',
name: 'activityStatus',
type: 'select',
width: '215px',
......@@ -458,18 +458,18 @@ export default {
},
// 明细
handleDetail ({ prop, scope }) {
let option = {
let data = {
viewAmount: {
type: 1,
name: '浏览'
count: scope.viewAmount
},
fansAmount: {
type: 2,
name: '访客'
count: scope.fansAmount
},
shareAmount: {
type: 3,
name: '分享'
count: scope.shareAmount
}
}[prop]
this.$router.push({
......@@ -477,8 +477,8 @@ export default {
query: {
id: scope.id,
activityName: scope.activityName,
detailType: option.type,
$title: encodeURI(`${option.name}明细`)
type: data.type,
count: data.count,
}
})
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!