|
|
@@ -84,7 +84,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="videolist">
|
|
|
+ <view class="videolist" v-if="liveItem.status==3">
|
|
|
<view class="video" :class="liveItem.showType == 1 ? 'video_row' : ''">
|
|
|
<view class="end">直播已结束</view>
|
|
|
</view>
|
|
|
@@ -178,7 +178,7 @@
|
|
|
<input :placeholder="placeholderText" v-model="value" placeholder-style="color:#e7e7e7;"
|
|
|
placeholder-class="placeholder-style" class="ml20 input-native" @focus="inputFocus"
|
|
|
@blur="inputBlur"
|
|
|
- style="border: none; font-size: 24rpx; color: #ffffff; background: transparent; width: 70%;"
|
|
|
+ style="border: none; font-size: 32rpx; color: #ffffff; background: transparent; width: 70%;"
|
|
|
cursor-spacing="100" :adjust-position="false" />
|
|
|
<view class="send" @click="sendMsg()">发送</view>
|
|
|
</view>
|
|
|
@@ -324,7 +324,7 @@
|
|
|
<image class="w48 h48" src="/static/images/after_sales.png" />
|
|
|
<view style="text-align: center;">售后订单</view>
|
|
|
</view>
|
|
|
- <view class=" item" @click="isMore=false">
|
|
|
+ <view class=" item" @click="isMore=false,goMiniProgram">
|
|
|
<image class="w48 h48" src="/static/images/points.png" />
|
|
|
<view style="text-align: center;">芳华币</view>
|
|
|
</view>
|
|
|
@@ -350,14 +350,9 @@
|
|
|
<image class="w48 h48" src="/static/images/search2.png" />
|
|
|
<view style="text-align: center;">更多</view>
|
|
|
</view>
|
|
|
- <!-- <view class=" search-top"
|
|
|
- @click="navgetTo('/pages_shopping/live/storeOrderRefundList?liveId='+liveId)">
|
|
|
- <image class="w48 h48" src="/static/images/after_sales.png" />
|
|
|
- <view style="text-align: center;">售后</view>
|
|
|
- </view> -->
|
|
|
</view>
|
|
|
|
|
|
- <scroll-view enable-flex scroll-y class="shop-list" :style="{ height: boxHeight + 'px' }">
|
|
|
+ <!-- <scroll-view enable-flex scroll-y class="shop-list" :style="{ height: boxHeight + 'px' }">
|
|
|
<view class="list-item" v-for="(item,index) in products" :key="index">
|
|
|
<view class="goods-img">
|
|
|
<image class="img" :src="item.imgUrl" mode="widthFix" />
|
|
|
@@ -385,6 +380,51 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ </scroll-view> -->
|
|
|
+ <scroll-view enable-flex scroll-y class="shop-list" :style="{ height: boxHeight + 'px' }">
|
|
|
+ <!-- 骨架屏 -->
|
|
|
+ <view v-if="loadingProducts && products.length === 0" class="skeleton-list">
|
|
|
+ <view v-for="n in 6" :key="n" class="skeleton-item">
|
|
|
+ <view class="skeleton-img"></view>
|
|
|
+ <view class="skeleton-content">
|
|
|
+ <view class="skeleton-line short"></view>
|
|
|
+ <view class="skeleton-line medium"></view>
|
|
|
+ <view class="skeleton-line long"></view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 实际商品列表 -->
|
|
|
+ <template v-else>
|
|
|
+ <view v-for="(item,index) in products" :key="index" class="list-item">
|
|
|
+ <view class="goods-img">
|
|
|
+ <image class="img" :src="item.imgUrl" mode="widthFix" />
|
|
|
+ <view class="goods-label">{{index+1}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="goods-right">
|
|
|
+ <view class="goods-title">{{item.productName}}</view>
|
|
|
+ <view class="goods-people">{{item.sales}} 人已购</view>
|
|
|
+ <view class="goods-shop">
|
|
|
+ <text class="nummber"><text
|
|
|
+ style="font-size: 20rpx;font-weight: 600;">¥</text><text
|
|
|
+ style="font-size: 36rpx;font-weight: bold;">{{Math.trunc(item.price)}}</text>.{{getPureDecimal(item.price)?getPureDecimal(item.price):'00'}}</text>
|
|
|
+ <view class="btn-group x-f">
|
|
|
+ <view class="collect-btn">
|
|
|
+ <image v-if="item.isFavorite" @click="onGoodsCollect(item)"
|
|
|
+ class="w36 h36" style="vertical-align: middle;"
|
|
|
+ src="/static/images/collect_select.png" />
|
|
|
+ <image v-else @click="onGoodsCollect(item)" class="w36 h36"
|
|
|
+ style="vertical-align: middle;" src="/static/images/collect.png" />
|
|
|
+ </view>
|
|
|
+ <view v-if="item.status==1" class="shop-btn"
|
|
|
+ @click="goShop(item.productId,item.goodsId)">去购买 </view>
|
|
|
+ <view v-else-if="item.status==0" class="shop-btn">
|
|
|
+ 已下架</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
@@ -568,6 +608,7 @@
|
|
|
liveViewers: [], //观众
|
|
|
livingUrl: "",
|
|
|
products: [],
|
|
|
+ loadingProducts: false, // 商品加载状态
|
|
|
store: {},
|
|
|
orderUser: {}, //正在购买
|
|
|
userType: 0,
|
|
|
@@ -617,12 +658,15 @@
|
|
|
if (options.companyId && options.companyUserId) {
|
|
|
this.qrFrom = `&companyId=${options.companyId}&companyUserId=${options.companyUserId}`;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 初始化直播间列表
|
|
|
this.$nextTick(() => {
|
|
|
if (this.liveId) {
|
|
|
this.getliving(this.liveId);
|
|
|
this.isOnload = true
|
|
|
+ this.getLiveMsg(this.liveItem);
|
|
|
+ this.getliveViewData(this.liveItem);
|
|
|
+
|
|
|
} else {
|
|
|
console.error("直播间 ID(liveId)未获取到");
|
|
|
}
|
|
|
@@ -637,9 +681,12 @@
|
|
|
}, 1000)
|
|
|
},
|
|
|
async onShow() {
|
|
|
- if (this.liveId && !this.isOnload) {
|
|
|
+ if (this.liveId&& !this.talklist) {
|
|
|
await this.getLiveMsg(this.liveItem);
|
|
|
}
|
|
|
+ if (!this.liveViewData) {
|
|
|
+ this.getliveViewData(this.liveItem);
|
|
|
+ }
|
|
|
if (!this.userData) {
|
|
|
await this.getUserInfo()
|
|
|
}
|
|
|
@@ -792,7 +839,24 @@
|
|
|
immediate: true
|
|
|
}
|
|
|
},
|
|
|
- methods: { // 阻止双击事件
|
|
|
+ methods: {
|
|
|
+ goMiniProgram() {
|
|
|
+ uni.navigateToMiniProgram({
|
|
|
+ appId: 'wx45cf09091aead547',
|
|
|
+ path: 'pages/index/index',
|
|
|
+ // extraData: {
|
|
|
+ // key1: 'value1',
|
|
|
+ // key2: 'value2'
|
|
|
+ // },
|
|
|
+ success: function(res) {
|
|
|
+ console.log('跳转成功', res);
|
|
|
+ },
|
|
|
+ fail: function(err) {
|
|
|
+ console.error('跳转失败', err);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 阻止双击事件
|
|
|
preventDoubleClick(e) {
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
@@ -937,9 +1001,9 @@
|
|
|
},
|
|
|
// 恢复页面活动
|
|
|
async resumePageActivity() {
|
|
|
- await this.getliving(this.liveId)
|
|
|
+
|
|
|
if (this.liveItem) {
|
|
|
- // this.playVideo()
|
|
|
+ await this.getliving(this.liveId)
|
|
|
this.startTimeTimer(this.liveItem)
|
|
|
}
|
|
|
if (!this.isSocketAvailable()) {
|
|
|
@@ -1865,9 +1929,6 @@
|
|
|
this.$set(this.liveItem, 'livingUrl', '');
|
|
|
this.$set(this.liveItem, 'videoUrl', '');
|
|
|
}
|
|
|
- await this.getLiveMsg(this.liveItem);
|
|
|
- await this.getliveViewData(this.liveItem);
|
|
|
-
|
|
|
this.$set(this.liveItem, 'autoplay', res.data.liveType !== 0);
|
|
|
this.$set(this.liveItem, 'showType', res.data.showType);
|
|
|
this.storeId = res.storeId;
|
|
|
@@ -1965,6 +2026,7 @@
|
|
|
|
|
|
// 查询店铺
|
|
|
async queryCollect() {
|
|
|
+ this.loadingProducts = true;
|
|
|
if (!this.liveId) return;
|
|
|
if (this.inputInfo == null) this.inputInfo = ''
|
|
|
uni.showLoading({
|
|
|
@@ -1973,12 +2035,15 @@
|
|
|
try {
|
|
|
const res = await liveStore(this.liveId, this.inputInfo);
|
|
|
uni.hideLoading()
|
|
|
+ this.shopping = true
|
|
|
if (res.code === 200) {
|
|
|
// 数据绑定到当前 liveItem,避免全局污染
|
|
|
this.products = Array.isArray(res.data) ? res.data : [];
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error('获取小黄车商品失败:', error);
|
|
|
+ } finally {
|
|
|
+ this.loadingProducts = false;
|
|
|
}
|
|
|
},
|
|
|
// 时间戳
|
|
|
@@ -1989,7 +2054,7 @@
|
|
|
|
|
|
openCart() {
|
|
|
this.queryCollect()
|
|
|
- this.shopping = true
|
|
|
+
|
|
|
},
|
|
|
close() {
|
|
|
this.showadd = false
|
|
|
@@ -2466,6 +2531,67 @@
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
+ .skeleton-item {
|
|
|
+ display: flex;
|
|
|
+ padding: 20rpx;
|
|
|
+ background: #fff;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .skeleton-img {
|
|
|
+ width: 200rpx;
|
|
|
+ height: 200rpx;
|
|
|
+ background: #f0f0f0;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ margin-right: 24rpx;
|
|
|
+ animation: pulse 1.5s ease-in-out infinite;
|
|
|
+ }
|
|
|
+
|
|
|
+ .skeleton-content {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .skeleton-line {
|
|
|
+ height: 20rpx;
|
|
|
+ background: #f0f0f0;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+ border-radius: 4rpx;
|
|
|
+ animation: pulse 1.5s ease-in-out infinite;
|
|
|
+ }
|
|
|
+
|
|
|
+ .skeleton-line.short {
|
|
|
+ width: 60%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .skeleton-line.medium {
|
|
|
+ width: 80%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .skeleton-line.long {
|
|
|
+ width: 95%;
|
|
|
+ }
|
|
|
+
|
|
|
+ @keyframes pulse {
|
|
|
+ 0% {
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ 50% {
|
|
|
+ opacity: 0.5;
|
|
|
+ }
|
|
|
+
|
|
|
+ 100% {
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
::v-deep .u-icon--right {
|
|
|
justify-content: flex-end !important;
|
|
|
}
|
|
|
@@ -2763,11 +2889,11 @@
|
|
|
margin-left: 10rpx;
|
|
|
}
|
|
|
|
|
|
- .end{
|
|
|
+ .end {
|
|
|
position: absolute;
|
|
|
top: 50%;
|
|
|
- right: 50%;
|
|
|
- transform: translate(-50%,-50%);
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
font-size: 36rpx;
|
|
|
color: #fff;
|
|
|
}
|