优化分组商品编辑

This commit is contained in:
gyq
2025-05-07 17:48:13 +08:00
parent b69b5dbf31
commit d6e1c83f88
10 changed files with 2599 additions and 2527 deletions

View File

@@ -1,12 +1,12 @@
<template>
<view class=" goods">
<view class="goods">
<view class="u-flex u-font-24 u-col-center u-row-between u-p-b-16 border-bottom">
<view class="u-flex u-col-center">
<view class="u-font-24">
<text>排序</text>
<text class="u-m-l-12">{{data.sort}}</text>
<text class="u-m-l-12">{{ data.sort }}</text>
</view>
<view class="u-flex u-m-l-16 " @click="editSort">
<view class="u-flex u-m-l-16" @click="editSort">
<image src="/pageGoodsGroup/static/image/icon-edit.svg" class="icon-edit" mode=""></image>
</view>
</view>
@@ -15,20 +15,23 @@
<up-switch :activeValue="1" :inactiveValue="0" v-model="data.status" @change="isShowChange" :size="18"></up-switch>
</view>
</view>
<view class="u-m-t-24 u-p-l-54 ">
<view class="u-m-t-24">
<view class="u-flex-1 u-flex u-col-top">
<view class="color-666 no-wrap">分组名</view>
<view class="color-333 u-m-l-60">{{data.name}}</view>
<view class="u-flex u-m-l-16 " @click="editName">
<view class="color-333 u-m-l-60">{{ data.name }}</view>
<view class="u-flex u-m-l-16" @click="editName">
<image src="/pageGoodsGroup/static/image/icon-edit.svg" class="icon-edit" mode=""></image>
</view>
</view>
<view class="u-flex u-m-t-24">
<view class="color-666">售卖时间</view>
<view class="color-main u-m-l-32" v-if="data.saleStartTime&&data.saleEndTime">
<text>{{data.saleStartTime}}</text>
<text>-</text>
<text>{{data.saleEndTime}}</text>
<view class="color-main u-m-l-32" v-if="data.saleStartTime && data.saleEndTime">
<text>{{ data.saleStartTime }}</text>
<text> - </text>
<text>{{ data.saleEndTime }}</text>
</view>
<view class="color-main u-m-l-32" v-else>
<text>00:00:00 - 23:59:59</text>
</view>
</view>
</view>
@@ -37,176 +40,169 @@
<view class="btn-default btn" @click="del">删除</view>
<view class="btn-primary btn u-m-l-38" @click="toEdit">编辑</view>
</view>
</view>
</template>
<script setup>
import { computed, ref, watchEffect } from 'vue';
import mySwitch from '@/components/my-components/my-switch.vue'
import go from '@/commons/utils/go.js';
import { computed, ref, watchEffect } from 'vue';
import mySwitch from '@/components/my-components/my-switch.vue';
import go from '@/commons/utils/go.js';
const emits = defineEmits(['changeClick', 'edit', 'editName', 'editSort', 'del', 'isShowChange']);
const emits = defineEmits(['changeClick','edit', 'editName','editSort', 'del', 'isShowChange'])
const props = defineProps({
index: {
type: Number
},
data: {
type: Object,
default: () => {
return {
status:true
}
}
},
})
function isShowChange() {
emits('isShowChange', {
...props.data,
})
const props = defineProps({
index: {
type: Number
},
data: {
type: Object,
default: () => {
return {
status: true
};
}
}
});
let isSellNone = ref(true)
isSellNone.value = props.isSellNone
function isShowChange() {
emits('isShowChange', {
...props.data
});
}
function isSellNoneChange() {
console.log(isSellNone.value);
console.log('isSellNoneChange');
}
let isSellNone = ref(true);
isSellNone.value = props.isSellNone;
let checked = ref(false)
function isSellNoneChange() {
console.log(isSellNone.value);
console.log('isSellNoneChange');
}
let checked = ref(false);
function changeClick() {
emits('changeClick', props.index)
}
function changeClick() {
emits('changeClick', props.index);
}
function del() {
emits('del', props.index)
}
function editName() {
emits('editName', props.index)
}
//携带参数type edit跳转到商品添加页面编辑与添加同一页面根据type值来判断
function editSort() {
emits('editSort', props.index)
}
function toEdit() {
emits('edit', props.index)
}
function del() {
emits('del', props.index);
}
function editName() {
emits('editName', props.index);
}
//携带参数type edit跳转到商品添加页面编辑与添加同一页面根据type值来判断
function editSort() {
emits('editSort', props.index);
}
function toEdit() {
emits('edit', props.index);
}
</script>
<style lang="scss" scoped>
$imgSize: 126rpx;
$price-color: #F02C45;
$imgSize: 126rpx;
$price-color: #f02c45;
.btn {
padding: 6rpx 28rpx;
border-radius: 100rpx;
font-size: 24rpx;
border: 1px solid transparent;
}
.btn {
padding: 6rpx 28rpx;
border-radius: 100rpx;
font-size: 24rpx;
border: 1px solid transparent;
}
.btn-primary {
border-color: $my-main-color;
color: $my-main-color;
}
.btn-primary {
border-color: $my-main-color;
color: $my-main-color;
}
.btn-default {
border-color: #999;
color: #999;
}
.btn-default {
border-color: #999;
color: #999;
}
.price {
color: $price-color;
}
.price {
color: $price-color;
}
.h-100 {
height: $imgSize;
}
.h-100 {
height: $imgSize;
}
.img {
width: $imgSize;
height: $imgSize;
}
.img {
width: $imgSize;
height: $imgSize;
}
.icon-arrow-right {
width: 32rpx;
height: 32rpx;
}
.icon-arrow-right {
width: 32rpx;
height: 32rpx;
}
.stock {
padding-right: 46rpx;
position: relative;
}
.stock {
padding-right: 46rpx;
position: relative;
}
.icon-edit {
width: 24rpx;
height: 24rpx;
}
.icon-edit {
width: 24rpx;
height: 24rpx;
}
.stock::after {
content: '';
position: absolute;
right: 10rpx;
top: 50%;
transform: translateY(-50%);
display: block;
width: 16rpx;
border: 2rpx solid #333333;
}
.stock::after {
content: '';
position: absolute;
right: 10rpx;
top: 50%;
transform: translateY(-50%);
display: block;
width: 16rpx;
border: 2rpx solid #333333;
}
.goods {
border-radius: 10rpx 10rpx 10rpx 10rpx;
background-color: #fff;
padding: 32rpx 28rpx 32rpx 28rpx;
font-size: 28rpx;
.goods {
border-radius: 10rpx 10rpx 10rpx 10rpx;
background-color: #fff;
padding: 32rpx 28rpx 32rpx 28rpx;
font-size: 28rpx;
.skus {
background: #F9F9F9;
border-radius: 14rpx 14rpx 14rpx 14rpx;
padding: 28rpx 42rpx;
.skus {
background: #f9f9f9;
border-radius: 14rpx 14rpx 14rpx 14rpx;
padding: 28rpx 42rpx;
.sku {
color: #000;
font-weight: 700;
padding: 6rpx 40rpx;
.sku {
color: #000;
font-weight: 700;
padding: 6rpx 40rpx;
}
.skds {
gap: 10rpx 50rpx;
}
.skd {
padding: 14rpx 40rpx;
background: #f0f2f5;
border-radius: 4rpx;
position: relative;
color: #666;
overflow: hidden;
.tag {
position: absolute;
right: 0;
top: 0;
font-size: 12rpx;
right: 0;
padding: 2rpx 4rpx;
border-radius: 0rpx 4rpx 4rpx 4rpx;
}
.skds {
gap: 10rpx 50rpx;
.tag-primary {
background-color: $my-main-color;
color: #fff;
}
.skd {
padding: 14rpx 40rpx;
background: #F0F2F5;
border-radius: 4rpx;
position: relative;
color: #666;
overflow: hidden;
.tag {
position: absolute;
right: 0;
top: 0;
font-size: 12rpx;
right: 0;
padding: 2rpx 4rpx;
border-radius: 0rpx 4rpx 4rpx 4rpx;
}
.tag-primary {
background-color: $my-main-color;
color: #fff;
}
}
}
}
</style>
}
</style>