app支持打开微信小程序直播,分享支持微信小程序
parent
a502c02536
commit
48cac77e72
17
App.vue
17
App.vue
|
|
@ -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
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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) {}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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('请在微信小程序中打开');
|
||||
},
|
||||
|
||||
// 海报分享
|
||||
|
|
|
|||
Loading…
Reference in New Issue