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();
});
+144 -159
View File
@@ -1,36 +1,36 @@
{
"name": "商城",
"appid": "__UNI__460BC4C",
"description": "基于 uni-app + Vue3 技术驱动的在线商城系统,内含诸多功能与丰富的活动,期待您的使用和反馈。",
"versionName": "2025.09",
"versionCode": "183",
"transformPx": false,
"app-plus": {
"usingComponents": true,
"nvueCompiler": "uni-app",
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"nvueLaunchMode": "fast",
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
"name" : "商城",
"appid" : "__UNI__4143309",
"description" : "基于 uni-app + Vue3 技术驱动的在线商城系统,内含诸多功能与丰富的活动,期待您的使用和反馈。",
"versionName" : "2025.09",
"versionCode" : "183",
"transformPx" : false,
"app-plus" : {
"usingComponents" : true,
"nvueCompiler" : "uni-app",
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"nvueLaunchMode" : "fast",
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
"safearea": {
"bottom": {
"offset": "none"
"safearea" : {
"bottom" : {
"offset" : "none"
}
},
"modules": {
"Payment": {},
"Share": {},
"VideoPlayer": {},
"OAuth": {}
"modules" : {
"Payment" : {},
"Share" : {},
"VideoPlayer" : {},
"OAuth" : {}
},
"distribute": {
"android": {
"permissions": [
"distribute" : {
"android" : {
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
@@ -64,174 +64,159 @@
"<uses-permission android:name=\"android.permission.WRITE_SMS\"/>",
"<uses-permission android:name=\"android.permission.RECEIVE_USER_PRESENT\"/>"
],
"minSdkVersion": 21,
"schemes": "shopro"
"minSdkVersion" : 21,
"schemes" : "shopro"
},
"ios": {
"urlschemewhitelist": [
"baidumap",
"iosamap"
],
"dSYMs": false,
"privacyDescription": {
"NSPhotoLibraryUsageDescription": "需要同意访问您的相册选取图片才能完善该条目",
"NSPhotoLibraryAddUsageDescription": "需要同意访问您的相册才能保存该图片",
"NSCameraUsageDescription": "需要同意访问您的摄像头拍摄照片才能完善该条目",
"NSUserTrackingUsageDescription": "开启追踪并不会获取您在其它站点的隐私信息,该行为仅用于标识设备,保障服务安全和提升浏览体验"
"ios" : {
"urlschemewhitelist" : [ "baidumap", "iosamap" ],
"dSYMs" : false,
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "需要同意访问您的相册选取图片才能完善该条目",
"NSPhotoLibraryAddUsageDescription" : "需要同意访问您的相册才能保存该图片",
"NSCameraUsageDescription" : "需要同意访问您的摄像头拍摄照片才能完善该条目",
"NSUserTrackingUsageDescription" : "开启追踪并不会获取您在其它站点的隐私信息,该行为仅用于标识设备,保障服务安全和提升浏览体验"
},
"urltypes": "shopro",
"capabilities": {
"entitlements": {
"com.apple.developer.associated-domains": [
"applinks:shopro.sheepjs.com"
]
"urltypes" : "shopro",
"capabilities" : {
"entitlements" : {
"com.apple.developer.associated-domains" : [ "applinks:shopro.sheepjs.com" ]
}
},
"idfa": true
"idfa" : true
},
"sdkConfigs": {
"speech": {},
"ad": {},
"oauth": {
"apple": {},
"weixin": {
"appid": "wxae7a0c156da9383b",
"UniversalLinks": "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
"sdkConfigs" : {
"speech" : {},
"ad" : {},
"oauth" : {
"apple" : {},
"weixin" : {
"appid" : "wxae7a0c156da9383b",
"UniversalLinks" : "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
}
},
"payment": {
"weixin": {
"__platform__": [
"ios",
"android"
],
"appid": "wxae7a0c156da9383b",
"UniversalLinks": "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
"payment" : {
"weixin" : {
"__platform__" : [ "ios", "android" ],
"appid" : "wxae7a0c156da9383b",
"UniversalLinks" : "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
},
"alipay": {
"__platform__": [
"ios",
"android"
]
"alipay" : {
"__platform__" : [ "ios", "android" ]
}
},
"share": {
"weixin": {
"appid": "wxae7a0c156da9383b",
"UniversalLinks": "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
"share" : {
"weixin" : {
"appid" : "wxae7a0c156da9383b",
"UniversalLinks" : "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
}
}
},
"orientation": [
"portrait-primary"
],
"splashscreen": {
"androidStyle": "common",
"iosStyle": "common",
"useOriginalMsgbox": true
"orientation" : [ "portrait-primary" ],
"splashscreen" : {
"androidStyle" : "common",
"iosStyle" : "common",
"useOriginalMsgbox" : true
},
"icons": {
"android": {
"hdpi": "unpackage/res/icons/72x72.png",
"xhdpi": "unpackage/res/icons/96x96.png",
"xxhdpi": "unpackage/res/icons/144x144.png",
"xxxhdpi": "unpackage/res/icons/192x192.png"
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios": {
"appstore": "unpackage/res/icons/1024x1024.png",
"ipad": {
"app": "unpackage/res/icons/76x76.png",
"app@2x": "unpackage/res/icons/152x152.png",
"notification": "unpackage/res/icons/20x20.png",
"notification@2x": "unpackage/res/icons/40x40.png",
"proapp@2x": "unpackage/res/icons/167x167.png",
"settings": "unpackage/res/icons/29x29.png",
"settings@2x": "unpackage/res/icons/58x58.png",
"spotlight": "unpackage/res/icons/40x40.png",
"spotlight@2x": "unpackage/res/icons/80x80.png"
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone": {
"app@2x": "unpackage/res/icons/120x120.png",
"app@3x": "unpackage/res/icons/180x180.png",
"notification@2x": "unpackage/res/icons/40x40.png",
"notification@3x": "unpackage/res/icons/60x60.png",
"settings@2x": "unpackage/res/icons/58x58.png",
"settings@3x": "unpackage/res/icons/87x87.png",
"spotlight@2x": "unpackage/res/icons/80x80.png",
"spotlight@3x": "unpackage/res/icons/120x120.png"
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
}
}
},
"quickapp": {},
"quickapp-native": {
"icon": "/static/logo.png",
"package": "com.example.demo",
"features": [
"quickapp" : {},
"quickapp-native" : {
"icon" : "/static/logo.png",
"package" : "com.example.demo",
"features" : [
{
"name": "system.clipboard"
"name" : "system.clipboard"
}
]
},
"quickapp-webview": {
"icon": "/static/logo.png",
"package": "com.example.demo",
"minPlatformVersion": 1070,
"versionName": "1.0.0",
"versionCode": 100
"quickapp-webview" : {
"icon" : "/static/logo.png",
"package" : "com.example.demo",
"minPlatformVersion" : 1070,
"versionName" : "1.0.0",
"versionCode" : 100
},
"mp-weixin": {
"appid": "wx736793c30c956243",
"setting": {
"urlCheck": false,
"minified": true,
"postcss": true
"mp-weixin" : {
"appid" : "wx736793c30c956243",
"setting" : {
"urlCheck" : false,
"minified" : true,
"postcss" : true
},
"optimization": {
"subPackages": true
"optimization" : {
"subPackages" : true
},
"plugins": {},
"lazyCodeLoading": "requiredComponents",
"usingComponents": {},
"permission": {},
"requiredPrivateInfos": [
"chooseAddress"
]
"plugins" : {},
"lazyCodeLoading" : "requiredComponents",
"usingComponents" : {},
"permission" : {},
"requiredPrivateInfos" : [ "chooseAddress" ]
},
"mp-alipay": {
"usingComponents": true
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu": {
"usingComponents": true
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao": {
"usingComponents": true
"mp-toutiao" : {
"usingComponents" : true
},
"mp-jd": {
"usingComponents": true
"mp-jd" : {
"usingComponents" : true
},
"h5": {
"template": "index.html",
"router": {
"mode": "history",
"base": "/"
"h5" : {
"template" : "index.html",
"router" : {
"mode" : "history",
"base" : "/"
},
"sdkConfigs": {
"maps": {}
"sdkConfigs" : {
"maps" : {}
},
"async": {
"timeout": 20000
"async" : {
"timeout" : 20000
},
"title": "商城",
"optimization": {
"treeShaking": {
"enable": true
"title" : "商城",
"optimization" : {
"treeShaking" : {
"enable" : true
}
}
},
"vueVersion": "3",
"_spaceID": "192b4892-5452-4e1d-9f09-eee1ece40639",
"locale": "zh-Hans",
"fallbackLocale": "zh-Hans"
"vueVersion" : "3",
"_spaceID" : "192b4892-5452-4e1d-9f09-eee1ece40639",
"locale" : "zh-Hans",
"fallbackLocale" : "zh-Hans"
}
+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('切换衣服');
},
},