4.0.0
This commit is contained in:
parent
4faa8cdb10
commit
0fb5844b6a
61
App.vue
61
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(); // 检测启动参数
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (storage.getHasLogin()) {
|
||||||
// init im
|
// init im
|
||||||
TUIChatKit.init();
|
TUIChatKit.init();
|
||||||
console.log('IM初始化完成');
|
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 |
@ -32,17 +32,13 @@
|
|||||||
</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';
|
||||||
@ -73,7 +69,7 @@ interface IEmits {
|
|||||||
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();
|
||||||
|
|
||||||
@ -86,11 +82,9 @@ const actionItems = ref([
|
|||||||
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',
|
key: 'copy',
|
||||||
@ -100,7 +94,7 @@ const actionItems = ref([
|
|||||||
if (!featureConfig.CopyMessage || !message.value) return false;
|
if (!featureConfig.CopyMessage || !message.value) return false;
|
||||||
return message.value.type === TYPES.MSG_TEXT;
|
return message.value.type === TYPES.MSG_TEXT;
|
||||||
},
|
},
|
||||||
clickEvent: copyMessage,
|
clickEvent: copyMessage
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'revoke',
|
key: 'revoke',
|
||||||
@ -110,7 +104,7 @@ const actionItems = ref([
|
|||||||
if (!featureConfig.RevokeMessage || !message.value) return false;
|
if (!featureConfig.RevokeMessage || !message.value) return false;
|
||||||
return message.value.flow === 'out' && message.value.status === 'success';
|
return message.value.flow === 'out' && message.value.status === 'success';
|
||||||
},
|
},
|
||||||
clickEvent: revokeMessage,
|
clickEvent: revokeMessage
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'delete',
|
key: 'delete',
|
||||||
@ -120,7 +114,7 @@ const actionItems = ref([
|
|||||||
if (!featureConfig.DeleteMessage || !message.value) return false;
|
if (!featureConfig.DeleteMessage || !message.value) return false;
|
||||||
return message.value.status === 'success';
|
return message.value.status === 'success';
|
||||||
},
|
},
|
||||||
clickEvent: deleteMessage,
|
clickEvent: deleteMessage
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'forward',
|
key: 'forward',
|
||||||
@ -130,7 +124,7 @@ const actionItems = ref([
|
|||||||
if (!featureConfig.ForwardMessage || !message.value) return false;
|
if (!featureConfig.ForwardMessage || !message.value) return false;
|
||||||
return message.value.status === 'success';
|
return message.value.status === 'success';
|
||||||
},
|
},
|
||||||
clickEvent: forwardSingleMessage,
|
clickEvent: forwardSingleMessage
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'quote',
|
key: 'quote',
|
||||||
@ -141,29 +135,40 @@ const actionItems = ref([
|
|||||||
const _message = TUIStore.getMessageModel(message.value.ID);
|
const _message = TUIStore.getMessageModel(message.value.ID);
|
||||||
return message.value.status === 'success' && !_message.getSignalingInfo();
|
return message.value.status === 'success' && !_message.getSignalingInfo();
|
||||||
},
|
},
|
||||||
clickEvent: quoteMessage,
|
clickEvent: quoteMessage
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'translate',
|
|
||||||
text: TUITranslateService.t('TUIChat.翻译'),
|
|
||||||
visible: false,
|
|
||||||
iconUrl: translateIcon,
|
|
||||||
renderCondition() {
|
|
||||||
if (!featureConfig.TranslateMessage || !message.value) return false;
|
|
||||||
return message.value.status === 'success' && message.value.type === TYPES.MSG_TEXT;
|
|
||||||
},
|
|
||||||
clickEvent: translateMessage,
|
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// key: 'translate',
|
||||||
|
// text: TUITranslateService.t('TUIChat.翻译'),
|
||||||
|
// visible: false,
|
||||||
|
// iconUrl: translateIcon,
|
||||||
|
// renderCondition() {
|
||||||
|
// if (!featureConfig.TranslateMessage || !message.value) return false;
|
||||||
|
// return message.value.status === 'success' && message.value.type === TYPES.MSG_TEXT;
|
||||||
|
// },
|
||||||
|
// clickEvent: translateMessage,
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// key: 'convert',
|
||||||
|
// text: TUITranslateService.t('TUIChat.转文字'),
|
||||||
|
// visible: false,
|
||||||
|
// iconUrl: convertText,
|
||||||
|
// renderCondition() {
|
||||||
|
// if (!featureConfig.VoiceToText || !message.value) return false;
|
||||||
|
// return message.value.status === 'success' && message.value.type === TYPES.MSG_AUDIO;
|
||||||
|
// },
|
||||||
|
// clickEvent: convertVoiceToText,
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
key: 'convert',
|
key: 'convert',
|
||||||
text: TUITranslateService.t('TUIChat.转文字'),
|
text: '举报',
|
||||||
visible: false,
|
visible: false,
|
||||||
iconUrl: convertText,
|
iconUrl: juBao,
|
||||||
renderCondition() {
|
renderCondition() {
|
||||||
if (!featureConfig.VoiceToText || !message.value) return false;
|
if (!featureConfig.VoiceToText || !message.value) return false;
|
||||||
return message.value.status === 'success' && message.value.type === TYPES.MSG_AUDIO;
|
return message.value.status === 'success';
|
||||||
},
|
},
|
||||||
clickEvent: convertVoiceToText,
|
clickEvent: toReport
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'multi-select',
|
key: 'multi-select',
|
||||||
@ -173,8 +178,8 @@ const actionItems = ref([
|
|||||||
if (!featureConfig.MultiSelection || !message.value) return false;
|
if (!featureConfig.MultiSelection || !message.value) return false;
|
||||||
return message.value.status === 'success';
|
return message.value.status === 'success';
|
||||||
},
|
},
|
||||||
clickEvent: multipleSelectMessage,
|
clickEvent: multipleSelectMessage
|
||||||
},
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const message = ref<IMessageModel>();
|
const message = ref<IMessageModel>();
|
||||||
@ -183,14 +188,14 @@ 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
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -242,7 +247,7 @@ function revokeMessage() {
|
|||||||
const message = TUITranslateService.t('TUIChat.已过撤回时限');
|
const message = TUITranslateService.t('TUIChat.已过撤回时限');
|
||||||
Toast({
|
Toast({
|
||||||
message,
|
message,
|
||||||
type: TOAST_TYPE.ERROR,
|
type: TOAST_TYPE.ERROR
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -254,10 +259,20 @@ function deleteMessage() {
|
|||||||
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
|
||||||
@ -295,17 +310,17 @@ function translateMessage() {
|
|||||||
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
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -313,17 +328,17 @@ 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
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,7 +349,7 @@ function multipleSelectMessage() {
|
|||||||
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) {
|
||||||
@ -349,7 +364,7 @@ function onMessageTranslationInfoUpdated(info: Map<string, ITranslateInfo[]>) {
|
|||||||
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) {
|
||||||
@ -362,12 +377,12 @@ function onMessageConvertInfoUpdated(info: Map<string, IConvertInfo[]>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"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",
|
||||||
|
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
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
:src="videoUrl"
|
:src="videoUrl"
|
||||||
autoplay="true"
|
autoplay="true"
|
||||||
controls="true"
|
controls="true"
|
||||||
:object-fit="objectFit"></video>
|
:object-fit="objectFit"
|
||||||
|
></video>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -15,14 +16,17 @@ 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;
|
||||||
|
var fileName = path.split('/').pop();
|
||||||
|
// let videoUrl = 'https://wuzhongjie.com.cn/vlogData/' + fileName;
|
||||||
|
let videoUrl = params.localFile;
|
||||||
this.videoUrl = videoUrl;
|
this.videoUrl = videoUrl;
|
||||||
let width = parseInt(params.width);
|
let width = parseInt(params.width);
|
||||||
let height = parseInt(params.height);
|
let height = parseInt(params.height);
|
||||||
@ -30,12 +34,12 @@ export default {
|
|||||||
this.height = height;
|
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>
|
||||||
|
|
||||||
|
@ -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,11 +429,16 @@ 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) {
|
||||||
|
var localdom = this.$refs[indexProp];
|
||||||
|
this.getLocation(localdom);
|
||||||
|
} else {
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
try {
|
try {
|
||||||
this.$refs[indexProp].get();
|
this.$refs[indexProp].get();
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
this.$refs[beforeProp].hideVd();
|
this.$refs[beforeProp].hideVd();
|
||||||
} catch {}
|
} catch {}
|
||||||
|
@ -2,14 +2,16 @@
|
|||||||
/**** 此文件说明请看注释 *****/
|
/**** 此文件说明请看注释 *****/
|
||||||
// 可以用自己项目的请求方法
|
// 可以用自己项目的请求方法
|
||||||
// 请求配置说明:https://ext.dcloud.net.cn/plugin?id=822
|
// 请求配置说明:https://ext.dcloud.net.cn/plugin?id=822
|
||||||
import { getAppVersion } from "@/api/message.js";
|
import {
|
||||||
|
getAppVersion
|
||||||
|
} from "@/api/message.js";
|
||||||
|
|
||||||
const platform = uni.getSystemInfoSync().platform;
|
const platform = uni.getSystemInfoSync().platform;
|
||||||
// 主颜色
|
// 主颜色
|
||||||
const $mainColor = "#1ABC9C";
|
const $mainColor = "#1ABC9C";
|
||||||
// 弹窗图标url
|
// 弹窗图标url
|
||||||
const $iconUrl =
|
const $iconUrl =
|
||||||
"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/app/upgrade.png";
|
"https://wuzhongjie.com.cn/download/logo.png";
|
||||||
|
|
||||||
// 获取当前应用的版本号
|
// 获取当前应用的版本号
|
||||||
export const getCurrentNo = function(callback) {
|
export const getCurrentNo = function(callback) {
|
||||||
@ -57,8 +59,7 @@ export const getDownload = function (data) {
|
|||||||
popupData,
|
popupData,
|
||||||
function(res) {
|
function(res) {
|
||||||
dtask = plus.downloader.createDownload(
|
dtask = plus.downloader.createDownload(
|
||||||
data.downloadUrl,
|
data.downloadUrl, {
|
||||||
{
|
|
||||||
filename: "_doc/update/",
|
filename: "_doc/update/",
|
||||||
},
|
},
|
||||||
function(download, status) {
|
function(download, status) {
|
||||||
@ -70,8 +71,7 @@ export const getDownload = function (data) {
|
|||||||
buttonNum: 0,
|
buttonNum: 0,
|
||||||
});
|
});
|
||||||
plus.runtime.install(
|
plus.runtime.install(
|
||||||
download.filename,
|
download.filename, {},
|
||||||
{},
|
|
||||||
function() {
|
function() {
|
||||||
res.change({
|
res.change({
|
||||||
contentText: "应用资源更新完成!",
|
contentText: "应用资源更新完成!",
|
||||||
@ -264,8 +264,7 @@ function updatePopup(data, callback) {
|
|||||||
|
|
||||||
// 弹窗容器高度
|
// 弹窗容器高度
|
||||||
let popupViewHeight = 400;
|
let popupViewHeight = 400;
|
||||||
let popupViewContentList = [
|
let popupViewContentList = [{
|
||||||
{
|
|
||||||
src: $iconUrl,
|
src: $iconUrl,
|
||||||
id: "logo",
|
id: "logo",
|
||||||
tag: "img",
|
tag: "img",
|
||||||
@ -359,47 +358,37 @@ function updatePopup(data, callback) {
|
|||||||
width: "80%",
|
width: "80%",
|
||||||
});
|
});
|
||||||
// 绘制白色背景
|
// 绘制白色背景
|
||||||
popupView.drawRect(
|
popupView.drawRect({
|
||||||
{
|
|
||||||
color: "#FFFFFF",
|
color: "#FFFFFF",
|
||||||
radius: "8px",
|
radius: "8px",
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
top: "40px",
|
top: "40px",
|
||||||
height: popupViewHeight - 40 + "px",
|
height: popupViewHeight - 40 + "px",
|
||||||
}
|
});
|
||||||
);
|
|
||||||
// 绘制底边按钮
|
// 绘制底边按钮
|
||||||
popupView.drawRect(
|
popupView.drawRect({
|
||||||
{
|
|
||||||
radius: "3px",
|
radius: "3px",
|
||||||
borderColor: "#f1f1f1",
|
borderColor: "#f1f1f1",
|
||||||
borderWidth: "1px",
|
borderWidth: "1px",
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
bottom: viewContentPadding + "px",
|
bottom: viewContentPadding + "px",
|
||||||
left: viewContentPadding + "px",
|
left: viewContentPadding + "px",
|
||||||
width: (viewContentWidth - viewContentPadding) / 2 + "px",
|
width: (viewContentWidth - viewContentPadding) / 2 + "px",
|
||||||
height: "30px",
|
height: "30px",
|
||||||
}
|
});
|
||||||
);
|
|
||||||
// 绘制底边按钮
|
// 绘制底边按钮
|
||||||
popupView.drawRect(
|
popupView.drawRect({
|
||||||
{
|
|
||||||
radius: "3px",
|
radius: "3px",
|
||||||
color: $mainColor,
|
color: $mainColor,
|
||||||
borderColor: $mainColor,
|
borderColor: $mainColor,
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
bottom: viewContentPadding + "px",
|
bottom: viewContentPadding + "px",
|
||||||
left:
|
left: (viewContentWidth - viewContentPadding) / 2 +
|
||||||
(viewContentWidth - viewContentPadding) / 2 +
|
|
||||||
viewContentPadding * 2 +
|
viewContentPadding * 2 +
|
||||||
"px",
|
"px",
|
||||||
width: (viewContentWidth - viewContentPadding) / 2 + "px",
|
width: (viewContentWidth - viewContentPadding) / 2 + "px",
|
||||||
height: "30px",
|
height: "30px",
|
||||||
}
|
});
|
||||||
);
|
|
||||||
popupViewContentList.push({
|
popupViewContentList.push({
|
||||||
tag: "rect",
|
tag: "rect",
|
||||||
id: "confimBtn",
|
id: "confimBtn",
|
||||||
@ -497,8 +486,7 @@ function downloadPopupDrawing(data) {
|
|||||||
let popupViewHeight = viewContentPadding * 3 + 60;
|
let popupViewHeight = viewContentPadding * 3 + 60;
|
||||||
let progressTip = data.progressTip || "准备下载...";
|
let progressTip = data.progressTip || "准备下载...";
|
||||||
let contentText = data.contentText || "正在为您更新,请耐心等待";
|
let contentText = data.contentText || "正在为您更新,请耐心等待";
|
||||||
let elementList = [
|
let elementList = [{
|
||||||
{
|
|
||||||
tag: "rect", //背景色
|
tag: "rect", //背景色
|
||||||
color: "#FFFFFF",
|
color: "#FFFFFF",
|
||||||
rectStyles: {
|
rectStyles: {
|
||||||
@ -540,8 +528,7 @@ function downloadPopupDrawing(data) {
|
|||||||
// 是否有进度条
|
// 是否有进度条
|
||||||
if (data.progress) {
|
if (data.progress) {
|
||||||
popupViewHeight += viewContentPadding + 40;
|
popupViewHeight += viewContentPadding + 40;
|
||||||
elementList = elementList.concat([
|
elementList = elementList.concat([{
|
||||||
{
|
|
||||||
tag: "font",
|
tag: "font",
|
||||||
id: "progressValue",
|
id: "progressValue",
|
||||||
text: progressTip,
|
text: progressTip,
|
||||||
@ -639,8 +626,7 @@ function downloadPopupDrawing(data) {
|
|||||||
}
|
}
|
||||||
if (data.buttonNum == 1) {
|
if (data.buttonNum == 1) {
|
||||||
popupViewHeight += viewContentPadding + 40;
|
popupViewHeight += viewContentPadding + 40;
|
||||||
elementList = elementList.concat([
|
elementList = elementList.concat([{
|
||||||
{
|
|
||||||
tag: "rect", //绘制底边按钮
|
tag: "rect", //绘制底边按钮
|
||||||
rectStyles: {
|
rectStyles: {
|
||||||
radius: "6px",
|
radius: "6px",
|
||||||
@ -696,8 +682,7 @@ function downloadPopup(data, callback, cancelCallback, rebootCallback) {
|
|||||||
let popupView = new plus.nativeObj.View("popupView", {
|
let popupView = new plus.nativeObj.View("popupView", {
|
||||||
//创建底部图标菜单
|
//创建底部图标菜单
|
||||||
tag: "rect",
|
tag: "rect",
|
||||||
top:
|
top: (popupViewData.screenHeight - popupViewData.popupViewHeight) / 2 + "px",
|
||||||
(popupViewData.screenHeight - popupViewData.popupViewHeight) / 2 + "px",
|
|
||||||
left: "15%",
|
left: "15%",
|
||||||
height: popupViewData.popupViewHeight + "px",
|
height: popupViewData.popupViewHeight + "px",
|
||||||
width: "70%",
|
width: "70%",
|
||||||
@ -765,8 +750,7 @@ function downloadPopup(data, callback, cancelCallback, rebootCallback) {
|
|||||||
position: {
|
position: {
|
||||||
top: popupViewData.viewContentPadding * 4 + 60 + "px",
|
top: popupViewData.viewContentPadding * 4 + 60 + "px",
|
||||||
left: popupViewData.viewContentPadding + "px",
|
left: popupViewData.viewContentPadding + "px",
|
||||||
width:
|
width: popupViewData.viewContentWidth * (res.progressValue / 100) + "px",
|
||||||
popupViewData.viewContentWidth * (res.progressValue / 100) + "px",
|
|
||||||
height: "8px",
|
height: "8px",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -809,8 +793,7 @@ function downloadPopup(data, callback, cancelCallback, rebootCallback) {
|
|||||||
buttonNum = res.buttonNum;
|
buttonNum = res.buttonNum;
|
||||||
popupView.reset();
|
popupView.reset();
|
||||||
popupViewData = downloadPopupDrawing(
|
popupViewData = downloadPopupDrawing(
|
||||||
Object.assign(
|
Object.assign({
|
||||||
{
|
|
||||||
progressValue: progressValue,
|
progressValue: progressValue,
|
||||||
progressTip: progressTip,
|
progressTip: progressTip,
|
||||||
contentText: contentText,
|
contentText: contentText,
|
||||||
@ -833,8 +816,7 @@ function downloadPopup(data, callback, cancelCallback, rebootCallback) {
|
|||||||
progressElement = newElement.concat(progressElement);
|
progressElement = newElement.concat(progressElement);
|
||||||
popupView.setStyle({
|
popupView.setStyle({
|
||||||
tag: "rect",
|
tag: "rect",
|
||||||
top:
|
top: (popupViewData.screenHeight - popupViewData.popupViewHeight) / 2 +
|
||||||
(popupViewData.screenHeight - popupViewData.popupViewHeight) / 2 +
|
|
||||||
"px",
|
"px",
|
||||||
left: "15%",
|
left: "15%",
|
||||||
height: popupViewData.popupViewHeight + "px",
|
height: popupViewData.popupViewHeight + "px",
|
||||||
|
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