congzc 1 년 전
부모
커밋
50058e8669
3개의 변경된 파일23개의 추가작업 그리고 6개의 파일을 삭제
  1. +7
    -1
      src/pages/index/index.vue
  2. +3
    -3
      src/pages/lookPhoto/index.vue
  3. +13
    -2
      src/pages/uploadPhoto/uploadPhoto.vue

+ 7
- 1
src/pages/index/index.vue 파일 보기

@@ -35,7 +35,7 @@
></view
>
<view class="coinBox" v-if="!userInfoModulesPinia.token"
>还未登录 ,
>登录即可体验更多功能哦!
<text class="goLogin" @click="goLoginHandel">去登录!</text></view
>
<!-- tab栏 -->
@@ -241,6 +241,7 @@ const pageClass = computed(() => {
//#region 头像
const avatarUrl = ref(null);
function chooseAvatar() {
uni.setStorageSync("action", 1);
uni.switchTab({
url: "/pages/uploadPhoto/uploadPhoto",
});
@@ -308,8 +309,13 @@ const tabList = ref([
]);
const showListActive = ref(1);
function clickTabHandle(e) {
if (!userInfoModulesPinia.token) {
return;
}
showListActive.value = e.id;
console.log(e.id, "id");
if (e.id == 1) {
getPhotoList(pageSize1.value, pageNum1.value);
} else if (e.id == 2) {


+ 3
- 3
src/pages/lookPhoto/index.vue 파일 보기

@@ -114,9 +114,9 @@ function downloadImg() {
success: () => {
//提示保存成功
uni.showToast({
mask: true,
title: "保存成功",
duration: 3000,
iconL: "success",
duration: 2000,
});
},
fail: (res2) => {
@@ -130,7 +130,7 @@ function downloadImg() {
},
complete: function () {
//隐藏提示
uni.hideLoading();
// uni.hideLoading();
},
});
}


+ 13
- 2
src/pages/uploadPhoto/uploadPhoto.vue 파일 보기

@@ -81,8 +81,8 @@
<script setup>
//#region 导入
import { ref, reactive } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { ref, reactive, nextTick } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { loginApi } from "../../api/login";
import { addImageApi } from "../../api/uploadphoto.js";
import { userInfoModules } from "@/store/modules/userInfo";
@@ -99,6 +99,7 @@ const showImgData = ref(null); //上传数据
// 点击上传图片
function chooseImage() {
console.log("chooseImage");
// 检查token
if (!userInfoModulesPinia.token) {
uni.showModal({
@@ -351,9 +352,19 @@ onLoad((options) => {
},
});
}
console.log(options);
});
//#endregion ---------------------
onShow(() => {
// 若来自我的页面的更换头像按钮,直接触发以下操作
const action = uni.getStorageSync("action");
if (action == 1) {
chooseImage();
uni.removeStorageSync("action");
}
});
//#region
function goOtherPage(url) {
uni.navigateTo({


불러오는 중...
취소
저장