解决数据下拉加载的bug,调整专区样式,完善充值记录

This commit is contained in:
qiaomu 2024-09-12 14:04:53 +08:00
parent b4438b4638
commit 3f6a12ee67
15 changed files with 67 additions and 16 deletions

View File

@ -31,7 +31,6 @@ Page({
})
},
onChange(e) {
console.log('e', e)
this.setData({
active: e.detail.index,
})

View File

@ -1,6 +1,6 @@
// pages/home/index.js
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 request from '../../utils/request';
import { getDot } from "../../utils/system";
@ -125,6 +125,15 @@ Page({
},
async recharge() {
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;
if (!user || !user.id) {
alertInfo("请先登录")

View File

@ -78,7 +78,6 @@ Page({
alertError("没有开票信息")
return;
}
console.log('res.tempFilePath', res.tempFilePath, sheetRes.tapIndex)
wx.openDocument({
filePath: res.tempFilePath,
// fileType: sheetRes.tapIndex === 0 ? 'xml' : "pdf", // 3. 这个必须写合法类型,不然下载不了

View File

@ -27,7 +27,7 @@ Page({
return;
}
let next = true;
if (total <= page * 20) {
if (total <= page / 20) {
next = false;
}
this.setData({

View File

@ -8,6 +8,6 @@
<view class="answer"> {{ item.content }} </view>
</view>
</view>
<empty bind:refresh="getList" />
<empty wx:else="" bind:refresh="getList" />
</view>
</scrollPageWrapper>

View File

@ -69,10 +69,14 @@ Page({
success: (res) => {
if (res.statusCode === 200) {
if (!res.tempFilePath) {
alertError("获取文件失败")
alertInfo("获取文件失败")
rej()
return;
}
if (res.tempFilePath.endsWith(".json")) {
alertInfo("下载文件失败")
return;
}
wx.openDocument({
filePath: res.tempFilePath,
fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了

View File

@ -97,6 +97,7 @@
border="{{ false }}"
wx:elif="{{detail.orderStatus === 2}}"
/>
<van-field
value="已充值"
label="订单状态"
@ -104,6 +105,15 @@
border="{{ false }}"
wx:else
/>
<van-field
value="{{detail.reason}}"
label="拒绝理由"
type="textarea"
autosize="{{true}}"
readonly
border="{{ false }}"
wx:if="{{detail.orderStatus === 2}}"
/>
</van-cell-group>
<view class="operate">

View File

@ -3,6 +3,7 @@ import { getRechargeList } from "../../service/recharge";
import { getTenementMeterList } from "../../service/meter";
import { getYears, alertInfo, loadingFunc } from "../../utils/index";
import request from "../../utils/request";
import Dialog from '@vant/weapp/dialog/dialog';
const { OK } = request;
Page({
@ -79,6 +80,14 @@ Page({
})
this.init(currentYear, codeId, pay)
},
showAnswer() {
Dialog.alert({
title: '提示',
message: '只统计已完成充值的数据,处理中和已退回不计入总额内',
}).then(() => {
// on close
});
},
onChangeMeter(e) {
const { id, code, } = e;
const { year, pay } = this.data;

View File

@ -5,7 +5,9 @@
"van-icon": "@vant/weapp/icon/index",
"custom-status-bar": "/components/customStatusBar/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"
}

View File

@ -34,6 +34,13 @@
<view class="rechargeStatus rechargeBack" wx:elif="{{item.orderStatus === 2}}"> 已退回 </view>
<view class="rechargeStatus rechargeSuccess" wx:else> 充值成功 </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 wx:else>
@ -48,3 +55,4 @@
bind:cancel="onCancel"
type="{{type}}"
/>
<van-dialog id="van-dialog" />

View File

@ -69,10 +69,10 @@
}
.allMoney {
flex: 1;
font-size: 34rpx;
margin-top: 24rpx;
margin-bottom: 20rpx;
text-align: right;
color: #fff;
font-size: 32rpx;
}
.type {

View File

@ -30,6 +30,10 @@ Page({
clickService(e) {
console.log('e', e)
const { type, value } = e.currentTarget.dataset.data;
if (!value) {
alertInfo("暂未开通")
return;
}
switch(type) {
case 0:
const [appId, path] = value.split(",")

View File

@ -4,3 +4,8 @@
height: auto;
padding: 40rpx;
}
.servicesWrapper {
min-height: 80vh;
background: linear-gradient(to bottom, var(--middle-green), #fff );
}

View File

@ -19,8 +19,6 @@
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
@ -45,11 +43,10 @@
"tabIndent": "insertSpaces",
"tabSize": 2
},
"condition": {},
"packOptions": {
"ignore": [],
"include": []
},
"appid": "wxb34b4e70f8a5c6f1",
"projectname": "elec",
"condition": {}
"appid": "wxb34b4e70f8a5c6f1"
}

View File

@ -15,3 +15,8 @@ export const getOwnTenementList = async function() {
export const getTenementDetail = async function(id) {
return await GET(`/wx/getTenementDetail/${id}`);
}
// 获取商户是否限电
export const getTenementExceptionalCase = async function(pid, tid) {
return await GET(`/wx/exceptionalCase/${pid}/${tid}`);
}