Kaynağa Gözat

feat:代理 控制台

ljc 2 ay önce
ebeveyn
işleme
43cae3a8c3
1 değiştirilmiş dosya ile 200 ekleme ve 46 silme
  1. 200 46
      pages/ib/index.vue

+ 200 - 46
pages/ib/index.vue

@@ -118,27 +118,25 @@
           />
 
           <view class="label">{{ t('Ib.Index.Spread4') }} :</view>
-          <uni-data-select
-            v-model="selectedSpreadId"
-            :localdata="spreadList.map(item => ({
+          <cwg-combox
+            v-model:value="selectedSpreadId"
+            :options="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="[
+          <cwg-combox
+            v-model:value="ibInvalid"
+            :options="[
           { value: 'B0', text: t('Ib.Custom.Allow') },
           { value: 'B1', text: t('Ib.Custom.NotAllow') }
         ]"
             :placeholder="t('placeholder.choose')"
-            style="width: 100%"
           />
 
           <view>
@@ -176,7 +174,7 @@
               <button
                 class="crm-cursor"
                 style="height: 16px"
-                @click="downloadQrCode"
+                @click="downloadQrCode()"
               >{{ t('Btn.item9') }}
               </button>
             </view>
@@ -194,6 +192,90 @@
         </view>
       </view>
     </cwg-popup>
+    <!-- 活动链接弹窗 -->
+    <cwg-popup ref="linkActivityPopup" type="center" :title="t('Ib.Index.CreateLinkActiv')" :showFooter="false" showFooterLine>
+      <view class="dia-content">
+        <view class="content" style="font-size: 14px; text-align: left">
+          <view class="label">{{ t('Ib.Index.ChooseActiv') }}</view>
+          <cwg-combox
+            v-model:value="activityLing"
+            :options="agentLinkList.map(item => ({ value: item.link, text: item.name }))"
+            :placeholder="t('Ib.Index.ChooseActiv')"
+          />
+
+          <view class="label">{{ t('Ib.Index.Spread5') }} :</view>
+          <cwg-combox
+            v-model:value="excludeShowLoginTypes"
+            :multiple="true"
+            :options="excludeList"
+            :placeholder="t('placeholder.choose')"
+            @change="handleChange"
+          />
+
+          <view class="label">{{ t('Ib.Index.Spread4') }} :</view>
+          <cwg-combox
+            v-model:value="selectedSpreadId"
+            :options="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')"
+          />
+
+          <view class="label">{{ t('Ib.Index.IbInvalid') }}</view>
+          <cwg-combox
+            v-model:value="ibInvalid"
+            :options="[
+          { value: 'B0', text: t('Ib.Custom.Allow') },
+          { value: 'B1', text: t('Ib.Custom.NotAllow') }
+        ]"
+            :placeholder="t('placeholder.choose')"
+          />
+
+          <view>
+            <text style="line-height: 1.5">{{ t('ApplicationDialog.item1') }}</text>
+          </view>
+
+          <view>
+            <text style="line-height: 1.5">{{ t('ApplicationDialog.item2') }}</text>
+            <a
+              :href="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') }}
+            </a>
+          </view>
+
+          <view class="btn">
+            <button
+              class="crm-cursor"
+              @click="CreateActivityLink"
+            >{{ t('Ib.Index.CreateLinkActivity') }}
+            </button>
+          </view>
+
+          <view class="link qrCode" v-if="linkActivity">
+            <QrCode
+              ref="qrCode1"
+              :text="linkActivity"
+              :width="200"
+              :height="200"
+            />
+            <view class="btn">
+              <button
+                class="crm-cursor"
+                @click="downloadQrCode(1)"
+              >{{ t('Btn.item9') }}
+              </button>
+            </view>
+          </view>
+        </view>
+      </view>
+    </cwg-popup>
   </cwg-page-wrapper>
 </template>
 
@@ -218,10 +300,10 @@
   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: '',
+      customAmount: 0,
+      ibAmount: 0,
     },
   )
   const selectedSpreadId = ref('')
@@ -243,17 +325,29 @@
   const loginTypes = ref('')
   const ibInvalid = ref('B0')
   const qrCode = ref(null)
+  const qrCode1 = ref(null)
 
   // 语言
   const lang = useStorage('lang')
+  const flag = ref(false)
+  const agentLinkList = ref([])
+  const activityLing = ref('')
+  const linkActivity = ref('')
+  const commission = ref('')
+  const linkActivityPopup = ref(null)
 
   // 开户链接
   const linkPopup = ref(null)
   const qrSize = ref(200)
 
