feat 分享剧照

develop
GJW200011 4 years ago
parent 581d0cd1c4
commit 6562b0baab

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

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

@ -89,7 +89,7 @@ Page({
nav(e) {
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) {

@ -21,20 +21,20 @@ Page({
var that = this;
let video = that.data.show_detail.wonderful_list;
for (var i in video) {
var index_video = 'video_' + i;
var videoContextPrev = wx.createVideoContext(index_video);
if (current_video != index_video) {
// 暂停其他的
videoContextPrev.pause();
}
var index_video = 'video_' + i;
var videoContextPrev = wx.createVideoContext(index_video);
if (current_video != index_video) {
// 暂停其他的
videoContextPrev.pause();
}
}
},
previewMedia(e) {
wx.previewMedia({
sources: this.data.show_detail.wonderful_list,
current: e.currentTarget.dataset.index
})
},
},
previewMedia(e) {
wx.previewMedia({
sources: this.data.show_detail.wonderful_list,
current: e.currentTarget.dataset.index
})
},
roll_spread() {
this.setData({
rolled: !this.data.rolled
@ -73,36 +73,37 @@ previewMedia(e) {
},
_like() {
if (login_check()) {
let status
let follow =false
if('undefined' !== typeof(this.data.show_detail.is_follow))
{
let status
let follow = false
if ('undefined' !== typeof (this.data.show_detail.is_follow)) {
follow = this.data.show_detail.is_follow
}
let abb_id = this.data.show_detail.abb_id
if(follow){
status=0
}else if(!follow){
status=1
if (follow) {
status = 0
} else if (!follow) {
status = 1
}
http("/api/v1/follow", "get", {
abb_id,
status
}).then(res => {
if( status == 1){
if (status == 1) {
wx.showToast({
icon:'success',
title:'已添加到想看的演出列表',
icon: 'success',
title: '已添加到想看的演出列表',
duration: 2000
})}else if( status == 0){
wx.showToast({
icon:'success',
title:'已取消想看',
duration: 2000
})}
let show_detail =this.data.show_detail
show_detail.is_follow=!show_detail.is_follow
this.setData({show_detail})
})
} else if (status == 0) {
wx.showToast({
icon: 'success',
title: '已取消想看',
duration: 2000
})
}
let show_detail = this.data.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,
longitude: e.currentTarget.dataset.longitude,
name: this.data.show_detail.theater_name,
address:this.data.show_detail.traffic_info
address: this.data.show_detail.traffic_info
})
} else {
wx.showToast({
@ -135,12 +136,19 @@ previewMedia(e) {
}
},
tabcoupon(e){
let url=e.currentTarget.dataset.router
tabcoupon(e) {
let url = e.currentTarget.dataset.router
wx.navigateTo({
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
})
})
if (cycle_id) {
http("/api/v1/show-detail", "get", {
cycle_id
@ -171,6 +180,7 @@ previewMedia(e) {
suggest_show: res.suggest_show
})
})
} else {
wx.showToast({
title: '未传入轮次id',
@ -179,6 +189,7 @@ previewMedia(e) {
})
}
},
swith_tab: function (e) {
@ -199,20 +210,21 @@ previewMedia(e) {
let windowHeight = this.data.windowHeight
let arr
let a
let query = wx.createSelectorQuery()
for(var i = 0 ; i < 4 ; i ++){
query.select('#nav'+i).boundingClientRect()
let query = wx.createSelectorQuery()
for (var i = 0; i < 4; i++) {
query.select('#nav' + i).boundingClientRect()
}
query.exec((res) => {
arr=[res[0].top,res[1].top,res[2].top,res[3].top]
for(var i = 0 ; i<4 ;i++){
if(arr[i]<20){
a=i
}
}
if(a){
this.setData({swith_area:a})}
})
query.exec((res) => {
arr = [res[0].top, res[1].top, res[2].top, res[3].top]
for (var i = 0; i < 4; i++) {
if (arr[i] < 20) {
a = i
}
}
if (a) {
this.setData({ swith_area: a })
}
})
if (ev.scrollTop > windowHeight) {
this.setData({
nav_show: true
@ -257,7 +269,7 @@ this.setData({swith_area:a})}
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
wx.stopPullDownRefresh()
},

@ -34,7 +34,9 @@
<van-icon name="/images/ui/location.png" size="30" data-longitude="{{show_detail.longitude}}"
data-latitude="{{show_detail.latitude}}" bind:click="loc" />
</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="{{show_detail.mini_coupon_img}}" alt="" mode="widthFix" />
</view>
@ -61,11 +63,12 @@
<block wx:if="{{item.type=='image'}}">
<image class="_img" src="{{item.url}}" data-index="{{index}}" bindtap="previewMedia" />
</block>
<block wx:if="{{item.type=='video'}}"><video poster="{{item.video_pic_url}}" class="_img" src="{{item.url}}" bindplay="bindPlayCallBack"
id="video_{{index}}" /></block>
<block wx:if="{{item.type=='video'}}"><video poster="{{item.video_pic_url}}" class="_img" src="{{item.url}}"
bindplay="bindPlayCallBack" id="video_{{index}}" /></block>
</block>
</scroll-view>
<view class="roll" bindtap="stage_click">查看更多</view>
</view>
<view class="_block" id="nav3">
@ -117,12 +120,12 @@
<van-goods-action safe-area-inset-bottom>
<van-goods-action-icon icon="/images/ui/{{show_detail.is_follow?'liked':'like'}}.png" text="想看" bind:click="_like" />
<van-goods-action-icon icon="/images/ui/share.png" text="分享" open-type="share" bind:click="_share" />
<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}}" />
<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}}" />
<van-goods-action-button text="立即购买" bind:click="show_select" color="linear-gradient(90deg, #FF4284 0%, #FF1D42 100%)"
wx:if="{{show_detail.is_end==0}}" />
<van-goods-action-button text="立即购买" bind:click="show_select"
color="linear-gradient(90deg, #FF4284 0%, #FF1D42 100%)" 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}}" bind:tap="show_select" wx:else>立即购买</view> -->
</van-goods-action>

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