diff --git a/api/activityManage.js b/api/activityManage.js index 892c562ebc68b3d2347f1378c1f7365b4fde7c7e..63b369faf31f0ab3a71d4a8cf26dc839006f885c 100644 --- a/api/activityManage.js +++ b/api/activityManage.js @@ -8,6 +8,14 @@ export function joinActivity (parameter) { }) } +export function sign (parameter) { + return axios({ + url: '/app/sign', + method: 'post', + data: parameter + }) +} + export function sList (parameter) { return axios({ url: '/app/sList', diff --git a/pages/act/detail.vue b/pages/act/detail.vue index 433c80207374f4935e50ff31afe834fae861d846..dcdfdc1807b5e1f84ddb0efaccbb98120ce438b5 100644 --- a/pages/act/detail.vue +++ b/pages/act/detail.vue @@ -212,17 +212,29 @@ export default { confirmColor: "#24CBA9", success: function (e) { e.confirm && t.signRequest(type).then(function (e) { - e.success ? (t.getRecruitDetail(), t.setData({ - btnDisabled: !1 - })) : uni.showToast({ - title: e.message, - icon: "none", - success: function () { - t.setData({ - btnDisabled: !1 - }); - } - }); + if (e.success) { + uni.showToast({ + title: typeName + "成功", + icon: "none", + duration: 1500, + success: function () { + t.getRecruitDetail(); + t.setData({ + btnDisabled: !1 + }); + } + }); + } else { + uni.showToast({ + title: e.message, + icon: "none", + success: function () { + t.setData({ + btnDisabled: !1 + }); + } + }); + } }), e.cancel && t.setData({ btnDisabled: !1 }); @@ -261,17 +273,29 @@ export default { confirmColor: "#24CBA9", success: function (e) { e.confirm && t.signUpRequest().then(function (e) { - e.success ? (t.getRecruitDetail(), t.setData({ - btnDisabled: !1 - })) : uni.showToast({ - title: e.data.message, - icon: "none", - success: function () { - t.setData({ - btnDisabled: !1 - }); - } - }); + if (e.success) { + uni.showToast({ + title: '报名成功', + icon: "none", + duration: 1500, + success: function () { + t.getRecruitDetail(); + t.setData({ + btnDisabled: !1 + }); + } + }); + } else { + uni.showToast({ + title: e.message, + icon: "none", + success: function () { + t.setData({ + btnDisabled: !1 + }); + } + }); + } }), e.cancel && t.setData({ btnDisabled: !1 }); @@ -332,6 +356,7 @@ export default { data: { api: n, id: e.id, + volunteerId: app.globalData.zyzId, contentType: 'application/x-www-form-urlencoded' }, method: 'get', @@ -362,14 +387,16 @@ export default { i.thumb = i.imageUrl ? config.host + "/sysFileInfo/preview?id=" + i.imageUrl : "/static/images/defaultorg.png"; i.users = []; - if (app.globalData.zyzId) { - e.isAlreadySignUp().then(function(result) { - if (result.data.success) { - e.isSignUp = result.data.data.isSign; - e.signType = result.data.data.signType; - } - }); - } + e.isSignUp = t.data.data.isSign; + e.signType = t.data.data.signType; + // if (app.globalData.zyzId) { + // e.isAlreadySignUp().then(function(result) { + // debugger; + // if (result.data.success) { + + // } + // }); + // } e.getActivityType().then(function(result) { diff --git a/pages/signin/signin.vue b/pages/signin/signin.vue index 05ce3d415b3cd9d9980b6157f6a53b74624dfe08..08e618945fdf709d3773781c1ac2656f06a9a21c 100644 --- a/pages/signin/signin.vue +++ b/pages/signin/signin.vue @@ -38,7 +38,8 @@ var t = require("../../utils/request.js"), default: t }; }(require("../../utils/api.js")), - o = (getApp(), e.default.departmentList), + app = getApp(), + o = e.default.departmentList, i = e.default.dictionaryCounty; export default { @@ -52,6 +53,11 @@ export default { props: {}, onLoad: function (t) { try { + if (!app.globalData.zyzId) { + uni.navigateTo({ + url: "/pages/entry/login" + }); + } var a = uni.getStorageSync("areaId"); console.log(a), this.setData({ provinceId: a.p_id, @@ -90,7 +96,7 @@ export default { }, toDetail: function (t) { uni.navigateTo({ - url: "/pages/signin/signincode" + url: "/pages/me/act/act" }); // uni.navigateTo({ // url: "/pages/org/detail?id=" + t.currentTarget.dataset.orgId