videoDetail.vue 4.5 KB

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