southnote-mini-sdk 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app.js +1 -22
- package/assets/file/badwords.js +1 -63008
- package/assets/file/rules.js +1 -38
- package/components/bottomSheet/bottomSheet.js +1 -473
- package/components/experience-item/experience-item.js +1 -105
- package/components/grid-item/grid-item.js +1 -8
- package/components/post-item/post-item.js +1 -1086
- package/components/wiki-renderer/wiki-renderer.js +1 -636
- package/components/wiki-tabs/wiki-tabs.js +1 -52
- package/index.js +1 -49
- package/package.json +2 -22
- package/pages/addGame/addGame.js +1 -454
- package/pages/addSubject/addSubject.js +1 -199
- package/pages/commonLogin/commonLogin.js +1 -269
- package/pages/copyOfficial/copyOfficial.js +1 -25
- package/pages/demo/demo.js +1 -23
- package/pages/game/game.js +1 -1305
- package/pages/home/home.js +1 -665
- package/pages/lottery-winners/lottery-winners.js +1 -60
- package/pages/message/messageCommentsAndAt/messageCommentsAndAt.js +1 -178
- package/pages/message/messageEntire/messageEntire.js +1 -112
- package/pages/message/messageLikeAndCollect/messageLikeAndCollect.js +1 -147
- package/pages/message/messageNewFans/messageNewFans.js +1 -139
- package/pages/officialWebview/officialWebview.js +1 -13
- package/pages/post/post.js +1 -1856
- package/pages/post-editor/post-editor.js +1 -465
- package/pages/postDialog/postDialog.js +1 -560
- package/pages/report-category/report-category.js +1 -29
- package/pages/report-form/report-form.js +1 -65
- package/pages/sevenDaySignDetail/sevenDaySignDetail.js +1 -273
- package/pages/topic/topic.js +1 -266
- package/pages/user/user.js +1 -939
- package/pages/userDatum/userDatum.js +1 -24
- package/pages/userGameLib/userGameLib.js +1 -105
- package/pages/webview/webview.js +1 -25
- package/pages/wheelActivivty/wheelActivivty.js +1 -492
- package/pages/wiki/wiki.js +1 -138
- package/request/JKRequest.js +1 -177
- package/services/home.js +1 -603
- package/utils/auth.js +1 -17
- package/utils/base64.js +1 -67
- package/utils/compressImage.js +1 -41
- package/utils/exp.js +1 -49
- package/utils/formatPost.js +1 -18
- package/utils/parseContent.js +1 -191
- package/utils/query-select.js +1 -9
- package/utils/sensitive.js +1 -82
|
@@ -1,52 +1 @@
|
|
|
1
|
-
Component({
|
|
2
|
-
options: {
|
|
3
|
-
styleIsolation: 'apply-shared',
|
|
4
|
-
multipleSlots: true
|
|
5
|
-
},
|
|
6
|
-
|
|
7
|
-
properties: {
|
|
8
|
-
tabs: {
|
|
9
|
-
// 格式: [{ name: 'Tab A' }, { name: 'Tab B' }]
|
|
10
|
-
type: Array,
|
|
11
|
-
value: []
|
|
12
|
-
},
|
|
13
|
-
// 激活颜色,对应 van-tabs 的 color 参数
|
|
14
|
-
color: {
|
|
15
|
-
type: String,
|
|
16
|
-
value: '#1989fa'
|
|
17
|
-
},
|
|
18
|
-
// 受控模式:外部传入当前激活 tab 名
|
|
19
|
-
active: {
|
|
20
|
-
type: String,
|
|
21
|
-
value: ''
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
data: {
|
|
26
|
-
activeTab: ''
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
observers: {
|
|
30
|
-
'tabs, active': function (tabs, active) {
|
|
31
|
-
if (!tabs || !tabs.length) return
|
|
32
|
-
|
|
33
|
-
// 如果外部传了 active 且合法,就用外部的;否则默认第一个
|
|
34
|
-
const names = tabs.map(t => t.name)
|
|
35
|
-
if (active && names.includes(active)) {
|
|
36
|
-
this.setData({ activeTab: active })
|
|
37
|
-
} else if (!this.data.activeTab || !names.includes(this.data.activeTab)) {
|
|
38
|
-
this.setData({ activeTab: tabs[0].name })
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
methods: {
|
|
44
|
-
onTabTap(e) {
|
|
45
|
-
const name = e.currentTarget.dataset.name
|
|
46
|
-
if (name === this.data.activeTab) return
|
|
47
|
-
this.setData({ activeTab: name })
|
|
48
|
-
// 触发 change 事件,与 van-tabs 保持一致,detail.name 是新 tab 名
|
|
49
|
-
this.triggerEvent('change', { name })
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
})
|
|
1
|
+
const _0x308aac=_0x51e0;function _0x51e0(_0x3d741e,_0x3472e0){_0x3d741e=_0x3d741e-0x1be;const _0x115562=_0x1155();let _0x51e043=_0x115562[_0x3d741e];if(_0x51e0['NeLBmd']===undefined){var _0xde448f=function(_0x3ccf46){const _0x5280cd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x316fde='',_0x3e1c41='';for(let _0x2d5cb8=0x0,_0x232534,_0x3b97b6,_0x32e868=0x0;_0x3b97b6=_0x3ccf46['charAt'](_0x32e868++);~_0x3b97b6&&(_0x232534=_0x2d5cb8%0x4?_0x232534*0x40+_0x3b97b6:_0x3b97b6,_0x2d5cb8++%0x4)?_0x316fde+=String['fromCharCode'](0xff&_0x232534>>(-0x2*_0x2d5cb8&0x6)):0x0){_0x3b97b6=_0x5280cd['indexOf'](_0x3b97b6);}for(let _0x482242=0x0,_0x546bec=_0x316fde['length'];_0x482242<_0x546bec;_0x482242++){_0x3e1c41+='%'+('00'+_0x316fde['charCodeAt'](_0x482242)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3e1c41);};_0x51e0['OGHrJo']=_0xde448f,_0x51e0['PFFqVz']={},_0x51e0['NeLBmd']=!![];}const _0x240766=_0x115562[0x0],_0x579bee=_0x3d741e+_0x240766,_0x5bc0a8=_0x51e0['PFFqVz'][_0x579bee];return!_0x5bc0a8?(_0x51e043=_0x51e0['OGHrJo'](_0x51e043),_0x51e0['PFFqVz'][_0x579bee]=_0x51e043):_0x51e043=_0x5bc0a8,_0x51e043;}(function(_0x5a96b1,_0x42d40c){const _0x5f3e56=_0x51e0,_0x3b15b7=_0x5a96b1();while(!![]){try{const _0xa5476b=parseInt(_0x5f3e56(0x1cc))/0x1+-parseInt(_0x5f3e56(0x1c5))/0x2+parseInt(_0x5f3e56(0x1c2))/0x3+parseInt(_0x5f3e56(0x1c8))/0x4+parseInt(_0x5f3e56(0x1c6))/0x5+parseInt(_0x5f3e56(0x1d1))/0x6*(parseInt(_0x5f3e56(0x1cb))/0x7)+-parseInt(_0x5f3e56(0x1d0))/0x8*(parseInt(_0x5f3e56(0x1ce))/0x9);if(_0xa5476b===_0x42d40c)break;else _0x3b15b7['push'](_0x3b15b7['shift']());}catch(_0x3bf78c){_0x3b15b7['push'](_0x3b15b7['shift']());}}}(_0x1155,0x99beb),Component({'options':{'styleIsolation':_0x308aac(0x1cd),'multipleSlots':!![]},'properties':{'tabs':{'type':Array,'value':[]},'color':{'type':String,'value':_0x308aac(0x1c1)},'active':{'type':String,'value':''}},'data':{'activeTab':''},'observers':{'tabs,\x20active':function(_0x56efad,_0x5b40cd){const _0x526109=_0x308aac;if(!_0x56efad||!_0x56efad['length'])return;const _0xa2f92=_0x56efad[_0x526109(0x1c3)](_0x493137=>_0x493137[_0x526109(0x1ca)]);if(_0x5b40cd&&_0xa2f92[_0x526109(0x1c9)](_0x5b40cd))this[_0x526109(0x1be)]({'activeTab':_0x5b40cd});else(!this['data'][_0x526109(0x1c7)]||!_0xa2f92[_0x526109(0x1c9)](this[_0x526109(0x1cf)]['activeTab']))&&this[_0x526109(0x1be)]({'activeTab':_0x56efad[0x0][_0x526109(0x1ca)]});}},'methods':{'onTabTap'(_0xf8d115){const _0x1b8bac=_0x308aac,_0x2fe097={'xyuTI':function(_0x1b0b94,_0x18566b){return _0x1b0b94===_0x18566b;},'Dxdhw':_0x1b8bac(0x1bf)},_0x33f26d=_0xf8d115[_0x1b8bac(0x1c4)]['dataset'][_0x1b8bac(0x1ca)];if(_0x2fe097[_0x1b8bac(0x1c0)](_0x33f26d,this[_0x1b8bac(0x1cf)]['activeTab']))return;this[_0x1b8bac(0x1be)]({'activeTab':_0x33f26d}),this['triggerEvent'](_0x2fe097['Dxdhw'],{'name':_0x33f26d});}}}));function _0x1155(){const _0x412380=['ofrHB1LNua','mJi4ndmYC3znwvLm','C2v0rgf0yq','y2HHBMDL','EhL1veK','iZe5odLMyq','mtK0nZaZowryCwf5yW','BwfW','y3vYCMvUDfrHCMDLDa','mtKXntKWme91AMvYqG','nJiXndyWmfb4q2PKuq','ywn0AxzLvgfI','ndq2mtuXnKXoAuDbDq','Aw5JBhvKzxm','BMfTzq','mtyXvKrhwvj5','ntK1ntu2r3rHA09q','yxbWBhKTC2HHCMvK','mJyWmtC1mtvyAej4ugS','zgf0yq'];_0x1155=function(){return _0x412380;};return _0x1155();}
|
package/index.js
CHANGED
|
@@ -1,49 +1 @@
|
|
|
1
|
-
class GameSDK {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.gameId = 100000;
|
|
4
|
-
this.isInitialized = false;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
init(options = {}) {
|
|
8
|
-
const { gameId } = options;
|
|
9
|
-
|
|
10
|
-
if (!gameId) {
|
|
11
|
-
throw new Error('gameId is required');
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
this.gameId = gameId;
|
|
15
|
-
this.isInitialized = true;
|
|
16
|
-
|
|
17
|
-
return this;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
navigateToGame(params = {}) {
|
|
21
|
-
this._checkInit();
|
|
22
|
-
wx.navigateTo({
|
|
23
|
-
url: `/miniprogram_npm/southnote-mini-sdk/pages/game/game?gameId=${this.gameId}&${this._buildQuery(params)}`
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
navigateToWiki(params = {}) {
|
|
28
|
-
this._checkInit();
|
|
29
|
-
wx.navigateTo({
|
|
30
|
-
url: `/miniprogram_npm/southnote-mini-sdk/pages/wiki/wiki?gameId=${this.gameId}&${this._buildQuery(params)}`
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
_checkInit() {
|
|
35
|
-
if (!this.isInitialized) {
|
|
36
|
-
throw new Error('SDK not initialized, please call init() first');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
_buildQuery(params) {
|
|
41
|
-
if (!Object.keys(params).length) return '';
|
|
42
|
-
return Object.keys(params)
|
|
43
|
-
.map(key => `${key}=${encodeURIComponent(params[key])}`)
|
|
44
|
-
.join('&');
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const sdk = new GameSDK();
|
|
49
|
-
module.exports = sdk;
|
|
1
|
+
const _0x1dcd64=_0x20d5;(function(_0x346154,_0x14baa1){const _0x368c57=_0x20d5,_0x26cb41=_0x346154();while(!![]){try{const _0x459f84=parseInt(_0x368c57(0xce))/0x1+-parseInt(_0x368c57(0xd1))/0x2+parseInt(_0x368c57(0xd9))/0x3*(-parseInt(_0x368c57(0xd0))/0x4)+-parseInt(_0x368c57(0xd3))/0x5*(parseInt(_0x368c57(0xcc))/0x6)+-parseInt(_0x368c57(0xcf))/0x7+-parseInt(_0x368c57(0xcb))/0x8+parseInt(_0x368c57(0xc3))/0x9;if(_0x459f84===_0x14baa1)break;else _0x26cb41['push'](_0x26cb41['shift']());}catch(_0x46b307){_0x26cb41['push'](_0x26cb41['shift']());}}}(_0xe26d,0xea20e));class GameSDK{constructor(){const _0xf0c0c8=_0x20d5;this['gameId']=0x186a0,this[_0xf0c0c8(0xc9)]=![];}['init'](_0x3999a9={}){const _0x5d9f7c=_0x20d5,_0xf4218f={'UvSRT':_0x5d9f7c(0xcd)},{gameId:_0x170614}=_0x3999a9;if(!_0x170614)throw new Error(_0xf4218f[_0x5d9f7c(0xd5)]);return this[_0x5d9f7c(0xdc)]=_0x170614,this['isInitialized']=!![],this;}[_0x1dcd64(0xda)](_0x1a7c25={}){const _0x34af79=_0x1dcd64;this[_0x34af79(0xc7)](),wx[_0x34af79(0xca)]({'url':_0x34af79(0xd7)+this['gameId']+'&'+this[_0x34af79(0xd2)](_0x1a7c25)});}[_0x1dcd64(0xd8)](_0x86ba1e={}){const _0x4dccc7=_0x1dcd64;this['_checkInit'](),wx[_0x4dccc7(0xca)]({'url':_0x4dccc7(0xd4)+this[_0x4dccc7(0xdc)]+'&'+this[_0x4dccc7(0xd2)](_0x86ba1e)});}[_0x1dcd64(0xc7)](){const _0x340754=_0x1dcd64;if(!this[_0x340754(0xc9)])throw new Error(_0x340754(0xc4));}[_0x1dcd64(0xd2)](_0x32daae){const _0x3b9deb=_0x1dcd64;if(!Object[_0x3b9deb(0xd6)](_0x32daae)[_0x3b9deb(0xc8)])return'';return Object[_0x3b9deb(0xd6)](_0x32daae)[_0x3b9deb(0xc5)](_0x2f7dad=>_0x2f7dad+'='+encodeURIComponent(_0x32daae[_0x2f7dad]))[_0x3b9deb(0xc6)]('&');}}const sdk=new GameSDK();function _0x20d5(_0x4ff759,_0x5119d2){_0x4ff759=_0x4ff759-0xc3;const _0xe26da2=_0xe26d();let _0x20d544=_0xe26da2[_0x4ff759];if(_0x20d5['skrHYT']===undefined){var _0x54a121=function(_0x26a8bc){const _0xb88cc6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x48c2ed='',_0x40ca39='';for(let _0x4fa637=0x0,_0x38a8ec,_0x28de5c,_0x5af7b1=0x0;_0x28de5c=_0x26a8bc['charAt'](_0x5af7b1++);~_0x28de5c&&(_0x38a8ec=_0x4fa637%0x4?_0x38a8ec*0x40+_0x28de5c:_0x28de5c,_0x4fa637++%0x4)?_0x48c2ed+=String['fromCharCode'](0xff&_0x38a8ec>>(-0x2*_0x4fa637&0x6)):0x0){_0x28de5c=_0xb88cc6['indexOf'](_0x28de5c);}for(let _0x2c17dc=0x0,_0x416541=_0x48c2ed['length'];_0x2c17dc<_0x416541;_0x2c17dc++){_0x40ca39+='%'+('00'+_0x48c2ed['charCodeAt'](_0x2c17dc)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x40ca39);};_0x20d5['oSrMYM']=_0x54a121,_0x20d5['JNaWTd']={},_0x20d5['skrHYT']=!![];}const _0x194b18=_0xe26da2[0x0],_0x245c59=_0x4ff759+_0x194b18,_0x18fed0=_0x20d5['JNaWTd'][_0x245c59];return!_0x18fed0?(_0x20d544=_0x20d5['oSrMYM'](_0x20d544),_0x20d5['JNaWTd'][_0x245c59]=_0x20d544):_0x20d544=_0x18fed0,_0x20d544;}function _0xe26d(){const _0x251bdc=['mJG2ntnxzgzXAKO','BMf2AwDHDgvuB0DHBwu','zxHWB3j0CW','z2fTzuLK','mJiYnJqWmdj2tvftD20','u0rlig5VDcbPBML0AwfSAxPLzcWGCgXLyxnLignHBgWGAw5PDcGPigzPCNn0','BwfW','AM9PBG','x2nOzwnRsw5PDa','BgvUz3rO','AxnjBML0AwfSAxPLza','BMf2AwDHDgvuBW','mJa4odmWneDmvu9mAW','ndK1nJzWt3zstw4','z2fTzuLKigLZihjLCxvPCMvK','mtaXmdKXn1HLDejoCG','nZeXnda4nNrQwNPgBW','nJHgwgfir3i','mtC3ntq3nLvbvfzkAW','x2j1AwXKuxvLCNK','mtiWs05nsLfn','l21PBMLWCM9NCMfTx25WBs9ZB3v0Ag5VDguTBwLUAs1ZzgSVCgfNzxmVD2LRAs93AwTPp2DHBwvjzd0','vxztuLq','A2v5CW','l21PBMLWCM9NCMfTx25WBs9ZB3v0Ag5VDguTBwLUAs1ZzgSVCgfNzxmVz2fTzs9Nyw1Lp2DHBwvjzd0','BMf2AwDHDgvuB1DPA2K'];_0xe26d=function(){return _0x251bdc;};return _0xe26d();}module[_0x1dcd64(0xdb)]=sdk;
|
package/package.json
CHANGED
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "southnote-mini-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"description": "小南书SDK",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"miniprogram": ".",
|
|
7
|
-
"files": [
|
|
8
|
-
"assets",
|
|
9
|
-
"components",
|
|
10
|
-
"pages",
|
|
11
|
-
"request",
|
|
12
|
-
"services",
|
|
13
|
-
"towxml",
|
|
14
|
-
"utils",
|
|
15
|
-
"app.js",
|
|
16
|
-
"app.json",
|
|
17
|
-
"app.wxss",
|
|
18
|
-
"index.js"
|
|
19
|
-
],
|
|
20
7
|
"keywords": [
|
|
21
8
|
"wechat",
|
|
22
9
|
"miniprogram",
|
|
@@ -25,18 +12,11 @@
|
|
|
25
12
|
],
|
|
26
13
|
"author": "你的名字",
|
|
27
14
|
"license": "MIT",
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build": "node build.js",
|
|
30
|
-
"publish:sdk": "npm run build && cd dist && npm publish"
|
|
31
|
-
},
|
|
32
15
|
"dependencies": {
|
|
33
16
|
"pako": "^2.1.0",
|
|
34
17
|
"underscore": "^1.13.6"
|
|
35
18
|
},
|
|
36
19
|
"peerDependencies": {
|
|
37
20
|
"@vant/weapp": ">=1.0.0"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"javascript-obfuscator": "^5.4.2"
|
|
41
21
|
}
|
|
42
|
-
}
|
|
22
|
+
}
|
package/pages/addGame/addGame.js
CHANGED
|
@@ -1,454 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
queryUserGames,
|
|
3
|
-
queryGames,
|
|
4
|
-
search
|
|
5
|
-
} from "../../services/home";
|
|
6
|
-
|
|
7
|
-
Page({
|
|
8
|
-
data: {
|
|
9
|
-
// tabs / categories
|
|
10
|
-
categories: [{
|
|
11
|
-
key: 'recent',
|
|
12
|
-
title: '最近添加'
|
|
13
|
-
}, // 特殊 tab,用 index 管理
|
|
14
|
-
{
|
|
15
|
-
key: 'my',
|
|
16
|
-
title: '我的游戏库'
|
|
17
|
-
}, // 特殊 tab,用 index 管理
|
|
18
|
-
{
|
|
19
|
-
key: 1,
|
|
20
|
-
title: '总榜'
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
key: 2,
|
|
24
|
-
title: '期待'
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
key: 3,
|
|
28
|
-
title: '新品'
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
key: 4,
|
|
32
|
-
title: '策略'
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
key: 5,
|
|
36
|
-
title: '动作'
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
key: 6,
|
|
40
|
-
title: '角色扮演'
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
key: 7,
|
|
44
|
-
title: '竞速'
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
key: 8,
|
|
48
|
-
title: '聚会'
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
key: 9,
|
|
52
|
-
title: '卡牌'
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
key: 10,
|
|
56
|
-
title: '冒险'
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
key: 11,
|
|
60
|
-
title: '模拟'
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
key: 12,
|
|
64
|
-
title: '体育'
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
key: 13,
|
|
68
|
-
title: '文字'
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
key: 14,
|
|
72
|
-
title: '问答'
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
key: 15,
|
|
76
|
-
title: '休闲'
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
key: 16,
|
|
80
|
-
title: '益智解密'
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
key: 17,
|
|
84
|
-
title: '音乐'
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
key: 18,
|
|
88
|
-
title: '娱乐场'
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
key: 19,
|
|
92
|
-
title: '桌游'
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
key: 20,
|
|
96
|
-
title: '射击'
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
key: 21,
|
|
100
|
-
title: '二次元'
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
key: 22,
|
|
104
|
-
title: 'Roguelike'
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
key: 23,
|
|
108
|
-
title: '女性向'
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
key: 24,
|
|
112
|
-
title: '沙盒'
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
key: 25,
|
|
116
|
-
title: '开放世界'
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
key: 26,
|
|
120
|
-
title: 'MMORPG'
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
key: 27,
|
|
124
|
-
title: '武侠'
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
key: 28,
|
|
128
|
-
title: 'MOBA'
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
key: 29,
|
|
132
|
-
title: '放置'
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
key: 30,
|
|
136
|
-
title: '塔防'
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
key: 31,
|
|
140
|
-
title: '影游'
|
|
141
|
-
}
|
|
142
|
-
],
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
activeKey: 0,
|
|
146
|
-
games: [],
|
|
147
|
-
loading: false,
|
|
148
|
-
refreshing: false,
|
|
149
|
-
page: 1,
|
|
150
|
-
hasMore: true,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
// 我的库分页单独管理
|
|
154
|
-
myPage: 1,
|
|
155
|
-
myHasMore: true,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
// 搜索
|
|
159
|
-
searchValue: '',
|
|
160
|
-
showSearchResult: false,
|
|
161
|
-
searchResults: [],
|
|
162
|
-
searchPage: 1, // 当前搜索页码
|
|
163
|
-
searchHasMore: true, // 搜索是否还有更多
|
|
164
|
-
searchLoading: false,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
onLoad() {
|
|
170
|
-
const recentGames = wx.getStorageSync('recentGames') || [];
|
|
171
|
-
// 最近添加属于 categories[0], 如果当前 activeKey 是 0,展示缓存
|
|
172
|
-
if (this.data.activeKey === 0) {
|
|
173
|
-
this.setData({
|
|
174
|
-
games: recentGames
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
this.setData({
|
|
178
|
-
recentGames
|
|
179
|
-
});
|
|
180
|
-
},
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
saveRecentGame(game) {
|
|
184
|
-
let recentGames = wx.getStorageSync('recentGames') || [];
|
|
185
|
-
recentGames = recentGames.filter(item => item.id !== game.id);
|
|
186
|
-
recentGames.unshift(game);
|
|
187
|
-
if (recentGames.length > 10) recentGames = recentGames.slice(0, 10);
|
|
188
|
-
wx.setStorageSync('recentGames', recentGames);
|
|
189
|
-
this.setData({
|
|
190
|
-
recentGames
|
|
191
|
-
});
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
// 放在 Page({ ... }) 内,与其它方法同级
|
|
195
|
-
loadRecentGames() {
|
|
196
|
-
// 最近缓存直接从 storage 里读
|
|
197
|
-
const recentGames = wx.getStorageSync('recentGames') || [];
|
|
198
|
-
this.setData({
|
|
199
|
-
games: recentGames,
|
|
200
|
-
refreshing: false,
|
|
201
|
-
loading: false,
|
|
202
|
-
hasMore: false // 最近列表是缓存,不走分页
|
|
203
|
-
});
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
async loadCategoryGames(reset = false) {
|
|
207
|
-
// 分类页(从 categories 中取 key)用 queryGames(filter, page)
|
|
208
|
-
// 防抖 / 防重入
|
|
209
|
-
if (this.data.loading) return;
|
|
210
|
-
this.setData({
|
|
211
|
-
loading: true
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
// 计算 page(reset 则回到 1)
|
|
215
|
-
let page = reset ? 1 : this.data.page || 1;
|
|
216
|
-
|
|
217
|
-
// 取当前分类 key(注意:activeKey 可能是数字索引)
|
|
218
|
-
const idx = this.data.activeKey;
|
|
219
|
-
const category = this.data.categories && this.data.categories[idx];
|
|
220
|
-
const filter = category ? category.key : ''; // 例如 'total' 'strategy' 等
|
|
221
|
-
|
|
222
|
-
try {
|
|
223
|
-
// 假设 queryGames(filter, page) 返回 { code: 0, data: [...] }
|
|
224
|
-
const res = await queryGames(filter, page);
|
|
225
|
-
if (res && res.code === 0) {
|
|
226
|
-
const list = Array.isArray(res.data) ? res.data : [];
|
|
227
|
-
|
|
228
|
-
// reset 时替换列表;否则追加
|
|
229
|
-
const newGames = reset ? list : [...(this.data.games || []), ...list];
|
|
230
|
-
|
|
231
|
-
// 下一页逻辑:如果本次返回有数据就认为还有更多(简单判断)
|
|
232
|
-
const hasMore = list.length > 0;
|
|
233
|
-
|
|
234
|
-
// 如果有数据并且不是 reset,则 page++
|
|
235
|
-
const nextPage = (reset ? 1 : page) + (list.length > 0 ? 1 : 0);
|
|
236
|
-
|
|
237
|
-
this.setData({
|
|
238
|
-
games: newGames,
|
|
239
|
-
page: nextPage,
|
|
240
|
-
hasMore,
|
|
241
|
-
});
|
|
242
|
-
} else {
|
|
243
|
-
// 请求失败或 code !== 0:保守处理为没有更多
|
|
244
|
-
this.setData({
|
|
245
|
-
hasMore: false
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
} catch (err) {
|
|
249
|
-
console.error('加载分类游戏失败:', err);
|
|
250
|
-
this.setData({
|
|
251
|
-
hasMore: false
|
|
252
|
-
});
|
|
253
|
-
} finally {
|
|
254
|
-
this.setData({
|
|
255
|
-
loading: false,
|
|
256
|
-
refreshing: false
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
|
|
261
|
-
onSearchReachBottom() {
|
|
262
|
-
if (!this.data.showSearchResult) return;
|
|
263
|
-
this.loadSearchResults(); // 调用搜索接口分页
|
|
264
|
-
},
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
onSearchInput(e) {
|
|
268
|
-
const value = e.detail.value.trim();
|
|
269
|
-
|
|
270
|
-
this.setData({
|
|
271
|
-
searchValue: value,
|
|
272
|
-
showSearchResult: !!value,
|
|
273
|
-
searchPage: 1,
|
|
274
|
-
searchResults: [],
|
|
275
|
-
searchHasMore: true,
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
if (value) {
|
|
279
|
-
this.loadSearchResults(true);
|
|
280
|
-
} else {
|
|
281
|
-
this.setData({
|
|
282
|
-
searchResults: [],
|
|
283
|
-
searchHasMore: true,
|
|
284
|
-
searchLoading: false,
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
|
|
289
|
-
async loadSearchResults(reset = false) {
|
|
290
|
-
if (this.data.searchLoading || !this.data.searchHasMore) return;
|
|
291
|
-
|
|
292
|
-
this.setData({
|
|
293
|
-
searchLoading: true
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
const page = reset ? 1 : this.data.searchPage;
|
|
297
|
-
const input = this.data.searchValue;
|
|
298
|
-
|
|
299
|
-
try {
|
|
300
|
-
const res = await search(input, 3, page); // nType 固定 3
|
|
301
|
-
if (res && res.code === 0) {
|
|
302
|
-
const list = Array.isArray(res.data.games) ? res.data.games : [];
|
|
303
|
-
|
|
304
|
-
const newResults = reset ? list : [...(this.data.searchResults || []), ...list];
|
|
305
|
-
|
|
306
|
-
const hasMore = list.length > 0;
|
|
307
|
-
|
|
308
|
-
this.setData({
|
|
309
|
-
searchResults: newResults,
|
|
310
|
-
searchPage: page + (list.length > 0 ? 1 : 0),
|
|
311
|
-
searchHasMore: hasMore,
|
|
312
|
-
});
|
|
313
|
-
} else {
|
|
314
|
-
this.setData({
|
|
315
|
-
searchHasMore: false,
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
} catch (err) {
|
|
319
|
-
console.error('搜索失败', err);
|
|
320
|
-
this.setData({
|
|
321
|
-
searchHasMore: false,
|
|
322
|
-
});
|
|
323
|
-
} finally {
|
|
324
|
-
this.setData({
|
|
325
|
-
searchLoading: false
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
},
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
onChangeTab(e) {
|
|
332
|
-
const key = e.detail;
|
|
333
|
-
this.setData({
|
|
334
|
-
activeKey: key,
|
|
335
|
-
page: 1,
|
|
336
|
-
hasMore: true,
|
|
337
|
-
loading: false
|
|
338
|
-
});
|
|
339
|
-
// 切 tab 时清空右侧列表,避免闪烁数据
|
|
340
|
-
this.setData({
|
|
341
|
-
games: []
|
|
342
|
-
});
|
|
343
|
-
this.loadActiveTab(true);
|
|
344
|
-
},
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
loadActiveTab(reset = false) {
|
|
348
|
-
const idx = this.data.activeKey;
|
|
349
|
-
// idx 0 -> 最近缓存
|
|
350
|
-
if (idx === 0) {
|
|
351
|
-
this.loadRecentGames();
|
|
352
|
-
this.setData({
|
|
353
|
-
refreshing: false
|
|
354
|
-
});
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
// idx 1 -> 我的游戏库 调用 queryUserGames(target_id=当前用户id, page)
|
|
360
|
-
if (idx === 1) {
|
|
361
|
-
this.loadMyGames(reset);
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
// idx >=2 -> 从总榜开始使用 queryGames(filter, page)
|
|
367
|
-
this.loadCategoryGames(reset);
|
|
368
|
-
},
|
|
369
|
-
|
|
370
|
-
async loadMyGames(reset = false) {
|
|
371
|
-
const user_id = wx.getStorageSync('appuid')
|
|
372
|
-
const {
|
|
373
|
-
myPage
|
|
374
|
-
} = this.data
|
|
375
|
-
try {
|
|
376
|
-
const res = await queryUserGames(
|
|
377
|
-
user_id,
|
|
378
|
-
myPage
|
|
379
|
-
);
|
|
380
|
-
if (res && res.code === 0) {
|
|
381
|
-
const list = reset ? res.data : [...this.data.games, ...res.data];
|
|
382
|
-
this.setData({
|
|
383
|
-
games: list,
|
|
384
|
-
myPage,
|
|
385
|
-
hasMore: res.data.length > 0
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
} catch (err) {
|
|
389
|
-
console.error('加载分类游戏失败:', err);
|
|
390
|
-
} finally {
|
|
391
|
-
this.setData({
|
|
392
|
-
loading: false,
|
|
393
|
-
refreshing: false
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
},
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
onRefresh() {
|
|
400
|
-
this.setData({
|
|
401
|
-
refreshing: true
|
|
402
|
-
});
|
|
403
|
-
const idx = this.data.activeKey;
|
|
404
|
-
if (idx === 0) {
|
|
405
|
-
this.loadRecentGames();
|
|
406
|
-
} else if (idx === 1) {
|
|
407
|
-
this.loadMyGames(true);
|
|
408
|
-
} else {
|
|
409
|
-
this.loadCategoryGames(true);
|
|
410
|
-
}
|
|
411
|
-
},
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
onReachBottom() {
|
|
415
|
-
const idx = this.data.activeKey;
|
|
416
|
-
if (idx === 0) return; // 最近缓存不分页
|
|
417
|
-
if (idx === 1) {
|
|
418
|
-
this.loadMyGames();
|
|
419
|
-
} else {
|
|
420
|
-
this.loadCategoryGames();
|
|
421
|
-
}
|
|
422
|
-
},
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
onSelectGame(e) {
|
|
426
|
-
const game = e.currentTarget.dataset.game;
|
|
427
|
-
if (!game) return;
|
|
428
|
-
this.saveRecentGame(game);
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
const pages = getCurrentPages();
|
|
432
|
-
const prevPage = pages[pages.length - 2];
|
|
433
|
-
if (!prevPage) {
|
|
434
|
-
console.warn('未找到上一个页面');
|
|
435
|
-
wx.navigateBack();
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
const bottomSheet = prevPage.selectComponent?.('#bottomSheet');
|
|
441
|
-
if (bottomSheet) {
|
|
442
|
-
setTimeout(() => {
|
|
443
|
-
bottomSheet.setData({
|
|
444
|
-
selectedGame: game
|
|
445
|
-
});
|
|
446
|
-
}, 100);
|
|
447
|
-
} else {
|
|
448
|
-
prevPage.setData({
|
|
449
|
-
selectedGame: game
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
wx.navigateBack();
|
|
453
|
-
}
|
|
454
|
-
});
|
|
1
|
+
const _0x15d3ed=_0x1e8a;function _0x1e8a(_0x4e116c,_0x2999d2){_0x4e116c=_0x4e116c-0x1d7;const _0x54ad29=_0x54ad();let _0x1e8a31=_0x54ad29[_0x4e116c];if(_0x1e8a['szqPGP']===undefined){var _0x10a7fd=function(_0x256cbf){const _0x2ebe55='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x140919='',_0x56e4bc='';for(let _0x71a067=0x0,_0x38018c,_0x6123e3,_0x1a80e0=0x0;_0x6123e3=_0x256cbf['charAt'](_0x1a80e0++);~_0x6123e3&&(_0x38018c=_0x71a067%0x4?_0x38018c*0x40+_0x6123e3:_0x6123e3,_0x71a067++%0x4)?_0x140919+=String['fromCharCode'](0xff&_0x38018c>>(-0x2*_0x71a067&0x6)):0x0){_0x6123e3=_0x2ebe55['indexOf'](_0x6123e3);}for(let _0x34fcb6=0x0,_0x36a624=_0x140919['length'];_0x34fcb6<_0x36a624;_0x34fcb6++){_0x56e4bc+='%'+('00'+_0x140919['charCodeAt'](_0x34fcb6)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x56e4bc);};_0x1e8a['UKLeLF']=_0x10a7fd,_0x1e8a['eiFkdq']={},_0x1e8a['szqPGP']=!![];}const _0x1bb8d0=_0x54ad29[0x0],_0x14b0de=_0x4e116c+_0x1bb8d0,_0x5b4340=_0x1e8a['eiFkdq'][_0x14b0de];return!_0x5b4340?(_0x1e8a31=_0x1e8a['UKLeLF'](_0x1e8a31),_0x1e8a['eiFkdq'][_0x14b0de]=_0x1e8a31):_0x1e8a31=_0x5b4340,_0x1e8a31;}function _0x54ad(){const _0x3e0792=['zgf0yxnLDa','AxnbCNjHEq','C2vHCMnOtg9HzgLUzW','zgX1rNq','DMfSDwu','t015sLa','nJiXota3CfHjsuLu','mZeWBur2DvHW','DNbrEuO','zMLSDgvY','C2v0rgf0yq','yMfbCg8','mJzRs2zewgy','CMvJzw50','zufsA2O','CgfNzq','Bg9HzgLUzW','z2fTzq','55Uk5PM66kEJ5A+g','ywn0AxzLs2v5','nZCYmtDvDvj1BNe','5AIX5lMq5zY6','CNPsuwK','mtaZnwjfDgzgzG','zxjYB3i','mtbuufLdvgG','C2XPy2u','C2vHCMnOsgfZtw9Yzq','5PcC57sI5AsX6lsL','zgv0ywLS','z2fTzxm','5PYQ5OM+5yIW5lIk5lIa5lIQ6Ag16z2I','5AwZ5OcN5zcr','yxbWDwLK','mtqXoti0z3rArM5n','C2vHCMnOugfNzq','BgvUz3rO','i2jVDhrVBvnOzwv0','mteXmJq2rhnnufz3','tu9cqq','ruXIBMW','zgf0yq','Bg9HzfjLy2vUDeDHBwvZ','sevbDxO','mJqYndHIA2ztzKm','mZCXzvfezeLn','ELnIre4','BMf2AwDHDgvcywnR','C2f2zvjLy2vUDeDHBwu','wuzTwee','A2v5','EhLvwLG','DhjPBq','rw5MDLu','5yQG6l295yIg57g75RI45OIp5AsX6lsLoG','Bg9Hze15r2fTzxm','5BYa5Ps+5lIw55wm','mtjkD3v2BKO','Bg9HzenHDgvNB3j5r2fTzxm','nJq3mte2sNbVEhPT','wvj1wxq','Bg9HzfnLyxjJAfjLC3vSDhm','uM9NDwvSAwTL','5OIr55Qe5RI45OIp5BQt','C2vSzwn0q29TCg9Uzw50','5lQm5QYH5ywd','C2Xsr1y','wLvTDwq','y2f0zwDVCMLLCW','y29Kzq','uurwz0K','z2v0u3rVCMfNzvn5BMm','mtiXnta0zMnIDK92','6kEs6iMY5OMU5RYu','CMvJzw50r2fTzxm'];_0x54ad=function(){return _0x3e0792;};return _0x54ad();}(function(_0x1d0cbb,_0x424229){const _0x1cd9a4=_0x1e8a,_0x44d75b=_0x1d0cbb();while(!![]){try{const _0x1cfd5d=-parseInt(_0x1cd9a4(0x1f3))/0x1+parseInt(_0x1cd9a4(0x1dc))/0x2*(parseInt(_0x1cd9a4(0x218))/0x3)+-parseInt(_0x1cd9a4(0x21a))/0x4*(parseInt(_0x1cd9a4(0x1f8))/0x5)+-parseInt(_0x1cd9a4(0x205))/0x6*(parseInt(_0x1cd9a4(0x20c))/0x7)+parseInt(_0x1cd9a4(0x20b))/0x8*(parseInt(_0x1cd9a4(0x1f6))/0x9)+parseInt(_0x1cd9a4(0x1e6))/0xa*(parseInt(_0x1cd9a4(0x1e5))/0xb)+-parseInt(_0x1cd9a4(0x201))/0xc*(parseInt(_0x1cd9a4(0x1eb))/0xd);if(_0x1cfd5d===_0x424229)break;else _0x44d75b['push'](_0x44d75b['shift']());}catch(_0x4e1b00){_0x44d75b['push'](_0x44d75b['shift']());}}}(_0x54ad,0xe4c9e));import{queryUserGames,queryGames,search}from'../../services/home';Page({'data':{'categories':[{'key':_0x15d3ed(0x1ec),'title':'最近添加'},{'key':'my','title':_0x15d3ed(0x21e)},{'key':0x1,'title':'总榜'},{'key':0x2,'title':'期待'},{'key':0x3,'title':'新品'},{'key':0x4,'title':'策略'},{'key':0x5,'title':'动作'},{'key':0x6,'title':_0x15d3ed(0x1dd)},{'key':0x7,'title':'竞速'},{'key':0x8,'title':'聚会'},{'key':0x9,'title':'卡牌'},{'key':0xa,'title':'冒险'},{'key':0xb,'title':'模拟'},{'key':0xc,'title':'体育'},{'key':0xd,'title':'文字'},{'key':0xe,'title':'问答'},{'key':0xf,'title':'休闲'},{'key':0x10,'title':_0x15d3ed(0x1f1)},{'key':0x11,'title':'音乐'},{'key':0x12,'title':_0x15d3ed(0x1f4)},{'key':0x13,'title':'桌游'},{'key':0x14,'title':'射击'},{'key':0x15,'title':_0x15d3ed(0x220)},{'key':0x16,'title':_0x15d3ed(0x21d)},{'key':0x17,'title':_0x15d3ed(0x1ff)},{'key':0x18,'title':'沙盒'},{'key':0x19,'title':_0x15d3ed(0x217)},{'key':0x1a,'title':'MMORPG'},{'key':0x1b,'title':'武侠'},{'key':0x1c,'title':_0x15d3ed(0x206)},{'key':0x1d,'title':'放置'},{'key':0x1e,'title':'塔防'},{'key':0x1f,'title':'影游'}],'activeKey':0x0,'games':[],'loading':![],'refreshing':![],'page':0x1,'hasMore':!![],'myPage':0x1,'myHasMore':!![],'searchValue':'','showSearchResult':![],'searchResults':[],'searchPage':0x1,'searchHasMore':!![],'searchLoading':![]},'onLoad'(){const _0x243ff7=_0x15d3ed,_0x30fef1={'baApo':_0x243ff7(0x1de),'HEAuz':function(_0x2c6ad3,_0x2b1957){return _0x2c6ad3===_0x2b1957;}},_0x86bf2e=wx[_0x243ff7(0x1db)](_0x30fef1[_0x243ff7(0x1ea)])||[];_0x30fef1[_0x243ff7(0x20a)](this[_0x243ff7(0x208)][_0x243ff7(0x1f2)],0x0)&&this['setData']({'games':_0x86bf2e}),this[_0x243ff7(0x1e9)]({'recentGames':_0x86bf2e});},'saveRecentGame'(_0x451f36){const _0x37da73=_0x15d3ed,_0x1a7ec7={'eARkj':'recentGames','Zjqci':function(_0x1d06b7,_0x13875f){return _0x1d06b7>_0x13875f;}};let _0x1410b9=wx['getStorageSync'](_0x1a7ec7[_0x37da73(0x1ed)])||[];_0x1410b9=_0x1410b9[_0x37da73(0x1e8)](_0xcc1778=>_0xcc1778['id']!==_0x451f36['id']),_0x1410b9['unshift'](_0x451f36);if(_0x1a7ec7['Zjqci'](_0x1410b9[_0x37da73(0x203)],0xa))_0x1410b9=_0x1410b9[_0x37da73(0x1f9)](0x0,0xa);wx['setStorageSync'](_0x1a7ec7[_0x37da73(0x1ed)],_0x1410b9),this[_0x37da73(0x1e9)]({'recentGames':_0x1410b9});},'loadRecentGames'(){const _0x174754=_0x15d3ed,_0x114d46={'ZUmud':_0x174754(0x1de)},_0x51372b=wx[_0x174754(0x1db)](_0x114d46[_0x174754(0x1d7)])||[];this['setData']({'games':_0x51372b,'refreshing':![],'loading':![],'hasMore':![]});},async 'loadCategoryGames'(_0x1455bb=![]){const _0x85c782=_0x15d3ed,_0x375b8d={'KtMpT':function(_0x391a0f,_0x1fab7f){return _0x391a0f===_0x1fab7f;},'OMyJP':function(_0x142792,_0xd20b72){return _0x142792>_0xd20b72;},'GFvVP':function(_0x30b19e,_0x3a2050){return _0x30b19e+_0x3a2050;},'ELbnl':'加载分类游戏失败:'};if(this['data'][_0x85c782(0x1ef)])return;this['setData']({'loading':!![]});let _0x3f886b=_0x1455bb?0x1:this[_0x85c782(0x208)][_0x85c782(0x1ee)]||0x1;const _0x314b0f=this[_0x85c782(0x208)][_0x85c782(0x1f2)],_0x29f3a1=this['data'][_0x85c782(0x1d8)]&&this['data'][_0x85c782(0x1d8)][_0x314b0f],_0x2f3d57=_0x29f3a1?_0x29f3a1[_0x85c782(0x211)]:'';try{const _0x2614ee=await queryGames(_0x2f3d57,_0x3f886b);if(_0x2614ee&&_0x375b8d['KtMpT'](_0x2614ee[_0x85c782(0x1d9)],0x0)){const _0x37b2dc=Array[_0x85c782(0x1e0)](_0x2614ee[_0x85c782(0x208)])?_0x2614ee[_0x85c782(0x208)]:[],_0x22651b=_0x1455bb?_0x37b2dc:[...this[_0x85c782(0x208)][_0x85c782(0x1fd)]||[],..._0x37b2dc],_0x3653f4=_0x375b8d[_0x85c782(0x1e4)](_0x37b2dc[_0x85c782(0x203)],0x0),_0x797c9a=_0x375b8d['GFvVP'](_0x1455bb?0x1:_0x3f886b,_0x375b8d['OMyJP'](_0x37b2dc[_0x85c782(0x203)],0x0)?0x1:0x0);this[_0x85c782(0x1e9)]({'games':_0x22651b,'page':_0x797c9a,'hasMore':_0x3653f4});}else this['setData']({'hasMore':![]});}catch(_0x257edb){console[_0x85c782(0x1f7)](_0x375b8d[_0x85c782(0x207)],_0x257edb),this[_0x85c782(0x1e9)]({'hasMore':![]});}finally{this[_0x85c782(0x1e9)]({'loading':![],'refreshing':![]});}},'onSearchReachBottom'(){const _0x3b8d2f=_0x15d3ed;if(!this[_0x3b8d2f(0x208)]['showSearchResult'])return;this['loadSearchResults']();},'onSearchInput'(_0x2cca83){const _0x460602=_0x15d3ed,_0x345d3f=_0x2cca83['detail'][_0x460602(0x1e3)][_0x460602(0x213)]();this['setData']({'searchValue':_0x345d3f,'showSearchResult':!!_0x345d3f,'searchPage':0x1,'searchResults':[],'searchHasMore':!![]}),_0x345d3f?this[_0x460602(0x21c)](!![]):this[_0x460602(0x1e9)]({'searchResults':[],'searchHasMore':!![],'searchLoading':![]});},async 'loadSearchResults'(_0x5f53ce=![]){const _0x5acec0=_0x15d3ed,_0x281635={'dluFt':function(_0x3054b4,_0x558cc3){return _0x3054b4>_0x558cc3;},'YFmXA':function(_0x56a4ae,_0x49267f){return _0x56a4ae+_0x49267f;}};if(this[_0x5acec0(0x208)][_0x5acec0(0x1e1)]||!this['data'][_0x5acec0(0x1fa)])return;this['setData']({'searchLoading':!![]});const _0x2da924=_0x5f53ce?0x1:this[_0x5acec0(0x208)][_0x5acec0(0x202)],_0x3ae835=this[_0x5acec0(0x208)]['searchValue'];try{const _0x48a225=await search(_0x3ae835,0x3,_0x2da924);if(_0x48a225&&_0x48a225[_0x5acec0(0x1d9)]===0x0){const _0x49bf8f=Array[_0x5acec0(0x1e0)](_0x48a225[_0x5acec0(0x208)]['games'])?_0x48a225[_0x5acec0(0x208)][_0x5acec0(0x1fd)]:[],_0xaa0ada=_0x5f53ce?_0x49bf8f:[...this[_0x5acec0(0x208)]['searchResults']||[],..._0x49bf8f],_0x17a8b6=_0x281635[_0x5acec0(0x1e2)](_0x49bf8f[_0x5acec0(0x203)],0x0);this[_0x5acec0(0x1e9)]({'searchResults':_0xaa0ada,'searchPage':_0x281635[_0x5acec0(0x210)](_0x2da924,_0x281635[_0x5acec0(0x1e2)](_0x49bf8f['length'],0x0)?0x1:0x0),'searchHasMore':_0x17a8b6});}else this[_0x5acec0(0x1e9)]({'searchHasMore':![]});}catch(_0x76d1c2){console['error'](_0x5acec0(0x1fb),_0x76d1c2),this[_0x5acec0(0x1e9)]({'searchHasMore':![]});}finally{this[_0x5acec0(0x1e9)]({'searchLoading':![]});}},'onChangeTab'(_0x30d4e2){const _0x8694bf=_0x15d3ed,_0x34ccab=_0x30d4e2[_0x8694bf(0x1fc)];this[_0x8694bf(0x1e9)]({'activeKey':_0x34ccab,'page':0x1,'hasMore':!![],'loading':![]}),this['setData']({'games':[]}),this['loadActiveTab'](!![]);},'loadActiveTab'(_0x3fb177=![]){const _0x5c469f=_0x15d3ed,_0xbb5326={'rzRQi':function(_0x56012e,_0x44912c){return _0x56012e===_0x44912c;}},_0x14bef7=this[_0x5c469f(0x208)][_0x5c469f(0x1f2)];if(_0xbb5326[_0x5c469f(0x1f5)](_0x14bef7,0x0)){this[_0x5c469f(0x209)](),this[_0x5c469f(0x1e9)]({'refreshing':![]});return;}if(_0x14bef7===0x1){this['loadMyGames'](_0x3fb177);return;}this[_0x5c469f(0x219)](_0x3fb177);},async 'loadMyGames'(_0x4f6689=![]){const _0xa06d48=_0x15d3ed,_0x26b971={'lzPEd':_0xa06d48(0x200),'xyUZX':function(_0x26082f,_0x318116,_0x122ad1){return _0x26082f(_0x318116,_0x122ad1);},'vpQyJ':function(_0x8fa955,_0x3dde51){return _0x8fa955>_0x3dde51;},'YRuYt':_0xa06d48(0x215)},_0x560999=wx[_0xa06d48(0x1db)](_0x26b971['lzPEd']),{myPage:_0x1ba713}=this[_0xa06d48(0x208)];try{const _0x1be91f=await _0x26b971[_0xa06d48(0x212)](queryUserGames,_0x560999,_0x1ba713);if(_0x1be91f&&_0x1be91f['code']===0x0){const _0x4478ea=_0x4f6689?_0x1be91f['data']:[...this[_0xa06d48(0x208)]['games'],..._0x1be91f['data']];this[_0xa06d48(0x1e9)]({'games':_0x4478ea,'myPage':_0x1ba713,'hasMore':_0x26b971[_0xa06d48(0x1e7)](_0x1be91f[_0xa06d48(0x208)][_0xa06d48(0x203)],0x0)});}}catch(_0x59ba02){console[_0xa06d48(0x1f7)](_0x26b971[_0xa06d48(0x21b)],_0x59ba02);}finally{this[_0xa06d48(0x1e9)]({'loading':![],'refreshing':![]});}},'onRefresh'(){const _0x350419=_0x15d3ed,_0xea836b={'zSbDN':function(_0x331057,_0x4bdc07){return _0x331057===_0x4bdc07;}};this['setData']({'refreshing':!![]});const _0x3f6d5c=this[_0x350419(0x208)][_0x350419(0x1f2)];if(_0xea836b['zSbDN'](_0x3f6d5c,0x0))this[_0x350419(0x209)]();else _0xea836b[_0x350419(0x20d)](_0x3f6d5c,0x1)?this[_0x350419(0x216)](!![]):this[_0x350419(0x219)](!![]);},'onReachBottom'(){const _0x59e6cb=_0x15d3ed,_0x2f0bb1={'EnfvU':function(_0x50c2f3,_0x307e28){return _0x50c2f3===_0x307e28;}},_0x1ff261=this[_0x59e6cb(0x208)]['activeKey'];if(_0x1ff261===0x0)return;_0x2f0bb1[_0x59e6cb(0x214)](_0x1ff261,0x1)?this['loadMyGames']():this[_0x59e6cb(0x219)]();},'onSelectGame'(_0x22fa65){const _0x40ba0e=_0x15d3ed,_0x39c514={'UfdOA':function(_0x2a6df4){return _0x2a6df4();},'JjKqX':function(_0x4c460e,_0x1ebea0){return _0x4c460e-_0x1ebea0;},'QDVgI':_0x40ba0e(0x1fe),'ceLJn':_0x40ba0e(0x204),'slRGV':function(_0xa4707e,_0x1fe801,_0x1df08f){return _0xa4707e(_0x1fe801,_0x1df08f);}},_0x7f8b41=_0x22fa65['currentTarget'][_0x40ba0e(0x1df)][_0x40ba0e(0x1f0)];if(!_0x7f8b41)return;this[_0x40ba0e(0x20f)](_0x7f8b41);const _0x3228f1=_0x39c514['UfdOA'](getCurrentPages),_0x3f2fab=_0x3228f1[_0x39c514['JjKqX'](_0x3228f1[_0x40ba0e(0x203)],0x2)];if(!_0x3f2fab){console['warn'](_0x39c514[_0x40ba0e(0x1da)]),wx[_0x40ba0e(0x20e)]();return;}const _0x5558b3=_0x3f2fab[_0x40ba0e(0x21f)]?.(_0x39c514['ceLJn']);_0x5558b3?_0x39c514[_0x40ba0e(0x221)](setTimeout,()=>{const _0x2a2fe5=_0x40ba0e;_0x5558b3[_0x2a2fe5(0x1e9)]({'selectedGame':_0x7f8b41});},0x64):_0x3f2fab[_0x40ba0e(0x1e9)]({'selectedGame':_0x7f8b41}),wx[_0x40ba0e(0x20e)]();}});
|