diff --git a/src/app.wpy b/src/app.wpy
index b557383..df82844 100644
--- a/src/app.wpy
+++ b/src/app.wpy
@@ -12,6 +12,9 @@
width: 749rpx;
overflow-x: hidden;
}
+ .hidden{
+ display: none!important;
+ }
diff --git a/src/common/jc-event.js b/src/common/jc-event.js
index cf8a95c..98d7fe6 100644
--- a/src/common/jc-event.js
+++ b/src/common/jc-event.js
@@ -29,6 +29,7 @@ export default {
LOGIN_FINISHED : 'login-finished',
UPDATE_RECENT_GAMES: 'update-recent-games',
UPDATE_GAME_STATUS: 'update-game-status',
- NEED_UPDATE_SCORE: 'need-update-score'
+ NEED_UPDATE_SCORE: 'need-update-score',
+ NEED_UPDATE_CFG: 'need-update-cfg'
}
}
diff --git a/src/components/game-cell.wpy b/src/components/game-cell.wpy
index 4b413f1..1106498 100644
--- a/src/components/game-cell.wpy
+++ b/src/components/game-cell.wpy
@@ -11,7 +11,7 @@
{{item.name}}
{{item.introduce}}
-
+
去玩
@@ -28,7 +28,11 @@
props = {
item: {
type: Object,
- defalut: null
+ default: null
+ },
+ showAll: {
+ type: Boolean,
+ default: false
}
}
data = {
diff --git a/src/jcfw/SDKManage.js b/src/jcfw/SDKManage.js
index 3ddaec5..7137150 100755
--- a/src/jcfw/SDKManage.js
+++ b/src/jcfw/SDKManage.js
@@ -71,6 +71,8 @@ var SDKManage = function() {
var cb = function(res) {
console.log('getGameConfig');
+ console.log(res);
+ wx.setStorageSync('cfg', res);
setTimeout(() => {
self.doLogin();
}, 10);
diff --git a/src/pages/gameInfo.wpy b/src/pages/gameInfo.wpy
index f4c80a0..2883281 100644
--- a/src/pages/gameInfo.wpy
+++ b/src/pages/gameInfo.wpy
@@ -51,7 +51,7 @@
-
@@ -77,6 +77,7 @@
typeStr: '其他',
tagList: [],
score: 0,
+ showAll: false,
bottomActionCfg: {
hide: false,
mainBtnIconClass: 'icon-cart',
@@ -115,6 +116,7 @@
onLoad(params) {
this.id = decodeURIComponent(params.id);
+ this.showAll = this.$parent.showAll();
console.log(this.id);
let self = this;
jcEvent.on(jcEvent.events.BUY_GAME_SUCCESS, this, data => {
@@ -128,9 +130,16 @@
jcEvent.on(jcEvent.events.NEED_UPDATE_SCORE, this, data => {
this.getUserInfo();
});
+ jcEvent.on(jcEvent.events.NEED_UPDATE_CFG, this, data => {
+ let cfg = wepy.getStorageSync('cfg');
+ this.showAll = !cfg ? false : !cfg.hide_main;
+ this.$apply();
+ })
this.getRecord();
}
onShow() {
+ let cfg = wepy.getStorageSync('cfg');
+ this.showAll = !cfg ? false : !cfg.hide_main;
this.getUserInfo();
}
async showBuyMenu() {
@@ -240,6 +249,7 @@
onUnload() {
jcEvent.remove(jcEvent.events.BUY_GAME_SUCCESS, this);
jcEvent.remove(jcEvent.events.NEED_UPDATE_SCORE, this);
+ jcEvent.remove(jcEvent.events.NEED_UPDATE_CFG, this);
}
async requestAd(text) {
try {
diff --git a/src/pages/index.wpy b/src/pages/index.wpy
index 502e430..90a4737 100644
--- a/src/pages/index.wpy
+++ b/src/pages/index.wpy
@@ -18,7 +18,7 @@
搜索
-
+
@@ -60,7 +60,8 @@
loading: false,
noData: true,
noMore: false,
- gameSet: new Set()
+ gameSet: new Set(),
+ showAll: false
};
methods = {
@@ -130,6 +131,11 @@
jcEvent.on(jcEvent.events.NEED_UPDATE_SCORE, this, data => {
this.getUserInfo();
})
+ jcEvent.on(jcEvent.events.NEED_UPDATE_CFG, this, data => {
+ let cfg = wepy.getStorageSync('cfg');
+ this.showAll = !cfg ? false : !cfg.hide_main;
+ this.$apply();
+ })
}
getAllData() {
this.getRecords();
@@ -141,8 +147,11 @@
jcEvent.remove(jcEvent.events.UPDATE_RECENT_GAMES, this);
jcEvent.remove(jcEvent.events.UPDATE_GAME_STATUS, this);
jcEvent.remove(jcEvent.events.NEED_UPDATE_SCORE, this);
+ jcEvent.remove(jcEvent.events.NEED_UPDATE_CFG, this);
}
onShow() {
+ let cfg = wepy.getStorageSync('cfg');
+ this.showAll = !cfg ? false : !cfg.hide_main;
let userInfo = this.$parent.getUserInfo();
console.log(userInfo);
if (userInfo) {