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 等样式类,改善分类和长度选择区域的显示效果。调整单选框的间距和对齐方式,提升用户界面的美观性和可用性。
This commit is contained in:
guigongli
2025-09-27 16:42:34 +08:00
parent b42a66aa49
commit f0cd843f85
8 changed files with 285 additions and 243 deletions
+4
View File
@@ -8,6 +8,10 @@
fail: () => {},
});
window.updateToken=function(newToken) {
console.log('Token updated via global function:', newToken);
uni.setStorageSync('token', newToken);
}
// 加载Shopro底层依赖
ShoproInit();
});
+7 -22
View File
@@ -1,6 +1,6 @@
{
"name" : "商城",
"appid": "__UNI__460BC4C",
"appid" : "__UNI__4143309",
"description" : "基于 uni-app + Vue3 技术驱动的在线商城系统,内含诸多功能与丰富的活动,期待您的使用和反馈。",
"versionName" : "2025.09",
"versionCode" : "183",
@@ -68,10 +68,7 @@
"schemes" : "shopro"
},
"ios" : {
"urlschemewhitelist": [
"baidumap",
"iosamap"
],
"urlschemewhitelist" : [ "baidumap", "iosamap" ],
"dSYMs" : false,
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "需要同意访问您的相册选取图片才能完善该条目",
@@ -82,9 +79,7 @@
"urltypes" : "shopro",
"capabilities" : {
"entitlements" : {
"com.apple.developer.associated-domains": [
"applinks:shopro.sheepjs.com"
]
"com.apple.developer.associated-domains" : [ "applinks:shopro.sheepjs.com" ]
}
},
"idfa" : true
@@ -101,18 +96,12 @@
},
"payment" : {
"weixin" : {
"__platform__": [
"ios",
"android"
],
"__platform__" : [ "ios", "android" ],
"appid" : "wxae7a0c156da9383b",
"UniversalLinks" : "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
},
"alipay" : {
"__platform__": [
"ios",
"android"
]
"__platform__" : [ "ios", "android" ]
}
},
"share" : {
@@ -122,9 +111,7 @@
}
}
},
"orientation": [
"portrait-primary"
],
"orientation" : [ "portrait-primary" ],
"splashscreen" : {
"androidStyle" : "common",
"iosStyle" : "common",
@@ -195,9 +182,7 @@
"lazyCodeLoading" : "requiredComponents",
"usingComponents" : {},
"permission" : {},
"requiredPrivateInfos": [
"chooseAddress"
]
"requiredPrivateInfos" : [ "chooseAddress" ]
},
"mp-alipay" : {
"usingComponents" : true
+22 -4
View File
@@ -1,19 +1,27 @@
<!--
* @Author: liguigong liguigong@shopline.com
* @Date: 2025-09-26 19:17:18
* @LastEditors: liguigong liguigong@shopline.com
* @LastEditTime: 2025-09-26 19:31:15
* @LastEditors:
* @LastEditTime: 2025-09-27 16:38:42
* @FilePath: pages/fittingRoom/components/Clothespic.vue
* @Description: 这是默认设置,可以在设置工具File Description中进行配置
-->
<template>
<view class="clothes-box">
<view></view>
<view v-for="item in fittingRoomStore.currentClothes" class="clothes-pic">
<image class="pic" :src="item.fileUrl" mode="aspectFill"></image>
</view>
<view class="btn" @click="tryItOn">试穿</view>
</view>
</template>
<script setup>
function tryItOn() {}
import sheep from '@/sheep';
const fittingRoomStore = sheep.$store('fittingRoom');
function tryItOn() {
fittingRoomStore.tryOn()
}
</script>
<style lang="scss" scoped>
.clothes-box {
@@ -29,6 +37,16 @@
align-items: center;
justify-content: center;
}
.clothes-pic {
width: 120rpx;
height: 180rpx;
overflow: hidden;
margin-bottom: 16rpx;
}
.pic {
width: 100%;
height: 100%;
}
.btn {
height: 48rpx;
background: #000;
@@ -1,8 +1,8 @@
<!--
* @Author: liguigong liguigong@shopline.com
* @Date: 2025-09-19 16:26:36
* @LastEditors: liguigong liguigong@shopline.com
* @LastEditTime: 2025-09-26 18:21:04
* @LastEditors:
* @LastEditTime: 2025-09-27 16:37:29
* @FilePath: pages/fittingRoom/components/s-grid-clothes.vue
* @Description: 这是默认设置,可以在设置工具File Description中进行配置
-->
@@ -12,10 +12,10 @@
<uni-grid-item
v-for="(item, index) in fittingRoomStore.clothes"
:key="index"
:index="index + 100"
:index="item"
>
<view class="grid-item-box" style="background-color: #fff">
<view v-if="index == 3" class="inUse">
<view v-if="fittingRoomStore.currentClothes.some(v => v.clothId === item.clothId)" class="inUse">
<view class="edit" @click="goEdit(item)">编辑</view>
</view>
@@ -71,7 +71,7 @@
}
function change(e) {
fittingRoomStore.changeClothes();
fittingRoomStore.changeClothes(e.detail.index);
console.log('🚀 ~ change 🐶63 ~ index: ', e.detail.index);
}
</script>
+3 -1
View File
@@ -40,7 +40,7 @@
import Clothespic from './components/Clothespic.vue'; // 隐藏原生tabBar
const fittingRoomStore = sheep.$store('fittingRoom');
uni.setStorageSync('token', '42be01f1a6c54ea591c991b5da0977c0');
sheep.$helper.toast('请选择是否同意协议');
// 隐藏原生tabBar
uni.hideTabBar({
@@ -110,6 +110,8 @@
}
// #endif
uni.setStorageSync('token', options?.token ?? 'e84526c0f7a3457da54e663fb4396beb');
console.log("🚀 ~ URL上的token ~ options?.token: ", options?.token);
// 预览模板
if (options.templateId) {
sheep.$store('app').init(options.templateId);
+1
View File
@@ -81,6 +81,7 @@
function deleteClothes() {
FittingRoomApi.deleteCloth({ id: clothesId.value }).then((res) => {
fittingRoomStore.currentClothes = []
sheep.$router.go('/pages/fittingRoom/index');
});
}
+10 -2
View File
@@ -1,8 +1,8 @@
/**
* @Author: liguigong liguigong@shopline.com
* @Date: 2025-09-23 09:41:10
* @LastEditors: liguigong liguigong@shopline.com
* @LastEditTime: 2025-09-26 17:56:13
* @LastEditors:
* @LastEditTime: 2025-09-27 15:48:31
* @FilePath: sheep/api/fittingRoom/index.js
* @Description: 这是默认设置,可以在设置》工具》File Description中进行配置
*/
@@ -133,6 +133,14 @@ const FittingRoomApi = {
data: data,
});
},
//试穿
tryOnApi: (data) => {
return request({
url: '/digital/on-record/create',
method: 'POST',
data: data,
});
},
addHairApi: (data) => {
return request({
+26 -2
View File
@@ -1,6 +1,7 @@
import { defineStore } from 'pinia';
import app from './app';
import FittingRoomApi from '../api/fittingRoom';
import sheep from '@/sheep';
const _tabsMap = [undefined, 'topCloth', 'bottomCloth', 'dress', 'suit', 'hair'];
@@ -96,7 +97,28 @@ const fittingRoom = defineStore({
let modelList = (httpResponse.result || []).slice(0, 4);
this.modelList = modelList;
this.currentModel = modelList?.[0] ?? {};
this.getTestResults(modelList?.[0].id);
this.getTestResults(modelList?.[0]?.id);
},
// 试穿
async tryOn() {
if (!this.currentModel?.id) {
sheep.$helper.toast('请选择模特');
return
}
if (!this.currentClothes?.[0]?.fileUrl) {
sheep.$helper.toast('请选择衣服');
return
}
const httpResponse = await FittingRoomApi.tryOnApi({
"modelId": this.currentModel.id,
"modelImageUrl": this.currentModel.fileUrl,
"clothingImageUrl": this.currentClothes[0]?.fileUrl,
});
if (httpResponse.code !== 0) {
sheep.$helper.toast(httpResponse.msg);
return
}
this.getTestResults(this.currentModel.id)
},
// 切换模特
switchModels(item) {
@@ -139,7 +161,9 @@ const fittingRoom = defineStore({
this.getCloths();
},
// 点击衣服
changeClothes() {
changeClothes(data) {
console.log("🚀 ~ changeClothes ~ data: ", data);
this.currentClothes = [data];
console.log('切换衣服');
},
},