From b031e6f0a983615dc1be3ae42caf692fcb71e369 Mon Sep 17 00:00:00 2001 From: Fox-33 <1466778434@qq.com> Date: Wed, 2 Apr 2025 18:57:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E9=85=8D=E7=BD=AE=E9=A1=B9?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dForm/index.vue | 6 +- .../authentication/connectAddress/detail.vue | 2 +- otherPages/authentication/connectAddress/index.vue | 19 +++++- .../authentication/examination/baseCompleted.vue | 42 ++++++++----- .../authentication/examination/errorDetail.vue | 9 ++- otherPages/authentication/examination/start.vue | 2 +- otherPages/authentication/serve/index.vue | 21 ++++++- otherPages/binding/grade/index.vue | 38 +++++------- otherPages/binding/list/index.vue | 16 +++-- otherPages/binding/withdrawal/index.vue | 20 ++++-- otherPages/myOrdersManage/bond/index.vue | 14 +++-- otherPages/myOrdersManage/bond/refund.vue | 64 +++++++++++-------- otherPages/myOrdersManage/withdrawal/index.vue | 12 ++-- .../userManage/pet/components/petHealthInfo.vue | 17 ++++-- otherPages/workbenchManage/examNotice/index.vue | 11 +++- .../workbenchManage/myLevel/commponents/myData.vue | 58 ++++++++---------- .../myUser/components/haveOrder.vue | 3 - otherPages/workbenchManage/myUser/index.vue | 15 +++++ .../workbenchManage/myWallet/components/myData.vue | 59 +++++++++--------- pages/userManage/index.scss | 20 +++--- pages/userManage/index.vue | 71 +++++++++++----------- 21 files changed, 315 insertions(+), 204 deletions(-) diff --git a/components/dForm/index.vue b/components/dForm/index.vue index 24ba612..f931e9b 100644 --- a/components/dForm/index.vue +++ b/components/dForm/index.vue @@ -137,6 +137,10 @@ }) } + const setDataByKey = (key, value) => { + formData[key] = value || null + } + const setData = (data) => { list.forEach(item => { const { key } = item @@ -152,7 +156,7 @@ return dFormRef.value.validate() } - defineExpose({ setData, getData, validate }) + defineExpose({ setDataByKey, setData, getData, validate }) \ No newline at end of file diff --git a/otherPages/workbenchManage/examNotice/index.vue b/otherPages/workbenchManage/examNotice/index.vue index 70b908c..7c482b9 100644 --- a/otherPages/workbenchManage/examNotice/index.vue +++ b/otherPages/workbenchManage/examNotice/index.vue @@ -52,13 +52,22 @@ import submitBut from "../../../components/submitBut/index.vue" import tab from "@/plugins/tab"; import {getStorage} from "../../../utils/auth"; import modal from "../../../plugins/modal"; +import { useStore } from 'vuex' + +const store = useStore() + +const configList = computed(() => { + return store.getters.configList +}) onShow(() => { answerCount.value = getStorage("userInfo").answerCount console.log(answerCount.value); }) const type = getStorage("userInfo")?.petType?.split(',') -const sumNum = ref(3) +const sumNum = computed(() => { + return parseInt(configList.value.pet_work_num.paramValueText || 0) +}) const answerCount = ref(0) const typeData = ref( [ diff --git a/otherPages/workbenchManage/myLevel/commponents/myData.vue b/otherPages/workbenchManage/myLevel/commponents/myData.vue index db0f30b..e7aaa3f 100644 --- a/otherPages/workbenchManage/myLevel/commponents/myData.vue +++ b/otherPages/workbenchManage/myLevel/commponents/myData.vue @@ -1,41 +1,29 @@ \ No newline at end of file diff --git a/utils/authorize.js b/utils/authorize.js new file mode 100644 index 0000000..eca6537 --- /dev/null +++ b/utils/authorize.js @@ -0,0 +1,53 @@ + + + +function authorize(scope){ + return new Promise((success, error) => { + uni.authorize({ + /* scope.writePhotosAlbum 类型是保存到相册 */ + scope, + success, + complete(res) { + /* 判断如果没有授权就打开设置选项让用户重新授权 */ + uni.getSetting({ + success(res) { + if (!res.authSetting[scope]) { + setting() + } + } + }); + } + }); + + function setting(){ + uni.showModal({ + title: '当前操作未授权,请授权!', + content: '拒绝授权将影响本小程序部分功能的使用', + confirmText: '授权', + success(e) { + if(!e.confirm){ + return error() + } + uni.openSetting({ + success(res) { + if (!res.authSetting[scope]) { + uni.showToast({ + title: '授权失败', + icon: 'none', + }) + return error() + } + success() + } + }); + } + }) + } + }) +} + + + + + +export default authorize \ No newline at end of file -- 2.15.0