diff --git a/app.js b/app.js index 6a22e89..13dd162 100644 --- a/app.js +++ b/app.js @@ -184,6 +184,7 @@ App({ }, isMapFindState: false, // 地图找房入口 + isShowVideo: true, // 是否显示视频 socketTask: null, // 全局的 socket 值 isHideState: true, // 判断是否 隐藏了 在 onshow 为 true 是代表小程序后台打开 diff --git a/pages/index/index.js b/pages/index/index.js index fe07180..6e86327 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -16,7 +16,6 @@ Page({ banner: [], service: '', servicename: '', - video: '', screen_data: {}, advListHKhousing: {}, advListotherHousing: {}, @@ -208,16 +207,6 @@ Page({ const content = this.data.servicename; miucms.copy(content).then((res) => {}).catch(err => {}) }, - play(e) { - this.setData({ - video: e.detail.src - }) - }, - closePage(e) { - this.setData({ - video: '' - }) - }, // 关闭广告 closeAd(e) { let { diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 033a78e..10e6d95 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -136,13 +136,6 @@ - - - diff --git a/pages/index/index.wxss b/pages/index/index.wxss index fba8a83..3f64723 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -54,30 +54,6 @@ border-radius: 10rpx; } -.video-box { - width: 100vw; - height: 100vh; - z-index: 100000; - background: rgba(0, 0, 0, 0.8); - position: fixed; - left: 0; - top: 0; -} - -.video-box .close { - position: fixed; - left: 20rpx; - top: 20rpx; - width: 50rpx; - height: 50rpx; - z-index: 1000000 -} - -.video-box video { - width: 100vw; - height: 100vh; -} - .cover { position: fixed; left: 5px; diff --git a/pages/irentDetail/irentDetail.js b/pages/irentDetail/irentDetail.js index 958bdb7..e730498 100644 --- a/pages/irentDetail/irentDetail.js +++ b/pages/irentDetail/irentDetail.js @@ -64,7 +64,7 @@ Page({ bottomLift: 0, operationsTop: false, - + isShowVideo: true, // 是否显示 视频 }, timer: null, @@ -137,6 +137,7 @@ Page({ listTab: app.globalData.listTab, screen_data: app.globalData.screen_data, bottomLift: app.globalData.screen_data.bottomLift, + isShowVideo: app.globalData.isShowVideo, }) this.get_content(); @@ -207,6 +208,14 @@ Page({ } else { data = data.data let info = data.info + if (!this.data.isShowVideo) { + info.videos = [] + const roomList = data.roomList || [] + roomList.forEach(element =>{ + element.videos = [] + }) + } + let coordinate = info.coordinate this.data.coordinate = coordinate.split(',').map(item => { return item * 1 @@ -586,12 +595,6 @@ Page({ sources: attachment, current }) - - // return - // wx.setStorageSync('attachment', attachment) - // wx.navigateTo({ - // url: `/pages/video_show/video_show?frompage=apartment¤t=${current}` - // }); }, // 公共跳转 diff --git a/pages/show/show.js b/pages/show/show.js index 95eb5e5..a979d12 100644 --- a/pages/show/show.js +++ b/pages/show/show.js @@ -111,6 +111,8 @@ Page({ targetAcademyPitch: [], // 附近学校距离选中院校 数据 specialSchoolDistance: null, // 特殊的 用户带有school参数 则需要特殊显示 学校距离 + + isShowVideo: true, // 是否显示 视频 }, to_share() { wx.navigateTo({ @@ -166,7 +168,8 @@ Page({ show_btn: options.show_btn ? options.show_btn : 'show', options: options || {}, irentCouponBig: app.globalData.irentCouponBig, - ['info.cityid']: options.cityid + ['info.cityid']: options.cityid, + isShowVideo: app.globalData.isShowVideo, }) screenWidth = wx.getSystemInfoSync().screenWidth; center_position = screenWidth / 2; @@ -265,6 +268,10 @@ Page({ } else { data = data.data let info = data.info + + if (!this.data.isShowVideo) info.video = null + + let arr = ["wechat", "wechatdata", "whatsapp", "tel"] let contactValue = [] let contactObj = this.data.contactObj @@ -650,9 +657,15 @@ Page({ }, show_video: function (e) { var src = e.currentTarget.dataset.src; - wx.navigateTo({ - url: '../video_show/video_show?src=' + src + wx.previewMedia({ + sources: [{ + url: src, + type: "video", + }] }) + // wx.navigateTo({ + // url: '../video_show/video_show?src=' + src + // }) }, showSchoolAlert(e) { this.setData({ diff --git a/pages/show/show.wxml b/pages/show/show.wxml index 7f089f8..fe991bb 100644 --- a/pages/show/show.wxml +++ b/pages/show/show.wxml @@ -327,6 +327,7 @@ {{ targetAcademyPitch.school }} + 本数据来自高德地图,仅供参考。 diff --git a/pages/show/show.wxss b/pages/show/show.wxss index 9fb3329..00d2e76 100644 --- a/pages/show/show.wxss +++ b/pages/show/show.wxss @@ -2366,7 +2366,8 @@ map .clickmap { color: #000; font-size: 30rpx; font-weight: 650; - margin-bottom: 46rpx; + /* margin-bottom: 46rpx; */ + margin-bottom: 30rpx; font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif; } @@ -2534,4 +2535,10 @@ map .clickmap { border-radius: 15rpx; margin-right: 15rpx; color: #333333; +} + +.academy-school-hint { + color: #a09e9e; + font-size: 22.5rpx; + margin-bottom: 30rpx; } \ No newline at end of file diff --git a/pages/video_show/video_show.js b/pages/video_show/video_show.js index 68afd31..38b69eb 100644 --- a/pages/video_show/video_show.js +++ b/pages/video_show/video_show.js @@ -1,177 +1,66 @@ -// pages/img_show/img_show.js -var app = getApp() +// pages/video_show/video_show.js Page({ /** * 页面的初始数据 */ data: { - src: '', - screen_data: {}, - videoLength: 0, - imgLength: 0, - liveLength: 0, - windowWidth: 0, - swiperHeight: 320, - attachment: [], - indicatorDots: true, - autoplay: false, - interval: 5000, - duration: 500, - circular: true, - skip: true, - videoautoplay: true, - controls: true, - current: 0, - imgIndex: 0, - videoIndex: 0, - liveIndex: 0, - tab: 'video', - currentTime: 0, - loop: false, - videoLoading: true, // 视频组件 是否加载中 + }, /** * 生命周期函数--监听页面加载 */ - onLoad: function (options) { - let that = this; - this.setData({ - src: options.src || '', - frompage: options.frompage || '', - screen_data: app.globalData.screen_data, - current: options.current || 0, - currentTime: options.currentTime || 0, - loop: options.loop || false - }) + onLoad(options) { - wx.getSystemInfo({ - success: function (res) { - that.setData({ - windowWidth: res.windowWidth - }) - } - }) - if (options.frompage && options.frompage == 'apartment') { - let attachment = wx.getStorageSync('attachment') - this.setData({ - attachment - }) - wx.removeStorageSync('attachment') - this.calculateimgLength() - } - if (!this.data.frompage) { - this.videoContext = wx.createVideoContext('videobox', this) //这里对应的视频id - setTimeout(() => { - // this.videoContext.play() - }, 2000) - } }, /** - * 用户点击关闭 + * 生命周期函数--监听页面初次渲染完成 */ - closePage() { - wx.navigateBack() - }, - // 计算视频个数 - calculateimgLength() { - let that = this; - this.data.attachment.forEach(item => { - if (item.islive) that.data.liveLength++; - else if (item.isvideo) that.data.videoLength++; - else that.data.imgLength++; - }) - this.setData({ - videoLength: this.data.videoLength, - imgLength: this.data.imgLength, - liveLength: this.data.liveLength, - }) - - // if (this.data.current >= this.data.videoLength + this.data.liveLength) { - // this.setData({ - // tab: 'img', - // imgIndex: this.data.current + this.data.videoLength + this.data.liveLength - // }) - // } else if (this.data.current >= this.data.liveLength) { - // this.setData({ - // tab: 'video', - // videoIndex: this.data.current + this.data.liveLength - // }) - // } else { - // this.setData({ - // tab: 'live', - // liveIndex: this.data.current - // }) - // } - - let tab = "live" - let index = this.data.current - - if (this.data.current >= this.data.videoLength + this.data.liveLength) { - tab = "img" - index = this.data.current + this.data.videoLength + this.data.liveLength - } else if (this.data.current >= this.data.liveLength) { - tab = "video" - index = this.data.current + this.data.liveLength - } - - this.setData({ - tab, - [`${tab}Index`]: index - }) - }, - // 切换图片或视频 - changeTab(e) { - let tab = e.currentTarget.dataset.tab; - if (this.data.tab == tab) return false - - let current = 0 - if (tab == 'live') {} else if (tab == 'video') current = this.data.liveLength - else current = this.data.liveLength + this.data.videoLength - - this.setData({ - current, - imgIndex: 0, - videoIndex: 0, - tab - }) - }, - currentIndex: 0, - bindchangeSwiper(e) { - if (this.data.tab == 'video') { - let videoID = wx.createVideoContext('video' + this.currentIndex, this) - videoID.pause() - } - - let current = e.detail.current; - - let videoLength = this.data.videoLength - let liveLength = this.data.liveLength - - let tab = "img" - if (current >= liveLength + videoLength) tab = "img" - else if (current >= liveLength) tab = "video" - else tab = "live" - - this.setData({ - tab, - current, - }) + onReady() { }, - load(e) { - this.setData({ - swiperHeight: Math.max(this.data.swiperHeight, this.data.windowWidth * e.detail.height / e.detail.width) - }) + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + }, - bindloadedmetadata(e) { - this.setData({ - videoLoading: false - }) + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + } - - }) \ No newline at end of file diff --git a/pages/video_show/video_show.json b/pages/video_show/video_show.json deleted file mode 100644 index 5477cd0..0000000 --- a/pages/video_show/video_show.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "navigationBarTitleText": "视频", - "navigationBarBackgroundColor": "#000000", - "navigationBarTextStyle": "white", - "enablePullDownRefresh": false, - "usingComponents": { - "header-nav": "../../template/headerNav/index" - } -} \ No newline at end of file diff --git a/pages/video_show/video_show.wxml b/pages/video_show/video_show.wxml index 301dcde..d71b6dc 100644 --- a/pages/video_show/video_show.wxml +++ b/pages/video_show/video_show.wxml @@ -1,44 +1,2 @@ - - - {{(current - videoLength - liveLength) + 1 + '/' + imgLength }} - {{ (current - liveLength) + 1 + '/' + videoLength }} - {{ current * 1 + 1 + '/' + liveLength }} - - - - - - - - - live({{ liveLength }}) - 视频({{ videoLength }}) - 图片({{ imgLength }}) - - - - - - - - - - - - - - - - - - - \ No newline at end of file + +pages/video_show/video_show.wxml \ No newline at end of file diff --git a/pages/video_show/video_show.wxss b/pages/video_show/video_show.wxss deleted file mode 100644 index d11a3f4..0000000 --- a/pages/video_show/video_show.wxss +++ /dev/null @@ -1,142 +0,0 @@ -/* pages/video_show/video_show.wxss */ -.video-box { - width: 100vw; - height: 100vh; - z-index: 100000; - background: rgba(0, 0, 0, 0.8); - position: fixed; - left: 0; - top: 0; -} - -.video-box .close { - position: fixed; - left: 20rpx; - top: 20rpx; - width: 50rpx; - height: 50rpx; - z-index: 1000000 -} - -.video-box video { - /* margin: calc(50vh - 120px) auto; - display: block; */ - width: 100vw; - height: 100vh; -} - -.cover { - position: fixed; - left: 5px; - top: 0; - display: flex; - justify-content: center; - align-items: center; - box-sizing: border-box; - - -} - -.image { - width: 30rpx; - height: 30rpx; - -} - -.inner { - border: 1px solid #aaa; - background: rgba(0, 0, 0, 0.2); - display: inline-flex; - justify-content: center; - align-items: center; - border-radius: 50%; -} - -.video-img-box { - background: #000; - width: 100vw; - height: 100vh; - color: #fff; - overflow: hidden; - /* position: fixed; */ - left: 0; - top: 0 -} - -.video-img-box .tab { - display: flex; - font-size: 28rpx; - height: 100rpx; - -} - -.video-img-box .tab .item { - display: inline-flex; - flex: 1; - color: #e8e8e8; - align-items: center; - justify-content: center; - font-weight: 400 -} - -.video-img-box .tab .item.active { - font-weight: bold; - font-size: 32rpx; - color: #fff; -} - -.video-img-box .content { - /* position: absolute; */ - left: 0; - top: 50%; - /* transform: translateY(-50%); */ - width: 100vw; -} - -.img-box { - width: 100vw; - height: 100%; - display: flex; - align-items: center; -} - -.img-box image { - display: block; - width: 100vw; -} - -.img-box video { - display: block; - margin: 0 auto; - width: 100vw; - /* max-height: 70vh; */ - /* position: static !important; */ - position: fixed; - /* top: 50%; - left: 50%; */ - /* transform: translate(-50%,-50%); */ -} - -.img-box .load { - z-index: 9999999; - width: 80rpx; - height: 80rpx; - color: #fff; - position: absolute; - top: calc(50% - 40rpx); - left: calc(50% - 40rpx); - /* transform: translate(-50%, -50%); */ - animation: rotate 3s linear infinite; - /* 使用动画效果实现无限旋转 */ - /* background: aquamarine; */ -} - -@keyframes rotate { - from { - transform: rotate(0deg); - } - - to { - transform: rotate(360deg); - } -} \ No newline at end of file diff --git a/template/bannerAD/bannerAD.js b/template/bannerAD/bannerAD.js index 5db7011..36991d2 100644 --- a/template/bannerAD/bannerAD.js +++ b/template/bannerAD/bannerAD.js @@ -86,7 +86,7 @@ Component({ // 直接将图片或者视频放大 if (this.data.isvideo) { wx.navigateTo({ - url: `/pages/video_show/video_show?loop=true&src=${this.properties.item.annex.url}`, + // url: `/pages/video_show/video_show?loop=true&src=${this.properties.item.annex.url}`, }) }else{ wx.previewImage({ diff --git a/template/headSwiper/headSwiper.js b/template/headSwiper/headSwiper.js index cc5b11c..d885d40 100644 --- a/template/headSwiper/headSwiper.js +++ b/template/headSwiper/headSwiper.js @@ -80,6 +80,7 @@ Component({ }) }, previewImg(e) { + console.log("img"); let that = this; let url = e.currentTarget.dataset.url; let appid = e.currentTarget.dataset.appid; @@ -130,9 +131,20 @@ Component({ if (this.properties.pages == 'apartmentDetail') { wx.setStorageSync('attachment', this.properties.attachment) - wx.navigateTo({ - url: `/pages/video_show/video_show?frompage=apartment¤t=${this.data.current}` - }); + // console.log("attachment", this.properties.attachment); + let sources = this.properties.attachment || [] + sources.forEach(element => { + if (element['videourl']) element['type'] = 'video' + element['url'] = element['videourl'] || element['image'] + }) + + wx.previewMedia({ + sources, + current: this.data.current, + }) + // wx.navigateTo({ + // url: `/pages/video_show/video_show?frompage=apartment¤t=${this.data.current}` + // }); return false } @@ -260,11 +272,12 @@ Component({ aState: false, }) }, - play(e) { - wx.navigateTo({ - url: '/pages/video_show/video_show?src=' + e.currentTarget.dataset.video, - }) - }, + // play(e) { + + // wx.navigateTo({ + // url: '/pages/video_show/video_show?src=' + e.currentTarget.dataset.video, + // }) + // }, closePage() { this.setData({ video: '' diff --git a/template/headSwiper/headSwiper.wxml b/template/headSwiper/headSwiper.wxml index 24db821..d511feb 100644 --- a/template/headSwiper/headSwiper.wxml +++ b/template/headSwiper/headSwiper.wxml @@ -1,5 +1,4 @@ - @@ -8,11 +7,7 @@ - - - - - + @@ -50,12 +45,9 @@ - diff --git a/utils/miucms.js b/utils/miucms.js index b2b8bae..effe320 100644 --- a/utils/miucms.js +++ b/utils/miucms.js @@ -55,6 +55,7 @@ function sendData(code) { app.globalData.listTab = data.listTab; app.globalData.wechat = data.wechat; app.globalData.isMapFindState = data.isMapFindState; + app.globalData.isShowVideo = data.reviewmode == 1 ? false : true; app.globalData.header = { 'content-type': 'application/json', diff --git a/wxParse/wxParse.wxml b/wxParse/wxParse.wxml index 00fa568..1dd710a 100644 --- a/wxParse/wxParse.wxml +++ b/wxParse/wxParse.wxml @@ -13,7 +13,7 @@