Commit aa00e2d9 by zhangquan

营销转化开发

1 parent 6e8f7760
const url = '/rop-scrm-marketing/router'
export default {
/**素材列表 */
getPsdList (data) {
getPsdList(data) {
data.method = 'marketing.api.material.list'
data.pageNum = 1
data.pageSize = 9999
......@@ -12,7 +12,7 @@ export default {
})
},
/** 素材组列表 */
getPsdGroupList (data = {}) {
getPsdGroupList(data = {}) {
data.method = 'marketing.api.material.group.list'
return window.$HTTP({
url,
......@@ -20,7 +20,7 @@ export default {
})
},
/** 素材发送/阅读埋点 */
sendReadBuriedPoint (params) {
sendReadBuriedPoint(params) {
let data = {
method: 'marketing.api.open.material.sendReadBuriedPoint',
list: [params]
......@@ -31,11 +31,19 @@ export default {
})
},
uploadMaterial (data = {}) {
uploadMaterial(data = {}) {
data.method = 'marketing.api.material.sop.upload'
return window.$HTTP({
url,
data
})
},
}
\ No newline at end of file
getTextDetail(data = {}) {
data.method = 'marketing.api.material.detail'
return window.$HTTP({
url,
data
})
}
}
.sprite-icon { background-image: url(../images/sprite.png);background-size: 105px 86px;}
.icon-down { width: 12px; height: 12px; background-position: 0px -74px;}
.icon-eye { width: 13px; height: 8px; background-position: -22px -74px;}
.sprite-icon { background-image: url(../images/sprite.png);background-size: 105px 90px;}
.icon-down { width: 12px; height: 12px; background-position: -26px -74px;}
.icon-eye { width: 13px; height: 8px; background-position: -48px -74px;}
.icon-gift-del { width: 18px; height: 18px; background-position: -84px -30px;}
.icon-link { width: 32px; height: 32px; background-position: -42px 0px;}
.icon-menu-active { width: 22px; height: 20px; background-position: 0px -44px;}
.icon-menu { width: 22px; height: 20px; background-position: -32px -44px;}
.icon-pdf { width: 32px; height: 34px; background-position: 0px 0px;}
.icon-PYQ { width: 21px; height: 20px; background-position: -84px 0px;}
.icon-send { width: 10px; height: 10px; background-position: -64px -44px;}
\ No newline at end of file
.icon-send { width: 10px; height: 10px; background-position: -64px -44px;}
.icon-grctx { width: 16px; height: 16px; background-position: 0px -74px;}
\ No newline at end of file

9.32 KB | W: | H:

10 KB | W: | H:

src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
<template>
<div class="psd-item">
<div class="title flex">
{{item.materialName}}
{{ item.materialName }}
<template v-if="!hidePYQ">
<div
class="sprite-icon icon-PYQ"
@click="onEmit('share',item)"
></div>
<div class="sprite-icon icon-PYQ" @click="onEmit('share', item)"></div>
</template>
</div>
<div class="content">
......@@ -14,35 +11,31 @@
<div class="sprite-icon icon-pdf"></div>
</template>
<template v-else-if="item.materialType == 2">链接</template>
<template v-else-if="item.materialType == 3">
<div @click="goDetailPage(item)" class="gr-ctx">
<div class="sprite-icon icon-grctx"></div>
查看图文
</div>
</template>
<template v-else>
<div
v-html="decodeURIComponent(item.materialUrl)"
class="hide"
></div>
<div v-html="decodeURIComponent(item.materialUrl)" class="hide"></div>
</template>
</div>
<div class="bottom flex">
<div class="num flex">
<div class="sprite-icon icon-send"></div>
{{item.sendNum}}
{{ item.sendNum }}
</div>
<div class="num flex">
<div class="sprite-icon icon-eye"></div>
{{item.readNum}}
{{ item.readNum }}
</div>
<van-button
block
round
color="#3975C6"
@click="onEmit('send',item)"
>
发送
</van-button>
<van-button block round color="#3975C6" @click="onEmit('send', item)">发送</van-button>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
export default {
name: 'Psd',
props: {
......@@ -58,12 +51,18 @@ export default {
methods: {
onEmit (name, item) {
this.$emit(name, item)
},
goDetailPage(i){
this.$router.push({
path: '/psd/detail',
query: {id:i.id}
})
}
}
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.psd-item {
background: #ffffff;
box-shadow: 0px 4px 8px 0px rgba(224, 224, 224, 0.5);
......@@ -87,6 +86,15 @@ export default {
padding: 10px 16px;
font-size: 12px;
color: #999999;
.gr-ctx {
display: flex;
align-items: center;
font-size: 28rpx;
color: #3975c6;
.icon-grctx {
margin-right: 5px;
}
}
.hide {
max-height: 150px;
overflow-y: scroll;
......@@ -116,4 +124,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -41,7 +41,6 @@ export default {
.then(link => {
this.showLoading()
if (isPyq) {
console.log('朋友圈')
wxConfig.shareToExternalMoments({
attachments: [
{
......@@ -67,22 +66,26 @@ export default {
desc: description || '',
imgUrl: titleUrl || imgUrl
}
wxConfig.getContext().then((res) => {
if (res.entry != 'normal'){
let pdfParam = {
msgtype: 'news',
news: params,
enterChat: false
}
if(i.materialType==1){
this.sendChatMessage(pdfParam, { id, merchantId, uuid })
}else{
this.getParam(i, { id, merchantId, uuid })
}
}else{
this.shareAppMessage(params, { id, merchantId, uuid })
}
})
// if (entry != 'normal') this.sendChatMessage(params, { id, merchantId, uuid })
// else this.shareAppMessage(params, { id, merchantId, uuid })
this.shareAppMessage(params, { id, merchantId, uuid })
// wxConfig.getContext().then((res) => {
// if (res.entry != 'normal'){
// let pdfParam = {
// msgtype: 'news',
// news: params,
// enterChat: false
// }
// if(i.materialType==1){
// this.sendChatMessage(pdfParam, { id, merchantId, uuid })
// }else{
// this.getParam(i, { id, merchantId, uuid })
// }
// }else{
// this.shareAppMessage(params, { id, merchantId, uuid })
// }
// })
}
})
},
......@@ -151,7 +154,6 @@ export default {
uploadMaterial(param,type){
return new Promise((resolve,reject)=>{
marketingApi.uploadMaterial(param).then(res =>{
console.log(res,456)
if(res?.mediaId){
if(type==1){
resolve({
......@@ -186,7 +188,6 @@ export default {
this.sendReadBuriedPoint(sendParams)
resolve()
}).catch(err => {
console.log(err)
this.hideLoading()
})
})
......
......@@ -48,7 +48,9 @@ import {
ShareSheet,
Overlay,
loading,
SwipeCell
SwipeCell,
Swipe,
SwipeItem
} from 'vant'
export const components = [
Button,
......@@ -91,5 +93,7 @@ export const components = [
ShareSheet,
Overlay,
loading,
SwipeCell
]
\ No newline at end of file
SwipeCell,
Swipe,
SwipeItem
]
......@@ -3,6 +3,8 @@ const pages = {
name: 'index'
}, {
name: 'list'
}, {
name: 'detail'
}
],
openEnterpriseChat: [
......
<template>
<div class="layout">
<div>
<template v-if="fileList && fileList.length">
<van-swipe @change="changeSwiper" :autoplay="autoplay" height="210" show-indicators>
<van-swipe-item v-for="(item, index) in fileList" :key="index">
<video id="swiper_video" v-if="item.type == 'video'" controls controlslist="nodownload" disablepictureinpicture playsinline="true" :src="item.url"></video>
<van-image width="100%" height="100%" fit="contain" v-if="item.type == 'image'" :src="item.url" />
</van-swipe-item>
<template #indicator>
<div class="custom-indicator">{{ curIdx + 1 }}/{{ fileList?.length || 0 }}</div>
</template>
</van-swipe>
</template>
<div class="rich-text">
<div v-html="decodeURIComponent(info.materialUrl)" class="hide"></div>
</div>
</div>
<div class="bottom flex">
<div class="num flex">
<div class="sprite-icon icon-send"></div>
{{ info.sendNum }}
</div>
<div class="num flex">
<div class="sprite-icon icon-eye"></div>
{{ info.readNum }}
</div>
<van-button block round @click="shareToExternalMoments(info)">分享朋友圈</van-button>
<van-button block round color="#3975C6" @click="sendMessage(info)">转发</van-button>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import { marketingApi } from '@/api'
import { psdMixin, businessMixin, pageMixin, shareMixin } from '@/mixins'
export default {
mixins: [shareMixin],
name: '',
data () {
return {
curIdx: 0,
fileList :[],
autoplay: 3000,
materialUrl:'',
info:{}
}
},
created(){
let { id } = this.getQuery()
// let id = 148
this.getDetail(id)
},
mounted () {
try {
let _that = this
let video=document.getElementById("swiper_video");
video.addEventListener('play', function () { //播放开始执行的函数
_that.autoplay = 0
});
video.addEventListener('pause', function () { //暂停开始执行的函数
_that.autoplay = 3000
});
video.addEventListener('ended', function () { //结束
_that.autoplay = 3000
}, false);
} catch (error) {
console.log('监听视频事件失败')
}
},
methods: {
changeSwiper(idx){
this.curIdx = idx
},
getDetail(id){
marketingApi.getTextDetail({id,flag: 0}).then(data => {
console.log(data)
let fileList = []
if(data.videoUrl) {
fileList.push({type:'video', url: data.videoUrl})
}
if(data.imageUrlList && data.imageUrlList.length){
data.imageUrlList.forEach(item => {
fileList.push({type:'image', url: item})
})
}
this.fileList = fileList
this.info = data
})
}
}
}
</script>
<style lang="scss">
.layout {
background-color: #fff;
}
.van-swipe {
background-color: #f8f8f8;
padding-bottom: 20px;
}
.van-swipe-item {
height: 210px;
}
#swiper_video {
width: 100%;
height: 100%;
}
.custom-indicator {
display: inline-block;
text-align: center;
position: absolute;
top: 10px;
right: 10px;
width: 38px;
font-size: 11px;
color: #ffffff;
height: 24px;
line-height: 24px;
background: #666666;
border-radius: 12px;
}
.rich-text {
margin-top: 20px;
}
.hide img {
width: 100%;
height: unset;
}
.bottom {
padding: 0 16px 34px;
height: 82px;
background: #f8f8f8;
border-radius: 0px 0px 4px 4px;
position: fixed;
bottom: 0;
width: 100%;
box-sizing: border-box;
box-shadow: 0 0 0 0 #e9e9e9;
border-top: 1px solid #dcdee0;
.num {
font-size: 12px;
color: #999999;
margin-right: 10px;
.sprite-icon {
margin-right: 4px;
}
}
.van-button {
min-width: 100px;
height: 36px;
font-size: 12px;
margin-left: 10px;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!