From c4a5ee19ea5c156603f1b950e28ae64f87886eba Mon Sep 17 00:00:00 2001 From: Patrick Sun Date: Sat, 12 Jan 2019 18:43:42 +1100 Subject: [PATCH] collecting all latest changes for github further development --- eventSubscribe.go | 9 ++++++--- menuClick.go | 41 +++++++++++++++++++++++++++++++++++------ outTemplateMsg.go | 23 ++++++++++++++++++++++- outTemplateMsg_test.go | 10 ++++++++++ procGetBasicUserInfo.go | 4 ++-- spa/editmeeting.html | 8 +++++--- spa/pinegrow.json | 2 +- 7 files changed, 81 insertions(+), 16 deletions(-) diff --git a/eventSubscribe.go b/eventSubscribe.go index 690ce0b..46cef01 100644 --- a/eventSubscribe.go +++ b/eventSubscribe.go @@ -80,10 +80,12 @@ func (m *WechatUserInfo) save2CRM() { func (in *InWechatMsg) askUserFillupBasicInfo() { first := "欢迎加入海外学子之家,这里凝聚着哈工大人在澳洲的,勤奋,努力和奋斗" url := "http://wechat.hitxy.org.au/profile_newly_register" - remark := "您是首次加入本社区,请点击详情完善您的个人资料" + url = "" + remark := "您是首次加入本社区,请通过菜单 “会员信息/我的会员资料”,完善您的个人信息" communityName := "哈工大澳洲校友会" joinDate := time.Now().Format("2006-Jan-02") templateSendJoinCommunity(in.header.FromUserName, url, first, remark, communityName, joinDate) + kfSendTxtAs(in.header.FromUserName, "系统会不断完善,如有问题和建议请及时联络我", "孙鹏") } func sendGreeting4ExistingUser(in *InWechatMsg, info crmdLead) { @@ -91,11 +93,12 @@ func sendGreeting4ExistingUser(in *InWechatMsg, info crmdLead) { first := "欢迎" + info.Name + "返回澳洲校友会" //url := "http://wechat.hitxy.org.au/profile_newly_register" url := "http://192.168.1.39:4200/profile_newly_register" - remark := "" + url = "" + remark := "请通过菜单 “会员信息/我的会员资料”,更新您的个人信息" communityName := "哈工大澳洲校友会" joinDate := info.getCreatedAt().Format("2006-Jan-02") templateSendJoinCommunity(in.header.FromUserName, url, first, remark, communityName, joinDate) - + kfSendTxtAs(in.header.FromUserName, "系统会不断完善和改进,如有问题或有建议请及时联络我", "孙鹏") } func (m *WechatUserInfo) registerNewLeadWithInfo(openID string) (newuser crmdLead, err error) { diff --git a/menuClick.go b/menuClick.go index b224c0c..4198206 100644 --- a/menuClick.go +++ b/menuClick.go @@ -18,16 +18,17 @@ func onClick(ss *openIDSessionData, in *InWechatMsg) { case "MEMBER_FEEDBACK": startProc(AllProc["投诉反馈"], ss, in) case "EVENT_STARTONE": - kfSendTxtAs(openid, "欢迎校友发起各种活动", "孙鹏") + in.replyText("众人拾柴火焰高,欢迎校友积极发起各种活动") onStartNewMeeting(ss, in) case "EVENT_LIVE": - kfSendTxtAs(openid, "当前暂无直播,如果你报名了直播活动,会自动收到直播", "孙鹏") + in.replyText("校友会活动,经常会有直播,以及3D VR影像\n\n由于距离原因不能参加活动的,欢迎通过直播和各位校友互动") + onGetLiveCast(ss, in) case "EVENT_CHECKIN": kfSendTxtAs(openid, "签到", "孙鹏") case "EVENT_LUCKYDRAW": - kfSendTxtAs(openid, "抽奖", "孙鹏") + kfSendTxtAs(openid, "目前暂无抽奖活动", "孙鹏") case "EVENTS_UPCOMING": - kfSendTxtAs(openid, "活动s", "孙鹏") + kfSendTxtAs(openid, "目前有一项活动,10月21日,许晓冬主讲,关于物联网 详情: https://www.hitxy.org.au/2017/10/15/2017_1015_peterxu/, 请在微信群里报名接龙", "孙鹏") case "CAREERDEV_JOBS": kfSendTxtAs(openid, "工作", "孙鹏") case "CAREERDEV_INDUSTRY": @@ -72,12 +73,40 @@ func onMembeCredits(ss *openIDSessionData, in *InWechatMsg) { } func onStartNewMeeting(ss *openIDSessionData, in *InWechatMsg) { + m := crmdMeeting{} info, found, err := crmFindLeadByOpenID(ss.OpenID) if found && err == nil && info.ID != "" { //lead found m.getMeetingByLead(info.ID) - // log.Printf("after search meeting %s ", m.ID) } url := m.getEditMeetingURL(info.ID) - kfSendTxtAs(ss.OpenID, url, "孙鹏") + + first := "校友会鼓励澳洲各地校友,积极发起活动,促进校友团结和发展\n\n根据活动内容提供活动资助\n\n" + name := info.LastName + application := "申请主办校友会的活动" + remark := "\n\n发起活动请点击详情" + + if m.ID != "" { //no existing + first = "您已有一次活动申请正在进行中,您现在还可以修改活动内容\n\n" + name = info.LastName + application = m.Name + remark = "\n\n点击详情进行修改" + } + + templateSendApplicationResult(ss.OpenID, url, first, remark, name, application) +} + +func onGetLiveCast(ss *openIDSessionData, in *InWechatMsg) { + + first := "最近一次直播2018年3月14日,母校领导访问悉尼\n\n" + name := "匿名用户" + application := "观看直播" + remark := "\n\n点击详情观看直播" + + info, found, err := crmFindLeadByOpenID(ss.OpenID) + if found && err == nil && info.ID != "" { //lead found + name = info.LastName + } + url := "https://hitxy.org.au/live" //GlobalPath.ThisSiteURL + "/spa/livecast" + templateSendApplicationResult(ss.OpenID, url, first, remark, name, application) } diff --git a/outTemplateMsg.go b/outTemplateMsg.go index 0d30bd5..aa15c97 100644 --- a/outTemplateMsg.go +++ b/outTemplateMsg.go @@ -37,6 +37,7 @@ var WechatTemplates = map[string]templatesIDInfo{ "checkin_failure": {"11", "签到失败提醒", "x0oZxM05A7DKKxQOt6x1AvgbKC0W1G7l2nwMy65rD0w"}, "inform_collection": {"12", "物品领取通知", "y4SUrN75QwWCmQfw2gLwgLzeTbhqrSxTm-GkxR16Pro"}, "join_community": {"13", "成功加入社群提醒", "yNKEqc7n-h1Y1DytmjUT5-H4s1zBK4nBIrYb8_jc2gM"}, + "application_result": {"14", "申请结果通知", "Cquuz_AFxdCb1hpZo_UN1S6-dCv_axLJI6osLU2quBE"}, } func kfSendTemplateMsg(touser, templateid, url string, data map[string]templateMsgKeyword) (resp string, err error) { @@ -382,5 +383,25 @@ func templateSendAccountBalance(toUser, url, first, remark, name, addr, card, ba data["remark"] = templateMsgKeyword{remark, "#FF0000"} return kfSendTemplateMsg(toUser, tid, url, data) - return +} + +func templateSendApplicationResult(toUser, url, first, remark, name, application string) (resp string, err error) { + // {{first.DATA}} + // 申请人:{{keyword1.DATA}} + // 申请类型:{{keyword2.DATA}} + // {{remark.DATA}} + + // 李先生,您好! + // 申请人:张三 + // 申请类型:预约会见法官 + // 您的申请已通过!请到个人中心查看详情。 + + tid := getTemplateIDByName("application_result") + data := map[string]templateMsgKeyword{} + data["first"] = templateMsgKeyword{first, "#173177"} + data["keyword1"] = templateMsgKeyword{name, "#173177"} + data["keyword2"] = templateMsgKeyword{application, "#173177"} + data["remark"] = templateMsgKeyword{remark, "#FF0000"} + return kfSendTemplateMsg(toUser, tid, url, data) + } diff --git a/outTemplateMsg_test.go b/outTemplateMsg_test.go index fd96521..ba17250 100644 --- a/outTemplateMsg_test.go +++ b/outTemplateMsg_test.go @@ -149,3 +149,13 @@ func TestSendTemplateMsgAccountBalance(t *testing.T) { templateSendAccountBalance(toUser, url, first, remark, name, addr, card, balance) } + +func TestSendTemplateMsgAppResult(t *testing.T) { + url := "http://www.google.com.au" + first := "什么申请 " + name := "张三二" + application := "申请加入某某活动" + remark := "没啥特殊指示 " + time.Now().Format("2006-01-02 15:04:06 Mon MST -07") + templateSendApplicationResult(toUser, url, first, remark, name, application) + +} diff --git a/procGetBasicUserInfo.go b/procGetBasicUserInfo.go index efb6ceb..dab1c97 100644 --- a/procGetBasicUserInfo.go +++ b/procGetBasicUserInfo.go @@ -76,7 +76,7 @@ func (m crmdLead) getBasicUserInfoEmail() (ret sendNewsArticle) { a.Description = "" a.PicURL = "" if m.EmailAddress == "" { - a.Title = "电邮: 妹有,妹有啊" + a.Title = "电邮: 请填写" } else { a.Title = "电邮: " + m.EmailAddress } @@ -89,7 +89,7 @@ func (m crmdLead) getBasicUserInfoPhone() (ret sendNewsArticle) { a.Description = "" a.PicURL = "" if m.PhoneNumber == "" { - a.Title = "电话: zhei4 个真妹有啊" + a.Title = "电话: 请填写" } else { a.Title = "电话: " + m.PhoneNumber } diff --git a/spa/editmeeting.html b/spa/editmeeting.html index e30e134..9421440 100644 --- a/spa/editmeeting.html +++ b/spa/editmeeting.html @@ -89,9 +89,11 @@
主办方须知 -

活动时间按照澳洲东岸时间(悉尼,墨尔本)时间为准。

-

活动内容将上报校友会备案。校友会全体在册人员将收到你的活动邀请,各位校友自行选择参加或不参加。

-

主办者将收到具体的人数更新,以及本次活动签到用的二维码。

+

上述填写的活动时间按照澳洲东岸时间(悉尼,墨尔本)。

+

活动内容自动上报校友会备案,资助情况由校友会和活动发起人线下协商。

+

活动举办之前也许会举行民意投票,以确定是否继续举办。

+

审核通过后,校友会全体在册人员将收到你的活动邀请,各位校友自行选择参加或不参加。

+

主办者将收到具体的人数更新,以及本次活动签到用的二维码。

所有当天参加活动的校友,通过公众号扫码即可签到

diff --git a/spa/pinegrow.json b/spa/pinegrow.json index 3c66500..1c54ada 100644 --- a/spa/pinegrow.json +++ b/spa/pinegrow.json @@ -1 +1 @@ -{"files":{"edit.html":{"frameworks":["spa","pg.insight.events","pg.code-validator","pg.asset.manager","pg.project.items","mat0.97.5","pg.html","pg.components"],"last_page_width":896},"404.html":{"frameworks":["spa","pg.insight.events","pg.code-validator","pg.asset.manager","pg.project.items","mat0.97.5","pg.html","pg.components"],"last_page_width":1024},"livecast.html":{"frameworks":["spa","pg.insight.events","pg.code-validator","pg.project.items","pg.asset.manager","mat0.97.5","pg.html","pg.components"],"last_page_width":1024},"newEvents.html":{"frameworks":["spa","pg.insight.events","pg.code-validator","pg.project.items","pg.asset.manager","mat0.97.5","pg.html","pg.components"],"last_page_width":1024},"newevent.html":{"frameworks":["spa","pg.insight.events","pg.asset.manager","pg.code-validator","pg.project.items","mat0.97.5","pg.html","pg.components"],"last_page_width":1024},"editmeeting.html":{"frameworks":["spa","pg.insight.events","pg.asset.manager","pg.code-validator","pg.project.items","mat0.97.5","pg.html","pg.components"],"last_page_width":1024},"403.html":{"frameworks":["spa","pg.insight.events","pg.code-validator","pg.asset.manager","pg.project.items","mat0.97.5","pg.html","pg.components"],"last_page_width":1024},"400.html":{"frameworks":["spa","pg.insight.events","pg.code-validator","pg.asset.manager","pg.project.items","mat0.97.5","pg.html","pg.components"],"last_page_width":1024},"500.html":{"frameworks":["spa","pg.insight.events","pg.code-validator","pg.asset.manager","pg.project.items","mat0.97.5","pg.html","pg.components"],"last_page_width":1024}},"breakpoints":["28.875em","33.875em","35.875em","38.875em","40.125em","46.75em","360px","390px","420px","450px","480px","510px","540px","570px","601px","630px","660px","690px","720px","750px","780px","810px","840px","870px","900px","930px","960px","993px","1200px"],"frameworks":["spa","pg.insight.events","pg.code-validator","pg.asset.manager","pg.project.items","mat0.97.5","pg.html","pg.components"],"template_framework_id":"materialize"} \ No newline at end of file +{"files":{"edit.html":{"frameworks":["spa","pg.insight.events","pg.code-validator","pg.asset.manager","pg.project.items","mat0.97.5","pg.html","pg.components"],"last_page_width":896},"404.html":{"frameworks":["spa","pg.insight.events","pg.code-validator","pg.asset.manager","pg.project.items","mat0.97.5","pg.html","pg.components"],"last_page_width":1024},"livecast.html":{"frameworks":["spa","pg.insight.events","pg.code-validator","pg.project.items","pg.asset.manager","mat0.97.5","pg.html","pg.components"],"last_page_width":1024},"newEvents.html":{"frameworks":["spa","pg.insight.events","pg.code-validator","pg.project.items","pg.asset.manager","mat0.97.5","pg.html","pg.components"],"last_page_width":1024},"newevent.html":{"frameworks":["spa","pg.insight.events","pg.asset.manager","pg.code-validator","pg.project.items","mat0.97.5","pg.html","pg.components"],"last_page_width":1024},"editmeeting.html":{"frameworks":["spa","pg.insight.events","pg.asset.manager","pg.code-validator","pg.project.items","mat0.97.5","pg.html","pg.components"],"last_page_width":1024},"403.html":{"frameworks":["spa","pg.insight.events","pg.code-validator","pg.asset.manager","pg.project.items","mat0.97.5","pg.html","pg.components"],"last_page_width":1024},"400.html":{"frameworks":["spa","pg.insight.events","pg.code-validator","pg.asset.manager","pg.project.items","mat0.97.5","pg.html","pg.components"],"last_page_width":1024},"500.html":{"frameworks":["spa","pg.insight.events","pg.code-validator","pg.asset.manager","pg.project.items","mat0.97.5","pg.html","pg.components"],"last_page_width":1024}},"breakpoints":["28.875em","33.875em","35.875em","38.875em","40.125em","46.75em","360px","390px","420px","450px","480px","510px","540px","570px","601px","630px","660px","690px","720px","750px","780px","810px","840px","870px","900px","930px","960px","993px","1200px"],"frameworks":["spa","pg.insight.events","pg.asset.manager","pg.code-validator","pg.project.items","mat0.97.5","pg.html","pg.components"],"template_framework_id":"materialize"} \ No newline at end of file