谢杰标 3 лет назад
Родитель
Сommit
2e5a6ab17d
1 измененных файлов с 21 добавлено и 0 удалено
  1. 21 0
      pages/bill/index.vue

+ 21 - 0
pages/bill/index.vue

@@ -71,6 +71,27 @@ export default {
   methods: {
     getSharePoster() {
       getSharePoster(this.options).then((res) => {
+        let nowTime = Date.parse(new Date()) / 1000;
+        if (
+          res.status != 1 ||
+          nowTime < res.startTime ||
+          nowTime > res.endTime
+        ) {
+          uni.showModal({
+            title: "提示",
+            content:
+              res.status != 1
+                ? "活动已关闭"
+                : nowTime < res.startTime
+                ? "未到活动开启时间"
+                : "活动已过期",
+            showCancel: false,
+            success: (resst) => {
+              // uni.navigateBack();
+            },
+          });
+          return;
+        }
         this.billDetail = res;
         let posterConfig = JSON.parse(res.posterConfig);
         this.posterConfig = this.changeData(posterConfig);