from hello.engin_menu import mb_page from .data import page_ctx class Page720(object): def __init__(self, request, engin): self.request = request def get_template(self): return 'mobile/live.html' def get_context(self): page_name = self.request.GET.get('page') my_ctx = page_ctx.get(page_name) return { 'editor_ctx': my_ctx, 'editor': 'live_page_3d', } mb_page.update({'page720': Page720})
from hello.engin_menu import mb_page from .data import page_ctx class Videopage(object): def __init__(self, request, engin): self.request = request def get_template(self): return 'mobile/live.html' def get_context(self): page_name = self.request.GET.get('page') my_ctx = page_ctx.get(page_name) return { 'editor_ctx': my_ctx, 'editor': 'live_video_page', } mb_page.update({'video': Videopage})
from hello.engin_menu import mb_page class NeedCom(object): need_login=False def __init__(self, *args,**kws): pass def get_template(self): return 'mobile/live_show.html' def get_label(self): return '用户登录' def get_context(self): return { 'editor':'live_info', 'editor_ctx':{ 'info':'请先完成商户资格认证!', 'ops':[ {'editor':'com-op-submit','label':'确定','action':'location="/mb/index"',} ] } } mb_page.update({ 'need_com':NeedCom })
{ 'label':'审核进度', 'action':'live_root.open_live("live_com_cert_progress",scope.head.progress_ctx)', 'progress_ctx':{ 'title':'审核进度', 'init_express':'cfg.show_load();ex.director_call("workerinfo/progress").then(resp=>{cfg.hide_load();scope.vc.active = resp})', 'submit_info_express':'''cfg.pop_vue_com("com-pop-protocal",scope.vc.ctx.protocal_ctx) .then(()=>{ cfg.show_load(); return ex.director_call("workerinfo/submit_info") }).then(resp=>{ cfg.hide_load(); cfg.toast("服务者认证申请已经提交成功,请耐心等待!"); scope.vc.active = resp })''' , 'protocal_ctx':{ 'content':get_value('worker_cert_protocol','求职者认证协议不能为空!') } } } ] } ] } } mb_page.update({ 'workercert':WorkerCert })
#}) #return options @director_view('get_new_guy_gift') def get_new_guy_gift(account,block): '''account_id='wyh99999 ''' options =[] crt_user = get_request_cache()['request'].user block_inst = GameBlock.objects.get(pk = block) if not GamePlayer.objects.filter(acount=account,block = block_inst).exists(): if not TbCharacter.objects.using(block_inst.db).filter(account_id=account).exists(): raise UserWarning(_('没有找到角色!') ) elif not GamePlayer.objects.filter(agent__account = crt_user,block = block_inst,acount=account,new_guy_gift=False).exists(): raise UserWarning(_('该用户不属于本代理或已经领取过新人福利。') ) for inst in TbCharacter.objects.using(block_inst.db).filter(account_id=account): options.append({ 'value':inst.pc_id,'label':inst.pc_name }) return options director.update({ 'recharge_mb.form':RechargeForm, 'recharge_mb.new_guy_gift':NewPlayerGift, }) mb_page.update({ 'home':Home })
class Home(object): def __init__(self, request, engin): pass def get_template(self): return 'mobile/live_show.html' def get_context(self): block = settings.BIG_MEDIA + '/images/block.png' one_sixe = settings.BIG_MEDIA + '/images/one_six.png' garden = settings.BIG_MEDIA + '/images/garden.png' return { 'adapt_size': 'fullwidth', 'editor_ctx': { 'link_ctx': page_ctx, #'video_src': settings.BIG_MEDIA + '/video/中铁·星月山湖 网络版 11.13~1.mp4', 'music': settings.BIG_MEDIA + '/mp3/Music.mp3', }, 'editor': 'live_home', 'init_express': '''ex.each(["/static/images/page500/back_品牌.jpg","/static/images/back_通用底图.jpg","%(block)s","%(one_sixe)s","%(garden)s"],img=>{ ex.load_image(img) })''' % locals() } mb_page.update({'index': Home})
from hello.engin_menu import mb_page from .data import page_ctx class Page2d(object): def __init__(self, request, engin): self.request = request def get_template(self): return 'mobile/live.html' def get_context(self): page_name = self.request.GET.get('page') my_ctx = page_ctx.get(page_name) return { 'editor_ctx':my_ctx, 'editor':'live_page_2d', } mb_page.update({ 'page2d':Page2d })
{'value':'box83004','label':_('传说时装箱子*1'),'amount':1}, {'value':'rst50003','label':_('武器修复石*5'),'amount':5}, {'value':'rst50103','label':_('首饰修复石*5'),'amount':5}, {'value':'wei40011','label':_('负重增加1000*20'),'amount':20}, ]}, ] #@director_view('player_get_charecter') #def player_get_charecter(account): #'''account_id='wyh99999 ''' #options =[] #try: #GamePlayer.objects.get(acount = account) #except GamePlayer.DoesNotExist: #raise UserWarning('账号不存在') #for inst in TbCharacter.objects.using('game_sqlserver').filter(account_id=account): #options.append({ #'value':inst.pc_id,'label':inst.pc_name #}) #return options director.update({ 'palystore_form':PlayerStoreForm, }) mb_page.update({ 'store':PlayerStorePage })
'live_root.open_live("live_com_cert_progress",scope.head.progress_ctx)', 'progress_ctx': { 'title': '审核进度', 'init_express': 'cfg.show_load();ex.director_call("CompanyInfo/progress").then(resp=>{cfg.hide_load();scope.vc.active = resp})', 'submit_info_express': '''cfg.pop_vue_com("com-pop-protocal",scope.vc.ctx.protocal_ctx) .then(()=>{ cfg.show_load(); return ex.director_call("CompanyInfo/submit_info") }).then(resp=>{ cfg.hide_load(); cfg.toast("申请已经提交,请耐心等待!"); scope.vc.active = resp }) ''', 'protocal_ctx': { 'content': get_value('company_cert_protocol', '商户认证协议不能为空!') } } }, ] }] } } mb_page.update({'com_cert': Comcert})
class ArticleTable(ModelTableMobile): nolimit = True model = Article exclude = [] def dict_row(self, inst): return { 'image_url': inst.cover, 'sub_title': textify(truncatehtml(inst.content, length=30)), #'action':'live_root.open_live("live_html",{"content":scope.head.content,"title":scope.head.title})' 'action': 'live_root.open_fade("live_html",{"content":scope.head.content,"title":scope.head.title})' } class TagArticleTable(ArticleTable): def inn_filter(self, query): query = query.filter(tag=self.kw.get('tag')) return query director.update({ 'article': ArticleTable, 'tag-article': TagArticleTable, }) mb_page.update({'article': ArticlePage})
from hello.engin_menu import mb_page from .data import page_ctx class Page3d(object): def __init__(self, request, engin): self.request = request def get_template(self): return 'mobile/live.html' def get_context(self): page_name = self.request.GET.get('page') my_ctx = page_ctx.get(page_name) return { 'editor_ctx': my_ctx, 'editor': 'live_page_3d', } mb_page.update({'page3d': Page3d})
return query.filter(player_id=self.kw.get('player')) class RechargeBonusTab(ModelTableMobile): model = RechargeBonus nolimit = True fields_sort=['amount','createtime'] def dict_head(self, head): width ={ 'amount':'3rem', } if head['name'] in width: head['width'] =width[head['name']] return head def inn_filter(self, query): return query.filter(player_id=self.kw.get('player')) director.update({ 'everyday-sign':EveryDaySignForm, 'everyday-sign-history':EveryDayHistory, 'recharge-bonus':RechargeBonusTab, }) mb_page.update({ 'everyday':EveryDaySign, 'day':EveryDaySign, })
"box00003": 200, "box00013": 200, "ess20003": 100, "ess10003": 100, "ess00003": 100, "getexp04": 9990 } }] @director_view('player_get_charecter') def player_get_charecter(block, account): '''account_id='wyh99999 ''' options = [] block_inst = GameBlock.objects.get(pk=block) try: GamePlayer.objects.get(acount=account, block=block_inst) except GamePlayer.DoesNotExist: raise UserWarning('账号不存在') for inst in TbCharacter.objects.using( block_inst.db).filter(account_id=account): options.append({'value': inst.pc_id, 'label': inst.pc_name}) return options director.update({ 'playercredit': CreditForm, }) mb_page.update({'player': PlayerCredit})
'餐馆点菜', 'sub_title': '一个面向餐馆本地点餐', 'action': 'cfg.confirm("确定跳转到[餐馆点菜]?").then(()=>{ location="http://dish.softjing.com/mb/home"})' }, { 'editor': 'com-top-html', 'html': '<h2 style="text-align:center;margin:.4rem 0 .2rem 0">PC端</h2>' }, { 'editor': 'com-top-caption', 'image_url': static_url('mobile/color.png'), 'class': 'white-bg material-wave', 'css': '.white-bg{background-color:white;margin:.4rem 0}', 'title': 'COLOR管理后台', 'action': 'cfg.toast("请在pc端查看该样例")', 'sub_title': '一个画图app管理后台面,向本地的求职平台,比大平台更加贴近普通大众。' }, ], 'footer': self.get_footer('com_example') } } mb_page.update({'example': ExamplePage})
from hello.engin_menu import mb_page class NeedWorkCert(object): need_login=False def __init__(self, *args,**kws): pass def get_template(self): return 'mobile/live_show.html' def get_label(self): return '求职者认证' def get_context(self): return { 'editor':'live_info', 'editor_ctx':{ 'info':'请先完成求职者资格认证!', 'ops':[ {'editor':'com-op-submit','label':'确定','action':'location="/mb/index"',} ] } } mb_page.update({ 'need_worker_cert':NeedWorkCert })