|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view :style="vuex_skin">
|
|
<view :style="vuex_skin">
|
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
|
- <u-navbar title-color="#000000" :is-back="fasle" title="首页"></u-navbar>
|
|
|
|
|
|
|
+ <u-navbar title-color="#000000" :is-back="fasle" title="首页"></u-navbar>
|
|
|
<!-- #endif -->
|
|
<!-- #endif -->
|
|
|
<mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback"
|
|
<mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback"
|
|
|
@up="upCallback">
|
|
@up="upCallback">
|
|
@@ -11,10 +11,10 @@
|
|
|
<view style="padding: 30rpx 30rpx 10rpx;">
|
|
<view style="padding: 30rpx 30rpx 10rpx;">
|
|
|
<u-swiper :list="swiperList" border-radius="12" name="url" mode="rect" height="300"></u-swiper>
|
|
<u-swiper :list="swiperList" border-radius="12" name="url" mode="rect" height="300"></u-swiper>
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<view class="">
|
|
<view class="">
|
|
|
<view class="cu-list grid no-border" :class="gridClass" style="border-radius:20rpx ;">
|
|
<view class="cu-list grid no-border" :class="gridClass" style="border-radius:20rpx ;">
|
|
|
- <view class="cu-item" @click.stop="jump(item)" v-for="(item,index) in gridList" :key="index">
|
|
|
|
|
|
|
+ <view class="cu-item" @click.stop="jump(item)" v-for="(item,index) in gridList" :key="index">
|
|
|
<view class="grid-icon">
|
|
<view class="grid-icon">
|
|
|
<image style="width: 88rpx;height: 88rpx;" :src="item.icon" />
|
|
<image style="width: 88rpx;height: 88rpx;" :src="item.icon" />
|
|
|
</view>
|
|
</view>
|
|
@@ -88,10 +88,7 @@
|
|
|
<script>
|
|
<script>
|
|
|
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
|
|
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
|
|
|
import util from "@/utils/util.js";
|
|
import util from "@/utils/util.js";
|
|
|
- // #ifdef H5
|
|
|
|
|
- import jssdk from "@/utils/jweixin.js"
|
|
|
|
|
- // #endif
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
mixins: [MescrollMixin],
|
|
mixins: [MescrollMixin],
|
|
|
data() {
|
|
data() {
|
|
@@ -119,14 +116,14 @@
|
|
|
//轮播图
|
|
//轮播图
|
|
|
swiperList: [],
|
|
swiperList: [],
|
|
|
//菜单
|
|
//菜单
|
|
|
- gridClass:'',
|
|
|
|
|
|
|
+ gridClass: '',
|
|
|
gridList: [],
|
|
gridList: [],
|
|
|
- keyword:'',
|
|
|
|
|
|
|
+ keyword: '',
|
|
|
noticeContent: [],
|
|
noticeContent: [],
|
|
|
//活动详情
|
|
//活动详情
|
|
|
activeInfo: {},
|
|
activeInfo: {},
|
|
|
//参赛的路径
|
|
//参赛的路径
|
|
|
- applyUrl:""
|
|
|
|
|
|
|
+ applyUrl: ""
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
@@ -139,42 +136,28 @@
|
|
|
this.canReset = true;
|
|
this.canReset = true;
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- /**
|
|
|
|
|
- * 获取H5分享数据
|
|
|
|
|
- */
|
|
|
|
|
- async getWxShareData(shareParam){
|
|
|
|
|
- //获取当前url传递给后台获取授权和签名信息
|
|
|
|
|
- let url = encodeURIComponent(window.location.href.split('#')[0])
|
|
|
|
|
- let params={
|
|
|
|
|
- url: url
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- this.$api.wxApp.getWxShareData(params).then(res=>{
|
|
|
|
|
- jssdk.H5Share(res.data.data, shareParam);
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取活动详情
|
|
* 获取活动详情
|
|
|
*/
|
|
*/
|
|
|
- async activeDetail(){
|
|
|
|
|
- let params={
|
|
|
|
|
|
|
+ async activeDetail() {
|
|
|
|
|
+ let params = {
|
|
|
id: this.activeId
|
|
id: this.activeId
|
|
|
}
|
|
}
|
|
|
- this.$api.activerecord.detail(params).then(res=>{
|
|
|
|
|
|
|
+ this.$api.activerecord.detail(params).then(res => {
|
|
|
this.activeInfo = res.data.data;
|
|
this.activeInfo = res.data.data;
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 获取通知公告
|
|
* 获取通知公告
|
|
|
*/
|
|
*/
|
|
|
- async getNotice(){
|
|
|
|
|
- let params={
|
|
|
|
|
- activeId:this.activeId,
|
|
|
|
|
- title:'活动通知'
|
|
|
|
|
|
|
+ async getNotice() {
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ activeId: this.activeId,
|
|
|
|
|
+ title: '活动通知'
|
|
|
}
|
|
}
|
|
|
- this.$api.notice.list(params).then(res=>{
|
|
|
|
|
- let notices=res.data.data.records
|
|
|
|
|
- if (this.$isNotEmpty(notices)&&this.$isNotEmpty(notices[0].content)) {
|
|
|
|
|
|
|
+ this.$api.notice.list(params).then(res => {
|
|
|
|
|
+ let notices = res.data.data.records
|
|
|
|
|
+ if (this.$isNotEmpty(notices) && this.$isNotEmpty(notices[0].content)) {
|
|
|
this.noticeContent.push(util.formatHtml(notices[0].content))
|
|
this.noticeContent.push(util.formatHtml(notices[0].content))
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -212,8 +195,10 @@
|
|
|
}
|
|
}
|
|
|
let activeSetting = JSON.parse((await this.$api.platform.getPlatformValue(params)).data.data);
|
|
let activeSetting = JSON.parse((await this.$api.platform.getPlatformValue(params)).data.data);
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
|
- if(this.$isNotEmpty(activeSetting.shareParam)){
|
|
|
|
|
- this.getWxShareData(activeSetting.shareParam);
|
|
|
|
|
|
|
+ if (this.$isNotEmpty(activeSetting.shareParam)) {
|
|
|
|
|
+ let shareParam=activeSetting.shareParam
|
|
|
|
|
+ shareParam.link=window.location.href
|
|
|
|
|
+ this.$shareConfig.H5Share(shareParam)
|
|
|
}
|
|
}
|
|
|
// #endif
|
|
// #endif
|
|
|
activeSetting.defaultActiveId = this.activeId
|
|
activeSetting.defaultActiveId = this.activeId
|
|
@@ -241,12 +226,12 @@
|
|
|
//获取排行榜
|
|
//获取排行榜
|
|
|
this.mescroll.resetUpScroll();
|
|
this.mescroll.resetUpScroll();
|
|
|
//获取轮播图
|
|
//获取轮播图
|
|
|
- let gridList=this.vuex_active_setting.functionItemList
|
|
|
|
|
|
|
+ let gridList = this.vuex_active_setting.functionItemList
|
|
|
if (this.$isNotEmpty(gridList)) {
|
|
if (this.$isNotEmpty(gridList)) {
|
|
|
- this.gridList = gridList.filter(item=>item.show == 1)
|
|
|
|
|
- this.gridClass='col-'+this.gridList.length
|
|
|
|
|
|
|
+ this.gridList = gridList.filter(item => item.show == 1)
|
|
|
|
|
+ this.gridClass = 'col-' + this.gridList.length
|
|
|
}
|
|
}
|
|
|
- console.log(gridList,"gridList");
|
|
|
|
|
|
|
+ console.log(gridList, "gridList");
|
|
|
this.swiperList = this.vuex_active_setting.indexImageList
|
|
this.swiperList = this.vuex_active_setting.indexImageList
|
|
|
},
|
|
},
|
|
|
jump(item) {
|
|
jump(item) {
|
|
@@ -255,7 +240,7 @@
|
|
|
}
|
|
}
|
|
|
if (item.name == '报名参赛') {
|
|
if (item.name == '报名参赛') {
|
|
|
//登录后才可以参赛
|
|
//登录后才可以参赛
|
|
|
- this.applyUrl=`${item.path}?activeId=${this.activeId}&activeType=${this.activeInfo.type}`
|
|
|
|
|
|
|
+ this.applyUrl = `${item.path}?activeId=${this.activeId}&activeType=${this.activeInfo.type}`
|
|
|
this.login()
|
|
this.login()
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -263,18 +248,18 @@
|
|
|
url: item.path
|
|
url: item.path
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- init(){
|
|
|
|
|
|
|
+ init() {
|
|
|
this.goApply()
|
|
this.goApply()
|
|
|
},
|
|
},
|
|
|
- goApply(){
|
|
|
|
|
|
|
+ goApply() {
|
|
|
let nowTime = new Date().getTime();
|
|
let nowTime = new Date().getTime();
|
|
|
- let startTime=this.$dateTime.getTime(this.activeInfo.startTime)
|
|
|
|
|
- let endTime=this.$dateTime.getTime(this.activeInfo.endTime)
|
|
|
|
|
- if(nowTime < startTime){
|
|
|
|
|
|
|
+ let startTime = this.$dateTime.getTime(this.activeInfo.startTime)
|
|
|
|
|
+ let endTime = this.$dateTime.getTime(this.activeInfo.endTime)
|
|
|
|
|
+ if (nowTime < startTime) {
|
|
|
this.$refs.toast.info("活动未开始");
|
|
this.$refs.toast.info("活动未开始");
|
|
|
- }else if(nowTime > endTime){
|
|
|
|
|
|
|
+ } else if (nowTime > endTime) {
|
|
|
this.$refs.toast.info("活动已结束");
|
|
this.$refs.toast.info("活动已结束");
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url: this.applyUrl
|
|
url: this.applyUrl
|
|
|
})
|
|
})
|