소스 검색

小程序:样式

panyong 2 년 전
부모
커밋
10ba371dcf

+ 1 - 1
htmldev/wxMini/README.md

@@ -5,7 +5,7 @@
   - [x] 供应商 business 4
     - [x] 供应商详情 businessDetail 4
   - [x] 采购指南 guide 6
-    - 商品详情(预售、现货) goodsDetail 8
+    - [x] 商品详情(预售、现货) goodsDetail 8
     - 购物车 shoppingCar 4
     - 联系商家 contactBusiness 4
   - 收藏 collection 4

+ 4 - 1
htmldev/wxMini/components/goods-item/index.js

@@ -14,7 +14,10 @@ Component({
    */
   methods: {
     jumpGoodsDetail() {
-      this.triggerEvent('jumpGoodsDetail', {})
+      // this.triggerEvent('jumpGoodsDetail', {})
+      wx.navigateTo({
+        url: '/pages/goodsDetail/goodsDetail'
+      })
     }
   }
 })

+ 6 - 1
htmldev/wxMini/pages/goodsDetail/goodsDetail.scss

@@ -175,14 +175,19 @@
   .info {
     display: flex;
     flex-direction: column;
-    margin-left: 18rpx;
+    width: calc(100% - 168rpx);
+    padding-left: 18rpx;
   }
 
   .name {
+    width: 100%;
     font-size: 26rpx;
     font-weight: 700;
     line-height: 36rpx;
     color: rgba(51, 51, 51, 1);
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
   }
 
   .unit-price {

+ 2 - 3
htmldev/wxMini/pages/goodsDetail/goodsDetail.wxml

@@ -20,7 +20,7 @@
   </view>
   <text
     class="name"
-    selectable>名字</text>
+    user-select>名字</text>
   <view class="unit-price">
     <text class="price">¥23.00</text>
     <text class="unit">/ kg</text>
@@ -59,8 +59,7 @@
           </view>
           <view class="info">
             <text
-              class="name"
-              selectable>名字</text>
+              class="name">名字名字名字名字名字名字名字名字</text>
             <view class="unit-price">
               <text class="price">¥23.00</text>
               <text class="unit">/ kg</text>

+ 0 - 5
htmldev/wxMini/pages/guide/guide.js

@@ -111,10 +111,5 @@ Page({
       currentCategory: item.id,
       navScrollLeft: 0
     })
-  },
-  jumpGoodsDetail(item) {
-    wx.navigateTo({
-      url: '/pages/goodsDetail/goodsDetail'
-    })
   }
 })

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

@@ -32,7 +32,7 @@
     class="waterfall"
     hidden="{{currentNav === '1'}}">
     <view class="waterfall-left">
-      <goods-item :jumpGoodsDetail="jumpGoodsDetail"/>
+      <goods-item/>
     </view>
     <view class="waterfall-right">
       <goods-item/>