diff --git a/components/com_top_nav/com_top_nav.js b/components/com_top_nav/com_top_nav.js new file mode 100644 index 0000000..c8e29d9 --- /dev/null +++ b/components/com_top_nav/com_top_nav.js @@ -0,0 +1,44 @@ +var t = getApp(),os = t.globalData.setting; +Component({ + properties: {}, + data: { + isopen: 0, + iurl: os.imghost, + nav_left: "首页", //导航左边 + nav_center: "预约", //导航中间 + nav_right: "我的", //导航右边 + nav_left_url: "/pages/index/index/index", //导航左边地址 + nav_center_url: "/pages/user/my_service/tment_order_list", //导航中间地址 + nav_right_url: "/pages/user/index/index", //导航右边地址 + }, + ready: function() {}, + methods: { + //--点击打开事件-- + open_box: function() { + this.setData({ + isopen: 1 + }); + }, + set_name: function(name,url) { + var th = this; + th.setData({ + nav_center:name, + nav_center_url:url + }) + }, + //--关闭事件-- + close_box: function() { + this.setData({ + isopen: 0 + }); + }, + //--跳转-- + goto: function(e) { + var url = e.currentTarget.dataset.url; + getApp().goto(url); + this.close_box(); + } + + } + +}) \ No newline at end of file diff --git a/components/com_top_nav/com_top_nav.json b/components/com_top_nav/com_top_nav.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/com_top_nav/com_top_nav.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/com_top_nav/com_top_nav.wxml b/components/com_top_nav/com_top_nav.wxml new file mode 100644 index 0000000..6fca6c2 --- /dev/null +++ b/components/com_top_nav/com_top_nav.wxml @@ -0,0 +1,5 @@ + + + ID:454545 + + \ No newline at end of file diff --git a/components/com_top_nav/com_top_nav.wxss b/components/com_top_nav/com_top_nav.wxss new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/components/com_top_nav/com_top_nav.wxss