Browse Source

first commit

liyongli 3 years ago
parent
commit
ae6f8fbb30

+ 21 - 9
miniprogram/pages/channelAdvertising/components/baohedu/F2.ts

@@ -10,10 +10,10 @@ namespace shiduan {
       if (chartCatch.toufangfenxiChart === undefined) return
       chartCatch.toufangfenxiChart.clear()
       let title = this.data.DayList.length ? `${this.data.DayList[0].dt}至${this.data.DayList[0].dt}` : "";
-      const data = this.data.DayList.map((v: any, i:number) => {
+      const data = this.data.DayList.map((v: any, i: number) => {
         v.type = title
         v.index = i
-        v.timeSize = v.timeSize *100
+        v.timeSize = v.timeSize * 100
         return v
       });
       if (chartCatch.toufangfenxiChart === undefined) return;
@@ -31,7 +31,7 @@ namespace shiduan {
           if (index === total - 1) align = 'right';
           return {
             textAlign: align,
-            text: data[Number(text)].hour
+            text: data[Number(text)].hour + '点'
           }
         }
       });
@@ -50,7 +50,7 @@ namespace shiduan {
           const { tooltip: { title } } = ev;
           let index = Number(title || 0);
           index < 0 ? index = 0 : "";
-          let nT = data[index].hour > 9 ? Number(data[index].hour) + 1 : '0' +( Number(data[index].hour ) + 1);
+          let nT = data[index].hour > 9 ? Number(data[index].hour) + 1 : '0' + (Number(data[index].hour) + 1);
           items[0].name = data[index].hour + '~' + nT;
           items[0].value = formmaterValueZhou(items[0].value, 2) + '%';
         }
@@ -67,10 +67,10 @@ namespace shiduan {
       config.height = sys.windowWidth / 16 * 9;
       chartCatch.toufangfenxiChart = new F2.Chart(config);
       let title = this.data.DayList.length ? `${this.data.DayList[0].dt}至${this.data.DayList[0].dt}` : "";
-      const data = this.data.DayList.map((v: any, i:number) => {
+      const data = this.data.DayList.map((v: any, i: number) => {
         v.type = title
         v.index = i
-        v.timeSize = v.timeSize *100
+        v.timeSize = v.timeSize * 100
         return v
       });
       if (chartCatch.toufangfenxiChart === undefined) return;
@@ -88,7 +88,7 @@ namespace shiduan {
           if (index === total - 1) align = 'right';
           return {
             textAlign: align,
-            text: data[Number(text)].hour
+            text: data[Number(text)].hour + '点'
           }
         }
       });
@@ -107,8 +107,10 @@ namespace shiduan {
           const { tooltip: { title } } = ev;
           let index = Number(title || 0);
           index < 0 ? index = 0 : "";
-          let nT = data[index].hour > 9 ? Number(data[index].hour) + 1 : '0' +( Number(data[index].hour ) + 1);
-          items[0].name = data[index].hour + '~' + nT;
+          let nT = data[index].hour > 9 ? Number(data[index].hour) + 1 : '0' + (Number(data[index].hour) + 1);
+          if (data[index].hour === '平均值') {
+            items[0].name = data[index].hour;
+          } else items[0].name = data[index].hour + '~' + nT;
           items[0].value = formmaterValueZhou(items[0].value, 2) + '%';
         }
       });
@@ -116,6 +118,16 @@ namespace shiduan {
         type: 'dodge',
         marginRatio: 0.05 // 设置分组间柱子的间距
       });
+      let linkey = data[data.length - 1].timeSize || 0
+      chartCatch.toufangfenxiChart.guide().line({
+        start: [ 'min', linkey ],
+        end: [ 'max', linkey ],
+        style: {
+          stroke: '#1b9ade',
+          lineWidth: 1,
+          lineCap: 'round'
+        }
+      });
       chartCatch.toufangfenxiChart.render();
       return chartCatch.toufangfenxiChart;
     }

