提交 1df7fb21 编写于 作者: 张磊's avatar 张磊

add page-model

上级 ae447a48
<!-- 通用Navbar --> <!-- 通用Navbar -->
<template> <template>
<section <section
:class="isFixNavbar ? 'nav-top-new fixed' : 'nav-top-new'" class="nav-top-new"
:style="'height:' + navHeight" :style="'height:' + navHeight"
> >
<div <div class="nav-part-new">
class="nav-part-new"
:style="
'background:' +
bgColor +
';' +
'padding-top:' +
paddingTop +
';border-bottom:' +
borderStyle
"
>
<div class="nav-title-new"> <div class="nav-title-new">
<span <span
class="nav-back" class="nav-back"
@click="goBack" @click="goBack"
> >
<img <img
v-show="isBlack"
src="../../assets/images/left-arrow-black.png"
alt=""
>
<img
v-show="!isBlack"
src="../../assets/images/left-arrow-black.png" src="../../assets/images/left-arrow-black.png"
alt="" alt=""
> >
</span> </span>
<span
v-show="bgColor !== 'none'"
class="nav-title-new-title"
>{{
title
}}</span>
<span
v-show="isShowShare"
class="nav-share"
@click="goShare"
>
<img
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/courses/Group17_hover%403x.png"
>
</span>
<span <span
v-show="isShowKf && !isWeb" v-show="isShowKf && !isWeb"
class="nav-share" class="nav-share"
...@@ -66,43 +34,14 @@ import { goKfFn } from '@/utils/kf'; ...@@ -66,43 +34,14 @@ import { goKfFn } from '@/utils/kf';
export default { export default {
name: 'CommonNavbarNew', name: 'CommonNavbarNew',
props: { props: {
bgColor: {
type: String,
default: '',
},
title: { title: {
type: String, type: String,
default: '暂无数据', default: '暂无数据',
}, },
// 是否fix定位
isFixNavbar: {
type: Boolean,
default: true,
},
burialPoint: {
default: '',
type: String,
},
backMethod: {
type: String,
default: 'native', // inner native
},
isShowShare: {
type: Boolean,
default: false,
},
isShowKf: { isShowKf: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
borderStyle: {
type: String,
default: '0px solid #e7e7e7',
},
isBlack: {
type: Boolean,
default: true,
},
}, },
data() { data() {
return { return {
...@@ -117,11 +56,7 @@ export default { ...@@ -117,11 +56,7 @@ export default {
}, },
computed: { computed: {
navHeight() { navHeight() {
if (this.isFixNavbar) { return (this.navbarHeight + this.contentHeight) / this.fontSize + 'rem';
return '54px';
} else {
return (this.navbarHeight + this.contentHeight) / this.fontSize + 'rem';
}
}, },
paddingTop() { paddingTop() {
return this.navbarHeight / this.fontSize + 'rem'; return this.navbarHeight / this.fontSize + 'rem';
...@@ -145,18 +80,6 @@ export default { ...@@ -145,18 +80,6 @@ export default {
this.$rocNative.goBack(); this.$rocNative.goBack();
} }
}, },
// 分享
goShare() {
this.$rocNative.shareWechat({
type: 6,
shareId: 0,
shareUrl: 'shareUrl',
title1: 'this.shareTitle1',
title2: 'this.shareTitle2',
shareImageUrl:
'https://file.yunqueyi.com/logo.png?version=' + new Date().getTime(),
});
},
goKf() { goKf() {
goKfFn({ goKfFn({
code: '0002', code: '0002',
......
import Vue from 'vue'; import Vue from 'vue';
import rocNative from '@/utils/jsbridge'; import rocNative from '@/utils/jsbridge';
// import echarts from 'echarts';
import { Toast } from 'vant'; import { Toast } from 'vant';
const echarts = window.echarts; const echarts = window.echarts;
console.log('--rocNative', rocNative);
Vue.use(Toast); Vue.use(Toast);
Vue.prototype.$echarts = echarts; Vue.prototype.$echarts = echarts;
Vue.prototype.$rocNative = new rocNative(); Vue.prototype.$rocNative = new rocNative();
...@@ -16,7 +16,12 @@ export const JsBridgeOptions = { ...@@ -16,7 +16,12 @@ export const JsBridgeOptions = {
GLOBAL_NAME: 'rocNative', GLOBAL_NAME: 'rocNative',
NATIVE_IOS_NAME: 'rociOS', NATIVE_IOS_NAME: 'rociOS',
NATIVE_ANDROID_NAME: '__rocAndroid', NATIVE_ANDROID_NAME: '__rocAndroid',
initMethodsWithCallBack: ['getToken', 'getUserInfo', 'getLocalData'], // value is string initMethodsWithCallBack: [
'getToken',
'getUserInfo',
'getLocalData',
'getAppVersionCode',
], // value is string
initMethodsWithoutCallBack: [ initMethodsWithoutCallBack: [
'gotoLogin', 'gotoLogin',
'appInit', 'appInit',
...@@ -51,7 +56,6 @@ export default class PicaJsBridge { ...@@ -51,7 +56,6 @@ export default class PicaJsBridge {
this.isIOS = this._isIos(); this.isIOS = this._isIos();
this.isAndroid = this._isAndroid(); this.isAndroid = this._isAndroid();
this.isWeb = this._isWeb(); this.isWeb = this._isWeb();
if ( if (
_toString.call(initMethodsWithCallBack) === ARRAY_CLASS && _toString.call(initMethodsWithCallBack) === ARRAY_CLASS &&
initMethodsWithCallBack.length !== 0 initMethodsWithCallBack.length !== 0
...@@ -90,7 +94,7 @@ export default class PicaJsBridge { ...@@ -90,7 +94,7 @@ export default class PicaJsBridge {
// register method width callback in window // register method width callback in window
_registerMethod(method) { _registerMethod(method) {
const _this = this; const _this = this;
console.log('-method', method, _this);
_this[method] = (param) => { _this[method] = (param) => {
return new Promise((response, reject) => { return new Promise((response, reject) => {
_this._callNative(method, param, function (result) { _this._callNative(method, param, function (result) {
...@@ -135,7 +139,6 @@ export default class PicaJsBridge { ...@@ -135,7 +139,6 @@ export default class PicaJsBridge {
window[this._NATIVE_ANDROID_NAME].postMessage(pm); window[this._NATIVE_ANDROID_NAME].postMessage(pm);
return true; return true;
} }
if (this.isIOS) { if (this.isIOS) {
window.webkit.messageHandlers[this._NATIVE_IOS_NAME].postMessage(pm); window.webkit.messageHandlers[this._NATIVE_IOS_NAME].postMessage(pm);
return true; return true;
...@@ -166,7 +169,6 @@ export default class PicaJsBridge { ...@@ -166,7 +169,6 @@ export default class PicaJsBridge {
throw Error( throw Error(
'widthCallback flag not defined, registerMethods should take second param value(true/false) for is not has callback.' 'widthCallback flag not defined, registerMethods should take second param value(true/false) for is not has callback.'
); );
if (this.isWeb) return; // Add By Anndy Yang if (this.isWeb) return; // Add By Anndy Yang
methods.forEach((m) => { methods.forEach((m) => {
widthCallback === true widthCallback === true
......
...@@ -2,46 +2,40 @@ ...@@ -2,46 +2,40 @@
<!-- 专项合作首页: 我参与的,其它项目 --> <!-- 专项合作首页: 我参与的,其它项目 -->
<div class="pro-list-container"> <div class="pro-list-container">
<!-- <CommonHeader :title="title"></CommonHeader> --> <!-- <CommonHeader :title="title"></CommonHeader> -->
<CommonHeaderNew <PageModel :header-info="headerInfo" />
border-style="1px solid #e7e7e7"
:title="title"
:is-show-kf="isShowKf"
/>
<CoopListItem <CoopListItem
style="margin: 10px 0" style="margin: 10px 0"
:data-list="projectList" :data-list="projectList"
/> />
<!-- <Loading v-if="showLoading" />-->
</div> </div>
</template> </template>
<script> <script>
import CommonHeaderNew from '@/components/common/common-header-new'; // import CommonHeaderNew from '@/components/common/common-header-new';
import PageModel from '@pica-kit/page-model';
import CoopListItem from '@/components/bussiness/coop-list-item'; import CoopListItem from '@/components/bussiness/coop-list-item';
// import Loading from '@/components/common/common-loading';
import { getProjectList } from '@/service'; import { getProjectList } from '@/service';
import { BASE_URL } from '@/utils/enumerate'; import { BASE_URL } from '@/utils/enumerate';
const { VUE_APP_ENV } = process.env; const { VUE_APP_ENV } = process.env;
const cookies = require('cookie-universal')(); const cookies = require('cookie-universal')();
console.log('--BASE_URL', BASE_URL);
console.log('--VUE_APP_ENV', VUE_APP_ENV);
export default { export default {
components: { components: {
CommonHeaderNew, // CommonHeaderNew,
CoopListItem, CoopListItem,
// Loading, PageModel,
}, },
data() { data() {
return { return {
token: '8C124410C0904B69B06D0E65039984B9', headerInfo: {
title: '学情报告', title: '学情报告',
},
token: 'C98719AA9D544876A92277955A692C8D',
projectList: [], projectList: [],
isShowKf: true, isShowKf: true,
}; };
}, },
created() { created() {
const _this = this; const _this = this;
console.log('--this.$rocNative.isWeb', this.$rocNative.isWeb);
if (this.$rocNative.isWeb) { if (this.$rocNative.isWeb) {
cookies.set('conslToken', _this.token); cookies.set('conslToken', _this.token);
_this.getProjectList(); _this.getProjectList();
...@@ -50,6 +44,7 @@ export default { ...@@ -50,6 +44,7 @@ export default {
} }
}, },
mounted() { mounted() {
console.log('---prolist--', this.$rocNative.getAppVersionCode);
this.$sendBuriedData && this.$sendBuriedData &&
this.$sendBuriedData({ this.$sendBuriedData({
action: 'ACTION_WEB_ENTER', action: 'ACTION_WEB_ENTER',
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册