|
@@ -1,59 +1,121 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <app-view class="mine-generalize" flex>
|
|
|
|
|
|
|
+ <app-view class="mine-generalize">
|
|
|
<template #header>
|
|
<template #header>
|
|
|
<app-navbar title="我的推广" />
|
|
<app-navbar title="我的推广" />
|
|
|
</template>
|
|
</template>
|
|
|
<div class="mine-generalize__header">
|
|
<div class="mine-generalize__header">
|
|
|
- <div class="info">
|
|
|
|
|
- <span>{{ userAccount.refercount }}</span>
|
|
|
|
|
- <h4>推广人数</h4>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="block">
|
|
|
|
|
- <div class="block-left">
|
|
|
|
|
- <h4>当日新增</h4>
|
|
|
|
|
- <span>{{ userAccount.todayrefercount }}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="block-right">
|
|
|
|
|
- <h4>推广编号</h4>
|
|
|
|
|
- <span @click="showQRCode = true">{{ userAccount.refernum }}</span>
|
|
|
|
|
|
|
+ <div class="rank" v-if="userLevelInfo">
|
|
|
|
|
+ <div class="rank-container">
|
|
|
|
|
+ <div class="rank-container__level">
|
|
|
|
|
+ <h1>{{ userLevelInfo.levelgroup }}</h1>
|
|
|
|
|
+ <span>{{ userLevelInfo.checkday }}到期</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="rank-container__next">
|
|
|
|
|
+ <div class="upgrade">
|
|
|
|
|
+ <div class="upgrade-left">
|
|
|
|
|
+ <span>{{ userLevelInfo.appup }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="upgrade-right">
|
|
|
|
|
+ <span>距</span>
|
|
|
|
|
+ <span>{{ userLevelInfo.nextlevelgroup }}</span>
|
|
|
|
|
+ <span>还需</span>
|
|
|
|
|
+ <span>{{ userLevelInfo.notyet }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <Progress :percentage="userLevelInfo.progress * 100" :show-pivot="false" color="#fff"
|
|
|
|
|
+ track-color="rgba(255,255,255,.35)" />
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div class="info">
|
|
|
|
|
+ <ul>
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <h4>推广人数</h4>
|
|
|
|
|
+ <span>{{ userAccount.refercount }}</span>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <h4>当日新增</h4>
|
|
|
|
|
+ <span>{{ userAccount.todayrefercount }}</span>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <h4>推广编号</h4>
|
|
|
|
|
+ <span @click="showQRCode = true">{{ userAccount.refernum }}</span>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <DropdownMenu>
|
|
|
|
|
+ <DropdownItem v-model="selectedMenu" :options="dropdownMenus" @change="onMenuChange" />
|
|
|
|
|
+ <DropdownItem v-model="selectedType" :options="dropdownTypes" />
|
|
|
|
|
+ </DropdownMenu>
|
|
|
</div>
|
|
</div>
|
|
|
- <Tabs class="mine-generalize__tabs">
|
|
|
|
|
- <Tab title="交易数据">
|
|
|
|
|
- <trade-data></trade-data>
|
|
|
|
|
- </Tab>
|
|
|
|
|
- <Tab title="推广收益">
|
|
|
|
|
- <promotion></promotion>
|
|
|
|
|
- </Tab>
|
|
|
|
|
- </Tabs>
|
|
|
|
|
|
|
+ <trade-data :marketid="selectedType" v-if="selectedMenu === 0" />
|
|
|
|
|
+ <promotion :status="selectedType" v-if="selectedMenu === 1" />
|
|
|
<app-qrcode v-model:show="showQRCode" :content="qrContent" :file-name="userAccount.refernum" />
|
|
<app-qrcode v-model:show="showQRCode" :content="qrContent" :file-name="userAccount.refernum" />
|
|
|
</app-view>
|
|
</app-view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, computed } from 'vue'
|
|
import { shallowRef, computed } from 'vue'
|
|
|
-import { Tab, Tabs } from 'vant'
|
|
|
|
|
|
|
+import { DropdownItem, DropdownMenu, Progress } from 'vant'
|
|
|
import { useLoginStore } from '@/stores'
|
|
import { useLoginStore } from '@/stores'
|
|
|
|
|
+import { queryUserLevelInfo } from '@/services/api/common'
|
|
|
import { queryUserAccount } from '@/services/api/account'
|
|
import { queryUserAccount } from '@/services/api/account'
|
|
|
import AppQrcode from '@mobile/components/base/qrcode/index.vue'
|
|
import AppQrcode from '@mobile/components/base/qrcode/index.vue'
|
|
|
import TradeData from './components/tradedata/index.vue'
|
|
import TradeData from './components/tradedata/index.vue'
|
|
|
import Promotion from './components/promotion/index.vue'
|
|
import Promotion from './components/promotion/index.vue'
|
|
|
import { getServiceUrl } from '@/services/http'
|
|
import { getServiceUrl } from '@/services/http'
|
|
|
|
|
+import { Market } from '@/constants/market'
|
|
|
|
|
|
|
|
const { getUserId } = useLoginStore()
|
|
const { getUserId } = useLoginStore()
|
|
|
const showQRCode = shallowRef(false)
|
|
const showQRCode = shallowRef(false)
|
|
|
|
|
+const selectedMenu = shallowRef(0)
|
|
|
|
|
+const selectedType = shallowRef(Market.THJ)
|
|
|
|
|
+const userLevelInfo = shallowRef<Model.UserLevelInfoRsp>()
|
|
|
|
|
|
|
|
const userAccount = shallowRef<Partial<Model.UserAccount>>({
|
|
const userAccount = shallowRef<Partial<Model.UserAccount>>({
|
|
|
todayrefercount: 0,
|
|
todayrefercount: 0,
|
|
|
refercount: 0,
|
|
refercount: 0,
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+const dropdownMenus = [
|
|
|
|
|
+ { text: '交易数据', value: 0 },
|
|
|
|
|
+ { text: '推广收益', value: 1 }
|
|
|
|
|
+]
|
|
|
|
|
+
|
|
|
|
|
+const dropdownTypes = computed(() => {
|
|
|
|
|
+ switch (selectedMenu.value) {
|
|
|
|
|
+ case 0: {
|
|
|
|
|
+ return [
|
|
|
|
|
+ { text: '采购', value: Market.THJ },
|
|
|
|
|
+ { text: '转让', value: 64202 },
|
|
|
|
|
+ { text: '供求', value: Market.THJ_Listing },
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ case 1: {
|
|
|
|
|
+ return [
|
|
|
|
|
+ { text: '全部', value: 0 },
|
|
|
|
|
+ { text: '已支付', value: 1 },
|
|
|
|
|
+ { text: '未支付', value: 2 }
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return []
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
const qrContent = computed(() => {
|
|
const qrContent = computed(() => {
|
|
|
const url = getServiceUrl('mobileOpenUrl')
|
|
const url = getServiceUrl('mobileOpenUrl')
|
|
|
return url + '/#/?code=' + userAccount.value.refernum
|
|
return url + '/#/?code=' + userAccount.value.refernum
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+// 切换菜单
|
|
|
|
|
+const onMenuChange = () => {
|
|
|
|
|
+ if (selectedMenu.value === 0) {
|
|
|
|
|
+ selectedType.value = Market.THJ
|
|
|
|
|
+ } else {
|
|
|
|
|
+ selectedType.value = 0
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
queryUserAccount({
|
|
queryUserAccount({
|
|
|
data: {
|
|
data: {
|
|
|
userID: getUserId()
|
|
userID: getUserId()
|
|
@@ -62,6 +124,15 @@ queryUserAccount({
|
|
|
userAccount.value = res.data
|
|
userAccount.value = res.data
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+queryUserLevelInfo({
|
|
|
|
|
+ data: {
|
|
|
|
|
+ userid: getUserId()
|
|
|
|
|
+ },
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ userLevelInfo.value = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|