diff --git a/App.vue b/App.vue index 285ec8b..35702cc 100644 --- a/App.vue +++ b/App.vue @@ -28,6 +28,13 @@ export default { // 启动完成 console.log(`App 启动耗时: ${Date.now() - startTime}ms`) + + // 初始化埋点,进入支付宝模拟器首页 + this.$apiUserEvent('all', { + type: 'event', + key: 'index', + value: "进入支付宝模拟器首页", + }) }, onShow: function () { @@ -48,17 +55,17 @@ export default { } catch (error) { //TODO handle the exception } - // } else if (event == "jump") { - // if (data == 'pages/index/index' || data == 'pages/contacts/index' || data == - // 'pages/discover/index' || data == 'pages/me/index') { - // uni.switchTab({ - // url: '/' + data - // }); - // } else { - // uni.navigateTo({ - // url: '/' + data - // }); - // } + } else if (event == "jump") { + if (data) { + let pages = getCurrentPages(); + let currentPage = pages[pages.length - 1]; + let currentUrl = currentPage.route; + if (currentUrl != data) { + uni.navigateTo({ + url: '/' + data + }); + } + } } else if (event == 'wx_pay_result' || event == 'ios_pay_result') { this.globalData.recentNativeEvent = event @@ -77,7 +84,7 @@ export default { // 关闭数据库 // #ifdef APP // plus.sqlite.closeDatabase({ name: 'zyds' }) - uni.sendNativeEvent('unimp_stop', "stop", ret => { + uni.sendNativeEvent('unimp_stop_alipay', "stop", ret => { // console.log('宿主App回传的数据:' + ret); }); // #endif diff --git a/common/main.css b/common/main.css index dc7a312..ca4ce53 100644 --- a/common/main.css +++ b/common/main.css @@ -381,6 +381,11 @@ src: url("/static/font/WeChatSansStd-Light.otf"); } +@font-face { + font-family: "sacramento"; + src: url("/static/font/Sacramento-Regular.ttf"); +} + .alipay-font { font-family: "alipayNumber"; } @@ -395,4 +400,8 @@ .wx-font-light { font-family: "wxNumberLight"; +} + +.sacramento-font { + font-family: "sacramento"; } \ No newline at end of file diff --git a/components/custom-tab/custom-tab.vue b/components/custom-tab/custom-tab.vue new file mode 100644 index 0000000..6f03a00 --- /dev/null +++ b/components/custom-tab/custom-tab.vue @@ -0,0 +1,698 @@ + + + + + \ No newline at end of file diff --git a/components/nav-bar/nav-bar.vue b/components/nav-bar/nav-bar.vue index fca60e5..f31f9ed 100644 --- a/components/nav-bar/nav-bar.vue +++ b/components/nav-bar/nav-bar.vue @@ -103,6 +103,10 @@ const props = defineProps({ zIndex: { type: Number, default: 999 + }, + noBack: { + type: Boolean, + default: false } }) @@ -129,6 +133,7 @@ const openPopup = () => { const onBack = () => { emit('back') // 默认返回上一页 + if (props.noBack) return uni.navigateBack() } diff --git a/main.js b/main.js index 77a48d3..efaf17f 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,6 @@ import App from './App' import globalMethods from '@/utils/globalMethods.js'; +import pageData from "@/static/json/page.json" // #ifndef VUE3 import Vue from 'vue' import './uni.promisify.adaptor' @@ -22,10 +23,13 @@ import { export function createApp() { const app = createSSRApp(App) // 从缓存读取系统信息(已在App.vue中获取) + app.config.globalProperties.$pageData = pageData const systemInfo = uni.getStorageSync('systemInfo') || {} app.config.globalProperties.$system = systemInfo.platform == 'ios' ? 'iOS' : 'Android' app.config.globalProperties.$systemInfo = systemInfo - uni.setStorageSync('version', '1.0.0') + uni.setStorageSync('version', '1.0.0.sp2') + app.config.globalProperties.$version = uni.getStorageSync('version') + app.use(globalMethods); return { app diff --git a/pages.json b/pages.json index 79832eb..3801605 100644 --- a/pages.json +++ b/pages.json @@ -70,6 +70,15 @@ } } ] + }, { + "root": "pages/finance-management", + "pages": [{ + "path": "index", + "style": { + "navigationBarTitleText": "理财首页", + "navigationStyle": "custom" + } + }] }, { "root": "pages/common", diff --git a/pages/ant-credit-pay/index.vue b/pages/ant-credit-pay/index.vue index ffd1328..7a5ca83 100644 --- a/pages/ant-credit-pay/index.vue +++ b/pages/ant-credit-pay/index.vue @@ -23,11 +23,11 @@ - + - + 花呗 @@ -38,7 +38,8 @@ - + {{ huabeiInfo.mouth }}月应还(元) {{ huabeiInfo.mouth }}月账单累计中(元) @@ -46,6 +47,7 @@ {{ numberUtil.formatMoneyWithThousand(huabeiInfo.money) }} + 立即还款 + {{ huabeiInfo.descText }} + @@ -84,7 +88,7 @@ + @touchstart="handleTouchStart" @touchend="handleTouchEnd"> @@ -130,16 +134,16 @@ 总计额度 - + 气泡文本 - + 分期气泡 - + 是否分期 @@ -195,6 +199,7 @@ import { } from '@dcloudio/uni-app'; const instance = getCurrentInstance(); +const { proxy } = instance; const buttonGroup = [{ @@ -288,6 +293,12 @@ const onMonthChange = (e) => { } onLoad((option) => { + // 进入花呗页面埋点 + proxy.$apiUserEvent('all', { + type: 'click', + key: 'huabei', + value: "花呗" + }) console.log(option) // 读取缓存 let savedInfo = uni.getStorageSync(data.huabeiInfoStorageKey) @@ -306,7 +317,9 @@ onLoad((option) => { onShow(() => { // #ifdef APP-PLUS util.setAndroidSystemBarColor('#ffffff') - plus.navigator.setStatusBarStyle("light"); + setTimeout(() => { + plus.navigator.setStatusBarStyle("light"); + }, 500) // #endif }) @@ -324,6 +337,14 @@ const closeDialog = () => { // 确认修改 const confirmDialog = () => { + // 校验数据: 本月应还不能大于总计额度 + if (Number(editHuabeiInfo.value.money) > Number(editHuabeiInfo.value.totalAmount)) { + uni.showToast({ + title: '本月应还不能大于总计额度', + icon: 'none' + }) + return + } data.huabeiInfo = JSON.parse(JSON.stringify(editHuabeiInfo.value)) // 保存到缓存 uni.setStorageSync(data.huabeiInfoStorageKey, data.huabeiInfo) @@ -403,8 +424,8 @@ const confirmImage = () => { canvasId: 'crop-canvas', width: canvasW, height: canvasH, - destWidth: canvasW * 2, // 导出更高清 - destHeight: canvasH * 2, + destWidth: sWidth, // 使用原图实际宽度,保持原图清晰度 + destHeight: sHeight, // 使用原图实际高度,保持原图清晰度 success: (res) => { console.log('crop success (temp)', res .tempFilePath) @@ -413,25 +434,18 @@ const confirmImage = () => { uni.saveFile({ tempFilePath: res.tempFilePath, success: (saveRes) => { - console.log( - 'save success (saved)', - saveRes - .savedFilePath) - data.huabeiInfo.image = - saveRes.savedFilePath - selectedImage.value = - '' // 隐藏编辑模式 - + console.log('save success (saved)', saveRes.savedFilePath) + data.huabeiInfo.image = saveRes.savedFilePath + selectedImage.value = '' // 隐藏编辑模式 + setTimeout(() => { + plus.navigator.setStatusBarStyle("light"); + }, 200) // 保存到缓存 - uni.setStorageSync(data - .huabeiInfoStorageKey, - data.huabeiInfo) + uni.setStorageSync(data.huabeiInfoStorageKey, data.huabeiInfo) uni.hideLoading() }, fail: (err) => { - console.error( - 'saveFile fail', - err) + console.error('saveFile fail', err) uni.hideLoading() uni.showToast({ title: '保存失败', @@ -484,10 +498,36 @@ const chooseImage = () => { success: (res) => { selectedImage.value = res.tempFilePaths[0] data.showMask = true + setTimeout(() => { + plus.navigator.setStatusBarStyle("dark"); + }, 500) } }) } +// 长按事件定时器 +let longPressTimer = null +const handleTouchStart = () => { + longPressTimer = setTimeout(() => { + uni.vibrateShort() + chooseImage() + }, 1200) // 长按时间大于1s +} + +const handleTouchEnd = () => { + if (longPressTimer) { + clearTimeout(longPressTimer) + longPressTimer = null + } +} + +const closeImage = () => { + selectedImage.value = '' + data.showMask = false + plus.navigator.setStatusBarStyle("light"); + return false +} + const closeMask = () => { data.showMask = false } @@ -516,11 +556,18 @@ const goBack = () => { align-items: center; padding: 0 20rpx; + .left { + display: flex; + align-items: center; + } + .title { color: #ffffff; font-size: 17px; font-weight: 500; text-align: center; + display: flex; + align-items: center; } .right { diff --git a/pages/ant-credit-pay/overdue-payment/overdue-payment.vue b/pages/ant-credit-pay/overdue-payment/overdue-payment.vue index 3197d2b..ef820b0 100644 --- a/pages/ant-credit-pay/overdue-payment/overdue-payment.vue +++ b/pages/ant-credit-pay/overdue-payment/overdue-payment.vue @@ -7,7 +7,7 @@ - - + - + 花呗 @@ -83,10 +83,10 @@ - 消费记录 + 消费成功{{ Number(huabeiInfo.consumptionAmount).toFixed(2) }}元 - 2025/09/22 + {{ huabeiInfo.consumptionDate }} @@ -117,6 +117,20 @@ 总计额度 + + + 消费金额 + + + + 消费日期 + + {{ editHuabeiInfo.consumptionDate || '请选择日期' }} + + 取消 确定 @@ -139,18 +153,23 @@ import NavBar from '@/components/nav-bar/nav-bar' import { numberUtil, + dateUtil, util } from '@/utils/common.js' import { ref, toRefs, - reactive + reactive, + getCurrentInstance } from 'vue'; import { onLoad, onShow } from '@dcloudio/uni-app'; +const instance = getCurrentInstance(); +const { proxy } = instance; + const buttonGroup = [{ name: "编辑花呗数据", click: () => { @@ -169,7 +188,6 @@ const buttonGroup = [{ } } }] - const serviceList = [{ id: 1, name: "花呗金", @@ -217,7 +235,9 @@ const data = reactive({ installmentBadgeText: '4折起', image: "", isOverdue: false, - daysPastDue: 1 + daysPastDue: 1, + consumptionAmount: 66.5, + consumptionDate: '2025/09/22' }, }) @@ -236,7 +256,18 @@ const onMonthChange = (e) => { editHuabeiInfo.value.mouth = monthRange[e.detail.value] } +const onConsumptionDateChange = (e) => { + // e.detail.value 格式通常为 YYYY-MM-DD,如果需要 YYYY/MM/DD 可以转换 + editHuabeiInfo.value.consumptionDate = e.detail.value.replace(/-/g, '/') +} + onLoad((option) => { + // 进入花呗页面埋点 + proxy.$apiUserEvent('all', { + type: 'click', + key: 'huabei', + value: "花呗" + }) console.log(option) // 读取缓存 let savedInfo = uni.getStorageSync(data.huabeiInfoStorageKey) @@ -255,6 +286,9 @@ onLoad((option) => { onShow(() => { // #ifdef APP-PLUS util.setAndroidSystemBarColor('#F6F6F6') + setTimeout(() => { + plus.navigator.setStatusBarStyle("light"); + }, 500) // #endif }) @@ -272,6 +306,14 @@ const closeDialog = () => { // 确认修改 const confirmDialog = () => { + // 校验数据: 本月应还不能大于总计额度 + if (Number(editHuabeiInfo.value.money) > Number(editHuabeiInfo.value.totalAmount)) { + uni.showToast({ + title: '本月应还不能大于总计额度', + icon: 'none' + }) + return + } data.huabeiInfo = JSON.parse(JSON.stringify(editHuabeiInfo.value)) // 保存到缓存 uni.setStorageSync(data.huabeiInfoStorageKey, data.huabeiInfo) @@ -298,7 +340,8 @@ const goBack = () => { flex-direction: column; background-color: #F6F6F6; height: 100vh; - overflow: hidden; + // overflow: hidden; + padding-bottom: 16rpx; .nav-bar { height: 100%; @@ -314,7 +357,7 @@ const goBack = () => { } .right { - width: 80px; + width: 90px; } .icon { @@ -327,7 +370,7 @@ const goBack = () => { .ios-nav-bar { .left { - width: 80px; + width: 90px; } .title { @@ -338,7 +381,7 @@ const goBack = () => { } .right { - width: 80px; + width: 90px; } } @@ -421,7 +464,7 @@ const goBack = () => { .label { color: #ffffff; - font-size: 30rpx; + font-size: 26rpx; line-height: 42rpx; } @@ -443,6 +486,7 @@ const goBack = () => { background-image: url('/static/image/ant-credit-pay/overdue-payment/overdue-bg.png'); background-size: contain; background-repeat: no-repeat; + margin-top: -1px; .overdue-info { width: 654rpx; @@ -519,7 +563,7 @@ const goBack = () => { } .consumption-box { - margin: 16rpx 24rpx; + margin: 16rpx 24rpx 16rpx; background-color: #ffffff; border-radius: 12rpx; padding: 24rpx 16rpx; diff --git a/pages/balance/index.vue b/pages/balance/index.vue index db2eebf..1c7f4fd 100644 --- a/pages/balance/index.vue +++ b/pages/balance/index.vue @@ -114,7 +114,6 @@ import NavBar from '@/components/nav-bar/nav-bar' import BalanceList from '@/components/balance-list/balance-list.vue' import { fastEntranceList } from '@/static/json/initial.json' - import { util, deviceUtil @@ -128,7 +127,8 @@ import { ref, onMounted, watch, - toRefs + toRefs, + getCurrentInstance } from 'vue' import { @@ -136,6 +136,8 @@ import { onShow } from '@dcloudio/uni-app' +const { appContext, proxy } = getCurrentInstance(); + // 导入状态管理 import { useStore, @@ -179,7 +181,7 @@ const data = reactive({ bgColor: "#00000000" }, statusBarHeight: 0, - balance: 1000000, + balance: 888888, windowHeight: 0, changeDetailList: [], menuList: [], @@ -198,6 +200,13 @@ onLoad(async () => { updateStatusBarHeight() data.windowHeight = await deviceUtil.getWindowHeight() + // 进入余额页面埋点 + proxy.$apiUserEvent('all', { + type: 'click', + key: 'balance', + value: "余额" + }) + }) onShow(() => { @@ -307,6 +316,16 @@ const dialogInputConfirm = () => { data.balance = 999999999.00 } storage.set('balance', data.balance) + + // 修改余额埋点 + proxy.$apiUserEvent('all', { + type: 'event', + key: 'edit_balance', + value: "修改零钱余额", + extra: { + balance: data.balance + } + }) inputDialog.value.close() } diff --git a/pages/bill/bill-list/bill-list.vue b/pages/bill/bill-list/bill-list.vue index 4924d65..e188954 100644 --- a/pages/bill/bill-list/bill-list.vue +++ b/pages/bill/bill-list/bill-list.vue @@ -139,15 +139,20 @@ import { toRefs, onMounted, ref, - computed + computed, + getCurrentInstance } from 'vue' import { useStore } from '@/store/index.js' import { onShow, + onLoad } from '@dcloudio/uni-app' +const instance = getCurrentInstance(); +const { proxy } = instance; + // 存储卡片的 ref const cardRefs = ref([]) @@ -255,6 +260,15 @@ onShow(() => { // #endif }) +onLoad(() => { + // 进入账单页面埋点 + proxy.$apiUserEvent('all', { + type: 'click', + key: 'bill', + value: "账单" + }) +}) + /** * 获取账单列表 */ diff --git a/pages/common/alipay-annual-bill/alipay-annual-bill.vue b/pages/common/alipay-annual-bill/alipay-annual-bill.vue index ecf9caf..d9dcea3 100644 --- a/pages/common/alipay-annual-bill/alipay-annual-bill.vue +++ b/pages/common/alipay-annual-bill/alipay-annual-bill.vue @@ -165,7 +165,8 @@ import { ref, reactive, - toRefs + toRefs, + getCurrentInstance } from 'vue'; import { onLoad, @@ -176,6 +177,9 @@ const statusBarHeight = ref(0); const dialogPopup = ref(null); const timeDialogPopup = ref(null); +const instance = getCurrentInstance(); +const { proxy } = instance; + const data = reactive({ totalMoney: 10000000, time: "", @@ -215,6 +219,12 @@ let { onLoad(() => { + // 进入花呗页面埋点 + proxy.$apiUserEvent('all', { + type: 'click', + key: 'year_in_review', + value: "年度账单" + }) time.value = getYesterday(); statusBarHeight.value = uni.getSystemInfoSync().statusBarHeight; diff --git a/pages/common/recharge/index.vue b/pages/common/recharge/index.vue index 9e6e153..013e4d2 100644 --- a/pages/common/recharge/index.vue +++ b/pages/common/recharge/index.vue @@ -1,20 +1,11 @@