From 2c08a98f7e85ec7c9376f27a7933e75e44d672f7 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 27 八月 2024 15:52:59 +0800
Subject: [PATCH] ll
---
wechat_staff/components/detailFooter/index.js | 142 +++++++++++++++++++++++++++++++++++++++++------
1 files changed, 123 insertions(+), 19 deletions(-)
diff --git a/wechat_staff/components/detailFooter/index.js b/wechat_staff/components/detailFooter/index.js
index ff58f51..24f4e0e 100644
--- a/wechat_staff/components/detailFooter/index.js
+++ b/wechat_staff/components/detailFooter/index.js
@@ -1,4 +1,7 @@
-import { getContentShareImg } from '../../api/index'
+import {
+ getContentShareImg,
+ actionDo
+} from '../../api/index'
Component({
/**
* 缁勪欢鐨勫睘鎬у垪琛�
@@ -13,44 +16,145 @@
*/
data: {
bottomLift: 0,
- showShare: false
+ showShare: false,
+ isShowPoster: false,
+ posterUrl: '',
+
+ leftIcon: '<<',
+ rightIcon: '>>',
},
attached() {
var app = getApp().globalData
this.setData({
bottomLift: app.bottomLift
- })
+ })
},
methods: {
- handleEnjoy() {
- const { info } = this.data
- this.triggerEvent('enjoy', {
- type: 'enjoy', flag: !info.isEnjoy
+ handleShare() {
+ let map = [
+ '/pages/detailDis/product',//浜у搧璇︽儏
+ '/pages/detailDis/case',//妗堜緥璇︽儏
+ '/pages/detailDis/realpic',//瀹炴櫙璇︽儏
+ '/pages/consult/detail',//璧勮璇︽儏
+ ]
+ const { info, path} = this.data
+ actionDo({
+ actionType: 'share',
+ id: info.id
+ })
+ wx.navigateToMiniProgram({
+ appId: 'wx208dd1edc0be24ee',
+ path: `${map[path]}?origin=b&id=${info.id}&userId=${wx.getStorageSync('member').id}`,
+ envVersion: 'release'
})
},
- handleCollec() {
- const { info } = this.data
+ handleEnjoy() {
+ const {
+ info
+ } = this.data
this.triggerEvent('enjoy', {
- type: 'collec', flag: !info.isCollection
+ type: 'enjoy',
+ flag: !info.isEnjoy
})
+ },
+ handleCollec() {
+ const {
+ info
+ } = this.data
+ this.triggerEvent('enjoy', {
+ type: 'collec',
+ flag: !info.isCollection
+ })
+
},
handleDown() {
- const { info, path } = this.data
- getContentShareImg({
- articleId: info.id,
- type: '1',
- pageUrl: path,
- imgurl: info.coverImage,
+ const {
+ info,
+ path
+ } = this.data
+ getContentShareImg({
+ articleId: `${info.id}_${path}`,
+ type: '0',
+ // pageUrl: path,
+ imgurl: info.coverImage,
+ }).then(res => {
+ this.setData({
+ isShowPoster: true,
+ showShare: false,
+ posterUrl: res.data
+ })
})
+ },
+ saveCard() {
+ let that = this
+ const posterUrl = this.data.posterUrl
+ wx.downloadFile({
+ url: posterUrl,
+ success: function (res) {
+ console.log('涓嬭浇鎴愬姛', res);
+ wx.saveImageToPhotosAlbum({
+ filePath: res.tempFilePath,
+ success(result) {
+ console.log(result)
+ that.setData({
+ isShowPoster: false
+ })
+ wx.setClipboardData({
+ data: ' >>绮惧搧妗堜緥<<\n'
+ +' 馃绮剧泭姹傜簿锛屽搧璐ㄧ敓娲火煡嘰n'
+ +'姹囬泦鍏ㄥ浗浼樼璁捐甯堣幏濂栨渚媆n'
+ +'馃憠鍚勭椋庢牸鐏垫劅妗堜緥涓婁竾濂楌煈圽n'
+ +' 鎬绘湁涓�濂楄兘鎵撳姩鎮紝閫傚悎鎮�',
+ success: function (res) {
+ wx.getClipboardData({
+ success: function (res) {
+ wx.showToast({
+ title: '鏂囨宸插鍒舵垚鍔燂紝鍘诲垎浜惂'
+ })
+ }
+ })
+ }
+ })
+ // wx.showToast({
+ // title: '淇濆瓨鎴愬姛',
+ // icon: 'success',
+ // duration: 2000
+ // })
+ }
+ })
+
+ }
+ })
+ },
+ batchDown() {
+ const downloadList = this.data.info.imageurlList || []
+ wx.setStorageSync('downloadList', downloadList)
+ wx.setStorageSync('downloadConfig', {
+ path: this.data.path,id: this.data.info.id
+ })
+ actionDo({
+ actionType: 'download',
+ id: this.data.info.id
+ })
+ wx.navigateTo({
+ url: '/pages/download/index',
+ }, 1000)
+ },
+ closeCard() {
+ this.setData({ isShowPoster: false })
},
openShare() {
console.log('鐐瑰嚮鎵撳紑');
- this.setData({ showShare: true })
+ this.setData({
+ showShare: true
+ })
},
onClose() {
console.log('鐐瑰嚮鍏抽棴');
- this.setData({ showShare: false })
+ this.setData({
+ showShare: false
+ })
},
}
-})
+})
\ No newline at end of file
--
Gitblit v1.9.3