feat 分享剧照

develop
GJW200011 4 years ago
parent 581d0cd1c4
commit 6562b0baab

@ -33,7 +33,8 @@
"pages/user/wallet/code_exchange/code_exchange", "pages/user/wallet/code_exchange/code_exchange",
"pages/user/viewer_list/viewer_list", "pages/user/viewer_list/viewer_list",
"pages/index/calendar/calendar", "pages/index/calendar/calendar",
"pages/index/city/selectcity" "pages/index/city/selectcity",
"pages/opera/stage/stage_photo"
], ],
"usingComponents": { "usingComponents": {
"van-icon": "@vant/weapp/icon/index", "van-icon": "@vant/weapp/icon/index",

@ -136,8 +136,10 @@ const router_list = [
{ {
id: 34, id: 34,
router_name: "pages/index/city/selectcity" router_name: "pages/index/city/selectcity"
},
{
id: 35,
router_name: "pages/opera/stage/stage_photo"
}, },
] ]
module.exports = { module.exports = {

@ -89,7 +89,7 @@ Page({
nav(e) { nav(e) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/opera/IP_detail/IP_detail?abb_id=' + e.currentTarget.dataset.abb_id url: '/pages/opera/IP_detail/IP_detail?=' + e.currentTarget.dataset.abb_id
}) })
}, },
nav1(e) { nav1(e) {

@ -28,13 +28,13 @@ Page({
videoContextPrev.pause(); videoContextPrev.pause();
} }
} }
}, },
previewMedia(e) { previewMedia(e) {
wx.previewMedia({ wx.previewMedia({
sources: this.data.show_detail.wonderful_list, sources: this.data.show_detail.wonderful_list,
current: e.currentTarget.dataset.index current: e.currentTarget.dataset.index
}) })
}, },
roll_spread() { roll_spread() {
this.setData({ this.setData({
rolled: !this.data.rolled rolled: !this.data.rolled
@ -74,35 +74,36 @@ previewMedia(e) {
_like() { _like() {
if (login_check()) { if (login_check()) {
let status let status
let follow =false let follow = false
if('undefined' !== typeof(this.data.show_detail.is_follow)) if ('undefined' !== typeof (this.data.show_detail.is_follow)) {
{
follow = this.data.show_detail.is_follow follow = this.data.show_detail.is_follow
} }
let abb_id = this.data.show_detail.abb_id let abb_id = this.data.show_detail.abb_id
if(follow){ if (follow) {
status=0 status = 0
}else if(!follow){ } else if (!follow) {
status=1 status = 1
} }
http("/api/v1/follow", "get", { http("/api/v1/follow", "get", {
abb_id, abb_id,
status status
}).then(res => { }).then(res => {
if( status == 1){ if (status == 1) {
wx.showToast({ wx.showToast({
icon:'success', icon: 'success',
title:'已添加到想看的演出列表', title: '已添加到想看的演出列表',
duration: 2000 duration: 2000
})}else if( status == 0){ })
} else if (status == 0) {
wx.showToast({ wx.showToast({
icon:'success', icon: 'success',
title:'已取消想看', title: '已取消想看',
duration: 2000 duration: 2000
})} })
let show_detail =this.data.show_detail }
show_detail.is_follow=!show_detail.is_follow let show_detail = this.data.show_detail
this.setData({show_detail}) show_detail.is_follow = !show_detail.is_follow
this.setData({ show_detail })
}) })
} }
@ -124,7 +125,7 @@ previewMedia(e) {
latitude: e.currentTarget.dataset.latitude, latitude: e.currentTarget.dataset.latitude,
longitude: e.currentTarget.dataset.longitude, longitude: e.currentTarget.dataset.longitude,
name: this.data.show_detail.theater_name, name: this.data.show_detail.theater_name,
address:this.data.show_detail.traffic_info address: this.data.show_detail.traffic_info
}) })
} else { } else {
wx.showToast({ wx.showToast({
@ -135,12 +136,19 @@ previewMedia(e) {
} }
}, },
tabcoupon(e){ tabcoupon(e) {
let url=e.currentTarget.dataset.router let url = e.currentTarget.dataset.router
wx.navigateTo({ wx.navigateTo({
url url
}) })
}, },
stage_click() {
let { abb_id } = this.data.Xshow_detail
wx.navigateTo({
url: '/pages/opera/stage/stage_photo?abb_id='+abb_id,
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
@ -162,6 +170,7 @@ previewMedia(e) {
Xshow_detail: res.show_detail Xshow_detail: res.show_detail
}) })
}) })
if (cycle_id) { if (cycle_id) {
http("/api/v1/show-detail", "get", { http("/api/v1/show-detail", "get", {
cycle_id cycle_id
@ -171,6 +180,7 @@ previewMedia(e) {
suggest_show: res.suggest_show suggest_show: res.suggest_show
}) })
}) })
} else { } else {
wx.showToast({ wx.showToast({
title: '未传入轮次id', title: '未传入轮次id',
@ -179,6 +189,7 @@ previewMedia(e) {
}) })
} }
}, },
swith_tab: function (e) { swith_tab: function (e) {
@ -200,18 +211,19 @@ previewMedia(e) {
let arr let arr
let a let a
let query = wx.createSelectorQuery() let query = wx.createSelectorQuery()
for(var i = 0 ; i < 4 ; i ++){ for (var i = 0; i < 4; i++) {
query.select('#nav'+i).boundingClientRect() query.select('#nav' + i).boundingClientRect()
} }
query.exec((res) => { query.exec((res) => {
arr=[res[0].top,res[1].top,res[2].top,res[3].top] arr = [res[0].top, res[1].top, res[2].top, res[3].top]
for(var i = 0 ; i<4 ;i++){ for (var i = 0; i < 4; i++) {
if(arr[i]<20){ if (arr[i] < 20) {
a=i a = i
}
} }
if (a) {
this.setData({ swith_area: a })
} }
if(a){
this.setData({swith_area:a})}
}) })
if (ev.scrollTop > windowHeight) { if (ev.scrollTop > windowHeight) {
this.setData({ this.setData({

@ -34,7 +34,9 @@
<van-icon name="/images/ui/location.png" size="30" data-longitude="{{show_detail.longitude}}" <van-icon name="/images/ui/location.png" size="30" data-longitude="{{show_detail.longitude}}"
data-latitude="{{show_detail.latitude}}" bind:click="loc" /> data-latitude="{{show_detail.latitude}}" bind:click="loc" />
</view> </view>
<view class="coupon" bindtap="tabcoupon" wx:if="{{show_detail.mini_coupon_status==3||show_detail.mini_coupon_status==1}}" data-router='{{show_detail.mini_coupon_activity_id}}'> <view class="coupon" bindtap="tabcoupon"
wx:if="{{show_detail.mini_coupon_status==3||show_detail.mini_coupon_status==1}}"
data-router='{{show_detail.mini_coupon_activity_id}}'>
<!-- <image src="../../../images/ui/couponpic.png" alt=""/> --> <!-- <image src="../../../images/ui/couponpic.png" alt=""/> -->
<image src="{{show_detail.mini_coupon_img}}" alt="" mode="widthFix" /> <image src="{{show_detail.mini_coupon_img}}" alt="" mode="widthFix" />
</view> </view>
@ -61,11 +63,12 @@
<block wx:if="{{item.type=='image'}}"> <block wx:if="{{item.type=='image'}}">
<image class="_img" src="{{item.url}}" data-index="{{index}}" bindtap="previewMedia" /> <image class="_img" src="{{item.url}}" data-index="{{index}}" bindtap="previewMedia" />
</block> </block>
<block wx:if="{{item.type=='video'}}"><video poster="{{item.video_pic_url}}" class="_img" src="{{item.url}}" bindplay="bindPlayCallBack" <block wx:if="{{item.type=='video'}}"><video poster="{{item.video_pic_url}}" class="_img" src="{{item.url}}"
id="video_{{index}}" /></block> bindplay="bindPlayCallBack" id="video_{{index}}" /></block>
</block> </block>
</scroll-view> </scroll-view>
<view class="roll" bindtap="stage_click">查看更多</view>
</view> </view>
<view class="_block" id="nav3"> <view class="_block" id="nav3">
@ -120,8 +123,8 @@
<van-goods-action-button text="演出结束" class="btn{{show_detail.is_end}}" <van-goods-action-button text="演出结束" class="btn{{show_detail.is_end}}"
color="linear-gradient(90deg, #CCC 0%, #CCC 100%)" wx:if="{{show_detail.is_end==1}}" /> color="linear-gradient(90deg, #CCC 0%, #CCC 100%)" wx:if="{{show_detail.is_end==1}}" />
<van-goods-action-button text="立即购买" bind:click="show_select" <van-goods-action-button text="立即购买" bind:click="show_select" color="linear-gradient(90deg, #FF4284 0%, #FF1D42 100%)"
color="linear-gradient(90deg, #FF4284 0%, #FF1D42 100%)" wx:if="{{show_detail.is_end==0}}" /> wx:if="{{show_detail.is_end==0}}" />
<!-- <view class="btn btn{{show_detail.is_end}}" wx:if="{{show_detail.is_end==1}}">演出结束</view> <!-- <view class="btn btn{{show_detail.is_end}}" wx:if="{{show_detail.is_end==1}}">演出结束</view>
<view class="btn btn{{show_detail.is_end}}" bind:tap="show_select" wx:else>立即购买</view> --> <view class="btn btn{{show_detail.is_end}}" bind:tap="show_select" wx:else>立即购买</view> -->

@ -158,7 +158,14 @@
height: 360rpx; height: 360rpx;
margin: 0 10rpx; margin: 0 10rpx;
} }
.more {
width: 540rpx;
height: 360rpx;
text-align: center;
line-height: 360rpx;
border: 1px solid #CCC;
border-radius: 8rpx;
}
._block .img1 { ._block .img1 {
margin: 0 auto 0 30rpx; margin: 0 auto 0 30rpx;
display: flex; display: flex;
@ -173,7 +180,7 @@
._block .roll { ._block .roll {
text-align: center; text-align: center;
margin: 20rpx 0; padding: 20rpx 0;
font-size: 24rpx; font-size: 24rpx;
color: #1394F2; color: #1394F2;
} }

@ -0,0 +1,90 @@
// pages/opera/stage/stage_photo.js
import {
httpUtil,
http,
login_check
} from '../../../utils/util'
Page({
/**
* 页面的初始数据
*/
data: {
picture_list: [],
// picture_list:[
// {
// url:'https://mahuaimage.oss-cn-qingdao.aliyuncs.com/mini_app/video/6151925930ce307d3e76d552c946236e07918c526dc0d.jpg'
// },
// {
// url:'https://mahuaimage.oss-cn-qingdao.aliyuncs.com/mini_app/video/6151924d6e398e1590603cd713bc3750f90be18d2c2fd.jpg'
// },
// ],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
http("/api/v1/share-picture-list", "get", {
abb_id: options.abb_id
}).then(res => {
this.setData({
picture_list: res.picture_list
})
})
},
previewMedia(e) {
wx.previewMedia({
sources: this.data.picture_list,
current: e.currentTarget.dataset.index
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText":"分享剧照"
}

@ -0,0 +1,8 @@
<view class="stage_photo">
<view class="no" wx:if="{{picture_list.length<=0}}">暂无数据</view>
<view class="stage_list">
<view class="image" wx:for="{{picture_list}}">
<image src="{{item.url}}" data-index="{{index}}" bindtap="previewMedia"></image>
</view>
</view>
</view>

@ -0,0 +1,24 @@
/* pages/opera/stage/stage_photo.wxss */
.no{
text-align: center;
line-height: 300rpx;
}
.stage_photo{
padding: 0 20rpx;
}
.stage_list{
display: flex;
flex-wrap: wrap;
justify-content:space-between;
}
.stage_list .image{
border-radius: 8rpx;
width: 330rpx;
height: 240rpx;
margin: 0rpx 10rpx 10rpx;
overflow: hidden;
}
image{
width: 100%;
height: 100%;
}
Loading…
Cancel
Save