videoDetail.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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. <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. 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. z-index: 10000;
  101. .iconzhibo-shangpin {
  102. color: #FFFFFF;
  103. font-size: 34px;
  104. }
  105. }
  106. .popup-box {
  107. width: 100%;
  108. height: 400px;
  109. float: left;
  110. background-color: #FFFFFF;
  111. border-radius: 15px 15px 0px 0px;
  112. box-sizing: border-box;
  113. padding: 16px 0 0 0;
  114. position: relative;
  115. .popup-close {
  116. width: 50%;
  117. height: 26px;
  118. float: left;
  119. box-sizing: border-box;
  120. padding: 10px 15px 0 15px;
  121. font-size: 15px;
  122. font-family: PingFang SC;
  123. color: #52A63A;
  124. line-height: 16px;
  125. margin-bottom: 10px;
  126. }
  127. .popup-edit {
  128. width: 50%;
  129. height: 26px;
  130. float: right;
  131. box-sizing: border-box;
  132. padding: 10px 15px 0 15px;
  133. font-size: 15px;
  134. font-family: PingFang SC;
  135. color: #52A63A;
  136. line-height: 16px;
  137. margin-bottom: 10px;
  138. text-align: right;
  139. }
  140. .good-box {
  141. width: 100%;
  142. height: calc(100% - 36px);
  143. box-sizing: border-box;
  144. padding: 0 0 10px 0;
  145. overflow: auto;
  146. position: relative;
  147. .good-card {
  148. width: calc(100% - 30px);
  149. float: left;
  150. margin: 5px 15px 10px 15px;
  151. background: #FFFFFF;
  152. border-radius: 15px;
  153. box-shadow: 0px 1px 5px 0px rgba(102, 102, 102, 0.43);
  154. padding: 12px;
  155. box-sizing: border-box;
  156. .goods-img {
  157. width: 80px;
  158. height: 80px;
  159. float: left;
  160. border-radius: 10px;
  161. object-fit: cover;
  162. }
  163. .good-info {
  164. width: calc(100% - 86px);
  165. height: 80px;
  166. float: right;
  167. .good-name {
  168. width: 100%;
  169. height: 40px;
  170. float: left;
  171. font-size: 15px;
  172. font-family: PingFang SC;
  173. color: #333333;
  174. line-height: 20px;
  175. overflow: hidden;
  176. text-overflow: ellipsis;
  177. display: -webkit-box;
  178. -webkit-line-clamp: 2;
  179. -webkit-box-orient: vertical;
  180. word-wrap: break-word;
  181. }
  182. .good-price {
  183. width: 100%;
  184. height: 20px;
  185. float: left;
  186. line-height: 20px;
  187. font-family: PingFang SC;
  188. white-space: nowrap;
  189. margin: 3px 0 3px 0;
  190. .goods-spec {
  191. font-size: 15px;
  192. color: #52A63A;
  193. margin-right: 6px;
  194. }
  195. .goods-original {
  196. font-size: 12px;
  197. text-decoration: line-through;
  198. color: #A67954;
  199. }
  200. }
  201. }
  202. }
  203. }
  204. }
  205. }
  206. </style>