使用asp.net mvc,boostrap及knockout.js开发微信自定义菜(2)

<div data-bind="with:Menus"> <div data-bind="foreach:newArray(3)"> <div> <!--ko if:($parent.button.length>0 && $parent.button[$index()]!=undefined && $parent.button[$index()].sub_button!=undefined ) --> <!--ko foreach:newArray((4-$parent.button[$index()].sub_button.length)) --> <div></div> <!--/ko--> <!--ko if:$parent.button[$index()].sub_button.length<5 --> <div data-bind="click:function (){$root.AddMenu($index())}"><i></i> </div> <!--/ko--> <!--ko foreach:($parent.button[$index()].sub_button) --> <div data-bind="text:name,attr:{'bottonIndex':$parent.value,'subbottonIndex':$index()},click:function (){$root.EditMenu($data,$parent.value,$index())}"></div> <!--/ko--> <!--/ko --> <!--ko if: $parent.button[$index()]!=undefined && $parent.button[$index()].sub_button==undefined --> <div></div> <div></div> <div></div> <div></div> <div data-bind="click:function (){$root.AddMenu($index())}"><i></i> </div> <!--/ko--> <!--ko if: $parent.button[$index()]==undefined --> <div></div> <div></div> <div></div> <div></div> <div></div> <!--/ko--> </div> </div> <!--ko foreach:button --> <div data-bind="text:name,attr:{'bottonindex':$index()},click:function (){$root.EditMenu($data,$index(),-1)}"></div> <!--/ko--> <!--ko if:button.length < 3 --> <div data-bind="click:function (){$root.AddMenu();}"><i></i> </div> <!--/ko--> <div></div> <div data-bind="with:$root.Menu,visible:($root.Menu()!=undefined)"> <form onsubmit="return false;"> <div> <input type="text" placeholder="请输入名称" data-bind="value:name"> </div> <div> <select onchange="$('#txtMenuButtonValue') .attr('placeholder', $(this).find('option:selected').attr('pl'))" data-bind="value:type"> <option value="view" pl="请输入Url">跳转URL</option> <option value="click" pl="请输入Key">点击推事件</option> <option value="scancode_push" pl="请输入Key">扫码推事件</option> <option value="scancode_waitmsg" pl="请输入Key">扫码推事件且弹出“消息接收中”提示框</option> <option value="pic_sysphoto" pl="请输入Key">弹出系统拍照发图</option> <option value="pic_photo_or_album" pl="请输入Key">弹出拍照或者相册发图</option> <option value="pic_weixin" pl="请输入Key"> 弹出微信相册发图器</option> <option value="location_select" pl="请输入Key">弹出地理位置选择器</option> </select> </div> <div> <input type="text" placeholder="请输入Url" data-bind="value:value"> </div> <div> <button type="submit" data-bind="click:$root.MenuSave">确定</button> <button type="submit" data-bind="visible:$root.isEditMenu,click:$root.DeleteMenu">删除</button> <button type="button" title="上移" data-bind="visible:$root.isEditMenu(),disable:!$root.IsUp(),click:$root.Up"><i aria-hidden="true"></i></button> <button type="button" title="下移" data-bind="visible:$root.isEditMenu(),disable:!$root.IsDown(),click:$root.Down"><i aria-hidden="true"></i></button> <button type="button" title="左移" data-bind="visible:$root.isEditMenu(),disable:!$root.IsLeft(),click:$root.Left"><i aria-hidden="true"></i></button> <button type="button" title="右移" data-bind="visible:$root.isEditMenu(),disable:!$root.IsRight(),click:$root.Right"><i aria-hidden="true"></i></button> <button type="button" title="复制菜单" data-bind="visible:$root.isEditMenu(),click:$root.Copy">复制</button> <button type="button" title="粘贴菜单" data-bind="click:$root.Paste">粘贴</button> <button type="submit" data-bind="click:$root.CancelMenuSave">关闭</button> </div> </form> </div> <div></div> </div>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdpjfs.html