调整首页顶部布局

This commit is contained in:
zhl 2019-03-26 15:44:24 +08:00
parent e3d6564aee
commit e9a3cc700c
4 changed files with 87 additions and 24 deletions

View File

@ -1,7 +1,7 @@
{ {
"description": "A WePY project", "description": "A WePY project",
"setting": { "setting": {
"urlCheck": true, "urlCheck": false,
"es6": false, "es6": false,
"postcss": false, "postcss": false,
"minified": false, "minified": false,

View File

@ -1,4 +1,4 @@
const env = 'product'; //product, test const env = 'test'; //product, test
export default { export default {
env: env, env: env,
// apiBase: env === 'test'? 'http://192.168.100.226' : 'https://ghost.kingsome.cn', // apiBase: env === 'test'? 'http://192.168.100.226' : 'https://ghost.kingsome.cn',

View File

@ -12,9 +12,8 @@
<view class="userinfo-user"> <view class="userinfo-user">
<image class="userinfo-avatar" src="{{avatar}}"></image> <image class="userinfo-avatar" src="{{avatar}}"></image>
<view class="userinfo-nickname">{{ nickname }}</view> <view class="userinfo-nickname">{{ nickname }}</view>
</view>
<view class="vip-view {{showAll? '' : 'hidden'}}"> <view class="vip-view {{showAll? '' : 'hidden'}}">
<image src="{{vipImg}}"></image>
<text class="vip-expire-txt">{{expire_str}}</text>
<navigator class="vip-btn zan-btn zan-btn--small zan-btn--primary zan-btn--plain button-hover {{showBuy ? '' : 'hidden'}}" <navigator class="vip-btn zan-btn zan-btn--small zan-btn--primary zan-btn--plain button-hover {{showBuy ? '' : 'hidden'}}"
target="miniProgram" target="miniProgram"
open-type="navigate" open-type="navigate"
@ -25,13 +24,19 @@
version="{{payVer}}" version="{{payVer}}"
> >
{{vip_btn_title}}</navigator> {{vip_btn_title}}</navigator>
<image src="{{vipImg}}"></image>
<text class="vip-expire-txt">{{expire_str}}</text>
</view> </view>
</view> </view>
<view class="zan-btn zan-btn--small zan-btn--primary button-hover {{showAll? '' : 'hidden'}}" @tap="showInviteView">免费获取游戏</view> <view class="user-info-ext {{(showAll && !vip)? '' : 'hidden'}}">
<view class="userinfo-score {{showAll? '' : 'hidden'}}">金币: {{score}}</view> <view class="info-part">
<view class="info-part-top">拥有游戏: <text class="info">{{my_game_list.length}}</text></view>
<view class="zan-btn zan-btn--small zan-btn--plain zan-btn--warn button-hover" @tap="showInviteView">免费获取游戏</view>
</view>
<view class="info-part">
<view class="info-part-top">金币: <text class="info">{{score}}</text></view>
<view class="zan-btn zan-btn--small zan-btn--plain zan-btn--warn button-hover" @tap="toGetMoney">免费获取金币</view>
</view> </view>
<view class="">
</view> </view>
</view> </view>
<myGame class="{{(showAll && showMyGame)? '' : 'hidden'}}" :idx.sync="recentCurrent" :titleList.sync="myGameTitles" <myGame class="{{(showAll && showMyGame)? '' : 'hidden'}}" :idx.sync="recentCurrent" :titleList.sync="myGameTitles"
@ -108,7 +113,7 @@
vip: false, vip: false,
expire_str: '', expire_str: '',
vipImg: image.vip_s, vipImg: image.vip_s,
vip_btn_title: '激活', vip_btn_title: '激活VIP, 畅玩所有游戏',
vip_params: '', vip_params: '',
showBuy: false, showBuy: false,
payVer: 'develop', payVer: 'develop',
@ -165,6 +170,10 @@
wepy.navigateTo({ wepy.navigateTo({
url: '/pages/game?link=' + encodeURIComponent(url) + '&gid=0&category=ad' url: '/pages/game?link=' + encodeURIComponent(url) + '&gid=0&category=ad'
}); });
},
toGetMoney() {
this.$parent.log('main_get_coin_btn', {});
this.requestAd('');
} }
}; };
onPullDownRefresh() { onPullDownRefresh() {
@ -404,7 +413,7 @@
} }
} else { } else {
this.vip_btn_title = '激活'; this.vip_btn_title = '激活VIP, 畅玩所有游戏';
this.vipImg = image.vip_s; this.vipImg = image.vip_s;
} }
this.showBuy = !!this.vip_btn_title && this.$showBuy(); this.showBuy = !!this.vip_btn_title && this.$showBuy();
@ -488,6 +497,20 @@
} }
this.$apply(); this.$apply();
} }
async requestAd(text) {
try {
let res = await http.post('/api/emulated/request_ad', {});
if (res.errcode === 0) {
wepy.navigateTo({
url: `/pages/jumppage?text=${text}&aid=${res.aid}`
});
} else {
console.log('request ad with errmsg: ' + res.errmsg);
}
} catch (err) {
console.log(err);
}
}
onShareAppMessage() { onShareAppMessage() {
let account = wepy.getStorageSync('account'); let account = wepy.getStorageSync('account');
let shareObj = this.$getShareCfg(); let shareObj = this.$getShareCfg();

View File

@ -18,9 +18,9 @@ page {
} }
.userinfo-nickname { .userinfo-nickname {
color: #aaa; color: #777777;
font-size: 60 rpx; font-size: 60 rpx;
margin-left: 8px; margin-left: 18px;
} }
.zan-btns { .zan-btns {
@ -103,4 +103,44 @@ page {
.record-list { .record-list {
background-color: white; background-color: white;
} }
.top-view .user-info-ext {
display: flex;
position: relative;
font-size:12px;
color:#aaa;
}
.top-view .user-info-ext::before{
position: absolute;
left: 10px;
right: 10px;
top: 0;
border-top: 1rpx solid #e5e5e5;
background: #e5e5e5;
content: ' ';
}
.top-view .user-info-ext .info-part{
width: 50%;
display: flex;
justify-content: center;
align-items: center;
padding: 12px;
position: relative;
flex-direction:column;
}
.top-view .user-info-ext .info-part::after {
position: absolute;
right: 0;
top: 10px;
bottom: 10px;
border-right: 1rpx solid #e5e5e5;
background: #e5e5e5;
content: ' ';
}
.top-view .user-info-ext .info-part .info-part-top {
margin-bottom: 5px;
}
.info {
color: #777777;
}