Procházet zdrojové kódy

feat:完善信息,代理 控制台

ljc před 2 měsíci
rodič
revize
7dece22ea3
3 změnil soubory, kde provedl 211 přidání a 88 odebrání
  1. 2 1
      components/cwg-combox.vue
  2. 201 80
      pages/ib/index.vue
  3. 8 7
      pages/mine/improveImmediately.vue

+ 2 - 1
components/cwg-combox.vue

@@ -22,7 +22,7 @@
 import { ref, computed, watch, onMounted } from 'vue'
 
 const props = defineProps({
-    value: [String, Number],
+    value: [String, Number, Array],
     options: {
         type: Array,
         default: () => []
@@ -75,6 +75,7 @@ const updateTextByValue = (val) => {
  */
 onMounted(() => {
     if (props.value) {
+
         innerValue.value = props.value
         updateTextByValue(props.value)
     }

+ 201 - 80
pages/ib/index.vue

@@ -105,18 +105,19 @@
     </uni-row>
 
     <!-- 二维码弹窗 -->
-    <uni-popup ref="linkPopup" type="center" :title="t('Ib.Index.CreateLink')" :mask-click="false" background-color="#fff">
+    <cwg-popup ref="linkPopup" type="center" :title="t('Ib.Index.CreateLink')" :showFooter="false" showFooterLine>
       <view class="dia-content">
         <view class="content" style="font-size: 14px; text-align: left">
-          <view class="label">{{ t("Ib.Index.Spread5") }} :</view>
+          <view class="label">{{ t('Ib.Index.Spread5') }} :</view>
           <cwg-combox
             v-model="excludeShowLoginTypes"
             :multiple="true"
             :options="excludeList"
             :placeholder="t('placeholder.choose')"
+            @change="handleChange"
           />
 
-          <view class="label">{{ t("Ib.Index.Spread4") }} :</view>
+          <view class="label">{{ t('Ib.Index.Spread4') }} :</view>
           <uni-data-select
             v-model="selectedSpreadId"
             :localdata="spreadList.map(item => ({
@@ -146,21 +147,22 @@
 
           <view>
             <text style="line-height: 1.5">{{ t('ApplicationDialog.item2') }}</text>
-            <navigator
-              :url="country == 'NG' || country == 'TH' || country == 'LA' || isAfterJuly7()
+            <a
+              :href="country == 'NG' || country == 'TH' || country == 'LA'
             ? `pdf/pdf6/all/Account Type Allocation Table - ${lang}.pdf`
             : `pdf/pdf6/no/Account Type Allocation Table-${lang}.pdf`"
               target="_blank"
             >
               {{ t('ApplicationDialog.item3') }}
-            </navigator>
+            </a>
           </view>
 
           <view class="btn">
-            <text
+            <button
               class="crm-cursor"
               @click="CreateLink"
-            >{{ t('Ib.Index.CreateLink') }}</text>
+            >{{ t('Ib.Index.CreateLink') }}
+            </button>
           </view>
 
           <view class="link qrCode" v-if="link">
@@ -171,31 +173,27 @@
               :height="200"
             />
             <view class="btn">
-              <text
+              <button
                 class="crm-cursor"
                 style="height: 16px"
                 @click="downloadQrCode"
-              >{{ t('Btn.item9') }}</text>
+              >{{ t('Btn.item9') }}
+              </button>
             </view>
           </view>
 
           <view class="link">
             <uni-easyinput
-              readonly
+              disabled
               v-model="link"
-              placeholder=""
-              id="custom_link"
             />
-            <view class="btn">
-              <text
-                class="crm-cursor"
-                @click="CopyShareLink('custom_link')"
-              >{{ t('Ib.Index.Copy') }}</text>
-            </view>
+            <button class="btn" @click="CopyShareLink(link)">
+              {{ t('Ib.Index.Copy') }}
+            </button>
           </view>
         </view>
       </view>
-    </uni-popup>
+    </cwg-popup>
   </cwg-page-wrapper>
 </template>
 
@@ -203,13 +201,15 @@
   import { ref, computed, watch, onMounted } from 'vue'
   import { useI18n } from 'vue-i18n'
   import useRouter from '@/hooks/useRouter'
-  import {ibApi} from '@/service/ib'
+  import { ibApi } from '@/service/ib'
   import config from '@/config/index'
-  import  useUserStore from '@/stores/use-user-store'
+  import useUserStore from '@/stores/use-user-store'
+  import { useStorage } from '@/hooks/useStorage'
+  import QrCode from '@/components/QrCode.vue'
 
   const { t } = useI18n()
   const router = useRouter()
-  const {Code } = config
+  const { Code } = config
   const { userInfo } = useUserStore()
   // 数据
   const balanceInt = ref(0)
@@ -220,25 +220,32 @@
   const activeTab = ref('link') // 'link' 或 'code'
   const getInfoId = ref('123123')
   const ibData = ref({
-      customAmount: "",
-      ibAmount: "",
-    }
+      customAmount: '',
+      ibAmount: '',
+    },
   )
   const selectedSpreadId = ref('')
   const spreadList = ref([])
   const excludeShowLoginTypes = ref([])
   const pammManagerValid = ref()
   const menuList = ref([
-    {label: t('Custom.Index.Withdrawals'),type: 1},
-    {label: t('Custom.Index.Transfer'),type: 2},
+    { label: t('Custom.Index.Withdrawals'), type: 1 },
+    { label: t('Custom.Index.Transfer'), type: 2 },
   ])
   const excludeList = ref([])
   const excludeLists = ref([
-    {text: t('AccountType.SeniorAccount'),value: '2'},
+    { text: t('AccountType.SeniorAccount'), value: '2' },
     // {text: t('AccountType.SeniorAccount'),value: '3'},
-    {text: t('AccountType.StandardAccount'),value: '7'},
-    {text: t('AccountType.CentAccount'),value: '8'},
+    { text: t('AccountType.StandardAccount'), value: '7' },
+    { text: t('AccountType.CentAccount'), value: '8' },
   ])
+  const link = ref('')
+  const loginTypes = ref('')
+  const ibInvalid = ref('B0')
+  const qrCode = ref(null)
+
+  // 语言
+  const lang = useStorage('lang')
 
   // 开户链接
   const linkPopup = ref(null)
@@ -249,6 +256,16 @@
     return activeTab.value === 'link' ? partnerLink.value : partnerCode.value
   })
 
+  // 国家
+  const country = computed(() => {
+    console.log(userInfo.customInfo.country, '2')
+    return userInfo.customInfo.country
+  })
+  // 修改多选
+  const handleChange = (val) => {
+    excludeShowLoginTypes.value = val
+  }
+
   // 复制内容
   const handleCopy = () => {
     uni.setClipboardData({
@@ -267,50 +284,155 @@
       },
     })
   }
+  const getValidAccountTypes = (selectedExcludeValues, selectedSpreadId) => {
+    const spread = spreadList.value.find(
+      (item) => item.id === selectedSpreadId,
+    )
+    let data = {
+      hide: '',
+      commission: '',
+      excludeShowLoginTypes: [],
+    }
+    if (!spread) return data
+    const validValues = selectedExcludeValues.filter((value) =>
+      spread.loginTypes.includes(value),
+    )
+    const invalidValues = selectedExcludeValues.filter(
+      (value) => !spread.loginTypes.includes(value),
+    )
 
-  // 查看所有合作伙伴链接
-  const handleViewAllLinks = () => {
-    // 根据实际路由配置跳转,此处示例为复制提示或跳转内部页面
-    uni.navigateTo({
-      url: '/pages/promo/registration_tools/links',
-      fail: () => {
+    const invalidLabels = excludeList.value
+      .filter((item) => invalidValues.includes(item.value))
+      .map((item) => item.label)
+
+    const excludeTypes = excludeLists.value
+      .filter((item) => !validValues.includes(item.value))
+      .map((item) => item.value)
+
+    loginTypes.value = invalidLabels.join('、')
+
+    return {
+      hide: spread.hide,
+      commission: spread.comPoint,
+      excludeShowLoginTypes: excludeTypes,
+      invalidLabels,
+      invalidValues,
+    }
+  }
+
+  const downloadQrCode = ()=>{
+    qrCode.value.download()
+  }
+  // 复制
+  const CopyShareLink = (value) =>{
+    uni.setClipboardData({data: value})
+  }
+
+  const getLink1 = async () => {
+    console.log(excludeShowLoginTypes.value,2)
+    if (excludeShowLoginTypes.value.length == 0) {
+      uni.showToast({
+        title: t('Ib.Index.Spread5'), icon: 'none',
+      })
+      link.value = ''
+      return
+    }
+    if (!selectedSpreadId.value.length) {
+      uni.showToast({
+        title: t('Ib.Index.Spread4'), icon: 'none',
+      })
+      link.value = ''
+      return
+    }
+    const validList = getValidAccountTypes(
+      excludeShowLoginTypes.value,
+      selectedSpreadId.value,
+    )
+    console.log('validList', validList)
+    if (validList.invalidLabels.length > 0) {
+      return new Promise((resolve) => {
+        uni.showModal({
+          title: t('Msg.SystemPrompt'),
+          content: `${t('Ib.Index.Spread1')}${
+            loginTypes.value
+          }${t('')}`,
+          confirmText: t('Btn.Confirm'),
+          cancelText: t('Btn.Cancel'),
+          success: async (res) => {
+            if (res.confirm) {
+              const res = await ibApi.customLink(validList)
+              if (res.code === Code.StatusOK) {
+                uni.showToast({
+                  title: res.msg,
+                  icon: 'none',
+                })
+                resolve(res.data)
+              } else {
+                uni.showToast({
+                  title: res.msg,
+                  icon: 'none',
+                })
+                resolve('')
+              }
+            }
+          },
+          fail: () => resolve(''),
+        })
+      })
+    } else {
+      const res = await ibApi.customLink(validList)
+      if (res.code === Code.StatusOK) {
         uni.showToast({
-          title: '页面开发中,敬请期待',
+          title: res.msg,
           icon: 'none',
         })
-      },
-    })
+        return res.data
+      } else {
+        uni.showToast({
+          title: res.msg,
+          icon: 'none',
+        })
+        return ''
+      }
+    }
+
   }
+  const CreateLink = async () => {
+    const linkValue = await getLink1()
+    if (!linkValue) return
+    link.value = `${Host80}/#/signup/${getInfoId.value}/${linkValue}/${ibInvalid.value}`
+  }
+
   const loginTypeList = async () => {
     const res = await ibApi.loginTypeList(
       {
-        page:{
+        page: {
           current: 1,
-          row: 100
-        }
-      }
+          row: 100,
+        },
+      },
     )
     if (res.code === Code.StatusOK) {
       spreadList.value = res.data
-    }else {
-      uni.showToast(res.msg)
+    } else {
+      uni.showToast({ title: res.msg,icon: 'none', })
     }
   }
   const getAgentAccountSetting = async () => {
     console.log(userInfo)
-    const {agentAccountSetting = ''} = userInfo.ibInfo ?? {}
+    const { agentAccountSetting = '' } = userInfo.ibInfo ?? {}
     if (agentAccountSetting === 0) {
-      const excludeValues = userInfo.customInfo.excludeShowLoginTypes;
-      try{
+      const excludeValues = userInfo.customInfo.excludeShowLoginTypes
+      try {
         excludeList.value = excludeLists.value.filter(
-          (item) => !excludeValues.includes(item.value)
+          (item) => !excludeValues.includes(item.value),
         )
         excludeShowLoginTypes.value = []
-      }catch(e){
+      } catch (e) {
         excludeShowLoginTypes.value = []
         excludeList.value = excludeLists.value
       }
-    }else {
+    } else {
       excludeShowLoginTypes.value = []
       excludeList.value = excludeLists.value
     }
@@ -325,58 +447,50 @@
   // 生成活动分享链接
   const LinkActivity = () => {
     // 根据实际路由配置跳转,此处示例为复制提示或跳转内部页面
-    uni.navigateTo({
-      url: '/pages/promo/registration_tools/links',
-      fail: () => {
-        uni.showToast({
-          title: '页面开发中,敬请期待',
-          icon: 'none',
-        })
-      },
-    })
+
   }
-  const handleMenuClick = ({value})=>{
+  const handleMenuClick = ({ value }) => {
     console.log(value.type)
     if (value.type === 1) {
       toWithdraw()
-    }else {
+    } else {
       toTransfer()
     }
   }
 
   const toWithdraw = () => {
     router.push({
-      path: '/pages/ib/withdraw',
-    }
+        path: '/pages/ib/withdraw',
+      },
     )
   }
   const toTransfer = () => {
     router.push({
-      path: '/pages/ib/transfer',
-    }
+        path: '/pages/ib/transfer',
+      },
     )
   }
   const toCustomManagement = () => {
     router.push({
-      path: '/pages/ib/customer',
-      query: {  type: 3 }
-    }
+        path: '/pages/ib/customer',
+        query: { type: 3 },
+      },
     )
   }
   const toIbManagement = () => {
     router.push({
-      path: '/pages/ib/customer',
-      query: {  type: 2 }
-    }
+        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)
+        ibData.value = res.data
+    } else {
+      uni.showToast({ title: res.msg,icon: 'none', })
     }
   }
   const getPammManagerValid = async () => {
@@ -384,8 +498,8 @@
     if (res.code === Code.StatusOK) {
       if (res.data != null)
         pammManagerValid.value = res.data
-    }else {
-      uni.showToast(res.msg)
+    } else {
+      uni.showToast({ title:res.msg,icon: 'none', })
     }
   }
 
@@ -621,6 +735,7 @@
     color: rgba(255, 255, 255, 0.6);
     word-break: break-all;
   }
