tanyanfei 2 years ago
parent
commit
255a30334d

+ 3 - 2
app.json

@@ -1,5 +1,6 @@
 {
 "pages": [
+  
   "pages/index/index",
   "pages/rank/rank",
   "pages/upload/upload",
@@ -8,14 +9,14 @@
   "pages/today/today",
   "pages/rethink/rethink",
   "pages/message/message",
-    
+  "pages/change/change",
     
     "pages/apply/apply",
     
     
     "pages/stock/stock",
     
-    "pages/change/change",
+    
     "pages/myMatchDetail/myMatchDetail",
     "pages/record/record",
     "pages/aboutus/aboutus",

+ 49 - 8
pages/change/change.js

@@ -7,7 +7,7 @@ Page({
      * 页面的初始数据
      */
     data: {
-        today_stock_img:[]
+        today_stock_img:''
     },
 
     /**
@@ -28,9 +28,9 @@ Page({
               $api.upload(tempFilePaths[i].path, 'file').then(res => {
                 wx.hideLoading()
                 if (res.code == 0) {
-                  today_stock_img.push(res.data.url)
+                  // today_stock_img.push(res.data.url)
                   this.setData({
-                    today_stock_img: today_stock_img
+                    today_stock_img: res.data.url
                   })
                 } else {
                   wx.showToast({
@@ -47,11 +47,11 @@ Page({
         })
       },
       del(e) {
-        var i = e.target.dataset.id;
-        var today_stock_img = this.data.today_stock_img;
-        today_stock_img.splice(i, 1)
+        // var i = e.target.dataset.id;
+        // var today_stock_img = this.data.today_stock_img;
+        // today_stock_img.splice(i, 1)
         this.setData({
-          today_stock_img: today_stock_img
+          today_stock_img: ''
         })
       },
       prview(e){
@@ -61,7 +61,48 @@ Page({
           urls: [src] // 需要预览的图片http链接列表
         })
       },
-
+      outchange(e){
+        this.setData({
+          out_fund: e.detail.value
+        })
+      },
+      inchange(e){
+        this.setData({
+          in_fund: e.detail.value
+        })
+      },
+      post(){
+        var data={
+          out_fund:this.data.out_fund,
+          in_fund:this.data.in_fund,
+          account_img:this.data.today_stock_img
+        }
+        if (!data.out_fund){
+          wx.showToast({
+            icon: 'none',
+            title: '请输入今转出资金'
+          })
+          return
+        }
+        if (!data.in_fund){
+          wx.showToast({
+            icon: 'none',
+            title: '请输入今转入资金'
+          })
+          return
+        }
+        $api.update(data).then(res=>{
+          if(res.code == 0){
+            wx.showToast({
+              title: '提交成功',
+            })
+          }else{
+            wx.showToast({
+              title: '提交失败',
+            })
+          }
+        })
+      },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 3 - 3
pages/change/change.wxml

@@ -1,11 +1,11 @@
 <view class="item">
     <label>今转出资金</label>
-    <input placeholder-style="color:rgba(203, 203, 203, 1)" type="text" placeholder="请填写"/>
+    <input bindinput="outchange" type='digit' placeholder-style="color:rgba(203, 203, 203, 1)"  placeholder="请填写"/>
     <text>万 <text>(单位)</text></text>
 </view>
 <view class="item">
     <label>今转入资金</label>
-    <input placeholder-style="color:rgba(203, 203, 203, 1)" type="text" placeholder="请填写"/>
+    <input bindinput="inchange" type='digit' placeholder-style="color:rgba(203, 203, 203, 1)"   placeholder="请填写"/>
     <text>万 <text>(单位)</text></text>
 </view>
 <view class="item">
@@ -16,7 +16,7 @@
             <text bindtap="del" data-id='{{index}}'>删除</text>
         </view>
     </view>
-    <view  class="upload" bindtap="uploadImg">
+    <view  class="upload" bindtap="uploadImg" wx:if="{{!today_stock_img}}">
           <image mode="widthFix" src="../../images/img.png"></image>
             上传图片
     </view>

+ 6 - 0
pages/day/day.wxml

@@ -23,6 +23,12 @@
           <image wx:for='{{item.today_stock_img}}' wx:for-item='i'  bindtap="preview" data-src='{{i}}' data-urls='{{item.today_stock_img}}'
                  class="img" src="{{i}}"></image>
     </view>
+    <view class="comment">
+        <image mode="widthFix" src="../../images/msg.png"></image>
+        <text>{{item.comments_count}}</text>
+        <image mode="widthFix" src="../../images/zan.png"></image>
+        <text>{{item.zans_count}}</text>
+    </view>
   </view>
   <block wx:if='{{total >= 20}}'>
     <view class='loading' wx:if='{{followList.length < total}}'>上拉加载更多...</view>

+ 15 - 0
pages/day/day.wxss

@@ -42,4 +42,19 @@ scroll-view{
   border-radius: 8rpx;
   margin-right: 8rpx;
   margin-bottom: 8rpx;
+}
+.comment{
+  padding:  24rpx 0;
+  border-bottom: 1px solid rgba(245, 245, 245, 1);
+}
+.comment image{
+  width: 32rpx;
+  margin-right: 10rpx;
+  position: relative;
+  top: 5rpx;
+}
+.comment text{
+  color: #999;
+  font-size: 28rpx;
+  margin-right: 40rpx;
 }

+ 2 - 0
pages/homepage/homepage.js

@@ -86,6 +86,8 @@ Page({
         date: stock_date[0] + '-' + stock_date[1],
         is_follow: res.data.data.is_follow,
         player_id: res.data.data.today_record.player_id,
+        followers:res.data.data.followers,
+        fans:res.data.data.fans,
         ec: {
           onInit: initChart
         },

+ 20 - 12
pages/homepage/homepage.wxml

@@ -3,8 +3,8 @@
     <view class="name">
       {{datas.today_record.username}}
       <view class="fans">
-          <text>2626</text>粉丝
-          <text style="margin-left: 20rpx;">2626</text>关注
+          <text>{{fans}}</text>粉丝
+          <navigator url="../follow/follow" style="display: inline-block;"><text style="margin-left: 20rpx;">{{followers}}</text>关注</navigator>
       </view>
     </view>
     <block wx:if='{{type!=1}}'>
@@ -14,17 +14,19 @@
     <navigator class="follow" url="../style/style" wx:else>编辑</navigator>
 </view>
 <view class="style">
-  <view wx:if='{{datas.today_record.style.length>0}}'>
-    <text>风格</text><label wx:for='{{datas.today_record.style}}' class="tag">{{item}}</label>
+  <view wx:if='{{datas.today_record.style.length>0}}' style="padding-bottom: 0;">
+    <text>风格</text>
+    <view style="display: inline-block;width: 70%;vertical-align: top;"><label wx:for='{{datas.today_record.style}}' class="tag">{{item}}</label></view>
   </view>
   <view>
-    <text>股龄</text>6年 
+    <text>股龄</text>{{datas.stock_age}}年
   </view>
-  <view>
+  <!-- <view>
     <text>城市</text>重庆
-  </view>
+  </view> -->
   <view>
-    <text>跟踪股票</text>金刚玻璃、国机汽车、华夏银行
+    <text>跟踪股票</text>
+    <block wx:for="{{datas.stock_follow}}">{{item}}</block>
   </view>
 </view>
 <view class="style" style="margin: 0;">
@@ -105,20 +107,26 @@
       <view class="info" wx:if='{{item.experience}}'>
         今日反思:{{item.experience}}
       </view>
-      <!-- <view class="info" wx:if='{{item.wanzhu_comment}}'>
+      <view class="info" wx:if='{{item.wanzhu_comment}}'>
         顽主点评:{{item.wanzhu_comment}}
-      </view> -->
+      </view>
     </navigator>
     <view class="imgs">
           <image wx:for='{{item.today_stock_img}}' wx:for-item='i'  bindtap="preview" data-src='{{i}}' data-urls='{{item.today_stock_img}}'
                  class="img" src="{{i}}"></image>
     </view>
+    <view class="comment">
+        <image mode="widthFix" src="../../images/msg.png"></image>
+        <text>{{item.comments_count}}</text>
+        <image mode="widthFix" src="../../images/zan.png"></image>
+        <text>{{item.zans_count}}</text>
+    </view>
   </view>
-  <!-- <view class="look_all">
+  <view class="look_all">
     <navigator hover-class="none" url="../day/day?id={{id}}&player_id={{player_id}}">
           查看全部
     </navigator>
-  </view> -->
+  </view>
 </view>
 
 <view wx:if="type==1" class="content" style="margin-top: 100rpx;"><view bindtap="logout" class="logout">退出登录</view></view>

+ 18 - 0
pages/homepage/homepage.wxss

@@ -91,6 +91,8 @@ ec-canvas {
   margin-right: 8rpx;
   font-weight: 400;
   padding: 0 8rpx;
+  display: inline-block;
+  margin-bottom: 10rpx;
 }
 .game{
   color: 32rpx;
@@ -279,4 +281,20 @@ picker{
   border: 1px solid rgba(224, 224, 224, 1);
   border-radius: 8rpx;
   background: #fff;
+}
+
+.comment{
+  padding:  24rpx 0;
+  border-bottom: 1px solid rgba(245, 245, 245, 1);
+}
+.comment image{
+  width: 32rpx;
+  margin-right: 10rpx;
+  position: relative;
+  top: 5rpx;
+}
+.comment text{
+  color: #999;
+  font-size: 28rpx;
+  margin-right: 40rpx;
 }

+ 10 - 6
pages/today/today.js

@@ -33,13 +33,15 @@ Page({
       record_id: record_id,
       player_id: options.player_id ? options.player_id:''
     })
+    $api.getAuthinfo().then(res=>{
+      wx.setNavigationBarTitle({
+        title: '',
+      })
+      this.setData({
+        role: res.data.data.role
+      })
+    })
     this.getData();
-    //获取评论 赞
-    // $api.getCommentCount({record_id:record_id}).then(res=>{
-    //   this.setData({
-    //     comment_count:res.data.data
-    //   })
-    // })
     this.getzan()
     this.getComment()
   },
@@ -116,6 +118,8 @@ Page({
         date: stock_date[0] + '-' + stock_date[1],
         is_follow: res.data.data.is_follow,
         player_id: res.data.data.today_record.player_id,
+        followers:res.data.data.followers,
+        fans:res.data.data.fans,
         ec: {
           onInit: initChart
         },

+ 4 - 4
pages/today/today.wxml

@@ -3,8 +3,8 @@
     <view class="name">
       {{datas.today_record.username}}
       <view class="fans">
-          <text>2626</text>粉丝
-          <text style="margin-left: 20rpx;">2626</text>关注
+          <text>{{fans}}</text>粉丝
+          <text style="margin-left: 20rpx;">{{followers}}</text>关注
       </view>
     </view>
     <navigator url="../homepage/homepage?id={{id}}&record_id={{record_id}}&player_id={{player_id}}">Ta的主页</navigator>
@@ -81,7 +81,7 @@
               {{i.content}}</view>
           </view>
           <view class="addr">
-              <text>{{item.ctime}}</text><text>来自北京</text>
+              <text>{{item.ctime}}</text><text>来自{{item.location}}</text>
               <image data-id='{{item.id}}' data-name='{{item.user_name}}' bindtap="answer" mode="widthFix" src="../../images/msg.png"></image>
           </view>
       </view>
@@ -93,7 +93,7 @@
     {{datas.today_record.wanzhu_comment?datas.today_record.wanzhu_comment:'无'}}
 </view> -->
 
-<view class="post">
+<view class="post" wx:if='{{role==2}}'>
     <image bindtap="zan"  mode="widthFix" src="../../images/zan.png"></image>
     <input bindblur="blur" value="{{comment}}" placeholder-style="color:#999" maxlength="500" bindinput="inputchange" focus='{{focus}}' type="text" placeholder="{{text}}"/>
     <button bindtap="sendmsg">提交</button>

+ 3 - 0
pages/user/user.wxml

@@ -43,6 +43,9 @@
         <navigator hover-class="none"  class="item" url="../mymatch/mymatch">
             我的比赛  <image mode="widthFix" src="../../images/right_icon.png"></image>
         </navigator> -->
+        <!-- <navigator hover-class="none" class="item" url="../style/style">
+            我的风格  <image mode="widthFix" src="../../images/right_icon.png"></image>
+        </navigator> -->
         <navigator hover-class="none" style="border:none"  class="item" url="../aboutus/aboutus">
             关于我们  <image mode="widthFix" src="../../images/right_icon.png"></image>
         </navigator>

+ 2 - 0
utils/api.js

@@ -145,6 +145,8 @@ const API = {
   wxpay: (data) => request(POST, `/api/wx/v3/signup/wxpay`, data),
   consult: (data) => request(POST, `/api/wx/v3/user/consult`, data),
   getsignup: (data) => request(GET, `/api/wx/v3/signup/info`, data),
+  update: (data) => request(PUT, `/v3/user/fund/modify`, data),
+  
   
 }; 
 module.exports = {