recommen.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view class="scan_course">
  3. <nav-bar title="商品列表" class="navbar"></nav-bar>
  4. <view class="list_item" v-for="(item, index) in courseList" :key="index">
  5. <view class="course_content">
  6. <view class="c_title">{{ item.goodsName }}</view>
  7. <view class="c_downs">
  8. <view class="img">
  9. <image :src="$method.splitImgHost(item.coverUrl, true)"></image>
  10. <view class="time" v-if="item.year">{{
  11. item.year ? item.year : ""
  12. }}</view>
  13. </view>
  14. <view class="text">
  15. <view class="desc">
  16. <view class="left">
  17. <text class="mon_t">¥ {{ item.standPrice }}</text>
  18. <text v-if="item.linePrice" class="sale"> ¥ </text>
  19. <text v-if="item.linePrice" class="price_line"
  20. >&nbsp;{{ item.linePrice }}</text
  21. >
  22. </view>
  23. <view class="right">
  24. <view class="regiser_row" @click="toBuy(item)">立即购买</view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. data() {
  36. return { courseList: [] };
  37. },
  38. onLoad({ scene }) {
  39. this.courseList = [];
  40. if (option.scene) {
  41. let optObj = {};
  42. let arrs = decodeURIComponent(scene).split("&");
  43. for (let i = 0; i < arrs.length; i++) {
  44. optObj[arrs[i].split("=")[0]] = arrs[i].split("=")[1];
  45. }
  46. this.getCourseList(optObj.sharekey);
  47. }
  48. },
  49. methods: {
  50. getCourseList(id) {
  51. this.$api.actGoodsList(id).then((res) => {
  52. this.courseList = res.data.data;
  53. });
  54. },
  55. toBuy(item) {
  56. if (item.goodsType == 2) {
  57. uni.navigateTo({
  58. url: "/pages2/bank/detail?id=" + item.goodsId,
  59. });
  60. } else {
  61. uni.navigateTo({
  62. url:
  63. "/pages3/course/detail?id=" +
  64. item.goodsId +
  65. "&goodsType=" +
  66. item.goodsType,
  67. });
  68. }
  69. },
  70. },
  71. };
  72. </script>
  73. <style lang="scss" scoped>
  74. .scan_course {
  75. padding: 32rpx 32rpx 0;
  76. .list_item {
  77. padding: 24rpx;
  78. // height: 278rpx;
  79. background: #ffffff;
  80. box-shadow: 0rpx 0rpx 20rpx 1rpx rgba(1, 99, 235, 0.1);
  81. border-radius: 24rpx;
  82. background: #fff;
  83. margin-bottom: 32rpx;
  84. display: flex;
  85. align-items: center;
  86. .c_title {
  87. font-size: 32rpx;
  88. font-weight: bold;
  89. margin-bottom: 24rpx;
  90. font-weight: bold;
  91. color: #222222;
  92. }
  93. .c_downs {
  94. display: flex;
  95. }
  96. .img {
  97. position: relative;
  98. margin-right: 24rpx;
  99. border-radius: 16rpx;
  100. overflow: hidden;
  101. width: 204rpx;
  102. height: 120rpx;
  103. image {
  104. width: 100%;
  105. height: 100%;
  106. }
  107. .time {
  108. position: absolute;
  109. bottom: 0;
  110. right: 0;
  111. width: 80rpx;
  112. height: 32rpx;
  113. background: rgba(1, 25, 45, 0.4);
  114. color: #fff;
  115. text-align: center;
  116. line-height: 32rpx;
  117. font-size: 24rpx;
  118. border-radius: 10rpx 0px 10rpx 0px;
  119. }
  120. }
  121. .text {
  122. width: 440rpx;
  123. position: relative;
  124. display: flex;
  125. flex-direction: column;
  126. justify-content: space-between;
  127. height: 120rpx;
  128. .desc {
  129. margin-top: 10rpx;
  130. display: flex;
  131. align-items: center;
  132. justify-content: space-between;
  133. width: 100%;
  134. .left {
  135. flex: 1;
  136. color: #333;
  137. font-size: 26rpx;
  138. .mon_t {
  139. font-weight: bold;
  140. color: #fc3f3f;
  141. font-size: 36rpx;
  142. }
  143. .sale {
  144. color: #999999;
  145. font-size: 24rpx;
  146. margin-left: 8rpx;
  147. }
  148. .price_line {
  149. color: #999999;
  150. font-size: 24rpx;
  151. text-decoration: line-through;
  152. font-weight: 400;
  153. }
  154. }
  155. .right {
  156. font-size: 24rpx;
  157. font-weight: bold;
  158. padding-right: 20rpx;
  159. .regiser_row {
  160. width: 144rpx;
  161. height: 52rpx;
  162. line-height: 52rpx;
  163. text-align: center;
  164. border-radius: 16rpx;
  165. background-color: #fc3f3f;
  166. color: #fff;
  167. font-weight: 500;
  168. font-size: 26rpx;
  169. }
  170. }
  171. }
  172. }
  173. }
  174. }
  175. </style>