Explorar o código

Merge branch 'master' of http://git.cc-lotus.info/ball-court/court-badminton-1

zs %!s(int64=2) %!d(string=hai) anos
pai
achega
8b5ed9a2c8
Modificáronse 3 ficheiros con 7 adicións e 5 borrados
  1. 1 1
      pages/news/index.js
  2. 5 3
      pages/topic/index.js
  3. 1 1
      pages/topic/index.wxml

+ 1 - 1
pages/news/index.js

@@ -67,7 +67,7 @@ Page({
         wx.getStorage({
             key: 'user',
             success: async res => {
-                let info = { skip: that.data.skip, limit: that.data.limit, type: type };
+                let info = { skip: that.data.skip, limit: that.data.limit, type: type, is_show: '0' };
                 const arr = await app.$get(`/newCourt/api/news`, { ...info });
                 if (arr.errcode == '0') {
                     that.setData({ list: [...that.data.list, ...arr.data] });

+ 5 - 3
pages/topic/index.js

@@ -15,6 +15,10 @@ Page({
         if (route) wx.redirectTo({ url: `/${route}` })
     },
     toView: function (e) {
+        const that = this;
+        that.setData({ skip: 0 })
+        that.setData({ page: 0 })
+        that.setData({ list: [] })
         let { item } = e.currentTarget.dataset;
         wx.navigateTo({ url: `/pages/topic/info?id=${item._id}` })
     },
@@ -40,12 +44,10 @@ Page({
     // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
-        let searchInfo = that.data.searchInfo;
         wx.getStorage({
             key: 'user',
             success: async (res) => {
-                let info = { skip: that.data.skip, limit: that.data.limit };
-                if (searchInfo && searchInfo.title) info.title = searchInfo.title;
+                let info = { skip: that.data.skip, limit: that.data.limit, is_show: '0' };
                 const arr = await app.$get(`/newCourt/api/topic`, { ...info });
                 if (arr.errcode == '0') { that.setData({ list: [...that.data.list, ...arr.data] }); that.setData({ total: arr.total }); }
                 else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }

+ 1 - 1
pages/topic/index.wxml

@@ -14,7 +14,7 @@
                         <view class="list_2">{{item.brief}}</view>
                         <view class="list_3">
                             <view>已发布{{item.stick.length||0}}个帖子</view>
-                            <view class="btn" bindtap="toJoin" data-item="{{item}}">加入话题>>></view>
+                            <view class="btn" bindtap="toView" data-item="{{item}}">加入话题>>></view>
                         </view>
                     </view>
                 </view>