tanyanfei před 3 roky
rodič
revize
6a2c685cd3
3 změnil soubory, kde provedl 14 přidání a 8 odebrání
  1. 2 1
      pages/homepage/homepage.js
  2. 10 5
      pages/stock/stock.js
  3. 2 2
      pages/stock/stock.wxml

+ 2 - 1
pages/homepage/homepage.js

@@ -89,6 +89,7 @@ Page({
         player_id: res.data.data.today_record.player_id,
         followers:res.data.data.followers,
         fans:res.data.data.fans,
+        id: res.data.data.match.id,
         ec: {
           onInit: initChart
         },
@@ -108,7 +109,7 @@ Page({
     })
     //每日持股
     var parm={
-      id: data.id?data.id:0, player_id: this.data.player_id?data.player_id:o
+      id: this.data.id, player_id: this.data.player_id?data.player_id:o
     }
     $api.getRecordList(parm).then(res=>{
         this.setData({

+ 10 - 5
pages/stock/stock.js

@@ -31,11 +31,7 @@ Page({
     if (options.id){
       this.setData({id:options.id})
       this.getComment()
-      $api.getChoice({ stock_id:options.id}).then(res => {
-        this.setData({
-          myList: res.data.data.list
-        })
-      })
+      this.getMylist()
       $api.getAuthinfo().then(res=>{
         this.setData({
           role: res.data.data.role
@@ -66,6 +62,13 @@ Page({
     }
     
   },
+  getMylist(){
+    $api.getChoice({ stock_id: this.data.id }).then(res => {
+      this.setData({
+        myList: res.data.data.list
+      })
+    })
+  },
   inputchange1(e) {
     this.setData({
       comment: e.detail.value
@@ -107,6 +110,7 @@ Page({
       this.setData({
         info: info
       })
+      this.getMylist()
     })
   },
   delchoice(){
@@ -119,6 +123,7 @@ Page({
       this.setData({
         info: info
       })
+      this.getMylist()
     })
   },
   tab(e){

+ 2 - 2
pages/stock/stock.wxml

@@ -58,12 +58,12 @@
           </navigator>
       </view>
       <view wx:if='{{cur==2}}'>
-      <view class="_list" wx:for="{{myList}}">
+        <navigator hover-class="none"  class="_list" wx:for="{{myList}}" url="../homepage/homepage?id={{item.match_id}}&player_id={{item.player_id}}">
           <image src="{{item.user_avatar}}" ></image>
             <view class="msg">
                 <text class="_name" style="line-height:60rpx;">{{item.user_name}}</text>
             </view>
-        </view>
+        </navigator>
       </view>
   </scroll-view>