You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
3.4 KiB

<template>
<view class="detail-bg">
<view class="detail-card">
<view class="detail-list">
<view class="detail-item">
<text class="detail-label">物资名称</text>
<text class="detail-value">{{ info.name }}</text>
</view>
<view class="detail-item">
<text class="detail-label">物资编号</text>
<text class="detail-value">{{ info.code }}</text>
</view>
<view class="detail-item">
<text class="detail-label">库存数量</text>
<text class="detail-value stock">{{ info.stockQty }}</text>
</view>
<view class="detail-item">
<text class="detail-label">物资图片</text>
<image v-if="info.photo" :src="info.photo" class="detail-img" mode="aspectFill" />
<view v-else class="img-placeholder">无图片</view>
</view>
<view class="detail-item remark-item">
<text class="detail-label">备注</text>
<text class="detail-remark">{{ info.remark || '' }}</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
info: {
name: '',
code: '',
stockQty: '',
photo: '',
remark: ''
}
}
},
onLoad(options) {
// 实际应根据 options.code 请求后端获取物资信息,这里用假数据演示
this.info = {
name: '仓库A物资',
code: options.code || '未知',
stockQty: 100,
photo: '',
remark: '无特殊说明'
}
}
}
</script>
<style>
.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;
}
</style>