k.zhang 4 years ago
parent
commit
b55d8543c4

File diff suppressed because it is too large
+ 6 - 0
lib/weui.wxss


+ 18 - 5
pages/details/details.wxml

@@ -1,10 +1,13 @@
 <!--pages/details/details.wxml-->
-<scroll-view class="scroll-container" wx:for="{{goodsDetails}}" wx:key="msg" scroll-into-view="{{toView}}" scroll-y="true" scroll-with-animation="true" bindscroll="bindscroll">
-    <view class="swiper-container" id="swiper-container">
+<scroll-view class="scroll-view_H" wx:for="{{goodsDetails}}" wx:key="msg" scroll-into-view="{{toView}}" scroll-y="true" scroll-with-animation="true" bindscroll="bindscroll">
+    <view class="banner" id="swiper-container">
      
       <swiper class="swiper_box" indicator-dots="true" indicator-active-color="#fff"  circular="true">
         <swiper-item  wx:for="{{item.goods_gallery_urls}}" wx:key="imgs" >
-          <image src=" {{item}}" class="slide-image" mode="aspectFill" lazy-load="false" />
+         <view class="imagesize">
+          <image src=" {{item}}" class="in-image" mode="aspectFill" lazy-load="false" />
+         </view>
+          
         </swiper-item>
       </swiper>
     </view>
@@ -40,11 +43,21 @@
     </view>
   </view>
 
-  <view class="label-title"> 
+  <view> 
         <view class="goodsDetail">商品详情</view>
         <view class="goodsDesc">{{item.goods_desc}}</view>
-        <image src="{{item.goods_image_url}}" class="slide-image" mode="aspectFill" lazy-load="false" />
+        
   </view>
+  <!-- <view class='imagesize'>
+  <image src="{{item.goods_image_url}}" class='in-image' ode="aspectFill"  >
+  </image>
+</view> -->
+
+<view class='imagesize' wx:for="{{item.goods_gallery_urls}}" wx:key="imgs"  >
+  <image src="{{item}}" class='in-image' ode="aspectFit"  >
+  </image>
+</view>
+  <!-- <view><image src="{{item.goods_image_url}}" class="slide-image" mode="aspectFill" lazy-load="false" /></view> -->
    <!-- <view class="goodsDetail">商品推荐</view> -->
 
   </scroll-view> 

+ 32 - 2
pages/details/details.wxss

@@ -1,4 +1,5 @@
 /* pages/details/details.wxss */
+@import "../../lib/weui.wxss";
 .container {
   display: flex;
   flex-direction: column;
@@ -82,6 +83,35 @@
 
 
 .slide-image{
+  
+
+  display: flex;
+
+ flex-direction: row;
+
+ justify-content: center;
+
+ align-items: center;
+}
+
+
+.imagesize{
+ display:flex;                   
+ justify-content: center;        
+}
+.imagesize image { 
+  
+  
+  }
+
+.scroll-view_H{
   display: flex;
-justify-content: center;
-}
+  white-space: nowrap;
+  width:700rpx;
+  height: auto;
+  margin:0 auto;
+  }
+
+/* .banner{
+  height: 100rpx;
+} */

BIN
pages/image/dd.png


BIN
pages/image/dd1 (2).png


BIN
pages/image/jd.png


BIN
pages/image/tm.png


+ 2 - 2
pages/search/search.wxml

@@ -10,14 +10,14 @@
 </l-card>
 
 
-<l-card type="primary" full l-class="card" l-img-class="right-card" image-mode="aspectFit" image="https://img.pddpic.com/mms-material-img/2021-02-23/7ba1ee16-fb91-4785-98ab-bda3afd6002f.png.a.jpeg"
+<l-card type="primary" full l-class="card" l-img-class="right-card" image-mode="aspectFit" image="https://cdn.3n6.cn/yun.share.tour/2021-05-27/2029259/1622099734452029086.jpg"
   title="做一个热爱生活的人!">
   <view class="content">
     大雄要死掉了,他对妻子说:我死之后你找一个男人我就在地下打一一个滚。说完就咽气了。某天...
   </view>
 </l-card>
 
