setMealItem.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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/VIP_icon.png`)" />
  16. <div class="invited-info">
  17. <div>{{ packageType[item.phoneType] }}{{ item.day }}天套餐</div>
  18. <div>
  19. <div><span>¥</span>30</div>
  20. <div><span>¥</span>30</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. console.log(this.$route.query)
  76. },
  77. methods: {
  78. add(data) {
  79. if (this.type) {
  80. console.log(this.$route.query)
  81. this.$router.push('/claimCloudPhone/1?menuRuleId=' + data.id)
  82. // return
  83. }
  84. },
  85. },
  86. };
  87. </script>
  88. <style lang="less" scoped>
  89. .set-meal-item {
  90. background: #ffffff;
  91. border-radius: 14px;
  92. border: 1px solid #feffef;
  93. margin-top: 12px;
  94. padding: 16px;
  95. font-family: PingFangSC, PingFang SC;
  96. & > img {
  97. height: 59px;
  98. width: 100%;
  99. margin-top: 12px;
  100. }
  101. .set-meal-item_content {
  102. max-height: 130px;
  103. overflow: hidden;
  104. &.expand-open {
  105. max-height: none;
  106. }
  107. .set-meal-item_content-item {
  108. padding: 14px 0;
  109. border-bottom: 1px solid #f0f0f0;
  110. display: flex;
  111. justify-content: space-between;
  112. .set-meal-item_content-item_left {
  113. display: flex;
  114. align-items: center;
  115. font-weight: bold;
  116. font-size: 14px;
  117. color: #6d2b12;
  118. line-height: 20px;
  119. text-align: left;
  120. font-style: normal;
  121. .invited {
  122. display: flex;
  123. align-items: center;
  124. & > img {
  125. width: 36px;
  126. height: 36px;
  127. }
  128. .invited-info {
  129. margin-left: 8px;
  130. & > div:last-of-type {
  131. display: flex;
  132. & > div {
  133. font-weight: bold;
  134. line-height: 20px;
  135. font-style: normal;
  136. }
  137. & > div:first-of-type {
  138. font-size: 16px;
  139. color: #f04646;
  140. }
  141. & > div:last-of-type {
  142. font-size: 12px;
  143. color: #bbbbbb;
  144. line-height: 23px;
  145. text-decoration: line-through;
  146. margin-left: 8px;
  147. }
  148. }
  149. }
  150. }
  151. }
  152. .set-meal-item_content-item_right {
  153. display: flex;
  154. align-items: center;
  155. .set-meal-item_content-item_right-price {
  156. font-weight: bold;
  157. font-size: 16px;
  158. color: #f04646;
  159. line-height: 20px;
  160. text-align: left;
  161. font-style: normal;
  162. display: flex;
  163. align-items: center;
  164. margin-right: 5px;
  165. text-decoration: line-through;
  166. }
  167. & > div:last-of-type {
  168. height: 30px;
  169. padding: 6px 12px;
  170. background: linear-gradient(178deg, #fd8c50 0%, #fc3307 100%);
  171. border-radius: 21px;
  172. font-weight: bold;
  173. font-size: 14px;
  174. color: #ffffff;
  175. line-height: 18px;
  176. text-align: left;
  177. font-style: normal;
  178. }
  179. }
  180. }
  181. }
  182. .set-meal-item-title {
  183. font-weight: bold;
  184. font-size: 18px;
  185. color: #6d2b12;
  186. line-height: 20px;
  187. text-align: left;
  188. font-style: normal;
  189. }
  190. .expand {
  191. display: flex;
  192. justify-content: center;
  193. font-weight: 400;
  194. font-size: 12px;
  195. color: #7d6156;
  196. line-height: 16px;
  197. text-align: center;
  198. font-style: normal;
  199. margin-top: 16px;
  200. }
  201. }
  202. </style>