Commit 7e826a4e by 前端

更新月底版本代码

1 parent 00736a2f
...@@ -63,11 +63,22 @@ const getCaseDetailApi = params => { ...@@ -63,11 +63,22 @@ const getCaseDetailApi = params => {
}) })
} }
const topCaseApi = params => {
params.method = 'scrm.api.shopmall.discover.case.updateToTop'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
export default { export default {
getCaseListApi, getCaseListApi,
getVideoListApi, getVideoListApi,
delCaseApi, delCaseApi,
addCaseApi, addCaseApi,
getCarSeriesApi, getCarSeriesApi,
getCaseDetailApi getCaseDetailApi,
topCaseApi
} }
\ No newline at end of file \ No newline at end of file
...@@ -75,6 +75,62 @@ const getMerchantListApi = params => { ...@@ -75,6 +75,62 @@ const getMerchantListApi = params => {
}) })
} }
const getBrowseListApi = params => {
params.method = 'scrm.api.shopmall.discover.goods.browse.records'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const getVisitorListApi = params => {
params.method = 'scrm.api.shopmall.discover.goods.visitor.records'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const getSharedListApi = params => {
params.method = 'scrm.api.shopmall.discover.goods.shared.records'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const exportBrowseApi = (params, TYPE = 1) => {
//TYPE 1 浏览 2 访客 3 分享
params.method = {
1: 'scrm.api.shopmall.discover.goods.browse.records.export',
2: 'scrm.api.shopmall.discover.goods.visitor.records.export',
3: 'scrm.api.shopmall.discover.goods.shared.records.export'
}[TYPE]
return http({
url,
method: 'POST',
data: params,
sign: true
})
}
const exportGoodsApi = params => {
params.method = 'scrm.api.shopmall.goods.configuration.export'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
export default { export default {
getGoodsListApi, getGoodsListApi,
updateGoodsStatusApi, updateGoodsStatusApi,
...@@ -82,5 +138,10 @@ export default { ...@@ -82,5 +138,10 @@ export default {
getCarlifeGoodsApi, getCarlifeGoodsApi,
addGoodsApi, addGoodsApi,
getGoodsDetail, getGoodsDetail,
getMerchantListApi getMerchantListApi,
getBrowseListApi,
getVisitorListApi,
getSharedListApi,
exportBrowseApi,
exportGoodsApi
} }
\ No newline at end of file \ No newline at end of file
...@@ -29,8 +29,47 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max ...@@ -29,8 +29,47 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max
} else { } else {
return newValue ? oldValue : '' return newValue ? oldValue : ''
} }
};
function getExplorer() {
var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
browserType = 'IE'
} else if (ua.match(/firefox/) != null) {
browserType = '火狐'
} else if (ua.match(/ubrowser/) != null) {
browserType = 'UC'
} else if (ua.match(/opera/) != null) {
browserType = '欧朋'
} else if (ua.match(/bidubrowser/) != null) {
browserType = '百度'
} else if (ua.match(/metasr/) != null) {
browserType = '搜狗'
} else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
browserType = 'QQ'
} else if (ua.match(/maxthon/) != null) {
browserType = '遨游'
} else {
browserType = '谷歌'
}
return browserType
}
function exportFn(url) {
let browserType = getExplorer()
if (browserType == 'QQ') {
window.open(url)
return
}
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = url
document.body.appendChild(iframe)
} }
const orderManageStatusList = [ const orderManageStatusList = [
{ confId: '1', confName: '未支付' }, { confId: '1', confName: '未支付' },
{ confId: '2', confName: '已支付' }, { confId: '2', confName: '已支付' },
...@@ -149,6 +188,8 @@ const stateList = [{ ...@@ -149,6 +188,8 @@ const stateList = [{
}, },
] ]
export { export {
limitPrice, limitPrice,
orderManageStatusList, orderManageStatusList,
...@@ -159,5 +200,7 @@ export { ...@@ -159,5 +200,7 @@ export {
memberTypeList, memberTypeList,
stateList, stateList,
orderTypesList, orderTypesList,
orderStatusList orderStatusList,
getExplorer,
exportFn
} }
\ No newline at end of file \ No newline at end of file
...@@ -60,6 +60,17 @@ ...@@ -60,6 +60,17 @@
buttonList: [ buttonList: [
{ {
type: 'el-button', type: 'el-button',
name: '置顶',
attrs: {
type: 'text',
fn: '置顶'
},
listeners: {
click: row => this.topFn(row.scope)
}
},
{
type: 'el-button',
name: '预览', name: '预览',
attrs: { attrs: {
type: 'text', type: 'text',
...@@ -159,11 +170,29 @@ ...@@ -159,11 +170,29 @@
created() {}, created() {},
mounted() {}, mounted() {},
methods: { methods: {
topFn({id, caseName}){
const h = this.$createElement
this.$confirm(h('div', [h('div',{ style: 'font-size: 18px;color:#333,margin-bottom:4px;margin-top:8px' }, '是否确定将此案例置顶?'),h('p', { style: 'color:#666;margin-top:4px' },'置顶后的案例会在小程序端优先置顶展示')]), '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis.case.topCaseApi({id}).then(res => {
if(res){
this.$message.success('置顶成功')
this.handleSearch()
}
})
}
}
})
},
filterBrand({brandList}){ filterBrand({brandList}){
return brandList?.map(item => item.brandName) || [] return brandList?.map(item => item.brandName) || []
}, },
previewFn(row){ previewFn(row){
console.log(this.previewVideoUrl)
this.previewVideoUrl = row?.mediaInfo?.mediaUrl this.previewVideoUrl = row?.mediaInfo?.mediaUrl
this.previewVideoVisible = true this.previewVideoVisible = true
}, },
...@@ -236,4 +265,3 @@ ...@@ -236,4 +265,3 @@
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<!-- 明细 -->
<template>
<div class="edit-share marketing edit-box">
<div class=" container1 edit-container">
<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>
<div class="flex m-b-10 w-100-percent">
<div class="table-title">
已累计
<template v-if="routeInfo.type != 2">{{ decodeURI(routeInfo.name) }} </template>
<span>{{total || routeInfo.count }}</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"
>
<template v-if="scope.scope.customerAvatar">
<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>
</template>
<span class="m-l-10">{{ scope.scope.customerName }}</span>
</div>
<div
slot="shareName"
class="flex-align"
slot-scope="scope"
>
<template v-if="scope.scope.shareAvatar">
<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>
</template>
<span class="m-l-10">{{ scope.scope.shareName }}</span>
<span class="m-l-10">{{ scope.scope.sharePhone }}</span>
</div>
<div
slot="isBuy"
slot-scope="scope"
>
<span :class="['table-circle', 'm-r-8', scope.scope.isBuy == 'Y' ? 'back-green' : 'back-grey']"></span>
<span>
{{
{
Y: '已付款',
N: '未付款'
}[scope.scope.isBuy] || '--'
}}
</span>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
<div
class="footer"
:style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type="default"
@click="handleJump"
>返回</el-button>
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'browseList',
data () {
return {
size: 'small',
url: url,
footerLeft: '0',
footerWidth: '0',
routeInfo: {
id: '',
activityName: ''
},
searchForm: {
customerName: '',
mobile: ''
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 搜索
searchFormData: [
{
label: '微信昵称',
name: 'customerName',
type: 'input',
maxlength: 50
},
{
label: '手机号',
name: 'mobile',
type: 'input',
maxlength: 11
},
{
label: '分享人',
name: 'shareName',
type: 'input',
maxlength: 50
}
],
// 表格
getListApi: null,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '微信昵称',
prop: 'customerName',
addHtml: 'customerName'
},
{
label: '手机号',
prop: 'mobile'
},
{
label: '分享人',
prop: 'shareName',
addHtml: 'shareName',
width: 230
}
]
},
total: 0
}
},
created () {
console.log(this.$route.query)
const lastTableColumns = [
{
label: '浏览时长',
prop: 'browserTime'
},
{
label: '进入页面时间',
prop: 'operationDate',
width: '180'
},
{
label: '离开页面时间',
prop: 'leaveDate',
width: '180'
},
{
label: '订单状态',
prop: 'isBuy',
addHtml: 'isBuy'
}
],
{ query } = this.$route,
name = {
1: '浏览',
2: '访客',
3: '分享'
}[query.type],
[url] = window.location.href.split('%24title'),
apiName = this.$apis.goods[
{
1: 'getBrowseListApi',
2: 'getVisitorListApi',
3: 'getSharedListApi'
}[query.type]]
query.name = name
this.routeInfo = query
this.getListApi = apiName
if (query.type == 1) this.getTotal(apiName, query.id)
history.replaceState(null, null, `${url}&$title=${name}明细`)
// listName:
//1 浏览 2 访客 3 分享
if (query.type != 2) {
this.searchFormData.push({
label: '订单状态',
name: 'isBuy',
type: 'select',
width: '215px',
optionList: [
{
confId: '',
confName: '全部'
},
{
confId: 'Y',
confName: '已付款'
},
{
confId: 'N',
confName: '未付款'
}
],
optionId: 'confId',
optionLabel: 'confName'
})
if (query.type == 3)
this.tableParams.tableColumns.push({
label: '分享时间',
prop: 'sharedTime'
})
this.tableParams.tableColumns = [...this.tableParams.tableColumns, ...lastTableColumns]
} else
this.tableParams.tableColumns = [
...this.tableParams.tableColumns,
{
label: '浏览次数',
prop: 'browseCount'
},
{
label: '最后浏览时间',
prop: 'lastBrowseDate'
}
]
},
mounted () {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
},
methods: {
beforeSearchFn () {
return new Promise(resolve => {
this.searchForm.id = this.routeInfo.id
resolve()
})
},
handleExport () {
var params = this.$common.utils.deepClone(this.searchForm)
let { type } = this.routeInfo
params.pageNum = 1
params.pageSize = 999999
this.$apis.goods.exportBrowseApi(params, type).then(res => {
exportFn(res)
})
},
handleJump (path, row = {}) {
// this.$router.push({
// path: '/gooods/crowdFundList'
// })
// this.$route.query.activeName= this.routeInfo.activeName;
this.$router.back()
},
setTableFinishFun () {
//接收到的数据为空
this.$refs.browserRef.data.length ? (this.$refs.browserRef.tableHeightValues = '') : this.$refs.browserRef.setTableHeightFun()
},
handleSearch () {
const { query } = this.$route
this.$refs.browserRef.refreshTable()
if (query.type == 1) this.getTotal(this.$apis.goods.getBrowseListApi, query.id)
},
handleReset () {
this.searchForm = {
id: this.routeInfo.id,
customerName: '',
mobile: ''
}
this.handleSearch()
},
async getTotal (apiName, id) {
const { customerName, mobile } = this.searchForm, { total } = await apiName({
pageSize: 10,
pageNum: 1,
id,
customerName,
mobile
})
this.total = total
}
}
}
</script>
<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;
}
}
}
.m-b-10{
margin-bottom: 10px;
}
.m-l-10{
margin-left: 10px;
}
.flex{
display:flex;
justify-content: space-between;
}
.flex-align{
display: flex;
align-items:center
}
.footer{
position: fixed;
bottom: 0;
width: 100%;
height: 64px;
text-align: center;
line-height: 64px;
background: #fff;
z-index: 999;
}
.marketing .edit-title{
font-size: 16px;
font-weight: 600;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
padding: 0 0 0 20px;
}
.marketing .edit-container{
margin-bottom:30px;
}
.p-20{
padding: 20px;
}
.marketing .container1{
background: #fff;
}
</style>
...@@ -10,7 +10,11 @@ ...@@ -10,7 +10,11 @@
</GLCombiForm> </GLCombiForm>
<div class="operate-wrap"> <div class="operate-wrap">
<span class="table-title">发现商品列表</span> <span class="table-title">发现商品列表</span>
<div>
<el-button class="operate-btn" type="primary" size="small" @click="handleAdd">新增商品</el-button> <el-button class="operate-btn" type="primary" size="small" @click="handleAdd">新增商品</el-button>
<el-button size="small" @click="handleExport">导出</el-button>
</div>
</div> </div>
<GLTable ref="channelRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :beforeSearchFn="beforeSearchFn" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"> <GLTable ref="channelRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :beforeSearchFn="beforeSearchFn" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="imageSlot" class="table-image" slot-scope="scope"> <div slot="imageSlot" class="table-image" slot-scope="scope">
...@@ -41,6 +45,20 @@ ...@@ -41,6 +45,20 @@
<span v-else>{{ filterData(scope.scope).join('、') }}</span> <span v-else>{{ filterData(scope.scope).join('、') }}</span>
</template> </template>
</div> </div>
<div
slot="linkText"
slot-scope="scope"
>
<template v-if="scope.scope.incrementFlag == 'Y' || hideStatus">
{{ scope.scope[scope.prop] || 0 }}
</template>
<template v-else>
<p
class="cursor-pointer"
@click="handleDetail(scope)"
>{{ scope.scope[scope.prop] || 0 }}</p>
</template>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="4"></GLTableButton> <GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="4"></GLTableButton>
</div> </div>
...@@ -53,6 +71,7 @@ ...@@ -53,6 +71,7 @@
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import brandCascader from './components/brandCascader' import brandCascader from './components/brandCascader'
import preferList from './preferList' import preferList from './preferList'
import { exportFn } from '@/common/constant'
export default { export default {
name: 'App', name: 'App',
components: { components: {
...@@ -60,8 +79,9 @@ ...@@ -60,8 +79,9 @@
preferList preferList
}, },
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
console.log(from)
next(vm =>{ next(vm =>{
if(from.path.indexOf('/goods/addPrefer')==0) {vm.activeName='2'} if(from.path.indexOf('/goods/addPrefer')==0 || (from.path.indexOf('/goods/browseList')==0 && from.query.activeName== 2)) {vm.activeName='2'}
}) })
}, },
data() { data() {
...@@ -211,6 +231,26 @@ ...@@ -211,6 +231,26 @@
addHtml: 'merchantPriceSlot' addHtml: 'merchantPriceSlot'
}, },
{ {
label: '浏览量(次)',
prop: 'viewAmount',
addHtml: 'linkText',
width: 140
},
{
label: '访客',
prop: 'fansAmount',
addHtml: 'linkText'
},
{
label: '分享',
prop: 'shareAmount',
addHtml: 'linkText'
},
{
label: '销量',
prop: 'saleAmount'
},
{
label: '分类', label: '分类',
width: 150, width: 150,
formatter: cellValue => { formatter: cellValue => {
...@@ -244,6 +284,42 @@ ...@@ -244,6 +284,42 @@
created() {}, created() {},
mounted() {}, mounted() {},
methods: { methods: {
// 明细
handleDetail ({ prop, scope }) {
let data = {
viewAmount: {
type: 1,
count: scope.viewAmount
},
fansAmount: {
type: 2,
count: scope.fansAmount
},
shareAmount: {
type: 3,
count: scope.shareAmount
}
}[prop]
this.$router.push({
path: '/goods/browseList',
query: {
id: scope.id,
activityName: scope.goodsName,
type: data.type,
count: data.count,
activeName:this.activeName
}
})
},
handleExport () {
var params = this.$common.utils.deepClone(this.searchForm)
params.goodsType = 1
this.$apis.goods.exportGoodsApi(params).then(res => {
exportFn(res)
})
},
selectCategory(e){ selectCategory(e){
this.tableSearchForm.associationClassifyFirstId = e?.parent?.id this.tableSearchForm.associationClassifyFirstId = e?.parent?.id
this.tableSearchForm.associationClassifySecondId = e?.data?.id this.tableSearchForm.associationClassifySecondId = e?.data?.id
...@@ -382,5 +458,8 @@ ...@@ -382,5 +458,8 @@
} }
} }
} }
.cursor-pointer{
cursor:pointer;
color:#5850FF;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!