Parcourir la source

会员VIP券组件

会员VIP券组件
huangxiaoming il y a 2 ans
Parent
commit
d0af94466d

+ 1 - 1
src/components/Global/Avatar.vue

@@ -31,7 +31,7 @@ import defCompanyLogo from '../../assets/img/comLogo.png'
   
   onMounted(() => {
     state.bg = 'bg' + Math.floor(Math.random() * 3)
-    if(props.companyId.length === 32) {
+    if(props.companyId?.length === 32) {
        state.imgSrc = `https://winhc.oss-cn-shanghai.aliyuncs.com/bigdata/companyLogo/${props.companyId}.jpg?x-oss-process=image/resize,m_pad,w_150,h_150,color_FFFFFF`
     }else{
        state.imgSrc =  `https://winhc.oss-cn-shanghai.aliyuncs.com/bigdata/humanLogo/${props.companyId}.jpg?x-oss-process=image/resize,m_fill,w_150,h_150,color_FFFFFF`

+ 112 - 0
src/components/Global/VipQuan.vue

@@ -0,0 +1,112 @@
+<!--
+ * @Description: 
+ * @Author: 狼牙
+ * @Email: huangxiaoming@winhc.cn
+ * @Date: 2022-04-20 20:20:27
+ * @LastEditTime: 2022-04-20 21:20:20
+ * @LastEditors: 狼牙
+-->
+<template>
+    <van-dialog 
+        v-model:show="isShow" 
+        :showConfirmButton="false" 
+        className='quanDialog'>
+        <div class="quanContent">
+            <div class="qu-top">
+                <div class="lt">
+                    <div class="t1">您使用的是VIP功能</div>
+                    <div class="t2">VIP体验权限:还剩{{quanData.voucherCount}}次</div>
+                </div>
+                <img src="@/assets/img/vipQuan.png" alt="" class="rt">
+            </div>
+            <div class="qu-bottom">
+                <div class="it" @click="close">暂不使用</div>
+                <div class="it slt" @click="use">确定使用1次</div>
+            </div>
+            <div class="qu-tips" @click="goQuanYi">
+                开通VIP享超20+权益 ››
+            </div>
+        </div>
+    </van-dialog>
+</template>
+
+<script lang='ts' setup>
+    import { ref,reactice,defineProps,defineEmits} from 'vue'
+    import { $historyGoBack,$goInAppPage } from "@/utils/utils"
+    interface Props {
+        isShow?: boolean, 
+        quanData: object
+    }
+
+    const props = withDefaults(defineProps<Props>(), {
+        quanData: () => {},
+        isShow: ()=>false
+    })
+
+    const emit = defineEmits(['changeShow','refreshHandle'])
+
+    const close=()=>{
+        emit('changeShow')
+        $historyGoBack();
+    }
+    const use=()=>{
+        let arr = [this.quanData.voucherCode]
+        emit('refreshHandle',JSON.stringify(arr))
+    }
+    const goQuanYi=()=>{
+        $goInAppPage('vipIntroduce')
+    }
+
+</script>
+
+<style lang='scss'>
+    .quanDialog{
+        padding: 30px 24px 20px !important;
+        .quanContent{
+            .qu-top{
+                display: flex;
+                justify-content: space-between;
+                align-items: center;
+                .lt{
+                    color: #242A32;
+                    .t1{
+                        font-size: 16px;
+                    }
+                    .t2{
+                        color: #FE7431;
+                        font-size: 14px;
+                        padding-top: 12px;
+                    }
+                }
+                .rt{
+                    width: 54px;
+                    height: 55px;
+                }
+            }
+            .qu-bottom{
+                margin-top: 24px;
+                display: flex;
+                .it{
+                    height: 38px;
+                    background: #F2F3F4;
+                    border-radius: 8px;
+                    color: #242A32;
+                    line-height: 38px;
+                    text-align: center;
+                    flex: 1;
+                    &.slt{
+                        background: #1775FF;
+                        margin-left: 12px;
+                        color: #fff;
+                    }
+                }
+            }
+            .qu-tips{
+                font-size: 12px;
+                color: #4A90E2;
+                text-align: center;
+                margin-top: 16px;
+            }
+        }
+    }
+</style>

+ 1 - 1
src/utils/app.ts

@@ -2,7 +2,7 @@
 /*
  * @Author: 文帅
  * @Date: 2022-03-08 15:35:36
- * @LastEditTime: 2022-04-20 14:50:22
+ * @LastEditTime: 2022-04-20 20:38:46
  * @LastEditors: 狼牙
  * @Description:
  */

+ 75 - 23
src/utils/utils.ts

@@ -7,14 +7,14 @@ import { config } from '../../config'
 import h5JumpApp from './app'
 
 
-
+const h5jumpApp = new h5JumpApp();
 export const $_sendAppFunction = (name: string | number, params: any) => { //跳企业Native
   // eslint-disable-next-line no-undef
-  if (systemJudge() == 'Android') {
+  if (h5jumpApp.systemJudge() == 'Android') {
     winhc[name](params)
   } else {
     // eslint-disable-next-line no-undef
-    ocMethod(name, {
+    h5jumpApp.ocMethod(name, {
       [params]: params
     })
   }
@@ -25,7 +25,7 @@ export const $downApp = () => { //跳企业Native
   return
 }
 
-export const $copyText = (text, back) => {
+export const $copyText = (text:string, back:Function) => {
   $_sendAppFunction('copyText', text)
   // if ($pageType == 'H5') {
   //   return
@@ -111,28 +111,80 @@ export const $goDetail = (url:string,type?:string)=>{//跳详情
   }
 
   // console.log('tempUrl=', tempUrl)
-  // if (new h5JumpApp().systemJudge() == 'Android') {
-  //     if(type == 'ws'){
-  //         winhc.openLegalServiceWebPage(config.commonUrl + tempUrl,"Y")
-  //     }else{
-  //         winhc.qccDetail(tempUrl)
-  //     }
-  // } else {
-  //     if(type == 'ws'){//文书详情是自定义头部
-  //         const obj = {
-  //             pageUrl: config.commonUrl + tempUrl, // 页面打开连接
-  //             immersion:'all'  //是否是沉浸式标题, Y  是沉浸式
-  //         }
-  //         new h5JumpApp().ocMethod('openPageWithShareBtn', obj)
-  //     }else{
-  //       new h5JumpApp().ocMethod('qccDetail', {
-  //             "url": tempUrl,
-  //         })
-  //     }
+  if (h5jumpApp.systemJudge() == 'Android') {
+      if(type == 'ws'){
+          winhc.openLegalServiceWebPage(config.commonUrl + tempUrl,"Y")
+      }else{
+          winhc.qccDetail(tempUrl)
+      }
+  } else {
+      if(type == 'ws'){//文书详情是自定义头部
+          const obj = {
+              pageUrl: config.commonUrl + tempUrl, // 页面打开连接
+              immersion:'all'  //是否是沉浸式标题, Y  是沉浸式
+          }
+          h5jumpApp.ocMethod('openPageWithShareBtn', obj)
+      }else{
+        h5jumpApp.ocMethod('qccDetail', {
+              "url": tempUrl,
+          })
+      }
      
-  // }
+  }
 }
 
+//定义返回按钮事件
+export const $historyGoBack = ()=>{
+  if (h5jumpApp.systemJudge() == 'Android') {
+      winhc.historyGoBack()
+  } else {
+    h5jumpApp.ocMethod('goBack', {})
+  }
+}
+
+export const $goInAppPage = (type?:string)=>{
+  if (h5jumpApp.systemJudge() == 'Android') {
+      winhc.goInAppPage(type)
+  } else {
+    h5jumpApp.ocMethod('goInAppPage', {
+          'type':type
+      })
+  }
+}
+
+export const $openBuyVipPopup = (type=0)=>{
+  // 股权结构图谱(1, "股权结构图谱"),
+  // 债权图谱(2, "债权图谱"),
+  // 最终受益人(3, "最终受益人"),
+  // 控股企业(4, "控股企业"),
+  // 财产线索(5, "财产线索"),
+  // 司法案件详情(10, "司法案件详情"),
+  // 司法案件(6, "司法案件"),
+  // 合同模板(7, "合同模板"),
+  // 监测动态(8, "监测动态"),
+  // 动态详情(9, "动态详情"),
+  // 财产线索提醒(11, "财产线索提醒"),
+  // 风险信息_公司(12, "风险信息公司"),
+  // 风险信息_人(13, "风险信息个人"),
+  // 智能法顾(14, "智能法顾"),
+  // 履债评估(15, "履债评估");
+  // 司法案件监测(10,'司法案件监测')
+  try {
+      if (h5jumpApp.systemJudge() == 'Android') {
+          winhc.openBuyVipPopupByParam('recharge',type)
+      } else {
+        h5jumpApp.ocMethod('openBuyVipPopupByParam', {
+              type:'recharge',
+              funcStyle:type
+          })
+      }
+  } catch (e) {
+      console.log(e)
+  }
+}
+
+
+
 //跳转外部URL
 export const $goOuterUrl = (url: string) => {
   window.open(url)

+ 6 - 6
src/views/CustomPage/FengXianSaoMiao/Company/FengXianSaoMiaoDet.vue

@@ -3,7 +3,7 @@
  * @Author: 狼牙
  * @Email: huangxiaoming@winhc.cn
  * @Date: 2022-04-19 19:42:09
- * @LastEditTime: 2022-04-20 15:30:18
+ * @LastEditTime: 2022-04-20 21:20:39
  * @LastEditors: 狼牙
 -->
 <template>
@@ -56,7 +56,7 @@
             </van-tabs>
         </van-skeleton>
        </van-row>
-       <!-- <VipQuan :isShow='isShowQuan' @changeShow="changShow" :quanData="quanData" @refreshHandle="refreshHandle"></VipQuan> -->
+       <VipQuan :isShow='isShowQuan' @changeShow="changShow" :quanData="quanData" @refreshHandle="refreshHandle"></VipQuan>
     </van-row>
 </template>
 
@@ -64,8 +64,8 @@
 import $axios from '@/api'
 import fxcomponent from './components/tabs.vue';
 import Logo from '@/components/Global/Avatar.vue';
-import { $goDetail } from "@/utils/utils"
-// import VipQuan from '../../components/VipQuan.vue'
+import { $goDetail ,$openBuyVipPopup} from "@/utils/utils"
+import VipQuan from '@/components/Global/VipQuan.vue'
 export default {
     data() {
         return {
@@ -97,7 +97,7 @@ export default {
     components: {
         Logo,
         'yhc-zishenfenxian':fxcomponent,
-        // VipQuan
+        VipQuan
     },
     mounted () {
         document.title = '风险扫描'
@@ -238,7 +238,7 @@ export default {
                         this.isShowQuan = true;
                         this.quanData = tempData;
                     }else{//VIP购买弹框
-                        this.$openBuyVipPopup(12)
+                        $openBuyVipPopup(12)
                     }
                 }
             }

+ 6 - 6
src/views/CustomPage/FengXianSaoMiao/Personal/FengXianSaoMiaoPerDet.vue

@@ -3,7 +3,7 @@
  * @Author: 狼牙
  * @Email: huangxiaoming@winhc.cn
  * @Date: 2022-04-20 15:55:02
- * @LastEditTime: 2022-04-20 17:00:37
+ * @LastEditTime: 2022-04-20 21:22:42
  * @LastEditors: 狼牙
 -->
 <template>
@@ -59,7 +59,7 @@
             </van-tabs>
         </van-skeleton>
        </van-row>
-       <!-- <VipQuan :isShow='isShowQuan' @changeShow="changShow" :quanData="quanData" @refreshHandle="refreshHandle"></VipQuan> -->
+       <VipQuan :isShow='isShowQuan' @changeShow="changShow" :quanData="quanData" @refreshHandle="refreshHandle"></VipQuan>
     </van-row>
 </template>
 
@@ -68,8 +68,8 @@ import $axios from '@/api';
 import glfx from './components/glfx.vue';
 import zsfx from './components/zsfx.vue';
 import Logo from '@/components/Global/Avatar.vue';
-import { $goDetail } from '@/utils/utils'
-// import VipQuan from '../../components/VipQuan'
+import { $goDetail,$openBuyVipPopup } from '@/utils/utils'
+import VipQuan from '@/components/Global/VipQuan.vue'
 export default {
     data() {
         return {
@@ -102,7 +102,7 @@ export default {
         Logo,
         'yhc-guanliangenxian':glfx,
         'yhc-zishenfenxian':zsfx,
-        // VipQuan
+        VipQuan
     },
     mounted () {
         document.title = '风险扫描'
@@ -263,7 +263,7 @@ export default {
                         this.isShowQuan = true;
                         this.quanData = tempData;
                     }else{//VIP购买弹框
-                        this.$openBuyVipPopup(13)
+                        $openBuyVipPopup(13)
                     }
                 }
             }