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


+ 3
- 3
src/pages/lookPhoto/index.vue 查看文件

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


+ 13
- 2
src/pages/uploadPhoto/uploadPhoto.vue 查看文件

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


Loading…
取消
儲存