增加首页和员工入口

This commit is contained in:
chenwj 2023-06-13 17:36:18 +08:00
parent aa4e18e267
commit 7597961a7b
24 changed files with 299 additions and 94 deletions

View File

@ -2,25 +2,25 @@
"pages": [
"pages/index/index",
"pages/logs/logs",
"pages/my/my",
"pages/payroll/payroll"
"pages/merchant/payroll",
"pages/merchant/my",
"pages/employee/index"
],
"tabBar": {
"custom": true,
"list": [
{
"pagePath": "pages/index/index"
"pagePath": "pages/merchant/payroll"
},
{
"pagePath": "pages/my/my"
"pagePath": "pages/merchant/my"
}
]
},
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "发薪Demo",
"navigationBarTextStyle": "black"
"navigationBarTitleText": "发薪Demo"
},
"usingComponents": {
"t-tab-bar": "tdesign-miniprogram/tab-bar/tab-bar",

View File

@ -8,7 +8,7 @@
padding: 200rpx 0;
box-sizing: border-box;
}
.card {
/* .card {
display: flex;
flex-direction: column;
height: 200px;
@ -18,7 +18,7 @@
.title {
font-size: 20px;
font-weight: bold;
}
} */
page {
background-color: rgb(245, 245, 245);
}

View File

@ -20,6 +20,7 @@ Component({
* 组件的初始数据
*/
data: {
},
/**

View File

@ -18,10 +18,10 @@ Component({
{ value: 1, label: '我的', icon: 'user' },
],
pageList: [{
url: '/pages/index/index'
url: '/pages/merchant/payroll'
},
{
url: '/pages/my/my'
url: '/pages/merchant/my'
}]
},
/**

View File

@ -1,11 +1,28 @@
// pages/payroll/payroll.js
// pages/employee/index.js
Page({
/**
* 页面的初始数据
*/
data: {
iconsList1: [{
value: 'oa-shenpi',
color: 'orange',
name: '个人信息',
}, {
value: 'zhifushezhi',
color: 'deepskyblue',
name: '薪资卡'
}],
iconsList2: [{
value: 'oa-shenpi',
color: 'orange',
name: '考勤记录',
}, {
value: 'zhifushezhi',
color: 'deepskyblue',
name: '工资条'
}],
},
/**

View File

@ -0,0 +1,6 @@
{
"usingComponents": {
"card": "../../components/card/index",
"t-navbar": "tdesign-miniprogram/navbar/navbar"
}
}

14
pages/employee/index.wxml Normal file
View File

@ -0,0 +1,14 @@
<!--pages/employee/index.wxml-->
<view >
<view class="userinfo">
<view class="userinfo-avatar" bindtap="bindViewTap">
<open-data type="userAvatarUrl"></open-data>
</view>
<view class="userinfo-detail">
<text class="userinfo-name">微信用户</text>
</view>
</view>
<card cardName="个人中心" icons="{{iconsList1}}" />
<card cardName="智能人事" icons="{{iconsList2}}" />
</view>

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

@ -0,0 +1,26 @@
/* pages/employee/index.wxss */
.userinfo {
display: flex;
width: 100%;
flex-direction: row;
background-color: #0052d9;
}
.userinfo-avatar {
overflow: hidden;
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}
.userinfo-detail {
display: flex;
flex-direction: column;
margin: 5%;
}
.userinfo-name {
font-weight: bold;
color: white;
}

View File

@ -4,7 +4,9 @@ const app = getApp()
Page({
data: {
showDialog: false
image1: "https://tdesign.gtimg.com/miniprogram/images/avatar1.png",
image2: "https://tdesign.gtimg.com/miniprogram/images/avatar2.png"
},
// 添加员工
addEmployee(e) {
@ -18,11 +20,16 @@ Page({
showDialog: false
});
},
// 转账记录页面
switchTransferRecord() {
// TODO
wx.navigateTo({
url: '/pages/logs/logs',
// 员工页面
navigateToEmployee() {
wx.navigateTo({
url: '/pages/employee/index',
})
},
// 商户页面
switchToMerchant() {
wx.switchTab({
url: '/pages/merchant/payroll',
})
},
@ -34,7 +41,6 @@ Page({
}
},
onShow() {
this.getTabBar().init();
},
})

View File

@ -1,11 +1,9 @@
{
"usingComponents": {
"t-button": "tdesign-miniprogram/button/button",
"t-dialog": "tdesign-miniprogram/dialog/dialog",
"t-avatar": "tdesign-miniprogram/avatar/avatar",
"t-row": "tdesign-miniprogram/row/row",
"t-col": "tdesign-miniprogram/col/col",
"t-tabs": "tdesign-miniprogram/tabs/tabs",
"t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
"t-empty": "tdesign-miniprogram/empty/empty"
"t-footer": "tdesign-miniprogram/footer/footer"
}
}

View File

@ -1,36 +1,28 @@
<!--index.wxml-->
<view>
<t-row class="head">
<view class="title">欢迎使用智能发薪</view>
<view class="subtitle">一键发薪 即时到账</view>
<t-button class="head-button" theme="primary" size="small" shape="round">一键发薪</t-button>
<view class="title">智能发薪</view>
<view class="subtitle">专业保障, 让发薪更便捷, 更安全</view>
</t-row>
<t-row>
<t-col span="11" t-class="small-card" bindtap="addEmployee">
<view class="small-card-title">添加员工</view>
<view class="small-card-subtitle">快速添加项目员工</view>
<t-dialog
visible="{{showDialog}}"
title="添加项目员工"
content="告知当前状态、信息和解决方法,等内容。描述文案尽可能控制在三行内"
close-btn
confirm-btn="{{ { content: '发给员工', variant: 'base' } }}"
cancel-btn="生成项目码"
bind:confirm="closeDialog"
bind:cancel="closeDialog"
bind:close="closeDialog"
/>
<t-row class="content">
<t-col span="10" class="content-avatar">
<t-avatar class="avatar" size="large" image="{{image1}}" />
</t-col>
<t-col span="11" offset="1" t-class="small-card" bindtap="switchTransferRecord">
<view class="small-card-title">转账记录</view>
<view class="small-card-subtitle">转账明细可查</view>
<t-col span="14">
<view class="content-title">员工入口</view>
<view class="content-subtitle">无需银行卡 实时到账</view>
<t-button theme="primary" size="extra-small" shape="round" bindtap="navigateToEmployee">点击进入</t-button>
</t-col>
</t-row>
<t-row>
<t-tabs defaultValue="{{0}}" t-class="custom-tabs" t-class-item="custom-tab-items">
<t-tab-panel label="制薪单" value="0" />
<t-tab-panel label="发薪单" value="1" />
</t-tabs>
<t-row class="content">
<t-col span="10" class="content-avatar">
<t-avatar class="avatar" size="large" image="{{image2}}" />
</t-col>
<t-col span="14">
<view class="content-title">商户入口</view>
<view class="content-subtitle">一键发薪 安全便捷</view>
<t-button theme="primary" size="extra-small" shape="round" bindtap="switchToMerchant">点击进入</t-button>
</t-col>
</t-row>
</view>
<view class="footer">当前版本暂不对外开放, 如需使用请先申请</view>

View File

@ -1,4 +1,9 @@
/**index.wxss**/
page {
background-color: #0052d9;
display: flex;
flex-direction: column;
}
.head {
display: flex;
@ -8,51 +13,55 @@
padding-top: 5%;
padding-bottom: 3%;
align-items: center;
background-color: white;
border-radius: 5%;
}
.title {
color: white;
font-size: 175%;
font-weight: bold;
margin-bottom: 2%;
}
.subtitle {
color: lightgray;
font-size: 85%;
margin-bottom: 5%;
}
.head-button {
color: orange;
background-color: orange;
width: 50%;
}
.small-card {
margin-left: 2%;
margin-bottom: 3%;
padding-top: 5%;
padding-left: 20px;
.content {
display: flex;
flex-direction: row;
background-color: white;
height: 75px;
border-radius: 5%;
border-radius: 3%;
margin: 5%;
padding: 5%;
padding-bottom: 0%;
}
.small-card-title {
font-size: 85%;
.content-avatar {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.avatar {
width: 250rpx;
height: 250rpx;
}
.content-title {
font-weight: bold;
margin-bottom: 3%;
/* margin-bottom: 5%; */
}
.small-card-subtitle {
color: gray;
font-size: 80%;
.content-subtitle {
font-size: 85%;
margin-bottom: 5%;
padding: 3%;
}
.custom-tabs {
margin-bottom: 32rpx;
background-color: gray;
}
.custom-tab-items {
background-color: rgb(245, 245, 245);
border: hidden;
.footer {
color: lightgray;
margin-top: 60%;
text-align: center;
}

View File

@ -12,6 +12,6 @@
<card cardName="发薪管理" icons="{{iconsList1}}" />
<card cardName="管理助手" icons="{{iconsList2}}" />
<card cardName="风险管控" icons="{{iconsList3}}" />
<t-cell title="回到首页" hover arrow leftIcon="home" bordered="{{false}}" />
<t-cell title="回到首页" hover arrow leftIcon="home" bordered="{{false}}" url="../index/index" />
<t-cell title="关于我们" hover arrow leftIcon="error-circle" bordered="{{false}}" />
</view>

View File

@ -14,7 +14,7 @@
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}
}
.userinfo-detail {
display: flex;

40
pages/merchant/payroll.js Normal file
View File

@ -0,0 +1,40 @@
// payroll.js
// 获取应用实例
const app = getApp()
Page({
data: {
showDialog: false
},
// 添加员工
addEmployee(e) {
console.log(e)
this.setData({
showDialog: true
})
},
closeDialog() {
this.setData({
showDialog: false
});
},
// 转账记录页面
switchTransferRecord() {
// TODO
wx.navigateTo({
url: '/pages/logs/logs',
})
},
onLoad() {
if (wx.getUserProfile) {
this.setData({
canIUseGetUserProfile: true
})
}
},
onShow() {
this.getTabBar().init();
},
})

View File

@ -0,0 +1,10 @@
{
"usingComponents": {
"t-button": "tdesign-miniprogram/button/button",
"t-dialog": "tdesign-miniprogram/dialog/dialog",
"t-row": "tdesign-miniprogram/row/row",
"t-col": "tdesign-miniprogram/col/col",
"t-tabs": "tdesign-miniprogram/tabs/tabs",
"t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel"
}
}

View File

@ -0,0 +1,37 @@
<!--pages/payroll/payroll.wxml-->
<view>
<t-row class="head">
<view class="title">欢迎使用智能发薪</view>
<view class="subtitle">一键发薪 即时到账</view>
<t-button class="head-button" theme="primary" size="small" shape="round">一键发薪</t-button>
</t-row>
<t-row>
<t-col span="11" t-class="small-card" bindtap="addEmployee">
<view class="small-card-title">添加员工</view>
<view class="small-card-subtitle">快速添加项目员工</view>
<t-dialog
visible="{{showDialog}}"
title="添加项目员工"
content="告知当前状态、信息和解决方法,等内容。描述文案尽可能控制在三行内"
close-btn
confirm-btn="{{ { content: '发给员工', variant: 'base' } }}"
cancel-btn="生成项目码"
bind:confirm="closeDialog"
bind:cancel="closeDialog"
bind:close="closeDialog"
/>
</t-col>
<t-col span="11" offset="1" t-class="small-card" bindtap="switchTransferRecord">
<view class="small-card-title">转账记录</view>
<view class="small-card-subtitle">转账明细可查</view>
</t-col>
</t-row>
<t-row>
<t-tabs defaultValue="{{0}}" t-class="custom-tabs" t-class-item="custom-tab-items">
<t-tab-panel label="制薪单" value="0" />
<t-tab-panel label="发薪单" value="1" />
</t-tabs>
</t-row>
</view>

View File

@ -0,0 +1,55 @@
/* pages/payroll/payroll.wxss */
.head {
display: flex;
flex-direction: column;
margin: 2%;
margin-top: 0%;
padding-top: 5%;
padding-bottom: 3%;
align-items: center;
background-color: white;
border-radius: 5%;
}
.title {
font-weight: bold;
}
.subtitle {
color: lightgray;
font-size: 85%;
margin-bottom: 5%;
}
.head-button {
color: orange;
background-color: orange;
width: 50%;
}
.small-card {
margin-left: 2%;
margin-bottom: 3%;
padding-top: 5%;
padding-left: 20px;
background-color: white;
height: 75px;
border-radius: 5%;
}
.small-card-title {
font-size: 85%;
font-weight: bold;
margin-bottom: 3%;
}
.small-card-subtitle {
color: gray;
font-size: 80%;
}
.custom-tabs {
margin-bottom: 32rpx;
background-color: gray;
}
.custom-tab-items {
background-color: rgb(245, 245, 245);
border: hidden;
}

View File

@ -1,3 +0,0 @@
{
"usingComponents": {}
}

View File

@ -1,2 +0,0 @@
<!--pages/payroll/payroll.wxml-->
<text>pages/payroll/payroll.wxml</text>

View File

@ -1 +0,0 @@
/* pages/payroll/payroll.wxss */

View File

@ -42,7 +42,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.19.4",
"appid": "wx131524437f10d3ea",
"appid": "wxbc8d44f75f7f9ffd",
"projectname": "miniprogram-92",
"condition": {},
"editorSetting": {