提交 59a01c3f 编写于 作者: guangjun.yang's avatar guangjun.yang

课程分享页面

上级 5773e3f6
<template> <template>
<section :class="isFixNavbar ? 'nav-top fixed' : 'nav-top'" :style="'height:' + navHeight"> <section :class="isFixNavbar ? 'nav-top fixed' : 'nav-top'" :style="'height:' + navHeight">
<!-- <section v-if="isWeb" :class="isFixNavbar ? 'nav-top fixed' : 'nav-top'"> -->
<div <div
class="nav-part" class="nav-part"
:style="'background:' + bgColor + ';' :style="'background:' + bgColor + ';'
...@@ -10,8 +9,6 @@ ...@@ -10,8 +9,6 @@
<span class="nav-back" @click="goBack"> <span class="nav-back" @click="goBack">
<img v-show="isBlack" src="../../images/left-array-black.png" alt=""> <img v-show="isBlack" src="../../images/left-array-black.png" alt="">
<img v-show="!isBlack" src="../../images/left-array-whiter.png" alt=""> <img v-show="!isBlack" src="../../images/left-array-whiter.png" alt="">
<!-- <img src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/gpranking/left-icon.png"> -->
<!-- <img class="nav-back" src="../../images//grey-throw.png"/> -->
</span> </span>
<span class="nav-title-title" v-show="bgColor!=='none'">{{title}}</span> <span class="nav-title-title" v-show="bgColor!=='none'">{{title}}</span>
<span v-if="isShowShare" class="nav-share" @click="goShare"> <span v-if="isShowShare" class="nav-share" @click="goShare">
...@@ -79,15 +76,13 @@ export default { ...@@ -79,15 +76,13 @@ export default {
shareTitleInfo: { shareTitleInfo: {
type: String, type: String,
default: "" default: ""
},
shareUrl: {
type: String,
default: ""
} }
}, },
computed: { computed: {
// bgColor2() {
// return this.bgColor
// },
// borderStyle() {
// return this.bgColor === 'no{ne' ? '0px solid #e7e7e7' : '1px solid #e7e7e7'
// },
navHeight() { navHeight() {
if (this.isFixNavbar) { if (this.isFixNavbar) {
return 0; return 0;
...@@ -108,28 +103,16 @@ export default { ...@@ -108,28 +103,16 @@ export default {
methods: { methods: {
//返回 //返回
goBack() { goBack() {
// if (this.burialPoint == "activity") {
// this.pageBurialPoin(this.objPoint);
// }
// if (this.backMethod === "inner" || window.__isWeb) {
// this.$router.back(-1);
// } else {
// rocNative.goBack();
// }
rocNative.goBack(); rocNative.goBack();
}, },
//分享 //分享
goShare() { goShare() {
let url = location.href, // let url = location.href,
_this = this; let _this = this;
rocNative.shareWechat({ rocNative.shareWechat({
// url: url,
// title: '_this.title',
// content: '_this.content',
// shareImageUrl: '_this.shareImageUrl'
type: 6, type: 6,
shareId: 0, shareId: 0,
shareUrl: url, shareUrl: _this.shareUrl,
title1: _this.shareTitle, title1: _this.shareTitle,
title2: _this.shareTitleInfo, title2: _this.shareTitleInfo,
shareImageUrl: "https://file.yunqueyi.com/logo.png?version=" + new Date().getTime() shareImageUrl: "https://file.yunqueyi.com/logo.png?version=" + new Date().getTime()
...@@ -168,9 +151,6 @@ export default { ...@@ -168,9 +151,6 @@ export default {
width: px2rem(55px); width: px2rem(55px);
padding-left: px2rem(15px); padding-left: px2rem(15px);
padding-right: px2rem(15px); padding-right: px2rem(15px);
// -ms-transform: translate(180deg);
// -webkit-transform: (180deg);
// transform: rotate(180deg);
} }
img { img {
display: block; display: block;
......
...@@ -2,6 +2,7 @@ import App from '../App' ...@@ -2,6 +2,7 @@ import App from '../App'
const index = r => require.ensure([], () => r(require('../views/index')), 'index') const index = r => require.ensure([], () => r(require('../views/index')), 'index')
const merge = r => require.ensure([], () => r(require('../views/merge-detail')), 'merge') const merge = r => require.ensure([], () => r(require('../views/merge-detail')), 'merge')
const shareMerge = r => require.ensure([], () => r(require('../views/share-merge-detail')), 'share-merge')
const test = r => require.ensure([], () => r(require('../views/test-components')), 'test-components') const test = r => require.ensure([], () => r(require('../views/test-components')), 'test-components')
const courseDetail = r => require.ensure([], () => r(require('../views/course-detail')), 'course-detail') const courseDetail = r => require.ensure([], () => r(require('../views/course-detail')), 'course-detail')
...@@ -25,6 +26,10 @@ export default [{ ...@@ -25,6 +26,10 @@ export default [{
path: '/coop', path: '/coop',
component: merge component: merge
}, },
{
path: '/sharecoop',
component: shareMerge
},
{ {
path: '/test', path: '/test',
component: test component: test
......
...@@ -23,6 +23,7 @@ export const envConfig = { ...@@ -23,6 +23,7 @@ export const envConfig = {
apiUrl: 'https://uat-api.yunqueyi.com/', apiUrl: 'https://uat-api.yunqueyi.com/',
webPageUrl: 'https://uat-phome.yunqueyi.com/', webPageUrl: 'https://uat-phome.yunqueyi.com/',
hactiveUrl: 'https://uat-hactive.yunqueyi.com', hactiveUrl: 'https://uat-hactive.yunqueyi.com',
appId: 'wxf4e66242d31c81c2', // 用于微信授权登录
// baseUrl: 'https://sc.yunqueyi.com/', // baseUrl: 'https://sc.yunqueyi.com/',
// apiUrl: 'https://api.yunqueyi.com/', // apiUrl: 'https://api.yunqueyi.com/',
...@@ -35,23 +36,27 @@ export const envConfig = { ...@@ -35,23 +36,27 @@ export const envConfig = {
apiUrl: 'https://dev-api.yunqueyi.com/', apiUrl: 'https://dev-api.yunqueyi.com/',
webPageUrl: 'https://dev-phome.yunqueyi.com/', webPageUrl: 'https://dev-phome.yunqueyi.com/',
hactiveUrl: 'https://dev-hactive.yunqueyi.com', hactiveUrl: 'https://dev-hactive.yunqueyi.com',
appId: 'wxf4e66242d31c81c2', // 用于微信授权登录
}, },
test: { test: {
baseUrl: 'https://test1-sc.yunqueyi.com/', baseUrl: 'https://test1-sc.yunqueyi.com/',
apiUrl: 'https://test1-api.yunqueyi.com/', apiUrl: 'https://test1-api.yunqueyi.com/',
webPageUrl: 'https://test1-phome.yunqueyi.com/', webPageUrl: 'https://test1-phome.yunqueyi.com/',
hactiveUrl: 'https://test1-hactive.yunqueyi.com', hactiveUrl: 'https://test1-hactive.yunqueyi.com',
appId: 'wxcaad75b7fff5659c', // 用于微信授权登录
}, },
uat: { uat: {
baseUrl: 'https://uat-sc.yunqueyi.com/', baseUrl: 'https://uat-sc.yunqueyi.com/',
apiUrl: 'https://uat-api.yunqueyi.com/', apiUrl: 'https://uat-api.yunqueyi.com/',
webPageUrl: 'https://uat-phome.yunqueyi.com/', webPageUrl: 'https://uat-phome.yunqueyi.com/',
hactiveUrl: 'https://uat-hactive.yunqueyi.com', hactiveUrl: 'https://uat-hactive.yunqueyi.com',
appId: 'wx342ef0e5afee54a7', // 用于微信授权登录
}, },
pro: { pro: {
baseUrl: 'https://sc.yunqueyi.com/', baseUrl: 'https://sc.yunqueyi.com/',
apiUrl: 'https://api.yunqueyi.com/', apiUrl: 'https://api.yunqueyi.com/',
webPageUrl: 'https://phome.yunqueyi.com/', webPageUrl: 'https://phome.yunqueyi.com/',
hactiveUrl: 'https://hactive.yunqueyi.com', hactiveUrl: 'https://hactive.yunqueyi.com',
appId: 'wx2c577552a2d28550', // 用于微信授权登录
} }
} }
...@@ -23,6 +23,11 @@ export function getHactiveUrl(url) { ...@@ -23,6 +23,11 @@ export function getHactiveUrl(url) {
return getConfigByEnvType('hactiveUrl') + (url || '') return getConfigByEnvType('hactiveUrl') + (url || '')
} }
// 获取微信APPID
export function getAPPID() {
return getConfigByEnvType('appId')
}
// 根据不同环境,生成URL // 根据不同环境,生成URL
function getConfigByEnvType(urlType) { function getConfigByEnvType(urlType) {
return envConfig[process.env.BUILD_ENV][urlType] return envConfig[process.env.BUILD_ENV][urlType]
......
/* eslint-disable */
import Vue from 'vue'
import request from '@/service/api';
import wx from 'weixin-js-sdk'
import { getBaseUrl } from "@/utils/index";
/** 注入配置信息 */
export const wxConfig = (link) => {
// const params = { resetURI: true, url: encodeURIComponent(location.href) };
// 上线前是需要把域名改为线上的sc
let baseUrl = getBaseUrl();
// request({ url: `https://sc.yunqueyi.com/wechats/signs?url=${encodeURIComponent(link)}` }).then(res => {
request({ url: `${baseUrl}/wechats/signs?url=${encodeURIComponent(link)}` }).then(res => {
let configs = res.data.signMap;
wx.config({
debug: false,
appId: configs.appId,
nonceStr: configs.nonceStr,
timestamp: configs.timestamp,
signature: configs.signature,
jsApiList: [
'hideMenuItems',
'previewImage',
'checkJsApi',
'chooseWXPay',
'onMenuShareTimeline',
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareWeibo',
'onMenuShareQZone',
'getLocation',
'openLocation',
'translateVoice'
]
});
});;
};
/**
* wxShare 分享
* @param option
*/
export const wxShare = (option = {}, successCB = () => {}) => {
wx.ready(() => {
// 分享给朋友
wx.onMenuShareAppMessage({
title: option.title,
desc: option.desc,
link: option.link,
imgUrl: option.imgUrl,
success: function(res) {
// 用户确认分享后执行的回调函数
successCB(res);
},
cancel: function() {
// 用户取消分享后执行的回调函数
}
});
// 分享到朋友圈
wx.onMenuShareTimeline({
title: option.friendtitle || option.title, // 标题
desc: option.desc,
link: option.link, // 链接
imgUrl: option.imgUrl, // 分享图标
success: function(res) {
successCB(res);
},
cancel: function() {
// 用户取消分享后执行的回调函数
}
});
});
};
export const wxDisabledShare = () => {
wx.ready(() => {
wx.hideMenuItems({
menuList: [
'menuItem:share:appMessage',
'menuItem:share:timeline',
'menuItem:share:qq',
'menuItem:share:weiboApp',
'menuItem:share:QZone'
]
});
});
};
/**
*
* @param source
* @param option
*/
export const wechatShare = async (option = {}, successCB = () => {}) => {
const shareOption = {
link: location.href,
title: `云鹊医!`,
friendtitle: `讨论进行中,速来围观!`,
desc: '参与讨论,一起畅谈医学那些事!快来看看吧~',
imgUrl: 'https://file.yunqueyi.com/logo.png',
...option
};
wxConfig(shareOption.link);
wxShare(shareOption, successCB);
};
Vue.prototype.wechatShare = wechatShare
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
textContent: "", textContent: "",
leaderText: "", leaderText: "",
pageTitle: "", pageTitle: "",
isShowShare: false, isShowShare: true,
tabFlag: true, // 显示目录还是简介 tabFlag: true, // 显示目录还是简介
fixedFlag: false, // 目录和简介是否固定 fixedFlag: false, // 目录和简介是否固定
project: { project: {
......
此差异已折叠。
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册