提交 b1246c71 编写于 作者: L linju

分享功能

上级 9c97a81b
module.exports = {
"h5":{
"url":"https://static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com"
},
"mp":{
"weixin":{
"id":"gh_33446d7f7a26"
}
},
"router":{
"needLogin":[ //配置需要路由拦截的页面地址,在打开这些页面之前会自动检查(不联网)uni_id_token的值是否存在/过期等
"/pages/ucenter/edit/edit",
......@@ -9,6 +17,7 @@ module.exports = {
},
"about":{
"appName":"base-app",
"logo":"/static/logo.png",
"company":"数字天堂(北京)网络技术有限公司",
"slogan":"为开发而生",
"agreements":[
......@@ -21,6 +30,6 @@ module.exports = {
"url":"https://uniapp.dcloud.io/"
}
],
"下载地址":""
"download":"https://m3w.cn/uniapp"
}
}
\ No newline at end of file
<template>
<view>
<canvas :id="cid" :canvas-id="cid" :style="{width: `${size}px`, height: `${size}px`}" />
</view>
</template>
<script>
import uQRCode from './uqrcode.js'
export default {
props: {
cid: {
type: String,
default(){
return Date.now()+Math.random()+'';
}
},
text: {
type: String,
required: true
},
size: {
type: Number,
default: uni.upx2px(200)
},
margin: {
type: Number,
default: 0
},
backgroundColor: {
type: String,
default: '#ffffff'
},
foregroundColor: {
type: String,
default: '#000000'
},
backgroundImage: {
type: String
},
logo: {
type: String
},
makeOnLoad: {
type: Boolean,
default: false
}
},
data() {
return {
}
},
mounted() {
if (this.makeOnLoad) {
this.make()
}
},
methods: {
async make() {
var options = {
canvasId: this.cid,
componentInstance: this,
text: this.text,
size: this.size,
margin: this.margin,
backgroundColor: this.backgroundImage ? 'rgba(255,255,255,0)' : this.backgroundColor,
foregroundColor: this.foregroundColor
}
var filePath = await this.makeSync(options)
if (this.backgroundImage) {
filePath = await this.drawBackgroundImageSync(filePath)
}
if (this.logo) {
filePath = await this.drawLogoSync(filePath)
}
this.makeComplete(filePath)
},
makeComplete(filePath) {
this.$emit('makeComplete', filePath)
},
drawBackgroundImage(options) {
var ctx = uni.createCanvasContext(this.cid, this)
ctx.drawImage(this.backgroundImage, 0, 0, this.size, this.size)
ctx.drawImage(options.filePath, 0, 0, this.size, this.size)
ctx.draw(false, () => {
uni.canvasToTempFilePath({
canvasId: this.cid,
success: res => {
options.success && options.success(res.tempFilePath)
},
fail: error => {
options.fail && options.fail(error)
}
}, this)
})
},
async drawBackgroundImageSync(filePath) {
return new Promise((resolve, reject) => {
this.drawBackgroundImage({
filePath: filePath,
success: res => {
resolve(res)
},
fail: error => {
reject(error)
}
})
})
},
fillRoundRect(ctx, r, x, y, w, h) {
ctx.save()
ctx.translate(x, y)
ctx.beginPath()
ctx.arc(w - r, h - r, r, 0, Math.PI / 2)
ctx.lineTo(r, h)
ctx.arc(r, h - r, r, Math.PI / 2, Math.PI)
ctx.lineTo(0, r)
ctx.arc(r, r, r, Math.PI, Math.PI * 3 / 2)
ctx.lineTo(w - r, 0)
ctx.arc(w - r, r, r, Math.PI * 3 / 2, Math.PI * 2)
ctx.lineTo(w, h - r)
ctx.closePath()
ctx.setFillStyle('#ffffff')
ctx.fill()
ctx.restore()
},
drawLogo(options) {
var ctx = uni.createCanvasContext(this.cid, this)
ctx.drawImage(options.filePath, 0, 0, this.size, this.size)
var logoSize = this.size / 4
var logoX = this.size / 2 - logoSize / 2
var logoY = logoX
var borderSize = logoSize + 10
var borderX = this.size / 2 - borderSize / 2
var borderY = borderX
var borderRadius = 5
this.fillRoundRect(ctx, borderRadius, borderX, borderY, borderSize, borderSize)
ctx.drawImage(this.logo, logoX, logoY, logoSize, logoSize)
ctx.draw(false, () => {
uni.canvasToTempFilePath({
canvasId: this.cid,
success: res => {
options.success && options.success(res.tempFilePath)
},
fail: error => {
options.fail && options.fail(error)
}
}, this)
})
},
async drawLogoSync(filePath) {
return new Promise((resolve, reject) => {
this.drawLogo({
filePath: filePath,
success: res => {
resolve(res)
},
fail: error => {
reject(error)
}
})
})
},
async makeSync(options) {
return new Promise((resolve, reject) => {
uQRCode.make({
canvasId: options.canvasId,
componentInstance: options.componentInstance,
text: options.text,
size: options.size,
margin: options.margin,
backgroundColor: options.backgroundColor,
foregroundColor: options.foregroundColor,
success: res => {
resolve(res)
},
fail: error => {
reject(error)
}
})
})
}
}
}
</script>
此差异已折叠。
......@@ -21,7 +21,6 @@ export default function request(name,params,callback=false,{showLoading=false,lo
uniCloud.callFunction({name,data: {action,params},
success(e){
// console.log(e);
if(showLoading || loadText) uni.hideLoading()
const {result:{data,code}} = e
console.log(data,code);
if (code === 0 ) {
......@@ -47,6 +46,9 @@ export default function request(name,params,callback=false,{showLoading=false,lo
})
}
fail(err)
},
complete() {
if(showLoading || loadText) uni.hideLoading()
}
})
})
......
......@@ -86,7 +86,8 @@
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
"usingComponents" : true,
"betterScopedSlots":true
},
"mp-alipay" : {
"usingComponents" : true
......
......@@ -76,7 +76,17 @@
}, {
"path": "pages/ucenter/about/about",
"style": {
"navigationBarTitleText": "关于"
"navigationBarTitleText": "关于"
// #ifdef APP-PLUS
,"app-plus": {
"titleNView": {
"buttons": [{
"type": "share"
}],
"type": "transparent"
}
}
// #endif
}
}, {
......@@ -179,6 +189,13 @@
},
"condition": {
"list": [
{
"path": "pages/list/list",
"style": {
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"path": "uni_modules/uni-login-page/pages/index/index"
},
......
<template>
<!--
本页面模板教程:https://ext.dcloud.net.cn/plugin?id=2717
uni-list 文档:https://ext.dcloud.net.cn/plugin?id=24
uniCloud 文档:https://uniapp.dcloud.io/uniCloud/README
unicloud-db 组件文档:https://uniapp.dcloud.net.cn/uniCloud/unicloud-db-component
DB Schema 规范:https://uniapp.dcloud.net.cn/uniCloud/schema
-->
<view class="article">
<uni-nav-bar :statusBar="true" :border="false"></uni-nav-bar>
<unicloud-db v-slot:default="{data, loading, error, options}" :options="formData" :collection="collection" :field="field"
:getone="true" :where="where" :manual="true" ref="detail" foreignKey="opendb-news-articles.author" @load="loadData">
<template v-if="!loading && data">
<view class="article-title">{{title}}</view>
<uni-list :border="false">
<uni-list-item thumbSize="lg" :thumb="data.image">
<!-- 通过body插槽定义作者信息内容 -->
<view slot="body" class="header-content">
<view class="uni-title">{{data.author && data.author[0].username}}</view>
<view class="uni-note">更新于 <uni-dateformat :date="data.last_modify_date" format="yyyy-MM-dd" :threshold="[60000, 2592000000]" /> </view>
</view>
<view slot="footer" class="footer">
<button @click="followClick" class="footer-button">关注</button>
</view>
</uni-list-item>
</uni-list>
<view class="banner">
<!-- 文章开头,缩略图 -->
<image class="banner-img" :src="data.avatar" mode="widthFix"></image>
<!-- 文章摘要 -->
<view class="banner-title">
<text class="uni-ellipsis">{{data.excerpt}}</text>
</view>
</view>
<!-- 新闻详情:使用 uParse 解析富文本 -->
<view class="article-content">
<u-parse :content="data.content" :noData="options.noData"></u-parse>
</view>
</template>
</unicloud-db>
<uni-popup ref="sharePopup" type="bottom">
<uni-popup-share @select="selectShareItem"></uni-popup-share>
</uni-popup>
</view>
</template>
<script>
import uParse from '@/components/u-parse/parse.vue';
export default {
components: {
uParse
},
data() {
return {
// 当前显示 _id
id:"",
title:'',
// 数据表名
collection: 'opendb-news-articles,uni-id-users',
// 查询字段,多个字段用 , 分割
field: 'author{username, _id},_id,avatar,excerpt,last_modify_date, comment_count, like_count,title,content',
formData: {
noData: '<p style="text-align:center;color:#666">详情加载中...</p>'
},
}
},
computed:{
//拼接where条件
//查询条件 ,更多详见 :https://uniapp.dcloud.net.cn/uniCloud/unicloud-db?id=jsquery
where(){
return `_id =="${this.id}"`
}
},
onLoad(event) {
//获取真实新闻id,通常 id 来自上一个页面
if(event.id){
this.id = event.id
}
//若上一页传递了标题过来,则设置导航栏标题
if(event.title){
this.title = event.title
uni.setNavigationBarTitle({
title:event.title
})
}
},
onNavigationBarButtonTap(event) {
if(event.type == 'share'){
this.shareClick();
}
},
onReady() {
// 开始加载数据,修改 where 条件后才开始去加载 clinetDB 的数据 ,需要等组件渲染完毕后才开始执行 loadData,所以不能再 onLoad 中执行
if(this.id){// ID 不为空,则发起查询
this.$refs.detail.loadData()
}else{
uni.showToast({
icon:'none',
title:'出错了,新闻ID为空'
})
}
},
methods: {
loadData(data){
//如果上一页未传递标题过来(如搜索直达详情),则从新闻详情中读取标题
if(this.title == '' && data[0].title){
this.title = data[0].title
uni.setNavigationBarTitle({
title:data[0].title
})
}
},
/**
* followClick
* 点击关注
*/
followClick(){
uni.showToast({
title: '点击关注',
icon: 'none'
});
},
/**
* 分享该文章
*/
shareClick(){
//#ifdef APP-PLUS
this.$refs.sharePopup.open();
//#endif
//#ifndef APP-PLUS || H5
uni.setClipboardData({
data: 'http://uniapp.dcloud.io/',
success: function () {
uni.showToast({
title: '已复制到剪切板',
icon: 'none'
});
}
});
//#endif
// #ifdef H5
let value = 'http://uniapp.dcloud.io/';
const textarea = document.createElement('textarea');
textarea.value = value;
textarea.readOnly = true;
document.body.appendChild(textarea);
textarea.select();
textarea.setSelectionRange(0, value.length);
document.execCommand('copy');
textarea.remove();
uni.showToast({
title: '已复制到剪切板',
icon: 'none'
});
// #endif
},
selectShareItem({item, index}, done){
//#ifdef APP-PLUS
if(item.name == 'more'){
// "复制链接"选项
uni.setClipboardData({
data: 'http://uniapp.dcloud.io/',
success: function () {
uni.showToast({
title: '已复制到剪切板',
icon: 'none'
});
}
});
} else {
uni.share({
provider: item.name,
scene: "WXSceneSession",
type: 0,
href: "http://uniapp.dcloud.io/",
title: "uni-app分享",
summary: "我正在使用HBuilderX开发uni-app,赶紧跟我一起来体验!",
imageUrl: "https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-uni-app-doc/d8590190-4f28-11eb-b680-7980c8a877b8.png",
success: function (res) {
console.log("success:" + JSON.stringify(res));
},
fail: function (err) {
console.log("fail:" + JSON.stringify(err));
}
});
}
//#endif
//#ifndef APP-PLUS
uni.showToast({
title: '仅app端支持分享',
icon: 'none'
});
//#endif
done();
}
}
}
</script>
<style scoped>
.header-content {
flex: 1;
display: flex;
flex-direction: column;
font-size: 14px;
}
/* 标题 */
.uni-title {
display: flex;
margin-bottom: 5px;
font-size: 14px;
font-weight: bold;
color: #3b4144;
}
/* 描述 额外文本 */
.uni-note {
color: #999;
font-size: 12px;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
}
.footer {
display: flex;
align-items: center;
}
.footer-button {
display: flex;
align-items: center;
font-size: 12px;
height: 30px;
color: #fff;
background-color: #ff5a5f;
}
.banner {
position: relative;
margin: 0 15px;
height: 180px;
overflow: hidden;
}
.banner-img {
position: absolute;
width: 100%;
}
.banner-title {
display: flex;
align-items: center;
position: absolute;
padding: 0 15px;
width: 100%;
bottom: 0;
height: 30px;
font-size: 14px;
color: #fff;
background: rgba(0, 0, 0, 0.4);
overflow: hidden;
box-sizing: border-box;
}
.uni-ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.article-title {
padding: 20px 15px;
padding-bottom: 0;
}
.article-content {
padding: 15px;
font-size: 15px;
overflow: hidden;
}
<template>
<!--
本页面模板教程:https://ext.dcloud.net.cn/plugin?id=2717
uni-list 文档:https://ext.dcloud.net.cn/plugin?id=24
uniCloud 文档:https://uniapp.dcloud.io/uniCloud/README
unicloud-db 组件文档:https://uniapp.dcloud.net.cn/uniCloud/unicloud-db-component
DB Schema 规范:https://uniapp.dcloud.net.cn/uniCloud/schema
-->
<view class="article">
<uni-nav-bar :statusBar="true" :border="false"></uni-nav-bar>
<unicloud-db v-slot:default="{data, loading, error, options}" :options="formData" :collection="collection"
:field="field" :getone="true" :where="where" :manual="true" ref="detail"
foreignKey="opendb-news-articles.author" @load="loadData">
<template v-if="!loading && data">
<view class="article-title">{{title}}</view>
<uni-list :border="false">
<uni-list-item thumbSize="lg" :thumb="data.image">
<!-- 通过body插槽定义作者信息内容 -->
<view slot="body" class="header-content">
<view class="uni-title">{{data.author && data.author[0].username}}</view>
<view class="uni-note">更新于
<uni-dateformat :date="data.last_modify_date" format="yyyy-MM-dd"
:threshold="[60000, 2592000000]" />
</view>
</view>
<view slot="footer" class="footer">
<button @click="followClick" class="footer-button">关注</button>
</view>
</uni-list-item>
</uni-list>
<view class="banner">
<!-- 文章开头,缩略图 -->
<image class="banner-img" :src="data.avatar" mode="widthFix"></image>
<!-- 文章摘要 -->
<view class="banner-title">
<text class="uni-ellipsis">{{data.excerpt}}</text>
</view>
</view>
<!-- 新闻详情:使用 uParse 解析富文本 -->
<view class="article-content">
<u-parse :content="data.content" :noData="options.noData"></u-parse>
</view>
</template>
</unicloud-db>
</view>
</template>
<script>
import baseappConfig from '@/baseapp.config.js';
import uniShare from 'uni_modules/uni-share/js_sdk/uni-share.js';
import uParse from '@/components/u-parse/parse.vue';
export default {
components: {
uParse
},
data() {
return {
// 当前显示 _id
id: "",
title: '',
// 数据表名
collection: 'opendb-news-articles,uni-id-users',
// 查询字段,多个字段用 , 分割
field: 'author{username, _id},_id,avatar,excerpt,last_modify_date, comment_count, like_count,title,content',
formData: {
noData: '<p style="text-align:center;color:#666">详情加载中...</p>'
},
}
},
computed: {
//拼接where条件
//查询条件 ,更多详见 :https://uniapp.dcloud.net.cn/uniCloud/unicloud-db?id=jsquery
where() {
return `_id =="${this.id}"`
}
},
onLoad(event) {
//获取真实新闻id,通常 id 来自上一个页面
if (event.id) {
this.id = event.id
}
//若上一页传递了标题过来,则设置导航栏标题
if (event.title) {
this.title = event.title
uni.setNavigationBarTitle({
title: event.title
})
}
},
onNavigationBarButtonTap(event) {
if (event.type == 'share') {
this.shareClick();
}
},
onReady() {
// 开始加载数据,修改 where 条件后才开始去加载 clinetDB 的数据 ,需要等组件渲染完毕后才开始执行 loadData,所以不能再 onLoad 中执行
if (this.id) { // ID 不为空,则发起查询
this.$refs.detail.loadData()
} else {
uni.showToast({
icon: 'none',
title: '出错了,新闻ID为空'
})
}
},
methods: {
loadData(data) {
//如果上一页未传递标题过来(如搜索直达详情),则从新闻详情中读取标题
if (this.title == '' && data[0].title) {
this.title = data[0].title
uni.setNavigationBarTitle({
title: data[0].title
})
}
},
/**
* followClick
* 点击关注
*/
followClick() {
uni.showToast({
title: '点击关注',
icon: 'none'
});
},
/**
* 分享该文章
*/
shareClick() {
let {
_id,
title,
excerpt,
avatar
} = this.$refs.detail.dataList
uniShare({
content: { //公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
type: 0,
href: baseappConfig.h5.url + `/#/pages/list/detail?id=${_id}&title=${title}`,
title: this.title,
summary: excerpt,
imageUrl: avatar
},
menus: [{
"img": "/static/sharemenu/wechatfriend.png",
"text": "微信好友",
"share": {
"provider": "weixin",
"scene": "WXSceneSession"
}
},
{
"img": "/static/sharemenu/wechatmoments.png",
"text": "微信朋友圈",
"share": {
"provider": "weixin",
"scene": "WXSenceTimeline"
}
},
{
"img": "/static/sharemenu/mp_weixin.png",
"text": "微信小程序",
"share": {
provider: "weixin",
scene: "WXSceneSession",
type: 5,
miniProgram: {
id:baseappConfig.mp.weixin.id,
path:`/pages/list/detail?id=${_id}&title=${title}`,
webUrl:baseappConfig.h5.url + `/#/pages/list/detail?id=${_id}&title=${title}`,
type:0
},
}
},
{
"img": "/static/sharemenu/weibo.png",
"text": "微博",
"share": {
"provider": "sinaweibo"
}
},
{
"img": "/static/sharemenu/qq.png",
"text": "QQ",
"share": {
"provider": "qq"
}
},
{
"img": "/static/sharemenu/copyurl.png",
"text": "复制",
"share": "copyurl"
},
{
"img": "/static/sharemenu/more.png",
"text": "更多",
"share": "shareSystem"
}
],
cancelText: "取消分享",
}, e => { //callback
console.log(e);
})
},
}
}
</script>
<style scoped>
.header-content {
flex: 1;
display: flex;
flex-direction: column;
font-size: 14px;
}
/* 标题 */
.uni-title {
display: flex;
margin-bottom: 5px;
font-size: 14px;
font-weight: bold;
color: #3b4144;
}
/* 描述 额外文本 */
.uni-note {
color: #999;
font-size: 12px;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
}
.footer {
display: flex;
align-items: center;
}
.footer-button {
display: flex;
align-items: center;
font-size: 12px;
height: 30px;
color: #fff;
background-color: #ff5a5f;
}
.banner {
position: relative;
margin: 0 15px;
height: 180px;
overflow: hidden;
}
.banner-img {
position: absolute;
width: 100%;
}
.banner-title {
display: flex;
align-items: center;
position: absolute;
padding: 0 15px;
width: 100%;
bottom: 0;
height: 30px;
font-size: 14px;
color: #fff;
background: rgba(0, 0, 0, 0.4);
overflow: hidden;
box-sizing: border-box;
}
.uni-ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.article-title {
padding: 20px 15px;
padding-bottom: 0;
}
.article-content {
padding: 15px;
font-size: 15px;
overflow: hidden;
}
</style>
......@@ -17,7 +17,7 @@
<script>
// import permision from '@/js_sdk/wa-permission/permission.js';
import uniShare from 'uni_modules/uni-share/js_sdk/main.js';
import uniShare from 'uni_modules/uni-share/js_sdk/uni-share.js';
export default {
data() {
return {
......@@ -86,7 +86,60 @@
},
methods: {
showShare(){
uniShare()
uniShare({
menus:[
{
"img": "/static/sharemenu/wechatfriend.png",
"text": "微信好友",
"share": {
"provider": "weixin",
"scene": "WXSceneSession"
}
},
{
"img": "/static/sharemenu/wechatmoments.png",
"text": "微信朋友圈",
"share": {
"provider": "weixin",
"scene": "WXSceneSession"
}
},
{
"img": "/static/sharemenu/weibo.png",
"text": "微博",
"share": {
"provider": "sinaweibo"
}
},
{
"img": "/static/sharemenu/qq.png",
"text": "QQ",
"share": {
"provider": "qq"
}
},
{
"img": "/static/sharemenu/copyurl.png",
"text": "复制",
"share": "copyurl"
},
{
"img": "/static/sharemenu/more.png",
"text": "更多",
"share": "shareSystem"
}
],
content:{
type: 0,
href: "https://uniapp.dcloud.io/api/plugins/share?id=share",
title: "主标题",
summary: "分享内容的摘要",
imageUrl: "https://uniapp.dcloud.io/api/plugins/share?id=share",
},
cancelText:"取消分享",
},e=>{ //callback
console.log(e);
})
},
clickItem(e){
console.log(e);
......
<template>
<view class="about">
<view class="logo">
<image class="logoImg" src="@/static/logo.png"></image>
<view class="box">
<image class="logoImg" :src="about.logo"></image>
<text class="tip appName">{{about.appName}}</text>
<text class="tip" style="font-size:24upx;">Version {{version}}</text>
<!--Sansnn-uQRCode组件来源,插件市场:https://ext.dcloud.net.cn/plugin?id=1287 微调后-->
<Sansnn-uQRCode :text="about.download" :makeOnLoad="true" class="qrcode"></Sansnn-uQRCode>
</view>
<view class="copyright">
<template v-for="(agreement,index) in about.agreements">
......@@ -17,6 +19,7 @@
</template>
<script>
import baseappConfig from '@/baseapp.config.js';
import uniShare from 'uni_modules/uni-share/js_sdk/uni-share.js';
export default {
onLoad() {
// #ifdef APP-PLUS
......@@ -34,6 +37,62 @@ import baseappConfig from '@/baseapp.config.js';
this.about = baseappConfig.about
this.year = (new Date).getFullYear()
},
onNavigationBarButtonTap() {
let {download,appName,slogan,logo} = this.about
uniShare({
content: { //公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
type: 0,
href: download,
title: appName,
summary: slogan,
imageUrl: logo
},
menus: [{
"img": "/static/sharemenu/wechatfriend.png",
"text": "微信好友",
"share": {
"provider": "weixin",
"scene": "WXSceneSession"
}
},
{
"img": "/static/sharemenu/wechatmoments.png",
"text": "微信朋友圈",
"share": {
"provider": "weixin",
"scene": "WXSenceTimeline"
}
},
{
"img": "/static/sharemenu/weibo.png",
"text": "微博",
"share": {
"provider": "sinaweibo"
}
},
{
"img": "/static/sharemenu/qq.png",
"text": "QQ",
"share": {
"provider": "qq"
}
},
{
"img": "/static/sharemenu/copyurl.png",
"text": "复制",
"share": "copyurl"
},
{
"img": "/static/sharemenu/more.png",
"text": "更多",
"share": "shareSystem"
}
],
cancelText: "取消分享",
}, e => { //callback
console.log(e);
})
},
methods:{
navigateTo({url,title}){
uni.navigateTo({
......@@ -51,11 +110,8 @@ import baseappConfig from '@/baseapp.config.js';
width: 750upx;
flex-direction: column;
}
.logo {
width: 750upx;
position: fixed;
left:0;
top:100px;
.box {
margin-top: 100px;
flex-direction: column;
justify-content: center;
align-items: center;
......@@ -72,6 +128,9 @@ import baseappConfig from '@/baseapp.config.js';
font-size:42rpx;
font-weight: 500;
}
.qrcode{
margin-top: 50px;
}
.copyright {
width: 750upx;
font-size:32rpx;
......
<template>
<view class="content">
<!-- 功能列表 -->
<uni-list>
<uni-list-item v-for="(item,index) in agreeList" :key="index" :title="item.title"
:clickable="true" @click="itemClick(item)" :showSwitch="item.showSwitch" :switchChecked="item.isChecked"
:link="!item.showSwitch"
></uni-list-item>
</uni-list>
<!-- 退出按钮 -->
<view class="bottom-back" @click="clickLogout">
<text class="bottom-back-text" v-if="userInfo">退出登录</text>
<text class="bottom-back-text" v-else>登录</text>
</view>
</view>
</template>
<script>
import {isOn,setting} from './dc-push/push.js';
import {mapMutations,mapGetters} from 'vuex';
export default {
data() {
return {
agreeList: [{
title: '个人资料',
event:'toEdit'
},
{
title: '修改密码',
event:'changePwd'
},
// {
// title: '注销用户',
// event: ''
// },
//#ifdef APP-PLUS
{
title: '推送功能',
name: 'push',
event: 'openSetting',
isChecked: false,
showSwitch: true
},
// {
// title: '清理缓存',
// event: ''
// },
//#endif
]
}
},
computed:{
...mapGetters({
'userInfo':'user/info'
})
},
onLoad() {
this.initSoterAuthentication();
},
onShow() {
this.checkPush();
},
methods: {
...mapMutations({
logout: 'user/logout'
}),
toEdit(){
uni.navigateTo({
url: '/uni_modules/uni-id-users/pages/uni-id-users/edit'
});
},
changePwd(){
uni.navigateTo({
url:'/uni_modules/uni-login-page/pages/pwd-retrieve/pwd-retrieve?phoneNumber='+ (this.userInfo&&this.userInfo.phone?this.userInfo.phone:'') +'&phoneArea=+86',
fail:err=> {
console.log(err);
}
});
},
checkPush(){
// 手机端获取推送是否开启
//#ifdef APP-PLUS
let pushIsOn = isOn();
this.agreeList.forEach(item => {
item.name == 'push' ? (item.isChecked = pushIsOn) : '';
})
//#endif
},
/**
* 添加生物认证选项
*/
initSoterAuthentication() {
// #ifdef APP-PLUS || MP-WEIXIN
let checkAuthModeList = [{
title: '指纹解锁',
name: 'fingerPrint',
event: 'startSoterAuthentication'
}, {
title: '人脸解锁',
name: 'facial',
event: 'startSoterAuthentication'
}];
uni.checkIsSupportSoterAuthentication({
success: (res) => {
res.supportMode.forEach(item => {
this.agreeList.push(checkAuthModeList.find(mode => mode.name == item));
})
},
fail: (err) => {
reject(err);
}
})
// #endif
},
/**
* 开始生物认证
*/
startSoterAuthentication(item) {
// 检查是否开启认证
this.checkIsSoterEnrolledInDevice(item)
.then(()=>{
// 开始认证
uni.startSoterAuthentication({
requestAuthModes: [item.name],
challenge: '123456', // 微信端挑战因子
authContent: `请用${item.title}`,
success:(res)=> {
if(res.errCode == 0){
/**
* 验证成功后开启自己的业务逻辑
*
* app端以此为依据 验证成功
*
* 微信小程序需要再次通过后台验证resultJSON与resultJSONSignature获取最终结果
*/
return uni.showToast({
title: `${item.title}成功`,
icon: 'none'
});
}
uni.showToast({
title: '认证失败请重试',
icon: 'none'
});
},
fail:(err)=> {
console.log(`认证失败:${err.errCode}`);
uni.showToast({
title: `认证失败`,
icon: 'none'
});
}
})
})
},
checkIsSoterEnrolledInDevice(mode){
return new Promise((resolve, reject)=>{
uni.checkIsSoterEnrolledInDevice({
checkAuthMode:mode.name,
success: (res) => {
if(res.isEnrolled){
return resolve(res);
}
uni.showToast({
title: `设备未开启${mode.title}`,
icon: 'none'
});
reject(res);
},
fail: (err) => {
uni.showToast({
title: `${mode.title}失败`,
icon: 'none'
});
reject(err);
}
})
})
},
clickLogout() {
if(this.userInfo){
uni.showModal({
title: '提示',
content: '是否退出登录',
cancelText: '取消',
confirmText: '确定',
success: res => {
if(res.confirm){
this.logout();
uni.navigateBack();
}
},
fail: () => {},
complete: () => {}
});
}else{
uni.navigateTo({
url: '/uni_modules/uni-login-page/pages/index/index'
});
}
},
itemClick(item) {
console.log(item);
if (item.event) {
this[item.event](item);
}
},
/**
* 打开设置页面
*/
openSetting() {
setting();
}
}
}
</script>
<style>
/* #ifndef APP-NVUE */
page {
flex: 1;
width: 100%;
height: 100%;
}
uni-button:after{
border: none;
border-radius: 0;
}
/* #endif */
.content {
/* #ifndef APP-NVUE */
display: flex;
width: 750rpx;
height: 100vh;
/* #endif */
flex-direction: column;
flex: 1;
background-color: #E5E5E5;
}
.bottom-back {
width: 750rpx;
height: 120rpx;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
justify-content: center;
align-items: center;
/* #ifndef APP-NVUE */
border: none;
/* #endif */
border-width: 0;
border-radius: 0;
background-color: #FFFFFF;
}
.bottom-back-text {
font-size: 40rpx;
color: #999999;
}
</style>
......@@ -2,7 +2,7 @@
<view class="content">
<!-- 功能列表 -->
<uni-list :border="false" class="mb10" v-for="(sublist,index) in agreeList">
<uni-list-item :border="false" class="mb1" v-for="(item,index) in sublist" :key="index" :title="item.title"
<uni-list-item :border="false" class="mb1" v-for="(item,i) in sublist" :key="i" :title="item.title"
:clickable="true" @click="itemClick(item)" :showSwitch="item.showSwitch" :switchChecked="item.isChecked"
:link="!item.showSwitch"></uni-list-item>
</uni-list>
......@@ -216,7 +216,18 @@
uni.showLoading({
title: '清除中',
mask: true
});
});
/*
任何临时存储或删除不直接影响程序运行逻辑(清除缓存必定造成业务逻辑的变化,如:打开页面的图片不从缓存中读取而从网络请求)的内容都可以视为缓存。主要有storage、和file写入。
缓存分为三部分
原生层(如:webview、x5播放器的、第三方sdk的、地图组件等)
前端框架(重启就会自动清除)
开发者自己的逻辑(如:
本示例的 检测更新功能下载了apk安装包,
其他逻辑需要根据开发者自己的业务设计
比如:有聊天功能的应用,聊天记录是否视为缓存,还是单独提供清除聊天记录的功能由开发者自己设计
*/
uni.getSavedFileList({
success:res=>{
if (res.fileList.length > 0) {
......@@ -224,11 +235,19 @@
filePath: res.fileList[0].filePath,
complete:res=>{
console.log(res);
uni.hideLoading()
uni.hideLoading()
uni.showToast({
title: '清除成功',
icon: 'none'
});
}
});
}else{
uni.hideLoading()
uni.showToast({
title: '清除成功',
icon: 'none'
});
}
},
complete:e=>{
......
var nvMask,nvImageMenu;
export default {
show(list,callback){
show({list,cancelText},callback){
if(!list){
list = [{
"img":"/static/sharemenu/wechatfriend.png",
"text":"图标文字"
}]
}
//以下为计算菜单的nview绘制布局,为固定算法,使用者无关关心
var screenWidth = plus.screen.resolutionWidth
//以360px宽度屏幕为例,上下左右边距及2排按钮边距留25像素,图标宽度55像素,同行图标间的间距在360宽的屏幕是30px,但需要动态计算,以此原则计算4列图标分别的left位置
//图标下的按钮文字距离图标5像素,文字大小12像素
//底部取消按钮高度固定为44px
//TODO 未处理横屏和pad,这些情况6个图标应该一排即可
var margin = 25,
iconWidth = 55,
var margin = 20,
iconWidth = 60,
icontextSpace = 5,
textHeight = 12
var left1 = margin / 360 * screenWidth
......@@ -46,7 +44,7 @@ export default {
nvImageMenu = new plus.nativeObj.View("nvImageMenu", { //创建底部图标菜单
bottom: '0px',
left: '0px',
height: (iconWidth + textHeight + 2 * margin)*(parseInt(list.length/4)+1) +44+'px',//'264px',
height: (iconWidth + textHeight + 2 * margin)*Math.ceil(list.length/4) +44+'px',//'264px',
width: '100%',
backgroundColor: 'rgb(255,255,255)'
});
......@@ -90,8 +88,7 @@ export default {
},
{
tag: 'font',
id: 'sharecancel',//底部取消按钮的文字
text: '取消分享',
text: cancelText,//底部取消按钮的文字
textStyles: {
size: '14px'
},
......@@ -141,9 +138,10 @@ export default {
iClickIndex = iCol + 4
}
// console.log("点击按钮的序号: " + iClickIndex);
if (iClickIndex >= 0 && iClickIndex <= 5) { //处理具体的点击逻辑,此处也可以自行定义逻辑。如果增减了按钮,此处也需要跟着修改
callback(iClickIndex)
}
// if (iClickIndex >= 0 && iClickIndex <= 5) { //处理具体的点击逻辑,此处也可以自行定义逻辑。如果增减了按钮,此处也需要跟着修改
// }
callback(iClickIndex)
this.hide()
}
})
/* nvImageMenu.addEventListener("touchstart", function(e) {
......
......@@ -47,7 +47,7 @@ page {
}
.phone-input-box {
height: 85rpx;
height: 45px;
background-color: #f9f9f9;
border-radius: 6rpx;
flex-direction: row;
......
......@@ -15,44 +15,44 @@
config: {
"weixin": {
"text": "微信登陆",
"logo": "../../static/login/img/weixin.png",
"logo": "../../static/login/weixin.png",
"isChecked":true
},
"apple": {
"text": "苹果登陆",
"logo": "../../static/login/img/apple.png",
"logo": "../../static/login/apple.png",
"isChecked":true
},
"univerify": {
"text": "一键登陆",
"logo": "../../static/login/img/univerify.png",
"logo": "../../static/login/univerify.png",
"isChecked":true
},
"qq": {
"text": "QQ登陆",
"logo": "../../static/login/img/qq.png",
"logo": "../../static/login/qq.png",
"isChecked":false //暂未提供该登陆方式的接口示例
},
"xiaomi": {
"text": "小米登陆",
"logo": "../../static/login/img/qq.png",
"logo": "../../static/login/qq.png",
"isChecked":false //暂未提供该登陆方式的接口示例
},
"sinaweibo": {
"text": "微博登录",
"logo": "../../static/login/img/sinaweibo.png",
"logo": "../../static/login/weibo.png",
"isChecked":false //暂未提供该登陆方式的接口示例
}
},
servicesList:[
{
"text": "账号登陆",
"logo": "../../static/login/img/username.png",
"logo": "../../static/login/db.png",
"path":"/uni_modules/uni-login-page/pages/pwd-login/pwd-login"
},
{
"text": "短信登陆",
"logo": "../../static/login/img/smsCode.png",
"logo": "../../static/login/smsCode.png",
"path":"/uni_modules/uni-login-page/pages/index/index"
}
],
......@@ -208,7 +208,7 @@
console.log('delta:'+delta);
uni.navigateBack({delta})
}
})
},{showLoading:true})
},
async getUserInfo(e){
return new Promise((resolve, reject)=>{
......@@ -246,7 +246,7 @@
.logo {
width: 60rpx;
height: 60rpx;
height: 60rpx;
}
.login-title {
......
......@@ -14,7 +14,7 @@
<template slot="left">
<!-- 当前仅支持中国大陆手机号 -->
<!-- <picker mode="selector" :range="phoneArea" @change="selectPhoneArea"> -->
<text class="phone-area" @click="selectPhoneArea">{{currenPhoneArea}}</text>
<!-- <text class="phone-area" @click="selectPhoneArea">{{currenPhoneArea}}</text> -->
<!-- </picker> -->
</template>
</uni-easyinput>
......@@ -150,5 +150,5 @@ import baseappConfig from '@/baseapp.config.js';
/* #ifndef APP-NVUE */
border-right: 1rpx solid #d7d9d8;
/* #endif */
}
}
</style>
{
"name": "user-center",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "1.0.0",
"license": "ISC",
"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-id": "file:../../../../uni-id/uniCloud/cloudfunctions/common/uni-id"
}
},
"../../../../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.1",
"license": "Apache-2.0"
},
"../../../../uni-id/uniCloud/cloudfunctions/common/uni-id": {
"version": "3.0.12",
"license": "Apache-2.0",
"dependencies": {
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
},
"../../../../uni-id/uniCloud/cloudfunctions/common/uni-id/node_modules/uni-config-center": {
"resolved": "../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center",
"link": true
},
"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
},
"node_modules/uni-id": {
"resolved": "../../../../uni-id/uniCloud/cloudfunctions/common/uni-id",
"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"
},
"uni-id": {
"version": "file:../../../../uni-id/uniCloud/cloudfunctions/common/uni-id",
"requires": {
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
},
"dependencies": {
"uni-config-center": {
"version": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
}
}
}
}
{
"name": "user",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "1.0.0",
"license": "ISC",
"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-id": "file:../../../../uni-id/uniCloud/cloudfunctions/common/uni-id"
}
},
"../../../../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.1",
"license": "Apache-2.0"
},
"../../../../uni-id/uniCloud/cloudfunctions/common/uni-id": {
"version": "3.0.12",
"license": "Apache-2.0",
"dependencies": {
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
},
"../../../../uni-id/uniCloud/cloudfunctions/common/uni-id/node_modules/uni-config-center": {
"resolved": "../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center",
"link": true
},
"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
},
"node_modules/uni-id": {
"resolved": "../../../../uni-id/uniCloud/cloudfunctions/common/uni-id",
"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"
},
"uni-id": {
"version": "file:../../../../uni-id/uniCloud/cloudfunctions/common/uni-id",
"requires": {
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
},
"dependencies": {
"uni-config-center": {
"version": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
}
}
}
}
{
"id": "quick-login",
"displayName": "quick-login",
"version": "1.0.0",
"description": "quick-login",
"keywords": [
"quick-login"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"uniCloud",
"云端一体页面模板"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u"
},
"client": {
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}
\ No newline at end of file
# uni-quick-login
\ No newline at end of file
{
"name": "user-center",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": 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"
},
"uni-id": {
"version": "file:../../../../uni-id/uniCloud/cloudfunctions/common/uni-id",
"requires": {
"uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
},
"dependencies": {
"uni-config-center": {
"version": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
}
}
}
}
{
"name": "user",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": 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"
},
"uni-id": {
"version": "file:../../../../uni-id/uniCloud/cloudfunctions/common/uni-id",
"requires": {
"uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
},
"dependencies": {
"uni-config-center": {
"version": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
}
}
}
}
import uniImageMenu from 'uni_modules/uni-image-menu/js_sdk/uni-image-menu.js';
let old_menus = [{
"img": "/static/sharemenu/wechatfriend.png",
"text": "微信好友",
"share":{
"provider":"weixin",
"scene":"WXSceneSession"
}
},
{
"img": "/static/sharemenu/wechatmoments.png",
"text": "微信朋友圈",
"share":{
"provider":"weixin",
"scene":"WXSceneSession"
}
},
{
"img": "/static/sharemenu/weibo.png",
"text": "微博",
"share":{
"provider":"sinaweibo"
}
},
{
"img": "/static/sharemenu/qq.png",
"text": "QQ",
"share":{
"provider":"qq"
}
},
{
"img": "/static/sharemenu/copyurl.png",
"text": "复制",
"share":false
},
{
"img": "/static/sharemenu/more.png",
"text": "更多",
"share":"more"
}
]
let menus = []
plus.oauth.getServices(services=>{ //只显示有服务的项目
let servicesList = services.map(e=>e.id)
console.log(servicesList);
old_menus.forEach(item=>{
console.log(item.share.provider);
if(servicesList.includes(item.share.provider)){
menus.push(item)
}
})
},err=>{
uni.showModal({
title: '获取服务供应商失败:' +JSON.stringify(err),
showCancel: false,
confirmText: '知道了'
});
console.error('获取服务供应商失败:' + JSON.stringify(err));
})
let shareContent = {
type: 0,
href: "https://uniapp.dcloud.io/api/plugins/share?id=share",
title: "主标题",
summary: "分享内容的摘要",
imageUrl: "https://uniapp.dcloud.io/api/plugins/share?id=share",
}
export default (callback) => {
uniImageMenu.show(menus,e=>{
console.log(e);
if(e<4){
uni.share({
...menus[e].share,
...shareContent,
success: function(res) {
console.log("success:" + JSON.stringify(res));
},
fail: function(err) {
console.log("fail:" + JSON.stringify(err));
},
complete() {
uniImageMenu.hide()
}
})
}
})
}
import uniImageMenu from 'uni_modules/uni-image-menu/js_sdk/uni-image-menu.js';
export default async (param,callback) => {
var menus = []
plus.oauth.getServices(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)
}
})
console.log(menus);
uniImageMenu.show({list:menus,cancelText:param.cancelText}, e => {
console.log(e);
if (typeof(menus[e]['share']) == 'string') {
eval(menus[e]['share']+'()')
} else {
console.log(9527,{
...param.content,
...menus[e].share,
});
uni.share({
...param.content,
...menus[e].share,
success: function(res) {
console.log("success:" + JSON.stringify(res));
},
fail: function(err) {
console.log("fail:" + JSON.stringify(err));
},
complete(e) {
uniImageMenu.hide()
callback(e)
}
})
}
})
}, err => {
uni.showModal({
title: '获取服务供应商失败:' + JSON.stringify(err),
showCancel: false,
confirmText: '知道了'
});
console.error('获取服务供应商失败:' + JSON.stringify(err));
})
function copyurl() {
uni.setClipboardData({
data: param.content.href,
success: function () {
console.log('success');
uni.hideToast()//关闭自带的toast
uni.showToast({
title: '复制成功',
icon: 'none'
});
},
fail: (err) => {
uni.showModal({
content: JSON.stringify(err),
showCancel: false
});
}
});
}
// 使用系统分享发送分享消息
function shareSystem() {
plus.share.sendWithSystem({
type: 'text',
content: param.content.title + param.content.summary || '',
href: param.content.href,
}, function(e) {
console.log('分享成功');
callback(e)
}, function(e) {
console.log('分享失败:' + JSON.stringify(e));
callback(e)
});
}
}
# uni-share
\ No newline at end of file
# uni-share
例子
import uniShare from 'uni_modules/uni-share/js_sdk/uni-share.js';
uniShare({
menus:[
{
"img": "/static/sharemenu/wechatfriend.png",
"text": "微信好友",
"share": {
"provider": "weixin",
"scene": "WXSceneSession"
}
},
{
"img": "/static/sharemenu/wechatmoments.png",
"text": "微信朋友圈",
"share": {
"provider": "weixin",
"scene": "WXSceneSession"
}
},
{
"img": "/static/sharemenu/weibo.png",
"text": "微博",
"share": {
"provider": "sinaweibo"
}
},
{
"img": "/static/sharemenu/qq.png",
"text": "QQ",
"share": {
"provider": "qq"
}
},
{
"img": "/static/sharemenu/copyurl.png",
"text": "复制",
"share": "copyurl"
},
{
"img": "/static/sharemenu/more.png",
"text": "更多",
"share": "shareSystem"
}
],
cancelText:"取消分享",
content:{
type: 0,
href: "https://uniapp.dcloud.io/api/plugins/share?id=share",
title: "主标题",
summary: "分享内容的摘要",
imageUrl: "https://uniapp.dcloud.io/api/plugins/share?id=share",
}
},e=>{ //callback
console.log(e);
})
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册