【金掌桂2022年开门红需求】梳理开门红专区完成

This commit is contained in:
liyuetong
2021-11-09 11:17:14 +08:00
parent 2d9ab55bdd
commit 1a21497c23
6 changed files with 168 additions and 10 deletions

View File

@@ -45,3 +45,12 @@ export function getcompany(data) {
data
})
}
// 获取开门红实时贺报和倒计时图片接口
export function makePosters(data) {
return request({
url: getUrl('/sale/makePosters/GoodStart', 1),
method: 'post',
data
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 852 KiB

View File

@@ -5,7 +5,9 @@ const Prefecture = () => import('@/views/ebiz/goodStart/Prefecture')
const Treasure = () => import('@/views/ebiz/goodStart/Treasure')
const TreasureDetail = () => import('@/views/ebiz/goodStart/TreasureDetail')
const GoodStartScheme = () => import('@/views/ebiz/goodStart/GoodStartScheme')
const businessMap = () => import('@/views/ebiz/goodStart/businessMap')
const businessMap = () => import('@/views/ebiz/goodStart/BusinessMap')
const issueList = () => import('@/views/ebiz/goodStart/IssueList')
const newsPaper = () => import('@/views/ebiz/goodStart/NewsPaper')
const spreadParams = function(route) {
const params = {}
@@ -59,7 +61,23 @@ export default [
name: 'businessMap',
component: businessMap,
meta: {
title: '开门红方案'
title: '开门红业务地图'
}
},
{
path: '/goodStart/issueList',
name: 'issueList',
component: issueList,
meta: {
title: '出单榜'
}
},
{
path: '/goodStart/newsPaper',
name: 'newsPaper',
component: newsPaper,
meta: {
title: '开门红实时贺报'
}
}
]

View File

View File

@@ -0,0 +1,118 @@
<template>
<div class="good-start-scheme bg-white">
<div v-if="isShow == '1'">
<img class="pics" :src="pics" alt="" />
<div class="flex justify-content-s bottom-btn bottom20">
<van-button class="" square type="default" size="large" @click="shareImg" v-no-more-click="1000"> 分享 </van-button>
<van-button class="" square type="danger" size="large" @click="composeWxHeadConfig" v-no-more-click="1000"> 下载 </van-button>
</div>
</div>
<div v-else-if="isShow == '0'" class="text-center">
<img class="mt40 w250" src="@/assets/images/pic_page-non.png" />
<div class="fs17 c-gray-dark mt40">暂无数据</div>
</div>
</div>
</template>
<script>
import { makePosters } from '@/api/ebiz/goodStart'
import Vue from 'vue'
// 全局注册
export default {
data() {
return {
pics: '',
isShow: '' //是否展示贺报 0-不展示 1-展示
}
},
computed: {},
created() {
this.isFromService = this.$route.query.from === 'service'
this.getSchemePics()
this.interceptAppBtn()
},
methods: {
interceptAppBtn() {
setTimeout(() => {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('webview_left_button', {
intercept: '1'
})
}, 100)
window.appCallBack = this.appCallBack
},
appCallBack(data) {
if (data.trigger == 'left_button_click') {
if (!this.isPrevShow) {
if (this.isFromService) {
this.$jump({
flag: 'service'
})
} else {
this.$jump({
flag: 'h5',
extra: {
title: '开门红专区',
forbidSwipeBack: 1,
url: location.origin + `/#/goodStart/prefecture`
},
routerInfo: {
path: `/goodStart/prefecture/prefecture`,
type: '1'
}
})
}
} else {
this.isPrevShow = false
}
}
},
async getSchemePics() {
const result = await makePosters({})
if (result.result === '0') {
this.isShow = result.content.isShow
this.pics = result.content.pictureUrl
} else {
this.$toast(result.resultMessage)
}
},
shareImg() {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('bridge', {
flag: 'share',
extra: {
shareType: '1',
img: this.pics
}
})
}
}
}
</script>
<style lang="scss" scoped>
.pics {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -10;
zoom: 1;
background-repeat: no-repeat;
background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
background-position: center 0;
}
.bottom20 {
border: 2px solid;
border-image: radial-gradient(circle, rgba(255, 233, 124, 1), rgba(222, 144, 34, 1)) 2 2;
bottom: 20px;
}
/deep/ .van-button--danger {
background: linear-gradient(to right, #f26e43, #ac0209) !important; /*设置按钮为渐变颜色*/
border: none !important;
}
</style>

View File

@@ -2,9 +2,9 @@
<div class="prefecture">
<div class="menu-container">
<van-grid :column-num="2" :border="false">
<van-grid-item v-for="(menu, i) in menus" :key="i" @click="onMenuClicked(menu)">
<img :src="$assetsUrl + menu.icon" />
<span class="menu-text">{{ menu.name }}</span>
<van-grid-item v-for="(item, i) in menuList" :key="i" @click="onMenuClicked(item.targetUrl)">
<img :src="item.img" />
<span class="menu-text">{{ item.title }}</span>
</van-grid-item>
</van-grid>
</div>
@@ -13,6 +13,8 @@
<script>
import { Grid, GridItem } from 'vant'
import { getServiceConfig } from '@/api/ebiz/my/my'
export default {
name: 'Prefecture',
components: {
@@ -21,7 +23,7 @@ export default {
},
data() {
return {
menus: [
menuList: [
{ name: '开门红业绩排名', icon: 'images/goodStart/performanceRank.png', route: '/goodStart/performanceReport' },
{ name: '上头条', icon: 'images/goodStart/topOne.png', route: '/congratulation/congratulationTop' },
{ name: '大单榜', icon: 'images/goodStart/bigOrder.png', route: '/congratulation/congratulationList' },
@@ -32,10 +34,21 @@ export default {
}
},
mounted() {
this.initMenuList()
this.changeNavigator()
this.interceptAppBtn()
},
methods: {
async initMenuList(){
const res =await getServiceConfig({})
if (res.sections) {
res.sections.forEach(e=>{
if(e.name.indexOf('开门红专区')!=-1){
this.menuList =e.items;
}
})
}
},
interceptAppBtn() {
setTimeout(() => {
// eslint-disable-next-line no-undef
@@ -61,13 +74,13 @@ export default {
})
}, 100)
},
onMenuClicked(menu) {
onMenuClicked(targetUrl) {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#${menu.route}`
url: location.origin + `/#/${targetUrl}`
},
routerInfo: { path: `${menu.route}` }
routerInfo: { path: `/${targetUrl}` }
})
}
}
@@ -93,7 +106,7 @@ export default {
border-radius: 12px;
width: 335px;
height: 390px;
margin-top: 160px;
margin-top: 185px;
display: flex;
flex-direction: column;
justify-content: space-between;