Преглед изворни кода

Merge remote-tracking branch 'origin/dev_czc' into dev

dev_YWQ
congzc пре 1 година
родитељ
комит
bc53872db2
5 измењених фајлова са 73 додато и 10 уклоњено
  1. +2
    -2
      src/api/closeStyle.js
  2. +1
    -1
      src/manifest.json
  3. +50
    -4
      src/pages/closeStyle/closeStyle.vue
  4. +1
    -1
      src/pages/index/index.vue
  5. +19
    -2
      src/pages/lookPhoto/index.vue

+ 2
- 2
src/api/closeStyle.js Прегледај датотеку

@@ -1,9 +1,9 @@
import { request } from "../utils/request"

// 获取风格列表
export function getListApi(pageNum, pageSize) {
export function getListApi(pageNum, pageSize, sex) {
return request({
url: `api/digitalAvatarMould/list?pageNum=${pageNum}&pageSize=${pageSize}`,
url: `api/digitalAvatarMould/list?pageNum=${pageNum}&pageSize=${pageSize}&sex=${sex}`,
method: 'GET',
})
}


+ 1
- 1
src/manifest.json Прегледај датотеку

@@ -71,7 +71,7 @@
"ignoreUploadUnusedFiles": false
},
"usingComponents": true,
"__usePrivacyCheck__": true
"__usePrivacyCheck__": false
},
"h5": {
"title": "",


+ 50
- 4
src/pages/closeStyle/closeStyle.vue Прегледај датотеку

@@ -1,5 +1,14 @@
<template>
<div class="page">
<!-- 性别tab -->
<view class="sexTab">
<view @click="sex = 1" class="sex" :class="sex == 1 ? 'sexActive' : ''"
>男</view
>
<view @click="sex = 2" class="sex" :class="sex == 2 ? 'sexActive' : ''"
>女</view
>
</view>
<u-list
class="styleListBox"
@scrolltolower="scrolltolower"
@@ -25,7 +34,7 @@
<script setup>
//#region 导入
import { onPullDownRefresh } from "@dcloudio/uni-app";
import { ref, reactive } from "vue";
import { ref, reactive, watch } from "vue";
import { getListApi } from "../../api/closeStyle";
//#endregion

@@ -47,19 +56,35 @@ import { getListApi } from "../../api/closeStyle";
//#region 列表加载
const pageNum = ref(1);
const pageSize = ref(20);
const sex = ref(1); //1男2女
const styleList = ref([]);
// 得到列表
async function getList() {
try {
const res = await getListApi(pageNum.value, pageSize.value);
uni.showLoading({
title: "加载中...",
mask: true,
});
const res = await getListApi(pageNum.value, pageSize.value, sex.value);
styleList.value = res.data.list;
uni.hideLoading();
} catch (error) {
uni.hideLoading();
uni.showToast({
title: "获取列表失败,请重试",
icon: "none",
});
}
}
// 监听性别tab变化
watch(
() => sex.value,
(sex) => {
pageNum.value = 1;
pageSize.value = 20;
getList();
}
);
getList();
// 触底加载更多
const scrolltolower = async () => {
@@ -67,10 +92,9 @@ const scrolltolower = async () => {
uni.showLoading({
title: "加载中...",
mask: true,
duration: 2000,
});
pageNum.value += 1;
const res = await getListApi(pageNum.value, pageSize.value);
const res = await getListApi(pageNum.value, pageSize.value, sex.value);
styleList.value.push(...res.data.list);
setTimeout(function () {
uni.hideLoading();
@@ -125,7 +149,29 @@ function createPhoto(item) {
.page {
background-color: #222527;
}
.sexTab {
margin: 20rpx 0;
width: 100%;
height: 60rpx;
display: flex;
justify-content: space-evenly;
line-height: 54rpx;
text-align: center;
.sex {
border-radius: 20rpx;
border: 2rpx solid #ccc;
width: 40%;
}
.sexActive {
color: #ff4f00;
border: 2rpx solid #ff4f00;
transition: all 0.3s;
}
}

.u-list {
overflow: hidden;
height: calc(100vh - 200rpx) !important;
width: 650rpx;
.glodYBox {
display: flex !important;


+ 1
- 1
src/pages/index/index.vue Прегледај датотеку

@@ -397,7 +397,7 @@ function getSymbol(type) {
if ([1, 2, 3].includes(type)) {
return "+";
} else {
return "-";
return "";
}
}
//#endregion 获取图片,金币,


+ 19
- 2
src/pages/lookPhoto/index.vue Прегледај датотеку

@@ -17,7 +17,7 @@
v-if="createState != 2"
class="logo"
src="../../assets/img/logo-4.png"
mode="scaleToFill"
mode="aspectFit"
/>
<view v-if="createState == 2" class="checkMore">左右滑动查看更多</view>
<view v-if="createState != 2" class="wait">生成中,请稍后...</view>
@@ -85,6 +85,7 @@ const previewImageList = ref([]); //预览图片列表
async function getSwiperList() {
const res = await getPhotoListApi(workId.value);
createState.value = res.data.status;
if (res.data.photoList) {
swiperList.value = res.data.photoList;
swiperList.value.forEach((item) => {
@@ -95,6 +96,11 @@ async function getSwiperList() {
}
});
}
if (createState.value != 2) {
setTimeout(() => {
getSwiperList();
}, 3000);
}
}
//#endregion ---------------------
@@ -424,8 +430,19 @@ async function getUserQrcode() {
.logo {
width: 520rpx;
margin: 90rpx;
animation: rotateAnimation 3s 0s infinite;
}
@keyframes rotateAnimation {
0% {
transform: rotate(0deg);
}
66.66% {
transform: rotate(360deg);
}
100% {
transform: rotate(360deg);
}
}
.checkMore,
.wait {
color: #ffffff;


Loading…
Откажи
Сачувај