弹窗,广告

This commit is contained in:
duan 2025-01-13 17:42:17 +08:00
parent dba6bcd906
commit fad0ca9ff0
5 changed files with 981 additions and 762 deletions

View File

@ -84,7 +84,7 @@
//
ymfgoCourse(e,courseDetailsId) {
uni.navigateTo({
url: '/me/detail/detail?id=' + e+'&courseDetailsId='+courseDetailsId
url: '/me/detail/detailIOS?id=' + e+'&courseDetailsId='+courseDetailsId
})
},
//

File diff suppressed because it is too large Load Diff

View File

@ -57,8 +57,8 @@
:src="`../../static/red-pack-new.gif`"
style="width: 200rpx;height: 200rpx;position: fixed;right: 10rpx;bottom: 180rpx;"></u-image>
<u-modal v-if="isShowMoneyPay" v-model="ruleShow" confirm-text="知道了" :title="rule_title" :title-style="{ fontWeight: '700' }"
confirm-color="rgb(255, 117, 129)">
<u-modal v-if="isShowMoneyPay" v-model="ruleShow" @confirm="ruleConfirm" confirm-text="知道了" :title="rule_title"
:title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)">
<view class="u-p-30 u-text-left">
<scroll-view scroll-y="true" style="max-height: 50vh;">
<rich-text class="color-666" :nodes="rule_content"></rich-text>
@ -70,153 +70,182 @@
</template>
<script>
import contentlist from './components/contentlist.vue'
import httpsRequest from '@/common/httpRequest.js'
export default {
components: {
contentlist
},
data() {
return {
noticeList: [], //
list: [],
page: 1,
active: 1,
isShowMoneyPay: true,
ruleShow: false,
rule_title: '',
rule_content: '',
import contentlist from './components/contentlist.vue'
import httpsRequest from '@/common/httpRequest.js'
import {
$cache_config,
$cache_rule
} from '@/store/cashe.js'
export default {
components: {
contentlist
},
data() {
return {
noticeList: [], //
list: [],
page: 1,
active: 1,
isShowMoneyPay: true,
ruleShow: false,
rule_title: '',
rule_content: '',
ruleList: "",
ruleIndex: 0,
ruleList: $cache_rule.ruleIndex || []
}
},
onShow() {
this.getMsg()
this.getrecomVideo()
httpsRequest.getT("/app/common/type/919", {}).then(res => {
if (res.code == 0) {
const sysInfo = uni.getSystemInfoSync();
let isIos = sysInfo.platform == 'ios'
this.isIosApp = isIos
this.isShowMoneyPay = !(res.data.value == '1' && isIos)
}
});
httpsRequest.getT("/app/announcement", {
type: 0
}).then(res => {
if (res.code == 0 && res.data.length > 0) {
this.ruleShow = true
this.ruleList = res.data
$cache_rule.set('ruleIndex', this.ruleList)
this.ruleInit()
// this.ruleShow = true
// this.rule_title = res.data[0].title
// this.rule_content = res.data[0].content
}
});
},
onReachBottom() {
++this.page
this.getrecomVideo()
},
methods: {
ruleInit() {
this.rule_title = this.ruleList[this.ruleIndex].title
this.rule_content = this.ruleList[this.ruleIndex].content
},
ruleConfirm() {
this.ruleIndex++
if (this.ruleIndex >= this.ruleList.length) {
this.ruleIndex = 0
return
}
this.ruleShow = false
setTimeout(res => {
this.ruleInit()
this.ruleShow = true
}, 300)
},
//
goMsg(url) {
if (url.indexOf('/pages/') !== -1 || url.indexOf('/me/') !== -1) {
uni.navigateTo({
url
});
} else {
//#ifndef H5
uni.navigateTo({
url: '/pages/index/webView?url=' + url
});
//#endif
//#ifdef H5
window.location.href = url;
//#endif
}
},
moreVideo() {
uni.navigateTo({
url: '/pages/index/course/courseList?title=最新热播'
})
},
//
//
getrecomVideo(sort, active = 1) {
this.active = active
if (sort) {
this.page = 1
}
let data = {
page: this.page,
limit: 12,
sort: sort,
classifyId: ''
}
this.$Request.getT('/app/course/selectCourse', data).then(res => {
if (res.code == 0) {
if (this.page == 1) {
this.list = res.data.list
} else {
this.list = [...this.list, ...res.data.list]
}
}
})
},
//
getMsg() {
let data = {
page: 1,
limit: 5,
state: 1
}
this.$u.api.msg(data).then(res => {
if (res.code == 0) {
this.notice = res.data.list
res.data.list.forEach(res => {
this.noticeList.push(res)
})
} else {
uni.showToast({
title: res.msg,
duration: 1000,
icon: 'none'
});
}
})
},
}
},
onShow() {
this.getMsg()
this.getrecomVideo()
httpsRequest.getT("/app/common/type/919", {}).then(res => {
if (res.code == 0) {
const sysInfo = uni.getSystemInfoSync();
let isIos = sysInfo.platform == 'ios'
this.isIosApp = isIos
this.isShowMoneyPay = !(res.data.value == '1' && isIos)
}
});
httpsRequest.getT("/app/announcement", {}).then(res => {
if (res.code == 0) {
if (res.data && res.data.state == 1) {
this.ruleShow = true
this.rule_title = res.data.title
this.rule_content = res.data.content
}
}
});
},
onReachBottom() {
++this.page
this.getrecomVideo()
},
methods: {
//
goMsg(url) {
if (url.indexOf('/pages/') !== -1 || url.indexOf('/me/') !== -1) {
uni.navigateTo({
url
});
} else {
//#ifndef H5
uni.navigateTo({
url: '/pages/index/webView?url=' + url
});
//#endif
//#ifdef H5
window.location.href = url;
//#endif
}
},
moreVideo() {
uni.navigateTo({
url: '/pages/index/course/courseList?title=最新热播'
})
},
//
//
getrecomVideo(sort, active = 1) {
this.active = active
if (sort) {
this.page = 1
}
let data = {
page: this.page,
limit: 12,
sort: sort,
classifyId: ''
}
this.$Request.getT('/app/course/selectCourse', data).then(res => {
if (res.code == 0) {
if (this.page == 1) {
this.list = res.data.list
} else {
this.list = [...this.list, ...res.data.list]
}
}
})
},
//
getMsg() {
let data = {
page: 1,
limit: 5,
state: 1
}
this.$u.api.msg(data).then(res => {
if (res.code == 0) {
this.notice = res.data.list
res.data.list.forEach(res => {
this.noticeList.push(res)
})
} else {
uni.showToast({
title: res.msg,
duration: 1000,
icon: 'none'
});
}
})
},
}
}
</script>
<style scoped lang="scss">
.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;
.gongaoicon {
color: #ffffff;
width: 98rpx;
height: 50rpx;
line-height: 50rpx;
text-align: center;
background-image: url('../../static/gonggaobg.png');
background-size: 98rpx 50rpx;
}
.swiperstyle {
.gongao {
position: absolute;
bottom: 75rpx;
left: 70rpx;
border-radius: 21rpx 21rpx 21rpx 21rpx;
width: 611rpx;
height: 78rpx;
width: 80%;
background-color: rgba(255, 255, 255, .65);
display: flex;
align-items: center;
padding: 12rpx;
.gongaoicon {
color: #ffffff;
width: 98rpx;
height: 50rpx;
line-height: 50rpx;
text-align: center;
background-image: url('../../static/gonggaobg.png');
background-size: 98rpx 50rpx;
}
.swiperstyle {
height: 78rpx;
width: 80%;
}
}
}
</style>

View File

@ -97,11 +97,11 @@
</view>
</view>
<!-- 激励视频广告 -->
<!-- <ad-rewarded-video v-if="adRewardedVideo" ref="adRewardedVideo" adpid="1531580352" :loadnext="true"
<ad-rewarded-video v-if="adRewardedVideo" ref="adRewardedVideo" adpid="1531580352" :loadnext="true"
v-slot:default="{ loading, error }" :url-callback="urlCallback" @load="onadload" @close="onadclose"
@error="onaderror">
<view class="ad-error" v-if="error">{{ error }}</view>
</ad-rewarded-video> -->
</ad-rewarded-video>
</view>
</template>

143
store/cashe.js Normal file
View File

@ -0,0 +1,143 @@
import {
data
} from "../tuniao-ui/libs/mixin/mixin"
class CACHE {
constructor(data) {
if (data === '' || data === null || data === undefined) {
throw (new Error('请传入缓存name值:index | {name:index}'))
return
}
if (typeof data === 'string') {
this._name = data
Object.defineProperty(this, '_name', {
writable: false
});
} else {
if (!data.name && !data._name) {
throw (new Error('请传入缓存name值:index | {name:index}'))
return
}
for (let i in data) {
this[i] = data[i]
const canWrite = i.slice(0, 1) !== '_'
Object.defineProperty(this, i, {
writable: canWrite,
writable: canWrite
});
}
}
}
isEmpty(){
return Object.keys(this).length>=2?false:true;
}
get(key) {
return this[key]
}
set(key, val) {
this[key] = val
uni.setStorageSync(this._name, this)
}
clear() {
Object.keys(this).map(v => {
if (v.slice(0, 1) !== '_') {
this[v] = null
delete this[v]
}
})
uni.removeStorageSync(this._name)
}
}
export const $cache_index = new CACHE({
_name: 'CACHE_index',
...uni.getStorageSync('CACHE_index')
})
export const $cache_video = new CACHE({
_name: 'CACHE_video',
...uni.getStorageSync('CACHE_video')
})
export const $cache_renwu = new CACHE({
_name: 'CACHE_renwu',
...uni.getStorageSync('CACHE_renwu')
})
export const $cache_chasingDrama = new CACHE({
_name: 'CACHE_chasingDrama',
...uni.getStorageSync('CACHE_chasingDrama')
})
export const $cache_user = new CACHE({
_name: 'CACHE_user',
...uni.getStorageSync('CACHE_user')
})
export const $cache_rule = new CACHE({
_name: 'CACHE_rule',
...uni.getStorageSync('CACHE_rule')
})
class CACHE_config extends CACHE {
constructor(data) {
super(data)
for (let i in data) {
if(i!=='_name'){
uni.setStorageSync(i,data[i])
}
}
}
set(key, val) {
this[key] = val
uni.setStorageSync(this._name, this)
}
set(key, val) {
this[key] = val
uni.setStorageSync(key, val)
uni.setStorageSync(this._name, this)
}
clear() {
Object.keys(this).map(v => {
if (v.slice(0, 1) !== '_') {
this[v] = null
delete this[v]
}
})
uni.removeStorageSync(this._name)
}
}
export const $cache_config = new CACHE_config({
_name: 'CACHE_config',
...uni.getStorageSync('CACHE_config')
})
const $cache={
index:$cache_index,
video:$cache_video,
renwu:$cache_renwu,
chasingDrama:$cache_chasingDrama,
user:$cache_user,
rule:$cache_rule,
config:$cache_config
}
export function cacheClearAll() {
for(let i in $cache){
$cache[i].clear()
}
}
export function cacheClear(arr){
if(typeof arr==='string'&&$cache[arr]){
$cache[arr].clear()
}
if(Array.isArray(arr)){
for(let i in arr){
const key=[arr[i]]
if($cache[key]){
$cache[key].clear()
}
}
}
}