Explorar el Código

出入资金优化

begmoon hace 2 años
padre
commit
63bf8bcda6

+ 1 - 1
pages/apply/apply.wxml

@@ -44,7 +44,7 @@
         </view>
         <view class="title title1">6、退赛</view>
         <view class="date">
-          <text>参一周内申请退赛可退报名费,比赛系统帐户收回</text>
+          <text>参一周内申请退赛可退报名费,比赛系统帐户收回</text>
         </view>
 
         

+ 76 - 1
pages/change/change.js

@@ -7,7 +7,12 @@ Page({
      * 页面的初始数据
      */
     data: {
-        today_stock_img:''
+        today_stock_img:'',
+        init_fund:'',
+        yesterday_fund:'',
+        today_fund:'',
+        today_income:'',
+        total_income:'',
     },
 
     /**
@@ -61,6 +66,12 @@ Page({
           urls: [src] // 需要预览的图片http链接列表
         })
       },
+      todaychange(e){
+        this.setData({
+          today_fund: e.detail.value
+        })
+      },
+
       outchange(e){
         this.setData({
           out_fund: e.detail.value
@@ -71,6 +82,54 @@ Page({
           in_fund: e.detail.value
         })
       },
+      trypost(){
+        var data={
+          today_fund:this.data.today_fund,
+          out_fund:this.data.out_fund,
+          in_fund:this.data.in_fund,
+          account_img:this.data.today_stock_img,
+          trycalc:1
+        }
+        if (!data.today_fund){
+          wx.showToast({
+            icon: 'none',
+            title: '请输入今日净资产'
+          })
+          return
+        }
+
+        if (!data.out_fund && !data.in_fund){
+          wx.showToast({
+            icon: 'none',
+            title: '请输入今转出资金或今转入资金'
+          })
+          return
+        }
+   
+        if (!data.account_img){
+          wx.showToast({
+            icon: 'none',
+            title: '请上传账户截图'
+          })
+          return
+        }
+        
+        $api.update(data).then(res=>{
+          if(res.data.code == 0){
+              this.setData({
+                init_fund:res.data.data.init_fund,
+                yesterday_fund:res.data.data.yesterday_fund,
+                total_income:res.data.data.total_income,
+                today_income:res.data.data.today_income
+              })
+          }else{
+            wx.showToast({
+              title: '提交失败',
+            })
+          }
+        })
+      },
+
       post(){
         var data={
           out_fund:this.data.out_fund,
@@ -84,12 +143,28 @@ Page({
           })
           return
         }
+
+        if (!data.account_img){
+          wx.showToast({
+            icon: 'none',
+            title: '请上传账户截图'
+          })
+          return
+        }
    
         $api.update(data).then(res=>{
           if(res.data.code == 0){
             wx.showToast({
               title: '提交成功',
+              success:function(){
+                setTimeout(() => {
+                  wx.navigateBack({
+                    delta: 0,
+                  })
+                }, 1500);
+              }
             })
+            
           }else{
             wx.showToast({
               title: '提交失败',

+ 58 - 6
pages/change/change.wxml

@@ -1,12 +1,18 @@
 <view class="item">
+    <label>今日净资产</label>
+    <input bindinput="todaychange" type='digit' placeholder-style="color:rgba(203, 203, 203, 1)"  placeholder="请填写"/>
+    <text class="note">(单位:万)</text>
+</view>
+
+<view class="item">
     <label>今转出资金</label>
     <input bindinput="outchange" type='digit' placeholder-style="color:rgba(203, 203, 203, 1)"  placeholder="请填写"/>
-    <text>万 <text>(单位)</text></text>
+    <text class="note">(单位:万)</text>
 </view>
 <view class="item">
     <label>今转入资金</label>
     <input bindinput="inchange" type='digit' placeholder-style="color:rgba(203, 203, 203, 1)"   placeholder="请填写"/>
-    <text>万 <text>(单位)</text></text>
+    <text class="note">(单位:万)</text>
 </view>
 <view class="item">
     <label>账户截图</label>
@@ -21,8 +27,54 @@
             上传图片
     </view>
 </view>
-<view class="item">
-    <label>规则</label>
-    <text style="margin: 0;">入金比赛成绩稀释,出金保持成绩不变</text>
+<button bindtap="trypost">确认除权后的成绩</button>
+
+<view wx:if="{{init_fund}}">
+  <view class="item1">除权后的结果</view>
+  <view class="item">
+      <label>初始资金</label>
+      <text style="margin: 0;">{{init_fund}} 万</text>
+  </view>
+
+  <view class="item">
+      <label>昨日净资产</label>
+      <text style="margin: 0;">{{yesterday_fund}} 万</text>
+  </view>
+
+  <view class="item">
+      <label>今日净资产</label>
+      <text style="margin: 0;">{{today_fund}} 万 今日收益 {{today_income}}</text>
+  </view>
+
+  <view class="item">
+      <label>总收益</label>
+      <text style="margin: 0;">{{total_income}} </text>
+  </view>
+
+  <view class="item2">
+    发现错误, 先不提交, 看今日净资产, 出入资金和昨天提交的数据是否正确, 不清楚<navigator url="../message/message"><text class="change" >咨询顽主</text></navigator>
+  </view>
+
+  <button bindtap="post">确认无误-提交</button>
+
+</view>
+
+<view class="item2">
+      <text style="margin: 0;">除权规则:入金比赛成绩稀释,出金保持成绩不变</text>
+</view>
+
+<view class="item2">出金计算方法</view>
+<view class="item1">
+      <text style="margin: 0;">今日收益:(今日净资产+出金-昨日净资产)/ 昨日净资产
+总收益:(今日净资产+出金-初始资金)/ 初始资金
+复权后的初始资产:今日净资产/(1+总收益)
+复权后的昨日资产:今日净资产/(1+今日收益)</text>
+</view>
+
+<view class="item2">入金计算方法</view>
+<view class="item1">
+      <text style="margin: 0;">今日收益:(今日净资产-入金-昨日净资产)/ 昨日净资产+入金
+总收益:(今日净资产-入金-初始资金)/ 初始资金+入金
+复权后的初始资产:初始资金+入金
+复权后的昨日资产:昨日净资金+入金</text>
 </view>
-<button bindtap="post">提交</button>

+ 23 - 5
pages/change/change.wxss

@@ -24,12 +24,10 @@ page{
 .item>text{
     font-size: 30rpx;
     line-height: 88rpx;
-    color: #333;
+    color: #D94B24;
     margin-left: 20rpx;
 }
-.item>text text{
-    color: rgba(153, 153, 153, 1);
-}
+
 .upload{
     width: 240rpx;
     height: 240rpx;
@@ -93,4 +91,24 @@ page{
     border-radius: 8rpx;
     margin-top: 50rpx;
     font-weight: 400;
-  }
+  }
+
+  .change{
+    color: #D94B24;
+    text-decoration: underline;
+    display: inline;
+  }
+
+  .item1{
+    margin-top: 30rpx;
+    font-size: 28rpx;
+    line-height: 60rpx;
+    color: #333;
+ }
+  
+ .item2{
+  margin-top: 40rpx;
+  font-size: 32rpx;
+  color: #333;
+ }
+ 

+ 4 - 3
pages/index/index.js

@@ -328,8 +328,9 @@ Page({
       }
     })
     
-    // if(this.data.followList.length<=0){
-    //   this.getFollow()
-    // }
+    if(this.data.followList.length<=0){
+      this.data.loading = 1
+      this.getFollow()
+    }
   },
 })

+ 3 - 0
pages/login/user.js

@@ -152,10 +152,13 @@ Page({
                   data: res.data.data,
                 })
                 //老用户直接进入系统
+              
                 if(res.data.data.role != 0){
                   wx.switchTab({
                     url: '../index/index',
                   })
+                  
+                  return;
                 }
                 //新用户选择报名
                 _this.setData({

+ 1 - 1
pages/rank/rank.wxml

@@ -8,7 +8,7 @@
   </picker>
   
 </view> -->
-<view  class="marquee_container">
+<view  class="marquee_container" wx:if="{{info.signup_status==0}}">
   <view class="zd"></view>
   <navigator hover-class="none" url="../apply/apply?type=2">
   <image src="../../images/lb.png" mode="widthFix" class="notice"></image>

+ 9 - 1
pages/style/style.js

@@ -176,7 +176,15 @@ Page({
       wx.hideLoading()
       wx.showToast({
         title: '保存成功',
-        icon:'success'
+        icon:'success',
+        success:function(){
+          setTimeout(() => {
+            wx.navigateBack({
+              delta: 0,
+            })
+          }, 1500);
+        }
+  
       })
     })
     .catch(err=>{

+ 5 - 5
pages/upload/upload.js

@@ -291,11 +291,11 @@ Page({
           })
         }, 200)
       })
-      .catch(err => {
-         this.setData({
-           disable:false
-         })
-      })
+      .catch(
+        this.setData({
+          disable:false
+        })
+      )
     }else{
       this.setData({
         show:1

+ 1 - 1
project.private.config.json

@@ -1,5 +1,5 @@
 {
-  "projectname": "wanzb_xcxv3",
+  "projectname": "xiaochengxu",
   "setting": {
     "compileHotReLoad": true
   },