首页修改强制更新时禁止tabbar切换
This commit is contained in:
@@ -45,134 +45,153 @@
|
|||||||
<image v-if="datas.isExamine == 0" @click="goMsg()" src="@/static/index/red-pack-new.gif"
|
<image v-if="datas.isExamine == 0" @click="goMsg()" src="@/static/index/red-pack-new.gif"
|
||||||
style="width: 200rpx;height: 200rpx;position: fixed;right: 10rpx;bottom: 180rpx;" mode=""></image>
|
style="width: 200rpx;height: 200rpx;position: fixed;right: 10rpx;bottom: 180rpx;" mode=""></image>
|
||||||
|
|
||||||
<up-modal :show="datas.version.show" :confirm-text="datas.version.confirmText" :showCancelButton="datas.version.cancelText!=''" @confirm='confirmUpdateVersion'
|
<up-modal :show="datas.version.show" :confirm-text="datas.version.confirmText"
|
||||||
:title="datas.version.title" :title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)" @cancel="datas.version.show = false">
|
:showCancelButton="datas.version.cancelText!=''" @confirm='confirmUpdateVersion' :title="datas.version.title"
|
||||||
|
:title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)" @cancel="datas.version.show = false">
|
||||||
<view class="" style="padding-top: 30rpx;text-align: left;">
|
<view class="" style="padding-top: 30rpx;text-align: left;">
|
||||||
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
||||||
<rich-text style="color:#666" :nodes="datas.version.content"></rich-text>
|
<rich-text style="color:#666" :nodes="datas.version.content"></rich-text>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</up-modal>
|
</up-modal>
|
||||||
<up-modal :show="datas.ruleShow" v-if="datas.isExamine == 0&&!datas.version.show" confirm-text="知道了" title="规则说明" :title="datas.rule_title" :title-style="{fontWeight:'700'}" @confirm="ruleConfirm" confirm-color="rgb(255, 117, 129)">
|
<up-modal :show="datas.ruleShow" v-if="datas.isExamine == 0&&!datas.version.show" confirm-text="知道了" title="规则说明"
|
||||||
|
:title="datas.rule_title" :title-style="{fontWeight:'700'}" @confirm="ruleConfirm"
|
||||||
|
confirm-color="rgb(255, 117, 129)">
|
||||||
<view class="u-p-30 u-text-left">
|
<view class="u-p-30 u-text-left">
|
||||||
<scroll-view scroll-y="true" style="max-height: 50vh;" >
|
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
||||||
<rich-text style="text-align: justify;font-size: 18px;color: #666;" :nodes="datas.rule_content"></rich-text>
|
<rich-text style="text-align: justify;font-size: 18px;color: #666;"
|
||||||
|
:nodes="datas.rule_content"></rich-text>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</up-modal>
|
</up-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
reactive
|
reactive
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import { announcement, messageselectMessage, courseselectCourse } from '@/api/index/index.js'
|
import {
|
||||||
import {
|
announcement,
|
||||||
onLoad,
|
messageselectMessage,
|
||||||
onReady,
|
courseselectCourse
|
||||||
onReachBottom
|
} from '@/api/index/index.js'
|
||||||
} from '@dcloudio/uni-app'
|
import {
|
||||||
import contentlist from './components/contentlist.vue'
|
onLoad,
|
||||||
import { selectNewApp } from '@/api/user/user.js';
|
onReady,
|
||||||
import config from '@/commons/config.js';
|
onReachBottom
|
||||||
import { linkTo } from '@/utils/app.js';
|
} from '@dcloudio/uni-app'
|
||||||
import {
|
import contentlist from './components/contentlist.vue'
|
||||||
|
import {
|
||||||
|
selectNewApp
|
||||||
|
} from '@/api/user/user.js';
|
||||||
|
import config from '@/commons/config.js';
|
||||||
|
import {
|
||||||
|
linkTo
|
||||||
|
} from '@/utils/app.js';
|
||||||
|
import {
|
||||||
useCommonStore
|
useCommonStore
|
||||||
} from '@/store/common.js'
|
} from '@/store/common.js'
|
||||||
const $common = useCommonStore()
|
const $common = useCommonStore()
|
||||||
let datas = reactive({
|
let datas = reactive({
|
||||||
noticeList: [], //公告列表
|
noticeList: [], //公告列表
|
||||||
|
|
||||||
active: 1, // 最新、最热。。。切换顶部导航栏
|
active: 1, // 最新、最热。。。切换顶部导航栏
|
||||||
|
|
||||||
list: [], // 底部短剧内容
|
list: [], // 底部短剧内容
|
||||||
page: 1, // 首页推荐分页
|
page: 1, // 首页推荐分页
|
||||||
|
|
||||||
ruleShow: false,
|
ruleShow: false,
|
||||||
rule_title: '', // 首页弹窗标题
|
rule_title: '', // 首页弹窗标题
|
||||||
rule_content: '', // 首页弹窗内容
|
rule_content: '', // 首页弹窗内容
|
||||||
ruleIndex: 0,
|
ruleIndex: 0,
|
||||||
ruleList: [],
|
ruleList: [],
|
||||||
|
|
||||||
//ios是否在审核 1是审核
|
//ios是否在审核 1是审核
|
||||||
isExamine: $common.isExamine,
|
isExamine: $common.isExamine,
|
||||||
|
|
||||||
version: {
|
version: {
|
||||||
show: false,
|
show: false,
|
||||||
title: "",
|
title: "",
|
||||||
content: "",
|
content: "",
|
||||||
confirmText: "",
|
confirmText: "",
|
||||||
cancelText: "",
|
cancelText: "",
|
||||||
}
|
}
|
||||||
})
|
|
||||||
onLoad(() => {
|
|
||||||
versionUpdate()
|
|
||||||
getMsg()
|
|
||||||
getrecomVideo()
|
|
||||||
})
|
|
||||||
onReady(() => {
|
|
||||||
announcement({type: 0}).then(res=>{
|
|
||||||
datas.ruleList = res
|
|
||||||
ruleInit()
|
|
||||||
datas.ruleShow = true
|
|
||||||
})
|
})
|
||||||
})
|
onLoad(() => {
|
||||||
onReachBottom(() => {
|
versionUpdate()
|
||||||
++datas.page
|
getMsg()
|
||||||
getrecomVideo()
|
getrecomVideo()
|
||||||
})
|
})
|
||||||
function versionUpdate(){
|
onReady(() => {
|
||||||
//#ifdef APP-PLUS
|
announcement({
|
||||||
plus.screen.lockOrientation('portrait-primary'); //竖屏正方向锁定
|
type: 0
|
||||||
//获取当前系统版本信息
|
}).then(res => {
|
||||||
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
|
datas.ruleList = res
|
||||||
//请求后台接口 解析数据 对比版本
|
ruleInit()
|
||||||
selectNewApp().then(res => {
|
datas.ruleShow = true
|
||||||
res = res[0];
|
})
|
||||||
let version;
|
})
|
||||||
if (uni.getSystemInfoSync().platform == 'android') {
|
onReachBottom(() => {
|
||||||
version = res.version
|
++datas.page
|
||||||
}
|
getrecomVideo()
|
||||||
if (uni.getSystemInfoSync().platform == 'ios') {
|
})
|
||||||
version = res.iosVersion
|
|
||||||
}
|
function versionUpdate() {
|
||||||
console.log(widgetInfo.version+'---'+version)
|
//#ifdef APP-PLUS
|
||||||
version = res.version
|
plus.screen.lockOrientation('portrait-primary'); //竖屏正方向锁定
|
||||||
// && uni.getSystemInfoSync().platform == 'android'
|
//获取当前系统版本信息
|
||||||
if (widgetInfo.version < version) {
|
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
|
||||||
let downloadLink = '';
|
//请求后台接口 解析数据 对比版本
|
||||||
let androidLink = res.androidWgtUrl;
|
selectNewApp().then(res => {
|
||||||
let iosLink = res.iosWgtUrl;
|
res = res[0];
|
||||||
datas.version.show = true;
|
let version;
|
||||||
datas.version.title = "发现新版本";
|
if (uni.getSystemInfoSync().platform == 'android') {
|
||||||
datas.version.content = res.des;
|
version = res.version
|
||||||
if (res.method == "true") {
|
|
||||||
datas.version.confirmText = "立即更新"
|
|
||||||
} else {
|
|
||||||
datas.version.confirmText = "立即更新"
|
|
||||||
datas.version.cancelText = "下次更新"
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||||
|
version = res.iosVersion
|
||||||
|
}
|
||||||
|
console.log(widgetInfo.version + '---' + version)
|
||||||
|
version = res.version
|
||||||
|
// && uni.getSystemInfoSync().platform == 'android'
|
||||||
|
if (widgetInfo.version < version) {
|
||||||
|
let downloadLink = '';
|
||||||
|
let androidLink = res.androidWgtUrl;
|
||||||
|
let iosLink = res.iosWgtUrl;
|
||||||
|
datas.version.show = true;
|
||||||
|
datas.version.title = "发现新版本";
|
||||||
|
datas.version.content = res.des;
|
||||||
|
if (res.method == "true") {
|
||||||
|
datas.version.confirmText = "立即更新"
|
||||||
|
uni.switchTab = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
datas.version.confirmText = "立即更新"
|
||||||
|
datas.version.cancelText = "下次更新"
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
//#endif
|
||||||
//#endif
|
}
|
||||||
}
|
|
||||||
function confirmUpdateVersion(){
|
function confirmUpdateVersion() {
|
||||||
// plus.runtime.openURL(config.baseUrl + '/pages/login/appEq')
|
// plus.runtime.openURL(config.baseUrl + '/pages/login/appEq')
|
||||||
linkTo('/pages/login/download')
|
linkTo('/pages/login/download')
|
||||||
return
|
return
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '下载中...',
|
title: '下载中...',
|
||||||
mask: true
|
mask: true
|
||||||
});
|
});
|
||||||
if (uni.getSystemInfoSync().platform == 'android') {
|
if (uni.getSystemInfoSync().platform == 'android') {
|
||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: androidLink,
|
url: androidLink,
|
||||||
success: downloadResult => {
|
success: downloadResult => {
|
||||||
console.log(downloadResult)
|
console.log(downloadResult)
|
||||||
if (downloadResult.statusCode === 200) {
|
if (downloadResult.statusCode === 200) {
|
||||||
plus.runtime .install(
|
plus.runtime.install(
|
||||||
downloadResult.tempFilePath, {
|
downloadResult.tempFilePath, {
|
||||||
force: false
|
force: false
|
||||||
},
|
},
|
||||||
@@ -186,156 +205,157 @@ function confirmUpdateVersion(){
|
|||||||
console.error('install fail...');
|
console.error('install fail...');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||||
|
plus.runtime.openURL(iosLink, function(res) {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function ruleInit() {
|
||||||
|
datas.rule_title = datas.ruleList[datas.ruleIndex].title
|
||||||
|
datas.rule_content = datas.ruleList[datas.ruleIndex].content
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 规则确认
|
||||||
|
*/
|
||||||
|
function ruleConfirm() {
|
||||||
|
datas.ruleShow = false
|
||||||
|
datas.ruleIndex++
|
||||||
|
if (datas.ruleIndex >= datas.ruleList.length) {
|
||||||
|
datas.ruleIndex = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
setTimeout(res => {
|
||||||
|
ruleInit()
|
||||||
|
datas.ruleShow = true
|
||||||
|
}, 300)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 跳转公告链接
|
||||||
|
function goMsg(url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/me/prizeDraw'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (uni.getSystemInfoSync().platform == 'ios') {
|
|
||||||
plus.runtime.openURL(iosLink, function(res) {});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function ruleInit(){
|
|
||||||
datas.rule_title = datas.ruleList[datas.ruleIndex].title
|
|
||||||
datas.rule_content = datas.ruleList[datas.ruleIndex].content
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 规则确认
|
|
||||||
*/
|
|
||||||
function ruleConfirm() {
|
|
||||||
datas.ruleShow = false
|
|
||||||
datas.ruleIndex++
|
|
||||||
if( datas.ruleIndex >= datas.ruleList.length) {
|
|
||||||
datas.ruleIndex = 0
|
|
||||||
return
|
|
||||||
}
|
|
||||||
setTimeout(res=>{
|
|
||||||
ruleInit()
|
|
||||||
datas.ruleShow = true
|
|
||||||
},300)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 跳转公告链接
|
|
||||||
function goMsg(url) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/me/prizeDraw'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 搜索跳转
|
// 搜索跳转
|
||||||
function moreVideo() {
|
function moreVideo() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/index/search/index'
|
url: '/pages/index/search/index'
|
||||||
});
|
});
|
||||||
}
|
|
||||||
// 公告
|
|
||||||
async function getMsg() {
|
|
||||||
let res = await messageselectMessage()
|
|
||||||
datas.noticeList = res.list
|
|
||||||
}
|
|
||||||
//获取推荐视频
|
|
||||||
async function getrecomVideo(sort, active = 1) {
|
|
||||||
datas.active = active
|
|
||||||
if (sort) {
|
|
||||||
datas.page = 1
|
|
||||||
}
|
}
|
||||||
let res = await courseselectCourse({
|
// 公告
|
||||||
page: datas.page,
|
async function getMsg() {
|
||||||
limit: 12,
|
let res = await messageselectMessage()
|
||||||
sort: sort,
|
datas.noticeList = res.list
|
||||||
classifyId: ''
|
}
|
||||||
})
|
//获取推荐视频
|
||||||
|
async function getrecomVideo(sort, active = 1) {
|
||||||
|
datas.active = active
|
||||||
|
if (sort) {
|
||||||
|
datas.page = 1
|
||||||
|
}
|
||||||
|
let res = await courseselectCourse({
|
||||||
|
page: datas.page,
|
||||||
|
limit: 12,
|
||||||
|
sort: sort,
|
||||||
|
classifyId: ''
|
||||||
|
})
|
||||||
|
|
||||||
if (datas.page == 1) {
|
if (datas.page == 1) {
|
||||||
datas.list = res.list
|
datas.list = res.list
|
||||||
} else {
|
} else {
|
||||||
datas.list = [...datas.list, ...res.list]
|
datas.list = [...datas.list, ...res.list]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.indexStyle {
|
.indexStyle {
|
||||||
height: 555rpx;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
>image {
|
|
||||||
width: 100%;
|
|
||||||
height: 555rpx;
|
height: 555rpx;
|
||||||
position: absolute;
|
position: relative;
|
||||||
|
|
||||||
|
>image {
|
||||||
|
width: 100%;
|
||||||
|
height: 555rpx;
|
||||||
|
position: absolute;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.indexStyleTwo {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 88rpx 25rpx;
|
||||||
|
|
||||||
|
>image {
|
||||||
|
width: 187rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
>view {
|
||||||
|
z-index: 50;
|
||||||
|
width: 236rpx;
|
||||||
|
line-height: 43rpx;
|
||||||
|
background: rgba(255, 255, 255, 0.29);
|
||||||
|
border-radius: 7rpx 7rpx 7rpx 7rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 21rpx;
|
||||||
|
color: rgba(255, 255, 255, 0.85);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.gongao {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 75rpx;
|
||||||
|
left: 70rpx;
|
||||||
|
border-radius: 21rpx 21rpx 21rpx 21rpx;
|
||||||
|
width: 611rpx;
|
||||||
|
height: 78rpx;
|
||||||
|
background-color: rgba(255, 255, 255, .65);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 12rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.gongaoicon {
|
||||||
|
color: #ffffff;
|
||||||
|
width: 98rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
line-height: 50rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 25rpx;
|
||||||
|
background-image: url('../../static/index/gonggaobg.png');
|
||||||
|
background-size: 98rpx 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiperstyle {
|
||||||
|
height: 78rpx;
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.indexStyleTwo {
|
.navTop-active {
|
||||||
|
color: #cb5d68;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navTop {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 88rpx 25rpx;
|
padding: 0 20rpx;
|
||||||
|
|
||||||
>image {
|
|
||||||
width: 187rpx;
|
|
||||||
height: 50rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
z-index: 50;
|
background-color: #f0f0f0;
|
||||||
width: 236rpx;
|
margin-left: 20rpx;
|
||||||
line-height: 43rpx;
|
padding: 6rpx 20rpx
|
||||||
background: rgba(255, 255, 255, 0.29);
|
|
||||||
border-radius: 7rpx 7rpx 7rpx 7rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 21rpx;
|
|
||||||
color: rgba(255, 255, 255, 0.85);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.gongao {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 75rpx;
|
|
||||||
left: 70rpx;
|
|
||||||
border-radius: 21rpx 21rpx 21rpx 21rpx;
|
|
||||||
width: 611rpx;
|
|
||||||
height: 78rpx;
|
|
||||||
background-color: rgba(255, 255, 255, .65);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 12rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
.gongaoicon {
|
|
||||||
color: #ffffff;
|
|
||||||
width: 98rpx;
|
|
||||||
height: 50rpx;
|
|
||||||
line-height: 50rpx;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 25rpx;
|
|
||||||
background-image: url('../../static/index/gonggaobg.png');
|
|
||||||
background-size: 98rpx 50rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiperstyle {
|
|
||||||
height: 78rpx;
|
|
||||||
width: 80%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.navTop-active {
|
|
||||||
color: #cb5d68;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navTop {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 0 20rpx;
|
|
||||||
|
|
||||||
>view {
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
margin-left: 20rpx;
|
|
||||||
padding: 6rpx 20rpx
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user