Commit d69abfc1 by 前端

Merge branch 'saas+v4.22.0' into 'master'

合并Saas+v4.22.0

See merge request !19
2 parents 828e78d4 26e6b749
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node",
"target": "ES2020",
"jsx": "react",
"strictNullChecks": true,
"strictFunctionTypes": true
},
"exclude": [
"node_modules",
"**/node_modules/*"
],
"vueCompilerOptions": {
"experimentalCompatMode": 2
}
}
\ No newline at end of file \ No newline at end of file
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"autoprefixer": "^8.0.0", "autoprefixer": "^8.0.0",
"core-js": "^3.6.4", "core-js": "^3.6.4",
"dayjs": "^1.10.5", "dayjs": "^1.10.5",
"glsx-common": "^1.4.9", "glsx-common": "^2.1.0",
"lib-flexible": "^0.3.2", "lib-flexible": "^0.3.2",
"postcss-loader": "^6.2.0", "postcss-loader": "^6.2.0",
"sha1": "^1.1.1", "sha1": "^1.1.1",
......
const url = '/rop-scrm-entmicro/router'
export default {
/**查询喜报战报推送日志分页列表 */
getActivityReportLogList (data) {
data.method = 'entmicro.api.wechatcloudcontrol.activityreport.log.page'
return window.$HTTP({
url,
data
})
},
}
...@@ -10,10 +10,12 @@ import ssoApi from './ssoApi' ...@@ -10,10 +10,12 @@ import ssoApi from './ssoApi'
import merchantsApi from './merchantsApi' import merchantsApi from './merchantsApi'
import wxConfig from './wxConfig' import wxConfig from './wxConfig'
import marketingApi from './marketingApi' import marketingApi from './marketingApi'
import entmicroApi from './entmicroApi'
export { export {
ssoApi, ssoApi,
wxConfig, wxConfig,
merchantsApi, merchantsApi,
marketingApi marketingApi,
entmicroApi
} }
\ No newline at end of file \ No newline at end of file
const url = '/rop-scrm-marketing/router' const url = '/rop-scrm-marketing/router'
export default { export default {
/**素材列表 */ /**素材列表 */
getPsdList(data) { getPsdList (data) {
data.method = 'marketing.api.material.list' data.method = 'marketing.api.material.list'
data.pageNum = 1 data.pageNum = 1
data.pageSize = 9999 data.pageSize = 9999
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
}) })
}, },
/** 素材组列表 */ /** 素材组列表 */
getPsdGroupList(data = {}) { getPsdGroupList (data = {}) {
data.method = 'marketing.api.material.group.list' data.method = 'marketing.api.material.group.list'
return window.$HTTP({ return window.$HTTP({
url, url,
...@@ -20,7 +20,7 @@ export default { ...@@ -20,7 +20,7 @@ export default {
}) })
}, },
/** 素材发送/阅读埋点 */ /** 素材发送/阅读埋点 */
sendReadBuriedPoint(params) { sendReadBuriedPoint (params) {
let data = { let data = {
method: 'marketing.api.open.material.sendReadBuriedPoint', method: 'marketing.api.open.material.sendReadBuriedPoint',
list: [params] list: [params]
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
}) })
}, },
uploadMaterial(data = {}) { uploadMaterial (data = {}) {
data.method = 'marketing.api.material.sop.upload' data.method = 'marketing.api.material.sop.upload'
return window.$HTTP({ return window.$HTTP({
url, url,
...@@ -39,11 +39,30 @@ export default { ...@@ -39,11 +39,30 @@ export default {
}) })
}, },
getTextDetail(data = {}) { getTextDetail (data = {}) {
data.method = 'marketing.api.material.detail' data.method = 'marketing.api.material.detail'
return window.$HTTP({ return window.$HTTP({
url, url,
data data
}) })
} },
/** 查询话术组列表 */
getChatGroupList (data = {}) {
data.method = 'marketing.api.scriptlibrary.group.list'
data.state = 0
return window.$HTTP({
url,
data
})
},
/**查询话术库列表 */
getChatLibraryList (data = {}) {
data.method = 'marketing.api.scriptlibrary.page'
data.state = 0
return window.$HTTP({
url,
data
})
},
} }
...@@ -44,7 +44,9 @@ const WxConfig = { ...@@ -44,7 +44,9 @@ const WxConfig = {
}) })
}, 500) }, 500)
} else { } else {
Notify('网络异常') let err_msg = '注册config失败'
Notify(err_msg)
reject(err_msg)
} }
}) })
}) })
......
...@@ -10,6 +10,10 @@ body .app { ...@@ -10,6 +10,10 @@ body .app {
height: 100%; height: 100%;
// overflow: hidden; // overflow: hidden;
--themeColor: #3975C6; --themeColor: #3975C6;
/* 兼容 IOS<11.2 先constant再env */
--constantSafeAreaInsetBottom: constant(safe-area-inset-bottom);
/* 兼容 IOS>11.2 */
--envSafeAreaInsetBottom: env(safe-area-inset-bottom);
} }
img { img {
......
<template>
<van-popup
v-model="show"
position="bottom"
class="date-popup"
round
@close="close"
>
<div class="date-title flex">
时间选择
<i
class="van-icon van-icon-cross van-popup__close-icon van-popup__close-icon--top-right"
@click="close"
></i>
</div>
<div class="date-box">
<div class="date-subtitle">推送日期</div>
<div class="date-list flex">
<template v-for="(i,index) in dateList">
<div
:key="index"
:class="['item flex',{'active':index == dateIndex}]"
@click="chooseDate(index)"
>
{{ i }}
</div>
</template>
</div>
<div class="date-subtitle">自定义</div>
<van-calendar
ref="calendar"
class="calendar"
:poppable="false"
:show-confirm="false"
:show-title="false"
:show-subtitle="false"
type="range"
color="#3975C6"
:min-date="minDate"
:max-date="maxDate"
:allow-same-day="true"
:lazy-render="false"
row-height="48px"
@confirm="confirmCalendar"
/>
<van-button
block
round
color="#3975C6"
class="date-btn"
:disabled="!dateValue.startTime && !dateValue.endTime"
@click="confirmDate"
>确定</van-button>
</div>
</van-popup>
</template>
<script type='text/ecmascript-6'>
import * as dayjs from 'dayjs'
export default {
name: 'DatePopup',
props: {
value: Boolean
},
data () {
return {
show: false,
dateList: ['上月', '近三月', '近一年'],
dateValue: {
startTime: '',
endTime: ''
},
dateIndex: -1,
minDate: new Date('2023/01/01'),
maxDate: new Date(),
}
},
watch: {
value (n) {
this.show = n
}
},
mounted () {
},
methods: {
chooseDate (index) {
const monthNumber = {
0: 1,
1: 3,
2: 12
}[index]
let startTime = dayjs().subtract(monthNumber, 'month'),
endTime = dayjs()
if (index == 0) {
startTime = startTime.startOf('M')
endTime = dayjs(startTime).endOf('month')
}
this.dateIndex = index
this.setDateValue([startTime, endTime])
this.$refs.calendar.reset()
},
confirmCalendar (val) {
this.dateIndex = -1
this.setDateValue(val)
},
setDateValue ([startTime, endTime]) {
this.dateValue = {
startTime: `${dayjs(startTime).format('YYYY-MM-DD')} 00:00:00`,
endTime: `${dayjs(endTime).format('YYYY-MM-DD')} 23:59:59`
}
console.log(JSON.parse(JSON.stringify(this.dateValue)))
},
close () {
this.$emit('update:value', false)
},
confirmDate () {
let { dateValue } = this
this.$emit('confirm', dateValue)
this.close()
}
}
}
</script>
<style scoped lang='scss'>
.date-popup {
max-height: 95%;
/deep/.van-popup__close-icon {
z-index: 3;
margin-left: auto;
position: static;
}
/deep/.van-calendar__day {
font-size: 14px;
}
/deep/.van-calendar__month-title {
height: 32px;
line-height: 32px;
}
/deep/.van-calendar__bottom-info {
font-size: 8px;
bottom: 2px;
}
.date-title {
height: 44px;
padding: 0 16px;
font-weight: 500;
font-size: 16px;
color: #222222;
position: sticky;
background-color: #fff;
z-index: 2;
top: 0;
}
.date-box {
padding: 16px 16px calc(var(--constantSafeAreaInsetBottom) + 76px);
padding: 16px 16px calc(var(--envSafeAreaInsetBottom) + 76px);
.date-subtitle {
font-size: 14px;
color: #333333;
margin-bottom: 8px;
}
.date-list {
margin-bottom: 16px;
gap: 8px;
.item {
width: 80px;
height: 28px;
border: 1px solid #dadde0;
border-radius: 14px;
font-size: 14px;
color: #333333;
justify-content: center;
}
.active {
color: #3975c6;
background: #3975c61a;
border-color: #3975c61a;
}
}
.calendar {
height: 320px;
}
}
.date-btn {
position: fixed;
left: 16px;
bottom: calc(var(--constantSafeAreaInsetBottom) + 16px);
bottom: calc(var(--envSafeAreaInsetBottom) + 16px);
z-index: 2;
width: calc(100% - 32px);
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
.nothing { .nothing {
display: flex; display: flex;
padding-top: 103px; padding: 103px 0;
flex-direction: column; flex-direction: column;
font-size: 12px; font-size: 12px;
color: #666666; color: #666666;
......
<template> <template>
<div :class="['scroll-view', ScrollViewclass]"> <van-pull-refresh
v-model="refreshing"
@refresh="onRefresh"
:disabled="disabledRefresh"
:class="['scroll-view', ScrollViewclass]"
>
<van-list <van-list
v-model="loading" v-model="loading"
:finished="finished" :finished="finished"
...@@ -10,7 +15,7 @@ ...@@ -10,7 +15,7 @@
> >
<slot></slot> <slot></slot>
</van-list> </van-list>
</div> </van-pull-refresh>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
...@@ -20,15 +25,25 @@ export default { ...@@ -20,15 +25,25 @@ export default {
return { return {
loading: false, loading: false,
finished: false, finished: false,
refreshing: false
} }
}, },
props: ['ScrollViewclass'], props: {
ScrollViewclass: String,
disabledRefresh: {
type: Boolean,
default: true
},
},
mounted () { mounted () {
}, },
methods: { methods: {
onLoad () { onLoad () {
this.$emit('ReachBottom') this.$emit('ReachBottom')
}, },
onRefresh () {
this.$emit('onRefresh')
}
} }
} }
</script> </script>
...@@ -37,5 +52,8 @@ export default { ...@@ -37,5 +52,8 @@ export default {
.scroll-view { .scroll-view {
overflow-y: scroll; overflow-y: scroll;
box-sizing: border-box; box-sizing: border-box;
.test {
height: 100%;
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<form :class="['search-box','flex',{'max':!showDropdown}]" action=""> <form
:class="['search-box','flex',{'max':!showDropdown}]"
action=""
>
<van-search <van-search
ref="search"
v-model="searchValue" v-model="searchValue"
:placeholder="placeholder" :placeholder="placeholder"
@search="onEmit($event,'search')" @search="onEmit($event,'search')"
@clear="onEmit('','search')" @clear="clear"
@focus="onEmit('','focus')" @focus="onEmit('','focus')"
:maxlength="maxlength" :maxlength="maxlength"
/> />
...@@ -81,6 +85,11 @@ export default { ...@@ -81,6 +85,11 @@ export default {
} }
}, },
methods: { methods: {
clear () {
let [input] = document.getElementsByClassName('van-field__control')
input.blur()
this.onEmit('', 'search')
},
onEmit (e, name) { onEmit (e, name) {
this.$emit(name, e) this.$emit(name, e)
} }
......
...@@ -7,11 +7,12 @@ ...@@ -7,11 +7,12 @@
title-active-color="#2c2c2c" title-active-color="#2c2c2c"
@click="click" @click="click"
:key="updata" :key="updata"
v-bind="$attrs"
> >
<template v-for="(i,index) in data"> <template v-for="(i,index) in data">
<van-tab <van-tab
:key="index" :key="index"
:title-class="titleClass"
> >
<template #title> <template #title>
{{i}} {{i}}
...@@ -40,7 +41,8 @@ export default { ...@@ -40,7 +41,8 @@ export default {
updata: { updata: {
type: Number, type: Number,
default: new Date().getTime() default: new Date().getTime()
} },
titleClass: String
}, },
data () { data () {
return { return {
...@@ -57,6 +59,7 @@ export default { ...@@ -57,6 +59,7 @@ export default {
} }
}, },
mounted () { mounted () {
this.data = this.list || []
}, },
methods: { methods: {
click (tabIndex) { click (tabIndex) {
...@@ -83,6 +86,9 @@ export default { ...@@ -83,6 +86,9 @@ export default {
transition: all 0.25s; transition: all 0.25s;
} }
.van-tab--active { .van-tab--active {
font-size: 16px !important; .van-tab__text {
transform: scale(1.14) !important;
transform-origin: center;
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -11,7 +11,7 @@ module.exports = { ...@@ -11,7 +11,7 @@ module.exports = {
title: '嘀加企微助手', title: '嘀加企微助手',
envVersion: 'trial', envVersion: 'trial',
request: { request: {
baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址, baseURL: '//scrm.test.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
......
...@@ -7,21 +7,21 @@ ...@@ -7,21 +7,21 @@
* @LastEditTime: 2021-06-30 11:23:25 * @LastEditTime: 2021-06-30 11:23:25
*/ */
// 根据环境引入不同配置 process.env.VUE_APP_ENV // 根据环境引入不同配置 process.env.VUE_APP_ENV
import { utils, Http } from 'glsx-common'
let config = require('./conf.js') let config = require('./conf.js')
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) { export const fetchConfig = function (isEnv = true) {
if (isEnv) { if (isEnv) {
let { request } = config let { request } = config
Object.assign(request, { timeout }) Object.assign(request, { timeout })
return Promise.resolve(config) return Promise.resolve(config)
} }
/**测试mock */ return new Http().get('https://oss-config.test.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-psd-config')
// let params = { moduleName: 'scrm-wx-work-psd-config', mockUrl: 'https://oss-config.test.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-psd-config', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
// return window.fetch('https://oss-config.dev.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-psd-config', {}).then(res => res.json()) // return utils.getConfig(params)
/**生产mock */ return window.fetch('https://oss-config.test.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-psd-config', {}).then(res => res.json())
} }
export const cfg = { export const cfg = {
install(vue, config) { install (vue, config) {
vue.prototype.$config = config vue.prototype.$config = config
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -37,7 +37,7 @@ Vue.prototype.to = function (name, params) { ...@@ -37,7 +37,7 @@ Vue.prototype.to = function (name, params) {
// import 'lib-flexible/flexible.js' // import 'lib-flexible/flexible.js'
import VConsole from 'vconsole' import VConsole from 'vconsole'
const isMock = ['prod','production'].includes(process.env.NODE_ENV) const isMock = ['prod', 'production'].includes(process.env.NODE_ENV)
fetchConfig(!isMock).then(res => { fetchConfig(!isMock).then(res => {
// 从配置服务器获取动态配置 // 从配置服务器获取动态配置
// 设置 js中可以访问 $cdn // 设置 js中可以访问 $cdn
...@@ -47,7 +47,8 @@ fetchConfig(!isMock).then(res => { ...@@ -47,7 +47,8 @@ fetchConfig(!isMock).then(res => {
/**登录过期 重新登录 */ /**登录过期 重新登录 */
window.reLogin = () => { window.reLogin = () => {
console.log('重新登录') const [url] = window.location.href.split('?')
history.replaceState(null, null, url)
util.clearSessionId() util.clearSessionId()
store.dispatch('navigation') store.dispatch('navigation')
} }
......
...@@ -14,6 +14,20 @@ const pages = { ...@@ -14,6 +14,20 @@ const pages = {
noAuth: true noAuth: true
} }
} }
],
Chat: [
{
name: 'library',
meta: {
title: '话术库'
}
},
{
name: 'paper',
meta: {
title: '喜报早报记录'
}
}
] ]
} }
let routes = [ let routes = [
......
<template>
<div class="layout">
<div class="sticky">
<search-box
@search="search"
placeholder="输入关键词搜索"
:showDropdown="false"
></search-box>
<template v-if="groupList.length">
<tab
:list="groupList"
@change="change"
>
</tab>
</template>
</div>
<template v-if="flag">
<template v-if="list.length">
<scroll-view
class="list-box"
@ReachBottom="onReachBottom"
ref="scrollView"
>
<div class="box">
<template v-for="(i,index) in list">
<div
class="item"
:key="index"
>
<div
v-html="decodeURIComponent(i.text)"
:class="['content',{'line-clamp':i.moreState}]"
></div>
<div class="chat-btns flex">
<template v-if="i.moreBtn">
<div
class="more"
@click="i.moreState = !i.moreState"
>{{ i.moreState ? '展开' :'收起' }}</div>
</template>
<van-button
class="send"
block
round
color="#3975C6"
:disabled="sendChatMessageDisabled"
@click="sendChatMessage(i.scriptContent)"
>发送</van-button>
</div>
</div>
</template>
</div>
</scroll-view>
</template>
<template v-else>
<nothing
class="nothing-box"
image="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/list-nothing.png"
>暂无可用话术</nothing>
</template>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
import { Notify } from 'vant'
import { wxConfig, marketingApi } from '@/api'
export default {
name: 'library',
data () {
return {
groupList: [],
flag: false,
list: [],
pageNum: 1,
sendChatMessageDisabled: false,//发送按钮权限
params: {
scriptGroup: '',
scriptContent: '',
pageNum: 1,
pageSize: 10
},
total: 0
}
},
async mounted () {
try {
await wxConfig.init(['sendChatMessage'])
} catch (error) {
this.sendChatMessageDisabled = true
}
this.getChatGroupList()
this.getChatLibraryList()
},
methods: {
/**发送 */
sendChatMessage (content) {
this.showLoading()
wxConfig
.sendChatMessage({
msgtype: 'text', //消息类型,必填
enterChat: true, //为true时表示发送完成之后顺便进入会话,仅移动端3.1.10及以上版本支持该字段
text: {
content
},
})
.then(res => {
this.hideLoading()
}).catch(err => {
console.log()
if (!err?.err_Info?.startsWith('cancel')) Notify(String(err))
this.hideLoading()
})
},
/**清空 */
clearData () {
this.list = []
this.flag = false
this.params.pageNum = 1
this.getChatLibraryList()
},
/**搜索 */
search (val) {
this.params.scriptContent = val
this.clearData()
},
/**切换tab */
change (index) {
const { groupList, params: { scriptGroup } } = this
if (scriptGroup == groupList[index] || (index == 0 && scriptGroup == '')) return
this.params.scriptGroup = index == 0 ? '' : groupList[index]
this.clearData()
},
/**话术组 */
async getChatGroupList () {
let res = await marketingApi.getChatGroupList() || [],
maxLength = 10
if (res.length > maxLength) res = res.splice(0, maxLength)
this.groupList = ['全部', ...res]
},
/**话术 */
async getChatLibraryList () {
this.showLoading()
try {
const { params, list } = this,
{ data, count } = await marketingApi.getChatLibraryList(params),
val = params.scriptContent || '',
rex = new RegExp(val, 'g')
data.length && data.map(e => {
let txt = e.scriptContent
if (e.scriptContent.length * 12 >= 1248) {
e.moreBtn = true
e.moreState = true
}
if (val) txt = txt.replace(rex, `<span>${val}</span>`)
e.text = encodeURIComponent(txt)
})
this.list = list.concat(data)
this.total = count
this.hideLoading()
} catch (error) {
this.hideLoading()
}
this.flag = true
},
/**触底分页加载 */
onReachBottom () {
let { total, params: { pageNum }, list, $refs: {
scrollView
} } = this
scrollView.loading = false
if (list.length == total) {
return scrollView.finished = true
}
if (Math.ceil(total / 10) > pageNum) {
this.params.pageNum = pageNum + 1
this.getChatLibraryList()
} else scrollView.finished = true
},
}
}
</script>
<style scoped lang='scss'>
.layout {
.list-box {
height: calc(100vh - 100px);
box-sizing: border-box;
.item {
background: #ffffff;
box-shadow: 0 2px 8px 0 #ced1de66, 0 2px 4px 0 #ced1de1f;
border-radius: 4px;
margin-bottom: 12px;
font-size: 12px;
color: #666666;
word-break: break-all;
position: relative;
.content {
padding: 14px 10px 0;
line-height: 20px;
/deep/span {
color: #3582ee;
}
}
.line-clamp {
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 4;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.chat-btns {
height: 36px;
padding: 0 16px;
border-top: 1px solid rgba(195, 195, 195, 0.3);
margin-top: 13px;
.more {
color: #999999;
}
.van-button--block {
width: 60px;
height: 24px;
font-weight: 500;
font-size: 12px;
color: #ffffff;
margin-left: auto;
box-shadow: 0 2px 6px 2px #3975c61c;
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="layout">
<div class="sticky">
<div class="search">
<search-box
@search="search"
:showDropdown="false"
placeholder="输入4S店/群聊名称搜索"
></search-box>
<div
class="date-menu flex"
@click="showDatePopup = true"
>
<!-- <template v-if="params.startTime && params.endTime">
{{ params.startTime }} - {{ params.endTime }}
</template>
<template v-else> -->
自定义
<!-- </template> -->
</div>
</div>
<tab
:list="tabList"
@change="change"
title-class="tab-item"
:ellipsis="false"
>
</tab>
</div>
<template v-if="flag">
<template v-if="list.length">
<scroll-view
class="list-box"
@ReachBottom="onReachBottom"
ref="scrollView"
:disabledRefresh="false"
@onRefresh="clearData"
>
<div class="box">
<template v-for="(i,index) in list">
<div
class="item"
:key="index"
>
<div class="title flex">{{ i.merchantName }}</div>
<div class="content">
<template v-for="(item,ind) in contentItem">
<div
class="content-item"
:key="ind"
>
<div class="label">{{item.label}}:</div>
<div class="value">
<template v-if="item.format">
{{ item.format(i[item.key]) }}
</template>
<template v-else>
{{ i[item.key] }}
</template>
</div>
</div>
</template>
</div>
<div class="bottom flex">
推送类型:<span>{{ {
1:'早报',
2:'SA个人喜报',
3:'SA喜报',
4:'收款喜报',
}[i.pushType] }}</span>
<van-button
block
round
color="#3975C6"
class="bottom-btn"
@click="handleViewImage(i.fileUrl)"
>查看</van-button>
</div>
</div>
</template>
</div>
</scroll-view>
</template>
<template v-else>
<nothing
class="nothing-box"
image="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/list-nothing.png"
>暂无数据-</nothing>
</template>
</template>
<date-popup
:value.sync="showDatePopup"
@confirm="confirmDate"
></date-popup>
<van-overlay
:show="showImagePreview"
@click="showImagePreview = false"
z-index="99"
:lock-scroll="false"
>
<div class="image-wrapper">
<div
class="image-close"
@click="showImagePreview = false"
>
<img src="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/close.png">
</div>
<div
class="image-box"
@click.stop
>
<img :src="imageUrl" />
</div>
<div
class="image-tips flex"
@click.stop
>
<img src="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/longtap.png">
长按图片保存
</div>
</div>
</van-overlay>
</div>
</template>
<script type='text/ecmascript-6'>
import { entmicroApi } from '@/api'
import * as dayjs from 'dayjs'
export default {
name: 'paper',
data () {
return {
tabList: ['全部', '早报', 'SA个人喜报', 'SA喜报', '收款喜报'],
contentItem: [
{
label: '推送时间',
key: 'pushTime',
format: val => dayjs(val).format('YYYY-MM-DD HH:mm:ss')
},
{
label: '所属园区',
key: 'parkStoreName'
},
{
label: '推送群聊',
key: 'groupChatName'
}
],
showDatePopup: false,
list: [],
flag: false,
params: {
startTime: '',
endTime: '',
pushType: '',//早报(即战报)=1 SA个人喜报 = 2 SA喜 =3 收款喜报 = 4
searchName: '',
pageNum: 1,
pageSize: 10
},
total: 0,
showImagePreview: false,
imageUrl: ''
}
},
mounted () {
this.getActivityReportLogList()
},
methods: {
async getActivityReportLogList () {
this.showLoading()
try {
const { params, list } = this,
{ data, count } = await entmicroApi.getActivityReportLogList(params)
this.list = list.concat(data)
this.total = count
this.hideLoading()
} catch (error) {
this.hideLoading()
}
this.flag = true
},
handleViewImage (e) {
this.imageUrl = e
this.$nextTick(() => {
this.showImagePreview = true
})
},
clearData () {
this.list = []
this.flag = false
this.params.pageNum = 1
this.getActivityReportLogList()
},
search (val) {
this.params.searchName = val
this.clearData()
},
change (index) {
const {pushType} = this.params
if (pushType == index || (pushType == '' && index == 0)) return
this.params.pushType = index == 0 ? '' : index
this.clearData()
},
confirmDate (e) {
let { params } = this
this.params = {
...params,
...e
}
this.clearData()
},
/**触底分页加载 */
onReachBottom () {
let { total, params: { pageNum }, list, $refs: {
scrollView
} } = this
scrollView.loading = false
if (list.length == total) {
return scrollView.finished = true
}
if (Math.ceil(total / 10) > pageNum) {
this.params.pageNum = pageNum + 1
this.getActivityReportLogList()
} else scrollView.finished = true
},
}
}
</script>
<style scoped lang='scss'>
.search {
display: flex;
background-color: #fff;
.search-box {
flex: 1;
transition: all 1s;
}
/deep/.tab-item {
font-size: 14px;
color: #666666;
}
.date-menu {
flex-shrink: 0;
font-size: 12px;
color: #333333;
padding-right: 16px;
&::after {
border: 4px solid transparent;
border-top-color: #333;
content: '';
display: block;
transform: translateY(2px);
margin-left: 4px;
border-radius: 1px;
}
}
}
/deep/.van-search {
padding: 9px 16px;
}
.list-box {
height: calc(100vh - 100px);
box-sizing: border-box;
padding: 10px 16px;
.item {
margin-bottom: 10px;
background: #ffffff;
box-shadow: 0 4px 8px 0 #e0e0e080;
border-radius: 4px;
.title {
font-weight: 500;
font-size: 14px;
color: #282829;
padding: 0 16px;
height: 39px;
}
.content {
padding: 12px 16px;
border-top: 1px solid rgba(194, 194, 194, 0.3);
border-bottom: 1px solid rgba(194, 194, 194, 0.3);
font-size: 12px;
color: #999999;
&-item {
margin-bottom: 8px;
display: flex;
.label {
flex-shrink: 0;
}
.value {
line-height: 16px;
flex: 1;
}
&:last-of-type {
margin-bottom: 0;
}
}
}
.bottom {
font-size: 12px;
color: #999999;
height: 36px;
padding: 0 16px;
span {
color: #3975c6;
}
&-btn {
margin-left: auto;
width: 60px;
height: 24px;
font-weight: 500;
font-size: 12px;
box-shadow: 0 2px 6px 2px #3975c61c;
span {
color: #fff;
}
}
}
}
}
.nothing-box {
height: calc(100vh - 99px);
}
.image-wrapper {
user-select: none;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.image-close {
position: absolute;
width: 28px;
height: 28px;
right: 0;
top: -44px;
}
.image-box {
width: 279px;
height: 400px;
// max-height: 454px;
background: #ffffff;
border-radius: 6px 6px 0 0;
padding: 16px;
box-sizing: border-box;
overflow-y: scroll;
img {
height: auto;
// object-fit: contain;
}
}
.image-tips {
width: 279px;
height: 45px;
background: #f7f8fa;
border-radius: 0 0 6px 6px;
justify-content: center;
font-weight: 500;
font-size: 16px;
color: #3975c6;
transform: translateY(-1px);
img {
margin-right: 6px;
width: 20px;
height: 20px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.layout { .layout {
background-color: #fff; background-color: #fff;
} }
......
...@@ -5,7 +5,7 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl ...@@ -5,7 +5,7 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl
const resolve = dir => path.join(__dirname, dir) const resolve = dir => path.join(__dirname, dir)
// page title // page title
const name = defaultSettings.title || 'vue mobile template' const name = defaultSettings.title || ''
// 生产环境,测试和正式 // 生产环境,测试和正式
const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV) const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
// externals // externals
...@@ -59,7 +59,7 @@ module.exports = { ...@@ -59,7 +59,7 @@ module.exports = {
productionSourceMap: false, // 如果不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 productionSourceMap: false, // 如果不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
devServer: { devServer: {
disableHostCheck: true, disableHostCheck: true,
port: 9527, // 端口 port: 9528, // 端口
open: false, // 启动后打开浏览器 open: false, // 启动后打开浏览器
public:'http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main-lwk/#/', public:'http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main-lwk/#/',
overlay: { overlay: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!