|
|
@@ -29,6 +29,8 @@
|
|
|
<button class="focu-btn followed" v-if="idInfo.has_follow" @click="doFollow">已关注</button>
|
|
|
<button class="focu-btn" v-else @click="doFollow">关注TA</button>
|
|
|
</div>
|
|
|
+
|
|
|
+
|
|
|
<div class="content-box">
|
|
|
<div class="content-left">
|
|
|
<div class="panel panel-default">
|
|
|
@@ -129,7 +131,7 @@
|
|
|
+ 添加视频
|
|
|
</div>
|
|
|
<template v-if="item == 'video'">
|
|
|
- <div class="video2" v-for="item in list" >
|
|
|
+ <div class="video2" v-for="item in list">
|
|
|
<div class="video-box" @click="openVideo(item)">
|
|
|
<div class="video-img">
|
|
|
<img class="img" :src="item.cover_url" alt="">
|
|
|
@@ -258,13 +260,18 @@
|
|
|
<span class="mui-tab-label ">我的</span>
|
|
|
</a>
|
|
|
</nav>
|
|
|
+ <van-overlay :show="show" @click="show = false" style="">
|
|
|
+ <div class="margin-0-auto" id="player-con" style="width:800px;height:500px;position:relative;top:50%;margin-top:-250px">111</div>
|
|
|
+ </van-overlay>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+ // import VueAliplayer from 'vue-aliplayer'
|
|
|
import WxMixin from "@/mixins/wx";
|
|
|
import "@/assets/css/user/mui.min.css"
|
|
|
import {
|
|
|
- Toast
|
|
|
+ Toast,
|
|
|
+ Overlay
|
|
|
} from 'vant';
|
|
|
|
|
|
import moment from "moment"
|
|
|
@@ -272,28 +279,33 @@
|
|
|
let page = 1;
|
|
|
|
|
|
export default {
|
|
|
+ // components: {
|
|
|
+ // 'ali-player': VueAliplayer,
|
|
|
+ // },
|
|
|
layout: "opacity_header",
|
|
|
head() {
|
|
|
- const {canonical="", title="", keywords="", description="", h1=""} = this.seoInfo
|
|
|
+ const {
|
|
|
+ canonical = "", title = "", keywords = "", description = "", h1 = ""
|
|
|
+ } = this.seoInfo
|
|
|
return {
|
|
|
title: title,
|
|
|
- meta: [
|
|
|
- {
|
|
|
- 'name': 'keywords',
|
|
|
- 'content': keywords
|
|
|
- }, {
|
|
|
- 'name': 'description',
|
|
|
- 'content': description
|
|
|
- }, {
|
|
|
- 'name': 'h1',
|
|
|
- 'content': h1
|
|
|
- }
|
|
|
- ],
|
|
|
+ meta: [{
|
|
|
+ 'name': 'keywords',
|
|
|
+ 'content': keywords
|
|
|
+ }, {
|
|
|
+ 'name': 'description',
|
|
|
+ 'content': description
|
|
|
+ }, {
|
|
|
+ 'name': 'h1',
|
|
|
+ 'content': h1
|
|
|
+ }],
|
|
|
script: [{
|
|
|
src: "https://res.wx.qq.com/open/js/jweixin-1.2.0.js"
|
|
|
},
|
|
|
{
|
|
|
src: "https://hm.baidu.com/hm.js?18455f493c982100e5a82ec978a8d06e"
|
|
|
+ }, {
|
|
|
+ src: "https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js"
|
|
|
}
|
|
|
],
|
|
|
link: [{
|
|
|
@@ -303,7 +315,12 @@
|
|
|
};
|
|
|
},
|
|
|
mixins: [WxMixin],
|
|
|
- async asyncData({ $axios, params, req, app }) {
|
|
|
+ async asyncData({
|
|
|
+ $axios,
|
|
|
+ params,
|
|
|
+ req,
|
|
|
+ app
|
|
|
+ }) {
|
|
|
console.log("*****")
|
|
|
let id = params.id;
|
|
|
let headers = req && req.headers;
|
|
|
@@ -312,7 +329,12 @@
|
|
|
headers
|
|
|
}
|
|
|
);
|
|
|
- const {headers: {host}, url} = req
|
|
|
+ const {
|
|
|
+ headers: {
|
|
|
+ host
|
|
|
+ },
|
|
|
+ url
|
|
|
+ } = req
|
|
|
//拼接canonical
|
|
|
let canonical = ""
|
|
|
if (host.indexOf('local') !== -1) {
|
|
|
@@ -320,7 +342,9 @@
|
|
|
} else {
|
|
|
canonical = 'https://' + host + url
|
|
|
}
|
|
|
- const {nickname=""} = res.data && res.data.info || {}
|
|
|
+ const {
|
|
|
+ nickname = ""
|
|
|
+ } = res.data && res.data.info || {}
|
|
|
return {
|
|
|
idInfo: res.data || {},
|
|
|
info: res.data && res.data.info || {},
|
|
|
@@ -329,7 +353,7 @@
|
|
|
seoInfo: {
|
|
|
title: `${nickname}个人主页-技术圈`,
|
|
|
keywords: `${nickname}个人主页`,
|
|
|
- description:`技术圈提供${nickname}个人主页,方便对${nickname}感兴趣的人收藏和关注,并及时了解${nickname}的动态,包括最新文章、最新视频!`,
|
|
|
+ description: `技术圈提供${nickname}个人主页,方便对${nickname}感兴趣的人收藏和关注,并及时了解${nickname}的动态,包括最新文章、最新视频!`,
|
|
|
h1: '/',
|
|
|
canonical
|
|
|
}
|
|
|
@@ -345,7 +369,8 @@
|
|
|
isLoading: false,
|
|
|
noMore: false,
|
|
|
item: null,
|
|
|
- listCount: 10
|
|
|
+ listCount: 10,
|
|
|
+ show:true
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -363,338 +388,374 @@
|
|
|
this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ play_toast(vid){
|
|
|
+ console.log(vid)
|
|
|
+ let that = this
|
|
|
+ that.show= true
|
|
|
+ this.$axios.$post(
|
|
|
+ '/api/jishuquan/get_play_token', {
|
|
|
+ video_id: vid
|
|
|
+ }
|
|
|
+ ).then((res) => {
|
|
|
+ let auth = res.data.auth.playauth
|
|
|
|
|
|
- edit() {
|
|
|
- let that = this
|
|
|
- this.$prompt('请输入签名', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- inputErrorMessage: '签名错误,需要在10-150字之间'
|
|
|
- }).then(({
|
|
|
- value
|
|
|
- }) => {
|
|
|
- this.$axios.$post(
|
|
|
- '/api/jishuquan/update_desc', {
|
|
|
- description: value
|
|
|
- }
|
|
|
- ).then((res) => {
|
|
|
+ var player = new Aliplayer({
|
|
|
+ "id": "player-con",
|
|
|
+ "vid": vid,
|
|
|
+ "playauth":auth,
|
|
|
+ "qualitySort": "asc",
|
|
|
+ "mediaType": "video",
|
|
|
+ "width": "800px",
|
|
|
+ "height": "500px",
|
|
|
+ "autoplay": true,
|
|
|
+ "isLive": false,
|
|
|
+ "cover": "",
|
|
|
+ "rePlay": false,
|
|
|
+ "playsinline": true,
|
|
|
+ "autoPlayDelay": "3",
|
|
|
+ "preload": true,
|
|
|
+ "controlBarVisibility": "hover",
|
|
|
+ "useH5Prism": true
|
|
|
+ }, function (player) {
|
|
|
+ console.log("The player is created");
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ edit() {
|
|
|
+ let that = this
|
|
|
+ this.$prompt('请输入签名', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ inputErrorMessage: '签名错误,需要在10-150字之间'
|
|
|
+ }).then(({
|
|
|
+ value
|
|
|
+ }) => {
|
|
|
+ this.$axios.$post(
|
|
|
+ '/api/jishuquan/update_desc', {
|
|
|
+ description: value
|
|
|
+ }
|
|
|
+ ).then((res) => {
|
|
|
|
|
|
- if (res.status >= 0) {
|
|
|
- let info = that.info
|
|
|
- info.jishuquan_description = value
|
|
|
- that.info = info
|
|
|
- that.$message({
|
|
|
- type: 'success',
|
|
|
- message: '更新成功'
|
|
|
+ if (res.status >= 0) {
|
|
|
+ let info = that.info
|
|
|
+ info.jishuquan_description = value
|
|
|
+ that.info = info
|
|
|
+ that.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '更新成功'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '更新失败'
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
+ }).catch(() => {
|
|
|
+ //取消输入
|
|
|
+ });
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let dom = document.getElementsByClassName('el-message-box')[0]
|
|
|
+ dom && (dom.style.width = "80vw")
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addCollect() {
|
|
|
+ if (this.mobile) {
|
|
|
+ Toast("请前往程序员客栈,添加解决方案")
|
|
|
} else {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '更新失败'
|
|
|
- });
|
|
|
+ window.open(this.baseUrl + '/kaifain/add')
|
|
|
}
|
|
|
- });
|
|
|
- }).catch(() => {
|
|
|
- //取消输入
|
|
|
- });
|
|
|
- this.$nextTick(()=>{
|
|
|
- let dom = document.getElementsByClassName('el-message-box')[0]
|
|
|
- dom && ( dom.style.width = "80vw")
|
|
|
- })
|
|
|
- },
|
|
|
- addCollect() {
|
|
|
- if (this.mobile) {
|
|
|
- Toast("请前往程序员客栈,添加解决方案")
|
|
|
- } else {
|
|
|
- window.open(this.baseUrl + '/kaifain/add')
|
|
|
- }
|
|
|
- },
|
|
|
- async addVideo() {
|
|
|
- await this.needLogin();
|
|
|
- if (this.$store.state.isPC) {
|
|
|
- window.location.href="/videos/create"
|
|
|
- } else {
|
|
|
- window.location.href="/user/new_video"
|
|
|
- }
|
|
|
- },
|
|
|
- async addArticle() {
|
|
|
- await this.needLogin();
|
|
|
- if (this.$store.state.isPC) {
|
|
|
- this.$router.push("/topics/create")
|
|
|
- } else {
|
|
|
- this.$router.push("/user/new_article")
|
|
|
- }
|
|
|
- },
|
|
|
- changeitem(x) {
|
|
|
- this.item = x
|
|
|
- this.page = 0
|
|
|
- this.currentPage = 1
|
|
|
- this.list = []
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- async handleDelete(topic) {
|
|
|
- await this.needLogin();
|
|
|
- if (!this.idInfo.has_edit_delete_access) {
|
|
|
- this.$message.error("你没有该文章的操作权限");
|
|
|
- }
|
|
|
- this.$confirm(`<p>确认删除该文章吗?</p>`, "提示", {
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- })
|
|
|
- .then(async () => {
|
|
|
- this.$axios
|
|
|
- .$post("/api/community/topic/delete", {
|
|
|
- topic_id: topic.id
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.$message({
|
|
|
- message: "删除成功",
|
|
|
- type: "success"
|
|
|
- });
|
|
|
- this.getDetail();
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$message.error("该文章不存在");
|
|
|
- setTimeout(() => location.reload(), 1000);
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.log("cancel");
|
|
|
- });
|
|
|
- },
|
|
|
- clickLancer({
|
|
|
- id
|
|
|
- }) {
|
|
|
- this.$router.push(baseUrl + `/cert/type/${id}`);
|
|
|
- },
|
|
|
- btnDisabled(item) {
|
|
|
- return item.btn_name !== "申请认证" || !item.can_click;
|
|
|
- },
|
|
|
- //获取列表
|
|
|
- async getList() {
|
|
|
- let id = this.$route.params.id;
|
|
|
- let url = ''
|
|
|
- let tag = 'topic'
|
|
|
+ },
|
|
|
+ async addVideo() {
|
|
|
+ await this.needLogin();
|
|
|
+ if (this.$store.state.isPC) {
|
|
|
+ window.location.href = "/videos/create"
|
|
|
+ } else {
|
|
|
+ window.location.href = "/user/new_video"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async addArticle() {
|
|
|
+ await this.needLogin();
|
|
|
+ if (this.$store.state.isPC) {
|
|
|
+ this.$router.push("/topics/create")
|
|
|
+ } else {
|
|
|
+ this.$router.push("/user/new_article")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeitem(x) {
|
|
|
+ this.item = x
|
|
|
+ this.page = 0
|
|
|
+ this.currentPage = 1
|
|
|
+ this.list = []
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ async handleDelete(topic) {
|
|
|
+ await this.needLogin();
|
|
|
+ if (!this.idInfo.has_edit_delete_access) {
|
|
|
+ this.$message.error("你没有该文章的操作权限");
|
|
|
+ }
|
|
|
+ this.$confirm(`<p>确认删除该文章吗?</p>`, "提示", {
|
|
|
+ dangerouslyUseHTMLString: true
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ this.$axios
|
|
|
+ .$post("/api/community/topic/delete", {
|
|
|
+ topic_id: topic.id
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$message({
|
|
|
+ message: "删除成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.getDetail();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message.error("该文章不存在");
|
|
|
+ setTimeout(() => location.reload(), 1000);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log("cancel");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ clickLancer({
|
|
|
+ id
|
|
|
+ }) {
|
|
|
+ this.$router.push(baseUrl + `/cert/type/${id}`);
|
|
|
+ },
|
|
|
+ btnDisabled(item) {
|
|
|
+ return item.btn_name !== "申请认证" || !item.can_click;
|
|
|
+ },
|
|
|
+ //获取列表
|
|
|
+ async getList() {
|
|
|
+ let id = this.$route.params.id;
|
|
|
+ let url = ''
|
|
|
+ let tag = 'topic'
|
|
|
|
|
|
- if (this.isLoading) {
|
|
|
- return 0
|
|
|
- }
|
|
|
- this.isLoading = true;
|
|
|
+ if (this.isLoading) {
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ this.isLoading = true;
|
|
|
|
|
|
- switch (this.item) {
|
|
|
- case 'heji':
|
|
|
- url = '/api/jishuquan/get_collections'
|
|
|
- break
|
|
|
- case 'video':
|
|
|
- url = '/api/jishuquan/get_videos'
|
|
|
- break
|
|
|
- default:
|
|
|
- url = '/api/user/getUserInfo'
|
|
|
- }
|
|
|
+ switch (this.item) {
|
|
|
+ case 'heji':
|
|
|
+ url = '/api/jishuquan/get_collections'
|
|
|
+ break
|
|
|
+ case 'video':
|
|
|
+ url = '/api/jishuquan/get_videos'
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ url = '/api/user/getUserInfo'
|
|
|
+ }
|
|
|
|
|
|
- let res = await this.$axios.$post(
|
|
|
- url, {
|
|
|
- uid: id,
|
|
|
- id: id,
|
|
|
- page: this.currentPage,
|
|
|
- size: 10
|
|
|
- }, {
|
|
|
- neverLogout: true
|
|
|
- }
|
|
|
- );
|
|
|
- this.isLoading = false;
|
|
|
- if (res) {
|
|
|
- let list = []
|
|
|
- switch (this.item) {
|
|
|
- case 'heji':
|
|
|
- list = res.data
|
|
|
- this.listCount = (res.data.count + 1 - 1) || 0
|
|
|
- break
|
|
|
- case 'video':
|
|
|
- list = res.data.videos
|
|
|
- this.listCount = (res.data.count + 1 - 1) || 0
|
|
|
- break
|
|
|
- default:
|
|
|
- list = res.data.topics
|
|
|
- this.listCount = (res.data.topics_count + 1 - 1) || 0
|
|
|
- }
|
|
|
- console.log("------------------------0")
|
|
|
- console.log(list)
|
|
|
- if(list.length < 10){
|
|
|
- console.log("------------------------0")
|
|
|
+ let res = await this.$axios.$post(
|
|
|
+ url, {
|
|
|
+ uid: id,
|
|
|
+ id: id,
|
|
|
+ page: this.currentPage,
|
|
|
+ size: 10
|
|
|
+ }, {
|
|
|
+ neverLogout: true
|
|
|
+ }
|
|
|
+ );
|
|
|
+ this.isLoading = false;
|
|
|
+ if (res) {
|
|
|
+ let list = []
|
|
|
+ switch (this.item) {
|
|
|
+ case 'heji':
|
|
|
+ list = res.data
|
|
|
+ this.listCount = (res.data.count + 1 - 1) || 0
|
|
|
+ break
|
|
|
+ case 'video':
|
|
|
+ list = res.data.videos
|
|
|
+ this.listCount = (res.data.count + 1 - 1) || 0
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ list = res.data.topics
|
|
|
+ this.listCount = (res.data.topics_count + 1 - 1) || 0
|
|
|
+ }
|
|
|
+ console.log("------------------------0")
|
|
|
+ console.log(list)
|
|
|
+ if (list.length < 10) {
|
|
|
+ console.log("------------------------0")
|
|
|
|
|
|
- this.noMore = true
|
|
|
- }
|
|
|
- this.currentPage += 1
|
|
|
- let new_list = this.list.concat(list)
|
|
|
- this.list = new_list
|
|
|
- }
|
|
|
- },
|
|
|
- canApply(item) {
|
|
|
- return item.end_date && item.is_cert_validate && item.cert_no;
|
|
|
- },
|
|
|
- configWx() {
|
|
|
- try {
|
|
|
- let conf = this.$store.state.wxConfig;
|
|
|
- wx.ready(function() {
|
|
|
- //需在用户可能点击分享按钮前就先调用
|
|
|
- wx.config({
|
|
|
- debug: true,
|
|
|
- appId: conf.appId,
|
|
|
- timestamp: conf.timestamp,
|
|
|
- nonceStr: conf.nonceStr,
|
|
|
- signature: conf.signature,
|
|
|
- jsApiList: [
|
|
|
- // 所有要调用的 API 都要加到这个列表中
|
|
|
- "onMenuShareTimeline", // 分享到朋友圈接口
|
|
|
- "onMenuShareAppMessage", // 分享到朋友接口
|
|
|
- "onMenuShareQQ", // 分享到QQ接口
|
|
|
- "onMenuShareWeibo" // 分享到微博接口
|
|
|
- ],
|
|
|
- success: function() {
|
|
|
- alert("wx.config ok");
|
|
|
- },
|
|
|
- error: function(d) {
|
|
|
- alert("wx.config err:" + JSON.stringify(d));
|
|
|
- }
|
|
|
- });
|
|
|
- wx.updateAppMessageShareData({
|
|
|
- title: "开发者资质认证", // 分享标题
|
|
|
- desc: "通过平台审核、认证,将获得更多接单机会", // 分享描述
|
|
|
- link: location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
|
- imgUrl: "https://stacdn.proginn.com/favicon.ico", // 分享图标
|
|
|
- success: function() {
|
|
|
- // 设置成功
|
|
|
- alert("微信图标设置成功");
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- } catch (error) {
|
|
|
- // alert(error);
|
|
|
- }
|
|
|
- },
|
|
|
- /**
|
|
|
- * 修改页码
|
|
|
- */
|
|
|
- changePagination(page) {
|
|
|
- this.currentPage = page;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- //打开视频
|
|
|
- openVideo(item) {
|
|
|
- const {
|
|
|
- width,
|
|
|
- height,
|
|
|
- video_id
|
|
|
- } = item
|
|
|
- console.log(item)
|
|
|
- if (this.$deviceType.app) {
|
|
|
- location.href = `proginn://community/video?id=${video_id}`
|
|
|
- } else if (this.$deviceType.isMobile()) {
|
|
|
- location.href = `${this.jishuBaseUrl}/video/${video_id}`
|
|
|
- } else if (Number(width) < Number(height)) { //竖屏 跳转到播放页
|
|
|
- window.open(`/video/${video_id}`, "_black")
|
|
|
- } else {
|
|
|
- this.$message("横屏还对接")
|
|
|
- }
|
|
|
- },
|
|
|
- /**
|
|
|
- * 点击关注按钮
|
|
|
- */
|
|
|
- async doFollow() {
|
|
|
- // 移动端处理
|
|
|
- if (!this.$store.state.isPC && !this.$store.getters.isLogin) {
|
|
|
- this.goLogin();
|
|
|
- return;
|
|
|
- }
|
|
|
- let res = await this.$axios.$post(`/api/user/follow`, {
|
|
|
- follow_id: this.$route.params.id
|
|
|
- });
|
|
|
- if (res && res.data) {
|
|
|
- this.idInfo.has_follow = res.data.follow_status ? 1 : 0;
|
|
|
- } else {
|
|
|
- this.goLogin(1, true);
|
|
|
- }
|
|
|
+ this.noMore = true
|
|
|
+ }
|
|
|
+ this.currentPage += 1
|
|
|
+ let new_list = this.list.concat(list)
|
|
|
+ this.list = new_list
|
|
|
+ }
|
|
|
+ },
|
|
|
+ canApply(item) {
|
|
|
+ return item.end_date && item.is_cert_validate && item.cert_no;
|
|
|
+ },
|
|
|
+ configWx() {
|
|
|
+ try {
|
|
|
+ let conf = this.$store.state.wxConfig;
|
|
|
+ wx.ready(function() {
|
|
|
+ //需在用户可能点击分享按钮前就先调用
|
|
|
+ wx.config({
|
|
|
+ debug: true,
|
|
|
+ appId: conf.appId,
|
|
|
+ timestamp: conf.timestamp,
|
|
|
+ nonceStr: conf.nonceStr,
|
|
|
+ signature: conf.signature,
|
|
|
+ jsApiList: [
|
|
|
+ // 所有要调用的 API 都要加到这个列表中
|
|
|
+ "onMenuShareTimeline", // 分享到朋友圈接口
|
|
|
+ "onMenuShareAppMessage", // 分享到朋友接口
|
|
|
+ "onMenuShareQQ", // 分享到QQ接口
|
|
|
+ "onMenuShareWeibo" // 分享到微博接口
|
|
|
+ ],
|
|
|
+ success: function() {
|
|
|
+ alert("wx.config ok");
|
|
|
+ },
|
|
|
+ error: function(d) {
|
|
|
+ alert("wx.config err:" + JSON.stringify(d));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ wx.updateAppMessageShareData({
|
|
|
+ title: "开发者资质认证", // 分享标题
|
|
|
+ desc: "通过平台审核、认证,将获得更多接单机会", // 分享描述
|
|
|
+ link: location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
|
+ imgUrl: "https://stacdn.proginn.com/favicon.ico", // 分享图标
|
|
|
+ success: function() {
|
|
|
+ // 设置成功
|
|
|
+ alert("微信图标设置成功");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } catch (error) {
|
|
|
+ // alert(error);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 修改页码
|
|
|
+ */
|
|
|
+ changePagination(page) {
|
|
|
+ this.currentPage = page;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ //打开视频
|
|
|
+ openVideo(item) {
|
|
|
+ const {
|
|
|
+ width,
|
|
|
+ height,
|
|
|
+ video_id
|
|
|
+ } = item
|
|
|
+
|
|
|
+ if (this.$deviceType.app) {
|
|
|
+ location.href = `proginn://community/video?id=${video_id}`
|
|
|
+ } else if (this.$deviceType.isMobile()) {
|
|
|
+ location.href = `${this.jishuBaseUrl}/video/${video_id}`
|
|
|
+ } else if (Number(width) < Number(height)) { //竖屏 跳转到播放页
|
|
|
+ window.open(`/video/${video_id}`, "_black")
|
|
|
+ } else {
|
|
|
+ this.$message("即将播放")
|
|
|
+ this.play_toast(video_id)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 点击关注按钮
|
|
|
+ */
|
|
|
+ async doFollow() {
|
|
|
+ // 移动端处理
|
|
|
+ if (!this.$store.state.isPC && !this.$store.getters.isLogin) {
|
|
|
+ this.goLogin();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let res = await this.$axios.$post(`/api/user/follow`, {
|
|
|
+ follow_id: this.$route.params.id
|
|
|
+ });
|
|
|
+ if (res && res.data) {
|
|
|
+ this.idInfo.has_follow = res.data.follow_status ? 1 : 0;
|
|
|
+ } else {
|
|
|
+ this.goLogin(1, true);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 点击文章
|
|
|
+ */
|
|
|
+ clickArt(art, index) {
|
|
|
+ location.href = `/p/${art.id}.html`;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 监听滚动
|
|
|
+ */
|
|
|
+ containerScroll() {
|
|
|
+ if (this.isLoading || this.noMore) return;
|
|
|
+ // PC不监听
|
|
|
+ if (this.$store.state.isPC) return;
|
|
|
+ if (
|
|
|
+ container.scrollHeight - container.scrollTop - container.clientHeight <
|
|
|
+ 50
|
|
|
+ ) {
|
|
|
+ this.currentPage++;
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //获取路由中的参数
|
|
|
+ getType() {
|
|
|
+ let item = this.$route.params.type
|
|
|
+ this.uid = this.$route.params.id
|
|
|
+ switch (item) {
|
|
|
+ case 'heji':
|
|
|
+ this.item = item
|
|
|
+ break
|
|
|
+ case 'video':
|
|
|
+ this.item = item
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ this.item = 'article'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ formatPublichTime(ts) {
|
|
|
+ try {
|
|
|
+ ts = moment(ts).toDate().getTime()
|
|
|
+ let now = new Date().getTime()
|
|
|
+ let fromNow = Math.floor((now - ts) / 1000)
|
|
|
+ if (fromNow < 5 * 60) {
|
|
|
+ return "刚刚";
|
|
|
+ } else if (fromNow < 60 * 60) {
|
|
|
+ return Math.floor(fromNow / 60) + "分钟前";
|
|
|
+ } else if (fromNow < 60 * 60 * 24) {
|
|
|
+ return Math.floor(fromNow / 3600) + "小时前";
|
|
|
+ } else if (fromNow < 60 * 60 * 24 * 10) {
|
|
|
+ return Math.floor(fromNow / 86400) + "天前";
|
|
|
+ } else {
|
|
|
+ return moment().format("YYYY-MM-DD HH:mm")
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ return ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dealDuration(second) {
|
|
|
+ console.log("second", second)
|
|
|
+ if (!second) {
|
|
|
+ return "00:00"
|
|
|
+ }
|
|
|
+ let fix = (s) => ("00" + s).slice(-2)
|
|
|
+ if (second < 60) {
|
|
|
+ return "00:" + fix(second)
|
|
|
+ } else if (second >= 60 && second < 60 * 60) {
|
|
|
+ return fix(Math.floor(second / 60)) + ":" + fix(Math.floor(second % 60))
|
|
|
+ } else {
|
|
|
+ return fix(Math.floor(second / 60 / 60)) + ":" + fix(Math.floor(second / 60) % 60)
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
- /**
|
|
|
- * 点击文章
|
|
|
- */
|
|
|
- clickArt(art, index) {
|
|
|
- location.href = `/p/${art.id}.html`;
|
|
|
- },
|
|
|
- /**
|
|
|
- * 监听滚动
|
|
|
- */
|
|
|
- containerScroll() {
|
|
|
- if (this.isLoading || this.noMore) return;
|
|
|
- // PC不监听
|
|
|
- if (this.$store.state.isPC) return;
|
|
|
- if (
|
|
|
- container.scrollHeight - container.scrollTop - container.clientHeight <
|
|
|
- 50
|
|
|
- ) {
|
|
|
- this.currentPage++;
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- },
|
|
|
- //获取路由中的参数
|
|
|
- getType() {
|
|
|
- let item = this.$route.params.type
|
|
|
- this.uid = this.$route.params.id
|
|
|
- switch (item) {
|
|
|
- case 'heji':
|
|
|
- this.item = item
|
|
|
- break
|
|
|
- case 'video':
|
|
|
- this.item = item
|
|
|
- break
|
|
|
- default:
|
|
|
- this.item = 'article'
|
|
|
- }
|
|
|
- },
|
|
|
- formatPublichTime(ts) {
|
|
|
- try {
|
|
|
- ts = moment(ts).toDate().getTime()
|
|
|
- let now = new Date().getTime()
|
|
|
- let fromNow = Math.floor((now - ts) / 1000)
|
|
|
- if (fromNow < 5 * 60) {
|
|
|
- return "刚刚";
|
|
|
- } else if (fromNow < 60 * 60) {
|
|
|
- return Math.floor(fromNow / 60) + "分钟前";
|
|
|
- } else if (fromNow < 60 * 60 * 24) {
|
|
|
- return Math.floor(fromNow / 3600) + "小时前";
|
|
|
- } else if (fromNow < 60 * 60 * 24 * 10) {
|
|
|
- return Math.floor(fromNow / 86400) + "天前";
|
|
|
- } else {
|
|
|
- return moment().format("YYYY-MM-DD HH:mm")
|
|
|
- }
|
|
|
- } catch (e) {
|
|
|
- console.log(e)
|
|
|
- return ""
|
|
|
- }
|
|
|
- },
|
|
|
- dealDuration(second) {
|
|
|
- console.log("second", second)
|
|
|
- if (!second) {
|
|
|
- return "00:00"
|
|
|
- }
|
|
|
- let fix = (s) => ("00" + s).slice(-2)
|
|
|
- if (second < 60) {
|
|
|
- return "00:" + fix(second)
|
|
|
- } else if (second >= 60 && second < 60 * 60) {
|
|
|
- return fix(Math.floor(second / 60)) + ":" + fix(Math.floor(second % 60))
|
|
|
- } else {
|
|
|
- return fix(Math.floor(second / 60 / 60)) + ":" + fix(Math.floor(second / 60) % 60)
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- };
|
|
|
+ };
|
|
|
</script>
|
|
|
-
|
|
|
+<style>
|
|
|
+ @import "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css";
|
|
|
+</style>
|
|
|
<style lang='less' scoped>
|
|
|
+
|
|
|
@import "../../../assets/css/user/jishuinUser.less";
|
|
|
</style>
|
|
|
|
|
|
<style lang="sass">
|
|
|
@import "../../../assets/css/scssCommon"
|
|
|
-
|
|
|
</style>
|