videoDetail.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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="popupShow = true">
  7. <view class="iconfont iconzhibo-shangpin"></view>
  8. </view>
  9. <u-popup v-model="popupShow" mode="bottom">
  10. <view class="popup-box">
  11. <view class="popup-close" @click="popupShow = false">收起</view>
  12. <view class="popup-edit" @click="editVideo()">编辑</view>
  13. <scroll-view scroll-y="true" class="good-box">
  14. <view class="good-card" v-for="(item, index) in goodList" :key="index">
  15. <image class="goods-img" :src="item.imgPath"></image>
  16. <view class="good-info">
  17. <view class="good-name">{{item.productName}}</view>
  18. <view class="good-text">销量:{{item.sellCount}}</view>
  19. <view class="good-price">
  20. <text class="goods-spec">¥{{item.bizPrice}}/{{item.unit}}</text>
  21. <text class="goods-original">原价:{{item.originalPrice}}</text>
  22. </view>
  23. </view>
  24. </view>
  25. </scroll-view>
  26. </view>
  27. </u-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. videoId: '',
  38. videoUrl: '',
  39. popupShow: false,
  40. goodList: [],
  41. }
  42. },
  43. onLoad(options) {
  44. this.videoId = options.videoId
  45. this.videoUrl = uni.getStorageSync("videoUrl")
  46. },
  47. onShow() {
  48. NET.request(API.getVideoBindGoods, {
  49. videoId: this.videoId
  50. }, 'GET').then(res => {
  51. this.goodList = res.data
  52. }).catch(res => {
  53. this.$refs.uTips.show({
  54. title: '获取商品失败',
  55. type: 'warning',
  56. })
  57. })
  58. },
  59. methods: {
  60. // 编辑短视频
  61. editVideo() {
  62. uni.navigateTo({
  63. url: '/pagesMedia/videoForm?type=edit&videoId=' + this.videoId
  64. });
  65. },
  66. // 短视频报错
  67. videoErrorCallback(e) {},
  68. },
  69. }
  70. </script>
  71. <style lang="less" scoped>
  72. page {
  73. width: 100%;
  74. height: 100%;
  75. }
  76. .container {
  77. width: 100%;
  78. height: 100%;
  79. float: left;
  80. position: relative;
  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. z-index: 10000;
  103. .iconzhibo-shangpin {
  104. color: #FFFFFF;
  105. font-size: 34px;
  106. }
  107. }
  108. .popup-box {
  109. width: 100%;
  110. height: 400px;
  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: 50%;
  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. margin-bottom: 10px;
  128. }
  129. .popup-edit {
  130. width: 50%;
  131. height: 26px;
  132. float: right;
  133. box-sizing: border-box;
  134. padding: 10px 15px 0 15px;
  135. font-size: 15px;
  136. font-family: PingFang SC;
  137. color: #52A63A;
  138. line-height: 16px;
  139. margin-bottom: 10px;
  140. text-align: right;
  141. }
  142. .good-box {
  143. width: 100%;
  144. height: calc(100% - 36px);
  145. box-sizing: border-box;
  146. padding: 0 0 10px 0;
  147. overflow: auto;
  148. position: relative;
  149. .good-card {
  150. width: calc(100% - 30px);
  151. float: left;
  152. margin: 5px 15px 10px 15px;
  153. background: #FFFFFF;
  154. border-radius: 15px;
  155. box-shadow: 0px 1px 5px 0px rgba(102, 102, 102, 0.43);
  156. padding: 12px;
  157. box-sizing: border-box;
  158. .goods-img {
  159. width: 80px;
  160. height: 80px;
  161. float: left;
  162. border-radius: 10px;
  163. object-fit: cover;
  164. }
  165. .good-info {
  166. width: calc(100% - 86px);
  167. height: 80px;
  168. float: right;
  169. .good-name {
  170. width: 100%;
  171. height: 40px;
  172. float: left;
  173. font-size: 15px;
  174. font-family: PingFang SC;
  175. color: #333333;
  176. line-height: 20px;
  177. overflow: hidden;
  178. text-overflow: ellipsis;
  179. display: -webkit-box;
  180. -webkit-line-clamp: 2;
  181. -webkit-box-orient: vertical;
  182. word-wrap: break-word;
  183. }
  184. .good-price {
  185. width: 100%;
  186. height: 20px;
  187. float: left;
  188. line-height: 20px;
  189. font-family: PingFang SC;
  190. white-space: nowrap;
  191. margin: 3px 0 3px 0;
  192. .goods-spec {
  193. font-size: 15px;
  194. color: #52A63A;
  195. margin-right: 6px;
  196. }
  197. .goods-original {
  198. font-size: 12px;
  199. text-decoration: line-through;
  200. color: #A67954;
  201. }
  202. }
  203. }
  204. }
  205. }
  206. }
  207. }
  208. </style>