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

add page-model

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