|
|
@@ -15,8 +15,9 @@ |
|
|
|
<script setup> |
|
|
|
//#region 导入 |
|
|
|
import { ref } from "vue"; |
|
|
|
import { onLoad, onUnload } from "@dcloudio/uni-app"; |
|
|
|
import { isPlainObject, onLoad, onUnload } from "@dcloudio/uni-app"; |
|
|
|
import { userInfoModules } from "@/store/modules/userInfo"; |
|
|
|
|
|
|
|
const userInfoModulesPinia = userInfoModules(); |
|
|
|
//#endregion ---------------------------------- |
|
|
|
|
|
|
@@ -24,9 +25,47 @@ function toChooseStyle() { |
|
|
|
uni.navigateTo({ url: "/pages/chooseStyle/index" }); |
|
|
|
} |
|
|
|
|
|
|
|
const fileReaderTest = () => { |
|
|
|
plus.io.resolveLocalFileSystemURL( |
|
|
|
"file:///storage", |
|
|
|
function (entry) { |
|
|
|
/* 获取文件目录 */ |
|
|
|
var directoryReader = entry.createReader(); //获取读取对象 |
|
|
|
directoryReader.readEntries( |
|
|
|
function (entries) { |
|
|
|
//历遍子目录即可 |
|
|
|
for (var i = 0; i < entries.length; i++) { |
|
|
|
console.log("文件信息:" + entries[i].name); |
|
|
|
uni.showToast({ |
|
|
|
// title: uni.getStorageSync("androidId"), |
|
|
|
title: "文件信息:" + entries[i].name, |
|
|
|
icon: "success", |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
function (err) { |
|
|
|
console.log("访问目录失败"); |
|
|
|
uni.showToast({ |
|
|
|
title: err, |
|
|
|
icon: "error", |
|
|
|
}); |
|
|
|
} |
|
|
|
); |
|
|
|
}, |
|
|
|
function (err) { |
|
|
|
console.log("访问指定目录失败:" + err.message); |
|
|
|
uni.showToast({ |
|
|
|
title: err, |
|
|
|
icon: "error", |
|
|
|
}); |
|
|
|
} |
|
|
|
); |
|
|
|
}; |
|
|
|
|
|
|
|
//#region 初始化 |
|
|
|
onLoad(() => { |
|
|
|
runGetAndroidId(); |
|
|
|
fileReaderTest(); |
|
|
|
userInfoModulesPinia.clearStorage(); |
|
|
|
}); |
|
|
|
//#endregion ---------------------------------- |
|
|
|