+
   .dia-content {
     padding: 20rpx;
   }
@@ -643,12 +758,18 @@
 
   .crm-cursor {
     cursor: pointer;
-    color: #ea002a;
-    text-decoration: underline;
   }
 
   .link {
+    display: flex;
     margin-top: 20rpx;
+    .btn{
+      display: flex;
+      align-items: center;
+      justify-content: center;
+        height: px2rpx(35);
+      margin: 0 px2rpx(10);
+    }
   }
 
   .qrCode {

+ 8 - 7
pages/mine/improveImmediately.vue

@@ -704,13 +704,13 @@
     </view>
     <view class="dia-content" v-if="!dialogCheck1">
       <view class="icon">
-        <i class="iconfont iconchenggong"></i>
+        <cwg-icon :size="60" name="verified" :color="'#4a6cf7'" />
       </view>
       <view class="des1">{{ t('ApplicationDialog.Des1') }}</view>
-      <QrCode :text="text1"></QrCode>
+      <QrCode v-if="text1" :text="text1"></QrCode>
       <view class="dialog-footer">
-        <u-button @click="closeDia">{{ t('Btn.Cancel') }}</u-button>
-        <u-button type="primary" @click="toHome">{{ t('Btn.Home') }}</u-button>
+        <button @click="closeDia">{{ t('Btn.Cancel') }}</button>
+        <button type="primary" @click="toHome">{{ t('Btn.Home') }}</button>
       </view>
     </view>
   </uni-popup>
@@ -1237,7 +1237,7 @@
         await getCustomFileList()
         await customApply()
       } else {
-        uni.showToast(res.msg)
+        uni.showToast({ title: res.msg, icon: 'none' })
       }
     } catch (error: any) {
       uni.showToast({ title: error.message || t('Msg.SystemError'), icon: 'none' })
@@ -1263,7 +1263,7 @@
       })
       if (res.code == Config.Code.StatusOK) {
         if (save) {
-          dialogCheck.value = false
+          dialogCheck.value.close()
           router.push({ path: '/pages/customer/index' })
         }
       } else {
@@ -1280,7 +1280,7 @@
       if (res.code == Config.Code.StatusOK) {
         isApprove.value = true
         await getLoginInfo()
-        dialogCheck.value = true
+        dialogCheck.value.open()
         dialogCheck1.value = false
       } else {
         uni.showToast({ title: res.msg, icon: 'none' })
@@ -1553,6 +1553,7 @@
 
   // 生命周期
   onMounted(async () => {
+    // dialogCheck.value.open()
     divInit()
     await getLoginInfo()
     await getMobileInfo()