Browse Source

小程序:首页接口对接

panyong 2 years ago
parent
commit
10c66b9016

+ 7 - 0
htmldev/wxMini/README.md

@@ -57,3 +57,10 @@
 
 * 商户消息:
   * 二级页面 ???
+
+
+登录:只要微信登录,设计稿优化下
+去除购物车
+供应商详情:地址、手机按钮区域重叠,UI优化下
+加个服务通知
+农事天地、系统消息:这一版暂不开发

+ 1 - 0
htmldev/wxMini/components/goods-item-large/index.wxss

@@ -2,6 +2,7 @@
   display: flex;
   flex-direction: column;
   width: 330rpx;
+  margin-bottom: 30rpx;
   border-radius: 16rpx;
   background: rgba(255, 255, 255, 1);
   box-shadow: 0 4rpx 8rpx 0 rgba(0, 0, 0, 0.2);

+ 15 - 7
htmldev/wxMini/pages/business/business.js

@@ -81,14 +81,22 @@ Page({
     try {
       const { status, data, msg } = await getProductCategoryList()
       if (status && Array.isArray(data) && data.length > 0) {
+        const temp = data.map(item => {
+          return {
+            ...item,
+            text: item.category_name
+          }
+        })
+
+        temp.unshift({
+          category_img_url: '',
+          category_name: '全部',
+          id: 0
+        })
+
         this.setData({
-          categoryList: data.map(item => {
-            return {
-              ...item,
-              text: item.category_name
-            }
-          }),
-          'searchForm.category_id': data[0].id
+          categoryList: temp,
+          'searchForm.category_id': temp[0].id
         })
       } else {
         wx.showToast({

+ 2 - 2
htmldev/wxMini/pages/business/business.wxss

@@ -2,8 +2,8 @@
   padding: 20rpx 0 28rpx;
 }
 
-.list {
-  padding: 38rpx 0;
+.app_nav-wrap {
+  margin-bottom: 38rpx;
 }
 
 .item-info {

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

@@ -79,7 +79,7 @@
     <button
       class="btn-collection"
       type="primary"
-      wx:if="{{false}}">收藏预售产品
+      wx:if="{{false}}">预约并收藏
     </button>
     <block wx:if="{{true}}">
       <button

+ 24 - 9
htmldev/wxMini/pages/home/home.js

@@ -26,7 +26,7 @@ Page({
       },
       {
         icon: 'guide@2x.png',
-        name: '购指南',
+        name: '购指南',
         path: 'guide'
       },
       {
@@ -132,14 +132,22 @@ Page({
     try {
       const { status, data, msg } = await getProductCategoryList()
       if (status && Array.isArray(data) && data.length > 0) {
+        const temp = data.map(item => {
+          return {
+            ...item,
+            text: item.category_name
+          }
+        })
+
+        temp.unshift({
+          category_img_url: '',
+          category_name: '全部',
+          id: 0
+        })
+
         this.setData({
-          categoryList: data.map(item => {
-            return {
-              ...item,
-              text: item.category_name
-            }
-          }),
-          'searchForm.category_id': data[0].id
+          categoryList: temp,
+          'searchForm.category_id': temp[0].id
         })
       } else {
         wx.showToast({
@@ -165,7 +173,14 @@ Page({
     } = this.data
     query = wx.createSelectorQuery()
     for (const item of list) {
-      leftHeight <= rightHeight ? leftList.push(item) : rightList.push(item)
+      // leftHeight <= rightHeight ? leftList.push(item) : rightList.push(item)
+      if (leftHeight < rightHeight) {
+        leftList.push(item)
+      } else if (leftHeight === rightHeight) {
+        leftList.length <= rightList ? leftList.push(item) : rightList.push(item)
+      } else {
+        rightList.push(item)
+      }
       await this.getBoxHeight(leftList, rightList)
     }
   },

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

@@ -108,7 +108,7 @@
       </block>
     </view>
     <view class="waterfall-right">
-      <block wx:for="{{leftList}}" wx:key="id">
+      <block wx:for="{{rightList}}" wx:key="id">
         <goods-item-large item="{{item}}"/>
       </block>
     </view>