+ 27 - 15
miniprogram/pages/channelAdvertising/components/hangyezhanbi/F2.ts

@@ -10,13 +10,13 @@ namespace hangyezhanbi {
       chartCatch.toufangfenxiChart.clear()
       let total = 0;
       let key = this.data.select[this.data.select_act].proportionType;
-      let data = this.data.DayList.map((v:any)=>{
+      let data = this.data.DayList.map((v: any) => {
         v.type = "1";
-      total += Number(v[key] || 0)
+        total += Number(v[key] || 0)
         return v
       });
-        data = data.map((v:any)=>{
-        v.p = Number(v[key]/total*100).toFixed(2)
+      data = data.map((v: any) => {
+        v.p = Number(v[key] / total * 100).toFixed(2)
         return v
       })
       if (chartCatch.toufangfenxiChart === undefined) return;
@@ -28,17 +28,23 @@ namespace hangyezhanbi {
       });
       chartCatch.toufangfenxiChart.legend({
         position: 'bottom',
-        align: 'center',
+        align: 'left',
+        nameStyle: {
+          fill: '#404040', // 文本的颜色
+          fontSize: 10, // 文本大小
+          textBaseline: 'middle', // 文本基准线,可取 top middle bottom,默认为middle
+          height: 10, // 设置文本的高度
+        },
         itemFormatter: function itemFormatter(val: string) {
-          let p :any= {};
+          let p: any = {};
           for (let i = 0; i < data.length; i++) {
             const v = data[i];
             if (v.industry === val) {
               p = v
               break
             }
-        }
-          return val + '  ' + p.p + "% ";
+          }
+          return val + '/' + p.p + "% ";
         }
       });
       chartCatch.toufangfenxiChart.axis(false);
@@ -82,13 +88,13 @@ namespace hangyezhanbi {
       chartCatch.toufangfenxiChart = new F2.Chart(config);
       let total = 0;
       let key = this.data.select[this.data.select_act].proportionType;
-      let data = this.data.DayList.map((v:any)=>{
+      let data = this.data.DayList.map((v: any) => {
         v.type = "1";
-      total += Number(v[key] || 0)
+        total += Number(v[key] || 0)
         return v
       });
-        data = data.map((v:any)=>{
-        v.p = Number(v[key]/total*100).toFixed(2)
+      data = data.map((v: any) => {
+        v.p = Number(v[key] / total * 100).toFixed(2)
         return v
       })
       if (chartCatch.toufangfenxiChart === undefined) return;
@@ -101,16 +107,22 @@ namespace hangyezhanbi {
       chartCatch.toufangfenxiChart.legend({
         position: 'bottom',
         align: 'center',
+        nameStyle: {
+          fill: '#404040', // 文本的颜色
+          fontSize: 10, // 文本大小
+          textBaseline: 'middle', // 文本基准线,可取 top middle bottom,默认为middle
+          height: 10, // 设置文本的高度
+        },
         itemFormatter: function itemFormatter(val: string) {
-          let p :any= {};
+          let p: any = {};
           for (let i = 0; i < data.length; i++) {
             const v = data[i];
             if (v.industry === val) {
               p = v
               break
             }
-        }
-          return val + '  ' + p.p + "% ";
+          }
+          return val + '/' + p.p + "% ";
         }
       });
       chartCatch.toufangfenxiChart.axis(false);

+ 26 - 8
miniprogram/pages/channelAdvertising/components/hangyezhanbi/index.ts

@@ -1,6 +1,5 @@
 // components/toufang/index.ts
 namespace hangyezhanbi{
-  const { line, upLine } = require("./F2");
   let { getRatio } = require('../../../../utils/api')
   let first = true;
   Component({
@@ -77,10 +76,19 @@ namespace hangyezhanbi{
             end: arrayItem.endDate,
             start: arrayItem.startDate
           }),
-        ]).then((res: adDay[]) => {
+        ]).then((res: adDay[][]) => {
+          let total = 0, key = this.data.select[this.data.select_act].proportionType
+          for (let i = 0; i < (res[0] || []).length; i++) {
+            const v:any = (res[0] || [])[i] || {};
+            total += Number(v[this.data.select[this.data.select_act].proportionType] || 0)
+          }
           this.setData({
-            DayList: res[0],
-            onInitChart: line.bind(this)
+            DayList: (res[0] || []).map((v: any) => {
+              v.p = Number(v[this.data.select[this.data.select_act].proportionType] / total * 100).toFixed(2)
+              return v
+            }).sort((a:any,b:any)=>{
+              return b[key] - a[key]
+            }),
           })
         })
       },
@@ -94,11 +102,21 @@ namespace hangyezhanbi{
             end: arrayItem.endDate,
             start: arrayItem.startDate
           }),
-        ]).then((res: adDay[]) => {
-          
+        ]).then((res: adDay[][]) => {
+          let total = 0, key = this.data.select[this.data.select_act].proportionType
+          for (let i = 0; i < (res[0] || []).length; i++) {
+            const v:any = (res[0] || [])[i] || {};
+            total += Number(v[this.data.select[this.data.select_act].proportionType] || 0)
+          }
           this.setData({
-            DayList: res[0],
-          },()=>upLine.bind(this)())
+            DayList: (res[0] || []).map((v: any) => {
+              v.p = Number(v[this.data.select[this.data.select_act].proportionType] / total * 100).toFixed(2)
+              return v
+            }).sort((a:any,b:any)=>{
+              return b[key] - a[key]
+            }),
+          })
+        // },()=>upLine.bind(this)())
           
         })
       },

+ 41 - 18
miniprogram/pages/channelAdvertising/components/hangyezhanbi/index.wxml

@@ -11,22 +11,45 @@
     </picker>
   </view>
 </view>
-<view style="height: 120vw;">
+<!-- <view style="height: 120vw;">
   <f2 wx:if="{{onInitChart !== undefined}}" onInit="{{onInitChart}}" />
-</view>
-<!-- <van-row wx:if="{{DayList.length}}" style="margin-top: 5px;text-align: center;font-size: 14px;">
-  <van-col span="2" class="col">序号</van-col>
-  <van-col span="6" class="col">大行业名称</van-col>
-  <van-col span="4" class="col">费用/万元</van-col>
-  <van-col span="4" class="col">时长/秒</van-col>
-  <van-col span="4" class="col">频次/次</van-col>
-  <van-col span="4" class="col">品牌数/个</van-col>
-</van-row>
-<van-row wx:if="{{DayList.length}}" style="margin-top: 5px;text-align: center;font-size: 14px;" wx:for="{{DayList}}" wx:key="index">
-  <van-col span="2"><view class="col col1">{{index+1}}</view></van-col>
-  <van-col span="6"><view class="col col1">{{item.industry}}</view></van-col>
-  <van-col span="4"><view class="col col1">{{tool.formmater(item.fee, 2)}}</view></van-col>
-  <van-col span="4"><view class="col col1">{{tool.formmater(item.timeSize, 2)}}</view></van-col>
-  <van-col span="4"><view class="col col1">{{tool.formmater(item.pinci, 2)}}</view></van-col>
-  <van-col span="4"><view class="col col1">{{tool.formmater(item.customer, 2)}}</view></van-col>
-</van-row> -->
+</view> -->
+<view class="youshikehubody">
+  <van-row class="rowText" wx:if="{{DayList.length}}" style="margin-top: 5px;text-align: center;font-size: 14px;">
+    <van-col span="3">
+      <view class="col">序号</view>
+    </van-col>
+    <van-col span="9">
+      <view class="col">大行业名称</view>
+    </van-col>
+    <van-col span="6">
+      <view class="col">{{select[select_act].text}}/万元</view>
+    </van-col>
+    <van-col span="6">
+      <view class="col">占比/%</view>
+    </van-col>
+  </van-row>
+  <van-row class="rowText" wx:if="{{DayList.length}}" style="margin-top: 5px;text-align: center;font-size: 14px;" wx:for="{{DayList}}" wx:key="index">
+    <van-col span="3">
+      <view class="col col1">{{index+1}}</view>
+    </van-col>
+    <van-col span="9">
+      <view class="col col1">{{item.industry}}</view>
+    </van-col>
+    <van-col span="6" wx:if="{{select_act === 0}}">
+      <view class="col col1">{{tool.formmater(item.fee, 2)}}</view>
+    </van-col>
+    <van-col span="6" wx:if="{{select_act === 1}}">
+      <view class="col col1">{{tool.formmater(item.timeSize, 2)}}</view>
+    </van-col>
+    <van-col span="6" wx:if="{{select_act === 2}}">
+      <view class="col col1">{{tool.formmater(item.pinci, 2)}}</view>
+    </van-col>
+    <van-col span="6" wx:if="{{select_act === 3}}">
+      <view class="col col1">{{tool.formmater(item.customer, 2)}}</view>
+    </van-col>
+    <van-col span="6" >
+      <view class="col col1">{{item.p}}%</view>
+    </van-col>
+  </van-row>
+</view>

+ 7 - 0
miniprogram/pages/channelAdvertising/components/hangyezhanbi/index.wxss

@@ -15,6 +15,13 @@
 .select{
   font-size: 15px;
 }
+.youshikehubody{
+  margin: 0 5px;
+  box-shadow: 0 0 5px #eee;
+}
+.rowText:nth-child(odd) .col {
+  background-color: #eee;
+}
 
 .after {
   width: 3px;

+ 14 - 2
miniprogram/pages/industryAdvertising/components/hangyejiegou/F2.ts

@@ -20,6 +20,12 @@ namespace hangyejiegou {
       chartCatch.toufangfenxiChart.source(data);
       chartCatch.toufangfenxiChart.legend({
         position: 'bottom',
+        nameStyle: {
+          fill: '#404040', // 文本的颜色
+          fontSize: 12, // 文本大小
+          textBaseline: 'middle', // 文本基准线,可取 top middle bottom,默认为middle
+          height: 12, // 设置文本的高度
+        },
         itemFormatter: function itemFormatter(val: string) {
           let p :any= {};
           for (let i = 0; i < data.length; i++) {
@@ -29,7 +35,7 @@ namespace hangyejiegou {
               break
             }
           }
-          return val + '  ' + p.p + "% ";
+          return val + ' ' + p.p + "% ";
         }
       });
       chartCatch.toufangfenxiChart.tooltip(false);
@@ -63,6 +69,12 @@ namespace hangyejiegou {
       chartCatch.toufangfenxiChart.source(data);
       chartCatch.toufangfenxiChart.legend({
         position: 'bottom',
+        nameStyle: {
+          fill: '#404040', // 文本的颜色
+          fontSize: 11, // 文本大小
+          textBaseline: 'middle', // 文本基准线,可取 top middle bottom,默认为middle
+          height: 11, // 设置文本的高度
+        },
         itemFormatter: function itemFormatter(val: string) {
           let p :any= {};
           for (let i = 0; i < data.length; i++) {
@@ -72,7 +84,7 @@ namespace hangyejiegou {
               break
             }
           }
-          return val + '  ' + p.p + "% ";
+          return val + ' ' + p.p + "% ";
         }
       });
       chartCatch.toufangfenxiChart.tooltip(false);

+ 14 - 2
miniprogram/pages/industryAdvertising/components/hangyejiegou/F21.ts

@@ -20,6 +20,12 @@ namespace hangyejiegou {
       chartCatch.toufangfenxiChart.source(data);
       chartCatch.toufangfenxiChart.legend({
         position: 'bottom',
+        nameStyle: {
+          fill: '#404040', // 文本的颜色
+          fontSize: 12, // 文本大小
+          textBaseline: 'middle', // 文本基准线,可取 top middle bottom,默认为middle
+          height: 12, // 设置文本的高度
+        },
         itemFormatter: function itemFormatter(val: string) {
           let p :any= {};
           for (let i = 0; i < data.length; i++) {
@@ -29,7 +35,7 @@ namespace hangyejiegou {
               break
             }
           }
-          return val + '  ' + p.p + "% ";
+          return val + ' ' + p.p + "% ";
         }
       });
       chartCatch.toufangfenxiChart.tooltip(false);
@@ -63,6 +69,12 @@ namespace hangyejiegou {
       chartCatch.toufangfenxiChart.source(data);
       chartCatch.toufangfenxiChart.legend({
         position: 'bottom',
+        nameStyle: {
+          fill: '#404040', // 文本的颜色
+          fontSize: 12, // 文本大小
+          textBaseline: 'middle', // 文本基准线,可取 top middle bottom,默认为middle
+          height: 12, // 设置文本的高度
+        },
         itemFormatter: function itemFormatter(val: string) {
           let p :any= {};
           for (let i = 0; i < data.length; i++) {
@@ -72,7 +84,7 @@ namespace hangyejiegou {
               break
             }
           }
-          return val + '  ' + p.p + "% ";
+          return val + ' ' + p.p + "% ";
         }
       });
       chartCatch.toufangfenxiChart.tooltip(false);

+ 3 - 1
miniprogram/pages/industryAdvertising/components/hangyejiegou/index.json

@@ -2,6 +2,8 @@
   "component": true,
   "usingComponents": {
     "f2": "@antv/wx-f2",
-    "van-icon": "@vant/weapp/icon/index"
+    "van-icon": "@vant/weapp/icon/index",
+    "van-row": "@vant/weapp/row/index",
+    "van-col": "@vant/weapp/col/index"
   }
 }

+ 8 - 2
miniprogram/pages/industryAdvertising/components/hangyejiegou/index.ts

@@ -89,14 +89,16 @@ namespace hangyejiegou {
               v.type = '0';
               v[key] = Number(v[key] || 0)
               return v
+            }).sort((a:any,b:any)=>{
+              return b[key] - a[key]
             }),
             DayList1: li1.map((v:any)=>{
               v.type = '0';
               v[key] = Number(v[key] || 0)
               return v
+            }).sort((a:any,b:any)=>{
+              return b[key] - a[key]
             }),
-            onInitChart: line.bind(this),
-            onInitChart1: line1.bind(this)
           })
         })
       },
