소스 검색

v0.0.1

添加首页、超值好券、地图定位、地图导航、授权登录功能
aldrich5750 6 년 전
부모
커밋
fc01b0ff64
29개의 변경된 파일234개의 추가작업 그리고 78개의 파일을 삭제
  1. 2 2
      src/components/base/map/index.wxml
  2. 4 4
      src/components/base/map/index.wxss
  3. 1 1
      src/components/base/menuItem/index.wxml
  4. 2 1
      src/components/base/menuItem/index.wxss
  5. 13 5
      src/components/base/switchButton/index.js
  6. 4 1
      src/components/base/switchButton/index.wxml
  7. 25 1
      src/components/base/switchButton/index.wxss
  8. 3 1
      src/components/user/limitTimeGetting/index.js
  9. 6 6
      src/components/user/limitTimeGetting/index.wxml
  10. 2 0
      src/components/user/limitTimeGetting/index.wxss
  11. 1 1
      src/components/user/popularShopList/index.wxml
  12. 3 1
      src/components/user/popularShopList/index.wxss
  13. 2 2
      src/components/user/recommendShop/index.wxml
  14. 2 0
      src/components/user/recommendShop/index.wxss
  15. 16 1
      src/components/user/screeningConditions/index.js
  16. 20 10
      src/components/user/screeningConditions/index.wxml
  17. 48 0
      src/components/user/screeningConditions/index.wxss
  18. 16 2
      src/components/user/ticketList/index.js
  19. 2 1
      src/components/user/ticketList/index.json
  20. 21 8
      src/components/user/ticketList/index.wxml
  21. 4 2
      src/components/user/ticketList/index.wxss
  22. 5 5
      src/components/user/valueTicket/index.wxml
  23. 4 1
      src/components/user/valueTicket/index.wxss
  24. 3 0
      src/styles/base/index.wxss
  25. 10 10
      src/utils/isLogin.js
  26. 4 3
      src/views/base/home/index.wxml
  27. 1 1
      src/views/base/home/index.wxss
  28. 4 2
      src/views/user/tickets/index.js
  29. 6 6
      src/views/user/tickets/index.wxml

+ 2 - 2
src/components/base/map/index.wxml

@@ -1,8 +1,8 @@
 <!--components/base/map/index.wxml-->
 <view class='flex flex_ac flex_ct'>
-  <image class='map-icon' mode='widthFix' src='/icons/base/icon_dingwei@3x.png'></image>
+  <image class='map-icon' src='/icons/base/icon_dingwei@3x.png'></image>
   <picker mode="multiSelector" range-key='name' range="{{openArea}}"  value='{{openAreaSelectIndexList}}' bindchange="openAreaChange" bindcolumnchange="openAreaColumnchange">
     <text style='margin-top: 10rpx' class='font14 position tc'>{{title?title:'定位中...'}}</text>
-    <image class='arrow-down fr' style='margin-top: 27rpx' src='/icons/base/icon_xiala@3x.png'></image>
+    <image class='arrow-down fr' style='margin-top: 27rpx;margin-left:10rpx' src='/icons/base/icon_xiala@3x.png'></image>
   </picker>
 </view>

+ 4 - 4
src/components/base/map/index.wxss

@@ -2,19 +2,19 @@
 @import '../../../app.wxss';
 .map-icon{
   width: 34rpx;
-  /* height: 40rpx */
+  height: 40rpx
 }
 .arrow-down{
   width: 15rpx;
   height: 12rpx
 }
 .position{
-  width: 116rpx;
+  width: 126rpx;
   display: inline-block;
-  text-overflow: ellipsis;
+  /* text-overflow: ellipsis; */
   overflow: hidden;
   white-space: nowrap;
-  padding-left: 15rpx;
+  padding-left: 12rpx;
   padding-right: 12rpx;
   color: #4a4a4a
 }

+ 1 - 1
src/components/base/menuItem/index.wxml

@@ -1,5 +1,5 @@
 <!--src/components/base/menuItem/index.wxml-->
 <view class='menuItem' style='margin-left:{{space}}rpx;margin-right:{{space}}rpx'>
