0 评论

0 收藏

分享

uniapp针对openinstall无法统计到注册量的问题解决方案及demo

uniapp针对openinstall无法统计到注册量的问题解决方案及demo

这个是与openinstall官方成员一起解决掉的 bug问题,因为原生SDK插件支持带来的相关问题。

由于注册统计代码  放入非app.vue 全局文件而无法引入插件配置导致的问题。

1.png
这是最后解决方案。

  1. template>
  2.         <view class="content">
  3.                 <image class="logo" src="/static/logo.png"></image>
  4.                 <view class="text-area">
  5.                         <text class="title">{{title}}</text>
  6.                 </view>
  7.                 <button v-on:click="testRegister">测试注册</button>
  8.         </view>
  9. </template>

  10. <script>
  11.         export default {
  12.                 data() {
  13.                         return {
  14.                                 title: 'Hello'
  15.                         }
  16.                 },
  17.                 onLoad() {

  18.                 },
  19.                 methods: {
  20.                         testRegister:function(even){
  21.                                 console.log('button click')
  22.                                 const openinstall = uni.requireNativePlugin('openinstall-plugin');
  23.                                 openinstall.reportRegister();
  24.                         }
  25.                 },
  26.         };

  27. </script>

  28. <style>
  29.         .content {
  30.                 display: flex;
  31.                 flex-direction: column;
  32.                 align-items: center;
  33.                 justify-content: center;
  34.         }

  35.         .logo {
  36.                 height: 200rpx;
  37.                 width: 200rpx;
  38.                 margin-top: 200rpx;
  39.                 margin-left: auto;
  40.                 margin-right: auto;
  41.                 margin-bottom: 50rpx;
  42.         }

  43.         .text-area {
  44.                 display: flex;
  45.                 justify-content: center;
  46.         }

  47.         .title {
  48.                 font-size: 36rpx;
  49.                 color: #8f8f94;
  50.         }
  51. </style>
复制代码


代码片段



uniapp-test2.rar (16.7 MB, 下载次数: 0, 售价: 20 颗小草)

优雅草论坛2022年8月11日大改,优雅草论坛变回只服务于客户的提问交流论坛,详情查看优雅草8月11日大改,原因详情查优雅草外卖乐关闭

回复

举报 使用道具

相关帖子
全部回复
暂无回帖,快来参与回复吧
一颗优雅草科技 实名认证 机构蓝V认证
服务代表
主题 846
回复 1636
粉丝 7
快速回复 返回顶部 返回列表