feat: 商品卡片增加编辑按钮,仅上架商品可编辑,状态改为已上架/已下架
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
:key="item.productId"
|
||||
class="product-item"
|
||||
>
|
||||
<view class="product-info" @click="editProduct(item)">
|
||||
<view class="product-info">
|
||||
<view class="product-header">
|
||||
<text class="product-name">{{ item.name }}</text>
|
||||
<text class="product-category" v-if="item.categoryName">{{ item.categoryName }}</text>
|
||||
@@ -45,11 +45,14 @@
|
||||
</view>
|
||||
<view class="product-status">
|
||||
<text :class="['status', item.status === 1 ? 'on' : 'off']">
|
||||
{{ item.status === 1 ? '上架' : '下架' }}
|
||||
{{ item.status === 1 ? '已上架' : '已下架' }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="product-actions">
|
||||
<view class="action-btn edit" @click="editProduct(item)" v-if="item.status === 1">
|
||||
编辑
|
||||
</view>
|
||||
<view class="action-btn" @click="toggleStatus(item)">
|
||||
{{ item.status === 1 ? '下架' : '上架' }}
|
||||
</view>
|
||||
@@ -525,6 +528,11 @@ export default {
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.action-btn.edit {
|
||||
background: #f0f5ff;
|
||||
color: #667eea;
|
||||
}
|
||||
|
||||
.action-btn.delete {
|
||||
background: #fff1f0;
|
||||
color: #ff4d4f;
|
||||
|
||||
Reference in New Issue
Block a user