提交 6a0dd700 编写于 作者: DCloud_JSON's avatar DCloud_JSON

为迎合苹果App Store的规则,登陆与分享功能项显示之前自动检测是否安装了对应客户端。比如:设备未安装微信则不显示微信快捷登陆和微信分享选项。

上级 8772e133
## 1.0.15(2021-06-07)
为迎合苹果App Store的规则,登陆与分享功能项显示之前自动检测是否安装了对应客户端。比如:设备未安装微信则不显示微信快捷登陆和微信分享选项。
## 1.0.14(2021-06-07)
修改错误的表名称uni-verify为opendb-verify-codes
## 1.0.13(2021-06-04)
......
......@@ -39,9 +39,9 @@
}
},
props: {
agree:{
type:Boolean,
default(){
agree: {
type: Boolean,
default () {
return false
}
},
......@@ -105,7 +105,7 @@
//去掉配置项中不存在的项
for (var i = 0; i < servicesList.length; i++) {
if (!this.loginConfig.includes(servicesList[i].id)) {
console.log('去掉配置项中不存在的项',servicesList[i].id);
console.log('去掉配置项中不存在的项', servicesList[i].id);
servicesList.splice(i, 1)
}
}
......@@ -119,15 +119,23 @@
oauthServices.forEach(({
id
}) => {
// console.log(9527,id);
if (this.config[id].isChecked&&this.loginConfig.includes(id)) {
if (this.config[id].isChecked && this.loginConfig.includes(id)) {
if (id == 'weixin') {
if (~plus.runtime.isApplicationExist({
pname: 'com.tencent.mm',
action: 'weixin://'
})) {
// console.log("微信应用未安装");
return
}
}
this.servicesList.push({
...this.config[id],
id
})
}
})
// console.log(oauthServices);
// console.log('oauthServices',oauthServices);
}, err => {
uni.hideLoading()
uni.showModal({
......@@ -171,13 +179,15 @@
}
},
login_before(type, navigateBack = true) {
if(!this.agree){
if (!this.agree) {
return uni.showToast({
title: '你未同意隐私政策协议',
icon: 'none'
});
}
uni.showLoading({mask:true})
uni.showLoading({
mask: true
})
// console.log(arguments);
let oauthService = this.oauthServices.find((service) => service.id == type)
// console.log(type);
......@@ -195,10 +205,10 @@
},
err => {
uni.hideLoading()
console.log(err);
uni.showModal({
content: JSON.stringify(err),
showCancel: false
console.log(err);
uni.showModal({
content: JSON.stringify(err),
showCancel: false
});
})
}
......@@ -233,7 +243,7 @@
console.log(err);
if (type == 'univerify') {
if (err.metadata&&err.metadata.error_data) {
if (err.metadata && err.metadata.error_data) {
uni.showToast({
title: "一键登录:" + err.metadata.error_data,
icon: 'none'
......@@ -249,33 +259,33 @@
uni.navigateBack()
}
break;
case 30006:
uni.showModal({
title: "登录服务初始化错误",
content: err.metadata.error_data,
showCancel: false,
confirmText: '知道了',
});
break;
case "30008":
uni.showToast({
title: '点击了第三方登陆',
icon: 'none'
});
switch (err.index){
case 0:
this.login_before('weixin',false)
break;
case 1:
this.login_before('apple',false)
break;
default:
break;
}
case 30006:
uni.showModal({
title: "登录服务初始化错误",
content: err.metadata.error_data,
showCancel: false,
confirmText: '知道了',
});
break;
default:
console.log(9527,err);
case "30008":
uni.showToast({
title: '点击了第三方登陆',
icon: 'none'
});
switch (err.index) {
case 0:
this.login_before('weixin', false)
break;
case 1:
this.login_before('apple', false)
break;
default:
break;
}
break;
default:
console.log(9527, err);
break;
}
}
......@@ -283,31 +293,34 @@
})
},
login(params, type) { //联网验证登录
console.log('type--', type);
console.log({
params,
type
});
uniCloud.callFunction({
name:'uni-id-cf',
data:{
action:'login_by_'+type,
params
},
success: ({result}) => {
console.log(result);
if (result.code === 0) {
if (type == 'univerify') {
uni.closeAuthView()
}
uni.hideLoading()
loginSuccess(result)
delete result.userInfo.token
this.setUserInfo(result.userInfo)
}
},
complete: () => {
uni.hideLoading()
}
uniCloud.callFunction({
name: 'uni-id-cf',
data: {
action: 'login_by_' + type,
params
},
success: ({
result
}) => {
console.log(result);
if (result.code === 0) {
if (type == 'univerify') {
uni.closeAuthView()
}
uni.hideLoading()
loginSuccess(result)
delete result.userInfo.token
this.setUserInfo(result.userInfo)
}
},
complete: () => {
uni.hideLoading()
}
})
},
async getUserInfo(e) {
......@@ -357,4 +370,4 @@
margin-top: 4px;
font-size: 26rpx;
}
</style>
</style>
{
"id": "uni-starter",
"displayName": "uni-starter",
"version": "1.0.14",
"version": "1.0.15",
"description": "云端一体应用快速开发模版",
"keywords": [
"uni-starter",
......
<template>
<view class="pagse">
<!-- #ifndef H5 -->
<statusBar></statusBar>
<!-- #endif -->
<!-- 搜索功能 -->
<uni-search-bar @click="searchClick" class="uni-search-box" v-model="keyword" ref="searchBar" radius="100" cancelButton="none" disabled/>
<view class="pagse">
<!-- #ifndef H5 -->
<statusBar></statusBar>
<!-- #endif -->
<!-- 搜索功能 -->
<uni-search-bar @click="searchClick" class="uni-search-box" v-model="keyword" ref="searchBar" radius="100"
cancelButton="none" disabled />
<unicloud-db ref='udb' v-slot:default="{data,pagination,hasMore, loading, error, options}" @error="onqueryerror"
:where="where" collection="opendb-news-articles,uni-id-users" :page-size="10"
field="avatar,title,last_modify_date,user_id.username">
field="avatar,title,last_modify_date,user_id.username">
<!-- 基于 uni-list 的页面布局 -->
<uni-list class="uni-list" :border="false" :bounce="true" :alwaysScrollableVertical="true" :style="{height:listHight}">
<uni-list-item :to="'./detail?id='+item._id+'&title='+item.title"
v-for="(item,index) in data" :key="index">
<uni-list class="uni-list" :border="false" :bounce="true" :alwaysScrollableVertical="true"
:style="{height:listHight}">
<uni-list-item :to="'./detail?id='+item._id+'&title='+item.title" v-for="(item,index) in data"
:key="index">
<!-- 通过header插槽定义列表左侧图片 -->
<template v-slot:header>
<image class="avatar" :src="item.avatar" mode="aspectFill"></image>
......@@ -21,26 +23,29 @@
<text class="title">{{ item.title }}</text>
<view class="info">
<text class="author">{{item.user_id[0].username}}</text>
<uni-dateformat class="last_modify_date" :date="item.last_modify_date"
format="yyyy-MM-dd" :threshold="[60000, 2592000000]" />
<uni-dateformat class="last_modify_date" :date="item.last_modify_date" format="yyyy-MM-dd"
:threshold="[60000, 2592000000]" />
</view>
</view>
</uni-list-item>
<uni-list-item>
<template slot="body">
<uni-load-state @networkResume="refresh" :state="{data,pagination,hasMore, loading, error}"></uni-load-state>
</template>
<uni-list-item>
<template slot="body">
<uni-load-state @networkResume="refresh" :state="{data,pagination,hasMore, loading, error}">
</uni-load-state>
</template>
</uni-list-item>
</uni-list>
</uni-list>
</unicloud-db>
</view>
</template>
<script>
var cdbRef, currentWebview;
var cdbRef, currentWebview;
import statusBar from "@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar";
export default {
components: { statusBar },
export default {
components: {
statusBar
},
data() {
return {
where: "",
......@@ -48,72 +53,75 @@
refreshState: 0,
listHight: 0
}
},
watch: {
keyword(keyword, oldValue) {
if(keyword){
this.where = `/${keyword}/.test(title)`;
}else{
this.where = '';
}
}
},
onReady() {
// #ifdef APP-NVUE
this.listHight = uni.getSystemInfoSync().windowHeight - 96 + 'px'
// #endif
// #ifndef APP-NVUE
this.listHight = 'auto'
watch: {
keyword(keyword, oldValue) {
if (keyword) {
this.where = `/${keyword}/.test(title)`;
} else {
this.where = '';
}
}
},
onReady() {
// #ifdef APP-NVUE
this.listHight = uni.getSystemInfoSync().windowHeight - 96 + 'px'
// #endif
// #ifndef APP-NVUE
this.listHight = 'auto'
// #endif
cdbRef = this.$refs.udb
cdbRef = this.$refs.udb
},
onShow() {
this.keyword = getApp().globalData.searchText
getApp().globalData.searchText = ''
if(this.keyword){
// #ifdef APP-PLUS
if (!currentWebview) {
let pages = getCurrentPages();
currentWebview = pages[pages.length - 1].$getAppWebview();
}
// 设置 searchInput的 text
currentWebview.setTitleNViewSearchInputText(this.keyword)
// #endif
if (this.keyword) {
// #ifdef APP-PLUS
if (!currentWebview) {
let pages = getCurrentPages();
currentWebview = pages[pages.length - 1].$getAppWebview();
}
// 设置 searchInput的 text
currentWebview.setTitleNViewSearchInputText(this.keyword)
// #endif
}
},
methods: {
searchClick(e) { //点击搜索框
searchClick(e) { //点击搜索框
uni.hideKeyboard();
uni.navigateTo({
url: '/pages/list/search/search',
animationType: 'fade-in'
});
},
retry(){
this.refresh()
},
refresh(){
cdbRef.loadData({
clear: true
}, () => {
uni.stopPullDownRefresh()
})
console.log('refresh');
},
retry() {
this.refresh()
},
refresh() {
cdbRef.loadData({
clear: true
}, () => {
uni.stopPullDownRefresh()
})
console.log('refresh');
}
},
onPullDownRefresh() {
this.refresh()
},
onReachBottom() {
cdbRef.loadMore({clear: true})
cdbRef.loadMore({
clear: true
})
}
}
</script>
<style scoped>
.pagse{
background-color: #FFFFFF;
<style scoped>
.pagse {
background-color: #FFFFFF;
}
.avatar {
width: 200rpx;
height: 200rpx;
......@@ -160,7 +168,8 @@
/* #ifndef APP-PLUS */
z-index: 9;
/* #endif */
}
}
.show-refresh-tip {
transform: translateY(0);
height: 40px;
......@@ -184,8 +193,10 @@
width: 750rpx;
text-align: center;
}
.uni-list {}
.f1{
flex: 1;
.uni-list {}
.f1 {
flex: 1;
}
</style>
......@@ -67,9 +67,10 @@
onReady() {
//#ifdef APP-PLUS
if (univerify_first) {
console.log('开始一键登录');
console.log('开始一键登录');
this.agree = true
setTimeout(() => {
this.$refs.uniQuickLogin.login('univerify')
this.$refs.uniQuickLogin.login_before('univerify')
}, 100)
setTimeout(() => {
currentWebview.setStyle({
......
......@@ -26,7 +26,7 @@ module.exports = {
"/pages/ucenter/userinfo/uploadCutImageToUnicloud",
"/uni_modules/uni-feedback/pages/uni-feedback/add"
],
"login": ["smsCode","univerify", "username", "weixin", "apple"],
"login": ["univerify","smsCode", "username", "weixin", "apple"],
/*
根据数组的第0项,决定登录方式的第一优先级。
未列举到的,或设备环境不支持的选项,将被隐藏。
......
......@@ -198,7 +198,7 @@ exports.main = async (event, context) => {
await loginLog(res)
break;
case 'login_by_univerify':
res = await uniID.loginByuniverify(params)
res = await uniID.loginByUniverify(params)
await loginLog(res)
break;
case 'login_by_apple':
......
......@@ -22,7 +22,7 @@
"license": "Apache-2.0"
},
"../../../uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id": {
"version": "3.0.12",
"version": "3.1.0",
"license": "Apache-2.0",
"dependencies": {
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
......
{
"id": "uni-id",
"displayName": "uni-id",
"displayName": "uni-id公共模块",
"version": "3.1.0",
"description": "简单、统一、可扩展的用户中心",
"keywords": [
......@@ -21,10 +21,10 @@
],
"sale": {
"regular": {
"price": "0.00"
"price": 0
},
"sourcecode": {
"price": "0.00"
"price": 0
}
},
"contact": {
......
{
"name": "uni-id",
"version": "3.0.12",
"version": "3.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "3.0.12",
"version": "3.1.0",
"license": "Apache-2.0",
"dependencies": {
"uni-captcha": "file:../../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha",
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
},
"../../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha": {
"version": "0.1.0",
"license": "Apache-2.0"
},
"../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center": {
"version": "0.0.2",
"license": "Apache-2.0"
},
"node_modules/uni-captcha": {
"resolved": "../../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha",
"link": true
},
"node_modules/uni-config-center": {
"resolved": "../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center",
"link": true
}
},
"dependencies": {
"uni-captcha": {
"version": "file:../../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha"
},
"uni-config-center": {
"version": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
......
{
"name": "uni-id",
"version": "3.0.12",
"version": "3.1.0",
"description": "uni-id for uniCloud",
"main": "index.js",
"homepage": "https://uniapp.dcloud.io/uniCloud/uni-id",
......@@ -11,6 +11,7 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
"uni-captcha": "file:../../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha",
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
}
## 1.0.4(2021-06-07)
为符合苹果应用市场的审核,只显示存在对应的分享客户端的选项。如:配置包含微信分享,但是用户手机上并没有安装微信,就不显示微信分享。
## 1.0.2(2021-05-06)
修复错误的提示:“打包时未添加oauth模块”
## 1.0.1(2021-04-30)
新增完整示例
## 1.0.0(2021-04-28)
第1版发布
var nvMask,nvImageMenu;
export default {
show({list,cancelText},callback){
if(!list){
list = [{
"img":"https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-dc-site/9a952c80-6080-11eb-a16f-5b3e54966275.png",
"text":"图标文字"
}]
}
if(list.length>8){
return uni.showToast({
title: '目前版本最多支持8个图标',
icon: 'none'
});
}
//以下为计算菜单的nview绘制布局,为固定算法,使用者无关关心
var screenWidth = plus.screen.resolutionWidth
//以360px宽度屏幕为例,上下左右边距及2排按钮边距留25像素,图标宽度55像素,同行图标间的间距在360宽的屏幕是30px,但需要动态计算,以此原则计算4列图标分别的left位置
//图标下的按钮文字距离图标5像素,文字大小12像素
//底部取消按钮高度固定为44px
//TODO 未处理横屏和pad,这些情况6个图标应该一排即可
var margin = 20,
iconWidth = 60,
icontextSpace = 5,
textHeight = 12
var left1 = margin / 360 * screenWidth
var iconSpace = (screenWidth - (left1 * 2) - (iconWidth * 4)) / 3 //屏幕宽度减去左右留白间距,再减去4个图标的宽度,就是3个同行图标的间距
if (iconSpace <= 5) { //屏幕过窄时,缩小边距和图标大小,再算一次
margin = 15
iconWidth = 40
left1 = margin / 360 * screenWidth
iconSpace = (screenWidth - (left1 * 2) - (iconWidth * 4)) / 3 //屏幕宽度减去左右留白间距,再减去4个图标的宽度,就是3个同行图标的间距
}
var left2 = left1 + iconWidth + iconSpace
var left3 = left1 + (iconWidth + iconSpace) * 2
var left4 = left1 + (iconWidth + iconSpace) * 3
var top1 = left1
var top2 = top1 + iconWidth + icontextSpace + textHeight + left1
nvMask = new plus.nativeObj.View("nvMask", { //先创建遮罩层
top: '0px',
left: '0px',
height: '100%',
width: '100%',
backgroundColor: 'rgba(0,0,0,0.2)'
});
nvMask.addEventListener("click", function() { //处理遮罩层点击
nvMask.hide();
nvImageMenu.hide();
})
nvImageMenu = new plus.nativeObj.View("nvImageMenu", { //创建底部图标菜单
bottom: '0px',
left: '0px',
height: (iconWidth + textHeight + 2 * margin)*Math.ceil(list.length/4) +44+'px',//'264px',
width: '100%',
backgroundColor: 'rgb(255,255,255)'
});
let myList = []
list.forEach((item,i)=>{
myList.push({
tag: 'img',
src: item.img,
position: {
top: eval('top'+( parseInt(i/4) +1)),
left: eval('left'+(1+i%4)),
width: iconWidth,
height: iconWidth
}
})
myList.push({
tag: 'font',
text: item.text,
textStyles: {
size: textHeight
},
position: {
top: eval('top'+(parseInt(i/4)+1)) + iconWidth + icontextSpace,
left: eval('left'+(1+i%4)),
width: iconWidth,
height: textHeight
}
})
})
//绘制底部图标菜单的内容
nvImageMenu.draw([
{
tag: 'rect',//菜单顶部的分割灰线
color: '#e7e7e7',
position: {
top: '0px',
height: '1px'
}
},
{
tag: 'font',
text: cancelText,//底部取消按钮的文字
textStyles: {
size: '14px'
},
position: {
bottom: '0px',
height: '44px'
}
},
{
tag: 'rect',//底部取消按钮的顶部边线
color: '#e7e7e7',
position: {
bottom: '45px',
height: '1px'
}
},
...myList
])
nvMask.show()
nvImageMenu.show() //5+应支持从底部向上弹出的动画
nvImageMenu.addEventListener("click",e=>{ //处理底部图标菜单的点击事件,根据点击位置触发不同的逻辑
// console.log("click menu"+JSON.stringify(e));
if (e.screenY > plus.screen.resolutionHeight - 44) { //点击了底部取消按钮
nvMask.hide();
nvImageMenu.hide();
} else if (e.clientX < 5 || e.clientX > screenWidth - 5 || e.clientY < 5) {
//屏幕左右边缘5像素及菜单顶部5像素不处理点击
} else { //点击了图标按钮
var iClickIndex = -1 //点击的图标按钮序号,第一个图标按钮的index为0
var iRow = e.clientY < (top2 - (left1 / 2)) ? 0 : 1
var iCol = -1
if (e.clientX < (left2 - (iconSpace / 2))) {
iCol = 0
} else if (e.clientX < (left3 - (iconSpace / 2))) {
iCol = 1
} else if (e.clientX < (left4 - (iconSpace / 2))) {
iCol = 2
} else {
iCol = 3
}
if (iRow == 0) {
iClickIndex = iCol
} else {
iClickIndex = iCol + 4
}
// console.log("点击按钮的序号: " + iClickIndex);
// if (iClickIndex >= 0 && iClickIndex <= 5) { //处理具体的点击逻辑,此处也可以自行定义逻辑。如果增减了按钮,此处也需要跟着修改
// }
callback(iClickIndex)
this.hide()
}
})
/* nvImageMenu.addEventListener("touchstart", function(e) {
if (e.screenY > (plus.screen.resolutionHeight - 44)) {
//TODO 这里可以处理按下背景变灰的效果
}
})
nvImageMenu.addEventListener("touchmove", function(e) {
//TODO 这里可以处理按下背景变灰的效果
if (e.screenY > plus.screen.resolutionHeight - 44) {}
})
nvImageMenu.addEventListener("touchend", function(e) {
//TODO 这里可以处理释放背景恢复的效果
})
*/
},
hide(){
nvMask.hide()
nvImageMenu.hide()
}
}
\ No newline at end of file
import uniImageMenu from 'uni_modules/uni-image-menu/js_sdk/uni-image-menu.js';
import uniImageMenu from './uni-image-menu.js';
export default async (param,callback) => {
var menus = []
plus.oauth.getServices(services => { //只显示有服务的项目
plus.share.getServices(services => { //只显示有服务的项目
services = services.filter(item=>item.nativeClient)
// console.log("servicesList",services);
let servicesList = services.map(e => e.id)
console.log(servicesList);
param.menus.forEach(item => {
if (servicesList.includes(item.share.provider) || typeof(item.share) == 'string') {
menus.push(item)
......@@ -27,6 +28,11 @@ export default async (param,callback) => {
},
fail: function(err) {
console.log("fail:" + JSON.stringify(err));
uni.showModal({
content: JSON.stringify(err),
showCancel: false,
confirmText:"知道了"
});
},
complete(e) {
uniImageMenu.hide()
......
{
"id": "uni-share",
"displayName": "uni-share",
"version": "1.0.0",
"version": "1.0.4",
"description": "底部弹出宫格图标式的分享菜单,可覆盖原生组件。",
"keywords": [
"分享菜单"
......
#### 本功能基于[底部图标菜单](https://ext.dcloud.net.cn/plugin?id=4858)封装而成。
### 示例代码
```
uniShare({
content: { //公共的分享参数配置 类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
type: 0,
href: 'https://uniapp.dcloud.io/',
title: '标题',
summary: '描述',
imageUrl: 'https://img-cdn-aliyun.dcloud.net.cn/stream/icon/__UNI__HelloUniApp.png'
},
menus: [{
"img": "/static/app-plus/sharemenu/wechatfriend.png",
"text": "微信好友",
"share": { //当前项的分享参数配置。可覆盖公共的配置如下:分享到微信小程序,配置了type=5
"provider": "weixin",
"scene": "WXSceneSession"
}
},
{
"img": "/static/app-plus/sharemenu/wechatmoments.png",
"text": "微信朋友圈",
"share": {
"provider": "weixin",
"scene": "WXSenceTimeline"
}
},
{
"img": "/static/app-plus/sharemenu/mp_weixin.png",
"text": "微信小程序",
"share": {
provider: "weixin",
scene: "WXSceneSession",
type: 5,
miniProgram: {
id: uniStarterConfig.mp.weixin.id,
path: `/pages/list/detail?id=${_id}&title=${title}`,
webUrl: uniStarterConfig.h5.url +
`/#/pages/list/detail?id=${_id}&title=${title}`,
type: 0
},
}
},
{
"img": "/static/app-plus/sharemenu/weibo.png",
"text": "微博",
"share": {
"provider": "sinaweibo"
}
},
{
"img": "/static/app-plus/sharemenu/qq.png",
"text": "QQ",
"share": {
"provider": "qq"
}
},
{
"img": "/static/app-plus/sharemenu/copyurl.png",
"text": "复制",
"share": "copyurl"
},
{
"img": "/static/app-plus/sharemenu/more.png",
"text": "更多",
"share": "shareSystem"
}
],
cancelText: "取消分享",
}, e => { //callback
console.log(e);
})
<template>
<button type="default" @click="uniShare">显示</button>
</template>
<script>
import uniShare from 'uni_modules/uni-share/js_sdk/uni-share.js';
export default {
methods: {
uniShare() {
uniShare({
content: { //公共的分享参数配置 类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
type: 0,
href: 'https://uniapp.dcloud.io/',
title: '标题',
summary: '描述',
imageUrl: 'https://img-cdn-aliyun.dcloud.net.cn/stream/icon/__UNI__HelloUniApp.png'
},
menus: [{
"img": "/static/app-plus/sharemenu/wechatfriend.png",
"text": "微信好友",
"share": { //当前项的分享参数配置。可覆盖公共的配置如下:分享到微信小程序,配置了type=5
"provider": "weixin",
"scene": "WXSceneSession"
}
},
{
"img": "/static/app-plus/sharemenu/wechatmoments.png",
"text": "微信朋友圈",
"share": {
"provider": "weixin",
"scene": "WXSenceTimeline"
}
},
{
"img": "/static/app-plus/sharemenu/mp_weixin.png",
"text": "微信小程序",
"share": {
provider: "weixin",
scene: "WXSceneSession",
type: 5,
miniProgram: {
id: '123',
path: '/pages/list/detail',
webUrl: '/#/pages/list/detail',
type: 0
},
}
},
{
"img": "/static/app-plus/sharemenu/weibo.png",
"text": "微博",
"share": {
"provider": "sinaweibo"
}
},
{
"img": "/static/app-plus/sharemenu/qq.png",
"text": "QQ",
"share": {
"provider": "qq"
}
},
{
"img": "/static/app-plus/sharemenu/copyurl.png",
"text": "复制",
"share": "copyurl"
},
{
"img": "/static/app-plus/sharemenu/more.png",
"text": "更多",
"share": "shareSystem"
}
],
cancelText: "取消分享",
}, e => { //callback
console.log(e);
})
}
}
}
</script>
```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册