Commit 2f6c46db by 李伟康

新增营销素材

1 parent 7dce29bc
.sprite-icon { background-image: url(../images/sprite.png);background-size: 77px 66px;} .sprite-icon { background-image: url(../images/sprite.png);background-size: 80px 77px;}
.icon-default-avatar { width: 44px; height: 44px; background-position: 0px 0px;} .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 \ No newline at end of file
.icon-down { width: 12px; height: 12px; background-position: -33px -54px;}
.icon-index-tips { width: 23px; height: 23px; background-position: 0px -54px;}
.icon-file { width: 26px; height: 26px; background-position: -54px 0px;}
\ No newline at end of file \ No newline at end of file

1.79 KB | W: | H:

3.08 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 \ No newline at end of file
<template>
<div :class="['search-box','flex',{'max':!showDropdown}]">
<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>
</div>
</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: ''
}
},
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;
.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%;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
<template #icon="props"> <template #icon="props">
<img :src="props.active ? i.active : i.inactive" /> <img :src="props.active ? i.active : i.inactive" />
</template> </template>
<div
class="line y-center"
v-if="index < data.length - 1"
></div>
</van-tabbar-item> </van-tabbar-item>
</template> </template>
</van-tabbar> </van-tabbar>
...@@ -37,13 +41,13 @@ export default { ...@@ -37,13 +41,13 @@ export default {
} }
} }
}, },
data() { data () {
return { return {
value: this.routerName value: this.routerName
} }
}, },
methods: { methods: {
change(value) { change (value) {
this.$emit('change', value) this.$emit('change', value)
} }
} }
...@@ -58,21 +62,18 @@ export default { ...@@ -58,21 +62,18 @@ export default {
border-radius: 10px 10px 0px 0px; border-radius: 10px 10px 0px 0px;
overflow: hidden; overflow: hidden;
z-index: 3; z-index: 3;
&::after {
width: 1px;
height: 34px;
background: #e9e9e9;
position: absolute;
left: 50%;
top: 8px;
transform: translateX(-50%);
content: '';
}
.van-tabbar-item--active { .van-tabbar-item--active {
color: var(--themeColor); color: var(--themeColor);
} }
.van-tabbar-item { .van-tabbar-item {
font-size: 16px; font-size: 16px;
position: relative;
.line {
width: 1px;
height: 34px;
background: #e9e9e9;
right: 0;
}
} }
.van-tabbar-item__icon img { .van-tabbar-item__icon img {
width: 20px; width: 20px;
......
...@@ -8,12 +8,34 @@ ...@@ -8,12 +8,34 @@
*/ */
// 本地环境配置 // 本地环境配置
module.exports = { module.exports = {
title: '嘀加企微助手', envVersion: "develop",
title: '嘀加企微管家',
request: { request: {
// baseURL: 'http://scrm.test.glsx.com.cn/scrm-wechat' // 测试项目地址 baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址,
baseURL: 'http://192.168.1.5:8083/scrm-wechat' // 测试项目地址 // 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
}, },
APPID: 'xxx', response: {
APPSECRET: 'xxx', data_key: 'data',
cdn: 'https://www.xxx.cn/static' 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: false
} }
\ No newline at end of file \ No newline at end of file
...@@ -38,7 +38,7 @@ Vue.prototype.to = function (name, params) { ...@@ -38,7 +38,7 @@ Vue.prototype.to = function (name, params) {
Vue.config.productionTip = false Vue.config.productionTip = false
import VConsole from 'vconsole' import VConsole from 'vconsole'
const isMock = true const isMock = ['prod','production'].includes(process.env.NODE_ENV)
fetchConfig(!isMock).then(res => { fetchConfig(!isMock).then(res => {
// 从配置服务器获取动态配置 // 从配置服务器获取动态配置
// 设置 js中可以访问 $cdn // 设置 js中可以访问 $cdn
......
...@@ -33,12 +33,12 @@ export default { ...@@ -33,12 +33,12 @@ export default {
inactive: require('@/assets/images/icon/workbench.png'), inactive: require('@/assets/images/icon/workbench.png'),
active: require('@/assets/images/icon/workbench-active.png') active: require('@/assets/images/icon/workbench-active.png')
}, },
// { {
// title: '素材库', title: '营销素材',
// name: 'psd', name: 'psd',
// inactive: require('@/assets/images/icon/workbench.png'), inactive: require('@/assets/images/icon/workbench.png'),
// active: require('@/assets/images/icon/workbench-active.png') active: require('@/assets/images/icon/workbench-active.png')
// } }
], ],
showWindow: false showWindow: false
} }
......
...@@ -139,12 +139,11 @@ import { indexMixin } from '@/mixins' ...@@ -139,12 +139,11 @@ import { indexMixin } from '@/mixins'
export default { export default {
name: '', name: '',
mixins: [indexMixin], mixins: [indexMixin],
data() { data () {
return {} return {}
}, },
mounted() {}, mounted () { },
methods: { methods: {
} }
} }
</script> </script>
...@@ -202,7 +201,7 @@ export default { ...@@ -202,7 +201,7 @@ export default {
margin-right: 16px; margin-right: 16px;
background: #d8d8d8; background: #d8d8d8;
} }
.info{ .info {
// max-width: calc(100% - 130px); // max-width: calc(100% - 130px);
max-width: calc(100% - 60px); max-width: calc(100% - 60px);
} }
...@@ -217,7 +216,7 @@ export default { ...@@ -217,7 +216,7 @@ export default {
font-size: 14px; font-size: 14px;
color: #fff !important; color: #fff !important;
} }
/deep/.van-dropdown-menu__item{ /deep/.van-dropdown-menu__item {
justify-content: flex-start; justify-content: flex-start;
} }
} }
......
<template>
<div class="nothing text-center">
<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 {
padding-top: 103px;
flex-direction: column;
font-size: 12px;
color: #666666;
.image {
width: 266px;
height: 133px;
margin-bottom: 5px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="psd-item">
<div class="title flex">
产品操作手册(这里显示素材名称)
<template v-if="!hidePYQ">
<div class="sprite-icon icon-PYQ"></div>
</template>
</div>
<div class="content">
{{item}}
</div>
<div class="bottom flex">
<div class="num flex">
<div class="sprite-icon icon-send"></div>
998
</div>
<div class="num flex">
<div class="sprite-icon icon-eye"></div>
10086
</div>
<van-button
block
round
color="#3975C6"
@click="send"
>
发送
</van-button>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'Psd',
props: {
item: null,
hidePYQ: Boolean
},
data () {
return {
}
},
mounted () {
},
methods: {
send () {
}
}
}
</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;
}
.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 \ No newline at end of file
<template> <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="keyword"
:showDropdown="false"
placeholder="输入关键词"
@focus="focus"
></search-box>
</div>
<div class="content">
<template v-if="flag">
<template v-if="list.length">
<scroll-view
:class="['list-box']"
@ReachBottom="onReachBottom"
ref="scrollView"
>
<div :class="['box',{'search-style':searchStyle}]">
<template v-for="(i,index) in list">
<template v-if="!searchStyle">
<div
:key="index"
class="item"
@click="jump(i)"
>
<img
class="bg"
:src="itemBgUrl[1]"
/>
<div class="text">
<div class="name text-hide">恒河猴</div>
15
</div>
</div>
</template>
<template v-else>
<div
class="search-item"
:key="index"
>
<div class="group flex">
<div class="sprite-icon icon-file"></div>
恒河猴
<div class="arrow">
<img src="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/arrow.png" />
</div>
</div>
<psd />
</div>
</template>
</template>
</div>
</scroll-view>
</template>
<template v-else>
<nothing image="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/index-nothing.png">暂无可用素材组</nothing>
</template>
</template>
</div>
<!-- <div class="input-tab"></div> -->
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
export default { import Nothing from './Nothing'
name: '', import Psd from './Psd'
data () { export default {
return { name: '',
components: { Nothing, Psd },
data () {
return {
itemBgUrl: {
1: 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/item-0.png',
2: 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/item-1.png',
3: 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/item-2.png'
},
flag: true,
list: new Array(10),
userInfo: window.vm.getLocalStorage('dj_scrm_userInfo'),
keyword: '',
total: 0,
pageNum: 1,
searchStyle: true
}
},
mounted () {
},
methods: {
jump (e) {
let { corpId } = this.getLocalStorage('dj_scrm_corpId')
let query = `?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) {
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()
}, },
mounted () { search () {
}, },
methods: { focus () {
/** */
},
getList () {
} }
} }
}
</script> </script>
<style scoped lang='scss'> <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: 152px;
height: 148.5px;
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;
}
}
}
}
}
.input-tab {
width: 100%;
height: 42.52px;
background: #096;
position: fixed;
bottom: 50%;
transform: translateY(-50%);
left: 0;
z-index: 2;
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -51,7 +51,7 @@ const spritesmithFunction = data => { ...@@ -51,7 +51,7 @@ const spritesmithFunction = data => {
return `${shared}\n${perSprite}` return `${shared}\n${perSprite}`
} }
module.exports = { 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模式使用 微信开发环境需打开 // publicPath: '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router history模式使用 微信开发环境需打开
outputDir: 'dist', // 生产环境构建文件的目录 outputDir: 'dist', // 生产环境构建文件的目录
assetsDir: 'static', // outputDir的静态资源(js、css、img、fonts)目录 assetsDir: 'static', // outputDir的静态资源(js、css、img、fonts)目录
...@@ -60,7 +60,8 @@ module.exports = { ...@@ -60,7 +60,8 @@ module.exports = {
devServer: { devServer: {
disableHostCheck: true, disableHostCheck: true,
port: 9527, // 端口 port: 9527, // 端口
open: false, // 启动后打开浏览器 open: false, // 启动后打开浏览器.
public:'http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-lwk/#/',
overlay: { overlay: {
// 当出现编译器错误或警告时,在浏览器中显示全屏覆盖层 // 当出现编译器错误或警告时,在浏览器中显示全屏覆盖层
warnings: false, warnings: false,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!