解决数据下拉加载的bug,调整专区样式,完善充值记录
This commit is contained in:
		@@ -31,7 +31,6 @@ Page({
 | 
				
			|||||||
    })
 | 
					    })
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  onChange(e) {
 | 
					  onChange(e) {
 | 
				
			||||||
    console.log('e', e)
 | 
					 | 
				
			||||||
    this.setData({
 | 
					    this.setData({
 | 
				
			||||||
      active: e.detail.index,
 | 
					      active: e.detail.index,
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
// pages/home/index.js
 | 
					// pages/home/index.js
 | 
				
			||||||
import { getMeterDetail, getMeterList, getTenementMeterList } from "../../service/meter";
 | 
					import { getMeterDetail, getMeterList, getTenementMeterList } from "../../service/meter";
 | 
				
			||||||
import { getOwnTenementList } from "../../service/tenement";
 | 
					import { getOwnTenementList, getTenementExceptionalCase } from "../../service/tenement";
 | 
				
			||||||
import { alertInfo, alertSuccess } from "../../utils/index";
 | 
					import { alertInfo, alertSuccess } from "../../utils/index";
 | 
				
			||||||
import request from '../../utils/request';
 | 
					import request from '../../utils/request';
 | 
				
			||||||
import { getDot } from "../../utils/system";
 | 
					import { getDot } from "../../utils/system";
 | 
				
			||||||
@@ -125,6 +125,15 @@ Page({
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  async recharge() {
 | 
					  async recharge() {
 | 
				
			||||||
    const { user, money, meter, tenement, park } = this.data;
 | 
					    const { user, money, meter, tenement, park } = this.data;
 | 
				
			||||||
 | 
					    const { code, message, data } = await getTenementExceptionalCase(park?.id, tenement?.id);
 | 
				
			||||||
 | 
					    if (code !== OK) {
 | 
				
			||||||
 | 
					      alertInfo(message)
 | 
				
			||||||
 | 
					      return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if (data === 1) {
 | 
				
			||||||
 | 
					      alertInfo("账号存在异常,无法进行充值,请联系客服处理")
 | 
				
			||||||
 | 
					      return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    const that  = this;
 | 
					    const that  = this;
 | 
				
			||||||
    if (!user || !user.id) {
 | 
					    if (!user || !user.id) {
 | 
				
			||||||
      alertInfo("请先登录")
 | 
					      alertInfo("请先登录")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -78,7 +78,6 @@ Page({
 | 
				
			|||||||
                  alertError("没有开票信息")
 | 
					                  alertError("没有开票信息")
 | 
				
			||||||
                  return;
 | 
					                  return;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                console.log('res.tempFilePath', res.tempFilePath, sheetRes.tapIndex)
 | 
					 | 
				
			||||||
                wx.openDocument({
 | 
					                wx.openDocument({
 | 
				
			||||||
                  filePath: res.tempFilePath,
 | 
					                  filePath: res.tempFilePath,
 | 
				
			||||||
                  // fileType: sheetRes.tapIndex === 0 ? 'xml' : "pdf", // 3. 这个必须写合法类型,不然下载不了 !!!
 | 
					                  // fileType: sheetRes.tapIndex === 0 ? 'xml' : "pdf", // 3. 这个必须写合法类型,不然下载不了 !!!
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,7 +27,7 @@ Page({
 | 
				
			|||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    let next = true;
 | 
					    let next = true;
 | 
				
			||||||
    if (total <= page * 20) {
 | 
					    if (total <= page / 20) {
 | 
				
			||||||
      next = false;
 | 
					      next = false;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    this.setData({
 | 
					    this.setData({
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,6 +8,6 @@
 | 
				
			|||||||
        <view class="answer"> {{ item.content }} </view>
 | 
					        <view class="answer"> {{ item.content }} </view>
 | 
				
			||||||
      </view>
 | 
					      </view>
 | 
				
			||||||
    </view>
 | 
					    </view>
 | 
				
			||||||
    <empty bind:refresh="getList" />
 | 
					    <empty wx:else="" bind:refresh="getList" />
 | 
				
			||||||
  </view>  
 | 
					  </view>  
 | 
				
			||||||
</scrollPageWrapper>
 | 
					</scrollPageWrapper>
 | 
				
			||||||
@@ -69,10 +69,14 @@ Page({
 | 
				
			|||||||
          success: (res) => {
 | 
					          success: (res) => {
 | 
				
			||||||
            if (res.statusCode === 200) {
 | 
					            if (res.statusCode === 200) {
 | 
				
			||||||
              if (!res.tempFilePath) {
 | 
					              if (!res.tempFilePath) {
 | 
				
			||||||
                alertError("获取文件失败")
 | 
					                alertInfo("获取文件失败")
 | 
				
			||||||
                rej()
 | 
					                rej()
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
 | 
					              if (res.tempFilePath.endsWith(".json")) {
 | 
				
			||||||
 | 
					                alertInfo("下载文件失败")
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
              wx.openDocument({
 | 
					              wx.openDocument({
 | 
				
			||||||
                filePath: res.tempFilePath,
 | 
					                filePath: res.tempFilePath,
 | 
				
			||||||
                fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了 !!!
 | 
					                fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了 !!!
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -97,6 +97,7 @@
 | 
				
			|||||||
    border="{{ false }}"
 | 
					    border="{{ false }}"
 | 
				
			||||||
    wx:elif="{{detail.orderStatus === 2}}"
 | 
					    wx:elif="{{detail.orderStatus === 2}}"
 | 
				
			||||||
  />
 | 
					  />
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
  <van-field
 | 
					  <van-field
 | 
				
			||||||
    value="已充值"
 | 
					    value="已充值"
 | 
				
			||||||
    label="订单状态"
 | 
					    label="订单状态"
 | 
				
			||||||
@@ -104,6 +105,15 @@
 | 
				
			|||||||
    border="{{ false }}"
 | 
					    border="{{ false }}"
 | 
				
			||||||
    wx:else
 | 
					    wx:else
 | 
				
			||||||
  />
 | 
					  />
 | 
				
			||||||
 | 
					  <van-field
 | 
				
			||||||
 | 
					    value="{{detail.reason}}"
 | 
				
			||||||
 | 
					    label="拒绝理由"
 | 
				
			||||||
 | 
					    type="textarea"
 | 
				
			||||||
 | 
					    autosize="{{true}}"
 | 
				
			||||||
 | 
					    readonly
 | 
				
			||||||
 | 
					    border="{{ false }}"
 | 
				
			||||||
 | 
					    wx:if="{{detail.orderStatus === 2}}"
 | 
				
			||||||
 | 
					  />
 | 
				
			||||||
</van-cell-group>
 | 
					</van-cell-group>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<view class="operate">
 | 
					<view class="operate">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@ import { getRechargeList } from "../../service/recharge";
 | 
				
			|||||||
import { getTenementMeterList } from "../../service/meter";
 | 
					import { getTenementMeterList } from "../../service/meter";
 | 
				
			||||||
import { getYears, alertInfo, loadingFunc } from "../../utils/index";
 | 
					import { getYears, alertInfo, loadingFunc } from "../../utils/index";
 | 
				
			||||||
import request from "../../utils/request";
 | 
					import request from "../../utils/request";
 | 
				
			||||||
 | 
					import Dialog from '@vant/weapp/dialog/dialog';
 | 
				
			||||||
const { OK } = request;
 | 
					const { OK } = request;
 | 
				
			||||||
Page({
 | 
					Page({
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -79,6 +80,14 @@ Page({
 | 
				
			|||||||
    })
 | 
					    })
 | 
				
			||||||
    this.init(currentYear, codeId, pay)
 | 
					    this.init(currentYear, codeId, pay)
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					  showAnswer() {
 | 
				
			||||||
 | 
					    Dialog.alert({
 | 
				
			||||||
 | 
					      title: '提示',
 | 
				
			||||||
 | 
					      message: '只统计已完成充值的数据,处理中和已退回不计入总额内',
 | 
				
			||||||
 | 
					    }).then(() => {
 | 
				
			||||||
 | 
					      // on close
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
  onChangeMeter(e) {
 | 
					  onChangeMeter(e) {
 | 
				
			||||||
    const { id, code,  } = e;
 | 
					    const { id, code,  } = e;
 | 
				
			||||||
    const { year, pay } = this.data;
 | 
					    const { year, pay } = this.data;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,9 @@
 | 
				
			|||||||
    "van-icon": "@vant/weapp/icon/index",
 | 
					    "van-icon": "@vant/weapp/icon/index",
 | 
				
			||||||
    "custom-status-bar": "/components/customStatusBar/index",
 | 
					    "custom-status-bar": "/components/customStatusBar/index",
 | 
				
			||||||
    "custom-picker": "/components/picker/index",
 | 
					    "custom-picker": "/components/picker/index",
 | 
				
			||||||
    "empty": "/components/empty/index"
 | 
					    "empty": "/components/empty/index",
 | 
				
			||||||
 | 
					    "van-dialog": "@vant/weapp/dialog/index",
 | 
				
			||||||
 | 
					    "van-divider": "@vant/weapp/divider/index"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "navigationStyle": "custom"
 | 
					  "navigationStyle": "custom"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -34,6 +34,13 @@
 | 
				
			|||||||
      <view class="rechargeStatus rechargeBack" wx:elif="{{item.orderStatus === 2}}"> 已退回 </view>
 | 
					      <view class="rechargeStatus rechargeBack" wx:elif="{{item.orderStatus === 2}}"> 已退回 </view>
 | 
				
			||||||
      <view class="rechargeStatus rechargeSuccess" wx:else> 充值成功 </view>
 | 
					      <view class="rechargeStatus rechargeSuccess" wx:else> 充值成功 </view>
 | 
				
			||||||
    </view>
 | 
					    </view>
 | 
				
			||||||
 | 
					    <view class="allMoney"> 总计<van-icon name="question-o" bind:click="showAnswer" style="font-size: 40rpx; margin-left: 8rpx;margin-right:8rpx;" />:{{amount}} </view>
 | 
				
			||||||
 | 
					    <van-divider
 | 
				
			||||||
 | 
					      contentPosition="center"
 | 
				
			||||||
 | 
					    >
 | 
				
			||||||
 | 
					      没有更多了
 | 
				
			||||||
 | 
					    </van-divider>
 | 
				
			||||||
 | 
					    <view style="height: 40rpx;"></view>
 | 
				
			||||||
  </view>
 | 
					  </view>
 | 
				
			||||||
</view>
 | 
					</view>
 | 
				
			||||||
<view wx:else>
 | 
					<view wx:else>
 | 
				
			||||||
@@ -47,4 +54,5 @@
 | 
				
			|||||||
  bind:ok="onOk" 
 | 
					  bind:ok="onOk" 
 | 
				
			||||||
  bind:cancel="onCancel" 
 | 
					  bind:cancel="onCancel" 
 | 
				
			||||||
  type="{{type}}" 
 | 
					  type="{{type}}" 
 | 
				
			||||||
/>
 | 
					/>
 | 
				
			||||||
 | 
					<van-dialog id="van-dialog" />
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -69,10 +69,10 @@
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.allMoney {
 | 
					.allMoney {
 | 
				
			||||||
  flex: 1;
 | 
					  font-size: 34rpx;
 | 
				
			||||||
 | 
					  margin-top: 24rpx;
 | 
				
			||||||
 | 
					  margin-bottom: 20rpx;
 | 
				
			||||||
  text-align: right;
 | 
					  text-align: right;
 | 
				
			||||||
  color: #fff;
 | 
					 | 
				
			||||||
  font-size: 32rpx;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.type {
 | 
					.type {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,6 +30,10 @@ Page({
 | 
				
			|||||||
  clickService(e) {
 | 
					  clickService(e) {
 | 
				
			||||||
    console.log('e', e)
 | 
					    console.log('e', e)
 | 
				
			||||||
    const { type, value } = e.currentTarget.dataset.data;
 | 
					    const { type, value } = e.currentTarget.dataset.data;
 | 
				
			||||||
 | 
					    if (!value) {
 | 
				
			||||||
 | 
					      alertInfo("暂未开通")
 | 
				
			||||||
 | 
					      return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    switch(type) {
 | 
					    switch(type) {
 | 
				
			||||||
      case 0:
 | 
					      case 0:
 | 
				
			||||||
        const [appId, path] = value.split(",")
 | 
					        const [appId, path] = value.split(",")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,4 +3,9 @@
 | 
				
			|||||||
    width: 100%;
 | 
					    width: 100%;
 | 
				
			||||||
    height: auto;
 | 
					    height: auto;
 | 
				
			||||||
    padding: 40rpx;
 | 
					    padding: 40rpx;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.servicesWrapper {
 | 
				
			||||||
 | 
					    min-height: 80vh;
 | 
				
			||||||
 | 
					    background: linear-gradient(to bottom, var(--middle-green), #fff );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -19,8 +19,6 @@
 | 
				
			|||||||
    "uploadWithSourceMap": true,
 | 
					    "uploadWithSourceMap": true,
 | 
				
			||||||
    "compileHotReLoad": false,
 | 
					    "compileHotReLoad": false,
 | 
				
			||||||
    "useMultiFrameRuntime": true,
 | 
					    "useMultiFrameRuntime": true,
 | 
				
			||||||
    "useApiHook": true,
 | 
					 | 
				
			||||||
    "useApiHostProcess": true,
 | 
					 | 
				
			||||||
    "babelSetting": {
 | 
					    "babelSetting": {
 | 
				
			||||||
      "ignore": [],
 | 
					      "ignore": [],
 | 
				
			||||||
      "disablePlugins": [],
 | 
					      "disablePlugins": [],
 | 
				
			||||||
@@ -45,11 +43,10 @@
 | 
				
			|||||||
    "tabIndent": "insertSpaces",
 | 
					    "tabIndent": "insertSpaces",
 | 
				
			||||||
    "tabSize": 2
 | 
					    "tabSize": 2
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					  "condition": {},
 | 
				
			||||||
  "packOptions": {
 | 
					  "packOptions": {
 | 
				
			||||||
    "ignore": [],
 | 
					    "ignore": [],
 | 
				
			||||||
    "include": []
 | 
					    "include": []
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "appid": "wxb34b4e70f8a5c6f1",
 | 
					  "appid": "wxb34b4e70f8a5c6f1"
 | 
				
			||||||
  "projectname": "elec",
 | 
					 | 
				
			||||||
  "condition": {}
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -14,4 +14,9 @@ export const getOwnTenementList = async function() {
 | 
				
			|||||||
// 获取商户详情
 | 
					// 获取商户详情
 | 
				
			||||||
export const getTenementDetail = async function(id) {
 | 
					export const getTenementDetail = async function(id) {
 | 
				
			||||||
  return await GET(`/wx/getTenementDetail/${id}`);
 | 
					  return await GET(`/wx/getTenementDetail/${id}`);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获取商户是否限电
 | 
				
			||||||
 | 
					export const getTenementExceptionalCase = async function(pid, tid) {
 | 
				
			||||||
 | 
					  return await GET(`/wx/exceptionalCase/${pid}/${tid}`);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user