Ver código fonte

小程序:购物车

panyong 2 anos atrás
pai
commit
d6d86b599e

+ 1 - 1
htmldev/wxMini/README.md

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

+ 115 - 0
htmldev/wxMini/pages/shoppingCar/shoppingCar.scss

@@ -0,0 +1,115 @@
+.wrapper {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  padding: 34rpx 0;
+}
+
+.list {
+  display: flex;
+  align-items: center;
+  width: 100%;
+  margin-bottom: 40rpx;
+}
+
+.icon-wrap {
+  display: flex;
+  width: 114rpx;
+  padding-left: 30rpx;
+
+  image {
+    width: 34rpx;
+    height: 32rpx;
+    background: pink;
+  }
+}
+
+.goods-wrap {
+  display: flex;
+  align-items: center;
+  width: calc(100% - 114rpx);
+}
+
+.photo-wrap {
+  width: 202rpx;
+  height: 194rpx;
+  border-radius: 20rpx;
+  overflow: hidden;
+
+  image {
+    display: block;
+    width: 100%;
+    height: 100%;
+    background: pink;
+  }
+}
+
+.info {
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  width: calc(100% - 202rpx);
+  min-height: 194rpx;
+  padding: 0 30rpx 0 50rpx;
+}
+
+.name-wrap {
+  display: flex;
+  flex-direction: column;
+}
+
+.goods-name {
+  width: 100%;
+  font-size: 32rpx;
+  line-height: 46rpx;
+  color: rgba(0, 28, 51, 1);
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
+.partner-name {
+  width: 100%;
+  font-size: 24rpx;
+  line-height: 34rpx;
+  color: rgba(163, 163, 163, 1);
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
+.price {
+  margin-top: 10rpx;
+  font-size: 28rpx;
+  line-height: 32rpx;
+  color: rgba(0, 28, 51, 1);
+}
+
+.count-wrap {
+  display: flex;
+  align-items: center;
+}
+
+.count {
+  min-width: 69rpx;
+  font-size: 24rpx;
+  line-height: 30rpx;
+  color: rgba(0, 28, 51, 1);
+  text-align: center;
+}
+
+.del,
+.add {
+  width: 38rpx;
+  height: 36rpx;
+  background: pink;
+}
+
+button.btn-business[type="primary"] {
+  width: 627rpx;
+  height: 80rpx;
+  border-radius: 88rpx;
+  background: rgba(145, 179, 121, 1);
+  font-size: 36rpx;
+  font-weight: 500;
+}

+ 44 - 0
htmldev/wxMini/pages/shoppingCar/shoppingCar.wxml

@@ -0,0 +1,44 @@
+<view class="wrapper">
+  <view
+    class="list"
+    wx:for="{{[1]}}"
+    wx:key="item">
+    <view
+      class="icon-wrap">
+      <image
+        src=""
+        hidden="{{true}}"></image>
+      <image
+        src=""
+        hidden="{{false}}"></image>
+    </view>
+    <view
+      class="goods-wrap">
+      <view class="photo-wrap">
+        <image src=""></image>
+      </view>
+      <view class="info">
+        <view class="name-wrap">
+          <text
+            class="goods-name">名字名字名字名字名字名字名字名字名字名字名字</text>
+          <text
+            class="partner-name"
+            user-select>上三村合作社名字名字名字名字名字名字名字名字名字名字名字</text>
+          <text class="price">¥12.00</text>
+        </view>
+        <view class="count-wrap">
+          <image
+            class="del"
+            src=""></image>
+          <text class="count">9</text>
+          <image
+            class="add"
+            src=""></image>
+        </view>
+      </view>
+    </view>
+  </view>
+  <button
+    class="btn-business"
+    type="primary">商家信息</button>
+</view>

+ 0 - 0
htmldev/wxMini/pages/shoppingCar/shoppingCar.wxss