1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033 |
- <template>
- <view class="app-goods-list">
- <view class="goods-list" :class="listClass" v-if="newData.length > 0">
- <!-- 列表模式 -->
- <template v-if="listStyle === -1">
- <block v-for="(goods, index) in newData" :key="index">
- <view :style="[{'background-color':`${goodsStyle != 3 ? '#fff' : ''}`, overflow: `${sign === 'composition' ? 'hidden': 'visible'}`}]" class="goods-item app-list-mode dir-left-nowrap" @click="jump(goods)"
- :class="goodsStyle === 3 ? 'no-border' : goodsStyle === 2 ? 'border' : ''">
- <!-- 售罄 -->
- <view :style="[{'border-radius': `${lisRadius}`}]" class="out-dialog" v-if="(goods.goods_stock == 0 || goods.goods.goods_stock == 0) && appSetting.is_show_stock == '1'">
- <image :style="[{'border-radius': `${lisRadius}`}]" :src="appSetting.is_use_stock == '1' ? appImg.plugins_out : appSetting.sell_out_pic"></image>
- </view>
- <view class="box-grow-0">
- <app-image
- v-if="sign === 'advance'"
- :borderRadius="lisRadius"
- :img-src="goods.goods.goodsWarehouse.cover_pic"
- width="220rpx"
- height="220rpx"
- :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
- ></app-image>
- <div v-else-if="sign === 'composition'" style="width: 328rpx;height: 100%">
- <app-diy-composition-image
- :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
- :image-list="goods.cover_pic_list"></app-diy-composition-image>
- </div>
- <app-image
- v-else
- :borderRadius="lisRadius"
- :img-src="goods.cover_pic"
- width="220rpx"
- height="220rpx"
- :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
- ></app-image>
- </view>
- <!-- 角标 -->
- <view class="goods-tag" v-if="showGoodsTag">
- <app-image :img-src="goodsTagPicUrl" width="64rpx" height="64rpx"></app-image>
- </view>
- <view class="right box-grow-1 dir-top-nowrap main-between"
- :style="{
- padding: sign === 'advance' || sign=== 'composition' || (sign === 'flash-sale' && (goods.vip_card_appoint.discount && (goods.level_show == 1 && goods.is_negotiable != 1))) ? `10rpx 24rpx 6rpx 20rpx` : '28rpx 24rpx 24rpx 20rpx',
- height: sign === 'composition' ? '165rpx' : '220rpx',
- }">
- <view class="box-grow-0 name "
- :class="(sign === 'advance' || sign === 'miaosha') || goods.vip_card_appoint.discount || (goods.level_show == 1 && goods.is_negotiable != 1) ? 't-omit name-one' : 't-omit-two name-two'">
- <text class="dir-tag-def"
- v-if="tag && sign === 'advance' || sign === 'pick'|| sign === 'miaosha'"
- :class="theme + '-m-text ' + theme + ' ' + theme + '-m-back-o '"
- >
- {{goods.people_num ? goods.people_num : ''}}{{tag}}
- </text>
- <text class="dir-tag-def"
- v-if="tag && sign !== 'advance' && sign !== 'pick' && sign !== 'miaosha' && ((sign == 'pintuan' && goods.people_num) || sign != 'pintuan')"
- :class="theme + '-m-text ' + theme + ' ' + theme + '-m-back-o '"
- >
- {{goods.people_num ? goods.people_num : ''}}{{tag}}
- </text>
- <!-- 商品名字 -->
- <text v-if="sign === 'advance'">
- {{showGoodsName ? goods.goods.goodsWarehouse.name : ''}}
- </text>
- <text v-else>{{showGoodsName ? goods.name : ''}}</text>
- </view>
- <view class=" dir-top-nowrap main-right box-grow-1">
- <template v-if="sign === 'flash-sale'">
- <view class="dir-left-nowrap main-between" style="margin-bottom: 10rpx">
- <view
- :class="theme + '-m-back flash-sale ' + theme "
- v-if="goods.discount_type == 1"
- >{{goods.min_discount}}折</view>
- <view
- :class="theme + '-m-back flash-sale ' + theme"
- v-if="goods.discount_type == 2"
- >减{{goods.min_discount}}元</view>
- <view v-if="showProgressBar" style="font-size: 20rpx;color: #999999;">{{goods.sales}}</view>
- </view>
- <view class="app-percentage" v-if="showProgressBar" :class="theme + '-m-back-l ' +theme" style="width: 445rpx;margin-bottom: 10rpx">
- <view :class="theme + '-m-back ' +theme" :style="{width: `${goods.percentage}%`}"></view>
- </view>
- </template>
- <view class="dir-left-nowrap cross-bottom">
- <view class="box-grow-1" :class="theme + '-m-text ' + theme">
- <!-- 时间 -->
- <template v-if="showTimer && sign !== 'flash-sale'">
- <app-goods-timer
- v-if="sign === 'advance'"
- :list-style="listStyle"
- :theme="theme"
- :start-date-time="goods.start_prepayment_at"
- :end-date-time="goods.end_prepayment_at"
- :sign="sign"
- :page-hide="pageHide"
- ></app-goods-timer>
- <app-goods-timer
- v-else
- :list-style="listStyle"
- :start-date-time="goods.start_time"
- :end-date-time="goods.end_time"
- :sign="sign"
- :page-hide="pageHide"
- :theme="theme"
- ></app-goods-timer>
- </template>
- <!-- #ifndef MP-ALIPAY -->
- <text v-if="sign === 'advance'" class="des-price"
- style="margin-top: 5rpx"
- :class="theme + '-m-text ' + theme + '-m-border ' + theme">
- 定金¥{{goods.deposit}}抵¥{{goods.swell_deposit}}
- </text>
- <!-- #endif -->
- <!-- #ifdef MP-ALIPAY -->
- <text v-if="sign === 'advance'" class="des-price" style="margin: 5rpx 0"
- :class="theme + '-m-text ' + theme + '-m-border ' + theme">
- 定金¥{{goods.deposit}}抵¥{{goods.swell_deposit}}
- </text>
- <!-- #endif -->
- <text class="tag" v-else-if="sign === 'pick'">
- {{goods.rule_price}}元选{{goods.rule_num}}{{goods.unit}}
- </text>
- <template v-if="goods.is_level == 1 && goods.is_negotiable != 1">
- <app-member-price :price="goods.level_price"></app-member-price>
- </template>
- <!-- #ifndef MP-ALIPAY -->
- <app-sup-vip
- :is_vip_card_user="goods.vip_card_appoint.is_vip_card_user"
- v-if="goods.vip_card_appoint.discount"
- :discount="goods.vip_card_appoint.discount"
- ></app-sup-vip>
- <!-- #endif -->
- <!-- #ifdef MP-ALIPAY -->
- <app-sup-vip
- margin="4rpx 0"
- :is_vip_card_user="goods.vip_card_appoint.is_vip_card_user"
- v-if=" goods.vip_card_appoint.discount"
- :discount="goods.vip_card_appoint.discount"
- ></app-sup-vip>
- <!-- #endif -->
- <template v-if="sign === 'advance'">
- <view class="dir-left-nowrap main-left cross-center">
- <view class="goods-price ">¥{{showGoodsPrice ? goods.goods.price :''}}
- </view>
- <view class="original-price" style="margin-left: 10upx;"
- v-if="isUnderLinePrice && goods.goods.goodsWarehouse.original_price">
- ¥{{goods.goods.goodsWarehouse.original_price}}
- </view>
- </view>
- </template>
- <view v-else
- :class="sign === 'miaosha'|| (sign === 'flash-sale' && showProgressBar) || goods.vip_card_appoint.discount || (goods.is_level == 1 && goods.is_negotiable != 1) ? 'dir-left-nowrap main-left cross-center' : 'dir-top-nowrap'">
- <view class="goods-price ">{{showGoodsPrice ?
- goods.price_content :
- ''}}
- </view>
- <view class="dir-left-nowrap">
- <view class="original-price" style="margin-left: 10upx;"
- v-if="isShowOriginalPrice(goods)">
- ¥{{goods.original_price}}
- </view>
- </view>
- </view>
- </view>
- <!--购物车-->
- <view v-if="showBuyBtn && goods.is_negotiable != 1" :style="btnStyle" :class="[buyBtnClass, 'box-grow-0', 'buy-btn', 'main-center', 'cross-center']">{{buyBtnText}}</view>
- </view>
- </view>
- </view>
- </view>
- </block>
- </template>
- <!-- 一行一个 -->
- <template v-else-if="listStyle === 1">
- <block v-for="(goods, index) in newData" :key="index">
- <view :style="[{'background-color':`${goodsStyle != 3 ? '#fff' : ''}`,overflow: `${sign === 'composition' ? 'hidden': 'visible'}`}]"
- class="goods-item app-column-1" :class="[goodsClass, index !== newData.length - 1 ? 'app-column-1-mar' : '']" @click="jump(goods)">
- <view style="position: relative;">
- <view class="out-dialog"
- :style="[{'height':`${coverPicHeight}`,'border-radius': `${imgRadius}`}]"
- v-if="(goods.goods_stock == 0 || goods.goods.goods_stock == 0) && appSetting.is_show_stock == '1'">
- <image v-if="coverPicHeight == '468rpx'"
- :style="[{'height':`${coverPicHeight}`,'border-radius': `${imgRadius}`}]"
- :src="appSetting.is_use_stock == '1' ? appImg.rate_out : appSetting.sell_out_other_pic"></image>
- <image v-else
- :style="[{'height':`${coverPicHeight}`,'border-radius': `${imgRadius}`}]"
- :src="appSetting.is_use_stock == '1' ? appImg.one_out : appSetting.sell_out_pic"></image>
- </view>
- <view>
- <app-image :borderRadius="imgRadius" v-if="sign === 'advance'"
- :img-src="goods.goods.goodsWarehouse.cover_pic"
- width="100%"
- :height="coverPicHeight"
- :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
- ></app-image>
- <div v-else-if="sign === 'composition'" style="width: 100%;height: 336rpx">
- <app-diy-composition-image
- :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
- :image-list="goods.cover_pic_list"></app-diy-composition-image>
- </div>
- <app-image :borderRadius="imgRadius" v-else
- :img-src="goods.cover_pic"
- width="100%"
- :height="coverPicHeight"
- :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
- ></app-image>
- </view>
- <view class="goods-tag" v-if="showGoodsTag">
- <app-image :img-src="goodsTagPicUrl"
- width="64rpx"
- height="64rpx"
- >
- </app-image>
- </view>
- <view class="box-grow-0 timer" v-if="showTimer">
- <template v-if="sign === 'advance'">
- <app-goods-timer
- :list-style="listStyle"
- :start-date-time="goods.start_prepayment_at"
- :end-date-time="goods.end_prepayment_at"
- :sign="sign" :page-hide="pageHide"
- :theme="theme"
- ></app-goods-timer>
- </template>
- <template v-else>
- <app-goods-timer
- :list-style="listStyle"
- :start-date-time="goods.start_time"
- :end-date-time="goods.end_time"
- :sign="sign" :page-hide="pageHide"
- :theme="theme"
- ></app-goods-timer>
- </template>
- </view>
- </view>
- <view class="goods-name t-omit" v-if="showGoodsName" :class="theme">
- <template v-if="sign === 'advance'">
- <text>{{showGoodsName ? goods.goods.goodsWarehouse.name : ''}}</text>
- </template>
- <template v-if="sign === 'pick' || sign === 'gift' || sign === 'exchange' || sign == 'wholesale'">
- <text class="tag-pick"
- :class="theme + '-m-text ' + theme + '-m-back-o ' + theme">
- {{tag}}
- </text>
- <text>{{showGoodsName ? goods.name : ''}}</text>
- </template>
- <template v-else-if="sign === 'composition'">
- <text class="tag-pick"
- :class="theme + '-m-text ' + theme + '-m-back-o ' + theme">
- {{goods.tag}}
- </text>
- <text>{{showGoodsName ? goods.name : ''}}</text>
- </template>
- <template v-else>
- <text class="tag"
- :class="theme + '-m-text ' + theme + ' ' + theme + '-m-border '"
- v-if="tag && sign == 'pintuan' && goods.people_num">
- {{goods.people_num ? goods.people_num : ''}}{{tag}}
- </text>
- <text>{{showGoodsName ? goods.name : ''}}</text>
- </template>
- </view>
- <template v-if="sign === 'advance'">
- <text class="des-price" :class="theme + '-m-text ' + theme + '-m-border ' + theme"
- style="margin-left: 24rpx;margin-top: 15rpx;">
- 定金¥{{goods.deposit}}抵¥{{goods.swell_deposit}}
- </text>
- </template>
- <template v-if="sign === 'flash-sale'">
- <view class="dir-top-nowrap" style="margin-bottom: 10rpx;padding:0 24rpx;">
- <view :class="showProgressBar ? 'flash-sale-dis' : ''">
- <view class="flash-sale" :class="theme + '-m-back ' + theme"
- v-if="goods.discount_type == 1">{{goods.min_discount}}折</view>
- <view class="flash-sale" :class="theme + '-m-back ' + theme"
- v-if="goods.discount_type == 2">减{{goods.min_discount}}元</view>
- </view>
- <view v-if="showProgressBar" class="app-percentage" style="width: 660rpx" :class="theme + '-m-back-l ' +theme">
- <view :class="theme + '-m-back ' +theme" :style="{width: `${goods.percentage}%`}"></view>
- </view>
- <view v-if="sign === 'flash-sale' && showProgressBar" style="font-size: 20rpx;color: #999999;">{{goods.sales}}</view>
- </view>
- </template>
- <template v-if="sign === 'pick'">
- <text class="des-price" style="margin-left: 24rpx;margin-top: 15rpx;"
- :class="theme + '-m-text ' + theme + '-m-border ' + theme">
- {{goods.rule_price}}元选{{goods.rule_num}}{{goods.unit}}
- </text>
- </template>
- <view class="price dir-left-nowrap cross-center"
- :style="{marginTop: sign === 'advance' ? '0rpx' : '16rpx'}">
- <view class="box-grow-1 t-omit" :class="theme + '-m-text ' + theme">
- <view v-if="sign === 'advance'" class="dir-left-nowrap cross-center"
- :class="textStyle === 2 ? 'main-center' : ''">
- <view v-if="goods.goods.is_level == 1">
- <app-member-price :price="goods.level_price"></app-member-price>
- </view>
- <app-sup-vip :is_vip_card_user="goods.vip_card_appoint.is_vip_card_user"
- margin='0 0 0 12rpx' v-if="goods.vip_card_appoint.discount"
- :discount="goods.vip_card_appoint.discount"></app-sup-vip>
- </view>
- <template v-if="sign === 'advance'">
- <view :class="{'dir-left-nowrap': goods.goods.is_level == 1}"
- v-if="showGoodsPrice">
- <view class="dir-left-nowrap cross-center"
- :class="{'main-center' :textStyle == 2}">
- <view style="font-size: 22rpx;height: 22rpx;line-height: 22rpx">
- {{showGoodsPrice ? `¥${goods.goods.price}` : ''}}
- </view>
- </view>
- <view class="original-price"
- style="font-size: 17rpx;height:17rpx;line-height: 17rpx;"
- v-if="isUnderLinePrice && goods.goods.goodsWarehouse.original_price">
- ¥{{goods.goods.goodsWarehouse.original_price}}
- </view>
- </view>
- </template>
- <template v-else>
- <view class="dir-left-nowrap cross-center"
- :class="textStyle === 2 ? 'main-center' : ''">
- <view>{{showGoodsPrice ? goods.price_content :
- ''}}
- </view>
- <view class="member-price"
- v-if="goods.is_level == 1 && goods.is_negotiable != 1 && sign !== 'pick'">
- <app-member-price margin=""
- :price="goods.level_price"></app-member-price>
- </view>
- <app-sup-vip :is_vip_card_user="goods.vip_card_appoint.is_vip_card_user"
- margin='0 0 0 12rpx'
- v-if="goods.vip_card_appoint.discount"
- :discount="goods.vip_card_appoint.discount"></app-sup-vip>
- </view>
- <view class="original-price"
- v-if="isShowOriginalPrice(goods)">
- ¥{{goods.original_price}}
- </view>
- </template>
- </view>
- <template v-if="showBuyBtn && goods.is_negotiable != 1 && textStyle !== 2">
- <view class="box-grow-0 buy-btn main-center cross-center" :style="btnStyle" :class="buyBtnClass">
- {{buyBtnText}}
- </view>
- </template>
- </view>
- </view>
- </block>
- </template>
- <!-- 一行两个 -->
- <template v-else-if="listStyle === 2">
- <block v-for="(goods, index) in newData" :key="index">
- <view :style="[{'background-color':`${goodsStyle != 3 ? '#fff' : ''}`, overflow: `${sign === 'composition' ? 'hidden': 'visible'}`}]"
- class="box-grow-0 dir-top-nowrap goods-item app-column-2" :class="goodsClass"
- @click="jump(goods)">
- <view style="position: relative;">
- <view :style="[{'border-radius': `${imgRadius}`}]" class="out-dialog"
- v-if="(goods.goods_stock == 0 || goods.goods.goods_stock == 0) && appSetting.is_show_stock == '1'">
- <image :style="[{'border-radius': `${imgRadius}`}]"
- :src="appSetting.is_use_stock == '1' ? appImg.book_out : appSetting.sell_out_pic"></image>
- </view>
- <view class="box-grow-0">
- <template v-if="sign === 'advance'">
- <app-image :borderRadius="imgRadius"
- :img-src="goods.goods.goodsWarehouse.cover_pic"
- width="100%"
- height="342rpx"
- :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
- ></app-image>
- </template>
- <div v-else-if="sign === 'composition'" style="width: 100%;height: 164rpx">
- <app-diy-composition-image
- :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"
- :image-list="goods.cover_pic_list"></app-diy-composition-image>
- </div>
- <template v-else>
- <app-image :borderRadius="imgRadius" :img-src="goods.cover_pic" width="100%"
- height="342rpx"
- :mode="fill === 1 ? 'aspectFill' : 'aspectFit'"></app-image>
- </template>
- </view>
- <view class="goods-tag" v-if="showGoodsTag">
- <app-image :img-src="goodsTagPicUrl" width="64rpx"
- height="64rpx"></app-image>
- </view>
- <view class="box-grow-0 timer" v-if="showTimer">
- <template v-if="sign === 'advance'">
- <app-goods-timer :list-style="listStyle"
- :start-date-time="goods.start_prepayment_at"
- :end-date-time="goods.end_prepayment_at"
- :sign="sign" :page-hide="pageHide"
- :theme="theme"
- ></app-goods-timer>
- </template>
- <template v-else>
- <app-goods-timer :list-style="listStyle" :start-date-time="goods.start_time"
- :end-date-time="goods.end_time"
- :sign="sign" :page-hide="pageHide"
- :theme="theme"
- ></app-goods-timer>
- </template>
- </view>
- </view>
- <view class="box-grow-1 dir-top-nowrap main-between" :class="theme">
- <view class="box-grow-0 goods-name t-omit-two" v-if="showGoodsName" :class="theme">
- <template
- v-if="sign !== 'advance' && sign !== 'pick' && sign !== 'gift' && sign !== 'exchange' && sign !== 'composition' && sign != 'wholesale'">
- <text class="tag"
- :class="theme + '-m-text ' + theme + ' ' + theme + '-m-border '"
- v-if="tag && ((sign === 'pintuan' && goods.people_num) || sign !== 'pintuan')">
- {{goods.people_num ? goods.people_num : ''}}{{tag}}
- </text>
- </template>
- <template v-if="sign === 'pick' || sign === `gift` || sign === 'exchange' || sign === 'wholesale'">
- <text class="dir-tag-def"
- :class="theme + '-m-text ' + theme + ' ' + theme + '-m-back-o '">
- {{tag}}
- </text>
- </template>
- <template v-if="sign === 'composition'">
- <text class="dir-tag-def"
- :class="theme + '-m-text ' + theme + ' ' + theme + '-m-back-o '">
- {{goods.tag}}
- </text>
- </template>
- <text v-if="sign === 'advance'">{{showGoodsName ?
- goods.goods.goodsWarehouse.name : ''}}
- </text>
- <text v-else>{{showGoodsName ? goods.name : ''}}</text>
- </view>
- <view v-if="sign === 'advance'">
- <text class="des-price" style="margin-left: 24rpx;"
- :class="theme + '-m-text ' + theme + '-m-border ' + theme">
- 定金¥{{goods.deposit}}抵¥{{goods.swell_deposit}}
- </text>
- </view>
- <view v-if="sign === 'pick'">
- <text class="des-price" style="margin-left: 24rpx;"
- :class="theme + '-m-text ' + theme + '-m-border ' + theme">
- {{goods.rule_price}}元选{{goods.rule_num}}{{goods.unit}}
- </text>
- </view>
- <template v-if="sign === 'flash-sale'">
- <view :class="showProgressBar ? 'flash-sale-dis' : ''" style="margin-left: 24rpx;">
- <view class="flash-sale" v-if="goods.discount_type === 1" :class="theme + '-m-back ' + theme">{{goods.min_discount}}折</view>
- <view class="flash-sale" v-if="goods.discount_type === 2" :class="theme + '-m-back ' + theme">减{{goods.min_discount}}元</view>
- </view>
- <view v-if="showProgressBar" class="app-percentage" style="width: 296rpx;margin-left: 24rpx;" :class="theme + '-m-back-l ' +theme">
- <view :class="theme + '-m-back ' +theme" :style="{width: `${goods.percentage}%`}"></view>
- </view>
- <text v-if="showProgressBar" style="font-size: 20rpx; color: #999;margin-top: 10rpx;padding-left: 24rpx">{{goods.sales}}</text>
- </template>
- <view :class="textStyle === 2 ? 'main-center' : 'dir-left-nowrap'"
- style="height: 15px;padding-left: 24rpx;"
- v-if="sign === 'advance' && goods.goods.is_level == 1 && goods.is_negotiable != 1">
- <view class="member-price">
- <app-member-price :price="goods.level_price"></app-member-price>
- </view>
- </view>
- <app-sup-vip :is_vip_card_user="goods.vip_card_appoint.is_vip_card_user"
- style="padding-left: 24rpx;"
- :class="textStyle === 2 ? 'main-center' : ''" margin="4rpx 0"
- v-if="goods.vip_card_appoint.discount && sign === 'advance'"
- :discount="goods.vip_card_appoint.discount"></app-sup-vip>
- <view class="box-grow-0 price dir-left-nowrap cross-bottom main-between"
- :style="{marginTop: sign === 'advance' ? '0rpx' : '16rpx'}">
- <template v-if="sign === 'advance'">
- <view :class="textStyle === 2 ? 'main-center advance-center' : ''"
- style="width: 100%" v-if="showGoodsPrice">
- <view class="dir-top-nowrap main-right cross-top"
- :class="theme + '-m-text ' + theme">
- <text class="t-omit"
- style="font-size: 22rpx;height: 22rpx; line-height: 22rpx">
- {{showGoodsPrice ? `¥${goods.goods.price}` : ''}}
- </text>
- <text class="original-price"
- style="font-size: 17rpx;height: 22rpx; line-height: 22rpx"
- v-if="isUnderLinePrice && goods.goods.goodsWarehouse.original_price">
- ¥{{goods.goods.goodsWarehouse.original_price}}
- </text>
- </view>
- </view>
- </template>
- <template v-else>
- <view class="box-grow-1" :class="theme + '-m-text ' + theme">
- <view class="member-price" :class="textStyle === 2 ? 'main-center' : ''"
- v-if="goods.is_level == 1 && goods.is_negotiable != 1 && sign !== 'pick'">
- <app-member-price :price="goods.level_price"></app-member-price>
- </view>
- <view v-if="goods.vip_card_appoint.discount" :class="textStyle === 2 ? 'main-center' : ''">
- <app-sup-vip
- :is_vip_card_user="goods.vip_card_appoint.is_vip_card_user"
- :margin="textStyle === 2 ? '0':'8rpx 0 0'"
- :discount="goods.vip_card_appoint.discount"
- ></app-sup-vip>
- </view>
- <view class="t-omit">
- {{showGoodsPrice ? goods.price_content : ''}}
- </view>
- <view class="original-price"
- v-if="isShowOriginalPrice(goods)">
- ¥{{goods.original_price}}
- </view>
- </view>
- </template>
- <view v-if="showBuyBtn && goods.is_negotiable != 1 && textStyle !== 2" class="box-grow-0 buy-btn main-center cross-center" :style="btnStyle" :class="buyBtnClass">
- {{buyBtnText}}
- </view>
- </view>
- </view>
- </view>
- </block>
- </template>
- </view>
- </view>
- </template>
- <script>
- import { mapGetters, mapState } from "vuex";
- import appPrice from "../../page-component/goods/app-price.vue";
- import appGoodsTimer from "./app-goods-timer.vue";
- import appDiyCompositionImage from '../app-diy-goods-list/app-diy-composition-image';
- export default {
- name: "app-diy-goods-list",
- components: {
- 'app-price': appPrice,
- 'app-goods-timer': appGoodsTimer,
- appDiyCompositionImage
- },
- props: {
- list: {
- type: Array,
- default() {
- return [];
- }
- },
- goodsStyle: {
- type: Number,
- default() {
- return 1;
- }
- },
- textStyle: {
- type: Number,
- default() {
- return 1;
- }
- },
- listStyle: {
- type: Number,
- default() {
- return -1;
- }
- },
- showBuyBtn: {
- type: Boolean,
- default() {
- return false;
- }
- },
- buyBtnText: {
- type: String,
- default() {
- return '';
- }
- },
- buyBtnStyle: {
- type: Number,
- default() {
- return 1;
- }
- },
- fill: {
- type: Number,
- default() {
- return 1;
- }
- },
- showGoodsName: {
- type: Boolean,
- default() {
- return true;
- }
- },
- showGoodsPrice: {
- type: Boolean,
- default() {
- return true;
- }
- },
- showGoodsTag: {
- type: Boolean,
- default() {
- return true;
- }
- },
- goodsCoverProportion: {
- type: String,
- default() {
- return '1-1';
- }
- },
- customizeGoodsTag: {
- type: Boolean,
- default() {
- return false;
- }
- },
- goodsTagPicUrl: String,
- sign: String,
- buttonColor: {
- type: String,
- default() {
- return '';
- }
- },
- //是否显示划线价
- isUnderLinePrice: {
- type: Boolean,
- default() {
- return true;
- }
- },
- pageHide: Boolean,
- theme: String,
- showProgressBar: {
- type: Boolean,
- default() {
- return false;
- }
- }
- },
- data() {
- return {
- imgRadius: '16rpx 16rpx 0 0',
- lisRadius: '16rpx'
- };
- },
- computed: {
- ...mapState({
- appImg: state => state.mallConfig.__wxapp_img.mall,
- appSetting: state => state.mallConfig.mall.setting
- }),
- ...mapGetters('mallConfig',{
- vip: 'getVip',
- getVideo: 'getVideo'
- }),
- newData() {
- return this.list;
- },
- listClass() {
- switch (this.listStyle) {
- case 2:
- return `dir-left-wrap column-2 main-between `;
- default:
- return ``;
- }
- },
- buyBtnClass() {
- let buyBtnClass = ``;
- if (this.buyBtnStyle === 2 || this.buyBtnStyle === 4) {
- buyBtnClass += `buy-btn-border `;
- }
- if (this.buyBtnStyle === 4 || this.buyBtnStyle === 3) {
- buyBtnClass += `buy-btn-radius`;
- }
- return buyBtnClass;
- },
- btnStyle() {
- let btnStyle = ``;
- if (this.buyBtnStyle === 1 || this.buyBtnStyle === 3) {
- btnStyle += `background-color: ${this.buttonColor};color: #ffffff;`;
- } else {
- btnStyle += `border-color: ${this.buttonColor};color: ${this.buttonColor};`;
- }
- return btnStyle;
- },
- coverPicHeight() {
- if (this.goodsCoverProportion === '1-1') {
- return `702rpx`;
- } else {
- return `468rpx`;
- }
- },
- goodsClass() {
- let goodsClass = ``;
- if (this.goodsStyle === 2) {
- goodsClass += `border ${this.theme} `;
- }
- if (this.textStyle === 2) {
- goodsClass += `text-center ${this.theme} `;
- }
- return goodsClass;
- },
- tag() {
- let tag = '';
- switch (this.sign) {
- case 'miaosha':
- tag = '秒杀';
- break;
- case 'bargain':
- tag = '砍价';
- break;
- case 'pintuan':
- tag = '人团';
- break;
- case 'advance':
- tag = '预售';
- break;
- case 'pick':
- tag = 'N元任选';
- break;
- case 'composition':
- tag = '套餐组合';
- break;
- case 'gift':
- tag = '社交送礼';
- break;
- case 'flash-sale':
- tag = '限时抢购';
- break;
- case 'wholesale':
- tag = '商品批发';
- break;
- case 'exchange':
- tag = '礼品卡';
- break;
- default:
- tag = null;
- break;
- }
- return tag;
- },
- showTimer() {
- if (!(this.sign === 'miaosha' || this.sign === 'bargain' || this.sign === 'lottery' || this.sign === 'advance' || this.sign === 'flash-sale')) return false;
- return true;
- },
- },
- methods: {
- jump(data) {
- // #ifndef MP-BAIDU
- if (data.video_url && this.getVideo == 1 && data.sign !== 'lottery' && data.sign !== 'bargain' && data.sign !== 'wholesale') {
- let id = data.id;
- if (data.sign === 'advance') {
- id = data.goods_id;
- }
- if (data.sign === 'gift') {
- id = id + '&is_share=1';
- }
- uni.navigateTo({
- url: `/pages/goods/video?goods_id=${id}&sign=${data.sign}`
- });
- } else {
- uni.navigateTo({
- url: data.page_url
- });
- }
- // #endif
- // #ifdef MP-BAIDU
- uni.navigateTo({
- url: data.page_url
- });
- // #endif
- },
- isShowOriginalPrice(goods) {
- return this.isUnderLinePrice && goods.original_price && this.showGoodsPrice && goods.is_negotiable !== 1;
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .advance-member {
- margin-right: #{12rpx};
- }
- .advance-center .original-price {
- width: 100%;
- text-align: center;
- }
- .app-goods-list {
- %background-image {
- background-repeat: no-repeat;
- background-size: cover;
- background-position: center;
- }
- .goods-list {
- padding: #{24rpx 24rpx 24rpx 24rpx};
- font-size: $uni-font-size-general-one;
- .border {
- border: #{1rpx} solid #e2e2e2;
- }
- .goods-item {
- position: relative;
- .app-button-icon {
- width: #{45rpx};
- height: #{45rpx};
- display: block;
- @extend %background-image;
- }
- .app-button-icon-cart {
- background-image: url('../../../static/image/icon/cats.png');
- }
- .app-button-icon-add {
- background-image: url('../../../static/image/icon/add-to.png');
- }
- .buy-btn {
- height: #{48rpx};
- padding: 0 #{20rpx};
- }
- .buy-btn-radius {
- border-radius: #{24rpx};
- }
- .buy-btn-border {
- border: #{1rpx} solid;
- }
- .goods-tag {
- position: absolute;
- left: 0;
- top: 0;
- z-index: 10;
- width: #{64rpx};
- height: #{64rpx};
- }
- .original-price {
- font-size: $uni-font-size-weak-two;
- color: $uni-general-color-two;
- text-decoration: line-through;
- }
- .tag {
- padding: 0 #{10rpx};
- margin-right: #{8rpx};
- font-size: #{20rpx};
- line-height: 1;
- border-radius: #{28rpx};
- border: #{1rpx} solid;
- transform: rotateZ(360deg);
- }
- .timer {
- width: 100%;
- }
- .pintuan-tag {
- font-size: $uni-font-size-weak-two;
- margin: #{16rpx} #{12rpx} 0 0;
- padding: 0 #{24rpx};
- .people {
- width: #{70rpx};
- text-align: center;
- border: #{1rpx} solid;
- border-radius: #{2rpx};
- padding: #{2rpx} 0;
- }
- }
- }
- .app-list-mode {
- margin-bottom: #{32rpx};
- position: relative;
- border-radius: #{16rpx};
- .name {
- font-size: #{28rpx};
- color: #353535;
- line-height: 38upx;
- }
- .right {
- height: #{220rpx};
- }
- &:last-child {
- margin-bottom: 0;
- }
- .pintuan-tag {
- padding: 0;
- }
- .out-dialog {
- width: #{220rpx};
- height: 100%;
- position: absolute;
- z-index: 11;
- top: 0;
- left: 0;
- background-color: rgba(0,0,0,.5);
- image {
- width: #{220rpx};
- height: #{220rpx};
- }
- }
- }
- .app-column-1 {
- padding-bottom: #{24rpx};
- border-radius: #{16rpx};
- .out-dialog {
- width: 100%;
- height: #{702rpx};
- z-index: 11;
- position: absolute;
- top: 0;
- left: 0;
- background-color: rgba(0,0,0,.5);
- image {
- width: #{702rpx};
- height: #{702rpx};
- }
- }
- .goods-name {
- margin-top: #{28rpx};
- padding: 0 #{24rpx};
- font-size: #{28rpx};
- color: #353535;
- line-height: 38upx;
- }
- .price {
- margin-top: #{16rpx};
- padding: 0 #{24rpx};
- max-width: #{702rpx};
- .member-price {
- margin-left: #{10rpx};
- }
- }
- .timer {
- position: absolute;
- left: 0;
- bottom: 0;
- z-index: 10;
- }
- .pintuan-tag {
- margin: 0;
- padding-left: 0;
- }
- }
- .app-column-1-mar {
- margin-bottom: #{24rpx};
- }
- &.column-2 {
- padding: #{24rpx} #{23rpx} 0 #{23rpx};
- .app-column-2 {
- margin-bottom: #{24rpx};
- padding-bottom: #{24rpx};
- border-radius: #{16rpx};
- width: #{346rpx};
- .out-dialog {
- width: 100%;
- height: #{342rpx};
- position: absolute;
- z-index: 11;
- top: 0;
- left: 0;
- background-color: rgba(0,0,0,.5);
- image {
- width: #{342rpx};
- height: #{342rpx};
- }
- }
- .goods-name {
- font-size: #{28rpx};
- color: #353535;
- margin-top: #{24rpx};
- padding: 0 #{24rpx};
- width: #{344rpx};
- line-height: 38upx;
- }
- .price {
- margin-top: #{16rpx};
- padding: 0 #{24rpx};
- max-width: #{344rpx};
- }
- .pintuan-tag ~ .price {
- margin-top: #{16rpx};
- }
- .timer {
- position: absolute;
- left: 0;
- bottom: 0;
- z-index: 10;
- }
- }
- }
- }
- }
- .des-price {
- display: inline-block;
- padding: #{0rpx 4rpx};
- border: #{1rpx} solid;
- border-radius: #{8rpx};
- font-size: #{20rpx};
- line-height: 1.2;
- transform: rotateZ(360deg);
- }
- .dir-tag-def {
- padding: 0 #{10rpx};
- margin-right: #{8rpx};
- font-size: $uni-font-size-weak-two;
- border-radius: #{28rpx};
- }
- .seheight {
- height: #{110rpx};
- width: #{430rpx};
- }
- .default-text {
- color: #666666;
- }
- .tag-pick {
- padding: 0 #{10rpx};
- margin-right: #{8rpx};
- font-size: $uni-font-size-weak-two;
- border-radius: #{28rpx};
- }
- .goods-price {
- font-size: #{30upx};
- line-height: 1.1;
- }
- .app-percentage {
- height: #{20rpx};
- border-radius: #{12rpx};
- overflow: hidden;
- >view {
- height: #{20rpx};
- border-radius: #{12rpx};
- }
- }
- .flash-sale {
- padding: 5upx 10upx;
- font-size: 20upx;
- color: #fff;
- line-height: 1;
- border-radius: 14upx;
- margin-right: 10upx;
- display: inline-block;
- }
- .flash-sale-dis {
- margin-bottom: 10upx;
- }
- </style>
|