فهرست منبع

feat:客户管理-仪表盘,

ljc 2 ماه پیش
والد
کامیت
34b955fbba

+ 6 - 1
components/cwg-page-wrapper.vue

@@ -8,7 +8,7 @@
     </cwg-match-media>
     <LanguageDropdown style="width: 0;display: none;" />
     <cwg-progress />
-    <view class="page-content">
+    <view class="page-content" :style="{ backgroundColor: bgColor }">
       <cwg-match-media :max-width="991" v-if="!isLoginPage">
         <view class="left-sidebar" :class="{ 'sidebar-visible': sidebarVisible }">
           <cwg-sidebar />
@@ -70,6 +70,11 @@ const props = defineProps({
   isContentPadding: {
     type: Boolean,
     default: true
+  },
+  // 主内容背景颜色
+  bgColor: {
+    type: String,
+    default: ''
   }
 })
 const isDark = computed(() => globalStore.theme === 'dark')

+ 585 - 16
pages/ib/index.vue

@@ -1,23 +1,592 @@
 <template>
-    <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
-        <cwg-header :title="t('Home.page_ib.item1')" />
-        <view class="account-section">
+  <cwg-page-wrapper class="create-page" :isHeaderFixed="true" :bgColor="'#f8f9f9'">
+    <cwg-header :title="t('Home.page_ib.item1')" />
+    <uni-row class="demo-uni-row uni-row1">
+      <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+        <view class="dashboard-container">
+          <!-- 余额卡片 -->
+          <view class="card balance-card">
+            <view class="card-header">
+              <view class="header-left">
+                <cwg-icon name="qbye" :size="24" />
+                <text class="header-title">{{ t('news_add_field.Label.Balance') }}</text>
+              </view>
+              <view class="header-right">
+                <cwg-dropdown :menu-list="menuList" @menuClick="handleMenuClick">
+                  <view class="pc-header-btn">
+                    <cwg-icon name="crm-ellipsis" :size="24" />
+                  </view>
+                </cwg-dropdown>
+              </view>
+            </view>
+            <view class="balance-content">
+              <view class="balance-main">
+                <text class="balance-currency">$</text>
+                <text class="balance-amount">{{ balanceInt }}</text>
+                <text class="balance-decimal">.{{ balanceDecimal }}</text>
+              </view>
+              <view class="total-earnings">
+                <text class="total-label">{{ t('Ib.Index.TotalRevenue') }}</text>
+                <text class="total-value">{{ totalEarnings }}</text>
+              </view>
+            </view>
+          </view>
+
+          <!-- 开户链接 -->
+          <view class="card partner-card">
+            <view class="card-header">
+              <view class="header-left">
+                <cwg-icon name="crm-share-nodes" :size="24" />
+                <text class="header-title">{{ t('Ib.Index.Link') }}</text>
+              </view>
+            </view>
+            <view class="partner-content">
+              <view class="link-area">
+                <button class="link-btn" @click="LinkActivity1">
+                  {{ t('Ib.Index.CreateLink') }}
+                </button>
+                <button class="link-btn" @click="LinkActivity">
+                  {{ t('Ib.Index.CreateLinkActivity') }}
+                </button>
+              </view>
+            </view>
+          </view>
+
+
+          <!-- 名下客户 -->
+          <view class="card custom-card">
+            <view class="card-header">
+              <view class="header-left">
+                <cwg-icon name="crm-custom" :size="24" />
+                <text class="header-title">{{ t('Ib.Index.NameCustom') }}</text>
+              </view>
+            </view>
+            <view class="custom-content">
+              <view class="con" @click="toCustomManagement">
+                <view class="num">
+                  {{ ibData.customAmount }}
+                </view>
+                <view class="des">
+                  {{ t('Ib.Index.Custom') }}
+                </view>
+              </view>
+              <view class="con" @click="toIbManagement">
+                <view class="num">
+                  {{ ibData.ibAmount }}
+                </view>
+                <view class="des">
+                  {{ t('Ib.Index.Agent') }}
+                </view>
+              </view>
+            </view>
+          </view>
+          <!-- 归属推荐码 -->
+          <view class="card code-card">
+            <view class="card-header">
+              <view class="header-left">
+                <text class="header-title">{{ t('Tips.AttributionCode') }}</text>
+                <uni-tooltip placement="top">
+                  <text class="icon-tip">?</text>
+                  <template v-slot:content>
+                    <view style="width: 100px;">
+                      {{ t('Tips.tips') }}
+                    </view>
+                  </template>
+                </uni-tooltip>
+              </view>
+            </view>
+            <view class="code-content">
+              <uni-easyinput class="code-input" :disabled="true" v-model="getInfoId" :clearable="false"></uni-easyinput>
+              <button class="link-btn">{{ t('Ib.Index.Copy') }}</button>
+            </view>
+          </view>
         </view>
