This commit is contained in:
Aiden 2024-10-21 09:44:58 +08:00
parent 68f9034042
commit 09bfce6ef5
5 changed files with 33 additions and 5 deletions

View File

@ -6,7 +6,6 @@ export default {
onShow: function () {
console.log("App Show");
console.log(window.location.href);
},
onHide: function () {
console.log("App Hide");

View File

@ -78,7 +78,7 @@ import { closeWebview, hasPermission } from "../../../utils/index.js";
import { onLoad } from "@dcloudio/uni-app";
import useToast from "@/hooks/toast/useToast.js";
import { pbDetail, outbound } from "@/api/login.js";
import { pbDetail, outbound, getRules } from "@/api/login.js";
const { showMessage } = useToast();
const isDetail = ref(false);
const loading = ref(false);
@ -100,6 +100,7 @@ onLoad((options) => {
state.pid = options.pid;
state.boxRelBucketStatus = options.boxRelBucketStatus;
paintingDetail();
getBtngetRules();
});
const paintingDetail = async () => {
loading.value = true;
@ -142,6 +143,15 @@ const runTimeEnv = () => {
return false;
}
};
const getBtngetRules = async () => {
const res = await getRules({});
if (res.status === 0) {
const ruleBtn = res.data.MyButtonAuths?.map((button) => button.Url) || [];
uni.setStorageSync("ruleBtn", ruleBtn);
} else {
showMessage({ type: "error", message: res.msg });
}
};
</script>
<style lang="scss" scoped>

View File

@ -98,7 +98,7 @@
import { ref, reactive, onBeforeMount } from "vue";
import useToast from "@/hooks/toast/useToast.js";
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
import { creChangepainting, add } from "@/api/login.js";
import { creChangepainting, add, getRules } from "@/api/login.js";
import { closeWebview, hasPermission } from "../../../utils/index";
const { showMessage } = useToast();
@ -118,6 +118,7 @@ onLoad((options) => {
state.id = options.id;
state.pid = options.pid;
paintingList();
getBtngetRules();
});
const groupChange = (e) => {
state.tableData.forEach((item) => {
@ -246,6 +247,15 @@ const runTimeEnv = () => {
return false;
}
};
const getBtngetRules = async () => {
const res = await getRules({});
if (res.status === 0) {
const ruleBtn = res.data.MyButtonAuths?.map((button) => button.Url) || [];
uni.setStorageSync("ruleBtn", ruleBtn);
} else {
showMessage({ type: "error", message: res.msg });
}
};
</script>
<style lang="scss" scoped>

View File

@ -248,7 +248,6 @@ const getBtngetRules = async () => {
const res = await getRules({});
if (res.status === 0) {
const ruleBtn = res.data.MyButtonAuths?.map((button) => button.Url) || [];
console.log(123, ruleBtn);
uni.setStorageSync("ruleBtn", ruleBtn);
} else {
showMessage({ type: "error", message: res.msg });

View File

@ -53,7 +53,7 @@
import { ref, reactive, onBeforeMount } from "vue";
import useToast from "@/hooks/toast/useToast.js";
import { onLoad } from "@dcloudio/uni-app";
import { freebox, bind, check_freebox, cancel } from "@/api/login.js";
import { freebox, bind, check_freebox, cancel, getRules } from "@/api/login.js";
import { closeWebview, hasPermission } from "../../../utils/index";
const { showMessage } = useToast();
const loading = ref(false);
@ -72,6 +72,7 @@ onLoad((options) => {
state.id = options.id;
state.pid = options.pid;
bindShelfHole();
getBtngetRules();
});
const bindShelfHole = async () => {
@ -150,6 +151,15 @@ const runTimeEnv = () => {
}
} catch (e) {}
};
const getBtngetRules = async () => {
const res = await getRules({});
if (res.status === 0) {
const ruleBtn = res.data.MyButtonAuths?.map((button) => button.Url) || [];
uni.setStorageSync("ruleBtn", ruleBtn);
} else {
showMessage({ type: "error", message: res.msg });
}
};
</script>
<style lang="scss" scoped>