人生不过如此

节选自《人生不过如此》 作者 林语堂


人生的盛宴已经摆在我们的面前,现在唯一的问题是我们的胃口怎样。

   关于人,最难了解的事情终究是他对工作的观念,及他指定给自己做的工作或社会指定给他做的工作。世间的万物都在悠闲中过日子,只有人类为生活而工作着。
  当我在这里坐在我的书台边时,一只鸽子在我窗外绕着尖塔飞翔着,毫不忧虑午餐吃什么东西。我知道我的午餐比那鸽子的午餐复杂得多,我也知道我所要吃的几样东西,乃是成千上万的人们工作的结果,需要一个极复杂的种植、贸易、运输、递送和烹饪的过程,为了这个原因,人类要获得食物是比动物更困难的。虽然如此,如果一只莽丛中的野兽跑到都市来,知道人类生活的匆忙是为了什么目的,那么,它对这个人类社会一定会发生很大的疑惑。  我们的危机是在过分文明,是在获取食物的工作太苦,因而在获取食物的过程中,失掉吃东西的胃口。
  我每次看见都市的摩天楼或一望相连的屋顶时,总觉得心惊胆战。这真是令人惊奇的景象。两三座水塔,两三个钉广告牌的铜架,一两座尖塔,一望相连的沥青的屋顶材料和砖头,形成一些四方形的、矗立的、垂直的轮廓,完全没有什么组织或次序,点缀着一些泥土,退色的烟突,以及几条晒着衣服的绳索和交叉着的无线电天线。我俯视街道,又看见一列灰色或退色的红砖的墙壁,墙壁上有成列的、千篇一律的、阴暗的小窗,窗门一半开着,一半给阴影掩蔽着,窗槛上也许有一瓶牛乳,其他的窗槛上有几盆细小的病态的花儿。人类便居住在这里。他们怎样居住呢?每一家就住在这么一两个阴暗的窗户的后边吗?他们做什么事情过活呢?说来真是令人咋舌。在两三个窗户的后边就有一对夫妻,每天晚上像鸽子那样地回到他们的鸽笼里去睡觉;接着他们在早晨清醒了,喝过咖啡,丈夫到街上去,到某地方为家人寻找面包,妻子在家里不断地、拼命地要把尘埃扫出去,使那小地方干净。到下午四五点钟时她们跑到门边,和邻居相见,大家谈谈天,吸吸新鲜空气,到了晚上,他们带着疲乏的身体再上床去睡。他们就这样生活下去啦!
  还有其他比较小康的人家,住在较好的公寓里。他们有着更“美术化”的房间和灯罩。房间更井然有序,更干净!房中比较有一点空处,但也仅是一点点而已。较没有经济上的烦虑,债务也较少,那是真的。可是同时却较多情感上的纠纷,较多离婚的事件,较多不忠的丈夫晚上不回家,或夫妻俩晚上一同到外边去游乐放荡。他们所需要的是娱乐。天啊,他们须离开这些单调的、千篇一律的砖头墙壁和发光的木头地板去找娱乐!有些人的确有着欢乐的生活,但其他的人却没有。可是在大体上说来,他们也许比那些工作劳苦的人更不快乐;他们感到更大的无聊和厌倦。然而他们有一部汽车,或许也有一座乡间住宅。啊,乡间住宅,这是他们的救星,这么一来,人们在乡间劳苦工作,希望到都市去,在都市赚到足量的金钱,可以再回乡间去隐居。
  当你在都市里散步的时候,你看见大街上有美容室、鲜花店和运输公司,后边一条街上有药店、食品杂货店、铁器店、理发店、洗衣店、小餐馆和报摊。你闲荡了一个钟头,如果那是一个大都市的话,你依然是在那都市里;你只看见更多的街道,更多的药店、食品杂货店、铁器店、理发店、洗衣店、小餐馆和报摊。这些人怎样生活度日呢?他们为什么到这里来呢?答案很简单。洗衣匠洗理发匠和餐馆堂倌的衣服,餐馆堂倌侍候洗衣匠和理发匠吃饭,而理发匠则替洗衣匠和堂倌理发,那便是文化。那不是令人惊奇的事吗?我敢说有些洗衣匠、理发匠和堂倌一生不曾离开过他们工作的地方,到十条街以外的地方去的。谢天谢地,他们至少有电影,可以看见鸟儿在银幕上唱歌,看见树木在生长,在摇曳。土耳其、埃及、喜马拉雅山、安第斯山、暴风雨、船舶沉没、加冕典礼、蚂蚁、毛虫、麝鼠、蜥蜴和蝎的格斗,山丘、波浪、沙、云,甚至于月亮一切都在银幕上!