-    </cwg-page-wrapper>
+      </uni-col>
+    </uni-row>
+
+    <!-- 二维码弹窗 -->
+    <uni-popup ref="linkPopup" type="center" :mask-click="false">
+      <view class="dia-content">
+        <view class="content" style="font-size: 14px; text-align: left">
+          <view class="label">{{ t("Ib.Index.Spread5") }} :</view>
+          <uni-data-select
+            v-model="excludeShowLoginTypes"
+            :multiple="true"
+            :localdata="excludeList"
+            :placeholder="t('placeholder.choose')"
+            style="width: 100%"
+          />
+
+          <view class="label">{{ t("Ib.Index.Spread4") }} :</view>
+          <uni-data-select
+            v-model="selectedSpreadId"
+            :localdata="spreadList.map(item => ({
+          value: item.id,
+          text: t('Ib.Index.Commission') + ':' + item.comPoint +
+            (levelNum === 1 ? '-' + t('Ib.Index.Hide') + ':' + item.hide :
+            (fixedHide === 1 ? '' : '-' + t('Ib.Index.Hide') + ':' + item.hide))
+        }))"
+            :placeholder="t('placeholder.choose')"
+            style="width: 100%"
+          />
+
+          <view class="label">{{ t('Ib.Index.IbInvalid') }}</view>
+          <uni-data-select
+            v-model="ibInvalid"
+            :localdata="[
+          { value: 'B0', text: t('Ib.Custom.Allow') },
+          { value: 'B1', text: t('Ib.Custom.NotAllow') }
+        ]"
+            :placeholder="t('placeholder.choose')"
+            style="width: 100%"
+          />
+
+          <view>
+            <text style="line-height: 1.5">{{ t('ApplicationDialog.item1') }}</text>
+          </view>
+
+          <view>
+            <text style="line-height: 1.5">{{ t('ApplicationDialog.item2') }}</text>
+            <navigator
+              :url="country == 'NG' || country == 'TH' || country == 'LA' || isAfterJuly7()
+            ? `pdf/pdf6/all/Account Type Allocation Table - ${lang}.pdf`
+            : `pdf/pdf6/no/Account Type Allocation Table-${lang}.pdf`"
+              target="_blank"
+            >
+              {{ t('ApplicationDialog.item3') }}
+            </navigator>
+          </view>
+
+          <view class="btn">
+            <text
+              class="crm-cursor"
+              @click="CreateLink"
+            >{{ t('Ib.Index.CreateLink') }}</text>
+          </view>
+
+          <view class="link qrCode" v-if="link">
+            <QrCode
+              ref="qrCode"
+              :text="link"
+              :width="200"
+              :height="200"
+            />
+            <view class="btn">
+              <text
+                class="crm-cursor"
+                style="height: 16px"
+                @click="downloadQrCode"
+              >{{ t('Btn.item9') }}</text>
+            </view>
+          </view>
+
+          <view class="link">
+            <uni-easyinput
+              readonly
+              v-model="link"
+              placeholder=""
+              id="custom_link"
+            />
+            <view class="btn">
+              <text
+                class="crm-cursor"
+                @click="CopyShareLink('custom_link')"
+              >{{ t('Ib.Index.Copy') }}</text>
+            </view>
+          </view>
+        </view>
+      </view>
+    </uni-popup>
+  </cwg-page-wrapper>
 </template>
 
