123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <template>
- <view class="container">
- <view class="video-box">
- <video id="myVideo" class="my-video" :src="videoUrl" @error="videoErrorCallback" controls></video>
- </view>
- <!-- <view class="popup-open" @click="popupShow = true">
- <view class="iconfont iconzhibo-shangpin"></view>
- </view>
- <u-popup v-model="popupShow" mode="bottom">
- <view class="popup-box">
- <view class="popup-close" @click="popupShow = false">收起</view>
- <view class="popup-edit" @click="editVideo()">编辑</view>
- <scroll-view scroll-y="true" class="good-box">
- <view class="good-card" v-for="(item, index) in goodList" :key="index">
- <image class="goods-img" :src="item.imgPath"></image>
- <view class="good-info">
- <view class="good-name">{{item.productName}}</view>
- <view class="good-text">销量:{{item.sellCount}}</view>
- <view class="good-price">
- <text class="goods-spec">¥{{item.bizPrice}}/{{item.unit}}</text>
- <text class="goods-original">原价:{{item.originalPrice}}</text>
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- </u-popup> -->
- <u-top-tips ref="uTips"></u-top-tips>
- </view>
- </template>
- <script>
- const NET = require('@/utils/request')
- const API = require('@/config/api')
- export default {
- data() {
- return {
- videoId: '',
- videoUrl: '',
- popupShow: false,
- goodList: [],
- }
- },
- onLoad(options) {
- this.videoId = options.videoId
- this.videoUrl = uni.getStorageSync("videoUrl")
- },
- onShow() {
- NET.request(API.getVideoBindGoods, {
- videoId: this.videoId
- }, 'GET').then(res => {
- this.goodList = res.data
- }).catch(res => {
- this.$refs.uTips.show({
- title: '获取商品失败',
- type: 'warning',
- })
- })
- },
- methods: {
- // 编辑短视频
- editVideo() {
- uni.navigateTo({
- url: '/pagesMedia/videoForm?type=edit&videoId=' + this.videoId
- });
- },
- // 短视频报错
- videoErrorCallback(e) {},
- },
- }
- </script>
- <style lang="less" scoped>
- page {
- width: 100%;
- height: 100%;
- }
- .container {
- width: 100%;
- height: 100%;
- float: left;
- position: relative;
- .video-box {
- width: 100%;
- height: 100%;
- float: left;
- position: absolute;
- .my-video {
- width: 100%;
- height: 100%;
- position: absolute;
- }
- }
- .popup-open {
- width: 50px;
- height: 50px;
- position: fixed;
- bottom: 15px;
- right: 15px;
- background: #52A63A;
- border-radius: 50%;
- text-align: center;
- line-height: 50px;
- z-index: 10000;
- .iconzhibo-shangpin {
- color: #FFFFFF;
- font-size: 34px;
- }
- }
- .popup-box {
- width: 100%;
- height: 400px;
- float: left;
- background-color: #FFFFFF;
- border-radius: 15px 15px 0px 0px;
- box-sizing: border-box;
- padding: 16px 0 0 0;
- position: relative;
- .popup-close {
- width: 50%;
- height: 26px;
- float: left;
- box-sizing: border-box;
- padding: 10px 15px 0 15px;
- font-size: 15px;
- font-family: PingFang SC;
- color: #52A63A;
- line-height: 16px;
- margin-bottom: 10px;
- }
- .popup-edit {
- width: 50%;
- height: 26px;
- float: right;
- box-sizing: border-box;
- padding: 10px 15px 0 15px;
- font-size: 15px;
- font-family: PingFang SC;
- color: #52A63A;
- line-height: 16px;
- margin-bottom: 10px;
- text-align: right;
- }
- .good-box {
- width: 100%;
- height: calc(100% - 36px);
- box-sizing: border-box;
- padding: 0 0 10px 0;
- overflow: auto;
- position: relative;
- .good-card {
- width: calc(100% - 30px);
- float: left;
- margin: 5px 15px 10px 15px;
- background: #FFFFFF;
- border-radius: 15px;
- box-shadow: 0px 1px 5px 0px rgba(102, 102, 102, 0.43);
- padding: 12px;
- box-sizing: border-box;
- .goods-img {
- width: 80px;
- height: 80px;
- float: left;
- border-radius: 10px;
- object-fit: cover;
- }
- .good-info {
- width: calc(100% - 86px);
- height: 80px;
- float: right;
- .good-name {
- width: 100%;
- height: 40px;
- float: left;
- font-size: 15px;
- font-family: PingFang SC;
- color: #333333;
- line-height: 20px;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- word-wrap: break-word;
- }
- .good-price {
- width: 100%;
- height: 20px;
- float: left;
- line-height: 20px;
- font-family: PingFang SC;
- white-space: nowrap;
- margin: 3px 0 3px 0;
- .goods-spec {
- font-size: 15px;
- color: #52A63A;
- margin-right: 6px;
- }
- .goods-original {
- font-size: 12px;
- text-decoration: line-through;
- color: #A67954;
- }
- }
- }
- }
- }
- }
- }
- </style>
|