feat: add mini-program privacy auth, update oss urls and refine photo guide
update oss static resource urls to oss.nianxx.cn refactor privacy component to be reusable, add wechat mini-program privacy authorization check before image picking add image urls to photo guide examples, refine photo guide ui styles and remove unused avatarSrc prop
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<view class="privacy" v-if="showPrivacy">
|
||||
<view v-if="visible" class="privacy">
|
||||
<view class="content">
|
||||
<view class="title">隐私保护指引</view>
|
||||
<view class="des">
|
||||
请您仔细阅读并充分理解<text
|
||||
class="link"
|
||||
@click="handleOpenPrivacyContract"
|
||||
>{{ privacyContractName }}</text
|
||||
>{{ contractName }}</text
|
||||
>
|
||||
,如您同意前述协议的全部内容,请点击“同意”开始使用。<text class="cancel"
|
||||
>如您不同意,将被限制使用部分功能,或将在您使用具体功能前再次询问以取得您的授权同意。</text
|
||||
@@ -28,46 +28,27 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { onShow } from "@dcloudio/uni-app";
|
||||
|
||||
const showPrivacy = ref(false);
|
||||
const privacyContractName = ref("隐私保护指引");
|
||||
|
||||
onShow(() => {
|
||||
// 条件编译微信小程序
|
||||
// #ifdef MP-WEIXIN
|
||||
|
||||
wx.getPrivacySetting({
|
||||
success: (res) => {
|
||||
console.log("cj隐私配置", res);
|
||||
if (res.errMsg == "getPrivacySetting:ok") {
|
||||
privacyContractName.value = res.privacyContractName;
|
||||
showPrivacy.value = !!res.needAuthorization;
|
||||
}
|
||||
},
|
||||
});
|
||||
// #endif
|
||||
|
||||
// 条件编译抖音小程序
|
||||
// #ifdef MP-TOUTIAO
|
||||
uni.getPrivacySetting({
|
||||
success: (res) => {
|
||||
console.log(res);
|
||||
showPrivacy.value = !!res.needAuthorization;
|
||||
},
|
||||
});
|
||||
// #endif
|
||||
defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
contractName: {
|
||||
type: String,
|
||||
default: "隐私保护指引",
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["agree", "disagree"]);
|
||||
|
||||
// 拒绝
|
||||
const handleDisagree = () => {
|
||||
showPrivacy.value = false;
|
||||
emit("disagree");
|
||||
};
|
||||
|
||||
// 同意
|
||||
const handleAgreePrivacyAuthorization = () => {
|
||||
showPrivacy.value = false;
|
||||
emit("agree");
|
||||
};
|
||||
|
||||
// 打开隐私保护指引
|
||||
|
||||
Reference in New Issue
Block a user