Jelajahi Sumber

推广素材

zhaoxiaohai 2 tahun lalu
induk
melakukan
b755773fc1

+ 22 - 6
pages/promotional/details.js

@@ -17,6 +17,7 @@ Page({
      * 生命周期函数--监听页面加载
      */
     async onLoad(options) {
+        console.log(options)
         this.setData({
             dataType: options.type,
             sat_sharematerialid: options.id
@@ -31,18 +32,33 @@ Page({
         };
         const res = isToken ? await _Http.basic(params) : await _Http.base(params);
         if (res.msg != '成功') res = await _Http.base(params);
+        if (!res.data.attinfos) {
+            wx.navigateBack()
+            wx.showToast({
+                title: '该素材已被删除',
+                icon: "none"
+            })
+            return
+        }
         if (res.msg == '成功') {
             if (res.data.attinfos.length) res.data.attinfos = MFT.fileList(res.data.attinfos);
             this.setData({
                 detailsData: res.data
             });
+            console.log(wx.getLaunchOptionsSync().scene)
             //分享进入
-            if ([1007, 1008, 1155].includes(wx.getLaunchOptionsSync().scene)) this.setData({
-                "shareData.userid": options.userid,
-                "shareData.systemclient": "wechatsaletool",
-                "shareData.sat_sharematerialid": options.id,
-                popupShow: true
-            })
+            if ([1007, 1008, 1155].includes(wx.getLaunchOptionsSync().scene)) {
+                wx.setNavigationBarTitle({
+                    title: res.data.title
+                })
+                console.log(res.data.title)
+                this.setData({
+                    "shareData.userid": options.userid,
+                    "shareData.systemclient": "wechatsaletool",
+                    "shareData.sat_sharematerialid": options.id
+                })
+                /* popupShow: true */
+            }
         } else {
             wx.showToast({
                 title: res.msg,

+ 1 - 0
pages/promotional/details.wxml

@@ -21,6 +21,7 @@
     <view style="width: 690rpx; margin: 0 auto;" wx:for="{{detailsData.attinfos}}">
         <van-image wx:if="{{item.fileType=='image'}}" width="690rpx" fit='widthFix' data-item="{{item}}" bindtap="openFile" radius='16rpx' src="{{item.url}}" lazy-load />
         <video class="video" wx:elif="{{item.fileType=='video'}}" style="width: 690rpx; margin: 0 auto; border-radius: 16rpx;" src="{{item.url}}" />
+        <view wx:else>未知文件</view>
         <view style="height:20rpx;" />
     </view>
 </block>

+ 1 - 0
pages/promotional/upload.js

@@ -273,4 +273,5 @@ Page({
             this.handleDelete(linksids)
         }
     },
+    onShareAppMessage(res) { }
 })