修改项目配置,完成要加入的等待和审批操作,修改了部分接口定义和参数

This commit is contained in:
2024-03-22 16:45:36 +08:00
parent e07641732f
commit 2c79edb80c
24 changed files with 378 additions and 30 deletions

88
pages/apply/index.js Normal file
View File

@@ -0,0 +1,88 @@
import { userApply } from "../../service/user";
import { alertInfo, alertSuccess } from "../../utils/index";
import request from '../../utils/request'
const { OK } = request;
// pages/apply/index.js
Page({
/**
* 页面的初始数据
*/
data: {
id: "",
name: "",
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { id, name } = options;
this.setData({ id, name })
},
exit() {
wx.exitMiniProgram()
},
async join() {
const { id } = this.data;
const { code, message } = await userApply({ id })
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("加入成功")
setTimeout(() => {
wx.switchTab({
url: '/pages/home/index',
})
}, 500)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

5
pages/apply/index.json Normal file
View File

@@ -0,0 +1,5 @@
{
"usingComponents": {
"van-button": "@vant/weapp/button/index"
}
}

11
pages/apply/index.wxml Normal file
View File

@@ -0,0 +1,11 @@
<!--pages/apply/index.wxml-->
<view class="content">
<view class="contentWrapper">
<view class="text"> 确定要加入{{name}}吗? </view>
<view class="operate">
<van-button type="default" block style="flex: 1;" bind:click="exit">退出</van-button>
<van-button type="info" block style="flex:1;margin-left: 20rpx;">确认</van-button>
</view>
</view>
</view>

26
pages/apply/index.wxss Normal file
View File

@@ -0,0 +1,26 @@
/* pages/apply/index.wxss */
.content {
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.text {
text-align: center;
margin-bottom: 10vh;
}
.operate {
display: flex;
margin-bottom: 6vh;
}
.contentWrapper {
width: 60%;
margin-left: 40rpx;
margin-right: 40rpx;
}