diff --git a/src/hooks/useCaptcha.ts b/src/hooks/useCaptcha.ts
index bde4915..1a60e2d 100644
--- a/src/hooks/useCaptcha.ts
+++ b/src/hooks/useCaptcha.ts
@@ -1,11 +1,15 @@
+const baseUrl = import.meta.env.VITE_SERVER_BASEURL
export const useCaptcha = () => {
- const codeUrl = ref('')
+ const t = ref(Date.now())
+
+ const codeUrl = computed(() => {
+ return baseUrl + '/captcha.html?t=' + t.value
+ })
const refreshCode = () => {
- const baseUrl = import.meta.env.VITE_SERVER_BASEURL
- codeUrl.value = baseUrl + '/captcha.html?t=' + Date.now()
+ t.value = Date.now()
}
onMounted(() => {
refreshCode()
})
- return { codeUrl, refreshCode }
+ return { codeUrl, t, refreshCode }
}
diff --git a/src/pages-sub/asset/index.vue b/src/pages-sub/asset/index.vue
index 2c2d054..69f6d33 100644
--- a/src/pages-sub/asset/index.vue
+++ b/src/pages-sub/asset/index.vue
@@ -13,30 +13,40 @@ import { useUserStore } from '@/store'
const userStore = useUserStore()
-const tabList = [
- { label: '我的余额', value: 0 },
- { label: '救济金余额', value: 1 },
- { label: '养老金余额', value: 2 },
- { label: '佣金余额', value: 3 },
-]
+const tabList = computed(() => {
+ return [
+ { label: '我的余额', value: 1, money: userStore.userInfo.money },
+ { label: '救济金余额', value: 2, money: userStore.userInfo.moneyjiu },
+ { label: '养老金余额', value: 3, money: userStore.userInfo.moneyold },
+ { label: '团队佣金余额', value: 4, money: userStore.userInfo.moneyyong },
+ ]
+})
const tabIndex = ref(0)
-const detailInfo = ref({
- point: 1,
- score: 1000,
- suminvest: '10000',
-})
-const { list: assetList } = useListPageRequest((params) =>
- getMyAssetAPI(params).then((res) => {
- detailInfo.value = res.data
- res.data.data = res.data.list
- return res.data
- }),
+const { list: assetList, onReload } = useListPageRequest(
+ (params) =>
+ getMyAssetAPI(params).then((res) => {
+ return res
+ }),
+ {
+ autoRequest: false,
+ },
)
onLoad((options) => {
tabIndex.value = Number(options.tabIndex ?? 0)
})
+watch(
+ () => tabIndex.value,
+ (index) => {
+ onReload({
+ type: unref(tabList)[index].value,
+ })
+ },
+ {
+ immediate: true,
+ },
+)
@@ -44,18 +54,18 @@ onLoad((options) => {
{{ tabItem.label }}
{{ tabList[tabIndex].label }}
- ¥{{ detailInfo.suminvest }}
+ ¥{{ tabList[tabIndex].money }}
【{{ tabList[tabIndex].label }}】明细
diff --git a/src/pages-sub/convert/index.vue b/src/pages-sub/convert/index.vue
index f171323..eda8d94 100644
--- a/src/pages-sub/convert/index.vue
+++ b/src/pages-sub/convert/index.vue
@@ -21,7 +21,9 @@
class="m-15 text-white flex rounded-tl-10 rounded-br-10 justify-between items-center p-15 bg-[linear-gradient(90deg,rgba(59,129,243,0.5),#3B81F3)]"
>
{{ type === 0 ? '养老金' : '团队佣金' }}余额
- {{ userStore.userInfo.money }}
+
+ {{ type === 0 ? userStore.userInfo.moneyold : userStore.userInfo.moneyyong }}
+
@@ -34,7 +36,12 @@
placeholder="转出金额"
class="text-14 text-#333 flex-1"
/>
-
+
全部
@@ -62,7 +69,7 @@
diff --git a/src/pages/invest/index.vue b/src/pages/invest/index.vue
index 49fe437..c8efc62 100644
--- a/src/pages/invest/index.vue
+++ b/src/pages/invest/index.vue
@@ -15,88 +15,129 @@
全部
- 2份
+
+ {{ userStore.userInfo.yanglao + userStore.userInfo.yiliao }}份
+
养老
- 1份
+ {{ userStore.userInfo.yanglao }}份
医疗
- 未保障
+
+ {{ userStore.userInfo.yiliao ? '保障中' : '未保障' }}
+
- 养老
- 医疗
+
+ {{ item.title }}
+
-
-
-
-
- {{ item.name }}
-
- 商业型
- 低风险
-
-
- 此处是产品简介,此处是产品简介,此处是产品简介,此处是产
-
-
-
-
-
- 1.99(%)
- 日收益
-
- |
-
- 365(天)
- 周期
-
-
-
- 购买
-
-
-
-
-
-
-
- 好医保·长期医保(旗舰版)
-
- 此处是产品简介,此处是产品简介,此处是产品简介,此处是产
-
-
-
+
- 查看权益
+
+
+
+ {{ item.name }}
+
+
+ {{ tag }}
+
+
+
+
+
+
+
+ {{ item.dividend }}(%)
+ 日收益
+
+ |
+
+ {{ item.days }}(天)
+ 周期
+
+
+
+ 购买
+
-
- 我要投保
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+ 查看权益
+
+
+ 我要投保
+
-
+
-
+
+
+
+
+
@@ -107,28 +148,37 @@ import WechatIcon from '@/static/images/invest/wechat-icon.png'
import UnionpayIcon from '@/static/images/invest/unionpay-icon.png'
import { getInvestmentListAPI, submitInvestAPI } from '@/service'
import { useUserStore } from '@/store'
-import { mergeStep, showModal } from '@/utils'
+import { getImageUrl, mergeStep, showModal } from '@/utils'
defineOptions({
name: 'Home',
})
-const showPayType = ref(false)
-const panels = ref([
- {
- iconUrl: WechatIcon,
- title: '微信支付',
- },
- {
- iconUrl: AlipayIcon,
- title: '支付宝支付',
- },
- {
- iconUrl: UnionpayIcon,
- title: '银联支付',
- },
-])
-const { list: investmentList } = useListPageRequest(getInvestmentListAPI)
+const tabList = [
+ {
+ value: 1,
+ title: '养老',
+ },
+ {
+ value: 2,
+ title: '医疗',
+ },
+]
+const tabValue = ref(1)
+
+const { list: investmentList, onReload } = useListPageRequest((params) =>
+ getInvestmentListAPI({
+ ...params,
+ type: tabValue.value,
+ }),
+)
+
+watch(
+ () => tabValue.value,
+ () => {
+ onReload()
+ },
+)
const userStore = useUserStore()
@@ -138,9 +188,23 @@ const onGoInvestDetail = () => {
})
}
-const onSelectPayType = ({ item, index }: any) => {
- console.log(item, index)
- alert(item.title)
+const showRightConfig = ref({
+ show: false,
+ data: null,
+})
+watch(
+ () => showRightConfig.value.show,
+ (val) => {
+ if (!val) {
+ showRightConfig.value.data = null
+ }
+ },
+)
+const onShowRights = (item: any) => {
+ showRightConfig.value = {
+ show: true,
+ data: item,
+ }
}
const onInvest = mergeStep(async (item: any) => {
diff --git a/src/pages/invite/index.vue b/src/pages/invite/index.vue
index 37fac74..788336d 100644
--- a/src/pages/invite/index.vue
+++ b/src/pages/invite/index.vue
@@ -13,7 +13,12 @@ import NavBar from '@/components/NavBar.vue'
import VueQrcode from '@chenfengyuan/vue-qrcode'
import { useUserStore } from '@/store'
import Avatar from '@/components/Avatar.vue'
-import { getCommunityMyInviteAPI } from '@/service'
+import {
+ getCommunityInviteFirstAPI,
+ getCommunityInviteRewardAPI,
+ getCommunityMyInviteAPI,
+} from '@/service'
+import { showModal } from '@/utils'
const userStore = useUserStore()
@@ -37,6 +42,61 @@ const { list } = useListPageRequest((params) => {
return res.data
})
})
+
+const inviteInfo = ref(null)
+const loadInviteInfo = async () => {
+ const { data } = await getCommunityInviteFirstAPI()
+ inviteInfo.value = data
+ // inviteInfo.value = {
+ // num: 10,
+ // isuserauth: 1,
+ // realrewards: '200',
+ // jianglitiaojian: {
+ // '10': '3000',
+ // '20': '5000',
+ // '30': '15000',
+ // '40': '30000',
+ // '50': '50000',
+ // },
+ // open: 1,
+ // }
+}
+
+onShow(async () => {
+ await loadInviteInfo()
+})
+const taskList = computed(() => {
+ if (!inviteInfo.value) return []
+
+ const inviteTask = Object.keys(inviteInfo.value.jianglitiaojian)
+ const inviteTaskList = inviteTask.map((key) => ({
+ title: `邀请${key}人(${inviteInfo.value.num}/${key})`,
+ desc: `每月额外领取${inviteInfo.value.jianglitiaojian[key]}元数济金`,
+ level: key,
+ status: Number(inviteInfo.value.num) >= Number(key),
+ open: false,
+ }))
+ // 查找最后一个完成的任务,并设置open为true
+ const lastCompletedTask = inviteTaskList.findLast((item) => item.status)
+ if (lastCompletedTask) {
+ lastCompletedTask.open = inviteInfo.value.open
+ }
+ return [
+ {
+ title: '注册实名',
+ desc: `领取${inviteInfo.value.realrewards}元救济金`,
+ status: inviteInfo.value.isuserauth,
+ open: false,
+ },
+ ...inviteTaskList,
+ ]
+})
+
+async function onGetReward(level) {
+ await getCommunityInviteRewardAPI({ level })
+ showModal('领取成功')
+ await loadInviteInfo()
+}
@@ -72,56 +132,24 @@ const { list } = useListPageRequest((params) => {
- 注册实名
- 领取20000元救济金
-
- 已完成
-
-
-
-
- 邀请10人
- ({{ inviteData.num }}
- /10)
-
- 每月额外领取3000元数济金
-
-
-
- 已完成
-
-
- 领取救济金
-
-
-
-
-
-
- 邀请10人
- (10
- /20)
-
- 每月额外领取3000元数济金
+ {{ item.title }}
+ {{ item.desc }}
已完成
领取救济金
@@ -131,17 +159,17 @@ const { list } = useListPageRequest((params) => {
团队人数
- 3000
+ {{ inviteData.num }}
直推人数
- 团队人数
- 3000
+ 我的佣金
+ {{ inviteData.performance }}
直推业绩
- 团队成员(3/人)
+ 团队成员({{ inviteData.num }}/人)
diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue
index ea7de5b..7392fff 100644
--- a/src/pages/login/index.vue
+++ b/src/pages/login/index.vue
@@ -45,7 +45,7 @@
class="text-right flex-1 text-14"
placeholder="请输入验证码"
/>
- {
@@ -110,7 +110,7 @@ const handleLogin = async () => {
data: {
userinfo: { token },
},
- } = await loginUserAPI(formData.value)
+ } = await loginUserAPI({ ...formData.value, t: captchaT.value })
userStore.setToken(token)
uni.reLaunch({
url: redirect,
diff --git a/src/pages/my/index.vue b/src/pages/my/index.vue
index 416021c..8415b40 100644
--- a/src/pages/my/index.vue
+++ b/src/pages/my/index.vue
@@ -96,9 +96,9 @@
import Avatar from '@/components/Avatar.vue'
import NavBar from '@/components/NavBar.vue'
import { loginRoute } from '@/interceptors/route'
-import { downloadAppAPI } from '@/service'
+import { downloadAppAPI, getSignInAPI } from '@/service'
import { useUserStore } from '@/store/user'
-import { getImageUrl } from '@/utils'
+import { getImageUrl, showModal } from '@/utils'
import CommonIcon1 from '@/static/images/my/common-icon-1.png'
import CommonIcon2 from '@/static/images/my/common-icon-2.png'
@@ -166,7 +166,11 @@ const handleConvert = (type) => {
})
}
-const handleSignIn = () => {}
+const handleSignIn = async () => {
+ await getSignInAPI()
+ showModal('签到成功')
+ userStore.loadUserInfo()
+}
const handleKefu = () => {
uni.navigateTo({
@@ -174,11 +178,17 @@ const handleKefu = () => {
})
}
+const handleInvestDetail = () => {
+ uni.navigateTo({
+ url: '/pages-sub/invest-detail/index',
+ })
+}
+
const commonList = [
{
title: '投保记录',
icon: CommonIcon5,
- handle: handleTeam,
+ handle: handleInvestDetail,
},
{
title: '资金明细',
diff --git a/src/service/index.ts b/src/service/index.ts
index 29adaa3..dcdacae 100644
--- a/src/service/index.ts
+++ b/src/service/index.ts
@@ -96,7 +96,7 @@ export const getMyTeamAPI = (data) =>
// 我的资产
export const getMyAssetAPI = (data) =>
http({
- url: '/api/user/myassets',
+ url: '/api/user/moneyloglist',
method: 'POST',
data,
})
@@ -169,3 +169,41 @@ export const getCommunityInviteFirstAPI = (data) =>
method: 'POST',
data,
})
+
+// 领取救济金
+export const getCommunityInviteRewardAPI = (data) =>
+ http({
+ url: '/api/user/rewardtwo',
+ method: 'POST',
+ data,
+ })
+
+// 签到功能
+export const getSignInAPI = () =>
+ http({
+ url: '/api/user/signin',
+ method: 'POST',
+ })
+
+// 开通个人养老账户
+export const getOpenPersonalAccountAPI = () =>
+ http({
+ url: '/api/user/activateold',
+ method: 'POST',
+ })
+
+// 养老金转入余额
+export const getOldMoneyTransferAPI = (data) =>
+ http({
+ url: '/api/user/yangout',
+ method: 'POST',
+ data,
+ })
+
+// 佣金转入养老金
+export const getYongMoneyTransferAPI = (data) =>
+ http({
+ url: '/api/user/tuanduiout',
+ method: 'POST',
+ data,
+ })