Bläddra i källkod

upload

master
HolyKnightIX 1 år sedan
förälder
incheckning
9f49c8292d
3 ändrade filer med 22 tillägg och 5 borttagningar
  1. +6
    -0
      src/pages/index/index.vue
  2. +3
    -3
      src/pages/lookPhoto/index.vue
  3. +13
    -2
      src/pages/uploadPhoto/uploadPhoto.vue

+ 6
- 0
src/pages/index/index.vue Visa fil

@@ -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 Visa fil

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


+ 13
- 2
src/pages/uploadPhoto/uploadPhoto.vue Visa fil

@@ -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({


Laddar…
Avbryt
Spara