修改弹窗

This commit is contained in:
daihh
2022-06-20 19:32:38 +08:00
parent 5ff6ec8fa1
commit b2c6e3ba9e
4 changed files with 92 additions and 21 deletions

View File

@@ -196,6 +196,12 @@
<view >
<uni-load-more :status="loadStatus"></uni-load-more>
</view>
<u-overlay :show="signInShow">
<view style="padding-top: 180upx;width:624upx;margin: 0px auto;">
<img usemap="#HotMap" src="/mobile/static/images/dlg.png" style="width:624upx;height: 864upx;">
<mapelement></mapelement>
</view>
</u-overlay>
</view>
</template>
<script>
@@ -216,6 +222,8 @@
noPageList: true,//判断接口是否还有数据
noDataList: true,//判断接口是否还有数据
msgNum:0,
signInShow:false,
signLocalTimesKey:'xboe_sign_dlg_times',
courseList:[],//课程列表数据
articleList: [],//文章列表数据
qaList: [],//问答列表数据
@@ -274,13 +282,72 @@
//this.$watermark.set('');
},
onShow() {
this.countNoReadMsg();
},
components:{
'mapelement': {
render: function(createElement) {
let $this=this;
var pElem1 = createElement('area', {
attrs:{
shape: "circle",
coords: "280,30,30",
href:"/pages/index/index",
},
on: {
click: function() {
//$this.signInShow=false;
console.log("test="+$this.signInShow)
},
}
});
var pElem2 = createElement('area', {
attrs:{
shape: "rectangle",
coords: "100,300,400,400",
href:"https://boehrsurvey.wjx.cn/vm/PmreuFN.aspx",
}
});
return createElement('map', {attrs: {
name: "HotMap",
id: "HotMap"
}},[
pElem1,pElem2 //想要添加更多area,可在数组中继续添加。如[pElem1,pElem2,…]
])
},
},
},
mounted() {
//控制弹出窗口的代码
let now = new Date() //当前时间
let end = new Date('2022/06/29 00:00:00') //对比时间
if(now.getTime() < end.getTime()){
let times = uni.getStorageSync(this.signLocalTimesKey);
let isNewLogin=uni.getStorageSync("boe_new_login");
//let isNewLogin='1';
if(isNewLogin && isNewLogin=='1'){
if(!times){
this.signInShow = true;//显示
uni.setStorageSync(this.signLocalTimesKey,1);
}else{
//console.log(times,'times');
let intTimes=parseInt(times);
if(intTimes<3){
this.signInShow = true;//显示
intTimes++;
uni.setStorageSync(this.signLocalTimesKey,intTimes);
}
}
uni.setStorageSync("boe_new_login",0);
}
}
this.findCourseData();
},
methods: {
methods: {
closeSignDlg(){
this.signInShow=false;
},
toNewLink(){
location.href='https://m.qingxuetang.com/x/?appId=qxtcorp306130';
},

View File

@@ -40,6 +40,7 @@
// uni.switchTab({
// url:'/pages/index/index'
// })
uni.setStorageSync("boe_new_login",1);//记录新登录
let openUrl=$this.toUrl;
if(openUrl){
if(openUrl.startsWith('http')){

View File

@@ -52,6 +52,9 @@
$this.loading = false;
if(rs.status==200){
//console.log(rs);
//记录已登录
uni.setStorageSync("boe_new_login",1);
$this.$store.dispatch("InitData").then(res => {
//console.log(res)
//$this.$watermark.set(res.result.name + res.result.loginName);

View File

@@ -400,25 +400,25 @@
this.loadBoeData(true);
// this.getLearning(); //这里应该是切换时再调用
//检查是否显示弹窗
let curTime = new Date();
curTime = parseInt(curTime.getTime() / 1000);
//console.log(curTime,'curTime');
let hasDlgTime = uni.getStorageSync('user_dlg_temp');
if (hasDlgTime) {
let lastTime = parseInt(hasDlgTime);
//console.log(lastTime,'lastTime2');
if (curTime > (lastTime + 24 * 60 * 60)) {
this.xuanShow = true;
//console.log('显示');
uni.setStorageSync('user_dlg_temp', curTime);
} else {
this.xuanShow = false;
this.showOneStady();
}
} else {
this.xuanShow = true;
uni.setStorageSync('user_dlg_temp', curTime);
}
// let curTime = new Date();
// curTime = parseInt(curTime.getTime() / 1000);
// //console.log(curTime,'curTime');
// let hasDlgTime = uni.getStorageSync('user_dlg_temp');
// if (hasDlgTime) {
// let lastTime = parseInt(hasDlgTime);
// //console.log(lastTime,'lastTime2');
// if (curTime > (lastTime + 24 * 60 * 60)) {
// this.xuanShow = true;
// //console.log('显示');
// uni.setStorageSync('user_dlg_temp', curTime);
// } else {
// this.xuanShow = false;
// this.showOneStady();
// }
// } else {
// this.xuanShow = true;
// uni.setStorageSync('user_dlg_temp', curTime);
// }
let $this = this;