Files
meida_front/pages/fittingRoom/components/s-grid-clothes.vue
T
liguigong d3f8ec3576 feat(fittingRoom): 实现试穿结果展示与衣服上传编辑功能
- 新增试穿结果获取与展示逻辑,支持模特切换
- 实现衣服上传和编辑功能,包括分类和长度选择
- 优化上传页面UI布局,增加确认和删除操作按钮- 调整轮播组件数据源,使用试穿结果列表
- 修复上传接口调用逻辑,支持文件上传与数据提交
- 更新请求超时时间,提升接口稳定性
- 优化分类标签显示逻辑,修复索引映射问题
- 支持从衣橱进入编辑模式,传递文件URL和ID参数
- 移除旧版图片选择器,统一使用新上传逻辑
- 修复组件间数据传递与事件绑定问题
2025-09-26 18:29:33 +08:00

117 lines
2.9 KiB
Vue

<!--
* @Author: liguigong liguigong@shopline.com
* @Date: 2025-09-19 16:26:36
* @LastEditors: liguigong liguigong@shopline.com
* @LastEditTime: 2025-09-26 18:21:04
* @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="index + 100"
>
<view class="grid-item-box" style="background-color: #fff">
<view v-if="index == 3" 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();
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>