videoDetail.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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="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. <cover-image class="goods-img" :src="item.imgPath"></cover-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. NET.request(API.getVideoBindGoods, {
  47. videoId: this.videoId
  48. }, 'GET').then(res => {
  49. this.goodList = res.data
  50. }).catch(res => {
  51. this.$refs.uTips.show({
  52. title: '获取商品失败',
  53. type: 'warning',
  54. })
  55. })
  56. },
  57. methods: {
  58. // 编辑短视频
  59. editVideo() {
  60. uni.navigateTo({
  61. url: '/pagesMedia/videoForm?type=edit&videoId=' + this.videoId
  62. });
  63. },
  64. // 短视频报错
  65. videoErrorCallback(e) {},
  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. .video-box {
  80. width: 100%;
  81. height: 100%;
  82. float: left;
  83. position: absolute;
  84. .my-video {
  85. width: 100%;
  86. height: 100%;
  87. position: absolute;
  88. }
  89. }
  90. .popup-open {
  91. width: 50px;
  92. height: 50px;
  93. position: fixed;
  94. bottom: 15px;
  95. right: 15px;
  96. background: #52A63A;
  97. border-radius: 50%;
  98. text-align: center;
  99. line-height: 50px;
  100. .iconzhibo-shangpin {
  101. color: #FFFFFF;
  102. font-size: 34px;
  103. }
  104. }
  105. .popup-box {
  106. width: 100%;
  107. height: 400px;
  108. float: left;
  109. background-color: #FFFFFF;
  110. border-radius: 15px 15px 0px 0px;
  111. box-sizing: border-box;
  112. padding: 16px 0 0 0;
  113. position: relative;
  114. .popup-close {
  115. width: 50%;
  116. height: 26px;
  117. float: left;
  118. box-sizing: border-box;
  119. padding: 10px 15px 0 15px;
  120. font-size: 15px;
  121. font-family: PingFang SC;
  122. color: #52A63A;
  123. line-height: 16px;
  124. margin-bottom: 10px;
  125. }
  126. .popup-edit {
  127. width: 50%;
  128. height: 26px;
  129. float: right;
  130. box-sizing: border-box;
  131. padding: 10px 15px 0 15px;
  132. font-size: 15px;
  133. font-family: PingFang SC;
  134. color: #52A63A;
  135. line-height: 16px;
  136. margin-bottom: 10px;
  137. text-align: right;
  138. }
  139. .good-box {
  140. width: 100%;
  141. height: calc(100% - 36px);
  142. box-sizing: border-box;
  143. padding: 0 0 10px 0;
  144. overflow: auto;
  145. position: relative;
  146. .good-card {
  147. width: calc(100% - 30px);
  148. float: left;
  149. margin: 5px 15px 10px 15px;
  150. background: #FFFFFF;
  151. border-radius: 15px;
  152. box-shadow: 0px 1px 5px 0px rgba(102, 102, 102, 0.43);
  153. padding: 12px;
  154. box-sizing: border-box;
  155. .goods-img {
  156. width: 80px;
  157. height: 80px;
  158. float: left;
  159. border-radius: 10px;
  160. object-fit: cover;
  161. }
  162. .good-info {
  163. width: calc(100% - 86px);
  164. height: 80px;
  165. float: right;
  166. .good-name {
  167. width: 100%;
  168. height: 40px;
  169. float: left;
  170. font-size: 15px;
  171. font-family: PingFang SC;
  172. color: #333333;
  173. line-height: 20px;
  174. overflow: hidden;
  175. text-overflow: ellipsis;
  176. display: -webkit-box;
  177. -webkit-line-clamp: 2;
  178. -webkit-box-orient: vertical;
  179. word-wrap: break-word;
  180. }
  181. .good-price {
  182. width: 100%;
  183. height: 20px;
  184. float: left;
  185. line-height: 20px;
  186. font-family: PingFang SC;
  187. white-space: nowrap;
  188. margin: 3px 0 3px 0;
  189. .goods-spec {
  190. font-size: 15px;
  191. color: #52A63A;
  192. margin-right: 6px;
  193. }
  194. .goods-original {
  195. font-size: 12px;
  196. text-decoration: line-through;
  197. color: #A67954;
  198. }
  199. }
  200. }
  201. }
  202. }
  203. }
  204. }
  205. </style>