Browse Source

ios视频修复

master
jiazhipeng 6 months ago
parent
commit
8bc48200ed
  1. 2
      app.js
  2. 4
      pages/info/foodProductInfo/index.wxml
  3. 13
      subPackages/foodNew/index.js
  4. 4
      subPackages/foodNew/index.wxml

2
app.js

@ -38,7 +38,7 @@ App({
// 获取前端配置文件 // 获取前端配置文件
commonApi._post("pbservice/Other/getClientConfig", {unique_key: "wechatxcx"}).then(res => { commonApi._post("pbservice/Other/getClientConfig", {unique_key: "wechatxcx"}).then(res => {
let data = JSON.parse(res.data); let data = JSON.parse(res.data);
data.isTest = data.isTest142? true : false; data.isTest = data.isTest144? true : false;
data.indexSeason = null data.indexSeason = null
this.globalData.configJson = data this.globalData.configJson = data
}).then(() => { }).then(() => {

4
pages/info/foodProductInfo/index.wxml

@ -4,14 +4,17 @@
<!-- <view class="share-icon" bindtap="share"></view> --> <!-- <view class="share-icon" bindtap="share"></view> -->
<image lazy-load wx:for="{{info.sku}}" style="{{aniSkuIndex==index?('top:'+cartTop+'px;'):('top:'+top+'px;'+cartImgInfo)}}" class="headimg{{aniSkuIndex==index?' active':''}}" src="{{info.headimg}}" mode="aspectFill"></image> <image lazy-load wx:for="{{info.sku}}" style="{{aniSkuIndex==index?('top:'+cartTop+'px;'):('top:'+top+'px;'+cartImgInfo)}}" class="headimg{{aniSkuIndex==index?' active':''}}" src="{{info.headimg}}" mode="aspectFill"></image>
<view style="position: relative;"> <view style="position: relative;">
<scroll-view>
<swiper class="swiper" wx:if="{{info}}" autoplay="{{autoPlay}}" current="{{swiperCurrent}}" <swiper class="swiper" wx:if="{{info}}" autoplay="{{autoPlay}}" current="{{swiperCurrent}}"
interval="{{2000}}" duration="{{300}}" bindchange="swiperChange"> interval="{{2000}}" duration="{{300}}" bindchange="swiperChange">
<block wx:if="{{info.videourl}}" wx:key="*this"> <block wx:if="{{info.videourl}}" wx:key="*this">
<swiper-item> <swiper-item>
<scroll-view>
<video bindplay="playVideo" src="{{info.videourl}}" autoplay="{{true}}" muted="{{true}}" <video bindplay="playVideo" src="{{info.videourl}}" autoplay="{{true}}" muted="{{true}}"
show-mute-btn="{{true}}" show-background-playback-button="{{false}}" show-mute-btn="{{true}}" show-background-playback-button="{{false}}"
show-progress="{{false}}" enable-progress-gesture="{{false}}"></video> show-progress="{{false}}" enable-progress-gesture="{{false}}"></video>
<!-- <image lazy-load src="{{info.headimg}}" mode="aspectFill"></image> --> <!-- <image lazy-load src="{{info.headimg}}" mode="aspectFill"></image> -->
</scroll-view>
</swiper-item> </swiper-item>
</block> </block>
<block wx:for="{{info.listimg}}" wx:key="*this"> <block wx:for="{{info.listimg}}" wx:key="*this">
@ -28,6 +31,7 @@
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
</scroll-view>
<view class="swiper-bottom" wx:if="{{info}}"> <view class="swiper-bottom" wx:if="{{info}}">
<!-- <view class="swuper-bottom-bg"> <!-- <view class="swuper-bottom-bg">
<view class="swiper-bottom-item {{(swiperCurrent>=swiperRange.video.min&&swiperCurrent<=swiperRange.video.max)?'active':''}}" <view class="swiper-bottom-item {{(swiperCurrent>=swiperRange.video.min&&swiperCurrent<=swiperRange.video.max)?'active':''}}"

13
subPackages/foodNew/index.js

@ -167,15 +167,16 @@ Page({
} catch(e) {} } catch(e) {}
// let swiperRange = this.data.swiperRange; let swiperRange = this.data.swiperRange;
// swiperRange.video = resData.videourl? { min: 0, max: 0 } : { min: -1, max: -1 } swiperRange.video = resData.videourl? { min: 0, max: 0 } : { min: -1, max: -1 }
// swiperRange.picture = {min:swiperRange.video.max+1, max:swiperRange.video.max+1+resData.listimg.length-1} swiperRange.picture = {min:swiperRange.video.max+1, max:swiperRange.video.max+1+resData.listimg.length-1}
// swiperRange.sku = {min:swiperRange.picture.max+1,max:swiperRange.picture.max+1+resData.sku.length-1} swiperRange.sku = {min:swiperRange.picture.max+1,max:swiperRange.picture.max+1+resData.sku.length-1}
this.setData({ this.setData({
info: resData, info: resData,
// swiperRange: swiperRange, swiperRange: swiperRange,
shareImg: null, shareImg: null,
prod_phone: resData.scene_tel prod_phone: resData.scene_tel,
swiperCurrent: 0
}) })
this.drawImg() this.drawImg()

4
subPackages/foodNew/index.wxml

@ -34,14 +34,17 @@
<!-- <view class="share-icon" bindtap="share"></view> --> <!-- <view class="share-icon" bindtap="share"></view> -->
<image lazy-load wx:for="{{info.sku}}" style="{{aniSkuIndex==index?('top:'+cartTop+'px;'):('top:'+top+'px;'+cartImgInfo)}}" class="headimg{{aniSkuIndex==index?' active':''}}" src="{{info.headimg}}" mode="aspectFill"></image> <image lazy-load wx:for="{{info.sku}}" style="{{aniSkuIndex==index?('top:'+cartTop+'px;'):('top:'+top+'px;'+cartImgInfo)}}" class="headimg{{aniSkuIndex==index?' active':''}}" src="{{info.headimg}}" mode="aspectFill"></image>
<view style="position: relative;"> <view style="position: relative;">
<scroll-view>
<swiper class="swiper" wx:if="{{info}}" autoplay="{{autoPlay}}" current="{{swiperCurrent}}" <swiper class="swiper" wx:if="{{info}}" autoplay="{{autoPlay}}" current="{{swiperCurrent}}"
interval="{{2000}}" duration="{{300}}" bindchange="swiperChange"> interval="{{2000}}" duration="{{300}}" bindchange="swiperChange">
<block wx:if="{{info.videourl}}" wx:key="*this"> <block wx:if="{{info.videourl}}" wx:key="*this">
<swiper-item> <swiper-item>
<scroll-view>
<video bindplay="playVideo" src="{{info.videourl}}" autoplay="{{true}}" muted="{{true}}" <video bindplay="playVideo" src="{{info.videourl}}" autoplay="{{true}}" muted="{{true}}"
show-mute-btn="{{true}}" show-background-playback-button="{{false}}" show-mute-btn="{{true}}" show-background-playback-button="{{false}}"
show-progress="{{false}}" enable-progress-gesture="{{false}}"></video> show-progress="{{false}}" enable-progress-gesture="{{false}}"></video>
<!-- <image lazy-load src="{{info.headimg}}" mode="aspectFill"></image> --> <!-- <image lazy-load src="{{info.headimg}}" mode="aspectFill"></image> -->
</scroll-view>
</swiper-item> </swiper-item>
</block> </block>
<block wx:for="{{info.listimg}}" wx:key="*this"> <block wx:for="{{info.listimg}}" wx:key="*this">
@ -58,6 +61,7 @@
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
</scroll-view>
<view class="swiper-bottom" wx:if="{{info}}"> <view class="swiper-bottom" wx:if="{{info}}">
<!-- <view class="swuper-bottom-bg"> <!-- <view class="swuper-bottom-bg">
<view class="swiper-bottom-item {{(swiperCurrent>=swiperRange.video.min&&swiperCurrent<=swiperRange.video.max)?'active':''}}" <view class="swiper-bottom-item {{(swiperCurrent>=swiperRange.video.min&&swiperCurrent<=swiperRange.video.max)?'active':''}}"

Loading…
Cancel
Save