| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- <template id="presale-goods-style2">
- <div class="presale-goods-style" :style="{background: bgColor}">
- <div :style="[groupBox]">
- <div class="presale-goods-title" :style="[titleStyle]" v-if="showTitle">{{ title || '商品定金预售' }}</div>
- <div class="presale-goods-box" :style="[goodsStyle]" v-for="(it, i) in goodsList" :key="i">
- <div flex>
- <div :class="hotClass" :style="hotStyle">{{hotName}}</div>
- <el-image style="width: 106px; height: 106px; border-radius: 8px;" :src="it.cover_pic"></el-image>
- <div class="group-content" flex="dir:top main:justify">
- <div class="goods-name over2">{{ it.goods_name }}</div>
- <div>
- <div class="goods-time" flex>
- <div>活动时间:</div>
- <div style="flex: 1;">{{ it.start_at | dateTimeFormat('Y-m-d H:i:s') }} - {{ it.end_at | dateTimeFormat('Y-m-d H:i:s') }}</div>
- </div>
- <div class="goods-origin">商品售价:¥{{ it.price }}</div>
- <div class="goods-price" flex>
- <span>预售价:¥{{ it.presale_price }}</span>
- <!-- <div class="price-save">节省了¥{{ it.sheng }}</div> -->
- </div>
- </div>
- </div>
- </div>
- <div class="goods-buy-card" flex="cross:center">
- <div class="goods-buy-img">
- <el-image style="width: 100%; height: 100%;" :src="imgUrl + 'buy_packagesl.png'"></el-image>
- </div>
- <div class="goods-buy-desc">
- <span class="text-color">{{it.virtual_payment_num}}人参与了</span>定金预售
- <!-- ,已团<span class="text-color">{{ it.total_num }}件</span> -->
- </div>
- <div class="goods-buy-btn" flex="cross:center main:center">
- <div class="btn-text">付定金</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- /**
- * @descriptions
- * 1. 组件名字必须对应模板形式 - 递归组件name
- * 2. 样式内容方法尽量内部维护 - 前端方便通用
- * 3. 父级组件会传预览数据 - activeItem
- */
- Vue.component('presale-goods-style2', {
- name: "presale-goods-style2",
- props: {
- activeItem: {
- type: Object,
- default () {
- return {}
- }
- },
- goodsList: {
- type: Array,
- default: () => []
- },
- showTitle: { // 是否展示标题
- type: Number,
- default: 0
- },
- title: { // 标题
- type: String,
- default: ''
- },
- titleStyle: { // 标题的样式
- type: Object,
- default: () => {}
- },
- groupBox: { // 最外层样式
- type: Object,
- default: () => {}
- },
- goodsStyle: { // 商品的样式
- type: Object,
- default: () => {}
- },
- btnStyle: { // 按钮的样式
- type: Object,
- default: () => {}
- },
- bgColor: {
- type: String,
- default: ''
- }
- },
- template: '#presale-goods-style2',
- data() {
- return {
- imgUrl: "<?= Yii::getAlias('@attachurl') ?>"+"/static/addons/DepositPresale/"
- }
- }
- });
- </script>
- <style>
- .presale-goods-style {
- position: relative;
- overflow: hidden;
- }
- .presale-goods-box {
- position: relative;
- background-color: #fff;
- border-radius: 8px;
- overflow: hidden;
- padding: 10px;
- }
- .group-content {
- flex: 1;
- padding-left: 8px;
- }
- .goods-time {
- color: #6D6A6A;
- font-size: 11px;
- padding: 6px 0;
- }
- .goods-origin {
- font-size: 11px;
- color: #707070;
- }
- .goods-price {
- padding-top: 2px;
- font-size: 16px;
- color: #DB0505;
- }
- .price-save {
- background: rgba(219, 5, 5, 0.08);
- border-radius: 20px;
- padding: 3px 8px;
- color: #DB0505;
- font-size: 11px;
- margin-left: 10px;
- }
- .price-origin {
- font-size: 11px;
- color: #707070;
- }
- .goods-buy-card {
- width: 100%;
- height: 52px;
- background-color: rgba(219, 5, 5, 0.08);
- border-radius: 8px;
- margin-top: 12px;
- }
- .goods-buy-img {
- width: 36px;
- height: 36px;
- margin-left: 8px;
- }
- .goods-buy-desc {
- font-size: 13px;
- padding-left: 5px;
- flex: 1;
- }
- .text-color {
- color: #DB0505;
- }
- .goods-buy-btn {
- width: 112px;
- height: 52px;
- background: url("<?= Yii::getAlias('@attachurl') ?>"+"/static/addons/DepositPresale/buy_btn.png") no-repeat;
- background-size: 100% 100%;
- color: #fff;
- }
- .btn-text {
- padding-left: 10px;
- }
- </style>
|