-<l-card type="primary" full l-class="card" l-img-class="right-card" image-mode="" image="https://img.pddpic.com/mms-material-img/2021-02-23/7ba1ee16-fb91-4785-98ab-bda3afd6002f.png.a.jpeg"
+<l-card type="primary" full l-class="card" l-img-class="right-card" image-mode="" image="https://cdn.3n6.cn/yun.share.tour/2021-05-27/2029259/1622099734452029086.jpg"
   title="做一个热爱生活的人!">
   <view class="content">
     大雄要死掉了,他对妻子说:我死之后你找一个男人我就在地下打一一个滚。说完就咽气了。某天...

+ 171 - 54
pages/shouye/shouye.js

@@ -70,33 +70,38 @@ Page({
   totalCount:0,
   listId:"",
   show:true,
-  lType:"loading"
+  lType:"loading",
+  activity_tags:"",
+  pid:"9112489_209622235",
+  keyword:""
   },
 
   _asyncData() {
     this.setData({
-      scrollAbleTabs: [{
-        tab: '精选',
-        key: 'treasure'
+      scrollAbleTabs: [
+        {
+          tab: '精选',
+          key: '0'
+        },
+        {
+        tab: '秒杀',
+        key: '4'
       }, {
-        tab: '居家生活',
-        key: 'life'
+        tab: '百亿补贴',
+        key: '7'
       }, {
-        tab: '美食厨房',
-        key: 'food'
+        tab: '千万补贴',
+        key: '10851'
       }, {
-        tab: '服饰珠宝',
-        key: 'cloth'
-      }, {
-        tab: '美妆洗护',
-        key: 'cosmetics'
+        tab: '品牌',
+        key: '31'
       },{
-        tab:'家用电器',
-        key:'one'
+        tab:'官方爆品',
+        key:'10564'
       },
       {
-        tab:'运动女装',
-        key:'sport'
+        tab:'大牌',
+        key:'24'
       }],
     });
   },
@@ -106,45 +111,158 @@ Page({
    */
   onLoad: function (options) {
     // this._asyncData
-    setTimeout(this._asyncData, 0);
-    //获取数据
-   var  that = this; 
-   that.page = 1
-   that.pageSize = 18
-  wx.request( { 
-   url: "http://49.234.19.130:8081/v1/pdd/ddk/search", 
-   //url: "http://127.0.0.1:8081/v1/pdd/ddk/search", 
-   header: { 
-    "Content-Type": "application/json"
-   }, 
-   method: "POST",
-   //data: { cityname: "上海", key: "1430ec127e097e1113259c5e1be1ba70" }, 
-   data:  { page: that.page.toString(), page_size: that.pageSize.toString() }, 
-   complete: function( res ) { 
-    wx.hideLoading();
-    console.log(res)
-    that.totalCount = res.data.data.goods_search_response.total_count
-    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]);
-    }
+    var  that = this; 
+    that.page = 1
+    that.pageSize = 18
+        
+    wx.request( { 
+      url: "http://127.0.0.1:8081/v1/set", 
+      header: { 
+       "Content-Type": "application/json"
+      }, 
+      method: "POST",
+      data:  { version: "1.0.1" }, 
+      complete: function( res ) { 
+       console.log(res)
+       if( res == null || res.data == null ) { 
+        console.error( '网络请求失败' ); 
+        return; 
+       } 
+       if (res.data.data.type == "true"){
+          wx.navigateTo({
+            url: '../search/search'
+          })
+       }else{
+       
+        //获取数据
+      setTimeout(that._asyncData, 0);
+      wx.request( { 
+       url: "http://49.234.19.130:8081/v1/pdd/ddk/search", 
+       header: { 
+        "Content-Type": "application/json"
+       }, 
+       method: "POST",
+       data:  { page: that.page.toString(), page_size: that.pageSize.toString(),with_coupon:"true" }, 
+       complete: function( res ) { 
+        wx.hideLoading();
+        console.log(res)
+        that.totalCount = res.data.data.goods_search_response.total_count
+        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,
+      })
     
-   that.setData({
-    goodsList: that.data.goodsList,
-  })
+        console.log(res.data.data.goods_search_response)
+        if( res == null || res.data == null ) { 
+         console.error( '网络请求失败' ); 
+         return; 
+        } 
+       } 
+      }) 
+       }
 
-    console.log(res.data.data.goods_search_response)
-    if( res == null || res.data == null ) { 
-     console.error( '网络请求失败' ); 
-     return; 
-    } 
-   } 
-  }) 
+
+      } 
+     }) 
+
+
+
+
+   
   },
 
