From 97e04fd9f933b7be95cbec3cac5baa0905cecef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Clinchaomei=E2=80=9D?= <2603772894@qq.com> Date: Thu, 1 Sep 2022 17:27:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E5=88=86=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/productDetails/index.vue | 37 ++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) 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 }