弹窗判断
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<template v-if="datas.setindexdata==1">
|
<template v-if="datas.isExamine">
|
||||||
<view class="gongao">
|
<view class="gongao">
|
||||||
<view class="gongaoicon">
|
<view class="gongaoicon">
|
||||||
公告
|
公告
|
||||||
@@ -42,18 +42,18 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<contentlist :list='datas.list'></contentlist>
|
<contentlist :list='datas.list'></contentlist>
|
||||||
<image v-if="datas.setindexdata==1" @click="goMsg()" src="@/static/index/red-pack-new.gif"
|
<image v-if="datas.isExamine" @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"
|
<up-modal :show="datas.version.show" :confirm-text="datas.version.confirmText"
|
||||||
:showCancelButton="datas.version.cancelText!=''" @confirm='confirmUpdateVersion' :title="datas.version.title"
|
:showCancelButton="datas.version.cancelText!=''" @cancel="cancelUpdateVersion" @confirm='confirmUpdateVersion' :title="datas.version.title"
|
||||||
:title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)" @cancel="datas.version.show = false">
|
:title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)">
|
||||||
<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="$common.isIosExamine&&!datas.version.show" confirm-text="知道了" title="规则说明"
|
<up-modal :show="datas.ruleShow" v-if="datas.isExamine&&!datas.version.show" confirm-text="知道了" title="规则说明"
|
||||||
:title="datas.rule_title" :title-style="{fontWeight:'700'}" @confirm="ruleConfirm"
|
:title="datas.rule_title" :title-style="{fontWeight:'700'}" @confirm="ruleConfirm"
|
||||||
confirm-color="rgb(255, 117, 129)">
|
confirm-color="rgb(255, 117, 129)">
|
||||||
<view class="u-p-30 u-text-left">
|
<view class="u-p-30 u-text-left">
|
||||||
@@ -97,11 +97,12 @@
|
|||||||
// console.log('cash:' + uni.getStorageSync('userInfo').userId + "" + new Date().getTime(), 'debug')
|
// console.log('cash:' + uni.getStorageSync('userInfo').userId + "" + new Date().getTime(), 'debug')
|
||||||
// 判断ios是否审核
|
// 判断ios是否审核
|
||||||
$common.init()
|
$common.init()
|
||||||
let sysInfo = uni.getSystemInfoSync()
|
// let sysInfo = uni.getSystemInfoSync()
|
||||||
let isIos = sysInfo.platform == 'ios'
|
// let isIos = sysInfo.platform == 'ios'
|
||||||
if (isIos) {
|
// if (isIos) {
|
||||||
datas.setindexdata = $common.isIosExamine
|
// datas.setindexdata = $common.setversion
|
||||||
}
|
// console.log(datas.setindexdata,'seaeasdas')
|
||||||
|
// }
|
||||||
})
|
})
|
||||||
let datas = reactive({
|
let datas = reactive({
|
||||||
noticeList: [], //公告列表
|
noticeList: [], //公告列表
|
||||||
@@ -125,13 +126,12 @@
|
|||||||
cancelText: "",
|
cancelText: "",
|
||||||
downloadLink: ""
|
downloadLink: ""
|
||||||
},
|
},
|
||||||
setindexdata :"false"
|
setindexdata :false
|
||||||
})
|
})
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
versionUpdate()
|
versionUpdate()
|
||||||
getMsg()
|
getMsg()
|
||||||
getrecomVideo()
|
getrecomVideo()
|
||||||
datas.isExamine = $common.isIosExamine || 0
|
|
||||||
})
|
})
|
||||||
onReady(() => {
|
onReady(() => {
|
||||||
if (!uni.getStorageSync('ruleShow')) {
|
if (!uni.getStorageSync('ruleShow')) {
|
||||||
@@ -169,10 +169,12 @@
|
|||||||
version = res.iosVersion
|
version = res.iosVersion
|
||||||
}
|
}
|
||||||
let isVersion = await $common.setversion(widgetInfo.version, version)
|
let isVersion = await $common.setversion(widgetInfo.version, version)
|
||||||
|
datas.isExamine = $common.isIosExamine
|
||||||
|
console.log(isVersion,'')
|
||||||
if ( isVersion == 1 ) {
|
if ( isVersion == 1 ) {
|
||||||
datas.version.downloadLink = res.androidWgtUrl;
|
datas.version.downloadLink = res.androidWgtUrl;
|
||||||
datas.version.show = true;
|
datas.version.show = true;
|
||||||
datas.version.title = "发现新版本";
|
datas.version.title = "发现新版本";
|
||||||
datas.version.content = res.des;
|
datas.version.content = res.des;
|
||||||
uni.hideTabBar()
|
uni.hideTabBar()
|
||||||
if (res.method == "true") {
|
if (res.method == "true") {
|
||||||
@@ -187,7 +189,10 @@
|
|||||||
});
|
});
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
function cancelUpdateVersion () {
|
||||||
|
uni.showTabBar()
|
||||||
|
datas.version.show = false
|
||||||
|
}
|
||||||
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')
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ export const useCommonStore = defineStore("common", {
|
|||||||
},
|
},
|
||||||
setversion(a, b) {
|
setversion(a, b) {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
// console.log('當前版本-' + a, '接口版本-' + b, '判斷值-' + this.isExamines)
|
|
||||||
this.isExamines = await this.compare(a, b)
|
this.isExamines = await this.compare(a, b)
|
||||||
|
console.log('判斷值-' + this.isExamines)
|
||||||
resolve(this.isExamines)
|
resolve(this.isExamines)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -82,19 +82,24 @@ export const useCommonStore = defineStore("common", {
|
|||||||
const n1 = Number(arr1[i] || 0)
|
const n1 = Number(arr1[i] || 0)
|
||||||
const n2 = Number(arr2[i] || 0)
|
const n2 = Number(arr2[i] || 0)
|
||||||
// version1 > version2 返回1,如果 version1 < version2 返回-1,不然返回0
|
// version1 > version2 返回1,如果 version1 < version2 返回-1,不然返回0
|
||||||
if (n1 > n2) return 1
|
// 当前版 n1 接口版本是 n2
|
||||||
if (n1 < n2) return -1
|
// 1小于2 更新弹窗、抽奖等显示
|
||||||
|
if (n1 < n2) return 1
|
||||||
|
// 1大于2 更新弹窗、抽奖不显示
|
||||||
|
if (n1 > n2) return -1
|
||||||
}
|
}
|
||||||
|
// 1等于2 更新弹窗不显示‘抽奖显示
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
isIosExamine: function () {
|
isIosExamine: function() {
|
||||||
|
console.log(this.isExamines)
|
||||||
if (!this.isIos) {
|
if (!this.isIos) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if (this.isExamines == 1) {
|
if (this.isExamines == -1) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user