diff --git a/components/nav-bar/nav-bar.vue b/components/nav-bar/nav-bar.vue
index 89a8e3e..569a585 100644
--- a/components/nav-bar/nav-bar.vue
+++ b/components/nav-bar/nav-bar.vue
@@ -2,35 +2,43 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
- {{ title }}
-
-
-
-
-
-
-
+
+
+
+ {{ title }}
+
+
+
+
+
+
+
+
+
+
+ {{ rightButtonText }}
+
+
-
- {{ rightButtonText }}
-
-
-
-
-
+
+
+
+
+
+
@@ -59,6 +67,10 @@ const props = defineProps({
type: String,
default: '#fff'
},
+ textColor: {
+ type: String,
+ default: '#000'
+ },
title: {
type: String,
default: ''
diff --git a/pages.json b/pages.json
index d48d845..13480fb 100644
--- a/pages.json
+++ b/pages.json
@@ -4,7 +4,7 @@
{
"path": "pages/index/index",
"style": {
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "支付宝模拟器首页",
"navigationStyle": "custom"
}
}
@@ -53,6 +53,16 @@
}
]
},
+ {
+ "root": "pages/ant-credit-pay",
+ "pages": [{
+ "path": "index",
+ "style": {
+ "navigationBarTitleText": "花呗首页",
+ "navigationStyle": "custom"
+ }
+ }]
+ },
{
"root": "pages/common",
"pages": [{
diff --git a/pages/ant-credit-pay/index.vue b/pages/ant-credit-pay/index.vue
new file mode 100644
index 0000000..2e00589
--- /dev/null
+++ b/pages/ant-credit-pay/index.vue
@@ -0,0 +1,525 @@
+
+
+
+
+
+
+
+
+
+
+
+ 花呗|信用购
+
+
+
+
+
+
+
+
+
+ {{ huabeiInfo.mouth }}月应还(元)
+
+ {{ numberUtil.formatMoneyWithThousand(huabeiInfo.money) }}
+
+
+
+ 立即还款
+
+ 分期还款
+ {{ huabeiInfo.installmentBadgeText }}
+
+
+
+
+
+
+ {{ huabeiInfo.descText }}
+
+
+
+
+
+ {{ huabeiInfo.descText }}
+
+
+
+
+
+
+ 总计账单
+ 还款日每月{{ huabeiInfo.dueDate }}日
+
+
+ 总计额度
+ {{
+ numberUtil.formatMoneyWithThousand(Number(huabeiInfo.totalAmount) - Number(huabeiInfo.money)) }}可用
+
+
+
+
+
+
+ 长按替换真实截图
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/common/recharge/index.vue b/pages/common/recharge/index.vue
index 44cb875..9e6e153 100644
--- a/pages/common/recharge/index.vue
+++ b/pages/common/recharge/index.vue
@@ -284,295 +284,594 @@
\ No newline at end of file
diff --git a/pages/index/index.nvue b/pages/index/index.nvue
index 88173d4..a6750d5 100644
--- a/pages/index/index.nvue
+++ b/pages/index/index.nvue
@@ -147,7 +147,7 @@ const menuList = [{
icon: "huabei",
name: "花呗",
isHot: false,
- path: ""
+ path: "/pages/ant-credit-pay/index"
},
]
diff --git a/static/image/ant-credit-pay/service.png b/static/image/ant-credit-pay/service.png
new file mode 100644
index 0000000..d6f7599
Binary files /dev/null and b/static/image/ant-credit-pay/service.png differ
diff --git a/static/image/ant-credit-pay/setting.png b/static/image/ant-credit-pay/setting.png
new file mode 100644
index 0000000..83231fc
Binary files /dev/null and b/static/image/ant-credit-pay/setting.png differ
diff --git a/store/index.js b/store/index.js
index 9e606b5..4cfcb91 100644
--- a/store/index.js
+++ b/store/index.js
@@ -40,24 +40,8 @@ export const store = reactive({
});
-
-
// 定义操作方法
export const useStore = () => {
- // 用户相关操作
- const setUserInfo = (userInfo) => {
- store.userInfo = userInfo;
- };
-
- const clearUserInfo = () => {
- store.userInfo = null;
- };
-
- // 设置相关操作
- const updateSettings = (settings) => {
- store.settings = { ...store.settings, ...settings };
- };
-
// 账单相关操作
const addBill = (bill) => {
store.billList.unshift(bill);
@@ -114,23 +98,11 @@ export const useStore = () => {
{ deep: true }
);
- // 获取系统信息(从缓存读取)
- const getSystemInfo = () => {
- const cachedInfo = uni.getStorageSync('systemInfo')
- if (cachedInfo) {
- store.systemInfo = cachedInfo
- }
- };
-
return {
store,
- setUserInfo,
- clearUserInfo,
- updateSettings,
addBill,
updateBill,
deleteBill,
- getBillList,
- getSystemInfo
+ getBillList
};
};
diff --git a/utils/common.js b/utils/common.js
index 36f1340..6d408e4 100644
--- a/utils/common.js
+++ b/utils/common.js
@@ -140,6 +140,22 @@ export const numberUtil = {
return number.toFixed(decimals);
},
+ /**
+ * 格式化金额,添加千分位并保留两位小数
+ * @param {number|string} val - 金额
+ * @returns {string} 格式化后的金额字符串
+ */
+ formatMoneyWithThousand(val) {
+ let num = Number(val);
+ if (isNaN(num)) {
+ return '0.00';
+ }
+ let str = num.toFixed(2);
+ let parts = str.split('.');
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
+ return parts.join('.');
+ },
+
/**
* 随机数生成
* @param {number} min - 最小值