parent
b1cdd623ad
commit
a07388aa0d
@ -0,0 +1,105 @@
|
||||
import { BASE_API } from './config'
|
||||
|
||||
// 登录接口
|
||||
export function login(username, password) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: BASE_API + 'api/admin/auth/login',
|
||||
method: 'POST',
|
||||
data: {
|
||||
username,
|
||||
password
|
||||
},
|
||||
success: resolve,
|
||||
fail: reject
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 获取用户信息接口
|
||||
export function getUserInfo() {
|
||||
const token = uni.getStorageSync('token')
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: BASE_API + 'api/admin/auth/me',
|
||||
method: 'POST',
|
||||
data: {
|
||||
token
|
||||
},
|
||||
success: resolve,
|
||||
fail: reject
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 退出登录接口
|
||||
export function logoutApi() {
|
||||
const token = uni.getStorageSync('token')
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: BASE_API + 'api/admin/auth/logout',
|
||||
method: 'POST',
|
||||
data: { token },
|
||||
success: resolve,
|
||||
fail: reject
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 获取物资详情接口
|
||||
export function getMaterialInfo(id) {
|
||||
const token = uni.getStorageSync('token')
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: BASE_API + 'api/admin/material-infos/show',
|
||||
method: 'GET',
|
||||
data: {
|
||||
id,
|
||||
token
|
||||
},
|
||||
success: resolve,
|
||||
fail: reject
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 盘点保存接口
|
||||
export function saveInventoryCheck(data) {
|
||||
const token = uni.getStorageSync('token')
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log("confirm接口")
|
||||
uni.request({
|
||||
url: BASE_API + 'api/admin/material-infos-plan-link/confirm',
|
||||
method: 'POST',
|
||||
data: {
|
||||
...data,
|
||||
token
|
||||
},
|
||||
success: resolve,
|
||||
fail: reject
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 文件上传接口
|
||||
export function uploadFile(filePath) {
|
||||
const token = uni.getStorageSync('token')
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: BASE_API + 'api/admin/upload-file',
|
||||
filePath,
|
||||
name: 'file',
|
||||
formData: { token },
|
||||
success: (res) => {
|
||||
// 假设后端返回 { code: 0, data: { id: 123, url: '...' } }
|
||||
try {
|
||||
const data = JSON.parse(res.data)
|
||||
resolve(data)
|
||||
} catch (e) {
|
||||
reject(e)
|
||||
}
|
||||
},
|
||||
fail: reject
|
||||
})
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
// 全局配置文件
|
||||
export const BASE_API = 'http://192.168.60.99:8004/'
|
||||
|
||||
// 导出配置
|
||||
export default {
|
||||
BASE_API
|
||||
}
|
||||
|
After Width: | Height: | Size: 8.2 KiB |
@ -1,8 +1,8 @@
|
||||
{
|
||||
"hash": "eb1a7fc1",
|
||||
"hash": "da7460ea",
|
||||
"configHash": "4bf35047",
|
||||
"lockfileHash": "2865f1ca",
|
||||
"browserHash": "153c7f83",
|
||||
"lockfileHash": "515ad130",
|
||||
"browserHash": "6a07c7fb",
|
||||
"optimized": {},
|
||||
"chunks": {}
|
||||
}
|
||||
@ -1,92 +0,0 @@
|
||||
|
||||
.detail-bg {
|
||||
min-height: 100vh;
|
||||
background: linear-gradient(180deg, #eaf1fb 0%, #f7fafd 100%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.detail-card {
|
||||
width: 94vw;
|
||||
max-width: 500px;
|
||||
background: #fff;
|
||||
border-radius: 28px;
|
||||
box-shadow: 0 8px 32px rgba(64,158,255,0.10);
|
||||
padding: 38px 18px 28px 18px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
.detail-title {
|
||||
font-size: 26px;
|
||||
font-weight: 800;
|
||||
color: #409eff;
|
||||
text-align: center;
|
||||
margin-bottom: 32px;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
.detail-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
}
|
||||
.detail-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
background: #f7fafd;
|
||||
border-radius: 16px;
|
||||
margin-bottom: 18px;
|
||||
padding: 18px 16px;
|
||||
box-shadow: 0 2px 8px rgba(64,158,255,0.04);
|
||||
}
|
||||
.detail-label {
|
||||
color: #888;
|
||||
font-size: 16px;
|
||||
min-width: 80px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.detail-value {
|
||||
color: #222;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
word-break: break-all;
|
||||
}
|
||||
.detail-value.stock {
|
||||
color: #409eff;
|
||||
font-weight: 700;
|
||||
}
|
||||
.detail-img {
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
border-radius: 10px;
|
||||
margin-left: 10px;
|
||||
background: #f0f1f3;
|
||||
border: 1px solid #e3e8f0;
|
||||
}
|
||||
.img-placeholder {
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
border-radius: 10px;
|
||||
background: #f0f1f3;
|
||||
color: #bbb;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.remark-item {
|
||||
align-items: flex-start;
|
||||
}
|
||||
.detail-remark {
|
||||
color: #666;
|
||||
font-size: 15px;
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
line-height: 1.7;
|
||||
word-break: break-all;
|
||||
}
|
||||
@ -1,96 +1,131 @@
|
||||
|
||||
.inventory-bg {
|
||||
min-height: 100vh;
|
||||
background: linear-gradient(180deg, #eaf1fb 0%, #f7fafd 100%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #f5f6f7;
|
||||
padding: 0.75rem;
|
||||
}
|
||||
.inventory-card {
|
||||
width: 92vw;
|
||||
max-width: 480px;
|
||||
background: #fff;
|
||||
border-radius: 24px;
|
||||
box-shadow: 0 8px 32px rgba(64,158,255,0.10);
|
||||
padding: 48px 24px 32px 24px;
|
||||
border-radius: 0.75rem;
|
||||
padding: 1rem 0.75rem;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
.readonly-group {
|
||||
margin-bottom: 1rem;
|
||||
padding: 0.75rem;
|
||||
background: #f8f9fa;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
.readonly-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 0.625rem;
|
||||
}
|
||||
.readonly-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.readonly-label {
|
||||
color: #666;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
.readonly-value {
|
||||
color: #333;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 28px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.form-label {
|
||||
font-size: 16px;
|
||||
color: #3a3a3a;
|
||||
margin-bottom: 10px;
|
||||
font-size: 0.875rem;
|
||||
color: #333;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
.form-input {
|
||||
height: 48px;
|
||||
border: 1.5px solid #e3e8f0;
|
||||
border-radius: 12px;
|
||||
padding: 0 14px;
|
||||
font-size: 17px;
|
||||
background: #f6f8fa;
|
||||
color: #222;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
.form-input[disabled] {
|
||||
background: #f0f1f3;
|
||||
color: #aaa;
|
||||
height: 2.75rem;
|
||||
background: #f8f9fa;
|
||||
border: none;
|
||||
border-radius: 0.5rem;
|
||||
padding: 0 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
color: #333;
|
||||
}
|
||||
.form-textarea {
|
||||
min-height: 80px;
|
||||
border: 1.5px solid #e3e8f0;
|
||||
border-radius: 12px;
|
||||
padding: 10px 14px;
|
||||
font-size: 16px;
|
||||
background: #f6f8fa;
|
||||
color: #222;
|
||||
min-height: 5rem;
|
||||
background: #f8f9fa;
|
||||
border: none;
|
||||
border-radius: 0.5rem;
|
||||
padding: 0.625rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
color: #333;
|
||||
}
|
||||
.photo-upload {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.photo-btn {
|
||||
height: 44px;
|
||||
background: #409eff;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
border-radius: 8px;
|
||||
padding: 0 24px;
|
||||
border: none;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.625rem;
|
||||
}
|
||||
.photo-preview {
|
||||
position: relative;
|
||||
width: 5rem;
|
||||
height: 5rem;
|
||||
}
|
||||
.photo-btn {
|
||||
width: 5rem;
|
||||
height: 5rem;
|
||||
background: #f8f9fa;
|
||||
border-radius: 0.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0;
|
||||
}
|
||||
.photo-btn .iconfont {
|
||||
font-size: 1.5rem;
|
||||
color: #666;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
.btn-text {
|
||||
font-size: 0.75rem;
|
||||
color: #666;
|
||||
}
|
||||
.photo-preview {
|
||||
position: relative;
|
||||
}
|
||||
.photo-img {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 8px;
|
||||
margin-right: 12px;
|
||||
width: 5rem;
|
||||
height: 5rem;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
.photo-del {
|
||||
position: absolute;
|
||||
top: -0.5rem;
|
||||
right: -0.5rem;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
background: rgba(0,0,0,0.6);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.delete-icon {
|
||||
color: #ff4d4f;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
}
|
||||
.submit-btn {
|
||||
margin-top: 18px;
|
||||
height: 52px;
|
||||
background: linear-gradient(90deg, #409eff 0%, #3b7cff 100%);
|
||||
width: 100%;
|
||||
height: 2.75rem;
|
||||
background: #409eff;
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
border-radius: 14px;
|
||||
letter-spacing: 8px;
|
||||
box-shadow: 0 4px 16px rgba(64,158,255,0.13);
|
||||
font-size: 1rem;
|
||||
font-weight: 500;
|
||||
border-radius: 1.375rem;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
.submit-btn:active {
|
||||
background: linear-gradient(90deg, #337ecc 60%, #2a5db0 100%);
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 8.2 KiB |
Loading…
Reference in new issue