弹窗,广告

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

@@ -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>