lex-xin преди 6 месеца
родител
ревизия
524452dbc8

+ 1 - 1
miniprogram/app.ts

@@ -80,7 +80,7 @@ App<IAppOption>({
           wx.removeStorageSync("token");
           this.globalData.isLogin = false
         }
-        console.log(users)
+        // console.log(users)
       } else {
         this.globalData.isLogin = false;
       }

+ 1 - 1
miniprogram/config.ts

@@ -1,4 +1,4 @@
-const environmentVariable = "online";
+const environmentVariable = "test";
 const apiUrlInfo = {
   dev: "https://dev.kt.colexiu.com",
   test: "https://test.kt.colexiu.com",

BIN
miniprogram/pages/index/images/icon-up-scroll.png


+ 45 - 1
miniprogram/pages/index/index.less

@@ -186,7 +186,7 @@ page {
   background: #FFFFFF;
   // border-radius: 20rpx;
   overflow: hidden;
-  margin: 16rpx 0 0;
+  // margin: 16rpx 0 0;
 
   .title {
     font-weight: 600;
@@ -319,6 +319,10 @@ page {
   }
 }
 
+.hide {
+  display: none !important;
+}
+
 
 // 'demo-text-1', 'demo-text-2', 'demo-text-3'
 .popup-section {
@@ -471,4 +475,44 @@ page {
     padding-top: 0;
     padding-bottom: 0;
   }
+}
+
+.showMoreContainer {
+  position: fixed;
+  bottom: 0;
+  width: 100%;
+  left: 0;
+  right: 0;
+  height: 378rpx;
+  background: linear-gradient( 180deg, rgba(255,255,255,0) 0%, #FFFFFF 100%);
+  display: flex;
+  justify-content: center;
+  align-items: flex-end;
+  pointer-events: none;
+  .iconUpScroll {
+    width: 80rpx;
+    height: 80rpx;
+    margin-bottom: 60rpx;
+    animation: breathe 1.5s infinite;
+    transition: all cubic-bezier(0.38, 0.03, 0, 0.63);
+  }
+
+  @keyframes breathe {
+    0% {
+      opacity: 0;
+      transform: translateY(0rpx);
+    }
+    // 90% {
+      // opacity: 0.75;
+      // transform: translateY(-10rpx);
+    // }
+    // 99% {
+    //   transform: translateY(-20rpx);
+    //   opacity: 1;
+    // }
+    100% {
+      opacity: 1;
+      transform: translateY(-30rpx);
+    }
+  }
 }

+ 23 - 9
miniprogram/pages/index/index.ts

@@ -14,26 +14,27 @@ Page({
     imgList: [
       'https://oss.dayaedu.com/ktyq/1732672861312.png',
       'https://oss.dayaedu.com/ktyq/1732613781003.png',
-      'https://oss.dayaedu.com/ktyq/1732613795513.png',
+      'https://oss.dayaedu.com/ktyq/1733118132694.png',
       'https://oss.dayaedu.com/ktyq/1732613807112.png',
       // 'https://oss.dayaedu.com/ktyq/1732101102921.png',
     ],
     
     goodsImgList: [
       "https://oss.dayaedu.com/ktyq/1732697791582.png",
-      "https://oss.dayaedu.com/ktyq/1732697810826.png",
+      "https://oss.dayaedu.com/ktyq/1733118166964.png",
       "https://oss.dayaedu.com/ktyq/1732706055542.png",
       "https://oss.dayaedu.com/ktyq/1732706066094.png"
     ],
     current: 0,
-    autoplay: false,
-    interval: 5000,
-    duration: 500,
+    // autoplay: false,
+    // interval: 5000,
+    // duration: 500,
     popupShow: false,
     list: [] as any,
     isOverSaled: false, // 是否所有商品都没有库存
     selected: {} as any,
     isFromPreviewImage: false,
+    isShowOperation: false, // 是否显示操作按钮
   },
 
   /**
@@ -221,9 +222,22 @@ Page({
       })
     }
   },
-  openService() {
-    wx.navigateTo({
-      url: '../service/service'
-    })
+  // openService() {
+  //   wx.navigateTo({
+  //     url: '../service/service'
+  //   })
+  // },
+  onScroll(e: { detail: any }) {
+    // console.log(e, 'any')
+    const scrollTop = e.detail.scrollTop || 0
+    if(scrollTop > 40) {
+      this.setData({
+        isShowOperation: true
+      })
+    } else {
+      this.setData({
+        isShowOperation: false
+      })
+    }
   }
 })

+ 11 - 9
miniprogram/pages/index/index.wxml

@@ -1,7 +1,7 @@
 <!--index.wxml-->
-<scroll-view class="scrollarea" scroll-y="{{popupShow ? false : true}}" type="list">
+<scroll-view class="scrollarea" scroll-y="{{popupShow ? false : true}}" type="list" bindscroll="onScroll" enable-passive="true">
   <view class="container">
-    <!-- <view class="topShadow"></view> -->
+    <!-- <view class="topShadow"></view>
     <view class="slider-count">{{current + 1}}/{{imgList.length}}</view>
     <swiper indicator-dots="{{false}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" bindchange="changeSwiper">
       <swiper-item wx:for="{{imgList}}" wx:key="index">
@@ -31,7 +31,6 @@
       </view>
 
       <view class="goodsInfo">
-        <!-- <text class="desc">已选:</text> -->
         <view class="goodsList">
           <view wx:for="{{ list }}" wx:key="index" class="goodsItem {{ item.id == selected.id ? 'selected' : '' }} {{ item.stockNum <= 0 ? 'nosale' : '' }}" bind:tap="onSelectGoods" data-id="{{ item.id }}">
           <image class="goods-cover" src="{{item.pic}}"></image>
@@ -39,15 +38,15 @@
           </view>
         </view>
       </view>
-    </view>
+    </view> -->
     
     <view class="goodsSection">
       <view class="goodsIntro">
-        <view class="title">
+        <!-- <view class="title">
           <view class="before"></view>
           <view>商品详情</view>
           <view class="after"></view>
-        </view>
+        </view> -->
         <view class="images">
           <block wx:for="{{goodsImgList}}" wx:key="index">
             <image  mode="widthFix" bind:tap="onPreivewGoodsImg" data-src="{{item}}" src="{{item}}"></image>
@@ -56,7 +55,7 @@
       </view>
     </view>
 
-    <view class="bottom-section">
+    <view class="bottom-section {{ isShowOperation ? '' : 'hide' }}">
       <view class="btnSection">
         <button bind:tap="onOrder" type="primary" disabled="{{ isOverSaled }}">我的订单</button>
         <button bind:tap="onBuyShop" type="primary" disabled="{{ isOverSaled }}">立即购买</button>
@@ -94,15 +93,18 @@
               <image class="goods-cover" src="{{item.pic}}"></image>
               <text class="name">{{ item.typeName }}</text><image class="iconSale" wx:if="{{ item.stockNum <= 0 }}" src="./images/nosale.png"></image>
             </view>
-            <!-- <view wx:for="{{ list }}" wx:key="index" class="goodsItem {{ item.id == selected.id ? 'selected' : '' }} {{ item.stockNum <= 0 ? 'nosale' : '' }}" bind:tap="onSelectGoods" data-id="{{ item.id }}">{{ item.typeName }}<image wx:if="{{ item.stockNum <= 0 }}" src="./images/nosale.png"></image></view> -->
           </view>
         </view>
 
         <view class="btnSections"><button type="primary" bind:tap="onSubmit">立即购买</button></view>
       </view>
     </view>
+
+    <view class="showMoreContainer {{ !isShowOperation ? '' : 'hide' }}">
+      <image src="./images/icon-up-scroll.png" class="iconUpScroll" />
+    </view>
   </view>
 
   <!-- 客服 -->
-  <service bind:openService="openService"></service>
+  <service bind:openService="openService" class="{{ isShowOperation ? '' : 'hide' }}"></service>
 </scroll-view>