Browse Source

首页弹窗显示,答题跳转延长

h5_css
yanyan 3 years ago
parent
commit
95ee2911ec
  1. 7
      components/s-video/s-video.vue
  2. 41
      pages/index/index.vue

7
components/s-video/s-video.vue

@ -170,6 +170,11 @@
this.resCheck = true; this.resCheck = true;
this.question = false; this.question = false;
this.innerAudioContext.play(); this.innerAudioContext.play();
// this.timer = setTimeout(() => {
// this.showTitle = false
// clearTimeout(this.timer)
// }, 5000)
} }
} }
}, },
@ -277,7 +282,7 @@
that.start = false; that.start = false;
that.question = false; that.question = false;
that.auto = true; that.auto = true;
}, 300); }, 2000);
}, },
getBindJson() { getBindJson() {
this.start = true; this.start = true;

41
pages/index/index.vue

@ -17,7 +17,9 @@
<view class="itembox"> <view class="itembox">
<span v-for="(item,i) in sceneList" :key="i" @click="navClickHandler(item)"><img :src="item.uploadPath" class="scene-img"></image></span> <span v-for="(item,i) in sceneList" :key="i" @click="navClickHandler(item)"><img :src="item.uploadPath" class="scene-img"></image></span>
</view> </view>
<view class="middleContent" v-if="showTitle">
<view v-html="content"></view>
</view>
</view> </view>
<view class="footbox"> <view class="footbox">
<tabbar :page="page"></tabbar> <tabbar :page="page"></tabbar>
@ -61,17 +63,24 @@
//场景入口 //场景入口
sceneList: [], sceneList: [],
x:0, x:0,
y:0 showTitle:true,
y:0,
content:""
}; };
}, },
computed: { computed: {
...mapState('m_user', ['token']) ...mapState('m_user', ['token'])
}, },
onLoad() { onLoad(options) {
this.checkLogin(); this.checkLogin();
if (this.token != "") { if (this.token != "") {
this.getSwiperList(); this.getSwiperList();
this.getLocation(); this.getLocation();
this.getContent();
this.timer = setTimeout(() => {
this.showTitle = false
clearTimeout(this.timer)
}, 5000)
} }
}, },
onShow() { onShow() {
@ -108,6 +117,18 @@
// uni.$showMsg('数据请求成功!') // uni.$showMsg('数据请求成功!')
}, },
async getContent() {
const {
data: res
} = await uni.$http.post('/small/project/text/listAll',{type:3})
if (!res.success) return uni.$showMsg()
res.data.forEach(item=>{
this.content = item.content
})
},
navClickHandler(item) { navClickHandler(item) {
uni.navigateTo({ uni.navigateTo({
url: '/subpkg/list/list?isOpen='+item.isOpen url: '/subpkg/list/list?isOpen='+item.isOpen
@ -214,6 +235,20 @@
<style lang="scss"> <style lang="scss">
@import url("@/static/base_css.css"); @import url("@/static/base_css.css");
.middleContent {
position: absolute;
top: 45%;
left: 50%;
z-index: 9999;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
padding: 30rpx;
width: 400rpx;
height: 300rpx;
background-color: #c0b9e1;
border-radius: 10px;
opacity: 0.9;
}
// .index-background { // .index-background {
// image { // image {
// height: 270rpx; // height: 270rpx;

Loading…
Cancel
Save