-  <image mode='widthFix' src='{{src}}'></image>
+  <image src='{{src}}'></image>
   <text class='font13 bc tc'>{{title}}</text>
 </view>

+ 2 - 1
src/components/base/menuItem/index.wxss

@@ -5,7 +5,8 @@
   display: inline-block
 }
 .menuItem image{
-  width: 100%
+  width: 85rpx;
+  height: 85rpx;
 }
 .menuItem text{
   color: #666666;

+ 13 - 5
src/components/base/switchButton/index.js

@@ -4,20 +4,28 @@ Component({
    * 组件的属性列表
    */
   properties: {
-
+    switching: {
+      type: Boolean,
+      value: false
+    }
   },
-
   /**
    * 组件的初始数据
    */
   data: {
 
   },
-
   /**
    * 组件的方法列表
    */
   methods: {
-
+    switchButton(){
+      this.setData({
+        switching: !this.data.switching
+      })
+      if (this.data.switching){
+        this.triggerEvent('change', this.data.switching)
+      }
+    }
   }
-})
+})

+ 4 - 1
src/components/base/switchButton/index.wxml

@@ -1,2 +1,5 @@
 <!--components/base/switchButton/index.wxml-->
-<text>components/base/switchButton/index.wxml</text>
+<view class='switchButton rat'>
+  <label bindtap='switchButton' class='label-circle bw' style='left:{{switching?41:2}}rpx'></label>
+  <label class='label-bg' style='background:{{switching?"#F35D60":"#D5D5D5"}}'></label>
+</view>

+ 25 - 1
src/components/base/switchButton/index.wxss

@@ -1 +1,25 @@
-/* components/base/switchButton/index.wxss */
+/* components/base/switchButton/index.wxss */
+@import '../../../app.wxss';
+.switchButton{
+  width: 73rpx;
+  height: 32rpx;
+  border-radius: 32rpx;
+}
+.switchButton .label-circle{
+  width: 28rpx;
+  height: 28rpx;
+  position: absolute;
+  top: 2rpx;
+  left: 2rpx;
+  border-radius: 50%;
+  z-index: 2;
+  transition: all .3s ease-in-out
+}
+.switchButton .label-bg{
+  position: absolute;
+  width: 100%;
+  min-height: 32rpx;
+  height: 32rpx;
+  border-radius: 32rpx;
+  transition: all .3s ease-in-out
+}

+ 3 - 1
src/components/user/limitTimeGetting/index.js

@@ -23,7 +23,9 @@ Component({
         startDate: '2018-12-12 12:12:13',
         endDate: '2019-01-08 08:23:45',
         address: '新都区斑竹园镇海底搂火锅店',
-        distance: '12km'
+        distance: '12km',
+        url: '',
+        navi: '/views/base/navi/index?city=大连市&cityd=大连市&address=辽宁省大连市沙河口区',
       }
     }
   },

+ 6 - 6
src/components/user/limitTimeGetting/index.wxml

@@ -1,6 +1,6 @@
 <!--components/user/limitTimeGetting/index.wxml-->
-<view class='limitTimeGetting flex border-bottom'>
-  <image lazy-load='true' src='{{info.pic}}' mode='widthFix'></image>
+<navigator url='{{info.url}}' class='limitTimeGetting flex border-bottom'>
+  <image lazy-load='true' src='{{info.pic}}'></image>
   <view class='info flex_one'>
     <view class='info-header flex flex_ac'>
       <text class='header-badge font12 tc'>{{info.type}}</text>
@@ -17,10 +17,10 @@
         <count black="true" startDate="{{info.startDate}}" bindchange="getCount" endDate="{{info.endDate}}"></count>
       </view>
     </view>
-    <view class='info-address clearfix'>
-      <image class='fl' src='/icons/base/weizhi@3x.png' mode='widthFix'></image>
+    <navigator url='{{info.navi}}' class='info-address clearfix'>
+      <image class='fl' src='/icons/base/weizhi@3x.png'></image>
       <text class='fl font12'>{{info.address}}</text>
       <text class='fr font12'>{{info.distance}}</text>
-    </view>
+    </navigator>
   </view>
-</view>
+</navigator>

