From 552a006e255170aa48b59ef9a038b9f1909d81aa Mon Sep 17 00:00:00 2001
From: dzc <2388224167@qq.com>
Date: Fri, 17 Apr 2026 14:54:47 +0800
Subject: [PATCH] =?UTF-8?q?feat:=E8=AE=BE=E5=A4=87=E9=AA=8C=E8=AF=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env | 8 +-
src/App.vue | 2 +
src/pages.json | 7 -
src/pages/pay/scanPay.vue | 11 +-
src/pages/root/dashboard.vue | 11 +-
src/pages/root/login.vue | 13 +-
src/pages/root/pwd-login.vue | 14 +-
src/pages/tabbar/cabinet.vue | 15 +-
src/pages/tabbar/canteen.vue | 11 +-
src/pages/tabbar/canteenAnalyse.vue | 11 +-
src/pages/tabbar/coopMerchant.vue | 10 +-
src/pages/tabbar/integrated.vue | 11 +-
src/pages/tabbar/my.vue | 11 +-
src/pages/tabbar/order.vue | 11 +-
src/pages/tabbar/prosperityShop.vue | 10 +-
src/pages/tabbar/prosperityShopMchList.vue | 11 +-
src/pages/tabbar/selfMerchant.vue | 10 +-
src/pages/wallet/recharge.vue | 5 +-
src/sheep/api/user.ts | 8 +
src/sheep/api/wallet.ts | 5 +
.../crud/crud-layout/crud-layout.vue | 44 +-
src/sheep/constant/index.ts | 2 +
src/sheep/constant/write-list.ts | 3 +
.../tm-ui/components/tm-drawer/tm-drawer.vue | 121 +-
.../components/tm-form-item/tm-form-item.vue | 18 +-
.../tm-ui/components/tm-icon/tm-icon.vue | 57 +-
.../tm-ui/components/tm-input/tm-input.vue | 1342 ++++++++---------
27 files changed, 962 insertions(+), 820 deletions(-)
create mode 100644 src/sheep/constant/write-list.ts
diff --git a/.env b/.env
index c26753f..0620042 100644
--- a/.env
+++ b/.env
@@ -17,13 +17,13 @@ VITE_PWD_ENC_KEY='pigxpigxpigxpigx'
VITE_OAUTH2_APP_CLIENT='mini:mini'
# --------------------------- start 开发环境 start ----------------------------------
-VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/api
+# VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/api
# VITE_APP_DEV_SERVICE = http://localhost:9999
-# VITE_APP_DEV_SERVICE = https://dzc-test-1.fy.takin.cc
+VITE_APP_DEV_SERVICE = https://dzc-test-1.fy.takin.cc
# VITE_IMAGE_DEV_PATH = http://localhost:9999
-# VITE_IMAGE_DEV_PATH = https://dzc-test-1.fy.takin.cc/api
-VITE_IMAGE_DEV_PATH = https://stgl.pj.gov.cn/api
+VITE_IMAGE_DEV_PATH = https://dzc-test-1.fy.takin.cc/api
+# VITE_IMAGE_DEV_PATH = https://stgl.pj.gov.cn/api
# ----------------------------- end 开发环境 end ------------------------------------
# --------------------------- start 生产环境 start ----------------------------------
diff --git a/src/App.vue b/src/App.vue
index dcc7a76..e33e79d 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -14,7 +14,9 @@ export default {
console.log("App Launch");
const _this = this;
uni.hideTabBar()
+ // #ifdef MP-WEIXIN
wx.onAppRoute(_this.watchRouter)
+ // #endif
},
onShow() {
console.log("App Show");
diff --git a/src/pages.json b/src/pages.json
index 1d5aaf8..e7ea7da 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -158,13 +158,6 @@
"navigationBarTitleText": "",
"disableScroll": true
}
- },
- {
- "path": "recharge-record",
- "style": {
- "navigationBarTitleText": "充值记录",
- "disableScroll": true
- }
}
]
},
diff --git a/src/pages/pay/scanPay.vue b/src/pages/pay/scanPay.vue
index 7e6f091..779be3b 100644
--- a/src/pages/pay/scanPay.vue
+++ b/src/pages/pay/scanPay.vue
@@ -1,5 +1,5 @@
-
+
¥
@@ -31,7 +31,7 @@
-
+
diff --git a/src/pages/root/login.vue b/src/pages/root/login.vue
index 46a72f4..3155474 100644
--- a/src/pages/root/login.vue
+++ b/src/pages/root/login.vue
@@ -2,7 +2,7 @@
import { ref, reactive } from "vue"
import { onShow } from "@dcloudio/uni-app"
import { constant, router } from "@@/index"
-import { userApi, miniPlatformApi } from "@@/api"
+import { userApi, miniPlatformApi, walletApi } from "@@/api"
import { getAppInfo } from "@@/utils/app"
import { SERVICE_IMAGE } from "@@/constant/index"
import { filePath } from "@@/utils/file"
@@ -57,6 +57,7 @@ const minAppGetphone = async (e) => {
// 查询用户信息
const { data: userData } = await userApi.userInfo()
uni.setStorageSync(constant.storageConstant.USERINFO, userData)
+ await createWallet()
uni.hideLoading()
uni.showToast({ title: "登录成功", icon: "success" })
router.jump("/pages/root/dashboard", {}, 3)
@@ -74,6 +75,16 @@ const doLogin = () => {
}
}
+// 创建钱包
+const createWallet = async () => {
+ try {
+ const { data, code }: any = await walletApi.createTopupWallet()
+ if (code != 0) throw new Error()
+ } catch (error) {
+ console.error("创建钱包意外的错误error:", error)
+ }
+}
+
const affirmConfirm = () => {
state.isAgree = true
}
diff --git a/src/pages/root/pwd-login.vue b/src/pages/root/pwd-login.vue
index 6d69e56..c9cc2e0 100644
--- a/src/pages/root/pwd-login.vue
+++ b/src/pages/root/pwd-login.vue
@@ -2,12 +2,13 @@
import { ref, reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { constant, router } from "@@/index"
-import { userApi } from "@@/api"
+import { userApi, walletApi } from "@@/api"
import { SERVICE_IMAGE } from "@@/constant/index"
import { filePath } from "@@/utils/file"
import AffirmCheck from "@/sheep/components/common/affirm-check.vue"
import AffirmModal from "@/sheep/components/common/affirm-modal.vue"
+import VerifyDeviceImpModel from "@/sheep/components/verify-device-imp-model.vue"
const affirmModalRef = ref()
const state = reactive({
@@ -69,11 +70,22 @@ const doSubmit = async () => {
username: applyForm.username,
password: applyForm.password,
} as GlobalSetting.RememberUser)
+ await createWallet()
uni.hideLoading()
uni.showToast({ title: "登录成功", icon: "none" })
router.jump("/pages/root/dashboard", {}, 3)
}
+// 创建钱包
+const createWallet = async () => {
+ try {
+ const { data, code }: any = await walletApi.createTopupWallet()
+ if (code != 0) throw new Error()
+ } catch (error) {
+ console.error("创建钱包意外的错误error:", error)
+ }
+}
+
const disposeLogin = () => {
applyFormRef.value.submit()
const { isPass } = applyFormRef.value.validate()
diff --git a/src/pages/tabbar/cabinet.vue b/src/pages/tabbar/cabinet.vue
index c2129e7..1df869c 100644
--- a/src/pages/tabbar/cabinet.vue
+++ b/src/pages/tabbar/cabinet.vue
@@ -1,5 +1,5 @@
-
+
@@ -28,21 +28,32 @@
-
+
diff --git a/src/pages/tabbar/canteenAnalyse.vue b/src/pages/tabbar/canteenAnalyse.vue
index 76e94df..bd4e68f 100644
--- a/src/pages/tabbar/canteenAnalyse.vue
+++ b/src/pages/tabbar/canteenAnalyse.vue
@@ -1,5 +1,5 @@
-
+
@@ -79,7 +79,7 @@
-
+
diff --git a/src/pages/tabbar/integrated.vue b/src/pages/tabbar/integrated.vue
index e54ca72..b603cdc 100644
--- a/src/pages/tabbar/integrated.vue
+++ b/src/pages/tabbar/integrated.vue
@@ -1,5 +1,5 @@
-
+
@@ -30,7 +30,7 @@
-
+
diff --git a/src/pages/tabbar/prosperityShop.vue b/src/pages/tabbar/prosperityShop.vue
index 6bd6f1a..ec76e99 100644
--- a/src/pages/tabbar/prosperityShop.vue
+++ b/src/pages/tabbar/prosperityShop.vue
@@ -1,5 +1,5 @@
-
+
@@ -75,12 +75,13 @@ import { hooks, router } from "@/sheep"
import { prosperityShopApi } from "@/sheep/api"
import { onLoad } from "@dcloudio/uni-app"
import { isEmpty } from "radash"
-import { reactive, ref } from "vue"
+import { reactive, ref, onMounted, nextTick } from "vue"
import { filePath } from "@@/utils/file"
import { displayPrice } from "@/sheep/utils/format-money"
import { SERVICE_IMAGE } from "@@/constant/index"
+const crudLayoutRef = ref(null)
const state = reactive({
params: {
keyword: "",
@@ -96,6 +97,11 @@ const query = (page: number, pagesize: number) => {
onLoad(async () => {
})
+onMounted(() => {
+ nextTick(() => {
+ crudLayoutRef.value?.checkVerifyDevice?.()
+ })
+})
// 切换分类
// const doClassify = async (categoryId: string) => {
diff --git a/src/pages/tabbar/prosperityShopMchList.vue b/src/pages/tabbar/prosperityShopMchList.vue
index 9c0a4f5..f102dc3 100644
--- a/src/pages/tabbar/prosperityShopMchList.vue
+++ b/src/pages/tabbar/prosperityShopMchList.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/src/pages/tabbar/selfMerchant.vue b/src/pages/tabbar/selfMerchant.vue
index 2ec727f..09de60f 100644
--- a/src/pages/tabbar/selfMerchant.vue
+++ b/src/pages/tabbar/selfMerchant.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/src/pages/wallet/recharge.vue b/src/pages/wallet/recharge.vue
index 8793047..77a1a90 100644
--- a/src/pages/wallet/recharge.vue
+++ b/src/pages/wallet/recharge.vue
@@ -102,8 +102,7 @@ const doPay = async () => {
}
const toRechargeRecord = () => {
- return
- router.jump("/pages/wallet/recharge-record", { walletId: state.walletId })
+ router.jump("/pages/wallet/detail", { id: state.walletId })
}
@@ -124,7 +123,7 @@ const toRechargeRecord = () => {
¥{{ hooks.useMoney(state.detail.balance) }}
-
+
充值记录
diff --git a/src/sheep/api/user.ts b/src/sheep/api/user.ts
index cf2f307..0f3ac4c 100644
--- a/src/sheep/api/user.ts
+++ b/src/sheep/api/user.ts
@@ -119,6 +119,14 @@ export default {
data,
}),
+ // 判断该设备是否被验证
+ isVerifyDevice: (data: { mobile: string; userId: string }) =>
+ request({
+ url: "/thirdparty/thirdPartyOAth2/is-verify-device",
+ method: "POST",
+ data,
+ }),
+
// 用户注册
register: (data: any) =>
request({
diff --git a/src/sheep/api/wallet.ts b/src/sheep/api/wallet.ts
index 4d94246..7752385 100644
--- a/src/sheep/api/wallet.ts
+++ b/src/sheep/api/wallet.ts
@@ -1,6 +1,11 @@
import request from "@/sheep/utils/request"
export default {
+ createTopupWallet: (): Promise =>
+ request({
+ url: "/wallet/wallet-manage/app/topup-wallet",
+ method: "GET",
+ }),
all: (): Promise =>
request({
url: "/wallet/wallet-manage/app/get-all",
diff --git a/src/sheep/components/crud/crud-layout/crud-layout.vue b/src/sheep/components/crud/crud-layout/crud-layout.vue
index a5aebf2..03986e2 100644
--- a/src/sheep/components/crud/crud-layout/crud-layout.vue
+++ b/src/sheep/components/crud/crud-layout/crud-layout.vue
@@ -1,9 +1,12 @@
@@ -118,6 +157,7 @@ function tabbarChange(index: number) {
borderColor="#DBDDDE" color="#8E8E8E" selected-color="#0094ff" position="fixed" @change="tabbarChange">
+
diff --git a/src/sheep/constant/index.ts b/src/sheep/constant/index.ts
index 64634a0..bf2e42f 100644
--- a/src/sheep/constant/index.ts
+++ b/src/sheep/constant/index.ts
@@ -5,3 +5,5 @@ export { default as storageConstant } from "./storage-constant"
export { default as APPENV } from "./app-env"
export * from "./service-image"
+
+export * from "./write-list"
diff --git a/src/sheep/constant/write-list.ts b/src/sheep/constant/write-list.ts
new file mode 100644
index 0000000..a7c44c7
--- /dev/null
+++ b/src/sheep/constant/write-list.ts
@@ -0,0 +1,3 @@
+export const DEVICE_VERIFY_WRITE_LIST = [
+ "17683843144",
+]
\ No newline at end of file
diff --git a/src/uni_modules/tm-ui/components/tm-drawer/tm-drawer.vue b/src/uni_modules/tm-ui/components/tm-drawer/tm-drawer.vue
index bc8fc08..1260216 100644
--- a/src/uni_modules/tm-ui/components/tm-drawer/tm-drawer.vue
+++ b/src/uni_modules/tm-ui/components/tm-drawer/tm-drawer.vue
@@ -3,8 +3,8 @@ import { ref, computed, onMounted, onBeforeUnmount, watch, PropType, getCurrentI
import { arrayNumberValid, arrayNumberValidByStyleMP, covetUniNumber, arrayNumberValidByStyleBorderColor, linearValid, getUnit, getUid } from "../../libs/tool";
import { getDefaultColor, getDefaultColorObj, getOutlineColorObj, getTextColorObj, getThinColorObj } from "../../libs/colors";
import { useTmConfig } from "../../libs/config";
-import {onLoad, onPageScroll,onReady} from '@dcloudio/uni-app';
-import {$i18n} from "@/uni_modules/tm-ui"
+import { onLoad, onPageScroll, onReady } from '@dcloudio/uni-app';
+import { $i18n } from "@/uni_modules/tm-ui"
/**
* @displayName 抽屉
* @exportName tm-drawer
@@ -12,8 +12,8 @@ import {$i18n} from "@/uni_modules/tm-ui"
* @description 提供四个方向的弹出。
* @constant 平台兼容
* | H5 | uniAPP | 小程序 | version |
- | --- | --- | --- | --- |
- | ☑️| ☑️ | ☑️ | ☑️ | ☑️ | 1.0.0 |
+ | --- | --- | --- | --- |
+ | ☑️| ☑️ | ☑️ | ☑️ | ☑️ | 1.0.0 |
*/
defineOptions({ name: 'TmDrawer' });
const { config } = useTmConfig()
@@ -195,15 +195,15 @@ const props = defineProps({
* 关闭前执行,可以是异步函数,只有当用户点击confirm时才会触发。如果返回false将阻止关闭。true允许关闭。
*/
beforeClose: {
- type: [Function,Boolean] as PropType<() => Promise>,
+ type: [Function, Boolean] as PropType<() => Promise>,
default: true
},
/**
* 是否禁用弹层
*/
disabled: {
- type: Boolean,
- default: false
+ type: Boolean,
+ default: false
},
/**
* 是否禁用teleport(H5平台)
@@ -272,30 +272,30 @@ const teleportElH5 = ref("#app")
const teleportTarget = ref(null)
// #ifdef H5
const getTeleportTarget = () => {
- try {
- // 优先尝试 uni-page
- if (document.querySelector('#uni-page')) {
- return '#uni-page'
- }
- // 备用方案:尝试 app
- if (document.querySelector('#app')) {
- return '#app'
- }
- // 最后备用:body
- return 'body'
- } catch (error) {
- console.warn('Failed to get teleport target:', error)
- return 'body'
- }
+ try {
+ // 优先尝试 uni-page
+ if (document.querySelector('#uni-page')) {
+ return '#uni-page'
+ }
+ // 备用方案:尝试 app
+ if (document.querySelector('#app')) {
+ return '#app'
+ }
+ // 最后备用:body
+ return 'body'
+ } catch (error) {
+ console.warn('Failed to get teleport target:', error)
+ return 'body'
+ }
}
// 检查teleport目标是否可用
const isTeleportTargetValid = (target: string) => {
- try {
- return !!document.querySelector(target)
- } catch {
- return false
- }
+ try {
+ return !!document.querySelector(target)
+ } catch {
+ return false
+ }
}
// #endif
watch(() => props.show, (newVal) => {
@@ -378,27 +378,27 @@ const __height = computed(() => {
})
const _titleFontSize = computed(() => (config.fontSizeScale * 16).toString() + 'px')
const _isDark = computed(() => config.mode == 'dark')
-const setDomHeight = ()=>{
- let sys = uni.getWindowInfo()
- // #ifdef WEB
- _width.value = sys.windowWidth
- _height.value = sys.windowHeight
+const setDomHeight = () => {
+ let sys = uni.getWindowInfo()
+ // #ifdef WEB
+ _width.value = sys.windowWidth
+ _height.value = sys.windowHeight
- windtop.value = sys.windowTop + (_position.value=='bottom'?0:_offset.value)
- windtopReal.value = _position.value=='bottom'?(sys.windowTop +_offset.value):sys.windowTop
- // #endif
- // #ifdef APP
- _width.value = sys.windowWidth
- _height.value = sys.windowHeight
- windtop.value = _offset.value
- // #endif
- safeFooterHeight.value = (sys.safeAreaInsets?.bottom??0) == 0 ? 16 : sys.safeAreaInsets.bottom
+ windtop.value = sys.windowTop + (_position.value == 'bottom' ? 0 : _offset.value)
+ windtopReal.value = _position.value == 'bottom' ? (sys.windowTop + _offset.value) : sys.windowTop
+ // #endif
+ // #ifdef APP
+ _width.value = sys.windowWidth
+ _height.value = sys.windowHeight
+ windtop.value = _offset.value
+ // #endif
+ safeFooterHeight.value = (sys.safeAreaInsets?.bottom ?? 0) == 0 ? 16 : sys.safeAreaInsets.bottom
}
-onMounted(()=>{
+onMounted(() => {
setDomHeight()
- uni.$on('onReady',setDomHeight)
+ uni.$on('onReady', setDomHeight)
lezyShowModal.value = props.lazy ? false : true
// #ifdef H5
nextTick(() => {
@@ -412,17 +412,17 @@ onMounted(()=>{
// 监听页面变化,重新获取teleport目标
onUpdated(() => {
- // #ifdef H5
- if (teleportTarget.value && !isTeleportTargetValid(teleportTarget.value)) {
- teleportTarget.value = getTeleportTarget()
- }
- // #endif
+ // #ifdef H5
+ if (teleportTarget.value && !isTeleportTargetValid(teleportTarget.value)) {
+ teleportTarget.value = getTeleportTarget()
+ }
+ // #endif
})
onBeforeUnmount(() => {
clearTimeout(tid.value)
clearTimeout(tid2.value)
- uni.$off('onReady',setDomHeight)
+ uni.$off('onReady', setDomHeight)
})
const cancelEvt = () => {
@@ -442,8 +442,8 @@ const confirmEvt = async () => {
return;
}
/**
- * 确认时触发
- */
+ * 确认时触发
+ */
emit('confirm')
closeAlert()
}
@@ -504,7 +504,7 @@ const showAlert = () => {
}
function openDrawer() {
- if(_disabled.value) return;
+ if (_disabled.value) return;
showAlert();
}
@@ -561,8 +561,8 @@ export default {
-
-
+
-
+
@@ -655,10 +654,10 @@ export default {
skin="thin" style="margin-right: 16px;flex:1">{{ _cancelText }}
{{
_confirmText
- }}
+ }}
-
+
@@ -692,7 +691,7 @@ export default {
flex-direction: row;
align-items: center;
justify-content: center;
- font-weight: bold;
+ font-weight: bold;
}
.tmDrawertitleBox {
diff --git a/src/uni_modules/tm-ui/components/tm-form-item/tm-form-item.vue b/src/uni_modules/tm-ui/components/tm-form-item/tm-form-item.vue
index 42f3151..5698565 100644
--- a/src/uni_modules/tm-ui/components/tm-form-item/tm-form-item.vue
+++ b/src/uni_modules/tm-ui/components/tm-form-item/tm-form-item.vue
@@ -1,9 +1,9 @@
\ No newline at end of file