代码更新

This commit is contained in:
GaoHao
2025-02-26 19:46:20 +08:00
parent 7519ffced3
commit b4a0393d2d
413 changed files with 7483 additions and 60762 deletions

View File

@@ -1,128 +0,0 @@
<template>
<view class="item">
<view class="u-flex u-row-between">
<view>#{{index+1}} {{data.name}}</view>
<view class="color-666 u-font-24 id">ID:{{data.id}}</view>
</view>
<view class="u-m-t-16 color-666 u-font-24 u-p-b-24 border-bottom">
添加时间
<uni-dateformat :date="data.createdAt"></uni-dateformat>
</view>
<view class="u-m-t-24">
<view v-for="(spec,specIndex) in data.specList" :key="specIndex">
<view class="font-bold " :class="{'u-m-t-32':specIndex>0}"> {{spec.name}}</view>
<view class="u-m-t-24 bg-gray u-flex u-flex-wrap options u-p-24">
<view class="u-flex option" v-for="(option,optionIndex) in spec.value" :key="optionIndex" @tap="statusClick(optionIndex)">
{{option}}
<!-- <view class="sellout" v-if="option.sellOut">已售罄</view>
<view class="tag-primary tag" v-if="option.status">上架中</view>
<view class="tag-gray tag" v-else>上架中</view> -->
</view>
</view>
</view>
</view>
<view class="u-m-t-20 u-flex u-row-right btns">
<my-button @tap="del" :plain="btnProps.plain" :fontSize="btnProps.fontSize" :width="btnProps.width" :height="btnProps.height" type="cancel" :shape="btnProps.shape" >删除</my-button>
<my-button @tap="edit" :plain="btnProps.plain" :fontSize="btnProps.fontSize" :width="btnProps.width" :height="btnProps.height" :shape="btnProps.shape">编辑</my-button>
</view>
</view>
</template>
<script setup>
import { reactive, ref } from 'vue';
import myButton from "@/components/my-components/my-button.vue"
import go from '@/commons/utils/go.js'
const props=defineProps({
index:{
type:Number,
},
data:{
type:Object,
default:()=>{
return {}
}
}
})
const emits=defineEmits(['del','edit','statusClick'])
function del(){
emits('del',props.index)
}
function edit(){
uni.$emit('edit:spec',props.data)
uni.setStorageSync('spec',props.data)
go.to('PAGES_PRODUCT_GUIGE_ADD', {
type: 'edit'
})
// emits('edit',props.index)
}
function statusClick(optionIndex){
emits('statusClick',[props.index,optionIndex])
}
const btnProps=reactive({
shape:'circle',
width:120,
height:48,
fontSize:24,
plain:true
})
</script>
<style lang="scss" scoped>
.btns{
gap: 0 20rpx;
}
.item{
background: #FFFFFF;
padding: 32rpx 24rpx;
border-radius: 18rpx 18rpx 18rpx 18rpx;
margin-bottom: 30rpx;
.id{
background: #F4F4F4;
padding: 6rpx 10rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
}
.options{
gap: 10rpx 50rpx;
.option{
padding: 12rpx 40rpx;
background: #F0F2F5;
border-radius: 4rpx;
font-size: 24rpx;
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;
}
.sellout{
position: absolute;
left: 0;
right: 0;
bottom: 0;
background-color: rgb(147, 147, 153);
color: #fff;
text-align: center;
font-size: 20rpx;
}
.tag-primary{
background-color: $my-main-color;
color: #fff;
}
.tag-gray{
background-color: rgb(147, 147, 153);
color: #fff;
}
}
}
}
</style>

View File

@@ -0,0 +1,56 @@
<template>
<view style="display: flex;line-height: 60rpx;align-items: center;justify-content: space-between;" @click="clickNode(data)">
<view style="display: flex;align-items: center;">
<view v-if="data.children && data.children.length">
<uni-icons v-if="data.isOpen" type="bottom" size="16" color="#2A5EFF"></uni-icons>
<uni-icons v-else type="forward" size="16"></uni-icons>
</view>
<view style="padding-left: 10px;">{{ data.name }}</view>
</view>
<view style="display: flex;align-items: center;justify-content: space-between;">
<view @tap.stop="del" style="font-size:24rpx;color: #999;">删除</view>
<view @tap.stop="edit" style="font-size:24rpx;color: #318AFE;margin-left: 20rpx;">编辑</view>
</view>
</view>
<view v-if="data.children && data.children.length && data.isOpen" style="margin-left: 16px;padding: 10rpx;line-height: 60rpx;">
<tree-item v-for="(child,index) in data.children" :key="child.id" :data="child"
@clickNode="clickNode"></tree-item>
</view>
</template>
<script setup>
import { reactive, ref } from 'vue';
import treeItem from './tree-item.vue'
import go from '@/commons/utils/go.js'
const props=defineProps({
data:{
type:Object,
default:()=>{
return {}
}
}
})
const emits=defineEmits(['del','edit'])
function clickNode(item) {
item.isOpen = !item.isOpen
}
function del(){
emits('del',props.index)
}
function edit(){
uni.setStorageSync('spec',props.data)
go.to('PAGES_PRODUCT_GUIGE_ADD', {
type: 'edit'
})
}
</script>
<style lang="scss" scoped>
</style>