-<script setup lang="ts">
-import { ref, reactive, computed, onMounted, onUnmounted } from 'vue'
-import { onLoad } from '@dcloudio/uni-app'
-import { useI18n } from 'vue-i18n' // uni-app 中已集成,但需配置
-import { customApi } from '@/service/custom'
-import { financialApi } from '@/service/financial'
-import Config from '@/config/index'
-import AddBankDialog from '@/components/AddBankDialog.vue';
-import PaymentMethodsList from './components/PaymentMethodsList.vue'
-const { t, locale } = useI18n()
-const isZh = computed(() => ['cn', 'zhHant'].includes(locale.value))
+<script setup>
+  import { ref, computed, watch, onMounted } from 'vue'
+  import { useI18n } from 'vue-i18n'
+  import useRouter from '@/hooks/useRouter'
+  import {ibApi} from '@/service/ib'
+  import config from '@/config/index'
+
+  const { t } = useI18n()
+  const router = useRouter()
+  const {Code } = config
+  // 数据
+  const balanceInt = ref(0)
+  const balanceDecimal = ref('00')
+  const totalEarnings = ref(0.00)
+  const partnerLink = ref('https://one.exnessonelink.com/a/plokue4yj3')
+  const partnerCode = ref('PLOKUE4YJ3')
+  const activeTab = ref('link') // 'link' 或 'code'
+  const getInfoId = ref('123123')
+  const ibData = ref({
+      customAmount: "",
+      ibAmount: "",
+    }
+  )
+  const spreadList = ref()
+  const pammManagerValid = ref()
+  const menuList = ref([
+    {label: t('Custom.Index.Withdrawals'),type: 1},
+    {label: t('Custom.Index.Transfer'),type: 2},
+  ])
+
+  // 开户链接
+  const linkPopup = ref(null)
+  const qrSize = ref(200)
+
+  // 显示内容
+  const displayContent = computed(() => {
+    return activeTab.value === 'link' ? partnerLink.value : partnerCode.value
+  })
+
+  // 复制内容
+  const handleCopy = () => {
+    uni.setClipboardData({
+      data: displayContent.value,
+      success: () => {
+        uni.showToast({
+          title: '复制成功',
+          icon: 'success',
+        })
+      },
+      fail: () => {
+        uni.showToast({
+          title: '复制失败',
+          icon: 'none',
+        })
+      },
+    })
+  }
+
+  // 查看所有合作伙伴链接
+  const handleViewAllLinks = () => {
+    // 根据实际路由配置跳转,此处示例为复制提示或跳转内部页面
+    uni.navigateTo({
+      url: '/pages/promo/registration_tools/links',
+      fail: () => {
+        uni.showToast({
+          title: '页面开发中,敬请期待',
+          icon: 'none',
+        })
+      },
+    })
+  }
+  const loginTypeList = async () => {
+    const res = await ibApi.loginTypeList(
+      {
+        page:{
+          current: 1,
+          row: 100
+        }
+      }
+    )
+    if (res.code === Code.StatusOK) {
+      spreadList.value = res.data
+    }else {
+      uni.showToast(res.msg)
+    }
+  }
+  // 生成开户链接
+  const LinkActivity1 = () => {
+    linkPopup.value.open()
+  }
+  // 生成活动分享链接
+  const LinkActivity = () => {
+    // 根据实际路由配置跳转,此处示例为复制提示或跳转内部页面
+    uni.navigateTo({
+      url: '/pages/promo/registration_tools/links',
+      fail: () => {
+        uni.showToast({
+          title: '页面开发中,敬请期待',
+          icon: 'none',
+        })
+      },
+    })
+  }
+  const handleMenuClick = ({value})=>{
+    console.log(value.type)
+    if (value.type === 1) {
+      toWithdraw()
+    }else {
+      toTransfer()
+    }
+  }
+
+  const toWithdraw = () => {
+    router.push({
+      path: '/pages/ib/withdraw',
+    }
+    )
+  }
+  const toTransfer = () => {
+    router.push({
+      path: '/pages/ib/transfer',
+    }
+    )
+  }
+  const toCustomManagement = () => {
+    router.push({
+      path: '/pages/ib/customer',
+      query: {  type: 3 }
+    }
+    )
+  }
+  const toIbManagement = () => {
+    router.push({
+      path: '/pages/ib/customer',
+      query: {  type: 2 }
+    }
+    )
+  }
+  const getIbData = async () => {
+    const res = await ibApi.IbData()
+    if (res.code === Code.StatusOK) {
+      if (res.data != null)
+      ibData.value = res.data
+    }else {
+      uni.showToast(res.msg)
+    }
+  }
+  const getPammManagerValid = async () => {
+    const res = await ibApi.mamApplyPammManagerValid()
+    if (res.code === Code.StatusOK) {
+      if (res.data != null)
+        pammManagerValid.value = res.data
+    }else {
+      uni.showToast(res.msg)
+    }
+  }
+
+  onMounted(() => {
+    // 初始化数据
+    getIbData()
+    getPammManagerValid()
+  })
+
 </script>
