Commit fafe906a authored by Mac's avatar Mac

1

parent 1f8b17c2
<template>
<view v-if="myPageData.home_pages" :style="[myPageData.home_pages.navs[active].templateBg]">
<view>
<view v-if="showStart== true" style="width: 100vw;height: 100vh;">
<image :src="startData.PicUrl" mode='aspectFit' style="width: 100%;height: 100%;position: relative;" >
<view class="Startbtn" :style="{'top':pagePaddingBottom}" @click="startb">
跳过
</view>
</image>
</view>
<view v-if="myPageData.home_pages " v-show="showStart== false" :style="[myPageData.home_pages.navs[active].templateBg]">
<view class="content" :style="{ 'padding-bottom': showtabs==ture? '100rpx':0,paddingTop:pagePaddingBottom }">
<view class="index-title" :style="[myPageData.home_pages.navs[active].templateBg,titleStyle,{color:myPageData.home_pages.navs[active].templateBg?myPageData.home_pages.navs[active].templateBg.titleColor:''}]">
<text v-if="isNavPosition==0">{{pageTitleStr}}</text>
......@@ -70,6 +78,8 @@
<official-account></official-account>
</view>
</view>
</view>
</template>
<script>
......@@ -101,7 +111,7 @@
import argoods from "@/components/studyArticle/index.vue";
import store from "@/components/store/store.vue"
import sindex from "@/components/store/index.vue"
const innerAudioContext = uni.createInnerAudioContext();
export default {
data() {
return {
......@@ -134,6 +144,8 @@
storePosition: '', //线下服务获取经纬度
storeInfo: {},
fxstoreId:0,//分享过来的门店id
showStart:false,//是否显示启动页
startData:{},
};
},
components: {
......@@ -369,8 +381,17 @@
// this.getstore()
// }
// this.init();
let now = new Date()
let nowtime = now.getFullYear()+'-'+(now.getMonth()+1)+'-'+now.getDate()
this.getIsOpenReserve();
if(!uni.getStorageSync('Startup_page')){//获取启动页信息1、没有记录日期
this.getstartModel(nowtime)
}else{//记录日期和当天相差1天调取
let dayc = this.DateDiff(uni.getStorageSync('Startup_page').time,nowtime)
if(dayc>=1){
this.getstartModel(nowtime)
}
}
uni.showNavigationBarLoading();
},
......@@ -476,6 +497,48 @@
}
);
},
DateDiff(sDate1,sDate2){
var aDate, oDate1, oDate2, iDays
aDate = sDate1.split("-")
oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) //转换为9-25-2017格式
aDate = sDate2.split("-")
oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) //把相差的毫秒数转换为天数
return iDays
},
getstartModel(time){
this.request2({
url: "/api/AppletSchool/GetEducationStartUpModel",
data: {},
},
(res) => {
uni.setStorageSync("Startup_page",{time:time});//方便在分类判断
if (res.resultCode == 1) {
if(res.data.IsShow == 1){
this.showStart = true;
this.startData = res.data;
innerAudioContext.autoplay = true;
innerAudioContext.src = res.data.MusicUrl;
setTimeout(()=>{
this.showStart =false;
if (innerAudioContext != undefined) {//判断下不是无法暂停
innerAudioContext.stop();
}
},res.data.Seconds*1000)
}
}else{
}
}
);
},
startb(){//跳过启动页
this.showStart = false;
if (innerAudioContext != undefined) {//判断下不是无法暂停
innerAudioContext.stop();
}
},
getphonenumber(e) {
console.log(e)
uni.checkSession({ //检查登录状态是否过期
......@@ -1072,7 +1135,13 @@
left: 5px;
bottom: 12.5px;
}
.Startbtn{
position: absolute;top: 10px;right: 15px;width: 50px;height: 20px;background: rgba(45, 45, 45, 0.5);border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
color: #FFF;
}
/* .logo {
height: 200rpx;
width: 200rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment