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
......@@ -16,9 +16,9 @@ export const fetchConfig = function (isEnv = true) {
Object.assign(request, { timeout })
return Promise.resolve(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 } } }
// return utils.getConfig(params)
// 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 utils.getConfig(params)
}
export const cfg = {
install (vue, config) {
......
......@@ -141,10 +141,12 @@ export default {
},
/**话术 */
async getChatLibraryList () {
const { params, list, $refs: {
scrollView
} } = this
this.showLoading()
try {
const { params, list } = this,
{ data, count } = await marketingApi.getChatLibraryList(params),
const { data, count } = await marketingApi.getChatLibraryList(params),
val = params.scriptContent || '',
rex = new RegExp(val, 'g')
data.length && data.map(e => {
......@@ -162,6 +164,7 @@ export default {
} catch (error) {
this.hideLoading()
}
if (scrollView) scrollView.loading = false
this.flag = true
},
/**触底分页加载 */
......@@ -169,14 +172,17 @@ export default {
let { total, params: { pageNum }, list, $refs: {
scrollView
} } = this
scrollView.loading = false
scrollView.loading = true
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
} else {
scrollView.finished = true
scrollView.loading = false
}
},
}
}
......
......@@ -28,14 +28,14 @@
</tab>
</div>
<template v-if="flag">
<template v-if="list.length">
<scroll-view
class="list-box"
@ReachBottom="onReachBottom"
ref="scrollView"
:disabledRefresh="false"
@onRefresh="clearData"
>
<scroll-view
class="list-box"
@ReachBottom="onReachBottom"
ref="scrollView"
:disabledRefresh="false"
@onRefresh="clearData"
>
<template v-if="list.length">
<div class="box">
<template v-for="(i,index) in list">
<div
......@@ -62,64 +62,35 @@
</template>
</div>
<div class="bottom flex">
推送类型:<span>{{ {
1:'早报',
2:'SA个人喜报',
3:'SA喜报',
4:'收款喜报',
}[i.pushType] }}</span>
推送类型:<span>{{ tabList[i.pushType] }}</span>
<van-button
block
round
color="#3975C6"
class="bottom-btn"
@click="handleViewImage(i.fileUrl)"
@click="handleViewImage(i)"
>查看</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>
<template v-else>
<nothing
class="nothing-box"
image="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/list-nothing.png"
>暂无数据-</nothing>
</template>
</scroll-view>
</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>
<paper-dialog
:value.sync="showImagePreview"
:data="paperInfo"
></paper-dialog>
</div>
</template>
<script type='text/ecmascript-6'>
......@@ -129,7 +100,7 @@ export default {
name: 'paper',
data () {
return {
tabList: ['全部', '早报', 'SA个人喜报', 'SA喜报', '收款喜报'],
tabList: ['全部', '早报', 'SA个人喜报', 'SA喜报', '收款喜报', '文字喜报'],
contentItem: [
{
label: '推送时间',
......@@ -151,14 +122,14 @@ export default {
params: {
startTime: '',
endTime: '',
pushType: '',//早报(即战报)=1 SA个人喜报 = 2 SA喜 =3 收款喜报 = 4
pushType: '',//早报(即战报)=1 SA个人喜报 = 2 SA喜 =3 收款喜报 = 4 文字喜报 = 5
searchName: '',
pageNum: 1,
pageSize: 10
},
total: 0,
showImagePreview: false,
imageUrl: ''
paperInfo: {}
}
},
mounted () {
......@@ -166,10 +137,12 @@ export default {
},
methods: {
async getActivityReportLogList () {
const { params, list, $refs: {
scrollView
} } = this
this.showLoading()
try {
const { params, list } = this,
{ data, count } = await entmicroApi.getActivityReportLogList(params)
const { data, count } = await entmicroApi.getActivityReportLogList(params)
this.list = list.concat(data)
this.total = count
this.hideLoading()
......@@ -177,9 +150,10 @@ export default {
this.hideLoading()
}
this.flag = true
if (scrollView) scrollView.loading = false
},
handleViewImage (e) {
this.imageUrl = e
handleViewImage (i) {
this.paperInfo = i
this.$nextTick(() => {
this.showImagePreview = true
})
......@@ -196,7 +170,7 @@ export default {
this.clearData()
},
change (index) {
const {pushType} = this.params
const { pushType } = this.params
if (pushType == index || (pushType == '' && index == 0)) return
this.params.pushType = index == 0 ? '' : index
this.clearData()
......@@ -214,14 +188,17 @@ export default {
let { total, params: { pageNum }, list, $refs: {
scrollView
} } = this
scrollView.loading = false
scrollView.loading = true
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
} else {
scrollView.finished = true
scrollView.loading = false
}
},
}
......@@ -319,51 +296,8 @@ export default {
}
}
.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;
}
}
height: calc(100vh - 110px);
width: 100vw;
transform: translate(-16px, -10px);
}
</style>
\ 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!