sharp-agezi 5 anos atrás
pai
commit
e37629e206
6 arquivos alterados com 35 adições e 8 exclusões
  1. 2 2
      app.js
  2. 17 0
      pages/index/index.js
  3. 1 1
      pages/index/index.wxml
  4. 3 0
      pages/index/index.wxss
  5. 10 3
      pages/login/login.js
  6. 2 2
      pages/momo/momo.js

+ 2 - 2
app.js

@@ -137,8 +137,8 @@ App({
     fromUserId : '',//分享者的id
     fromUserRole : '',//分享者的role
     //servsers: "https://52yqf.cn/",
-    servsers: "https://www.daliangzao.net/",//正式库
-    //servsers: "https://dlz.info666.com/",//测试域名库
+    //servsers: "https://www.daliangzao.net/",//正式库
+    servsers: "https://dlz.info666.com/",//测试域名库
     //servsers: "https://tt.daliangzao.net/",//测试库
     appid: 'wxf9a0ddcb8c70b939',//appid
     secret: 'a009cb3e46c8ecef9c54a50522f11823',//secret

+ 17 - 0
pages/index/index.js

@@ -30,6 +30,8 @@ Page({
   data: {
     urlHttp: '',
     host: '',
+    previous: 30,
+    next: 180,
     scrollLeft: 0, //tab标题的滚动条位置
     search: {
       placeholder: "输入搜索关键字"
@@ -662,6 +664,21 @@ Page({
     //     url: '/pages/momo/momo',
     //   })
     // }
+  },
+  swiperChange(e) {
+    console.log(e.detail.current, this.data.specArray.length,"detail")
+    if (e.detail.current == this.data.specArray.length-1) {
+      console.log("等于了")
+      this.setData({
+        previous: 210,
+        next: 0,
+      })
+    } else {
+      this.setData({
+        previous: 30,
+        next: 180,
+      })
+    }
   }
 
 })

+ 1 - 1
pages/index/index.wxml

@@ -73,7 +73,7 @@
         <!-- 专题精选 -->
         <view class='special-box'>
           <view class='spec-title'>专题精选</view>
-          <swiper autoplay="true" interval="5000" duration="500" previous-margin="30rpx" next-margin="180rpx">
+          <swiper autoplay="true" interval="5000" duration="500" previous-margin="{{previous}}rpx" next-margin="{{next}}rpx" bindchange="swiperChange">
             <block wx:for="{{specArray}}">
               <swiper-item>
               <view style='height:100%;margin-right:30rpx'>

+ 3 - 0
pages/index/index.wxss

@@ -879,4 +879,7 @@ page{
   height:260rpx; */
   display: block;
   margin-right:30rpx;
+}
+.special-box .slide-image:last-child{
+   margin-right:0rpx;
 }

+ 10 - 3
pages/login/login.js

@@ -10,7 +10,8 @@ Page({
     account:null,
     pwd:null,
     url:null,
-    type:0 //默认nav 为1表示switch
+    type:0, //默认nav 为1表示switch
+    back:1,
   },
 
   /**
@@ -20,7 +21,8 @@ Page({
     console.log(options)
     this.setData({
       url:options.url,
-      type: options.type ? options.type : 0
+      type: options.type ? options.type : 0,
+      back: options.back ? options.back : 1
     })
   },
 
@@ -49,7 +51,12 @@ Page({
    * 生命周期函数--监听页面卸载
    */
   onUnload: function () {
-
+    if(this.data.back == 2){ //表示需要返回2级,给首页
+      wx.reLaunch({
+        url: '/pages/index/index'
+      })
+    }
+    
   },
 
   /**

+ 2 - 2
pages/momo/momo.js

@@ -71,8 +71,8 @@ Page({
       goodsList:[],
     })
     if (!wx.getStorageSync('channelIdObj')) { // 还没有登录过渠道
-      wx.redirectTo({
-        url: '/pages/login/login?url=/pages/momo/momo&&type=1',
+      wx.navigateTo({
+        url: '/pages/login/login?url=/pages/momo/momo&&type=1&&back=2',
       })
     } else {
       that.getGiftList(that)