@@ -119,11 +121,15 @@ namespace hangyejiegou {
               v.type = '0';
               v[key] = Number(v[key] || 0)
               return v
+            }).sort((a:any,b:any)=>{
+              return b[key] - a[key]
             }),
             DayList1: li1.map((v:any)=>{
               v.type = '0';
               v[key] = Number(v[key] || 0)
               return v
+            }).sort((a:any,b:any)=>{
+              return b[key] - a[key]
             }),
           },()=>{
             upLine.bind(this)()

+ 66 - 4
miniprogram/pages/industryAdvertising/components/hangyejiegou/index.wxml

@@ -1,4 +1,5 @@
 <view class="titleHead">
+  <wxs src="../../../../utils/util.wxs" module="tool"></wxs>
   <view class="after"></view>
   行业结构
   <view class="btns">
@@ -10,16 +11,77 @@
     </picker>
   </view>
 </view>
-<view>
+<view style="margin-bottom: 10px;">
   <text class="title">硬广行业结构</text>
 </view>
-<view style="height: 70vh;">
+<!-- <view style="height: 70vh;">
   <f2 wx:if="{{onInitChart !== undefined}}" onInit="{{onInitChart}}" />
+</view> -->
+
+<view class="youshikehubody">
+  <van-row class="rowText" wx:if="{{DayList.length}}" style="margin-top: 5px;text-align: center;font-size: 14px;">
+    <van-col span="4">
+      <view class="col">序号</view>
+    </van-col>
+    <van-col span="15">
+      <view class="col">大行业名称</view>
+    </van-col>
+    <van-col span="5">
+      <view class="col">{{select[select_act].text + '/' + select[select_act].unit}}</view>
+    </van-col>
+  </van-row>
+  <van-row class="rowText" wx:if="{{DayList.length}}" style="margin-top: 5px;text-align: center;font-size: 14px;" wx:for="{{DayList}}" wx:key="index">
+    <van-col span="4">
+      <view class="col col1">{{index+1}}</view>
+    </van-col>
+    <van-col span="15">
+      <view class="col col1">{{item.name}}</view>
+    </van-col>
+    <van-col span="5" wx:if="{{select_act === 0}}">
+      <view class="col col1">{{tool.formmater(item[select[select_act].proportionType], 2)}}</view>
+    </van-col>
+    <van-col span="5" wx:if="{{select_act === 1}}">
+      <view class="col col1">{{tool.formmater(item[select[select_act].proportionType], 2)}}</view>
+    </van-col>
+    <van-col span="5" wx:if="{{select_act === 2}}">
+      <view class="col col1">{{tool.formmater(item[select[select_act].proportionType], 2)}}</view>
+    </van-col>
+  </van-row>
 </view>
 
-<view style="margin-top: 10px">
+<view style="margin: 10px 0">
   <text class="title">软广行业结构</text>
 </view>
-<view style="height: 70vh;margin-bottom: 10px;">
+<!-- <view style="height: 70vh;margin-bottom: 10px;">
   <f2 wx:if="{{onInitChart1 !== undefined}}" onInit="{{onInitChart1}}" />
+</view> -->
+<view class="youshikehubody">
+  <van-row class="rowText" wx:if="{{DayList.length}}" style="margin-top: 5px;text-align: center;font-size: 14px;">
+    <van-col span="4">
+      <view class="col">序号</view>
+    </van-col>
+    <van-col span="15">
+      <view class="col">大行业名称</view>
+    </van-col>
+    <van-col span="5">
+      <view class="col">{{select[select_act].text + '/' + select[select_act].unit}}</view>
+    </van-col>
+  </van-row>
+  <van-row class="rowText" wx:if="{{DayList.length}}" style="margin-top: 5px;text-align: center;font-size: 14px;" wx:for="{{DayList}}" wx:key="index">
+    <van-col span="4">
+      <view class="col col1">{{index+1}}</view>
+    </van-col>
+    <van-col span="15">
+      <view class="col col1">{{item.name}}</view>
+    </van-col>
+    <van-col span="5" wx:if="{{select_act === 0}}">
+      <view class="col col1">{{tool.formmater(item[select[select_act].proportionType], 2)}}</view>
+    </van-col>
+    <van-col span="5" wx:if="{{select_act === 1}}">
+      <view class="col col1">{{tool.formmater(item[select[select_act].proportionType], 2)}}</view>
+    </van-col>
+    <van-col span="5" wx:if="{{select_act === 2}}">
+      <view class="col col1">{{tool.formmater(item[select[select_act].proportionType], 2)}}</view>
+    </van-col>
+  </van-row>
 </view>

+ 17 - 2
miniprogram/pages/industryAdvertising/components/hangyejiegou/index.wxss

@@ -16,6 +16,13 @@
   font-size: 15px;
 }
 
