southnote-mini-sdk 1.0.7 → 1.0.9

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.
@@ -14,7 +14,7 @@ Component({
14
14
 
15
15
  data: {
16
16
  level: 0, // 我们保留 0 级概念
17
- levelImg: '/assets/images/icons/lv1.png',
17
+ levelImg: '../../assets/images/icons/lv1.png',
18
18
  currentExpInLevel: 0, // 在当前等级内的经验(不是累计)
19
19
  nextLevelNeedExp: 0, // 到下一等级所需的本级经验(即本等级消耗)
20
20
  progressPercent: 0,
@@ -391,7 +391,7 @@ Component({
391
391
  this.triggerEvent('pauseAllVideo')
392
392
  if (!checkLogin()) return;
393
393
 
394
- this.triggerEvent('shareTap', {
394
+ this.triggerEvent('myShareTap', {
395
395
  item: this.data.item
396
396
  })
397
397
 
@@ -400,10 +400,11 @@ Component({
400
400
  commonTap() {
401
401
  this.triggerEvent('pauseAllVideo')
402
402
  if (!checkLogin()) return;
403
-
404
- this.triggerEvent('commentTap', {
405
- item: this.data.item
406
- })
403
+
404
+ const postId = this.data.item.post.id;
405
+ wx.navigateTo({
406
+ url: `../../pages/post/post?id=${postId}&isCommentIn=true`
407
+ });
407
408
  },
408
409
  // 点赞点击
409
410
  likeTap(e) {
@@ -4,7 +4,7 @@
4
4
 
5
5
  <!-- 顶部用户信息 -->
6
6
  <view class="post-header">
7
- <image class="avatar" src="{{item.user.avatar ? item.user.avatar +'?x-oss-process=image/resize,w_256' : '../../assets/images/icons/header_placeholder.png'}}" mode="aspectFill" catchtap="goUserDetail" data-id="{{item.user.id}}" />
7
+ <image class="avatar" src="{{item.user.avatar ? item.user.avatar : '../../assets/images/icons/header_placeholder.png'}}" mode="aspectFill" catchtap="goUserDetail" data-id="{{item.user.id}}" />
8
8
  <view class="user-info">
9
9
  <view style="display: flex;align-items: center;">
10
10
  <span class="nickname" catchtap="goUserDetail" data-id="{{item.user.id}}">{{item.user.nickname}}</span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "southnote-mini-sdk",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "小南书SDK",
5
5
  "main": "index.js",
6
6
  "miniprogram": ".",
@@ -1,4 +1,7 @@
1
1
  {
2
- "usingComponents": {},
2
+ "usingComponents": {
3
+ "van-checkbox": "@vant/weapp/checkbox/index",
4
+ "van-icon":"@vant/weapp/icon/index"
5
+ },
3
6
  "navigationBarTitleText": "登录"
4
7
  }
@@ -39,6 +39,9 @@ Page({
39
39
  gameWikiJson: [],
40
40
  wikiUsers: [],
41
41
  wiki_created_at: '',
42
+ showSheet: false,
43
+ sheetMode: 'forward',
44
+ originPost: {},
42
45
 
43
46
  postTabs: [{
44
47
  title: "最新",
@@ -1242,9 +1245,57 @@ Page({
1242
1245
  })
1243
1246
  }
1244
1247
  })
1245
- }
1248
+ },
1249
+ onShareTap(e) {
1250
+ this.setData({
1251
+ sheetMode: 'forward',
1252
+ showSheet: true,
1253
+ originPost: e.detail.item,
1254
+ commentData: null
1255
+ }, () => {
1256
+ const sheet = this.selectComponent('#bottomSheet');
1257
+ if (sheet) {
1258
+ if (wx.getStorageSync('height') != 0) {
1259
+ sheet.updateSheetPosition(wx.getStorageSync('height'));
1260
+
1261
+ }
1262
+ }
1263
+ });
1264
+ },
1265
+ onCommentTap(e) {
1266
+ debugger
1267
+ // this.setData({
1268
+ // sheetMode: 'comment',
1269
+ // showSheet: true,
1270
+ // originPost: e.detail.item
1271
+ // })
1272
+
1273
+ const postId = e.detail.item.post.id;
1274
+ this.onPauseAllVideo()
1275
+ wx.navigateTo({
1276
+ url: `/pages/post/post?id=${postId}&isCommentIn=true`
1277
+ });
1278
+ },
1246
1279
 
1247
1280
 
1281
+ onCloseSheet() {
1282
+ this.setData({
1283
+ showSheet: false
1284
+ });
1285
+ },
1286
+
1287
+ onSubmitSheet() {
1288
+ this.setData({
1289
+ showSheet: false
1290
+ });
1291
+ },
1292
+
1293
+ chooseTopic(e) {
1294
+ this.onPauseAllVideo()
1295
+ wx.navigateTo({
1296
+ url: '../addSubject/addSubject',
1297
+ });
1298
+ },
1248
1299
 
1249
1300
 
1250
1301
 
@@ -2,7 +2,10 @@
2
2
  "usingComponents": {
3
3
  "post-item": "../../components/post-item/post-item",
4
4
  "experience-item": "../../components/experience-item/experience-item",
5
- "wiki-renderer": "../../components/wiki-renderer/wiki-renderer"
5
+ "wiki-renderer": "../../components/wiki-renderer/wiki-renderer",
6
+ "van-tab": "@vant/weapp/tab/index",
7
+ "van-tabs": "@vant/weapp/tabs/index",
8
+ "bottomSheet": "../../components/bottomSheet/bottomSheet"
6
9
  },
7
10
  "enablePullDownRefresh": true
8
11
  }
@@ -182,7 +182,7 @@
182
182
  <van-tab title="{{item.title}}">
183
183
  <view class="post-list">
184
184
  <block wx:for="{{posts[item.filter]}}" wx:for-item="post" wx:key="item">
185
- <post-item item="{{post}}" bind:moreTap="onMoreTap" data-index="{{index}}" bind:followChanged="onFollowChanged" bind:videoPlay="onVideoPlay" id="postItem-{{item.filter}}-{{index}}" bind:pauseAllVideo="onPauseAllVideo" />
185
+ <post-item item="{{post}}" bind:moreTap="onMoreTap" data-index="{{index}}" bind:myShareTap="onShareTap" bind:commentTap="onCommentTap" bind:followChanged="onFollowChanged" bind:videoPlay="onVideoPlay" id="postItem-{{item.filter}}-{{index}}" bind:pauseAllVideo="onPauseAllVideo" />
186
186
  </block>
187
187
 
188
188
  <!-- 无数据 -->
@@ -368,4 +368,7 @@
368
368
  <view class="sheet-divider"></view>
369
369
  <view class="sheet-cancel" bindtap="onCloseMoreSheet">取消</view>
370
370
  </view>
371
- </view>
371
+ </view>
372
+
373
+
374
+ <bottomSheet id="bottomSheet" insertSubject="{{selectedTopic}}" visible="{{showSheet}}" mode="{{sheetMode}}" originData="{{originPost}}" bind:close="onCloseSheet" bind:submit="onSubmitSheet" bind:chooseTopic="chooseTopic" />
@@ -127,7 +127,7 @@ Page({
127
127
  } else {
128
128
  // 未登录,跳转登录页面
129
129
  wx.navigateTo({
130
- url: '/pages/commonLogin/commonLogin',
130
+ url: '../../pages/commonLogin/commonLogin',
131
131
  // url:'/pages/login/login'
132
132
  });
133
133
  }
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "navigationBarTitleText": "正文",
3
3
  "usingComponents": {
4
- "bottomSheet": "../../components/bottomSheet/bottomSheet"
4
+ "bottomSheet": "../../components/bottomSheet/bottomSheet",
5
+ "van-tab": "@vant/weapp/tab/index",
6
+ "van-tabs": "@vant/weapp/tabs/index"
5
7
  }
6
8
  }
package/utils/auth.js CHANGED
@@ -9,7 +9,7 @@ export function checkLogin() {
9
9
  if (!token) {
10
10
  // 未登录,跳转登录页
11
11
  wx.navigateTo({
12
- url: '/pages/commonLogin/commonLogin',
12
+ url: '../../pages/commonLogin/commonLogin',
13
13
  });
14
14
  return false;
15
15
  }
package/utils/exp.js CHANGED
@@ -45,5 +45,5 @@ export function getLevelImg(level) {
45
45
  if (level >= 15) return "/assets/images/icons/lv4.png";
46
46
  if (level >= 10) return "/assets/images/icons/lv3.png";
47
47
  if (level >= 5) return "/assets/images/icons/lv2.png";
48
- return "/assets/images/icons/lv1.png";
48
+ return "../../assets/images/icons/lv1.png";
49
49
  }