1.遮罩层穿透事件 2.支付宝小程序升级/更新3.支付宝小程序扫描普通二维码进入小程序获取参数

510 阅读1分钟
1.遮罩层穿透事件

<view class="content1"><uni-popup @touchmove.stop.prevent="preventHandler"></uni-popup></view>

<view class="content1-content"></view>


preventHandler(){
return false
}

.content1 {
    height: 100vh;
    overflow: hidden;
}
.content1-content{
    height: 100vh;
    overflow: auto;
}
2.支付宝小程序升级/更新
onShow: function(options) {
	const updateManager = uni.getUpdateManager();
        updateManager.onCheckForUpdate(function (res) {
	 // 请求完新版本信息的回调
	   console.log(res.hasUpdate);
	 });
	updateManager.onUpdateReady(function (res) {
	 uni.showModal({
              title: '更新提示',
              content: '新版本已经准备好,是否重启应用?',
              showCancel: false,
              success(res) {
	 if (res.confirm) {
          // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
	  updateManager.applyUpdate();
                     }
                 }
              });
	    });
     }
3.支付宝小程序扫描普通二维码进入小程序获取参数
onLaunch: function(options) {
    //获取关联普通二维码的码值,放到全局变量qrCode中
    if (options.query && options.query.xxx) {
    // console.log('推荐人Id:'+options.query.xxx);
    uni.setStorageSync("xxx", options.query.xxx);
    }else{
    uni.setStorageSync("xxx", "0");
    }  
}