4.0.0
This commit is contained in:
parent
4faa8cdb10
commit
0fb5844b6a
67
App.vue
67
App.vue
@ -14,6 +14,10 @@ import storage from '@/utils/storage.js'; //缓存
|
|||||||
//初始化im
|
//初始化im
|
||||||
import { TUIChatKit } from '@/TUIKit';
|
import { TUIChatKit } from '@/TUIKit';
|
||||||
import { loginIm } from '@/utils/handleim.js';
|
import { loginIm } from '@/utils/handleim.js';
|
||||||
|
//解决华为上架权限描述
|
||||||
|
import { PermissionTips } from '@/utils/huawei_describe.js';
|
||||||
|
import { requestPermissions, closeModal, showModal } from '@/js_sdk/yu-app-permission/yu-app-permission.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// 全局属性
|
// 全局属性
|
||||||
globalData: {
|
globalData: {
|
||||||
@ -21,7 +25,9 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
config
|
config,
|
||||||
|
popupView: null,
|
||||||
|
flag: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -56,15 +62,20 @@ export default {
|
|||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
this.checkArguments(); // 检测启动参数
|
this.checkArguments(); // 检测启动参数
|
||||||
|
// 权限监听申请
|
||||||
|
this.onRequestPermissionListener();
|
||||||
APPUpdate();
|
APPUpdate();
|
||||||
this.hanleTabCenter();
|
this.hanleTabCenter();
|
||||||
// 重点是以下: 一定要监听后台恢复 !一定要
|
// 重点是以下: 一定要监听后台恢复 !一定要
|
||||||
plus.globalEvent.addEventListener('newintent', (e) => {
|
plus.globalEvent.addEventListener('newintent', (e) => {
|
||||||
this.checkArguments(); // 检测启动参数
|
this.checkArguments(); // 检测启动参数
|
||||||
});
|
});
|
||||||
// init im
|
|
||||||
TUIChatKit.init();
|
if (storage.getHasLogin()) {
|
||||||
console.log('IM初始化完成');
|
// init im
|
||||||
|
TUIChatKit.init();
|
||||||
|
console.log('IM初始化完成');
|
||||||
|
}
|
||||||
// 如果有缓存登录信息
|
// 如果有缓存登录信息
|
||||||
console.log('是否登录', storage.getHasLogin());
|
console.log('是否登录', storage.getHasLogin());
|
||||||
if (storage.getHasLogin()) {
|
if (storage.getHasLogin()) {
|
||||||
@ -83,6 +94,54 @@ export default {
|
|||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onRequestPermissionListener() {
|
||||||
|
// #ifdef APP
|
||||||
|
// 权限监听申请
|
||||||
|
// 为应用市场审核时要求:APP在调用终端权限时,应同步告知用户申请该权限的目的。此时即可使用本API,在app.vue里全局监听。
|
||||||
|
var brand = uni.getSystemInfoSync().deviceBrand;
|
||||||
|
if (brand.toLowerCase() != 'huawei' && brand.toLowerCase() != 'xiaomi') return;
|
||||||
|
this.permissionListener = uni.createRequestPermissionListener();
|
||||||
|
this.permissionListener.onRequest(async (e) => {
|
||||||
|
if (this.flag) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.flag = true;
|
||||||
|
console.log('权限-1', e);
|
||||||
|
var item = e[0];
|
||||||
|
const { isSuc, msg } = await requestPermissions({
|
||||||
|
title: PermissionTips[item].title, // 申请权限时弹出框标题
|
||||||
|
content: PermissionTips[item].content, // 申请权限时弹出框内容
|
||||||
|
permissionID: item // 权限ID
|
||||||
|
});
|
||||||
|
console.log(msg);
|
||||||
|
if (!isSuc) {
|
||||||
|
if (msg != 'close') {
|
||||||
|
this.popupView = showModal({
|
||||||
|
title: PermissionTips[item].title, // 申请权限时弹出框标题
|
||||||
|
content: PermissionTips[item].content, // 申请权限时弹出框内容
|
||||||
|
permissionID: item // 权限ID
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log('用户永久拒绝');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.permissionListener.onComplete((e) => {
|
||||||
|
console.log('权限-2', e);
|
||||||
|
if (this.popupView) {
|
||||||
|
this.popupView.close();
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.flag = false;
|
||||||
|
}, 5000);
|
||||||
|
});
|
||||||
|
// 权限检测成功则返回 { isSuc : true} ,未授权则弹出权限询问弹窗以及权限说明窗口
|
||||||
|
|
||||||
|
// if (!isSuc) {
|
||||||
|
// return false
|
||||||
|
// }
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
hanleTabCenter() {
|
hanleTabCenter() {
|
||||||
// 点击中间的➕
|
// 点击中间的➕
|
||||||
uni.onTabBarMidButtonTap(() => {
|
uni.onTabBarMidButtonTap(() => {
|
||||||
|
1
TUIKit/assets/icon/jubao.svg
Normal file
1
TUIKit/assets/icon/jubao.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1747019858517" class="icon" viewBox="0 0 1088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4001" xmlns:xlink="http://www.w3.org/1999/xlink" width="212.5" height="200"><path d="M566.224 10.032a48 48 0 0 1 20.32 20.32l480.768 920.32a48 48 0 0 1-42.544 70.24H63.232a48 48 0 0 1-42.56-70.24l480.784-920.32a48 48 0 0 1 64.768-20.32zM544 52.576L63.232 972.896h961.536L544 52.576z m16 712.32a48 48 0 1 1 0 96 48 48 0 0 1 0-96z m0-416a44.272 44.272 0 0 1 44.128 47.84l-24.72 305.456a16 16 0 0 1-15.936 14.72h-7.36a16 16 0 0 1-15.952-14.736l-24.352-305.424A44.32 44.32 0 0 1 560 348.912z" p-id="4002"></path></svg>
|
After Width: | Height: | Size: 764 B |
@ -1,48 +1,44 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
v-if="!isAllActionItemInvalid && !messageItem.hasRiskContent"
|
v-if="!isAllActionItemInvalid && !messageItem.hasRiskContent"
|
||||||
ref="messageToolDom"
|
ref="messageToolDom"
|
||||||
:class="['dialog-item', !isPC ? 'dialog-item-h5' : 'dialog-item-web']"
|
:class="['dialog-item', !isPC ? 'dialog-item-h5' : 'dialog-item-web']"
|
||||||
>
|
>
|
||||||
<slot
|
<slot
|
||||||
v-if="featureConfig.EmojiReaction"
|
v-if="featureConfig.EmojiReaction"
|
||||||
name="TUIEmojiPlugin"
|
name="TUIEmojiPlugin"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="dialog-item-list"
|
class="dialog-item-list"
|
||||||
:class="!isPC ? 'dialog-item-list-h5' : 'dialog-item-list-web'"
|
:class="!isPC ? 'dialog-item-list-h5' : 'dialog-item-list-web'"
|
||||||
>
|
>
|
||||||
<template v-for="(item, index) in actionItems">
|
<template v-for="(item, index) in actionItems">
|
||||||
<div
|
<div
|
||||||
v-if="item.renderCondition()"
|
v-if="item.renderCondition()"
|
||||||
:key="item.key"
|
:key="item.key"
|
||||||
class="list-item"
|
class="list-item"
|
||||||
@click="getFunction(index)"
|
@click="getFunction(index)"
|
||||||
@mousedown="beforeCopy(item.key)"
|
@mousedown="beforeCopy(item.key)"
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon
|
||||||
:file="item.iconUrl"
|
:file="item.iconUrl"
|
||||||
:size="'15px'"
|
:size="'15px'"
|
||||||
/>
|
/>
|
||||||
<span class="list-item-text">{{ item.text }}</span>
|
<span class="list-item-text">{{ item.text }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import TUIChatEngine, {
|
import TUIChatEngine, { TUIStore, StoreName, TUITranslateService, IMessageModel } from '@tencentcloud/chat-uikit-engine';
|
||||||
TUIStore,
|
|
||||||
StoreName,
|
|
||||||
TUITranslateService,
|
|
||||||
IMessageModel,
|
|
||||||
} from '@tencentcloud/chat-uikit-engine';
|
|
||||||
import { TUIGlobal } from '@tencentcloud/universal-api';
|
import { TUIGlobal } from '@tencentcloud/universal-api';
|
||||||
import { ref, watchEffect, computed, onMounted, onUnmounted } from '../../../../adapter-vue';
|
import { ref, watchEffect, computed, onMounted, onUnmounted } from '../../../../adapter-vue';
|
||||||
import Icon from '../../../common/Icon.vue';
|
import Icon from '../../../common/Icon.vue';
|
||||||
import { Toast, TOAST_TYPE } from '../../../common/Toast/index';
|
import { Toast, TOAST_TYPE } from '../../../common/Toast/index';
|
||||||
import delIcon from '../../../../assets/icon/msg-del.svg';
|
import delIcon from '../../../../assets/icon/msg-del.svg';
|
||||||
|
import juBao from '../../../../assets/icon/jubao.svg';
|
||||||
import copyIcon from '../../../../assets/icon/msg-copy.svg';
|
import copyIcon from '../../../../assets/icon/msg-copy.svg';
|
||||||
import quoteIcon from '../../../../assets/icon/msg-quote.svg';
|
import quoteIcon from '../../../../assets/icon/msg-quote.svg';
|
||||||
import revokeIcon from '../../../../assets/icon/msg-revoke.svg';
|
import revokeIcon from '../../../../assets/icon/msg-revoke.svg';
|
||||||
@ -62,365 +58,384 @@ import CopyManager from '../../utils/copy';
|
|||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
messageItem: IMessageModel;
|
messageItem: IMessageModel;
|
||||||
isMultipleSelectMode: boolean;
|
isMultipleSelectMode: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IEmits {
|
interface IEmits {
|
||||||
(key: 'toggleMultipleSelectMode'): void;
|
(key: 'toggleMultipleSelectMode'): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const emits = defineEmits<IEmits>();
|
const emits = defineEmits<IEmits>();
|
||||||
const props = withDefaults(defineProps<IProps>(), {
|
const props = withDefaults(defineProps<IProps>(), {
|
||||||
isMultipleSelectMode: false,
|
isMultipleSelectMode: false,
|
||||||
messageItem: () => ({}) as IMessageModel,
|
messageItem: () => ({} as IMessageModel)
|
||||||
});
|
});
|
||||||
const featureConfig = TUIChatConfig.getFeatureConfig();
|
const featureConfig = TUIChatConfig.getFeatureConfig();
|
||||||
|
|
||||||
const TYPES = TUIChatEngine.TYPES;
|
const TYPES = TUIChatEngine.TYPES;
|
||||||
|
|
||||||
const actionItems = ref([
|
const actionItems = ref([
|
||||||
{
|
{
|
||||||
key: 'open',
|
key: 'open',
|
||||||
text: TUITranslateService.t('TUIChat.打开'),
|
text: TUITranslateService.t('TUIChat.打开'),
|
||||||
iconUrl: copyIcon,
|
iconUrl: copyIcon,
|
||||||
renderCondition() {
|
renderCondition() {
|
||||||
if (!featureConfig.DownloadFile || !message.value) return false;
|
if (!featureConfig.DownloadFile || !message.value) return false;
|
||||||
return isPC && (message.value?.type === TYPES.MSG_FILE
|
return isPC && (message.value?.type === TYPES.MSG_FILE || message.value.type === TYPES.MSG_VIDEO || message.value.type === TYPES.MSG_IMAGE);
|
||||||
|| message.value.type === TYPES.MSG_VIDEO
|
},
|
||||||
|| message.value.type === TYPES.MSG_IMAGE);
|
clickEvent: openMessage
|
||||||
},
|
},
|
||||||
clickEvent: openMessage,
|
{
|
||||||
},
|
key: 'copy',
|
||||||
{
|
text: TUITranslateService.t('TUIChat.复制'),
|
||||||
key: 'copy',
|
iconUrl: copyIcon,
|
||||||
text: TUITranslateService.t('TUIChat.复制'),
|
renderCondition() {
|
||||||
iconUrl: copyIcon,
|
if (!featureConfig.CopyMessage || !message.value) return false;
|
||||||
renderCondition() {
|
return message.value.type === TYPES.MSG_TEXT;
|
||||||
if (!featureConfig.CopyMessage || !message.value) return false;
|
},
|
||||||
return message.value.type === TYPES.MSG_TEXT;
|
clickEvent: copyMessage
|
||||||
},
|
},
|
||||||
clickEvent: copyMessage,
|
{
|
||||||
},
|
key: 'revoke',
|
||||||
{
|
text: TUITranslateService.t('TUIChat.撤回'),
|
||||||
key: 'revoke',
|
iconUrl: revokeIcon,
|
||||||
text: TUITranslateService.t('TUIChat.撤回'),
|
renderCondition() {
|
||||||
iconUrl: revokeIcon,
|
if (!featureConfig.RevokeMessage || !message.value) return false;
|
||||||
renderCondition() {
|
return message.value.flow === 'out' && message.value.status === 'success';
|
||||||
if (!featureConfig.RevokeMessage || !message.value) return false;
|
},
|
||||||
return message.value.flow === 'out' && message.value.status === 'success';
|
clickEvent: revokeMessage
|
||||||
},
|
},
|
||||||
clickEvent: revokeMessage,
|
{
|
||||||
},
|
key: 'delete',
|
||||||
{
|
text: TUITranslateService.t('TUIChat.删除'),
|
||||||
key: 'delete',
|
iconUrl: delIcon,
|
||||||
text: TUITranslateService.t('TUIChat.删除'),
|
renderCondition() {
|
||||||
iconUrl: delIcon,
|
if (!featureConfig.DeleteMessage || !message.value) return false;
|
||||||
renderCondition() {
|
return message.value.status === 'success';
|
||||||
if (!featureConfig.DeleteMessage || !message.value) return false;
|
},
|
||||||
return message.value.status === 'success';
|
clickEvent: deleteMessage
|
||||||
},
|
},
|
||||||
clickEvent: deleteMessage,
|
{
|
||||||
},
|
key: 'forward',
|
||||||
{
|
text: TUITranslateService.t('TUIChat.转发'),
|
||||||
key: 'forward',
|
iconUrl: forwardIcon,
|
||||||
text: TUITranslateService.t('TUIChat.转发'),
|
renderCondition() {
|
||||||
iconUrl: forwardIcon,
|
if (!featureConfig.ForwardMessage || !message.value) return false;
|
||||||
renderCondition() {
|
return message.value.status === 'success';
|
||||||
if (!featureConfig.ForwardMessage || !message.value) return false;
|
},
|
||||||
return message.value.status === 'success';
|
clickEvent: forwardSingleMessage
|
||||||
},
|
},
|
||||||
clickEvent: forwardSingleMessage,
|
{
|
||||||
},
|
key: 'quote',
|
||||||
{
|
text: TUITranslateService.t('TUIChat.引用'),
|
||||||
key: 'quote',
|
iconUrl: quoteIcon,
|
||||||
text: TUITranslateService.t('TUIChat.引用'),
|
renderCondition() {
|
||||||
iconUrl: quoteIcon,
|
if (!featureConfig.QuoteMessage || !message.value) return false;
|
||||||
renderCondition() {
|
const _message = TUIStore.getMessageModel(message.value.ID);
|
||||||
if (!featureConfig.QuoteMessage || !message.value) return false;
|
return message.value.status === 'success' && !_message.getSignalingInfo();
|
||||||
const _message = TUIStore.getMessageModel(message.value.ID);
|
},
|
||||||
return message.value.status === 'success' && !_message.getSignalingInfo();
|
clickEvent: quoteMessage
|
||||||
},
|
},
|
||||||
clickEvent: quoteMessage,
|
// {
|
||||||
},
|
// key: 'translate',
|
||||||
{
|
// text: TUITranslateService.t('TUIChat.翻译'),
|
||||||
key: 'translate',
|
// visible: false,
|
||||||
text: TUITranslateService.t('TUIChat.翻译'),
|
// iconUrl: translateIcon,
|
||||||
visible: false,
|
// renderCondition() {
|
||||||
iconUrl: translateIcon,
|
// if (!featureConfig.TranslateMessage || !message.value) return false;
|
||||||
renderCondition() {
|
// return message.value.status === 'success' && message.value.type === TYPES.MSG_TEXT;
|
||||||
if (!featureConfig.TranslateMessage || !message.value) return false;
|
// },
|
||||||
return message.value.status === 'success' && message.value.type === TYPES.MSG_TEXT;
|
// clickEvent: translateMessage,
|
||||||
},
|
// },
|
||||||
clickEvent: translateMessage,
|
// {
|
||||||
},
|
// key: 'convert',
|
||||||
{
|
// text: TUITranslateService.t('TUIChat.转文字'),
|
||||||
key: 'convert',
|
// visible: false,
|
||||||
text: TUITranslateService.t('TUIChat.转文字'),
|
// iconUrl: convertText,
|
||||||
visible: false,
|
// renderCondition() {
|
||||||
iconUrl: convertText,
|
// if (!featureConfig.VoiceToText || !message.value) return false;
|
||||||
renderCondition() {
|
// return message.value.status === 'success' && message.value.type === TYPES.MSG_AUDIO;
|
||||||
if (!featureConfig.VoiceToText || !message.value) return false;
|
// },
|
||||||
return message.value.status === 'success' && message.value.type === TYPES.MSG_AUDIO;
|
// clickEvent: convertVoiceToText,
|
||||||
},
|
// },
|
||||||
clickEvent: convertVoiceToText,
|
{
|
||||||
},
|
key: 'convert',
|
||||||
{
|
text: '举报',
|
||||||
key: 'multi-select',
|
visible: false,
|
||||||
text: TUITranslateService.t('TUIChat.多选'),
|
iconUrl: juBao,
|
||||||
iconUrl: multipleSelectIcon,
|
renderCondition() {
|
||||||
renderCondition() {
|
if (!featureConfig.VoiceToText || !message.value) return false;
|
||||||
if (!featureConfig.MultiSelection || !message.value) return false;
|
return message.value.status === 'success';
|
||||||
return message.value.status === 'success';
|
},
|
||||||
},
|
clickEvent: toReport
|
||||||
clickEvent: multipleSelectMessage,
|
},
|
||||||
},
|
{
|
||||||
|
key: 'multi-select',
|
||||||
|
text: TUITranslateService.t('TUIChat.多选'),
|
||||||
|
iconUrl: multipleSelectIcon,
|
||||||
|
renderCondition() {
|
||||||
|
if (!featureConfig.MultiSelection || !message.value) return false;
|
||||||
|
return message.value.status === 'success';
|
||||||
|
},
|
||||||
|
clickEvent: multipleSelectMessage
|
||||||
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const message = ref<IMessageModel>();
|
const message = ref<IMessageModel>();
|
||||||
const messageToolDom = ref<HTMLElement>();
|
const messageToolDom = ref<HTMLElement>();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
TUIStore.watch(StoreName.CHAT, {
|
TUIStore.watch(StoreName.CHAT, {
|
||||||
translateTextInfo: onMessageTranslationInfoUpdated,
|
translateTextInfo: onMessageTranslationInfoUpdated,
|
||||||
voiceToTextInfo: onMessageConvertInfoUpdated,
|
voiceToTextInfo: onMessageConvertInfoUpdated
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
TUIStore.unwatch(StoreName.CHAT, {
|
TUIStore.unwatch(StoreName.CHAT, {
|
||||||
translateTextInfo: onMessageTranslationInfoUpdated,
|
translateTextInfo: onMessageTranslationInfoUpdated,
|
||||||
voiceToTextInfo: onMessageConvertInfoUpdated,
|
voiceToTextInfo: onMessageConvertInfoUpdated
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
message.value = TUIStore.getMessageModel(props.messageItem.ID);
|
message.value = TUIStore.getMessageModel(props.messageItem.ID);
|
||||||
});
|
});
|
||||||
|
|
||||||
const isAllActionItemInvalid = computed(() => {
|
const isAllActionItemInvalid = computed(() => {
|
||||||
for (let i = 0; i < actionItems.value.length; ++i) {
|
for (let i = 0; i < actionItems.value.length; ++i) {
|
||||||
if (actionItems.value[i].renderCondition()) {
|
if (actionItems.value[i].renderCondition()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
function getFunction(index: number) {
|
function getFunction(index: number) {
|
||||||
// Compatible with Vue2 and WeChat Mini Program syntax, dynamic binding is not allowed.
|
// Compatible with Vue2 and WeChat Mini Program syntax, dynamic binding is not allowed.
|
||||||
actionItems.value[index].clickEvent();
|
actionItems.value[index].clickEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
function openMessage() {
|
function openMessage() {
|
||||||
let url = '';
|
let url = '';
|
||||||
switch (message.value?.type) {
|
switch (message.value?.type) {
|
||||||
case TUIChatEngine.TYPES.MSG_FILE:
|
case TUIChatEngine.TYPES.MSG_FILE:
|
||||||
url = message.value.payload.fileUrl;
|
url = message.value.payload.fileUrl;
|
||||||
break;
|
break;
|
||||||
case TUIChatEngine.TYPES.MSG_VIDEO:
|
case TUIChatEngine.TYPES.MSG_VIDEO:
|
||||||
url = message.value.payload.remoteVideoUrl;
|
url = message.value.payload.remoteVideoUrl;
|
||||||
break;
|
break;
|
||||||
case TUIChatEngine.TYPES.MSG_IMAGE:
|
case TUIChatEngine.TYPES.MSG_IMAGE:
|
||||||
url = message.value.payload.imageInfoArray[0].url;
|
url = message.value.payload.imageInfoArray[0].url;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
window?.open(url, '_blank');
|
window?.open(url, '_blank');
|
||||||
}
|
}
|
||||||
|
|
||||||
function revokeMessage() {
|
function revokeMessage() {
|
||||||
if (!message.value) return;
|
if (!message.value) return;
|
||||||
const messageModel = TUIStore.getMessageModel(message.value.ID);
|
const messageModel = TUIStore.getMessageModel(message.value.ID);
|
||||||
messageModel
|
messageModel
|
||||||
.revokeMessage()
|
.revokeMessage()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
enableSampleTaskStatus('revokeMessage');
|
enableSampleTaskStatus('revokeMessage');
|
||||||
})
|
})
|
||||||
.catch((error: any) => {
|
.catch((error: any) => {
|
||||||
// The message cannot be recalled after the time limit was reached, which is 2 minutes by default.
|
// The message cannot be recalled after the time limit was reached, which is 2 minutes by default.
|
||||||
if (error.code === 20016 || error.code === 10031) {
|
if (error.code === 20016 || error.code === 10031) {
|
||||||
const message = TUITranslateService.t('TUIChat.已过撤回时限');
|
const message = TUITranslateService.t('TUIChat.已过撤回时限');
|
||||||
Toast({
|
Toast({
|
||||||
message,
|
message,
|
||||||
type: TOAST_TYPE.ERROR,
|
type: TOAST_TYPE.ERROR
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteMessage() {
|
function deleteMessage() {
|
||||||
if (!message.value) return;
|
if (!message.value) return;
|
||||||
const messageModel = TUIStore.getMessageModel(message.value.ID);
|
const messageModel = TUIStore.getMessageModel(message.value.ID);
|
||||||
messageModel.deleteMessage();
|
messageModel.deleteMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
function toReport() {
|
||||||
|
if (!message.value) return;
|
||||||
|
Toast({
|
||||||
|
message: TUITranslateService.t('我们已收到您的举报'),
|
||||||
|
type: TOAST_TYPE.WARNING
|
||||||
|
});
|
||||||
|
const messageModel = TUIStore.getMessageModel(message.value.ID);
|
||||||
|
messageModel.deleteMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function copyMessage() {
|
async function copyMessage() {
|
||||||
if (isUniFrameWork) {
|
if (isUniFrameWork) {
|
||||||
TUIGlobal?.setClipboardData({
|
TUIGlobal?.setClipboardData({
|
||||||
data: transformTextWithKeysToEmojiNames(message.value?.payload?.text),
|
data: transformTextWithKeysToEmojiNames(message.value?.payload?.text)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// uni-app conditional compilation will not run the following code
|
// uni-app conditional compilation will not run the following code
|
||||||
// #ifndef APP || APP-PLUS || MP || H5
|
// #ifndef APP || APP-PLUS || MP || H5
|
||||||
CopyManager.copySelection(message.value?.payload?.text);
|
CopyManager.copySelection(message.value?.payload?.text);
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function beforeCopy(key: string) {
|
function beforeCopy(key: string) {
|
||||||
// only pc support copy selection or copy full message text
|
// only pc support copy selection or copy full message text
|
||||||
// uni-app and h5 only support copy full message text
|
// uni-app and h5 only support copy full message text
|
||||||
if (key !== 'copy' || isH5) {
|
if (key !== 'copy' || isH5) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// uni-app conditional compilation will not run the following code
|
// uni-app conditional compilation will not run the following code
|
||||||
// #ifndef APP || APP-PLUS || MP || H5
|
// #ifndef APP || APP-PLUS || MP || H5
|
||||||
CopyManager.saveCurrentSelection();
|
CopyManager.saveCurrentSelection();
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
function forwardSingleMessage() {
|
function forwardSingleMessage() {
|
||||||
if (!message.value) return;
|
if (!message.value) return;
|
||||||
TUIStore.update(StoreName.CUSTOM, 'singleForwardMessageID', message.value.ID);
|
TUIStore.update(StoreName.CUSTOM, 'singleForwardMessageID', message.value.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
function quoteMessage() {
|
function quoteMessage() {
|
||||||
if (!message.value) return;
|
if (!message.value) return;
|
||||||
message.value.quoteMessage();
|
message.value.quoteMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
function translateMessage() {
|
function translateMessage() {
|
||||||
const enable = TUIStore.getData(StoreName.APP, 'enabledTranslationPlugin');
|
const enable = TUIStore.getData(StoreName.APP, 'enabledTranslationPlugin');
|
||||||
if (!enable) {
|
if (!enable) {
|
||||||
Toast({
|
Toast({
|
||||||
message: TUITranslateService.t('TUIChat.请开通翻译功能'),
|
message: TUITranslateService.t('TUIChat.请开通翻译功能'),
|
||||||
type: TOAST_TYPE.WARNING,
|
type: TOAST_TYPE.WARNING
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!message.value) return;
|
if (!message.value) return;
|
||||||
const index = actionItems.value.findIndex(item => item.key === 'translate');
|
const index = actionItems.value.findIndex((item) => item.key === 'translate');
|
||||||
TUIStore.update(StoreName.CHAT, 'translateTextInfo', {
|
TUIStore.update(StoreName.CHAT, 'translateTextInfo', {
|
||||||
conversationID: message.value.conversationID,
|
conversationID: message.value.conversationID,
|
||||||
messageID: message.value.ID,
|
messageID: message.value.ID,
|
||||||
visible: !actionItems.value[index].visible,
|
visible: !actionItems.value[index].visible
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertVoiceToText() {
|
function convertVoiceToText() {
|
||||||
const enable = TUIStore.getData(StoreName.APP, 'enabledVoiceToText');
|
const enable = TUIStore.getData(StoreName.APP, 'enabledVoiceToText');
|
||||||
if (!enable) {
|
if (!enable) {
|
||||||
Toast({
|
Toast({
|
||||||
message: TUITranslateService.t('TUIChat.请开通语音转文字功能'),
|
message: TUITranslateService.t('TUIChat.请开通语音转文字功能')
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!message.value) return;
|
if (!message.value) return;
|
||||||
const index = actionItems.value.findIndex(item => item.key === 'convert');
|
const index = actionItems.value.findIndex((item) => item.key === 'convert');
|
||||||
TUIStore.update(StoreName.CHAT, 'voiceToTextInfo', {
|
TUIStore.update(StoreName.CHAT, 'voiceToTextInfo', {
|
||||||
conversationID: message.value.conversationID,
|
conversationID: message.value.conversationID,
|
||||||
messageID: message.value.ID,
|
messageID: message.value.ID,
|
||||||
visible: !actionItems.value[index].visible,
|
visible: !actionItems.value[index].visible
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function multipleSelectMessage() {
|
function multipleSelectMessage() {
|
||||||
emits('toggleMultipleSelectMode');
|
emits('toggleMultipleSelectMode');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMessageTranslationInfoUpdated(info: Map<string, ITranslateInfo[]>) {
|
function onMessageTranslationInfoUpdated(info: Map<string, ITranslateInfo[]>) {
|
||||||
if (info === undefined) return;
|
if (info === undefined) return;
|
||||||
const translationInfoList = info.get(props.messageItem.conversationID) || [];
|
const translationInfoList = info.get(props.messageItem.conversationID) || [];
|
||||||
const idx = actionItems.value.findIndex(item => item.key === 'translate');
|
const idx = actionItems.value.findIndex((item) => item.key === 'translate');
|
||||||
for (let i = 0; i < translationInfoList.length; ++i) {
|
for (let i = 0; i < translationInfoList.length; ++i) {
|
||||||
const { messageID, visible } = translationInfoList[i];
|
const { messageID, visible } = translationInfoList[i];
|
||||||
if (messageID === props.messageItem.ID) {
|
if (messageID === props.messageItem.ID) {
|
||||||
actionItems.value[idx].text = TUITranslateService.t(visible ? 'TUIChat.隐藏' : 'TUIChat.翻译');
|
actionItems.value[idx].text = TUITranslateService.t(visible ? 'TUIChat.隐藏' : 'TUIChat.翻译');
|
||||||
actionItems.value[idx].visible = !!visible;
|
actionItems.value[idx].visible = !!visible;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
actionItems.value[idx].text = TUITranslateService.t('TUIChat.翻译');
|
actionItems.value[idx].text = TUITranslateService.t('TUIChat.翻译');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMessageConvertInfoUpdated(info: Map<string, IConvertInfo[]>) {
|
function onMessageConvertInfoUpdated(info: Map<string, IConvertInfo[]>) {
|
||||||
if (info === undefined) return;
|
if (info === undefined) return;
|
||||||
const convertInfoList = info.get(props.messageItem.conversationID) || [];
|
const convertInfoList = info.get(props.messageItem.conversationID) || [];
|
||||||
const idx = actionItems.value.findIndex(item => item.key === 'convert');
|
const idx = actionItems.value.findIndex((item) => item.key === 'convert');
|
||||||
for (let i = 0; i < convertInfoList.length; ++i) {
|
for (let i = 0; i < convertInfoList.length; ++i) {
|
||||||
const { messageID, visible } = convertInfoList[i];
|
const { messageID, visible } = convertInfoList[i];
|
||||||
if (messageID === props.messageItem.ID) {
|
if (messageID === props.messageItem.ID) {
|
||||||
actionItems.value[idx].text = TUITranslateService.t(visible ? 'TUIChat.隐藏' : 'TUIChat.转文字');
|
actionItems.value[idx].text = TUITranslateService.t(visible ? 'TUIChat.隐藏' : 'TUIChat.转文字');
|
||||||
actionItems.value[idx].visible = !!visible;
|
actionItems.value[idx].visible = !!visible;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
actionItems.value[idx].text = TUITranslateService.t('TUIChat.转文字');
|
actionItems.value[idx].text = TUITranslateService.t('TUIChat.转文字');
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
messageToolDom,
|
messageToolDom
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "../../../../assets/styles/common";
|
@import '../../../../assets/styles/common';
|
||||||
|
|
||||||
.dialog-item-web {
|
.dialog-item-web {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
border: 1px solid #e0e0e0;
|
border: 1px solid #e0e0e0;
|
||||||
padding: 12px 0;
|
padding: 12px 0;
|
||||||
|
|
||||||
.dialog-item-list {
|
.dialog-item-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
max-width: 280px;
|
max-width: 280px;
|
||||||
|
|
||||||
.list-item {
|
.list-item {
|
||||||
padding: 4px 12px;
|
padding: 4px 12px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.list-item-text {
|
.list-item-text {
|
||||||
padding-left: 4px;
|
padding-left: 4px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 17px;
|
line-height: 17px;
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-item-h5 {
|
.dialog-item-h5 {
|
||||||
@extend .dialog-item-web;
|
@extend .dialog-item-web;
|
||||||
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
.dialog-item-list {
|
.dialog-item-list {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
max-width: 280px;
|
max-width: 280px;
|
||||||
|
|
||||||
.list-item {
|
.list-item {
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
color: #4f4f4f;
|
color: #4f4f4f;
|
||||||
|
|
||||||
.list-item-text {
|
.list-item-text {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
{
|
{
|
||||||
"version": "4",
|
"version" : "4",
|
||||||
"prompt": "template",
|
"prompt" : "template",
|
||||||
"title": "用户协议和隐私政策",
|
"title" : "用户协议和隐私政策",
|
||||||
"message": " 请你务必审慎阅读、充分理解“用户协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=\"https://www.wzj.net.cn/download/yonhuxieyi.html\">《用户协议》</a>和<a href=\"http://www.wzj.net.cn/download/yinsizhengce.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
"message" : " 请你务必审慎阅读、充分理解“用户协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=\"https://wuzhongjie.com.cn/download/yonhuxieyi.html\">《用户协议》</a>和<a href=\"https://wuzhongjie.com.cn/download/yinsizhengce.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
||||||
"buttonAccept": "同意并接受",
|
"buttonAccept" : "同意并接受",
|
||||||
"buttonRefuse": "暂不同意",
|
"buttonRefuse" : "暂不同意",
|
||||||
"hrefLoader": "system|default",
|
"hrefLoader" : "system|default",
|
||||||
"second": {
|
"second" : {
|
||||||
"title": "确认提示",
|
"title" : "确认提示",
|
||||||
"message": " 进入应用前,你需先同意<a href=\"https://wuzhongjie.com.cn/download/yonhuxieyi.html\" >《用户协议》</a>和<a href=\"http://wuzhongjie.com.cn/download/yinsizhengce.html\">《隐私政策》</a>,否则将退出应用。",
|
"message" : " 进入应用前,你需先同意<a href=\"https://wuzhongjie.com.cn/download/yonhuxieyi.html\" >《用户协议》</a>和<a href=\"http://wuzhongjie.com.cn/download/yinsizhengce.html\">《隐私政策》</a>,否则将退出应用。",
|
||||||
"buttonAccept": "同意并继续",
|
"buttonAccept" : "同意并继续",
|
||||||
"buttonRefuse": "退出应用"
|
"buttonRefuse" : "退出应用"
|
||||||
},
|
},
|
||||||
"styles": {
|
"styles" : {
|
||||||
"backgroundColor": "#ffffff",
|
"backgroundColor" : "#ffffff",
|
||||||
"borderRadius": "5px",
|
"borderRadius" : "5px",
|
||||||
"title": {
|
"title" : {
|
||||||
"color": "#FF2C3C"
|
"color" : "#FF2C3C"
|
||||||
},
|
},
|
||||||
"buttonAccept": {
|
"buttonAccept" : {
|
||||||
"color": "#FF2C3C"
|
"color" : "#FF2C3C"
|
||||||
},
|
},
|
||||||
"buttonRefuse": {
|
"buttonRefuse" : {
|
||||||
"color": "#545454"
|
"color" : "#545454"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
11
apple-app-site-association
Normal file
11
apple-app-site-association
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"applinks": {
|
||||||
|
"apps": [],
|
||||||
|
"details": [
|
||||||
|
{
|
||||||
|
"appID": "9C9VWBX77X.cn.net.wzj.mall",
|
||||||
|
"paths": [ "/ulink/*"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -9,9 +9,9 @@ export default {
|
|||||||
appSecret: "6dfbe0c72380dce5d49d65b3c91059b1", //可在 manifest.json 查看
|
appSecret: "6dfbe0c72380dce5d49d65b3c91059b1", //可在 manifest.json 查看
|
||||||
aMapKey: "AOHBZ-VCEL3-XX73N-O623U-FMTP6-ASBTD", //在腾讯的中申请web端key
|
aMapKey: "AOHBZ-VCEL3-XX73N-O623U-FMTP6-ASBTD", //在腾讯的中申请web端key
|
||||||
scanAuthNavigation: ['https://m-b2b2c.pickmall.cn/'], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
|
scanAuthNavigation: ['https://m-b2b2c.pickmall.cn/'], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
|
||||||
iosAppId: "id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
|
iosAppId: "id6479185362", //AppStore的应用地址id 具体在分享->拷贝链接中查看
|
||||||
logo: "https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址
|
logo: "https://wuzhongjie.com.cn/download/logo.png", //logo地址
|
||||||
customerServiceMobile: "13161366885", //客服电话
|
customerServiceMobile: "13040076090", //客服电话
|
||||||
customerServiceEmail: "lili@lili.com", //客服邮箱
|
customerServiceEmail: "13040076090@163.com", //客服邮箱
|
||||||
img: 'https://wzjbucket.oss-rg-china-mainland.aliyuncs.com', //图片地址,聊天分享的图片地址
|
img: 'https://wzjbucket.oss-rg-china-mainland.aliyuncs.com', //图片地址,聊天分享的图片地址
|
||||||
};
|
};
|
20
js_sdk/yu-app-permission/package.json
Normal file
20
js_sdk/yu-app-permission/package.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"id": "yu-app-permission",
|
||||||
|
"name": "解决APP未向用户告知权限申请目的,导致华为等上架被拒问题",
|
||||||
|
"displayName": "解决APP未向用户告知权限申请目的,导致华为等上架被拒问题",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"description": "纯JS单个文件,解决安卓APP上架时未向用户告知权限申请目的等被拒问题",
|
||||||
|
"keywords": [
|
||||||
|
"华为",
|
||||||
|
"上架",
|
||||||
|
"权限",
|
||||||
|
"上架被拒",
|
||||||
|
"app"
|
||||||
|
],
|
||||||
|
"dcloudext": {
|
||||||
|
"category": [
|
||||||
|
"JS SDK",
|
||||||
|
"通用 SDK"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
308
js_sdk/yu-app-permission/yu-app-permission.js
Normal file
308
js_sdk/yu-app-permission/yu-app-permission.js
Normal file
@ -0,0 +1,308 @@
|
|||||||
|
let popupView = null // 窗口实例
|
||||||
|
export function showModal(info) {
|
||||||
|
const title = info && info.title ? info.title : '标题'
|
||||||
|
const content = info && info.content ? info.content : '请输入内容'
|
||||||
|
let screenWidth = plus.screen.resolutionWidth
|
||||||
|
let screenHeight = plus.screen.resolutionHeight
|
||||||
|
const popupViewWidth = screenWidth * 0.7
|
||||||
|
const viewContentPadding = 20
|
||||||
|
const viewContentWidth = parseInt(popupViewWidth - (viewContentPadding * 2))
|
||||||
|
const descriptionList = drawtext(content, viewContentWidth)
|
||||||
|
let popupViewHeight = 80 + 20 + 20 + 20
|
||||||
|
let popupViewContentList = [{
|
||||||
|
tag: 'font',
|
||||||
|
id: 'title',
|
||||||
|
text: title,
|
||||||
|
textStyles: {
|
||||||
|
size: '18px',
|
||||||
|
color: "#333",
|
||||||
|
weight: "bold",
|
||||||
|
whiteSpace: "normal"
|
||||||
|
},
|
||||||
|
position: {
|
||||||
|
top: '60px',
|
||||||
|
left: viewContentPadding + "px",
|
||||||
|
width: viewContentWidth + "px",
|
||||||
|
height: "30px",
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
const textHeight = 18
|
||||||
|
let contentTop = 110
|
||||||
|
descriptionList.forEach((item, index) => {
|
||||||
|
if (index > 0) {
|
||||||
|
popupViewHeight += textHeight;
|
||||||
|
contentTop += textHeight;
|
||||||
|
}
|
||||||
|
popupViewContentList.push({
|
||||||
|
tag: 'font',
|
||||||
|
id: 'content' + index + 1,
|
||||||
|
text: item.content,
|
||||||
|
textStyles: {
|
||||||
|
size: '14px',
|
||||||
|
color: "#666",
|
||||||
|
lineSpacing: "50%",
|
||||||
|
align: "center"
|
||||||
|
},
|
||||||
|
position: {
|
||||||
|
top: contentTop + "px",
|
||||||
|
left: viewContentPadding + "px",
|
||||||
|
width: viewContentWidth + "px",
|
||||||
|
height: textHeight + "px",
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (item.type == "break") {
|
||||||
|
contentTop += 10;
|
||||||
|
popupViewHeight += 10;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
popupView = new plus.nativeObj.View("popupView", { //创建底部图标菜单
|
||||||
|
tag: "rect",
|
||||||
|
top: "50px",
|
||||||
|
left: '15%',
|
||||||
|
height: popupViewHeight + "px",
|
||||||
|
width: "70%"
|
||||||
|
})
|
||||||
|
popupView.drawRect({
|
||||||
|
color: "#FFFFFF",
|
||||||
|
radius: "8px",
|
||||||
|
borderWidth: "2px",
|
||||||
|
borderColor: "#ddd"
|
||||||
|
}, {
|
||||||
|
top: "40px",
|
||||||
|
height: popupViewHeight - 40 + "px",
|
||||||
|
})
|
||||||
|
popupView.draw(popupViewContentList)
|
||||||
|
popupView.show()
|
||||||
|
return popupView
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function closeModal() {
|
||||||
|
// 在不再需要 popupView 时关闭它
|
||||||
|
popupView && popupView.close();
|
||||||
|
popupView = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 文字换行
|
||||||
|
function drawtext(text, maxWidth) {
|
||||||
|
let textArr = text.split("");
|
||||||
|
let len = textArr.length;
|
||||||
|
// 上个节点
|
||||||
|
let previousNode = 0;
|
||||||
|
// 记录节点宽度
|
||||||
|
let nodeWidth = 0;
|
||||||
|
// 文本换行数组
|
||||||
|
let rowText = [];
|
||||||
|
// 如果是字母,侧保存长度
|
||||||
|
let letterWidth = 0;
|
||||||
|
// 汉字宽度
|
||||||
|
let chineseWidth = 14;
|
||||||
|
// otherFont宽度
|
||||||
|
let otherWidth = 7;
|
||||||
|
for (let i = 0; i < len; i++) {
|
||||||
|
if (/[\u4e00-\u9fa5]|[\uFE30-\uFFA0]/g.test(textArr[i])) {
|
||||||
|
if (letterWidth > 0) {
|
||||||
|
if (nodeWidth + chineseWidth + letterWidth * otherWidth > maxWidth) {
|
||||||
|
rowText.push({
|
||||||
|
type: "text",
|
||||||
|
content: text.substring(previousNode, i)
|
||||||
|
});
|
||||||
|
previousNode = i
|
||||||
|
nodeWidth = chineseWidth
|
||||||
|
letterWidth = 0
|
||||||
|
} else {
|
||||||
|
nodeWidth += chineseWidth + letterWidth * otherWidth
|
||||||
|
letterWidth = 0
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (nodeWidth + chineseWidth > maxWidth) {
|
||||||
|
rowText.push({
|
||||||
|
type: "text",
|
||||||
|
content: text.substring(previousNode, i)
|
||||||
|
})
|
||||||
|
previousNode = i
|
||||||
|
nodeWidth = chineseWidth
|
||||||
|
} else {
|
||||||
|
nodeWidth += chineseWidth
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (/\n/g.test(textArr[i])) {
|
||||||
|
rowText.push({
|
||||||
|
type: "break",
|
||||||
|
content: text.substring(previousNode, i)
|
||||||
|
})
|
||||||
|
previousNode = i + 1
|
||||||
|
nodeWidth = 0
|
||||||
|
letterWidth = 0
|
||||||
|
} else if (textArr[i] == "\\" && textArr[i + 1] == "n") {
|
||||||
|
rowText.push({
|
||||||
|
type: "break",
|
||||||
|
content: text.substring(previousNode, i)
|
||||||
|
})
|
||||||
|
previousNode = i + 2
|
||||||
|
nodeWidth = 0
|
||||||
|
letterWidth = 0
|
||||||
|
} else if (/[a-zA-Z0-9]/g.test(textArr[i])) {
|
||||||
|
letterWidth += 1;
|
||||||
|
if (nodeWidth + letterWidth * otherWidth > maxWidth) {
|
||||||
|
rowText.push({
|
||||||
|
type: "text",
|
||||||
|
content: text.substring(previousNode, i + 1 - letterWidth)
|
||||||
|
})
|
||||||
|
previousNode = i + 1 - letterWidth
|
||||||
|
nodeWidth = letterWidth * otherWidth
|
||||||
|
letterWidth = 0
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (nodeWidth + otherWidth > maxWidth) {
|
||||||
|
rowText.push({
|
||||||
|
type: "text",
|
||||||
|
content: text.substring(previousNode, i)
|
||||||
|
});
|
||||||
|
previousNode = i
|
||||||
|
nodeWidth = otherWidth
|
||||||
|
} else {
|
||||||
|
nodeWidth += otherWidth
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (previousNode < len) {
|
||||||
|
rowText.push({
|
||||||
|
type: "text",
|
||||||
|
content: text.substring(previousNode, len)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return rowText
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//权限检测
|
||||||
|
export function requestPermissions(info) {
|
||||||
|
const permissionID = info.permissionID
|
||||||
|
return new Promise((rev, jec) => {
|
||||||
|
if (!permissionID) {
|
||||||
|
rev({
|
||||||
|
isSuc: false,
|
||||||
|
msg: "缺少permissionID"
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
//判断安卓与ios设备
|
||||||
|
if (plus.os.name == 'Android') {
|
||||||
|
let _permissionID = permissionID;
|
||||||
|
console.log(permissionID)
|
||||||
|
plus.android.checkPermission(_permissionID,
|
||||||
|
granted => {
|
||||||
|
if (granted.checkResult == 0) {
|
||||||
|
rev({
|
||||||
|
isSuc: true,
|
||||||
|
msg: ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (granted.checkResult == -1) {
|
||||||
|
//还未授权当前查询的权限,打开权限申请目的自定义弹框
|
||||||
|
closeModal() // 先关闭再弹窗
|
||||||
|
// showModal(info)
|
||||||
|
rev({
|
||||||
|
isSuc: false,
|
||||||
|
msg: ''
|
||||||
|
})
|
||||||
|
plus.android.requestPermissions([_permissionID],
|
||||||
|
(e) => {
|
||||||
|
//关闭权限申请目的自定义弹框
|
||||||
|
// if (e.granted.length > 0) {
|
||||||
|
// closeModal()
|
||||||
|
// //当前查询权限已授权,此时可以通知页面执行接下来的操作
|
||||||
|
// rev({
|
||||||
|
// isSuc: true
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// if (e.deniedPresent.length > 0) {
|
||||||
|
// closeModal()
|
||||||
|
// //当前查询权限已授权,此时可以通知页面执行接下来的操作
|
||||||
|
// rev({
|
||||||
|
// isSuc: false,
|
||||||
|
// msg: "用户已拒绝"
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
if (e.deniedAlways.length > 0) {
|
||||||
|
rev({
|
||||||
|
isSuc: false,
|
||||||
|
msg: "close"
|
||||||
|
})
|
||||||
|
//当前查询权限已被永久禁用,此时需要引导用户跳转手机系统设置去开启
|
||||||
|
// uni.showModal({
|
||||||
|
// title: '温馨提示',
|
||||||
|
// content: '还没有该权限,立即去设置开启?',
|
||||||
|
// cancelText: "取消",
|
||||||
|
// confirmText: "去设置",
|
||||||
|
// showCancel: true,
|
||||||
|
// confirmColor: '#000',
|
||||||
|
// cancelColor: '#666',
|
||||||
|
// success: (res) => {
|
||||||
|
// if (res.confirm) {
|
||||||
|
// goSetting();
|
||||||
|
// }
|
||||||
|
// if (res.cancel) {
|
||||||
|
// rev({
|
||||||
|
// isSuc: false,
|
||||||
|
// msg: "取消前往权限设置页面"
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// fail(e) {
|
||||||
|
// rev({
|
||||||
|
// isSuc: false,
|
||||||
|
// msg: e.message || "弹窗失败"
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
// complete() {
|
||||||
|
// closeModal()
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
rev({
|
||||||
|
isSuc: false,
|
||||||
|
mes: error.message || '检查权限失败'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//IOS不需要添加自定义弹框来描述权限目的,因为在配置文件的隐私信息访问的许可描述里可添加
|
||||||
|
rev({
|
||||||
|
isSuc: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//跳转手机系统设置
|
||||||
|
export function goSetting() {
|
||||||
|
if (plus.os.name == "iOS") {
|
||||||
|
var UIApplication = plus.ios.import("UIApplication");
|
||||||
|
var application2 = UIApplication.sharedApplication();
|
||||||
|
var NSURL2 = plus.ios.import("NSURL");
|
||||||
|
var setting2 = NSURL2.URLWithString("app-settings:");
|
||||||
|
application2.openURL(setting2);
|
||||||
|
plus.ios.deleteObject(setting2);
|
||||||
|
plus.ios.deleteObject(NSURL2);
|
||||||
|
plus.ios.deleteObject(application2);
|
||||||
|
} else {
|
||||||
|
var Intent = plus.android.importClass("android.content.Intent");
|
||||||
|
var Settings = plus.android.importClass("android.provider.Settings");
|
||||||
|
var Uri = plus.android.importClass("android.net.Uri");
|
||||||
|
var mainActivity = plus.android.runtimeMainActivity();
|
||||||
|
var intent = new Intent();
|
||||||
|
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
mainActivity.startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,7 @@
|
|||||||
"appid" : "__UNI__6DB512D",
|
"appid" : "__UNI__6DB512D",
|
||||||
"description" : "admin",
|
"description" : "admin",
|
||||||
"versionName" : "4.0.0",
|
"versionName" : "4.0.0",
|
||||||
"versionCode" : 4000049,
|
"versionCode" : 402,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"android" : {
|
"android" : {
|
||||||
@ -29,11 +29,11 @@
|
|||||||
"Share" : {},
|
"Share" : {},
|
||||||
"Geolocation" : {},
|
"Geolocation" : {},
|
||||||
"Maps" : {},
|
"Maps" : {},
|
||||||
"OAuth" : {},
|
|
||||||
"Camera" : {},
|
"Camera" : {},
|
||||||
"Barcode" : {},
|
"Barcode" : {},
|
||||||
"VideoPlayer" : {},
|
"VideoPlayer" : {},
|
||||||
"Push" : {}
|
"Push" : {},
|
||||||
|
"OAuth" : {}
|
||||||
},
|
},
|
||||||
"error" : {
|
"error" : {
|
||||||
/* 404错误页面*/
|
/* 404错误页面*/
|
||||||
@ -71,20 +71,25 @@
|
|||||||
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
],
|
],
|
||||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
"abiFilters" : [ "arm64-v8a" ],
|
||||||
"schemes" : "wuzhongjie",
|
"schemes" : "wuzhongjie",
|
||||||
"minSdkVersion" : 21
|
"minSdkVersion" : 30,
|
||||||
|
"targetSdkVersion" : 34
|
||||||
},
|
},
|
||||||
"ios" : {
|
"ios" : {
|
||||||
"idfa" : false,
|
"idfa" : false,
|
||||||
"privacyDescription" : {
|
"privacyDescription" : {
|
||||||
"NSPhotoLibraryUsageDescription" : "需要用与评论上传,头像上传功能",
|
"NSPhotoLibraryUsageDescription" : "需要用与评论上传,头像上传功能",
|
||||||
"NSPhotoLibraryAddUsageDescription" : "保存商品图片到本地",
|
"NSPhotoLibraryAddUsageDescription" : "保存商品图片到本地",
|
||||||
"NSFaceIDUsageDescription" : "使用面部识别进行登录",
|
|
||||||
"NSCameraUsageDescription" : "需要用与扫描二维码和商品评论图片拍摄",
|
"NSCameraUsageDescription" : "需要用与扫描二维码和商品评论图片拍摄",
|
||||||
"NSLocationAlwaysAndWhenInUseUsageDescription" : "位置信息将用于高德地图的效果展示",
|
"NSLocationAlwaysAndWhenInUseUsageDescription" : "可根据位置向您介绍附近的视频信息,提升浏览体验,或帮助你在发布的信息中展示位置,不授权不影响app正常使用",
|
||||||
"NSMicrophoneUsageDescription" : "用户上传视频时需使用音频信息"
|
"NSMicrophoneUsageDescription" : "用户上传视频时需使用音频信息"
|
||||||
},
|
},
|
||||||
|
"capabilities" : {
|
||||||
|
"entitlements" : {
|
||||||
|
"com.apple.developer.associated-domains" : [ "applinks:wuzhongjie.com.cn" ]
|
||||||
|
}
|
||||||
|
},
|
||||||
"urltypes" : "wuzhongjie",
|
"urltypes" : "wuzhongjie",
|
||||||
"dSYMs" : false
|
"dSYMs" : false
|
||||||
},
|
},
|
||||||
@ -94,7 +99,7 @@
|
|||||||
"weixin" : {
|
"weixin" : {
|
||||||
"__platform__" : [ "ios", "android" ],
|
"__platform__" : [ "ios", "android" ],
|
||||||
"appid" : "wxebcdaea31881caab",
|
"appid" : "wxebcdaea31881caab",
|
||||||
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/app/"
|
"UniversalLinks" : "https://wuzhongjie.com.cn/ulink/"
|
||||||
},
|
},
|
||||||
"alipay" : {
|
"alipay" : {
|
||||||
"__platform__" : [ "ios", "android" ]
|
"__platform__" : [ "ios", "android" ]
|
||||||
@ -104,18 +109,13 @@
|
|||||||
"share" : {
|
"share" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"appid" : "wxebcdaea31881caab",
|
"appid" : "wxebcdaea31881caab",
|
||||||
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/app/"
|
"UniversalLinks" : "https://wuzhongjie.com.cn/ulink/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oauth" : {
|
"oauth" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"appid" : "wxebcdaea31881caab",
|
"appid" : "wxebcdaea31881caab",
|
||||||
"appsecret" : "71826d76bad096ec5407897c6ed1391f",
|
"UniversalLinks" : "https://wuzhongjie.com.cn/ulink/"
|
||||||
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/app/"
|
|
||||||
},
|
|
||||||
"apple" : {},
|
|
||||||
"qq" : {
|
|
||||||
"appid" : "101918503"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"geolocation" : {
|
"geolocation" : {
|
||||||
|
@ -102,6 +102,7 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "预览视频",
|
"navigationBarTitleText": "预览视频",
|
||||||
"navigationBarBackgroundColor": "#181b27",
|
"navigationBarBackgroundColor": "#181b27",
|
||||||
|
"navigationBarTextStyle": "#FFFFFF",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1,54 +1,58 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="prpage">
|
<view class="prpage">
|
||||||
<video
|
<video
|
||||||
class="prvideo"
|
class="prvideo"
|
||||||
:style="{ height: screenSafeHeight + 'px' }"
|
:style="{ height: screenSafeHeight + 'px' }"
|
||||||
:src="videoUrl"
|
:src="videoUrl"
|
||||||
autoplay="true"
|
autoplay="true"
|
||||||
controls="true"
|
controls="true"
|
||||||
:object-fit="objectFit"></video>
|
:object-fit="objectFit"
|
||||||
</view>
|
></video>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let system = uni.getSystemInfoSync();
|
let system = uni.getSystemInfoSync();
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
videoUrl: "",
|
videoUrl: '',
|
||||||
objectFit: "fill",
|
objectFit: 'fill',
|
||||||
screenSafeHeight: system.safeArea.bottom,
|
screenSafeHeight: system.safeArea.bottom
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(params) {
|
onLoad(params) {
|
||||||
let me = this;
|
let me = this;
|
||||||
let videoUrl = params.videoUrl;
|
var path = params.videoUrl;
|
||||||
this.videoUrl = videoUrl;
|
var fileName = path.split('/').pop();
|
||||||
let width = parseInt(params.width);
|
// let videoUrl = 'https://wuzhongjie.com.cn/vlogData/' + fileName;
|
||||||
let height = parseInt(params.height);
|
let videoUrl = params.localFile;
|
||||||
this.width = width;
|
this.videoUrl = videoUrl;
|
||||||
this.height = height;
|
let width = parseInt(params.width);
|
||||||
|
let height = parseInt(params.height);
|
||||||
|
this.width = width;
|
||||||
|
this.height = height;
|
||||||
|
|
||||||
if (width >= height) {
|
if (width >= height) {
|
||||||
me.objectFit = "contain";
|
me.objectFit = 'contain';
|
||||||
} else {
|
} else {
|
||||||
me.objectFit = "fill";
|
me.objectFit = 'fill';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {},
|
methods: {}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.prpage {
|
.prpage {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background-color: #181b27;
|
background-color: #181b27;
|
||||||
}
|
}
|
||||||
.prvideo {
|
.prvideo {
|
||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -104,6 +104,7 @@ export default {
|
|||||||
title: '',
|
title: '',
|
||||||
width: 0,
|
width: 0,
|
||||||
height: 0,
|
height: 0,
|
||||||
|
localFile: '',
|
||||||
percentCompleted: 0 // 进度
|
percentCompleted: 0 // 进度
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -113,6 +114,8 @@ export default {
|
|||||||
let vlogInfo = storage.getVlogUserInfo();
|
let vlogInfo = storage.getVlogUserInfo();
|
||||||
// 上个页面传过来的文件事件对象, 其中包含了相册中选择的视频内容
|
// 上个页面传过来的文件事件对象, 其中包含了相册中选择的视频内容
|
||||||
let fileObjectEvent = JSON.parse(params.fileObjectEvent);
|
let fileObjectEvent = JSON.parse(params.fileObjectEvent);
|
||||||
|
console.log(fileObjectEvent);
|
||||||
|
this.localFile = fileObjectEvent.tempFilePath;
|
||||||
let times = new Date().getTime();
|
let times = new Date().getTime();
|
||||||
var userId = vlogInfo.id;
|
var userId = vlogInfo.id;
|
||||||
let nickname = vlogInfo.nickname;
|
let nickname = vlogInfo.nickname;
|
||||||
@ -229,7 +232,7 @@ export default {
|
|||||||
|
|
||||||
preview() {
|
preview() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/publish/preview?videoUrl=' + this.videoUrl + '&width=' + this.width + '&height=' + this.height,
|
url: '/pages/publish/preview?videoUrl=' + this.videoUrl + '&width=' + this.width + '&height=' + this.height + '&localFile=' + this.localFile,
|
||||||
animationType: 'slide-in-bottom',
|
animationType: 'slide-in-bottom',
|
||||||
animationDuration: 500
|
animationDuration: 500
|
||||||
});
|
});
|
||||||
|
@ -237,7 +237,6 @@ export default {
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
var prop = this.pageList[this.curIndex];
|
var prop = this.pageList[this.curIndex];
|
||||||
this.getLocation();
|
|
||||||
if (storage.getRefreshVlogIndex() == '1') {
|
if (storage.getRefreshVlogIndex() == '1') {
|
||||||
// 登录后需要刷新数据
|
// 登录后需要刷新数据
|
||||||
for (var i = 0; i < this.pageList.length; i++) {
|
for (var i = 0; i < this.pageList.length; i++) {
|
||||||
@ -279,7 +278,7 @@ export default {
|
|||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
getLocation() {
|
getLocation(localdom) {
|
||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
type: 'wg84',
|
type: 'wg84',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
@ -304,6 +303,7 @@ export default {
|
|||||||
var address_name = ad_info.district || ad_info.city;
|
var address_name = ad_info.district || ad_info.city;
|
||||||
this.tabList.forEach((i, index) => {
|
this.tabList.forEach((i, index) => {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
|
localdom.get();
|
||||||
i.name = address_name;
|
i.name = address_name;
|
||||||
// this.selectorQuery();
|
// this.selectorQuery();
|
||||||
var timer = setTimeout(() => {
|
var timer = setTimeout(() => {
|
||||||
@ -328,7 +328,7 @@ export default {
|
|||||||
storage.setCityCode('');
|
storage.setCityCode('');
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '获取位置信息失败'
|
title: '获取位置信息失败,请前往设置'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -429,10 +429,15 @@ export default {
|
|||||||
var beforeProp = this.pageList[this._lastTabIndex];
|
var beforeProp = this.pageList[this._lastTabIndex];
|
||||||
var indexProp = this.pageList[index];
|
var indexProp = this.pageList[index];
|
||||||
if (this.$refs[indexProp].dataList.length == 0) {
|
if (this.$refs[indexProp].dataList.length == 0) {
|
||||||
// 初始化数据
|
if (index == 0) {
|
||||||
try {
|
var localdom = this.$refs[indexProp];
|
||||||
this.$refs[indexProp].get();
|
this.getLocation(localdom);
|
||||||
} catch {}
|
} else {
|
||||||
|
// 初始化数据
|
||||||
|
try {
|
||||||
|
this.$refs[indexProp].get();
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
this.$refs[beforeProp].hideVd();
|
this.$refs[beforeProp].hideVd();
|
||||||
|
File diff suppressed because it is too large
Load Diff
29
utils/huawei_describe.js
Normal file
29
utils/huawei_describe.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
export const PermissionTips = {
|
||||||
|
"android.permission.WRITE_EXTERNAL_STORAGE": {
|
||||||
|
title: '正在获取相册权限',
|
||||||
|
content: '为了您使用相机拍摄,并在评论、传头像等功能使用所拍摄的照片,我们需要访问您终端设备的摄像头权限和相册权限,如果您拒绝或关闭本项权限,我们将无法提供上述服务。'
|
||||||
|
|
||||||
|
},
|
||||||
|
"android.permission.READ_EXTERNAL_STORAGE": {
|
||||||
|
title: '正在获取相册权限',
|
||||||
|
content: '为了您使用相机拍摄,并在评论、传头像等功能使用所拍摄的照片,我们需要访问您终端设备的摄像头权限和相册权限,如果您拒绝或关闭本项权限,我们将无法提供上述服务。'
|
||||||
|
|
||||||
|
},
|
||||||
|
"android.permission.CAMERA": {
|
||||||
|
title: '正在获取摄像头权限',
|
||||||
|
content: '您可以拍照设置头像、拍照上传图片'
|
||||||
|
|
||||||
|
},
|
||||||
|
"android.permission.ACCESS_COARSE_LOCATION": {
|
||||||
|
title: '正在获取定位信息',
|
||||||
|
content: '可根据位置向您介绍附近的视频信息,提升浏览体验,或帮助你在发布的信息中展示位置,不授权不影响app正常使用'
|
||||||
|
},
|
||||||
|
"android.permission.ACCESS_FINE_LOCATION": {
|
||||||
|
title: '正在获取定位信息',
|
||||||
|
content: '可根据位置向您介绍附近的视频信息,提升浏览体验,或帮助你在发布的信息中展示位置,不授权不影响app正常使用'
|
||||||
|
},
|
||||||
|
"android.permission.RECORD_AUDIO": {
|
||||||
|
title: '正在获取麦克风权限',
|
||||||
|
content: '为了您使用发送语音消息功能,我们需要访问您终端设备的麦克风权限,不授权不影响app正常使用'
|
||||||
|
}
|
||||||
|
}
|
@ -288,7 +288,8 @@ const clickFeedBack = (fn) => {
|
|||||||
}
|
}
|
||||||
if (uni.getSystemInfoSync().platform == 'android') {
|
if (uni.getSystemInfoSync().platform == 'android') {
|
||||||
// vibrateShort
|
// vibrateShort
|
||||||
uni.vibrateLong({
|
// uni.vibrateLong({
|
||||||
|
uni.vibrateShort({
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log('点击震动');
|
console.log('点击震动');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user