yann 5 ヶ月 前
コミット
e11f6c37ff

+ 19 - 0
components/existProduct-list/existProduct-list.js

@@ -0,0 +1,19 @@
+// components/existProduct-list/existProduct-list.js
+Component({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    cartList: [
+        { id: 1, prodName: "商品A商品A商品A商品A商品A", price: 100, prodAttrName:'属性',checked: false, quantity: 1 }
+    ],
+  },
+
+  methods:{
+
+  },
+  ready(){
+
+  }
+})

+ 3 - 0
components/existProduct-list/existProduct-list.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 16 - 0
components/existProduct-list/existProduct-list.wxml

@@ -0,0 +1,16 @@
+<!--components/existProduct-list/existProduct-list.wxml-->
+<view class="prodsList">
+            <view class="itemProd" wx:for="{{cartList}}" wx:key="id">
+                <view class="goods-info">
+                    <image src="/images/index/category-item.png" mode="aspectFill"></image>
+                    <view class="info">
+                        <text>{{item.prodName}}</text>
+                        <text>{{item.prodAttrName}}</text>
+                        <text>¥{{item.price}}</text>
+                    </view>
+                    <view class="count">
+                        <text class="num">{{item.quantity}}</text>
+                    </view>
+                </view>
+            </view>
+    </view>

+ 37 - 0
components/existProduct-list/existProduct-list.wxss

@@ -0,0 +1,37 @@
+/* components/existProduct-list/existProduct-list.wxss */
+/* 商品列表 */
+.prodsList{
+    width: 668rpx;
+    margin: auto;
+}
+.itemProd{
+    height: 224rpx;
+    border-bottom: 1rpx solid #EFEFEF;
+    display: flex;
+    align-items: center;
+}
+/* 商品信息 */
+.goods-info {
+    flex: 1;
+    display: flex;
+    margin-left: 10px;
+    position: relative;
+}
+.goods-info image {
+    width: 170rpx;
+    height: 170rpx;
+    border-radius: 10rpx;
+}
+.goods-info .info {
+    margin-left: 10px;
+    display: flex;
+    flex-direction: column;
+}
+.count {
+    padding: 5rpx 15rpx;
+    background:#EFEFEF;
+    border-radius: 10rpx;
+    position: absolute;
+    right: 10rpx;
+    bottom: 0;
+}