videoDetail.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="container">
  3. <view class="popup-open" @click="popupShow = true">
  4. <view class="iconfont iconzhibo-shangpin"></view>
  5. </view>
  6. <u-popup v-model="popupShow" mode="bottom">
  7. <view class="popup-box">
  8. <view class="popup-close" @click="popupShow = false">收起</view>
  9. <view class="popup-edit" @click="editVideo()">编辑</view>
  10. <scroll-view scroll-y="true" class="good-box">
  11. <view class="good-card" v-for="(item, index) in goodList" :key="index">
  12. <cover-image class="goods-img" :src="item.imgPath"></cover-image>
  13. <view class="good-info">
  14. <view class="good-name">{{item.productName}}</view>
  15. <view class="good-text">销量:{{item.sellCount}}</view>
  16. <view class="good-price">
  17. <text class="goods-spec">¥{{item.bizPrice}}/{{item.unit}}</text>
  18. <text class="goods-original">原价:{{item.originalPrice}}</text>
  19. </view>
  20. </view>
  21. </view>
  22. </scroll-view>
  23. </view>
  24. </u-popup>
  25. <u-top-tips ref="uTips"></u-top-tips>
  26. </view>
  27. </template>
  28. <script>
  29. const NET = require('@/utils/request')
  30. const API = require('@/config/api')
  31. export default {
  32. data() {
  33. return {
  34. videoId: '',
  35. popupShow: false,
  36. goodList: [],
  37. }
  38. },
  39. onLoad(options) {
  40. this.videoId = options.videoId
  41. NET.request(API.getVideoBindGoods, {}, 'GET').then(res => {
  42. this.goodList = res.data
  43. }).catch(res => {
  44. this.$refs.uTips.show({
  45. title: '获取商品失败',
  46. type: 'warning',
  47. })
  48. })
  49. },
  50. methods: {
  51. // 编辑短视频
  52. editVideo() {
  53. uni.navigateTo({
  54. url: '/pagesMedia/videoForm?type=edit&videoId=' + this.videoId
  55. });
  56. },
  57. },
  58. }
  59. </script>
  60. <style lang="less" scoped>
  61. page {
  62. width: 100%;
  63. height: 100%;
  64. }
  65. .container {
  66. width: 100%;
  67. height: 100%;
  68. float: left;
  69. position: relative;
  70. .popup-open {
  71. width: 50px;
  72. height: 50px;
  73. position: fixed;
  74. bottom: 15px;
  75. right: 15px;
  76. background: #52A63A;
  77. border-radius: 50%;
  78. text-align: center;
  79. line-height: 50px;
  80. .iconzhibo-shangpin {
  81. color: #FFFFFF;
  82. font-size: 34px;
  83. }
  84. }
  85. .popup-box {
  86. width: 100%;
  87. height: 400px;
  88. float: left;
  89. background-color: #FFFFFF;
  90. border-radius: 15px 15px 0px 0px;
  91. box-sizing: border-box;
  92. padding: 16px 0 0 0;
  93. position: relative;
  94. .popup-close {
  95. width: 50%;
  96. height: 26px;
  97. float: left;
  98. box-sizing: border-box;
  99. padding: 10px 15px 0 15px;
  100. font-size: 15px;
  101. font-family: PingFang SC;
  102. color: #52A63A;
  103. line-height: 16px;
  104. margin-bottom: 10px;
  105. }
  106. .popup-edit {
  107. width: 50%;
  108. height: 26px;
  109. float: right;
  110. box-sizing: border-box;
  111. padding: 10px 15px 0 15px;
  112. font-size: 15px;
  113. font-family: PingFang SC;
  114. color: #52A63A;
  115. line-height: 16px;
  116. margin-bottom: 10px;
  117. text-align: right;
  118. }
  119. .good-box {
  120. width: 100%;
  121. height: calc(100% - 36px);
  122. box-sizing: border-box;
  123. padding: 0 0 10px 0;
  124. overflow: auto;
  125. position: relative;
  126. .good-card {
  127. width: calc(100% - 30px);
  128. float: left;
  129. margin: 5px 15px 10px 15px;
  130. background: #FFFFFF;
  131. border-radius: 15px;
  132. box-shadow: 0px 1px 5px 0px rgba(102, 102, 102, 0.43);
  133. padding: 12px;
  134. box-sizing: border-box;
  135. .goods-img {
  136. width: 80px;
  137. height: 80px;
  138. float: left;
  139. border-radius: 10px;
  140. object-fit: cover;
  141. }
  142. .good-info {
  143. width: calc(100% - 86px);
  144. height: 80px;
  145. float: right;
  146. .good-name {
  147. width: 100%;
  148. height: 40px;
  149. float: left;
  150. font-size: 15px;
  151. font-family: PingFang SC;
  152. color: #333333;
  153. line-height: 20px;
  154. overflow: hidden;
  155. text-overflow: ellipsis;
  156. display: -webkit-box;
  157. -webkit-line-clamp: 2;
  158. -webkit-box-orient: vertical;
  159. word-wrap: break-word;
  160. }
  161. .good-price {
  162. width: 100%;
  163. height: 20px;
  164. float: left;
  165. line-height: 20px;
  166. font-family: PingFang SC;
  167. white-space: nowrap;
  168. margin: 3px 0 3px 0;
  169. .goods-spec {
  170. font-size: 15px;
  171. color: #52A63A;
  172. margin-right: 6px;
  173. }
  174. .goods-original {
  175. font-size: 12px;
  176. text-decoration: line-through;
  177. color: #A67954;
  178. }
  179. }
  180. }
  181. }
  182. }
  183. }
  184. }
  185. </style>