detail.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <view>
  3. <view style="background-color: #FFFFFF;">
  4. <view >
  5. <image :src="$method.splitImgHost(detail.coverUrl)" style="height: 461rpx;width: 100%;"></image>
  6. <view style="padding:20rpx">
  7. <view style="display: flex;margin-top: 13rpx;">
  8. <view class="yearTag">{{detail.year}}</view>
  9. <view class="titleTag">{{detail.goodsName}}</view>
  10. </view>
  11. <view style="display: flex;justify-content: space-between;margin-top: 13rpx;">
  12. <view class="noteTag"><image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
  13. 共 <text class="blackFont">6</text> 科 <text class="blackFont">120</text> 节 <text class="blackFont">60</text> 学时</view>
  14. </view>
  15. </view>
  16. </view>
  17. <u-line color="#D6D6DB" />
  18. <view>
  19. <view style="width: 160px;margin: 0 auto;"><u-tabs :list="list" item-width="150" font-size="24" bar-width="110" :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
  20. </view>
  21. <u-line color="#D6D6DB" />
  22. </view>
  23. <view style="padding: 20rpx;">
  24. <view class="content">
  25. <view v-html="detail.mobileDetailHtml"></view>
  26. </view>
  27. </view>
  28. <view class="bottomBox">
  29. <view class="priceTag">¥ {{detail.standPrice}}</view>
  30. <view style="display: flex;color: #FFFFFF;align-items: center;">
  31. <view class="btn1" @click="addCart">加购物车</view>
  32. <view class="btn2" @click="buy">立即购买</view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import { mapGetters } from 'vuex';
  39. export default {
  40. data() {
  41. return {
  42. id:0,
  43. list: [
  44. {
  45. name: '详情'
  46. },
  47. {
  48. name: '大纲'
  49. }
  50. ],
  51. current:0,
  52. detail:{}
  53. };
  54. },
  55. onUnload() {
  56. },
  57. computed: { ...mapGetters(['userInfo']) },
  58. onLoad(option) {
  59. this.id = option.id;
  60. this.getDetail()
  61. },
  62. onShow() {
  63. },
  64. methods: {
  65. getDetail() {
  66. let self = this
  67. this.$api.goodsDetail(this.id).then(res => {
  68. console.log(res)
  69. if(res.data.code==200){
  70. self.detail = res.data.data
  71. console.log(self.detail.mobileDetailHtml)
  72. }
  73. });
  74. },
  75. buy(){
  76. if(this.$method.isGoLogin()){
  77. return
  78. }
  79. this.$navTo.togo('/pages2/order/confirm_list');
  80. },
  81. addCart(){
  82. if(this.$method.isGoLogin()){
  83. return
  84. }
  85. uni.showToast({
  86. title: '添加成功',
  87. duration: 1000
  88. });
  89. },
  90. open(item){
  91. item.showChildren = !item.showChildren
  92. },
  93. change(index){
  94. this.current = index;
  95. }
  96. }
  97. };
  98. </script>
  99. <style >
  100. page{
  101. background-color: #EAEEF1;
  102. }
  103. </style>
  104. <style scope>
  105. .content{
  106. background-color: #FFFFFF;
  107. }
  108. .btn2{
  109. width: 200rpx;
  110. height: 64rpx;
  111. background: linear-gradient(0deg, #FFB102, #FD644F);
  112. box-shadow: 0rpx 10rpx 16rpx 4rpx rgba(1, 99, 235, 0.04);
  113. border-radius: 32rpx;
  114. line-height: 64rpx;
  115. text-align: center;
  116. }
  117. .btn1{
  118. width: 200rpx;
  119. height: 64rpx;
  120. background: linear-gradient(0deg, #015EEA, #00C0FA);
  121. border-radius: 32rpx;
  122. line-height: 64rpx;
  123. text-align: center;
  124. margin-right: 20rpx;
  125. }
  126. .bottomBox{
  127. position: fixed;
  128. bottom: 0;
  129. width: 100%;
  130. left: 0;
  131. height:98rpx ;
  132. background-color: #FFFFFF;
  133. display: flex;
  134. justify-content: space-between;
  135. align-items: center;
  136. padding: 0 30rpx;
  137. }
  138. .blackFont{
  139. color: #333333;
  140. margin: 0 4rpx;
  141. }
  142. .wk_icon{
  143. width: 24rpx;
  144. height: 24rpx;
  145. margin-right: 12rpx;
  146. }
  147. .noteTag{
  148. ont-size: 24rpx;
  149. font-family: PingFang SC;
  150. font-weight: 500;
  151. color: #999999;
  152. align-items: center;
  153. }
  154. .priceTag{
  155. font-size: 30rpx;
  156. font-family: PingFang SC;
  157. font-weight: bold;
  158. color: #FF2D55;
  159. }
  160. .titleTag{
  161. font-size: 32rpx;
  162. font-weight: bold;
  163. color: #333333;
  164. margin-left: 8rpx;
  165. }
  166. .yearTag{
  167. width: 80rpx;
  168. height: 32rpx;
  169. background: #EBF5FF;
  170. border: 2rpx solid #007AFF;
  171. border-radius: 16rpx;
  172. font-size: 24rpx;
  173. color: #007AFF;
  174. text-align: center;
  175. line-height: 32rpx;
  176. }
  177. .itemBox{
  178. background: #FFFFFF;
  179. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  180. border-radius: 24rpx;
  181. width: 100%;
  182. padding: 20rpx;
  183. margin-bottom: 20rpx;
  184. }
  185. </style>