+
 <style lang="scss" scoped>
-@import "@/uni.scss";
+  @import "@/uni.scss";
+
+  .dashboard-container {
+    min-height: 100vh;
+    box-sizing: border-box;
+  }
+
+  /* 卡片通用样式 */
+  .card {
+    background: var(--color-white);
+    color: #333;
+    padding: px2rpx(12) px2rpx(16);
+    border-radius: 4px;
+    margin-bottom: px2rpx(20);
+    box-shadow: 0 px2rpx(4) px2rpx(12) rgba(0, 0, 0, 0.2);
+  }
+
+  .card-header {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: px2rpx(12);
+  }
+
+  .header-left {
+    display: flex;
+    align-items: center;
+    gap: 12rpx;
+  }
+
+  .header-title {
+    font-size: px2rpx(14);
+    font-weight: 600;
+  }
+
+  .header-right {
+    display: flex;
+    align-items: center;
+  }
+
+  .action-btn {
+    background: #ffde02;
+    border: none;
+    border-radius: 50%;
+    width: px2rpx(32);
+    height: px2rpx(32);
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    padding: 0;
+    margin: 0;
+
+    &:after {
+      border: none;
+    }
+  }
+
+  /* 余额区域 */
+  .balance-content {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    gap: 16rpx;
+  }
+
+  .balance-main {
+    display: flex;
+    align-items: baseline;
+    flex-wrap: wrap;
+  }
+
+  .balance-amount {
+    font-size: px2rpx(20);
+    font-weight: 700;
+    line-height: 1;
+  }
+
+  .balance-decimal {
+    font-size: px2rpx(16);
+    font-weight: 500;
+    line-height: 1;
+  }
+
+  .balance-currency {
+    font-size: px2rpx(16);
+    font-weight: 500;
+  }
+
+  .total-earnings {
+    display: flex;
+    gap: 12px;
+    color: rgba(20, 29, 34, 0.6);
+    font-size: px2rpx(12);
+  }
+
+  .total-value {
+  }
+
+  /* 合作伙伴卡片 */
+  .partner-content {
+    display: flex;
+    flex-direction: column;
+    gap: 12px;
+  }
+
+  .link-area {
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: space-around;
+    align-items: center;
+    gap: 12px;
+  }
+
+  .link-btn {
+    height: px2rpx(32);
+    background-color: rgb(108, 133, 149);
+    line-height: px2rpx(32);
+    color: var(--color-white);
+    border-radius: px2rpx(16);
+    font-size: px2rpx(14);
+    margin: 0;
+  }
+
+  .code-content {
+    display: flex;
+    justify-content: center;
+  }
+
+  .code-input {
+    width: 50%;
+    max-width: px2rpx(178);
+    margin-right: px2rpx(20);
+  }
+
+  .custom-content {
+    display: flex;
+    justify-content: center;
+    justify-content: space-around;
+    flex-wrap: wrap;
+
+    .con {
+      cursor: pointer;
+      text-align: center;
+      font-size: px2rpx(16);
+      margin: 5px;
+    }
+
+    .num {
+      font-weight: bold;
+    }
+
+    .des {
+      margin-top: px2rpx(5);
+
+    }
+  }
+
+
+  /* 知识库卡片 */
+  .knowledge-content {
+    padding: 8rpx 0;
+  }
+
+  .knowledge-text {
+    font-size: 28rpx;
+    line-height: 1.5;
+    text-decoration: underline;
+    text-decoration-color: rgba(255, 255, 255, 0.4);
+  }
+
+  /* 二维码弹窗样式 */
+  .qr-modal {
+    width: 560rpx;
+    background: #1e1e2a;
+    border-radius: 32rpx;
+    overflow: hidden;
+  }
+
+  .qr-header {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 24rpx 32rpx;
+    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
+  }
+
+  .qr-title {
+    font-size: 32rpx;
+    font-weight: 600;
+  }
+
+  .qr-close {
+    font-size: 48rpx;
+    color: rgba(255, 255, 255, 0.6);
+    line-height: 1;
+    cursor: pointer;
+  }
+
+  .qr-body {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    padding: 32rpx;
+  }
+
+  .qr-canvas {
+    width: 400rpx;
+    height: 400rpx;
+    background: #fff;
+    border-radius: 16rpx;
+  }
+
+  .qr-footer {
+    padding: 24rpx 32rpx;
+    border-top: 1px solid rgba(255, 255, 255, 0.1);
+    text-align: center;
+  }
+
+  .qr-tip {
+    font-size: 24rpx;
+    color: rgba(255, 255, 255, 0.6);
+    word-break: break-all;
+  }
 </style>

