southnote-mini-sdk 1.0.1 → 1.0.3

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.
@@ -261,7 +261,7 @@ Component({
261
261
  chooseTopic() {
262
262
  // this.triggerEvent('chooseTopic', {});
263
263
  wx.navigateTo({
264
- url: '/pages/addSubject/addSubject',
264
+ url: '../../pages/addSubject/addSubject',
265
265
  });
266
266
  },
267
267
 
@@ -293,7 +293,7 @@ Component({
293
293
  this.triggerEvent('pauseAllVideo')
294
294
 
295
295
  wx.navigateTo({
296
- url: `/pages/webview/webview?url=${encodeURIComponent(url)}`
296
+ url: `../../pages/webview/webview?url=${encodeURIComponent(url)}`
297
297
  });
298
298
  },
299
299
  /** 点击 #话题# 跳转 */
@@ -303,14 +303,14 @@ Component({
303
303
  this.triggerEvent('pauseAllVideo')
304
304
 
305
305
  wx.navigateTo({
306
- url: `/pages/topic/topic?topic_name=${encodeURIComponent(topicName)}`
306
+ url: `../../pages/topic/topic?topic_name=${encodeURIComponent(topicName)}`
307
307
  });
308
308
  },
309
309
  gotoWiki(e) {
310
310
  const gameId = e.currentTarget.dataset.id
311
311
  const name = e.currentTarget.dataset.name
312
312
  wx.navigateTo({
313
- url: `/pages/wiki/wiki?game_id=${gameId}&name=${encodeURIComponent(name)}`
313
+ url: `../../pages/wiki/wiki?game_id=${gameId}&name=${encodeURIComponent(name)}`
314
314
  })
315
315
  },
316
316
  /** 点击 @某人 跳转 */
@@ -320,7 +320,7 @@ Component({
320
320
  this.triggerEvent('pauseAllVideo')
321
321
 
322
322
  wx.navigateTo({
323
- url: `/pages/user/user?id=${userId}`
323
+ url: `../../pages/user/user?id=${userId}`
324
324
  });
325
325
  },
326
326
  gotoGameCenter(e) {
@@ -328,7 +328,7 @@ Component({
328
328
  this.triggerEvent('pauseAllVideo')
329
329
 
330
330
  wx.navigateTo({
331
- url: `/pages/game/game?id=${gameId}`
331
+ url: `../../pages/game/game?id=${gameId}`
332
332
  });
333
333
  },
334
334
  goDetail(e) {
@@ -339,7 +339,7 @@ Component({
339
339
 
340
340
 
341
341
  wx.navigateTo({
342
- url: `/pages/post/post?id=${postId}`
342
+ url: `../../pages/post/post?id=${postId}`
343
343
  });
344
344
  },
345
345
  goUserDetail(e) {
@@ -348,8 +348,8 @@ Component({
348
348
 
349
349
 
350
350
  wx.navigateTo({
351
- url: `/pages/user/user?id=${userId}`
352
- // url: '/pages/customNavPage/customNavPage'
351
+ url: `../../pages/user/user?id=${userId}`
352
+ // url: '../../pages/customNavPage/customNavPage'
353
353
 
354
354
  });
355
355
  },
@@ -362,7 +362,7 @@ Component({
362
362
 
363
363
 
364
364
  wx.navigateTo({
365
- url: `/pages/post/post?id=${postId}`
365
+ url: `../../pages/post/post?id=${postId}`
366
366
  });
367
367
  },
368
368
  // 关注点击
@@ -895,7 +895,7 @@ Component({
895
895
 
896
896
 
897
897
  wx.navigateTo({
898
- url: `/pages/report-category/report-category?postId=${this.data.item.post.id}`,
898
+ url: `../../pages/report-category/report-category?postId=${this.data.item.post.id}`,
899
899
  })
900
900
 
901
901
  this.triggerEvent('reportPost', {
@@ -527,14 +527,14 @@ Component({
527
527
  _jumpAction(name) {
528
528
  if (!name) return
529
529
  wx.navigateTo({
530
- url: `/pages/wiki/wiki?game_id=${this.properties.gameId}&name=${encodeURIComponent(name)}`
530
+ url: `../../pages/wiki/wiki?game_id=${this.properties.gameId}&name=${encodeURIComponent(name)}`
531
531
  })
532
532
  },
533
533
 
534
534
  gotoUserCenter(e) {
535
535
  const id = e.currentTarget.dataset.id
536
536
  wx.navigateTo({
537
- url: `/pages/user/user?id=${id}`
537
+ url: `../../pages/user/user?id=${id}`
538
538
  })
539
539
  },
540
540
  // 评分
package/index.js CHANGED
@@ -46,4 +46,4 @@ class GameSDK {
46
46
  }
47
47
 
48
48
  const sdk = new GameSDK();
49
- export default sdk;
49
+ module.exports = sdk;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "southnote-mini-sdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "小南书SDK",
5
5
  "main": "index.js",
6
6
  "miniprogram": ".",
@@ -33,7 +33,7 @@ Page({
33
33
  url = 'https://www.southnote.cn/private?type=3'
34
34
  }
35
35
  wx.navigateTo({
36
- url: `/pages/officialWebview/officialWebview?url=${encodeURIComponent(url)}`
36
+ url: `../officialWebview/officialWebview?url=${encodeURIComponent(url)}`
37
37
  });
38
38
  },
39
39
  onClose() {
@@ -144,7 +144,7 @@ Page({
144
144
  onForgot() {
145
145
  // 跳转到忘记密码页面(你可以自己实现)
146
146
  wx.navigateTo({
147
- url: '/pages/forgot/forgot'
147
+ url: '../forgot/forgot'
148
148
  });
149
149
  },
150
150
 
@@ -109,13 +109,13 @@ Page({
109
109
  if (token) {
110
110
  // 已登录,跳转到发布页面
111
111
  wx.navigateTo({
112
- url: `/pages/post-editor/post-editor?gameId=${gameId}&gameName=${encodeURIComponent(gameInfo.name || '')}`,
112
+ url: `../post-editor/post-editor?gameId=${gameId}&gameName=${encodeURIComponent(gameInfo.name || '')}`,
113
113
  });
114
114
  } else {
115
115
  // 未登录,跳转登录页面
116
116
  wx.navigateTo({
117
- url: '/pages/commonLogin/commonLogin',
118
- // url:'/pages/login/login'
117
+ url: '../commonLogin/commonLogin',
118
+ // url:'../login/login'
119
119
  });
120
120
  }
121
121
  },
@@ -123,7 +123,7 @@ Page({
123
123
  this.onPauseAllVideo()
124
124
  const userId = e.currentTarget.dataset.id;
125
125
  wx.navigateTo({
126
- url: `/pages/user/user?id=${userId}`
126
+ url: `../user/user?id=${userId}`
127
127
  });
128
128
  },
129
129
  // 游戏详情页分享逻辑
@@ -139,7 +139,7 @@ Page({
139
139
  return {
140
140
  title,
141
141
  // 分享路径携带 gameId 参数
142
- path: `/pages/game/game?id=${gameId}`
142
+ path: `../game/game?id=${gameId}`
143
143
  };
144
144
  },
145
145
 
@@ -525,13 +525,13 @@ Page({
525
525
  // h5活动直接跳官网
526
526
  if (item.activity_type === 2) {
527
527
  wx.navigateTo({
528
- url: `/pages/copyOfficial/copyOfficial?url=${encodeURIComponent('https://www.southnote.cn')}`
528
+ url: `../copyOfficial/copyOfficial?url=${encodeURIComponent('https://www.southnote.cn')}`
529
529
  });
530
530
  }
531
531
  // 签到跳转
532
532
  if (item.activity_type === 1) {
533
533
  wx.navigateTo({
534
- url: `/pages/sevenDaySignDetail/sevenDaySignDetail?activity_id=${item.activity_id}`
534
+ url: `../sevenDaySignDetail/sevenDaySignDetail?activity_id=${item.activity_id}`
535
535
  });
536
536
  }
537
537
  // 大转盘跳转
@@ -539,13 +539,13 @@ Page({
539
539
  if (!checkLogin()) return; // 🔥 登录校验
540
540
 
541
541
  wx.navigateTo({
542
- url: `/pages/wheelActivivty/wheelActivivty?activity_id=${item.activity_id}`
542
+ url: `../wheelActivivty/wheelActivivty?activity_id=${item.activity_id}`
543
543
  });
544
544
  }
545
545
  // 话题活动跳转话题
546
546
  if (item.activity_type === 3) {
547
547
  wx.navigateTo({
548
- url: `/pages/topic/topic?id=${item.activity_topic}`
548
+ url: `../topic/topic?id=${item.activity_topic}`
549
549
  });
550
550
  }
551
551
  },
@@ -753,7 +753,7 @@ Page({
753
753
  onReport() {
754
754
  this.onPauseAllVideo()
755
755
  wx.navigateTo({
756
- url: `/pages/report-category/report-category?postId=${this.data.moreSheetItem.post.id}`,
756
+ url: `../report-category/report-category?postId=${this.data.moreSheetItem.post.id}`,
757
757
  })
758
758
 
759
759
  this.triggerEvent('reportPost', {
@@ -54,7 +54,7 @@ Page({
54
54
 
55
55
  onAddressTap() {
56
56
  wx.navigateTo({
57
- url: `/pages/copyOfficial/copyOfficial?url=${encodeURIComponent('https://www.southnote.cn')}`
57
+ url: `../copyOfficial/copyOfficial?url=${encodeURIComponent('https://www.southnote.cn')}`
58
58
  });
59
59
  }
60
60
  });
@@ -218,11 +218,11 @@ Page({
218
218
 
219
219
  if (type === 'topic') {
220
220
  wx.navigateTo({
221
- url: `/pages/topic/topic?topic_name=${encodeURIComponent(name)}`
221
+ url: `../topic/topic?topic_name=${encodeURIComponent(name)}`
222
222
  });
223
223
  } else if (type === 'game') {
224
224
  wx.navigateTo({
225
- url: `/pages/game/game?id=${id}`
225
+ url: `../game/game?id=${id}`
226
226
  });
227
227
  }
228
228
  },
@@ -244,7 +244,7 @@ Page({
244
244
  };
245
245
 
246
246
  wx.navigateTo({
247
- url: `/pages/lottery-winners/lottery-winners?post=${encodeURIComponent(
247
+ url: `../lottery-winners/lottery-winners?post=${encodeURIComponent(
248
248
  JSON.stringify(post)
249
249
  )}`
250
250
  });
@@ -263,7 +263,7 @@ Page({
263
263
  return {
264
264
  title,
265
265
  // 分享路径携带帖子 id 参数
266
- path: `/pages/post/post?id=${postId}` // 携带用户ID
266
+ path: `../post/post?id=${postId}` // 携带用户ID
267
267
  };
268
268
  },
269
269
  // tab切换
@@ -1059,7 +1059,7 @@ Page({
1059
1059
  if (!url) return;
1060
1060
 
1061
1061
  wx.navigateTo({
1062
- url: `/pages/webview/webview?url=${encodeURIComponent(url)}`
1062
+ url: `../webview/webview?url=${encodeURIComponent(url)}`
1063
1063
  });
1064
1064
  },
1065
1065
 
@@ -1331,7 +1331,7 @@ Page({
1331
1331
 
1332
1332
  const postId = e.currentTarget.dataset.id;
1333
1333
  wx.navigateTo({
1334
- url: `/pages/post/post?id=${postId}`
1334
+ url: `../post/post?id=${postId}`
1335
1335
  });
1336
1336
  },
1337
1337
 
@@ -1339,7 +1339,7 @@ Page({
1339
1339
  const gameId = e.currentTarget.dataset.id
1340
1340
  const name = e.currentTarget.dataset.name
1341
1341
  wx.navigateTo({
1342
- url: `/pages/wiki/wiki?game_id=${gameId}&name=${encodeURIComponent(name)}`
1342
+ url: `../wiki/wiki?game_id=${gameId}&name=${encodeURIComponent(name)}`
1343
1343
  })
1344
1344
  },
1345
1345
  /** 点击 跳转 */
@@ -1354,19 +1354,19 @@ Page({
1354
1354
  const topicText = text;
1355
1355
  const topicName = topicText.replace(/#/g, ''); // 去掉首尾 #
1356
1356
  wx.navigateTo({
1357
- url: `/pages/topic/topic?topic_name=${encodeURIComponent(topicName)}`
1357
+ url: `../topic/topic?topic_name=${encodeURIComponent(topicName)}`
1358
1358
  });
1359
1359
  break;
1360
1360
 
1361
1361
  case 'at':
1362
1362
  wx.navigateTo({
1363
- url: `/pages/user/user?id=${id}`
1363
+ url: `../user/user?id=${id}`
1364
1364
  });
1365
1365
  break;
1366
1366
 
1367
1367
  case 'game':
1368
1368
  wx.navigateTo({
1369
- url: `/pages/game/game?id=${id}`
1369
+ url: `../game/game?id=${id}`
1370
1370
  });
1371
1371
  break;
1372
1372
 
@@ -1652,7 +1652,7 @@ Page({
1652
1652
  // 举报帖子
1653
1653
  onReport() {
1654
1654
  wx.navigateTo({
1655
- url: `/pages/report-category/report-category?postId=${this.data.item.post.id}`,
1655
+ url: `../report-category/report-category?postId=${this.data.item.post.id}`,
1656
1656
  })
1657
1657
 
1658
1658
  this.triggerEvent('reportPost', {
@@ -1751,7 +1751,7 @@ Page({
1751
1751
 
1752
1752
  checkDialog() {
1753
1753
  wx.navigateTo({
1754
- url: `/pages/postDialog/postDialog?id=${this.data.item.post.id}`,
1754
+ url: `../postDialog/postDialog?id=${this.data.item.post.id}`,
1755
1755
  })
1756
1756
  },
1757
1757
 
@@ -265,7 +265,7 @@ Page({
265
265
 
266
266
  chooseGame() {
267
267
  wx.navigateTo({
268
- url: '/pages/addGame/addGame',
268
+ url: '../addGame/addGame',
269
269
  })
270
270
  },
271
271
 
@@ -294,7 +294,7 @@ Page({
294
294
  wx.hideKeyboard();
295
295
  } catch (e) {}
296
296
  wx.navigateTo({
297
- url: '/pages/addSubject/addSubject',
297
+ url: '../addSubject/addSubject',
298
298
  });
299
299
  },
300
300
 
@@ -346,11 +346,11 @@ Page({
346
346
 
347
347
  if (type === 'topic') {
348
348
  wx.navigateTo({
349
- url: `/pages/topic/topic?topic_name=${encodeURIComponent(name)}`
349
+ url: `../topic/topic?topic_name=${encodeURIComponent(name)}`
350
350
  });
351
351
  } else if (type === 'game') {
352
352
  wx.navigateTo({
353
- url: `/pages/game/game?id=${id}`
353
+ url: `../game/game?id=${id}`
354
354
  });
355
355
  }
356
356
  },
@@ -372,7 +372,7 @@ Page({
372
372
  };
373
373
 
374
374
  wx.navigateTo({
375
- url: `/pages/lottery-winners/lottery-winners?post=${encodeURIComponent(
375
+ url: `../lottery-winners/lottery-winners?post=${encodeURIComponent(
376
376
  JSON.stringify(post)
377
377
  )}`
378
378
  });
@@ -528,19 +528,19 @@ Page({
528
528
  const topicText = text;
529
529
  const topicName = topicText.replace(/#/g, ''); // 去掉首尾 #
530
530
  wx.navigateTo({
531
- url: `/pages/topic/topic?topic_name=${encodeURIComponent(topicName)}`
531
+ url: `../topic/topic?topic_name=${encodeURIComponent(topicName)}`
532
532
  });
533
533
  break;
534
534
 
535
535
  case 'at':
536
536
  wx.navigateTo({
537
- url: `/pages/user/user?id=${id}`
537
+ url: `../user/user?id=${id}`
538
538
  });
539
539
  break;
540
540
 
541
541
  case 'game':
542
542
  wx.navigateTo({
543
- url: `/pages/game/game?id=${id}`
543
+ url: `../game/game?id=${id}`
544
544
  });
545
545
  break;
546
546
 
@@ -553,7 +553,7 @@ Page({
553
553
  if (!url) return;
554
554
 
555
555
  wx.navigateTo({
556
- url: `/pages/webview/webview?url=${encodeURIComponent(url)}`
556
+ url: `../webview/webview?url=${encodeURIComponent(url)}`
557
557
  });
558
558
  },
559
559
 
@@ -23,7 +23,7 @@ Page({
23
23
  const category = this.data.categories[idx] || '';
24
24
  // 跳转到举报填写页,并传递分类名称(作为 query)
25
25
  wx.navigateTo({
26
- url: `/pages/report-form/report-form?category=${encodeURIComponent(category)}&postId=${this.postId}&nType=${idx+1}`
26
+ url: `../report-form/report-form?category=${encodeURIComponent(category)}&postId=${this.postId}&nType=${idx+1}`
27
27
  });
28
28
  }
29
29
  });
@@ -177,10 +177,10 @@ Page({
177
177
  // })
178
178
 
179
179
  // wx.navigateTo({
180
- // url: `/pages/officialWebview/officialWebview?url=${encodeURIComponent('https://www.southnote.cn/#/home')}`
180
+ // url: `../officialWebview/officialWebview?url=${encodeURIComponent('https://www.southnote.cn/#/home')}`
181
181
  // });
182
182
  wx.navigateTo({
183
- url: `/pages/copyOfficial/copyOfficial?url=${encodeURIComponent('https://www.southnote.cn')}`
183
+ url: `../copyOfficial/copyOfficial?url=${encodeURIComponent('https://www.southnote.cn')}`
184
184
  });
185
185
  };
186
186
 
@@ -46,7 +46,7 @@ Page({
46
46
  return {
47
47
  title,
48
48
  // 分享路径携带 gameId 参数
49
- path: `/pages/topic/topic?id=${title}`
49
+ path: `../topic/topic?id=${title}`
50
50
  };
51
51
  },
52
52
 
@@ -183,13 +183,13 @@ Page({
183
183
  gotoGameDetail(e) {
184
184
  const gameId = e.currentTarget.dataset.game.id
185
185
  wx.navigateTo({
186
- url: `/pages/game/game?id=${gameId}`
186
+ url: `../game/game?id=${gameId}`
187
187
  });
188
188
  },
189
189
 
190
190
  onPublish() {
191
191
  wx.navigateTo({
192
- url: '/pages/post-editor/post-editor',
192
+ url: '../post-editor/post-editor',
193
193
  })
194
194
  },
195
195
 
@@ -79,7 +79,7 @@ Page({
79
79
 
80
80
  return {
81
81
  title: userDetail?.nickname || '查看用户主页',
82
- path: `/pages/user/user?id=${userId}` // 携带用户ID
82
+ path: `../user/user?id=${userId}` // 携带用户ID
83
83
  };
84
84
  },
85
85
 
@@ -374,7 +374,7 @@ Page({
374
374
  const user = this.data.userDetail.user
375
375
  this.onPauseAllVideo()
376
376
  wx.navigateTo({
377
- url: '/pages/userDatum/userDatum?user=' + encodeURIComponent(JSON.stringify(user))
377
+ url: '../userDatum/userDatum?user=' + encodeURIComponent(JSON.stringify(user))
378
378
  })
379
379
  },
380
380
 
@@ -382,7 +382,7 @@ Page({
382
382
  const user = this.data.userDetail.user
383
383
  this.onPauseAllVideo()
384
384
  wx.navigateTo({
385
- url: '/pages/userGameLib/userGameLib?user_id=' + user.id
385
+ url: '../userGameLib/userGameLib?user_id=' + user.id
386
386
  })
387
387
  },
388
388
 
@@ -391,7 +391,7 @@ Page({
391
391
  const id = e.currentTarget.dataset.id;
392
392
  this.onPauseAllVideo()
393
393
  wx.navigateTo({
394
- url: `/pages/game/game?id=${id}`
394
+ url: `../game/game?id=${id}`
395
395
  });
396
396
  },
397
397
 
@@ -646,7 +646,7 @@ Page({
646
646
  onReport() {
647
647
  this.onPauseAllVideo()
648
648
  wx.navigateTo({
649
- url: `/pages/report-category/report-category?postId=${this.data.moreSheetItem.post.id}`,
649
+ url: `../report-category/report-category?postId=${this.data.moreSheetItem.post.id}`,
650
650
  })
651
651
 
652
652
  this.triggerEvent('reportPost', {
@@ -90,7 +90,7 @@ Page({
90
90
  goDetail(e) {
91
91
  const id = e.currentTarget.dataset.id;
92
92
  wx.navigateTo({
93
- url: `/pages/game/game?id=${id}`
93
+ url: `../game/game?id=${id}`
94
94
  });
95
95
  },
96
96
 
@@ -99,7 +99,7 @@ Page({
99
99
  e.stopPropagation();
100
100
  const id = e.currentTarget.dataset.id;
101
101
  wx.navigateTo({
102
- url: `/pages/game/game?id=${id}`
102
+ url: `../game/game?id=${id}`
103
103
  });
104
104
  }
105
105
  });
@@ -486,7 +486,7 @@ computeDerivedData() {
486
486
  // 或使用其他方式引导用户下载APP
487
487
 
488
488
  wx.navigateTo({
489
- url: `/pages/copyOfficial/copyOfficial?url=${encodeURIComponent('https://www.southnote.cn')}`
489
+ url: `../copyOfficial/copyOfficial?url=${encodeURIComponent('https://www.southnote.cn')}`
490
490
  });
491
491
  }
492
492
  })
@@ -24,7 +24,7 @@ Page({
24
24
  onShareAppMessage() {
25
25
  return {
26
26
  title: this.data.name, // 分享卡片标题
27
- path: `/pages/wiki/wiki?game_id=${this.data.gameId}&name=${encodeURIComponent(this.data.name)}`
27
+ path: `../wiki/wiki?game_id=${this.data.gameId}&name=${encodeURIComponent(this.data.name)}`
28
28
  }
29
29
  },
30
30