feat(fittingRoom): 新增试衣间功能
- 添加 fittingRoom 存储模块,用于管理试衣间状态和数据 - 实现试衣间页面布局和基础功能,包括轮播图、标签页、衣服网格等组件 - 开发选择模特和上传衣服功能 - 优化页面样式和交互
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import app from './app';
|
||||
|
||||
const fittingRoom = defineStore({
|
||||
id: 'fittingRoom',
|
||||
state: () => ({
|
||||
visable: false, // 上传模特, 选模特的
|
||||
type: true, // true: 我的衣橱, false: 衣服库
|
||||
tab: 0, // 对应下面tabs的序号
|
||||
tabs: ['全部', '上衣', '下装', '连衣裙', '外套', '发型'],
|
||||
currentClothes: [], // 当前选的衣服
|
||||
}),
|
||||
getters: {
|
||||
// 能上传图片的场景
|
||||
canUpload(state) {
|
||||
console.log(this.type, this.tab, state.type, '123');
|
||||
return this.type && this.tab > 0;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
setVisable(visable) {
|
||||
console.log('🚀 ~ setVisable 🐶15 ~ visable: ', visable);
|
||||
this.visable = visable ?? !this.visable;
|
||||
},
|
||||
changeType(visable) {
|
||||
console.log('🚀 ~ setVisable 🐶15 ~ visable: ', visable);
|
||||
this.type = visable ?? !this.type;
|
||||
},
|
||||
// 点击衣服
|
||||
changeClothes() {
|
||||
console.log('切换衣服');
|
||||
},
|
||||
},
|
||||
persist: {
|
||||
enabled: true,
|
||||
strategies: [
|
||||
{
|
||||
key: 'fittingRoom-store',
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
export default fittingRoom;
|
||||
Reference in New Issue
Block a user