+ 2 - 1
pages/mine/improveImmediately.vue

@@ -461,7 +461,8 @@
               </view>
               <view class="con-box">
                 <view class="box">
-                  <image class="mobile" :src="icon_mobile" />
+                  <cwg-icon name="icon_mobile" :size="50"/>
+<!--                  <image class="mobile" :src="icon_mobile" />-->
                   <image class="arrow" :src="icon_arrowR" />
                   <image
                     class="img_mobile"

+ 1 - 0
static/icons/crm-custom.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M240 192C240 147.8 275.8 112 320 112C364.2 112 400 147.8 400 192C400 236.2 364.2 272 320 272C275.8 272 240 236.2 240 192zM448 192C448 121.3 390.7 64 320 64C249.3 64 192 121.3 192 192C192 262.7 249.3 320 320 320C390.7 320 448 262.7 448 192zM144 544C144 473.3 201.3 416 272 416L368 416C438.7 416 496 473.3 496 544L496 552C496 565.3 506.7 576 520 576C533.3 576 544 565.3 544 552L544 544C544 446.8 465.2 368 368 368L272 368C174.8 368 96 446.8 96 544L96 552C96 565.3 106.7 576 120 576C133.3 576 144 565.3 144 552L144 544z"/></svg>

+ 1 - 0
static/icons/crm-ellipsis.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M96 320C96 289.1 121.1 264 152 264C182.9 264 208 289.1 208 320C208 350.9 182.9 376 152 376C121.1 376 96 350.9 96 320zM264 320C264 289.1 289.1 264 320 264C350.9 264 376 289.1 376 320C376 350.9 350.9 376 320 376C289.1 376 264 350.9 264 320zM488 264C518.9 264 544 289.1 544 320C544 350.9 518.9 376 488 376C457.1 376 432 350.9 432 320C432 289.1 457.1 264 488 264z"/></svg>

+ 1 - 0
static/icons/crm-share-nodes.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M448 256C501 256 544 213 544 160C544 107 501 64 448 64C395 64 352 107 352 160C352 165.4 352.5 170.8 353.3 176L223.6 248.1C206.7 233.1 184.4 224 160 224C107 224 64 267 64 320C64 373 107 416 160 416C184.4 416 206.6 406.9 223.6 391.9L353.3 464C352.4 469.2 352 474.5 352 480C352 533 395 576 448 576C501 576 544 533 544 480C544 427 501 384 448 384C423.6 384 401.4 393.1 384.4 408.1L254.7 336C255.6 330.8 256 325.5 256 320C256 314.5 255.5 309.2 254.7 304L384.4 231.9C401.3 246.9 423.6 256 448 256z"/></svg>

+ 3 - 0
static/scss/global/global.scss

@@ -106,6 +106,7 @@
     --color-warning-focus: #e68200;
     --color-error: #e32326;
     --color-error-focus: #f03000;
+    --color-bg-main: #f8f9f9;
     --text-tiny: .625rem;
     --text-tiny--line-height: .8125rem;
     --text-tiny-plus: .6875rem;
@@ -242,6 +243,8 @@
     --color-error: #e32326;
     --color-error-focus: #f03000;
     --color-gray-second: #6B7188;
+  --color-bg-main: #f8f9f9;
+
     --text-tiny: .625rem;
     --text-tiny--line-height: .8125rem;
     --text-tiny-plus: .6875rem;