Skip to content

Commit

Permalink
格式化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
宁泽林 committed Sep 27, 2019
2 parents 00110c3 + 4a9e677 commit 5475ee3
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 82 deletions.
43 changes: 20 additions & 23 deletions pages/about/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var wxRequest = require('../../utils/wxRequest.js')
var Auth = require('../../utils/auth.js');
import config from '../../utils/config.js'
var app = getApp();

let interstitialAd = null

Page({
data: {
Expand All @@ -37,10 +37,25 @@ Page({
isLoginPopup: false,
openid: "",
system: ""


},
onLoad: function(options) {
if (wx.createInterstitialAd) {
interstitialAd = wx.createInterstitialAd({
adUnitId: 'adunit-9fa574b054c9be1c'
})
interstitialAd.onLoad(() => {
console.log('onLoad event emit')
})
interstitialAd.onError((err) => {
console.log('onError event emit', err)
})
interstitialAd.onClose((res) => {
console.log('onClose event emit', res)
})
interstitialAd.show().catch((err) => {
console.error(err)
})
}
var self = this;
wx.setNavigationBarTitle({
title: config.getWebsiteName + '-关于站长',
Expand All @@ -52,15 +67,16 @@ Page({
Auth.checkLogin(self);
this.fetchData(config.getAboutId);
wx.getSystemInfo({

success: function(t) {
var system = t.system.indexOf('iOS') != -1 ? 'iOS' : 'Android';
self.setData({
system: system
});

}
})
},

praise: function() {

var self = this;
Expand All @@ -80,9 +96,7 @@ Page({
wx.previewImage({
urls: [src],
});

}

},
onPullDownRefresh: function() {
var self = this;
Expand All @@ -96,7 +110,6 @@ Page({
this.fetchData(config.getAboutId);
//消除下刷新出现空白矩形的问题。
wx.stopPullDownRefresh()

},
onShareAppMessage: function() {
return {
Expand All @@ -122,7 +135,6 @@ Page({
} else {
self.copyLink(config.getDomain);
}

},
copyLink: function(url) {
//this.ShowHideMenu();
Expand Down Expand Up @@ -165,7 +177,6 @@ Page({
}
})
} else {

var slug = util.GetUrlFileName(href, domain);
if (slug == 'index') {
wx.switchTab({
Expand All @@ -188,13 +199,9 @@ Page({
openLinkCount++;
wx.setStorageSync('openLinkCount', openLinkCount);
}

})

}

}

},
agreeGetUser: function(e) {
var userInfo = e.detail.userInfo;
Expand Down Expand Up @@ -227,7 +234,6 @@ Page({
getPageRequest.then(response => {
console.log(response);
WxParse.wxParse('article', 'html', response.data.content.rendered, self, 5);

self.setData({
pageData: response.data,
// wxParseData: WxParse('md',response.data.content.rendered)
Expand All @@ -237,13 +243,10 @@ Page({
display: 'block'
});


}).then(res => {
var getAllPraiseRequest = wxRequest.getRequest(Api.getAllPraiseUrl());
getAllPraiseRequest.then(response => {

if (response.data.status == '200') {

var _avatarurls = response.data.avatarurls;
var avatarurls = [];
for (var i = 0; i < _avatarurls.length; i++) {
Expand All @@ -253,24 +256,18 @@ Page({
}
avatarurls[i] = avatarurl;
}

self.setData({
praiseList: avatarurls
});

} else {
console.log(response);
}


})

})
.then(res => {
if (!app.globalData.isGetOpenid) {
// auth.getUsreInfo();
}

})
}
})
3 changes: 3 additions & 0 deletions pages/about/about.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
padding: 5rpx;
}

.adContainer {
}

.excerpt{
color:#626262;
font-size:32rpx;
Expand Down
4 changes: 3 additions & 1 deletion pages/detail/detail.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,12 @@
<view class="canvas-box">
<canvas style="width: 600px;height: 970px;" canvas-id="mycanvas" />
</view>
<view class="adContainer">
<ad unit-id="adunit-b7fce7de127259cc" bindload="adLoad" binderror="adError" bindclose="adClose"></ad>
</view>
<view class="ditail-copyright" style="display:{{display}}">
<template is="tempCopyright" />
</view>

<template is="login-popup" data="{{show: isLoginPopup, userInfo: userInfo}}"></template>

<!--评论区-->
Expand Down
116 changes: 58 additions & 58 deletions project.config.json
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
{
"description": "项目配置文件。",
"setting": {
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"nodeModules": false,
"autoAudits": false,
"uglifyFileName": true
},
"compileType": "miniprogram",
"libVersion": "2.6.2",
"appid": "wxea3b3b52ffe574f2",
"projectname": "PHP%E5%BC%80%E6%BA%90Hub",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": [
{
"name": "test",
"pathName": "",
"title": "",
"cacheKey": ""
}
]
},
"conversation": {
"current": 0,
"list": [
{
"name": "test",
"query": "",
"boxQI": "",
"service": {}
}
]
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"list": []
},
"miniprogram": {
"current": 0,
"list": [
{
"id": -1,
"name": "更新模式",
"pathName": "pages/index/index"
}
]
}
}
"description": "项目配置文件。",
"setting": {
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"nodeModules": false,
"autoAudits": false,
"uglifyFileName": true
},
"compileType": "miniprogram",
"libVersion": "2.6.2",
"appid": "wxea3b3b52ffe574f2",
"projectname": "PHP%E5%BC%80%E6%BA%90Hub",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": [
{
"name": "test",
"pathName": "",
"title": "",
"cacheKey": ""
}
]
},
"conversation": {
"current": 0,
"list": [
{
"name": "test",
"query": "",
"boxQI": "",
"service": {}
}
]
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"list": []
},
"miniprogram": {
"current": 0,
"list": [
{
"id": -1,
"name": "更新模式",
"pathName": "pages/index/index"
}
]
}
}
}

0 comments on commit 5475ee3

Please sign in to comment.