Blame view
src/components/CommodityCard/CommodityCard.vue
2.74 KB
1003c53e8 go |
1 |
<template> |
7d6833f2c 地址列表 |
2 3 |
<view class="card" |
b9fb65756 购物车和推荐产品根据sk_id来对应价格 |
4 |
@tap="toGoods(goods.id?goods.id:goods.pid,goods.sk_id)" |
7d6833f2c 地址列表 |
5 |
> |
967ce241a 合并冲突 |
6 7 8 9 10 |
<easy-loadimage mode="widthFix" :scroll-top="scrollTop" :image-src="goods.imgurl?goods.imgurl:goods.pic" :viewHeight="viewHeight"></easy-loadimage> <!-- <image |
7d6833f2c 地址列表 |
11 |
mode="widthFix" |
058f060df 冲突修改 |
12 |
:src="goods.imgurl?goods.imgurl:goods.pic" |
967ce241a 合并冲突 |
13 |
></image> --> |
058f060df 冲突修改 |
14 |
<view class="name">{{goods.name?goods.name:goods.p_name}}</view> |
7d6833f2c 地址列表 |
15 16 |
<view class="info"> <view class="priceBox"> |
089dce19d 支付修改 |
17 |
<view class="price">{{goods.old_price ? goods.old_price : (goods.rsSon && goods.rsSon.Min_Price)}}</view> |
7d6833f2c 地址列表 |
18 |
<view class="originCost"> |
089dce19d 支付修改 |
19 20 |
<!-- {{goods.price !== undefined?goods.price:goods.real_price}} --> {{goods.real_price ? goods.real_price : parseInt(goods.rsSon && goods.rsSon.Min_Price*(1 + Number(goods.rsSon.discount)/100))}} |
7d6833f2c 地址列表 |
21 22 23 24 25 |
</view> </view> <view class="trade_num">{{goods.trade_num}}人购买</view> </view> </view> |
1003c53e8 go |
26 |
</template> |
fb85b244c user页面 |
27 28 |
<script> |
967ce241a 合并冲突 |
29 30 |
import easyLoadimage from '@/components/EasyLoadimage/EasyLoadimage.vue' // const MockData = require('@/static/easy-loadimage/mock-data.json') |
7d6833f2c 地址列表 |
31 |
export default { |
967ce241a 合并冲突 |
32 |
components:{easyLoadimage}, |
7d6833f2c 地址列表 |
33 34 35 36 37 38 39 40 41 42 43 44 |
props: { /** * 商品数据 */ goods: { id: Number, imgurl: String, name: String, rsSon: Object, originCost: String, price: String, trade_num: String, |
089dce19d 支付修改 |
45 46 |
goodType: String, }, |
967ce241a 合并冲突 |
47 48 |
scrollTop:Number, viewHeight:Number, |
7d6833f2c 地址列表 |
49 50 |
}, created () { |
7d6833f2c 地址列表 |
51 52 53 |
}, data () { return { |
967ce241a 合并冲突 |
54 |
|
7d6833f2c 地址列表 |
55 56 |
} }, |
967ce241a 合并冲突 |
57 |
|
7d6833f2c 地址列表 |
58 |
methods: { |
a3d2beaa8 立即支付功能 |
59 60 |
toGoods (id, skId) { console.log('---', '../frameDetail/frameDetail?pid=' + id + '&sk_id=' + skId) |
7d6833f2c 地址列表 |
61 |
uni.navigateTo({ |
a3d2beaa8 立即支付功能 |
62 |
url: '../frameDetail/frameDetail?pid=' + id + '&sk_id=' + skId, |
7d6833f2c 地址列表 |
63 64 |
success: res => {}, fail: () => {}, |
089dce19d 支付修改 |
65 |
complete: () => {}, |
7d6833f2c 地址列表 |
66 |
}) |
089dce19d 支付修改 |
67 68 |
}, }, |
7d6833f2c 地址列表 |
69 |
} |
1003c53e8 go |
70 71 |
</script> |
fb85b244c user页面 |
72 |
<style lang="scss"> |
967ce241a 合并冲突 |
73 |
|
7d6833f2c 地址列表 |
74 75 76 77 78 79 |
image { width: 100%; height: 120rpx; } .name { width: 92%; |
15af636b4 购物车逻辑 |
80 |
height: 76rpx; |
7d6833f2c 地址列表 |
81 |
padding: 5px 4%; |
15af636b4 购物车逻辑 |
82 |
box-sizing: border-box; |
7d6833f2c 地址列表 |
83 84 85 86 87 |
display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; text-align: justify; overflow: hidden; |
156736a2e 样式修改 |
88 |
font-size: 26rpx; |
7d6833f2c 地址列表 |
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
color: #333333; } .info { display: flex; justify-content: space-between; align-items: center; width: 92%; padding: 5px 4% 5px 4%; .priceBox { display: flex; justify-content: space-between; align-items: center; .price { color: #eb5d3b; font-size: 28rpx; font-weight: 600; margin-right: 10rpx; } .originCost { text-decoration: line-through; color: #999999; font-size: 20rpx; } } .trade_num { color: #999999; font-size: 20rpx; } } </style> |