123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- # -*- coding: utf-8 -*-
- # !/usr/bin/env python
- import sys
- from base import init_env, setup_logger, get_logger
- init_env(interactive = True)
- if len(sys.argv) < 2:
- logger = get_logger(__name__)
- else:
- logger = setup_logger(filename = sys.argv[1], namespace = __name__)
- from apps.web.core.models import WechatAuthApp
- from apps.web.core.bridge import WechatClientProxy
- agentId = '6417d4456f29257125ebf705'
- appId = 'wx9a5f5a3529bfc123'
- secret = '3814fbdd6f3b6cbbf1713a89a63ba40f'
- grzx = {
- 'type': 'view',
- 'name': u'个人中心',
- 'url': 'http://www.washpayer.com/userLogin?agentId=' + agentId + '&redirect=%2Fuser%2Findex.html%23%2Fuser%2Fme'
- }
- dangqianfuwu = {
- 'type': 'view',
- 'name': u'当前服务',
- 'url': 'http://www.washpayer.com/userLogin?agentId=' + agentId + '&redirect=%2Fuser%2Findex.html%23%2Fuser%2FdeviceStatus'
- }
- changjianwenti = {
- 'type': 'view',
- 'name': u'常见问题',
- 'url': 'http://www.washpayer.com/userLogin?agentId=' + agentId + '&redirect=%2Fuser%2Findex.html%23%2Fuser%2Fhelp'
- }
- baogaolaoban = {
- 'type': 'view',
- 'name': u'报告老板',
- 'url': 'http://www.washpayer.com/userLogin?agentId=' + agentId + '&redirect=%2Fuser%2Findex.html%23%2Fuser%2FfeedbackList'
- }
- qitawenti = {
- 'type': 'view',
- 'name': u'其他问题',
- 'url': 'http://www.washpayer.com/userLogin?agentId=' + agentId + '&redirect=%2Fuser%2Findex.html%23%2Fuser%2FfeedbackList'
- }
- zbsb = {
- 'type': 'view',
- 'name': u'周边设备',
- 'url': 'http://www.washpayer.com/userLogin?agentId=' + agentId + '&redirect=%2Fuser%2Findex.html%23%2Fuser%2Findex'
- }
- toushushouli = {
- 'type': 'view',
- 'name': u'投诉受理',
- 'url': 'http://www.washpayer.com/userLogin?agentId=' + agentId + '&redirect=%2Fuser%2Findex.html%23%2Fcomplaint%2Flist'
- }
- menu = {
- "button":
- [
-
- {
- "name": u"服务&投诉",
- "sub_button": [dangqianfuwu,changjianwenti,baogaolaoban,toushushouli]
- },
- {
- "type": "scancode_push",
- "name": u"扫一扫",
- "key": "rselfmenu_0_1",
- "sub_button": []
- },
- grzx
- ]
- }
- app = WechatAuthApp(appid = appId,secret = secret)
- proxy = WechatClientProxy(app)
- print proxy.client.menu.create(menu)
|