This commit is contained in:
浅念
2025-12-05 18:08:03 +08:00
commit 423fc8b7e1
841 changed files with 103564 additions and 0 deletions
+428
View File
@@ -0,0 +1,428 @@
<template>
<view class="home-page">
<uni-nav-bar leftText=" " :fixed="true" leftIcon="back" :border="false" @clickLeft="leftClick" color="#fff" backgroundColor="rgb(79 137 247)" :statusBar="true" title="借用申请"></uni-nav-bar>
<view class="content-wrapper">
<!-- 申请人信息卡片 -->
<view class="form-card">
<view class="form-item form-item-row">
<text class="form-label">申请人:</text>
<text class="form-value">{{ formData.applicant || '犇犇' }}</text>
</view>
<view class="form-item form-item-row">
<text class="form-label">公司名称:</text>
<text class="form-value">{{ formData.companyName || '合塑' }}</text>
</view>
</view>
<!-- 借用详情卡片 -->
<view class="form-card4">
<!-- 借用时间 -->
<view class="form-item form-item-row">
<text class="form-label required">借用时间</text>
<view class="form-input-container">
<uni-datetime-picker
ref="borrowTimePicker"
type="datetime"
v-model="formData.borrowTime"
placeholder="请选择时间"
:border="false"
:clear-icon="false"
@change="onBorrowTimeChange"
>
<view class="custom-datetime-input">
<text class="custom-datetime-text" :class="{ 'placeholder': !formData.borrowTime }">
{{ formData.borrowTime || '请选择时间' }}
</text>
<uni-icons type="calendar" size="18" color="#999"></uni-icons>
</view>
</uni-datetime-picker>
</view>
</view>
</view>
<view class="form-card4">
<!-- 计划归还时间 -->
<view class="form-item form-item-row">
<text class="form-label required">计划归还时间</text>
<view class="form-input-container">
<uni-datetime-picker
ref="returnTimePicker"
type="datetime"
v-model="formData.returnTime"
placeholder="请选择时间"
:border="false"
:clear-icon="false"
@change="onReturnTimeChange"
>
<view class="custom-datetime-input">
<text class="custom-datetime-text" :class="{ 'placeholder': !formData.returnTime }">
{{ formData.returnTime || '请选择时间' }}
</text>
<uni-icons type="calendar" size="18" color="#999"></uni-icons>
</view>
</uni-datetime-picker>
</view>
</view>
</view>
<view class="form-card4">
<!-- 物品名称 -->
<view class="form-item form-item-row">
<text class="form-label required">物品名称</text>
<view class="form-input-container">
<uni-data-select
v-model="formData.itemName"
:localdata="itemNameOptions"
placeholder="请选择"
:clear="false"
></uni-data-select>
</view>
</view>
</view>
<view class="form-card4">
<!-- 物品所属公司 -->
<view class="form-item form-item-row">
<text class="form-label required">物品所属公司</text>
<view class="form-input-container">
<uni-data-select
v-model="formData.itemCompany"
:localdata="itemCompanyOptions"
placeholder="请选择"
:clear="false"
></uni-data-select>
</view>
</view>
</view>
<view class="form-card">
<!-- 借用事由 -->
<view class="form-item">
<text class="form-label required">借用事由</text>
<uni-easyinput
v-model="formData.borrowReason"
type="textarea"
:autoHeight="true"
placeholder="请填写借用事由"
:maxlength="500"
></uni-easyinput>
</view>
</view>
<!-- 备注卡片 -->
<view class="form-card " style="margin-bottom: 8rpx;">
<view class="form-item">
<text class="form-label">备注</text>
<uni-easyinput
v-model="formData.remarks"
type="textarea"
:autoHeight="true"
placeholder="请填写备注"
:maxlength="500"
></uni-easyinput>
</view>
</view>
<!-- 附件卡片 -->
<view class="form-card">
<view class="form-item">
<text class="form-label form-label1">附件</text>
<uni-file-picker
v-model="formData.attachments"
file-mediatype="image"
mode="grid"
:limit="9"
:auto-upload="false"
@select="onFileSelect"
>
<image src="/static/image/upload.png" mode="" class="addimg"></image>
</uni-file-picker>
</view>
</view>
<!-- 提交按钮 -->
<view class="submit-btn-wrapper">
<button class="submit-btn" @click="handleSubmit">提交</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
formData: {
applicant: '犇犇',
companyName: '合塑',
borrowTime: '',
returnTime: '',
itemName: '',
itemCompany: '',
borrowReason: '',
remarks: '',
attachments: []
},
itemNameOptions: [
{ text: '物品1', value: 'item1' },
{ text: '物品2', value: 'item2' },
{ text: '物品3', value: 'item3' }
],
itemCompanyOptions: [
{ text: '公司A', value: 'companyA' },
{ text: '公司B', value: 'companyB' },
{ text: '公司C', value: 'companyC' }
]
}
},
methods: {
leftClick(){
uni.navigateBack({})
},
onBorrowTimeChange(e) {
// uni-datetime-picker返回的已经是格式化后的字符串
this.formData.borrowTime = e
},
onReturnTimeChange(e) {
// uni-datetime-picker返回的已经是格式化后的字符串
this.formData.returnTime = e
},
onFileSelect(e) {
console.log('文件选择:', e)
},
handleSubmit() {
// 表单验证
if (!this.formData.borrowTime) {
uni.showToast({
title: '请选择借用时间',
icon: 'none'
})
return
}
if (!this.formData.returnTime) {
uni.showToast({
title: '请选择计划归还时间',
icon: 'none'
})
return
}
if (!this.formData.itemName) {
uni.showToast({
title: '请选择物品名称',
icon: 'none'
})
return
}
if (!this.formData.itemCompany) {
uni.showToast({
title: '请选择物品所属公司',
icon: 'none'
})
return
}
if (!this.formData.borrowReason) {
uni.showToast({
title: '请填写借用事由',
icon: 'none'
})
return
}
// 提交表单
console.log('提交表单:', this.formData)
uni.showToast({
title: '提交成功',
icon: 'success'
})
// 这里可以调用API提交数据
}
}
}
</script>
<style lang="scss">
.home-page{
min-height: 100vh;
background: linear-gradient(180.05deg, #3074F7 0.04%, #F4F6F8 34.07%);
box-sizing: border-box;
padding-bottom: 120rpx;
padding: 0px 28rpx;
}
.content-wrapper{
margin-top: 20rpx;
}
.addimg{
width: 50px;
height:50px;
}
.form-card {
background: #fff;
border-radius: 12rpx;
padding:20rpx 34rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
}
.form-card4 {
background: #fff;
border-radius: 6px;
padding: 3px 17px;
margin-bottom: 4px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
height: 35px;
line-height: 35px;
}
.form-item {
margin-bottom: 32rpx;
&:last-child {
margin-bottom: 0;
}
&.form-item-row {
display: flex;
align-items: center;
flex-wrap: nowrap;
}
}
.form-label {
font-size: 28rpx;
color: #333;
// margin-bottom: 16rpx;
display: block;
flex-shrink: 0;
min-width: 160rpx;
&.required::before {
content: '*';
color: #ff0000;
margin-right: 4rpx;
}
}
.form-label1{
margin-bottom: 16rpx;
}
.form-item-row .form-label {
margin-bottom: 0;
margin-right: 24rpx;
}
.form-input-container {
flex: 1;
min-width: 0;
}
.form-value {
font-size: 28rpx;
color: #666;
flex: 1;
text-align: right;
}
.form-input-wrapper {
width: 100%;
}
.form-input-container .form-input-wrapper {
width: 100%;
}
.custom-datetime-input {
border-radius: 4px;
box-sizing: border-box;
width: 100%;
text-align: right;
}
.custom-datetime-text {
font-size: 28rpx;
color: #333;
flex: 1;
&.placeholder {
color: #999;
}
}
// uni-datetime-picker 样式覆盖
::v-deep .uni-date-editor {
width: 100%;
}
::v-deep .uni-date-editor--x {
border: none !important;
background: transparent !important;
padding: 0 !important;
}
::v-deep .uni-date-x {
width: 100%;
padding: 0 !important;
}
::v-deep .uni-date__x-input {
display: none;
}
::v-deep .icon-calendar {
display: none;
}
.submit-btn-wrapper {
margin-top: 40rpx;
padding-bottom: 40rpx;
}
.submit-btn {
width: 70%;
height: 88rpx;
background: #3074F7;
color: #fff;
border-radius: 44rpx;
font-size: 32rpx;
line-height: 88rpx;
border: none;
&::after {
border: none;
}
}
// uni-data-select 样式调整
::v-deep .uni-stat__select {
width: 100%;
}
::v-deep .uni-select {
width: 100%;
border: none;
text-align: right;
}
::v-deep .uni-select__input-text {
font-size: 28rpx;
color: #333;
}
::v-deep .uni-select__input-placeholder {
color: #999;
}
// uni-easyinput 样式调整
::v-deep .uni-easyinput {
width: 100%;
}
::v-deep .uni-easyinput__content {
border: none;
min-height: 120rpx;
}
::v-deep .uni-easyinput__content-textarea {
font-size: 28rpx;
color: #333;
min-height: 120rpx;
padding-left: 0px;
}
// uni-file-picker 样式调整
::v-deep .uni-file-picker {
width: 100%;
}
</style>
+223
View File
@@ -0,0 +1,223 @@
<template>
<view class="home-page">
<uni-nav-bar leftText=" " :fixed="true" leftIcon="back" :border="false" @clickLeft="leftClick" color="#fff" backgroundColor="rgb(79 137 247)" :statusBar="true" title="详情"></uni-nav-bar>
<view class="content-wrapper">
<view class="detail-card">
<!-- 状态丝带 -->
<view class="status-ribbon" :class="statusClass">
<text class="ribbon-text">{{ statusText }}</text>
</view>
<!-- 标题 -->
<view class="card-header">
<text class="item-title">{{ detail.itemName }}</text>
</view>
<!-- 申请信息 -->
<view class="section">
<text class="section-title">申请信息</text>
<view class="info-row">
<text class="label">申请人</text>
<text class="value">{{ detail.applicant }}</text>
</view>
<view class="info-row">
<text class="label">公司名称</text>
<text class="value">{{ detail.companyName }}</text>
</view>
<view class="info-row">
<text class="label">物品所属公司</text>
<text class="value">{{ detail.itemCompany }}</text>
</view>
<view class="info-row">
<text class="label">借用时间</text>
<text class="value">{{ detail.borrowTime }}</text>
</view>
<view class="info-row">
<text class="label">计划归还时间</text>
<text class="value">{{ detail.returnTime }}</text>
</view>
<view class="info-row">
<text class="label">借用事由</text>
<text class="value">{{ detail.borrowReason }}</text>
</view>
<view class="info-row" v-if="detail.remarks">
<text class="label">备注</text>
<text class="value">{{ detail.remarks }}</text>
</view>
</view>
<!-- 复核信息 -->
<view class="section">
<text class="section-title">复核信息</text>
<view class="info-row">
<text class="label">复核人</text>
<text class="value">{{ detail.reviewer || '—' }}</text>
</view>
<view class="info-row">
<text class="label">复核时间</text>
<text class="value">{{ detail.reviewTime || '—' }}</text>
</view>
<view class="info-row">
<text class="label">复核结果</text>
<text class="value">{{ detail.reviewResult || '—' }}</text>
</view>
<view class="info-row" v-if="detail.reviewRemark">
<text class="label">复核说明</text>
<text class="value">{{ detail.reviewRemark }}</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
id: '',
detail: {
status: 'returned', // returned | notReturned | pendingReview
itemName: '公章',
applicant: '刘宇',
companyName: '合塑',
itemCompany: '合塑',
borrowTime: '2024-11-06 09:41:18',
returnTime: '2024-11-10 18:00:00',
borrowReason: '合同签署使用',
remarks: '请保持物品完整',
reviewer: '张伟',
reviewTime: '2024-11-07 09:00:00',
reviewResult: '已复核',
reviewRemark: '流程符合规定'
}
}
},
computed: {
statusText() {
const map = {
returned: '已归还',
notReturned: '未归还',
pendingReview: '待复核'
}
return map[this.detail.status] || ''
},
statusClass() {
return `ribbon-${this.detail.status}`
}
},
onLoad(options) {
this.id = options.id;
},
methods: {
leftClick(){
uni.navigateBack({})
}
}
}
</script>
<style lang="scss">
.home-page{
min-height: 100vh;
background: linear-gradient(180.05deg, #3074F7 0.04%, #F4F6F8 34.07%);
box-sizing: border-box;
padding-bottom: 120rpx;
padding: 0px 28rpx;
}
.content-wrapper{
margin-top: 20rpx;
}
.detail-card{
position: relative;
background: #fff;
border-radius: 12rpx;
padding: 32rpx;
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.05);
overflow: hidden;
}
.card-header{
margin-bottom: 16rpx;
}
.item-title{
font-size: 32rpx;
font-weight: 600;
color: #333;
}
.section{
margin-top: 24rpx;
padding-top: 12rpx;
}
.section-title{
font-size: 28rpx;
font-weight: 500;
color: #444;
margin-bottom: 12rpx;
display: block;
}
.info-row{
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 12rpx;
}
.label{
color: #666;
font-size: 26rpx;
}
.value{
color: #333;
font-size: 26rpx;
text-align: right;
max-width: 66%;
}
.status-ribbon{
position: absolute;
top: -5px;
right: -24px;
width: 75px;
height: 37px;
background: #08A400;
transform: rotate(45deg);
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
.ribbon-returned{
background: #08A400;
}
.ribbon-notReturned{
background: #BD0000;
}
.ribbon-pendingReview{
background: #3471FF;
}
.ribbon-text{
color: #fff;
font-size: 20rpx;
font-weight: 500;
transform: rotate(0deg);
transform-origin: center;
display: block;
text-align: center;
margin-top: 16rpx;
white-space: nowrap;
letter-spacing: 1rpx;
}
</style>
+318
View File
@@ -0,0 +1,318 @@
<template>
<view class="home-page">
<uni-nav-bar leftText=" " :fixed="true" leftIcon="back" :border="false" @clickLeft="leftClick" color="#fff" backgroundColor="rgb(48, 116, 247)" :statusBar="true" title="借用列表"></uni-nav-bar>
<view class="content-wrapper">
<!-- Tab栏 -->
<view class="tab-bar">
<view
class="tab-item"
:class="{ 'tab-item-active': currentTab === index }"
v-for="(tab, index) in tabList"
:key="index"
@click="switchTab(index)"
>
<text class="tab-text">{{ tab }}</text>
<view v-if="currentTab === index" class="tab-underline"></view>
</view>
</view>
<!-- 列表内容 -->
<view class="list-container">
<view
class="borrow-card"
v-for="(item, index) in filteredList"
:key="index"
>
<!-- 状态标签(右上角旋转丝带) -->
<view class="status-ribbon" :class="'ribbon-' + item.status">
<text class="ribbon-text">{{ getStatusText(item.status) }}</text>
</view>
<!-- 卡片内容 -->
<view class="card-content">
<view class="card-title">{{ item.itemName }}</view>
<view class="card-info">
<text class="info-item">申请人: {{ item.applicant }}</text>
<text class="info-item">借用时间: {{ item.borrowTime }}</text>
<text class="info-item">公司名称: {{ item.companyName }}</text>
</view>
<!-- 操作按钮 -->
<view class="card-actions" v-if="item.status !== 'returned'">
<button
class="action-btn"
:class="'btn-' + item.status"
@click="handleAction(item)"
>
{{ getActionText(item.status) }}
</button>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
currentTab: 0,
tabList: ['全部', '已归还', '未归还', '待复核'],
borrowList: [
{
id: 1,
itemName: '公章',
applicant: '刘宇',
borrowTime: '2024-11-06 09:41:18',
companyName: '合塑',
status: 'returned' // returned, notReturned, pendingReview
},
{
id: 2,
itemName: '公章',
applicant: '刘宇',
borrowTime: '2024-11-06 09:41:18',
companyName: '合塑',
status: 'notReturned'
},
{
id: 3,
itemName: '公章',
applicant: '刘宇',
borrowTime: '2024-11-06 09:41:18',
companyName: '合塑',
status: 'pendingReview'
}
]
}
},
computed: {
filteredList() {
if (this.currentTab === 0) {
return this.borrowList
} else if (this.currentTab === 1) {
return this.borrowList.filter(item => item.status === 'returned')
} else if (this.currentTab === 2) {
return this.borrowList.filter(item => item.status === 'notReturned')
} else if (this.currentTab === 3) {
return this.borrowList.filter(item => item.status === 'pendingReview')
}
return []
}
},
methods: {
leftClick(){
uni.navigateBack({})
},
switchTab(index) {
this.currentTab = index
},
getStatusText(status) {
const statusMap = {
'returned': '已归还',
'notReturned': '未归还',
'pendingReview': '待复核'
}
return statusMap[status] || ''
},
getActionText(status) {
const actionMap = {
'notReturned': '立即归还',
'pendingReview': '立即复核'
}
return actionMap[status] || ''
},
handleAction(item) {
if (item.status === 'notReturned') {
// 归还操作
uni.showModal({
title: '提示',
content: '确定要归还该物品吗?',
success: (res) => {
if (res.confirm) {
uni.showToast({
title: '归还成功',
icon: 'success'
})
// 这里可以调用API更新状态
}
}
})
} else if (item.status === 'pendingReview') {
// 复核操作
uni.showModal({
title: '提示',
content: '确定要复核该申请吗?',
success: (res) => {
if (res.confirm) {
uni.showToast({
title: '复核成功',
icon: 'success'
})
// 这里可以调用API更新状态
}
}
})
}
}
}
}
</script>
<style lang="scss">
.home-page {
min-height: 100vh;
background: rgb(244, 246, 248);
}
.content-wrapper {
}
// Tab栏样式
.tab-bar {
display: flex;
background: #F4F6F8;
}
.tab-item {
flex: 1;
position: relative;
padding: 24rpx 0;
text-align: center;
}
.tab-text {
font-size: 28rpx;
color: #666;
}
.tab-item-active .tab-text {
color: #3074F7;
font-weight: 500;
}
.tab-underline {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 60rpx;
height: 4rpx;
background: #3074F7;
border-radius: 2rpx;
}
// 列表容器
.list-container {
padding: 24rpx 28rpx;
}
// 借用卡片
.borrow-card {
position: relative;
background: #fff;
border-radius: 12rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
overflow: hidden;
}
// 状态标签(旋转丝带效果)
.status-ribbon {
position: absolute;
top: -5px;
right: -24px;
width: 75px;
height: 37px;
background: #4CAF50;
transform: rotate(45deg);
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.15);
}
.ribbon-returned {
background: #4CAF50; // 绿色
}
.ribbon-notReturned {
background: #F44336; // 红色
}
.ribbon-pendingReview {
background: #2196F3; // 蓝色
}
.ribbon-text {
color: #fff;
font-size: 20rpx;
font-weight: 500;
transform: rotate(0deg);
transform-origin: center;
display: block;
text-align: center;
margin-top: 16rpx;
white-space: nowrap;
letter-spacing: 1rpx;
}
// 卡片内容
.card-content {
padding: 32rpx;
padding-top: 48rpx;
}
.card-title {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
}
.card-info {
display: flex;
flex-direction: column;
gap: 12rpx;
margin-bottom: 24rpx;
}
.info-item {
font-size: 26rpx;
color: #666;
line-height: 1.6;
}
// 操作按钮
.card-actions {
display: flex;
justify-content: flex-end;
margin-top: 24rpx;
}
.action-btn {
padding: 14rpx 40rpx;
background: #3074F7;
color: #fff;
border-radius: 8rpx;
font-size: 26rpx;
border: none;
line-height: 1;
&::after {
border: none;
}
}
.btn-notReturned {
background: #3074F7;
}
.btn-pendingReview {
background: #3074F7;
}
</style>
+316
View File
@@ -0,0 +1,316 @@
<template>
<view class="home-page">
<uni-nav-bar leftText=" " :fixed="true" leftIcon="back" :border="false" @clickLeft="leftClick" color="#fff" backgroundColor="rgb(48, 116, 247)" :statusBar="true" title="借用列表"></uni-nav-bar>
<view class="content-wrapper">
<!-- Tab栏 -->
<view class="tab-bar">
<u-tabs :list="tabList" :current="currentTab" lineColor="#3C7CF7" :scrollable="false" @click="tabclick" :inactiveStyle="{color: '#666666'}" :activeStyle="{color: '#3C7CF7',fontWeight: '500'}"></u-tabs>
</view>
<!-- 列表内容 -->
<view class="list-container">
<view
class="borrow-card"
v-for="(item, index) in filteredList"
:key="index"
>
<!-- 状态标签(右上角旋转丝带) -->
<view class="status-ribbon" :class="'ribbon-' + item.status">
<text class="ribbon-text">{{ getStatusText(item.status) }}</text>
</view>
<!-- 卡片内容 -->
<view class="card-content">
<view class="card-title">{{ item.itemName }}</view>
<view class="card-info">
<text class="info-item">申请人: {{ item.applicant }}</text>
<text class="info-item">借用时间: {{ item.borrowTime }}</text>
<text class="info-item">公司名称: {{ item.companyName }}</text>
</view>
<!-- 操作按钮 -->
<view class="card-actions" v-if="item.status !== 'returned'">
<button
class="action-btn"
:class="'btn-' + item.status"
@click="handleAction(item)"
>
{{ getActionText(item.status) }}
</button>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
currentTab: 0,
tabList: [
{
name: '全部',
},
{
name: '已归还',
},
{
name: '未归还'
},
{
name: '待复核'
},
],
borrowList: [
{
id: 1,
itemName: '公章',
applicant: '刘宇',
borrowTime: '2024-11-06 09:41:18',
companyName: '合塑',
status: 'returned' // returned, notReturned, pendingReview
},
{
id: 2,
itemName: '公章',
applicant: '刘宇',
borrowTime: '2024-11-06 09:41:18',
companyName: '合塑',
status: 'notReturned'
},
{
id: 3,
itemName: '公章',
applicant: '刘宇',
borrowTime: '2024-11-06 09:41:18',
companyName: '合塑',
status: 'pendingReview'
}
]
}
},
computed: {
filteredList() {
if (this.currentTab === 0) {
return this.borrowList
} else if (this.currentTab === 1) {
return this.borrowList.filter(item => item.status === 'returned')
} else if (this.currentTab === 2) {
return this.borrowList.filter(item => item.status === 'notReturned')
} else if (this.currentTab === 3) {
return this.borrowList.filter(item => item.status === 'pendingReview')
}
return []
}
},
methods: {
leftClick(){
uni.navigateBack({})
},
switchTab(index) {
this.currentTab = index
},
getStatusText(status) {
const statusMap = {
'returned': '已归还',
'notReturned': '未归还',
'pendingReview': '待复核'
}
return statusMap[status] || ''
},
getActionText(status) {
const actionMap = {
'notReturned': '立即归还',
'pendingReview': '立即复核'
}
return actionMap[status] || ''
},
handleAction(item) {
if (item.status === 'notReturned') {
// 归还操作
uni.showModal({
title: '提示',
content: '确定要归还该物品吗?',
success: (res) => {
if (res.confirm) {
uni.showToast({
title: '归还成功',
icon: 'success'
})
// 这里可以调用API更新状态
}
}
})
} else if (item.status === 'pendingReview') {
// 复核操作
uni.showModal({
title: '提示',
content: '确定要复核该申请吗?',
success: (res) => {
if (res.confirm) {
uni.showToast({
title: '复核成功',
icon: 'success'
})
// 这里可以调用API更新状态
}
}
})
}
}
}
}
</script>
<style lang="scss">
.home-page {
min-height: 100vh;
background: rgb(244, 246, 248);
}
.content-wrapper {
}
.tab-item {
flex: 1;
position: relative;
padding: 24rpx 0;
text-align: center;
}
.tab-text {
font-size: 28rpx;
color: #666;
}
.tab-item-active .tab-text {
color: #3074F7;
font-weight: 500;
}
.tab-underline {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 60rpx;
height: 4rpx;
background: #3074F7;
border-radius: 2rpx;
}
// 列表容器
.list-container {
padding: 24rpx 28rpx;
}
// 借用卡片
.borrow-card {
position: relative;
background: #fff;
border-radius: 12rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
overflow: hidden;
}
// 状态标签(旋转丝带效果)
.status-ribbon {
position: absolute;
top: -5px;
right: -24px;
width: 75px;
height: 37px;
background: #4CAF50;
transform: rotate(45deg);
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.15);
}
.ribbon-returned {
background: #4CAF50; // 绿色
}
.ribbon-notReturned {
background: #F44336; // 红色
}
.ribbon-pendingReview {
background: #2196F3; // 蓝色
}
.ribbon-text {
color: #fff;
font-size: 20rpx;
font-weight: 500;
transform: rotate(0deg);
transform-origin: center;
display: block;
text-align: center;
margin-top: 16rpx;
white-space: nowrap;
letter-spacing: 1rpx;
}
// 卡片内容
.card-content {
padding: 32rpx;
padding-top: 48rpx;
}
.card-title {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
}
.card-info {
display: flex;
flex-direction: column;
gap: 12rpx;
margin-bottom: 24rpx;
}
.info-item {
font-size: 26rpx;
color: #666;
line-height: 1.6;
}
// 操作按钮
.card-actions {
display: flex;
justify-content: flex-end;
margin-top: 24rpx;
}
.action-btn {
padding: 14rpx 40rpx;
background: #3074F7;
color: #fff;
border-radius: 8rpx;
font-size: 26rpx;
border: none;
line-height: 1;
&::after {
border: none;
}
}
.btn-notReturned {
background: #3074F7;
}
.btn-pendingReview {
background: #3074F7;
}
</style>
+340
View File
@@ -0,0 +1,340 @@
<template>
<view class="home-page">
<z-paging ref="paging" :auto="false" v-model="contList" @query="queryList" empty-view-text="暂无数据!">
<template #top>
<uni-nav-bar leftText=" " :fixed="true" leftIcon="back" :border="false" @clickLeft="leftClick" color="#fff" backgroundColor="rgb(48, 116, 247)" :statusBar="true" title="借用列表"></uni-nav-bar>
<!-- Tab栏 -->
<view class="tab-bar">
<view
class="tab-item"
:class="{ 'tab-item-active': currentTab === index }"
v-for="(tab, index) in tabList"
:key="index"
@click="switchTab(index)"
>
<text class="tab-text">{{ tab }}</text>
<view v-if="currentTab === index" class="tab-underline"></view>
</view>
</view>
</template>
<!-- 列表内容 -->
<view class="list-container">
<view
class="borrow-card"
v-for="(item, index) in filteredList"
:key="index"
@click="handleCardClick(item)"
>
<!-- 状态标签(右上角旋转丝带) -->
<view class="status-ribbon" :class="'ribbon-' + item.status">
<text class="ribbon-text">{{ getStatusText(item.status) }}</text>
</view>
<!-- 卡片内容 -->
<view class="card-content">
<view class="card-title">{{ item.itemName }}</view>
<view class="card-info">
<text class="info-item">申请人: {{ item.applicant }}</text>
<text class="info-item">借用时间: {{ item.borrowTime }}</text>
<view class="action-btns">
<text class="info-item">公司名称: {{ item.companyName }}</text>
<!-- 操作按钮 -->
<view class="card-actions" v-if="item.status !== 'returned'">
<button
class="action-btn"
:class="'btn-' + item.status"
@click="handleAction(item)"
>
{{ getActionText(item.status) }}
</button>
</view>
</view>
</view>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script>
export default {
data() {
return {
currentTab: 0,
tabList: ['全部', '已归还', '未归还', '待复核'],
borrowList: [
{
id: 1,
itemName: '公章',
applicant: '刘宇',
borrowTime: '2024-11-06 09:41:18',
companyName: '合塑',
status: 'returned' // returned, notReturned, pendingReview
},
{
id: 2,
itemName: '公章',
applicant: '刘宇',
borrowTime: '2024-11-06 09:41:18',
companyName: '合塑',
status: 'notReturned'
},
{
id: 3,
itemName: '公章',
applicant: '刘宇',
borrowTime: '2024-11-06 09:41:18',
companyName: '合塑',
status: 'pendingReview'
},
{
id: 4,
itemName: '公章',
applicant: '刘宇',
borrowTime: '2024-11-06 09:41:18',
companyName: '合塑',
status: 'pendingReview'
},
{
id: 5,
itemName: '公章',
applicant: '刘宇',
borrowTime: '2024-11-06 09:41:18',
companyName: '合塑',
status: 'pendingReview'
}
]
}
},
computed: {
filteredList() {
if (this.currentTab === 0) {
return this.borrowList
} else if (this.currentTab === 1) {
return this.borrowList.filter(item => item.status === 'returned')
} else if (this.currentTab === 2) {
return this.borrowList.filter(item => item.status === 'notReturned')
} else if (this.currentTab === 3) {
return this.borrowList.filter(item => item.status === 'pendingReview')
}
return []
}
},
methods: {
leftClick(){
uni.navigateBack({})
},
switchTab(index) {
this.currentTab = index
},
getStatusText(status) {
const statusMap = {
'returned': '已归还',
'notReturned': '未归还',
'pendingReview': '待复核'
}
return statusMap[status] || ''
},
getActionText(status) {
const actionMap = {
'notReturned': '立即归还',
'pendingReview': '立即复核'
}
return actionMap[status] || ''
},
handleCardClick(item) {
uni.navigateTo({
url: '/pages/borrow/borrow_detils?id=' + item.id
});
},
handleAction(item) {
if (item.status === 'notReturned') {
// 归还操作
uni.navigateTo({
url: '/pages/borrow/return'
});
// uni.showModal({
// title: '提示',
// content: '确定要归还该物品吗?',
// success: (res) => {
// if (res.confirm) {
// uni.showToast({
// title: '归还成功',
// icon: 'success'
// })
// // 这里可以调用API更新状态
// }
// }
// })
} else if (item.status === 'pendingReview') {
// 复核操作
uni.navigateTo({
url: '/pages/borrow/review'
});
}
}
}
}
</script>
<style lang="scss">
.home-page {
min-height: 100vh;
background: rgb(244, 246, 248);
}
.content-wrapper {
}
// Tab栏样式
.tab-bar {
display: flex;
background: #F4F6F8;
}
.tab-item {
flex: 1;
position: relative;
padding: 24rpx 0;
text-align: center;
}
.tab-text {
font-size: 28rpx;
color: #666;
}
.tab-item-active .tab-text {
color: #3074F7;
font-weight: 500;
}
.tab-underline {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 60rpx;
height: 4rpx;
background: #3074F7;
border-radius: 2rpx;
}
// 列表容器
.list-container {
padding: 24rpx 28rpx;
}
// 借用卡片
.borrow-card {
position: relative;
background: #fff;
border-radius: 12rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
overflow: hidden;
}
// 状态标签(旋转丝带效果)
.status-ribbon {
position: absolute;
top: -5px;
right: -24px;
width: 75px;
height: 37px;
background: #08A400;
transform: rotate(45deg);
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.15);
}
.ribbon-returned {
background: #08A400; // 绿色
}
.ribbon-notReturned {
background: #BD0000; // 红色
}
.ribbon-pendingReview {
background: #3471FF; // 蓝色
}
.ribbon-text {
color: #fff;
font-size: 20rpx;
font-weight: 500;
transform: rotate(0deg);
transform-origin: center;
display: block;
text-align: center;
margin-top: 16rpx;
white-space: nowrap;
letter-spacing: 1rpx;
}
// 卡片内容
.card-content {
padding: 28rpx;
}
.card-title {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
}
.card-info {
display: flex;
flex-direction: column;
gap: 12rpx;
margin-bottom: 24rpx;
}
.info-item {
font-size: 26rpx;
color: #666;
line-height: 1.6;
}
// 操作按钮
.card-actions {
display: flex;
justify-content: flex-end;
}
.action-btns{
display: flex;
justify-content: space-between;
align-items: center;
}
.action-btn {
padding: 14rpx 40rpx;
background: #3074F7;
color: #fff;
border-radius: 8rpx;
font-size: 26rpx;
border: none;
line-height: 1;
&::after {
border: none;
}
}
.btn-notReturned {
background: #3074F7;
}
.btn-pendingReview {
background: #3074F7;
}
</style>
+452
View File
@@ -0,0 +1,452 @@
<template>
<view class="home-page">
<uni-nav-bar leftText=" " :fixed="true" leftIcon="back" :border="false" @clickLeft="leftClick" color="#fff" backgroundColor="rgb(79 137 247)" :statusBar="true" title="物品归还"></uni-nav-bar>
<view class="content-wrapper">
<!-- 申请人信息卡片 -->
<view class="form-card">
<view class="form-item form-item-row">
<text class="form-label">申请人:</text>
<text class="form-value">{{ formData.applicant || '犇犇' }}</text>
</view>
<view class="form-item form-item-row">
<text class="form-label">公司名称:</text>
<text class="form-value">{{ formData.companyName || '合塑' }}</text>
</view>
</view>
<!-- 借用详情卡片 -->
<view class="form-card4">
<!-- 借用时间 -->
<view class="form-item form-item-row">
<text class="form-label">借用时间</text>
<view class="form-input-container">
<uni-datetime-picker
ref="borrowTimePicker"
type="datetime"
v-model="formData.borrowTime"
placeholder="请选择时间"
:border="false"
:clear-icon="false"
@change="onBorrowTimeChange"
>
<view class="custom-datetime-input">
<text class="custom-datetime-text" :class="{ 'placeholder': !formData.borrowTime }">
{{ formData.borrowTime || '请选择时间' }}
</text>
<uni-icons type="calendar" size="18" color="#999"></uni-icons>
</view>
</uni-datetime-picker>
</view>
</view>
</view>
<view class="form-card4">
<!-- 计划归还时间 -->
<view class="form-item form-item-row">
<text class="form-label">计划归还时间</text>
<view class="form-input-container">
<uni-datetime-picker
ref="returnTimePicker"
type="datetime"
v-model="formData.returnTime"
placeholder="请选择时间"
:border="false"
:clear-icon="false"
@change="onReturnTimeChange"
>
<view class="custom-datetime-input">
<text class="custom-datetime-text" :class="{ 'placeholder': !formData.returnTime }">
{{ formData.returnTime || '请选择时间' }}
</text>
<uni-icons type="calendar" size="18" color="#999"></uni-icons>
</view>
</uni-datetime-picker>
</view>
</view>
</view>
<view class="form-card4">
<!-- 物品所属公司 -->
<view class="form-item form-item-row">
<text class="form-label">物品所属公司</text>
<view class="form-input-container">
<uni-data-select
v-model="formData.itemCompany"
:localdata="itemCompanyOptions"
placeholder="请选择"
:clear="false"
></uni-data-select>
</view>
</view>
</view>
<view class="form-card">
<!-- 借用事由 -->
<view class="form-item">
<text class="form-label">借用事由</text>
<uni-easyinput
v-model="formData.borrowReason"
type="textarea"
:autoHeight="true"
placeholder="请填写借用事由"
:maxlength="500"
></uni-easyinput>
</view>
</view>
<view class="form-card4">
<!-- 物品名称 -->
<view class="form-item form-item-row">
<text class="form-label required">归还物品名称</text>
<view class="form-input-container">
<uni-data-select
v-model="formData.itemName"
:localdata="itemNameOptions"
placeholder="请选择"
:clear="false"
></uni-data-select>
</view>
</view>
</view>
<view class="form-card">
<!-- 计划归还时间 -->
<view class="form-item form-item-row">
<text class="form-label required">实际归还时间</text>
<view class="form-input-container">
<uni-datetime-picker
ref="returnTimePicker"
type="datetime"
v-model="formData.returnTime"
placeholder="请选择时间"
:border="false"
:clear-icon="false"
@change="onReturnTimeChange"
>
<view class="custom-datetime-input">
<text class="custom-datetime-text" :class="{ 'placeholder': !formData.returnTime }">
{{ formData.returnTime || '请选择时间' }}
</text>
<uni-icons type="calendar" size="18" color="#999"></uni-icons>
</view>
</uni-datetime-picker>
</view>
</view>
</view>
<!-- 备注卡片 -->
<view class="form-card " style="margin-bottom: 8rpx;">
<view class="form-item">
<text class="form-label">备注</text>
<uni-easyinput
v-model="formData.remarks"
type="textarea"
:autoHeight="true"
placeholder="请填写备注"
:maxlength="500"
></uni-easyinput>
</view>
</view>
<!-- 附件卡片 -->
<view class="form-card">
<view class="form-item">
<text class="form-label form-label1">附件</text>
<uni-file-picker
v-model="formData.attachments"
file-mediatype="image"
mode="grid"
:limit="9"
:auto-upload="false"
@select="onFileSelect"
>
<image src="/static/image/upload.png" mode="" class="addimg"></image>
</uni-file-picker>
</view>
</view>
<!-- 提交按钮 -->
<view class="submit-btn-wrapper">
<button class="submit-btn" @click="handleSubmit">提交</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
formData: {
applicant: '犇犇',
companyName: '合塑',
borrowTime: '',
returnTime: '',
itemName: '',
itemCompany: '',
borrowReason: '',
remarks: '',
attachments: []
},
itemNameOptions: [
{ text: '物品1', value: 'item1' },
{ text: '物品2', value: 'item2' },
{ text: '物品3', value: 'item3' }
],
itemCompanyOptions: [
{ text: '公司A', value: 'companyA' },
{ text: '公司B', value: 'companyB' },
{ text: '公司C', value: 'companyC' }
]
}
},
methods: {
leftClick(){
uni.navigateBack({})
},
onBorrowTimeChange(e) {
// uni-datetime-picker返回的已经是格式化后的字符串
this.formData.borrowTime = e
},
onReturnTimeChange(e) {
// uni-datetime-picker返回的已经是格式化后的字符串
this.formData.returnTime = e
},
onFileSelect(e) {
console.log('文件选择:', e)
},
handleSubmit() {
// 表单验证
if (!this.formData.borrowTime) {
uni.showToast({
title: '请选择借用时间',
icon: 'none'
})
return
}
if (!this.formData.returnTime) {
uni.showToast({
title: '请选择计划归还时间',
icon: 'none'
})
return
}
if (!this.formData.itemName) {
uni.showToast({
title: '请选择物品名称',
icon: 'none'
})
return
}
if (!this.formData.itemCompany) {
uni.showToast({
title: '请选择物品所属公司',
icon: 'none'
})
return
}
if (!this.formData.borrowReason) {
uni.showToast({
title: '请填写借用事由',
icon: 'none'
})
return
}
// 提交表单
console.log('提交表单:', this.formData)
uni.showToast({
title: '提交成功',
icon: 'success'
})
// 这里可以调用API提交数据
}
}
}
</script>
<style lang="scss">
.home-page{
min-height: 100vh;
background: linear-gradient(180.05deg, #3074F7 0.04%, #F4F6F8 34.07%);
box-sizing: border-box;
padding-bottom: 120rpx;
padding: 0px 28rpx;
}
.content-wrapper{
margin-top: 20rpx;
}
.addimg{
width: 50px;
height:50px;
}
.form-card {
background: #fff;
border-radius: 12rpx;
padding:20rpx 34rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
}
.form-card4 {
background: #fff;
border-radius: 6px;
padding: 3px 17px;
margin-bottom: 4px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
height: 35px;
line-height: 35px;
}
.form-item {
margin-bottom: 32rpx;
&:last-child {
margin-bottom: 0;
}
&.form-item-row {
display: flex;
align-items: center;
flex-wrap: nowrap;
}
}
.form-label {
font-size: 28rpx;
color: #333;
// margin-bottom: 16rpx;
display: block;
flex-shrink: 0;
min-width: 160rpx;
&.required::before {
content: '*';
color: #ff0000;
margin-right: 4rpx;
}
}
.form-label1{
margin-bottom: 16rpx;
}
.form-item-row .form-label {
margin-bottom: 0;
margin-right: 24rpx;
}
.form-input-container {
flex: 1;
min-width: 0;
}
.form-value {
font-size: 28rpx;
color: #666;
flex: 1;
text-align: right;
}
.form-input-wrapper {
width: 100%;
}
.form-input-container .form-input-wrapper {
width: 100%;
}
.custom-datetime-input {
border-radius: 4px;
box-sizing: border-box;
width: 100%;
text-align: right;
}
.custom-datetime-text {
font-size: 28rpx;
color: #333;
flex: 1;
&.placeholder {
color: #999;
}
}
// uni-datetime-picker 样式覆盖
::v-deep .uni-date-editor {
width: 100%;
}
::v-deep .uni-date-editor--x {
border: none !important;
background: transparent !important;
padding: 0 !important;
}
::v-deep .uni-date-x {
width: 100%;
padding: 0 !important;
}
::v-deep .uni-date__x-input {
display: none;
}
::v-deep .icon-calendar {
display: none;
}
.submit-btn-wrapper {
margin-top: 40rpx;
padding-bottom: 40rpx;
}
.submit-btn {
width: 70%;
height: 88rpx;
background: #3074F7;
color: #fff;
border-radius: 44rpx;
font-size: 32rpx;
line-height: 88rpx;
border: none;
&::after {
border: none;
}
}
// uni-data-select 样式调整
::v-deep .uni-stat__select {
width: 100%;
}
::v-deep .uni-select {
width: 100%;
border: none;
text-align: right;
}
::v-deep .uni-select__input-text {
font-size: 28rpx;
color: #333;
}
::v-deep .uni-select__input-placeholder {
color: #999;
}
// uni-easyinput 样式调整
::v-deep .uni-easyinput {
width: 100%;
}
::v-deep .uni-easyinput__content {
border: none;
min-height: 120rpx;
}
::v-deep .uni-easyinput__content-textarea {
font-size: 28rpx;
color: #333;
min-height: 120rpx;
padding-left: 0px;
}
// uni-file-picker 样式调整
::v-deep .uni-file-picker {
width: 100%;
}
</style>
+455
View File
@@ -0,0 +1,455 @@
<template>
<view class="home-page">
<uni-nav-bar leftText=" " :fixed="true" leftIcon="back" :border="false" @clickLeft="leftClick" color="#fff" backgroundColor="rgb(79 137 247)" :statusBar="true" title="物品复核"></uni-nav-bar>
<view class="content-wrapper">
<!-- 信息卡片 -->
<view class="form-card">
<view class="form-item form-item-row">
<text class="form-label">复核人:</text>
<text class="form-value">{{ formData.applicant || '犇犇' }}</text>
</view>
<view class="form-item form-item-row">
<text class="form-label">申请人:</text>
<text class="form-value">{{ formData.applicant || '犇犇' }}</text>
</view>
<view class="form-item form-item-row">
<text class="form-label">公司名称:</text>
<text class="form-value">{{ formData.companyName || '合塑' }}</text>
</view>
</view>
<!-- 借用详情卡片 -->
<view class="form-card4">
<!-- 借用时间 -->
<view class="form-item form-item-row">
<text class="form-label">借用时间</text>
<view class="form-input-container">
<uni-datetime-picker
ref="borrowTimePicker"
type="datetime"
v-model="formData.borrowTime"
placeholder="请选择时间"
:border="false"
:clear-icon="false"
@change="onBorrowTimeChange"
>
<view class="custom-datetime-input">
<text class="custom-datetime-text" :class="{ 'placeholder': !formData.borrowTime }">
{{ formData.borrowTime || '请选择时间' }}
</text>
<uni-icons type="calendar" size="18" color="#999"></uni-icons>
</view>
</uni-datetime-picker>
</view>
</view>
</view>
<view class="form-card4">
<!-- 计划归还时间 -->
<view class="form-item form-item-row">
<text class="form-label">计划归还时间</text>
<view class="form-input-container">
<uni-datetime-picker
ref="returnTimePicker"
type="datetime"
v-model="formData.returnTime"
placeholder="请选择时间"
:border="false"
:clear-icon="false"
@change="onReturnTimeChange"
>
<view class="custom-datetime-input">
<text class="custom-datetime-text" :class="{ 'placeholder': !formData.returnTime }">
{{ formData.returnTime || '请选择时间' }}
</text>
<uni-icons type="calendar" size="18" color="#999"></uni-icons>
</view>
</uni-datetime-picker>
</view>
</view>
</view>
<view class="form-card4">
<!-- 物品所属公司 -->
<view class="form-item form-item-row">
<text class="form-label">物品所属公司</text>
<view class="form-input-container">
<uni-data-select
v-model="formData.itemCompany"
:localdata="itemCompanyOptions"
placeholder="请选择"
:clear="false"
></uni-data-select>
</view>
</view>
</view>
<view class="form-card">
<!-- 借用事由 -->
<view class="form-item">
<text class="form-label">借用事由</text>
<uni-easyinput
v-model="formData.borrowReason"
type="textarea"
:autoHeight="true"
placeholder="请填写借用事由"
:maxlength="500"
></uni-easyinput>
</view>
</view>
<view class="form-card4">
<!-- 物品名称 -->
<view class="form-item form-item-row">
<text class="form-label required">归还物品名称</text>
<view class="form-input-container">
<uni-data-select
v-model="formData.itemName"
:localdata="itemNameOptions"
placeholder="请选择"
:clear="false"
></uni-data-select>
</view>
</view>
</view>
<view class="form-card">
<!-- 计划归还时间 -->
<view class="form-item form-item-row">
<text class="form-label required">实际归还时间</text>
<view class="form-input-container">
<uni-datetime-picker
ref="returnTimePicker"
type="datetime"
v-model="formData.returnTime"
placeholder="请选择时间"
:border="false"
:clear-icon="false"
@change="onReturnTimeChange"
>
<view class="custom-datetime-input">
<text class="custom-datetime-text" :class="{ 'placeholder': !formData.returnTime }">
{{ formData.returnTime || '请选择时间' }}
</text>
<uni-icons type="calendar" size="18" color="#999"></uni-icons>
</view>
</uni-datetime-picker>
</view>
</view>
</view>
<!-- 附件卡片 -->
<view class="form-card" style="margin-bottom: 8rpx;">
<view class="form-item">
<text class="form-label form-label1">附件</text>
<uni-file-picker
v-model="formData.attachments"
file-mediatype="image"
mode="grid"
:limit="9"
:auto-upload="false"
@select="onFileSelect"
>
<image src="/static/image/upload.png" mode="" class="addimg"></image>
</uni-file-picker>
</view>
</view>
<!-- 备注卡片 -->
<view class="form-card " >
<view class="form-item">
<text class="form-label">备注</text>
<uni-easyinput
v-model="formData.remarks"
type="textarea"
:autoHeight="true"
placeholder="请填写备注"
:maxlength="500"
></uni-easyinput>
</view>
</view>
<!-- 提交按钮 -->
<view class="submit-btn-wrapper">
<button class="submit-btn" @click="handleSubmit">提交</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
formData: {
applicant: '犇犇',
companyName: '合塑',
borrowTime: '',
returnTime: '',
itemName: '',
itemCompany: '',
borrowReason: '',
remarks: '',
attachments: []
},
itemNameOptions: [
{ text: '物品1', value: 'item1' },
{ text: '物品2', value: 'item2' },
{ text: '物品3', value: 'item3' }
],
itemCompanyOptions: [
{ text: '公司A', value: 'companyA' },
{ text: '公司B', value: 'companyB' },
{ text: '公司C', value: 'companyC' }
]
}
},
methods: {
leftClick(){
uni.navigateBack({})
},
onBorrowTimeChange(e) {
// uni-datetime-picker返回的已经是格式化后的字符串
this.formData.borrowTime = e
},
onReturnTimeChange(e) {
// uni-datetime-picker返回的已经是格式化后的字符串
this.formData.returnTime = e
},
onFileSelect(e) {
console.log('文件选择:', e)
},
handleSubmit() {
// 表单验证
if (!this.formData.borrowTime) {
uni.showToast({
title: '请选择借用时间',
icon: 'none'
})
return
}
if (!this.formData.returnTime) {
uni.showToast({
title: '请选择计划归还时间',
icon: 'none'
})
return
}
if (!this.formData.itemName) {
uni.showToast({
title: '请选择物品名称',
icon: 'none'
})
return
}
if (!this.formData.itemCompany) {
uni.showToast({
title: '请选择物品所属公司',
icon: 'none'
})
return
}
if (!this.formData.borrowReason) {
uni.showToast({
title: '请填写借用事由',
icon: 'none'
})
return
}
// 提交表单
console.log('提交表单:', this.formData)
uni.showToast({
title: '提交成功',
icon: 'success'
})
// 这里可以调用API提交数据
}
}
}
</script>
<style lang="scss">
.home-page{
min-height: 100vh;
background: linear-gradient(180.05deg, #3074F7 0.04%, #F4F6F8 34.07%);
box-sizing: border-box;
padding-bottom: 120rpx;
padding: 0px 28rpx;
}
.content-wrapper{
margin-top: 20rpx;
}
.addimg{
width: 50px;
height:50px;
}
.form-card {
background: #fff;
border-radius: 12rpx;
padding:20rpx 34rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
}
.form-card4 {
background: #fff;
border-radius: 6px;
padding: 3px 17px;
margin-bottom: 4px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
height: 35px;
line-height: 35px;
}
.form-item {
margin-bottom: 32rpx;
&:last-child {
margin-bottom: 0;
}
&.form-item-row {
display: flex;
align-items: center;
flex-wrap: nowrap;
}
}
.form-label {
font-size: 28rpx;
color: #333;
// margin-bottom: 16rpx;
display: block;
flex-shrink: 0;
min-width: 160rpx;
&.required::before {
content: '*';
color: #ff0000;
margin-right: 4rpx;
}
}
.form-label1{
margin-bottom: 16rpx;
}
.form-item-row .form-label {
margin-bottom: 0;
margin-right: 24rpx;
}
.form-input-container {
flex: 1;
min-width: 0;
}
.form-value {
font-size: 28rpx;
color: #666;
flex: 1;
text-align: right;
}
.form-input-wrapper {
width: 100%;
}
.form-input-container .form-input-wrapper {
width: 100%;
}
.custom-datetime-input {
border-radius: 4px;
box-sizing: border-box;
width: 100%;
text-align: right;
}
.custom-datetime-text {
font-size: 28rpx;
color: #333;
flex: 1;
&.placeholder {
color: #999;
}
}
// uni-datetime-picker 样式覆盖
::v-deep .uni-date-editor {
width: 100%;
}
::v-deep .uni-date-editor--x {
border: none !important;
background: transparent !important;
padding: 0 !important;
}
::v-deep .uni-date-x {
width: 100%;
padding: 0 !important;
}
::v-deep .uni-date__x-input {
display: none;
}
::v-deep .icon-calendar {
display: none;
}
.submit-btn-wrapper {
margin-top: 40rpx;
padding-bottom: 40rpx;
}
.submit-btn {
width: 70%;
height: 88rpx;
background: #3074F7;
color: #fff;
border-radius: 44rpx;
font-size: 32rpx;
line-height: 88rpx;
border: none;
&::after {
border: none;
}
}
// uni-data-select 样式调整
::v-deep .uni-stat__select {
width: 100%;
}
::v-deep .uni-select {
width: 100%;
border: none;
text-align: right;
}
::v-deep .uni-select__input-text {
font-size: 28rpx;
color: #333;
}
::v-deep .uni-select__input-placeholder {
color: #999;
}
// uni-easyinput 样式调整
::v-deep .uni-easyinput {
width: 100%;
}
::v-deep .uni-easyinput__content {
border: none;
min-height: 120rpx;
}
::v-deep .uni-easyinput__content-textarea {
font-size: 28rpx;
color: #333;
min-height: 120rpx;
padding-left: 0px;
}
// uni-file-picker 样式调整
::v-deep .uni-file-picker {
width: 100%;
}
</style>
+158
View File
@@ -0,0 +1,158 @@
<template>
<view class="home-page">
<uni-nav-bar leftText=" " :fixed="true" :border="false" @clickLeft="leftClick" color="#fff" backgroundColor="rgb(79 137 247)" :statusBar="true" title="X-Server"></uni-nav-bar>
<view>
<view class="cards">
<view class="title">审批管理</view>
<u-grid :border="false" col="5" >
<u-grid-item
v-for="(listItem,listIndex) in list"
:key="listIndex"
>
<image class="icons" src="/static/image/icon.png" mode=""></image>
<text class="grid-text">{{listItem.title}}</text>
</u-grid-item>
</u-grid>
</view>
<view class="cards">
<view class="title">物品借用</view>
<u-grid :border="false" col="5" >
<u-grid-item @click="navTo('/pages/borrow/borrow')">
<image class="icons" src="/static/image/borrow.png" mode=""></image>
<text class="grid-text">借用申请</text>
</u-grid-item>
<u-grid-item @click="navTo('/pages/borrow/borrow_list')">
<image class="icons" src="/static/image/borrow-list.png" mode=""></image>
<text class="grid-text">借用列表</text>
</u-grid-item>
</u-grid>
</view>
<view class="cards">
<view class="title">备货单</view>
<u-grid :border="false" col="5" >
<u-grid-item
v-for="(listItem,listIndex) in list"
:key="listIndex"
@click="navTo('/pages/stock/stock_list')"
>
<image class="icons" src="/static/image/icon.png" mode=""></image>
<text class="grid-text">{{listItem.title}}</text>
</u-grid-item>
</u-grid>
</view>
</view>
</view>
</template>
<script>
import { request,showToast } from '@/api/apiT.js'
export default {
data() {
return {
list: [
{
title: '备货单审批'
},
{
title: '备货单审批'
},
{
title: '备货单审批'
},
{
title: '备货单审批'
},
{
title: '备货单审批'
}
],
bannerList: [],
contList: [],
}
},
onLoad() {
if (!uni.getStorageSync('token')) {}
},
onShow() {
},
methods: {
navTo(url) {
uni.navigateTo({
url: url
});
},
bannerListfn(){
request({
url:'common/banner/list',
method:'get',
data:{
module:'home_module'
}
}).then(res => {
this.bannerList = res.data.data
})
},
// 点击商品项
navToList(item) {
uni.navigateTo({
url: '/pages/square/detiles?id='+item.id
});
},
queryList(pageNo, pageSize) {
this.loading = true;
var that = this;
request({
url:'common/post/list',
method:'get',
data: {
current:pageNo,
size:10
}
}).then(res => {
if(res.data.code ==200){
var datas = res.data.data.records;
this.$refs.paging.complete(datas);
}else{
// this.$refs.paging.complete(null);
// that.listlength=0
}
uni.stopPullDownRefresh();
//
})
},
addCar(){
uni.navigateTo({
url: '/pages/carinfo/index'
});
}
}
}
</script>
<style lang="scss">
.home-page{
min-height: 100vh;
background: linear-gradient(180.05deg, #3074F7 0.04%, #F4F6F8 34.07%);
box-sizing: border-box;
padding-bottom: 120rpx;
padding: 0px 28rpx;
}
.cards{
margin-top: 20rpx;
background: #fff;
border-radius: 6px;
padding: 28rpx;
}
.title{
font-size: 32rpx;
font-weight: 500;
margin-bottom: 40rpx;
}
.icons{
width: 80rpx;
height: 80rpx;
}
.grid-text{
font-size: 20rpx;
}
</style>
+60
View File
@@ -0,0 +1,60 @@
<template>
<view>
<uni-nav-bar leftText=" " :fixed="true" :border="false" leftIcon="back" @clickLeft="leftClick" color="#000000"
backgroundColor="#fff" :statusBar="true" title="隐私政策"></uni-nav-bar>
<view class="contents">
<view class="title">
{{title}}
</view>
<view class="" v-html="content">
</view>
</view>
</view>
</template>
<script>
import {
request,
showToast
} from '@/api/apiT.js'
export default {
data() {
return {
content: '',
title: ''
}
},
onLoad() {
this.getcont()
},
methods: {
leftClick() {
uni.navigateBack({})
},
getcont() {
request({
url:'common/agreement?type=privacy_policy',
method:'GET'
}).then(res => {
console.log(res.data.data)
if (res.data.code == 200) {
this.content = res.data.data.content
this.title = res.data.data.title
}
})
}
}
}
</script>
<style>
.contents {
padding: 10px 12px;
}
.title {
text-align: center;
font-size: 18px;
}
</style>
+56
View File
@@ -0,0 +1,56 @@
<template>
<view>
<uni-nav-bar leftText=" " :fixed="true" :border="false" leftIcon="back" @clickLeft="leftClick" color="#000000" backgroundColor="#fff" :statusBar="true" title="用户服务协议"></uni-nav-bar>
<view class="contents" >
<view class="title">
{{title}}
</view>
<view class="" v-html="content">
</view>
</view>
</view>
</template>
<script>
import { request,showToast } from '@/api/apiT.js'
export default {
data() {
return {
content:'',
title:''
}
},
onLoad() {
this.getcont()
},
methods: {
leftClick(){
uni.navigateBack({})
},
getcont(){
request({
url:'common/agreement?type=user_agreement',
method:'GET'
}).then(res => {
console.log(res.data.data)
if (res.data.code == 200) {
this.content = res.data.data.content
this.title = res.data.data.title
}
})
}
}
}
</script>
<style>
.contents{
padding: 10px 12px;
}
.title{
text-align: center;
font-size: 18px;
}
</style>
+407
View File
@@ -0,0 +1,407 @@
<template>
<view class="content">
<image class="logo" src="/static/image/bg.jpg"></image>
<view class="contop">
<text class="text">2025 USED CAR</text>
<text class="cont">
河南合塑实业有限公司
</text>
</view>
<view class="foot">
<!-- <button v-if="is_login" class="btn" @click="mini_login">一键登录</button>
<button v-else="is_login" class="btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">一键登录</button>
<view class="check">
<checkbox-group name="" style="width: 28px;">
<label>
<checkbox :checked="selfChecked" activeBackgroundColor="#3F435B" style="transform:scale(0.7);border-radius: 50%"/>
</label>
</checkbox-group>
我同意并遵守<text class="argeen" @click="gouser">《用户服务协议》</text>以及<text class="argeen" @click="goprivacy">《隐私政策》</text>
</view> -->
<view class="login-form-content">
<uni-forms ref="loginForm" :modelValue="loginForm" :border="true" validateTrigger="submit"
err-show-type="toast">
<uni-forms-item name="username">
<view style="margin-top: 20rpx;">
<u-input v-model="loginForm.username" type="text" placeholder="请输入手机号" border="none" maxlength="11"
:styles="{ backgroundColor: 'transparent' }" clearable>
<template slot="prefix">
<uni-icons type="person" size="20"></uni-icons>
</template>
</u-input>
</view>
</uni-forms-item>
<uni-forms-item name="password">
<view style="margin-top: 20rpx;">
<u-input type="text" password v-model="loginForm.password" placeholder="请输入密码" border="none"
maxlength="16" :styles="{ backgroundColor: 'transparent' }" clearable>
<template slot="prefix">
<uni-icons type="locked" size="20"></uni-icons>
</template>
</u-input>
</view>
</uni-forms-item>
<uni-forms-item>
<view class="register_forget_wrap">
<view class="" @click="handleClickForgetPwd">
<text>忘记密码?</text>
</view>
<view class="" @click="handleClickRegister">
<text>立即注册</text>
</view>
</view>
</uni-forms-item>
</uni-forms>
<view class="action-btn">
<button class="btn" @click="mini_login">登录</button>
</view>
<view class="check">
<checkbox-group name="" style="width: 28px;">
<label>
<checkbox :checked="selfChecked" activeBackgroundColor="#3F435B" style="transform:scale(0.6);border-radius: 50%"/>
</label>
</checkbox-group>
同意<text class="argeen" @click="gouser">《用户服务协议》</text>以及<text class="argeen" @click="goprivacy">《隐私政策》</text>
</view>
</view>
</view>
</view>
</template>
<script>
import { request,showToast } from '@/api/apiT.js'
export default {
data() {
return {
selfChecked: false,
is_login:false,
loginForm: {
isChecked: false,
username: '',
password: ''
},
rules: {
isChecked: {
rules: [{
required: true,
errorMessage: '请阅读并勾选《用户服务协议》《隐私政策》',
}, {
validateFunction: (rule, value, data, callback) => {
return new Promise((resolve, reject) => {
if (value) {
resolve()
} else {
reject(new Error('请阅读并勾选《用户服务协议》《隐私政策》'))
}
})
}
}]
},
username: {
rules: [{
required: true,
errorMessage: '请输入手机号',
}, {
validateFunction: (rule, value, data, callback) => {
return new Promise((resolve, reject) => {
if (uni.$u.test.mobile(value)) {
resolve()
} else {
reject(new Error('请输入正确的手机号'))
}
})
}
}]
},
password: {
rules: [{
required: true,
errorMessage: '请输入密码',
},{
validateFunction: (rule, value, data, callback) => {
return new Promise((resolve, reject) => {
if (value.length >= 8 && value.length <= 16) {
resolve()
} else {
reject(new Error('密码是由8-16位数字、字母或字符组合请重新输入'))
}
})
}
}
]
}
}
}
},
computed: {
isCheckedLoginBtn() {
console.log(this.loginForm.username && this.loginForm.password)
return this.loginForm.username && this.loginForm.password
}
},
onLoad() {
// this.Props.statusBarHeight = getApp().globalData.statusBarHeight
// console.log(this.Props.statusBarHeight)
// this.Props.capsuleTop = getApp().globalData.capsuleTop
// this.getbg()
},
onShow() {
// #ifdef MP-WEIXIN
//小程序登录检测
// this.mini_login()
// #endif
// #ifndef MP-WEIXIN
this.is_login = true
// #endif
},
methods: {
// 点击忘记密码
handleClickForgetPwd() {
uni.navigateTo({
url: '/pages/login/forgetPwd'
})
},
// 点击注册
handleClickRegister() {
uni.navigateTo({
url: '/pages/login/register'
})
},
selfChangde(e) {
this.selfChecked = !this.selfChecked;
},
goprivacy(){
uni.navigateTo({
url: '/pages/login/agreement',// 替换为你要跳转的页面路径
});
},
gouser(){
uni.navigateTo({
url: '/pages/login/agreementuser',// 替换为你要跳转的页面路径
});
},
getPhoneNumber(e) {
console.log(e.detail.code) // 动态令牌
let that = this;
request({
url:'miniapp/phone',
// url:'customerLogin',
method:'POST',
data:{
phone_code: e.detail.code,
}
}).then(res => {
console.log(res.data.data)
if (res.data.code == -1) {
uni.showToast({
title: res.data.msg,
icon: 'none'
});
} else if (res.data.code == 0) {
//返回数据接收成功
this.mini_login();
}
})
},
mini_login() {
let that = this;
// if(!this.selfChecked){
// uni.showToast({
// title:'请先勾选同意用户服务协议以及隐私政策',
// icon: 'none'
// });
// return false
// }
uni.login({
provider: 'weixin',
success: loginRes => {
console.log(loginRes);
that.code = loginRes.code;
// 2. 将用户登录code传递到后台置换用户SessionKey、OpenId等信息
request({
url:'miniapp/login',
method:'POST',
data:{
code: loginRes.code
}
}).then(res => {
console.log(res.data);
uni.hideLoading()
if (res.data.code == 0) {
//存取session
uni.setStorageSync('openid', res.data.data.openid);
uni.setStorageSync('token', res.data.data.token);
if(res.data.data.phone&&res.data.data.phone!=''&&res.data.data.phone!=null){
uni.reLaunch({
url: '/pages/index/index',// 替换为你要跳转的页面路径
});
this.is_login = true;
}
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
})
},
fail: () => {
uni.showToast({
title: '获取 code 失败',
icon: 'none'
});
}
});
},
pd_login(openid) {
let that = this;
request({
url:'miniapp/phone',
method:'POST',
data:{
phone_code: openid
}
}).then(res => {
console.log(res.data)
uni.reLaunch({
url: '/pages/index/index',// 替换为你要跳转的页面路径
});
// if (res.data.code == -1) {
// //unionid在数据库没有记录 记录就可以不需要操作
// console.log('unionid在数据库没有记录 记录就可以不需要操作')
// } else if (res.data.code == 0) {
// var userid = res.data.data;
// this.is_login = true;
// this.getCard(openid);
// }
})
},
}
}
</script>
<style scoped>
>>>.uni-forms-item{
padding: 5px 0px !important;
}
>>>checkbox .wx-checkbox-input {
border-radius: 50% !important;
border: 2rpx solid #3F435B !important;
}
>>>checkbox .wx-checkbox-input.wx-checkbox-input-checked {
border: 2rpx solid #3F435B !important;
background-color:#3F435B !important;
color: #FFFFFF !important;
}
>>>checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
color: #FFFFFF !important;
}
>>>uni-checkbox .uni-checkbox-input {
margin-right: 0;
border-radius: 50%;
border: 2rpx solid #3F435B;
}
>>>uni-checkbox .uni-checkbox-input:empty {
border: 2rpx solid #3F435B;
background-color: #5FFFFFF;
opacity: 0.5;
}
>>>uni-checkbox .uni-checkbox-input:not(:empty) {
border: 2rpx solid #3F435B;
background-color: #3F435B;
color: #FFFFFF;
}
.argeen{
color: #3F435B;
}
.content{
height: 100%;
width: 100%;
position: relative;
background-color: white;
}
.logo{
width: 100%;
height: 830rpx;
}
.contop{
position: absolute;
top: 16%;
text-align: center;
}
.text{
font-size: 32px;
font-weight: bold;
background: linear-gradient(120deg, #B9773C 0%, #67450D 100%);
-webkit-background-clip: text;
color: transparent;
background-clip: text;
display: inline-block;
}
.cont{
background-image: linear-gradient(#4C392B, #0A0604);
padding: 4px 15px;
color: #FFEBCC;
text-align: center;
border-radius: 6px;
display: inline-block;
margin-top: 12px;
font-size: 16px;
}
.foot{
width: 88%;
margin: 0px auto;
text-align: center;
}
.foot label{
color: #929292;
}
.check{
display: flex;
align-items: center;
font-size: 24rpx;
}
.btn{
background-color: #3F435B;
color: white;
border-radius: 50px;
width: 100%;
margin-bottom: 15px;
height: 46px;
line-height: 46px;
}
.radio{
color: #929292;
font-size: 12px;
}
.login-form-content {
width: 100%;
padding: 0 20rpx;
box-sizing: border-box;
}
.register_forget_wrap {
display: flex;
align-items: center;
justify-content: space-between;
color: #ff8f02;
}
.login_btn {
color: white;
border-radius: 50px;
width: 100%;
margin-bottom: 40px;
height: 50px;
line-height: 50px;
}
.action-btn{
margin-bottom: 10px;
}
</style>
+263
View File
@@ -0,0 +1,263 @@
<template>
<view class="content">
<image class="logo" src="/static/image/bg.jpg"></image>
<view class="contop">
<text class="text">2025 USED CAR</text>
<text class="cont">
河南合塑实业有限公司
</text>
</view>
<view class="foot">
<button v-if="is_login" class="btn" @click="mini_login">一键登录</button>
<button v-else="is_login" class="btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">一键登录</button>
<view class="check">
<checkbox-group name="" style="width: 28px;">
<label>
<checkbox :checked="selfChecked" activeBackgroundColor="#3F435B" style="transform:scale(0.7);border-radius: 50%"/>
</label>
</checkbox-group>
我同意并遵守<text class="argeen" @click="gouser">《用户服务协议》</text>以及<text class="argeen" @click="goprivacy">《隐私政策》</text>
</view>
</view>
</view>
</template>
<script>
import { request,showToast } from '@/api/apiT.js'
export default {
data() {
return {
selfChecked: false,
is_login:false,
}
},
onLoad() {
// this.Props.statusBarHeight = getApp().globalData.statusBarHeight
// console.log(this.Props.statusBarHeight)
// this.Props.capsuleTop = getApp().globalData.capsuleTop
// this.getbg()
},
onShow() {
// #ifdef MP-WEIXIN
//小程序登录检测
this.mini_login()
// #endif
// #ifndef MP-WEIXIN
this.is_login = true
// #endif
},
methods: {
selfChangde(e) {
this.selfChecked = !this.selfChecked;
},
goprivacy(){
uni.navigateTo({
url: '/pages/login/agreement',// 替换为你要跳转的页面路径
});
},
gouser(){
uni.navigateTo({
url: '/pages/login/agreementuser',// 替换为你要跳转的页面路径
});
},
getPhoneNumber(e) {
console.log(e.detail.code) // 动态令牌
let that = this;
request({
url:'miniapp/phone',
// url:'customerLogin',
method:'POST',
data:{
phone_code: e.detail.code,
}
}).then(res => {
console.log(res.data.data)
if (res.data.code == -1) {
uni.showToast({
title: res.data.msg,
icon: 'none'
});
} else if (res.data.code == 0) {
//返回数据接收成功
this.mini_login();
}
})
},
mini_login() {
let that = this;
// if(!this.selfChecked){
// uni.showToast({
// title:'请先勾选同意用户服务协议以及隐私政策',
// icon: 'none'
// });
// return false
// }
uni.login({
provider: 'weixin',
success: loginRes => {
console.log(loginRes);
that.code = loginRes.code;
// 2. 将用户登录code传递到后台置换用户SessionKey、OpenId等信息
request({
url:'miniapp/login',
method:'POST',
data:{
code: loginRes.code
}
}).then(res => {
console.log(res.data);
uni.hideLoading()
if (res.data.code == 0) {
//存取session
uni.setStorageSync('openid', res.data.data.openid);
uni.setStorageSync('token', res.data.data.token);
if(res.data.data.phone&&res.data.data.phone!=''&&res.data.data.phone!=null){
uni.reLaunch({
url: '/pages/index/index',// 替换为你要跳转的页面路径
});
this.is_login = true;
}
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
})
},
fail: () => {
uni.showToast({
title: '获取 code 失败',
icon: 'none'
});
}
});
},
pd_login(openid) {
let that = this;
request({
url:'miniapp/phone',
method:'POST',
data:{
phone_code: openid
}
}).then(res => {
console.log(res.data)
uni.reLaunch({
url: '/pages/index/index',// 替换为你要跳转的页面路径
});
// if (res.data.code == -1) {
// //unionid在数据库没有记录 记录就可以不需要操作
// console.log('unionid在数据库没有记录 记录就可以不需要操作')
// } else if (res.data.code == 0) {
// var userid = res.data.data;
// this.is_login = true;
// this.getCard(openid);
// }
})
},
}
}
</script>
<style scoped>
>>>checkbox .wx-checkbox-input {
border-radius: 50% !important;
border: 2rpx solid #3F435B !important;
}
>>>checkbox .wx-checkbox-input.wx-checkbox-input-checked {
border: 2rpx solid #3F435B !important;
background-color:#3F435B !important;
color: #FFFFFF !important;
}
>>>checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
color: #FFFFFF !important;
}
>>>uni-checkbox .uni-checkbox-input {
margin-right: 0;
border-radius: 50%;
border: 2rpx solid #3F435B;
}
>>>uni-checkbox .uni-checkbox-input:empty {
border: 2rpx solid #3F435B;
background-color: #5FFFFFF;
opacity: 0.5;
}
>>>uni-checkbox .uni-checkbox-input:not(:empty) {
border: 2rpx solid #3F435B;
background-color: #3F435B;
color: #FFFFFF;
}
.argeen{
color: #3F435B;
}
.content{
height: 100%;
width: 100%;
position: relative;
background-color: white;
}
.logo{
width: 100%;
height: 830rpx;
}
.contop{
position: absolute;
top: 16%;
text-align: center;
}
.text{
font-size: 32px;
font-weight: bold;
background: linear-gradient(120deg, #B9773C 0%, #67450D 100%);
-webkit-background-clip: text;
color: transparent;
background-clip: text;
display: inline-block;
}
.cont{
background-image: linear-gradient(#4C392B, #0A0604);
padding: 4px 15px;
color: #FFEBCC;
text-align: center;
border-radius: 6px;
display: inline-block;
margin-top: 12px;
font-size: 16px;
}
.foot{
width: 88%;
margin: 30px auto;
text-align: center;
}
.foot label{
color: #929292;
}
.check{
display: flex;
align-items: center;
font-size: 26rpx;
}
.btn{
background-color: #3F435B;
color: white;
border-radius: 50px;
width: 100%;
margin-bottom: 40px;
height: 50px;
line-height: 50px;
}
.radio{
color: #929292;
font-size: 12px;
}
</style>
+314
View File
@@ -0,0 +1,314 @@
<template>
<view class="home-page">
<z-paging ref="paging" :auto="false" v-model="contList" @query="queryList" empty-view-text="暂无数据!">
<template #top>
<uni-nav-bar leftText=" " :fixed="true" leftIcon="back" :border="false" @clickLeft="leftClick" color="#fff" backgroundColor="rgb(48, 116, 247)" :statusBar="true" title="备货单审批"></uni-nav-bar>
<!-- Tab栏 -->
<view class="tab-bar">
<view
class="tab-item"
:class="{ 'tab-item-active': currentTab === index }"
v-for="(tab, index) in tabList"
:key="index"
@click="switchTab(index)"
>
<text class="tab-text">{{ tab }}</text>
<view v-if="currentTab === index" class="tab-underline"></view>
</view>
</view>
</template>
<!-- 列表内容 -->
<view class="list-container">
<view
class="borrow-card"
v-for="(item, index) in filteredList"
:key="index"
@click="handleCardClick(item)"
>
<!-- 状态标签(右上角旋转丝带) -->
<view class="status-ribbon" :class="'ribbon-' + item.status">
<text class="ribbon-text">{{ getStatusText(item.status) }}</text>
</view>
<!-- 卡片内容 -->
<view class="card-content">
<view class="card-title">备货单编号:{{ item.itemName }}</view>
<view class="card-info">
<text class="info-item">阿里订单号/PI号: {{ item.applicant }}</text>
<text class="info-item">客户名称: Alicia</text>
<text class="info-item">客户来源: 广交会</text>
<text class="info-item">业务员: 测试</text>
<text class="info-item">时间: {{ item.borrowTime }}</text>
<text class="info-item">补充: {{ item.companyName }}</text>
</view>
<!-- 操作按钮 -->
<view class="card-actions" >
<view class="action-btn" @click="handleAction(item)">
查看审批
</view>
</view>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script>
export default {
data() {
return {
currentTab: 0,
tabList: ['全部', '审批中', '已通过', '未通过'],
borrowList: [
{
id: 1,
itemName: 'HSAT-JN00010',
applicant: 'VCS280726JN2',
borrowTime: '2024-11-06 09:41:18',
companyName: '合塑',
status: 'returned' // returned, notReturned, pendingReview
},
{
id: 2,
itemName: 'HSAT-JN00010',
applicant: 'VCS280726JN2',
borrowTime: '2024-11-06 09:41:18',
companyName: '合塑',
status: 'notReturned'
},
{
id: 3,
itemName: 'HSAT-JN00010',
applicant: 'VCS280726JN2',
borrowTime: '2024-11-06 09:41:18',
companyName: '合塑',
status: 'pendingReview'
}
]
}
},
computed: {
filteredList() {
if (this.currentTab === 0) {
return this.borrowList
} else if (this.currentTab === 1) {
return this.borrowList.filter(item => item.status === 'returned')
} else if (this.currentTab === 2) {
return this.borrowList.filter(item => item.status === 'notReturned')
} else if (this.currentTab === 3) {
return this.borrowList.filter(item => item.status === 'pendingReview')
}
return []
}
},
methods: {
leftClick(){
uni.navigateBack({})
},
switchTab(index) {
this.currentTab = index
},
getStatusText(status) {
const statusMap = {
'returned': '已归还',
'notReturned': '未归还',
'pendingReview': '待复核'
}
return statusMap[status] || ''
},
getActionText(status) {
const actionMap = {
'notReturned': '立即归还',
'pendingReview': '立即复核'
}
return actionMap[status] || ''
},
handleCardClick(item) {
uni.navigateTo({
url: '/pages/borrow/borrow_detils?id=' + item.id
});
},
handleAction(item) {
if (item.status === 'notReturned') {
// 归还操作
uni.navigateTo({
url: '/pages/borrow/return'
});
// uni.showModal({
// title: '提示',
// content: '确定要归还该物品吗?',
// success: (res) => {
// if (res.confirm) {
// uni.showToast({
// title: '归还成功',
// icon: 'success'
// })
// // 这里可以调用API更新状态
// }
// }
// })
} else if (item.status === 'pendingReview') {
// 复核操作
uni.navigateTo({
url: '/pages/borrow/review'
});
}
}
}
}
</script>
<style lang="scss">
.home-page {
min-height: 100vh;
background: rgb(244, 246, 248);
}
.content-wrapper {
}
// Tab栏样式
.tab-bar {
display: flex;
background: #F4F6F8;
}
.tab-item {
flex: 1;
position: relative;
padding: 24rpx 0;
text-align: center;
}
.tab-text {
font-size: 28rpx;
color: #666;
}
.tab-item-active .tab-text {
color: #3074F7;
font-weight: 500;
}
.tab-underline {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 60rpx;
height: 4rpx;
background: #3074F7;
border-radius: 2rpx;
}
// 列表容器
.list-container {
padding: 24rpx 28rpx;
}
// 借用卡片
.borrow-card {
position: relative;
background: #fff;
border-radius: 12rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
overflow: hidden;
}
// 状态标签(旋转丝带效果)
.status-ribbon {
position: absolute;
top: -5px;
right: -24px;
width: 75px;
height: 37px;
background: #08A400;
transform: rotate(45deg);
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.15);
}
.ribbon-returned {
background: #08A400; // 绿色
}
.ribbon-notReturned {
background: #BD0000; // 红色
}
.ribbon-pendingReview {
background: #3471FF; // 蓝色
}
.ribbon-text {
color: #fff;
font-size: 20rpx;
font-weight: 500;
transform: rotate(0deg);
transform-origin: center;
display: block;
text-align: center;
margin-top: 16rpx;
white-space: nowrap;
letter-spacing: 1rpx;
}
// 卡片内容
.card-content {
padding: 28rpx;
}
.card-title {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
}
.card-info {
display: flex;
flex-direction: column;
gap: 12rpx;
margin-bottom: 24rpx;
}
.info-item {
font-size: 26rpx;
color: #666;
line-height: 1.6;
}
// 操作按钮
.card-actions {
display: flex;
justify-content: flex-end;
}
.action-btn {
padding: 14rpx 40rpx;
background: #3074F7;
color: #fff;
border-radius: 8rpx;
font-size: 26rpx;
border: none;
line-height: 1;
&::after {
border: none;
}
}
.btn-notReturned {
background: #3074F7;
}
.btn-pendingReview {
background: #3074F7;
}
</style>