开始做充值和发票

This commit is contained in:
2024-03-20 11:10:52 +08:00
parent e5c9a96353
commit 7648ace524
59 changed files with 1091 additions and 199 deletions

View File

@@ -0,0 +1,64 @@
import { approveUser, getApproveList } from "../../../../service/user"
import { alertInfo, alertSuccess, wxModal } from "../../../../utils/index";
import request from "../../../../utils/request"
const { OK } = request;
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
list: []
},
lifetimes: {
attached: function() {
// this.setData({
// list: []
// })
this.init();
}
},
/**
* 组件的方法列表
*/
methods: {
async init() {
const result = await getApproveList()
this.setData({
list: result.data
})
},
async agree(e) {
const { user } = e.currentTarget.dataset;
console.log('user', user)
await wxModal({ content: `同意${user.nickName}的申请?` })
const { code, message } = await approveUser({ userId: user.id, type: 1 })
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("已同意")
this.init()
},
async disAgree(e) {
const { user } = e.currentTarget.dataset;
await wxModal({ content: `拒绝${user.nickName}的申请?` })
const { code, message } = await approveUser({ userId: user.id, type: 0 })
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("已拒绝")
this.init()
}
}
})

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,8 @@
<!--pages/member/components/approveMember/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="agree"> 同意 </view>
<view class="disAgree dangerTextBtn" data-user="{{item}}" bind:tap="disAgree"> 拒绝 </view>
</view>
</view>

View File

@@ -0,0 +1,21 @@
/* pages/member/components/approveMember/index.wxss */
.item {
display: flex;
align-items: center;
padding-top: 24rpx;
padding-bottom: 24rpx;
margin-left: 32rpx;
margin-right: 32rpx;
}
.nickName {
flex: 1;
}
.operate {
display: flex;
}
.disAgree {
margin-left: 24rpx;
}

View File

@@ -0,0 +1,65 @@
import { approveUser, getApproveList } from "../../../../service/user"
import { alertInfo, alertSuccess, wxModal } from "../../../../utils/index";
import request from "../../../../utils/request"
const { OK } = request;
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
list: []
},
lifetimes: {
attached: function() {
// this.setData({
// list: []
// })
this.init();
}
},
/**
* 组件的方法列表
*/
methods: {
async init() {
const result = await getApproveList()
this.setData({
list: result.data
})
},
async setAdmin(e) {
const { user } = e.currentTarget.dataset;
console.log('user', user)
await wxModal({ content: `你的管理员身份将转交给${user.nickName}` })
const { code, message } = await approveUser({ userId: user.id, type: 2 })
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("转交成功")
wx.clearStorageSync()
wx.exitMiniProgram()
},
async disAgree(e) {
const { user } = e.currentTarget.dataset;
await wxModal({ content: `拒绝${user.nickName}的申请?` })
const { code, message } = await approveUser({ userId: user.id, type: 0 })
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("已拒绝")
this.init()
}
}
})

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,8 @@
<!--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>

View File

@@ -0,0 +1,21 @@
.item {
display: flex;
align-items: center;
padding-top: 24rpx;
padding-bottom: 24rpx;
margin-left: 32rpx;
margin-right: 32rpx;
}
.nickName {
flex: 1;
}
.operate {
display: flex;
}
.disAgree {
margin-left: 24rpx;
}