Showing
8 changed files
with
101 additions
and
93 deletions
| 1 | 1 | ||
| 2 | App({ | 2 | App({ |
| 3 | - url: 'https://nature.docroot.drupalagile.com', | 3 | + url: 'https://stg.natureresearch.cn', |
| 4 | onLaunch: function () { | 4 | onLaunch: function () { |
| 5 | 5 | ||
| 6 | this.getUserInfo() | 6 | this.getUserInfo() |
| @@ -25,7 +25,7 @@ App({ | @@ -25,7 +25,7 @@ App({ | ||
| 25 | typeof cb == "function" && cb(that.globalData.userInfo); | 25 | typeof cb == "function" && cb(that.globalData.userInfo); |
| 26 | //插入修改会员表返回openid | 26 | //插入修改会员表返回openid |
| 27 | wx.request({ | 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 | method: 'POST', | 29 | method: 'POST', |
| 30 | header: { | 30 | header: { |
| 31 | 'content-type': 'application/json', | 31 | 'content-type': 'application/json', |
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | </view> --> | 10 | </view> --> |
| 11 | </view> | 11 | </view> |
| 12 | <view class="video"> | 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 | binderror="videoErrorCallback" poster="http://xcx.yiscio.com/app/shipin.png" controls></video> | 14 | binderror="videoErrorCallback" poster="http://xcx.yiscio.com/app/shipin.png" controls></video> |
| 15 | </view> | 15 | </view> |
| 16 | <view class="content1"> | 16 | <view class="content1"> |
| @@ -12,7 +12,7 @@ Page({ | @@ -12,7 +12,7 @@ Page({ | ||
| 12 | imgheight: 0, | 12 | imgheight: 0, |
| 13 | num: 0, | 13 | num: 0, |
| 14 | gun: true, | 14 | gun: true, |
| 15 | - scrollTop1: '60', | 15 | + scrollTop1: '', |
| 16 | countTotal: '', | 16 | countTotal: '', |
| 17 | right: true, | 17 | right: true, |
| 18 | xiala: true, | 18 | xiala: true, |
| @@ -84,6 +84,18 @@ Page({ | @@ -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 | onLoad: function (options) { | 99 | onLoad: function (options) { |
| 88 | var that = this | 100 | var that = this |
| 89 | var con = that.data.con | 101 | var con = that.data.con |
| @@ -197,7 +209,7 @@ Page({ | @@ -197,7 +209,7 @@ Page({ | ||
| 197 | }, 2000) | 209 | }, 2000) |
| 198 | 210 | ||
| 199 | 211 | ||
| 200 | - | 212 | + this.queryMultipleNodes() |
| 201 | }, | 213 | }, |
| 202 | // imageLoad: function (e) { | 214 | // imageLoad: function (e) { |
| 203 | // console.log('asdasfsdfg',e) | 215 | // console.log('asdasfsdfg',e) |
| @@ -213,7 +225,7 @@ Page({ | @@ -213,7 +225,7 @@ Page({ | ||
| 213 | // }) | 225 | // }) |
| 214 | // }, | 226 | // }, |
| 215 | scroll: function (e) { | 227 | scroll: function (e) { |
| 216 | - // console.log('aa', e) | 228 | + console.log('aa', e) |
| 217 | // console.log(e.detail.scrollTop); | 229 | // console.log(e.detail.scrollTop); |
| 218 | var that = this | 230 | var that = this |
| 219 | var num = that.data.num | 231 | var num = that.data.num |
| @@ -226,6 +238,11 @@ Page({ | @@ -226,6 +238,11 @@ Page({ | ||
| 226 | that.setData({ | 238 | that.setData({ |
| 227 | scrollTop: scrollTop | 239 | scrollTop: scrollTop |
| 228 | }) | 240 | }) |
| 241 | + | ||
| 242 | + | ||
| 243 | + | ||
| 244 | + | ||
| 245 | + | ||
| 229 | if (scrollTop == 0) { | 246 | if (scrollTop == 0) { |
| 230 | // var that = this | 247 | // var that = this |
| 231 | // var skey = that.data.skey | 248 | // var skey = that.data.skey |
| @@ -503,6 +520,60 @@ Page({ | @@ -503,6 +520,60 @@ Page({ | ||
| 503 | console.log('下拉', e) | 520 | console.log('下拉', e) |
| 504 | }, | 521 | }, |
| 505 | lower: function (e) { | 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 | console.log('上啦', e) | 577 | console.log('上啦', e) |
| 507 | var that = this | 578 | var that = this |
| 508 | var skey = that.data.skey | 579 | var skey = that.data.skey |
| @@ -684,38 +755,6 @@ Page({ | @@ -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 | -<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 | <view class="index-advs"> | 2 | <view class="index-advs"> |
| 9 | <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"> | 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 | <block wx:for="{{adv}}" wx:for-index="idx"> | 4 | <block wx:for="{{adv}}" wx:for-index="idx"> |
| @@ -12,7 +6,6 @@ | @@ -12,7 +6,6 @@ | ||
| 12 | <navigator class="index-advs-navigator" url="/{{item.linkTo.pageUri}}"> | 6 | <navigator class="index-advs-navigator" url="/{{item.linkTo.pageUri}}"> |
| 13 | <image src="{{item.image.url}}" bindload="imagesHeight" style='width:100%; height:612rpx' data-type="advsheight"> | 7 | <image src="{{item.image.url}}" bindload="imagesHeight" style='width:100%; height:612rpx' data-type="advsheight"> |
| 14 | </image> | 8 | </image> |
| 15 | - | ||
| 16 | <!-- <view class="wenzi"> pssb{{idx}}</view> --> | 9 | <!-- <view class="wenzi"> pssb{{idx}}</view> --> |
| 17 | </navigator> | 10 | </navigator> |
| 18 | </swiper-item> | 11 | </swiper-item> |
| @@ -155,4 +148,3 @@ | @@ -155,4 +148,3 @@ | ||
| 155 | </view> | 148 | </view> |
| 156 | </view> | 149 | </view> |
| 157 | <view class="{{meng ? 'hide' : 'block'}} meng" bindtap='meng'></view> | 150 | <view class="{{meng ? 'hide' : 'block'}} meng" bindtap='meng'></view> |
| 158 | -</scroll-view> |
| @@ -212,6 +212,7 @@ Page({ | @@ -212,6 +212,7 @@ Page({ | ||
| 212 | var skey = that.data.skey | 212 | var skey = that.data.skey |
| 213 | var tanchuang = that.data.tanchuang | 213 | var tanchuang = that.data.tanchuang |
| 214 | var id = that.data.id | 214 | var id = that.data.id |
| 215 | + console.log('id',id) | ||
| 215 | var disabled = that.data.disabled | 216 | var disabled = that.data.disabled |
| 216 | var information = that.data.information | 217 | var information = that.data.information |
| 217 | console.log('information1', information) | 218 | console.log('information1', information) |
| @@ -6,6 +6,7 @@ Page({ | @@ -6,6 +6,7 @@ Page({ | ||
| 6 | * 页面的初始数据 | 6 | * 页面的初始数据 |
| 7 | */ | 7 | */ |
| 8 | data: { | 8 | data: { |
| 9 | + hdid: '', | ||
| 9 | meng: true, | 10 | meng: true, |
| 10 | skey: '', | 11 | skey: '', |
| 11 | user: '', | 12 | user: '', |
| @@ -24,7 +25,7 @@ Page({ | @@ -24,7 +25,7 @@ Page({ | ||
| 24 | bgbgbgbgbbg: false, | 25 | bgbgbgbgbbg: false, |
| 25 | tanchuang3: false, | 26 | tanchuang3: false, |
| 26 | tanchuang4: false, | 27 | tanchuang4: false, |
| 27 | - tanchuang5: false | 28 | + tanchuang5: false, |
| 28 | }, | 29 | }, |
| 29 | getmenu: function () { | 30 | getmenu: function () { |
| 30 | var that = this | 31 | var that = this |
| @@ -86,11 +87,8 @@ Page({ | @@ -86,11 +87,8 @@ Page({ | ||
| 86 | onLoad: function (options) { | 87 | onLoad: function (options) { |
| 87 | var that = this | 88 | var that = this |
| 88 | // var id = options.id | 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 | var skey = wx.getStorageSync('key') | 92 | var skey = wx.getStorageSync('key') |
| 95 | var user = wx.getStorageSync('user') | 93 | var user = wx.getStorageSync('user') |
| 96 | var information = that.data.information | 94 | var information = that.data.information |
| @@ -98,7 +96,6 @@ Page({ | @@ -98,7 +96,6 @@ Page({ | ||
| 98 | var total1 = that.data.total1 | 96 | var total1 = that.data.total1 |
| 99 | var total2 = that.data.total2 | 97 | var total2 = that.data.total2 |
| 100 | var total3 = that.data.total3 | 98 | var total3 = that.data.total3 |
| 101 | - | ||
| 102 | wx.request({ | 99 | wx.request({ |
| 103 | url: app.url + '/mpapi/1.0.0/user/profile', | 100 | url: app.url + '/mpapi/1.0.0/user/profile', |
| 104 | method: 'GET', | 101 | method: 'GET', |
| @@ -113,7 +110,7 @@ Page({ | @@ -113,7 +110,7 @@ Page({ | ||
| 113 | // id:'1' | 110 | // id:'1' |
| 114 | }, | 111 | }, |
| 115 | success: function (res) { | 112 | success: function (res) { |
| 116 | - console.log('xinxi', res.data) | 113 | + console.log('xinxi', res) |
| 117 | that.setData({ | 114 | that.setData({ |
| 118 | information: res.data | 115 | information: res.data |
| 119 | }) | 116 | }) |
| @@ -123,7 +120,7 @@ Page({ | @@ -123,7 +120,7 @@ Page({ | ||
| 123 | console.log('user', user) | 120 | console.log('user', user) |
| 124 | that.setData({ | 121 | that.setData({ |
| 125 | skey: skey, | 122 | skey: skey, |
| 126 | - user: user | 123 | + user: user, |
| 127 | }) | 124 | }) |
| 128 | wx.request({ | 125 | wx.request({ |
| 129 | url: app.url + '//mpapi/1.0.0/user/favorite?type=&offset=&limit=', | 126 | url: app.url + '//mpapi/1.0.0/user/favorite?type=&offset=&limit=', |
| @@ -193,11 +190,6 @@ Page({ | @@ -193,11 +190,6 @@ Page({ | ||
| 193 | limit: 9999 | 190 | limit: 9999 |
| 194 | }, | 191 | }, |
| 195 | success: function (res) { | 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 | that.setData({ | 193 | that.setData({ |
| 202 | total3: res.data.countTotal, | 194 | total3: res.data.countTotal, |
| 203 | total1: Number(res.data.countTotal) + Number(that.data.total2) | 195 | total1: Number(res.data.countTotal) + Number(that.data.total2) |
| @@ -255,14 +247,11 @@ Page({ | @@ -255,14 +247,11 @@ Page({ | ||
| 255 | console.log('coupon', res.data) | 247 | console.log('coupon', res.data) |
| 256 | } | 248 | } |
| 257 | }) | 249 | }) |
| 258 | - | ||
| 259 | - | ||
| 260 | - | ||
| 261 | }, | 250 | }, |
| 262 | formSubmit: function (e) { | 251 | formSubmit: function (e) { |
| 263 | var that = this | 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 | var mobile = e.detail.value.mobile | 255 | var mobile = e.detail.value.mobile |
| 267 | var email = e.detail.value.email | 256 | var email = e.detail.value.email |
| 268 | var major = e.detail.value.major | 257 | var major = e.detail.value.major |
| @@ -275,12 +264,6 @@ Page({ | @@ -275,12 +264,6 @@ Page({ | ||
| 275 | that.setData({ | 264 | that.setData({ |
| 276 | skey: skey | 265 | skey: skey |
| 277 | }) | 266 | }) |
| 278 | - // wx.showLoading({ | ||
| 279 | - // title: '提交中', | ||
| 280 | - // }) | ||
| 281 | - // setTimeout(function () { | ||
| 282 | - // wx.hideLoading() | ||
| 283 | - // }, 2000) | ||
| 284 | wx.request({ | 267 | wx.request({ |
| 285 | url: app.url + '/mpapi/1.0.0/user/profile', | 268 | url: app.url + '/mpapi/1.0.0/user/profile', |
| 286 | method: 'POST', | 269 | method: 'POST', |
| @@ -298,8 +281,7 @@ Page({ | @@ -298,8 +281,7 @@ Page({ | ||
| 298 | // id:'1' | 281 | // id:'1' |
| 299 | }, | 282 | }, |
| 300 | success: function (res) { | 283 | success: function (res) { |
| 301 | - console.log('con', res.data) | ||
| 302 | - | 284 | + console.log('con', res) |
| 303 | wx.showToast({ | 285 | wx.showToast({ |
| 304 | title: '提交成功', | 286 | title: '提交成功', |
| 305 | icon: 'success', | 287 | icon: 'success', |
| @@ -309,21 +291,14 @@ Page({ | @@ -309,21 +291,14 @@ Page({ | ||
| 309 | disabled: true | 291 | disabled: true |
| 310 | }) | 292 | }) |
| 311 | that.onLoad() | 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,7 +355,7 @@ Page({ | ||
| 380 | var that = this | 355 | var that = this |
| 381 | var tanchuang4 = that.data.tanchuang4 | 356 | var tanchuang4 = that.data.tanchuang4 |
| 382 | var bgbgbgbgbbg = that.data.bgbgbgbgbbg | 357 | var bgbgbgbgbbg = that.data.bgbgbgbgbbg |
| 383 | - | 358 | + |
| 384 | that.setData({ | 359 | that.setData({ |
| 385 | tanchuang4: false, | 360 | tanchuang4: false, |
| 386 | bgbgbgbgbbg: false | 361 | bgbgbgbgbbg: false |
| @@ -490,7 +465,7 @@ Page({ | @@ -490,7 +465,7 @@ Page({ | ||
| 490 | } | 465 | } |
| 491 | } | 466 | } |
| 492 | }) | 467 | }) |
| 493 | - | 468 | + |
| 494 | }, | 469 | }, |
| 495 | a2: function () { | 470 | a2: function () { |
| 496 | var that = this | 471 | var that = this |
Please
register
or
login
to post a comment