feat(fittingRoom): 新增试衣间功能

- 添加 fittingRoom 存储模块,用于管理试衣间状态和数据
- 实现试衣间页面布局和基础功能,包括轮播图、标签页、衣服网格等组件
- 开发选择模特和上传衣服功能
- 优化页面样式和交互
This commit is contained in:
liguigong
2025-09-19 19:27:22 +08:00
parent cb434a532c
commit 4ea873c1bd
74 changed files with 7963 additions and 321 deletions
+95
View File
@@ -0,0 +1,95 @@
<!--
* @Author: liguigong liguigong@shopline.com
* @Date: 2025-09-19 16:26:36
* @LastEditors: liguigong liguigong@shopline.com
* @LastEditTime: 2025-09-19 17:56:16
* @FilePath: pages/fittingRoom/components/STabs.vue
* @Description: 这是默认设置,可以在设置工具File Description中进行配置
-->
<template>
<view class="tabContainer">
<view class="tab-top">
<view class="parent-tab" @click="() => fittingRoom.changeType()"
>{{ !fittingRoom.type ? '我的衣橱' : '衣服库' }}
</view>
<view class="title">赴宴试衣间</view>
</view>
<view class="tab-bottom">
<view class="mainTitle"
>{{ fittingRoom.type ? '我的衣橱' : '衣服库' }}
<view class="slash">/</view>
</view>
<v-tabs
v-model="fittingRoom.tab"
:lineScale="0.2"
:tabs="fittingRoom.tabs"
activeColor="#fff"
bgColor="#000000"
color="#fff"
fontSize="24rpx"
height="50rpx"
lineColor="#fff"
lineHeight="2rpx"
paddingItem="0 18rpx"
@change="changeTab"
></v-tabs>
</view>
</view>
</template>
<script setup>
import sheep from '@/sheep';
const fittingRoom = sheep.$store('fittingRoom');
function changeTab(index) {
console.log('当前选中的项:' + index);
}
</script>
<style lang="scss" scoped>
.tabContainer {
height: 130rpx;
background: #000;
width: 100%;
.tab-top {
margin: 18rpx 0 14rpx;
color: rgba(255, 255, 255, 0.5);
display: flex;
align-items: center;
justify-content: center;
position: relative;
.parent-tab {
position: absolute;
font-size: 20rpx;
left: 0;
top: 0;
width: 180rpx;
text-align: center;
}
.title {
font-size: 24rpx;
}
}
.tab-bottom {
display: flex;
align-items: center;
.mainTitle {
flex: 0 0 180rpx;
color: #ffffff;
font-size: 26rpx;
text-align: center;
position: relative;
.slash {
position: absolute;
top: 0;
right: 0;
}
}
}
}
</style>
@@ -0,0 +1,104 @@
<!--
* @Author: liguigong liguigong@shopline.com
* @Date: 2025-09-19 16:26:36
* @LastEditors: liguigong liguigong@shopline.com
* @LastEditTime: 2025-09-19 19:17:22
* @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 7" :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">编辑</view>
</view>
<template v-if="fittingRoom.canUpload && index === 0">
<image
class="clothes"
mode="aspectFill"
src="/static/uploads/1.png"
@click="uploadFile"
></image>
<uni-file-picker
:auto-upload="false"
:del-icon="false"
:disable-preview="true"
:image-styles="imageStyle"
:sizeType="sizeType"
class="upload"
limit="1"
mode="grid"
@select="selectPic"
>选择</uni-file-picker
></template
>
<image v-else class="clothes" mode="aspectFill" src="/static/yifu1.png"></image>
</view>
</uni-grid-item>
</uni-grid>
</view>
</template>
<script setup>
import sheep from '@/sheep';
const fittingRoom = sheep.$store('fittingRoom');
function selectPic(...data) {
console.log(fittingRoom.tab);
console.log('🚀 ~ selectPic 🐶47 ~ data: ', data);
}
function uploadFile() {}
const sizeType = ['original'];
const imageStyle = {
width: 200,
height: 200,
};
function goEdit() {
sheep.$router.go('/pages/report/index', {});
}
function change(e) {
fittingRoom.changeClothes();
console.log('🚀 ~ change 🐶25 ~ 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>
@@ -0,0 +1,79 @@
<!-- 商品信息满减送等营销活动的弹窗 -->
<template>
<view :class="['mote', { unfold: fittingRoom.visable }]">
<view class="item" @click="expansion">
<view class="item-text">模特</view>
<image class="item-image" mode="widthFix" src="/static/mote.png"></image>
</view>
<view class="item">
<image class="shangchuan" mode="heightFix" src="/static/shangchuan.png"></image>
</view>
<view class="item">
<view class="item-text"></view>
<image class="item-image" mode="widthFix" src="/static/mote.png"></image>
</view>
</view>
</template>
<script setup>
import sheep from '../../../sheep';
const fittingRoom = sheep.$store('fittingRoom');
console.log('🚀 ~ 🐶9 ~ fittingRoom: ', fittingRoom);
function expansion(e) {
fittingRoom.setVisable();
}
</script>
<style lang="scss" scoped>
.mote {
position: absolute;
top: 50rpx;
left: 20rpx;
overflow: hidden;
height: 76rpx;
transition: height 0.3s ease-in-out;
}
.unfold {
height: 700rpx;
}
.item {
width: 86rpx;
height: 76rpx;
margin-bottom: 16rpx;
overflow: hidden;
position: relative;
}
.item-text {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
color: #fff;
text-align: center;
//font-family: Molengo;
font-size: 20rpx;
font-style: normal;
font-weight: 400;
display: flex;
align-items: center;
justify-content: center;
line-height: 76rpx;
text-transform: uppercase;
background: rgba(0, 0, 0, 0.5);
z-index: 3;
}
.shangchuan {
width: 86rpx;
height: 76rpx;
}
.item-image {
width: 100%;
height: 100%;
}
</style>