Browse Source

11

11
master
wangsai 1 week ago
parent
commit
7d291b4ea7
  1. 2
      pages/add/add.wxss
  2. 2
      pages/index/index.wxml
  3. 10
      pages/login/login.js
  4. 28
      pages/profile/profile.js
  5. 4
      pages/profile/profile.wxml
  6. 2
      pages/utils/request.js

2
pages/add/add.wxss

@ -195,7 +195,7 @@
border-top-left-radius: 24rpx;
border-top-right-radius: 24rpx;
z-index: 999;
max-height: 80vh;
max-height: 50vh;
display: flex;
flex-direction: column;
}

2
pages/index/index.wxml

@ -34,7 +34,7 @@
<text class="iconfont icon-{{item.categoryIcon}}"></text>
</view>
<view class="record-details">
<view class="record-title">{{item.categoryName}}</view>
<view class="record-title">{{item.classificationName}}</view>
<view class="record-date">{{item.useDate}}</view>
</view>
<view class="record-amount {{item.type === 'in' ? 'income' : 'expense'}}">

10
pages/login/login.js

@ -95,13 +95,13 @@ Page({
});
wx.request({
url: 'http://localhost:48080/admin-api/system/auth/login', // 仅为示例,并非真实的接口地址
url: 'http://192.168.250.38:48080/app-api/member/auth/login', // 仅为示例,并非真实的接口地址
method: 'POST', // 请求方法,可以是 GET, POST, PUT, DELETE 等
data: {
"tenantName": "芋道源码",
"username": account,
"password": password,
"rememberMe": true
mobile: account,
// 账号
password: password
// 密码
},
header: {
'Tenant-Id':1,

28
pages/profile/profile.js

@ -1,3 +1,4 @@
const request = require('../utils/request')
Page({
data: {
totalRecords: 0,
@ -134,12 +135,29 @@ Page({
});
},
outLogin() {
async outLogin() {
wx.showModal({
title: '关于简易记账',
content: '简易记账是一款简单实用的记账工具,帮助你记录和管理个人财务。',
showCancel: false,
confirmText: '我知道了'
title: '确认退出',
content: '是否确认退出?',
cancelText: '取消',
confirmText: '确认',
success: async (res) => {
if (res.confirm) {
const ress=await request.post('/app-api/member/auth/logout')
console.log('resss:',ress)
if(ress.code==0){
wx.showToast({
title: '退出登录成功',
icon: 'success',
duration: 2000
});
wx.redirectTo({
url: `/pages/login/login`
})
}
}
}
});
}

4
pages/profile/profile.wxml

@ -55,7 +55,7 @@
</view>
<!-- 数据统计 -->
<view class="stats-card">
<!-- <view class="stats-card">
<text class="stats-title">记账统计</text>
<view class="stats-grid">
<view class="stats-item">
@ -71,5 +71,5 @@
<text class="stats-label">连续记账(天)</text>
</view>
</view>
</view>
</view> -->
</view>

2
pages/utils/request.js

@ -1,7 +1,7 @@
/**
* 封装微信小程序请求自动处理token
*/
const baseUrl='http://localhost:48080'
const baseUrl='http://192.168.250.38:48080'
const request = (url, options = {}) => {
// 返回Promise,方便使用async/await

Loading…
Cancel
Save