Commit 0807eec2 by 前端

Merge branch 'v3.12.0' into 'master'

V3.12.0

See merge request !20
2 parents d69abfc1 00af0ff2
<template>
<van-overlay
:show="show"
@click="$emit('update:value', false)"
z-index="99"
:lock-scroll="false"
>
<div class="image-wrapper">
<div
class="image-close"
@click="$emit('update:value', false)"
>
<img src="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/close.png">
</div>
<template v-if="data.text && data.pushType == 5">
<div
class="text-box"
@click.stop
>
<div class="text-title flex">文字喜报</div>
<div
class="content"
v-html="data.text"
ref="textBox"
>
</div>
<van-button
block
round
color="#3975C6"
class="btn"
@click="$emit('update:value', false)"
>确定</van-button>
</div>
</template>
<template v-else>
<div
class="image-box"
@click.stop
>
<img :src="data.fileUrl" />
</div>
<div
class="image-tips flex"
@click.stop
>
<img src="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/longtap.png">
长按图片保存
</div>
</template>
</div>
</van-overlay>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'PaperDialog',
props: {
value: Boolean,
data: Object
},
data () {
return {
show: false
}
},
watch: {
value (n) {
this.show = n
if (n && this.data.pushType == 5) this.$nextTick(() => {
this.$refs.textBox.scrollTop = 0
})
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.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;
}
}
.text-box {
background-color: #fff;
width: 279px;
max-height: 457px;
background: #ffffff;
border-radius: 6px;
box-sizing: border-box;
padding-bottom: 20px;
.text-title {
font-weight: 500;
font-size: 16px;
color: #282829;
height: 52px;
justify-content: center;
border-bottom: 1px solid rgba(195, 195, 195, 0.3);
}
.content {
user-select: text;
padding: 16px;
box-sizing: border-box;
max-height: 320px;
overflow-y: scroll;
font-size: 14px;
line-height: 24px;
color: #666666ff;
word-break: break-all;
white-space: pre-wrap;
}
.btn {
width: 247px !important;
margin: 24px auto 0;
height: 40px;
background: #3975c6;
border-radius: 21px;
font-weight: 600;
font-size: 16px;
letter-spacing: 1px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -16,9 +16,9 @@ export const fetchConfig = function (isEnv = true) { ...@@ -16,9 +16,9 @@ export const fetchConfig = function (isEnv = true) {
Object.assign(request, { timeout }) Object.assign(request, { timeout })
return Promise.resolve(config) return Promise.resolve(config)
} }
return new Http().get('https://oss-config.test.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-psd-config') // 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 } } } 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 utils.getConfig(params) return utils.getConfig(params)
} }
export const cfg = { export const cfg = {
install (vue, config) { install (vue, config) {
......
...@@ -141,10 +141,12 @@ export default { ...@@ -141,10 +141,12 @@ export default {
}, },
/**话术 */ /**话术 */
async getChatLibraryList () { async getChatLibraryList () {
const { params, list, $refs: {
scrollView
} } = this
this.showLoading() this.showLoading()
try { try {
const { params, list } = this, const { data, count } = await marketingApi.getChatLibraryList(params),
{ data, count } = await marketingApi.getChatLibraryList(params),
val = params.scriptContent || '', val = params.scriptContent || '',
rex = new RegExp(val, 'g') rex = new RegExp(val, 'g')
data.length && data.map(e => { data.length && data.map(e => {
...@@ -162,6 +164,7 @@ export default { ...@@ -162,6 +164,7 @@ export default {
} catch (error) { } catch (error) {
this.hideLoading() this.hideLoading()
} }
if (scrollView) scrollView.loading = false
this.flag = true this.flag = true
}, },
/**触底分页加载 */ /**触底分页加载 */
...@@ -169,14 +172,17 @@ export default { ...@@ -169,14 +172,17 @@ export default {
let { total, params: { pageNum }, list, $refs: { let { total, params: { pageNum }, list, $refs: {
scrollView scrollView
} } = this } } = this
scrollView.loading = false scrollView.loading = true
if (list.length == total) { if (list.length == total) {
return scrollView.finished = true return scrollView.finished = true
} }
if (Math.ceil(total / 10) > pageNum) { if (Math.ceil(total / 10) > pageNum) {
this.params.pageNum = pageNum + 1 this.params.pageNum = pageNum + 1
this.getChatLibraryList() this.getChatLibraryList()
} else scrollView.finished = true } else {
scrollView.finished = true
scrollView.loading = false
}
}, },
} }
} }
......
...@@ -28,14 +28,14 @@ ...@@ -28,14 +28,14 @@
</tab> </tab>
</div> </div>
<template v-if="flag"> <template v-if="flag">
<template v-if="list.length"> <scroll-view
<scroll-view class="list-box"
class="list-box" @ReachBottom="onReachBottom"
@ReachBottom="onReachBottom" ref="scrollView"
ref="scrollView" :disabledRefresh="false"
:disabledRefresh="false" @onRefresh="clearData"
@onRefresh="clearData" >
> <template v-if="list.length">
<div class="box"> <div class="box">
<template v-for="(i,index) in list"> <template v-for="(i,index) in list">
<div <div
...@@ -62,64 +62,35 @@ ...@@ -62,64 +62,35 @@
</template> </template>
</div> </div>
<div class="bottom flex"> <div class="bottom flex">
推送类型:<span>{{ { 推送类型:<span>{{ tabList[i.pushType] }}</span>
1:'早报',
2:'SA个人喜报',
3:'SA喜报',
4:'收款喜报',
}[i.pushType] }}</span>
<van-button <van-button
block block
round round
color="#3975C6" color="#3975C6"
class="bottom-btn" class="bottom-btn"
@click="handleViewImage(i.fileUrl)" @click="handleViewImage(i)"
>查看</van-button> >查看</van-button>
</div> </div>
</div> </div>
</template> </template>
</div> </div>
</scroll-view> </template>
</template> <template v-else>
<template v-else> <nothing
<nothing class="nothing-box"
class="nothing-box" image="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/list-nothing.png"
image="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/list-nothing.png" >暂无数据-</nothing>
>暂无数据-</nothing> </template>
</template> </scroll-view>
</template> </template>
<date-popup <date-popup
:value.sync="showDatePopup" :value.sync="showDatePopup"
@confirm="confirmDate" @confirm="confirmDate"
></date-popup> ></date-popup>
<van-overlay <paper-dialog
:show="showImagePreview" :value.sync="showImagePreview"
@click="showImagePreview = false" :data="paperInfo"
z-index="99" ></paper-dialog>
: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> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
...@@ -129,7 +100,7 @@ export default { ...@@ -129,7 +100,7 @@ export default {
name: 'paper', name: 'paper',
data () { data () {
return { return {
tabList: ['全部', '早报', 'SA个人喜报', 'SA喜报', '收款喜报'], tabList: ['全部', '早报', 'SA个人喜报', 'SA喜报', '收款喜报', '文字喜报'],
contentItem: [ contentItem: [
{ {
label: '推送时间', label: '推送时间',
...@@ -151,14 +122,14 @@ export default { ...@@ -151,14 +122,14 @@ export default {
params: { params: {
startTime: '', startTime: '',
endTime: '', endTime: '',
pushType: '',//早报(即战报)=1 SA个人喜报 = 2 SA喜 =3 收款喜报 = 4 pushType: '',//早报(即战报)=1 SA个人喜报 = 2 SA喜 =3 收款喜报 = 4 文字喜报 = 5
searchName: '', searchName: '',
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
total: 0, total: 0,
showImagePreview: false, showImagePreview: false,
imageUrl: '' paperInfo: {}
} }
}, },
mounted () { mounted () {
...@@ -166,10 +137,12 @@ export default { ...@@ -166,10 +137,12 @@ export default {
}, },
methods: { methods: {
async getActivityReportLogList () { async getActivityReportLogList () {
const { params, list, $refs: {
scrollView
} } = this
this.showLoading() this.showLoading()
try { try {
const { params, list } = this, const { data, count } = await entmicroApi.getActivityReportLogList(params)
{ data, count } = await entmicroApi.getActivityReportLogList(params)
this.list = list.concat(data) this.list = list.concat(data)
this.total = count this.total = count
this.hideLoading() this.hideLoading()
...@@ -177,9 +150,10 @@ export default { ...@@ -177,9 +150,10 @@ export default {
this.hideLoading() this.hideLoading()
} }
this.flag = true this.flag = true
if (scrollView) scrollView.loading = false
}, },
handleViewImage (e) { handleViewImage (i) {
this.imageUrl = e this.paperInfo = i
this.$nextTick(() => { this.$nextTick(() => {
this.showImagePreview = true this.showImagePreview = true
}) })
...@@ -196,7 +170,7 @@ export default { ...@@ -196,7 +170,7 @@ export default {
this.clearData() this.clearData()
}, },
change (index) { change (index) {
const {pushType} = this.params const { pushType } = this.params
if (pushType == index || (pushType == '' && index == 0)) return if (pushType == index || (pushType == '' && index == 0)) return
this.params.pushType = index == 0 ? '' : index this.params.pushType = index == 0 ? '' : index
this.clearData() this.clearData()
...@@ -214,14 +188,17 @@ export default { ...@@ -214,14 +188,17 @@ export default {
let { total, params: { pageNum }, list, $refs: { let { total, params: { pageNum }, list, $refs: {
scrollView scrollView
} } = this } } = this
scrollView.loading = false scrollView.loading = true
if (list.length == total) { if (list.length == total) {
return scrollView.finished = true return scrollView.finished = true
} }
if (Math.ceil(total / 10) > pageNum) { if (Math.ceil(total / 10) > pageNum) {
this.params.pageNum = pageNum + 1 this.params.pageNum = pageNum + 1
this.getActivityReportLogList() this.getActivityReportLogList()
} else scrollView.finished = true } else {
scrollView.finished = true
scrollView.loading = false
}
}, },
} }
...@@ -319,51 +296,8 @@ export default { ...@@ -319,51 +296,8 @@ export default {
} }
} }
.nothing-box { .nothing-box {
height: calc(100vh - 99px); height: calc(100vh - 110px);
} width: 100vw;
transform: translate(-16px, -10px);
.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> </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!