+ 2 - 0
src/components/user/limitTimeGetting/index.wxss

@@ -8,6 +8,7 @@
 }
 .limitTimeGetting image{
   width: 150rpx;
+  height: 150rpx;
   flex-shrink: 0
 }
  .info{
@@ -56,6 +57,7 @@
 .info-address image{
   margin-top: 6rpx;
   width: 20rpx;
+  height: 24rpx;
   margin-right: 12rpx
 }
 .info-address text{

+ 1 - 1
src/components/user/popularShopList/index.wxml

@@ -1,7 +1,7 @@
 <!--components/user/popularShopList/index.wxml-->
 <navigator url='{{url}}' class='popularShopList rat'>
   <image lazy-load='true' src='{{icon}}' mode='widthFix' class='bg'></image>
-  <image lazy-load='true' src='/images/user/icon_bangdan@3x.png' class='bang' mode='widthFix'></image>
+  <image lazy-load='true' src='/images/user/icon_bangdan@3x.png' class='bang'></image>
   <view class='go font12 flex flex_ac flex_ct'>
     <text>查看GO</text>
     <text class='iconfont arrow-right'></text>

+ 3 - 1
src/components/user/popularShopList/index.wxss

@@ -7,10 +7,12 @@
   overflow: hidden
 }
 .popularShopList .bg{
-  width: 100%
+  width: 335rpx;
+  height: 220rpx
 }
 .popularShopList .bang{
   width: 22rpx;
+  height: 22rpx;
   position: absolute;
   top: 54rpx;
   left: 130rpx;

+ 2 - 2
src/components/user/recommendShop/index.wxml

@@ -1,6 +1,6 @@
 <!--components/user/recommendShop/index.wxml-->
 <view class='limitTimeGetting flex border-bottom'>
-  <image lazy-load='true' src='{{info.pic}}' mode='widthFix'></image>
+  <image lazy-load='true' src='{{info.pic}}'></image>
   <view class='info flex_one'>
     <view class='info-header flex flex_ac flex_sb'>
       <text class='font16'>{{info.title}}</text>
@@ -13,7 +13,7 @@
     <text class='info-count bc font14'>{{info.activity}}</text>
     <view class='getSale flex flex_ac font13'>抢优惠 <text class='iconfont arrow-right'></text></view>
     <view class='info-address clearfix'>
-      <image lazy-load='true' class='fl' src='/icons/base/weizhi@3x.png' mode='widthFix'></image>
+      <image lazy-load='true' class='fl' src='/icons/base/weizhi@3x.png'></image>
       <text class='fl font12'>{{info.address}}</text>
       <text class='fr font12'>{{info.distance}}</text>
     </view>

+ 2 - 0
src/components/user/recommendShop/index.wxss

@@ -8,6 +8,7 @@
 }
 .limitTimeGetting image{
   width: 150rpx;
+  height: 150rpx;
   flex-shrink: 0
 }
  .info{
@@ -41,6 +42,7 @@
 .info-address image{
   margin-top: 6rpx;
   width: 20rpx;
+  height: 24rpx;
   margin-right: 12rpx
 }
 .info-address text{

+ 16 - 1
src/components/user/screeningConditions/index.js

@@ -16,7 +16,7 @@ Component({
    * 组件的初始数据
    */
   data: {
-    active: 0,
+    active: 'null',
     typeActive0: 1,
     typeActive1: 0,
     activeSort: 'null',
@@ -31,11 +31,26 @@ Component({
 
     sortActive: 0,
     sortList: ['智能推荐', '最多分享','销量最高','收藏最多','佣金最高'],
+    lists: ['团购', '满减', '单品', '代金券','免单','满送'],
+    activeOpt: 0
   },
   /**
    * 组件的方法列表
    */
   methods: {
+    finish(){
+      this.setData({
+        activeSort: 'null'
+      })
+    },
+    getItem(e) {
+      // console.log(e.currentTarget.dataset.index)
+      this.setData({
+        activeOpt: e.currentTarget.dataset.index
+      })
+      const data = this.data.lists[this.data.activeOpt]
+      console.log(data)
+    },
     getIndex(e){
       const index = e.currentTarget.dataset.index
       if(!this.last){

+ 20 - 10
src/components/user/screeningConditions/index.wxml

@@ -31,9 +31,9 @@
 <!--距离-->
 <mask wx:if="{{activeSort==1}}" top="31">
   <view class='clearfix bw' style='padding:28rpx 47rpx;border-bottom:1px solid #d7d7d7'>
-    <image style='width:34rpx' class='fl' src='/icons/base/icon_dingwei@3x.png' mode='widthFix'></image>
+    <image style='width:34rpx;height:43rpx' class='fl' src='/icons/base/icon_dingwei@3x.png'></image>
     <text class='fl' style='color:#4A4A4A;margin-left:6rpx'>{{city}}</text>
-    <image style='width:26rpx;margin-top:4rpx' class='fr' src='/icons/base/icon_qiehuan@3x.png' mode='widthFix'></image>
+    <image style='width:26rpx;height:24rpx;margin-top:4rpx' class='fr' src='/icons/base/icon_qiehuan@3x.png'></image>
     <picker style='color:#666666;margin-right:6rpx' class='fr' mode="region" bindchange="getCity">切换城市</picker>
   </view>
   <view class='bw sort-type sort-type1 flex flex-ac'>
@@ -58,13 +58,23 @@
 </mask>
 <!--筛选-->
 <mask wx:if="{{activeSort==3}}" top="31">
-  <view class='bw sort-type sort-type2 flex flex-ac'>
-     限时特惠 <switch color='#F35D60' bindchange="switch2Change" />
-  </view>
-  <view class='bw sort-type sort-type2 flex flex-ac'>
-     限量特惠 <switch color='#F35D60' bindchange="switch2Change" />
-  </view>
-  <view class='bw sort-type sort-type2 flex flex-ac'>
-     开业特惠 <switch color='#F35D60' bindchange="switch2Change" />
+  <view class='bw'>
+      <view class='sortBy bw flex flex_ac flex_sb'>
+      限时特惠 <switch-button color='#F35D60' bindchange="switch1Change" ></switch-button>
+    </view>
+    <view class='sortBy bw flex flex_ac flex_sb'>
+      限量特惠 <switch-button color='#F35D60' bindchange="switch2Change" ></switch-button>
+    </view>
+    <view class='sortBy bw flex flex_ac flex_sb'>
+      开业特惠 <switch-button color='#F35D60' bindchange="switch3Change" ></switch-button>
+    </view>
+    <text class='bc bw more-opt font12'>更多选项</text>
+    <view class='bw history-list clearfix flex flex_wrap'>
+      <text wx:for="{{lists}}" wx:key="index" bindtap='getItem' data-index='{{index}}' class='tc history-list-item fr {{index==activeOpt?"active":""}}'>{{item}}</text>
+    </view>
+    <view class='btn-group flex bw'>
+      <view class='flex_one tc font15'>重置</view>
+      <view class='flex_one tc font15' bindtap='finish'>完成</view>
+    </view>
   </view>
 </mask>

+ 48 - 0
src/components/user/screeningConditions/index.wxss

@@ -28,6 +28,7 @@
   position: relative;
   padding: 30rpx 0;
   color: #666666;
+  width: 100%;
 }
 .sort-type text::before{
   content: '';
@@ -64,4 +65,51 @@
 .sort-type2{
   height: 512rpx;
   padding-top: 30rpx
+}
+.sortBy{
+  padding: 0 30rpx;
+  padding-bottom: 52rpx;
+  color: #666666
+}
+.sortBy:nth-child(1){
+  padding-top: 52rpx
+}
+.more-opt{
+  color: #9B9B9B;
+  padding: 30rpx 0;
+  margin: 0 30rpx;
+  border-top: 1px solid #EEEEEE
+}
+.history-list{
+  padding-left: 30rpx;
+  padding-right: 30rpx;
+}
+.history-list-item{
+  box-sizing: border-box;
+  margin-bottom: 30rpx;
+  width: 160rpx;
+  line-height: 60rpx;
+  border-radius: 32rpx;
+  border: 1px solid #d7d7d7;
+  color: #999999;
+  margin-right: 16rpx;
+  background: #ffffff
+}
+.history-list-item:nth-child(4n){
+  margin-right: 0
+}
+.history-list-item.active{
+  color: #F35D60;
+  border-color: #F35D60
+}
+.btn-group{
+  margin-top: 50rpx;
+  border-top: 1px solid #EEEEEE;
+}
+.btn-group view{
+  padding: 30rpx
+}
+.btn-group view:nth-last-child(1){
+  color: #F35D60;
+  border-left: 1px solid #eee
 }

+ 16 - 2
src/components/user/ticketList/index.js

@@ -14,6 +14,7 @@ Component({
       type: Object,
       value: {
         pic: '/images/user/limit-time.jpg',
+        mark: '/icons/user/tickets/limit@3x.png',
         type: '美食-火锅',
         price: '¥345',
         oldprice: '¥450',
@@ -35,6 +36,7 @@ Component({
         current: 140,
         //0,1,2,3,4分别对应代金券、单品、满减、满送、团购(具体按照实际字段)
         status: 0,
+        navi: '/views/base/navi/index?city=大连市&cityd=大连市&address=辽宁省大连市沙河口区'
       }
     },
     status: String,
@@ -44,7 +46,8 @@ Component({
     color: String,
     borderWidth: Number,
     total: Number,
-    current: Number
+    current: Number,
+    type: String
   },
   ready() {
     this.setData({
@@ -55,12 +58,23 @@ Component({
    * 组件的初始数据
    */
   data: {
-
+    day: 0
   },
   /**
    * 组件的方法列表
    */
   methods: {
+    getCount(e) {
+      // console.log(e.detail)
+      if (!this.day) {
+        this.day = e.detail.day
+      }
+      if (this.day - e.detail.day != 0) {
+        this.setData({
+          day: e.detail.day
+        })
+      }
+    },
     buy() {
       wx.navigateTo({
         url: '',

+ 2 - 1
src/components/user/ticketList/index.json

@@ -1,6 +1,7 @@
 {
   "component": true,
   "usingComponents": {
-    "progress-line": "/components/base/progressLine/index"
+    "progress-line": "/components/base/progressLine/index",
+    "count": "/components/base/count/index"
   }
 }

+ 21 - 8
src/components/user/ticketList/index.wxml

@@ -1,13 +1,16 @@
 <!--components/user/ticketList/index.wxml-->
 <wxs module="filters" src="../../../filters/user/index.wxs" />
 <view class='ticketList rat bw'>
-  <image lazy-load='true' class='tag' mode='widthFix' src='{{filters.ticketSrc(info.status)}}'></image>
+  <image lazy-load='true' class='tag' src='{{filters.ticketSrc(info.status)}}'></image>
   <view class='flex flex_sb' style='margin-bottom:30rpx'>
-    <text class='font16' style='color:#333'>{{info.title}}</text>
+    <view class='flex flex_ac'>
+      <text class='font16' style='color:#333;margin-right:6rpx'>{{info.title}}</text>
+      <image lazy-load='true' src='{{info.mark}}' style='width:75rpx;height:52rpx'></image>
+    </view>
     <text class='font12' style='color:#4A4A4A'>{{info.type}}</text>
   </view>
   <view class='info flex_one flex'>
-    <image lazy-load='true' src='{{info.pic}}' mode='widthFix'></image>
+    <image lazy-load='true' src='{{info.pic}}' style='width:150rpx;height:150rpx'></image>
     <view class='flex_one' style='padding-left:20rpx'>
       <view class='info-price font14'>到店
         <text class='font14'>{{info.price}}</text>
@@ -16,14 +19,24 @@
       <view class='info-count flex flex_ac flex_sb'>
         <text class='sale font12 tc'>售{{info.saleprice}} 赚{{info.earnprice}}</text>
       </view>
-      <view class='info-address clearfix'>
-        <image lazy-load='true' class='fl' src='/icons/base/weizhi@3x.png' mode='widthFix'></image>
+      <navigator url='{{info.navi}}' class='info-address clearfix'>
+        <image lazy-load='true' class='fl' src='/icons/base/weizhi@3x.png' style='wdith:20rpx;height:24rpx'></image>
         <text class='fl font12'>{{info.address}}</text>
         <text class='fr font12'>{{info.distance}}</text>
-      </view>
-      <view class='flex flex_sb'>
+      </navigator>
+      <view hidden="{{type!='ticket'&&type!='limit'}}" class='flex flex_sb'>
         <progress-line percent="{{info.current/info.total*100}}"></progress-line>
-        <text style='color:#34495E' class='font12'>仅剩 {{info.current}}/{{info.total}}张</text>
+        <!--若从首页-超值好券入口进入,则显示“仅剩 xx 张”;
+         若从首页-限时抢购入口进入,则显示“距结束 倒计时” 其他情况:
+          1. 若该优惠券限时,则显示倒计时; 
+          2. 若该优惠券限量,则显示仅剩; 
+          3. 若两者皆有,则显示进度条百分比更高的那个; 
+          4. 若两者皆无,则不显示进度条区域-->
+        <text wx:if="{{type=='ticket'}}" style='color:#34495E' class='font12'>仅剩 {{info.current}}/{{info.total}}张</text>
+        <view wx:if="{{type=='limit'}}" class='flex flex_ac flex_sb'>
+          <text class='day font12'>距结束{{day}}天</text>
+          <count black="true" startDate="{{info.startDate}}" bindchange="getCount" endDate="{{info.endDate}}"></count>
+        </view>
       </view>
     </view>
   </view>

+ 4 - 2
src/components/user/ticketList/index.wxss

@@ -11,14 +11,16 @@
   width: 150rpx;
   flex-shrink: 0
 }
-.ticketList:nth-child(1){
-  margin-top: 30rpx
+.info .day{
+  color: #34495e;
+  margin-right: 8rpx
 }
 .ticketList .tag{
   position: absolute;
   top: 0;
   left: 0;
   width: 112rpx;
+  height: 40rpx
 }
 .info-count{
   margin-top: 15rpx;

+ 5 - 5
src/components/user/valueTicket/index.wxml

@@ -1,14 +1,14 @@
 <!--components/user/valueTicket/index.wxml-->
 <wxs module="filters" src="../../../filters/user/index.wxs" />
-<view class='valueTicket rat'>
-  <image lazy-load='true' class='bg' mode='widthFix' src='/images/user/bg_haoquan@3x.png'></image>
-  <image lazy-load='true' class='tag' mode='widthFix' src='{{filters.ticketSrc(info.status)}}'></image>
+<navigator url='{{info.url}}' class='valueTicket rat'>
+  <image lazy-load='true' class='bg' src='/images/user/bg_haoquan@3x.png'></image>
+  <image lazy-load='true' class='tag' src='{{filters.ticketSrc(info.status)}}'></image>
   <progress-circle class="progress" total="{{info.total}}" current="{{info.current}}"></progress-circle>
   <text class='buy font12 tc' bindtap='buy'>去抢购</text>
   <view class='info'>
     <text class='title font14 bc'>{{info.title}}</text>
     <view class='info-content flex'>
-      <image lazy-load='true' mode='widthFix' src='{{info.pic}}'></image>
+      <image lazy-load='true' src='{{info.pic}}'></image>
       <view class='price-content flex_one'>
         <text class='font12 bc brown'>{{info.buy}}</text>
         <text class='font12 bc brown'>{{info.shop}}</text>
@@ -16,4 +16,4 @@
       </view>
     </view>
   </view>
-</view>
+</navigator>

+ 4 - 1
src/components/user/valueTicket/index.wxss

@@ -18,6 +18,7 @@
 }
 .valueTicket .info-content image{
   width: 110rpx;
+  height: 100rpx;
   border-radius: 4rpx;
   margin-right: 18rpx
 }
@@ -39,13 +40,15 @@
   position: absolute;
   top: 0;
   left: 0;
-  width: 100%
+  width: 590rpx;
+  height: 240rpx
 }
 .valueTicket .tag{
   position: absolute;
   top: 0;
   left: 0;
   width: 100rpx;
+  height: 36rpx;
   z-index: 2;
 }
 .valueTicket .progress{

+ 3 - 0
src/styles/base/index.wxss

@@ -57,6 +57,9 @@ page{
 .font14{
   font-size: 28rpx
 }
+.font15{
+  font-size: 30rpx
+}
 .font16{
   font-size: 32rpx
 }

+ 10 - 10
src/utils/isLogin.js

@@ -17,19 +17,19 @@ export const isLogin = function (res) {
     wx.login({
       success: res => {
         // 发送 res.code 到后台换取 openId, sessionKey, unionId
-        login({
-          code: res.code,
-          userInfo: userInfo
-        }).then(res => {
-          console.log(res)
-          wx.setStorageSync('_id', res.data._id)
+        // login({
+        //   code: res.code,
+        //   userInfo: userInfo
+        // }).then(res => {
+          // console.log(res)
+          // wx.setStorageSync('_id', res.data._id)
           wx.hideLoading()
           // msg.confirm(res.data.errMsg, () => {
-          //   wx.navigateTo({
-          //     url: '/views/user/home/index',
-          //   })
+            wx.switchTab({
+              url: '/views/base/home/index',
+            })
           // })
-        })
+        // })
       }
     })
   }

+ 4 - 3
src/views/base/home/index.wxml

@@ -14,15 +14,16 @@
             <menu-item src="/icons/user/home/icon_yule@3x.png" title="娱乐"></menu-item>
 
             <menu-item src="/icons/user/home/icon_yule@3x.png" title="娱乐"></menu-item>
-
+            <menu-item src="/icons/user/home/icon_yule@3x.png" title="娱乐"></menu-item>
+            
         </scroll-view>
       <home-notify></home-notify>
-      <home-list-container title="超值好券">
+      <home-list-container title="超值好券" url="/views/user/tickets/index?from=ticket">
         <scroll-view class='scroll-view' scroll-x scroll-with-animation enable-back-to-top>
           <value-ticket status="{{index}}" wx:for="01234" wx:key="index"></value-ticket>
         </scroll-view>
       </home-list-container>
-      <home-list-container title="限时抢购">
+      <home-list-container title="限时抢购" url="/views/user/tickets/index?from=limit">
         <scroll-view scroll-y scroll-with-animation enable-back-to-top>
           <limitTime-getting class='scroll-view-item' wx:for="12345" wx:key="index"></limitTime-getting>
         </scroll-view>

+ 1 - 1
src/views/base/home/index.wxss

@@ -1,6 +1,6 @@
 /* src/views/base/home/index.wxss */
 .home-top{
-  padding: 30rpx 0 30rpx 44rpx
+  padding: 30rpx 0 30rpx 24rpx
 }
 .area-unopen{
   padding-top: 72px

+ 4 - 2
src/views/user/tickets/index.js

@@ -6,16 +6,18 @@ Page({
   data: {
 
   },
-
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
     this.setData({
+      type: options.from,
       city: options.city ? options.city : '四川省成都市'
     })
+    wx.setNavigationBarTitle({
+      title: options.from=='limit'?'限时抢购':'超值好券',
+    })
   },
-
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 6 - 6
src/views/user/tickets/index.wxml

@@ -1,11 +1,11 @@
 <!--src/views/user/tickets/index.wxml-->
 <page title="超值好券">
   <screening-conditions city="{{city}}"></screening-conditions>
-  <scroll-view scroll-x scroll-with-animation enable-back-to-top>
-    <ticket-list status="0"></ticket-list>
-    <ticket-list status="1"></ticket-list>
-    <ticket-list status="2"></ticket-list>
-    <ticket-list status="3"></ticket-list>
-    <ticket-list status="4"></ticket-list>
+  <scroll-view style='padding-bottom:30rpx;padding-top:30rpx' scroll-x scroll-with-animation enable-back-to-top>
+    <ticket-list status="0" type="{{type}}"></ticket-list>
+    <ticket-list status="1" type="{{type}}"></ticket-list>
+    <ticket-list status="2" type="{{type}}"></ticket-list>
+    <ticket-list status="3" type="{{type}}"></ticket-list>
+    <ticket-list status="4" type="{{type}}"></ticket-list>
   </scroll-view>
 </page>