Browse Source

短信分享

master
“linchaomei” 4 years ago
parent
commit
97e04fd9f9
  1. 37
      pages/productDetails/index.vue

37
pages/productDetails/index.vue

@ -365,8 +365,8 @@
<view class="share_icon">
<view class="icon_item"><image src="../../static/img/facebook1.png" mode=""></image>Facebook</view>
<view class="icon_item" @click="Copylink()"><image src="../../static/img/copyLink.png" mode="">Copy Link</view>
<view class="icon_item"><image src="../../static/img/Mes.png" mode="">Send SMS</view>
<view class="icon_item"><image src="../../static/img/down.png" mode="">Download</view>
<view class="icon_item" @click="Sendmes()"><image src="../../static/img/Mes.png" mode="">Send SMS</view>
<view class="icon_item" @click="downloadImg()"><image src="../../static/img/down.png" mode="">Download</view>
<view class="icon_item"><image src="../../static/img/more1.png" mode="">More</view>
</view>
</view>
@ -748,7 +748,7 @@
getDate(){
defaultRequest(this.query).then(res=>{
if(res.error==0){
console.log(res.data.url)
console.log(res.data)
this.goodsDate=res.data
this.goodsDate.gallery_list.map(item=>{
item.content=''
@ -804,7 +804,7 @@
back(){
uni.navigateBack()
},
//
// 1
Copylink(){
uni.setClipboardData({
data:this.goodsDate.url,//
@ -816,6 +816,35 @@
}
});
},
// 2
downloadImg(){
uni.downloadFile({
url:this.goodsDate.goods_thumb,
success: (res) => {
if (res.statusCode === 200) {
console.log(res);
   uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function() {
uni.showToast({
title: 'saved!',
icon: 'none'
})
},
    });
}
}
});
},
//3
Sendmes(){
console.log('发送短信')
var msg = plus.messaging.createMessage(plus.messaging.TYPE_SMS);
msg.to = [];
msg.body = 'I discovered amazing products on DOPE PLUS.com, come check them out!'+ this.goodsDate.url;
plus.messaging.sendMessage( msg );
},
Require(url){
return url
}

Loading…
Cancel
Save