|
|
|
|
@ -4,23 +4,26 @@
|
|
|
|
|
<!-- 状态栏占位 -->
|
|
|
|
|
<view class="statusBar" :style="{paddingTop: navBarTop+'px'}"></view>
|
|
|
|
|
<!-- 真正的导航栏内容 -->
|
|
|
|
|
<view class="navBar" :style="{'height':navBarHeight+'px','line-height':navBarHeight+'px'}">
|
|
|
|
|
<view class="navBar" :style="{'height':navBarHeight+'px','line-height':navBarHeight+'px'}">
|
|
|
|
|
<view>斜塘街道基层党员冬训</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="content">
|
|
|
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
|
|
|
<!-- <privacy-popup ref="privacyComponent" @agree-privacy="onAgreePrivacy"
|
|
|
|
|
@reject-privacy="onRejectPrivacy"></privacy-popup> -->
|
|
|
|
|
<!-- #endif -->
|
|
|
|
|
<view class="topbg">
|
|
|
|
|
<image class="topbg" :src="require('@/static/index-top.png')"></image>
|
|
|
|
|
</view>
|
|
|
|
|
<view :style="{'margin-top':bannerTop+'rpx'}">
|
|
|
|
|
<image class="banner" src="https://vr.langye.net/images/index-banner.png"></image>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="content-content">
|
|
|
|
|
<view class="icons">
|
|
|
|
|
<block v-for="(item,index) in iconList">
|
|
|
|
|
<image v-if="index<3" :src="item.src" @click="toMenu(item.id)"></image>
|
|
|
|
|
<view class="icons">
|
|
|
|
|
<block v-for="(item,index) in iconList">
|
|
|
|
|
<image v-if="index<3" :src="item.src" @click="toMenu(item.id)"></image>
|
|
|
|
|
</block>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="icons icons-out">
|
|
|
|
|
@ -33,29 +36,32 @@
|
|
|
|
|
<image class="menus-list-img" :src="item.poster?item.poster:replaceImg"></image>
|
|
|
|
|
<view class="menus-list-title">{{item.title}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="hasNomore" class="hasNomore">————没有更多了————</view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<tabbar :current-page="0"></tabbar>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import tabbar from "../../components/tabbar/tabbar.vue"
|
|
|
|
|
import{isNull} from '@/common/util.js'
|
|
|
|
|
export default {
|
|
|
|
|
components:{
|
|
|
|
|
tabbar
|
|
|
|
|
<script>
|
|
|
|
|
import tabbar from "../../components/tabbar/tabbar.vue"
|
|
|
|
|
import {
|
|
|
|
|
isNull
|
|
|
|
|
} from '@/common/util.js'
|
|
|
|
|
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue';
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
tabbar,
|
|
|
|
|
PrivacyPopup
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
navBarBoxHeight: 0,
|
|
|
|
|
navBarTop: 0,
|
|
|
|
|
bannerTop: 0,
|
|
|
|
|
navBarHeight:0,
|
|
|
|
|
isScroll: false,
|
|
|
|
|
|
|
|
|
|
bannerTop: 0,
|
|
|
|
|
navBarHeight: 0,
|
|
|
|
|
isScroll: false,
|
|
|
|
|
|
|
|
|
|
iconList: [{
|
|
|
|
|
id: 6,
|
|
|
|
|
src: require("@/static/index-icon1.png"),
|
|
|
|
|
@ -81,39 +87,56 @@
|
|
|
|
|
url: "https://vr.langye.net/h5xtdt/",
|
|
|
|
|
src: require("@/static/index-icon5.png"),
|
|
|
|
|
title: '百步芳草 与理同行'
|
|
|
|
|
}],
|
|
|
|
|
replaceImg:require("@/static/index-img.png"),
|
|
|
|
|
menuList:[],
|
|
|
|
|
currentPage:1,
|
|
|
|
|
hasNomore:false
|
|
|
|
|
}],
|
|
|
|
|
replaceImg: require("@/static/index-img.png"),
|
|
|
|
|
menuList: [],
|
|
|
|
|
currentPage: 1,
|
|
|
|
|
hasNomore: false,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
|
|
|
|
|
const MenuButton = uni.getMenuButtonBoundingClientRect()
|
|
|
|
|
this.navBarTop = MenuButton.top //左侧文字与右侧胶囊对齐
|
|
|
|
|
this.navBarHeight = MenuButton.height
|
|
|
|
|
this.navBarBoxHeight = this.navBarTop + this.navBarHeight + 10
|
|
|
|
|
this.bannerTop = this.navBarBoxHeight*2 - 360
|
|
|
|
|
// this.getMenu()
|
|
|
|
|
this.getToken()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onLoad() {
|
|
|
|
|
|
|
|
|
|
const MenuButton = uni.getMenuButtonBoundingClientRect()
|
|
|
|
|
this.navBarTop = MenuButton.top //左侧文字与右侧胶囊对齐
|
|
|
|
|
this.navBarHeight = MenuButton.height
|
|
|
|
|
this.navBarBoxHeight = this.navBarTop + this.navBarHeight + 10
|
|
|
|
|
this.bannerTop = this.navBarBoxHeight * 2 - 360
|
|
|
|
|
// this.getMenu()
|
|
|
|
|
if (isNull(this.vuex_token)) {
|
|
|
|
|
this.getToken()
|
|
|
|
|
} else {
|
|
|
|
|
this.getMenuList(11, (this.currentPage))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onPageScroll(e) {
|
|
|
|
|
var that = this;
|
|
|
|
|
if (e.scrollTop > (this.navBarTop/2)) {
|
|
|
|
|
if (e.scrollTop > (this.navBarTop / 2)) {
|
|
|
|
|
that.isScroll = true;
|
|
|
|
|
} else {
|
|
|
|
|
that.isScroll = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onReachBottom() {
|
|
|
|
|
if (true)
|
|
|
|
|
this.getMenuList(11,(this.currentPage + 1))
|
|
|
|
|
},
|
|
|
|
|
onReachBottom() {
|
|
|
|
|
if (true)
|
|
|
|
|
this.getMenuList(11, (this.currentPage + 1))
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
onAgreePrivacy() {
|
|
|
|
|
// 用户同意隐私政策
|
|
|
|
|
// 在这里添加您想要执行的代码
|
|
|
|
|
console.log('User agreed to the privacy policy');
|
|
|
|
|
this.getToken()
|
|
|
|
|
},
|
|
|
|
|
onRejectPrivacy() {
|
|
|
|
|
// 用户拒绝隐私政策
|
|
|
|
|
// 在这里添加您想要执行的代码
|
|
|
|
|
console.log('User rejected the privacy policy');
|
|
|
|
|
},
|
|
|
|
|
toMenu(id) {
|
|
|
|
|
if (id) {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
@ -129,73 +152,77 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
toDetail(id) {
|
|
|
|
|
if(id){
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url:'/pages/detail/detail?id='+id + '&menuTitle=学习新思想'
|
|
|
|
|
})
|
|
|
|
|
if (id) {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/pages/detail/detail?id=' + id + '&menuTitle=学习新思想'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getToken(){
|
|
|
|
|
await uni.login({
|
|
|
|
|
provider: 'weixin',
|
|
|
|
|
success: (res) => {
|
|
|
|
|
console.log(res.code);
|
|
|
|
|
this.$u.api.login({
|
|
|
|
|
code: res.code
|
|
|
|
|
}).then(res => {
|
|
|
|
|
},
|
|
|
|
|
async getToken() {
|
|
|
|
|
await uni.login({
|
|
|
|
|
provider: 'weixin',
|
|
|
|
|
success: (res) => {
|
|
|
|
|
this.$u.api.login({
|
|
|
|
|
code: res.code
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.$u.vuex('vuex_token', res.token)
|
|
|
|
|
this.$u.api.user().then(res=>{
|
|
|
|
|
this.$u.vuex('vuex_user', res)
|
|
|
|
|
this.getMenuList(11,this.currentPage)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
async getMenu(){
|
|
|
|
|
const res = await this.$u.api.baseFormIndex({
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
table_name: 'study_columns',
|
|
|
|
|
})
|
|
|
|
|
const parArr = res.data.filter(item=>item.pid===0)
|
|
|
|
|
parArr.map(item=>{
|
|
|
|
|
this.menuList.map(m=>{
|
|
|
|
|
if(item.title===m.title){
|
|
|
|
|
m.id = parArr.id
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
async getMenuList(id,currentPage){
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
title:'加载中'
|
|
|
|
|
})
|
|
|
|
|
let that = this
|
|
|
|
|
const res = await this.$u.api.getAudios({
|
|
|
|
|
study_column_id: id,
|
|
|
|
|
page:currentPage
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if(res.data.length===0 && currentPage>0){
|
|
|
|
|
uni.stopPullDownRefresh(); // 服务器总条数 < 每页条数, 会将第一页的条数重新返回
|
|
|
|
|
// 已加载到最后一页
|
|
|
|
|
that.hasNomore = true
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '没有更多了',
|
|
|
|
|
icon: 'none'
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (currentPage == 1) {
|
|
|
|
|
that.menuList = res.data;
|
|
|
|
|
} else {
|
|
|
|
|
that.menuList.push(...res.data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
that.currentPage = currentPage;
|
|
|
|
|
uni.hideLoading()
|
|
|
|
|
},
|
|
|
|
|
this.$u.api.user().then(res => {
|
|
|
|
|
this.$u.vuex('vuex_user', res)
|
|
|
|
|
this.getMenuList(11, this.currentPage)
|
|
|
|
|
})
|
|
|
|
|
}).catch(err=>{
|
|
|
|
|
console.log('login-error:',JSON.stringify(err))
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
fail: (res) => {
|
|
|
|
|
console.log("errtoken", JSON.stringify(res))
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
async getMenu() {
|
|
|
|
|
const res = await this.$u.api.baseFormIndex({
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
table_name: 'study_columns',
|
|
|
|
|
})
|
|
|
|
|
const parArr = res.data.filter(item => item.pid === 0)
|
|
|
|
|
parArr.map(item => {
|
|
|
|
|
this.menuList.map(m => {
|
|
|
|
|
if (item.title === m.title) {
|
|
|
|
|
m.id = parArr.id
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
async getMenuList(id, currentPage) {
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
title: '加载中'
|
|
|
|
|
})
|
|
|
|
|
let that = this
|
|
|
|
|
const res = await this.$u.api.getAudios({
|
|
|
|
|
study_column_id: id,
|
|
|
|
|
page: currentPage
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if (res.data.length === 0 && currentPage > 0) {
|
|
|
|
|
uni.stopPullDownRefresh(); // 服务器总条数 < 每页条数, 会将第一页的条数重新返回
|
|
|
|
|
// 已加载到最后一页
|
|
|
|
|
that.hasNomore = true
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '没有更多了',
|
|
|
|
|
icon: 'none'
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (currentPage == 1) {
|
|
|
|
|
that.menuList = res.data;
|
|
|
|
|
} else {
|
|
|
|
|
that.menuList.push(...res.data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
that.currentPage = currentPage;
|
|
|
|
|
uni.hideLoading()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -303,11 +330,12 @@
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.hasNomore{
|
|
|
|
|
text-align: center;
|
|
|
|
|
color:#a4a4a4;
|
|
|
|
|
height:80rpx;
|
|
|
|
|
line-height: 80rpx;
|
|
|
|
|
|
|
|
|
|
.hasNomore {
|
|
|
|
|
text-align: center;
|
|
|
|
|
color: #a4a4a4;
|
|
|
|
|
height: 80rpx;
|
|
|
|
|
line-height: 80rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|