Kaynağa Gözat

Merge branch 'master' of http://118.190.145.217:3000/xiaojincai/wanzb_xcxv3 into master

tanyanfei 1 yıl önce
ebeveyn
işleme
bc51c5ee18

+ 1 - 0
app.js

@@ -6,6 +6,7 @@ App({
     logs.unshift(Date.now())
     wx.setStorageSync('logs', logs)
 
+    console.log('app start')
     // 登录
     wx.login({
       success: res => {

BIN
images/shanchu.png


+ 0 - 6
pages/apply/apply.js

@@ -10,7 +10,6 @@ Page({
     data: {
       type:2,
       info:{},
-      authinfo:{}
     },
 
     /**
@@ -25,11 +24,6 @@ Page({
                 info:res.data.data
             })
         })
-        $api.getAuthinfo().then(res=>{
-          this.setData({
-            authinfo: res.data.data,
-          })
-        })
     },
     tab(e){
         this.setData({

+ 2 - 2
pages/apply/apply.wxml

@@ -21,7 +21,7 @@
           <text>百万组:50W到300W</text>
           <text>十万组:10W到50W</text>
           <text>菜鸟组:10W以下</text>
-          <text>各组第一有牛气冲天奖杯!</text>
+          <text>各组第一奖牛气冲天奖杯!各组前三奖比赛纪念衫两件。五组选手总收益率第一,奖华为mate60一部。五组选手总盈利金额第一,奖华为mate60一部。</text>
           <text>产业链选手禁止参赛,一经多个观众投诉反应,经核实有一定嫌疑,将立刻取消参赛资格。</text>
         </view>
         <view class="title title1">3、交作业</view>
@@ -41,7 +41,7 @@
           <text>免费参赛:在比赛券商开户参赛,可永久免报名费,佣金低-网速快-网上开户几分钟完成,可同时兼容同花顺-通达信,已开通创业板权限的可转签,具体操作请站内</text>
           <navigator url="../message/message"><text class="change" >咨询我们</text></navigator>
           <text>
-          已经取得免费参赛资格的老选手:含(开户选手,历届小组第一,倒数第一,种子选手,腰斩选手),请直接站内联系客服授权登记。</text>
+          取得免费参赛资格的老选手:含(开户选手,历届小组第一,倒数第一,种子选手,腰斩选手),请直接站内联系客服授权登记。</text>
         </view>
         <view class="title title1">6、退赛</view>
         <view class="date">

+ 5 - 0
pages/comment/comment.js

@@ -1,5 +1,7 @@
 // pages/follow/follow.js
 const $api = require('../../utils/api.js').API;
+const $push = require('../../utils/api.js').PUSH;
+
 Page({
 
   /**
@@ -51,6 +53,9 @@ Page({
     })
   },
 
+  pushToday(e){
+    $push.pushToday(e.currentTarget.dataset)
+  },
 
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 1 - 1
pages/comment/comment.wxml

@@ -1,6 +1,6 @@
 <!--pages/comment/comment.wxml-->
 <scroll-view scroll-y='{{true}}' bindscrolltolower='next'>
-  <navigator hover-class="none" class="list" wx:for='{{list}}' url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+  <navigator hover-class="none" class="list" wx:for='{{list}}' bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
         <view class="name">{{item.username}}  <text>选手</text> <view>TOP <text>{{item.group_rank}}</text></view></view> 
         <view class="info">
                   日期: <view>{{item.stock_date}}(收益 <text  class="{{item.today_income[0]=='-' ?'down':'up'}}">{{item.today_income}}</text>)</view>

+ 4 - 1
pages/day/day.js

@@ -1,5 +1,6 @@
 // pages/follow/follow.js
 const $api = require('../../utils/api.js').API;
+const $push = require('../../utils/api.js').PUSH;
 Page({
 
   /**
@@ -60,7 +61,9 @@ Page({
       current: e.target.dataset.src
     })
   },
-
+  pushToday(e){
+    $push.pushToday(e.currentTarget.dataset)
+  },
 
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 2 - 2
pages/day/day.wxml

@@ -1,6 +1,6 @@
 <scroll-view scroll-y='{{true}}' bindscrolltolower='next'>
   <view class="stock" wx:for='{{list}}'>
-  <navigator hover-class="none" url='../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{user_id}}' >
+  <navigator hover-class="none" bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{user_id}}" >
     <view class="info">
       <view>{{item.stock_date}}(今日收益 <text  class="{{item.today_income[0]=='-' ?'down':'up'}}">{{item.today_income}}</text>)</view>
     </view>
@@ -18,7 +18,7 @@
       <view class="info" wx:if='{{item.wanzhu_comment}}'>
         顽主点评:{{item.wanzhu_comment}}
       </view>
-    </navigator>
+  </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>

+ 19 - 13
pages/index/index.js

@@ -2,6 +2,8 @@
 // 获取应用实例
 const app = getApp()
 const $api = require('../../utils/api.js').API;
+const $push = require('../../utils/api.js').PUSH;
+
 Page({
   data: {
     loading:0,
@@ -24,12 +26,20 @@ Page({
     articleList2:[],
     articleList3:[],
     articleList4:[],
-    groups:{}
+    groups:{},
+    role:0,
   },
   onLoad() {
-    
     wx.showNavigationBarLoading()
-    
+    wx.getStorage({
+      key: 'user',
+      complete: res => {
+        this.setData({
+          role: res.data.role,
+        })
+      }
+    })
+
     $api.getDate().then(res=>{
       this.setData({
         date:res.data.data
@@ -184,8 +194,6 @@ Page({
         })
     }
   },
-
-
   renew(){
     this.setData({
       followList:[],
@@ -206,20 +214,18 @@ Page({
         break;
     }
   },
+  pushToday(e){
+    $push.pushToday(e.currentTarget.dataset)
+  },
+
   onShow: function (e) {
+    $api.initUser()
+    
     $api.getsignup().then(res => {
       this.setData({
         info: res.data.data
       })
     })
-    //判断是否报名
-    $api.getAuthinfo().then(res=>{
-      if(res.data.data.role==0){
-        wx.navigateTo({
-          url: '../login/user?type=3&player_type='+res.data.data.player_type,
-        })
-      }
-    })
     
     if(this.data.cur == 0 && app.globalData.follow == 1){
       this.data.loading = 1

+ 10 - 10
pages/index/index.wxml

@@ -66,7 +66,7 @@
   <!-- <image src="../../images/lb.png" mode="widthFix" class="notice"></image> -->
     <view class="marquee_text">
       {{info.name}}正在报名中
-      <text>报名时间:{{info.signup_start_time}}到{{info.signup_end_time}}</text> 
+      <text>报名时间: {{info.signup_start_time}} 至 {{info.signup_end_time}}</text> 
     </view>
     <navigator hover-class="none" url="../apply/apply?type=2">马上报名</navigator>
     <!-- <image class="signupPoint" mode="widthFix" src="../../images/right.png"></image> -->
@@ -107,7 +107,7 @@
     <view wx:for='{{tabs1}}' bindtap="tabChange1" data-id='{{index}}' class="{{index==cur1?'act':''}}">{{item}}</view>
 </view>
 
-<swiper class="swiper-content" style="padding:10rpx 25rpx;" current='{{cur1}}'  bindchange='curChange1'>
+<swiper class="swiper-content" style="padding:10rpx 25rpx;height: 100vh;" current='{{cur1}}'  bindchange='curChange1'>
   <swiper-item class="up-down">
     <view class="title_1">
       <text>涨幅</text><text>资产(w)</text><text>收益(w)</text>
@@ -155,7 +155,7 @@
     <view class="content-list">
       <view class="up-down">
         <text>盈利榜</text>
-        <navigator wx:for="{{winLost.total_income_up}}" hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+        <navigator wx:for="{{winLost.total_income_up}}" hover-class="none"  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
             <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
             <text wx:else class="number">{{index+1}}</text>
             <image class="avatar"   src="{{filters.defaultImg(item.avatar)}}"></image>
@@ -165,7 +165,7 @@
       </view>
       <view class="up-down">
         <text>赚钱榜</text>
-        <navigator wx:for="{{winLost.total_win_up}}" hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+        <navigator wx:for="{{winLost.total_win_up}}" hover-class="none"  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
             <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
             <text wx:else class="number">{{index+1}}</text>
             <image class="avatar"  src="{{filters.defaultImg(item.avatar)}}"></image>
@@ -175,7 +175,7 @@
       </view>
       <view class="up-down">
         <text>亏损榜</text>
-        <navigator wx:for="{{winLost.total_income_down}}" hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+        <navigator wx:for="{{winLost.total_income_down}}" hover-class="none"  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
             <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
             <text wx:else class="number">{{index+1}}</text>
             <image class="avatar"   src="{{filters.defaultImg(item.avatar)}}"></image>
@@ -185,7 +185,7 @@
       </view>
       <view class="up-down">
         <text>亏钱榜</text>
-        <navigator wx:for="{{winLost.total_win_down}}" hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+        <navigator wx:for="{{winLost.total_win_down}}" hover-class="none"  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
             <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
             <text wx:else class="number">{{index+1}}</text>
             <image class="avatar"   src="{{filters.defaultImg(item.avatar)}}"></image>
@@ -255,7 +255,7 @@
   <swiper-item>
       <scroll-view  scroll-y='{{true}}'  bindscrolltolower='next1'>
           <view  class="item1" wx:for='{{explist}}'>
-            <navigator hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+            <navigator hover-class="none"  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
               <view class="relist">
                 <image  src="{{filters.defaultImg(item.avatar)}}"></image>
                   <view class="msg">
@@ -275,7 +275,7 @@
                   <image mode="widthFix" src="../../images/zan.png"></image>
                   <text>{{item.zans_count}}</text>
               </view>
-              </navigator>
+            </navigator>
           </view>
           <block wx:if='{{total1 >= 20}}'>
             <view class='loading' wx:if='{{explist.length < total1}}'>上拉加载更多...</view>
@@ -286,7 +286,7 @@
       <scroll-view   upper-threshold="0" bindscrolltoupper='fresh' scroll-y='{{true}}' bindscrolltolower='next2'>
           <view wx:if='{{loading}}' class="loading">下拉刷新</view>
           <view  class="item1" wx:for='{{followList}}'>
-            <navigator hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+            <navigator hover-class="none"  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
               <view class="relist">
                 <image  src="{{filters.defaultImg(item.avatar)}}"></image>
                   <view class="msg">
@@ -299,7 +299,7 @@
               <view class="item_money"><label class="item_money_title">资产 </label>{{item.today_fund}}w <label class="item_money_title"> 总收益 </label> <label class="{{item.total_income[0]=='-' ?'down':'up'}}">{{item.total_income}}</label>  <label class="item_money_title"> 今日收益 </label><label class="{{item.today_income[0]=='-' ?'down':'up'}}">{{item.today_income}}</label>
               </view>
               <view class="content" wx:if="{{item.experience}}">{{item.experience}}</view>
-              <view class="imgs">
+              <view class="imgs" wx:if="{{role != 0}}">
                 <image wx:for='{{item.today_stock_img}}' wx:for-item='i'  catchtap="preview" data-src='{{i}}' data-urls='{{item.today_stock_img}}'
                  class="img" src="{{i}}"  mode="heightFix"></image>
               </view> 

+ 4 - 4
pages/index/index.wxss

@@ -575,7 +575,7 @@ scroll-view{
   /* background: rgba(255, 244.8, 244.8, 1); */
   /* box-shadow:0px 4px 12px 0px rgba(0,0,0,0.08); */
   border-radius:4px;
-  padding: 12.5px 12px;
+  padding: 10px 8px;
   position: relative;
   overflow: hidden;
   height: 125rpx;
@@ -588,8 +588,8 @@ scroll-view{
   top: 0;
   color: #fff;
   padding: 0 20rpx;
-  height: 60rpx;
-  line-height: 60rpx;
+  height: 70rpx;
+  line-height: 70rpx;
   border-radius: 6rpx;
   font-size: 26rpx;
   bottom: 0;
@@ -598,7 +598,7 @@ scroll-view{
 .marquee_text{
   color:#333;
   font-weight: 600;
-  font-size: 30rpx;
+  font-size: 34rpx;
 }
 
 .marquee_text text{

+ 5 - 0
pages/list/list.js

@@ -1,5 +1,7 @@
 // pages/list/list.js
 const $api = require('../../utils/api.js').API;
+const $push = require('../../utils/api.js').PUSH;
+
 Page({
 
   /**
@@ -93,6 +95,9 @@ Page({
     this.getData()
   },
 
+  pushToday(e){
+    $push.pushToday(e.currentTarget.dataset)
+  },
 
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 1 - 1
pages/list/list.wxml

@@ -18,7 +18,7 @@
     </view>
 </view>
 <scroll-view scroll-y="true" class="list" bindscrolltolower='next'>
-    <navigator hover-class="none" class="item" wx:for='{{list}}'  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+    <navigator hover-class="none" class="item" wx:for='{{list}}' bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}" >
         <view wx:if="{{order_by == 'total_income__desc'}}">
         <image wx:if='{{item.group_rank==1}}' mode="widthFix" src="../../images/1.png"></image>
         <image wx:if='{{item.group_rank==2}}' mode="widthFix" src="../../images/2.png"></image>

+ 14 - 9
pages/login/user.js

@@ -179,7 +179,7 @@ Page({
             openid:nopenid,
             unionid:nunionid,
           })
-          console.log(res.data.data.unionid,222)
+          // console.log(res.data.data.unionid,222)
           $api.isUserLogin({openid:nopenid,unionid:nunionid})
           .then(res=>{
             wx.hideLoading();
@@ -240,27 +240,32 @@ Page({
         })
         return;
       }
-
+      // console.log(res.data.data,'user')
       wx.setStorage({
         key: 'userInfo',
         data: res.data.data,
       })
+
+      wx.setStorage({
+        key: 'user',
+        data: res.data.data,
+      })
       
       //老用户直接进入系统
-      if(res.data.data.role != 0){
+      // if(res.data.data.role != 0){
         app.globalData.follow = 1
         wx.switchTab({
           url: '../index/index',
         })
         
-        return;
-      }
+        // return;
+      // }
 
       //新用户选择报名
-      _this.setData({
-        status:3,
-        player_type:0
-      })
+      // _this.setData({
+      //   status:3,
+      //   player_type:0
+      // })
       
       wx.setNavigationBarTitle({
         title: '',

+ 1 - 1
pages/login/user.json

@@ -1,3 +1,3 @@
 {
-  "navigationBarTitleText": "登录"
+  "navigationBarTitleText": "报名"
 }

+ 3 - 3
pages/login/user.wxml

@@ -41,12 +41,12 @@
 
 
 <view class="no_login" wx:if='{{status == 3}}'>
-  <view class="title">欢迎来到湖南顽主杯实盘大赛</view>
+  <view class="title">顽主杯实盘大赛VIP报名</view>
     <view class='avatar'>
             <image src="../../images/logo.png"></image>
     </view>
-  <navigator url="../apply/apply?type=2"><image style="width: 24px;" mode="widthFix" src="../../images/bs.png"></image>  注册选手(报名参赛)</navigator>
-  <navigator  style="background: none;color:#D94B24;" url="../apply/apply?type=1"><image style="width: 24px;" mode="widthFix" src="../../images/yk.png"></image>  注册游客(浏览系统)</navigator>
+  <navigator url="../apply/apply?type=2"><image style="width: 24px;" mode="widthFix" src="../../images/bs.png"></image>报名参赛(选手VIP)</navigator>
+  <navigator  style="background: none;color:#D94B24;" url="../apply/apply?type=1"><image style="width: 24px;" mode="widthFix" src="../../images/yk.png"></image>报名观赛(游客VIP)</navigator>
   <navigator style="background: none;color:#D94B24;" url="../message/message"><image style="width: 18px;" mode="widthFix" src="../../images/zx.png"></image>  咨询顽主</navigator>
 </view>
 

+ 17 - 1
pages/matchdetail/matchdetail.js

@@ -2,6 +2,8 @@
 const app = getApp()
 import * as echarts from '../../ec-canvas/echarts';
 const $api = require('../../utils/api.js').API;
+const $push = require('../../utils/api.js').PUSH;
+
 var records = [], today_stock=[];
 
 Page({
@@ -21,7 +23,8 @@ Page({
     },
     ec1: {
       onInit: null
-    }
+    },
+    role:0,
   },
 
   /**
@@ -32,10 +35,23 @@ Page({
       user_id:options.user_id,
       match_id:options.match_id,
     })
+
+    wx.getStorage({
+      key: 'user',
+      complete: res => {
+        this.setData({
+          role: res.data.role,
+        })
+      }
+    })
+
     this.getMatchData()
 
   },
 
+  pushToday(e){
+    $push.pushToday(e.currentTarget.dataset)
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 35 - 13
pages/matchdetail/matchdetail.wxml

@@ -1,4 +1,5 @@
 <!--pages/matchdetail/matchdetail.wxml-->
+<wxs module="filters" src="../../utils/toFixed.wxs" />
 
 <view class="{{total_money[0]=='-' ?'head_loss':'head'}}">
   <view class="head_title">{{datas.match.name}}</view>
@@ -55,7 +56,7 @@
         {{item.day}}
         <text>{{item.income}}</text>
       </view>
-      <navigator wx:else url="../today/today?id={{match_id}}&record_id={{item.record_id}}&user_id={{user_id}}">
+      <navigator wx:else bind:tap="pushToday" data-match_id="{{match_id}}" data-record_id="{{item.record_id}}" data-user_id = "{{user_id}}" >
       <view   class="{{item.income[0]=='-' ? 'down1':'up1'}}"> 
         {{item.day}}
         <text>{{item.income}}</text>
@@ -67,7 +68,36 @@
 <view class="title">每日持股</view>
 <view class="days_stock">
   <view  class="stock" wx:for='{{datas.records}}'>
-    <navigator hover-class="none" url='../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{user_id}}'>
+    <navigator hover-class="none"  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
+      <view class="relist">
+        <image  src="{{filters.defaultImg(item.avatar)}}"></image>
+          <view class="msg">
+              <text class="name">{{item.username}}</text>
+          </view>
+          <view class="msg">
+              <text class="date">{{item.stock_date}}</text>
+          </view>
+      </view>
+      <view class="item_money"><label class="item_money_title">资产 </label>{{item.today_fund}}w <label class="item_money_title"> 总收益 </label> <label class="{{item.total_income[0]=='-' ?'down':'up'}}">{{item.total_income}}</label>  <label class="item_money_title"> 今日收益 </label><label class="{{item.today_income[0]=='-' ?'down':'up'}}">{{item.today_income}}</label>
+      </view>
+
+      <view class="experience" wx:if="{{item.experience}}">{{item.experience}}</view>
+      <view class="info" wx:if='{{item.wanzhu_comment}}'>
+        顽主点评:{{item.wanzhu_comment}}
+      </view>
+      <view class="imgs" wx:if="{{role != 0}}">
+          <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="recomment">
+          <image mode="widthFix" src="../../images/msg.png"></image>
+          <text>{{item.comments_count}}</text>
+          <image mode="widthFix" src="../../images/zan.png"></image>
+          <text>{{item.zans}}</text>
+      </view>
+    </navigator>
+
+    <!-- <navigator hover-class="none" bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{user_id}}" >
       <view class="info">
         <view class="date"> {{item.stock_date}}(今日收益 <text  class="{{item.today_income[0]=='-' ?'down':'up'}}">{{item.today_income}}</text>)</view>
       </view>
@@ -88,17 +118,9 @@
       <view class="info" wx:if='{{item.wanzhu_comment}}'>
         顽主点评:{{item.wanzhu_comment}}
       </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>
+    </navigator> -->
+    
+    
   </view>
 
 </view>

+ 61 - 3
pages/matchdetail/matchdetail.wxss

@@ -99,10 +99,10 @@ ec-canvas {
   font-weight: bold;
   margin-bottom: 20rpx;
 }
-.date{
+/* .date{
   border-left: 4px solid #D94B24;
   padding-left: 4rpx;
-}
+} */
 
 
 .infos{
@@ -164,6 +164,7 @@ ec-canvas {
   font-size: 30rpx;
   font-weight: 500;
 }
+
 .days_stock{
   background: #fff;
   padding: 30rpx;
@@ -299,7 +300,9 @@ picker{
 }
 
 .info{
-  font-size: 30rpx;
+  font-size: 32rpx;
+  font-weight: 500;
+  margin-top: 20rpx;
   /* padding: 10rpx 24rpx;
   display: flex; */
 }
@@ -367,4 +370,59 @@ picker{
 .head_ratio{
   font-size: 30rpx;
   padding-top: 50rpx;
+}
+
+.relist{
+  position: relative;
+  padding-left: 80rpx;
+  margin-bottom: 24rpx;
+}
+
+.relist image{
+  width: 90rpx;
+  height: 90rpx;
+  position: absolute;
+  left: 0;
+  border-radius: 100%;
+}
+.experience{
+  font-size: 32rpx;
+  margin-top: 20rpx;
+}
+
+.msg .name{
+  font-size: 32rpx;
+  color: #333;
+  margin-left: 30rpx;
+}
+
+.msg .date{
+  font-size: 28rpx;
+  color: #333;
+  margin-left: 30rpx;
+}
+
+.item_money{
+  font-size: 33rpx;
+}
+
+.item_money_title{
+  font-size: 30rpx;
+}
+
+
+.recomment{
+  padding:  24rpx 0;
+  border-bottom: 1px solid rgba(245, 245, 245, 1);
+}
+.recomment image{
+  width: 32rpx;
+  margin-right: 10rpx;
+  position: relative;
+  top: 5rpx;
+}
+.recomment text{
+  color: #999;
+  font-size: 28rpx;
+  margin-right: 40rpx;
 }

+ 5 - 0
pages/mymatch/mymatch.js

@@ -1,5 +1,7 @@
 // pages/follow/follow.js
 const $api = require('../../utils/api.js').API;
+const $push = require('../../utils/api.js').PUSH;
+
 Page({
 
   /**
@@ -28,6 +30,9 @@ Page({
     })
   },
 
+  pushToday(e){
+    $push.pushToday(e.currentTarget.dataset)
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 1 - 1
pages/mymatch/mymatch.wxml

@@ -1,3 +1,3 @@
 <!--pages/mymatch/mymatch.wxml-->
-<navigator hover-class="none" wx:for="{{list}}" url="../today/today?id={{item.id}}&user_id={{item.user_id}}">{{item.name}}</navigator>
+<navigator hover-class="none" wx:for="{{list}}"  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">{{item.name}}</navigator>
 <view wx:if="{{list.length<=0}}" class="not_data">-暂无数据-</view>

+ 8 - 1
pages/rank/rank.js

@@ -1,5 +1,7 @@
 // pages/rank/rank.js
 const $api = require('../../utils/api.js').API;
+const $push = require('../../utils/api.js').PUSH;
+
 Page({
 
   /**
@@ -86,7 +88,9 @@ Page({
     })
     this.getData()
   },
-
+  pushToday(e){
+    $push.pushToday(e.currentTarget.dataset)
+  },
 
 
   /**
@@ -100,6 +104,8 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
+    $api.initUser()
+    
     $api.getsignup().then(res => {
       this.setData({
         info: res.data.data
@@ -123,6 +129,7 @@ Page({
     
   },
 
+
   /**
    * 生命周期函数--监听页面隐藏
    */

+ 1 - 1
pages/rank/rank.wxml

@@ -53,7 +53,7 @@
         </navigator>
     </view> 
     <navigator hover-class="none" class="item" wx:for='{{item.players}}' 
-    wx:for-index='i' wx:for-item='player'  url="../today/today?id={{item.match_id}}&record_id={{player.id}}&user_id={{player.user_id}}">
+    wx:for-index='i' wx:for-item='player'  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{player.id}}" data-user_id = "{{player.user_id}}">
         <image wx:if='{{i==0}}' mode="widthFix" src="../../images/1.png"></image>
         <image wx:if='{{i==1}}' mode="widthFix" src="../../images/2.png"></image>
         <image wx:if='{{i==2}}' mode="widthFix" src="../../images/3.png"></image>

+ 5 - 5
pages/rank/rank.wxss

@@ -26,7 +26,7 @@ page{
   /* background: rgba(255, 244.8, 244.8, 1); */
   /* box-shadow:0px 4px 12px 0px rgba(0,0,0,0.08); */
   border-radius:4px;
-  padding: 12.5px 12px;
+  padding: 10px 8px;
   position: relative;
   overflow: hidden;
   height: 125rpx;
@@ -39,10 +39,10 @@ page{
   top: 0;
   color: #fff;
   padding: 0 20rpx;
-  height: 60rpx;
-  line-height: 60rpx;
+  height: 70rpx;
+  line-height: 70rpx;
   border-radius: 6rpx;
-  font-size: 26rpx;
+  font-size: 28rpx;
   bottom: 0;
   margin: auto;
 }
@@ -53,7 +53,7 @@ page{
 .marquee_text{
   color:#333;
   font-weight: 600;
-  font-size: 30rpx;
+  font-size: 34rpx;
 }
 .marquee_text navigator{
   margin-right: 20px;

+ 10 - 12
pages/signup/signup.js

@@ -43,20 +43,18 @@ Page({
         
       }
     })
-    this.getUserData()
-  },
-  getUserData() {
-    $api.getAuthinfo().then(res=>{
-      this.setData({
-        userinfo: res.data.data,
-      })
-    })
-    .catch(err=>{
-      this.setData({
-        userinfo: {}
-      })
+
+    wx.getStorage({
+      key: 'user',
+      complete: res => {
+        this.setData({
+          userinfo: res.data,
+        })
+      }
     })
+
   },
+
   bindChange(e) {
     let match=this.data.info.groups;
     this.setData({

+ 17 - 12
pages/stock/stock.js

@@ -1,5 +1,7 @@
 // pages/stock/stock.js
 const $api = require('../../utils/api.js').API;
+const $push = require('../../utils/api.js').PUSH;
+
 Page({
 
   /**
@@ -21,7 +23,8 @@ Page({
     myList:[],
     searchList:[],
     nbComments:[],
-    todaynb:0
+    todaynb:0,
+    role:0,
   },
 
   /**
@@ -33,12 +36,17 @@ Page({
       type:options.type,
       stock_date:options.stock_date
     })
-    $api.getAuthinfo().then(res=>{
-      this.setData({
-        user_id:res.data.data.id,
-        role: res.data.data.role
-      })
+
+    wx.getStorage({
+      key: 'user',
+      complete: res => {
+        this.setData({
+          user_id: res.data.id,
+          role: res.data.role,
+        })
+      }
     })
+
     if (options.id){
       //详情
       this.setData({
@@ -49,11 +57,6 @@ Page({
       })
       this.getComment()
       this.getMylist()
-      $api.getAuthinfo().then(res=>{
-        this.setData({
-          role: res.data.data.role
-        })
-      })
       $api.getStock({ id: options.id, stock_date: this.data.stock_date }).then(res => {
         this.setData({
           info: res.data.data
@@ -264,7 +267,9 @@ Page({
       
     
   },
-
+  pushToday(e){
+    $push.pushToday(e.currentTarget.dataset)
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 7 - 8
pages/stock/stock.wxml

@@ -11,10 +11,10 @@
     </block>
     <view class="tab">
         <view bindtap="tab"   data-id='1' class="{{cur==1?'act':''}}">今日持仓<text></text></view>
-        <view bindtap="tab" data-id='0' class="{{cur==0?'act':''}}">我要解读<text></text></view>
-        <view bindtap="tab" data-id='2' class="{{cur==2?'act':''}}">牛人点评<text></text></view>
+        <!-- <view bindtap="tab" data-id='0' class="{{cur==0?'act':''}}">我要解读<text></text></view>
+        <view bindtap="tab" data-id='2' class="{{cur==2?'act':''}}">牛人点评<text></text></view> -->
     </view>
-    <view bindtap="blur" style="background: #fff;padding: 30rpx 30rpx 180rpx;">
+    <view bindtap="blur" style="background: #fff;padding: 20rpx 0rpx 0rpx 20rpx;">
         <view class="content" wx:if='{{cur==0}}'>
           <view class="_list" wx:for="{{comment_list}}">
             <navigator url="../homepage/homepage?user_id={{item.user_id}}"><image src="{{item.user_avatar}}" ></image></navigator>
@@ -35,14 +35,14 @@
           </view>
         </view>
         <scroll-view wx:if='{{cur==1}}' bindscrolltolower='next1' scroll-y='{{true}}' style="height:calc(100vh - 90rpx);">
-            <navigator hover-class="none" class="player" wx:for='{{list}}' url="../today/today?id={{item.match_id}}&user_id={{item.user_id}}">
+            <navigator hover-class="none" class="player" wx:for='{{list}}' bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
               <view class="name">{{item.username}}  <text>{{item.badge}}</text> 
               </view> 
               <view class="info">
                           资产:<view><label style="font-weight: 600;">{{item.today_fund}}w</label>(今日收益 <text  class="{{item.today_income[0]=='-' ?'down':'up'}}">{{item.today_income}}</text><text style="color:#F5F5F5;">  |  </text>总收益<text  class="{{item.total_income[0]=='-' ?'down':'up'}}">{{item.total_income}}</text>)</view>
               </view>
 
-              <view class="info">
+              <view class="info" wx:if="{{role != 0}}">
                             持仓: 
                               <view wx:if='{{item.is_markt}}'>开超市</view>
                               <view wx:elif='{{item.today_stock.length>0}}'>
@@ -63,10 +63,9 @@
           </view>
         </view>
     </view>
-    <view  class="post">
+    <!-- <view  class="post">
         <input value="{{comment}}" confirm-type='send' bindconfirm='sendmsg' placeholder-style="color:#999" maxlength="500" bindinput="inputchange1" focus='{{focus}}' type="text" placeholder="{{text}}"/>
-        <!-- <button bindtap="sendmsg">提交</button> -->
-    </view>
+    </view> -->
   </view>
   <view wx:else class="hot_list">
     <view class="top_bg">

+ 4 - 5
pages/stock/stock.wxss

@@ -191,8 +191,8 @@ image.number{
 }
 .stock_name{
   line-height: 100rpx;
-  padding: 0 30rpx;
-  font-size: 30rpx;
+  padding: 0 20rpx;
+  font-size: 32rpx;
   color: #333;
   background: #fff;
   position: relative;
@@ -208,13 +208,12 @@ image.number{
   border-bottom: 1px solid #f2f2f2;
 }
 .tab view{
-  line-height: 90rpx;
+  line-height: 70rpx;
   text-align: center;
-  /* width: 50%; */
   display: inline-block;
   font-size: 30rpx;
   position: relative;
-  padding: 0 30rpx;
+  padding: 0 20rpx;
 }
 .tab .act{
   color: #FF583D;

+ 14 - 8
pages/today/today.js

@@ -2,6 +2,8 @@
 const app = getApp()
 import * as echarts from '../../ec-canvas/echarts';
 const $api = require('../../utils/api.js').API;
+const $push = require('../../utils/api.js').PUSH;
+
 var id, record_id, records = [], today_stock=[];
 Page({
 
@@ -33,15 +35,16 @@ Page({
       record_id: record_id,
       user_id: options.user_id ? options.user_id:''
     })
-    $api.getAuthinfo().then(res=>{
-      wx.setNavigationBarTitle({
-        title: '',
-      })
-      this.setData({
-        author_user_id:res.data.data.id,
-        role: res.data.data.role
-      })
+
+    wx.getStorage({
+      key: 'user',
+      complete: res => {
+        this.setData({
+          author_user_id: res.data.id,
+        })
+      }
     })
+
     this.getData();
   },
   getzan(){
@@ -255,6 +258,9 @@ Page({
       }
     })
   },
+  pushToday(e){
+    $push.pushToday(e.currentTarget.dataset)
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 1 - 1
pages/today/today.wxml

@@ -99,7 +99,7 @@
         {{item.day}}
         <text>{{item.income}}</text>
       </view>
-      <navigator wx:else url="../today/today?id={{id}}&record_id={{item.record_id}}&user_id={{user_id}}">
+      <navigator wx:else bind:tap="pushToday" data-match_id="{{id}}" data-record_id="{{item.record_id}}" data-user_id = "{{user_id}}">
       <view   class="{{item.income[0]=='-' ? 'down1':'up1'}}"> 
         {{item.day}}
         <text>{{item.income}}</text>

+ 7 - 0
pages/todayExp/todayExp.js

@@ -1,6 +1,8 @@
 // pages/article/article.js
 const app = getApp()
 const $api = require('../../utils/api.js').API;
+const $push = require('../../utils/api.js').PUSH;
+
 Page({
 
   /**
@@ -45,6 +47,11 @@ Page({
       this.getData()
     }
   },
+
+  pushToday(e){
+    $push.pushToday(e.currentTarget.dataset)
+  },
+  
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 1 - 1
pages/todayExp/todayExp.wxml

@@ -1,7 +1,7 @@
 <wxs module="filters" src="../../utils/toFixed.wxs" />
 <scroll-view  scroll-y='{{true}}'  bindscrolltolower='next'>
 <view class="up-down">
-        <navigator wx:for="{{list}}" hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+        <navigator wx:for="{{list}}" hover-class="none" bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
           <view class="relist">
                 <image  src="{{filters.defaultImg(item.avatar)}}"></image>
                   <view class="msg">

+ 158 - 121
pages/upload/upload.js

@@ -20,7 +20,8 @@ Page({
     cur:0,
     freshen:true,
     disable:false,
-    id:0
+    id:0,
+    images:[],
   },
 
   /**
@@ -33,12 +34,18 @@ Page({
     this.setData({
       disable: false
     })
-    $api.getAuthinfo().then(res=>{
-      this.setData({
-        role: res.data.data.role,
-        need_fill: res.data.data.need_fill,
-      })
+
+    $api.initUser()
+
+    wx.getStorage({
+      key: 'user',
+      complete: res => {
+        this.setData({
+          role: res.data.role,
+        })
+      }
     })
+
     $api.getCurrecord().then(res=>{
       if (!res.data.data.id){return}
       let stock = res.data.data.today_stock
@@ -87,6 +94,11 @@ Page({
       value: value
     })
   },
+  delToday(e){
+    this.setData({
+      today_fund: '',
+    })
+  },
   bindPickerChange(e){
     var i=this.data.cur;
     var v = e.target.dataset.name
@@ -181,6 +193,7 @@ Page({
         wx.showLoading({
           title: '正在上传',
         })
+    
         const tempFilePaths = res.tempFiles
         for (let i = 0; i < tempFilePaths.length; i++) {
           $api.upload(tempFilePaths[i].path, 'file').then(res => {
@@ -192,6 +205,9 @@ Page({
                 today_stock_img: today_stock_img
               })
               console.log(this.data.today_stock_img,22222222222)
+              if (i==0 && today_stock_img.length == 1){
+                  this.loadOcr(tempFilePaths[i].path,res.data.url)
+              }
             } else {
               wx.showToast({
                 title: '上传失败',
@@ -201,11 +217,65 @@ Page({
             .catch(err => {
               wx.hideLoading()
             })
+
         }
 
       }
     })
   },
+  loadOcr(path,url){
+    var _this = this
+
+    wx.getImageInfo({
+      src:path,
+      success:function(ires){
+        _this.loadImageOcr(url,ires.width < ires.height ? 'phone':'pc')
+      }
+    })
+  },
+
+  loadImageOcr(img_url,source){
+    var _this = this
+    var param = {
+      img_url:img_url.split('?')[0],
+      source:source,
+    }
+    console.log('img_url',param['img_url'])
+    console.log('source',param['source'])
+    $api.imageOcr(param).then(res => {
+      console.log('ocr',res)
+      if(res.data.code == 0){
+        _this.setData({
+          today_fund:res.data.data.today,
+          stock:res.data.data.list
+        })
+      }
+    })
+  },
+
+  startOcr(e){
+    var index = e.target.dataset.index;
+    var img_url = this.data.today_stock_img[index]
+    
+    console.log('startocr',img_url)
+    this.loadImageOcr(img_url,this.data.images[index].width < this.data.images[index].height ? 'phone':'pc')
+  },
+
+  imageLoad: function(e) {
+    var width=e.detail.width; //获取图片真实宽度
+    var height=e.detail.height;
+    
+    var image=this.data.images;
+    //将图片的datadata-index作为image对象的key,然后存储图片的宽高值
+    image[e.target.dataset.index]={
+      width:width,
+      height:height,
+    }
+    this.setData({
+    images:image
+    })
+  },
+
   del1(e) {
     var i = e.target.dataset.id;
     var today_stock_img = this.data.today_stock_img;
@@ -222,145 +292,112 @@ Page({
     })
   },
   post(){
-    if (!this.data.need_fill) {
-      var stocks = []
-      var slist = this.data.stock
+    var stocks = []
+    var slist = this.data.stock
 
-      for(let i=0;i<slist.length;i++){
-        if(slist[i].name.length <= 0){
-          continue;
-        }
-
-        if(slist[i].fund > 5000){
-          wx.showToast({
-            icon: 'none',
-            title: '持仓金额单位为万'
-          })
-          return;
-          break;
-        }
-
-        stocks.push(slist[i])
+    for(let i=0;i<slist.length;i++){
+      if(slist[i].name.length <= 0){
+        continue;
       }
 
-      var parm = {
-        stock_date: this.data.stock_date,
-        today_stock: stocks,
-        is_markt: this.data.is_markt,
-        today_stock_img: this.data.today_stock_img,
-        today_fund: Number(this.data.today_fund),
-        id:this.data.id,
-        experience: this.data.experience
-      }
-      if (!parm.today_fund) {
+      if(slist[i].fund > 5000){
         wx.showToast({
           icon: 'none',
-          title: '请输入今日净资产'
+          title: '持仓金额单位为万'
         })
-        return
+        return;
       }
 
-      if (parm.today_fund >= 10000) {
-        wx.showToast({
-          icon: 'none',
-          title: '今日净资产单位为万'
-        })
-        return
-      }
+      stocks.push(slist[i])
+    }
 
-      // if (!parm.is_markt) {
-      //   // for (let i = 0; i < parm.today_stock.length;i++){
-      //   //   if (!parm.today_stock[i].name || !parm.today_stock[i].fund) {
-      //   //     wx.showToast({
-      //   //       icon: 'none',
-      //   //       title: '请选择股票并输入资金额'
-      //   //     })
-      //   //     return;
-      //   //     break;
-      //   //   }
-      //   // }
-
-      // } else {
-      //   parm.today_stock = []
-      // }
-
-      console.log(parm)
-      if (parm.today_stock_img.length <= 0) {
-        wx.showToast({
-          icon: 'none',
-          title: '请上传截图'
-        })
-        return
-      }
-      wx.showLoading({
-        title: '正在提交',
-      })
-      this.setData({
-        disable: true
-      })
-      $api.updateRecord(parm).then(res => {
-        wx.hideLoading()
-        wx.showToast({
-          title: '提交成功',
-        })
-        this.setData({
-          freshen: true,
-          disable: false
-        })
-        setTimeout(() => {
-          this.setData({
-            stock: [{ label: '', name: '', code: '', fund: '' }],
-            stockList: [],
-            today_stock_img: [],
-            value: [-1],
-            is_markt: 0,
-            today_fund: ''
-            
-          })
-          wx.switchTab({
-            url: '../user/user',
-          })
-        }, 200)
+    var parm = {
+      stock_date: this.data.stock_date,
+      today_stock: stocks,
+      is_markt: this.data.is_markt,
+      today_stock_img: this.data.today_stock_img,
+      today_fund: Number(this.data.today_fund),
+      id:this.data.id,
+      experience: this.data.experience
+    }
+
+    if (!parm.today_fund) {
+      wx.showToast({
+        icon: 'none',
+        title: '请输入今日净资产'
       })
-      .catch(
-        this.setData({
-          disable:false
-        })
-      )
-    }else{
-      this.setData({
-        show:1
+      return
+    }
+
+    if (parm.today_fund >= 10000) {
+      wx.showToast({
+        icon: 'none',
+        title: '今日净资产单位为万'
       })
+      return
     }
 
-    
-  },
-  fundchange(e) {
-    this.setData({
-      init_fund: e.detail.value
-    })
-  },
-  save() {
-    if (!this.data.init_fund) {
+    // if (!parm.is_markt) {
+    //   // for (let i = 0; i < parm.today_stock.length;i++){
+    //   //   if (!parm.today_stock[i].name || !parm.today_stock[i].fund) {
+    //   //     wx.showToast({
+    //   //       icon: 'none',
+    //   //       title: '请选择股票并输入资金额'
+    //   //     })
+    //   //     return;
+    //   //     break;
+    //   //   }
+    //   // }
+
+    // } else {
+    //   parm.today_stock = []
+    // }
+
+    console.log(parm)
+    if (parm.today_stock_img.length <= 0) {
       wx.showToast({
         icon: 'none',
-        title: '请输入初始资金',
+        title: '请上传截图'
       })
-      return;
+      return
     }
-    $api.initfund({ init_fund: this.data.init_fund }).then(res => {
+    wx.showLoading({
+      title: '正在提交',
+    })
+    this.setData({
+      disable: true
+    })
+    $api.updateRecord(parm).then(res => {
+      wx.hideLoading()
       wx.showToast({
         title: '提交成功',
       })
       this.setData({
-        show: 0,
-        need_fill:0,
-        init_fund:''
+        freshen: true,
+        disable: false
       })
-      // this.getUserData()
+      setTimeout(() => {
+        this.setData({
+          stock: [{ label: '', name: '', code: '', fund: '' }],
+          stockList: [],
+          today_stock_img: [],
+          value: [-1],
+          is_markt: 0,
+          today_fund: ''
+          
+        })
+        wx.switchTab({
+          url: '../user/user',
+        })
+      }, 200)
     })
-
+    .catch(
+      this.setData({
+        disable:false
+      })
+    )    
   },
+  
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 1 - 1
pages/upload/upload.json

@@ -1,3 +1,3 @@
 {
-  "navigationBarTitleText": "上传"
+  "navigationBarTitleText": "交作业"
 }

+ 42 - 47
pages/upload/upload.wxml

@@ -1,19 +1,42 @@
 <form bindtap="blur">
-    <view class="label" >持仓日期   {{stock_date}}</view>
-    <view class="note">交作业时间:15:00-15:30</view>
-    <navigator wx:if="{{role == 2}}" class="change" url="../change/change">今日有出入金?必须先点此处申报</navigator>
-    <view class="label">今日总资产<text class="note">(单位:万)</text>  </view>
+    <view class="label" >持仓日期 {{stock_date}}<text class="note">交作业时间:15:00-15:30</text></view>
+    
+    <navigator wx:if="{{role == 2}}" class="change" url="../change/change">今日有银证转帐?先在此申报,再来交作业</navigator>
+    <view class="label">账户截图<text class="note">必须包括:总资产-股票名-持股金额,<text style='color:#E90001;font-size: 22rpx'>禁止打码</text>,买卖点截图也欢迎提交</text></view>
+    <view wx:for='{{today_stock_img}}' class="stock_imgs">
+        <image  src="{{item}}" bindtap="prview" data-src="{{item}}" bindload="imageLoad" data-index="{{ index }}"></image>
+        <view class="edit">
+            <!-- <text>识别</text> -->
+            <text data-index="{{index}}" bind:tap="startOcr">识别</text>
+        </view>
+        <!-- <icon bindtap="del1" data-id='{{index}}' class="icon-small" type="cancel" size="25" style="margin-top: 0rpx;"></icon> -->
+        <view class="delete">
+          <image mode="aspectFit" style="display:inline-block;margin-top: 10rpx;width: 50rpx;height: 50rpx;" src="../../images/shanchu.png" bind:tap="del1"></image>
+        </view>
+        
+    </view>
+    <view  class="upload" bindtap="uploadImg">
+          <image mode="widthFix" src="../../images/img.png"></image>
+            上传图片
+    </view>
+    <view>
+    <text style="color:rgb(88, 88, 88);font-size:24rpx">注意:识别有误请手动修改,用手机同花顺或券商app截图,可提高准确率,默认识别第一张图</text>
+    </view>
+    <view class="label">今日总资产<text class="note">融资账户填净资产</text>  </view>
+    <view class="info">
     <input type='digit' value="{{today_fund}}" bindinput="fundChange1" placeholder="请输入总资产"></input>
-    <text style="color:red;font-weight:500">万</text>
-    <text style="color:rgb(128, 128, 128);font-size:24rpx">注意:1.融资账户填净资产 2.今日若有银证转账,请先去上面一栏进行申报除权,再来这里填资金进出后的总资产</text>
+    <text style="color:#E90001;font-size: 34rpx;">万</text>
+    <icon bindtap="delToday" style="margin-top:25rpx; margin-left: 10rpx;" class="icon-small" type="cancel" size="20"></icon>
+    </view>
+
     <!-- <block wx:if='{{!is_markt}}'> -->
-    <view class="label">今日持股<text class="note">(空仓请留空不填)</text></view>
+    <view class="label">今日持股<text class="note">空仓不填即可</text></view>
     <view class="info" wx:for='{{stock}}' >
       <input bindinput='stockSearch'   data-id='{{index}}'  value="{{item.name}}" placeholder="股票名称"></input>
       <input type='digit' bindinput="fundChange" data-id='{{index}}' value="{{item.fund}}" placeholder="持股金额"></input>
-      <text style="color:red;font-weight:500">万</text>    
+      <text style="color:#E90001;font-size: 34rpx;">万</text>    
       <view  style="width:17%;">
-        <icon bindtap="del" data-id='{{index}}' style="margin-top:20rpx;" class="icon-small" type="cancel" size="25"></icon>
+        <icon bindtap="del" data-id='{{index}}' style="margin-top:25rpx; margin-left: 10rpx;" class="icon-small" type="cancel" size="20"></icon>
       </view>
       
       <view class="stock_list" wx:if='{{stockList.length>0 && cur==index}}'>
@@ -22,50 +45,22 @@
     </view>
     <view bindtap="add" class="add"> + 添加持股</view>
     <!-- </block> -->
-    <view class="openmarket">  
-        开超市<text class="note">(持股超5支可选)</text>  
-        <switch color='#D94B24' checked="{{is_markt}}" bindchange="switch1Change" />
-    </view>
-    <view class="label">账户截图<text class="note">(需包括:净资产-股票名-持股金额,<text style='color:red;font-size: 22rpx'>请屏蔽</text>账户-开户名-股东代码等个人信息,分时买卖点截图也可选填)</text></view>
-    <view wx:for='{{today_stock_img}}' class="stock_imgs">
-        <image  src="{{item}}" bindtap="prview" data-src="{{item}}"></image>
-        <view class="edit">
-            <!-- <text>识别</text> -->
-            <text bindtap="del1" data-id='{{index}}'>删除</text>
-        </view>
-        <!-- <icon bindtap="del1" data-id='{{index}}' class="icon-small" type="cancel" size="25"></icon> -->
-    </view>
-    <view  class="upload" bindtap="uploadImg">
-          <image mode="widthFix" src="../../images/img.png"></image>
-            上传图片
-    </view>
-    <view class="label">今日反思</view>
-    <textarea value="{{experience}}" bindinput="expChange" placeholder='请填写'></textarea>
+    
+    <view class="label">交易日记<text class="note">记录成长点滴</text></view>
+    <textarea value="{{experience}}" bindinput="expChange" placeholder='记录...'></textarea>
     <view class="tips">
 
         <text>交作业须知:</text>
-        <text>1、今日有银证转账请先申报除权再交作业,单位是万!</text>
-        <text>2、为方便学习交流,选手每日持仓图系统内公开可见。</text>
-        <text>3、持仓图需包含总资产-持股名称-持股金额。</text>
-        <text>4、有特殊情况可不公布持股金额,但持股名称必须有。</text>
-        <text>5、连续3天未交作业,无特殊原因将被视为退赛。</text>
-        <text>6、重新归赛请联系顽主,并提交请假期间的银证转账记录。</text>
-        <text>7、数据提交有误可直接修改,再点击上传。</text>
+        <text>1、比赛期间银证转帐不能超过五次,每次须在系统申报。</text>
+        <text>2、被观众反应成绩异常的选手,比赛将提前验证帐户。</text>
+        <text>3、连续3天未交作业,无特殊原因将被视为退赛。</text>
+        <text>4、重新归赛请联系我们,提交请假期间的银证转账记录。</text>
+        <text>5、数据提交有误可直接修改,再点击上传。</text>
     </view>
     
-    <button wx:if="{{role == 2}}" disabled='{{disable}}'  bindtap="post">上传</button>
+    <button wx:if="{{role == 2}}" disabled='{{disable}}'  bindtap="post">提交</button>
     <!-- <button wx:else disabled>上传</button> -->
     
     <!-- <button wx:if='{{!change}}' disable='{{disable}}' bindtap="post">上传</button>
     <button wx:else  bindtap="post" disable='{{disable}}'>修改</button> -->
-</form>
-
-
-<view class="modal" wx:if='{{show}}'>
-  <view class="fund_modal">
-    <view>请先输入初始资金</view>
-    <input type='digit' bindinput="fundchange"></input>
-    <text>W</text>
-    <button bindtap="save">确定</button>
-  </view>
-</view>
+</form>

+ 21 - 17
pages/upload/upload.wxss

@@ -3,9 +3,9 @@ page{
   padding:0 32rpx 32rpx;
 }
 .label{
-  font-size: 28rpx;
+  font-size: 30rpx;
   font-weight: 500;
-  margin: 32rpx 0 16rpx;
+  margin: 32rpx 0 20rpx;
 }
 input,.picker,textarea{
   height: 88rpx;
@@ -13,7 +13,7 @@ input,.picker,textarea{
   border-radius: 8rpx;
   padding: 0 20rpx;
   font-size: 28rpx;
-  width: 87%;
+  width: 79%;
   border: 1px solid #E0E0E0;
   display: inline-block;
   vertical-align: middle;
@@ -78,19 +78,19 @@ picker{
 }
 .tips text{
   display: block;
-  color: #666;
+  color: #000000;
   font-size: 24rpx;
   line-height: 40rpx;
 }
 
 .change{
   /* background: #D94B24; */
-  color: #D94B24;
+  color: #E90001;
   /* width: 90%; */
   /* height: 88rpx; */
   /* line-height: 88rpx; */
   /* padding: 0; */
-  font-size: 28rpx;
+  font-size: 30rpx;
   /* border-radius: 8rpx; */
   /* margin-top: 50rpx; */
   /* text-align: center; */
@@ -115,13 +115,11 @@ form button:not([size='mini']){
   margin-bottom: 10rpx;
   z-index: 999;
 }
-.upload{
-  width: 220rpx;
-}
 .note{
-  font-size:22rpx;
+  font-size:24rpx;
   padding:10rpx 0rpx;
-  color:#999;
+  color:rgb(128, 128, 128);
+  margin-left: 10rpx;
 }
 .upload{
   width: 240rpx;
@@ -145,8 +143,8 @@ form button:not([size='mini']){
   height:240rpx;
   vertical-align: top;
   position: relative;
-  margin-right: 10rpx;
-  margin-bottom: 10rpx;
+  margin-right: 20rpx;
+  margin-bottom: 20rpx;
 }
 .stock_imgs icon{
   position: absolute;
@@ -155,24 +153,30 @@ form button:not([size='mini']){
 }
 .stock_imgs image{
   border-radius: 8rpx;
-  width:240rpx;height:240rpx;
+  width:240rpx;
+  height:240rpx;
+}
+.delete{
+  position: absolute;
+  right: -15rpx;
+  top: -30rpx;
 }
 .edit{
   text-align: center;
   position: absolute;
-  bottom: 2px;
+  bottom: 10rpx;
   left: 0;
   width: 100%;
 }
 .edit text{
   display: inline-block;
   color: #fff;
-  background: #D94B24;
+  background: #E90001;
   border-radius: 32rpx;
   width: 100rpx;
   line-height: 48rpx;
   text-align: center;
-  font-size: 28rpx;
+  font-size: 20rpx;
   margin: 0 2px;
 }
 .stock_list{

+ 18 - 4
pages/user/user.js

@@ -2,6 +2,8 @@
 const app = getApp()
 var host = app.globalData.host;
 const $api = require('../../utils/api.js').API;
+const $push = require('../../utils/api.js').PUSH;
+
 Page({
 
   /**
@@ -26,9 +28,18 @@ Page({
 
   getUserData() {
     $api.getAuthinfo().then(res=>{
-      this.setData({
-        userinfo: res.data.data,
-      })
+      if(res.data.code == 0){
+        this.setData({
+          userinfo: res.data.data,
+        })
+  
+        wx.setStorage({
+          key: 'user',
+          data: res.data.data,
+        })
+      }
+      
+
     })
     .catch(err=>{
       this.setData({
@@ -74,6 +85,9 @@ Page({
     })
   },
  
+  pushToday(e){
+    $push.pushToday(e.currentTarget.dataset)
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
@@ -87,7 +101,7 @@ Page({
   onShow: function () {
     this.getUserData()
     this.getTodayData()
-
+    $api.initUser()
   },
 
   /**

+ 2 - 2
pages/user/user.wxml

@@ -10,7 +10,7 @@
         <navigator  url="../homepage/homepage?user_id={{userinfo.id}}&type=1" class="mine">我的主页</navigator>
       </view>
       <view  wx:if='{{todayinfo.today_fund}}' class="today">
-      <navigator hover-class="none"  url="../today/today?id={{todayinfo.match_id}}&record_id={{todayinfo.id}}&user_id={{todayinfo.user_id}}">
+      <navigator hover-class="none" bind:tap="pushToday" data-match_id="{{todayinfo.match_id}}" data-record_id="{{todayinfo.id}}" data-user_id = "{{todayinfo.user_id}}">
       
       <view class="money">
         <text class="{{todayinfo.today_income_fund < 0 ?'down':'up'}}">{{todayinfo.today_income_fund}}  </text>
@@ -26,7 +26,7 @@
         <text >总收益 <text class="{{todayinfo.total_income[0]=='-' ?'down':'up'}}"> {{todayinfo.total_income}}</text></text>
       </view>
       </navigator>
-      <navigator class="msg"  hover-class="none"  url="../today/today?id={{todayinfo.match_id}}&record_id={{todayinfo.id}}&user_id={{todayinfo.user_id}}">
+      <navigator class="msg"  hover-class="none"  bind:tap="pushToday" data-match_id="{{todayinfo.match_id}}" data-record_id="{{todayinfo.id}}" data-user_id = "{{todayinfo.user_id}}">
         <view ><image mode="widthFix" src="../../images/msg.png"></image>{{todayinfo.comments_count}}</view>
         <view><image mode="widthFix" src="../../images/zan.png"></image>{{todayinfo.zan_count}}</view>
       </navigator>

+ 4 - 0
pages/winlost/winlost.js

@@ -1,6 +1,7 @@
 // pages/winlost/winlost.js
 const app = getApp()
 const $api = require('../../utils/api.js').API;
+const $push = require('../../utils/api.js').PUSH;
 Page({
 
   /**
@@ -21,6 +22,9 @@ Page({
     })
   },
 
+  pushToday(e){
+    $push.pushToday(e.currentTarget.dataset)
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 4 - 4
pages/winlost/winlost.wxml

@@ -7,7 +7,7 @@
     <view class="content-list">
       <view class="up-down">
         <text>盈利榜</text>
-        <navigator wx:for="{{list.total_income_up}}"   hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+        <navigator wx:for="{{list.total_income_up}}"   hover-class="none"  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
             <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
             <text wx:else class="number">{{index+1}}</text>
             <image class="avatar"   src="{{filters.defaultImg(item.avatar)}}"></image>
@@ -17,7 +17,7 @@
       </view>
       <view class="up-down">
         <text>赚钱榜</text>
-        <navigator wx:for="{{list.total_win_up}}" hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+        <navigator wx:for="{{list.total_win_up}}" hover-class="none"  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
             <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
             <text wx:else class="number">{{index+1}}</text>
             <image class="avatar"  src="{{filters.defaultImg(item.avatar)}}"></image>
@@ -27,7 +27,7 @@
       </view>
       <view class="up-down">
         <text>亏损榜</text>
-        <navigator wx:for="{{list.total_income_down}}" hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+        <navigator wx:for="{{list.total_income_down}}" hover-class="none"  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
             <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
             <text wx:else class="number">{{index+1}}</text>
             <image class="avatar"   src="{{filters.defaultImg(item.avatar)}}"></image>
@@ -37,7 +37,7 @@
       </view>
       <view class="up-down">
         <text>亏钱榜</text>
-        <navigator wx:for="{{list.total_win_down}}" hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+        <navigator wx:for="{{list.total_win_down}}" hover-class="none"  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
             <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
             <text wx:else class="number">{{index+1}}</text>
             <image class="avatar"   src="{{filters.defaultImg(item.avatar)}}"></image>

+ 44 - 5
utils/api.js

@@ -37,8 +37,11 @@ function request(method, url, data) {
               //未登录
               reject(403)
               if (url.indexOf('authinfo')>=0){
-                wx.switchTab({
-                  url: '../user/user',
+                // wx.switchTab({
+                //   url: '../user/user',
+                // })
+                wx.navigateTo({
+                  url: '../login/user?type=0',
                 })
               }
             }else{
@@ -99,6 +102,36 @@ function uploadFile(url, filePath, name, formData, isSubDomain) {
   })
 }
 
+function pushToday(e){
+  wx.getStorage({
+    key: 'user',
+    complete: res => {
+      if (res.data.role == 0) {
+        wx.navigateTo({
+          url: '../login/user?type=3',
+        })
+      } else{
+        wx.navigateTo({
+          url: '../today/today?id=' + e.match_id + '&record_id=' + e.record_id + '&user_id=' + e.user_id,
+        })
+      }
+    }
+  })
+  
+}
+
+function initUser(){
+  API.getAuthinfo().then(res=>{
+    console.log(res.data.data,'user')
+    if(res.data.code==0){
+      wx.setStorage({
+        key: 'user',
+        data: res.data.data,
+      })
+    }
+  })
+}
+
 const API = {
   getOpenid: (data) => request(GET, `/api/wx/openid`, data),
   login: (data) => request(POST, `/api/wx/v3/login`, data),
@@ -173,8 +206,14 @@ const API = {
   getNbcomments: (data) => request(GET, `/api/wx/v3/stock/nbcomments/list`, data),
   getStockNbcomments: (data) => request(GET, `/api/wx/v3/stock/comments/list`, data),
   getWinLose: (data) => request(GET, `/api/wx/v3/match/group/winlose/statistic`, data),
- 
-}; 
+  imageOcr: (data) => request(POST, `/api/wx/v3/ai/ocr`, data),
+  initUser:() => initUser(),
+};
+
+const PUSH = {
+  pushToday:(data) => pushToday(data),
+};
 module.exports = {
-  API: API
+  API: API,
+  PUSH: PUSH,
 }