Commit 61e86433d69333ae33ff88efee25c35645979586
1 parent
4b0a6f26
导航新增一个入参方法,好友助力排版
Showing
5 changed files
with
272 additions
and
28 deletions
components/nav_b/nav_b.js
| 1 | -var t = getApp(), os = t.globalData.setting; | 1 | +var t = getApp(), |
| 2 | + os = t.globalData.setting; | ||
| 2 | Component({ | 3 | Component({ |
| 3 | - properties: { | ||
| 4 | - }, | 4 | + properties: {}, |
| 5 | data: { | 5 | data: { |
| 6 | isopen: 0, | 6 | isopen: 0, |
| 7 | iurl: os.imghost, | 7 | iurl: os.imghost, |
| 8 | - nav_left:"首页",//导航左边 | ||
| 9 | - nav_center:"预约",//导航中间 | ||
| 10 | - nav_right: "我的",//导航右边 | ||
| 11 | - nav_left_url: "/pages/index/index/index",//导航左边地址 | ||
| 12 | - nav_center_url:"/pages/user/my_service/tment_order_list",//导航中间地址 | ||
| 13 | - nav_right_url:"/pages/user/index/index",//导航右边地址 | 8 | + nav_left: "首页", //导航左边 |
| 9 | + nav_center: "预约", //导航中间 | ||
| 10 | + nav_right: "我的", //导航右边 | ||
| 11 | + nav_left_url: "/pages/index/index/index", //导航左边地址 | ||
| 12 | + nav_center_url: "/pages/user/my_service/tment_order_list", //导航中间地址 | ||
| 13 | + nav_right_url: "/pages/user/index/index", //导航右边地址 | ||
| 14 | }, | 14 | }, |
| 15 | 15 | ||
| 16 | - ready: function () { | ||
| 17 | - }, | 16 | + ready: function() {}, |
| 18 | methods: { | 17 | methods: { |
| 19 | //--点击打开事件-- | 18 | //--点击打开事件-- |
| 20 | - open_box: function () { | ||
| 21 | - this.setData({ isopen: 1 }); | 19 | + open_box: function() { |
| 20 | + this.setData({ | ||
| 21 | + isopen: 1 | ||
| 22 | + }); | ||
| 23 | + }, | ||
| 24 | + set_name: function(name,url) { | ||
| 25 | + var th = this; | ||
| 26 | + th.setData({ | ||
| 27 | + nav_center:name, | ||
| 28 | + nav_center_url:url | ||
| 29 | + }) | ||
| 22 | }, | 30 | }, |
| 23 | //--关闭事件-- | 31 | //--关闭事件-- |
| 24 | - close_box: function () { | ||
| 25 | - this.setData({ isopen: 0 }); | 32 | + close_box: function() { |
| 33 | + this.setData({ | ||
| 34 | + isopen: 0 | ||
| 35 | + }); | ||
| 26 | }, | 36 | }, |
| 27 | //--跳转-- | 37 | //--跳转-- |
| 28 | - goto: function (e) { | 38 | + goto: function(e) { |
| 29 | var url = e.currentTarget.dataset.url; | 39 | var url = e.currentTarget.dataset.url; |
| 30 | getApp().goto(url); | 40 | getApp().goto(url); |
| 31 | this.close_box(); | 41 | this.close_box(); |
pages/user/assistance/assistance.js
| @@ -10,21 +10,41 @@ Page({ | @@ -10,21 +10,41 @@ Page({ | ||
| 10 | * 页面的初始数据 | 10 | * 页面的初始数据 |
| 11 | */ | 11 | */ |
| 12 | data: { | 12 | data: { |
| 13 | - | 13 | + url: a.url, //接口网址 |
| 14 | + iurl: a.imghost, //图片前缀网址 | ||
| 15 | + switch_head: 0, //0:我的任务,1:活动说明 | ||
| 14 | }, | 16 | }, |
| 15 | 17 | ||
| 16 | /** | 18 | /** |
| 17 | * 生命周期函数--监听页面加载 | 19 | * 生命周期函数--监听页面加载 |
| 18 | */ | 20 | */ |
| 19 | - onLoad: function (options) { | ||
| 20 | - | 21 | + onLoad: function(options) { |
| 22 | + var th = this; | ||
| 23 | + th.close(); | ||
| 21 | }, | 24 | }, |
| 22 | 25 | ||
| 23 | /** | 26 | /** |
| 24 | * 生命周期函数--监听页面显示 | 27 | * 生命周期函数--监听页面显示 |
| 25 | */ | 28 | */ |
| 26 | - onShow: function () { | 29 | + onShow: function() { |
| 27 | 30 | ||
| 31 | + }, | ||
| 32 | + switch_head: function(e) { | ||
| 33 | + var th = this; | ||
| 34 | + var index = e.currentTarget.dataset.index; //获取当前选择的是任务还是活动说明 | ||
| 35 | + var switch_head = th.data.switch_head; //0任务,1活动说明 | ||
| 36 | + if (index != switch_head) { | ||
| 37 | + th.setData({ | ||
| 38 | + switch_head: index | ||
| 39 | + }) | ||
| 40 | + } | ||
| 41 | + }, | ||
| 42 | + //关闭导航 | ||
| 43 | + close: function() { | ||
| 44 | + var th = this; | ||
| 45 | + var nav_b = th.selectComponent("#nav_b"); //组件的id | ||
| 46 | + nav_b.close_box(); | ||
| 47 | + nav_b.set_name("助力", ""); | ||
| 28 | } | 48 | } |
| 29 | 49 | ||
| 30 | }) | 50 | }) |
| 31 | \ No newline at end of file | 51 | \ No newline at end of file |
pages/user/assistance/assistance.json
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | "navigationStyle": "custom", | 3 | "navigationStyle": "custom", |
| 4 | "usingComponents": { | 4 | "usingComponents": { |
| 5 | "warn": "/components/long_warn/long_warn", | 5 | "warn": "/components/long_warn/long_warn", |
| 6 | - "my_confirm": "/components/my_confirm/my_confirm" | 6 | + "my_confirm": "/components/my_confirm/my_confirm", |
| 7 | + "nav_b": "/components/nav_b/nav_b" | ||
| 7 | } | 8 | } |
| 8 | } | 9 | } |
| 9 | \ No newline at end of file | 10 | \ No newline at end of file |
pages/user/assistance/assistance.wxml
| 1 | -<view> | ||
| 2 | - | ||
| 3 | - | ||
| 4 | - | ||
| 5 | - | ||
| 6 | - | 1 | +<view class="page" bindtap="close"> |
| 2 | + <!-- 背景图片 --> | ||
| 3 | + <image class="lumi" src="{{iurl+'miniapp/images/friendhelp/lumi.png'}}" lazy-load="true"></image> | ||
| 4 | + <view class="zindex"> | ||
| 5 | + <view class="top"> | ||
| 6 | + <view class="flex-center"> | ||
| 7 | + <image class="getgift" src="{{iurl+'miniapp/images/friendhelp/getgift.png'}}" lazy-load="true"></image> | ||
| 8 | + </view> | ||
| 9 | + <view class="flex-center fs32"> | ||
| 10 | + <view class="excitation">机会总是留给最有行动力的人</view> | ||
| 11 | + </view> | ||
| 12 | + <view class="flex-center"> | ||
| 13 | + <image class="gift" src="{{iurl+'miniapp/images/friendhelp/gift.png'}}" lazy-load="true"></image> | ||
| 14 | + </view> | ||
| 15 | + <view class="flex-center fs26 time"> | ||
| 16 | + <view>活动时间:</view> | ||
| 17 | + <view>5月28日-6月30日 | ||
| 18 | + </view> | ||
| 19 | + </view> | ||
| 20 | + <view class="flex-center"> | ||
| 21 | + <view class="flex-center take"> | ||
| 22 | + <view>立即领取</view> | ||
| 23 | + </view> | ||
| 24 | + </view> | ||
| 25 | + </view> | ||
| 7 | 26 | ||
| 27 | + <!-- 任务及说明栏 --> | ||
| 28 | + <view> | ||
| 29 | + <!-- 标题 --> | ||
| 30 | + <view class="flex-vertical-between fs28 padding head"> | ||
| 31 | + <!-- task --> | ||
| 32 | + <view class="flex-center lhead {{switch_head==0?'rhead':''}}" bindtap="switch_head" data-index="{{0}}"> | ||
| 33 | + <image class="explain" src="{{iurl+'miniapp/images/friendhelp/task.png'}}" lazy-load="true"></image> | ||
| 34 | + <view>我的任务</view> | ||
| 35 | + </view> | ||
| 36 | + <view class="flex-center lhead {{switch_head==1?'rhead':''}}" bindtap="switch_head" data-index="{{1}}"> | ||
| 37 | + <image class="explain" src="{{iurl+'miniapp/images/friendhelp/explain.png'}}" lazy-load="true"></image> | ||
| 38 | + <view>活动说明</view> | ||
| 39 | + </view> | ||
| 40 | + </view> | ||
| 8 | 41 | ||
| 42 | + <!-- 我的任务 --> | ||
| 43 | + <view wx:if="{{switch_head==0}}" class="white"> | ||
| 44 | + <view class="items"> | ||
| 45 | + <view class="item fs26 flex-vertical-between padding" wx:for="{{5}}"> | ||
| 46 | + <view class="flex-center width"> | ||
| 47 | + <view class="ellipsis-1">豪华任务一 | ||
| 48 | + </view> | ||
| 49 | + </view> | ||
| 9 | 50 | ||
| 51 | + <view class="flex-center width state"> | ||
| 52 | + <view class="ellipsis-1">进行中 | ||
| 53 | + </view> | ||
| 54 | + </view> | ||
| 55 | + </view> | ||
| 56 | + <!-- 加载更多 --> | ||
| 57 | + <view class="fs28 flex-center"> | ||
| 58 | + <view class="line"></view> | ||
| 59 | + <view class="load" bindtap="">点击加载更多</view> | ||
| 60 | + <view class="line"></view> | ||
| 61 | + </view> | ||
| 62 | + </view> | ||
| 10 | 63 | ||
| 64 | + <view class="fs30"> | ||
| 65 | + <view class="flex-center nothing"> | ||
| 66 | + <view>暂无任务记录</view> | ||
| 67 | + </view> | ||
| 68 | + <view class="flex-center receive"> | ||
| 69 | + <view class="flex-center"> | ||
| 70 | + <view>已有</view> | ||
| 71 | + <view>126</view> | ||
| 72 | + <view>人领取了任务</view> | ||
| 73 | + </view> | ||
| 11 | 74 | ||
| 75 | + </view> | ||
| 76 | + </view> | ||
| 12 | 77 | ||
| 78 | + </view> | ||
| 79 | + <!-- 活动说明 --> | ||
| 80 | + <view wx:if="{{switch_head}}" class="white"> | ||
| 81 | + <view class="items"> | ||
| 82 | + <view class="content fs28 padding"> | ||
| 83 | + <view>活动时间: 2014年4月24日-27日, 共4天 活动规则:活动期间内,通过当当购物手机客户端成功购买图书的用户, 均视为成功参与此次活动;每个用户只可参与一-次。 奖品发放:交易完成后,3个工作日内发送至参与用户账号 补充说明:此次活动不与客户端用户首单奖励5元活动冲突,可同时参与。 此次活动最终解释权归当当网所有。</view> | ||
| 84 | + </view> | ||
| 85 | + <!-- 加载更多 --> | ||
| 86 | + <view class="loads fs28 flex-center"> | ||
| 87 | + <view class="line"></view> | ||
| 88 | + <view class="load" bindtap="">点击加载更多</view> | ||
| 89 | + <view class="line"></view> | ||
| 90 | + </view> | ||
| 91 | + </view> | ||
| 13 | 92 | ||
| 93 | + </view> | ||
| 14 | 94 | ||
| 95 | + </view> | ||
| 15 | 96 | ||
| 97 | + </view> | ||
| 16 | </view> | 98 | </view> |
| 99 | +<!-- 制作一个圆球导航 --> | ||
| 100 | +<nav_b id="nav_b"></nav_b> | ||
| 17 | \ No newline at end of file | 101 | \ No newline at end of file |
pages/user/assistance/assistance.wxss
| 1 | -/* pages/user/assistance/assistance.wxss */ | ||
| 2 | \ No newline at end of file | 1 | \ No newline at end of file |
| 2 | +page { | ||
| 3 | + background-color: rgb(208, 17, 25); | ||
| 4 | + width: 100%; | ||
| 5 | + height: 100%; | ||
| 6 | +} | ||
| 7 | + | ||
| 8 | +.lumi { | ||
| 9 | + position: absolute; | ||
| 10 | + z-index: 0; | ||
| 11 | + width: 100%; | ||
| 12 | + height: 1100rpx; | ||
| 13 | +} | ||
| 14 | + | ||
| 15 | +.zindex { | ||
| 16 | + position: absolute; | ||
| 17 | + z-index: 1; | ||
| 18 | + width: 100%; | ||
| 19 | +} | ||
| 20 | + | ||
| 21 | +.top { | ||
| 22 | + padding-bottom: 75rpx; | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +.getgift { | ||
| 26 | + width: 610rpx; | ||
| 27 | + height: 130rpx; | ||
| 28 | + padding-top: 70rpx; | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +.excitation { | ||
| 32 | + padding-top: 30rpx; | ||
| 33 | + color: rgb(255, 255, 255); | ||
| 34 | + padding-bottom: 50rpx; | ||
| 35 | +} | ||
| 36 | + | ||
| 37 | +.gift { | ||
| 38 | + width: 550rpx; | ||
| 39 | + height: 500rpx; | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +.time { | ||
| 43 | + color: rgb(255, 255, 255); | ||
| 44 | + margin-bottom: 55rpx; | ||
| 45 | + text-decoration: underline; | ||
| 46 | + margin-top: 10rpx; | ||
| 47 | +} | ||
| 48 | + | ||
| 49 | +.take { | ||
| 50 | + width: 440rpx; | ||
| 51 | + height: 77rpx; | ||
| 52 | + color: rgb(221, 45, 8); | ||
| 53 | + background-color: rgb(252, 210, 10); | ||
| 54 | + border-radius: 45rpx; | ||
| 55 | + font-weight: 900; | ||
| 56 | + line-height: 77rpx; | ||
| 57 | + box-shadow: 0rpx 7rpx 0rpx 0rpx rgb(245, 119, 6); | ||
| 58 | + font-size: 38rpx; | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +.head { | ||
| 62 | + border-bottom: 4rpx solid rgb(253, 193, 7); | ||
| 63 | + color: rgb(255, 255, 255); | ||
| 64 | + height: 50rpx; | ||
| 65 | + line-height: 50rpx; | ||
| 66 | +} | ||
| 67 | + | ||
| 68 | +.lhead { | ||
| 69 | + border-top: 4rpx solid rgb(253, 193, 7); | ||
| 70 | + border-left: 4rpx solid rgb(253, 193, 7); | ||
| 71 | + border-right: 4rpx solid rgb(253, 193, 7); | ||
| 72 | + width: 290rpx; | ||
| 73 | + height: 50rpx; | ||
| 74 | + line-height: 50rpx; | ||
| 75 | +} | ||
| 76 | + | ||
| 77 | +.rhead { | ||
| 78 | + background-color: rgb(253, 193, 7); | ||
| 79 | + border-bottom: 4rpx solid rgb(253, 193, 7); | ||
| 80 | +} | ||
| 81 | + | ||
| 82 | +.items { | ||
| 83 | + padding-top: 50rpx; | ||
| 84 | +} | ||
| 85 | + | ||
| 86 | +.explain { | ||
| 87 | + width: 22rpx; | ||
| 88 | + height: 22rpx; | ||
| 89 | + margin-right: 10rpx; | ||
| 90 | +} | ||
| 91 | + | ||
| 92 | +.padding { | ||
| 93 | + padding: 0rpx 50rpx; | ||
| 94 | +} | ||
| 95 | + | ||
| 96 | +.content { | ||
| 97 | + padding-bottom: 35rpx; | ||
| 98 | +} | ||
| 99 | + | ||
| 100 | +.width { | ||
| 101 | + width: 290rpx; | ||
| 102 | +} | ||
| 103 | + | ||
| 104 | +.line { | ||
| 105 | + width: 110rpx; | ||
| 106 | + border-top: 2rpx solid rgb(255, 255, 255); | ||
| 107 | +} | ||
| 108 | + | ||
| 109 | +.loads { | ||
| 110 | + margin-bottom: 35rpx; | ||
| 111 | +} | ||
| 112 | + | ||
| 113 | +.load { | ||
| 114 | + margin: 0rpx 26rpx; | ||
| 115 | +} | ||
| 116 | + | ||
| 117 | +.item { | ||
| 118 | + margin-bottom: 35rpx; | ||
| 119 | +} | ||
| 120 | + | ||
| 121 | +.state { | ||
| 122 | + text-decoration: underline; | ||
| 123 | +} | ||
| 124 | + | ||
| 125 | +.nothing { | ||
| 126 | + padding: 50rpx 0rpx; | ||
| 127 | +} | ||
| 128 | + | ||
| 129 | +.receive { | ||
| 130 | + padding-bottom: 50rpx; | ||
| 131 | +} |