Browse Source

小程序:商品详情接口对接

panyong 2 years ago
parent
commit
3a59ecb909

BIN
htmldev/wxMini/image/common/comment.png


BIN
htmldev/wxMini/image/common/like.png


BIN
htmldev/wxMini/image/common/share.png


BIN
htmldev/wxMini/image/common/video-play-normal.png


BIN
htmldev/wxMini/image/common/video.png


+ 6 - 0
htmldev/wxMini/mixin/pages.js

@@ -75,6 +75,12 @@ module.exports = {
               pagenum: that.data.pagenum + 1
             }
 
+            // VR看菜园:轮播图只取前三个
+            if (that.data.listUrl === '/api/user/vr/list') {
+              temp['topSwiperData'] = _list.slice(0, 3)
+              temp['listData'] = _list.filter((item, index) => index > 2)
+            }
+
             if (isRefresh && this.data.hasOwnProperty('leftList')) {
               temp['leftList'] = []
               temp['rightList'] = []

+ 20 - 10
htmldev/wxMini/pages/VR/VR.js

@@ -1,17 +1,25 @@
+const pages = require('../../mixin/pages')
+
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    background: ['demo-text-1', 'demo-text-2', 'demo-text-3']
+    ...pages.data(),
+    listUrl: '/api/user/vr/list',
+    searchForm: {
+      key_words: ''
+    },
+    topSwiperData: []
   },
