123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- <template>
- <div class="set-meal-item">
- <div class="set-meal-item-title">
- {{ packageType[data.cloudSetMealType] }} 安卓{{ data.androidVersion }}
- </div>
- <img :src="IMG_URL + '/' + data.promotionalImages" alt="" />
- <div :class="['set-meal-item_content', { 'expand-open': isExpand }]">
- <div
- v-for="item in data.mealList"
- :key="item.id"
- class="set-meal-item_content-item"
- >
- <div class="set-meal-item_content-item_left">
- <div v-if="!type" class="invited">
- <img :src="require(`@/assets/image/${item.phoneType}_icon.png`)" />
- <div class="invited-info">
- <div>{{ packageType[item.phoneType] }}{{ item.day }}天套餐</div>
- <div>
- <div class="actual-price">
- <span>¥</span>{{ item.actualPrice }}
- </div>
- <div v-if="item.originalPrice" class="original-price">
- <span>¥</span>{{ item.originalPrice }}
- </div>
- </div>
- </div>
- </div>
- <div v-else>
- {{ packageType[item.phoneType] }}{{ item.day }}天套餐
- </div>
- </div>
- <div class="set-meal-item_content-item_right">
- <div class="set-meal-item_content-item_right-price" v-if="type">
- <span>¥</span
- >{{ item.originalPrice ? item.originalPrice : item.actualPrice }}
- </div>
- <div @click="add(item)" :class="{ mark: type }">
- {{ type ? '0元领' : '新增云手机' }}
- </div>
- </div>
- </div>
- </div>
- <div class="expand" v-if="data.mealList.length > 2">
- <span @click="isExpand = !isExpand">
- {{ isExpand ? '收起' : '查看全部' }}
- <van-icon :name="isExpand ? 'arrow-up' : 'arrow-down'" />
- </span>
- </div>
- </div>
- </template>
- <script>
- export default {
- name: 'setMealItem',
- props: {
- type: {
- type: Number,
- default: 1, // 0是被邀请人 1是邀请人
- },
- data: {
- type: Object,
- default: () => {
- return {};
- },
- },
- },
- data() {
- return {
- isExpand: false,
- packageType: {
- VIP: '星动',
- SVIP: '星曜',
- STARRYSKY: '星空',
- STAR: '唔即',
- STARPRO: '唔即Pro',
- },
- IMG_URL: process.env.IMG_URL,
- };
- },
- mounted() {},
- methods: {
- add(data) {
- if (this.type) {
- this.$axios
- .$get('activity/v5/assist/bargaining/current/bargainingStatus', {
- params: {
- operateActivityId: localStorage.getItem('auth.operateActivityId'),
- },
- })
- .then((res) => {
- if (res.success) {
- if (!res.data.bargainingStatus) {
- let url = '/claimCloudPhone/1?menuRuleId=' + data.id;
- if (this.$route.query.userCardId) {
- url += `&userCardId=${this.$route.query.userCardId}`;
- }
- this.$router.push(url);
- } else {
- if (res.data.bargainingStatus === 6) {
- setTimeout(() => {
- this.$toast('活动已到期');
- });
- return;
- }
- setTimeout(() => {
- this.$toast('已参加正在砍价活动,请退出后重新进入');
- });
- }
- }
- })
- .finally(() => {
- this.$toast.clear();
- });
- return;
- }
- this.$emit('buy', data);
- },
- },
- computed: {
- list() {
- this.data.mealList.length > 10
- ? this.data.mealList.slice(0, 9)
- : this.data.mealList;
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .set-meal-item {
- background: #ffffff;
- border-radius: 14px;
- border: 1px solid #feffef;
- margin-top: 12px;
- padding: 16px;
- font-family: PingFangSC, PingFang SC;
- & > img {
- height: 59px;
- width: 100%;
- margin-top: 12px;
- }
- .set-meal-item_content {
- max-height: 142px;
- overflow: hidden;
- &.expand-open {
- max-height: none;
- }
- .set-meal-item_content-item {
- padding: 14px 0;
- border-bottom: 1px solid #f0f0f0;
- display: flex;
- justify-content: space-between;
- .set-meal-item_content-item_left {
- display: flex;
- align-items: center;
- font-family: PingFangSC, PingFang SC;
- font-weight: 500;
- font-size: 14px;
- color: #6d2b12;
- line-height: 20px;
- text-align: left;
- font-style: normal;
- .invited {
- display: flex;
- align-items: center;
- & > img {
- width: 36px;
- height: 36px;
- }
- .invited-info {
- margin-left: 8px;
- & > div:last-of-type {
- display: flex;
- & > div {
- font-weight: bold;
- line-height: 20px;
- font-style: normal;
- }
- .actual-price {
- font-size: 16px;
- color: #f04646;
- }
- .original-price {
- font-size: 12px;
- color: #bbbbbb;
- line-height: 23px;
- text-decoration: line-through;
- margin-left: 8px;
- }
- }
- }
- }
- }
- .set-meal-item_content-item_right {
- display: flex;
- align-items: center;
- .set-meal-item_content-item_right-price {
- font-weight: bold;
- font-size: 16px;
- color: #f04646;
- line-height: 20px;
- text-align: left;
- font-style: normal;
- display: flex;
- align-items: center;
- margin-right: 5px;
- text-decoration: line-through;
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- font-weight: bold;
- }
- & > div:last-of-type {
- height: 30px;
- padding: 6px 12px;
- background: linear-gradient(178deg, #fd8c50 0%, #fc3307 100%);
- border-radius: 21px;
- font-weight: bold;
- font-size: 14px;
- color: #ffffff;
- line-height: 18px;
- text-align: left;
- font-style: normal;
- &.mark {
- height: 42px;
- line-height: 42px;
- font-size: 24px;
- padding: 0 32px;
- }
- }
- }
- }
- }
- .set-meal-item-title {
- font-family: PingFangSC, PingFang SC;
- font-weight: 500;
- font-size: 18px;
- color: #6d2b12;
- line-height: 20px;
- text-align: left;
- font-style: normal;
- }
- .expand {
- display: flex;
- justify-content: center;
- font-weight: 400;
- font-size: 12px;
- color: #7d6156;
- line-height: 16px;
- text-align: center;
- font-style: normal;
- margin-top: 10px;
- }
- }
- </style>
|