-  // 显示内容
-  const displayContent = computed(() => {
-    return activeTab.value === 'link' ? partnerLink.value : partnerCode.value
+  const levelNum = computed(() => {
+    return userInfo.ibInfo.levelNum
+  })
+  const fixedHide = computed(() => {
+    return userInfo.ibInfo.fixedHide
+  })
+  const getInfoId = computed(() => {
+    return userInfo.ibInfo.id
   })
 
   // 国家
@@ -265,25 +359,12 @@
   const handleChange = (val) => {
     excludeShowLoginTypes.value = val
   }
-
-  // 复制内容
-  const handleCopy = () => {
-    uni.setClipboardData({
-      data: displayContent.value,
-      success: () => {
-        uni.showToast({
-          title: '复制成功',
-          icon: 'success',
-        })
-      },
-      fail: () => {
-        uni.showToast({
-          title: '复制失败',
-          icon: 'none',
-        })
-      },
-    })
+  const isAfterJuly7 = () => {
+    const currentDate = new Date();
+    const july7 = new Date(currentDate.getFullYear(), 6, 7); // 月份从0开始,6表示7月
+    return currentDate >= july7;
   }
+
   const getValidAccountTypes = (selectedExcludeValues, selectedSpreadId) => {
     const spread = spreadList.value.find(
       (item) => item.id === selectedSpreadId,
@@ -320,16 +401,20 @@
     }
   }
 
-  const downloadQrCode = ()=>{
-    qrCode.value.download()
+  const downloadQrCode = (type = 0) => {
+    if (type === 1) {
+      qrCode1.value.download()
+    }else {
+      qrCode.value.download()
+    }
   }
   // 复制
-  const CopyShareLink = (value) =>{
-    uni.setClipboardData({data: value})
+  const CopyShareLink = (value) => {
+    uni.setClipboardData({ data: value })
   }
 
   const getLink1 = async () => {
-    console.log(excludeShowLoginTypes.value,2)
+    console.log(excludeShowLoginTypes.value, 2)
     if (excludeShowLoginTypes.value.length == 0) {
       uni.showToast({
         title: t('Ib.Index.Spread5'), icon: 'none',
@@ -415,11 +500,10 @@
     if (res.code === Code.StatusOK) {
       spreadList.value = res.data
     } else {
-      uni.showToast({ title: res.msg,icon: 'none', })
+      uni.showToast({ title: res.msg, icon: 'none' })
     }
   }
   const getAgentAccountSetting = async () => {
-    console.log(userInfo)
     const { agentAccountSetting = '' } = userInfo.ibInfo ?? {}
     if (agentAccountSetting === 0) {
       const excludeValues = userInfo.customInfo.excludeShowLoginTypes
@@ -445,9 +529,78 @@
     linkPopup.value.open()
   }
   // 生成活动分享链接
-  const LinkActivity = () => {
-    // 根据实际路由配置跳转,此处示例为复制提示或跳转内部页面
+  const LinkActivity = async () => {
+    if (flag.value) {
+
+    } else {
+      flag.value = true
+    }
+    let res = await ibApi.marketAgentLinkList({})
+    if (res.code === Code.StatusOK) {
+      agentLinkList.value = res.data??[]
+      loginTypeList()
+      getAgentAccountSetting()
+      activityLing.value = '';
+      linkActivity.value = ''
+      commission.value = 0;
+      ibInvalid.value = 'B0'
+      linkActivityPopup.value.open()
+      flag.value = false
+    }
+  }
 
+  const CreateActivityLink = async () => {
+    if (!activityLing.value){
+      uni.showToast({title: t("Ib.Index.ChooseActiv"),icon: 'error'})
+      return
+    }
+    const linkValue = await getLink1()
+    if (!linkValue) return
+    if (activityLing.value.indexOf("http") > -1) {
+      if (activityLing.value.indexOf("?") > -1) {
+        linkActivity.value =
+          activityLing.value +
+          "&mmdi=" +
+          getInfoId.value +
+          "&mmF=" +
+          linkValue +
+          "&mmB=" +
+          ibInvalid.value;
+      } else {
+        linkActivity.value =
+          activityLing.value +
+          "?mmdi=" +
+          getInfoId.value +
+          "&mmF=" +
+          linkValue +
+          "&mmB=" +
+          ibInvalid.value;
+      }
+    } else {
+      if (activityLing.value.indexOf("?") > -1) {
+        linkActivity.value =
+          Host80 +
+          "/" +
+          activityLing.value +
+          "&mmdi=" +
+          getInfoId.value +
+          "&mmF=" +
+          linkValue +
+          "&mmB=" +
+          ibInvalid.value;
+      } else {
+        linkActivity.value =
+          Host80 +
+          "/" +
+          activityLing.value +
+          "?mmdi=" +
+          getInfoId.value +
+          "&mmF=" +
+          linkValue +
+          "&mmB=" +
+          ibInvalid.value;
+      }
+    }
   }
   const handleMenuClick = ({ value }) => {
     console.log(value.type)
@@ -490,7 +643,7 @@
       if (res.data != null)
         ibData.value = res.data
     } else {
-      uni.showToast({ title: res.msg,icon: 'none', })
+      uni.showToast({ title: res.msg, icon: 'none' })
     }
   }
   const getPammManagerValid = async () => {
@@ -499,7 +652,7 @@
       if (res.data != null)
         pammManagerValid.value = res.data
     } else {
-      uni.showToast({ title:res.msg,icon: 'none', })
+      uni.showToast({ title: res.msg, icon: 'none' })
     }
   }
 
@@ -763,11 +916,12 @@
   .link {
     display: flex;
     margin-top: 20rpx;
-    .btn{
+
+    .btn {
       display: flex;
       align-items: center;
       justify-content: center;
-        height: px2rpx(35);
+      height: px2rpx(35);
       margin: 0 px2rpx(10);
     }
   }