Commit 3ea0ed01a8c255a509abc123d455ac4fa3700ddf
1 parent
577087f7
美图秀秀粉钻免费送
Showing
5 changed files
with
264 additions
and
1 deletions
app.json
packageF/pages/free_delivery/free_delivery.js
0 → 100644
| 1 | +// packageF/pages/free_delivery/free_delivery.js | |
| 2 | +var o = getApp().globalData.setting | |
| 3 | +const app = getApp(); | |
| 4 | +Page({ | |
| 5 | + | |
| 6 | + /** | |
| 7 | + * 页面的初始数据 | |
| 8 | + */ | |
| 9 | + data: { | |
| 10 | + url: o.imghost, | |
| 11 | + userInfo:null, | |
| 12 | + login_title:'暂未登录,请先登录', | |
| 13 | + login_name:'授权登录', | |
| 14 | + login_off:false, | |
| 15 | + hd_id:'', | |
| 16 | + delHeight:736, //默认窗口高度,用于对比,定位图片用 | |
| 17 | + delOff:false, //窗口高度对比,false 用默认定位,ture 定位调整 | |
| 18 | + | |
| 19 | + }, | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * 生命周期函数--监听页面加载 | |
| 23 | + */ | |
| 24 | + onLoad(options) { | |
| 25 | + let window_info = wx.getWindowInfo() | |
| 26 | + if (window_info.screenHeight > this.data.delHeight) { | |
| 27 | + this.setData({ | |
| 28 | + delOff:true | |
| 29 | + }) | |
| 30 | + } | |
| 31 | + | |
| 32 | + if (options && options.id) { | |
| 33 | + this.setData({ | |
| 34 | + hd_id:options.id | |
| 35 | + }) | |
| 36 | + }else{ | |
| 37 | + wx.showToast({ | |
| 38 | + title: '获取活动失败', | |
| 39 | + icon: 'none', | |
| 40 | + duration: 2000, | |
| 41 | + mask:true | |
| 42 | + }) | |
| 43 | + setTimeout(()=>{ | |
| 44 | + wx.reLaunch({ | |
| 45 | + url: '/pages/index/index/index' | |
| 46 | + }) | |
| 47 | + },2000) | |
| 48 | + } | |
| 49 | + | |
| 50 | + }, | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * 生命周期函数--监听页面初次渲染完成 | |
| 54 | + */ | |
| 55 | + onReady() { | |
| 56 | + | |
| 57 | + }, | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 生命周期函数--监听页面显示 | |
| 61 | + */ | |
| 62 | + onShow() { | |
| 63 | + let userInfo = getApp().globalData.userInfo; | |
| 64 | + this.setData({ | |
| 65 | + userInfo | |
| 66 | + }) | |
| 67 | + if (userInfo) { | |
| 68 | + this.setData({ | |
| 69 | + login_title:userInfo.mobile, | |
| 70 | + login_name:'领取会员' | |
| 71 | + }) | |
| 72 | + } | |
| 73 | + wx.setNavigationBarTitle({ | |
| 74 | + title: '免费送' | |
| 75 | + }) | |
| 76 | + }, | |
| 77 | + //--跳到绑定页面-- | |
| 78 | + gobindtel: function () { | |
| 79 | + let userInfo = this.data.userInfo | |
| 80 | + let login_off = this.data.login_off | |
| 81 | + if (userInfo) { | |
| 82 | + if (!login_off) { | |
| 83 | + this.setData({ | |
| 84 | + login_off:true | |
| 85 | + }) | |
| 86 | + wx.showLoading({ | |
| 87 | + title: '领取中', | |
| 88 | + mask: true, | |
| 89 | + }); | |
| 90 | + app.request.promisePost('/api/weshop/meitu/storeMeituUserlist/save', { | |
| 91 | + is_json: true, | |
| 92 | + data: { | |
| 93 | + store_id: app.globalData.setting.stoid, | |
| 94 | + user_id: app.globalData.user_id, | |
| 95 | + hd_id: this.data.hd_id, | |
| 96 | + }, | |
| 97 | + }).then((res)=>{ | |
| 98 | + if(res.data.code == 0) { | |
| 99 | + wx.showToast({ | |
| 100 | + title: '领取成功', | |
| 101 | + icon: 'success', | |
| 102 | + duration: 2000, | |
| 103 | + mask:true, | |
| 104 | + }); | |
| 105 | + setTimeout(()=>{ | |
| 106 | + wx.reLaunch({ | |
| 107 | + url: '/pages/index/index/index' | |
| 108 | + }) | |
| 109 | + },2000) | |
| 110 | + // self.getData(true, '/api/weshop/goods/page?isnewwhere=1&is_mainshow=1&isonsale=1&dis_type=1', self.data.currentQuery, false); | |
| 111 | + } else { | |
| 112 | + this.setData({ | |
| 113 | + login_off:false | |
| 114 | + }) | |
| 115 | + wx.showToast({ | |
| 116 | + title: '领取失败', | |
| 117 | + icon: 'success', | |
| 118 | + duration: 1000, | |
| 119 | + mask:true, | |
| 120 | + }); | |
| 121 | + } | |
| 122 | + | |
| 123 | + }); | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + } | |
| 129 | + }else{ | |
| 130 | + wx.navigateTo({ | |
| 131 | + url: '/packageE/pages/togoin/togoin', | |
| 132 | + }) | |
| 133 | + } | |
| 134 | + }, | |
| 135 | + /** | |
| 136 | + * 生命周期函数--监听页面隐藏 | |
| 137 | + */ | |
| 138 | + onHide() { | |
| 139 | + | |
| 140 | + }, | |
| 141 | + | |
| 142 | + /** | |
| 143 | + * 生命周期函数--监听页面卸载 | |
| 144 | + */ | |
| 145 | + onUnload() { | |
| 146 | + | |
| 147 | + }, | |
| 148 | + | |
| 149 | + /** | |
| 150 | + * 页面相关事件处理函数--监听用户下拉动作 | |
| 151 | + */ | |
| 152 | + onPullDownRefresh() { | |
| 153 | + | |
| 154 | + }, | |
| 155 | + | |
| 156 | + /** | |
| 157 | + * 页面上拉触底事件的处理函数 | |
| 158 | + */ | |
| 159 | + onReachBottom() { | |
| 160 | + | |
| 161 | + }, | |
| 162 | + | |
| 163 | + /** | |
| 164 | + * 用户点击右上角分享 | |
| 165 | + */ | |
| 166 | + onShareAppMessage() { | |
| 167 | + | |
| 168 | + } | |
| 169 | +}) | |
| 0 | 170 | \ No newline at end of file | ... | ... |
packageF/pages/free_delivery/free_delivery.json
0 → 100644
packageF/pages/free_delivery/free_delivery.wxml
0 → 100644
| 1 | +<!--packageF/pages/free_delivery/free_delivery.wxml--> | |
| 2 | +<view class="free_delivery" style="background-image: url({{url}}miniapp/images/pink_diamond/bj.png);"> | |
| 3 | + <view class="top" > | |
| 4 | + <image src="{{url}}miniapp/images/pink_diamond/logo.png" style="width: 345.6rpx;height: 88rpx;"></image> | |
| 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> | |
| 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> | |
| 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> | |
| 10 | + <!-- <view wx:if="{{userInfo}}">领取会员</view> | |
| 11 | + <view wx:else catchtap="gobindtel">点击注册</view> --> | |
| 12 | + </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> | |
| 16 | +</view> | ... | ... |
packageF/pages/free_delivery/free_delivery.wxss
0 → 100644
| 1 | +/* packageF/pages/free_delivery/free_delivery.wxss */ | |
| 2 | + | |
| 3 | +.free_delivery{ | |
| 4 | + width: 100%; | |
| 5 | + height: 100vh; | |
| 6 | + /* display: flex; | |
| 7 | + flex-direction: column; | |
| 8 | + justify-content: space-between; */ | |
| 9 | + background-position: 50%; | |
| 10 | + background-repeat: no-repeat; | |
| 11 | + background-attachment: fixed; | |
| 12 | + background-size: 100% 100%; | |
| 13 | + position: relative; | |
| 14 | +} | |
| 15 | +.top{ | |
| 16 | + padding: 50rpx 0 0 40rpx; | |
| 17 | + | |
| 18 | + /* width: 100%; | |
| 19 | + height: 483rpx; | |
| 20 | + display: flex; | |
| 21 | + align-items: center; | |
| 22 | + justify-content: center; */ | |
| 23 | +} | |
| 24 | +.main{ | |
| 25 | + position: absolute; | |
| 26 | + left: 0; | |
| 27 | + top: 24.5%; | |
| 28 | + width: 100%; | |
| 29 | + /* height: 200rpx; | |
| 30 | + background-color: red; */ | |
| 31 | + /* opacity: .5; */ | |
| 32 | + display: flex; | |
| 33 | + flex-direction: column; | |
| 34 | + align-items: center; | |
| 35 | + justify-content: center; | |
| 36 | + /* width: 100%; | |
| 37 | + flex: 1; | |
| 38 | + display: flex; | |
| 39 | + align-items: center; | |
| 40 | + justify-content: center; | |
| 41 | + | |
| 42 | + background-color: darkmagenta; */ | |
| 43 | +} | |
| 44 | +.main_title{ | |
| 45 | + margin: 25rpx 0; | |
| 46 | + | |
| 47 | +} | |
| 48 | +.main view{ | |
| 49 | + background-position: 50%; | |
| 50 | + background-repeat: no-repeat; | |
| 51 | + background-attachment: fixed; | |
| 52 | + background-size: 100% 100%; | |
| 53 | + position: relative; | |
| 54 | + border: 1rpx solid rgb(194, 194, 194); | |
| 55 | + border-radius: 5rpx; | |
| 56 | + overflow: hidden; | |
| 57 | + text-align: center; | |
| 58 | + line-height: 80rpx; | |
| 59 | +} | |
| 60 | +.but{ | |
| 61 | + font-weight: bold; | |
| 62 | +} | |
| 63 | +.bottom{ | |
| 64 | + width: 100%; | |
| 65 | + position: absolute; | |
| 66 | + left: 0; | |
| 67 | + bottom: 5%; | |
| 68 | + display: flex; | |
| 69 | + align-items: center; | |
| 70 | + justify-content: center; | |
| 71 | +} | |
| 72 | + | ... | ... |