retailact.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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. <view
  18. class="priceTag"
  19. v-if="
  20. !item.specTemplateId || (!item.maxPrice && !item.minPrice)
  21. "
  22. >
  23. {{ item.standPrice === 0 ? "免费" : `¥${item.standPrice}` }}
  24. </view>
  25. <!-- 范围价格 -->
  26. <view v-else class="priceTag">
  27. <view>{{ item.minPrice }}</view>
  28. <template v-if="item.minPrice != item.maxPrice">
  29. <text>-</text>
  30. <view>{{ item.maxPrice }}</view>
  31. </template>
  32. </view>
  33. <text v-if="item.linePrice" class="sale">¥ </text>
  34. <text v-if="item.linePrice" class="price_line">
  35. {{ item.linePrice }}</text
  36. >
  37. </view>
  38. <view class="right">
  39. <view class="regiser_row" @click="toBuy(item)">立即购买</view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- <view class="tip"
  47. >温馨提示:在线课程属虚拟商品,活动期间购买不予退款,请按需购买</view
  48. > -->
  49. </view>
  50. </template>
  51. <script>
  52. import { tenantId, BASE_URL } from "@/common/request.js";
  53. export default {
  54. data() {
  55. return {
  56. courseList: [],
  57. };
  58. },
  59. onLoad(options) {
  60. this.options = options;
  61. this.getCourseList();
  62. },
  63. methods: {
  64. getCourseList() {
  65. this.$api.fxGoodsList(this.options.distributionId).then((res) => {
  66. if (res.data.code == 200) {
  67. this.courseList = res.data.data;
  68. } else {
  69. this.$u.toast(res.data.msg);
  70. }
  71. });
  72. },
  73. addParam(item) {
  74. let str = "?id=" + item.goodsId + "&goodsType=" + item.goodsType;
  75. if (this.options.distributionCode) {
  76. str += "&distributionCode=" + this.options.distributionCode;
  77. }
  78. if (this.options.linkCode) {
  79. str += "&linkCode=" + this.options.linkCode;
  80. }
  81. return str;
  82. },
  83. toBuy(item) {
  84. if (item.goodsType == 2) {
  85. uni.navigateTo({
  86. url: "/pages2/bank/detail" + this.addParam(item),
  87. });
  88. } else {
  89. uni.navigateTo({
  90. url: "/pages3/course/detail" + this.addParam(item),
  91. });
  92. }
  93. },
  94. },
  95. };
  96. </script>
  97. <style lang="scss" scoped>
  98. .scan_course {
  99. padding: 32rpx 32rpx 0;
  100. .list_item {
  101. padding: 24rpx;
  102. // height: 278rpx;
  103. background: #ffffff;
  104. box-shadow: 0rpx 0rpx 20rpx 1rpx rgba(1, 99, 235, 0.1);
  105. border-radius: 24rpx;
  106. background: #fff;
  107. margin-bottom: 32rpx;
  108. display: flex;
  109. align-items: center;
  110. .c_title {
  111. font-size: 32rpx;
  112. font-weight: bold;
  113. margin-bottom: 24rpx;
  114. font-weight: bold;
  115. color: #222222;
  116. }
  117. .c_downs {
  118. display: flex;
  119. }
  120. .img {
  121. position: relative;
  122. margin-right: 24rpx;
  123. border-radius: 16rpx;
  124. overflow: hidden;
  125. width: 204rpx;
  126. height: 120rpx;
  127. image {
  128. width: 100%;
  129. height: 100%;
  130. }
  131. .time {
  132. position: absolute;
  133. bottom: 0;
  134. right: 0;
  135. width: 80rpx;
  136. height: 32rpx;
  137. background: rgba(1, 25, 45, 0.4);
  138. color: #fff;
  139. text-align: center;
  140. line-height: 32rpx;
  141. font-size: 24rpx;
  142. border-radius: 10rpx 0px 10rpx 0px;
  143. }
  144. }
  145. .text {
  146. width: 440rpx;
  147. position: relative;
  148. display: flex;
  149. flex-direction: column;
  150. justify-content: space-between;
  151. height: 120rpx;
  152. .desc {
  153. margin-top: 20rpx;
  154. display: flex;
  155. align-items: center;
  156. justify-content: space-between;
  157. width: 100%;
  158. .left {
  159. flex: 1;
  160. color: #333;
  161. font-size: 26rpx;
  162. .sale {
  163. color: #999999;
  164. font-size: 24rpx;
  165. margin-left: 8rpx;
  166. }
  167. .price_line {
  168. color: #999999;
  169. font-size: 24rpx;
  170. text-decoration: line-through;
  171. font-weight: 400;
  172. }
  173. }
  174. .right {
  175. font-size: 24rpx;
  176. font-weight: bold;
  177. padding-right: 20rpx;
  178. .regiser_row {
  179. width: 144rpx;
  180. height: 52rpx;
  181. line-height: 52rpx;
  182. text-align: center;
  183. border-radius: 16rpx;
  184. background-color: #fc3f3f;
  185. color: #fff;
  186. font-weight: 500;
  187. font-size: 26rpx;
  188. }
  189. }
  190. }
  191. }
  192. .priceTag {
  193. display: flex;
  194. font-size: 32rpx;
  195. font-family: PingFang SC;
  196. font-weight: bold;
  197. color: #fc3f3f;
  198. view::before {
  199. content: "¥";
  200. font-size: 24rpx;
  201. font-weight: bold;
  202. }
  203. }
  204. }
  205. .tip {
  206. text-align: center;
  207. color: #a7b0b8;
  208. padding: 16rpx 30rpx 0;
  209. }
  210. }
  211. </style>