| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <template>
- <view class="item" @click="showProduct()">
- <view class="img-box">
- <image :src="item.image" mode="aspectFill"></image>
- </view>
- <view class="info-box">
- <view class="title ellipsis2">{{item.productName}}</view>
- <view class="price-box x-bc">
- <view>
- <text class="price-box-unit">¥</text>
- <text class="price-box-integer">{{splitPrice(item.price || 0).intPart}}</text>
- <text class="price-box-decimal">.{{splitPrice(item.price || 0).decPart}}</text>
- <!-- <text class="price-box-text">/日</text> -->
- <!-- <text class="old" v-show="item.price!=item.otPrice&&item.otPrice!==null&&item.otPrice!==undefined">¥{{item.otPrice.toFixed(2)}}</text> -->
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- props: ['item','storeId'],
- data() {
- return {
-
- }
- },
- methods: {
- splitPrice(num) {
- const [intPart = '0', decPart = '00'] = String(num||0).split('.');
- return { intPart, decPart: decPart.padEnd(2, '0').slice(0, 2) };
- },
- showProduct() {
- uni.navigateTo({
- url: '/pages_shopping/productDetails?productId=' + this.item.productId+'&storeId='+this.storeId || ''
- })
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .price-box {
- font-family: Roboto, Roboto;
- font-weight: bold;
- font-size: 36rpx;
- color: #FF5C03;
-
- &-unit {
- font-weight: 600;
- font-size: 26rpx;
- }
-
- &-decimal {
- font-weight: 600;
- font-size: 26rpx;
- }
-
- &-text {
- font-family: PingFang SC, PingFang SC;
- font-weight: 500;
- font-size: 26rpx;
- }
- }
- .item{
- margin-right: 20rpx;
- margin-bottom: 20rpx;
- width: 235rpx;
- background: #FFFFFF;
- box-shadow: 0px 0px 10rpx 4rpx rgba(199, 199, 199, 0.22);
- border-radius: 20rpx;
- overflow: hidden;
- &:nth-child(2n) {
- margin-right: 0;
- }
- .img-box{
- width: 100%;
- height: 235rpx;
- image{
- width: 100%;
- height: 100%;
- }
- }
- .info-box{
- box-sizing: border-box;
- // height: 182rpx;
- padding: 12rpx 20rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .title{
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #111111;
- line-height: 40rpx;
- }
- .price-box{
- display: flex;
- align-items: flex-end;
- .now{
- display: flex;
- align-items: flex-end;
- margin-right: 20rpx;
- .unit{
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FF6633;
- line-height: 1.2;
- margin-right: 4rpx;
- }
- .num{
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FF6633;
- line-height: 1;
- }
- }
- .old{
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- text-decoration: line-through;
- color: #BBBBBB;
- line-height: 1.1;
- }
- }
- }
- }
- </style>
|