Skip to content

Commit

Permalink
社科音像室放映日历优化修复
Browse files Browse the repository at this point in the history
  • Loading branch information
Airmole committed Apr 11, 2023
1 parent 55b3c29 commit 724ebc0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 16 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shellbox",
"version": "3.3.9",
"description": "预留领取红包封面接口",
"version": "3.4.0",
"description": "社科馆音像室放映安排日历",
"author": "Airmole"
}
19 changes: 18 additions & 1 deletion pages/school/movie.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,14 @@ const conf = {
const index = e.currentTarget.dataset.index
const movie = this.data.movieList[index]
const endTime = new Date(movie.play_at).getTime() + 1000 * 60 * 150

const nowTimestamp = new Date().getTime()
const playTimestamp = new Date(movie.play_at).getTime()
if (nowTimestamp > playTimestamp) return

wx.addPhoneCalendar({
title: `电影【${movie.name}】`,
startTime: new Date(movie.play_at).getTime(),
startTime: new Date(movie.play_at).getTime().toString().slice(0, -3),
description: `电影《${movie.name}》即将开始放映`,
location: '社科馆202音像室',
endTime: endTime.toString().slice(0, -3),
Expand All @@ -117,7 +122,19 @@ const conf = {
appId: 'wx2f9b06c1de1ccfca',
path: `pages/subject/subject?id=${movie.douban_id}&type=movie`
})
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
let title = `${this.data.checkedDate}社科音像室影片`;
if (this.data.movieList.length > 0) title = `${title}${this.data.movieList[0].name}》`
return {
title: title,
path: 'pages/school/movie?date=' + this.data.checkedDate,
imageUrl: this.data.movieList.length > 0 ? this.data.movieList[0].poster : null
}
},
}

Page(conf)
20 changes: 9 additions & 11 deletions pages/school/movie.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,24 @@
<text class="cuIcon-title text-green"></text>当天放映
</view>
<view class="cu-list menu" wx:if="{{movieList.length > 0}}">
<view class="cu-item padding-tb" wx:for="{{movieList}}" wx:key="index" bindtap="goDouban" data-index="{{index}}">
<view>
<view class="cu-item padding-tb radius" wx:for="{{movieList}}" wx:key="index" bindtap="goDouban" data-index="{{index}}">
<view class="padding-xs">
<image catchtap="showPoster" data-url="{{item.poster}}" style="width: 180rpx;" src="{{item.poster}}?imageMogr2/auto-orient/strip%7CimageView2/2/w/128" mode="widthFix" />
</view>
<view class="padding-lr">
<view class="text-xl text-cut"><text class="cuIcon-videofill text-red margin-right-xs"></text><text class="text-bold">{{item.name}}</text><text class="text-gray" wx:if="{{item.year}}">({{item.year}})</text>
<view class="padding-lr-xs flex flex-wrap">
<view class="padding-bottom-sm solid-bottom text-xl text-cut"><text class="cuIcon-videofill text-red margin-right-xs"></text><text class="text-bold">{{item.name}}</text><text class="text-gray" wx:if="{{item.year}}">({{item.year}})</text>
</view>
<view class="margin-tb-xs">
<text catchtap="setRemind" data-index="{{index}}" class="cuIcon-remind text-orange margin-right-xs"></text><text class="text-df">{{ item.play_at }}</text>
<view class="margin-tb-xs" catchtap="setRemind" data-index="{{index}}">
<text class="cuIcon-remind text-orange margin-right-xs"></text><text class="text-df">{{ item.play_at }}</text>
</view>
<view class="margin-tb-xs" catchtap="goLibraryCinema">
<view class="margin-bottom-xs" catchtap="goLibraryCinema">
<text class="cuIcon-locationfill text-blue margin-right-xs"></text><text class="text-df">社科图书馆音像室(202)</text>
</view>
<view class="margin-tb-xs">
<view class="margin-bottom-xs">
<view class="cu-tag line-blue">{{item.duration}}</view>
<view class="cu-tag line-blue">{{item.genre}}</view>
</view>
<view class="margin-tb-xs">
<text>{{item.actor}}</text>
</view>
<view class="margin-bottom-xs">{{item.actor}}</view>
</view>
</view>
</view>
Expand Down
2 changes: 1 addition & 1 deletion project.private.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{
"name": "movie",
"pathName": "pages/school/movie",
"query": "date=2023-04-12",
"query": "date=2023-04-09",
"launchMode": "default",
"scene": null
}
Expand Down
2 changes: 1 addition & 1 deletion utils/iconfont.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,5 @@
}

.icon-movie:before {
content: "\e70d;";
content: "\e70d";
}

0 comments on commit 724ebc0

Please sign in to comment.