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
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
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
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
......@@ -7,23 +7,13 @@
* @LastEditTime: 2021-06-17 18:23:27
*/
import ssoApi from './ssoApi'
import liveApi from './liveApi'
import couponApi from './couponApi'
import activityApi from './activityApi'
import merchantsApi from './merchantsApi'
import wxConfig from './wxConfig'
import shopmallApi from './shopmallApi'
import boutiquecouponApi from './boutiquecouponApi'
import equityApi from './equityApi'
import giftApi from './giftApi'
import marketingApi from './marketingApi'
export {
ssoApi,
couponApi,
wxConfig,
shopmallApi,
activityApi,
liveApi,
boutiquecouponApi,
equityApi,
giftApi
merchantsApi,
marketingApi
}
\ 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
const url = '/rop-scrm-equity/router'
const url = '/rop-scrm-marketing/router'
export default {
/**套餐分页查询 */
getEquityList (pageNum) {
let data = {
method: 'scrm.api.equity.package.info.list.with.page',
pageSize: 10,
state: 1,
pageNum
}
/**素材列表 */
getPsdList (data) {
data.method = 'marketing.api.material.list'
data.pageNum = 1
data.pageSize = 9999
data.flag = 1
return window.$HTTP({
url,
data
})
},
/**套餐详情 */
getEquityDetail (data) {
data.method = 'scrm.api.equity.main.page.package.detail.get'
/** 素材组列表 */
getPsdGroupList (data = {}) {
data.method = 'marketing.api.material.group.list'
return window.$HTTP({
url,
data
})
},
/** 获取套餐分享链接 */
getEquityShared (data) {
data.method = 'scrm.api.equity.package.info.share'
/** 素材发送/阅读埋点 */
sendReadBuriedPoint (params) {
let data = {
method: 'marketing.api.open.material.sendReadBuriedPoint',
list: [params]
}
return window.$HTTP({
url,
data
})
},
}
}
\ 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
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 = {
if (e == 'chooseImage') jsApiList.push('getLocalImgData')
})
let [redirectUrl] = window.location.href.split('#')
const { corpId } = util.getLocalStorage('dj_scrm_corpId')
const { corpId } = util.getLocalStorage('dj_scrm_corpId') || util.getQuery()
/** 获取企微应用AgentConfig */
let data = {
corpId,
......@@ -57,7 +57,7 @@ const WxConfig = {
* expireTime 失效时间
* expireInterval 失效间隔
* appId 微信应用ID
* envVersion 要打开的小程序版本。正式版为:release,体验版为:trial,开发版为:develop,仅在微信外打开时生效
* envVersion 要打开的小程序版本。正式版为:release 体验版为:trial 开发版为:develop,仅在微信外打开时生效
*/
console.log('请求', data)
return window.$HTTP({
......@@ -174,10 +174,12 @@ const WxConfig = {
/**发表内容到客户朋友圈 */
shareToExternalMoments (params) {
return new Promise(resolve => {
return new Promise((resolve, reject) => {
wx.invoke('shareToExternalMoments', params, res => {
if (res.err_msg == 'shareToExternalMoments:ok') {
resolve()
} else {
reject(res)
}
})
})
......@@ -185,7 +187,7 @@ const WxConfig = {
/**打开会话 */
openEnterpriseChat ({ externalUserIds = [], groupName = '', userIds = [], chatId = '' }) {
return new Promise(resolve => {
return new Promise((resolve, reject) => {
userIds = userIds.join(';')
externalUserIds = externalUserIds.join(';')
wx.openEnterpriseChat({
......@@ -201,6 +203,7 @@ const WxConfig = {
if (res.errMsg.indexOf('function not exist') > -1) {
Notify('版本过低请升级')
}
reject()
}
})
})
......
......@@ -75,12 +75,6 @@ img {
.van-dropdown-menu {
margin-left: auto;
.arrow {
right: 8px;
z-index: 998;
}
.icon-down {
transition: all 0.25s;
}
......
.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;}
.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-eye { width: 13px; height: 8px; background-position: -22px -74px;}
.icon-send { width: 10px; height: 10px; background-position: -64px -44px;}
.icon-menu-active { width: 22px; height: 20px; background-position: -32px -44px;}
\ No newline at end of file
.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

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 @@
:single="single"
@confirm="confirm"
:title="title"
:data="data"
/>
</van-dropdown-item>
</van-dropdown-menu>
......@@ -24,7 +25,11 @@ export default {
name: 'DropdownMenu',
props: {
single: Boolean,
title: String
title: String,
data: {
type: Array,
default: () => []
}
},
data () {
return {
......@@ -34,9 +39,6 @@ export default {
mounted () {
},
methods: {
close () {
// this.$refs.menu.toggle()
},
confirm (e) {
this.$emit('confirm', e)
}
......@@ -50,8 +52,8 @@ export default {
/deep/.van-dropdown-menu__bar {
width: 44px;
height: 44px !important;
.sprite-icon{
transition: all .25s;
.sprite-icon {
transition: all 0.25s;
}
.icon-menu-active {
display: none;
......
......@@ -8,29 +8,18 @@
:class="['item text-center',{'active':i.active}]"
:key="index"
@click="choose(i,index)"
> {{i.text}}</div>
>{{i.text}}</div>
</template>
</div>
</div>
<div class="menu-btn-box">
<template v-if="showReset">
<van-button
block
round
@click="reset"
>
重置
</van-button>
</template>
<template v-else>
<van-button
block
round
@click="close"
>
取消
</van-button>
</template>
<van-button
block
round
@click="close(1)"
>
{{showReset?'重置':'取消'}}
</van-button>
<van-button
block
round
......@@ -48,44 +37,20 @@ export default {
name: 'MenuCheckbox',
props: {
single: Boolean,
title: String
title: String,
data: {
type: Array,
default: () => []
}
},
data () {
return {
showReset: false,
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
}
]
list: [],
}
},
mounted () {
this.list = this.data
},
methods: {
choose (e, index) {
......@@ -120,18 +85,18 @@ export default {
confirm () {
let { list } = this
let chooseList = []
try {
list.map(e => {
if (!e.value && e.active) throw e
if (e.active) chooseList.push(e)
})
} catch (e) {
chooseList = []
}
list.map(e => {
if (e.active && e.value) chooseList.push(e)
})
this.$emit('confirm', chooseList)
this.close()
},
close () {
close (click) {
let { showReset } = this
if (click && showReset) {
this.reset()
return
}
this.$parent.close()
}
}
......@@ -157,7 +122,7 @@ export default {
padding: 0 12px;
color: #666;
font-size: 14px;
transition: all .25s;
transition: all 0.25s;
}
.active {
border-color: var(--themeColor);
......
<template>
<div class="psd-item">
<div class="title flex">
产品操作手册(这里显示素材名称)
{{item.materialName}}
<template v-if="!hidePYQ">
<div class="sprite-icon icon-PYQ"></div>
<div class="sprite-icon icon-PYQ" @click="onEmit('share',item)"></div>
</template>
</div>
<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 class="bottom flex">
<div class="num flex">
<div class="sprite-icon icon-send"></div>
998
{{item.sendNum}}
</div>
<div class="num flex">
<div class="sprite-icon icon-eye"></div>
10086
{{item.readNum}}
</div>
<van-button
block
round
color="#3975C6"
@click="send"
@click="onEmit('send',item)"
>
发送
</van-button>
......@@ -44,8 +50,8 @@ export default {
mounted () {
},
methods: {
send () {
onEmit (name, item) {
this.$emit(name, item)
}
}
}
......
......@@ -11,13 +11,17 @@
<template v-if="showDropdown">
<van-dropdown-menu active-color="#3975C6">
<van-dropdown-item
v-model="value"
:options="option"
v-model="value"
@change="onEmit($event,'change')"
/>
<div class="arrow y-center">
<div class="sprite-icon icon-down"></div>
</div>
>
<template #title>
<div class="menu-title flex">
{{option[value].text}}
<div class="sprite-icon icon-down"></div>
</div>
</template>
</van-dropdown-item>
</van-dropdown-menu>
</template>
<template v-if="showMenu">
......@@ -25,6 +29,7 @@
@confirm="onEmit($event,'menuSelect')"
:single="single"
:title="title"
:data="option"
></dropdown-menu>
</template>
</div>
......
......@@ -10,9 +10,13 @@
>
<template v-for="(i,index) in data">
<van-tab
:title="i"
:key="index"
></van-tab>
>
<template #title>
{{i}}
</template>
</van-tab>
</template>
</van-tabs>
</div>
......@@ -64,7 +68,7 @@ export default {
</script>
<style lang='scss'>
.TAB{
.TAB {
position: relative;
}
.sticky {
......
......@@ -8,15 +8,22 @@
*/
// 本地环境配置
module.exports = {
envVersion: "develop",
envVersion: 'trial',
request: {
baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址,
baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间
timeout: 180000,
// 携带凭证
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: {
data_key: 'data',
......
......@@ -15,7 +15,7 @@ export const fetchConfig = function(isEnv = true) {
Object.assign(request, { timeout })
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 = {
install(vue, config) {
......
......@@ -43,7 +43,7 @@ fetchConfig(!isMock).then(res => {
// 设置 js中可以访问 $cdn
Vue.use(cfg)
window.$fetchConfig = res
// if (res.vconsole) new VConsole()
if (res.vconsole) new VConsole()
/**登录过期 重新登录 */
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
import businessMixin from './businessMixin'
import shareMixin from './shareMixin'
import pageMixin from './pageMixin'
import psdMixin from './psdMixin'
export {
businessMixin,
shareMixin,
pageMixin,
psdMixin
......
import { marketingApi } from '@/api'
export default {
data () {
return {
tabIndex: 0,
pageNum: 1,
list: [],
total: 0,
flag: false,
updata: new Date().getTime()
businessText: '全部',
materialName: '',
sort: 0,
businessType: '',
groupId: ''
}
},
mounted () {
let { tabIndex } = this.getQuery()
if (tabIndex) {
this.tabIndex = Number(tabIndex)
this.updata = new Date().getTime()
this.init()
let { groupId } = this.getQuery()
if (groupId) {
this.groupId = groupId
return
}
if (this.$route.meta.isTab) this.init()
if (this.$route.name != 'psd') {
this.init()
}
},
methods: {
init () {
this.showLoading()
this.getList(this.pageNum)
this.getList()
},
search (e) {
this.materialName = e
this.clearData()
},
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()
},
clearData () {
this.flag = false
this.pageNum = 1
this.list = []
if (this.$refs.scrollView) this.$refs.scrollView.finished = false
this.init()
},
onReachBottom () {
let { total, pageNum, list } = this
this.$refs.scrollView.loading = false
if (list.length == total) {
this.$refs.scrollView.finished = true
return
}
if (Math.ceil(total / 10) > pageNum) {
this.pageNum = pageNum + 1
this.init()
changeSort (e) {
this.sort = e
this.clearData()
},
businessConfirm (chooseList) {
console.log(chooseList)
if (chooseList.length) {
let text = []
let businessType = []
chooseList.map(e => {
text.push(e.text)
businessType.push(e.value)
})
this.businessText = `${text.join(',').substring(0, 5)}...`
this.businessType = businessType.join(',')
} 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
import { marketingApi } from '@/api'
export default {
data() {
data () {
return {
option: [
{ text: '上传时间优先', value: 0 },
{ text: '发送次数优先', value: 1 },
{ 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: {
......
import { couponApi, wxConfig } from '@/api'
import { wxConfig, marketingApi } from '@/api'
export default {
data () {
return {
......@@ -6,195 +6,95 @@ export default {
}
},
mounted () {
if (this.$route.meta.isTab || this.$route.meta.isIndex) this.wxInit()
this.wxInit()
},
methods: {
wxInit () {
let _this = this
wxConfig.init(['shareAppMessage', 'sendChatMessage', 'getCurExternalContact', 'getContext']).then(() => {
wxConfig.init(['getContext', 'shareAppMessage', 'sendChatMessage', 'shareToExternalMoments']).then(() => {
wxConfig.getContext().then(({ entry }) => {
_this.$parent.entry = entry
_this.entry = entry
})
})
},
showShareModel (i = {}) {
let {
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)
})
shareToExternalMoments (i) {
this.sendMessage(i, true)
},
sendMessage (i) {
const { shopmall_appid } = window.$fetchConfig
let { merchantId, merchantName, userName, sapCode } = this.getLocalStorage('dj_scrm_userInfo')
let { tabIndex, entry } = this
let { name } = this.$route
let { userId, id, couponName, activityName, packageName, goodsName, goodsImage, discountType } = i
let query = `merchantId=${merchantId}`
sendMessage (i, isPyq) {
const { shopmall_appid, envVersion } = window.$fetchConfig
const path = 'pages/psdView/psdView'
const { merchantId, uuid, sapCode } = this.getLocalStorage('dj_scrm_userInfo')
const { entry } = this
const { materialName, id, titleUrl, materialTitle, description } = i
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}`
const entryType = entry != 'normal'
this.showLoading()
if (name === 'coupon') { /**卡券 */
let desc = '您的专属服务顾问为您发来了优惠券,请点击领取~'
let imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-yh-10004.png'
if (tabIndex == 0) {
let path = 'packageMine/pages/boutique/gift/gift'
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,
query,
appId: shopmall_appid
})
.then(url => {
this.shareAppMessage(url, desc, couponName, imgUrl)
marketingApi.sendReadBuriedPoint({
materialId: id,
type: 1,
merchantId,
staffUuid: uuid
}).then(() => {
wxConfig.createMiniprogramUrlLink({
path,
query,
appId: shopmall_appid,
envVersion
})
.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 必填
},
}
]
}).then(() => {
this.hideLoading()
})
.catch(err => {
this.hideLoading()
})
} 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 (name === 'activity') { /**活动 */
if (tabIndex == 0) {
let imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-ms-10004.png'
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 => {
this.shareAppMessage(url, '您有一个秒杀活动可参加', activityName, imgUrl)
})
} else {
/**直播 */
}
} 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
.sendChatMessage({
msgtype: 'miniprogram',
miniprogram: params,
msgtype,
[msgtype]: params,
enterChat: false
})
.then(() => {
this.hideLoading()
})
.catch(err => {
console.log('当前会话', err)
console.log(err)
this.hideLoading()
})
},
shareAppMessage (link, desc, title, imgUrl) {
shareAppMessage (params) {
wxConfig
.shareAppMessage({
title,
desc,
link,
imgUrl
})
.shareAppMessage(params)
.then(() => {
this.hideLoading()
})
......@@ -208,22 +108,6 @@ export default {
unicodeStr += '@' + chineseStr.charCodeAt(i).toString(16)
}
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) => {
/* 路由发生变化修改页面背景色 */
if (to.meta.backgroundColor) document.documentElement.style.backgroundColor = to.meta.backgroundColor
if (to.matched.some(recode => recode.meta.noAuth)) {
store.dispatch('registerHttp')
store.state.app.showWindow = true
} else {
store.dispatch('navigation')
......
......@@ -3,8 +3,16 @@ const pages = {
name: 'index'
}, {
name: 'list'
},
}
],
openEnterpriseChat: [
{
name: 'index',
meta: {
noAuth: true
}
}
]
}
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
......@@ -3,18 +3,25 @@
<div class="tab">
<tab
:list="tab"
:updata="updata"
@change="change"
>
</tab>
<dropdown-menu class="menu" title="业务类型"></dropdown-menu>
<dropdown-menu
class="menu"
title="业务类型"
:data="businessList"
@confirm="businessConfirm"
></dropdown-menu>
</div>
<search-box
@search="search"
:keyword="keyword"
:keyword="materialName"
:option="option"
placeholder="输入关键词"
class="attachment"
@change="changeSort"
:index="sort"
></search-box>
<template v-if="flag">
<template v-if="list.length">
......@@ -31,6 +38,7 @@
>
<psd
:item="i"
@send="sendMessage"
hidePYQ
/>
</div>
......@@ -46,42 +54,19 @@
</template>
<script type='text/ecmascript-6'>
import { psdMixin } from '@/mixins'
import { psdMixin, businessMixin, pageMixin, shareMixin } from '@/mixins'
export default {
mixins: [psdMixin],
mixins: [psdMixin, businessMixin, pageMixin, shareMixin],
name: '',
data () {
return {
tab: ['新车素材', '活动海报', '朋友圈素材', '门店服务'],
keyword: '',
flag: true,
list: new Array(10).fill('121'),
total: 0,
pageNum: 1
}
},
mounted () {
},
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>
......
......@@ -2,13 +2,15 @@
<div class="layout">
<search-box
@search="search"
:keyword="keyword"
:keyword="materialName"
:showDropdown="false"
showMenu
single
placeholder="输入关键词"
@menuSelect="menuSelect"
title="素材组"
:option="psdGroupList"
:updata="updata"
></search-box>
<van-dropdown-menu
active-color="#3975C6"
......@@ -21,15 +23,20 @@
<div class="sprite-icon icon-down"></div>
</div>
</template>
<menu-checkbox @confirm="confirm" title="业务类型" />
<menu-checkbox
@confirm="businessConfirm"
title="业务类型"
:data="businessList"
/>
</van-dropdown-item>
<van-dropdown-item
:options="option"
v-model="test"
v-model="sort"
@change="changeSort"
>
<template #title>
<div class="menu-title flex">
{{option[test].text}}
{{option[sort].text}}
<div class="sprite-icon icon-down"></div>
</div>
</template>
......@@ -50,7 +57,8 @@
>
<psd
:item="i"
hidePYQ
@send="sendMessage"
@share="shareToExternalMoments"
/>
</div>
</template>
......@@ -64,55 +72,18 @@
</div>
</template>
<script type='text/ecmascript-6'>
import { psdMixin } from '@/mixins'
import { psdMixin, businessMixin, pageMixin, shareMixin} from '@/mixins'
export default {
name: '',
mixins: [psdMixin],
mixins: [psdMixin, businessMixin, pageMixin, shareMixin],
data () {
return {
keyword: '',
test: 0,
flag: true,
list: new Array(10).fill('121'),
total: 0,
pageNum: 1,
businessText: '全部'
}
return {}
},
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 () {
},
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>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!