@ -1,4 +1,3 @@
原始文件
永久链接
Blame
@ -7,7 +6,7 @@ Blame
< view class = "main" >
<!-- nav -- >
< view class = "nav-head" >
< u -button class = "serviceButton" color = "#323045" > { { i18n . customerService } } < / u - b u t t o n >
< u -button class = "serviceButton" color = "#323045" @click ="getContact" > {{ i18n.customerService }} < / u -button >
< view class = "languageBtn" @ click.stop = " languageShow = true " >
{ { langTrue } }
< / view >
@ -21,11 +20,11 @@ Blame
< u -swiper class = "swiper" :list ="swiperList" previousMargin = "48rpx" nextMargin = "80rpx" circular :autoplay ="true"
radius = "32rpx" bgColor = "rgba(0,0,0,0)" height = "360rpx" > < / u - s w i p e r >
<!-- 消息 -- >
< view class = "message" @ click = "popupShow = true" >
< view class = "message" >
< u -icon class = "icon" name = "../../static/home/ic_proclamation.png" size = "60rpx" width = "60rpx" > < / u - i c o n >
<!-- < view class = "text" > { { i18n . homeMessage } } < / view > -- >
< u -notice -bar class = "notice" :text ="messageList" icon = "" fontSize = "24rpx" bgColor = "#211F32" color = "#fff"
direction = "column" >
direction = "column" @ click = "go('/pages/me/notification')" >
< / u - n o t i c e - b a r >
< / view >
<!-- 三个按钮 -- >
@ -69,16 +68,16 @@ Blame
< video class = "video" v -show = " videoShow " id = "video" :enable-progress-gesture ="false" autoplay = "true"
: src = "videoUrl" controls x5 - video - player - type = "h5-page" @ fullscreenchange = "ifStopVideo" > < / video >
<!-- 通知弹出层 -- >
< u -popup class = "popup" :show ="popupShow " round = "32rpx" mode = "center" @ close = "popupShow = false"
< u -popup class = "popup" v -if = " popupShow " round = "32rpx" mode = "center" @ close = "popupShow = false"
@ open = "popupShow = true" bgColor = "#211F32" : customStyle = " {
margin : 'auto 102rpx auto 118rpx' ,
} " >
< view class = "content" >
< scroll -view scroll -y = " true " style = "height: 288rpx;" scroll -with -animation = " true "
< scroll -view scroll -y = " true " style = "max- height: 288rpx;" scroll -with -animation = " true "
@ touchmove . stop . prevent = "" >
{ { i18n . homeMessage } }
< view class = "" v-html ="contentFirst" > < / view >
< / s c r o l l - v i e w >
< u -button class = "button" color = "#00E8A2" @ click = "popupShow = false "> OK < / u - b u t t o n >
< u -button class = "button" color = "#00E8A2" @click ="toRead" :throttleTime ="500 "> OK < / u - b u t t o n >
< / view >
< / u - p o p u p >
<!-- tabBar -- >
@ -87,38 +86,42 @@ Blame
< / template >
< script >
import languagePopups from '@/components/language-popups/language-popups.vue'
import languageData from '@/utils/language/config'
import api from '@/utils/api'
/ / 引 入 e c h a r t s
/ / i m p o r t * a s e c h a r t s f r o m ' e c h a r t s ' ;
/ / l e t v i d e o P l a y e r O b j = { } ;
let videoPlayer ;
let myChart ;
export default {
import languagePopups from '@/components/language-popups/language-popups.vue'
import languageData from '@/utils/language/config'
import api from '@/utils/api'
import constant from '@/utils/constant.js' ;
/ / 引 入 e c h a r t s
/ / i m p o r t * a s e c h a r t s f r o m ' e c h a r t s ' ;
/ / l e t v i d e o P l a y e r O b j = { } ;
let videoPlayer ;
let myChart ;
export default {
name : 'home' ,
components : { languagePopups } ,
components : {
languagePopups
} ,
data ( ) {
return {
/ / 展 示 的 公 告 数 据 未 读 的
contentFirst : '' ,
/ / 记 录 还 剩 多 少 未 读 的 是 否 显 示 弹 框
noticeId : null ,
/ / 公 告
notice : [ ] ,
/ / 公 告 详 情
noticeDetail : { } ,
baseURL : '' ,
languageShow : false ,
langTrue : languageData [ 0 ] . title || 'English' ,
languageData ,
popupShow : false ,
messageList : [
` Please contact customer service on the top-left corner for identity verification on your first Please contact customer service on the top-left corner for identity verification on your first...Please contact customer service on the top-left corner for identity verification on your first... ` ,
` Please contact customer service on the top-left corner for identity verification on your first Please contact customer service on the top-left corner for identity verification on your first...Please contact customer service on the top-left corner for identity verification on your first... ` ,
` Please contact customer service on the top-left corner for identity verification on your first Please contact customer service on the top-left corner for identity verification on your first...Please contact customer service on the top-left corner for identity verification on your first... ` ,
` Please contact customer service on the top-left corner for identity verification on your first Please contact customer service on the top-left corner for identity verification on your first...Please contact customer service on the top-left corner for identity verification on your first... ` ,
] ,
popupShow : true ,
messageList : [ ] ,
swiperList : [
'https://cdn.uviewui.com/uview/swiper/swiper1.png' ,
'https://cdn.uviewui.com/uview/swiper/swiper2.png' ,
'https://cdn.uviewui.com/uview/swiper/swiper3.png' ,
] ,
videoShow : false ,
videoUrl : '' ,
videoList : [
{
videoList : [ {
url : 'https://cdn.uviewui.com/uview/resources/video.mp4' ,
title : 'Video name 1' ,
poster : 'https://cdn.uviewui.com/uview/swiper/swiper1.png'
@ -141,13 +144,15 @@ export default {
] ,
option : null ,
stepsNum : 5000 , / / 当 前 步 数
stepTarget : 10000 , / / 目 标 步 数
stepTarget : 10000 , / / 目 标 步 数
myChart : null ,
}
} ,
onLoad ( ) {
this . baseURL = constant . BASE_URL
this . getbanner ( ) ;
this . noticeList ( ) ;
this . getContact ( )
} ,
onShow ( ) {
/ / 生 成 播 放 器 队 列 对 象
@ -163,7 +168,7 @@ export default {
if ( uni . getStorageSync ( 'langTrue' ) ) {
this . langTrue = uni . getStorageSync ( 'langTrue' )
}
this . getbanner ( ) ;
} ,
onHide ( ) {
@ -175,9 +180,70 @@ export default {
}
} ,
methods : {
/ / 获 取 客 服 联 系 方 式
getContact ( ) {
api . customerService ( { } ) . then ( res => {
if ( res . errCode == 'SYS.0012' ) {
uni . $u . toast ( res . errMsg ) ;
} else {
/ / # i f d e f A P P - P L U S
plus . runtime . openURL ( res . url ) ;
/ / # e n d i f
/ / # i f d e f H 5
window . location . href = res . url
/ / # e n d i f
}
} )
} ,
/ / 获 取 未 读 的 公 告
getNoReadNotice ( ) {
for ( var i = 0 ; i < this . notice . length ; i ++ ) {
if ( this . notice [ i ] . isRead == 'no' ) {
this . contentFirst = this . notice [ i ] . content
this . noticeId = this . notice [ i ] . id
}
}
if ( ! this . noticeId ) {
this . popupShow = false
}
} ,
go ( url ) {
uni . navigateTo ( {
url : url
} )
} ,
toRead ( ) {
api . noticeRead ( {
noticeId : this . noticeId
} ) . then ( res => {
this . noticeId = null ;
this . popupShow = false
this . getNoReadNotice ( )
console . log ( res , '已经读了吗' )
} )
} ,
/ / 公 告
noticeList ( ) {
api . noticeList ( { } ) . then ( res => {
this . notice = res ;
for ( var i = 0 ; i < res . length ; i ++ ) {
this . messageList . push ( res [ i ] . title )
}
/ / 获 取 未 读 的 公 告
this . getNoReadNotice ( )
} )
} ,
/ / 轮 播
getbanner ( ) {
const indexBanner = api . indexBanner ( { 'mark' : 'APP_INDEX' } ) ;
console . log ( indexBanner )
api . indexBanner ( {
'mark' : 'APP_INDEX'
} ) . then ( res => {
for ( var i = 0 ; i < res . length ; i ++ ) {
this . swiperList . push ( this . baseURL + res [ i ] . adImgPath )
}
} )
} ,
/ / 弹 出 语 言 选 择 框
laug ( ) {
@ -219,7 +285,9 @@ export default {
playVideo ( data ) {
this . videoUrl = data . url ;
this . videoShow = true ;
videoPlayer . requestFullScreen ( { direction : 0 } )
videoPlayer . requestFullScreen ( {
direction : 0
} )
} ,
/ * *
* 跳转
@ -296,8 +364,7 @@ export default {
} ,
data : [ {
value : + this . stepsNum / this . stepTarget
,
value : + this . stepsNum / this . stepTarget ,
name : '步数' ,
itemStyle : {
color : new echarts . graphic . LinearGradient ( 0 , 0 , 0 , 1 , [ {
@ -309,8 +376,7 @@ export default {
} , {
offset : 1 ,
color : '#0589FF'
}
] ) ,
} ] ) ,
borderRadius : 800 ,
@ -334,8 +400,7 @@ export default {
/ / } ) ;
}
}
}
}
< / script >
< script module = "echarts" lang = "renderjs" >
@ -345,7 +410,7 @@ export default {
/ / t h i s . i n i t E c h a r t s ( ) ;
if ( typeof window . echarts === 'object' ) {
this . initEcharts ( )
} else if ( typeof window . echarts === 'function' ) {
} else if ( typeof window . echarts === 'function' ) {
this . initEcharts ( )
} else {
/ / 动 态 引 入 较 大 类 库 避 免 影 响 页 面 展 示
@ -413,8 +478,7 @@ export default {
} ,
data : [ {
value : + this . stepsNum / this . stepTarget
,
value : + this . stepsNum / this . stepTarget ,
name : '步数' ,
itemStyle : {
color : new echarts . graphic . LinearGradient ( 0 , 0 , 0 , 1 , [ {
@ -426,8 +490,7 @@ export default {
} , {
offset : 1 ,
color : '#0589FF'
}
] ) ,
} ] ) ,
borderRadius : 800 ,
}
} ,
@ -460,7 +523,7 @@ export default {
< / script >
< style lang = "scss" scoped >
. main {
. main {
padding - bottom : 198 rpx ; / / 避 免 底 部 T a b B a r 盖 住 内 容
. nav - head {
@ -705,5 +768,5 @@ export default {
}
}
}
< / style >