修改项目配置,完成要加入的等待和审批操作,修改了部分接口定义和参数
This commit is contained in:
93
pages/waitApprove/index.js
Normal file
93
pages/waitApprove/index.js
Normal file
@@ -0,0 +1,93 @@
|
||||
import { getUserInfo, reApprove } from "../../service/user"
|
||||
import { alertInfo, alertSuccess } from '../../utils/index'
|
||||
import request from "../../utils/request"
|
||||
const { OK } = request;
|
||||
// pages/waitApprove/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
user: {}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.getInfo()
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
async getInfo() {
|
||||
const { code, message, data } = await getUserInfo();
|
||||
// if (code !== OK) {
|
||||
// alertInfo(message)
|
||||
// return;
|
||||
// }
|
||||
this.setData({
|
||||
user: data
|
||||
})
|
||||
},
|
||||
jumpToHome() {
|
||||
wx.switchTab({
|
||||
url: '/page/home/index',
|
||||
})
|
||||
},
|
||||
async handleReApprove() {
|
||||
const { code, message, } = await reApprove();
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
alertSuccess("提交成功");
|
||||
this.getInfo();
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
6
pages/waitApprove/index.json
Normal file
6
pages/waitApprove/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-button": "@vant/weapp/button/index"
|
||||
},
|
||||
"navigationBarTitleText": ""
|
||||
}
|
21
pages/waitApprove/index.wxml
Normal file
21
pages/waitApprove/index.wxml
Normal file
@@ -0,0 +1,21 @@
|
||||
<!--pages/waitApprove/index.wxml-->
|
||||
<view class="wrapper">
|
||||
<view class="content" wx:if="{{user.status === 0}}">
|
||||
<view class="status"> 等待管理员审批中 </view>
|
||||
<view class="operate">
|
||||
<van-button type="default" bind:tap="getInfo">刷新</van-button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content" wx:if="{{user.status === 1}}">
|
||||
<view class="status"> 管理员已同意 </view>
|
||||
<view class="operate">
|
||||
<van-button type="default" bind:tap="jumpToHome">进入系统</van-button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content" wx:if="{{user.status === 2}}">
|
||||
<view class="status"> 管理员已拒绝 </view>
|
||||
<view class="operate">
|
||||
<van-button type="default">重新提交</van-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
25
pages/waitApprove/index.wxss
Normal file
25
pages/waitApprove/index.wxss
Normal file
@@ -0,0 +1,25 @@
|
||||
/* pages/waitApprove/index.wxss */
|
||||
.content {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
width: 600rpx;
|
||||
height: 50vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.status {
|
||||
text-align: center;
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.operate {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
Reference in New Issue
Block a user