Files
meida_front/pages/fittingRoom/index.vue
T
guigongli f0cd843f85 feat(fittingRoom): 新增衣服长度选择功能在上传衣服页面增加分类和长度选择功能,支持用户选择衣服类型和具体长度部位。新增 pattern 常量定义各种长度选项,并在 store 中添加相应的状态管理。同时更新了相关样式和组件依赖。
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 等样式类,改善分类和长度选择区域的显示效果。调整单选框的间距和对齐方式,提升用户界面的美观性和可用性。
2025-09-27 16:42:34 +08:00

209 lines
4.6 KiB
Vue

<template>
<view v-if="template">
<view class="uni-margin-wrap">
<!-- https://ext.dcloud.net.cn/plugin?id=22930-->
<hbxw-stack-carousel
:key="fittingRoomStore.testResults"
:height="680"
:interval="15000"
:list="fittingRoomStore.testResults"
:width="430"
indicatorStyle="line"
loop
@change="handleChange"
@click="handleItemClick"
>
<template #default="{ item, index }">
<view class="custom-item">
<image :src="item.tryOnResultUrl" class="swiper-image" mode="aspectFill" />
</view>
</template>
</hbxw-stack-carousel>
<s-select-mote />
<Clothespic />
</view>
<uv-sticky :customNavHeight="0" :offset-top="0">
<s-tabs />
</uv-sticky>
<s-grid-clothes />
<view class="height1" @click="dian"></view>
</view>
</template>
<script setup>
import { computed, onMounted, reactive } from 'vue';
import { onLoad, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app';
import sheep from '@/sheep';
import SSelectMote from './components/s-select-mote.vue';
import STabs from './components/STabs.vue';
import SGridClothes from './components/s-grid-clothes.vue';
import Clothespic from './components/Clothespic.vue'; // 隐藏原生tabBar
const fittingRoomStore = sheep.$store('fittingRoom');
sheep.$helper.toast('请选择是否同意协议');
// 隐藏原生tabBar
uni.hideTabBar({
fail: () => {},
});
function handleItemClick(index, item) {
console.log(index, item, '12');
}
onMounted(() => {
fittingRoomStore.getCategory();
fittingRoomStore.getCloths();
fittingRoomStore.getModelList();
});
const state = reactive({
info: [
{
image: 'https://picsum.photos/600/300?random=1',
},
{
image: 'https://picsum.photos/600/300?random=2',
},
{
image: 'https://picsum.photos/600/300?random=3',
},
],
current: 0,
});
function handleChange(index, oldIndex) {
// state.current = index;
console.log('---- change ----', index, oldIndex);
}
function dian() {
state.info = [
{
image: 'https://picsum.photos/600/300?random=1',
},
{
image: 'https://picsum.photos/600/300?random=2',
},
{
image: 'https://picsum.photos/600/300?random=3',
},
{
image: 'https://picsum.photos/600/300?random=4',
},
{
image: 'https://picsum.photos/600/300?random=5',
},
];
}
const swiperChange = (e) => {
state.current = e.detail.current;
};
const template = computed(() => sheep.$store('app').template?.home);
onLoad((options) => {
// #ifdef MP
// 小程序识别二维码
if (options.scene) {
const sceneParams = decodeURIComponent(options.scene).split('=');
console.log('sceneParams=>', sceneParams);
options[sceneParams[0]] = sceneParams[1];
}
// #endif
uni.setStorageSync('token', options?.token ?? 'e84526c0f7a3457da54e663fb4396beb');
console.log("🚀 ~ URL上的token ~ options?.token: ", options?.token);
// 预览模板
if (options.templateId) {
sheep.$store('app').init(options.templateId);
}
// 解析分享信息
if (options.spm) {
$share.decryptSpm(options.spm);
}
// 进入指定页面(完整页面路径)
if (options.page) {
sheep.$router.go(decodeURIComponent(options.page));
}
});
// 下拉刷新
onPullDownRefresh(() => {
sheep.$store('app').init();
setTimeout(function () {
uni.stopPullDownRefresh();
}, 800);
});
onPageScroll(() => {});
</script>
<style lang="scss" scoped>
.uni-margin-wrap {
width: 100%;
position: relative;
}
.swiper {
height: 680rpx;
}
.swiper-item {
display: block;
height: 680rpx;
line-height: 300rpx;
text-align: center;
background: #ffffff;
}
.custom-item {
width: 100%;
height: 100%;
}
.swiper-image {
width: 430rpx;
height: 680rpx;
}
.swiper-item-card {
//width: 92% !important;
height: 100%;
margin: 0 4%;
overflow: hidden;
box-sizing: border-box;
display: flex;
align-items: flex-start;
justify-content: center;
}
.swiper-item-card-margin {
padding: 4% 0;
}
.height1 {
height: 2000px;
}
.swiper-list {
margin-top: 40rpx;
margin-bottom: 0;
}
.uni-common-mt {
margin-top: 60rpx;
position: relative;
}
.info {
position: absolute;
right: 20rpx;
}
.uni-padding-wrap {
width: 550rpx;
padding: 0 100rpx;
}
</style>