wang_xy 1 năm trước cách đây
mục cha
commit
eba3b02ebc
2 tập tin đã thay đổi với 15 bổ sung6 xóa
  1. 2 1
      songhua-ui/src/api/ship/diqiu.js
  2. 13 5
      songhua-ui/src/views/index/index.vue

+ 2 - 1
songhua-ui/src/api/ship/diqiu.js

@@ -3244,7 +3244,8 @@ export function getMap() {
     { name: '海南', value: randomData() },
     { name: '台湾', value: randomData() },
     { name: '香港', value: randomData() },
-    { name: '澳门', value: randomData() }
+    { name: '澳门', value: randomData() },
+    { name: '南海诸岛', value: randomData() }
   ];
   let option = {
     backgroundColor: 'rgba(1, 14, 33)',

+ 13 - 5
songhua-ui/src/views/index/index.vue

@@ -255,8 +255,8 @@ export default {
       moreMeunSmalLeft_3: false,
       regionInShowOne: false,
       regionInShowTwo: true,
-      money: 15389740,
-      peopleNum: 234856,
+      money: 0,
+      peopleNum: 0,
       dataSource: [],
       map:[],
       dateList: [
@@ -293,8 +293,9 @@ export default {
     this.getMapByPerson();
     let _this = this;
     setInterval(function () {
-      _this.money += Math.round(Math.random() * 100);
-      _this.peopleNum += Math.round(Math.random() * 100);
+      let peo = Math.round(Math.random() * 100);
+      _this.peopleNum += peo;
+      _this.money += (peo*29);
     }, 3000)
   },
   created() {
@@ -1016,7 +1017,14 @@ export default {
       }
     },
     getFirstDigit(num) {
-      return Number(String(this.money).charAt(num));
+      let ret = 0;
+      let strMoney = '';
+      for (let i = 0;i < 8-String(this.money).length;i++){
+        strMoney += '0';
+      }
+      strMoney = strMoney + String(this.money);
+      ret = Number(strMoney.charAt(num));
+      return ret;
     },
     aaa(){
       this.map.panTo(new BMap.Point(126.607581,43.802168)); // 初始化地图,设置中心点坐标和地图级别