+.youshikehubody{
+  margin: 0 5px;
+  box-shadow: 0 0 5px #eee;
+}
+.rowText:nth-child(odd) .col {
+  background-color: #eee;
+}
 .after {
   width: 3px;
   height: 1.2em;
@@ -30,8 +37,16 @@
   line-height: 20px;
   margin-right: 10rpx;
 }
-.title{
-  font-size: 14px;
+.title {
+  font-size: 16px;
   font-weight: 500;
   padding-left: 10rpx;
+  color: #44aae1;
+}
+
+.col{
+  padding: .5em 0;
+  overflow:hidden;
+  text-overflow:ellipsis;
+  white-space:nowrap
 }

+ 3 - 2
miniprogram/pages/industryAdvertising/components/hangyetoufang/index.wxss

@@ -30,8 +30,9 @@
   line-height: 20px;
   margin-right: 10rpx;
 }
-.title{
-  font-size: 14px;
+.title {
+  font-size: 16px;
   font-weight: 500;
   padding-left: 10rpx;
+  color: #44aae1;
 }

+ 3 - 2
miniprogram/pages/industryAdvertising/components/hangyezhanbi/index.wxss

@@ -30,8 +30,9 @@
   line-height: 20px;
   margin-right: 10rpx;
 }
-.title{
-  font-size: 14px;
+.title {
+  font-size: 16px;
   font-weight: 500;
   padding-left: 10rpx;
+  color: #44aae1;
 }

+ 3 - 2
miniprogram/pages/industryAdvertising/components/pindaofenbu/index.wxss

@@ -30,8 +30,9 @@
   line-height: 20px;
   margin-right: 10rpx;
 }
