setMealItem.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <div class="set-meal-item">
  3. <div class="set-meal-item-title">
  4. {{ packageType[data.cloudSetMealType] }} 安卓{{ data.androidVersion }}
  5. </div>
  6. <img src="@/assets/image/claimCloudPhone/vip-bg.png" alt="" />
  7. <div :class="['set-meal-item_content', { 'expand-open': isExpand }]">
  8. <div
  9. v-for="item in data.mealList"
  10. :key="item.id"
  11. class="set-meal-item_content-item"
  12. >
  13. <div class="set-meal-item_content-item_left">
  14. <div v-if="!type" class="invited">
  15. <img :src="require(`@/assets/image/${item.phoneType}_icon.png`)" />
  16. <div class="invited-info">
  17. <div>{{ packageType[item.phoneType] }}{{ item.day }}天套餐</div>
  18. <div>
  19. <div class="actual-price">
  20. <span>¥</span>{{ item.actualPrice }}
  21. </div>
  22. <div v-if="item.originalPrice" class="original-price">
  23. <span>¥</span>{{ item.originalPrice }}
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. <div v-else>
  29. {{ packageType[item.phoneType] }}{{ item.day }}天套餐
  30. </div>
  31. </div>
  32. <div class="set-meal-item_content-item_right">
  33. <div class="set-meal-item_content-item_right-price" v-if="type">
  34. <span>¥</span
  35. >{{ item.originalPrice ? item.originalPrice : item.actualPrice }}
  36. </div>
  37. <div @click="add(item)">
  38. {{ type ? '0元领' : '新增云手机' }}
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. <div class="expand" v-if="data.mealList.length > 2">
  44. <span @click="isExpand = !isExpand">
  45. {{ isExpand ? '收起' : '查看全部' }}
  46. <van-icon :name="isExpand ? 'arrow-up' : 'arrow-down'" />
  47. </span>
  48. </div>
  49. </div>
  50. </template>
  51. <script>
  52. export default {
  53. name: 'setMealItem',
  54. props: {
  55. type: {
  56. type: Number,
  57. default: 1, // 0是被邀请人 1是邀请人
  58. },
  59. data: {
  60. type: Object,
  61. default: () => {
  62. return {};
  63. },
  64. },
  65. },
  66. data() {
  67. return {
  68. isExpand: false,
  69. packageType: {
  70. VIP: '星动',
  71. SVIP: '星曜',
  72. STARRYSKY: '星空',
  73. STAR: '唔即',
  74. STARPRO: '唔即Pro',
  75. },
  76. };
  77. },
  78. mounted() {},
  79. methods: {
  80. add(data) {
  81. if (this.type) {
  82. this.$router.push('/claimCloudPhone/1?menuRuleId=' + data.id);
  83. return;
  84. }
  85. this.$emit('buy', data);
  86. },
  87. },
  88. };
  89. </script>
  90. <style lang="less" scoped>
  91. .set-meal-item {
  92. background: #ffffff;
  93. border-radius: 14px;
  94. border: 1px solid #feffef;
  95. margin-top: 12px;
  96. padding: 16px;
  97. font-family: PingFangSC, PingFang SC;
  98. & > img {
  99. height: 59px;
  100. width: 100%;
  101. margin-top: 12px;
  102. }
  103. .set-meal-item_content {
  104. max-height: 130px;
  105. overflow: hidden;
  106. &.expand-open {
  107. max-height: none;
  108. }
  109. .set-meal-item_content-item {
  110. padding: 14px 0;
  111. border-bottom: 1px solid #f0f0f0;
  112. display: flex;
  113. justify-content: space-between;
  114. .set-meal-item_content-item_left {
  115. display: flex;
  116. align-items: center;
  117. font-weight: bold;
  118. font-size: 14px;
  119. color: #6d2b12;
  120. line-height: 20px;
  121. text-align: left;
  122. font-style: normal;
  123. .invited {
  124. display: flex;
  125. align-items: center;
  126. & > img {
  127. width: 36px;
  128. height: 36px;
  129. }
  130. .invited-info {
  131. margin-left: 8px;
  132. & > div:last-of-type {
  133. display: flex;
  134. & > div {
  135. font-weight: bold;
  136. line-height: 20px;
  137. font-style: normal;
  138. }
  139. .actual-price {
  140. font-size: 16px;
  141. color: #f04646;
  142. }
  143. .original-price {
  144. font-size: 12px;
  145. color: #bbbbbb;
  146. line-height: 23px;
  147. text-decoration: line-through;
  148. margin-left: 8px;
  149. }
  150. }
  151. }
  152. }
  153. }
  154. .set-meal-item_content-item_right {
  155. display: flex;
  156. align-items: center;
  157. .set-meal-item_content-item_right-price {
  158. font-weight: bold;
  159. font-size: 16px;
  160. color: #f04646;
  161. line-height: 20px;
  162. text-align: left;
  163. font-style: normal;
  164. display: flex;
  165. align-items: center;
  166. margin-right: 5px;
  167. text-decoration: line-through;
  168. }
  169. & > div:last-of-type {
  170. height: 30px;
  171. padding: 6px 12px;
  172. background: linear-gradient(178deg, #fd8c50 0%, #fc3307 100%);
  173. border-radius: 21px;
  174. font-weight: bold;
  175. font-size: 14px;
  176. color: #ffffff;
  177. line-height: 18px;
  178. text-align: left;
  179. font-style: normal;
  180. }
  181. }
  182. }
  183. }
  184. .set-meal-item-title {
  185. font-weight: bold;
  186. font-size: 18px;
  187. color: #6d2b12;
  188. line-height: 20px;
  189. text-align: left;
  190. font-style: normal;
  191. }
  192. .expand {
  193. display: flex;
  194. justify-content: center;
  195. font-weight: 400;
  196. font-size: 12px;
  197. color: #7d6156;
  198. line-height: 16px;
  199. text-align: center;
  200. font-style: normal;
  201. margin-top: 16px;
  202. }
  203. }
  204. </style>