Commit 1c79e772c069b2a32c05f9495a2786e4c6f7f600
1 parent
61793b4a
美图秀秀页面优化
Showing
3 changed files
with
64 additions
and
28 deletions
packageF/pages/free_delivery/free_delivery.js
| @@ -33,6 +33,7 @@ Page({ | @@ -33,6 +33,7 @@ Page({ | ||
| 33 | this.setData({ | 33 | this.setData({ |
| 34 | hd_id:options.id | 34 | hd_id:options.id |
| 35 | }) | 35 | }) |
| 36 | + this.getInfo() | ||
| 36 | }else{ | 37 | }else{ |
| 37 | wx.showToast({ | 38 | wx.showToast({ |
| 38 | title: '获取活动失败', | 39 | title: '获取活动失败', |
| @@ -48,7 +49,15 @@ Page({ | @@ -48,7 +49,15 @@ Page({ | ||
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | }, | 51 | }, |
| 51 | - | 52 | + getInfo(){ |
| 53 | + app.promiseGet(`/api/weshop/meitu/storeMeituHdlist/get/${app.globalData.setting.stoid}/${this.data.hd_id}`, {}).then(res => { | ||
| 54 | + if (res.data.code == 0 && res.data.data && res.data.data.hd_name) { | ||
| 55 | + wx.setNavigationBarTitle({ | ||
| 56 | + title: res.data.data.hd_name | ||
| 57 | + }) | ||
| 58 | + } | ||
| 59 | + }) | ||
| 60 | + }, | ||
| 52 | /** | 61 | /** |
| 53 | * 生命周期函数--监听页面初次渲染完成 | 62 | * 生命周期函数--监听页面初次渲染完成 |
| 54 | */ | 63 | */ |
| @@ -70,9 +79,7 @@ Page({ | @@ -70,9 +79,7 @@ Page({ | ||
| 70 | login_name:'领取会员' | 79 | login_name:'领取会员' |
| 71 | }) | 80 | }) |
| 72 | } | 81 | } |
| 73 | - wx.setNavigationBarTitle({ | ||
| 74 | - title: '免费送' | ||
| 75 | - }) | 82 | + |
| 76 | }, | 83 | }, |
| 77 | //--跳到绑定页面-- | 84 | //--跳到绑定页面-- |
| 78 | gobindtel: function () { | 85 | gobindtel: function () { |
| @@ -97,25 +104,28 @@ Page({ | @@ -97,25 +104,28 @@ Page({ | ||
| 97 | }).then((res)=>{ | 104 | }).then((res)=>{ |
| 98 | if(res.data.code == 0) { | 105 | if(res.data.code == 0) { |
| 99 | wx.showToast({ | 106 | wx.showToast({ |
| 100 | - title: '领取成功', | ||
| 101 | - icon: 'success', | 107 | + title: res.data.msg, |
| 108 | + icon: 'none', | ||
| 102 | duration: 2000, | 109 | duration: 2000, |
| 103 | mask:true, | 110 | mask:true, |
| 104 | }); | 111 | }); |
| 105 | - setTimeout(()=>{ | ||
| 106 | - wx.reLaunch({ | ||
| 107 | - url: '/pages/index/index/index' | ||
| 108 | - }) | ||
| 109 | - },2000) | 112 | + this.setData({ |
| 113 | + login_name:'已领取' | ||
| 114 | + }) | ||
| 115 | + // setTimeout(()=>{ | ||
| 116 | + // wx.reLaunch({ | ||
| 117 | + // url: '/pages/index/index/index' | ||
| 118 | + // }) | ||
| 119 | + // },2000) | ||
| 110 | // self.getData(true, '/api/weshop/goods/page?isnewwhere=1&is_mainshow=1&isonsale=1&dis_type=1', self.data.currentQuery, false); | 120 | // self.getData(true, '/api/weshop/goods/page?isnewwhere=1&is_mainshow=1&isonsale=1&dis_type=1', self.data.currentQuery, false); |
| 111 | } else { | 121 | } else { |
| 112 | this.setData({ | 122 | this.setData({ |
| 113 | login_off:false | 123 | login_off:false |
| 114 | }) | 124 | }) |
| 115 | wx.showToast({ | 125 | wx.showToast({ |
| 116 | - title: '领取失败', | ||
| 117 | - icon: 'success', | ||
| 118 | - duration: 1000, | 126 | + title: res.data.msg, |
| 127 | + icon: 'none', | ||
| 128 | + duration: 2000, | ||
| 119 | mask:true, | 129 | mask:true, |
| 120 | }); | 130 | }); |
| 121 | } | 131 | } |
| @@ -150,7 +160,7 @@ Page({ | @@ -150,7 +160,7 @@ Page({ | ||
| 150 | * 页面相关事件处理函数--监听用户下拉动作 | 160 | * 页面相关事件处理函数--监听用户下拉动作 |
| 151 | */ | 161 | */ |
| 152 | onPullDownRefresh() { | 162 | onPullDownRefresh() { |
| 153 | - | 163 | + wx.stopPullDownRefresh() |
| 154 | }, | 164 | }, |
| 155 | 165 | ||
| 156 | /** | 166 | /** |
packageF/pages/free_delivery/free_delivery.wxml
| 1 | <!--packageF/pages/free_delivery/free_delivery.wxml--> | 1 | <!--packageF/pages/free_delivery/free_delivery.wxml--> |
| 2 | -<view class="free_delivery" style="background-image: url({{url}}miniapp/images/pink_diamond/bj.png);"> | 2 | +<view class="free_delivery" style="background-image: url({{url}}miniapp/images/pink_diamond/bg.jpg);"> |
| 3 | <view class="top" > | 3 | <view class="top" > |
| 4 | <image src="{{url}}miniapp/images/pink_diamond/logo.png" style="width: 345.6rpx;height: 88rpx;"></image> | 4 | <image src="{{url}}miniapp/images/pink_diamond/logo.png" style="width: 345.6rpx;height: 88rpx;"></image> |
| 5 | </view> | 5 | </view> |
| 6 | - <view class="main" style="top: {{delOff ? '26.5':'24.5'}}%;"> | ||
| 7 | - <image src="{{url}}miniapp/images/pink_diamond/top.png" style="width: 618.8rpx;height: 235.9rpx;"></image> | 6 | + <view class="main"> |
| 7 | + <view class="imageBox" > | ||
| 8 | + <image src="{{url}}miniapp/images/pink_diamond/top1.png" style="width: 618.8rpx;height: 484.4rpx;"></image> | ||
| 9 | + </view> | ||
| 8 | <view class="main_title" style="background-image: url({{url}}miniapp/images/pink_diamond/login.png);width: 618.8rpx;height: 80rpx;color: {{userInfo ? '#333' :'rgb(194, 194, 194)'}};font-weight: {{userInfo ? 'bold' :'400'}};" >{{login_title}}</view> | 10 | <view class="main_title" style="background-image: url({{url}}miniapp/images/pink_diamond/login.png);width: 618.8rpx;height: 80rpx;color: {{userInfo ? '#333' :'rgb(194, 194, 194)'}};font-weight: {{userInfo ? 'bold' :'400'}};" >{{login_title}}</view> |
| 9 | <view class="but" catchtap="gobindtel" style="background-image: url({{url}}miniapp/images/pink_diamond/login1.png);width: 618.8rpx;height: 80rpx;" >{{login_name}}</view> | 11 | <view class="but" catchtap="gobindtel" style="background-image: url({{url}}miniapp/images/pink_diamond/login1.png);width: 618.8rpx;height: 80rpx;" >{{login_name}}</view> |
| 10 | <!-- <view wx:if="{{userInfo}}">领取会员</view> | 12 | <!-- <view wx:if="{{userInfo}}">领取会员</view> |
| 11 | <view wx:else catchtap="gobindtel">点击注册</view> --> | 13 | <view wx:else catchtap="gobindtel">点击注册</view> --> |
| 12 | </view> | 14 | </view> |
| 13 | - <view class="bottom" style="bottom: {{delOff ? '7':'3.5'}}%;" > | ||
| 14 | - <image src="{{url}}miniapp/images/pink_diamond/bottom.png?v=5" style="width: 646.8rpx;height: 388.5rpx;"></image> | 15 | + <view class="bottom" > |
| 16 | + <image src="{{url}}miniapp/images/pink_diamond/bottom.png?v=5" style="width: 618.8rpx;height: 388.5rpx;"></image> | ||
| 15 | </view> | 17 | </view> |
| 16 | </view> | 18 | </view> |
packageF/pages/free_delivery/free_delivery.wxss
| @@ -2,7 +2,9 @@ | @@ -2,7 +2,9 @@ | ||
| 2 | 2 | ||
| 3 | .free_delivery{ | 3 | .free_delivery{ |
| 4 | width: 100%; | 4 | width: 100%; |
| 5 | - height: 100vh; | 5 | + min-height: 100vh; |
| 6 | + padding-bottom:25.6rpx; | ||
| 7 | + box-sizing: border-box; | ||
| 6 | /* display: flex; | 8 | /* display: flex; |
| 7 | flex-direction: column; | 9 | flex-direction: column; |
| 8 | justify-content: space-between; */ | 10 | justify-content: space-between; */ |
| @@ -22,10 +24,11 @@ | @@ -22,10 +24,11 @@ | ||
| 22 | justify-content: center; */ | 24 | justify-content: center; */ |
| 23 | } | 25 | } |
| 24 | .main{ | 26 | .main{ |
| 25 | - position: absolute; | 27 | + /* position: absolute; |
| 26 | left: 0; | 28 | left: 0; |
| 27 | - top: 24.5%; | ||
| 28 | - width: 100%; | 29 | + top: 24.5%; */ |
| 30 | + width: 670rpx; | ||
| 31 | + margin: 100rpx auto 20rpx; | ||
| 29 | /* height: 200rpx; | 32 | /* height: 200rpx; |
| 30 | background-color: red; */ | 33 | background-color: red; */ |
| 31 | /* opacity: .5; */ | 34 | /* opacity: .5; */ |
| @@ -33,6 +36,10 @@ | @@ -33,6 +36,10 @@ | ||
| 33 | flex-direction: column; | 36 | flex-direction: column; |
| 34 | align-items: center; | 37 | align-items: center; |
| 35 | justify-content: center; | 38 | justify-content: center; |
| 39 | + background-color: rgba(255, 255, 255, .5); | ||
| 40 | + padding-bottom: 25.6rpx; | ||
| 41 | + border-radius: 30rpx; | ||
| 42 | + /* opacity: .5; */ | ||
| 36 | /* width: 100%; | 43 | /* width: 100%; |
| 37 | flex: 1; | 44 | flex: 1; |
| 38 | display: flex; | 45 | display: flex; |
| @@ -41,11 +48,24 @@ | @@ -41,11 +48,24 @@ | ||
| 41 | 48 | ||
| 42 | background-color: darkmagenta; */ | 49 | background-color: darkmagenta; */ |
| 43 | } | 50 | } |
| 51 | +.main .imageBox{ | ||
| 52 | + width: 100%; | ||
| 53 | + height: 344.4rpx; | ||
| 54 | + position: relative; | ||
| 55 | + /* background-color: royalblue; */ | ||
| 56 | +} | ||
| 57 | +.main .imageBox image{ | ||
| 58 | + position: absolute; | ||
| 59 | + top: -140rpx; | ||
| 60 | + left: 0; | ||
| 61 | + right: 0; | ||
| 62 | + margin: auto; | ||
| 63 | +} | ||
| 44 | .main_title{ | 64 | .main_title{ |
| 45 | margin: 25rpx 0; | 65 | margin: 25rpx 0; |
| 46 | 66 | ||
| 47 | } | 67 | } |
| 48 | -.main view{ | 68 | +.main .main_title , .main .but{ |
| 49 | background-position: 50%; | 69 | background-position: 50%; |
| 50 | background-repeat: no-repeat; | 70 | background-repeat: no-repeat; |
| 51 | background-attachment: fixed; | 71 | background-attachment: fixed; |
| @@ -61,10 +81,14 @@ | @@ -61,10 +81,14 @@ | ||
| 61 | font-weight: bold; | 81 | font-weight: bold; |
| 62 | } | 82 | } |
| 63 | .bottom{ | 83 | .bottom{ |
| 64 | - width: 100%; | ||
| 65 | - position: absolute; | 84 | + width: 670rpx; |
| 85 | + margin: 0 auto; | ||
| 86 | + /* position: absolute; | ||
| 66 | left: 0; | 87 | left: 0; |
| 67 | - bottom: 5%; | 88 | + bottom: 5%; */ |
| 89 | + background-color: rgba(255, 255, 255, .5); | ||
| 90 | + padding: 50rpx 0; | ||
| 91 | + border-radius: 30rpx; | ||
| 68 | display: flex; | 92 | display: flex; |
| 69 | align-items: center; | 93 | align-items: center; |
| 70 | justify-content: center; | 94 | justify-content: center; |