Browse Source

merge master

bding 1 year ago
parent
commit
d6656c453b

+ 20 - 11
activityPages/activityDetail/manageMixin.js

@@ -136,17 +136,26 @@ export default {
         })
         .then((res) => {
           if (res.Ret == 200) {
-            uni.showModal({
-              confirmText: "知道了",
-              confirmColor: "#376cbb",
-              content: res.Msg || res.Data.PopupMsg,
-              showCancel: false,
-              success: (res) => {
-                if (res.confirm) {
-                  this.getActivityDetail();
-                }
-              },
-            });
+            this.hasPermission = res.Data.HasPermission;
+            this.jurisdictionList = res.Data;
+            this.jurisdictionList.isActivityDetail = true;
+            if (res.Data.SignupStatus !== "Success") {
+              this.isShow = true;
+            } else {
+              if (res.Data.SignupStatus == "Success") this.isShow = true;
+            }
+            
+            // uni.showModal({
+            //   confirmText: "知道了",
+            //   confirmColor: "#376cbb",
+            //   content: res.Msg || res.Data.PopupMsg,
+            //   showCancel: false,
+            //   success: (res) => {
+            //     if (res.confirm) {
+            //       this.getActivityDetail();
+            //     }
+            //   },
+            // });
           }
         });
     },

+ 95 - 2
components/modalDialog.vue

@@ -5,7 +5,7 @@
       :content-style="{ fontSize: '32rpx' }"
       @confirm="confirmModal"
       :confirm-text="confirmText"
-      :cancel-text="editIsShowDlg ? '前去修改' : '取消'"
+      :cancel-text="editIsShowDlg ? '前去修改' : signupType == 'summaryIsHandel' || jurisdictionList.SignupStatus !== 'Success' ? '取消' : '不加入'"
       :show-cancel-button="show_cancel_button"
       @cancel="cancelModal"
       :show-title="false"
@@ -191,7 +191,9 @@ export default {
         : this.goFollowShow
         ? "去关注"
         : this.show
-        ? "知道了"
+        ? this.jurisdictionList.SignupStatus !== "Success" || this.signupType == "summaryIsHandel"
+          ? "知道了"
+          : "加入"
         : "";
       return text;
     },
@@ -236,6 +238,9 @@ export default {
         ? this.GoOutboundMobileBtn()
         : "";
       this.initData();
+      if (this.jurisdictionList.isActivityDetail) {
+        this.$parent.getActivityDetail();
+      }
     },
     /**
      *
@@ -252,6 +257,9 @@ export default {
         this.initData();
         this.$emit("cancelShowBtn");
       }
+      if (this.jurisdictionList.isActivityDetail) {
+        this.$parent.getActivityDetail();
+      }
     },
     /**
      *
@@ -380,6 +388,8 @@ export default {
     //正常的
     contentBtn() {
       this.$emit("cancelShowBtn", this.idTypeCancel, this.signupType, this.idTypeCancel.isNum);
+      if (this.signupType == "summaryIsHandel" || this.jurisdictionList.SignupStatus !== "Success") return;
+      this.addCalendarHandler();
     },
     //去关注
     goFollowShowBtn() {
@@ -440,6 +450,89 @@ export default {
       this.showhasPermission = false;
       this.$parent.isShowhasPermission = false;
     },
+    handleAddCalendar() {
+      wx.getSetting({
+        success: (res) => {
+          // 判断是否已经授权
+          if (!res.authSetting["scope.addPhoneCalendar"]) {
+            wx.authorize({
+              scope: "scope.addPhoneCalendar",
+              success: () => {
+                // 用户已授权,调用添加日程 API
+                wx.showModal({
+                  title: "提示",
+                  content: "日历授权成功",
+                  confirmText: "加入日历",
+                  confirmColor: "#376cbb",
+                  success: (res) => {
+                    if (res.confirm) {
+                      this.addCalendarHandler();
+                    }
+                  },
+                });
+              },
+              fail(res) {
+                // 用户拒绝授权,提示用户授权
+                wx.showModal({
+                  title: "提示",
+                  content: "需要获取用户日历权限",
+                  confirmText: "前往设置",
+                  confirmColor: "#376cbb",
+                  success(res) {
+                    if (res.confirm) {
+                      wx.openSetting(); // 打开小程序设置页面,可以让用户开启需要的权限
+                    }
+                  },
+                });
+              },
+            });
+          } else {
+            this.addCalendarHandler();
+          }
+        },
+      });
+    },
+    addCalendarHandler() {
+      // 已经授权,调用添加日程 API
+      let dateTime = new Date(this.jurisdictionList.ActivityTime);
+      let timeOffset = this.jurisdictionList.ActivityType == 1 ? 900 : 7200;
+      wx.addPhoneCalendar({
+        title: this.jurisdictionList.ActivityTypeName, // 日程标题,必填项
+        startTime: dateTime.getTime() / 1000, // 日程开始时间,必填项
+        alarmOffset: timeOffset, // 线下活动,活动开始时间前2小时 || 线上活动,活动开始时间前15分钟
+        success(res) {
+          // 日程添加成功的回调函数
+          wx.showToast({
+            title: "添加日程成功",
+            icon: "success",
+            duration: 2000,
+          });
+        },
+        fail(res) {
+          console.log(res);
+          // 日程添加失败的回调函数
+          if (res.errMsg == "addPhoneCalendar:fail authorization refuesed") {
+            wx.showToast({
+              title: "添加失败,请确认系统日历已开启",
+              icon: "none",
+              duration: 2000,
+            });
+          }else if (res.errMsg == "addPhoneCalendar:fail auth deny") {
+            wx.showToast({
+              title: "添加失败,请确认允许小程序添加日历",
+              icon: "none",
+              duration: 2000,
+            });
+          } else {
+            wx.showToast({
+              title: "已取消添加",
+              icon: "none",
+              duration: 2000,
+            });
+          }
+        },
+      });
+    },
   },
   mounted() {
     // 免费送月卡

+ 2 - 2
pages/index/index.vue

@@ -15,7 +15,7 @@
           </search-bar>
         </view>
       </view>
-      <view class="banne-content" v-if="bannerDataList.length">
+      <view class="banne-content" v-if="bannerDataList.length > 0">
         <swiper autoplay :interval="4000" circular indicator-dots>
           <view v-for="item in bannerDataList" :key="item.BannerId" @click="bannerSwiperHandler(item)">
             <swiper-item>
@@ -30,7 +30,7 @@
           </view>
         </swiper>
       </view>
-      <view class="lable-select-box">
+      <view class="lable-select-box" v-if="industryTablList.length > 0">
         <view class="global_two_tabs industry-box-tabs">
           <view
             :class="['item', item.ChartPermissionId == industrytabActId && 'tabs-active']"

+ 2 - 2
pages/material/material.vue

@@ -484,8 +484,8 @@ export default {
         PageRouter: this.$store.state.pageRouterReport,
       });
       if (res.Ret === 200) {
-        let index = this.roadshowPageList.findIndex((key) => key.Id == item.Id);
-        res.Data.Status == 1 ? (this.roadshowPageList[index].IsCollect = true) : (this.roadshowPageList[index].IsCollect = false);
+        let index = this.roadshowPageList.findIndex((key) => key.SourceId == item.SourceId && key.Type == item.Type);
+        res.Data.Status == 1 ? this.$set(this.roadshowPageList[index], "IsCollect", true) : this.$set(this.roadshowPageList[index], "IsCollect", false);
         uni.showToast({
           title: res.Msg,
           duration: 2000,