Quellcode durchsuchen

长图文考虑数据未发布和已过期情况

xiaohaizhao vor 1 Jahr
Ursprung
Commit
108c0ade89
1 geänderte Dateien mit 23 neuen und 5 gelöschten Zeilen
  1. 23 5
      packageA/advertising/modules/page.vue

+ 23 - 5
packageA/advertising/modules/page.vue

@@ -37,11 +37,29 @@ export default {
                 }).then(res => {
                     console.log('获取长图文详情', res)
                     if (this.cutoff(res.msg)) return;
-                    this.detail = res.data;
-                    resolve(res.data)
-                    uni.setNavigationBarTitle({
-                        title: res.data.title,
-                    })
+                    let tips = '';
+                    if (!res.data.status) {
+                        tips = '数据已过期'
+                    } else {
+                        if (res.data.status != '发布') tips = '敬请期待!'
+                    };
+
+                    if (tips) {
+                        uni.showModal({
+                            title: '提示',
+                            content: tips,
+                            showCancel: false,
+                            complete: (complete) => {
+                                uni.navigateBack();
+                            },
+                        })
+                    } else {
+                        this.detail = res.data;
+                        resolve(res.data)
+                        uni.setNavigationBarTitle({
+                            title: res.data.title,
+                        })
+                    }
                 })
             })