Skip to content

Commit 3bdcbb3

Browse files
committed
更新vpush推送组件
1 parent ef3c6c7 commit 3bdcbb3

35 files changed

+667
-499
lines changed

app.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,27 @@
99
*/
1010

1111
const ald = require('./utils/ald-stat.js');
12-
var vPush = require('./utils/vpush/_vpush.js');
12+
var vPush = require('./utils/vpush-pro-sdk/vpush.pro.js');
1313

1414
App({
15-
vPush,
16-
onLaunch: function () {
15+
vPush: new vPush('wxd9a0fcfcb2877cc0'),
16+
onLaunch: function() {
1717
//调用API从本地缓存中获取数据
1818
var logs = wx.getStorageSync('logs') || []
1919
logs.unshift(Date.now())
2020
wx.setStorageSync('logs', logs)
2121
},
22-
23-
getUserInfo:function(cb){
22+
23+
getUserInfo: function(cb) {
2424
var that = this
25-
if(this.globalData.userInfo){
25+
if (this.globalData.userInfo) {
2626
typeof cb == "function" && cb(this.globalData.userInfo)
27-
}else{
27+
} else {
2828
//调用登录接口
2929
wx.login({
30-
success: function () {
30+
success: function() {
3131
wx.getUserInfo({
32-
success: function (res) {
32+
success: function(res) {
3333
that.globalData.userInfo = res.userInfo
3434
typeof cb == "function" && cb(that.globalData.userInfo)
3535
}
@@ -38,11 +38,11 @@ App({
3838
})
3939
}
4040
},
41-
globalData:{
42-
userInfo:null,
43-
openid:'',
44-
isGetUserInfo:false,
45-
isGetOpenid:false
41+
globalData: {
42+
userInfo: null,
43+
openid: '',
44+
isGetUserInfo: false,
45+
isGetOpenid: false
4646

4747
}
4848
})

app.wxss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
.common-list .list-item.has-img image.cover-100 {
100100
border-radius:3px;
101101
width:100%;
102-
height:175px;
102+
height:30vh;
103103
}
104104

105105
.common-list .list-item.has-img .content-title {
@@ -110,7 +110,7 @@
110110

111111
.common-list .list-item.has-img .content-title-100 {
112112
width:100%;
113-
margin-top:185px;
113+
/*margin-top:185px;*/
114114
margin-bottom:5px;
115115
}
116116

images/next_page.svg

Lines changed: 1 addition & 0 deletions
Loading

images/previous_page.svg

Lines changed: 1 addition & 0 deletions
Loading

images/source-commit-end-local.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

images/source-commit-start-next-local.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

pages/detail/detail.wxml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,34 +63,36 @@
6363
</view>
6464
</view>
6565

66-
<!-- 上一篇 -->
66+
<!--
6767
<view wx:if="{{display}}" class="pagination">
6868
<view wx:if="{{detail.previous_post_id}}" class="nav-previous">
6969
<navigator url="../detail/detail?id={{detail.previous_post_id}}" open-type="redirect" hover-class="relatedNavigator" style="position:fixed;right:26rpx;bottom:340rpx;background:rgba(255,255,255,.95);width:50rpx;height:50rpx;padding:15rpx;box-shadow:0rpx 2rpx 6rpx rgba(0,0,0,.2);border-radius:50%;z-index:999">
7070
<image src="../../images/source-commit-end-local.svg" style="height:50rpx;width:50rpx;"></image>
7171
</navigator>
7272
</view>
7373
</view>
74-
<!-- 下一篇 -->
74+
7575
<view wx:if="{{display}}" class="pagination">
7676
<view wx:if="{{detail.next_post_id}}" class="nav-next">
7777
<navigator url="../detail/detail?id={{detail.next_post_id}}" open-type="redirect" hover-class="relatedNavigator" style="position:fixed;right:26rpx;bottom:230rpx;background:rgba(255,255,255,.95);width:50rpx;height:50rpx;padding:15rpx;box-shadow:0rpx 2rpx 6rpx rgba(0,0,0,.2);border-radius:50%;z-index:999">
7878
<image src="../../images/source-commit-start-next-local.svg" style="height:50rpx;width:50rpx;"></image>
7979
</navigator>
8080
</view>
8181
</view>
82-
<!--<view class="relatedPost" style="display:{{display}}">
83-
<view class="relatedTitle">
84-
相关文章
85-
</view>
86-
<view class="entry-gap-like"></view>
87-
<view class="relatedText">
88-
<block wx:key="id" wx:for="{{postList}}">
89-
<navigator url="../detail/detail?id={{item.id}}" open-type="redirect" hover-class="relatedNavigator"><image src="../../images/circle-empty.png" style='width:16rpx;height:16rpx;margin:0 14rpx 1rpx 0;'></image>{{item.title.rendered}}</navigator>
82+
<view class="relatedPost" style="display:{{display}}">
83+
<view class="relatedTitle">
84+
相关文章
85+
</view>
86+
<view class="entry-gap-like"></view>
87+
<view class="relatedText">
88+
<block wx:key="id" wx:for="{{postList}}">
89+
<navigator url="../detail/detail?id={{item.id}}" open-type="redirect" hover-class="relatedNavigator">
90+
<image src="../../images/circle-empty.png" style='width:16rpx;height:16rpx;margin:0 14rpx 1rpx 0;'></image>{{item.title.rendered}}</navigator>
9091

91-
</block>
92-
</view>
93-
</view>-->
92+
</block>
93+
</view>
94+
</view>
95+
-->
9496

9597
<view class="likePost" style="display:{{displayLikenone}}">
9698
<view catchtap="clickLike" id="likebottom" class="likebtt">
@@ -212,7 +214,6 @@
212214
<button class="share-button share-button touch-active" open-type="share">
213215
</button>
214216
</view>
215-
216217
</view>
217218
<view style="width:40%;text-align:center;line-height:50rpx;">
218219
<view>

pages/index/index.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"enablePullDownRefresh": true,
33
"usingComponents": {
4-
"vpush-view": "/utils/vpush/view",
5-
"vpush-nav": "/utils/vpush/navigation"
4+
"vpush-view": "/utils/vpush-pro-sdk/components/view"
65
}
76
}

pages/usercenter/usercenter.wxml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,20 @@
1515
<import src="../../templates/login-popup.wxml" />
1616

1717
<view class="readlog-container">
18-
<view class="userinfo">
19-
<image class="userinfo-avatar" src="{{userInfo.avatarUrl}}" background-size="cover"></image>
20-
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
21-
</view>
18+
<block wx:if="{{userInfo == null || userInfo == ''}}">
19+
<button class="login-btn login-button" open-type="getUserInfo" bindgetuserinfo="agreeGetUser">
20+
<view class="userinfo">
21+
<image class="userinfo-avatar" src="../../images/gravatar.png" background-size="cover"></image>
22+
<text class="userinfo-nickname">请点击登陆</text>
23+
</view>
24+
</button>
25+
</block>
26+
<block wx:else>
27+
<view class="userinfo">
28+
<image class="userinfo-avatar" src="{{userInfo.avatarUrl}}" background-size="cover"></image>
29+
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
30+
</view>
31+
</block>
2232

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

pages/usercenter/usercenter.wxss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,10 @@
138138
/* font-weight: bold; */
139139
color: #495056;
140140
}
141+
142+
.login-button {
143+
background: #2f89fc;
144+
width: 100%;
145+
border-radius: 0;
146+
border: #2f89fc;
147+
}

0 commit comments

Comments
 (0)