-  search(){
-    wx.navigateTo({
-      url: '../search/search'
+  search:function(e){
+    var that = this
+    console.log(e)
+    that.keyword = e.detail.value
+    that.activity_tags = ""
+    that.pid = "9112489_209622235"
+    console.log(that.keyword)
+    console.log(that.pid)
+
+    that.page = 1
+    that.pageSize = 18
+     wx.request( { 
+     url: "http://49.234.19.130:8081/v1/pdd/ddk/search", 
+     header: { 
+       "Content-Type": "application/json"
+     }, 
+     method: "POST",
+     data:  { page: that.page.toString(), page_size: that.pageSize.toString(),with_coupon:"true", activity_tags: that.activity_tags, pid:that.pid, keyword: that.keyword}, 
+     complete: function( res ) { 
+       wx.hideLoading();
+       console.log(res)
+      
+       that.totalCount = res.data.data.goods_search_response.total_count
+       that.data.goodsList = res.data.data.goods_search_response.goods_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; 
+       } 
+     } 
+     })
+ 
+    
+    // wx.navigateTo({
+    //   url: '../search/search'
+    // })
+
+  },
+
+  keyData:function(e){
+    var that = this
+    that.keyword = ""
+    if (e.detail.activeKey == "0"){
+      that.activity_tags = ""
+    } else{
+      that.activity_tags = "["+e.detail.activeKey + "]"
+    }
+   
+    console.log(e)
+
+   that.page = 1
+   that.pageSize = 18
+    wx.request( { 
+    url: "http://49.234.19.130:8081/v1/pdd/ddk/search", 
+    header: { 
+      "Content-Type": "application/json"
+    }, 
+    method: "POST",
+    data:  { page: that.page.toString(), page_size: that.pageSize.toString(),with_coupon:"true", activity_tags: that.activity_tags}, 
+    complete: function( res ) { 
+      wx.hideLoading();
+      console.log(res)
+     
+      that.totalCount = res.data.data.goods_search_response.total_count
+      that.data.goodsList = res.data.data.goods_search_response.goods_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; 
+      } 
+    } 
     })
+
   },
 
   goodsCollection: function(e){
@@ -161,7 +279,6 @@ Page({
       header:{
         'Accept': 'application/json'
       },
-     
       success (res) {
         wx.hideLoading();
         for (var i = 0; i < res.data.goodsSearchInfo.goodsSearchResponse.goodsList.length; i++) {
@@ -224,7 +341,7 @@ Page({
     })
     return
    }
-
+   
    that.page +=1
   wx.request( { 
    url: "http://49.234.19.130:8081/v1/pdd/ddk/search", 
@@ -234,7 +351,7 @@ Page({
    }, 
    method: "POST",
    //data: { cityname: "上海", key: "1430ec127e097e1113259c5e1be1ba70" }, 
-   data:  { page: that.page.toString(), page_size: that.pageSize.toString() }, 
+   data:  { page: that.page.toString(), page_size: that.pageSize.toString(),with_coupon:"true", activity_tags: that.activity_tags,keyword:that.keyword,pid:that.pid}, 
    complete: function( res ) { 
     wx.hideLoading();
     console.log(res)

+ 4 - 6
pages/shouye/shouye.wxml

@@ -1,8 +1,9 @@
 <!--pages/shouye.wxml-->
-<l-search-bar l-container-class="aa" bg-color="#e5e7df" placeholder="搜索" show-cancel="{{false}}" bind:linfocus="search"/>
+<!-- <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}}">
-  <l-tabpanel has-line="false" wx:for="{{scrollAbleTabs}}" tab="{{item.tab}}" key="{{item.key}}" slot="{{item.key}}" wx:key="key">
+<l-search-bar l-container-class="aa" bg-color="#e5e7df" placeholder="搜索" show-cancel="{{false}}" bind:linconfirm="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>
@@ -34,6 +35,3 @@
     我是有底线的~
   </view> -->
 </l-loadmore>
-
-  
-