[新增]企业主页,企业活动

This commit is contained in:
zdx
2020-12-28 10:38:29 +08:00
parent d3fa1d743c
commit 3a559141d1
106 changed files with 4587 additions and 164 deletions

View File

@@ -1,4 +1,3 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
@@ -11,21 +10,21 @@ Page({
* 页面的初始数据
*/
data: {
videoList : [], //获取短视频列表
videoIndex : 0, //当前播放视频的下标
videoId : "", //当前播放的视频id
playState : true, //视频播放状态
videoList: [], //获取短视频列表
videoIndex: 0, //当前播放视频的下标
videoId: "", //当前播放的视频id
playState: true, //视频播放状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.$api.video.videos().then(res=>{
wx.$api.video.videos().then(res => {
console.log(res)
this.setData({
videoList: res,
videoId : res[0].video_id
videoId: res[0].video_id
})
})
},
@@ -33,15 +32,15 @@ Page({
/***
* 视频的播放状态
*/
videoPlay(e){
if(e.detail.playType == "play" && this.data.playState == false){
videoPlay(e) {
if (e.detail.playType == "play" && this.data.playState == false) {
this.setData({
playState : true,
videoId : e.detail.videoId
playState: true,
videoId: e.detail.videoId
})
}else if(e.detail.playType == "pause" && this.data.playState == true){
} else if (e.detail.playType == "pause" && this.data.playState == true) {
this.setData({
playState : false
playState: false
})
}
},
@@ -49,7 +48,7 @@ Page({
/**
* 获取视频下标
*/
swiperIndex(e){
swiperIndex(e) {
console.log(e.detail.current)
@@ -61,17 +60,25 @@ Page({
/**
* 点赞视频
*/
binLike(){
binLike() {
let hasLogin = wx.getStorageSync("token")
if(hasLogin == ""){
if (hasLogin == "") {
wx.navigateTo({
url: "/pages/login/login"
})
}else{
} else {
wx.showToast({
title: "点赞成功"
})
}
},
/**
* 跳转到企业主页
*/
goCompany(e) {
wx.navigateTo({
url: '/pages/home/index?id=' + e.currentTarget.dataset.id,
})
}
})
})