[更新]短视频轮播
This commit is contained in:
@@ -3,7 +3,8 @@ import {errInfo} from './err'
|
||||
import {updToken} from './updateToken'
|
||||
|
||||
// 请求方式配置
|
||||
const api = "https://mi-org.cnskl.com/api/"
|
||||
// const api = "https://mi-org.cnskl.com/api/"
|
||||
const api = "https://new-web-test.cnskl.com/api/"
|
||||
const header = {
|
||||
"Accept": "application/json"
|
||||
}
|
||||
|
||||
2
app.json
2
app.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/businessCard/index",
|
||||
"pages/shortVideo/shortVideo",
|
||||
"pages/businessCard/index",
|
||||
"pages/login/login",
|
||||
"pages/businessCard/cards/cards"
|
||||
],
|
||||
|
||||
@@ -43,6 +43,9 @@ Component({
|
||||
methods: {
|
||||
// 视频滚动了
|
||||
changeVideo(e){
|
||||
|
||||
console.log(e)
|
||||
|
||||
let videoLists = this.data.videoList,
|
||||
current = e.detail.current,
|
||||
currentId = this.data.playId,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
bindpause="vipdeBindPlay"
|
||||
loop
|
||||
>
|
||||
<cover-image class="videoLayer-play {{!isPlay ? 'show': ''}}" src="/static/icon/play_icon.png"></cover-image>
|
||||
</video>
|
||||
<image src=""></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
// pages/businessCard/index.js
|
||||
|
||||
/**
|
||||
* Web唐明明
|
||||
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||
* 碌碌无为枉半生,一朝惊醒万事空。
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
<view>名片</view>
|
||||
|
||||
<navigator url="./cards/cards">名片夹</navigator>
|
||||
|
||||
@@ -16,6 +16,7 @@ Page({
|
||||
*/
|
||||
onLoad(options) {
|
||||
wx.$api.video.videos().then(res=>{
|
||||
console.log(res)
|
||||
this.setData({
|
||||
videoList: res,
|
||||
videoId : res[0].video_id
|
||||
@@ -43,6 +44,9 @@ Page({
|
||||
* 获取视频下标
|
||||
*/
|
||||
swiperIndex(e){
|
||||
|
||||
console.log(e.detail.current)
|
||||
|
||||
this.setData({
|
||||
videoIndex: e.detail.current
|
||||
})
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
bind:swiperindex="swiperIndex"
|
||||
>
|
||||
</swiperViode>
|
||||
<!-- 视频播放按钮 -->
|
||||
<view class="videoLayer-play {{!isPlay ? 'show': ''}}" src="/static/icon/play_icon.png"></view>
|
||||
<!-- 视频信息 -->
|
||||
<view class="video-info">
|
||||
<view class="video-user">@ {{videoList[videoIndex].company.name || "-"}}</view>
|
||||
@@ -23,10 +25,10 @@
|
||||
<image class="video-tool-icon" src="/static/icon/video_tool_00.png" mode="widthFix"></image>
|
||||
<view class="video-tool-number">{{videoList[videoIndex].likes || "0"}}</view>
|
||||
</view>
|
||||
<!-- <view class="video-tool-item">
|
||||
<view class="video-tool-item">
|
||||
<image class="video-tool-icon" src="/static/icon/video_tool_01.png" mode="widthFix"></image>
|
||||
<view class="video-tool-number">1000</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="video-tool-item">
|
||||
<image class="video-tool-icon" src="/static/icon/video_tool_02.png" mode="widthFix"></image>
|
||||
<view class="video-tool-number">{{videoList[videoIndex].shares || "0"}}</view>
|
||||
|
||||
@@ -5,7 +5,13 @@
|
||||
*/
|
||||
|
||||
page{
|
||||
background: #0e0c1a;
|
||||
/* background: #0e0c1a; */
|
||||
}
|
||||
|
||||
.videoSwiper{
|
||||
width: 100%;
|
||||
height: 80%;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.videos-content{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"ignore": []
|
||||
},
|
||||
"setting": {
|
||||
"urlCheck": true,
|
||||
"urlCheck": false,
|
||||
"es6": true,
|
||||
"enhance": false,
|
||||
"postcss": true,
|
||||
|
||||
Reference in New Issue
Block a user