diff --git a/pages/productDetails/index.vue b/pages/productDetails/index.vue index c4690bb..c2c557b 100644 --- a/pages/productDetails/index.vue +++ b/pages/productDetails/index.vue @@ -365,8 +365,8 @@ Facebook Copy Link - Send SMS - Download + Send SMS + Download More @@ -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 }