Commit 2c9efa276c6d0209b5f0158bdc2749d4cdbf3728

Authored by 陈晓峰
1 parent 47c77a5f

update

1 1
2 2 App({
3   - url: 'https://nature.docroot.drupalagile.com',
  3 + url: 'https://stg.natureresearch.cn',
4 4 onLaunch: function () {
5 5
6 6 this.getUserInfo()
... ... @@ -25,7 +25,7 @@ App({
25 25 typeof cb == "function" && cb(that.globalData.userInfo);
26 26 //插入修改会员表返回openid
27 27 wx.request({
28   - url: 'https://nature.docroot.drupalagile.com/mpapi/1.0.0/user/login',
  28 + url: 'https://stg.natureresearch.cn/mpapi/1.0.0/user/login',
29 29 method: 'POST',
30 30 header: {
31 31 'content-type': 'application/json',
... ...
... ... @@ -44,7 +44,7 @@ page {
44 44
45 45 .content2 .li {
46 46 position: relative;
47   - margin-bottom: 6rpx;
  47 + /* margin-top: 6rpx; */
48 48 }
49 49
50 50 .content2 .li image {
... ...
... ... @@ -10,7 +10,7 @@
10 10 </view> -->
11 11 </view>
12 12 <view class="video">
13   - <video src="https://www.natureresearch.cn/sites/default/files/videos/NatureResearch.mp4"
  13 + <video src="https://stg.natureresearch.cn/sites/default/files/videos/NatureResearch.mp4"
14 14 binderror="videoErrorCallback" poster="http://xcx.yiscio.com/app/shipin.png" controls></video>
15 15 </view>
16 16 <view class="content1">
... ...
... ... @@ -12,7 +12,7 @@ Page({
12 12 imgheight: 0,
13 13 num: 0,
14 14 gun: true,
15   - scrollTop1: '60',
  15 + scrollTop1: '',
16 16 countTotal: '',
17 17 right: true,
18 18 xiala: true,
... ... @@ -84,6 +84,18 @@ Page({
84 84 ]
85 85
86 86 },
  87 + queryMultipleNodes: function () {
  88 + var query = wx.createSelectorQuery()
  89 + query.select('#the-id').boundingClientRect()
  90 + query.selectViewport().scrollOffset()
  91 + query.exec(function (res) {
  92 + console.log('qwe', res)
  93 + console.log('fgf', res[0].top)
  94 + res[0].top // #the-id节点的上边界坐标
  95 + res[1].scrollTop // 显示区域的竖直滚动位置
  96 + })
  97 +
  98 + },
87 99 onLoad: function (options) {
88 100 var that = this
89 101 var con = that.data.con
... ... @@ -197,7 +209,7 @@ Page({
197 209 }, 2000)
198 210
199 211
200   -
  212 + this.queryMultipleNodes()
201 213 },
202 214 // imageLoad: function (e) {
203 215 // console.log('asdasfsdfg',e)
... ... @@ -213,7 +225,7 @@ Page({
213 225 // })
214 226 // },
215 227 scroll: function (e) {
216   - // console.log('aa', e)
  228 + console.log('aa', e)
217 229 // console.log(e.detail.scrollTop);
218 230 var that = this
219 231 var num = that.data.num
... ... @@ -226,6 +238,11 @@ Page({
226 238 that.setData({
227 239 scrollTop: scrollTop
228 240 })
  241 +
  242 +
  243 +
  244 +
  245 +
229 246 if (scrollTop == 0) {
230 247 // var that = this
231 248 // var skey = that.data.skey
... ... @@ -503,6 +520,60 @@ Page({
503 520 console.log('下拉', e)
504 521 },
505 522 lower: function (e) {
  523 +
  524 +
  525 + },
  526 + /**
  527 + * 生命周期函数--监听页面隐藏
  528 + */
  529 + onHide: function () {
  530 +
  531 + },
  532 +
  533 + /**
  534 + * 生命周期函数--监听页面卸载
  535 + */
  536 + onUnload: function () {
  537 +
  538 + },
  539 +
  540 + /**
  541 + * 页面相关事件处理函数--监听用户下拉动作
  542 + */
  543 + onPullDownRefresh: function () {
  544 + var that = this
  545 + // wx.showToast({
  546 + // title: 'loading...',
  547 + // icon: 'loading'
  548 + // })
  549 + setTimeout(function () {
  550 + wx.stopPullDownRefresh()
  551 + }, 1500)
  552 + that.setData({
  553 + currentTab: 10
  554 + // con: res.data.data
  555 + })
  556 + that.onLoad()
  557 + },
  558 + /**
  559 + * 监听页面滚动事件
  560 + */
  561 + onPageScroll:function(e){
  562 + // console.log('eeeee',e)
  563 + var that = this
  564 + var scrollTop =e.scrollTop
  565 + that.setData({
  566 + scrollTop: scrollTop
  567 + })
  568 + // console.log('scrol2',scrollTop)
  569 + },
  570 +
  571 +
  572 + /**
  573 + * 页面上拉触底事件的处理函数
  574 + */
  575 + onReachBottom: function (e) {
  576 + var that = this
506 577 console.log('上啦', e)
507 578 var that = this
508 579 var skey = that.data.skey
... ... @@ -684,38 +755,6 @@ Page({
684 755
685 756
686 757 },
687   - /**
688   - * 生命周期函数--监听页面隐藏
689   - */
690   - onHide: function () {
691   -
692   - },
693   -
694   - /**
695   - * 生命周期函数--监听页面卸载
696   - */
697   - onUnload: function () {
698   -
699   - },
700   -
701   - /**
702   - * 页面相关事件处理函数--监听用户下拉动作
703   - */
704   - onPullDownRefresh: function () {
705   - console.log('下拉')
706   - setTimeout(function () {
707   - wx.stopPullDownRefresh()
708   - }, 1500)
709   - },
710   -
711   - /**
712   - * 页面上拉触底事件的处理函数
713   - */
714   - // onReachBottom: function () {
715   - // var that = this
716   - // console.log('上拉')
717   -
718   - // },
719 758
720 759 /**
721 760 * 用户点击右上角分享
... ...
1 1 {
2 2 "navigationBarTitleText": "Nature",
  3 + "backgroundTextStyle": "dark",
3 4 "enablePullDownRefresh": true
4   -}
\ No newline at end of file
  5 +}
... ...
1   -<scroll-view scroll-y="true" scroll-top="{{scrollTop1}}" style="height:{{windowHeight}}px;" upper-threshold="20px" lower-threshold="20px" bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" bindtouchend='touchend'>
2   -
3   - <view style="height:60px;line-height:60px;text-align: center; font-size:26rpx;">
4   - <image src="{{gun?'/static/images/gungun.gif':'/static/images/jiantou.png'}}" class="jiantou"></image>
5   - <text class="{{gun?'hide':''}}">下拉刷新</text>
6   - </view>
7   - <view style="font-size:28rpx; height:{{windowHeight}}px;">
  1 + <view style="font-size:28rpx; height:{{windowHeight}}px;" id="the-id">
8 2 <view class="index-advs">
9 3 <swiper autoplay="{{autoplay}}" circular="{{circular}}" class="index-adcs-sqiper" duration="{{duration}}" indicator-dots="{{indicatorDots}}" indicator-color="{{indicatorColor}}" indicator-active-color="{{indicatoractive}}" interval="{{interval}}" style="height:612rpx">
10 4 <block wx:for="{{adv}}" wx:for-index="idx">
... ... @@ -12,7 +6,6 @@
12 6 <navigator class="index-advs-navigator" url="/{{item.linkTo.pageUri}}">
13 7 <image src="{{item.image.url}}" bindload="imagesHeight" style='width:100%; height:612rpx' data-type="advsheight">
14 8 </image>
15   -
16 9 <!-- <view class="wenzi"> pssb{{idx}}</view> -->
17 10 </navigator>
18 11 </swiper-item>
... ... @@ -155,4 +148,3 @@
155 148 </view>
156 149 </view>
157 150 <view class="{{meng ? 'hide' : 'block'}} meng" bindtap='meng'></view>
158   -</scroll-view>
\ No newline at end of file
... ...
... ... @@ -212,6 +212,7 @@ Page({
212 212 var skey = that.data.skey
213 213 var tanchuang = that.data.tanchuang
214 214 var id = that.data.id
  215 + console.log('id',id)
215 216 var disabled = that.data.disabled
216 217 var information = that.data.information
217 218 console.log('information1', information)
... ...
... ... @@ -6,6 +6,7 @@ Page({
6 6 * 页面的初始数据
7 7 */
8 8 data: {
  9 + hdid: '',
9 10 meng: true,
10 11 skey: '',
11 12 user: '',
... ... @@ -24,7 +25,7 @@ Page({
24 25 bgbgbgbgbbg: false,
25 26 tanchuang3: false,
26 27 tanchuang4: false,
27   - tanchuang5: false
  28 + tanchuang5: false,
28 29 },
29 30 getmenu: function () {
30 31 var that = this
... ... @@ -86,11 +87,8 @@ Page({
86 87 onLoad: function (options) {
87 88 var that = this
88 89 // var id = options.id
89   - // console.log('id1111', id)
90   - // that.setData({
91   - // id: id
92   - // })
93   -
  90 + console.log('thatttttt', that)
  91 +
94 92 var skey = wx.getStorageSync('key')
95 93 var user = wx.getStorageSync('user')
96 94 var information = that.data.information
... ... @@ -98,7 +96,6 @@ Page({
98 96 var total1 = that.data.total1
99 97 var total2 = that.data.total2
100 98 var total3 = that.data.total3
101   -
102 99 wx.request({
103 100 url: app.url + '/mpapi/1.0.0/user/profile',
104 101 method: 'GET',
... ... @@ -113,7 +110,7 @@ Page({
113 110 // id:'1'
114 111 },
115 112 success: function (res) {
116   - console.log('xinxi', res.data)
  113 + console.log('xinxi', res)
117 114 that.setData({
118 115 information: res.data
119 116 })
... ... @@ -123,7 +120,7 @@ Page({
123 120 console.log('user', user)
124 121 that.setData({
125 122 skey: skey,
126   - user: user
  123 + user: user,
127 124 })
128 125 wx.request({
129 126 url: app.url + '//mpapi/1.0.0/user/favorite?type=&offset=&limit=',
... ... @@ -193,11 +190,6 @@ Page({
193 190 limit: 9999
194 191 },
195 192 success: function (res) {
196   - console.log('res', res.data)
197   - console.log(that.data.total2)
198   - console.log(that.data.total3)
199   -
200   -
201 193 that.setData({
202 194 total3: res.data.countTotal,
203 195 total1: Number(res.data.countTotal) + Number(that.data.total2)
... ... @@ -255,14 +247,11 @@ Page({
255 247 console.log('coupon', res.data)
256 248 }
257 249 })
258   -
259   -
260   -
261 250 },
262 251 formSubmit: function (e) {
263 252 var that = this
264   - var id = that.data.id
265   - console.log('id2222', id)
  253 + console.log('2222', that)
  254 + console.log('eeeee1111', e)
266 255 var mobile = e.detail.value.mobile
267 256 var email = e.detail.value.email
268 257 var major = e.detail.value.major
... ... @@ -275,12 +264,6 @@ Page({
275 264 that.setData({
276 265 skey: skey
277 266 })
278   - // wx.showLoading({
279   - // title: '提交中',
280   - // })
281   - // setTimeout(function () {
282   - // wx.hideLoading()
283   - // }, 2000)
284 267 wx.request({
285 268 url: app.url + '/mpapi/1.0.0/user/profile',
286 269 method: 'POST',
... ... @@ -298,8 +281,7 @@ Page({
298 281 // id:'1'
299 282 },
300 283 success: function (res) {
301   - console.log('con', res.data)
302   -
  284 + console.log('con', res)
303 285 wx.showToast({
304 286 title: '提交成功',
305 287 icon: 'success',
... ... @@ -309,21 +291,14 @@ Page({
309 291 disabled: true
310 292 })
311 293 that.onLoad()
312   - // if (id) {
313   - // console.log('id333333', id)
314   - wx.navigateBack();
315   - // wx.setStorage({
316   - // key: "id",
317   - // data: that.data.id,
318   - // success: function () {
319   - //返回上一个页面
320   - // }
321   - // })
322   -
323   -
324   - // } else {
325   - // that.onLoad()
326   - // }
  294 + console.log('that.options.id', that.options.id)
  295 + if (that.options.id != '' && that.options.id != undefined) {
  296 + console.log(123456)
  297 + console.log('that.options.id', that.options.id)
  298 + setTimeout(function(){
  299 + wx.navigateBack()
  300 + },1500)
  301 + }
327 302 }
328 303 })
329 304 },
... ... @@ -380,7 +355,7 @@ Page({
380 355 var that = this
381 356 var tanchuang4 = that.data.tanchuang4
382 357 var bgbgbgbgbbg = that.data.bgbgbgbgbbg
383   -
  358 +
384 359 that.setData({
385 360 tanchuang4: false,
386 361 bgbgbgbgbbg: false
... ... @@ -490,7 +465,7 @@ Page({
490 465 }
491 466 }
492 467 })
493   -
  468 +
494 469 },
495 470 a2: function () {
496 471 var that = this
... ...
Please register or login to post a comment