123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <template>
- <view class="list">
- <view class="recommend">
- <view class="top">
- <image
- src="../../../static/images/recommend.png"
- style="width: 124rpx; height: 30rpx"
- mode="scaleToFill"
- />
- </view>
- <view class="bottom">
- <scroll-view
- scroll-x
- class="u-flex"
- style="column: gap 28rpx; display: flex"
- >
- <view class="u-flex" style="column-gap: 16rpx">
- <view
- class=""
- v-for="(item, idx) in swiptlist"
- :key="idx"
- @click="todetail(item.id)"
- >
- <image
- :src="item.image"
- style="width: 156rpx; height: 156rpx"
- mode=""
- >
- </image>
- <view class="title">
- {{ item.name_cn }}
- </view>
- <view class="title" v-if="language == 'en-US'">
- {{ item.name_en }}
- </view>
- <view class="title" v-if="language == 'es-ES'">
- {{ item.name_es }}
- </view>
- <view class="title" v-if="language == 'it-IT'">
- {{ item.name_ita }}
- </view>
- <view class="money" style="color: #f83224; font-size: 20rpx">
- <text>¥</text>
- <text style="font-size: 28rpx">{{
- item.is_discount == 0
- ? item.discount_price.slice(0, -3)
- : item.price.slice(0, -3)
- }}</text>
- <text>{{
- item.is_discount == 0
- ? item.discount_price.slice(-3)
- : item.price.slice(-3)
- }}</text>
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- props: {
- swiptlist: {
- typeof: Array,
- default: () => {
- return [];
- },
- },
- },
- computed: {
- i18n() {
- return this.$t("index");
- },
- },
- methods: {
- //跳转商品详情
- todetail(id) {
- uni.reLaunch({
- url: "/pageA/productdetails?id=" + id,
- });
- },
- },
- };
- </script>
- <style scoped lang="scss">
- .list {
- .recommend {
- margin-top: 20rpx;
- .title {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 22rpx;
- color: #222222;
- line-height: 32rpx;
- text-align: left;
- font-style: normal;
- width: 148rpx;
- height: 64rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- -webkit-line-clamp: 2;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- word-break: break-all;
- }
- .top {
- width: 702rpx;
- height: 64rpx;
- background: linear-gradient(
- 180deg,
- #ffe7e3 0%,
- rgba(255, 255, 255, 1) 100%
- );
- border-radius: 16rpx 16rpx 0 0;
- padding: 24rpx 22rpx;
- box-sizing: border-box;
- }
- .bottom {
- padding: 0 20rpx 22rpx;
- box-sizing: border-box;
- background: #fff;
- }
- .money {
- font-family: HarmonyOS_Sans_Medium;
- font-size: 48rpx;
- color: #f83224;
- line-height: 38rpx;
- text-align: left;
- font-style: normal;
- // font-weight: 500;
- font-weight: bold;
- }
- }
- }
- </style>
|