From 097cdcd70b1d95f5fc581ea2bedc4faeba8259f2 Mon Sep 17 00:00:00 2001 From: yiming <m13691596795@163.com> Date: 星期五, 15 三月 2024 18:36:24 +0800 Subject: [PATCH] fix: 购物车的样式 --- pages/cart/index.js | 6 - pages/cart/paymentPage/index.js | 6 + pages/cart/paymentPage/index.wxml | 53 +++++------------ pages/cart/paymentPage/index.wxss | 49 +++++++++++++++ pages/testLogin/index.js | 2 pages/bookServices/detail/components/tree/index.js | 3 + pages/cart/index.wxss | 14 ++++ pages/cart/index.wxml | 18 +++++ 8 files changed, 101 insertions(+), 50 deletions(-) diff --git a/pages/bookServices/detail/components/tree/index.js b/pages/bookServices/detail/components/tree/index.js index 57c889e..3b1bd8a 100644 --- a/pages/bookServices/detail/components/tree/index.js +++ b/pages/bookServices/detail/components/tree/index.js @@ -249,5 +249,8 @@ }, onCloudShoppingCart() { console.log(this.properties.treeList); + }, + oncheckbox() { + console.log(111); } }) \ No newline at end of file diff --git a/pages/cart/index.js b/pages/cart/index.js index c2194e7..c2ea63e 100644 --- a/pages/cart/index.js +++ b/pages/cart/index.js @@ -106,21 +106,17 @@ }); }, goPaymentPage() { - - const selectedItems = this.data.shoppingCartData.filter(item => item.checked); // console.log(selectedItems, 789); const selectedIds = selectedItems.map(item => item.id); console.log('閫変腑鐨勫晢鍝� id:', selectedIds); if (selectedIds.length) { app.MG.store.shoppingCartCreateOrder({ linkIds: selectedIds }).then(res => { - console.log(res.orderNumber, 456); + console.log(res, 456); const url = '/pages/cart/paymentPage/index?orderNumber=' + res.orderNumber wx.navigateTo({ url }); - - }) } else { diff --git a/pages/cart/index.wxml b/pages/cart/index.wxml index 32e95b2..470f5f0 100644 --- a/pages/cart/index.wxml +++ b/pages/cart/index.wxml @@ -24,8 +24,22 @@ </view> - <view slot="description" class="descriptionBox" wx:if="{{item.saleMethod.price != 0}}"> 锟{item.saleMethod.price}}</view> - <view wx:else slot="description" class="descriptionBox"> 绔嬪嵆棰嗗彇</view> + + <view slot="description" class="descriptionBox"> + + <view> + <view class="textBox" wx:if="{{type == 'product'}}">鍥句功鏈嶅姟-鐢靛瓙涔�</view> + <view class="textBox" wx:if="{{type == 'item'}}">鍥句功鏈嶅姟-浜戝涔�</view> + </view> + + <view wx:if="{{item.saleMethod.price != 0}}"> + 锟{item.saleMethod.price}} + </view> + + + <view wx:else class="descriptionBox"> 绔嬪嵆棰嗗彇</view> + </view> + <view slot="left-icon" class="left-icon"> <view class="contentCheckbox"> <t-checkbox icon="rectangle" value=" {{item.id}}" data-item="{{item}}" checked="{{item.checked}}" bindchange="HandelItemChange" /> diff --git a/pages/cart/index.wxss b/pages/cart/index.wxss index cfe290d..6323f54 100644 --- a/pages/cart/index.wxss +++ b/pages/cart/index.wxss @@ -209,16 +209,17 @@ font-size: 22rpx; color: #FFFFFF; font-family: PingFang SC, PingFang SC; - margin-right: 30rpx; + /* margin-right: 30rpx; */ border-radius: 0px 0px 0px 5px; } .eBook { - width: 100%; + width: 90%; height: 100%; background: #FF6C00; text-align: center; line-height: 38rpx; + border-radius: 9rpx; } .cloudLearning { @@ -236,4 +237,13 @@ display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; +} + +.textBox { + font-family: PingFang SC, PingFang SC; + font-weight: 400; + font-size: 25rpx; + color: #333333; + /* margin: 10rpx 0; */ + margin-bottom: 20rpx; } \ No newline at end of file diff --git a/pages/cart/paymentPage/index.js b/pages/cart/paymentPage/index.js index 7a4e351..fcad534 100644 --- a/pages/cart/paymentPage/index.js +++ b/pages/cart/paymentPage/index.js @@ -143,6 +143,7 @@ } } app.MG.store.getOrderByOrderNum(query).then(res => { + console.log(res, 'res'); this.setData({ orderGoods: res.orderNumber }) @@ -155,10 +156,11 @@ res.saleMethodLinks.forEach(item => { item.paymentIcon = getPublicImage(item.orderSaleMethod.product.icon) - + console.log(item.orderSaleMethod.type); this.setData({ - productList: res.saleMethodLinks + productList: res.saleMethodLinks, + type: item.orderSaleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product' }) }) diff --git a/pages/cart/paymentPage/index.wxml b/pages/cart/paymentPage/index.wxml index 945c7a5..fbaed31 100644 --- a/pages/cart/paymentPage/index.wxml +++ b/pages/cart/paymentPage/index.wxml @@ -1,6 +1,5 @@ <!-- 澶撮儴 --> <view class="titleBox"> - <view style="width: 100%; height: {{barHeight}}px; "></view> <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> <view> @@ -10,22 +9,7 @@ </view> </view> - <view class="paymentPageBox"> - - - - - - - - - - - - - - <view class="content"> <t-dialog visible="{{showCloseBtn}}" close-btn bind:confirm="closeDialog" bind:cancel="closeDialog"> <view slot="content" class="slotContent"> @@ -36,31 +20,32 @@ </view> </t-dialog> - - - - <view class="shoppingCartList"> <view class="cartList" wx:for="{{productList}}" wx:key="index" wx:for-item="item" wx:for-index="index"> <view class="imageBox"> - <image src="{{item.paymentIcon }}" mode="aspectFit" /> + <image src="{{item.paymentIcon }}" mode="aspectFill" /> </view> - + <view class="cartListContent"> - <view class="cartListDetails">{{item.orderSaleMethod.product.name}}</view> - <view class="textBox">鍥句功鏈嶅姟-鐢靛瓙涔�</view> + + + <view class="cartListDetails"> + <view class="labelBox"> + <view class="eBook" wx:if="{{type == 'product'}}">鐢靛瓙涔�</view> + <view wx:if="{{type == 'item'}}" class="cloudLearning">浜戝涔�</view> + </view> + + <view class="boosName"> + {{item.orderSaleMethod.product.name}} + </view> + + </view> + <view class="textBox" wx:if="{{type == 'product'}}">鍥句功鏈嶅姟-鐢靛瓙涔�</view> + <view class="textBox" wx:if="{{type == 'item'}}">鍥句功鏈嶅姟-浜戝涔�</view> <view class="priceBox">锟{item.payPrice}}</view> </view> </view> </view> - - - - - - - - <view class="priceBreakdown"> <view class="priceBreakdownContent">浠锋牸鏄庣粏</view> <view class="amountMoney"> @@ -72,12 +57,8 @@ </view> </view> - - - </view> <!-- <view class="interval"></view> --> - <view class="paymentBox"> <view class="residue">寰呮敮浠橈細<text class="residueTextBox">锟{payPrice}}</text></view> <view> diff --git a/pages/cart/paymentPage/index.wxss b/pages/cart/paymentPage/index.wxss index 695fc63..14285dc 100644 --- a/pages/cart/paymentPage/index.wxss +++ b/pages/cart/paymentPage/index.wxss @@ -40,8 +40,8 @@ } image { - width: 100%; - height: 100%; + width: 150rpx; + height: 210rpx; } .cartListContent { @@ -62,6 +62,10 @@ font-weight: bold; font-size: 29rpx; color: #333333; + display: flex; + flex-direction: row; + padding: 0 10rpx; + } .textBox { @@ -77,6 +81,10 @@ font-weight: 500; font-size: 31rpx; color: #0F1214; + font-family: DIN, DIN; + + + } @@ -168,4 +176,41 @@ top: 0; width: 100%; +} + +.eBook { + width: 90%; + height: 100%; + background: #FF6C00; + text-align: center; + line-height: 38rpx; + border-radius: 9rpx; +} + +.cloudLearning { + width: 100%; + height: 100%; + background: #5F92FD; + text-align: center; + line-height: 38rpx; + border-radius: 9rpx; +} + +.labelBox { + width: 105rpx; + height: 38rpx; + font-size: 22rpx; + color: #FFFFFF; + font-family: PingFang SC, PingFang SC; + + +} + +.boosName { + width: 300rpx; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; } \ No newline at end of file diff --git a/pages/testLogin/index.js b/pages/testLogin/index.js index 8dc1a28..e83f718 100644 --- a/pages/testLogin/index.js +++ b/pages/testLogin/index.js @@ -7,7 +7,7 @@ * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { - textName: "18892081234", + textName: "15111111116", textPassword: "xA123456", loading: false, userInfo: { -- Gitblit v1.9.1