tanyanfei 1 rok pred
rodič
commit
3db5a5e8eb
4 zmenil súbory, kde vykonal 56 pridanie a 11 odobranie
  1. 7 7
      pages/login/user.js
  2. 14 2
      pages/today/today.js
  3. 9 2
      pages/today/today.wxml
  4. 26 0
      pages/today/today.wxss

+ 7 - 7
pages/login/user.js

@@ -132,13 +132,13 @@ Page({
   },
 
   register(e){
-    if(this.data.avatarUrl == defaultAvatarUrl){
-      wx.showToast({
-        icon: 'none',
-        title: '请选择头像',
-      })
-      return
-    }
+    // if(this.data.avatarUrl == defaultAvatarUrl){
+    //   wx.showToast({
+    //     icon: 'none',
+    //     title: '请选择头像',
+    //   })
+    //   return
+    // }
 
     if(this.data.nickName == ''){
       wx.showToast({

+ 14 - 2
pages/today/today.js

@@ -132,6 +132,9 @@ Page({
       })
       records = res.data.data.records
       today_stock = res.data.data.today_record.today_stock
+      this.setData({
+        today_stock:today_stock
+      })
       this.getDays()
       this.getzan()
       this.getComment()
@@ -418,6 +421,11 @@ function initChart1(canvas, width, height, dpr) {
       show: true,
       orient: 'vertical',
       right: '1%',
+      itemWidth:10,
+      itemHeight:10,
+      textStyle:{
+        fontSize:12
+      },
       formatter: function (name){
         var index = 0;
         today_stock.forEach(function (value, i) {
@@ -425,9 +433,13 @@ function initChart1(canvas, width, height, dpr) {
             index = i;
           }
         });
-        return name + "  " + today_stock[index].value;
+        return name;
+        // + "  " + today_stock[index].value+ "  " + today_stock[index].money
       }
     },
+    grid:{
+      // right:'10%'
+    },
     series: [{
       label: {
         
@@ -440,7 +452,7 @@ function initChart1(canvas, width, height, dpr) {
         }
       },
       type: 'pie',
-      center: ['37%', '40%'],
+      center: ['38%', '40%'],
       radius: ['0%', radius],
       data: today_stock
       

+ 9 - 2
pages/today/today.wxml

@@ -44,10 +44,16 @@
 </view>
 
 <view class="page_top">
-  <view wx:if='{{datas.today_record.today_stock.length>0&&datas.today_record.today_stock.length<9}}' class="container" style="height:400rpx;">
+  <view class="totay_title">
+        <view class="totay_title_1"><text>持仓(万)</text> <text>  盈亏(万)</text></view>
+        <view wx:for="{{today_stock}}" class="totay_title_item">
+          <text>{{item.fund}}</text><text class="{{item.money[0]=='-' ?'down':'up'}}">{{item.money}}</text>
+        </view>
+    </view>
+  <view wx:if='{{datas.today_record.today_stock.length>0&&datas.today_record.today_stock.length<9}}' class="container" style="height:400rpx;width: 80%;">
     <ec-canvas id="mychart-dom-pie" canvas-id="mychart-pie" ec="{{ ec1 }}"></ec-canvas>
   </view>
-  <view wx:if='{{datas.today_record.today_stock.length>8}}' class="container" style="height:550rpx;">
+  <view wx:if='{{datas.today_record.today_stock.length>8}}' class="container" style="height:550rpx;width: 80%;">
     <ec-canvas id="mychart-dom-pie" canvas-id="mychart-pie" ec="{{ ec1 }}"></ec-canvas>
   </view>
 </view>
@@ -70,6 +76,7 @@
 </view>
 
 <view class="content">
+
     <view class="container" wx:if='{{datas.records.length>1}}'>
           <ec-canvas   ec="{{ ec }}">
           </ec-canvas>

+ 26 - 0
pages/today/today.wxss

@@ -18,6 +18,7 @@ page{
   height: 50vh;
   background: #fff;
   z-index: 9;
+  margin-top: 40rpx;
 } 
 
 ec-canvas {
@@ -478,4 +479,29 @@ picker{
     100% {
       transform: scale(1,1);
     }
+}
+
+
+.totay_title{
+  text-align: right;
+  position: absolute;
+  top: -49rpx;
+  right: 0;
+  padding-right: 10rpx;
+}
+.totay_title text{
+  display: inline-block;
+  font-size: 20rpx;
+  color: #999;
+  /* padding-right: 15rpx; */
+  /* width: 47%; */
+}
+.totay_title_1 text{
+  font-size: 20rpx;
+  padding-left: 4rpx;
+}
+.totay_title_item text{
+  width: 70rpx;
+  text-align: left;
+  margin-bottom: 7rpx;
 }