videoDetail.vue 5.0 KB

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