fix(uploadClothes): 修复上传页面分类选择逻辑 调整上传衣服页面的分类选择逻辑,使用 uv-radio-group 实现单选功能,支持衣服类型和长度部位的选择。引入 fittingRoom store 中的 tabs 和 pattern 数据,优化用户交互体验。 chore(deps): 更新 uv-icon 和 uv-radio 组件版本更新 uv-icon 和 uv-radio 组件的 package.json 配置文件,设置版本号为1.0.13。更新 changelog 文档,记录组件的优化和 bug 修复历史。完善组件的平台兼容性配置和依赖关系。 style(components): 调整上传页面样式布局优化上传衣服页面的样式布局,新增 warp、title、container 等样式类,改善分类和长度选择区域的显示效果。调整单选框的间距和对齐方式,提升用户界面的美观性和可用性。
117 lines
2.9 KiB
Vue
117 lines
2.9 KiB
Vue
<!--
|
|
* @Author: liguigong liguigong@shopline.com
|
|
* @Date: 2025-09-19 16:26:36
|
|
* @LastEditors:
|
|
* @LastEditTime: 2025-09-27 16:37:29
|
|
* @FilePath: pages/fittingRoom/components/s-grid-clothes.vue
|
|
* @Description: 这是默认设置,可以在设置》工具》File Description中进行配置
|
|
-->
|
|
<template>
|
|
<view class="tabContainer">
|
|
<uni-grid :column="4" :highlight="true" :square="false" borderColor="#000" @change="change">
|
|
<uni-grid-item
|
|
v-for="(item, index) in fittingRoomStore.clothes"
|
|
:key="index"
|
|
:index="item"
|
|
>
|
|
<view class="grid-item-box" style="background-color: #fff">
|
|
<view v-if="fittingRoomStore.currentClothes.some(v => v.clothId === item.clothId)" class="inUse">
|
|
<view class="edit" @click="goEdit(item)">编辑</view>
|
|
</view>
|
|
|
|
<template v-if="fittingRoomStore.canUpload && index === 0">
|
|
<image
|
|
class="clothes"
|
|
mode="aspectFill"
|
|
src="/static/uploads/1.png"
|
|
@click="uploadFile"
|
|
></image>
|
|
</template>
|
|
<image v-else :src="item.thumbnailFileUrl" class="clothes" mode="aspectFill"></image>
|
|
</view>
|
|
</uni-grid-item>
|
|
</uni-grid>
|
|
</view>
|
|
</template>
|
|
<script setup>
|
|
import sheep from '@/sheep';
|
|
import { pattern } from '../../../sheep/store/fittingRoom';
|
|
|
|
const fittingRoomStore = sheep.$store('fittingRoom');
|
|
|
|
function selectPic(...data) {
|
|
console.log(fittingRoomStore.tab);
|
|
console.log('🚀 ~ selectPic 🐶43 ~ data: ', data);
|
|
}
|
|
|
|
function uploadFile() {
|
|
sheep.$router.go('/pages/uploadClothes/index', {});
|
|
}
|
|
|
|
const sizeType = ['original'];
|
|
const imageStyle = {
|
|
width: 200,
|
|
height: 200,
|
|
};
|
|
|
|
function goEdit(item) {
|
|
console.log('🚀 ~ goEdit 🐶57 ~ item: ', item);
|
|
fittingRoomStore.selectClothesType = fittingRoomStore.tabsMap.includes(Number(item.clothType))
|
|
? Number(item.clothType)
|
|
: fittingRoomStore.selectClothesType;
|
|
fittingRoomStore.selectPattern = pattern.some((v) => {
|
|
v.value === item.len;
|
|
})
|
|
? item.len
|
|
: fittingRoomStore.selectPattern;
|
|
sheep.$router.go('/pages/uploadClothes/index', {
|
|
fileUrl: item.fileUrl,
|
|
clothId: item.clothId,
|
|
});
|
|
}
|
|
|
|
function change(e) {
|
|
fittingRoomStore.changeClothes(e.detail.index);
|
|
console.log('🚀 ~ change 🐶63 ~ index: ', e.detail.index);
|
|
}
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.grid-item-box {
|
|
height: 272rpx;
|
|
overflow: hidden;
|
|
position: relative;
|
|
}
|
|
|
|
.clothes {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.upload {
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
position: absolute;
|
|
opacity: 0;
|
|
}
|
|
|
|
.inUse {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: rgba(0, 0, 0, 0.1);
|
|
z-index: 3;
|
|
|
|
.edit {
|
|
color: #000;
|
|
right: 14rpx;
|
|
top: 12rpx;
|
|
font-size: 24rpx;
|
|
position: absolute;
|
|
}
|
|
}
|
|
</style>
|