-.title{
-  font-size: 14px;
+.title {
+  font-size: 16px;
   font-weight: 500;
   padding-left: 10rpx;
+  color: #44aae1;
 }

+ 4 - 3
miniprogram/pages/industryAdvertising/components/quanpanqushi/index.wxss

@@ -31,8 +31,9 @@
   line-height: 40px;
   margin-right: 10rpx;
 }
-.title{
-  font-size: 14px;
+.title {
+  font-size: 16px;
   font-weight: 500;
   padding-left: 10rpx;
-}
+  color: #44aae1;
+}

+ 0 - 5
miniprogram/utils/api.ts

@@ -1,9 +1,5 @@
 const { url } = require("../config_base");
-let loadingCount = 0;
 function requireFunc(urlType: string, data: requireFuncDate) {
-  loadingCount++ === 0 && wx.showLoading({
-    title: '请稍后'
-  })
   return new Promise((resolve, reject) => {
     wx.request({
       url: url + urlType,
@@ -15,7 +11,6 @@ function requireFunc(urlType: string, data: requireFuncDate) {
         resolve(res.data.data);
       },
       fail(err) {
-        --loadingCount === 0 && wx.showToast({ title: '网络出错' })
         reject(err);
       },
       complete() {

+ 1 - 1
miniprogram/utils/util.wxs

@@ -1,5 +1,5 @@
 var formmater = function(num, digit){
-  var n = num || 0
+  var n = (num || 0)
   if(n > 100000000) return Number((n/100000000).toFixed(digit)) + '亿'
   if(n > 10000) return Number((n/10000).toFixed(digit)) + '万'
   return Number(n.toFixed(digit))

+ 3 - 3
project.config.json

@@ -7,7 +7,7 @@
   "compileType": "miniprogram",
   "projectname": "advertising",
   "setting": {
-    "urlCheck": false,
+    "urlCheck": true,
     "es6": true,
     "enhance": true,
     "postcss": true,
@@ -33,7 +33,6 @@
       "disablePlugins": [],
       "outputPath": ""
     },
-    "enableEngineNative": false,
     "useIsolateContext": true,
     "userConfirmedBundleSwitch": false,
     "packNpmManually": true,
@@ -50,7 +49,8 @@
     "useCompilerPlugins": [
       "typescript",
       "less"
-    ]
+    ],
+    "ignoreUploadUnusedFiles": true
   },
   "simulatorType": "wechat",
   "simulatorPluginLibVersion": {},