瀏覽代碼

返回json大小写

pzc 4 年之前
父節點
當前提交
86a2a8236a
共有 2 個文件被更改,包括 22 次插入21 次删除
  1. 16 16
      src/views/doctor/MyProfit/MyProfitIndex.vue
  2. 6 5
      src/views/doctor/MyProfit/subordinateMyProfitIndex.vue

+ 16 - 16
src/views/doctor/MyProfit/MyProfitIndex.vue

@@ -66,16 +66,16 @@
           <div class="rec_body">
             <ul>
               <li v-for="(item, index) in UserData.recentProfitList" :key="index" v-if="index<5"
-                @click="jumpToDetail(item.ID, item.Type)">
-                <img :src="item.SceneIcon" />
+                @click="jumpToDetail(item.id, item.type)">
+                <img :src="item.sceneIcon" />
                 <div>
-                  <p>{{ typeTips[item.Type] }}</p>
-                  <p>{{ item.OrderCode }}</p>
-                  <p>{{ item.CreateTime |compatibleDate}}</p>
+                  <p>{{ typeTips[item.type] }}</p>
+                  <p>{{ item.orderCode }}</p>
+                  <p>{{ item.createTime |compatibleDate}}</p>
                 </div>
                 <div>
-                  <p class="price_red">+{{ item.Price | getPrice }}</p>
-                  <p>{{ statusTips[item.Status] }}</p>
+                  <p class="price_red">+{{ item.price | getPrice }}</p>
+                  <p>{{ statusTips[item.status] }}</p>
                 </div>
               </li>
             </ul>
@@ -401,7 +401,7 @@
         this.onshow = show;
       },
       getPrice(val) {
-        let valout = isNaN(val) || val ==0 ? 0: (val / 100).toFixed(2);
+        let valout = isNaN(val)|| Number(val) || val ==0 ? 0: (val / 100).toFixed(2);
         return valout;
       },
       getCaption(obj) {
@@ -478,13 +478,13 @@
           console.log(res);
           this.$toast.clear();
           this.UserData = {
-            cumulativePrice: "",
-            withdrawablePrice: "",
-            toBeRecordedPrice: "",
-            withdrawingPrice: "",
+            cumulativePrice: 0,
+            withdrawablePrice: 0,
+            toBeRecordedPrice: 0,
+            withdrawingPrice: 0,
             recentProfitList: []
           };
-          if (res.data.success==1) {
+          if (res.data.success) {
             let sum = 0;
             this.UserData = res.data.result;
             res.data.result.dailyProfitList.forEach((item, index) => {
@@ -498,7 +498,7 @@
           } else {
             this.$toast(res.data.message);
           }
-          console.log(this.UserData);
+          // console.log(this.UserData);
         });
       },
       //过滤时间选取月份
@@ -524,11 +524,11 @@
         // })[0].TotalProfitPrice;
         var maxi = 0;
         for (var i = 0; i < arr.length; i++) {
-          if (arr[maxi].TotalProfitPrice <= arr[i].TotalProfitPrice) {
+          if (arr[maxi].totalProfitPrice <= arr[i].totalProfitPrice) {
             maxi = i;
           }
         }
-        return this.getPrice(arr[maxi].TotalProfitPrice + 10000);
+        return this.getPrice(arr[maxi].totalProfitPrice + 10000);
         // console.log(max);
         // arr.map((i,item)=>{
         //   if(item.TotalProfitPrice<)

+ 6 - 5
src/views/doctor/MyProfit/subordinateMyProfitIndex.vue

@@ -398,7 +398,8 @@ export default {
       this.onshow = show;
     },
     getPrice(val) {
-      return (val / 100).toFixed(2);
+      let valout = isNaN(val)|| Number(val) || val ==0 ? 0: (val / 100).toFixed(2);
+      return valout;
     },
     getCaption(obj) {
       var index = obj.lastIndexOf("年");
@@ -477,10 +478,10 @@ export default {
         console.log(res);
         this.$toast.clear();
         this.UserData = {
-          cumulativePrice: "",    // 累计收益
-          withdrawablePrice: "",
-          toBeRecordedPrice: "",
-          withdrawingPrice: "",
+          cumulativePrice: 0,    // 累计收益
+          withdrawablePrice: 0,
+          toBeRecordedPrice: 0,
+          withdrawingPrice: 0,
           recentProfitList: []    // 近期利润列表
         };
         if (res.data.success) {