Browse Source

智慧养老对应的水查查:修改首页样式

wangfen 4 năm trước cách đây
mục cha
commit
ad91933514

+ 9 - 9
shuichacha-for-TJ/components/dashboard/dashboard.wxml

@@ -2,18 +2,18 @@
 <view class="container">
   <view class="dashboard">
     <view class="content">
-      <view class="count" style="height: calc(100% - {{userInfo.laddertype? waterStages.length * 80 : 80}}rpx)">
-        <view class="number">{{userInfo.intNum || 0}}<text>.{{userInfo.floatNum}}t</text></view>
-        <view class="txt">
-          <text>{{userInfo.laddertypename || '-'}}</text>
-          <text wx:if="{{userInfo.laddertype}}">/{{userInfo.ladderlevelname || '-'}}</text>
+      <view class="count" style="height: 100%">
+        <view class="textFlag">
+          <image src="/static/img/icon-code.png" role="img"></image>
+          <text class="textcurrentMonth">本月用水</text>        
         </view>
+        <view class="number">{{userInfo.intNum || 0}}<text>.{{userInfo.floatNum}}t</text></view>      
       </view>
-      <view class="item" wx:for="{{userInfo.laddertype? waterStages : [waterStages[0]]}}" wx:key="index"
+      <!-- <view class="item" wx:for="{{userInfo.laddertype? waterStages : [waterStages[0]]}}" wx:key="index"
         style="background-color: {{item.background}}">
         <view class="icon" style="background-color: {{item.color}}"></view>
         <view class="name">{{item.name}}</view>
-      </view>
+      </view> -->
     </view>
     <view class="wave-wrap">
       <view class="wave-inner" style="height: {{userInfo.percentage}}%; {{userInfo.style.linear}}">
@@ -22,7 +22,7 @@
         <view  wx:if="{{userInfo.percentage < 100 && userInfo.percentage > 0}}" class="before"></view>
       </view>
     </view>
-    <view class="ruler">
+    <!-- <view class="ruler">
       <view wx:for="{{waterStages}}" wx:key="index" class="item" style="height: calc(100% / {{waterStages.length}})">
         <view class="long-scale top" wx:if="{{index == waterStages.length - 1}}}">
           <text class="line"></text>
@@ -39,6 +39,6 @@
           <text class="number">{{item.minValue}}</text>
         </view>
       </view>
-    </view>
+    </view> -->
   </view>
 </view>

+ 24 - 4
shuichacha-for-TJ/components/dashboard/dashboard.wxss

@@ -9,13 +9,14 @@
 }
 
 .dashboard .content {
-  width: 240rpx;
+  /* width: 240rpx; */
+  width: 50%;
   height: 100%;
   margin-right: 60rpx;
 }
 
 .dashboard .content .count {
-  width: 192rpx;
+  /* width: 240rpx; */
   height: auto;
   display: flex;
   flex-direction: column;
@@ -204,8 +205,27 @@
   border-radius: 48%;
   animation-duration: 10s;
 }
