This commit is contained in:
quantulr
2023-08-31 17:26:57 +08:00
parent 5bbe958729
commit a09291a1c8
7 changed files with 35 additions and 11 deletions

View File

@ -17,7 +17,7 @@
<view slot="description">{{times.formatDate(item.date) || "-"}} | {{item.oppositeCompany}}</view>
<view slot="note" style="color: {{item.type=='finance_type_income'?'#38a169':item.type=='finance_type_expenditure'?'#dd6b20':'transparent'}};">{{item.type=='finance_type_income'?'+':item.type=='finance_type_expenditure'?'-':''}}{{item.amount}}</view>
</t-cell>
<view slot="right" class="btn-wrapper" data-finance-id="{{item.financeId}}" bind:tap="showDeleteDialog">
<view wx:if="{{utils.hasPermission('finance:detail:remove', permissions)}}" slot="right" class="btn-wrapper" data-finance-id="{{item.financeId}}" bind:tap="showDeleteDialog">
<view class="btn delete-btn">删除</view>
</view>
</t-swipe-cell>

View File

@ -21,6 +21,7 @@
position: absolute;
left: 0;
top: 0;
z-index: -1;
}
.avatar_login {
margin-left: 64rpx;
@ -33,6 +34,11 @@
--td-button-primary-text-color: #ffffff;
}
}
.nickname {
margin-left: 24rpx;
color: #ffffff;
font-size: x-large;
}
}
.vip-card {
position: absolute;

View File

@ -8,6 +8,7 @@ Page({
*/
data: {
authToken: null,
user: null,
},
loginWithWeChat(e: any) {
@ -20,6 +21,9 @@ Page({
setToken(response.token);
getInfo(response.token).then((resp: any) => {
getApp().globalData.permissions = resp.permissions;
this.setData({
user: resp.user,
});
});
});
},
@ -38,6 +42,14 @@ Page({
this.setData({
authToken,
});
if (authToken) {
getInfo(authToken).then((resp: any) => {
const { user } = resp;
this.setData({
user,
});
});
}
},
/**

View File

@ -8,6 +8,7 @@
<view class="avatar_login">
<t-avatar icon="user" />
<t-button wx:if="{{!authToken}}" open-type="getPhoneNumber" bindgetphonenumber="loginWithWeChat" class="login-button" size="medium" theme="primary" variant="text">登录</t-button>
<view class="nickname" wx:else>{{user.nickname}}</view>
</view>
<view class="vip-card">
<text>中科九章管理层</text>

View File

@ -1,6 +1,7 @@
{
"usingComponents": {
"t-fab": "tdesign-miniprogram/fab/fab",
"t-sticky": "tdesign-miniprogram/sticky/sticky",
"statistics-card": "/components/statistics-card"
},
"enablePullDownRefresh": true

View File

@ -5,10 +5,12 @@
page {
padding-top: 32rpx;
}
.stock-tabs {
.stock-stick {
margin: 16rpx 32rpx 0;
border-radius: 18rpx;
overflow: hidden;
.stock-tabs {
border-radius: 18rpx;
overflow: hidden;
}
}
.stock-list {
padding: 16rpx 0 32rpx;

View File

@ -4,13 +4,15 @@
<wxs module="times" src="../../utils/time.wxs" />
<wxs module="utils" src="../../utils/utils.wxs" />
<statistics-card statistics-data="{{statisticsData}}" />
<view class="stock-tabs">
<t-tabs defaultValue="{{0}}" value="{{stockType}}" bind:change="onTabsChange" theme="tag">
<t-tab-panel label="库存" value="{{0}}" />
<t-tab-panel label="库" value="{{1}}" />
<t-tab-panel label="库" value="{{2}}" />
</t-tabs>
</view>
<t-sticky class="stock-stick">
<view class="stock-tabs">
<t-tabs defaultValue="{{0}}" value="{{stockType}}" bind:change="onTabsChange" theme="tag">
<t-tab-panel label="库" value="{{0}}" />
<t-tab-panel label="库" value="{{1}}" />
<t-tab-panel label="出库" value="{{2}}" />
</t-tabs>
</view>
</t-sticky>
<view class="stock-list">
<t-fab wx:if="{{stockType > 0 && utils.hasPermission('product:product:add', permissions)}}" class="float-button" icon="add" aria-label="增加" bind:click="handleAddStock"></t-fab>
<view hidden="{{stockType!=0}}" class="scroll-container">