Compare commits

...

23 Commits

Author SHA1 Message Date
c266572022 修改商城和充费跳转 2024-08-14 09:07:37 +08:00
0b568a81e5 暂存商城修改 2024-07-17 17:05:58 +08:00
765b3ad111 缴费新增对公支付(但是功能不可操作),开始调整首页 2024-07-16 08:52:36 +08:00
e4a22af891 完成充值改造 2024-07-15 14:16:06 +08:00
8e1ed62bd7 调整跳转h5链接 2024-07-10 08:28:53 +08:00
14dad0a506 修改发票详情样式错误 2024-06-26 17:15:37 +08:00
e6edf6e3d1 修改首页样式和手动绑定字段名 2024-06-25 11:16:38 +08:00
9ca94479fa 修改手动绑定不能返回的问题,修改发票类型字段,修改首页样式 2024-06-24 15:06:24 +08:00
31870c0222 优化跳转登录逻辑,退出登录,修改收据复制错误 2024-06-19 17:17:30 +08:00
4963d4f8a6 修改充值类型错误 2024-06-19 09:28:37 +08:00
e3ad9ea30a 调整样式,新增发票打印复制链接 2024-06-18 17:34:17 +08:00
75713f1e97 修改样式 2024-06-17 17:36:07 +08:00
56e08863de 修改了发票详细样式,新增发票审核状态,发票新增全选 2024-06-12 14:09:17 +08:00
8b970f2b8f 修改发票下载查询和发票信息修改 2024-06-05 16:16:21 +08:00
8ecb1e5977 修改开票编辑后详情错位的bug 2024-06-04 19:25:44 +08:00
60fcd5f8e2 修改退出登录逻辑,新增访问接口退出 2024-05-30 17:21:30 +08:00
7ac104d1b8 登录页不判断用户登录跳转首页逻辑 2024-05-30 16:40:24 +08:00
8f83197c02 修改导出xlsx的时候手机端异常的问题 2024-05-15 15:22:30 +08:00
ada2d71136 修改顶部navigator样式 2024-05-09 16:29:45 +08:00
05853b819f 修改首页顺序 2024-05-09 11:14:14 +08:00
e730e66c7c 新增用电查询echarts和导出功能 2024-05-09 11:02:40 +08:00
6d35c78da9 修复发票编辑时候异常 2024-05-08 17:18:11 +08:00
b673d0c994 修改返回首页报错 2024-05-08 16:05:08 +08:00
65 changed files with 1787 additions and 928 deletions

View File

