Compare commits
16 Commits
7ac104d1b8
...
shop
Author | SHA1 | Date | |
---|---|---|---|
c266572022 | |||
0b568a81e5 | |||
765b3ad111 | |||
e4a22af891 | |||
8e1ed62bd7 | |||
14dad0a506 | |||
e6edf6e3d1 | |||
9ca94479fa | |||
31870c0222 | |||
4963d4f8a6 | |||
e3ad9ea30a | |||
75713f1e97 | |||
56e08863de | |||
8b970f2b8f | |||
8ecb1e5977 | |||
60fcd5f8e2 |
4
app.json
4
app.json
@@ -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": [
|
||||
|
2
app.wxss
2
app.wxss
@@ -8,7 +8,7 @@ page {
|
||||
}
|
||||
|
||||
.border {
|
||||
border: 0.5rpx solid #f0f0f0;
|
||||
border: 0.5rpx solid #cfc9c9;
|
||||
}
|
||||
|
||||
.radius12 {
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
@@ -130,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;
|
||||
}
|
||||
|
@@ -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({
|
||||
|
@@ -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"
|
||||
}
|
@@ -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>
|
@@ -1,66 +0,0 @@
|
||||
// pages/editInvoice/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
@@ -1,2 +0,0 @@
|
||||
<!--pages/editInvoice/index.wxml-->
|
||||
<text>pages/editInvoice/index.wxml</text>
|
@@ -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 {
|
||||
|
@@ -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) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<!--pages/handleLogin/index.wxml-->
|
||||
<!-- <topbar /> -->
|
||||
<navigator title="绑定商户" canBack="{{true}}" />
|
||||
<navigator title="绑定商户" canBack="{{canBack}}" />
|
||||
<van-tabs>
|
||||
<van-tab title="扫码绑定">
|
||||
<view class="codeContent">
|
||||
@@ -25,8 +25,8 @@
|
||||
<van-field
|
||||
required
|
||||
value="{{ phone }}"
|
||||
label="联系人手机号"
|
||||
placeholder="请输入联系人手机号"
|
||||
label="预留手机号"
|
||||
placeholder="请输入预留手机号"
|
||||
border="{{ true }}"
|
||||
bind:change="onChangePhone"
|
||||
/>
|
||||
|
@@ -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;
|
||||
@@ -95,10 +107,6 @@ Page({
|
||||
tenement: value
|
||||
})
|
||||
|
||||
break;
|
||||
case "meter":
|
||||
const { code, id } = e.detail.value;
|
||||
this.handleGetMeterDetail(id)
|
||||
break;
|
||||
}
|
||||
},
|
||||
@@ -119,67 +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) => {
|
||||
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',
|
||||
@@ -189,7 +139,6 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
this.getAllList();
|
||||
this.watchTenement();
|
||||
this.watchPark();
|
||||
@@ -209,8 +158,8 @@ Page({
|
||||
set: function (newVal) {
|
||||
// const oldValue = value;
|
||||
wx.setStorageSync('tenement', newVal)
|
||||
that.getMeters(newVal);
|
||||
that.setUser();
|
||||
// that.getMeters(newVal);
|
||||
value = newVal;
|
||||
}
|
||||
});
|
||||
@@ -267,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 = {}
|
||||
@@ -309,22 +248,11 @@ Page({
|
||||
updateDatas.all = data;
|
||||
this.setData({
|
||||
...updateDatas
|
||||
}, () => {
|
||||
if (updateDatas?.tenement?.id) {
|
||||
this.getMeters({ id: updateDatas?.tenement?.id })
|
||||
}
|
||||
})
|
||||
},
|
||||
jumpToRecord() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/rechargeRecord/index',
|
||||
})
|
||||
},
|
||||
jumpToOrder() {
|
||||
// alertInfo("尚未完成")
|
||||
wx.navigateTo({
|
||||
url: '/pages/billList/index',
|
||||
})
|
||||
|
||||
jumpToShop() {
|
||||
alertInfo("开发中");
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
|
@@ -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"
|
||||
}
|
@@ -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}}" />
|
||||
|
||||
|
||||
|
@@ -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);
|
||||
}
|
@@ -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("下载文件失败")
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@@ -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>
|
@@ -56,7 +56,7 @@
|
||||
title-width="160rpx"
|
||||
/>
|
||||
<van-field
|
||||
value="{{detail.invoice.type === 0 ? '普通电子发票' : '增值税专用电子发票'}}"
|
||||
value="{{detail.invoice.type === 0 ? '普通发票' : '增值税专用发票'}}"
|
||||
label="发票类型 :"
|
||||
readonly
|
||||
autosize="{{true}}"
|
||||
|
@@ -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({
|
||||
|
@@ -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>
|
||||
|
@@ -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) */
|
||||
}
|
@@ -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("请输入开户行")
|
||||
|
@@ -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,18 +67,143 @@
|
||||
</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
|
||||
wx:elif="{{editType === 'edit' && formData.headerType === 0 }}"
|
||||
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;"
|
||||
@@ -91,160 +223,102 @@
|
||||
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'}}"
|
||||
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;"
|
||||
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'}}"
|
||||
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'}}"
|
||||
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'}}"
|
||||
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'}}"
|
||||
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'}}"
|
||||
@@ -252,12 +326,13 @@
|
||||
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
|
||||
@@ -268,6 +343,7 @@
|
||||
border="{{ editType === 'detail' ? false : true }}"
|
||||
bind:change="onChangeText"
|
||||
data-name="email"
|
||||
placeholder="请输入电子邮箱"
|
||||
/>
|
||||
</view>
|
||||
</card>
|
||||
|
@@ -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 })
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
@@ -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>
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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) => {
|
||||
|
@@ -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"
|
||||
|
@@ -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;
|
||||
@@ -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({
|
||||
|
@@ -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=" ">
|
||||
|
@@ -23,7 +23,9 @@ Page({
|
||||
*/
|
||||
onLoad(options) {
|
||||
// this.getList()
|
||||
this.getCode()
|
||||
loadingFunc(async () => {
|
||||
await this.getCode()
|
||||
})
|
||||
},
|
||||
async getList() {
|
||||
const { code, message, data } = await getOwnTenementList()
|
||||
|
@@ -2,5 +2,6 @@
|
||||
"usingComponents": {
|
||||
"navigator": "/components/navigator/index",
|
||||
"scrollPageWrapper": "/components/scrollPageWrapper/index"
|
||||
}
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
}
|
@@ -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>
|
@@ -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;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
|
@@ -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"
|
||||
}
|
@@ -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}}" />
|
@@ -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;
|
||||
}
|
@@ -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();
|
||||
|
@@ -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>
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
@@ -95,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);
|
||||
|
@@ -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}}"
|
||||
/>
|
@@ -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
140
pages/rechargeWay/index.js
Normal 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() {
|
||||
|
||||
}
|
||||
})
|
11
pages/rechargeWay/index.json
Normal file
11
pages/rechargeWay/index.json
Normal 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"
|
||||
}
|
25
pages/rechargeWay/index.wxml
Normal file
25
pages/rechargeWay/index.wxml
Normal 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>
|
23
pages/rechargeWay/index.wxss
Normal file
23
pages/rechargeWay/index.wxss
Normal 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;
|
||||
}
|
@@ -24,14 +24,14 @@
|
||||
>
|
||||
<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 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:if="{{detail.type === 0}}"> 普通发票 </view>
|
||||
<view wx:elif="{{detail.type === 1}}"> 增值税专用发票 </view>
|
||||
<view wx:else>-</view>
|
||||
</view>
|
||||
</van-field>
|
||||
|
@@ -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');
|
||||
}
|
@@ -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;
|
||||
// 体验版
|
||||
@@ -233,3 +234,8 @@ export const getPixelRatio = () => {
|
||||
})
|
||||
return pixelRatio
|
||||
}
|
||||
|
||||
|
||||
export function isValidPhoneNumber(phoneNumber) {
|
||||
return /^1\d{10}$/.test(phoneNumber);
|
||||
}
|
@@ -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',
|
||||
|
Reference in New Issue
Block a user