Commit b5440d49 by 前端

Merge branch 'liwk_dev' into 'master'

Liwk dev——合并到主干

See merge request !1
2 parents 7dce29bc 5a6483d7
......@@ -15,7 +15,7 @@
"autoprefixer": "^8.0.0",
"core-js": "^3.6.4",
"dayjs": "^1.10.5",
"glsx-common": "^1.4.8",
"glsx-common": "^1.4.9",
"lib-flexible": "^0.3.2",
"postcss-loader": "^6.2.0",
"sha1": "^1.1.1",
......
......@@ -19,7 +19,7 @@
</noscript>
<div id="app"></div>
<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
<script src="//open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
<!-- 使用CDN加速的JS文件,配置在vue.config.js下 -->
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
......
......@@ -9,8 +9,10 @@
import ssoApi from './ssoApi'
import wwbenchApi from './wwbenchApi'
import wxConfig from './wxConfig'
import marketingApi from './marketingApi'
export {
ssoApi,
wwbenchApi,
wxConfig
wxConfig,
marketingApi
}
\ No newline at end of file
const url = '/rop-scrm-marketing/router'
export default {
/**素材列表 */
getPsdList (data) {
data.method = 'marketing.api.material.list'
data.pageNum = 1
data.pageSize = 9999
data.flag = 2
return window.$HTTP({
url,
data
})
},
/** 素材组列表 */
getPsdGroupList (data = {}) {
data.method = 'marketing.api.material.group.list'
return window.$HTTP({
url,
data
})
},
/** 素材发送/阅读埋点 */
sendReadBuriedPoint (params) {
let data = {
method: 'marketing.api.open.material.sendReadBuriedPoint',
list: [params]
}
return window.$HTTP({
url,
data
})
}
}
\ No newline at end of file
const url = '/rop-scrm-wwbench/router'
export default {
/**统计我的待办数据 */
getTaskData(data = {}) {
getTaskData (data = {}) {
data.method = 'scrm.api.wwbench.user.task.list.count'
return window.$HTTP({
url,
......@@ -9,9 +9,9 @@ export default {
})
},
/** 查询我的待办 */
getTasksList(data = {}) {
getTasksList (data = {}) {
data.method = 'scrm.api.wwbench.user.task.list.get'
data.taskTypes = [3, 4, 5]
data.taskTypes = [3, 4, 5, 6]
return window.$HTTP({
url,
data,
......@@ -19,7 +19,7 @@ export default {
})
},
/**更新待办状态 */
updateTasks(data = {}) {
updateTasks (data = {}) {
data.method = 'scrm.api.wwbench.user.task.list.update'
return window.$HTTP({
url,
......
.sprite-icon { background-image: url(../images/sprite.png);background-size: 77px 66px;}
.sprite-icon { background-image: url(../images/sprite.png);background-size: 139px 104px;}
.icon-default-avatar { width: 44px; height: 44px; background-position: 0px 0px;}
.icon-down { width: 12px; height: 12px; background-position: 0px -54px;}
.icon-index-tips { width: 23px; height: 23px; background-position: -54px 0px;}
\ No newline at end of file
.icon-down { width: 12px; height: 12px; background-position: -96px -63px;}
.icon-eye { width: 13px; height: 8px; background-position: 0px -96px;}
.icon-file { width: 26px; height: 26px; background-position: -42px -54px;}
.icon-index-tips { width: 23px; height: 23px; background-position: -96px 0px;}
.icon-link { width: 32px; height: 32px; background-position: 0px -54px;}
.icon-pdf { width: 32px; height: 34px; background-position: -54px 0px;}
.icon-PYQ { width: 21px; height: 20px; background-position: -96px -33px;}
.icon-send { width: 10px; height: 10px; background-position: -129px 0px;}
\ No newline at end of file

1.79 KB | W: | H:

8.72 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="['scroll-view', ScrollViewclass]">
<van-list
v-model="loading"
:finished="finished"
finished-text="到底啦!!"
@load="onLoad"
offset="100"
:immediate-check="false"
>
<slot></slot>
</van-list>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ScrollView',
data () {
return {
loading: false,
finished: false,
}
},
props: ['ScrollViewclass'],
mounted () {
},
methods: {
onLoad () {
this.$emit('ReachBottom')
},
}
}
</script>
<style scoped lang='scss'>
.scroll-view {
overflow-y: scroll;
box-sizing: border-box;
}
</style>
\ No newline at end of file
<template>
<form :class="['search-box','flex',{'max':!showDropdown}]" action="">
<van-search
v-model="searchValue"
:placeholder="placeholder"
@search="onEmit($event,'search')"
@clear="onEmit('','search')"
@focus="onEmit('','focus')"
:maxlength="maxlength"
/>
<template v-if="showDropdown">
<van-dropdown-menu active-color="#3975C6">
<van-dropdown-item
v-model="value"
:options="option"
@change="onEmit($event,'change')"
/>
<div class="arrow y-center">
<div class="sprite-icon icon-down"></div>
</div>
</van-dropdown-menu>
</template>
</form >
</template>
<script type='text/ecmascript-6'>
export default {
name: 'SearchBox',
props: {
keyword: String,
index: {
type: Number,
default: 0
},
updata: {
type: Number,
default: new Date().getTime()
},
showDropdown: {
type: Boolean,
default: true
},
placeholder: String,
maxlength: {
type: Number,
default: 30
}
},
data () {
return {
value: 0,
option: [
{ text: '优惠券', value: 0 },
{ text: '精品礼券', value: 1 },
{ text: '商品订单', value: 2 },
{ text: '会员服务', value: 3 }
],
searchValue: ''
}
},
mounted(){
console.log('searchValue',this.searchValue)
},
watch: {
'updata' (n) {
this.value = this.index
},
'keyword' (n) {
this.searchValue = n
},
},
methods: {
onEmit (e, name) {
this.$emit(name, e)
}
}
}
</script>
<style lang='scss'>
.search-box {
height: 50px;
background: #fff;
box-shadow: 0px 1px 0px 0px #e9e9e9;
padding-right: 16px;
position: relative;
margin-bottom: 0;
.van-search {
width: 263px;
padding: 4.5px 8px;
height: 100%;
background: #fff;
.van-search__content {
background-color: #fff;
border: 1px solid #cdd1d4;
border-radius: 16px;
}
}
.van-dropdown-menu {
margin-left: auto;
.arrow {
right: 8px;
z-index: 998;
}
.van-dropdown-menu__bar--opened ~ .arrow .sprite-icon {
transform: rotate(-180deg);
transition: all 0.25s;
}
.van-dropdown-menu__bar {
background-color: #fff;
box-shadow: none;
.van-dropdown-menu__title {
color: #545454 !important;
font-size: 16px;
&::after {
display: none;
}
}
}
}
}
.max {
padding-right: 0;
.van-search {
width: 100%;
}
}
.van-icon-search:before {
color: #cdd1d4;
}
</style>
\ No newline at end of file
......@@ -17,6 +17,10 @@
<template #icon="props">
<img :src="props.active ? i.active : i.inactive" />
</template>
<div
class="line y-center"
v-if="index < data.length - 1"
></div>
</van-tabbar-item>
</template>
</van-tabbar>
......@@ -37,13 +41,13 @@ export default {
}
}
},
data() {
data () {
return {
value: this.routerName
}
},
methods: {
change(value) {
change (value) {
this.$emit('change', value)
}
}
......@@ -58,21 +62,18 @@ export default {
border-radius: 10px 10px 0px 0px;
overflow: hidden;
z-index: 3;
&::after {
width: 1px;
height: 34px;
background: #e9e9e9;
position: absolute;
left: 50%;
top: 8px;
transform: translateX(-50%);
content: '';
}
.van-tabbar-item--active {
color: var(--themeColor);
}
.van-tabbar-item {
font-size: 16px;
position: relative;
.line {
width: 1px;
height: 34px;
background: #e9e9e9;
right: 0;
}
}
.van-tabbar-item__icon img {
width: 20px;
......
......@@ -8,12 +8,52 @@
*/
// 本地环境配置
module.exports = {
title: '嘀加企微助手',
envVersion: 'trial',
title: '嘀加企微管家',
request: {
// baseURL: 'http://scrm.test.glsx.com.cn/scrm-wechat' // 测试项目地址
baseURL: 'http://192.168.1.5:8083/scrm-wechat' // 测试项目地址
baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
APPID: 'xxx',
APPSECRET: 'xxx',
cdn: 'https://www.xxx.cn/static'
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
errId_logout_value: '21',
logout_function: 'reLogin',
code_message_map: {}
},
secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b",
shopmall_appid: "wxe10067a63c1856ac",
sign: {
appKey: "48e5e13229b82c1b4e6e8c96151f0637",
format: "json",
locale: "zh_CN",
source: "scrm-main",
v: "1.0.0",
},
vconsole: true,
text: '群发助手',
subsystemInfo: {
activity: {
path: '/dj-scrm-wx-work-attachment-activity/#/'
},
customer: {
path: '/dj-scrm-wx-work-attachment-customer/#/'
},
report: {
path: '/dj-scrm-wx-work-attachment-report/#/'
},
upload: {
path: '/dj-scrm-wx-work-file-upload/#/'
},
sop: {
path: '/dj-scrm-wx-work-sop/#/'
}
}
}
\ No newline at end of file
......@@ -9,16 +9,17 @@
// 根据环境引入不同配置 process.env.VUE_APP_ENV
let config = require('./conf.js')
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) {
export const fetchConfig = function (isEnv = true) {
if (isEnv) {
let { request } = config
Object.assign(request, { timeout })
return Promise.resolve(config)
}
return window.fetch('https://oss-config.test.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-main-config', {}).then(res => res.json())
// /**测试mock */ return window.fetch('https://oss-config.dev.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-main-config', {}).then(res => res.json())
/**生产 */ return window.fetch('https://oss-config.test.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-main-config', {}).then(res => res.json())
}
export const cfg = {
install(vue, config) {
install (vue, config) {
vue.prototype.$config = config
}
}
\ No newline at end of file
......@@ -38,7 +38,7 @@ Vue.prototype.to = function (name, params) {
Vue.config.productionTip = false
import VConsole from 'vconsole'
const isMock = true
const isMock = ['prod','production'].includes(process.env.NODE_ENV)
fetchConfig(!isMock).then(res => {
// 从配置服务器获取动态配置
// 设置 js中可以访问 $cdn
......
import indexMixin from './indexMixin'
import shareMixin from './shareMixin'
export {
indexMixin
indexMixin,
shareMixin
}
\ No newline at end of file
import { Notify, Dialog } from 'vant'
import { wwbenchApi, ssoApi } from '@/api'
import { wwbenchApi, ssoApi, sopApi } from '@/api'
const { subsystemInfo, text } = window.$fetchConfig
export default {
data() {
data () {
return {
statusEnum: {
0: '去处理',
......@@ -14,7 +14,8 @@ export default {
2: '直播群发任务',
3: '客户群发',
4: '客户群群发',
5: '客户资料完善'
5: '客户资料完善',
6: '营销sop-任务'
},
userInfo: {},
accountList: [],
......@@ -35,7 +36,8 @@ export default {
// { text: '直播群发任务', value: 2 },
{ text: '客户群发', value: 3 },
{ text: '客户群群发', value: 4 },
{ text: '客户资料完善', value: 5 }
{ text: '客户资料完善', value: 5 },
{ text: '营销sop', value: 6 }
],
list: [
{
......@@ -61,11 +63,11 @@ export default {
tasksFlag: false
}
},
mounted() {
mounted () {
this.init()
},
methods: {
init() {
init () {
this.userInfo = this.getLocalStorage('dj_scrm_userInfo')
let accountList = this.getLocalStorage('dj_scrm_accountList')
if (accountList) {
......@@ -79,7 +81,7 @@ export default {
this.getTaskData()
this.initDate()
},
getTaskData() {
getTaskData () {
wwbenchApi.getTaskData().then(data => {
let sum = Number(data.finishTaskCount + data.unFinishTaskCount) || 0
let num = Math.round(Number((Number(data.finishTaskCount) / sum) * 100)) || 0
......@@ -88,7 +90,7 @@ export default {
this.taskCountData = data
})
},
initDate() {
initDate () {
let { dateRangeFormat } = this
let now = new Date()
let minDate = new Date(new Date().setDate(now.getDate() - 30))
......@@ -102,7 +104,7 @@ export default {
endDate
})
},
onConfirmCalendar(e) {
onConfirmCalendar (e) {
let { dateRangeFormat } = this
let [start, end] = e
let startDate = start.format(dateRangeFormat)
......@@ -115,7 +117,7 @@ export default {
endDate
})
},
changeType(e, target) {
changeType (e, target) {
let { dateRange } = this
let [startDate, endDate] = dateRange.split('-')
this[target] = e
......@@ -125,7 +127,7 @@ export default {
endDate
})
},
getTasksList({ startDate = '', endDate = '' }) {
getTasksList ({ startDate = '', endDate = '' }) {
this.showLoading()
let { status, taskType } = this
if (startDate) startDate = `${startDate.replace(/\./g, '-')} 00:00:00`
......@@ -147,7 +149,7 @@ export default {
this.tasksFlag = true
})
},
changeAccount(id) {
changeAccount (id) {
console.log(id)
let { accountList } = this
try {
......@@ -173,33 +175,47 @@ export default {
})
}
},
click(e) {
let { status, taskId, id, taskType } = e
if (status == 2) return
wwbenchApi.updateTasks({ id }).then(res => {
if (taskType == 3 || taskType == 4) {
Dialog.alert({
message: `请去企业微信“消息”列表-“${text}”中进行转发`,
theme: 'round-button',
confirmButtonText: '我知道了',
confirmButtonColor: 'var(--themeColor)'
})
} else {
let sessionId = this.getSessionId()
let { corpId } = this.getLocalStorage('dj_scrm_corpId')
let link = {
1: 'customerDetails',
2: 'customerGroup/mass',
5: 'customer/information'
}[taskType]
if (link) {
let { path } = subsystemInfo['customer']
let url = `${path}${link}?sessionId=${sessionId}&corpId=${corpId}`
if (taskId) url = `${url}&taskId=${taskId}`
window.location.href = url
click (e) {
let { status, id, taskType } = e
if (status == 2 && taskType != 6) return
if (taskType == 6) {
this.jump(e)
} else {
wwbenchApi.updateTasks({ id }).then(res => {
if (taskType == 3 || taskType == 4) {
Dialog.alert({
message: `请去企业微信“消息”列表-“${text}”中进行转发`,
theme: 'round-button',
confirmButtonText: '我知道了',
confirmButtonColor: '#3975C6'
})
} else {
this.jump(e)
}
}
})
})
}
},
jump (e) {
let { taskId, taskType } = e
let sessionId = this.getSessionId()
let { corpId } = this.getLocalStorage('dj_scrm_corpId')
let link = {
1: 'customerDetails',
2: 'customerGroup/mass',
5: 'customer/information',
6: 'home'
}[taskType]
let { path } = subsystemInfo[{
5: 'customer',
6: 'sop'
}[taskType]]
if (link) {
if (!['prod', 'production'].includes(process.env.NODE_ENV)) path = '/dj-scrm-wx-work-main-lwk/#/'
let url = `${path}${link}?sessionId=${sessionId}&corpId=${corpId}`
if (taskId) url = `${url}&taskId=${taskId}`
window.location.href = url
}
}
}
}
import { wxConfig, marketingApi } from '@/api'
export default {
data () {
return {
entry: 'normal'
}
},
mounted () {
this.wxInit()
},
methods: {
wxInit () {
let _this = this
wxConfig.init(['getContext', 'shareAppMessage', 'shareToExternalMoments'])
},
shareToExternalMoments (i) {
this.sendMessage(i, true)
},
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}`
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.sendReadBuriedPoint({ id, merchantId, uuid })
this.hideLoading()
})
.catch(err => {
this.hideLoading()
})
} else {
let params = {
link,
title: materialTitle || materialName,
desc: description || '',
imgUrl: titleUrl || imgUrl
}
this.shareAppMessage(params, { id, merchantId, uuid })
}
})
},
sendReadBuriedPoint ({ id, merchantId, uuid }) {
marketingApi.sendReadBuriedPoint({
materialId: id,
type: 1,
merchantId,
staffUuid: uuid
})
},
shareAppMessage (params, sendParams) {
wxConfig
.shareAppMessage(params)
.then(() => {
this.sendReadBuriedPoint(sendParams)
this.hideLoading()
})
.catch(() => {
this.hideLoading()
})
}
}
}
......@@ -33,12 +33,12 @@ export default {
inactive: require('@/assets/images/icon/workbench.png'),
active: require('@/assets/images/icon/workbench-active.png')
},
// {
// title: '素材库',
// name: 'psd',
// inactive: require('@/assets/images/icon/workbench.png'),
// active: require('@/assets/images/icon/workbench-active.png')
// }
{
title: '营销素材',
name: 'psd',
inactive: require('@/assets/images/icon/psd.png'),
active: require('@/assets/images/icon/psd-active.png')
}
],
showWindow: false
}
......
......@@ -69,7 +69,7 @@
</div>
</div>
<div class="drop-down-box flex">
<div class="item flex">
<div class="item flex left">
<div class="label">状态</div>
<van-dropdown-menu active-color="#3975C6">
<van-dropdown-item
......@@ -139,12 +139,11 @@ import { indexMixin } from '@/mixins'
export default {
name: '',
mixins: [indexMixin],
data() {
data () {
return {}
},
mounted() {},
mounted () { },
methods: {
}
}
</script>
......@@ -202,7 +201,7 @@ export default {
margin-right: 16px;
background: #d8d8d8;
}
.info{
.info {
// max-width: calc(100% - 130px);
max-width: calc(100% - 60px);
}
......@@ -217,7 +216,7 @@ export default {
font-size: 14px;
color: #fff !important;
}
/deep/.van-dropdown-menu__item{
/deep/.van-dropdown-menu__item {
justify-content: flex-start;
}
}
......@@ -243,7 +242,6 @@ export default {
flex: 1;
font-size: 24px;
color: #333333;
.num,
.ball {
height: 46px;
......@@ -302,7 +300,7 @@ export default {
background-color: #f7f7f7;
font-size: 14px;
color: #666666;
justify-content: center;
.label {
width: 53px;
flex-shrink: 0;
......@@ -313,6 +311,9 @@ export default {
color: #666;
}
}
.left {
justify-content: flex-start;
}
}
}
......@@ -364,10 +365,13 @@ export default {
}
.van-dropdown-menu {
height: 100%;
align-items: center;
display: flex;
/deep/.van-dropdown-menu__bar {
background-color: transparent !important;
box-shadow: none;
height: auto;
height: 100%;
}
}
</style>
......
<template>
<div class="nothing">
<img
:src="image"
class="image"
/>
<slot></slot>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'Nothing',
props: {
image: String
},
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.nothing {
display: flex;
padding-top: 103px;
flex-direction: column;
font-size: 12px;
color: #666666;
align-items: center;
box-sizing: border-box;
background-color: #fff;
.image {
width: 266px;
height: 133px;
margin-bottom: 5px;
}
}
</style>
\ No newline at end of file
<template>
<div class="psd-item">
<div class="title flex">
{{item.materialName}}
<template v-if="!hidePYQ">
<div
class="sprite-icon icon-PYQ"
@click="onEmit('share',item)"
></div>
</template>
</div>
<div class="content">
<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)"
class="hide"
></div>
</template>
</div>
<div class="bottom flex">
<div class="num flex">
<div class="sprite-icon icon-send"></div>
{{item.sendNum}}
</div>
<div class="num flex">
<div class="sprite-icon icon-eye"></div>
{{item.readNum}}
</div>
<van-button
block
round
color="#3975C6"
@click="onEmit('send',item)"
>
发送
</van-button>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'Psd',
props: {
item: null,
hidePYQ: Boolean
},
data () {
return {
}
},
mounted () {
},
methods: {
onEmit (name, item) {
this.$emit(name, item)
}
}
}
</script>
<style scoped lang='scss'>
.psd-item {
background: #ffffff;
box-shadow: 0px 4px 8px 0px rgba(224, 224, 224, 0.5);
border-radius: 4px;
.title {
min-height: 39px;
border-bottom: 1px solid rgba(195, 195, 195, 0.3);
padding: 10px 16px;
font-size: 14px;
font-weight: 500;
color: #282829;
box-sizing: border-box;
.icon-PYQ {
margin-left: auto;
flex-shrink: 0;
}
}
.content {
min-height: 60px;
box-sizing: border-box;
padding: 10px 16px;
font-size: 12px;
color: #999999;
.hide {
max-height: 150px;
overflow-y: scroll;
/deep/img {
height: auto;
}
}
}
.bottom {
padding: 0 16px;
height: 32px;
background: #f8f8f8;
border-radius: 0px 0px 4px 4px;
.num {
font-size: 12px;
color: #999999;
margin-right: 24px;
.sprite-icon {
margin-right: 4px;
}
}
.van-button {
width: 60px;
height: 24px;
font-size: 12px;
margin-left: auto;
}
}
}
</style>
\ No newline at end of file
<template>
<div>
素材库
<div class="layout">
<div class="top-box">
<template v-if="userInfo.staffAvatar">
<div class="avatar text-center">
<img :src="userInfo.staffAvatar" />
</div>
</template>
<template v-else>
<div class="sprite-icon icon-default-avatar"></div>
</template>
<div class="name text-hide">Hi {{userInfo.userName}}</div>
<div class="text">营销素材发给客户后,客户的阅读行为将会<br />主动通知你,系统并自动给客户打上指定标签</div>
<search-box
@search="search"
:keyword="materialName"
:showDropdown="false"
placeholder="输入关键词"
@focus="focus"
></search-box>
</div>
<div class="content">
<template v-if="flag">
<template v-if="nothing">
<scroll-view
:class="['list-box']"
@ReachBottom="onReachBottom"
ref="scrollView"
>
<div :class="['box',{'search-style':searchStyle}]">
<template v-if="!searchStyle">
<template v-for="(i,index) in list">
<div
:key="index"
class="item"
@click="jump(i.id)"
>
<img
class="bg"
:src="itemBgUrl[index % 2 == 0 ? 0: 1]"
/>
<div class="text">
<div class="name text-hide">{{i.materialGroupName}}</div>
{{i.materialNum || 0}}
</div>
</div>
</template>
</template>
<template v-else>
<template v-if="list.materialGroupListRpcResponses && list.materialGroupListRpcResponses.length">
<template v-for="i in list.materialGroupListRpcResponses">
<div
class="search-item"
:key="i.id"
>
<div
class="group flex"
@click="jump(i.id)"
>
<div class="sprite-icon icon-file"></div>
{{i.materialGroupName}}
<div class="arrow">
<img src="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/arrow.png" />
</div>
</div>
</div>
</template>
</template>
<template v-if="list.materialToCRpcResponses && list.materialToCRpcResponses.length">
<template v-for="i in list.materialToCRpcResponses">
<div
class="search-item"
:key="i.id"
>
<psd
:item="i"
@send="sendMessage"
@share="shareToExternalMoments"
/>
</div>
</template>
</template>
</template>
</div>
</scroll-view>
</template>
<template v-else>
<nothing
class="nothing-box"
image="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/index-nothing.png"
>暂无可用素材组</nothing>
</template>
</template>
</div>
<!-- <div class="input-tab"></div> -->
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
import Nothing from './Nothing'
import Psd from './Psd'
import { marketingApi } from '@/api'
import { shareMixin } from '@/mixins'
export default {
name: '',
mixins: [shareMixin],
components: { Nothing, Psd },
data () {
return {
itemBgUrl: [
'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/item-1.png',
'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/item-2.png'
],
flag: false,
list: [],
userInfo: window.vm.getLocalStorage('dj_scrm_userInfo'),
materialName: '',
searchStyle: false,
nothing: false
}
},
mounted () {
this.getList()
},
methods: {
jump (groupId) {
let { corpId } = this.getLocalStorage('dj_scrm_corpId')
let query = `?groupId=${groupId}&sessionId=${this.getSessionId()}&corpId=${corpId}`
let url = window.location.origin || `${window.location.protocol}//${window.location.hostname}${window.location.port ? `:${window.location.port}` : ''}`
let path = ['prod', 'production'].includes(process.env.NODE_ENV)
? 'dj-scrm-wx-work-attachment-psd' //测试、生产
: 'dj-scrm-wx-work-main-lwk' //本地调试(可变更)
window.location.href = `/${path}/#/psd/list${query}`
},
onReachBottom (e) {
this.$refs.scrollView.finished = true
},
mounted () {
search (e) {
this.materialName = e
this.getList()
},
methods: {
focus () {
/** */
},
getList () {
this.flag = false
this.list = []
let { materialName } = this
let target = 'getPsdGroupList'
if (materialName) target = 'getPsdList'
this.showLoading()
marketingApi[target]({ materialName }).then(data => {
this.searchStyle = materialName ? true : false
console.log(materialName ? '素材列表' : '素材组', data)
this.list = data
this.hideLoading()
this.flag = true
this.nothing = materialName ? data.materialGroupListRpcResponses || data.materialToCRpcResponses : data.length
})
}
}
}
</script>
<style scoped lang='scss'>
.layout {
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
.top-box {
width: 375px;
height: 222px;
background: var(--themeColor);
font-size: 14px;
color: #ffffff;
position: relative;
.avatar {
position: absolute;
left: 24px;
top: 17px;
width: 40px;
height: 40px;
border-radius: 100%;
overflow: hidden;
}
.icon-default-avatar {
position: absolute;
left: 20px;
top: 13px;
border-radius: 100%;
overflow: hidden;
}
.name {
padding: 17px 34px 8px 72px;
font-size: 18px;
font-weight: 600;
}
.text {
padding-left: 72px;
}
/deep/.search-box {
box-shadow: none;
}
/deep/.van-search {
padding: 16px 24px 0;
background: var(--themeColor);
}
}
.content {
position: relative;
top: -69px;
background: #f7f7f7;
border-radius: 16px 16px 0 0;
overflow: hidden;
.list-box {
height: calc(100vh - 180px);
padding-bottom: 50px;
box-sizing: border-box;
.box {
display: grid;
grid-template-columns: repeat(2, 152px);
justify-content: space-between;
gap: 20px 0;
box-sizing: border-box;
padding: 24px;
}
.search-style {
display: block;
padding: 16px;
.search-item {
margin-bottom: 10px;
.group {
height: 54px;
background: #ffffff;
box-shadow: 0px 3px 10px 0px rgba(223, 228, 234, 0.81);
border-radius: 4px;
margin-bottom: 10px;
box-sizing: border-box;
padding: 0 20px;
font-size: 12px;
color: #333333;
.sprite-icon {
margin-right: 10px;
}
.arrow {
margin-left: auto;
width: 7px;
height: 10px;
}
}
}
}
.item {
width: 155px;
height: 155px;
position: relative;
font-size: 12px;
color: #666666;
.bg {
position: absolute;
left: 0;
top: 0;
}
.text {
position: relative;
z-index: 2;
padding: 89px 15px 0;
.name {
margin-bottom: 2.5px;
font-size: 14px;
color: #333333;
font-weight: 600;
}
}
}
}
.nothing-box {
height: calc(100vh - 180px);
}
}
.input-tab {
width: 100%;
height: 42.52px;
background: #096;
position: fixed;
bottom: 50%;
transform: translateY(-50%);
left: 0;
z-index: 2;
}
}
</style>
\ No newline at end of file
......@@ -51,7 +51,7 @@ const spritesmithFunction = data => {
return `${shared}\n${perSprite}`
}
module.exports = {
publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router hash 模式使用
publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-lwk/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router history模式使用 微信开发环境需打开
outputDir: 'dist', // 生产环境构建文件的目录
assetsDir: 'static', // outputDir的静态资源(js、css、img、fonts)目录
......@@ -60,7 +60,8 @@ module.exports = {
devServer: {
disableHostCheck: true,
port: 9527, // 端口
open: false, // 启动后打开浏览器
open: false, // 启动后打开浏览器.
public:'http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-lwk/#/',
overlay: {
// 当出现编译器错误或警告时,在浏览器中显示全屏覆盖层
warnings: false,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!