setMealItem.vue 5.2 KB

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