Commit cc8b2811 by 李伟康

commit--营销素材

1 parent 74e95069
const url = '/rop-scrm-shopmall/router'
export default {
/** 分页查询活动 */
getActivityList (currentPage) {
let data = {
method: 'scrm.api.shopmall.activity.page',
pageSize: 10,
currentPage
}
return window.$HTTP({
url,
data
})
},
/** 获取分享链接 */
getShared (data) {
data.method = 'scrm.api.shopmall.activity.get.shared'
return window.$HTTP({
url,
data
})
},
}
\ No newline at end of file \ No newline at end of file
const url = '/rop-scrm-boutiquecoupon/router'
export default {
/**精品礼券分页查询 */
getBoutiqueCouponList(data) {
data.method = 'scrm.api.boutiquecoupon.wework.coupon.page'
data.pageSize = 10
return window.$HTTP({
// url: 'http://192.168.3.222:8489/rop-scrm-boutiquecoupon/router',
url,
data
})
},
/**精品礼券领取链接 */
getBoutiqueCoupon(data) {
data.method = 'scrm.api.boutiquecoupon.wework.coupon.receiveUrl'
return window.$HTTP({
// url: 'http://192.168.3.222:8489/rop-scrm-boutiquecoupon/router',
url,
data
})
},
/** 分页查询用户券列表(待核销、已核销) */
getCustomerCouponList(data) {
data.method = 'scrm.api.boutiquecoupon.wework.customerCoupon.page'
data.pageSize = 10
return window.$HTTP({
url,
data
})
},
}
\ No newline at end of file \ No newline at end of file
const url = '/rop-scrm-coupon/router'
const pageSize = 10
export default {
/**商城优惠券列表 */
getMerchantCouponList(data) {
// data.method = 'scrm.api.coupon.list.merchant'
data.method = 'scrm.wechat.activity.coupon.list'
data.pageSize = pageSize
data.validType = 'valid'
data.discountTypes = [2,3,4]
return window.$HTTP({
url,
data
})
},
/** 获取优惠卷分享链接 */
getCouponShared(data) {
data.method = 'scrm.api.coupon.share'
return window.$HTTP({
url,
data
})
},
/** 已经核销列表 */
getVerificationList(data) {
data.method = 'scrm.api.coupon.verification.code.verification.list'
data.pageSize = pageSize
return window.$HTTP({
url,
data
})
},
/** 查询已领取 未核销 */
getUserCouponList(data) {
data.method = 'scrm.api.coupon.user.list.merchant'
data.pageSize = pageSize
return window.$HTTP({
url,
data
})
},
/** 根据核销码查询卷信息 */
scan(data) {
data.method = 'scrm.api.coupon.verification.code.scan'
return window.$HTTP({
url,
data
})
},
/** 核销核销码 */
verificationCode(data) {
data.method = 'scrm.api.coupon.verification.code.verification'
return window.$HTTP({
url,
data
})
}
}
\ No newline at end of file \ No newline at end of file
const url = '/rop-scrm-coupon/router'
const pageSize = 10
export default {
/**根据条件获取定向礼包列表(企微) */
getGiftList (data) {
data.method = 'scrm.api.coupon.weChat.directional.gift.list'
data.pageSize = pageSize
return window.$HTTP({
url,
data
})
},
/** 根据id删除定向礼包 */
deleteGift (data) {
data.method = 'scrm.api.coupon.directional.gift.delete'
return window.$HTTP({
url,
data
})
},
/**根据id获取定向礼包详情(企微) */
getGiftDetail (id) {
let data = {
method: 'scrm.api.coupon.weChat.directional.gift.detail',
id
}
return window.$HTTP({
url,
data
})
},
/**定向礼包专用优惠券列表(嘀加后台和企微) */
getCouponList (data) {
data.method = 'scrm.api.coupon.directional.gift.coupon.list'
data.pageSize = 9999
return window.$HTTP({
url,
data
})
},
/**创建或修改礼包,修改时礼包id必传 */
createOrupdataGift (data) {
data.method = 'scrm.api.coupon.directional.gift.create'
return window.$HTTP({
url,
data
})
},
/**根据定向礼包id获取二维码路径 */
createQr (data) {
data.method = 'scrm.api.coupon.directional.gift.qr.code'
return window.$HTTP({
url,
data
})
}
}
\ No newline at end of file \ No newline at end of file
...@@ -7,23 +7,13 @@ ...@@ -7,23 +7,13 @@
* @LastEditTime: 2021-06-17 18:23:27 * @LastEditTime: 2021-06-17 18:23:27
*/ */
import ssoApi from './ssoApi' import ssoApi from './ssoApi'
import liveApi from './liveApi' import merchantsApi from './merchantsApi'
import couponApi from './couponApi'
import activityApi from './activityApi'
import wxConfig from './wxConfig' import wxConfig from './wxConfig'
import shopmallApi from './shopmallApi' import marketingApi from './marketingApi'
import boutiquecouponApi from './boutiquecouponApi'
import equityApi from './equityApi'
import giftApi from './giftApi'
export { export {
ssoApi, ssoApi,
couponApi,
wxConfig, wxConfig,
shopmallApi, merchantsApi,
activityApi, marketingApi
liveApi,
boutiquecouponApi,
equityApi,
giftApi
} }
\ No newline at end of file \ No newline at end of file
const url = '/rop-scrm-live/router'
export default {
/** 分页查询活动 */
getLiveList(pageNum) {
let data = {
method: 'scrm.api.live.live.room.list',
pageSize: 10,
pageNum
}
return window.$HTTP({
url,
data,
})
},
getShared(data) {
data.method = 'scrm.api.live.get.shared.code'
return window.$HTTP({
url,
data
})
},
}
\ No newline at end of file \ No newline at end of file
const url = '/rop-scrm-equity/router' const url = '/rop-scrm-marketing/router'
export default { export default {
/**套餐分页查询 */ /**素材列表 */
getEquityList (pageNum) { getPsdList (data) {
let data = { data.method = 'marketing.api.material.list'
method: 'scrm.api.equity.package.info.list.with.page', data.pageNum = 1
pageSize: 10, data.pageSize = 9999
state: 1, data.flag = 1
pageNum
}
return window.$HTTP({ return window.$HTTP({
url, url,
data data
}) })
}, },
/**套餐详情 */ /** 素材组列表 */
getEquityDetail (data) { getPsdGroupList (data = {}) {
data.method = 'scrm.api.equity.main.page.package.detail.get' data.method = 'marketing.api.material.group.list'
return window.$HTTP({ return window.$HTTP({
url, url,
data data
}) })
}, },
/** 获取套餐分享链接 */ /** 素材发送/阅读埋点 */
getEquityShared (data) { sendReadBuriedPoint (params) {
data.method = 'scrm.api.equity.package.info.share' let data = {
method: 'marketing.api.open.material.sendReadBuriedPoint',
list: [params]
}
return window.$HTTP({ return window.$HTTP({
url, url,
data data
}) })
}, }
} }
\ No newline at end of file \ No newline at end of file
export default {
/**查询业务类型 */
getBusinessType (data = {}) {
data.method = 'merchants.api.menu.findAllDictData'
data.dictType = 'business_type'
return window.$HTTP({
url: `${window.$fetchConfig.request.ropMerchantURL}/rop-merchants/router`,
data
})
},
}
\ No newline at end of file \ No newline at end of file
const url = '/rop-scrm-shopmall/router'
export default {
/** 获取门店商品列表 */
getGoodsList(currentPage) {
let data = {
method: 'scrm.api.shopmall.goods.wework.page',
pageSize: 10,
currentPage
}
return window.$HTTP({
url,
data
})
},
/**获取商品海报 */
getGoodsPoster(data) {
data.method = 'scrm.api.shopmall.goods.wework.posterUrl'
return window.$HTTP({
url,
data
})
},
/** 获取商品链接 */
getGoodsLink(data) {
data.method = 'scrm.api.shopmall.goods.wework.url'
return window.$HTTP({
url,
data
})
},
/** 获取商品海报企业微信素材mediaId */
getGoodsPosterMediaId(data) {
data.method = 'scrm.api.shopmall.goods.wework.posterWorkWxMediaId'
return window.$HTTP({
url,
data
})
},
/** 分页查询商品订单核销列表(待核销、已核销用查询参数区分) */
getGoodsVerficationList(data = {}) {
data.method = 'scrm.api.shopmall.wework.order.verfication.page'
data.pageSize = 10
return window.$HTTP({
url,
data
})
},
/**根据商城订单核销码获取商城订单详情以备核销 */
getGoodsVerficationDetail(verificationCode) {
let data = {
method: 'scrm.api.shopmall.wework.order.detail.toVerfication',
verificationCode: verificationCode
}
return window.$HTTP({
url,
data
})
},
/** 商品订单核销 */
verficationGoods(verificationCode) {
let data = {
method: 'scrm.api.shopmall.wework.order.verfication',
verificationCode: verificationCode
}
return window.$HTTP({
url,
data
})
}
}
...@@ -8,7 +8,7 @@ const WxConfig = { ...@@ -8,7 +8,7 @@ const WxConfig = {
if (e == 'chooseImage') jsApiList.push('getLocalImgData') if (e == 'chooseImage') jsApiList.push('getLocalImgData')
}) })
let [redirectUrl] = window.location.href.split('#') let [redirectUrl] = window.location.href.split('#')
const { corpId } = util.getLocalStorage('dj_scrm_corpId') const { corpId } = util.getLocalStorage('dj_scrm_corpId') || util.getQuery()
/** 获取企微应用AgentConfig */ /** 获取企微应用AgentConfig */
let data = { let data = {
corpId, corpId,
...@@ -57,7 +57,7 @@ const WxConfig = { ...@@ -57,7 +57,7 @@ const WxConfig = {
* expireTime 失效时间 * expireTime 失效时间
* expireInterval 失效间隔 * expireInterval 失效间隔
* appId 微信应用ID * appId 微信应用ID
* envVersion 要打开的小程序版本。正式版为:release,体验版为:trial,开发版为:develop,仅在微信外打开时生效 * envVersion 要打开的小程序版本。正式版为:release 体验版为:trial 开发版为:develop,仅在微信外打开时生效
*/ */
console.log('请求', data) console.log('请求', data)
return window.$HTTP({ return window.$HTTP({
...@@ -174,10 +174,12 @@ const WxConfig = { ...@@ -174,10 +174,12 @@ const WxConfig = {
/**发表内容到客户朋友圈 */ /**发表内容到客户朋友圈 */
shareToExternalMoments (params) { shareToExternalMoments (params) {
return new Promise(resolve => { return new Promise((resolve, reject) => {
wx.invoke('shareToExternalMoments', params, res => { wx.invoke('shareToExternalMoments', params, res => {
if (res.err_msg == 'shareToExternalMoments:ok') { if (res.err_msg == 'shareToExternalMoments:ok') {
resolve() resolve()
} else {
reject(res)
} }
}) })
}) })
...@@ -185,7 +187,7 @@ const WxConfig = { ...@@ -185,7 +187,7 @@ const WxConfig = {
/**打开会话 */ /**打开会话 */
openEnterpriseChat ({ externalUserIds = [], groupName = '', userIds = [], chatId = '' }) { openEnterpriseChat ({ externalUserIds = [], groupName = '', userIds = [], chatId = '' }) {
return new Promise(resolve => { return new Promise((resolve, reject) => {
userIds = userIds.join(';') userIds = userIds.join(';')
externalUserIds = externalUserIds.join(';') externalUserIds = externalUserIds.join(';')
wx.openEnterpriseChat({ wx.openEnterpriseChat({
...@@ -201,6 +203,7 @@ const WxConfig = { ...@@ -201,6 +203,7 @@ const WxConfig = {
if (res.errMsg.indexOf('function not exist') > -1) { if (res.errMsg.indexOf('function not exist') > -1) {
Notify('版本过低请升级') Notify('版本过低请升级')
} }
reject()
} }
}) })
}) })
......
...@@ -75,12 +75,6 @@ img { ...@@ -75,12 +75,6 @@ img {
.van-dropdown-menu { .van-dropdown-menu {
margin-left: auto; margin-left: auto;
.arrow {
right: 8px;
z-index: 998;
}
.icon-down { .icon-down {
transition: all 0.25s; transition: all 0.25s;
} }
......
.sprite-icon { background-image: url(../images/sprite.png);background-size: 105px 86px;} .sprite-icon { background-image: url(../images/sprite.png);background-size: 105px 86px;}
.icon-down { width: 12px; height: 12px; background-position: 0px -74px;} .icon-down { width: 12px; height: 12px; background-position: 0px -74px;}
.icon-eye { width: 13px; height: 8px; background-position: -22px -74px;}
.icon-gift-del { width: 18px; height: 18px; background-position: -84px -30px;} .icon-gift-del { width: 18px; height: 18px; background-position: -84px -30px;}
.icon-menu { width: 22px; height: 20px; background-position: 0px -44px;}
.icon-PYQ { width: 21px; height: 20px; background-position: -84px 0px;}
.icon-pdf { width: 32px; height: 34px; background-position: 0px 0px;}
.icon-link { width: 32px; height: 32px; background-position: -42px 0px;} .icon-link { width: 32px; height: 32px; background-position: -42px 0px;}
.icon-eye { width: 13px; height: 8px; background-position: -22px -74px;} .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;} .icon-send { width: 10px; height: 10px; background-position: -64px -44px;}
\ No newline at end of file \ No newline at end of file
.icon-menu-active { width: 22px; height: 20px; background-position: -32px -44px;}
\ No newline at end of file \ No newline at end of file

9.32 KB | W: | H:

9.32 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
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
:single="single" :single="single"
@confirm="confirm" @confirm="confirm"
:title="title" :title="title"
:data="data"
/> />
</van-dropdown-item> </van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
...@@ -24,7 +25,11 @@ export default { ...@@ -24,7 +25,11 @@ export default {
name: 'DropdownMenu', name: 'DropdownMenu',
props: { props: {
single: Boolean, single: Boolean,
title: String title: String,
data: {
type: Array,
default: () => []
}
}, },
data () { data () {
return { return {
...@@ -34,9 +39,6 @@ export default { ...@@ -34,9 +39,6 @@ export default {
mounted () { mounted () {
}, },
methods: { methods: {
close () {
// this.$refs.menu.toggle()
},
confirm (e) { confirm (e) {
this.$emit('confirm', e) this.$emit('confirm', e)
} }
...@@ -50,8 +52,8 @@ export default { ...@@ -50,8 +52,8 @@ export default {
/deep/.van-dropdown-menu__bar { /deep/.van-dropdown-menu__bar {
width: 44px; width: 44px;
height: 44px !important; height: 44px !important;
.sprite-icon{ .sprite-icon {
transition: all .25s; transition: all 0.25s;
} }
.icon-menu-active { .icon-menu-active {
display: none; display: none;
......
...@@ -8,29 +8,18 @@ ...@@ -8,29 +8,18 @@
:class="['item text-center',{'active':i.active}]" :class="['item text-center',{'active':i.active}]"
:key="index" :key="index"
@click="choose(i,index)" @click="choose(i,index)"
> {{i.text}}</div> >{{i.text}}</div>
</template> </template>
</div> </div>
</div> </div>
<div class="menu-btn-box"> <div class="menu-btn-box">
<template v-if="showReset">
<van-button <van-button
block block
round round
@click="reset" @click="close(1)"
> >
重置 {{showReset?'重置':'取消'}}
</van-button> </van-button>
</template>
<template v-else>
<van-button
block
round
@click="close"
>
取消
</van-button>
</template>
<van-button <van-button
block block
round round
...@@ -48,44 +37,20 @@ export default { ...@@ -48,44 +37,20 @@ export default {
name: 'MenuCheckbox', name: 'MenuCheckbox',
props: { props: {
single: Boolean, single: Boolean,
title: String title: String,
data: {
type: Array,
default: () => []
}
}, },
data () { data () {
return { return {
showReset: false, showReset: false,
list: [ list: [],
{
text: '全部',
value: '',
active: true
},
{
text: '真滴C',
value: 2,
active: false
},
{
text: '咦哦啊',
value: 3,
active: false
},
{
text: '两段蛙跳',
value: 4,
active: false
},
{
text: '葫芦给',
value: 5,
active: false
}
]
} }
}, },
mounted () { mounted () {
this.list = this.data
}, },
methods: { methods: {
choose (e, index) { choose (e, index) {
...@@ -120,18 +85,18 @@ export default { ...@@ -120,18 +85,18 @@ export default {
confirm () { confirm () {
let { list } = this let { list } = this
let chooseList = [] let chooseList = []
try {
list.map(e => { list.map(e => {
if (!e.value && e.active) throw e if (e.active && e.value) chooseList.push(e)
if (e.active) chooseList.push(e)
}) })
} catch (e) {
chooseList = []
}
this.$emit('confirm', chooseList) this.$emit('confirm', chooseList)
this.close() this.close()
}, },
close () { close (click) {
let { showReset } = this
if (click && showReset) {
this.reset()
return
}
this.$parent.close() this.$parent.close()
} }
} }
...@@ -157,7 +122,7 @@ export default { ...@@ -157,7 +122,7 @@ export default {
padding: 0 12px; padding: 0 12px;
color: #666; color: #666;
font-size: 14px; font-size: 14px;
transition: all .25s; transition: all 0.25s;
} }
.active { .active {
border-color: var(--themeColor); border-color: var(--themeColor);
......
<template> <template>
<div class="psd-item"> <div class="psd-item">
<div class="title flex"> <div class="title flex">
产品操作手册(这里显示素材名称) {{item.materialName}}
<template v-if="!hidePYQ"> <template v-if="!hidePYQ">
<div class="sprite-icon icon-PYQ"></div> <div class="sprite-icon icon-PYQ" @click="onEmit('share',item)"></div>
</template> </template>
</div> </div>
<div class="content"> <div class="content">
{{item}} <template v-if="item.materialType == 1">
<div class="sprite-icon icon-pdf"></div>
</template>
<template v-else-if="item.materialType == 2">链接</template>
<template v-else>
<div v-html="decodeURIComponent(item.materialUrl)"></div>
</template>
</div> </div>
<div class="bottom flex"> <div class="bottom flex">
<div class="num flex"> <div class="num flex">
<div class="sprite-icon icon-send"></div> <div class="sprite-icon icon-send"></div>
998 {{item.sendNum}}
</div> </div>
<div class="num flex"> <div class="num flex">
<div class="sprite-icon icon-eye"></div> <div class="sprite-icon icon-eye"></div>
10086 {{item.readNum}}
</div> </div>
<van-button <van-button
block block
round round
color="#3975C6" color="#3975C6"
@click="send" @click="onEmit('send',item)"
> >
发送 发送
</van-button> </van-button>
...@@ -44,8 +50,8 @@ export default { ...@@ -44,8 +50,8 @@ export default {
mounted () { mounted () {
}, },
methods: { methods: {
send () { onEmit (name, item) {
this.$emit(name, item)
} }
} }
} }
......
...@@ -11,13 +11,17 @@ ...@@ -11,13 +11,17 @@
<template v-if="showDropdown"> <template v-if="showDropdown">
<van-dropdown-menu active-color="#3975C6"> <van-dropdown-menu active-color="#3975C6">
<van-dropdown-item <van-dropdown-item
v-model="value"
:options="option" :options="option"
v-model="value"
@change="onEmit($event,'change')" @change="onEmit($event,'change')"
/> >
<div class="arrow y-center"> <template #title>
<div class="menu-title flex">
{{option[value].text}}
<div class="sprite-icon icon-down"></div> <div class="sprite-icon icon-down"></div>
</div> </div>
</template>
</van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</template> </template>
<template v-if="showMenu"> <template v-if="showMenu">
...@@ -25,6 +29,7 @@ ...@@ -25,6 +29,7 @@
@confirm="onEmit($event,'menuSelect')" @confirm="onEmit($event,'menuSelect')"
:single="single" :single="single"
:title="title" :title="title"
:data="option"
></dropdown-menu> ></dropdown-menu>
</template> </template>
</div> </div>
......
...@@ -10,9 +10,13 @@ ...@@ -10,9 +10,13 @@
> >
<template v-for="(i,index) in data"> <template v-for="(i,index) in data">
<van-tab <van-tab
:title="i"
:key="index" :key="index"
></van-tab> >
<template #title>
{{i}}
</template>
</van-tab>
</template> </template>
</van-tabs> </van-tabs>
</div> </div>
...@@ -64,7 +68,7 @@ export default { ...@@ -64,7 +68,7 @@ export default {
</script> </script>
<style lang='scss'> <style lang='scss'>
.TAB{ .TAB {
position: relative; position: relative;
} }
.sticky { .sticky {
......
...@@ -8,15 +8,22 @@ ...@@ -8,15 +8,22 @@
*/ */
// 本地环境配置 // 本地环境配置
module.exports = { module.exports = {
envVersion: "develop", envVersion: 'trial',
request: { request: {
baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址, baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
withCredentials: true, withCredentials: true,
// 返回数据类型 // 返回数据类型
responseType: 'json' responseType: 'json',
ropMerchantURL: 'http://rop-merchant.dev.glsx.com.cn'
/**
* 开发:http://rop-merchant.dev.glsx.com.cn
* 测试:http://rop-merchant.test.glsx.com.cn
* 预发布:http://rop-merchant.beta.glsx.com.cn
* 生产:http://commodity.glsx.com.cn
*/
}, },
response: { response: {
data_key: 'data', data_key: 'data',
......
...@@ -15,7 +15,7 @@ export const fetchConfig = function(isEnv = true) { ...@@ -15,7 +15,7 @@ export const fetchConfig = function(isEnv = true) {
Object.assign(request, { timeout }) Object.assign(request, { timeout })
return Promise.resolve(config) return Promise.resolve(config)
} }
return window.fetch('https://oss-config.test.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-activity-config', {}).then(res => res.json()) return window.fetch('http://192.168.3.171:7300/mock/617918601072f92988f05a11/base/scrm-wx-work-psd-config', {}).then(res => res.json())
} }
export const cfg = { export const cfg = {
install(vue, config) { install(vue, config) {
......
...@@ -43,7 +43,7 @@ fetchConfig(!isMock).then(res => { ...@@ -43,7 +43,7 @@ fetchConfig(!isMock).then(res => {
// 设置 js中可以访问 $cdn // 设置 js中可以访问 $cdn
Vue.use(cfg) Vue.use(cfg)
window.$fetchConfig = res window.$fetchConfig = res
// if (res.vconsole) new VConsole() if (res.vconsole) new VConsole()
/**登录过期 重新登录 */ /**登录过期 重新登录 */
window.reLogin = () => { window.reLogin = () => {
......
import { merchantsApi } from '@/api'
export default {
data () {
return {
businessList: [
{
text: '全部',
value: '',
active: true
}
]
}
},
mounted () {
this.getBusinessType()
},
methods: {
getBusinessType () {
merchantsApi.getBusinessType().then(data => {
data && data.map(e => {
this.businessList.push({
text: e.dictLabel,
value: e.dictValue,
active: false
})
})
})
}
}
}
\ No newline at end of file \ No newline at end of file
import businessMixin from './businessMixin'
import shareMixin from './shareMixin' import shareMixin from './shareMixin'
import pageMixin from './pageMixin' import pageMixin from './pageMixin'
import psdMixin from './psdMixin' import psdMixin from './psdMixin'
export { export {
businessMixin,
shareMixin, shareMixin,
pageMixin, pageMixin,
psdMixin psdMixin
......
import { marketingApi } from '@/api'
export default { export default {
data () { data () {
return { return {
tabIndex: 0,
pageNum: 1,
list: [], list: [],
total: 0, total: 0,
flag: false, flag: false,
updata: new Date().getTime() businessText: '全部',
materialName: '',
sort: 0,
businessType: '',
groupId: ''
} }
}, },
mounted () { mounted () {
let { tabIndex } = this.getQuery() let { groupId } = this.getQuery()
if (tabIndex) { if (groupId) {
this.tabIndex = Number(tabIndex) this.groupId = groupId
this.updata = new Date().getTime()
this.init()
return return
} }
if (this.$route.meta.isTab) this.init() if (this.$route.name != 'psd') {
this.init()
}
}, },
methods: { methods: {
init () { init () {
this.showLoading() this.showLoading()
this.getList(this.pageNum) this.getList()
},
search (e) {
this.materialName = e
this.clearData()
}, },
change (index) { change (index) {
this.tabIndex = index let { psdGroupList } = this
this.groupId = psdGroupList[index + 1].value
this.clearData()
},
menuSelect (e) {
this.groupId = e && e.length && e[0].value || ''
this.clearData() this.clearData()
}, },
clearData () { clearData () {
this.flag = false this.flag = false
this.pageNum = 1
this.list = [] this.list = []
if (this.$refs.scrollView) this.$refs.scrollView.finished = false
this.init() this.init()
}, },
onReachBottom () { changeSort (e) {
let { total, pageNum, list } = this this.sort = e
this.$refs.scrollView.loading = false this.clearData()
if (list.length == total) { },
this.$refs.scrollView.finished = true businessConfirm (chooseList) {
return console.log(chooseList)
} if (chooseList.length) {
if (Math.ceil(total / 10) > pageNum) { let text = []
this.pageNum = pageNum + 1 let businessType = []
this.init() chooseList.map(e => {
text.push(e.text)
businessType.push(e.value)
})
this.businessText = `${text.join(',').substring(0, 5)}...`
this.businessType = businessType.join(',')
} else { } else {
this.$refs.scrollView.finished = true this.businessType = ''
this.businessText = '全部'
} }
this.clearData()
},
onReachBottom () {
this.$refs.scrollView.finished = true
},
sortList (data, attr) {
return data.sort((a, b) => b[attr] - a[attr])
},
getList () {
let { materialName, businessType, groupId, sort } = this
marketingApi.getPsdList({ materialName, businessType, groupId }).then(data => {
console.log('素材列表', data)
if (sort != 0 && data && data.length) data = this.sortList(data, sort == 1 ? 'sendNum' : 'readNum')
this.list = data || []
this.flag = true
this.hideLoading()
})
} }
} }
} }
\ No newline at end of file \ No newline at end of file
import { marketingApi } from '@/api'
export default { export default {
data() { data () {
return { return {
option: [ option: [
{ text: '上传时间优先', value: 0 }, { text: '上传时间优先', value: 0 },
{ text: '发送次数优先', value: 1 }, { text: '发送次数优先', value: 1 },
{ text: '阅读数优先', value: 2 }, { text: '阅读数优先', value: 2 },
], ],
psdGroupList: [],
tab: [],
updata: new Date().getTime()
} }
}, },
mounted() { mounted () {
marketingApi.getPsdGroupList().then(data => {
console.log('素材组', data)
let psdGroupList = [{
text: '全部',
value: '',
active: true
}]
let tab = []
data && data.map(e => {
psdGroupList.push({
text: e.materialGroupName,
value: e.id,
active: false
})
tab.push(e.materialGroupName)
})
let { groupId } = this
if (groupId) {
psdGroupList.map(e =>{
if(e.value == groupId) e.active = true
else e.active = false
})
this.clearData()
}
this.psdGroupList = psdGroupList
if (this.$route.name == 'psd') {
this.tab = tab
this.change(0)
}
this.updata = new Date().getTime()
})
}, },
methods: { methods: {
......
import { couponApi, wxConfig } from '@/api' import { wxConfig, marketingApi } from '@/api'
export default { export default {
data () { data () {
return { return {
...@@ -6,195 +6,95 @@ export default { ...@@ -6,195 +6,95 @@ export default {
} }
}, },
mounted () { mounted () {
if (this.$route.meta.isTab || this.$route.meta.isIndex) this.wxInit() this.wxInit()
}, },
methods: { methods: {
wxInit () { wxInit () {
let _this = this let _this = this
wxConfig.init(['shareAppMessage', 'sendChatMessage', 'getCurExternalContact', 'getContext']).then(() => { wxConfig.init(['getContext', 'shareAppMessage', 'sendChatMessage', 'shareToExternalMoments']).then(() => {
wxConfig.getContext().then(({ entry }) => { wxConfig.getContext().then(({ entry }) => {
_this.$parent.entry = entry _this.$parent.entry = entry
_this.entry = entry _this.entry = entry
}) })
}) })
}, },
showShareModel (i = {}) { shareToExternalMoments (i) {
let { this.sendMessage(i, true)
tabIndex,
$route: { name }
} = this
if (name != 'merchant') {
if (tabIndex == 0 && i.remainAmount < 1) return
if (tabIndex == 1 && i.residueAmount < 1) return
}
wxConfig
.getCurExternalContact()
.then(res => {
console.log('当前外部联系人', res)
i.is_contact = res
this.sendMessage(i)
})
.catch(() => {
this.sendMessage(i)
})
}, },
sendMessage (i) { sendMessage (i, isPyq) {
const { shopmall_appid } = window.$fetchConfig const { shopmall_appid, envVersion } = window.$fetchConfig
let { merchantId, merchantName, userName, sapCode } = this.getLocalStorage('dj_scrm_userInfo') const path = 'pages/psdView/psdView'
let { tabIndex, entry } = this const { merchantId, uuid, sapCode } = this.getLocalStorage('dj_scrm_userInfo')
let { name } = this.$route const { entry } = this
let { userId, id, couponName, activityName, packageName, goodsName, goodsImage, discountType } = i const { materialName, id, titleUrl, materialTitle, description } = i
let query = `merchantId=${merchantId}` const imgUrl = 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/test/test.jpg'
let query = `merchantId=${merchantId}&id=${id}&staffUuid=${uuid}`
if (sapCode) query = `${query}&storeCode=${sapCode}` if (sapCode) query = `${query}&storeCode=${sapCode}`
const entryType = entry != 'normal' marketingApi.sendReadBuriedPoint({
this.showLoading() materialId: id,
if (name === 'coupon') { /**卡券 */ type: 1,
let desc = '您的专属服务顾问为您发来了优惠券,请点击领取~' merchantId,
let imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-yh-10004.png' staffUuid: uuid
if (tabIndex == 0) { }).then(() => {
let path = 'packageMine/pages/boutique/gift/gift' wxConfig.createMiniprogramUrlLink({
let query = `id=${id}&userId=${userId}&employName=${this.toUnicode(i.employeeName)}&${query}`
if (entryType) this.sendChatMessage({
appid: shopmall_appid,
title: couponName,
imgUrl,
page: `/${path}.html?${query}`
})
else wxConfig
.createMiniprogramUrlLink({
path,
query,
appId: shopmall_appid
})
.then(url => {
this.shareAppMessage(url, desc, couponName, imgUrl)
})
} else {
let path = 'packageMall/pages/coupon/coupon'
query = `couponId=${id}&${query}&issueName=${this.toUnicode(userName)}&issueDate=${new Date().getTime()}`
this.couponShare(i, url => {
if (entryType) this.sendChatMessage({
appid: shopmall_appid,
title: `${couponName}(${window.$discountType[discountType]}券)`,
imgUrl,
page: `/${path}.html?${query}`
})
else wxConfig
.createMiniprogramUrlLink({
path, path,
query, query,
appId: shopmall_appid appId: shopmall_appid,
}) envVersion
.then(url => {
this.shareAppMessage(url, desc, couponName, imgUrl)
})
}) })
.then(link => {
this.showLoading()
if (isPyq) {
console.log('朋友圈')
wxConfig.shareToExternalMoments({
attachments: [
{
msgtype: 'link', // 消息类型,必填
link: {
title: materialTitle || materialName, // H5消息标题
imgUrl: titleUrl || imgUrl, // H5消息封面图片URL
url: link // H5消息页面url 必填
},
} }
} else if (name === 'activity') { /**活动 */ ]
if (tabIndex == 0) { }).then(() => {
let imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-ms-10004.png' this.hideLoading()
let path = 'packageMall/pages/detail/detail'
query = `isActivity=true&id=${id}&${query}`
if (entryType) this.sendChatMessage({
appid: shopmall_appid,
title: activityName,
imgUrl,
page: `/${path}.html?${query}`
})
else wxConfig
.createMiniprogramUrlLink({
path,
query,
appId: shopmall_appid
}) })
.then(url => { .catch(err => {
this.shareAppMessage(url, '您有一个秒杀活动可参加', activityName, imgUrl) this.hideLoading()
}) })
} else { } else {
/**直播 */ let params = {
link,
title: materialTitle || materialName,
desc: description || '',
imgUrl: titleUrl || imgUrl
}
if (entry != 'normal') this.sendChatMessage(params, 'news')
else this.shareAppMessage(params)
} }
} else { /**店铺 */
if (tabIndex == 0) {
let path = 'pages/tab/index/index'
const imgUrl = 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/activity/miniprogram-cover.jpg'
if (entryType) this.sendChatMessage({
appid: shopmall_appid,
title: merchantName,
imgUrl,
page: `/${path}.html?${query}`
})
else wxConfig
.createMiniprogramUrlLink({
path,
query,
appId: shopmall_appid
})
.then(url => {
this.shareAppMessage(url, '', merchantName, imgUrl)
})
} else if (tabIndex == 1) {
let path = 'packageEquity/pages/package/package'
let imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-qy-10004.png'
query = `id=${id}&${query}`
if (entryType) this.sendChatMessage({
appid: shopmall_appid,
title: packageName,
imgUrl,
page: `/${path}.html?${query}`
})
else wxConfig
.createMiniprogramUrlLink({
path,
query,
appId: shopmall_appid
})
.then(url => {
this.shareAppMessage(url, '您的专属客服顾问为您发来了会员套餐,点击查看哦', packageName, imgUrl)
})
} else {
let path = 'packageMall/pages/detail/detail'
query = `id=${id}&${query}`
if (entryType) this.sendChatMessage({
appid: shopmall_appid,
title: goodsName,
imgUrl: goodsImage,
page: `/${path}.html?${query}`
})
else wxConfig
.createMiniprogramUrlLink({
path,
query,
appId: shopmall_appid
}) })
.then(url => {
this.shareAppMessage(url, '', goodsName, goodsImage)
}) })
}
}
}, },
sendChatMessage (params) { sendChatMessage (params, msgtype) {
wxConfig wxConfig
.sendChatMessage({ .sendChatMessage({
msgtype: 'miniprogram', msgtype,
miniprogram: params, [msgtype]: params,
enterChat: false enterChat: false
}) })
.then(() => { .then(() => {
this.hideLoading() this.hideLoading()
}) })
.catch(err => { .catch(err => {
console.log('当前会话', err) console.log(err)
this.hideLoading() this.hideLoading()
}) })
}, },
shareAppMessage (link, desc, title, imgUrl) { shareAppMessage (params) {
wxConfig wxConfig
.shareAppMessage({ .shareAppMessage(params)
title,
desc,
link,
imgUrl
})
.then(() => { .then(() => {
this.hideLoading() this.hideLoading()
}) })
...@@ -208,22 +108,6 @@ export default { ...@@ -208,22 +108,6 @@ export default {
unicodeStr += '@' + chineseStr.charCodeAt(i).toString(16) unicodeStr += '@' + chineseStr.charCodeAt(i).toString(16)
} }
return unicodeStr return unicodeStr
},
couponShare (item, callBack) {
let { is_contact, id } = item
let obj = {
couponId: id,
shareType: 1
}
if (is_contact) obj.userList = [
{
userId: is_contact
}
]
else obj.shareType = 0
couponApi.getCouponShared(obj).then(res => {
callBack(res.url)
})
} }
} }
} }
...@@ -40,6 +40,7 @@ router.beforeEach((to, from, next) => { ...@@ -40,6 +40,7 @@ router.beforeEach((to, from, next) => {
/* 路由发生变化修改页面背景色 */ /* 路由发生变化修改页面背景色 */
if (to.meta.backgroundColor) document.documentElement.style.backgroundColor = to.meta.backgroundColor if (to.meta.backgroundColor) document.documentElement.style.backgroundColor = to.meta.backgroundColor
if (to.matched.some(recode => recode.meta.noAuth)) { if (to.matched.some(recode => recode.meta.noAuth)) {
store.dispatch('registerHttp')
store.state.app.showWindow = true store.state.app.showWindow = true
} else { } else {
store.dispatch('navigation') store.dispatch('navigation')
......
...@@ -3,8 +3,16 @@ const pages = { ...@@ -3,8 +3,16 @@ const pages = {
name: 'index' name: 'index'
}, { }, {
name: 'list' name: 'list'
}, }
], ],
openEnterpriseChat: [
{
name: 'index',
meta: {
noAuth: true
}
}
]
} }
let routes = [ let routes = [
{ {
......
<template>
</template>
<script type='text/ecmascript-6'>
import { wxConfig } from '@/api'
export default {
name: '',
data () {
return {
text:''
}
},
mounted () {
let { userId } = this.getQuery()
this.text = userId
wxConfig.init(['openEnterpriseChat']).then(() => {
wxConfig.openEnterpriseChat({
externalUserIds: [userId]
})
})
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ No newline at end of file
...@@ -3,18 +3,25 @@ ...@@ -3,18 +3,25 @@
<div class="tab"> <div class="tab">
<tab <tab
:list="tab" :list="tab"
:updata="updata"
@change="change" @change="change"
> >
</tab> </tab>
<dropdown-menu class="menu" title="业务类型"></dropdown-menu> <dropdown-menu
class="menu"
title="业务类型"
:data="businessList"
@confirm="businessConfirm"
></dropdown-menu>
</div> </div>
<search-box <search-box
@search="search" @search="search"
:keyword="keyword" :keyword="materialName"
:option="option" :option="option"
placeholder="输入关键词" placeholder="输入关键词"
class="attachment" class="attachment"
@change="changeSort"
:index="sort"
></search-box> ></search-box>
<template v-if="flag"> <template v-if="flag">
<template v-if="list.length"> <template v-if="list.length">
...@@ -31,6 +38,7 @@ ...@@ -31,6 +38,7 @@
> >
<psd <psd
:item="i" :item="i"
@send="sendMessage"
hidePYQ hidePYQ
/> />
</div> </div>
...@@ -46,42 +54,19 @@ ...@@ -46,42 +54,19 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { psdMixin } from '@/mixins' import { psdMixin, businessMixin, pageMixin, shareMixin } from '@/mixins'
export default { export default {
mixins: [psdMixin], mixins: [psdMixin, businessMixin, pageMixin, shareMixin],
name: '', name: '',
data () { data () {
return { return {
tab: ['新车素材', '活动海报', '朋友圈素材', '门店服务'],
keyword: '',
flag: true,
list: new Array(10).fill('121'),
total: 0,
pageNum: 1
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
search () {
},
change () {
},
getList () {
},
onReachBottom () {
let { total, pageNum, list } = this
this.$refs.scrollView.loading = false
if (list.length == total || Math.ceil(total / 10) < pageNum) {
this.$refs.scrollView.finished = true
return
}
this.pageNum = pageNum + 1
this.getList()
}
} }
} }
</script> </script>
......
...@@ -2,13 +2,15 @@ ...@@ -2,13 +2,15 @@
<div class="layout"> <div class="layout">
<search-box <search-box
@search="search" @search="search"
:keyword="keyword" :keyword="materialName"
:showDropdown="false" :showDropdown="false"
showMenu showMenu
single single
placeholder="输入关键词" placeholder="输入关键词"
@menuSelect="menuSelect" @menuSelect="menuSelect"
title="素材组" title="素材组"
:option="psdGroupList"
:updata="updata"
></search-box> ></search-box>
<van-dropdown-menu <van-dropdown-menu
active-color="#3975C6" active-color="#3975C6"
...@@ -21,15 +23,20 @@ ...@@ -21,15 +23,20 @@
<div class="sprite-icon icon-down"></div> <div class="sprite-icon icon-down"></div>
</div> </div>
</template> </template>
<menu-checkbox @confirm="confirm" title="业务类型" /> <menu-checkbox
@confirm="businessConfirm"
title="业务类型"
:data="businessList"
/>
</van-dropdown-item> </van-dropdown-item>
<van-dropdown-item <van-dropdown-item
:options="option" :options="option"
v-model="test" v-model="sort"
@change="changeSort"
> >
<template #title> <template #title>
<div class="menu-title flex"> <div class="menu-title flex">
{{option[test].text}} {{option[sort].text}}
<div class="sprite-icon icon-down"></div> <div class="sprite-icon icon-down"></div>
</div> </div>
</template> </template>
...@@ -50,7 +57,8 @@ ...@@ -50,7 +57,8 @@
> >
<psd <psd
:item="i" :item="i"
hidePYQ @send="sendMessage"
@share="shareToExternalMoments"
/> />
</div> </div>
</template> </template>
...@@ -64,55 +72,18 @@ ...@@ -64,55 +72,18 @@
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { psdMixin } from '@/mixins' import { psdMixin, businessMixin, pageMixin, shareMixin} from '@/mixins'
export default { export default {
name: '', name: '',
mixins: [psdMixin], mixins: [psdMixin, businessMixin, pageMixin, shareMixin],
data () { data () {
return { return {}
keyword: '',
test: 0,
flag: true,
list: new Array(10).fill('121'),
total: 0,
pageNum: 1,
businessText: '全部'
}
}, },
mounted () { mounted () {
},
methods: {
confirm (chooseList) {
console.log(chooseList)
if (chooseList.length) {
let text = []
chooseList.map(e => {
text.push(e.text)
})
this.businessText = `${text.join(',').substring(0, 5)}...`
} else {
this.businessText = '全部'
}
},
menuSelect(e){
console.log(e)
},
search (e) {
}, },
getList () { methods: {
},
onReachBottom () {
const { total, pageNum, list } = this
this.$refs.scrollView.loading = false
if (list.length === total || Math.ceil(total / 10) < pageNum) {
this.$refs.scrollView.finished = true
return
}
this.pageNum = pageNum + 1
this.getList()
}
} }
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!