|
@@ -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() {
|
|
|
// 免费送月卡
|