k.zhang 4 gadi atpakaļ
vecāks
revīzija
5215e9e327

+ 3 - 2
app.json

@@ -1,5 +1,6 @@
 {
   "pages": [
+    "pages/boutique/outique",
     "pages/shouye/shouye",
     "pages/index/index",
     "pages/logs/logs",
@@ -10,7 +11,7 @@
   "window": {
     "backgroundTextStyle": "light",
     "navigationBarBackgroundColor": "#fff",
-    "navigationBarTitleText": "大优惠",
+  
     "navigationBarTextStyle": "black"
   },
   "tabBar": {
@@ -20,7 +21,7 @@
    "borderStyle": "black" ,
     "list": [
       {
-        "pagePath": "pages/shouye/shouye",
+        "pagePath": "pages/boutique/outique",
         "text": "首页"
       },
       {

+ 313 - 0
pages/boutique/outique.js

@@ -0,0 +1,313 @@
+// pages/boutique/outique.js
+const app = getApp()
+const link = app.globalData.url
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    offset:0,
+    limit:20,
+    channel_type:"4",
+    pid:"9112489_209622235",
+    totalCount:0,
+    goodsList:[],
+    cat_id:"20100"
+  },
+
+  _asyncData() {
+    this.setData({
+      scrollAbleTabs: [
+        {
+          tab: '精选',
+          key: '4'
+        },
+        {
+        tab: '今日热销',
+        key: '1'
+      }, {
+        tab: '高佣商品',
+        key: '6'
+      }, {
+        tab: '百货',
+        key: '20100'
+      }, {
+        tab: '母婴',
+        key: '20200'
+      },{
+        tab:'食品',
+        key:'20300'
+      },
+      {
+        tab:'女装',
+        key:'20400'
+      },
+      {
+        tab:'电器',
+        key:'20500'
+      },
+      {
+        tab:'鞋包',
+        key:'20600'
+      },{
+        tab:'内衣',
+        key:'20700'
+      },
+      {
+        tab:'美妆',
+        key:'20800'
+      },
+      {
+        tab:'男装',
+        key:'20900'
+      },
+      {
+        tab:'水果',
+        key:'21000'
+      },{
+        tab:'家纺',
+        key:'21100'
+      },{
+        tab:'文具',
+        key:'21200'
+      }
+      ,{
+        tab:'运动',
+        key:'21300'
+      },{
+        tab:'虚拟',
+        key:'21400'
+      },{
+        tab:'汽车',
+        key:'21500'
+      },{
+        tab:'家装',
+        key:'21600'
+      },{
+        tab:'家具',
+        key:'21700'
+      },{
+        tab:'医药',
+        key:'21800'
+      }
+    ],
+    });
+  },
+
+  //20100-百货,20200-母婴,20300-食品,20400-女装,20500-电器,20600-鞋包,20700-内衣,20800-美妆,20900-男装,21000-水果,21100-家纺,21200-文具,21300-运动,21400-虚拟,21500-汽车,21600-家装,21700-家具,21800-医药
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    var that = this
+    that.offset = 0
+    that.limit = 20
+    that.channel_type = "4"
+    that.pid = "9112489_209622235"
+    that.cat_id = ""
+    
+    wx.request( { 
+      url: link + "/v1/set", 
+      header: { 
+       "Content-Type": "application/json"
+      }, 
+      method: "POST",
+      data:  { version: "1.0.3" }, 
+      complete: function( res ) { 
+       console.log(res)
+       if( res == null || res.data == null ) { 
+        console.error( '网络请求失败' ); 
+        return; 
+       } 
+       if (res.data.data.type == "false"){
+          wx.redirectTo({
+            url: '../search/search'
+          })
+       }else{
+       
+        //获取数据
+      setTimeout(that._asyncData, 0);
+      wx.request( { 
+       url: link + "/v1/pdd/recommend/get", 
+       header: { 
+        "Content-Type": "application/json"
+       }, 
+       method: "POST",
+       data:  { offset: that.offset.toString(), limit: that.limit.toString(),channel_type:that.channel_type,pid:that.pid,cat_id:that.cat_id}, 
+       complete: function( res ) { 
+        wx.hideLoading();
+        if( res == null || res.data == null ) { 
+          console.error( '网络请求失败' ); 
+          return; 
+         } 
+        console.log(res)
+        that.totalCount = res.data.data.goods_basic_detail_response.total
+        that.data.goodsList = res.data.data.goods_basic_detail_response.list
+        // for (var i = 0; i < res.data.data.goods_basic_detail_response.list.length; i++) {
+        //   that.data.goodsList.push( res.data.data.goods_basic_detail_response.list[i]);
+        // }
+        
+       that.setData({
+        goodsList: that.data.goodsList,
+      })
+    
+  
+       } 
+      }) 
+       }
+
+
+      } 
+     }) 
+
+  },
+  search: function(options){
+    wx.navigateTo({
+      url: '../shouye/shouye'
+    })
+  },
+
+  keyData:function(e){
+    var that = this
+   
+    if (e.detail.activeKey == "4" || e.detail.activeKey == "1" || e.detail.activeKey == "6"){
+      that.channel_type = e.detail.activeKey
+      that.cat_id = ""
+    } else{
+      that.channel_type = "4"
+      that.cat_id = e.detail.activeKey
+    }
+   
+    console.log(e)
+
+    that.offset = 0
+    that.limit = 20
+    wx.request( { 
+    url: link + "/v1/pdd/recommend/get", 
+    header: { 
+      "Content-Type": "application/json"
+    }, 
+    method: "POST",
+    data:  { offset: that.offset.toString(), limit: that.limit.toString(),channel_type:that.channel_type,pid:that.pid,cat_id:that.cat_id}, 
+    complete: function( res ) { 
+      wx.hideLoading();
+      console.log(res)
+      that.totalCount = res.data.data.goods_basic_detail_response.total
+      that.data.goodsList = res.data.data.goods_basic_detail_response.list
+      // for (var i = 0; i < res.data.data.goods_search_response.goods_list.length; i++) {
+      //   that.data.goodsList.push( res.data.data.goods_search_response.goods_list[i]);
+      // }
+      
+    that.setData({
+      goodsList: that.data.goodsList,
+    })
+
+      console.log(res.data.data.goods_search_response)
+      if( res == null || res.data == null ) { 
+      console.error( '网络请求失败' ); 
+      return; 
+      } 
+    } 
+    })
+
+  },
+     
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+           //获取数据
+   var  that = this; 
+   if (that.totalCount <= that.offset + 20){  //提示页码到了
+    that.setData({
+      lType:"end"
+    })
+    return
+   }
+   
+   that.offset +=20
+  wx.request( { 
+   url: link + "/v1/pdd/recommend/get", 
+   header: { 
+    "Content-Type": "application/json"
+   }, 
+   method: "POST",
+   data:   { offset: that.offset.toString(), limit: that.limit.toString(),channel_type:that.channel_type,pid:that.pid,cat_id:that.cat_id}, 
+   complete: function( res ) { 
+    wx.hideLoading();
+    console.log(res)
+    that.totalCount = res.data.data.goods_basic_detail_response.total_count
+    for (var i = 0; i < res.data.data.goods_basic_detail_response.list.length; i++) {
+      that.data.goodsList.push( res.data.data.goods_basic_detail_response.list[i]);
+    }
+
+    console.log(res.data.data.goods_search_response)
+    if( res == null || res.data == null ) { 
+     console.error( '网络请求失败' ); 
+     return; 
+    } 
+    
+   that.setData({
+    goodsList: that.data.goodsList,
+  })
+
+   
+   } 
+  }) 
+  },
+
+  goodsDetail:function(e){
+    const goodsSign=e.currentTarget.dataset.sign;
+    const searchId=e.currentTarget.dataset.searchid;
+      
+      wx.navigateTo({
+       url: `/pages/details/details?goodsSign=${goodsSign}&searchId=${searchId}`,
+      // url: `/pages/goods-detail/index`,
+      })
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 20 - 0
pages/boutique/outique.json

@@ -0,0 +1,20 @@
+{
+  "usingComponents": {
+    "l-search-bar": "/dist/search-bar/index",
+    "l-icon":"/dist/icon/index",
+    "content-title": "/components/content-title/index",
+    "content-card": "/components/content-card/index",
+    "l-tabs": "/dist/tabs/index",
+    "l-combined-tabs": "/dist/combined-tabs/index",
+    "l-tabpanel": "/dist/tabpanel/index",
+    "l-button":"/dist/button/index",
+    "l-segment":"/dist/segment/index",
+    "l-segment-item":"/dist/segment-item/index",
+    "l-card":"/dist/card/index",
+    "l-tag":"/dist/tag/index",
+    "l-price":"/dist/price/index",
+    "l-notice":"/dist/notice-bar/index",
+    "l-loadmore": "/dist/loadmore/index"
+  },
+  "navigationBarTitleText": "首页"
+}

+ 36 - 0
pages/boutique/outique.wxml

@@ -0,0 +1,36 @@
+<!--pages/boutique/outique.wxml-->
+<l-search-bar l-container-class="aa" bg-color="#e5e7df" placeholder="搜索" show-cancel="{{false}}" bind:linfocus="search"/>
+
+<l-tabs l-class-header="l-class-header" l-class-active="l-class-active" has-line="false" placement="top" scrollable equal-width="{{false}}" bind:linchange="keyData">
+  <l-tabpanel has-line="false" wx:for="{{scrollAbleTabs}}" tab="{{item.tab}}" key="{{item.key}}" slot="{{item.key}}" wx:key="key" bind:linchange="keyData">
+    <!-- <view class="tab-content">{{item.tab}}</view> -->
+  </l-tabpanel>
+</l-tabs>
+<view wx:for="{{goodsList}}" wx:key="msg">
+  <l-card  type="primary" l-img-class="right-card" position="left" image="{{item.goods_image_url}}"
+  bindtap="goodsDetail"  data-sign="{{item.goods_sign}}" data-searchId="{{item.search_id}}"   full="true" >
+
+    <view class="super-long-test">
+      <image class="empty-icon" src="/pages/image/dd.png" ></image>
+      {{item.goods_name}}
+    </view>
+    <view class="containertag">
+      <l-tag plain="{{true}}" font-color="#d81e06" shape="circle" size="medium"  l-class="tag" class="describe" >{{item.coupon_discount/100}}元券</l-tag>
+      <l-tag plain="{{true}}" font-color="#d81e06" shape="circle" size="medium"  l-class="tag"  class="fanli">赚:{{(item.rebate)}}</l-tag>
+     
+    </view>
+    <view class="price-v">
+     <text class="price">劵后¥{{(item.min_group_price-item.coupon_discount)/100}}</text> <text class="yprice">原价{{item.min_group_price/100}}</text>  
+    </view>
+    <text class="contentcard">
+    销量:{{item.sales_tip}}
+   </text>
+      <text class="contentcard">店铺:{{item.mall_name}}</text>
+  </l-card>
+</view>
+
+<l-loadmore show="{{true}}" end-text="我是有底线的~" type="{{lType}}">
+  <!-- <view slot="content">
+    我是有底线的~
+  </view> -->
+</l-loadmore>

+ 236 - 0
pages/boutique/outique.wxss

@@ -0,0 +1,236 @@
+/* pages/boutique/outique.wxss */
+.content-name {
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular;
+  font-weight: 400;
+  color: rgba(69, 82, 107, 1);
+  line-height: 20px;
+  margin-left: 8px;
+}
+
+.icon-container{
+  display: flex;
+  flex-direction: row;
+  align-items: center
+}
+
+.city{
+  font-size: 28rpx;
+  color: #333;
+  margin-right: 10rpx;
+}
+
+.aa{
+  margin-top: 20rpx;
+}
+
+.bb{
+  width: 500rpx !important; 
+}
+
+
+.header{
+  position: fixed;
+  top: 0;
+  left: 0;
+}
+
+.content {
+  /* height: 400rpx; */
+  position: relative;
+}
+
+.tab-content {
+  min-height: 140rpx;
+  height: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  font-size: 28rpx;
+  color: rgba(140, 152, 174, 1);
+}
+
+.toggle-button {
+  position: absolute !important;
+  top: -80rpx;
+  right: 20rpx;
+  min-width: 72rpx !important;
+  padding: 0 !important;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  border-radius: 50% !important;
+  background: transparent !important;
+}
+
+.swipeable-header {
+  margin: 0 auto;
+  width: 327rpx !important;
+  border: 0 !important;
+}
+
+.swipeable-class-inactive {
+  border-width: 8rpx !important;
+}
+
+.swipeable-class-active {
+  font-weight: 900 !important;
+  font-size: 34rpx !important;
+  border-width: 6rpx !important;
+}
+
+.line-tabs {
+  background: rgba(90, 120, 158, 1) !important;
+}
+
+.tab-image {
+  width: 44rpx !important;
+  height: 44rpx !important;
+}
+
+.line-class {
+  width: 30rpx !important;
+}
+
+
+.card {
+  margin: 10rpx auto !important;
+}
+
+.right-card {
+  height: 250rpx !important;
+  width: 250rpx !important;
+  border-radius: 12rpx !important;
+}
+
+.card-dot {
+  width: 18rpx;
+  height: 18rpx;
+  border-radius: 50%;
+  border: 6rpx solid #3963bc;
+  margin-left: 26rpx;
+}
+
+.card-top {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  width: 750rpx;
+  height: 100rpx;
+}
+
+
+.contentcard-name {
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular;
+  font-weight: 400;
+  color: rgba(69, 82, 107, 1);
+  line-height: 20px;
+  margin-left: 8px;
+}
+
+.contentcard {
+  margin:5rpx 0rpx 0rpx 0rpx;   
+  color: #666;
+  font-size: 25rpx;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 5;
+}
+
+.avter-contentcard {
+  margin-top: 10rpx;
+  color: #333;
+  font-size: 26rpx;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 5;
+}
+
+
+.super-long-test{
+  display: -webkit-box;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ font-size: 30rpx;
+ overflow: hidden;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp:2;
+}
+
+
+.empty-icon{
+  width: 30rpx;
+  height: 30rpx;
+  background-color:rgb(252, 248, 248);
+}
+
+
+.containertag{
+  display: flex;
+  flex-direction: row;
+  align-items: flex-end;
+  flex-wrap: wrap;
+}
+
+.btn{
+  margin-bottom: 5rpx;
+}
+.describe{
+  color: #f4f4f5;
+    font-size: 28rpx;
+    
+}
+
+.fanli{
+  position: absolute;
+  right: 10rpx;
+  
+}
+
+.l-tag {
+  padding: 0 16rpx;
+ 
+  display: inline-flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: row;
+  color: #fff;
+  background-color: #3963bc;
+  margin-left: 15rpx;
+}
+.tag{
+  margin: 6rpx 15rpx 6rpx 0 !important;
+}
+.price-container{
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-left: 10rpx;
+}
+
+
+.price{
+  color:#d81e06;
+  font-size: 30rpx;
+ 
+ 
+  position: absolute;
+  
+}
+.yprice{
+  position: absolute;
+  right: 30rpx;
+  color: #999;
+  font-size: 25rpx;
+  text-decoration:line-through;
+
+  
+}
+.price-v{
+  margin:5rpx 0rpx 10rpx 0rpx;   
+}

+ 1 - 1
pages/details/details.wxml

@@ -20,7 +20,7 @@
     </view>
     <view class="goodsPrice">
       <text class="jprice">劵后价¥{{(item.min_group_price-item.coupon_discount)/100}}元</text>  
-      <l-button plain="{{true}}" type="error"  width="50" height="40" class="fanli"  >返利{{(item.promotion_rate/100)*0.5}}元</l-button>
+      <l-button plain="{{true}}" type="error"  width="50" height="40" class="fanli"  >返利{{item.rebate}}元</l-button>
     </view>
     <view class="goodsbtm">
       <text class="yprice">原价¥{{item.min_group_price/100}} </text>

+ 22 - 3
pages/search-details/earch-details.js

@@ -12,7 +12,26 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    console.log(options)
+    var that=this
+    const sr=options.sr
+    console.log(sr)
+    if (sr == 1){
+      that.setData({
+        tex:"非洲野猫的样子\n",
+        texx:" 初中一生物老师的佳作,讲非洲草原上的生态,全班无人听讲。\n他大怒:“你们都看我呀!你们不看我怎么知道非洲野猫长什么样子啊!”"
+      })
+    } else if (sr ==2){
+      that.setData({
+        tex:"拿一个柿饼来\n",
+        texx:"有个农妇,天清晨醒来,觉得饿,她想,皇后娘娘是怎么享福的呢? \n一定是一觉醒来就叫:“大姐,拿一个柿饼来吃吃。”"
+      })
+    } else if (sr == 3){
+      that.setData({
+        tex:"忘了一半\n",
+        texx:"一人死,奈何桥头喝孟婆汤,近半时突吻孟婆,婆羞且怒:戏弄老婆子作甚?\n死者:我临死前要吻一人,刚才喝汤偏忘了要吻谁。就你吧。"
+      })
+    }
   },
 
   /**
@@ -39,8 +58,8 @@ Page({
   /**
    * 生命周期函数--监听页面卸载
    */
-  onUnload: function () {
-
+  onUnload: function (options) {
+   
   },
 
   /**

+ 2 - 4
pages/search-details/earch-details.wxml

@@ -1,5 +1,3 @@
 <!--pages/search-details/earch-details.wxml-->
-<text>非洲野猫的样子
-初中一生物老师的佳作,讲非洲草原上的生态,全班无人听讲。
-
-他大怒:“你们都看我呀!你们不看我怎么知道非洲野猫长什么样子啊!”</text>
+<text>{{tex}}</text>
+<text>{{texx}}</text>

+ 16 - 2
pages/search/search.js

@@ -63,11 +63,25 @@ Page({
   goodsDetail:function(e){
    
       wx.navigateTo({
-       url: `/pages/search-details/earch-details`,
-      
+      url: `/pages/search-details/earch-details?sr=1`,
+    
       })
   },
 
+  goodsDetail2:function(e){
+   
+    wx.navigateTo({
+     url: `/pages/search-details/earch-details?sr=2`,
+     
+    })
+},
+goodsDetail3:function(e){
+   
+  wx.navigateTo({
+   url: `/pages/search-details/earch-details?sr=3`,
+   
+  })
+},
 
   /**
    * 页面上拉触底事件的处理函数

+ 4 - 4
pages/search/search.wxml

@@ -11,15 +11,15 @@
 
 
 <l-card type="primary" full l-class="card" l-img-class="right-card" image-mode="aspectFill" image="https://cdn.3n6.cn/yun.share.tour/2021-05-27/2029259/1622099734452029086.jpg"
-  title="非洲野猫的样子" bindtap="goodsDetail">
+  title="拿一个柿饼来" bindtap="goodsDetail2">
   <view class="content">
-    初中一生物老师的佳作,讲非洲草原上的生态,全班无人听讲。
+    有个农妇,天清晨醒来,觉得饿,她想,皇后娘娘是怎么享福的呢?”
   </view>
 </l-card>
 
 <l-card type="primary" full l-class="card" l-img-class="right-card" image-mode="aspectFill" image="https://cdn.3n6.cn/yun.share.tour/2021-05-27/2029259/1622099734452029086.jpg"
-  title="非洲野猫的样子" bindtap="goodsDetail">
+  title="忘了一半" bindtap="goodsDetail3">
   <view class="content">
-    初中一生物老师的佳作,讲非洲草原上的生态,全班无人听讲。
+    一人死,奈何桥头喝孟婆汤,近半时突吻孟婆,婆羞且怒:戏弄老婆子作甚?
   </view>
 </l-card>

+ 1 - 1
pages/shouye/shouye.js

@@ -182,7 +182,7 @@ Page({
     console.log(e)
     that.keyword = e.detail.value
     that.activity_tags = ""
-    that.pid = "9112489_212035116"
+    that.pid = "9112489_209622235"
     console.log(that.keyword)
     console.log(that.pid)
 

+ 1 - 1
pages/shouye/shouye.json

@@ -16,6 +16,6 @@
     "l-notice":"/dist/notice-bar/index",
     "l-loadmore": "/dist/loadmore/index"
   },
-  "navigationBarTitleText": "首页"
+  "navigationBarTitleText": "搜索"
 }
 

+ 1 - 1
pages/shouye/shouye.wxml

@@ -17,7 +17,7 @@
     </view>
     <view class="containertag">
       <l-tag plain="{{true}}" font-color="#d81e06" shape="circle" size="medium"  l-class="tag" class="describe" >{{item.coupon_discount/100}}元券</l-tag>
-      <l-tag plain="{{true}}" font-color="#d81e06" shape="circle" size="medium"  l-class="tag"  class="fanli">返利{{(item.promotion_rate/100)}}</l-tag>
+      <l-tag plain="{{true}}" font-color="#d81e06" shape="circle" size="medium"  l-class="tag"  class="fanli">返:{{item.rebate}}</l-tag>
      
     </view>
     <view class="price-v">