<template> <view class=""> <swiper class="swiper" :style="{height:screenHeight+'px'}" :vertical="true" :duration="1000" @transition="transition" @change="changed"> <swiper-item class="swiper-item" :style="{height:screenHeight+'px'}" v-for="(item,index) in videoList" :key="index" > <!-- 11111{{index==changeIndex}} --> <video id="myVideo" class="playVideo" :style="{height:screenHeight+'px'}" object-fit="cover" autoplay :src="item.src" :controls="false" @tap="handleVideoTap" loop @timeupdate="onTimeUpdate($event)" @loadeddata="onVideoLoadedData(index)" @play="onVideoPlay" v-if="index==changeIndex||showFlag"> </video> <!-- <image v-else class="fmBox" :src="item.fmsrc" mode="aspectFill"></image> --> <view class="txtWrap"> <text class="nickname" style="color: #fff;font-size: 18px;"> @Picnic熊 </text> <text class="tit" style="width:500rpx;color: #fff;font-size: 14px;text-overflow: ellipsis; lines:2;"> {{item.title}} </text> </view> </swiper-item> </swiper> <view class="iconWrap" :style="{height:screenHeight+'px'}"> <image class="playIcon" src="/static/play.png" style="" v-if="!playFlag"></image> <view class="control_box"> <slider class="sliderbox" :value="currentProgress" min="0" @change="sliderChange" @changing="sliderChanging" max="100" activeColor=" #6d6d6d" backgroundColor="#2f2f2f" block-color="#6d6d6d" block-size="12" /> </view> <view class="changing" v-if="showChanging"> <text style="color: #fff;font-size: 20px;">{{sliderchanging}}</text> <text style="color: #c5c5c5;font-size: 20px;">/ {{totalDuration}}</text> </view> </view> </view> </template> <script> export default { data() { return { screenHeight: 0, originList: [], // 源数据 displaySwiperList: [], // swiper需要的数据 displayIndex: 0, // 用于显示swiper的真正的下标数值只有:0,1,2。 originIndex: 0, // 记录源数据的下标 changeIndex: 0, //控制video是否渲染 page: 0, // 视频分页 num: 0, flag: true, showFlag:false, videoList: [{ "src": "https://minivideo.xiu123.cn/original/79649956972748019fb7761c6852c5b1/25d3d19-17b2a2529da.mp4", "title": "……… 时过尽迁!", "fmsrc": "../../static/fm1.png" }, { "src": "https://minivideo.xiu123.cn/original/6b474d2596d742ab8f1c1da42145ee4d/5a8969da-17afdba394d.mp4", "title": "完美收官/美女/靓仔", "fmsrc": "../../static/fm2.png" }, { "src": "https://minivideo.xiu123.cn/original/95267608f6c94ec786bf2799add0aa7a/d5538f3-17b49507b12.mp4", "title": "人生不过如此,且行且珍惜。", "fmsrc": "../../static/fm.png" }, { "src": "https://minivideo.xiu123.cn/original/e09a1efc53304a30b14258c9f81c53d3/2ca04e20-17b4ad28fe4.mp4", "title": "皮一下🤪🤪🤪", "fmsrc": "../../static/fm1.png" }, { "src": "https://minivideo.xiu123.cn/original/41ce5089729b42388d8beeebffa3b0ea/1896b231-17ea06304eb.mp4", "title": "❤️🧡💛💚💙💜接受自", "fmsrc": "../../static/fm2.png" }, { "src": "https://minivideo.xiu123.cn/original/9866913b960b48aea4ba9795e438e105/324d23bd-17ea0807e3e.mp4", "title": "本年度最后一场正式直", "fmsrc": "../../static/fm.png" }, { "src": "https://minivideo.xiu123.cn/original/1177f5d195d44404991943fc2ee6afb5/58469ddf-17ea1339711.mp4", "title": "555", "fmsrc": "../../static/fm1.png" }, { "src": "https://minivideo.xiu123.cn/original/227284517d2a4858bfe36194106f3978/138a8ce0-17ea2217e0b.mp4", "title": "村上树说“你要记得那", "fmsrc": "../../static/fm2.png" }, { "src": "https://minivideo.xiu123.cn/original/b63ba4528456418f9ded1fb9a568e0ca/3c42538d-17ea016eeb0.mp4", "title": "回村过大年了,家人们", "fmsrc": "../../static/fm.png" }, { "src": "https://minivideo.xiu123.cn/original/9fe073c59b25443fa424a920238d186c/1e9e041d-17d71e53bd0.mp4", "title": "最后一个月啦/狂笑", "fmsrc": "../../static/fm1.png" } ], videoContext: null, playFlag: true, currentProgress: 0, // 当前播放进度 totalDuration: "00:00", // 视频总时长 playTime: "00:00", videoPrecent: 0, sliderallTime: 0, precenting: 0, sliderchanging: "00:00", timerclear: false, showChanging: false, //控制定时器和changing的显示 // sliderTimer: null, //定时器 pageStartY: 0, pageEndY: 0, } }, computed: { canCircular() { // return (this.originIndex + 1 == this.originList.length ? 0 : this.originIndex + 1) == 1; } }, onLoad() { /* 获取系统信息 */ uni.getSystemInfo({ success: (res) => { this.screenHeight = res.windowHeight } }); // 调用函数 this.getPageID() }, onReady: function(res) { this.videoContext = uni.createVideoContext('myVideo') }, methods: { transition(e) { // let originListLength = this.originList.length; // if ((this.originIndex + 1 == originListLength ? 0 : this.originIndex + 1) == 1 && e.detail.dy < -100) { // uni.showToast({ // title: '已经到顶了', // icon: 'none' // }) // } }, /* 生成随机的 pageID */ getPageID() { // console.log("getPageID") let pageID = parseInt(Math.random() * (0 - 100 + 1) + 100) //生成 [min,max] 的随机数 this.getVideoList(pageID) }, /* 获取视频数据 */ getVideoList(pageID) { uni.request({ url: 'https://api.apiopen.top/api/getMiniVideo?page=' + pageID + '&size=10&pageSize=10', // 请求数据接口 data: {}, success: (res) => { if (res.data.code == 200) { res.data.result.list.forEach(item => { //取源数据的部分属性组合成新的数组 let obj = {} obj.src = item.playurl obj.title = item.title this.originList.push(obj) }) } } }) }, changed(event) { this.currentProgress = 0; this.playFlag = true let { current } = event.detail; this.changeIndex = current; // console.log(event) let f1 = this.originList.length - 1 if ((current + 1) >= this.originList.length) { console.log("到底") this.getPageID() } }, handleVideoTap(e) { // console.log("hang") // this.videoContext.pause(); if (this.playFlag) { this.videoContext.pause(); this.playFlag = false } else { this.videoContext.play(); this.playFlag = true } }, onTimeUpdate(e) { let playTime = e.detail.currentTime this.sliderallTime = e.detail.duration this.playTime = this.formatSecondsToMMSS(Math.floor(playTime)); this.totalDuration = this.formatSecondsToMMSS(Math.floor(this.sliderallTime)); if (this.timerclear) { // clearTimeout(this.sliderTimer) // this.sliderTimer = null this.showChanging = false this.timerclear = false return } // this.sliderTimer = setTimeout(() => { // }) this.currentProgress = playTime / this.sliderallTime * 100; }, formatSecondsToMMSS(seconds) { let minutes = Math.floor(seconds / 60); let remainingSeconds = seconds % 60; minutes = ('0' + minutes).slice(-2); remainingSeconds = ('0' + remainingSeconds).slice(-2); return `${minutes}:${remainingSeconds}` }, sliderChange(e) { this.videoPrecent = e.detail.value let designatedTime = (this.videoPrecent / 100) * this.sliderallTime this.videoContext.seek(parseInt(designatedTime)) }, sliderChanging(e) { this.showChanging = true this.timerclear = true this.precenting = e.detail.value let changetiming = (this.precenting / 100) * this.sliderallTime this.sliderchanging = this.formatSecondsToMMSS(Math.floor(changetiming)); }, onVideoPlay(index) { // console.log("onVideoPlay") } }, onHide() { this.videoContext.pause() this.playFlag = false }, onShow() { if (this.videoContext) { this.videoContext.play() this.playFlag = true } } } </script> <style lang="scss" scoped> .swiper { width: 750rpx; } .swiper-item { width: 750rpx; position: relative; // background-color: red; .fmBox { width: 750rpx; height: 500rpx; position: absolute; bottom: 0; left: 0; } .txtWrap { width: 750rpx; height: 100px; position: absolute; bottom: 0; left: 0; padding: 10rpx 30rpx 0; background: linear-gradient(to top, rgba(25, 25, 25, 1.0), rgba(118, 118, 118, 0.01)); justify-content: flex-end; padding-bottom: 70rpx; .nickname { margin-bottom: 10rpx; } .tit {} } } .iconWrap { width: 750rpx; height: 300rpx; position: fixed; top: 0; left: 0; .playIcon { position: absolute; left: 335rpx; top: 400rpx; width: 80rpx; height: 80rpx; } .control_box { width: 750rpx; height: 40rpx; position: absolute; left: 0; bottom: 0rpx; flex-direction: row; // background:linear-gradient(to top,rgba(0,0,0,1),rgba(94, 94, 94, 0.3)) ; .sliderbox { // transform: scale(0.9,0.9); transform: scale(0.95); } .time { width: 100rpx; border: 1px solid blue; } } .changing { flex-direction: row; position: absolute; width: 270rpx; height: 50rpx; bottom: 220rpx; left: 240rpx; justify-content: center; background-color: rgba(118, 118, 118, 0.1); } } </style>依照这种代码实现方式来该功能
最新发布
07-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

YasinLeeX

再来一杯西湖龙井。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值