feat(f增模特ittingRoom): 新选择与上传功能- 添加模特列表状态管理与当前模特选中逻辑- 实现获取模特列表及切换模特功能
- 新增上传模特图片接口及调用逻辑- 更新模特展示组件,支持动态显示模特缩略图 - 添加获取衣服分类接口及初始化调用- 配置.editorconfig统一代码风格 - 移除调试用的console.log及token写死逻辑 - 修复部分组件引用及生命周期调用问题
This commit is contained in:
@@ -3,7 +3,11 @@
|
||||
<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>
|
||||
<image
|
||||
:src="fittingRoom.currentModel.thumbnailFileUrl"
|
||||
class="item-image"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
</view>
|
||||
<view class="item">
|
||||
<image class="shangchuan" mode="heightFix" src="/static/shangchuan.png"></image>
|
||||
@@ -17,33 +21,36 @@
|
||||
limit="1"
|
||||
mode="grid"
|
||||
@select="selectPic"
|
||||
>选择
|
||||
>选择
|
||||
</uni-file-picker>
|
||||
</view>
|
||||
<view class="item" @click="switchModels">
|
||||
<view v-for="item of fittingRoom.modelList" class="item" @click="switchModels(item)">
|
||||
<view class="item-text"></view>
|
||||
<image class="item-image" mode="widthFix" src="/static/mote.png"></image>
|
||||
<image :src="item.thumbnailFileUrl" class="item-image" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import sheep from '../../../sheep';
|
||||
import FittingRoomApi from '../../../sheep/api/fittingRoom'; // 隐藏
|
||||
const sizeType = ['original'];
|
||||
const imageStyle = {
|
||||
width: 200,
|
||||
height: 50,
|
||||
};
|
||||
|
||||
const fittingRoom = sheep.$store('fittingRoom');
|
||||
console.log(fittingRoom.currentModel);
|
||||
|
||||
function selectPic(...data) {
|
||||
console.log(fittingRoom.tab);
|
||||
console.log('🚀 ~ selectPic 🐶47 ~ data: ', data);
|
||||
FittingRoomApi.uploadModel(data[0].tempFiles[0].path, { sex: fittingRoom.sex }).then(() =>
|
||||
fittingRoom.getModelList(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function switchModels() {
|
||||
console.log("🚀 ~ ~ fittingRoom: ", 12);
|
||||
function switchModels(item) {
|
||||
fittingRoom.switchModels(item);
|
||||
console.log('🚀 ~ ~ fittingRoom: ', item);
|
||||
}
|
||||
|
||||
console.log('🚀 ~ 🐶9 ~ fittingRoom: ', fittingRoom);
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { computed, reactive, onMounted } from 'vue';
|
||||
import { onLoad, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||
import sheep from '@/sheep';
|
||||
import SSelectMote from './components/s-select-mote.vue';
|
||||
@@ -39,7 +39,7 @@
|
||||
import FittingRoomApi from '../../sheep/api/fittingRoom'; // 隐藏原生tabBar
|
||||
|
||||
const fittingRoomStore = sheep.$store('fittingRoom');
|
||||
|
||||
uni.setStorageSync('token', '42be01f1a6c54ea591c991b5da0977c0');
|
||||
sheep.$helper.toast('请选择是否同意协议');
|
||||
// 隐藏原生tabBar
|
||||
uni.hideTabBar({
|
||||
@@ -50,10 +50,11 @@
|
||||
console.log(index, item, '12');
|
||||
}
|
||||
|
||||
fittingRoomStore.getCloths().then((res) => {
|
||||
console.log(res, 'res');
|
||||
onMounted(() => {
|
||||
fittingRoomStore.getCategory();
|
||||
fittingRoomStore.getCloths();
|
||||
fittingRoomStore.getModelList();
|
||||
});
|
||||
|
||||
const state = reactive({
|
||||
info: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user