+  ...pages.methods,
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-
+    this.fetchOrderList()
   },
 
   /**
@@ -46,20 +54,22 @@ Page({
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh() {
-
+    if (this.data.freshing) {
+      return
+    }
+    this.setData({
+      freshing: true
+    })
+    this.bindCallBack()
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
   onReachBottom() {
-
+    this.fetchOrderList()
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
+  bindCallBack() {
+    this.refreshOrderList()
   }
 })

+ 7 - 2
htmldev/wxMini/pages/VR/VR.json

@@ -1,3 +1,8 @@
 {
-  "usingComponents": {}
-}
+  "usingComponents": {},
+  "navigationBarTitleText": "VR看菜园",
+  "backgroundColor": "#F6F6F6",
+  "backgroundTextStyle": "dark",
+  "enablePullDownRefresh": true,
+  "onReachBottomDistance": 50
+}

+ 0 - 2
htmldev/wxMini/pages/VR/VR.scss

@@ -31,7 +31,6 @@
     display: block;
     width: 100%;
     height: 100%;
-    background: pink;
   }
 
   .info {
@@ -112,7 +111,6 @@
       display: block;
       width: 100%;
       height: 100%;
-      background: pink;
     }
   }
 

+ 14 - 12
htmldev/wxMini/pages/VR/VR.wxml

@@ -2,12 +2,14 @@
   <view class="app_page-header-search">
     <view class="app_page-header-search-warp app_width-690">
       <label for="header-search">
-        <image src=""></image>
+        <image src="../../image/common/search@2x.png"></image>
       </label>
       <input
         placeholder-class="app_header-search-placeholder"
-        value=""
-        placeholder="搜索信息"></input>
+        value="{{searchForm.key_words}}"
+        placeholder="搜索信息"
+        data-formkey="key_words"
+        bind:input="handleKeyWords"></input>
     </view>
   </view>
   <view class="page-section">
@@ -15,15 +17,15 @@
       interval="{{2000}}"
       autoplay="{{false}}">
       <block
-        wx:for="{{background}}"
+        wx:for="{{topSwiperData}}"
         wx:key="*this">
         <swiper-item
           class="swiper-item-wrap">
           <view class="swiper-item {{item}}">
-            <image src=""></image>
+            <image src="{{item.vr_img_url}}"></image>
             <view class="info">
-              <view class="name">嵊州菜园</view>
-              <view class="address">浙江省嵊州菜园</view>
+              <view class="name">{{item.vr_name}}</view>
+              <view class="address">{{item.vr_introduce}}</view>
             </view>
           </view>
         </swiper-item>
@@ -34,14 +36,14 @@
   <view class="main">
     <view
       class="list"
-      wx:for="{{[1, 2, 3]}}"
-      wx:key="item">
+      wx:for="{{listData}}"
+      wx:key="id">
       <view class="photo-wrap">
-        <image src=""></image>
+        <image src="{{item.vr_img_url}}"></image>
       </view>
       <view class="info">
-        <view class="name">嵊州菜园</view>
-        <view class="address">浙江省嵊州菜园</view>
+        <view class="name">{{item.vr_name}}</view>
+        <view class="address">{{item.vr_introduce}}</view>
       </view>
     </view>
   </view>

+ 1 - 0
htmldev/wxMini/pages/business/business.json

@@ -3,6 +3,7 @@
     "van-loading": "@vant/weapp/loading/index",
     "business-item-normal": "../../components/business-item-normal"
   },
+  "navigationBarTitleText": "供应商",
   "backgroundColor": "#F6F6F6",
   "backgroundTextStyle": "dark",
   "enablePullDownRefresh": true,

+ 1 - 0
htmldev/wxMini/pages/businessDetail/businessDetail.json

@@ -6,6 +6,7 @@
     "business-detail-large": "../../components/business-detail-large",
     "goods-item-normal": "../../components/goods-item-normal"
   },
+  "navigationBarTitleText": "供应商详情",
   "backgroundColor": "#F6F6F6",
   "backgroundTextStyle": "dark",
   "enablePullDownRefresh": true,

+ 16 - 1
htmldev/wxMini/pages/businessHome/businessHome.scss

@@ -43,6 +43,9 @@
 }
 
 .dashboard {
+  position: relative;
+  left: 0;
+  top: 0;
   display: flex;
   flex-direction: column;
   align-items: center;
@@ -57,8 +60,20 @@
   background-size: 100% 100%;
   background-repeat: no-repeat;
 
+  .bg {
+    position: absolute;
+    left: 0;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    width: 100%;
+    height: 100%;
+  }
+
   .data,
   .btn {
+    position: relative;
+    z-index: 1;
     display: flex;
     flex-direction: column;
     align-items: center;
@@ -77,7 +92,7 @@
     color: rgba(37, 31, 57, 1);
   }
 
-  image {
+  .eyes {
     width: 40rpx;
     height: 40rpx;
   }

+ 4 - 2
htmldev/wxMini/pages/businessHome/businessHome.wxml

@@ -12,16 +12,18 @@
 
     <view
       class="dashboard"
-      style="background-image: url('../../image/businessHome/bg.png')"
       data-path="businessGoodsManage"
       data-tabvalue="1"
       bind:tap="jump">
+      <image
+        class="bg"
+        src="../../image/businessHome/bg.png"></image>
       <view class="data">
         <view class="label">已发布产品</view>
         <view class="value">{{shopInfo.product_total}}</view>
       </view>
       <view class="btn">
-        <image src="../../image/businessHome/eyes.png"></image>
+        <image class="eyes" src="../../image/businessHome/eyes.png"></image>
         <text class="check">查看详情</text>
       </view>
     </view>

+ 1 - 0
htmldev/wxMini/pages/collection/collection.json

@@ -5,6 +5,7 @@
     "business-item-normal": "../../components/business-item-normal",
     "van-loading": "@vant/weapp/loading/index"
   },
+  "navigationBarTitleText": "收藏",
   "backgroundColor": "#F6F6F6",
   "backgroundTextStyle": "dark",
   "enablePullDownRefresh": true,

+ 2 - 1
htmldev/wxMini/pages/goodsDetail/goodsDetail.json

@@ -2,5 +2,6 @@
   "usingComponents": {
     "customer-tab": "../../components/customer-tab/index",
     "business-detail-large": "../../components/business-detail-large"
-  }
+  },
+  "navigationBarTitleText": "预售商品"
 }

+ 1 - 0
htmldev/wxMini/pages/guide/guide.json

@@ -3,6 +3,7 @@
     "van-loading": "@vant/weapp/loading/index",
     "goods-item-large": "../../components/goods-item-large"
   },
+  "navigationBarTitleText": "选购指南",
   "backgroundColor": "#F6F6F6",
   "backgroundTextStyle": "dark",
   "enablePullDownRefresh": true,

+ 4 - 6
htmldev/wxMini/pages/media/child/video-item-normal/index.scss

@@ -18,10 +18,9 @@
     left: 50%;
     top: 50%;
     z-index: 1;
-    width: 53rpx;
-    height: 53rpx;
+    width: 54rpx;
+    height: 54rpx;
     transform: translate(-50%, -50%);
-    background: pink;
   }
 
   .pv {
@@ -64,9 +63,8 @@
   .icon-praise,
   .icon-message,
   .icon-share {
-    width: 27rpx;
-    height: 27rpx;
-    background: pink;
+    width: 28rpx;
+    height: 28rpx;
   }
 
   .data {

+ 4 - 4
htmldev/wxMini/pages/media/child/video-item-normal/index.wxml

@@ -1,20 +1,20 @@
 <view class="photo-wrap">
   <image class="photo" src=""></image>
-  <image class="play" src=""></image>
+  <image class="play" src="../../../../image/common/video-play-normal.png"></image>
   <text class="pv">3万次播放</text>
 </view>
 <view class="video-name">视频名称视频名称视频名</view>
 <view class="data-detail">
   <view class="box">
-    <image class="icon-praise" src=""></image>
+    <image class="icon-praise" src="../../../../image/common/like.png"></image>
     <text class="data">99+</text>
   </view>
   <view class="box">
-    <image class="icon-message" src=""></image>
+    <image class="icon-message" src="../../../../image/common/comment.png"></image>
     <text class="data">99+</text>
   </view>
   <view class="box">
-    <image class="icon-share" src=""></image>
+    <image class="icon-share" src="../../../../image/common/share.png"></image>
     <text class="data">99+</text>
   </view>
 </view>

+ 2 - 1
htmldev/wxMini/pages/media/media.json

@@ -2,5 +2,6 @@
   "usingComponents": {
     "customer-tab": "../../components/customer-tab/index",
     "video-item-normal": "./child/video-item-normal/index"
-  }
+  },
+  "navigationBarTitleText": "村长说农货"
 }

+ 3 - 3
htmldev/wxMini/pages/media/media.scss

@@ -47,12 +47,12 @@
   }
 
   .value-wrap {
-    width: calc(100% - 118rpx);
+    width: calc(100% - 120rpx);
   }
 
   .icon {
-    width: 35rpx;
-    height: 34rpx;
+    width: 36rpx;
+    height: 36rpx;
     background: pink;
   }
 

+ 1 - 1
htmldev/wxMini/pages/media/media.wxml

@@ -26,7 +26,7 @@
             <image class="photo" src=""></image>
             <view class="info">
               <view class="label-wrap">
-                <image class="icon" src=""></image>
+                <image class="icon" src="../../image/common/video.png"></image>
                 <text class="label">频道:</text>
               </view>
               <view class="value-wrap">

+ 3 - 2
htmldev/wxMini/pages/mediaDetail/mediaDetail.json

@@ -1,3 +1,4 @@
 {
-  "usingComponents": {}
-}
+  "usingComponents": {},
+  "navigationBarTitleText": "视频详情"
+}

+ 1 - 0
htmldev/wxMini/pages/newGoods/newGoods.json

@@ -4,6 +4,7 @@
     "goods-item-normal": "../../components/goods-item-normal/index",
     "van-loading": "@vant/weapp/loading/index"
   },
+  "navigationBarTitleText": "最新上架",
   "backgroundColor": "#F6F6F6",
   "backgroundTextStyle": "dark",
   "enablePullDownRefresh": true,