def text(xml): content = xml.Content if content == "111": return { "Title": "美女", "Description": "比基尼美女", "PicUrl": "http://9smv.com/static/mm/uploads/150411/2-150411115450247.jpg", "Url": "http://9smv.com/beauty/list?category=5", } elif content == "222": return [ [ "比基尼美女", "比基尼美女", "http://9smv.com/static/mm/uploads/150411/2-150411115450247.jpg", "http://9smv.com/beauty/list?category=5", ], [ "长腿美女", "长腿美女", "http://9smv.com/static/mm/uploads/150506/2-150506111A9648.jpg", "http://9smv.com/beauty/list?category=8", ], ] elif content == "push": Helper.send_text_message(xml.FromUserName, "推送消息测试") return "push ok" company_info_query = CompanyInfo.objects.all() if company_info_query: companyInfo = company_info_query[0] return str(companyInfo.welcome) else: return "欢迎加入"
def share(request): """jssdk 分享""" url = "http://" + request.get_host() + request.path sign = Helper.jsapi_sign(url) sign["appId"] = WxPayConf_pub.APPID return render_to_response("share.html", {"jsapi": sign})
def pay(request): response = render_to_response("pay.html") response.set_cookie("openid", Helper.sign_cookie(request.openid)) return response
def oauth(request): """网页授权获取用户信息""" resp = HttpResponse(request.openid) resp.set_cookie("openid", Helper.sign_cookie(request.openid)) return resp