|
|
@@ -10,8 +10,8 @@ |
|
|
|
<view class="avatarBox">
|
|
|
|
<image
|
|
|
|
class="avatar"
|
|
|
|
src="../../assets/img/avatar.png"
|
|
|
|
mode="scaleToFill"
|
|
|
|
:src="userInfoModulesPinia.myAvatar"
|
|
|
|
mode="aspectFill"
|
|
|
|
/>
|
|
|
|
<view @click="chooseAvatar" class="changeAvatar">
|
|
|
|
<image src="../../assets/img/reset.png" mode="aspectFit" />
|
|
|
@@ -20,7 +20,7 @@ |
|
|
|
|
|
|
|
<!-- 金币 -->
|
|
|
|
<view class="coinBox">
|
|
|
|
我的金币: 30
|
|
|
|
我的金币: {{ userInfoModulesPinia.myGlod }}
|
|
|
|
<image src="../../assets/icon/icon.png" mode="scaleToFill" />
|
|
|
|
<text @click="goBuyCoin">购买金币</text></view
|
|
|
|
>
|
|
|
@@ -94,7 +94,7 @@ |
|
|
|
<!-- 显示邀请列表内容 -->
|
|
|
|
<view class="InviteBox" v-show="showListActive == 3">
|
|
|
|
<scroll-view :scroll-y="true" class="showInviteList">
|
|
|
|
<view v-for="item in 9" class="InviteList">
|
|
|
|
<view v-for="item in 9" :key="item" class="InviteList">
|
|
|
|
<up-avatar :src="avatarUrl" size="50"></up-avatar>
|
|
|
|
<view class="info">
|
|
|
|
<view class="name">猕猴桃</view>
|
|
|
@@ -113,7 +113,7 @@ |
|
|
|
<text>金币</text>
|
|
|
|
</view>
|
|
|
|
<scroll-view :scroll-y="true" class="bottom">
|
|
|
|
<view class="OrderListItem" v-for="item in 16">
|
|
|
|
<view class="OrderListItem" v-for="item in 16" :key="item">
|
|
|
|
<view class="name">大西瓜</view>
|
|
|
|
<view class="time">2023/7/29 </view>
|
|
|
|
<view class="coin">-2金币</view>
|
|
|
@@ -126,13 +126,15 @@ |
|
|
|
<script setup>
|
|
|
|
//#region 导入
|
|
|
|
|
|
|
|
import { ref, reactive, computed } from "vue";
|
|
|
|
import { voiceTotalApi } from "../../api/login.js";
|
|
|
|
import { onLoad } from "@dcloudio/uni-app";
|
|
|
|
import { ref, reactive, computed, inject } from "vue";
|
|
|
|
// import App from "../../App.vue";
|
|
|
|
import { findImageApi, findGlodApi, getPhotoListApi } from "../../api/home.js";
|
|
|
|
import { userInfoModules } from "@/store/modules/userInfo";
|
|
|
|
import imageCompression from "browser-image-compression"; //压缩图片插件
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
// 定义,杂项
|
|
|
|
//#region 定义,杂项
|
|
|
|
const userInfoModulesPinia = userInfoModules();
|
|
|
|
const pageClass = computed(() => {
|
|
|
|
if (userInfoModulesPinia.platForm == 1) {
|
|
|
@@ -141,8 +143,9 @@ const pageClass = computed(() => { |
|
|
|
return "page";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// console.log(userInfoModulesPinia.token, "token123123");
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region 头像
|
|
|
|
const avatarUrl = ref(null);
|
|
|
|
function chooseAvatar() {
|
|
|
@@ -210,9 +213,72 @@ function clickTabHandle(e) { |
|
|
|
}
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region 获取写真列表
|
|
|
|
const pageSize = ref(6);
|
|
|
|
const pageNum = ref(1);
|
|
|
|
async function getPhotoList(pageSize, pageNum) {
|
|
|
|
try {
|
|
|
|
const res = await getPhotoListApi(pageSize, pageNum);
|
|
|
|
} catch (error) {}
|
|
|
|
}
|
|
|
|
//#endregion
|
|
|
|
//#region 获取图片,金币,
|
|
|
|
const myAvatar = ref(
|
|
|
|
"https://suimang.oss-accelerate.aliyuncs.com/capi/2023-08-25/03b58cd2f52c49829435addbf1ec435a.jpg?x-oss-process=image/resize,w_10000/quality,q_60"
|
|
|
|
);
|
|
|
|
const myGlod = ref(0);
|
|
|
|
const PhotoList = ref(0);
|
|
|
|
async function findImage() {
|
|
|
|
try {
|
|
|
|
const res = await findImageApi();
|
|
|
|
myAvatar.value = res.data.image;
|
|
|
|
} catch (error) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
async function findGlod() {
|
|
|
|
try {
|
|
|
|
const res = await findGlodApi();
|
|
|
|
if (!res.data) {
|
|
|
|
myGlod.value = 0;
|
|
|
|
} else {
|
|
|
|
myGlod.value = res.data.coin;
|
|
|
|
}
|
|
|
|
} catch (error) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
//#endregion ---------------------------
|
|
|
|
|
|
|
|
//#region 初始化和卸载
|
|
|
|
function init() {
|
|
|
|
if (userInfoModulesPinia.token == 1) {
|
|
|
|
getPhotoList(pageSize.value, pageNum.value);
|
|
|
|
} else {
|
|
|
|
setTimeout(init, 500); // 继续等待 0.5 秒后再次执行函数
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onLoad(async () => {
|
|
|
|
// if (!userInfoModulesPinia.token) {
|
|
|
|
// setTimeout(() => {
|
|
|
|
// onLoad();
|
|
|
|
// }, 500);
|
|
|
|
// return;
|
|
|
|
// } else {
|
|
|
|
// console.log(userInfoModulesPinia.token);
|
|
|
|
|
|
|
|
// }
|
|
|
|
setTimeout(() => {
|
|
|
|
getPhotoList(pageSize.value, pageNum.value);
|
|
|
|
// findImage();
|
|
|
|
// findGlod();
|
|
|
|
// getPhotoList();
|
|
|
|
}, 1000);
|
|
|
|
});
|
|
|
|
|
|
|
|
//#endregion ---------------------------
|
|
|
|
|
|
|
|
//#region
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
//#endregion ---------------------------
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
@@ -387,7 +453,8 @@ function clickTabHandle(e) { |
|
|
|
width: 100%;
|
|
|
|
height: 100rpx;
|
|
|
|
padding: 10rpx 20rpx;
|
|
|
|
background-color: red;
|
|
|
|
// background-color: red;
|
|
|
|
// background-color: #393b3d;
|
|
|
|
z-index: 2;
|
|
|
|
.name {
|
|
|
|
font-weight: 900;
|
|
|
|