liveDetail.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view class="container">
  3. <view class="popup-open" @click="showGoods()">
  4. <view class="iconfont iconzhibo-shangpin"></view>
  5. </view>
  6. <uni-popup ref="popup" type="bottom">
  7. <view class="popup-box">
  8. <view class="popup-close" @click="closeGoods()">收起</view>
  9. <scroll-view scroll-y="true" class="good-box">
  10. <view class="goods-row" v-for="item in goodsList" @click="goToGoodDetails(item)">
  11. <cover-image class="goods-img" :src="item.imgPath"></cover-image>
  12. <view class="goods-info">
  13. <view class="goods-name">{{item.productName}}</view>
  14. <view class="goods-sales">{{item.sellCount}}人付款</view>
  15. <view class="goods-number">
  16. <text class="goods-icon">¥</text>
  17. <text class="goods-spec">{{item.bizPrice}}</text>
  18. <text class="price">原价:{{item.originalPrice}}</text>
  19. </view>
  20. </view>
  21. <view class="more-button">
  22. <view class="iconfont icongengduo"></view>
  23. </view>
  24. </view>
  25. </scroll-view>
  26. </view>
  27. </uni-popup>
  28. <u-top-tips ref="uTips"></u-top-tips>
  29. </view>
  30. </template>
  31. <script>
  32. const NET = require('@/utils/request')
  33. const API = require('@/config/api')
  34. export default {
  35. data() {
  36. return {
  37. videoType: '',
  38. goodsList: [],
  39. }
  40. },
  41. onLoad(options) {
  42. this.videoType = options.videoType
  43. NET.request(API.getLiveGoodsDetail + options.liveId, {}, 'GET').then(res => {
  44. this.goodsList = res.data
  45. }).catch(res => {
  46. this.$refs.uTips.show({
  47. title: '获取商品列表失败',
  48. type: 'warning',
  49. })
  50. })
  51. },
  52. methods: {
  53. // 打开弹窗
  54. showGoods() {
  55. this.$refs.popup.open()
  56. },
  57. // 关闭弹窗
  58. closeGoods() {
  59. this.$refs.popup.close()
  60. },
  61. goToGoodDetails() {
  62. uni.navigateTo({
  63. url: '/pagesGood/goodDetails?goodId=' + item.productId
  64. });
  65. },
  66. },
  67. }
  68. </script>
  69. <style lang="less" scoped>
  70. page {
  71. width: 100%;
  72. height: 100%;
  73. }
  74. .container {
  75. width: 100%;
  76. height: 100;
  77. float: left;
  78. position: relative;
  79. .popup-open {
  80. width: 50px;
  81. height: 50px;
  82. position: fixed;
  83. bottom: 15px;
  84. right: 15px;
  85. background: #52A63A;
  86. border-radius: 50%;
  87. text-align: center;
  88. line-height: 50px;
  89. .iconzhibo-shangpin {
  90. color: #FFFFFF;
  91. font-size: 34px;
  92. }
  93. }
  94. .popup-box {
  95. width: 100%;
  96. height: 265px;
  97. float: left;
  98. background-color: #FFFFFF;
  99. border-radius: 15px 15px 0px 0px;
  100. box-sizing: border-box;
  101. padding: 16px 0 0 0;
  102. position: relative;
  103. .popup-close {
  104. width: 100%;
  105. height: 26px;
  106. float: left;
  107. box-sizing: border-box;
  108. padding: 10px 15px 0 15px;
  109. font-size: 15px;
  110. font-family: PingFang SC;
  111. color: #52A63A;
  112. line-height: 16px;
  113. }
  114. .good-box {
  115. width: 100%;
  116. height: calc(100% - 26px);
  117. box-sizing: border-box;
  118. padding: 0 0 10px 0;
  119. overflow: auto;
  120. position: relative;
  121. .goods-row:first-child {
  122. margin-top: 12px;
  123. }
  124. .goods-row {
  125. width: calc(100% - 30px);
  126. height: 104px;
  127. float: left;
  128. background: #FFFFFF;
  129. box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.1);
  130. border-radius: 5px;
  131. margin: 0 15px 10px 15px;
  132. position: relative;
  133. .goods-img {
  134. width: 104px;
  135. height: 104px;
  136. object-fit: cover;
  137. float: left;
  138. margin-right: 15px;
  139. }
  140. .goods-info {
  141. width: calc(100% - 120px);
  142. float: left;
  143. padding-top: 10px;
  144. .goods-name {
  145. width: 100%;
  146. height: 30px;
  147. float: left;
  148. font-size: 15px;
  149. font-family: PingFang SC;
  150. color: #333333;
  151. line-height: 15px;
  152. overflow: hidden;
  153. text-overflow: ellipsis;
  154. display: -webkit-box;
  155. -webkit-line-clamp: 2;
  156. -webkit-box-orient: vertical;
  157. word-wrap: break-word;
  158. }
  159. .goods-sales {
  160. width: 100%;
  161. float: left;
  162. font-size: 12px;
  163. font-family: PingFang SC;
  164. color: #666666;
  165. line-height: 15px;
  166. margin: 4px 0 8px 0;
  167. }
  168. .goods-number {
  169. width: 100%;
  170. height: 24px;
  171. float: left;
  172. white-space: nowrap;
  173. font-family: PingFang SC;
  174. color: #52A63A;
  175. line-height: 24px;
  176. .goods-icon {
  177. font-size: 14px;
  178. }
  179. .goods-spec {
  180. font-size: 24px;
  181. }
  182. .price {
  183. font-size: 12px;
  184. text-decoration: line-through;
  185. color: #A67954;
  186. margin-left: 6px;
  187. }
  188. }
  189. }
  190. .more-button {
  191. width: 24px;
  192. height: 24px;
  193. position: absolute;
  194. right: 16px;
  195. bottom: 16px;
  196. .iconfont {
  197. font-size: 36px;
  198. color: #999999;
  199. }
  200. }
  201. }
  202. }
  203. }
  204. }
  205. </style>