From 28a4cfadc0a78d1bfec093e0694f420aaf3a725c Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 22 十二月 2020 19:15:04 +0800 Subject: [PATCH] 'api完善' --- util/api.js | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 98 insertions(+), 1 deletions(-) diff --git a/util/api.js b/util/api.js index b350140..1dee667 100644 --- a/util/api.js +++ b/util/api.js @@ -6,8 +6,19 @@ console.log(obj.data); http.postApi(url, obj.data, function (res) { - if (obj.success) + if (obj.success) { obj.success(res.data); + if (obj.showErrorToast) { + try { + if (res.data.code != 0) { + my.showToast({ + content: res.data.msg + }); + } + } catch (e) { + } + } + } }, function (res) { my.showToast({ content: '缃戠粶璇锋眰鍑洪敊' @@ -19,6 +30,20 @@ obj.complete(); }, obj.showLoading); }, + getConfig(obj) { + obj.data = {}; + this.commonRequest("/api/client/config/getConfig", obj); + }, + + /** + * + * @param {*} obj + */ + getNotice(obj) { + obj.data = { position: obj.position }; + this.commonRequest("/api/client/anouncement/getNotice", obj); + }, + /** * 鑾峰彇鎺ㄨ崘娲诲姩 @@ -126,6 +151,75 @@ getJoinerList(obj) { obj.data = { page: obj.page, activityId: obj.activityId }; this.commonRequest("/api/client/activity/join/getJoinerList", obj); + }, + + /** + * 娲诲姩鍔╁姏鍒楄〃 + * @param {*} obj + */ + getActivityAssistCouponList(obj) { + obj.data = { page: obj.page, activityId: obj.activityId }; + this.commonRequest("/api/client/activity/assist/getActivityAssistCouponList", obj); + }, + + /** + * 鑾峰彇涓淇℃伅 + * @param {*} obj + */ + getDrawnInfo(obj) { + obj.data = { count: obj.count, activityId: obj.activityId }; + this.commonRequest("/api/client/activity/awards/getDrawnInfo", obj); + }, + /** + * 鑾峰彇涓鍙備笌鑰呭垪琛� + * @param {*} obj + */ + getDrawnJoinerList(obj) { + obj.data = { awardId: obj.awardId, activityId: obj.activityId, page: obj.page }; + this.commonRequest("/api/client/activity/awards/getDrawnJoinerList", obj); + + }, + + /** + * 鑾峰彇鍔╁姏濂藉弸 + * @param {*} obj + */ + getAssistFriendsList(obj) { + obj.data = { page: obj.page }; + this.commonRequest("/api/client/activity/assist/getAssistFriendsList", obj); + }, + + getUserMsgList(obj) { + obj.data = { page: obj.page }; + this.commonRequest("/api/client/user/getUserMsgList", obj); + }, + + getUserConfig(obj) { + obj.data = {}; + this.commonRequest("/api/client/user/getUserConfig", obj); + }, + + setMsgRead(obj) { + obj.data = {}; + this.commonRequest("/api/client/user/setMsgRead", obj); + }, + + + getMsgSettings(obj) { + obj.data = {}; + this.commonRequest("/api/client/user/getMsgSettings", obj); + }, + setMsgSettings(obj) { + obj.data = obj.settings; + this.commonRequest("/api/client/user/setMsgSettings", obj); + }, + advice(obj) { + obj.data = { content: obj.content }; + this.commonRequest("/api/client/config/advice", obj); + }, + sponsorSignUp(obj) { + obj.data = { identity: obj.identity, provider: obj.provider, phone: obj.phone }; + this.commonRequest("/api/client/config/sponsorSignUp", obj); } @@ -137,6 +231,9 @@ + + + }; module.exports = api; \ No newline at end of file -- Gitblit v1.8.0