app支持打开微信小程序直播,分享支持微信小程序

master
gongfuxiang 2023-12-15 00:13:03 +08:00
parent a502c02536
commit 48cac77e72
6 changed files with 85 additions and 31 deletions

17
App.vue
View File

@ -1030,16 +1030,13 @@
articleTitle: share.title,
description: share.desc,
image: share.img,
video:
(share.video || null) == null
? []
: [
{
url: share.video,
duration: '100',
image: share.img,
},
],
video: (share.video || null) == null ? [] : [
{
url: share.video,
duration: '100',
image: share.img,
},
],
});
// #endif
},

View File

@ -1,7 +1,7 @@
<template>
<view :class="theme_view">
<!-- 是否有网络 -->
<view v-if="network_type_value == 'none'" class="network-type-tips pa left-0 wh-auto tc bs-bb padding-horizontal-main">
<view v-if="network_type_value == 'none'" class="network-type-tips wh-auto tc bs-bb padding-horizontal-main">
<view class="cr-base text-size">暂时无网络连接</view>
<view class="cr-grey margin-top-sm">请您检查是否系统设置-蜂窝移动网络中是否允许{{title}}APP使用蜂窝移动网络或无线局域网</view>
</view>
@ -77,7 +77,7 @@
</script>
<style>
.network-type-tips {
top: calc(50vh - 60rpx);
padding-top: 15%;
}
.no-data-box {
padding: 15% 0;

View File

@ -212,7 +212,27 @@
//
var share = app.globalData.share_content_handle(this.share_info || {});
var img = this.images || share.img;
var url = this.url || share.url;
var title = this.title || share.title;
var summary = this.summary || share.desc;
var type = (this.type === null) ? ((img || null) == null ? 1 : 0) : this.type;
var miniProgram = {};
// #ifdef APP
// id
if(scene == 'WXSceneSession') {
var weixin_original_id = app.globalData.get_config('config.common_app_mini_share_weixin_original_id', null);
if(weixin_original_id != null) {
type = 5;
miniProgram = {
id: weixin_original_id,
path: url.split('#')[1],
type: 0,
webUrl: url,
};
}
}
// #endif
//
this.setData({
@ -224,10 +244,11 @@
provider: provider,
scene: scene,
type: type,
href: this.url || share.url,
title: this.title || share.title,
summary: this.summary || share.desc,
href: url,
title: title,
summary: summary,
imageUrl: img,
miniProgram: miniProgram,
success: function (res) {},
fail: function (err) {}
});

View File

@ -167,18 +167,19 @@
}
},
"__usePrivacyCheck__" : true,
"plugins" : {}
"plugins" : {
// ->-> https://mp.weixin.qq.com/wxopen/pluginbasicprofile?action=intro&appid=wx2b03c6e691cd7370
// "live-player-plugin" : {
// "version" : "1.3.5",
// "provider" : "wx2b03c6e691cd7370"
// },
// 线->->线 https://mp.weixin.qq.com/wxopen/plugindevdoc?appid=wx50b5593e81dd937a
// "routePlan" : {
// "version" : "1.0.19",
// "provider" : "wx50b5593e81dd937a"
// }
}
},
// ->-> https://mp.weixin.qq.com/wxopen/pluginbasicprofile?action=intro&appid=wx2b03c6e691cd7370
// "live-player-plugin" : {
// "version" : "1.3.5",
// "provider" : "wx2b03c6e691cd7370"
// },
// 线->->线 https://mp.weixin.qq.com/wxopen/plugindevdoc?appid=wx50b5593e81dd937a
// "routePlan" : {
// "version" : "1.0.19",
// "provider" : "wx50b5593e81dd937a"
// }
"mp-alipay" : {
"usingComponents" : true,
"appid" : "2021001173639600"

View File

@ -15,7 +15,7 @@
<view class="home-top-nav margin-bottom-sm pr padding-right-main">
<!-- 定位 -->
<view v-if="is_home_location_choice == 1" class="home-top-nav-location dis-inline-block va-m single-text cr-white pr bs-bb padding-left-main padding-right-lg" @tap="choose_user_location_event">
<view class="dis-inline-block va-m">
<view class="dis-inline-block va-m lh">
<iconfont name="icon-location" size="32rpx" prop-class="lh" color="#fff"></iconfont>
</view>
<text class="va-m margin-left-xs text-size-md">{{user_location.text || ''}}</text>

View File

@ -181,15 +181,50 @@
},
//
player_event(e) {
player_event(e) {
//
var params = encodeURIComponent(
JSON.stringify({
type: 'detail',
})
);
);
var url = `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${this.detail.roomid}&custom_params=${params}`;
// #ifdef APP
// APP
var weixin_original_id = app.globalData.get_config('config.common_app_mini_share_weixin_original_id', null);
if(weixin_original_id != null) {
plus.share.getServices(res => {
let sweixin = null;
for(let i in res) {
if(res[i].id == 'weixin') {
sweixin = res[i];
}
}
//
if(sweixin) {
sweixin.launchMiniProgram({
id: weixin_original_id,
type: 0,
path: url
});
} else {
app.globalData.showToast('未安装微信APP');
}
});
}
return false;
// #endif
// #ifdef MP-WEIXIN
uni.navigateTo({
url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${this.detail.roomid}&custom_params=${params}`,
});
url: url
});
return false;
// #endif
// APP
app.globalData.showToast('请在微信小程序中打开');
},
//