-
-
+.textFlag{
+  width: 100%;
+  display: inline-flex;
+  padding: 28rpx 0;
+  text-align: center;
+  flex-direction: row;
+  justify-content: left;
+}
+.textFlag image{
+  width: 80rpx;
+  height: 80rpx;
+  display: block;
+  margin-left: 1rpx;
+  margin-bottom: 18rpx;
+  flex-shrink: 0;
+}
+.textFlag .textcurrentMonth{
+  align-items: center;
+  margin-top: 15rpx;
+  margin-left: 15rpx;
+}
 @keyframes rotate {
   0% {
     transform: translate(-50%, 0) rotateZ(0deg);

+ 1 - 1
shuichacha-for-TJ/pages/customermanage/addcustomer.js

@@ -47,7 +47,7 @@ Page({
       })
       return;
     }
-    app.$http.get('/user/codeAndPhoneQuery', this.data.formData).then(({ status, data = {}, msg }) => {
+    app.$http.get('/appletUser/codeAndPhoneQuery', this.data.formData).then(({ status, data = {}, msg }) => {
       if (status === 0) {
         const {userNumber, username, address} = data;
         if (userNumber) {

+ 3 - 3
shuichacha-for-TJ/pages/customermanage/customermanage.js

@@ -28,7 +28,7 @@ Page({
       loading: true
     })
     const params = JSON.parse(JSON.stringify(that.data.params));
-    app.$http.get('/user/getAccountInfoPage', params).then(({ status, data: { list = [], total = 0 }, msg }) => {
+    app.$http.get('/appletUser/getAccountInfoPage', params).then(({ status, data: { list = [], total = 0 }, msg }) => {
       if (0 === status) {
         let result = list,
           dataLoadComplete = false;
@@ -76,7 +76,7 @@ Page({
     const { id, isDefault } = e.currentTarget.dataset.item;
     if (!isDefault) {
       wx.showLoading();
-      app.$http.postForm('/user/setDefault', {
+      app.$http.postForm('/appletUser/setDefault', {
         id
       }).then(({ status, msg }) => {
         if (status === 0) {
@@ -126,7 +126,7 @@ Page({
     const self = this;
     if (this.popup.data.type == 'success' && this.popup.data.params) {
       const { id } = this.popup.data.params;
-      app.$http.deleteForm('/user/cancelBind', {
+      app.$http.deleteForm('/appletUser/cancelBind', {
         id
       }).then(({ status, msg }) => {
         if (status === 0) {

+ 8 - 8
shuichacha-for-TJ/pages/index/index.js

@@ -13,16 +13,17 @@ Page({
       icon: '/static/img/icon-water.png',
       url: '?period=7',
       sonlabel:'近期用水量'
-    }, {
-      id: 'wateranalysis',
-      label: '用水趋势',
-      icon: '/static/img/icon_water_analysis.png',
-      sonlabel:'年度用水趋势'
     }, {
       id: 'waterabnormal',
       label: '异常预警',
       icon: '/static/img/icon_water_abnormal.png',
       sonlabel:'用水异常提醒'
+    },
+    {
+      id: 'wateranalysis',
+      label: '用水趋势',
+      icon: '/static/img/icon_water_analysis.png',
+      sonlabel:'年度用水趋势'
     }, {
       id: 'customermanage',
       label: '户号管理',
@@ -91,7 +92,6 @@ Page({
       param,
       item = {}
     } = e.currentTarget.dataset;
-
     if (!this.data.weixinLogin) {
       wx.showToast({
         title: '请您先进行授权',
@@ -156,7 +156,7 @@ Page({
     })
   },
   onShow() {
-    //this.getAccountInfo();
+    this.getAccountInfo();
     this.isRegister()
   },
   toLogin(msg) {
@@ -172,7 +172,7 @@ Page({
     this.popup.close();
   },
   confirmEvent: function () {
-    // this.getAccountInfo(true);
+    this.getAccountInfo(true);
   },
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 2 - 2
shuichacha-for-TJ/pages/index/index.wxml

@@ -1,8 +1,8 @@
-<!--index.wxml-->
+<!--index.wxml wx:if="{{ !weixinLogin }}"-->
 <view class="container home">
 	<view class="unbind-box" wx:if="{{!userInfo.userNumber && !onQuery}}">
 		<image class="unbind-img" src="/static/img/img_no_customer.png"></image>
-		<button  class="open-button"  wx:if="{{ !weixinLogin }}"open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">点击授权</button>
+		<button  class="open-button" wx:if="{{!weixinLogin}}"  open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">点击授权</button>
 	</view>
 	<view wx:else class="waterInfo">
 		<block>

+ 1 - 1
shuichacha-for-TJ/utils/util.js

@@ -22,7 +22,7 @@ const selfUserInfo = (global, force = false, name = 'selfUserInfo') => {
     if (global[name] && !force) {
       resolve(global[name]);
     } else {
-      http.get('/user/getAccountInfo').then(({ status, data = {} }) => {
+      http.get('/appletUser/getAccountInfo').then(({ status, data = {} }) => {
         if (status === 0) {
           global[name] = data;
           resolve(global[name]);