- 微信小程序开卡跳转到别的品牌去了?
[图片][图片][图片] [图片][图片][图片] 问题描述,打开波司登小程序开卡不点开通返回退出小程序,然后再打开森马小程序开卡,结果显示的还是波司登,此时如果打开别的如下图的小程序开卡也是显示波司登 [图片][图片] 跳转开卡代码 [图片]
01-16 - wx.NeedPrivacyAuthorization监听授权成功还弹隐私接口拒绝的框?
1 微信小程序隐私协议通过在app.js 处通过onNeedPrivacyAuthorization全局监听隐私接口调用,因为小程序无法自定义全局弹窗,于是统一跳转自定义隐私协议页面,在自定义页面里点击<button id="agree-btn" open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>按钮,授权成功后,会先谈一个隐私接口拒绝的弹窗,但是返回上一页刷新页面,隐私接口是能正常调用的。这个是为啥,难道只能在触发的当前页面弹窗,不能跳转页面去同意隐私协议么? app.tsx componentDidMount() { ezrTrack.gioAppStart(); if (process.env.TARO_ENV === 'weapp') { onNeedPrivacyAuthorization((resolve: any) => { setGlobalData('privacyAuthorization', resolve); navigateTo({ url:'/pages/privacy-agreenment/index' }) console.log('xxx还未授权请先授权:', resolve); }); } } /pages/privacy-agreenment/index.tsx import React, { Component } from 'react'; import { View, Image } from '@tarojs/components'; import { get as getGlobalData } from '@/utils/global-data'; import { showToast, navigateBack, getCurrentPages, openPrivacyContract, } from '@ezr-core/uniapi'; import { EzrModal, EzrModalHeader, EzrModalContent, EzrModalAction, } from '@ezr/pebble'; interface IndexProps {} interface IndexState { openPrivace: boolean; } export default class PrivacyAgreenment extends Component< IndexProps, IndexState > { constructor(props) { super(props); } componentDidMount(): void {} handleConfirm = () => { console.log('拒绝请求'); }; handleCancel = () => {}; handleAgree = () => { const resolve = getGlobalData('privacyAuthorization'); resolve({ buttonId: 'agree-btn', event: 'agree' }); setTimeout(() => { let pages = getCurrentPages(); let prevPage = pages.pageStack[pages.length - 2]; prevPage?.onLoad(); navigateBack(); }, 1000); }; handleDisagree = () => { const resolve = getGlobalData('privacyAuthorization'); resolve({ event: 'disagree' }); showToast({ icon: 'none', title: '您已拒绝,相关功能可能将无法使用', }); setTimeout(() => { navigateBack(); }, 500); }; render(): React.ReactNode { return ( <> <EzrModal isOpened onClose={this.handleCancel}> <EzrModalHeader isSimplified> <Image style={{ width: '100%' }} mode="widthFix" src="https://assets-img.ezrpro.com/mobile/img/wx/hdq.png" ></Image> </EzrModalHeader> <EzrModalContent> <View className="modal-content"> <View>隐私协议</View> <View>阅读隐私协议接受请点击同意</View> <View onClick={() => { openPrivacyContract(); }} style={{ color: 'blue' }} > 《商城小程序协议详情》 </View> </View> </EzrModalContent> <EzrModalAction isSimplified> <View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', padding: '20px 0', }} > <button id="agree-btn" style={{ height: '30px', lineHeight: '30px', fontSize: '14px', width: '100px', }} open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization={this.handleAgree} onClick={this.handleAgree} > 同意 </button> <button id="disagree-btn" style={{ height: '30px', lineHeight: '30px', fontSize: '14px', width: '100px', }} onClick={this.handleDisagree} > 拒绝 </button> </View> </EzrModalAction> </EzrModal> </> ); } }
2023-09-04