@@ -1,9 +1,9 @@
{
"pages": [
"pages/home/index",
"pages/electricQuery/index",
"pages/billDetail/index",
"pages/billList/index",
"pages/electricQuery/index",
"pages/rechargeRecord/index",
"pages/invoiceList/index",
"pages/invoiceDetail/index",
@@ -18,10 +18,10 @@
"pages/qrCode/index",
"pages/recharge/index",
"pages/questions/index",
"pages/editInvoice/index",
"pages/rechargeDetail/index",
"pages/agreements/index",
"pages/updateInvoice/index"
"pages/updateInvoice/index",
"pages/rechargeWay/index"
],
"tabBar": {
"list": [

View File

@@ -8,7 +8,7 @@ page {
}
.border {
border: 0.5rpx solid #f0f0f0;
border: 0.5rpx solid #cfc9c9;
}
.radius12 {

View File

@@ -1,7 +1,7 @@
/* components/avatar/index.wxss */
.wrapper {
width: 150rpx;
height: 150rpx;
width: 120rpx;
height: 120rpx;
border-radius: 50%;
background: radial-gradient(circle, var(--light-green), var(--middle-green),var(--deep-green) );
display: flex;
@@ -14,4 +14,5 @@
max-width: 100rpx;
overflow: hidden;
white-space: nowrap;
font-size: 30rpx;
}

View File

@@ -1,10 +1,13 @@
/* components/dot/index.wxss */
.dot {
background-color: #ee0a24;
width: 56rpx;
height: 56rpx;
width: 52rpx;
height: 52rpx;
border-radius: 50%;
text-align: center;
color: #fff;
font-size: 28rpx;
font-size: 26rpx;
display: flex;
justify-content: center;
align-items: center;
}

View File

@@ -1,20 +1,9 @@
import { getReportDetail } from "../../service/report";
import { alertInfo } from "../../utils/index";
import { alertInfo, getPixelRatio } from "../../utils/index";
import request from '../../utils/request'
import * as echarts from '../../components/echarts/echarts';
const { OK } = request
const getPixelRatio = () => {
let pixelRatio = 0
wx.getSystemInfo({
success: function (res) {
pixelRatio = res.pixelRatio
},
fail: function () {
pixelRatio = 0
}
})
return pixelRatio
}
// pages/billDetail/index.js
Page({
@@ -141,19 +130,19 @@ Page({
// 开发版
case 'develop':
wx.setClipboardData({
data: `https://zgd.hbhcbn.com/h5/?report=${id}&tenement=${tenement}`,
data: `https://zgd.hbhcbn.com/user-report/?report=${id}&tenement=${tenement}`,
})
break;
// 体验版
case 'trial':
wx.setClipboardData({
data: `https://zgd.hbhcbn.com/h5/?report=${id}&tenement=${tenement}`,
data: `https://zgd.hbhcbn.com/user-report/?report=${id}&tenement=${tenement}`,
})
break;
// 正式版
case 'release':
wx.setClipboardData({
data: `https://zgd.hbhcbn.com/reporth5/?report=${id}&tenement=${tenement}`,
data: `https://zgd.hbhcbn.com/user-report-h5/?report=${id}&tenement=${tenement}`,
})
break;
}

View File

@@ -23,7 +23,7 @@ Page({
const { page, list } = this.data;
const { code, data, message } = await getBillList(page)
if (!data?.length) {
alertInfo("没更多了")
alertInfo("没更多了")
return;
}
this.setData({

View File

@@ -1,7 +1,8 @@
{
"usingComponents": {
"navigator": "/components/navigator/index",
"van-icon": "@vant/weapp/icon/index"
"van-icon": "@vant/weapp/icon/index",
"empty": "/components/empty/index"
},
"navigationStyle": "custom"
}

View File

@@ -1,8 +1,12 @@
<!--pages/billList/index.wxml-->
<navigator title="电费账单" canBack="{{true}}" />
<view class="itemWrapper" wx:for="{{list}}" wx:key="index">
<view wx:if="{{!list.length}}">
<empty bind:refresh="init" />
</view>
<view wx:else>
<view class="itemWrapper" wx:for="{{list}}" wx:key="index">
<van-icon name="balance-list-o" />
<view class="time"> {{ item.time }} </view>
<view class="operate" bind:tap="jumpToDetail" data-id="{{item.id}}"> 查看详细 </view>
</view>
</view>

View File

@@ -1,66 +0,0 @@
// pages/editInvoice/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -1,2 +0,0 @@
<!--pages/editInvoice/index.wxml-->
<text>pages/editInvoice/index.wxml</text>

View File

@@ -1,10 +1,10 @@
// pages/electricQuery/index.js
import { getAccountingList, getElectricityList, getMeterReadingList } from "../../service/accounting";
import { exportElectricityList, getAccountingList, getElectricityList, getMeterReadingList } from "../../service/accounting";
import { getTenementMeterList } from "../../service/meter";
import dayjs from "../../utils/dayjs";
import request from '../../utils/request';
import * as echarts from '../../components/echarts/echarts';
import { alertInfo } from "../../utils/index";
import { alertInfo, getPixelRatio, loadingFunc } from "../../utils/index";
const { OK } = request;
Page({
@@ -99,6 +99,52 @@ Page({
return;
}
this.setData({ list: data, electricNumber, meterNumber })
if (!data?.length) {
return;
}
this.selectComponent('#echarts').init((canvas, width, height) => {
// 初始化图表
const pieChart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: getPixelRatio(),
});
const ids = [...new Set(data?.map(item => item?.meter?.id))]
const options = {
tooltip: {
trigger: 'axis'
},
legend: {
data: data?.map(item => item?.meter?.address),
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: [...new Set(data?.map(item => item.time))]
},
yAxis: {
type: 'value'
},
series: ids?.map(item => {
const element = data?.find(i => i?.meter?.id === item)
return {
name: element?.meter?.address,
type: 'line',
stack: 'Total',
data: data?.filter(ele => ele?.meter?.id === item).map(item => item.number)
}})
};
pieChart.setOption(options);
// 注意这里一定要返回 chart 实例,否则会影响事件处理等
return pieChart;
});
},
async getReadingList() {
const { meterId } = this.data;
@@ -109,6 +155,37 @@ Page({
}
this.setData({ meterReadingList: data })
},
async export() {
loadingFunc(async () => {
const { queryType, timeType, meterId, year, yearMonth, yearMonthDay } = this.data;
let time;
switch(timeType) {
case 1:
time = yearMonth;
break;
case 2:
time = year;
break;
default:
time = yearMonthDay;
break;
}
const data = await exportElectricityList({ type: timeType, meter: meterId, time: time })
// if (code !== OK) {
// alertInfo(message)
// return;
// }
wx.openDocument({
filePath: data.tempFilePath,
fileType: ['xlsx'],
success() {
},
fail(err) {
}
})
})
},
async getAccountingBalanceList() {
const { meterId } = this.data;
const { code, message, data } = await getAccountingList(meterId)
@@ -147,11 +224,7 @@ Page({
})
},
onOk(e) {
const { type, value = {} } = e.detail;
const { id, code } = e.detail.value;
console.log('e', e)
const { year } = this.data;
// const currentYear = years[Number(e)]
this.setData({
// year: currentYear,
meterId: id,

View File

@@ -9,7 +9,8 @@
"table": "/components/table/table",
"empty": "/components/empty/index",
"timePicker": "/components/timePicker/index",
"accountingCard": "./components/accountingCard/index"
"accountingCard": "./components/accountingCard/index",
"echarts": "/components/echarts/ec-canvas"
},
"navigationStyle": "custom"
}

View File

@@ -53,7 +53,7 @@
<view class="timeText" wx:else> {{year}} </view>
<van-icon name="arrow-down" />
</view>
<van-button type="info" size="small"> 导出 </van-button>
<van-button type="info" size="small" bind:click="export"> 导出 </van-button>
</view>
</view>
<view wx:elif="{{queryType === 1}}">
@@ -94,14 +94,16 @@
</view>
</view>
<!-- <echarts
style="width:200rpx;height:200rpx;position:relative"
<echarts
style="width:200rpx;height:180rpx;"
id="echarts"
class='mychart-bar'
canvas-id="mychart-bar"
ec="{{ ec }}"
forceUseOldCanvas="{{false}}"
wx:if="{{list.length}}"
>
</echarts> -->
</echarts>
<custom-picker
title="{{title}}"
show="{{show}}"

View File

@@ -6,17 +6,17 @@ page {
.queryWrapper {
margin: 20rpx 0rpx;
background-color: #fff;
padding: 30rpx;
padding:15rpx 20rpx;
box-sizing: border-box;
border-radius: 20rpx;
display: flex;
align-items: center;
font-size: 32rpx;
}
.label {
width: 180rpx;
font-size: 34rpx;
font-size: 32rpx;
}
.sum {
@@ -32,9 +32,9 @@ page {
.typeQueryText {
text-align: center;
padding: 30rpx;
padding: 20rpx;
background-color: var(--light-green);
font-size: 34rpx;
font-size: 32rpx;
}
.select {
@@ -44,13 +44,14 @@ page {
flex: 1;
display: flex;
justify-content: space-between;
font-size: 30rpx;
}
.timeQueryText {
text-align: center;
padding: 30rpx;
padding: 20rpx;
background-color: rgb(242,248,246);
font-size: 34rpx;
font-size: 30rpx;
}
.wrapper {
@@ -61,12 +62,13 @@ page {
.tooltip {
margin: 20rpx 0;
font-size: 32rpx;
color: rgb(119, 114, 114);
font-size: 28rpx;
color: rgb(97, 93, 93);
}
.timeChooseWrapper {
display: flex;
align-items: center;
font-size: 30rpx;
}
.time {

View File

@@ -14,14 +14,18 @@ Page({
parkName: "",
park: "",
tenementName: "",
tenement: ""
tenement: "",
canBack: true,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { canBack } = options
if (canBack === 'false') {
this.setData({ canBack: false })
}
},
onChangeName(e) {
this.setData({
@@ -64,7 +68,7 @@ Page({
return
}
if (!phone) {
alertInfo("请输入联系人手机号")
alertInfo("请输入预留手机号")
return
}
if (!name) {

View File

@@ -6,7 +6,8 @@
"van-field": "@vant/weapp/field/index",
"van-icon": "@vant/weapp/icon/index",
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index"
"van-tabs": "@vant/weapp/tabs/index",
"navigator": "/components/navigator/index"
},
"navigationBarTitleText": "绑定商户"
"navigationStyle": "custom"
}

View File

@@ -1,5 +1,6 @@
<!--pages/handleLogin/index.wxml-->
<!-- <topbar /> -->
<navigator title="绑定商户" canBack="{{canBack}}" />
<van-tabs>
<van-tab title="扫码绑定">
<view class="codeContent">
@@ -24,8 +25,8 @@
<van-field
required
value="{{ phone }}"
label="联系人手机号"
placeholder="请输入联系人手机号"
label="预留手机号"
placeholder="请输入预留手机号"
border="{{ true }}"
bind:change="onChangePhone"
/>

View File

@@ -4,7 +4,6 @@ import { alertInfo, alertSuccess } from "../../utils/index";
import request from '../../utils/request';
import { getDot } from "../../utils/system";
import { getUserInfo } from "../../service/user"
import { requestRecharge } from "../../service/recharge";
const { OK } = request;
// pages/home/index.js
Page({
@@ -22,6 +21,8 @@ Page({
pickerType: "",
meterList: [],
meterIndex: 0,
rechargeVisible: false,
background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
},
/**
@@ -52,18 +53,29 @@ Page({
onReady() {
},
async changeMeter() {
const { meterList = [] } = this.data;
const newColumns = meterList.map(item => { item.id = item.code; item.name = `${item.code} - ${item.address}`; return item; })
this.setData({
columns: newColumns,
show: true,
pickerType: "meter"
jumpToRecharge() {
const { user } = this.data;
if (!user || !user?.id) {
alertInfo("请先登录")
return;
}
wx.navigateTo({
url: '/pages/recharge/index',
})
},
async refreshMeter() {
const { meter } = this.data;
this.handleGetMeterDetail(meter.id);
async setUser() {
const result = await getUserInfo();
if (result.code !== OK) {
// alertInfo(result.message)
const user = wx.getStorageSync('user')
this.setData({ user: user })
return;
}
this.setData({ user: result.data })
wx.setStorageSync('user', result.data)
// const user = wx.getStorageSync('user')
// this.setData({ user: user })
},
onOk(e) {
const { type, index, value } = e.detail;
@@ -79,7 +91,7 @@ Page({
park: value,
tenement: value.tenements?.[0]
})
wx.setStorageSync('park', park)
wx.setStorageSync('park', value)
wx.setStorageSync('tenement', value.tenements?.[0])
break;
case "tenement":
@@ -95,10 +107,6 @@ Page({
tenement: value
})
break;
case "meter":
const { code, id } = e.detail.value;
this.handleGetMeterDetail(id)
break;
}
},
@@ -119,68 +127,9 @@ Page({
show: false,
})
},
changeMoney(e) {
const { money } = e.currentTarget.dataset;
this.setData({
money: money
})
},
onChangeMoney(e) {
this.setData({ money: e.detail })
},
async recharge() {
const { user, money, meter, tenement, park } = this.data;
const that = this;
if (!user || !user.id) {
alertInfo("请先登录")
return
}
if (!money) {
alertInfo("请先输入金额")
return;
}
if (!meter?.code) {
alertInfo("没有选择表计")
return;
}
if (money < 0.01) {
alertInfo("最少为1分")
return
}
const { code, message, data } = await requestRecharge({ money: Number(money), id: meter.id, tenement: tenement.id, park: park.id })
if (code !== OK) {
alertInfo(message)
return;
}
wx.requestPayment({
timeStamp: data?.time,
nonceStr: data?.nonceStr,
package: "prepay_id=" + data?.prepay_id,
paySign: data?.paySign,
signType: 'RSA',
success: (res) => {
console.log('success', res)
alertSuccess("充值成功")
that.setData({
money: null
})
},
fail: (res) => {
console.log('fail', res)
alertInfo("请稍后重试")
},
complete: (res) => {
console.log('complete')
that.handleGetMeterDetail(meter.id)
}
})
},
jumpToInvoice() {
wx.navigateTo({
url: '/pages/invoiceList/index',
})
},
jumpToLogin() {
wx.navigateTo({
url: '/pages/login/index',
@@ -190,7 +139,6 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.setUser();
this.getAllList();
this.watchTenement();
this.watchPark();
@@ -210,10 +158,8 @@ Page({
set: function (newVal) {
// const oldValue = value;
wx.setStorageSync('tenement', newVal)
if (value !== newVal) {
that.getMeters(newVal);
that.setUser();
}
// that.getMeters(newVal);
value = newVal;
}
});
@@ -270,30 +216,20 @@ Page({
wx.setStorageSync('meter', data?.[0] || {} )
// }
},
jumpToElectric() {
wx.navigateTo({
url: '/pages/electricQuery/index',
})
},
async setUser() {
const result = await getUserInfo();
if (result.code !== OK) {
// alertInfo(result.message)
const user = wx.getStorageSync('user')
this.setData({ user: user })
return;
}
this.setData({ user: result.data })
wx.setStorageSync('user', result.data)
// const user = wx.getStorageSync('user')
// this.setData({ user: user })
},
async getAllList() {
const { code, message, data } = await getOwnTenementList()
if (code !== OK) {
alertInfo(message)
return
}
if (!data?.length) {
alertInfo("尚无信息")
wx.redirectTo({
url: '/pages/handleLogin/index?back=false',
})
return;
}
const [firstPark = {}] = data;
const { park, tenement } = this.data;
const updateDatas = {}
@@ -312,20 +248,11 @@ Page({
updateDatas.all = data;
this.setData({
...updateDatas
}, () => {
this.getMeters({ id: updateDatas.tenement.id })
})
},
jumpToRecord() {
wx.navigateTo({
url: '/pages/rechargeRecord/index',
})
},
jumpToOrder() {
// alertInfo("尚未完成")
wx.navigateTo({
url: '/pages/billList/index',
})
jumpToShop() {
alertInfo("开发中");
},
/**
* 生命周期函数--监听页面隐藏

View File

@@ -8,7 +8,8 @@
"van-field": "@vant/weapp/field/index",
"picker": "/components/picker/index",
"van-grid": "@vant/weapp/grid/index",
"van-grid-item": "@vant/weapp/grid-item/index"
"van-grid-item": "@vant/weapp/grid-item/index",
"van-action-sheet": "@vant/weapp/action-sheet/index"
},
"navigationStyle": "custom"
}

View File

@@ -1,7 +1,9 @@
<!--pages/home/index.wxml-->
<page-meta page-style="{{ show ? 'overflow: hidden;' : '' }}" />
<view>
<view class="top">
<custom-status-bar transparent="{{true}}" />
<view class="chooseParkWrapper">
用电管理服务 ·
@@ -24,80 +26,27 @@
<view class="logined" wx:else>
<avatar text="{{ user.nickName }}" />
<view>
<van-button type="info" size="small" plain="{{true}}" class="loginBtn" bind:click="chooseTenement">{{tenement.name}} <van-icon name="arrow-down" style="margin-left: 16rpx;" /></van-button>
<view class="company" bind:tap="chooseTenement">
<view class="companyName"> {{tenement.name}} </view>
<van-icon name="arrow-down" style="margin-left: 16rpx;" />
</view>
<view class="welcome"> 欢迎使用华昌宝能用电管理系统! </view>
</view>
</view>
<view class="rechargeWrapper">
<view class="card">
<view class="cardTop">
<view class="cardTopLeft">
<view wx:if="{{user.id}}"> {{ tenement.shortName}} - {{ meter.address }} </view>
<view wx:else> -- </view>
<swiper indicator-dots="{{true}}" autoplay="{{true}}" interval="{{8000}}" duration="{{300}}">
<block wx:for="{{background}}" wx:key="*this">
<swiper-item>
<view class="swiper-item {{item}}">
{{item}}
</view>
<van-button type="info" size="small" plain="{{true}}" class="loginBtn" bind:click="changeMeter" wx:if="{{user.id}}">
<van-icon name="exchange" />
切换电表
</van-button>
</view>
<view class="cardContent">
<view class="cardItem">
<view class="cardItemLabel"> 电表编号: </view>
<view class="cardItemValue" wx:if="{{user.id}}"> {{meter.code}} </view>
<view class="cardItemValue" wx:else> -- </view>
</view>
<view class="cardItem">
<view class="cardItemLabel"> 电表地址: </view>
<view class="cardItemValue" wx:if="{{user.id}}"> {{meter.address}} </view>
<view class="cardItemValue" wx:else> -- </view>
</view>
<view class="cardItem">
<view class="cardItemLabel"> 电表余额: </view>
<view class="cardItemValue">
<view class="text" wx:if="{{user.id}}"> {{meter.money}} </view>
<view class="text" wx:else> --- </view>
<van-button type="info" size="small" plain="{{true}}" bind:click="refreshMeter" wx:if="{{user.id}}">
<van-icon name="replay" />
刷新
</van-button>
</view>
</view>
</view>
</view>
<view class="recharge">
<view> 请输入金额: </view>
<view class="moneyBox">
<view class="money" bind:tap="changeMoney" data-money="30"> ¥30 </view>
<view class="money" bind:tap="changeMoney" data-money="50"> ¥50 </view>
<view class="money" bind:tap="changeMoney" data-money="100"> ¥100 </view>
<view class="money" style="margin-right: 0;" bind:tap="changeMoney" data-money="200"> ¥200 </view>
</view>
<view class="moneyInput">
<van-field
value="{{ money }}"
placeholder="请输入充值金额"
border="{{true}}"
bind:change="onChangeMoney"
size="large"
type="digit"
/>
</view>
</view>
<view class="operate">
<van-button color="rgb(88, 165, 141)" block bind:click="recharge">去缴费</van-button>
</view>
<view class="others">
<van-grid direction="horizontal" column-num="2">
<van-grid-item icon="balance-list-o" text="电费账单" bind:click="jumpToOrder">
<!-- <view slot="icon"> 111 </view> -->
<!-- <van-icon slot="icom" name="balance-list-o" /> -->
</van-grid-item>
<van-grid-item icon="after-sale" text="缴费记录" bind:click="jumpToRecord" />
<van-grid-item icon="bar-chart-o" text="用电查询" bind:click="jumpToElectric" />
<van-grid-item icon="bill-o" text="去开票" bind:click="jumpToInvoice" />
</van-grid>
</view>
</view>
</swiper-item>
</block>
</swiper>
<van-grid column-num="2" direction="horizontal">
<van-grid-item icon="balance-list-o" text="充值" bind:tap="jumpToRecharge" />
<van-grid-item icon="shop-o" text="商城" bind:tap="jumpToShop" />
</van-grid>
</view>
<picker show="{{show}}" valueKey="name" columns="{{columns}}" bind:ok="onOk" bind:cancel="onCancel" type="{{pickerType}}" />

View File

@@ -21,118 +21,47 @@
.park {
margin-left: 20rpx;
max-width: 200rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.parkContent {
display: flex;
align-items: center;
font-size: 32rpx;
}
.notLoginWrapper, .logined {
padding: 30rpx 32rpx;
padding: 24rpx 32rpx;
padding-left: 50rpx;
background-color: var(--middle-green);
display: flex;
align-items: center;
}
.loginBtn {
.loginBtn, .company {
margin-left: 30rpx;
}
.rechargeWrapper {
background: linear-gradient(to bottom, var(--middle-green), #fff );
.company {
font-size: 32rpx;
display: flex;
color: #fff;
}
.companyName {
max-width:300rpx;
overflow: hidden;
}
.card {
margin-top: 1vh;
margin-left: 46rpx;
margin-right: 46rpx;
border-radius: 30rpx;
padding: 28rpx 30rpx;
/* background-color: rgb(173, 217, 203); */
background: linear-gradient(to bottom right, rgb(212, 240, 231), rgb(145, 206, 185));
}
.cardTop {
display: flex;
align-items: center;
}
.cardTopLeft {
display: flex;
align-items: center;
flex: 1;
}
.cardContent {
margin: 30rpx 20rpx 0;
}
.cardItem {
display: flex;
align-items: center;
margin-bottom: 30rpx;
font-size: 34rpx;
}
.cardItemValue {
display: flex;
flex: 1;
align-items: center;
}
.cardItemValue .text {
flex: 1;
}
.recharge {
background: #fff;
padding: 20rpx 30rpx;
margin-top: 30rpx;
margin-left: 46rpx;
margin-right: 46rpx;
margin-bottom: 40rpx;
border-radius: 30rpx;
}
.operate {
margin-left: 46rpx;
margin-right: 46rpx;
margin-bottom: 40rpx;
text-overflow: ellipsis;
white-space: nowrap;
}
.welcome {
margin-top: 20rpx;
margin-left: 30rpx;
font-size: 32rpx;
color: #fff;
}
.moneyBox {
display: flex;
justify-content: space-between;
margin-top: 30rpx;
}
.money {
flex: 1;
padding: 16rpx;
display: flex;
justify-content: center;
align-items: center;
border: 1rpx solid #ccc;
margin-right: 30rpx;
}
.moneyInput {
margin-top: 30rpx;
margin-bottom: 30rpx;
}
.others {
margin-left: 46rpx;
margin-right: 46rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
font-size: 30rpx;
color: rgba(255,255,255, .85);
}

View File

@@ -1,5 +1,5 @@
import { getInvoiceInfoDetail, downloadInvoice } from "../../service/invoice";
import { alertInfo, loadingFunc } from "../../utils/index";
import { alertError, alertInfo, loadingFunc } from "../../utils/index";
import request from '../../utils/request'
const { OK } = request;
// pages/invoiceInfo/index.js
@@ -43,10 +43,18 @@ Page({
alertInfo(message)
return;
}
if (!data) {
alertInfo("暂无文档信息")
return
}
wx.downloadFile({
url: data,
success(res) {
if (res.statusCode === 200) {
if (!res.tempFilePath) {
alertError("没有开票信息")
return;
}
wx.openDocument({
filePath: res.tempFilePath,
fileType: [res.tapIndex === 0 ? 'xml' : "pdf"], // 3. 这个必须写合法类型,不然下载不了
@@ -54,11 +62,15 @@ Page({
},
fail: function (e) {
alertError("打开失败")
console.log('打开失败错误为', e)
}
})
}
},
fail: (e) => {
console.log('e', e)
alertInfo("下载文件失败")
}
})
})

View File

@@ -50,7 +50,7 @@
</view> -->
<navigator title="发票详细" canBack="{{true}}" bind:back="back" />
<view wx:if="{{detail.status === 1}}">
<view wx:if="{{detail.status === 2}}">
<view class="wrapper">
<view style="margin-top: 40rpx;"> 尊敬的客户,您好: </view>
<view style="margin-top: 20rpx;"> 已经为您开具订单{{detail.id}}的发票发票数量共计1张如下 </view>
@@ -63,9 +63,12 @@
<van-button type="info" style="flex: 1;margin-left: 40rpx;" block bind:click="jumpToDetail"> 发票明细 </van-button>
</view>
</view>
<view wx:if="{{detail.status === 0}}">
<view wx:if="{{detail.status === 1}}">
<view class="wrapper">
<view style="margin-top: 40rpx;"> 尊敬的客户,您好: </view>
<view style="margin-top: 20rpx;"> 开票申请已提交,系统正在开票中,请您稍后再查看。 </view>
</view>
<view class="operate">
<van-button type="info" style="flex: 1;" block bind:click="jumpToDetail"> 发票明细 </van-button>
</view>
</view>

View File

@@ -56,7 +56,7 @@
title-width="160rpx"
/>
<van-field
value="{{detail.invoice.type === 0 ? '普通电子发票' : '增值税专用电子发票'}}"
value="{{detail.invoice.type === 0 ? '普通发票' : '增值税专用发票'}}"
label="发票类型 :"
readonly
autosize="{{true}}"

View File

@@ -35,7 +35,7 @@ Component({
const { page, list = [] } = this.data;
const { code, message, data } = await getAlreadyInvoiceList(page);
if (!data.length) {
alertInfo("没更多数据了")
alertInfo("没更多数据了")
return
}
this.setData({

View File

@@ -8,17 +8,18 @@
{{item.invoice.name}}
</view>
<view class="invoiceContent">
发票内容: {{item.invoice.content}}
发票内容: {{item.invoice.content}}{{item.money}}元)
</view>
<view class="invoiceType">
发票类型:{{ item.invoice.type === 0 ? '普通电子发票' : '增值税专用电子发票' }}
发票类型:{{ item.invoice.type === 0 ? '普通发票' : '增值税专用发票' }}
</view>
<view class="time">
{{item.finishTime}}
</view>
</view>
<view class="right">
<view class="money"> ¥{{item.money}} </view>
<view class="money"> </view>
<view class="operate">
<view style="margin-top: 20rpx; margin-bottom: 20rpx;">
<van-button type="info" class="invoiceBtn" bind:click="submit" size="small" bind:click="jumpToDetail" data-id="{{item.id}}">发票</van-button>
@@ -26,6 +27,10 @@
<van-button type="info" class="detailBtn" bind:click="submit" size="small" bind:click="jumpToDetailContent" data-id="{{item.id}}">明细</van-button>
</view>
</view>
<view class="{{item.status === 1 ? 'approving' : 'already'}}">
<view wx:if="{{item.status === 1}}"> 审核中 </view>
<view wx:else> 已开票 </view>
</view>
</view>
<view style="height: 50rpx;"></view>
</scroll-view>

View File

@@ -8,15 +8,17 @@
background-color: #fff;
border-radius: 26rpx;
padding: 20rpx;
box-sizing: border-box
;
box-sizing: border-box;
position: relative;
}
.left {
flex: 1;
}
.right {
display: flex;
flex-direction: column;
justify-content: flex-end;
}
.detailBtn {
margin-top: 20rpx;
@@ -31,3 +33,31 @@
margin-top: 30rpx;
font-size: 32rpx;
}
.operate {
display: flex;
flex-direction: column;
justify-content: flex-end;
}
.approving {
position: absolute;
top: 0;
right: 0;
font-size: 30rpx;
background-color: rgb(239,227,227);
padding: 14rpx 24rpx;
border-radius: 18rpx;
color: rgb(224, 106, 106)
}
.already {
position: absolute;
top: 0;
right: 0;
font-size: 30rpx;
background-color: #0958d9;
padding: 14rpx 24rpx;
border-radius: 18rpx;
color: #fff;
/* color: var(--deep-green) */
}

View File

@@ -1,6 +1,6 @@
import { getInvoiceInfo, updateInvoiceInfo } from "../../../../service/invoice"
import { getUserInfo } from "../../../../service/user";
import { alertInfo, alertSuccess } from "../../../../utils/index";
import { alertInfo, alertSuccess, isValidPhoneNumber } from "../../../../utils/index";
import request from '../../../../utils/request'
const { OK } = request
@@ -93,9 +93,9 @@ Component({
// alertInfo("请输入地址")
// return;
// }
if (!phone) {
alertInfo("请输入电话")
return;
if (phone && !isValidPhoneNumber(phone)) {
alertInfo("手机号格式不正确")
return
}
if (!bank) {
alertInfo("请输入开户行")

View File

@@ -12,45 +12,52 @@
</view>
<view slot="content">
<view wx:if="{{editType === 'detail'}}">
<van-field
label="发票类型"
readonly="{{editType === 'detail'}}"
readonly="{{true}}"
autosize="{{true}}"
type="textarea"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
>
<view slot="input" style="margin-top: 16rpx;" wx:if="{{editType === 'edit'}}">
<van-radio-group direction="horizontal" value="{{formData.type}}" bind:change="onChangeType">
<van-radio name="{{0}}" icon-size="30rpx" style="font-size: 30rpx;margin-bottom: 20rpx;">普通电子</van-radio>
<van-radio name="{{1}}" icon-size="30rpx" style="font-size: 30rpx;">增值税专用电子</van-radio>
</van-radio-group>
</view>
border="{{ false }}"
value="普通发票"
wx:if="{{detail.type === 0}}"
/>
<van-field
label="发票类型"
readonly="{{true}}"
autosize="{{true}}"
<view wx:else slot="input" style="margin-top: -10rpx;">
<view wx:if="{{detail.type === 0}}"> 普通电子发票 </view>
<view wx:elif="{{detail.type === 1}}"> 增值税专用电子发票 </view>
<view wx:else>-</view>
</view>
</van-field>
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ false }}"
value="增值税专用发票"
wx:elif="{{detail.type === 1}}"
/>
<van-field
label="发票类型"
readonly="{{true}}"
autosize="{{true}}"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ false }}"
value="-"
wx:elif="{{detail.type === 1}}"
/>
<van-field
label="抬头类型"
readonly="{{editType === 'detail'}}"
readonly="{{true}}"
autosize="{{true}}"
type="textarea"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
border="{{ false }}"
value="企业单位"
wx:if="{{detail.headerType === 0}}"
>
<view slot="input" style="margin-top: 16rpx;" wx:if="{{editType === 'edit'}}">
<van-radio-group direction="horizontal" bind:change="onChangeHeaderType" value="{{formData.headerType}}">
<van-radio name="{{0}}" icon-size="30rpx" style="font-size: 30rpx;margin-bottom: 20rpx;">企业单位</van-radio>
<van-radio name="{{1}}" icon-size="30rpx" style="font-size: 30rpx;">个人/非企业单位</van-radio>
</van-radio-group>
</view>
<view
wx:else
slot="input"
style="margin-top: -10rpx;"
>
@@ -60,196 +67,258 @@
</view>
</van-field>
<van-field
wx:if="{{editType === 'detail'}}"
value="{{detail.name || '--'}}"
label="抬头类型"
readonly="{{true}}"
autosize="{{true}}"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ false }}"
value="个人/非企业单位"
wx:elif="{{detail.headerType === 1}}"
/>
<van-field
label="抬头类型"
readonly="{{true}}"
autosize="{{true}}"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ false }}"
value="个人/非企业单位"
wx:else
/>
<van-field
value="{{detail.name || '-'}}"
label="发票抬头"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{true}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ false }}"
>
</van-field>
<van-field
label="发票税号"
value="{{detail.tin || '-'}}"
wx:if="{{detail.headerType === 0}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
>
</van-field>
<van-field
value="{{detail.bank || '-'}}"
label="开户行"
wx:if="{{detail.headerType === 0}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
>
</van-field>
<van-field
label="银行账号"
value="{{detail.account || '-'}}"
wx:if="{{(detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入银行账号' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="account"
>
</van-field>
<van-field
label="地址"
wx:if="{{(detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入地址' : ''}}"
custom-style="padding-left: 0; padding-right: 0; height: auto;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="address"
value="{{detail.address || '-'}}"
>
</van-field>
<van-field
label="备注"
wx:if="{{editType === 'detail' }}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="remark"
value="{{detail.remark || '-'}}"
>
<!-- <view slot="input" style="margin-top: -10rpx;">
<view> {{detail.remark || '-'}} </view>
</view> -->
</van-field>
</view>
<view wx:else>
<van-field
label="发票类型"
autosize="{{true}}"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ true }}"
>
<view slot="input" style="margin-top: 16rpx;">
<van-radio-group direction="horizontal" value="{{formData.type}}" bind:change="onChangeType">
<van-radio name="{{0}}" icon-size="30rpx" style="font-size: 30rpx;margin-bottom: 20rpx;">普通发票</van-radio>
<van-radio name="{{1}}" icon-size="30rpx" style="font-size: 30rpx;">增值税专用发票</van-radio>
</van-radio-group>
</view>
</van-field>
<van-field
label="抬头类型"
autosize="{{true}}"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ true }}"
>
<view slot="input" style="margin-top: 16rpx;">
<van-radio-group direction="horizontal" bind:change="onChangeHeaderType" value="{{formData.headerType}}">
<van-radio name="{{0}}" icon-size="30rpx" style="font-size: 30rpx;margin-bottom: 20rpx;">企业单位</van-radio>
<van-radio name="{{1}}" icon-size="30rpx" style="font-size: 30rpx;">个人/非企业单位</van-radio>
</van-radio-group>
</view>
</van-field>
<van-field
wx:if="{{formData.headerType === 0 }}"
value="{{formData.name || '--'}}"
label="发票抬头"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{true}}"
disabled="{{true}}"
title-width="132rpx"
border="{{ true }}"
/>
<van-field
wx:else
value="{{formData.name}}"
label="发票抬头"
custom-style="padding-left: 0; padding-right: 0;"
disabled="{{formData.headerType !== 1}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
bind:change="onChangeText"
data-name="name"
bind:change="onChangeText"
border="{{ true }}"
/>
<van-field
value="{{detail.tin|| '--'}}"
label="发票税号"
wx:if="{{editType === 'detail' && detail.headerType === 0}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
/>
<van-field
value="{{formData.tin }}"
label="发票税号"
wx:if="{{editType === 'edit' && formData.headerType === 0}}"
placeholder="{{editType === 'edit' ? '请输入发票税号' : ''}}"
wx:if="{{formData.headerType === 0}}"
placeholder="{{'请输入发票税号'}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
bind:change="onChangeText"
data-name="tin"
border="{{ editType === 'detail' ? false : true }}"
/>
<van-field
value="{{detail.bank || '--'}}"
label="开户行"
wx:if="{{editType === 'detail' && detail.headerType === 0}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
border="{{true }}"
/>
<van-field
value="{{formData.bank}}"
label="开户行"
wx:if="{{editType === 'edit' && formData.headerType === 0}}"
wx:if="{{ formData.headerType === 0}}"
placeholder="{{'请输入开户行'}}"
custom-style="padding-left: 0; padding-right: 0;"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
border="{{ true }}"
bind:change="onChangeText"
data-name="bank"
/>
<van-field
value="{{detail.account || '--'}}"
label="银行账号"
wx:if="{{(editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入银行账号' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="account"
/>
<van-field
value="{{formData.account}}"
label="银行账号"
wx:if="{{(editType === 'edit' && formData.headerType === 0) }}"
placeholder="{{editType === 'edit' ? '请输入银行账号' : ''}}"
wx:if="{{(formData.headerType === 0) }}"
placeholder="{{'请输入银行账号' }}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
border="{{true }}"
bind:change="onChangeText"
data-name="account"
/>
<van-field
value="{{detail.address || '--'}}"
label="地址"
wx:if="{{(editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入地址' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="address"
/>
<van-field
value="{{formData.address}}"
label="地址"
wx:if="{{(editType === 'edit' && formData.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入地址' : ''}}"
wx:if="{{(formData.headerType === 0)}}"
placeholder="{{'请输入地址'}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
border="{{ true }}"
bind:change="onChangeText"
data-name="address"
/>
<van-field
value="{{detail.phone || '--'}}"
label="电话"
wx:if="{{(editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入电话' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="phone"
/>
<van-field
value="{{formData.phone }}"
label="电话"
wx:if="{{(editType === 'edit' && formData.headerType === 0) }}"
placeholder="{{editType === 'edit' ? '请输入电话' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="phone"
/>
<van-field
value="{{detail.remark || '--'}}"
label="备注"
wx:if="{{editType === 'detail' }}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="remark"
/>
<van-field
value="{{formData.remark}}"
label="备注"
wx:else
placeholder="{{editType === 'edit' ? '请输入备注' : ''}}"
placeholder="{{'请输入备注'}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
border="{{true }}"
bind:change="onChangeText"
data-name="remark"
/>
</view>
</view>
</card>
</view>
<view class="cardWrapper" style="margin-bottom: 40rpx;">
<card title="接收信息">
<view slot="content">
<view wx:if="{{editType === 'detail'}}">
<van-field
label="手机号"
wx:if="{{(detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入手机号' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="phone"
value="{{detail.phone || '-'}}"
>
</van-field>
</view>
<view wx:else>
<van-field
value="{{formData.phone }}"
label="手机号"
wx:if="{{(formData.headerType === 0) }}"
placeholder="{{ '请输入手机号' }}"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ true }}"
bind:change="onChangeText"
data-name="phone"
/>
</view>
<van-field
value="{{detail.email || '--'}}"
wx:if="{{editType === 'detail'}}"
@@ -257,24 +326,24 @@
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="email"
/>
value="{{detail.email || '-'}}"
>
</van-field>
<van-field
value="{{formData.email}}"
wx:else
label="电子邮箱"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="email"
placeholder="请输入电子邮箱"
/>
</view>
</card>

View File

@@ -34,11 +34,12 @@ Component({
methods: {
async init() {
const { code, message, data } = await getInvoiceList();
// if (code !== OK) {
// alertInfo(message)
// return;
// }
this.setData({ list: data, selectList: new Array(data?.length).map(() => false) })
if (code !== OK) {
alertInfo(message)
return;
}
this.setData({ list: data, selectList: new Array(data?.length).map(() => false), allChecked: false, })
},
onRefresh() {
loadingFunc(() => this.init())
@@ -67,6 +68,7 @@ Component({
this.setData({
// chooseList: newList,
selectList: newSelectList,
allChecked: selectCount === list.length,
selectCount,
selectMoney: Number(selectMoney.toFixed(2))
})
@@ -92,6 +94,16 @@ Component({
wx.navigateTo({
url: `/pages/invoicing/index?money=${selectMoney}&count=${selectCount}&tenement=${tenementID}&ids=${ids}&tenementName=${tenementName}`,
})
},
onAllChecked(e) {
const { list } = this.data;
if (e.detail) {
const newSelectList = Array.from({ length: list.length }, () => true)
this.setData({ selectList: newSelectList, selectCount: list.length, selectMoney: list.map(item => item.money).reduce((prev, next) => prev + next).toFixed(2), allChecked: true })
} else {
this.setData({ allChecked: false, selectMoney: 0, selectList: [], selectCount: 0 })
}
}
}
})

View File

@@ -25,10 +25,15 @@
</van-checkbox-group>
<view class="allSelect">
<van-checkbox value="{{ allChecked }}" bind:change="onAllChecked">
全选
</van-checkbox>
<view style="flex: 1; display: flex; align-items: center; justify-content: flex-end;">
<view class="allNumber"> {{ selectCount }} </view>
笔订单,共
<view class="allMoney"> ¥ {{selectMoney}} </view>
<van-button size="small" type="info" bind:click="next" disabled="{{!selectCount}}"> 下一步 </van-button>
</view>
</view>
</view>

View File

@@ -47,6 +47,7 @@
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
}
.allNumber {
@@ -56,8 +57,8 @@
}
.allMoney {
flex: 1;
margin-left: 20rpx;
margin-right: 20rpx;
color: var(--money-color);
}

View File

@@ -38,7 +38,7 @@ Page({
if (user.isAdmin) {
wx.showModal({
title: '提示',
content: '当前公司没开票信息,请先前往开票信息页面编辑开票信息',
content: '当前公司没开票信息,请先前往开票信息页面编辑开票信息',
confirmText: '前往编辑',
cancelText: '取消',
complete: (res) => {
@@ -57,7 +57,7 @@ Page({
} else {
wx.showModal({
title: '提示',
content: '当前公司没开票信息,请联系管理员编辑完开票信息之后再开票',
content: '当前公司没开票信息,请联系管理员编辑完开票信息之后再开票',
showCancel: false,
confirmText: '返回',
complete: (res) => {

View File

@@ -7,8 +7,8 @@
<view>
<card title="发票类型">
<van-radio-group disabled="{{true}}" direction="horizontal" slot="content" value="{{detail.type}}">
<van-radio name="{{0}}" icon-size="30rpx" style="font-size: 32rpx;margin-bottom: 20rpx;">普通电子发票</van-radio>
<van-radio name="{{1}}" icon-size="30rpx" style="font-size: 32rpx;">增值税专用电子发票</van-radio>
<van-radio name="{{0}}" icon-size="30rpx" style="font-size: 32rpx;margin-bottom: 20rpx;">普通发票</van-radio>
<van-radio name="{{1}}" icon-size="30rpx" style="font-size: 32rpx;">增值税专用发票</van-radio>
</van-radio-group>
</card>
</view>
@@ -71,7 +71,7 @@
disabled="{{true}}"
/>
<van-field
value="{{ detail.address }}"
value="{{ detail.phone }}"
wx:if="{{detail.headerType === 0}}"
label="电话"
readonly
@@ -120,7 +120,7 @@
border="{{false}}"
/>
<van-field
value="{{ detail.type === 0 ? '普通电子发票' : '增值税专用电子发票' }}"
value="{{ detail.type === 0 ? '普通发票' : '增值税专用发票' }}"
label="发票类型"
readonly
title-width="132rpx"

View File

@@ -20,19 +20,19 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad() {
const user = wx.getStorageSync('user')
if (!user || !user.id) {
return;
}
// const user = wx.getStorageSync('user')
// if (!user || !user.id) {
// return;
// }
// if (user.status === 0 || user.status === 2) {
// wx.redirectTo({
// url: '/pages/waitApprove/index',
// })
// return
// }
wx.switchTab({
url: '/pages/home/index',
})
// wx.switchTab({
// url: '/pages/home/index',
// })
},
/**

View File

@@ -1,6 +1,6 @@
import { alertInfo } from "../../utils/index";
import { alertInfo, alertSuccess } from "../../utils/index";
import Dialog from '@vant/weapp/dialog/dialog';
import { getUserInfo } from "../../service/user";
import { getUserInfo, logout } from "../../service/user";
import { getDot } from "../../utils/system";
import request from "../../utils/request"
const { OK } = request;
@@ -69,7 +69,7 @@ Page({
},
jumpToUpdateInvoice() {
wx.navigateTo({
url: '/pages/updateInvoice/index',
url: '/pages/invoiceList/index?tab=2',
})
},
async getUnReadNumber() {
@@ -78,11 +78,27 @@ Page({
dot
})
},
logout() {
async logout() {
Dialog.alert({
title: '提示',
message: '确认退出登录?',
showCancelButton: true,
}).then(async () => {
const { code, message } = await logout()
if (code !== OK) {
alertInfo(message)
return;
}
wx.clearStorageSync()
wx.switchTab({
url: '/pages/home/index',
})
});
},
jumpToQuestions() {
wx.navigateTo({
url: '/pages/questions/index',
})
},
bindTenement() {
wx.navigateTo({

View File

@@ -17,6 +17,7 @@
</van-cell>
<van-cell title="发票抬头" value="" is-link bind:tap="jumpToUpdateInvoice" />
<van-cell title="绑定企业" value="" is-link bind:tap="bindTenement" />
<!-- <van-cell title="常见问题" value="" is-link bind:tap="jumpToQuestions" /> -->
<van-cell title="退出登录" value="" is-link bind:tap="logout" />
<!-- </van-cell-group> -->
<!-- <van-cell-group title=" ">

View File

@@ -23,7 +23,9 @@ Page({
*/
onLoad(options) {
// this.getList()
this.getCode()
loadingFunc(async () => {
await this.getCode()
})
},
async getList() {
const { code, message, data } = await getOwnTenementList()

View File

@@ -1,7 +1,9 @@
{
"usingComponents": {
"van-image": "@vant/weapp/image/index"
"van-image": "@vant/weapp/image/index",
"navigator": "/components/navigator/index"
},
"navigationBarTitleText": "二维码"
"navigationBarTitleText": "二维码",
"navigationStyle": "custom"
}

View File

@@ -8,7 +8,7 @@
</view>
</view> -->
<navigator title="二维码" canBack="{{true}}" />
<view class="wrapper">
<view class="image">
<van-image width="400rpx" height="400rpx" src="{{url}}" />

View File

@@ -1,7 +1,5 @@
/* pages/qrCode/index.wxss */
.wrapper {
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
@@ -22,7 +20,6 @@
.tenement {
display: flex;
align-items: center;
}
.name {
@@ -33,4 +30,5 @@
margin: 50rpx 40rpx;
display: flex;
justify-content: center;
margin-top: 10vh;
}

View File

@@ -2,5 +2,6 @@
"usingComponents": {
"navigator": "/components/navigator/index",
"scrollPageWrapper": "/components/scrollPageWrapper/index"
}
},
"navigationStyle": "custom"
}

View File

@@ -9,17 +9,4 @@
</view>
</scroll-view>
</view>
<!-- <movable-area>
<movable-view x="{{x}}" y="{{y}}" direction="all">
<rich-text nodes="<div style='color:red;font-size:46px'>1234</div>"></rich-text>
</movable-view>
</movable-area> -->
<!-- <movable-area style="width: 500rpx; height: 500rpx;background-color: red;">
<movable-view x="{{x}}" y="{{y}}" direction="all">
<view style="width: 100rpx; height: 100rpx;background-color: blue;"> 1111 </view>
</movable-view>
</movable-area> -->
</scrollPageWrapper>

View File

@@ -1,32 +1,202 @@
import { getMeterDetail } from "../../service/meter";
import { getGlobalData, showModal } from "../../utils/index";
import { getMeterDetail, getTenementMeterList } from "../../service/meter";
import request from '../../utils/request';
import { getUserInfo } from "../../service/user"
import { alertInfo, alertSuccess, loadingFunc } from "../../utils/index";
import { requestRecharge } from "../../service/recharge";
const { OK } = request;
// pages/recharge/index.js
Page({
/**
* 页面的初始数据
*/
data: {
money: 0,
moneyIndex: -1,
primaryColor: getGlobalData().primaryColor,
defaultMoneyArray: [100, 200, 500, 1000, 2000],
customFlag: false,
detail: {}
meterList: [],
meter: {},
actions: [
{ name: '微信支付', },
{ name: '对公支付', disabled: true },
],
user: {},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { tenement, code } = options
this.init({ tenement, code })
},
async init(options) {
const { code, message, data = {}} = await getMeterDetail(options)
onLoad() {
const tenement = wx.getStorageSync('tenement')
const park = wx.getStorageSync('park')
this.setData({
detail: data
tenement, park
})
this.init(park, tenement)
},
async changeMeter() {
const { meterList = [] } = this.data;
const newColumns = meterList.map(item => { item.id = item.code; item.name = `${item.code} - ${item.address}`; return item; })
this.setData({
columns: newColumns,
show: true,
pickerType: "meter"
})
},
onOk(e) {
const { type } = e.detail;
switch(type) {
case "meter":
const { id } = e.detail.value;
this.handleGetMeterDetail(id)
break;
}
},
async init(park, tenement) {
this.getMeters({ id: tenement?.id })
},
async refreshMeter() {
const { meter } = this.data;
this.handleGetMeterDetail(meter.id);
},
async handleGetMeterDetail(meterId) {
const { tenement } = this.data;
const { code, message, data } = await getMeterDetail({ tenement: tenement?.id, id: meterId });
if (code !== OK) {
alertInfo(message);
return;
}
this.setData({
meter: data,
show: false,
})
},
onCancel() {
this.setData({
show: false,
})
},
async setUser() {
const result = await getUserInfo();
if (result.code !== OK) {
const user = wx.getStorageSync('user')
this.setData({ user: user })
return;
}
this.setData({ user: result.data })
wx.setStorageSync('user', result.data)
},
async recharge() {
const { user, money, meter, tenement, park } = this.data;
if (!user || !user.id) {
alertInfo("请先登录")
return
}
if (!money) {
alertInfo("请先输入金额")
return;
}
if (!meter?.code) {
alertInfo("没有选择表计")
return;
}
if (money < 0.01) {
alertInfo("最少为1分")
return
}
// wx.navigateTo({
// url: `/pages/rechargeWay/index?money=${money}&address=${meter.address}&id=${meter?.id}&tenement=${tenement?.id}&park=${park.id}`,
// })
this.setData({ rechargeVisible: true })
},
async getMeters({ id }) {
const { code, message, data } = await getTenementMeterList(id);
if (code !== OK) {
alertInfo(message)
this.setData({ meterList: [], meter: {} })
wx.setStorageSync('meter', {})
return;
}
this.setData({
meterList: data || [],
meter: (data?.[0] || {})
})
// if (!storageMeter) {
wx.setStorageSync('meter', data?.[0] || {} )
// }
},
changeMoney(e) {
const { money } = e.currentTarget.dataset;
this.setData({
money: money
})
},
onChangeMoney(e) {
this.setData({ money: e.detail })
},
onCloseRechargeWay() {
this.setData({ rechargeVisible: false })
},
onSelectRechargeWay(e) {
const that = this;
switch(e.detail.name) {
case "对公支付":
alertInfo("开发中")
break;
default:
loadingFunc(async () => {
await that.wxRecharge();
})
break;
}
},
jumpToRecord() {
wx.navigateTo({
url: '/pages/rechargeRecord/index',
})
},
jumpToOrder() {
// alertInfo("尚未完成")
wx.navigateTo({
url: '/pages/billList/index',
})
},
jumpToElectric() {
wx.navigateTo({
url: '/pages/electricQuery/index',
})
},
jumpToInvoice() {
wx.navigateTo({
url: '/pages/invoiceList/index',
})
},
async wxRecharge() {
const { money, meter, tenement, park } = this.data;
const that = this;
const { code, message, data } = await requestRecharge({ money: Number(money), id: meter?.id, tenement: tenement?.id, park: park?.id })
if (code !== OK) {
alertInfo(message)
return;
}
wx.requestPayment({
timeStamp: data?.time,
nonceStr: data?.nonceStr,
package: "prepay_id=" + data?.prepay_id,
paySign: data?.paySign,
signType: 'RSA',
success: (res) => {
alertSuccess("充值成功")
that.setData({
money: null
})
},
fail: (res) => {
console.log('fail', res)
alertInfo("请稍后重试")
},
complete: (res) => {
console.log('complete')
that.handleGetMeterDetail(meter.id)
}
})
},
/**
@@ -40,7 +210,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.setUser();
},
chooseMoney(e) {
const { money, index } = e.currentTarget.dataset;
@@ -69,13 +239,6 @@ Page({
money: money,
})
},
async recharge() {
const { detail = {}, money } = this.data;
const confirmResult = await showModal({ title: "充值确认", content: `确认充值表号为${detail?.meter?.code}的表计${money}元吗?` });
if (!confirmResult) {
return;
}
},
/**
* 生命周期函数--监听页面隐藏
*/

View File

@@ -4,7 +4,12 @@
"van-grid": "@vant/weapp/grid/index",
"van-grid-item": "@vant/weapp/grid-item/index",
"van-row": "@vant/weapp/row/index",
"van-button": "@vant/weapp/button/index",
"picker": "/components/picker/index",
"van-field": "@vant/weapp/field/index",
"van-action-sheet": "@vant/weapp/action-sheet/index",
"van-col": "@vant/weapp/col/index"
},
"navigationBarTitleText": "充值"
"navigationBarTitleText": "充值",
"navigationStyle": "custom"
}

View File

@@ -1,76 +1,77 @@
<!--pages/recharge/index.wxml-->
<view class="wrapper">
<!-- <van-grid column-num="2" center="{{false}}">
<van-grid-item icon="photo-o" text="文字" use-slot>
<view>
<view class="gridTitle"> 充值表号: </view>
<view class="gridContent"> {{ detail.meter.code }} </view>
<navigator title="充值" canBack="true" />
<view class="rechargeWrapper">
<view class="card">
<view class="cardTop">
<view class="cardTopLeft">
<view wx:if="{{user.id}}"> {{ tenement.shortName}} - {{ meter.address }} </view>
<view wx:else> -- </view>
</view>
</van-grid-item>
<van-grid-item icon="photo-o" text="文字" use-slot>
<view>
<view class="gridTitle"> 表计地址: </view>
<view class="gridContent"> {{ detail.meter.address }} </view>
<van-button type="info" size="small" plain="{{true}}" class="loginBtn" bind:click="changeMeter" wx:if="{{user.id}}">
<van-icon name="exchange" />
切换电表
</van-button>
</view>
</van-grid-item>
<van-grid-item icon="photo-o" text="文字" use-slot>
<view>
<view class="gridTitle"> 剩余金额: </view>
<view class="gridContent"> {{ detail.money }} </view>
<view class="cardContent">
<view class="cardItem">
<view class="cardItemLabel"> 电表编号: </view>
<view class="cardItemValue" wx:if="{{user.id}}"> {{meter.code}} </view>
<view class="cardItemValue" wx:else> -- </view>
</view>
</van-grid-item>
<van-grid-item icon="photo-o" text="文字" use-slot>
<view>
<view class="gridTitle"> 公司名称: </view>
<view class="gridContent"> {{ detail.tenement.name }} </view>
<view class="cardItem">
<view class="cardItemLabel"> 电表地址: </view>
<view class="cardItemValue" wx:if="{{user.id}}"> {{meter.address}} </view>
<view class="cardItemValue" wx:else> -- </view>
</view>
</van-grid-item>
</van-grid> -->
<van-row gutter="10">
<van-col span="12">
<view class="title">充值表号:</view>
<view class="content">{{ detail.meter.code }}</view>
</van-col>
<van-col span="12">
<view class="title">表计地址:</view>
<view class="content">{{ detail.meter.address }}</view>
</van-col>
<van-col span="12" custom-class="colBottom">
<view class="title">剩余金额:</view>
<view class="content">{{ detail.money }}</view>
</van-col>
<van-col span="12" custom-class="colBottom">
<view class="title">公司名称:</view>
<view class="content">{{ detail.tenement.name }}</view>
</van-col>
</van-row>
<view class="moneyBoxs">
<view
wx:for="{{defaultMoneyArray}}"
class="moneyBox border radius12"
style="background-color: {{moneyIndex === index ? primaryColor : ''}};"
wx:key="index"
bind:tap="chooseMoney"
data-money="{{item}}"
data-index="{{index}}"
> {{item}} </view>
<view class="moneyBox border radius12" bind:tap="custom"> 自定义 </view>
<view class="cardItem">
<view class="cardItemLabel"> 电表余额: </view>
<view class="cardItemValue" style="position: relative;">
<view class="text" wx:if="{{user.id}}"> {{meter.money}} </view>
<view class="text" wx:else> --- </view>
<van-button type="info" size="small" plain="{{true}}" custom-style="position: absolute; right: 0; bottom: 0;z-index: 99;" bind:click="refreshMeter" wx:if="{{user.id}}">
<van-icon name="replay" />
刷新
</van-button>
</view>
<view
class="customInput border radius12"
wx:if="{{customFlag}}"
>
<input
type="number"
focus
placeholder="请输入要充值的金额"
bindinput="onChangeCustomMoney"
</view>
</view>
</view>
<view class="recharge">
<view> 请输入金额: </view>
<view class="moneyBox">
<view class="money" bind:tap="changeMoney" data-money="30"> ¥30 </view>
<view class="money" bind:tap="changeMoney" data-money="50"> ¥50 </view>
<view class="money" bind:tap="changeMoney" data-money="100"> ¥100 </view>
<view class="money" style="margin-right: 0;" bind:tap="changeMoney" data-money="200"> ¥200 </view>
</view>
<view class="moneyInput">
<van-field
value="{{ money }}"
placeholder="请输入充值金额"
border="{{true}}"
bind:change="onChangeMoney"
size="large"
type="digit"
/>
</view>
</view>
<view class="operate">
<button type="primary" bind:tap="recharge" disabled="{{!money}}"> 充值 </button>
<van-button color="rgb(88, 165, 141)" block bind:click="recharge">去缴费</van-button>
</view>
<view class="others">
<van-grid direction="horizontal" column-num="2">
<van-grid-item icon="balance-list-o" text="电费账单" bind:click="jumpToOrder">
</van-grid-item>
<van-grid-item icon="after-sale" text="缴费记录" bind:click="jumpToRecord" />
<van-grid-item icon="bar-chart-o" text="用电查询" bind:click="jumpToElectric" />
<van-grid-item icon="bill-o" text="去开票" bind:click="jumpToInvoice" />
</van-grid>
</view>
</view>
<van-action-sheet
show="{{ rechargeVisible }}"
actions="{{ actions }}"
bind:close="onCloseRechargeWay"
bind:select="onSelectRechargeWay"
/>
<picker show="{{show}}" valueKey="name" columns="{{columns}}" bind:ok="onOk" bind:cancel="onCancel" type="{{pickerType}}" />

View File

@@ -1,62 +1,99 @@
/* pages/recharge/index.wxss */
.moneyBoxs {
margin-top: 32rpx;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
.rechargeWrapper {
background: linear-gradient(to bottom, var(--middle-green), #fff );
overflow: hidden;
padding-top: 30rpx;
}
.moneyBox {
width: 30%;
height: 140rpx;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 24rpx;
.card {
margin-top: 0rpx;
margin-left: 46rpx;
margin-right: 46rpx;
border-radius: 30rpx;
padding: 22rpx 30rpx;
/* background-color: rgb(173, 217, 203); */
background: linear-gradient(to bottom right, rgb(212, 240, 231), rgb(145, 206, 185));
}
.chooseMeter {
.cardTop {
display: flex;
align-items: center;
margin-top: 10rpx;
}
.selectMeter {
margin-left: 24rpx;
.cardTopLeft {
display: flex;
align-items: center;
flex: 1;
font-size: 33rpx;
}
.cardContent {
margin: 30rpx 20rpx 0;
}
.cardItem {
display: flex;
align-items: center;
margin-bottom: 30rpx;
font-size: 32rpx;
}
.cardItem:last-child {
margin-bottom: 12rpx;
}
.cardItemValue {
display: flex;
flex: 1;
align-items: center;
}
.cardItemValue .text {
flex: 1;
}
.recharge {
background: #fff;
padding: 20rpx 30rpx;
margin-top: 24rpx;
margin-left: 46rpx;
margin-right: 46rpx;
margin-bottom: 30rpx;
border-radius: 30rpx;
}
.operate {
margin-top: 24rpx;
}
.input {
height: 40rpx;
width: 400rpx;
line-height: 40rpx;
border-radius: 20rpx;
padding: 12rpx 14rpx 16rpx;
/* border: 1rpx solid #ccc; */
}
.customInput {
padding: 16rpx 24rpx;
}
.gridTitle {
margin-left: 46rpx;
margin-right: 46rpx;
margin-bottom: 24rpx;
}
.colBottom {
margin-top: 40rpx;
.moneyBox {
display: flex;
justify-content: space-between;
margin-top: 30rpx;
}
.title {
font-weight: 600;
font-size: 40rpx;
.money {
flex: 1;
padding: 16rpx;
display: flex;
justify-content: center;
align-items: center;
border: 1rpx solid #ccc;
margin-right: 30rpx;
}
.moneyInput {
margin-top: 20rpx;
margin-bottom: 20rpx;
}
.content {
font-size: 32rpx;
.others {
margin-left: 46rpx;
margin-right: 46rpx;
margin-top: 10rpx;
margin-bottom: 40rpx;
}

View File

@@ -1,4 +1,5 @@
import { getRechargeDetail } from "../../service/recharge";
import { alertError, alertInfo, loadingFunc } from "../../utils/index";
import { getRechargeOperateType, getRechargeOperateWay } from "../../utils/data";
import request from "../../utils/request"
const { OK } = request
@@ -17,14 +18,59 @@ Page({
*/
onLoad(options) {
const { id } = options;
this.init(id)
loadingFunc(async () => {
await this.init(id)
})
},
async init(id) {
const { code, message, data } = await getRechargeDetail(id)
if (code !== OK) {
alertInfo(message)
return;
}
this.setData({
detail: { ...data, way: getRechargeOperateWay(data.way), type: getRechargeOperateType(data.type) }
})
},
record() {
const { detail } = this.data;
wx.showModal({
title: '提示',
content: '为了您更好的体验,请复制链接,通过电脑浏览器打开下载',
showCancel: true,
cancelText: '关闭',
confirmText: '复制链接',
complete: (res) => {
if (res.confirm) {
const result = wx.getAccountInfoSync();
const { envVersion } = result.miniProgram;
let api = ""
switch (envVersion) {
// 开发版
case 'develop':
wx.setClipboardData({
data: `https://1.92.72.5:8080/print/?id=${detail.serialNumber}`,
})
break;
// 体验版
case 'trial':
wx.setClipboardData({
data: `http://1.92.72.5:8080/print/?id=${detail.serialNumber}`,
})
break;
// 正式版
case 'release':
wx.setClipboardData({
data: `https://zgd.hbhcbn.com/print/?id=${detail.serialNumber}`,
})
break;
}
}
}
})
},
back() {
// wx.navigateBack({ delta: 1 });
wx.navigateBack();

View File

@@ -86,5 +86,6 @@
</van-cell-group>
<view class="operate">
<van-button type="default" block bind:tap="back">返回</van-button>
<van-button type="info" block bind:tap="record" style="flex: 1; margin-right: 20rpx;">收据</van-button>
<van-button type="default" block bind:tap="back" style="flex: 1;">返回</van-button>
</view>

View File

@@ -1,8 +1,9 @@
/* pages/rechargeDetail/index.wxss */
.operate {
margin-top: 60rpx;
margin-top: 20rpx;
margin-left: 36rpx;
margin-right: 36rpx;
padding-bottom: 50rpx;
display: flex;
}

View File

@@ -1,6 +1,6 @@
import { getRechargeList } from "../../service/recharge";
import { getTenementMeterList } from "../../service/meter";
import { getYears, alertInfo } from "../../utils/index";
import { getYears, alertInfo, loadingFunc } from "../../utils/index";
import request from "../../utils/request";
const { OK } = request;
// pages/rechargeRecord/index.js
@@ -65,9 +65,8 @@ Page({
},
onChangeYear(e) {
const { years, codeId } = this.data;
const { codeId } = this.data;
const currentYear = e
console.log('e', e, 'currentYear', currentYear, 'years', years)
this.setData({
year: currentYear,
type: "",
@@ -96,10 +95,14 @@ Page({
onShow() {
const { year } = this.data;
const tenement = wx.getStorageSync('tenement')
this.init(year, '');
this.getMeters(tenement?.id);
loadingFunc(async () => {
await this.init(year, '');
await this.getMeters(tenement?.id);
});
},
refreshEmpty() {
const { year } = this.data;
const tenement = wx.getStorageSync('tenement')
this.init(year, '');
this.init(year, tenement);

View File

@@ -1,19 +1,15 @@
<!--pages/rechargeRecord/index.wxml-->
<navigator title="缴费记录" canBack="{{true}}" bind:back="back" />
<view class="chooseWrapper">
<!-- <picker bindchange="onChangeYear" value="{{index}}" range="{{years}}"> -->
<view class="yearPicker" bind:tap="clickYear">
{{ year }}年
<image src="/assets/images/down.png" mode="" class="down" />
<van-icon name="arrow-down" custom-class="down" />
</view>
<!-- </picker> -->
<!-- <picker bindchange="onChangeYear" value="{{index}}" range="{{years}}"> -->
<view class="tenementPicker" bind:tap="clickMeter">
<view wx:if="{{meterCode}}" class="tenementName"> {{ meterCode }} </view>
<view wx:else> 全部 </view>
<image src="/assets/images/down.png" mode="" class="down" />
<van-icon name="arrow-down" custom-class="down" />
</view>
<!-- </picker> -->
<view class="allMoney">
合计: {{amount}}元
</view>
@@ -21,7 +17,9 @@
<view class="wrapper" wx:if="{{list.length}}">
<view class="recordsWrapper">
<view class="recordsItem border" wx:for="{{list}}" wx:key="index" bind:tap="jumpToDetail" data-id="{{item.id}}">
<view class="type"> 充值 </view>
<view class="type" wx:if="{{item.type === 1}}"> 冲正 </view>
<view class="type" wx:elif="{{item.type === 2}}"> 退费 </view>
<view class="type" wx:else> 充值 </view>
<view class="codeTime">
<view class="code"> {{ item.meter.address }} </view>
<view class="time"> {{ item.time }} </view>
@@ -34,4 +32,12 @@
<view wx:else>
<empty bind:refresh="refreshEmpty" />
</view>
<custom-picker title="{{title}}" show="{{show}}" valueKey="name" columns="{{columns}}" bind:ok="onOk" bind:cancel="onCancel" type="{{type}}" />
<custom-picker
title="{{title}}"
show="{{show}}"
valueKey="name"
columns="{{columns}}"
bind:ok="onOk"
bind:cancel="onCancel"
type="{{type}}"
/>

View File

@@ -3,6 +3,8 @@
.yearPicker {
display: flex;
align-items: center;
color: #fff;
font-size: 32rpx;
}
.down {
@@ -35,11 +37,12 @@
font-size: 34rpx;
}
.time {
margin-top: 16rpx;
margin-top: 12rpx;
font-size: 28rpx;
color:rgb(158, 154, 154);
}
.money {
font-size: 40rpx;
font-size: 36rpx;
font-weight: 500;
margin-right: 30rpx;
}
@@ -61,6 +64,8 @@
margin-left: 30rpx;
display: flex;
align-items: center;
color: #fff;
font-size: 32rpx;
}
.allMoney {
@@ -73,8 +78,9 @@
}
.type {
margin-right: 46rpx;
margin-right: 40rpx;
font-weight: 600;
font-size: 36rpx;
}
.codeTime {

140
pages/rechargeWay/index.js Normal file
View File

@@ -0,0 +1,140 @@
// pages/rechargeWay/index.js
import { requestRecharge } from "../../service/recharge";
import { alertInfo } from "../../utils/index";
import request from '../../utils/request';
const { OK } = request;
Page({
/**
* 页面的初始数据
*/
data: {
money: 0,
address: "",
rechargeWay: 0,
id: "",
tenement: "",
park: "",
rechargeLoading: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { money, address, id, tenement, park } = options
this.setData({ money: Number(money), address, id, tenement, park })
},
onChangeRechargeWay(e) {
this.setData({ rechargeWay: e.detail })
},
onClickCell(e) {
const { name } = e.currentTarget.dataset;
this.setData({ rechargeWay: name })
},
async recharge() {
const { rechargeWay } = this.data;
await this.setLoading(true)
try {
switch(rechargeWay) {
case 1:
alertInfo("开发中")
break;
default:
await this.wxRecharge();
break;
}
} catch(err) {
} finally {
await this.setLoading(false)
}
},
async wxRecharge() {
const { money, id, tenement, park } = this.data;
const { code, message, data } = await requestRecharge({ money: Number(money), id, tenement, park })
if (code !== OK) {
alertInfo(message)
return;
}
wx.requestPayment({
timeStamp: data?.time,
nonceStr: data?.nonceStr,
package: "prepay_id=" + data?.prepay_id,
paySign: data?.paySign,
signType: 'RSA',
success: (res) => {
alertSuccess("充值成功")
that.setData({
money: null
})
},
fail: (res) => {
console.log('fail', res)
alertInfo("请稍后重试")
},
complete: (res) => {
console.log('complete')
that.handleGetMeterDetail(meter.id)
}
})
},
async setLoading(flag) {
return new Promise((res) => {
this.setData({
rechargeLoading: flag,
}, () => {
res()
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,11 @@
{
"usingComponents": {
"navigator": "/components/navigator/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-button": "@vant/weapp/button/index"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,25 @@
<!--pages/rechargeWay/index.wxml-->
<navigator title="支付订单" canBack="{{true}}" bind:back="back" />
<view class="rechargeInfoWrapper">
<view>
<text> ¥ </text>
<text class="money"> {{ money }} </text>
</view>
<view class="address"> 地址:{{address}} </view>
</view>
<van-radio-group value="{{ rechargeWay }}" bind:change="onChangeRechargeWay">
<van-cell-group>
<van-cell title="微信支付" clickable data-name="{{0}}" bind:click="onClickCell">
<van-radio slot="right-icon" name="{{0}}" />
</van-cell>
<van-cell title="对公转账" clickable data-name="{{1}}" bind:click="onClickCell">
<van-radio slot="right-icon" name="{{1}}" />
</van-cell>
</van-cell-group>
</van-radio-group>
<view class="rechargeBtn">
<van-button type="info" block bind:click="recharge" loading="{{rechargeLoading}}">支付</van-button>
</view>

View File

@@ -0,0 +1,23 @@
/* pages/rechargeWay/index.wxss */
.rechargeInfoWrapper {
margin-top: 10vw;
margin-bottom: 10vw;
text-align: center;
}
.money {
font-weight: 700;
font-size: 60rpx;
margin-left: 10rpx;
}
.address {
font-size: 28rpx;
margin-top: 20rpx;
}
.rechargeBtn {
margin-top: 10vh;
margin-left: 32rpx;
margin-right: 32rpx;
}

View File

@@ -1,66 +1,118 @@
// pages/updateInvoice/index.js
Page({
import { getInvoiceInfo, updateInvoiceInfo } from "../../service/invoice"
import { getUserInfo } from "../../service/user";
import { alertInfo, alertSuccess } from "../../utils/index";
import request from '../../utils/request'
const { OK } = request
// pages/invoiceList/components/info/index.js
Component({
/**
* 页面的初始数据
* 组件的属性列表
*/
properties: {
},
lifetimes: {
attached() {
this.getDetail();
this.getUser();
}
},
/**
* 组件的初始数据
*/
data: {
detail: { },
formData: {headerType: 0, name: wx.getStorageSync('tenement')?.name},
editType: "detail"
},
/**
* 生命周期函数--监听页面加载
* 组件的方法列表
*/
onLoad(options) {
methods: {
async getDetail() {
const { code, message, data } = await getInvoiceInfo()
if (code !== OK) {
alertInfo(message)
return;
}
this.setData({ detail: {...data,name: wx.getStorageSync('tenement')?.name, },editType: 'detail', })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
async getUser() {
const { code, message, data } = await getUserInfo()
this.setData({ user: data });
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
changeEditType() {
this.setData({ editType: 'edit', formData: {...this.data.detail, tenement: wx.getStorageSync('tenement')?.id} })
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
cancelEdit() {
this.setData({ editType: 'detail', formData: {} })
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
onChangeType(e) {
const { formData } = this.data;
this.setData({ formData: {...formData, type: e.detail} })
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
onChangeHeaderType(e) {
const { formData } = this.data;
this.setData({ formData: {...formData, headerType: e.detail} })
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
onChangeText(e) {
const { name } = e.currentTarget.dataset;
const { formData } = this.data;
this.setData({ formData: {...formData, [name]: e.detail} })
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
async submit() {
const { formData } = this.data;
const { tin, address, phone, bank, account, email, type, headerType, name } = formData;
if (type !== 0 && type !== 1) {
alertInfo("请选择发票类型");
return;
}
if (headerType !== 0 && headerType !== 1) {
alertInfo("请选择抬头类型");
return;
}
if (headerType === 1) {
if (!name) {
alertInfo("请输入发票抬头")
return
}
}
if (!email || !/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(email)) {
alertInfo("邮箱格式不正确")
return;
}
if (headerType === 0) {
if (!tin) {
alertInfo("请输入发票税号")
return;
}
// if (!address) {
// alertInfo("请输入地址")
// return;
// }
if (!phone) {
alertInfo("请输入电话")
return;
}
if (!bank) {
alertInfo("请输入开户行")
return;
}
if (!account) {
alertInfo("请输入银行账号")
return;
}
}
const { code, message } = await updateInvoiceInfo(formData)
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("编辑成功")
this.getDetail()
}
}
})

View File

@@ -1,7 +1,13 @@
{
"usingComponents": {
"navigator": "/components/navigator/index",
"info": "/pages/invoiceList/components/info/index"
"info": "/pages/invoiceList/components/info/index",
"card": "/components/card/index",
"van-icon": "@vant/weapp/icon/index",
"van-field": "@vant/weapp/field/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-button": "@vant/weapp/button/index"
},
"navigationStyle": "custom"
}

View File

@@ -1,3 +1,298 @@
<!--pages/updateInvoice/index.wxml-->
<navigator title="发票抬头" canBack="{{true}}" />
<info />
<view class="cardWrapper">
<card title="发票详情">
<view
slot="operate"
class="cardOperate"
wx:if="{{editType === 'detail' && user.isAdmin}}"
bind:tap="changeEditType"
>
<van-icon name="edit" />
<view class="editContent">修改</view>
</view>
<view slot="content">
<van-field
label="发票类型"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
>
<view slot="input" style="margin-top: 16rpx;" wx:if="{{editType === 'edit'}}">
<van-radio-group direction="horizontal" value="{{formData.type}}" bind:change="onChangeType">
<van-radio name="{{0}}" icon-size="30rpx" style="font-size: 30rpx;margin-bottom: 20rpx;">普通发票</van-radio>
<van-radio name="{{1}}" icon-size="30rpx" style="font-size: 30rpx;">增值税专用发票</van-radio>
</van-radio-group>
</view>
<view wx:else slot="input" style="margin-top: -10rpx;">
<view wx:if="{{detail.type === 0}}"> 普通发票 </view>
<view wx:elif="{{detail.type === 1}}"> 增值税专用发票 </view>
<view wx:else>-</view>
</view>
</van-field>
<van-field
label="抬头类型"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
>
<view slot="input" style="margin-top: 16rpx;" wx:if="{{editType === 'edit'}}">
<van-radio-group direction="horizontal" bind:change="onChangeHeaderType" value="{{formData.headerType}}">
<van-radio name="{{0}}" icon-size="30rpx" style="font-size: 30rpx;margin-bottom: 20rpx;">企业单位</van-radio>
<van-radio name="{{1}}" icon-size="30rpx" style="font-size: 30rpx;">个人/非企业单位</van-radio>
</van-radio-group>
</view>
<view
wx:else
slot="input"
style="margin-top: -10rpx;"
>
<view wx:if="{{detail.headerType === 0}}"> 企业单位 </view>
<view wx:elif="{{detail.headerType === 1}}"> 个人/非企业单位 </view>
<view wx:else>-</view>
</view>
</van-field>
<van-field
wx:if="{{editType === 'detail'}}"
value="{{detail.name || '--'}}"
label="发票抬头"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{true}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ false }}"
/>
<van-field
wx:elif="{{editType === 'edit' }}"
value="{{detail.name || '--'}}"
label="发票抬头"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{true}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ false }}"
/>
<van-field
wx:else
value="{{formData.name}}"
label="发票抬头"
custom-style="padding-left: 0; padding-right: 0;"
disabled="{{formData.headerType !== 1}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
bind:change="onChangeText"
data-name="name"
bind:change="onChangeText"
border="{{ true }}"
/>
<van-field
value="{{detail.tin|| '--'}}"
label="发票税号"
wx:if="{{editType === 'detail' && detail.headerType === 0}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
/>
<van-field
value="{{formData.tin }}"
label="发票税号"
wx:if="{{editType === 'edit' && formData.headerType === 0}}"
placeholder="{{editType === 'edit' ? '请输入发票税号' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
bind:change="onChangeText"
data-name="tin"
border="{{ editType === 'detail' ? false : true }}"
/>
<van-field
value="{{detail.bank || '--'}}"
label="开户行"
wx:if="{{editType === 'detail' && detail.headerType === 0}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
/>
<van-field
value="{{formData.bank}}"
label="开户行"
wx:if="{{editType === 'edit' && formData.headerType === 0}}"
placeholder="{{'请输入开户行'}}"
custom-style="padding-left: 0; padding-right: 0;"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="bank"
/>
<van-field
value="{{detail.account || '--'}}"
label="银行账号"
wx:if="{{(editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入银行账号' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="account"
/>
<van-field
value="{{formData.account}}"
label="银行账号"
wx:if="{{(editType === 'edit' && formData.headerType === 0) }}"
placeholder="{{editType === 'edit' ? '请输入银行账号' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="account"
/>
<van-field
value="{{detail.address || '--'}}"
label="地址"
wx:if="{{(editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入地址' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="address"
/>
<van-field
value="{{formData.address}}"
label="地址"
wx:if="{{(editType === 'edit' && formData.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入地址' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="address"
/>
<van-field
value="{{detail.phone || '--'}}"
label="电话"
wx:if="{{(editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入电话' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="phone"
/>
<van-field
value="{{formData.phone }}"
label="电话"
wx:if="{{(editType === 'edit' && formData.headerType === 0) }}"
placeholder="{{editType === 'edit' ? '请输入电话' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="phone"
/>
<van-field
value="{{detail.remark || '--'}}"
label="备注"
wx:if="{{editType === 'detail' }}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="remark"
/>
<van-field
value="{{formData.remark}}"
label="备注"
wx:else
placeholder="{{editType === 'edit' ? '请输入备注' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="remark"
/>
</view>
</card>
</view>
<view class="cardWrapper" style="margin-bottom: 40rpx;">
<card title="接收信息">
<view slot="content">
<van-field
value="{{detail.email || '--'}}"
wx:if="{{editType === 'detail'}}"
label="电子邮箱"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="email"
/>
<van-field
value="{{formData.email}}"
wx:else
label="电子邮箱"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="email"
/>
</view>
</card>
</view>
<view class="submit" wx:if="{{editType === 'edit'}}">
<van-button block class="cancelEdit" bind:click="cancelEdit">取消编辑</van-button>
<van-button type="info" block class="save" bind:click="submit">保存</van-button>
</view>

View File

@@ -1 +1,34 @@
/* pages/updateInvoice/index.wxss */
/* pages/updateInvoice/index.wxss *//* pages/invoiceList/components/info/index.wxss */
.cardOperate {
display: flex;
align-items: center;
font-size: 32rpx;
}
.cardWrapper {
margin-top: 30rpx;
}
.editContent {
margin-left: 20rpx;
}
.van-cell {
padding-left: 0rpx !important;
padding-right: 0rpx !important;
}
.submit {
margin: 32rpx;
margin-bottom: 50rpx;
display: flex;
align-items: center;
}
.cancelEdit, .save {
flex: 1;
}
.cancelEdit {
margin-right: 40rpx;
}

View File

@@ -1,4 +1,5 @@
import apis from '../utils/request';
import { getConfigByEnv } from "../utils/index"
const { GET, POST, PUT, DELETE } = apis
// 获取电费账单列表
@@ -23,3 +24,21 @@ export const getAccountingList = async function(meter) {
const tenement = wx.getStorageSync('tenement')?.id || ""
return await GET(`/wx/getAccountingList?tenement=${tenement}&meter=${meter}`);
}
// 导出电量查询
export const exportElectricityList = async function({ meter, type, time }) {
const tenement = wx.getStorageSync('tenement')?.id || ""
const { api } = getConfigByEnv();
return new Promise(resolve => {
wx.downloadFile({
url: `${api}/wx/getElectricityList/export?tenement=${tenement}&meter=${meter}&type=${type}&time=${time}`,
success(res) {
console.log('请求成功结果', res)
resolve(res)
},
fail(err) {
console.log('err', err)
}
})
})
}

View File

@@ -55,3 +55,7 @@ export const getUserParksAndTenementsList = async function() {
export const getUnReadApproveNumber = async function() {
return await GET('/wx/getApproveNumber');
}
// 退出登录
export const logout = async function() {
return await POST('/wx/logout');
}

View File

@@ -46,6 +46,7 @@ export function getConfigByEnv() {
// 开发版
case 'develop':
api = "http://localhost:8000"
// api = "https://zgd.hbhcbn.com/wxApi"
// api = "http://127.0.0.1:4523/m1/4143821-0-default"
break;
// 体验版
@@ -220,3 +221,21 @@ export const wxModal = (data) => {
})
}
export const getPixelRatio = () => {
let pixelRatio = 0
wx.getSystemInfo({
success: function (res) {
pixelRatio = res.pixelRatio
},
fail: function () {
pixelRatio = 0
}
})
return pixelRatio
}
export function isValidPhoneNumber(phoneNumber) {
return /^1\d{10}$/.test(phoneNumber);
}

View File

@@ -19,7 +19,7 @@ const requestWithoutCookie = promisify(wx.request);
// 考虑了Cookie的请求
const request = async function (options, config = {}) {
console.log('请求参数', 'options', options, 'config', config)
console.log('请求地址', options.url, "请求参数", options.data, 'config', config)
let token = wx.getStorageSync('token');
const result = wx.getAccountInfoSync();
const { envVersion } = result.miniProgram;
@@ -73,18 +73,17 @@ const request = async function (options, config = {}) {
} catch(err) {
alertInfo(err.errMsg)
}
return response;
}
// 处理返回结果,默认直接返回数据
const parseResponse = function (response, url) {
console.log('url', url, 'response', response)
if (!response) {
alertError("服务异常")
return
}
const { statusCode } = response;
console.log('url', url, 'response.status', statusCode, 'response.data', response.data)
if (statusCode === 401) {
wx.redirectTo({
url: '/pages/login/index',