123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319 |
- import { activity, User } from "@/config/api.js";
- let app = getApp();
- export default {
- data() {
- return {
- page_no: 1,
- pageSize: 10,
- collectList: [],
- status: "loadmore",
- refresh: false, //正在下拉
- loadText: {
- loadmore: "上拉加载更多",
- loading: "加载中",
- nomore: "已经到底了",
- },
- isNeedAddCountryCode: false, //判断是否需要区号
- isAreaCode: false,
- areaCode: {
- id: "",
- type: "",
- },
- /**/
- tabsActive: 0,
- /**/
- /* 共用的弹框 */
- isShow: false, //弹框
- signupType: "", //关注类型
- goFollow: false, //是否关注公众号
- signupStatus: "Success", //4个不同的类型提示文案
- hasPermission: "", //是否有权限
- jurisdictionList: {
- SellerMobile: "",
- PopupMsg: "",
- OperationMode: "",
- },
- editIsShow: false, //外呼莫泰框
- isCancelShow: false,
- idTypeCancel: {
- id: "",
- type: 1,
- cutId: "",
- state: "",
- isNum: false,
- },
- countryCode: "", //外呼区号
- mobileEdit: "", //外呼手机号
- goOnNextStep: "", //设置外呼号后弹出哪个
- isShowhasPermission: false, //拨打销售电话
- applyForIsShow: false, //潜在用户
- mailboxBinding: false, //是否绑定邮箱
- };
- },
- methods: {
- // 我要报名
- wanttosignup(id) {
- this.activityIdAdd = id;
- this.selectShow = true;
- },
- //判断是否要绑定区号
- countryCcode() {
- User.countryCcode().then((res) => {
- if (res.Ret == 200) {
- this.isNeedAddCountryCode = res.Data.IsNeedAddCountryCode;
- }
- });
- },
- //报名
- signupAdd(id, type) {
- let timer = null;
- if (this.flag) return;
- clearTimeout(timer);
- this.flag = true;
- this.selectShow = false;
- if (id == "id") {
- id = this.activityIdAdd;
- }
- if (this.isNeedAddCountryCode) {
- this.isAreaCode = true;
- this.areaCode = {
- id,
- type,
- };
- } else {
- activity
- .signupAdd({
- ActivityId: id,
- SignupType: type,
- })
- .then((res) => {
- if (res.Ret == 200) {
- this.hasPermission = res.Data.HasPermission;
- if (this.hasPermission == 1) {
- const index = this.collectList.findIndex((item) => item.ActivityId == id);
- this.collectList[index].SignupType = type;
- this.signupType = res.Data.SignupType;
- this.signupStatus = res.Data.SignupStatus;
- this.countryCode = res.Data.CountryCode;
- this.mobileEdit = res.Data.Mobile;
- this.goOnNextStep = res.Data.GoFollow;
- this.idTypeCancel = {
- cutId: res.Data.ActivityId,
- state: 1,
- };
- if (res.Data.GoBindEmail) {
- this.mailboxBinding = true;
- return;
- }
- if (res.Data.SignupStatus !== "Success") {
- this.isShow = true;
- } else {
- if (res.Data.GoOutboundMobile) {
- this.editIsShow = true;
- } else if (res.Data.GoFollow) {
- this.goFollow = res.Data.GoFollow;
- } else if (res.Data.SignupStatus == "Success") {
- this.isShow = true;
- }
- }
- } else if (this.hasPermission == 2) {
- this.jurisdictionList.SellerMobile = res.Data.SellerMobile;
- this.jurisdictionList.PopupMsg = res.Data.PopupMsg;
- this.isShowhasPermission = true;
- } else if (this.hasPermission == 3 || this.hasPermission == 4) {
- this.jurisdictionList.PopupMsg = res.Data.PopupMsg;
- this.applyForIsShow = true;
- }
- }
- });
- }
- timer = setTimeout(() => {
- this.flag = false;
- }, 500);
- },
- //取消报名
- signupCancel(id, type, time) {
- const str = time.replace(/-/g, "/");
- const date = new Date(str);
- const times = date.getTime();
- const num = new Date().getTime();
- if (times - num <= 3600000) {
- uni.showModal({
- confirmText: "知道了",
- showCancel: false,
- confirmColor: "#3385FF",
- content: type == 1 ? "活动开始前1小时内无法取消预约外呼,请联系对口销售处理" : "活动开始前1小时内无法取消报名,请联系对口销售处理",
- });
- return;
- }
- this.isCancelShow = true;
- this.idTypeCancel = {
- id,
- type,
- cutId: "",
- state: 0,
- isNum: true,
- };
- },
- // 弹框的初始化
- init() {
- this.signupType = "";
- this.goFollow = false;
- this.signupStatus = "";
- this.isShow = false;
- this.isCancelShow = false;
- },
- //添加会议提醒接口
- meetingReminderAdd(id) {
- activity
- .meetingReminderAdd({
- ActivityId: id,
- })
- .then((res) => {
- if (res.Ret == 200) {
- this.hasPermission = res.Data.HasPermission;
- if (this.hasPermission == 1) {
- if ((res.Data.GoFollow && res.Data.SignupStatus !== "Success") || !res.Data.GoFollow) {
- this.isShow = true;
- } else {
- this.goFollow = res.Data.GoFollow;
- }
- this.signupType = 999;
- this.signupStatus = res.Data.SignupStatus;
- this.idTypeCancel = {
- cutId: res.Data.ActivityId,
- state: 1,
- name: "conference",
- };
- this.collectList.forEach((item) => {
- if (id == item.ActivityId) {
- item.IsCancelMeetingReminder = 1;
- }
- });
- } else if (this.hasPermission == 2) {
- this.jurisdictionList.SellerMobile = res.Data.SellerMobile;
- this.jurisdictionList.PopupMsg = res.Data.PopupMsg;
- this.isShowhasPermission = true;
- } else if (this.hasPermission == 3 || this.hasPermission == 4) {
- this.jurisdictionList.PopupMsg = res.Data.PopupMsg;
- this.applyForIsShow = true;
- }
- }
- });
- },
- //取消会议提醒接口
- meetingReminderCancel(id) {
- activity
- .meetingReminderCancel({
- ActivityId: id,
- })
- .then((res) => {
- if (res.Ret == 200) {
- uni.showModal({
- confirmText: "知道了",
- confirmColor: "#3385FF",
- content: res.Msg,
- showCancel: false,
- success: (res) => {
- if (this.isrefresh) return this.getActivityList();
- if (res.confirm) {
- this.collectList.forEach((item) => {
- if (id == item.ActivityId) {
- item.IsCancelMeetingReminder = 0;
- }
- });
- }
- },
- });
- }
- });
- },
- //取消弹框的确认事件
- cancelEnsure(obj, type, unm) {
- this.init();
- if (obj.name == "conference") return;
- if (this.isrefresh) return this.getActivityList();
- if (obj.cutId == 0) return;
- if (this.tabsActive !== 0) return this.getActivityList();
- if (type == 1) {
- this.collectList.forEach((item) => {
- if (obj.cutId == item.ActivityId) {
- item.IsSignup = obj.state;
- if (unm) {
- item.SignupNum = item.SignupNum - 1;
- } else {
- item.SignupNum = item.SignupNum + 1;
- }
- }
- });
- } else {
- this.collectList.forEach((item) => {
- if (obj.cutId == item.ActivityId) {
- item.IsSignup = obj.state;
- if (unm) {
- item.SignupNum = item.SignupNum - 1;
- } else {
- item.SignupNum = item.SignupNum + 1;
- }
- }
- });
- }
- },
- //帮我代问
- async askingGo(item) {
- const str = item.ActivityTime.replace(/-/g, "/");
- const date = new Date(str);
- const times = date.getTime();
- const num = new Date().getTime();
- if (item.ChartPermissionName !== "研选") {
- if (times - num <= 900000) {
- uni.showModal({
- confirmText: "知道了",
- showCancel: false,
- confirmColor: "#3385FF",
- content: "活动开始前15分钟内无法提交问题",
- });
- return;
- }
- } else {
- if (times - num <= 3600000) {
- uni.showModal({
- confirmText: "知道了",
- showCancel: false,
- confirmColor: "#3385FF",
- content: "活动开始前1小时内无法提交问题",
- });
- return;
- }
- }
- const res = await activity.checkAskActivity({ActivityId:item.ActivityId })
- if (res.Ret == 200) {
- this.hasPermission = res.Data.HasPermission;
- if (this.hasPermission == 1) {
- uni.navigateTo({
- url: "/activityPages/generationAsk/generationAsk?id=" + item.ActivityId,
- });
- } else if (this.hasPermission == 2) {
- this.jurisdictionList.SellerMobile = res.Data.SellerMobile;
- this.jurisdictionList.PopupMsg = res.Data.PopupMsg;
- this.isShowhasPermission = true;
- } else if (this.hasPermission == 3 || this.hasPermission == 4) {
- this.jurisdictionList.PopupMsg = res.Data.PopupMsg;
- this.applyForIsShow = true;
- }
- }
- },
- // 弹框的初始化
- init() {
- this.signupType = "";
- this.goFollow = false;
- this.signupStatus = "";
- this.isShow = false;
- this.isCancelShow = false;
- },
- //去往详情页面
- goDetail(item) {
- this.$store.dispatch("checkHandle", "/activityPages/activityDetail/activityDetail?id=" + item.ActivityId);
- },
- },
- };
|