videoDetail.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <view class="container">
  3. <view class="video-box">
  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. <image class="goods-img" :src="item.imgPath" mode="aspectFill"></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").replace("http://","https://")
  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(item) {
  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. .video-box {
  82. width: 100%;
  83. height: 100%;
  84. float: left;
  85. position: absolute;
  86. .my-video {
  87. width: 100%;
  88. height: 100%;
  89. position: absolute;
  90. }
  91. }
  92. .popup-open {
  93. width: 50px;
  94. height: 50px;
  95. position: fixed;
  96. bottom: 15px;
  97. right: 15px;
  98. background: #52A63A;
  99. border-radius: 50%;
  100. text-align: center;
  101. line-height: 50px;
  102. .iconzhibo-shangpin {
  103. color: #FFFFFF;
  104. font-size: 34px;
  105. }
  106. }
  107. .popup-box {
  108. width: 100%;
  109. height: 265px;
  110. float: left;
  111. background-color: #FFFFFF;
  112. border-radius: 15px 15px 0px 0px;
  113. box-sizing: border-box;
  114. padding: 16px 0 0 0;
  115. position: relative;
  116. .popup-close {
  117. width: 100%;
  118. height: 26px;
  119. float: left;
  120. box-sizing: border-box;
  121. padding: 10px 15px 0 15px;
  122. font-size: 15px;
  123. font-family: PingFang SC;
  124. color: #52A63A;
  125. line-height: 16px;
  126. }
  127. .good-box {
  128. width: 100%;
  129. height: calc(100% - 26px);
  130. box-sizing: border-box;
  131. padding: 0 0 10px 0;
  132. overflow: auto;
  133. position: relative;
  134. .goods-row:first-child {
  135. margin-top: 12px;
  136. }
  137. .goods-row {
  138. width: calc(100% - 30px);
  139. height: 104px;
  140. float: left;
  141. background: #FFFFFF;
  142. box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.1);
  143. border-radius: 5px;
  144. margin: 0 15px 10px 15px;
  145. position: relative;
  146. .goods-img {
  147. width: 104px;
  148. height: 104px;
  149. object-fit: cover;
  150. float: left;
  151. margin-right: 15px;
  152. }
  153. .goods-info {
  154. width: calc(100% - 120px);
  155. float: left;
  156. padding-top: 10px;
  157. .goods-name {
  158. width: 100%;
  159. height: 30px;
  160. float: left;
  161. font-size: 15px;
  162. font-family: PingFang SC;
  163. color: #333333;
  164. line-height: 15px;
  165. overflow: hidden;
  166. text-overflow: ellipsis;
  167. display: -webkit-box;
  168. -webkit-line-clamp: 2;
  169. -webkit-box-orient: vertical;
  170. word-wrap: break-word;
  171. }
  172. .goods-sales {
  173. width: 100%;
  174. float: left;
  175. font-size: 12px;
  176. font-family: PingFang SC;
  177. color: #666666;
  178. line-height: 15px;
  179. margin: 4px 0 8px 0;
  180. }
  181. .goods-number {
  182. width: 100%;
  183. height: 24px;
  184. float: left;
  185. white-space: nowrap;
  186. font-family: PingFang SC;
  187. color: #52A63A;
  188. line-height: 24px;
  189. .goods-icon {
  190. font-size: 14px;
  191. }
  192. .goods-spec {
  193. font-size: 24px;
  194. }
  195. .price {
  196. font-size: 12px;
  197. text-decoration: line-through;
  198. color: #A67954;
  199. margin-left: 6px;
  200. }
  201. }
  202. }
  203. .more-button {
  204. width: 24px;
  205. height: 24px;
  206. position: absolute;
  207. right: 16px;
  208. bottom: 16px;
  209. .iconfont {
  210. font-size: 36px;
  211. color: #999999;
  212. }
  213. }
  214. }
  215. }
  216. }
  217. }
  218. </style>