renjianshu 4 years ago
parent
commit
92eb6ac1b9

File diff suppressed because it is too large
+ 768 - 747
lionfish_comshop/pages/type/index.js


+ 1 - 0
lionfish_comshop/pages/type/index.json

@@ -1,6 +1,7 @@
 {
   "navigationBarTitleText": "分类",
   "disableScroll": true,
+  "enablePullDownRefresh": true,
   "usingComponents": {
     "i-auth": "../../components/auth/index",
     "i-tabbar": "../../components/tabbar/index",

+ 122 - 122
lionfish_comshop/pages/type/index.wxml

@@ -1,123 +1,123 @@
-<i-auth bind:authSuccess="authSuccess" needAuth="{{!is_login}}">
-  <view class='page-wrap'>
-    <!--搜索框begin-->
-    <view class='search-bar'>
-      <view class='search-box'>
-        <input class='ipt' placeholder="搜索商品" confirm-type="搜索" type="text" bindconfirm="goResult"></input>
-        <view class='search-icon'>
-          <image src='../../images/search.png'></image>
-        </view>
-      </view>
-    </view>
-    <view class="page-content">
-      <scroll-view scrollWithAnimation scrollY class="page-category" scrollTop="{{categoryScrollBarTop}}" style="height:{{scrollViewHeight}}px">
-        <view bindtap="changeCategory" class="category-item {{rushCategoryData.activeIndex===index?'active':''}}" data-index="{{index}}" wx:for="{{rushCategoryData.tabs}}" wx:key="index">
-          <view class="item-border"></view>
-          <view>{{item.name}}</view>
-        </view>
-      </scroll-view>
-      <!-- 子栏目 -->
-      <view class='mask' hidden='{{!showDrop}}' bindtap='showDrop'></view>
-      <view class='sub-cate' wx:if="{{rushCategoryData.tabs[rushCategoryData.activeIndex].sub.length}}">
-        <scroll-view class='sub-cate-scroll' scroll-x scrollLeft="{{scrollLeft}}">
-          <view class='sub-cate-item {{active_sub_index==0?"active":""}}' data-idx="0" data-id='{{rushCategoryData.tabs[rushCategoryData.activeIndex].id}}' bindtap='change_sub_cate'>默认</view>
-          <view class='sub-cate-item {{active_sub_index==index+1?"active":""}}' wx:for="{{rushCategoryData.tabs[rushCategoryData.activeIndex].sub}}" wx:key="{{index}}" data-idx="{{index+1}}" data-id='{{item.id}}' bindtap='change_sub_cate'>{{item.name}}</view>
-        </scroll-view>
-        <view class='icon-open' bindtap='showDrop'><image class="openImg {{showDrop?'':'down'}}" src="../../images/commentsOpen.png"></image></view>
-      </view>
-      <view class='sub-cate-hide' wx:if="{{rushCategoryData.tabs[rushCategoryData.activeIndex].sub.length&&showDrop}}">
-        <view class='sub-cate-item {{active_sub_index==0?"active":""}}' data-idx="0" data-id='{{rushCategoryData.tabs[rushCategoryData.activeIndex].id}}' bindtap='change_sub_cate'>默认</view>
-        <view class='sub-cate-item {{active_sub_index==index+1?"active":""}}' wx:for="{{rushCategoryData.tabs[rushCategoryData.activeIndex].sub}}" wx:key="{{index}}" data-idx="{{index+1}}" data-id='{{item.id}}' bindtap='change_sub_cate'>{{item.name}}</view>
-      </view>
-      <!-- 列表 -->
-      <scroll-view scrollWithAnimation scrollY bindscroll="scroll" bindscrolltolower="scrollBottom" bindtouchend="touchend" bindtouchstart="touchstart" class="page-list {{rushCategoryData.tabs[rushCategoryData.activeIndex].sub.length?'pt50':''}}" lowerThreshold="{{200}}" scrollTop="{{resetScrollBarTop}}" style="height:{{scrollViewHeight}}px"
-        upperThreshold="{{50}}">
-        <view class="scroll-col-tip-top">
-          <span wx:if="{{isFirstCategory}}">已经拉到最顶部啦~</span>
-          <block wx:else>
-            <span>下拉查看上一个分类</span>
-          </block>
-        </view>
-        <view style="min-height: {{scrollViewHeight+50}}px;">
-          <block wx:if="{{!pageEmpty}}">
-            <i-type-item wx:for="{{rushList}}" wx:key="{{item.actId}}" spuItem="{{item}}" reduction="{{reduction}}" stopClick="{{stopClick}}" bind:openSku="openSku" bind:changeCartNum="changeCartNum" changeCarCount="{{changeCarCount}}"/>
-          </block>
-          <view class="none-rush-list" wx:elif="{{pageEmpty}}">
-            <image class="img-block" src="../../images/icon-index-empty.png"></image>
-            <view class="h1">暂时没有团购</view>
-            <view class="h2">我们正在为您准备更优惠的团购</view>
-          </view>
-
-          <view wx:if="{{loadMore}}">
-            <i-load-more loading="{{loadMore}}" tip="{{loadText}}"></i-load-more>
-          </view>
-          <view class="scroll-col-tip-bottom" wx:elif="{{canNext}}">
-            <span wx:if="{{isLastCategory}}">看到我的底线了吗~</span>
-            <block wx:else>
-              <span>上拉查看下一个分类</span>
-            </block>
-          </view>
-        </view>
-      </scroll-view>
-    </view>
-    <i-tabbar currentIdx='1' cartNum='{{cartNum}}' class="tabbar {{isIpx?'pb20':''}}" />
-  </view>
-</i-auth>
-
-<view class="mask" hidden="{{!visible}}"></view>
-<!---规格选择begin-->
-<view bind:cancel="close" class='sku-content' scrollUp="{{true}}" hidden="{{!visible}}">
-  <view class="sku-card">
-    <view bindtap="closeSku" class="close">
-      <image src="../../images/icon-sku-close.png"></image>
-    </view>
-    <view class="sku-header">
-      <i-img defaultImage="../../images/placeholder-refund.png" height="80" iClass="sku-img" loadImage="{{cur_sku_arr.skuImage}}" width="80"></i-img>
-      <view class="sku-desc">
-        <view class="sku-title">
-          <span>{{cur_sku_arr.spuName}}</span>
-        </view>
-        <view class="sku-price">
-          <view class="sale-price">
-            ¥
-            <span>{{cur_sku_arr.actPrice[0]}}</span>.{{cur_sku_arr.actPrice[1]}}
-          </view>
-          <view class="market-price">¥{{cur_sku_arr.marketPrice[0]}}.{{cur_sku_arr.marketPrice[1]}}</view>
-        </view>
-        <view class="sku-switch-on">已选择:{{cur_sku_arr.spec}}</view>
-      </view>
-    </view>
-
-    <view class="sku-spec" wx:for="{{skuList.list}}" wx:key="{{item.id}}">
-      <view class="title">{{item.name}}</view>
-      <view class="spec-list">
-        <span bindtap="selectSku" class="{{idx==sku[index]['idx']?'on':''}}" data-disabled="{{item.canBuyNum-value<0}}" data-type="{{index}}_{{idx}}_{{value.option_value_id}}_{{value.name}}" wx:for-index="idx" data-idx="{{idx}}" wx:for="{{item.option_value}}"
-          wx:for-item="value" wx:key="{{idx}}">{{value.name}}</span>
-      </view>
-    </view>
-    <view class="sku-num-content">
-      <view class="title">数量</view>
-      <view class="i-class i-input-number i-input-number-size-{{size}}">
-        <view bindtap="setNum" data-type="decrease" class="i-input-number-minus {{value<=min?'i-input-number-disabled':''}}">
-          <image src="../../images/icon-input-reduce.png"></image>
-        </view>
-        <input bindblur="handleBlur" bindfocus="handleFocus" class="i-input-number-text {{min>=max?'i-input-number-disabled':''}}" disabled="true" type="number" value="{{sku_val}}"></input>
-        <view bindtap="setNum" data-type="add" class="i-input-number-plus {{value>=max?'i-input-number-disabled':''}}">
-          <image src="../../images/icon-input-add.png"></image>
-        </view>
-      </view>
-      <view class="msg" wx:if="{{skuList[current].isLimit}}">
-        <span wx:if="{{skuList[current].limitMemberNum>-1}}">每人限{{skuList[current].limitMemberNum}}单</span>
-        <span wx:if="{{skuList[current].limitOrderNum>-1}}">每单限{{skuList[current].limitOrderNum}}份</span>
-        <span></span>
-      </view>
-      <view class="even-num" wx:elif="{{!skuList[current].isLimit&&skuList[current].canBuyNum-value<=10&&skuList[current].canBuyNum-value>-1}}">还可以购买 {{skuList[current].canBuyNum-value}} 件</view>
-    </view>
-    <form bindsubmit="gocarfrom" report-submit="true">
-      <button formType="submit" class="sku-confirm" disabled='{{cur_sku_arr.stock==0 ? true : false}}'>
-        <view>{{cur_sku_arr.stock==0?"已抢光":"确定"}}</view>
-      </button>
-    </form>
-  </view>
-</view>
+<i-auth bind:authSuccess="authSuccess" needAuth="{{!is_login}}">
+  <view class='page-wrap'>
+    <!--搜索框begin-->
+    <view class='search-bar'>
+      <view class='search-box'>
+        <input class='ipt' placeholder="搜索商品" confirm-type="搜索" type="text" bindconfirm="goResult"></input>
+        <view class='search-icon'>
+          <image src='../../images/search.png'></image>
+        </view>
+      </view>
+    </view>
+    <view class="page-content">
+      <scroll-view scrollWithAnimation scrollY class="page-category" scrollTop="{{categoryScrollBarTop}}" style="height:{{scrollViewHeight}}px">
+        <view bindtap="changeCategory" class="category-item {{rushCategoryData.activeIndex===index?'active':''}}" data-index="{{index}}" wx:for="{{rushCategoryData.tabs}}" wx:key="index">
+          <view class="item-border"></view>
+          <view>{{item.name}}</view>
+        </view>
+      </scroll-view>
+      <!-- 子栏目 -->
+      <view class='mask' hidden='{{!showDrop}}' bindtap='showDrop'></view>
+      <view class='sub-cate' wx:if="{{rushCategoryData.tabs[rushCategoryData.activeIndex].sub.length}}">
+        <scroll-view class='sub-cate-scroll' scroll-x scrollLeft="{{scrollLeft}}">
+          <view class='sub-cate-item {{active_sub_index==0?"active":""}}' data-idx="0" data-id='{{rushCategoryData.tabs[rushCategoryData.activeIndex].id}}' bindtap='change_sub_cate'>默认</view>
+          <view class='sub-cate-item {{active_sub_index==index+1?"active":""}}' wx:for="{{rushCategoryData.tabs[rushCategoryData.activeIndex].sub}}" wx:key="{{index}}" data-idx="{{index+1}}" data-id='{{item.id}}' bindtap='change_sub_cate'>{{item.name}}</view>
+        </scroll-view>
+        <view class='icon-open' bindtap='showDrop'><image class="openImg {{showDrop?'':'down'}}" src="../../images/commentsOpen.png"></image></view>
+      </view>
+      <view class='sub-cate-hide' wx:if="{{rushCategoryData.tabs[rushCategoryData.activeIndex].sub.length&&showDrop}}">
+        <view class='sub-cate-item {{active_sub_index==0?"active":""}}' data-idx="0" data-id='{{rushCategoryData.tabs[rushCategoryData.activeIndex].id}}' bindtap='change_sub_cate'>默认</view>
+        <view class='sub-cate-item {{active_sub_index==index+1?"active":""}}' wx:for="{{rushCategoryData.tabs[rushCategoryData.activeIndex].sub}}" wx:key="{{index}}" data-idx="{{index+1}}" data-id='{{item.id}}' bindtap='change_sub_cate'>{{item.name}}</view>
+      </view>
+      <!-- 列表 -->
+      <scroll-view scrollWithAnimation scrollY bindscroll="scroll" bindscrolltolower="onReachBottom" bindtouchend="touchend" bindtouchstart="touchstart" class="page-list {{rushCategoryData.tabs[rushCategoryData.activeIndex].sub.length?'pt50':''}}" lowerThreshold="{{200}}" scrollTop="{{resetScrollBarTop}}" style="height:{{scrollViewHeight}}px"
+        upperThreshold="{{50}}">
+        <view class="scroll-col-tip-top">
+          <!-- <span wx:if="{{isFirstCategory}}">已经拉到最顶部啦~</span>
+          <block wx:else>
+            <span>到顶了,看看别的分类吧~</span>
+          </block> -->
+        </view>
+        <view style="min-height: {{scrollViewHeight+50}}px;">
+          <block wx:if="{{!pageEmpty}}">
+            <i-type-item wx:for="{{rushList}}" wx:key="{{item.actId}}" spuItem="{{item}}" reduction="{{reduction}}" stopClick="{{stopClick}}" bind:openSku="openSku" bind:changeCartNum="changeCartNum" changeCarCount="{{changeCarCount}}"/>
+          </block>
+          <view class="none-rush-list" wx:elif="{{pageEmpty}}">
+            <image class="img-block" src="../../images/icon-index-empty.png"></image>
+            <view class="h1">暂时没有团购</view>
+            <view class="h2">我们正在为您准备更优惠的团购</view>
+          </view>
+
+          <view wx:if="{{loadMore}}">
+            <i-load-more loading="{{loadMore}}" tip="{{loadText}}"></i-load-more>
+          </view>
+          <view class="scroll-col-tip-bottom" wx:elif="{{canNext}}">
+            <span wx:if="{{isLastCategory}}">看到我的底线了吗~</span>
+            <block wx:else>
+              <span>到底了,看看别的分类吧~</span>
+            </block>
+          </view>
+        </view>
+      </scroll-view>
+    </view>
+    <i-tabbar currentIdx='1' cartNum='{{cartNum}}' class="tabbar {{isIpx?'pb20':''}}" />
+  </view>
+</i-auth>
+
+<view class="mask" hidden="{{!visible}}"></view>
+<!---规格选择begin-->
+<view bind:cancel="close" class='sku-content' scrollUp="{{true}}" hidden="{{!visible}}">
+  <view class="sku-card">
+    <view bindtap="closeSku" class="close">
+      <image src="../../images/icon-sku-close.png"></image>
+    </view>
+    <view class="sku-header">
+      <i-img defaultImage="../../images/placeholder-refund.png" height="80" iClass="sku-img" loadImage="{{cur_sku_arr.skuImage}}" width="80"></i-img>
+      <view class="sku-desc">
+        <view class="sku-title">
+          <span>{{cur_sku_arr.spuName}}</span>
+        </view>
+        <view class="sku-price">
+          <view class="sale-price">
+            ¥
+            <span>{{cur_sku_arr.actPrice[0]}}</span>.{{cur_sku_arr.actPrice[1]}}
+          </view>
+          <view class="market-price">¥{{cur_sku_arr.marketPrice[0]}}.{{cur_sku_arr.marketPrice[1]}}</view>
+        </view>
+        <view class="sku-switch-on">已选择:{{cur_sku_arr.spec}}</view>
+      </view>
+    </view>
+
+    <view class="sku-spec" wx:for="{{skuList.list}}" wx:key="{{item.id}}">
+      <view class="title">{{item.name}}</view>
+      <view class="spec-list">
+        <span bindtap="selectSku" class="{{idx==sku[index]['idx']?'on':''}}" data-disabled="{{item.canBuyNum-value<0}}" data-type="{{index}}_{{idx}}_{{value.option_value_id}}_{{value.name}}" wx:for-index="idx" data-idx="{{idx}}" wx:for="{{item.option_value}}"
+          wx:for-item="value" wx:key="{{idx}}">{{value.name}}</span>
+      </view>
+    </view>
+    <view class="sku-num-content">
+      <view class="title">数量</view>
+      <view class="i-class i-input-number i-input-number-size-{{size}}">
+        <view bindtap="setNum" data-type="decrease" class="i-input-number-minus {{value<=min?'i-input-number-disabled':''}}">
+          <image src="../../images/icon-input-reduce.png"></image>
+        </view>
+        <input bindblur="handleBlur" bindfocus="handleFocus" class="i-input-number-text {{min>=max?'i-input-number-disabled':''}}" disabled="true" type="number" value="{{sku_val}}"></input>
+        <view bindtap="setNum" data-type="add" class="i-input-number-plus {{value>=max?'i-input-number-disabled':''}}">
+          <image src="../../images/icon-input-add.png"></image>
+        </view>
+      </view>
+      <view class="msg" wx:if="{{skuList[current].isLimit}}">
+        <span wx:if="{{skuList[current].limitMemberNum>-1}}">每人限{{skuList[current].limitMemberNum}}单</span>
+        <span wx:if="{{skuList[current].limitOrderNum>-1}}">每单限{{skuList[current].limitOrderNum}}份</span>
+        <span></span>
+      </view>
+      <view class="even-num" wx:elif="{{!skuList[current].isLimit&&skuList[current].canBuyNum-value<=10&&skuList[current].canBuyNum-value>-1}}">还可以购买 {{skuList[current].canBuyNum-value}} 件</view>
+    </view>
+    <form bindsubmit="gocarfrom" report-submit="true">
+      <button formType="submit" class="sku-confirm" disabled='{{cur_sku_arr.stock==0 ? true : false}}'>
+        <view>{{cur_sku_arr.stock==0?"已抢光":"确定"}}</view>
+      </button>
+    </form>
+  </view>
+</view>
 <!---规格选择end-->

+ 3 - 0
lionfish_comshop/pages/type/index.wxss

@@ -129,6 +129,9 @@
   font-size: 24rpx;
   line-height: 24rpx;
 }
+.page-list .scroll-col-tip-bottom{
+  padding-bottom:100rpx;
+}
 
 .page-list .scroll-col-tip-top image, .page-list .scroll-col-tip-bottom image {
   width: 24rpx;

+ 2 - 2
project.config.json

@@ -22,8 +22,8 @@
 	},
 	"compileType": "miniprogram",
 	"libVersion": "2.7.2",
-	"appid": "wx470de64ce71f3c38",
-	"projectname": "V5.8.0",
+	"appid": "wxd8bb3f7de92c60c0",
+	"projectname": "niuniu",
 	"cloudfunctionTemplateRoot": "",
 	"debugOptions": {
 		"hidedInDevtools": []