hjr 1 miesiąc temu
rodzic
commit
88f40c7fa6

+ 6 - 0
src/components/addDesktop.ux

@@ -44,6 +44,12 @@ export default {
       },
       fail: function(data, code) {
         console.log(`handling fail, code = ${code}, errorMsg=${data}`)
+        if(code == 206){
+          $utils.showToast('已在桌面中')
+        }else if(code == 201){
+          $utils.showToast('用户拒绝创建')
+        }
+        // $utils.showToast(`添加fail code = ${code}, errorMsg=${data}`)
       }
     })
     // this.$emit('tap')

+ 13 - 1
src/components/my/index.ux

@@ -42,6 +42,13 @@
        </div>
         <text>></text> 
      </div>
+     <!-- <div class="item_tab" @click="tohap()">
+       <div>
+        <text class="iconfont">&#xe648;</text>
+        <text style="margin-left: 10px;">跳转hap</text> 
+       </div>
+        <text>></text> 
+     </div> -->
   </div>
 </template>
 
@@ -77,7 +84,7 @@ export default {
           style:{            
             left: 0,       
             top: 1240,
-            height:100,        
+            height:100,
             width: 1080
           }
         })
@@ -94,6 +101,11 @@ export default {
         params: { key: 1 }
       })
   },
+  tohap(){
+    router.push({
+      uri: 'hap://app/com.ytcalendar.module/pages/first'
+    })
+  },
 }
 </script>
 

+ 4 - 0
src/helper/apis/common.js

@@ -43,4 +43,8 @@ export default {
   getConfig(data) {
     return $ajax.post('sysConfig/getConfig', data)
   },
+  /** 全部 是否屏蔽书架页 / 现在后台是境外IOS广告设置 */
+  getAllConfig(data) {
+    return $ajax.post('sysConfig/getAllConfig', data)
+  },
 }

+ 8 - 5
src/pages/first/index.ux

@@ -116,9 +116,9 @@ export default {
           success: function(response) {
             console.log('response',JSON.parse(response.data).city)
             // prompt.showToast({
-            //   message: `${ JSON.parse(response.data).city }`
+            //   message: `${ JSON.parse(response.data).city }`1`1`                                                                                                                                              
             // })
-            let list = ['Xiamen','Beijing','Shanghai','Shenzhen','Guangzhou'] // 北上广深厦门 不显示广告弹窗 
+            let list = ['Beijing','Shanghai','Shenzhen','Guangzhou'] // 北上广深厦门 不显示广告弹窗  'Xiamen',
             if(list.includes(JSON.parse(response.data).city)){
                 $utils.setStorage('isSpecialArea',true)
                 router.replace({
@@ -150,12 +150,15 @@ export default {
      }
   },
   jumpMain(){
-      $apis.common.getConfig().then(res=>{
+      // getAllConfig  getConfig
+      $apis.common.getAllConfig().then(res=>{
         console.log('res',res)
-        if(res.data.status == 0){ // 屏蔽IP地址
+        let isBlockIpStatus = res.data.filter(item=>{ return item.type == 3 })[0].status // 屏蔽ip地址
+        let isBlockDevStatus = res.data.filter(item=>{ return item.type == 4 })[0].status // 屏蔽ip地址
+        if(isBlockIpStatus == 0){ // 屏蔽IP地址
           this.isBlockIp = false
         }
-        if(res.data.status == 0){ // 屏蔽调试器
+        if(isBlockDevStatus == 0){ // 屏蔽调试器
           this.isBlockDev = false
         }
         let devList = ['log','debug'] // 

+ 44 - 7
src/pages/main/index.ux

@@ -12,6 +12,7 @@
 
 <template>
   <div class="page-wrapper">
+    <text>{{ adListJson }}</text>
     <ad
         adId="{{adList.adId}}"
         style="height: 250px;width: 100%;"
@@ -101,7 +102,7 @@ import router from '@system.router'
 // import system from '@system.system'
 export default {
   public: {
-    tab: '', 
+    tab: '',
   },
   private: {
     tabList: [
@@ -152,13 +153,49 @@ export default {
     adList: {},
     ad: null,
     clickid:'',
+    interstitialAdMultiton:null,
+    adListJson:'ddd',
+    adLists:[], // 多例广告
   },
   async onInit() {
+
+    this.interstitialAdMultiton = require("@service.ad").createInterstitialAd({
+        multiton: true
+    })
+    this.interstitialAdMultiton.load({
+      adUnitId: '6bd7f72fb64249bda8770adc0619d0cc',
+      channel: 'vivo',
+      success: (data) => {
+        //  prompt.showToast({
+        //     message: `interstitialAdMultiton!success`
+        //   })
+        this.adListJson = JSON.stringify(data)
+        let list = Array.isArray(data) ? data : (typeof data === 'object' ? [data] : [])
+        this.adLists = this.adLists.concat(list)
+        this.interstitialAdMultiton.show({
+            adid: this.adLists[0].adid,
+        }).then(() => {
+            // this.$broadcast('logsUnshift', `ad.show 成功`)
+        }, () => {
+            // this.$broadcast('logsUnshift', `ad.show 失败, err = ${JSON.stringify(err)}`)
+        })
+      }, 
+      fail: (data, err) => {
+        if (code === 205) {
+            this.adLists = data.adLists  // 错误码205时,表示缓存已满导致加载失败,此时从缓存返回3个广告
+        } else {
+          prompt.showToast({
+            message: `fail!data= ${JSON.stringify(data)}, code= ${code}`
+          })
+        }
+      }
+  })
     // this.selectedTab = this.tab // || 0 // 带参数则跳转对应页面
-    // 获取后台配置 判断是否屏蔽小说/工具页面
-    $apis.common.getConfig().then(res=>{
+    // 获取后台配置 判断是否屏蔽小说/工具页面 getAllConfig  getConfig
+    $apis.common.getAllConfig().then(res=>{
       console.log('res',res)
-      if(res.data.status == 1){ // 屏蔽书架/书城
+      let status = res.data.filter(item=>{ return item.type == 2 })[0].status // 屏蔽小说/工具
+      if(status == 1){ // 屏蔽书架/书城
         this.isBlock = true
         this.tabList.splice(0,2)
         this.tabList.splice(2,1)
@@ -173,9 +210,9 @@ export default {
           // })
         //设备唯一标识。在 Android 上返回 IMEI 或 MEID; 在 Android Q 之后,除了华为手机返回 aaid(应用匿名设备标识符),
         // 其他厂商手机如果支持 oaid(匿名设备标识符)则返回 oaid,否则返回空值。
-        // $apis.common.vivoUpload({sign: data.deviceId, type: 1}).then(res=>{
-        //   console.log('res',res)
-        // })
+        $apis.common.vivoUpload({sign: data.deviceId, type: 1}).then(res=>{
+          console.log('res',res)
+        })
       },
       fail: function(data, code) {
         console.log(`handling fail, code = ${code}`)