Commit 6d296437 by 王君

update files

parent 19712671
...@@ -206,7 +206,7 @@ ...@@ -206,7 +206,7 @@
this.isMoreCache = true; this.isMoreCache = true;
} }
}*/ }*/
if(this.isMoreCache){ if(app.isMoreCache){
//moreList = this.setModelLocalIcon(moreList); //moreList = this.setModelLocalIcon(moreList);
$api.setStorage('morelists',moreList); $api.setStorage('morelists',moreList);
} }
...@@ -276,11 +276,12 @@ ...@@ -276,11 +276,12 @@
this.$nextTick(function () { this.$nextTick(function () {
/* 设置顶部安全区域,解决状态栏沉浸式 和 刘海屏问题 */ /* 设置顶部安全区域,解决状态栏沉浸式 和 刘海屏问题 */
}); });
this.init();
this.setTopModels();
this.setHomeModels();
} }
}); });
app.init();
app.setTopModels();
app.setHomeModels();
} }
</script> </script>
</body> </body>
......
...@@ -196,6 +196,7 @@ ...@@ -196,6 +196,7 @@
</head> </head>
<body> <body>
<div id="app_frame" v-cloak> <div id="app_frame" v-cloak>
<div v-if="show_page">
<div class="block"> <div class="block">
<!--顶部模块--> <!--顶部模块-->
<div class="topModels"> <div class="topModels">
...@@ -320,6 +321,7 @@ ...@@ -320,6 +321,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<script src="../script/jquery.min.js"></script> <script src="../script/jquery.min.js"></script>
<script type="text/javascript" src="../script/vue.min.js"></script> <script type="text/javascript" src="../script/vue.min.js"></script>
<script type="text/javascript" src="../script/vant.min.js"></script> <script type="text/javascript" src="../script/vant.min.js"></script>
...@@ -339,7 +341,25 @@ ...@@ -339,7 +341,25 @@
party_show:false, party_show:false,
article_list:[], article_list:[],
preview_list:[], preview_list:[],
token:$api.getStorage('token') token:$api.getStorage('token'),
show_page:false,
},
watch:{
top_models:function (newQuestion, oldQuestion) {
if(newQuestion){
this.showPage();
}
},
home_models:function (newQuestion, oldQuestion) {
if(newQuestion){
this.showPage();
}
},
article_list:function (newQuestion, oldQuestion) {
if(newQuestion){
this.showPage();
}
}
}, },
computed: { computed: {
/*topModels: function () { /*topModels: function () {
...@@ -415,7 +435,12 @@ ...@@ -415,7 +435,12 @@
this.getPartyList(); this.getPartyList();
this.getArticleList(); this.getArticleList();
this.getNewsList(); this.getNewsList();
},
showPage:function(){
if(this.top_models.length>0&&this.home_models.length>0&&this.article_list.length>0){
api.refreshHeaderLoadDone(); api.refreshHeaderLoadDone();
Vue.set(appFrame,"show_page",true);
}
}, },
setTopModels:function(){ setTopModels:function(){
get_data('/api/Column/getHeaderColumn2', 'post', {'type':'display'}, function(ret) { get_data('/api/Column/getHeaderColumn2', 'post', {'type':'display'}, function(ret) {
...@@ -477,8 +502,16 @@ ...@@ -477,8 +502,16 @@
}) })
} }
}, },
created:function(){
api.setRefreshHeaderInfo({
bgColor: '#3D7BFC',
     textColor: '#fff',
},function(ret, err){
appFrame.init();
});
api.refreshHeaderLoading();
},
mounted:function(){ mounted:function(){
$("#div_all").append("<div class='msg-new'></div>");
this.init(); this.init();
//监听 加red_datas //监听 加red_datas
api.addEventListener({ api.addEventListener({
...@@ -521,21 +554,18 @@ ...@@ -521,21 +554,18 @@
//更新红点数据 //更新红点数据
initHomeFrameMsgCache(); initHomeFrameMsgCache();
} }
});
//更新红点数据 //更新红点数据
initHomeFrameMsgCache(); initHomeFrameMsgCache();
this.$nextTick(function () {
});
});
//appFrame.top_models = $api.getStorage("topModelCache"); //appFrame.top_models = $api.getStorage("topModelCache");
//console.log(appFrame.top_models); //console.log(appFrame.top_models);
} }
}); });
api.setRefreshHeaderInfo({
bgColor: '#3D7BFC',
     textColor: '#fff',
},function(ret, err){
appFrame.init();
});
api.refreshHeaderLoading();
} }
</script> </script>
</body> </body>
......
...@@ -117,7 +117,6 @@ ...@@ -117,7 +117,6 @@
}, },
toDirect: function(param,l){ toDirect: function(param,l){
console.log(param); console.log(param);
console.log(l);
openmodulelink(param,l); openmodulelink(param,l);
}, },
}); });
......
...@@ -415,9 +415,9 @@ ...@@ -415,9 +415,9 @@
up_loading(ret.path) up_loading(ret.path)
}) })
} }
if(index == 3) { /*if(index == 3) {
post_video() post_video()
} }*/
}); });
} }
//准备上传图片 //准备上传图片
......
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
body{ body{
padding: 0px; padding: 0px;
margin: 0px; margin: 0px;
background-color: #fff;
}
[v-cloak]{
display: none;
} }
#privacy_policy{ #privacy_policy{
/*padding: 1em;*/ /*padding: 1em;*/
...@@ -20,6 +24,10 @@ ...@@ -20,6 +24,10 @@
overflow-y: auto; overflow-y: auto;
padding-left: 1em; padding-left: 1em;
padding-right: 1em; padding-right: 1em;
background: #fff;
}
.content_text{
padding-bottom: 6em;
} }
#header{ #header{
background-color: #3D60F6; background-color: #3D60F6;
...@@ -27,7 +35,11 @@ ...@@ -27,7 +35,11 @@
} }
.buttons{ .buttons{
padding: 1em; padding: 1em;
padding-bottom: 2em; padding-bottom: 1em;
position: fixed;
bottom: 0;
width: 100%;
background: #fff;
} }
.btnitem{ .btnitem{
text-align: center; text-align: center;
...@@ -39,7 +51,7 @@ ...@@ -39,7 +51,7 @@
.btnitem .btn1{ .btnitem .btn1{
color: #fff; color: #fff;
background-image: linear-gradient(to right,#4AA6FF ,#3764FF); background-image: linear-gradient(to right,#4AA6FF ,#3764FF);
padding: 0.2em 2.3em; padding: 0.2em 10%;
border-radius: 100px; border-radius: 100px;
font-size: 14px; font-size: 14px;
} }
...@@ -53,28 +65,49 @@ ...@@ -53,28 +65,49 @@
.loading{ .loading{
margin-top: 50%; margin-top: 50%;
} }
.header_img{
width: 100%;
height: 4em;
}
.title{
text-align: center;
color: #262626;
background: #fff;
font-size: 16px;
padding-top: 1em;
padding-bottom: 1em;
}
#header_div{
display: flex;
top:0;
}
</style> </style>
</head> </head>
<body> <body>
<div id="privacy_policy" v-cloak>
<div id="privacy_policy"> <van-sticky offset-top="0" id="header_div">
<van-loading v-if="isLoading" size="24px" vertical class="loading">加载中...</van-loading>
<div v-if="!isLoading">
<van-sticky :offset-top="0">
<header id="header"></header> <header id="header"></header>
<van-nav-bar :title="title"/> <van-row class="header_img">
</van-sticky> <van-col span="24">
<van-row> <van-image fit="contain" src="../image/privacy_policy_header_img.png" loading-icon="../image/default.png"/>
<van-col span="24" v-html="content" class="content">
</van-col> </van-col>
</van-row> </van-row>
</van-sticky>
<van-loading v-if="isLoading" size="24px" vertical class="loading">加载中...</van-loading>
<van-sticky :offset-top="0">
<div class="title" id="title">隐私协议</div>
</van-sticky>
<div class="content" id="content">
<div v-if="!isLoading">
<div v-html="content" class="content_text"></div>
</div>
</div>
<div id="buttons" class="buttons"> <div id="buttons" class="buttons">
<div class="btnitem btnitem1"> <div class="btnitem btnitem1">
<a href="javascript:goto();" class="btn btn1" @click="agree">同意并继续</a> <a href="javascript:;" class="btn btn1" @click="agree">同意并继续</a>
</div> </div>
<div class="btnitem"> <div class="btnitem">
<a href="javascript:goto();" class="btn btn2" @click="disagree">退出应用</a> <a href="javascript:;" class="btn btn2" @click="disagree">退出应用</a>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -98,33 +131,61 @@ ...@@ -98,33 +131,61 @@
isLoading:true, isLoading:true,
headerHeight:0 headerHeight:0
}, },
watch:{
isLoading:function (newQuestion, oldQuestion) {
if(!newQuestion){
var body_h=api.frameHeight;
var header_h=$('#header_div').height();
var buttons_h=$('#buttons').height();
var title_h=$('#title').height();
var contentHeight=body_h-header_h-buttons_h-title_h-api.safeArea.bottom;
console.log(body_h,header_h,buttons_h,title_h,api.safeArea.bottom,contentHeight);
$('#content').height(contentHeight);
}
}
},
methods:{ methods:{
init(){ init(){
//var header = document.querySelector('#header'); /*var body_h = $api.offset($api.dom('body')).h;
//$api.fixStatusBar(header); var header = $api.byId('header_div');
//var headerPos = $api.offset(header); var headerPos = $api.offset(header);
//Vue.set(app,'headerHeight',headerPos.h); console.log(JSON.stringify(headerPos));
var buttons = $api.byId('buttons');
var buttonsPos = $api.offset(buttons);
console.log(JSON.stringify(buttonsPos));
var contentHeight =body_h-headerPos.h-buttonsPos.h;
var content = $api.byId('content');
$api.css(content,'height:'+contentHeight+'px');*/
}, },
back(){ back(){
window.history.back(); window.history.back();
}, },
setContent(){ setContent(){
var url = window.config.dev_path+"/api/page/detail?id=16"; var url = window.config.dev_path+"api/page/detail?id=16";
$.post(url,{},function(ret){ $api.post(url,{},function(ret){
if(1==ret.status){ if(1==ret.status){
Vue.set(app,'content',ret.data.content); Vue.set(app,'content',ret.data.content);
Vue.set(app,'title',ret.data.title); Vue.set(app,'title',ret.data.title);
Vue.set(app,'isLoading',false); Vue.set(app,'isLoading',false);
} }
},'json'); },'json');
/*$.post(url,{},function(ret){
alert(JSON.stringify(ret));
if(1==ret.status){
Vue.set(app,'content',ret.data.content);
Vue.set(app,'title',ret.data.title);
Vue.set(app,'isLoading',false);
}
},'json');*/
}, },
agree(){ agree(){
//open_home(); if(!this.isLoading){
$api.setStorage('first_run',500); $api.setStorage('first_run',500);
api.openFrame({ api.openFrame({
name: 'index', name: 'index',
url: './index.html', url: './index.html',
}); });
}
}, },
disagree(){ disagree(){
api.closeWidget(); api.closeWidget();
......
...@@ -55,7 +55,17 @@ ...@@ -55,7 +55,17 @@
<script type="text/javascript" src="./script/api.js"></script> <script type="text/javascript" src="./script/api.js"></script>
<script type="text/javascript"> <script type="text/javascript">
apiready = function(){ apiready = function(){
console.log('as'); $api.setStorage('first_run',1);
var first_run=$api.getStorage('first_run');
if(first_run!=500){
api.openFrame({
name: 'privacy_policy',
url: './html/privacy_policy.html',
bounces: false,
reload: true,
vScrollBarEnabled: false,
});
}else{
api.setStatusBarStyle({ api.setStatusBarStyle({
style: 'light', style: 'light',
}); });
...@@ -74,7 +84,7 @@ ...@@ -74,7 +84,7 @@
h:'auto' h:'auto'
} }
}); });
console.log('dd'); }
}; };
</script> </script>
</html> </html>
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