Browse Source

页面微调

yanjie 4 years ago
parent
commit
f89de1047a

+ 1 - 0
mini/app.js

xqd
@@ -49,6 +49,7 @@ App({
     userInfo: null
   },
   updateUserInfo: function (info) {
+    console.log(info)
     this.globalData.userInfo = info
     wx.setStorageSync('sg-userinfo', info)
   },

+ 47 - 14
mini/pages/data/index.js

xqd xqd xqd xqd xqd xqd xqd
@@ -106,15 +106,15 @@ Page({
    */
   onLoad: function (options) {
     app.resetDataFilter()
-    api.getByName(this, 'projects/getAll', 'projects', {type: 'drop_menu'});
+    api.getByName(this, 'projects/getAll', 'projects', { type: 'drop_menu' });
   },
 
-  changeChartIndex: function(e) {
+  changeChartIndex: function (e) {
     var type = e.currentTarget.dataset.type
     var chartIndex = this.data.chartIndex
     chartIndex = type == '+' ? (chartIndex + 1) : (chartIndex - 1)
-    if(chartIndex < 0 || chartIndex > 2) return false;
-    this.setData({chartIndex})
+    if (chartIndex < 0 || chartIndex > 2) return false;
+    this.setData({ chartIndex })
     this.getChartData()
   },
 
@@ -187,11 +187,11 @@ Page({
   updateChart: function () {
     var data = this.data.data
     var chartIndex = this.data.chartIndex
-    if(chartIndex == 0) {
+    if (chartIndex == 0) {
       option.xAxis = [{
         type: 'value'
       }]
-      
+
       option.legend = {
         data: data.legends,
         bottom: 40
@@ -207,10 +207,21 @@ Page({
       }
       option.yAxis = [{
         type: 'category',
-        data: data.names
+        data: data.names,
+        axisLabel: {
+          color: "#000",
+          interval: 0,
+          formatter: function (value) {
+            if (value.length > 4) {
+              return value.substring(0, 4) + "...";
+            } else {
+              return value;
+            }
+          }
+        },
       }];
       var values = data.values
-      
+
       option.series = [{
         label: {
           show: true
@@ -230,7 +241,7 @@ Page({
       option.xAxis = [{
         type: 'value'
       }]
-      
+
       option.legend = {
         data: data.legends,
         bottom: 40
@@ -246,10 +257,21 @@ Page({
       }
       option.yAxis = [{
         type: 'category',
-        data: data.names
+        data: data.names,
+        axisLabel: {
+          color: "#000",
+          interval: 0,
+          formatter: function (value) {
+            if (value.length > 4) {
+              return value.substring(0, 4) + "...";
+            } else {
+              return value;
+            }
+          }
+        },
       }];
       var values = data.values
-      
+
       option.series = [{
         label: {
           show: true
@@ -270,7 +292,7 @@ Page({
       option.xAxis = [{
         type: 'value'
       }]
-      
+
       option.legend = {
         data: data.legends,
         bottom: 40
@@ -283,10 +305,21 @@ Page({
       }
       option.yAxis = [{
         type: 'category',
-        data: data.names
+        data: data.names,
+        axisLabel: {
+          color: "#000",
+          interval: 0,
+          formatter: function (value) {
+            if (value.length > 4) {
+              return value.substring(0, 4) + "...";
+            } else {
+              return value;
+            }
+          }
+        },
       }];
       var values = data.values
-      
+
       option.series = [{
         label: {
           show: true

+ 1 - 1
mini/pages/index/index.js

xqd
@@ -94,7 +94,7 @@ Page({
     this.getList()
   },
   getList: function() {
-    if(this.data.touchBottom) return false;
+    // if(this.data.touchBottom) return false;
 
     var that = this
     http({

+ 2 - 1
mini/pages/order/index.js

xqd xqd
@@ -38,6 +38,7 @@ Page({
    */
   onLoad: function (options) {
     // project_id
+    console.log(options)
     var id = options.id ? options.id : 1
     var type = options.type ? options.type : 'list'
     var tabIndex = options.index ? options.index : 0
@@ -47,7 +48,7 @@ Page({
       tabIndex
     })
     api.getProject(this)
-    api.getByName(this, 'work-points/get', 'work_points', {type: 'drop_menu'});
+    api.getByName(this, 'work-points/get', 'work_points', {type: 'drop_menu',project_id:id});
     api.getByName(this, 'orders/getRole', 'role', {id: id});
     this.getList();
   },

+ 6 - 4
mini/pages/order/index.wxml

xqd
@@ -3,15 +3,17 @@
   <view class="sg-top-box sg-fix-top sg-white-bg">
     <view class="sg-search-box sg-flex sg-align-center">
       <van-dropdown-menu>
-        <van-dropdown-item value="{{ work_point_id }}" options="{{ work_points }}" bind:change="onDropChange" data-name="work_point_id"/>
+        <van-dropdown-item value="{{ work_point_id }}" options="{{ work_points }}" bind:change="onDropChange"
+          data-name="work_point_id" />
       </van-dropdown-menu>
-      <van-search value="{{ keyword }}" placeholder="请输入订单号或提交人搜索" use-right-icon-slot class="sg-flex-grow" left-icon="none" bind:change="onDropChange" data-name="keyword">
+      <van-search value="{{ keyword }}" placeholder="请输入订单号或提交人搜索" use-right-icon-slot class="sg-flex-grow"
+        left-icon="none" bind:change="onDropChange" data-name="keyword">
         <van-icon name="search" class="sg-index-color sg-icon" slot="right-icon" bindtap="search"></van-icon>
       </van-search>
     </view>
     <view class="sg-tabs sg-flex sg-align-center sg-white-bg sg-pad sg-bottom-border sg-top-border sg-font-small">
-      <view wx:for="{{tabs}}" wx:key="index" class="sg-tab {{tabIndex == index ? 'sg-selected' : ''}}"
-        bindtap="switchTab" data-index="{{index}}" hidden="{{ type=='check' && index > 2 }}">{{ item }}</view>
+      <view wx:for="{{tabs}}"  wx:key="index" class="sg-tab {{tabIndex == index ? 'sg-selected' : ''}}"
+        bindtap="switchTab"   data-index="{{index}}" hidden="{{ type=='check' && index > 2 }}">{{ item }}</view>
     </view>
   </view>
   <view class="sg-list-box sg-pad">

+ 2 - 1
mini/pages/user/index.js

xqd
@@ -95,12 +95,13 @@ Page({
   },
 
   updateInfo: function() {
+    console.log(this.data.phone)
     http({
       url: 'users/update',
       data: {
         avatar: this.data.avatar,
         name: this.data.name,
-        phone: this.data.phone
+        phone: this.data.userInfo.phone
       },
       success: function (res) {
         if (res.code == 0) {

+ 2 - 1
mini/project.config.json

xqd
@@ -21,8 +21,9 @@
     "checkSiteMap": true,
     "uploadWithSourceMap": true,
     "compileHotReLoad": false,
-    "useMultiFrameRuntime": false,
+    "useMultiFrameRuntime": true,
     "useApiHook": true,
+    "useApiHostProcess": true,
     "babelSetting": {
       "ignore": [],
       "disablePlugins": [],

+ 3 - 3
mini/utils/env.js

xqd
@@ -1,3 +1,3 @@
-const isTest = false;
-export const baseUrl = isTest ? 'http://app.rt/api/mini/' : 'https://t18.9026.com/api/mini/';
-export const imgHost = isTest ? 'http://app.rt/images/' : 'https://t18.9026.com/images/'
+const isTest = true;
+export const baseUrl = isTest ? 'http://172.31.31.144/api/mini/' : 'https://t18.9026.com/api/mini/';
+export const imgHost = isTest ? 'http://172.31.31.144/images/' : 'https://t18.9026.com/images/'