新增充值的修改
This commit is contained in:
parent
f5ddb92449
commit
417ba1454c
6
app.json
6
app.json
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"pages": [
|
||||
"pages/login/index",
|
||||
"pages/home/index",
|
||||
"pages/my/index",
|
||||
"pages/rechargeRecord/index",
|
||||
|
@ -8,15 +9,14 @@
|
|||
"pages/apply/index",
|
||||
"pages/member/index",
|
||||
"pages/handleLogin/index",
|
||||
"pages/login/index",
|
||||
"pages/qrCode/index",
|
||||
"pages/meterList/index",
|
||||
"pages/recharge/index",
|
||||
"pages/questions/index",
|
||||
"pages/index/index",
|
||||
"pages/invoiceDetail/index",
|
||||
"pages/editInvoice/index",
|
||||
"pages/rechargeDetail/index"
|
||||
"pages/rechargeDetail/index",
|
||||
"pages/agreements/index"
|
||||
],
|
||||
"tabBar": {
|
||||
"list": [
|
||||
|
|
|
@ -35,7 +35,8 @@ Component({
|
|||
*/
|
||||
methods: {
|
||||
back() {
|
||||
this.triggerEvent("back")
|
||||
// this.triggerEvent("back")
|
||||
wx.navigateBack();
|
||||
}
|
||||
}
|
||||
})
|
67
pages/agreements/index.js
Normal file
67
pages/agreements/index.js
Normal file
|
@ -0,0 +1,67 @@
|
|||
// pages/agreements/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
url: ""
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
const { url } = options;
|
||||
this.setData({ url });
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
3
pages/agreements/index.json
Normal file
3
pages/agreements/index.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"usingComponents": {}
|
||||
}
|
2
pages/agreements/index.wxml
Normal file
2
pages/agreements/index.wxml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<!--pages/agreements/index.wxml-->
|
||||
<web-view src="https://support.weixin.qq.com/cgi-bin/mmsupport-bin/readtemplate?check=false&nav=faq&t=weixin_agreement"/>
|
1
pages/agreements/index.wxss
Normal file
1
pages/agreements/index.wxss
Normal file
|
@ -0,0 +1 @@
|
|||
/* pages/agreements/index.wxss */
|
|
@ -1,7 +1,6 @@
|
|||
import { getMeterDetail, getMeterList, getTenementMeterList } from "../../service/meter";
|
||||
import { getOwnTenementList } from "../../service/tenement";
|
||||
import { getUserInfo } from "../../service/user";
|
||||
import { alertError, alertInfo } from "../../utils/index";
|
||||
import { alertInfo } from "../../utils/index";
|
||||
import request from '../../utils/request';
|
||||
import { getDot } from "../../utils/system";
|
||||
const { OK } = request;
|
||||
|
@ -52,9 +51,10 @@ Page({
|
|||
|
||||
},
|
||||
async changeMeter() {
|
||||
const { meterList = [], meterIndex, tenement = {} } = this.data;
|
||||
const { meterList = [] } = this.data;
|
||||
const newColumns = meterList.map(item => { item.id = item.code; item.name = `${item.code} - ${item.address}`; return item; })
|
||||
this.setData({
|
||||
columns: meterList.map(item => { item.id = item.code; item.name = `${item.code} - ${item.address}`; return item; }),
|
||||
columns: newColumns,
|
||||
show: true,
|
||||
pickerType: "meter"
|
||||
})
|
||||
|
@ -66,36 +66,42 @@ Page({
|
|||
onOk(e) {
|
||||
const { type, index, value } = e.detail;
|
||||
const currentPark = this.data.park;
|
||||
if (type === "park") {
|
||||
if (value.id === currentPark?.id) {
|
||||
this.setData({ show: false })
|
||||
return
|
||||
}
|
||||
this.setData({
|
||||
show: false,
|
||||
park: value,
|
||||
tenement: value.tenements?.[0]
|
||||
})
|
||||
}
|
||||
if (type === "tenement") {
|
||||
const currentTenement = this.data.tenement;
|
||||
if (value.id === currentTenement?.id) {
|
||||
this.setData({ show: false })
|
||||
return
|
||||
}
|
||||
this.setData({
|
||||
show: false,
|
||||
tenement: value
|
||||
})
|
||||
}
|
||||
if (type === "meter") {
|
||||
const { code, id } = e.detail.value;
|
||||
this.handleGetMeterDetail(code)
|
||||
switch(type) {
|
||||
case "park":
|
||||
// if (value.id === currentPark?.id) {
|
||||
// this.setData({ show: false })
|
||||
// return
|
||||
// }
|
||||
this.setData({
|
||||
show: false,
|
||||
park: value,
|
||||
tenement: value.tenements?.[0]
|
||||
})
|
||||
break;
|
||||
case "tenement":
|
||||
const currentTenement = this.data.tenement;
|
||||
// if (value.id === currentTenement?.id) {
|
||||
// this.setData({ show: false })
|
||||
// return
|
||||
// }
|
||||
this.setData({
|
||||
show: false,
|
||||
tenement: value
|
||||
})
|
||||
break;
|
||||
case "meter":
|
||||
const { code, id } = e.detail.value;
|
||||
this.handleGetMeterDetail(code)
|
||||
break;
|
||||
}
|
||||
},
|
||||
async handleGetMeterDetail(meterCode) {
|
||||
const { tenement } = this.data;
|
||||
const { code, message, data } = await getMeterDetail({ tenement, code: meterCode });
|
||||
if (code !== OK) {
|
||||
alertInfo(message);
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
tenement: data,
|
||||
show: false,
|
||||
|
@ -122,6 +128,11 @@ Page({
|
|||
return
|
||||
}
|
||||
},
|
||||
jumpToInvoice() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/invoiceList/index',
|
||||
})
|
||||
},
|
||||
jumpToLogin() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/login/index',
|
||||
|
@ -148,7 +159,7 @@ Page({
|
|||
return value; // 返回属性的当前值
|
||||
},
|
||||
set: function (newVal) {
|
||||
const oldValue = value;
|
||||
// const oldValue = value;
|
||||
value = newVal;
|
||||
that.getMeters(newVal);
|
||||
}
|
||||
|
@ -156,10 +167,10 @@ Page({
|
|||
},
|
||||
async getMeters({ id }) {
|
||||
const { code, message, data } = await getTenementMeterList(id);
|
||||
// if (code !== OK) {
|
||||
// alertError(message)
|
||||
// return;
|
||||
// }
|
||||
if (code !== OK) {
|
||||
alertError(message)
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
meterList: data || [],
|
||||
meter: data?.[0] || {}
|
||||
|
@ -178,10 +189,10 @@ Page({
|
|||
},
|
||||
async getAllList() {
|
||||
const { code, message, data } = await getOwnTenementList()
|
||||
// if (code !== OK) {
|
||||
// alertInfo(message)
|
||||
// return
|
||||
// }
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return
|
||||
}
|
||||
const [firstPark = {}] = data;
|
||||
const { park, tenement } = this.data;
|
||||
const updateDatas = {}
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
</van-grid-item>
|
||||
<van-grid-item icon="after-sale" text="缴费记录" bind:click="jumpToRecord" />
|
||||
<van-grid-item icon="bar-chart-o" text="用电查询" />
|
||||
<van-grid-item icon="bill-o" text="去开票" />
|
||||
<van-grid-item icon="bill-o" text="去开票" bind:click="jumpToInvoice" />
|
||||
</van-grid>
|
||||
</view>
|
||||
|
||||
|
|
24
pages/invoiceList/components/already/index.js
Normal file
24
pages/invoiceList/components/already/index.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
// pages/invoiceList/components/already/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
4
pages/invoiceList/components/already/index.json
Normal file
4
pages/invoiceList/components/already/index.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
2
pages/invoiceList/components/already/index.wxml
Normal file
2
pages/invoiceList/components/already/index.wxml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<!--pages/invoiceList/components/already/index.wxml-->
|
||||
<text>pages/invoiceList/components/already/index.wxml</text>
|
1
pages/invoiceList/components/already/index.wxss
Normal file
1
pages/invoiceList/components/already/index.wxss
Normal file
|
@ -0,0 +1 @@
|
|||
/* pages/invoiceList/components/already/index.wxss */
|
24
pages/invoiceList/components/info/index.js
Normal file
24
pages/invoiceList/components/info/index.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
// pages/invoiceList/components/info/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
4
pages/invoiceList/components/info/index.json
Normal file
4
pages/invoiceList/components/info/index.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
2
pages/invoiceList/components/info/index.wxml
Normal file
2
pages/invoiceList/components/info/index.wxml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<!--pages/invoiceList/components/info/index.wxml-->
|
||||
<text>pages/invoiceList/components/info/index.wxml</text>
|
1
pages/invoiceList/components/info/index.wxss
Normal file
1
pages/invoiceList/components/info/index.wxss
Normal file
|
@ -0,0 +1 @@
|
|||
/* pages/invoiceList/components/info/index.wxss */
|
24
pages/invoiceList/components/notyet/index.js
Normal file
24
pages/invoiceList/components/notyet/index.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
// pages/invoiceList/components/notyet/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
4
pages/invoiceList/components/notyet/index.json
Normal file
4
pages/invoiceList/components/notyet/index.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
2
pages/invoiceList/components/notyet/index.wxml
Normal file
2
pages/invoiceList/components/notyet/index.wxml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<!--pages/invoiceList/components/notyet/index.wxml-->
|
||||
<text>pages/invoiceList/components/notyet/index.wxml</text>
|
1
pages/invoiceList/components/notyet/index.wxss
Normal file
1
pages/invoiceList/components/notyet/index.wxss
Normal file
|
@ -0,0 +1 @@
|
|||
/* pages/invoiceList/components/notyet/index.wxss */
|
24
pages/invoiceList/components/notyetCard/index.js
Normal file
24
pages/invoiceList/components/notyetCard/index.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
// pages/invoiceList/components/notyetCard/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
4
pages/invoiceList/components/notyetCard/index.json
Normal file
4
pages/invoiceList/components/notyetCard/index.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
2
pages/invoiceList/components/notyetCard/index.wxml
Normal file
2
pages/invoiceList/components/notyetCard/index.wxml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<!--pages/invoiceList/components/notyetCard/index.wxml-->
|
||||
<text>pages/invoiceList/components/notyetCard/index.wxml</text>
|
1
pages/invoiceList/components/notyetCard/index.wxss
Normal file
1
pages/invoiceList/components/notyetCard/index.wxss
Normal file
|
@ -0,0 +1 @@
|
|||
/* pages/invoiceList/components/notyetCard/index.wxss */
|
|
@ -1,7 +1,12 @@
|
|||
{
|
||||
"usingComponents": {
|
||||
"van-action-sheet": "@vant/weapp/action-sheet/index",
|
||||
"van-button": "@vant/weapp/button/index"
|
||||
"van-tab": "@vant/weapp/tab/index",
|
||||
"van-tabs": "@vant/weapp/tabs/index",
|
||||
"navigator": "/components/navigator/index",
|
||||
"notyet": "./components/notyet/index",
|
||||
"already": "./components/already/index",
|
||||
"info": "./components/info/index",
|
||||
"notyetCard": "./components/notyetCard/index"
|
||||
},
|
||||
"navigationBarTitleText": "开票信息"
|
||||
"navigationStyle": "custom"
|
||||
}
|
|
@ -1,27 +1,13 @@
|
|||
<!--pages/invoiceList/index.wxml-->
|
||||
<view class="wrapper">
|
||||
<view
|
||||
wx:for="{{list}}"
|
||||
wx:key="index"
|
||||
class="item"
|
||||
>
|
||||
<view style="flex: 1"> {{ item.tenement.name }} </view>
|
||||
<view class="operate">
|
||||
<view class="primaryTextBtn" data-data="{{item}}" bind:tap="operate"> 操作 </view>
|
||||
<!-- <view class="primaryTextBtn" style="margin-left: 24rpx;"> 编辑 </view>
|
||||
<view class="dangerTextBtn" style="margin-left: 24rpx;"> 删除 </view> -->
|
||||
</view>
|
||||
</view>
|
||||
<navigator canBack="{{true}}" title="发票管理" />
|
||||
|
||||
<view style="margin-top: 10vh;">
|
||||
<van-button type="info" block bind:click="handleCreate">创建一个</van-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<van-action-sheet
|
||||
show="{{ show }}"
|
||||
actions="{{ actions }}"
|
||||
bind:close="onClose"
|
||||
bind:select="onSelect"
|
||||
cancel-text="取消"
|
||||
/>
|
||||
<van-tabs active="{{ active }}" bind:change="onChange">
|
||||
<van-tab title="申请开票">
|
||||
<notyet />
|
||||
</van-tab>
|
||||
<van-tab title="已开发票">
|
||||
<already />
|
||||
</van-tab>
|
||||
<van-tab title="开票信息">
|
||||
<info />
|
||||
</van-tab>
|
||||
</van-tabs>
|
|
@ -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',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -108,6 +108,17 @@ Page({
|
|||
.catch(() => {
|
||||
// on cancel
|
||||
});
|
||||
},
|
||||
jumpToUserAgreement() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/agreements/index',
|
||||
})
|
||||
},
|
||||
jumpToLoginAgreement() {
|
||||
|
||||
},
|
||||
jumpToSecret() {
|
||||
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<van-checkbox value="{{ agree }}" bind:change="onChangeAgree"></van-checkbox>
|
||||
</view>
|
||||
<view>
|
||||
使用本系统,代表您已阅读并同意 <text class="agreementText">《用电管理服务条款》</text>、<text class="agreementText">《用电管理登录政策》</text><text class="agreementText">《隐私政策》</text>。
|
||||
使用本系统,代表您已阅读并同意 <text class="agreementText" bind:tap="jumpToUserAgreement">《用电管理服务条款》</text>、<text class="agreementText" bind:tap="jumpToLoginAgreement">《用电管理登录政策》</text><text bind:tap="jumpToSecret" class="agreementText">《隐私政策》</text>。
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -1,12 +1,3 @@
|
|||
<!--pages/member/components/memberManage/index.wxml-->
|
||||
<!-- <view wx:for="{{list}}" wx:key="index" wx:for-item="item" class="item">
|
||||
<view class="nickName"> {{ item.nickName }} </view>
|
||||
<view class="operate">
|
||||
<view class="primaryTextBtn" data-user="{{item}}" bind:tap="setAdmin"> 设为管理员 </view>
|
||||
<view class="disAgree dangerTextBtn" data-user="{{item}}" bind:tap="remove"> 移除 </view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<van-tabs active="{{ active }}" bind:change="onChange">
|
||||
<van-tab wx:for="{{list}}" wx:key="index" title="{{item.name}}">
|
||||
<view wx:for="{{item.users}}" wx:key="index" wx:for-item="ele" class="item">
|
||||
|
@ -15,7 +6,6 @@
|
|||
<view class="nickName"> {{ ele.name }} </view>
|
||||
<view class="phone"> {{ ele.phone }} </view>
|
||||
</view>
|
||||
<!-- <view class="operate" wx:if="{{!ele.isAdmin}}"> -->
|
||||
<view class="operate">
|
||||
<van-button type="info" size="small" data-user="{{ele}}" bind:click="setAdmin" data-tenement="{{item.id}}" style="margin-bottom: 16rpx;" class="admin">设为管理员</van-button>
|
||||
<van-button type="danger" size="small" data-user="{{ele}}" bind:click="remove" data-tenement="{{item.id}}" class="remove">移除</van-button>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { getRechargeList } from "../../service/recharge";
|
||||
import { getOwnTenementList } from "../../service/tenement";
|
||||
import { getYears } from "../../utils/index";
|
||||
import { getYears, alertInfo } from "../../utils/index";
|
||||
import request from "../../utils/request";
|
||||
const { OK } = request;
|
||||
// pages/rechargeRecord/index.js
|
||||
|
@ -97,10 +97,10 @@ Page({
|
|||
},
|
||||
async getTenementsList() {
|
||||
const { code, message, data } = await getOwnTenementList()
|
||||
// if (code !== OK) {
|
||||
// alertInfo(message)
|
||||
// return
|
||||
// }
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return
|
||||
}
|
||||
let tenements = [];
|
||||
data.forEach(item => {
|
||||
if (item.tenements) {
|
||||
|
|
|
@ -45,8 +45,8 @@ export function getConfigByEnv() {
|
|||
switch (envVersion) {
|
||||
// 开发版
|
||||
case 'develop':
|
||||
// api = "http://localhost:8000"
|
||||
api = "http://127.0.0.1:4523/m1/4143821-0-default"
|
||||
api = "http://localhost:8000"
|
||||
// api = "http://127.0.0.1:4523/m1/4143821-0-default"
|
||||
break;
|
||||
// 体验版
|
||||
case 'trial':
|
||||
|
|
|
@ -83,12 +83,16 @@ const parseResponse = function (response) {
|
|||
return
|
||||
}
|
||||
const { statusCode } = response;
|
||||
console.log('response', response)
|
||||
if (statusCode === 401) {
|
||||
wx.redirectTo({
|
||||
url: '/pages/login/index',
|
||||
})
|
||||
return { code: 401, message: '未登录状态' }
|
||||
}
|
||||
if (statusCode === 403) {
|
||||
return { code: 403, message: "非法访问" }
|
||||
}
|
||||
if (statusCode === 404) {
|
||||
return { code: 404, message: "服务故障" }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user