准备上传
This commit is contained in:
@@ -68,6 +68,12 @@
|
||||
</swiper>
|
||||
</view>
|
||||
|
||||
<!-- 配件查询按钮 -->
|
||||
<view class="parts-search-btn" @click="onPartsSearchTap" hover-class="parts-search-btn-active" hover-stay-time="80">
|
||||
<image src="/static/icons/product.png" class="parts-search-icon" mode="aspectFit"></image>
|
||||
<text class="parts-search-text">配件查询</text>
|
||||
</view>
|
||||
|
||||
<!-- 分割标题:产品与功能 -->
|
||||
<view class="section-title">
|
||||
<text class="section-text">常用功能</text>
|
||||
@@ -268,6 +274,20 @@
|
||||
})
|
||||
},
|
||||
|
||||
onPartsSearchTap() {
|
||||
// 设置标志,让货品列表页打开时自动切换到"查询"Tab并选择"按模板参数查询"
|
||||
try {
|
||||
uni.setStorageSync('PRODUCT_SEARCH_CONFIG', JSON.stringify({
|
||||
openTab: 'search',
|
||||
mode: 'template'
|
||||
}))
|
||||
} catch(e) {
|
||||
console.error('[index] 设置存储标志失败:', e)
|
||||
}
|
||||
// 跳转到货品列表页(tabBar页面使用switchTab)
|
||||
uni.switchTab({ url: '/pages/product/list' })
|
||||
},
|
||||
|
||||
onIconError(item) {
|
||||
item.img = ''
|
||||
}
|
||||
@@ -324,6 +344,34 @@ page {
|
||||
.notice-text { color: $uni-text-color; font-size: 28rpx; line-height: 36rpx; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
||||
.notice-tag { color: $uni-color-primary; font-size: 22rpx; padding: 4rpx 10rpx; border-radius: 999rpx; background: rgba(76,141,255,0.18); }
|
||||
|
||||
/* 配件查询按钮 */
|
||||
.parts-search-btn {
|
||||
margin: 0 24rpx 20rpx;
|
||||
padding: 24rpx 32rpx;
|
||||
border-radius: 20rpx;
|
||||
background: linear-gradient(135deg, #4C8DFF 0%, #3d73e6 100%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 16rpx;
|
||||
box-shadow: 0 8rpx 20rpx rgba(76,141,255,0.25);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.parts-search-btn-active {
|
||||
opacity: 0.85;
|
||||
transform: scale(0.98);
|
||||
}
|
||||
.parts-search-icon {
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
filter: brightness(0) invert(1);
|
||||
}
|
||||
.parts-search-text {
|
||||
color: #fff;
|
||||
font-size: 34rpx;
|
||||
font-weight: 800;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
/* 分割标题 */
|
||||
.section-title { display: flex; align-items: center; gap: 16rpx; padding: 10rpx 28rpx 0; flex: 0 0 auto; }
|
||||
|
||||
@@ -155,6 +155,15 @@ export default {
|
||||
this.shopName = storeName
|
||||
const phone = profile?.phone || uni.getStorageSync('USER_MOBILE') || ''
|
||||
this.mobile = phone
|
||||
// 保存邮箱到本地存储
|
||||
const email = profile?.email || ''
|
||||
try {
|
||||
if (email) {
|
||||
uni.setStorageSync('USER_EMAIL', email)
|
||||
} else {
|
||||
uni.removeStorageSync('USER_EMAIL')
|
||||
}
|
||||
} catch(_){}
|
||||
} catch(e) {
|
||||
try {
|
||||
const storeName = uni.getStorageSync('SHOP_NAME') || ''
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 保留“我的提交”页的+,此处不显示 -->
|
||||
<!-- 右下角的"+"按钮 -->
|
||||
<view class="fab" @click="goSubmit">+</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -99,6 +100,27 @@ export default {
|
||||
onShow() {
|
||||
const hasToken = (() => { try { return !!uni.getStorageSync('TOKEN') } catch(e){ return false } })()
|
||||
if (!hasToken) return
|
||||
|
||||
// 检查是否需要打开查询Tab并设置查询模式(从首页"配件查询"按钮进入)
|
||||
try {
|
||||
const configStr = uni.getStorageSync('PRODUCT_SEARCH_CONFIG')
|
||||
if (configStr) {
|
||||
const config = JSON.parse(configStr)
|
||||
// 切换到指定Tab
|
||||
if (config.openTab) {
|
||||
this.tab = config.openTab
|
||||
}
|
||||
// 设置查询模式
|
||||
if (config.mode) {
|
||||
this.query.mode = config.mode
|
||||
}
|
||||
// 清除标志,避免下次进入时再次切换
|
||||
uni.removeStorageSync('PRODUCT_SEARCH_CONFIG')
|
||||
}
|
||||
} catch(e) {
|
||||
console.error('[list] 处理查询配置失败:', e)
|
||||
}
|
||||
|
||||
// 从创建/编辑页返回时,确保刷新最新列表
|
||||
this.reload()
|
||||
},
|
||||
@@ -211,7 +233,10 @@ export default {
|
||||
} catch (e) {
|
||||
uni.showToast({ title: '删除失败', icon: 'none' })
|
||||
}
|
||||
}
|
||||
},
|
||||
goSubmit() {
|
||||
uni.navigateTo({ url: '/pages/product/submit' })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -241,7 +266,7 @@ export default {
|
||||
.card-params .param { color:$uni-text-color-grey; font-size: 22rpx; background:$uni-bg-color-grey; padding: 2rpx 6rpx; border-radius: 8rpx; }
|
||||
.price { margin-left: 20rpx; color:$uni-color-primary; }
|
||||
.empty { height: 60vh; display:flex; align-items:center; justify-content:center; color:$uni-text-color-grey; }
|
||||
.fab { position: fixed; right: 30rpx; bottom: 120rpx; width: 100rpx; height: 100rpx; background:$uni-color-primary; color:#fff; border-radius: 50rpx; text-align:center; line-height: 100rpx; font-size: 48rpx; box-shadow: 0 8rpx 20rpx rgba(0,0,0,0.15); }
|
||||
.fab { position: fixed; right: 30rpx; bottom: 120rpx; width: 100rpx; height: 100rpx; background: linear-gradient(135deg, #4c8dff, #6ab7ff); color: #fff; border-radius: 50rpx; display: flex; align-items: center; justify-content: center; font-size: 48rpx; box-shadow: 0 20rpx 40rpx rgba(0,0,0,0.2); }
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
@@ -120,24 +120,134 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page { padding: 24rpx 24rpx 160rpx; background: #f6f7fb; }
|
||||
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20rpx; }
|
||||
.model { font-size: 36rpx; font-weight: 700; color: #2d3a4a; }
|
||||
.status.deleted { font-size: 24rpx; padding: 6rpx 18rpx; border-radius: 999rpx; background: #c0c4cc; color: #fff; }
|
||||
.section { background: #fff; border-radius: 16rpx; padding: 20rpx 22rpx; margin-bottom: 24rpx; box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.04); }
|
||||
.row { display: flex; justify-content: space-between; padding: 12rpx 0; border-bottom: 1rpx solid #f1f2f5; }
|
||||
.page {
|
||||
min-height: 100vh;
|
||||
padding: 20rpx 24rpx 160rpx;
|
||||
background: #f6f7fb;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
gap: 16rpx;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.model {
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
color: #2d3a4a;
|
||||
word-break: break-word;
|
||||
overflow-wrap: break-word;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.status.deleted {
|
||||
font-size: 24rpx;
|
||||
padding: 6rpx 18rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #c0c4cc;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.section {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 22rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.04);
|
||||
}
|
||||
.row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
gap: 16rpx;
|
||||
padding: 12rpx 0;
|
||||
border-bottom: 1rpx solid #f1f2f5;
|
||||
}
|
||||
.row:last-child { border-bottom: none; }
|
||||
.label { width: 160rpx; font-size: 26rpx; color: #7a8899; }
|
||||
.value { flex: 1; text-align: right; font-size: 26rpx; color: #2d3a4a; word-break: break-all; }
|
||||
.block-title { font-size: 28rpx; font-weight: 600; color: #2d3a4a; margin-bottom: 12rpx; }
|
||||
.placeholder { font-size: 26rpx; color: #7a8899; }
|
||||
.params { display: flex; flex-direction: column; gap: 12rpx; }
|
||||
.param { display: flex; justify-content: flex-start; align-items: center; gap: 16rpx; font-size: 26rpx; color: #2d3a4a; }
|
||||
.param-key { color: #7a8899; }
|
||||
.param-val { text-align: left; }
|
||||
.images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12rpx; }
|
||||
.image { width: 100%; height: 200rpx; border-radius: 16rpx; background: #f0f2f5; }
|
||||
.footer { display: flex; justify-content: flex-end; gap: 20rpx; }
|
||||
.loading { height: 100vh; display: flex; align-items: center; justify-content: center; color: #7a8899; }
|
||||
.label {
|
||||
flex-shrink: 0;
|
||||
width: 140rpx;
|
||||
font-size: 26rpx;
|
||||
color: #7a8899;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
text-align: right;
|
||||
font-size: 26rpx;
|
||||
color: #2d3a4a;
|
||||
word-break: break-word;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
.block-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #2d3a4a;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.placeholder {
|
||||
font-size: 26rpx;
|
||||
color: #7a8899;
|
||||
word-break: break-word;
|
||||
}
|
||||
.params {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12rpx;
|
||||
}
|
||||
.param {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
gap: 16rpx;
|
||||
font-size: 26rpx;
|
||||
color: #2d3a4a;
|
||||
}
|
||||
.param-key {
|
||||
flex-shrink: 0;
|
||||
color: #7a8899;
|
||||
min-width: 160rpx;
|
||||
}
|
||||
.param-val {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
text-align: left;
|
||||
word-break: break-word;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
.images {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 12rpx;
|
||||
}
|
||||
.image {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #f0f2f5;
|
||||
}
|
||||
.footer {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 20rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
|
||||
background: rgba(255,255,255,0.96);
|
||||
box-shadow: 0 -6rpx 20rpx rgba(0,0,0,0.08);
|
||||
}
|
||||
.loading {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #7a8899;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
<template>
|
||||
<scroll-view scroll-y class="page">
|
||||
<view class="hero">
|
||||
<text class="title">提交配件</text>
|
||||
<text class="desc">填写型号、名称、参数与图片,提交后进入待审核状态</text>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="row required">
|
||||
<text class="label">型号</text>
|
||||
@@ -332,11 +327,13 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page { padding: 24rpx 24rpx 120rpx; background: #f6f7fb; }
|
||||
.hero { padding: 24rpx; background: linear-gradient(135deg, #4c8dff, #6ab7ff); border-radius: 20rpx; color: #fff; margin-bottom: 24rpx; }
|
||||
.title { font-size: 36rpx; font-weight: 700; }
|
||||
.desc { font-size: 26rpx; margin-top: 8rpx; opacity: 0.9; }
|
||||
.section { background: #fff; border-radius: 16rpx; padding: 20rpx 22rpx; margin-bottom: 24rpx; box-shadow: 0 10rpx 30rpx rgba(0,0,0,0.04); }
|
||||
.page {
|
||||
height: 100vh;
|
||||
padding: 16rpx 24rpx 120rpx;
|
||||
background: #f6f7fb;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.section { background: #fff; border-radius: 16rpx; padding: 20rpx 22rpx; margin-bottom: 16rpx; box-shadow: 0 10rpx 30rpx rgba(0,0,0,0.04); }
|
||||
.row { display: flex; align-items: center; gap: 16rpx; padding: 16rpx 0; border-bottom: 1rpx solid #f1f2f5; }
|
||||
.row:last-child { border-bottom: none; }
|
||||
.row.required .label::after { content: '*'; color: #ff5b5b; margin-left: 6rpx; }
|
||||
|
||||
Reference in New Issue
Block a user