android 模拟分享到微信朋友圈,uni-app实现Android分享到微信朋友圈和微信好友

分享到微信群或好友

清空以上信息

里客云科技开发

export default {

data() {

return {}

},

// 执行事件

methods:{

formSubmit:function(e){

var title = e.detail.value.title;

var miaoshu = e.detail.value.miaoshu;

var imgurl = e.detail.value.imgurl;

var url = e.detail.value.url;

uni.share({

provider: "weixin",

scene: "WXSceneSession",

type: 0,

href: url,

title: title,

summary: miaoshu,

imageUrl: imgurl,

success: function (res) {

console.log(JSON.stringify(res));

uni.showToast({

title: '已分享',

duration: 2000

});

},

fail: function (err) {

var errrr = JSON.stringify(err);

if(errrr){

uni.showModal({

title: '表单不能留空',

content: '请完善所有信息再发起分享',

success: function (res) {

if (res.confirm) {

console.log('用户点击确定');

} else if (res.cancel) {

console.log('用户点击取消');

}

}

});

}

}

});

},

},

}

*{margin: 0;padding: 0;}

.content{

width: 100%;

margin: 20px auto;

}

.content .uni-input{

width: 80%;

height: 45px;

margin: 8px auto;

border: 1px solid #ccc;

margin-bottom: 8px;

padding-left: 8px;

border-radius: 10px;

font-size: 16px;

color: #333;

}

.content button{

width: 80%;

height: 45px;

line-height: 45px;

margin: 8px auto;

border: 1px solid #ccc;

margin-bottom: 8px;

padding-left: 8px;

border-radius: 10px;

font-size: 16px;

color: #fff;

background: #56b273;

border: none;

}

button::after{ border: none;}

.content .banquan{

text-align: center;

margin-top: 50px;

font-size: 15px;

color: #666;

}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值