| func (in *InWechatMsg) askUserFillupBasicInfo() { | func (in *InWechatMsg) askUserFillupBasicInfo() { | ||||
| first := "欢迎加入海外学子之家,这里凝聚着哈工大人在澳洲的,勤奋,努力和奋斗" | first := "欢迎加入海外学子之家,这里凝聚着哈工大人在澳洲的,勤奋,努力和奋斗" | ||||
| url := "http://wechat.hitxy.org.au/profile_newly_register" | url := "http://wechat.hitxy.org.au/profile_newly_register" | ||||
| remark := "您是首次加入本社区,请点击详情完善您的个人资料" | |||||
| url = "" | |||||
| remark := "您是首次加入本社区,请通过菜单 “会员信息/我的会员资料”,完善您的个人信息" | |||||
| communityName := "哈工大澳洲校友会" | communityName := "哈工大澳洲校友会" | ||||
| joinDate := time.Now().Format("2006-Jan-02") | joinDate := time.Now().Format("2006-Jan-02") | ||||
| templateSendJoinCommunity(in.header.FromUserName, url, first, remark, communityName, joinDate) | templateSendJoinCommunity(in.header.FromUserName, url, first, remark, communityName, joinDate) | ||||
| kfSendTxtAs(in.header.FromUserName, "系统会不断完善,如有问题和建议请及时联络我", "孙鹏") | |||||
| } | } | ||||
| func sendGreeting4ExistingUser(in *InWechatMsg, info crmdLead) { | func sendGreeting4ExistingUser(in *InWechatMsg, info crmdLead) { | ||||
| first := "欢迎" + info.Name + "返回澳洲校友会" | first := "欢迎" + info.Name + "返回澳洲校友会" | ||||
| //url := "http://wechat.hitxy.org.au/profile_newly_register" | //url := "http://wechat.hitxy.org.au/profile_newly_register" | ||||
| url := "http://192.168.1.39:4200/profile_newly_register" | url := "http://192.168.1.39:4200/profile_newly_register" | ||||
| remark := "" | |||||
| url = "" | |||||
| remark := "请通过菜单 “会员信息/我的会员资料”,更新您的个人信息" | |||||
| communityName := "哈工大澳洲校友会" | communityName := "哈工大澳洲校友会" | ||||
| joinDate := info.getCreatedAt().Format("2006-Jan-02") | joinDate := info.getCreatedAt().Format("2006-Jan-02") | ||||
| templateSendJoinCommunity(in.header.FromUserName, url, first, remark, communityName, joinDate) | templateSendJoinCommunity(in.header.FromUserName, url, first, remark, communityName, joinDate) | ||||
| kfSendTxtAs(in.header.FromUserName, "系统会不断完善和改进,如有问题或有建议请及时联络我", "孙鹏") | |||||
| } | } | ||||
| func (m *WechatUserInfo) registerNewLeadWithInfo(openID string) (newuser crmdLead, err error) { | func (m *WechatUserInfo) registerNewLeadWithInfo(openID string) (newuser crmdLead, err error) { |
| case "MEMBER_FEEDBACK": | case "MEMBER_FEEDBACK": | ||||
| startProc(AllProc["投诉反馈"], ss, in) | startProc(AllProc["投诉反馈"], ss, in) | ||||
| case "EVENT_STARTONE": | case "EVENT_STARTONE": | ||||
| kfSendTxtAs(openid, "欢迎校友发起各种活动", "孙鹏") | |||||
| in.replyText("众人拾柴火焰高,欢迎校友积极发起各种活动") | |||||
| onStartNewMeeting(ss, in) | onStartNewMeeting(ss, in) | ||||
| case "EVENT_LIVE": | case "EVENT_LIVE": | ||||
| kfSendTxtAs(openid, "当前暂无直播,如果你报名了直播活动,会自动收到直播", "孙鹏") | |||||
| in.replyText("校友会活动,经常会有直播,以及3D VR影像\n\n由于距离原因不能参加活动的,欢迎通过直播和各位校友互动") | |||||
| onGetLiveCast(ss, in) | |||||
| case "EVENT_CHECKIN": | case "EVENT_CHECKIN": | ||||
| kfSendTxtAs(openid, "签到", "孙鹏") | kfSendTxtAs(openid, "签到", "孙鹏") | ||||
| case "EVENT_LUCKYDRAW": | case "EVENT_LUCKYDRAW": | ||||
| kfSendTxtAs(openid, "抽奖", "孙鹏") | |||||
| kfSendTxtAs(openid, "目前暂无抽奖活动", "孙鹏") | |||||
| case "EVENTS_UPCOMING": | case "EVENTS_UPCOMING": | ||||
| kfSendTxtAs(openid, "活动s", "孙鹏") | |||||
| kfSendTxtAs(openid, "目前有一项活动,10月21日,许晓冬主讲,关于物联网 详情: https://www.hitxy.org.au/2017/10/15/2017_1015_peterxu/, 请在微信群里报名接龙", "孙鹏") | |||||
| case "CAREERDEV_JOBS": | case "CAREERDEV_JOBS": | ||||
| kfSendTxtAs(openid, "工作", "孙鹏") | kfSendTxtAs(openid, "工作", "孙鹏") | ||||
| case "CAREERDEV_INDUSTRY": | case "CAREERDEV_INDUSTRY": | ||||
| } | } | ||||
| func onStartNewMeeting(ss *openIDSessionData, in *InWechatMsg) { | func onStartNewMeeting(ss *openIDSessionData, in *InWechatMsg) { | ||||
| m := crmdMeeting{} | m := crmdMeeting{} | ||||
| info, found, err := crmFindLeadByOpenID(ss.OpenID) | info, found, err := crmFindLeadByOpenID(ss.OpenID) | ||||
| if found && err == nil && info.ID != "" { //lead found | if found && err == nil && info.ID != "" { //lead found | ||||
| m.getMeetingByLead(info.ID) | m.getMeetingByLead(info.ID) | ||||
| // log.Printf("after search meeting %s ", m.ID) | |||||
| } | } | ||||
| url := m.getEditMeetingURL(info.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) | |||||
| } | } |
| "checkin_failure": {"11", "签到失败提醒", "x0oZxM05A7DKKxQOt6x1AvgbKC0W1G7l2nwMy65rD0w"}, | "checkin_failure": {"11", "签到失败提醒", "x0oZxM05A7DKKxQOt6x1AvgbKC0W1G7l2nwMy65rD0w"}, | ||||
| "inform_collection": {"12", "物品领取通知", "y4SUrN75QwWCmQfw2gLwgLzeTbhqrSxTm-GkxR16Pro"}, | "inform_collection": {"12", "物品领取通知", "y4SUrN75QwWCmQfw2gLwgLzeTbhqrSxTm-GkxR16Pro"}, | ||||
| "join_community": {"13", "成功加入社群提醒", "yNKEqc7n-h1Y1DytmjUT5-H4s1zBK4nBIrYb8_jc2gM"}, | "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) { | func kfSendTemplateMsg(touser, templateid, url string, data map[string]templateMsgKeyword) (resp string, err error) { | ||||
| data["remark"] = templateMsgKeyword{remark, "#FF0000"} | data["remark"] = templateMsgKeyword{remark, "#FF0000"} | ||||
| return kfSendTemplateMsg(toUser, tid, url, data) | 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) | |||||
| } | } |
| templateSendAccountBalance(toUser, url, first, remark, name, addr, card, balance) | 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) | |||||
| } |
| a.Description = "" | a.Description = "" | ||||
| a.PicURL = "" | a.PicURL = "" | ||||
| if m.EmailAddress == "" { | if m.EmailAddress == "" { | ||||
| a.Title = "电邮: 妹有,妹有啊" | |||||
| a.Title = "电邮: 请填写" | |||||
| } else { | } else { | ||||
| a.Title = "电邮: " + m.EmailAddress | a.Title = "电邮: " + m.EmailAddress | ||||
| } | } | ||||
| a.Description = "" | a.Description = "" | ||||
| a.PicURL = "" | a.PicURL = "" | ||||
| if m.PhoneNumber == "" { | if m.PhoneNumber == "" { | ||||
| a.Title = "电话: zhei4 个真妹有啊" | |||||
| a.Title = "电话: 请填写" | |||||
| } else { | } else { | ||||
| a.Title = "电话: " + m.PhoneNumber | a.Title = "电话: " + m.PhoneNumber | ||||
| } | } |
| </div> | </div> | ||||
| <div class="col s12 m12 l12"> | <div class="col s12 m12 l12"> | ||||
| <b>主办方须知</b> | <b>主办方须知</b> | ||||
| <p>活动时间按照澳洲东岸时间(悉尼,墨尔本)时间为准。</p> | |||||
| <p>活动内容将上报校友会备案。校友会全体在册人员将收到你的活动邀请,各位校友自行选择参加或不参加。</p> | |||||
| <p>主办者将收到具体的人数更新,以及本次活动签到用的二维码。</p> | |||||
| <p>上述填写的活动时间按照澳洲东岸时间(悉尼,墨尔本)。</p> | |||||
| <p>活动内容自动上报校友会备案,资助情况由校友会和活动发起人线下协商。</p> | |||||
| <p>活动举办之前也许会举行民意投票,以确定是否继续举办。</p> | |||||
| <p>审核通过后,校友会全体在册人员将收到你的活动邀请,各位校友自行选择参加或不参加。</p> | |||||
| <p>主办者将收到具体的人数更新,以及本次活动签到用的二维码。<br></p> | |||||
| <p>所有当天参加活动的校友,通过公众号扫码即可签到</p> | <p>所有当天参加活动的校友,通过公众号扫码即可签到</p> | ||||
| <p class="valign right"></p> | <p class="valign right"></p> | ||||
| </div> | </div> |
| {"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"} | |||||
| {"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"} |