feat: 初始化
This commit is contained in:
15
pages/pamm/index.css
Normal file
15
pages/pamm/index.css
Normal file
@ -0,0 +1,15 @@
|
||||
.container {
|
||||
padding: 0 16px;
|
||||
}
|
||||
.title {
|
||||
margin: 14px 0;
|
||||
}
|
||||
.pammSegmentedWrapper {
|
||||
z-index: 90;
|
||||
padding-top: 12px;
|
||||
background: #fff;
|
||||
height: 49px;
|
||||
}
|
||||
.webViewWrapper {
|
||||
flex: 1;
|
||||
}
|
63
pages/pamm/index.nvue
Normal file
63
pages/pamm/index.nvue
Normal file
@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<NNavBar />
|
||||
<view class="container" style="padding-bottom: 0;">
|
||||
<view class="title">
|
||||
<PageTitle title="PAMM" style="flex-direction: row;" />
|
||||
</view>
|
||||
<view class="pammSegmentedWrapper" :style="{'width': contentWidth+'px'}">
|
||||
<NSegmented
|
||||
styleType="text"
|
||||
fontSize="16px"
|
||||
gap="13px"
|
||||
:current="current"
|
||||
:values="items"
|
||||
@clickItem="onClickItem"
|
||||
inActiveColor="#999999"
|
||||
activeColor="#000"
|
||||
></NSegmented>
|
||||
</view>
|
||||
<view class="webViewWrapper" v-if="current == 0">
|
||||
<web-view :style="{'width': 'calc(750rpx - 32px)', 'height': wbHeight+'px'}" :webview-styles="{'progress': {color:'#29bbe4'}}" :fullscreen="false" :src="pammUrl"></web-view>
|
||||
</view>
|
||||
<view class="webViewWrapper" v-if="current == 1">
|
||||
<web-view :style="{'width': 'calc(750rpx - 32px)', 'height': wbHeight+'px'}" :webview-styles="{'progress': {color:'#29bbe4'}}" :fullscreen="false" :src="loginUrl"></web-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import NNavBar from '@/components/nvue/NavBar/index.nvue'
|
||||
import NSegmented from '@/components/nvue/segmented/index.nvue';
|
||||
import { i18n } from '@/locale/index.ts'
|
||||
import { app_host } from '@/utils/request'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
t: i18n.global.t,
|
||||
current: 0,
|
||||
items: [i18n.global.t('pamm.pamm'), i18n.global.t('pamm.login')],
|
||||
pammUrl: 'https://stats.htfx.co/widgets/ratings?widgetKey=pamm-ratings',
|
||||
loginUrl: 'https://pamm.htfx.co/app/auth',
|
||||
wbHeight: uni.getSystemInfoSync().windowHeight - uni.getSystemInfoSync().statusBarHeight - 164,
|
||||
contentWidth: uni.getSystemInfoSync().windowWidth - 32
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onClickItem(e) {
|
||||
if (this.current != e.currentIndex) {
|
||||
this.current = e.currentIndex;
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
components: {
|
||||
NNavBar,
|
||||
NSegmented
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@import url('./index.css');
|
||||
</style>
|
21
pages/pamm/index.scss
Normal file
21
pages/pamm/index.scss
Normal file
@ -0,0 +1,21 @@
|
||||
.container {
|
||||
padding: 0 16px;
|
||||
.swiper {
|
||||
margin: 14px 0 18px;
|
||||
}
|
||||
.title {
|
||||
margin: 14px 0 21px;
|
||||
}
|
||||
}
|
||||
.pammSegmentedWrapper {
|
||||
position: sticky;
|
||||
top: 44px;
|
||||
z-index: 90;
|
||||
padding-top: 12px;
|
||||
background-color: #fff;
|
||||
}
|
||||
.webViewWrapper {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100vh - 170px);
|
||||
}
|
72
pages/pamm/index.vue
Normal file
72
pages/pamm/index.vue
Normal file
@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<NavBar />
|
||||
<view class="container">
|
||||
<view class="title">
|
||||
<PageTitle title="PAMM" />
|
||||
</view>
|
||||
<view class="pammSegmentedWrapper">
|
||||
<Segmented
|
||||
styleType="text"
|
||||
fontSize="16px"
|
||||
gap="13px"
|
||||
:current="current"
|
||||
:values="items"
|
||||
@clickItem="onClickItem"
|
||||
inActiveColor="#999999"
|
||||
activeColor="#000"
|
||||
></Segmented>
|
||||
</view>
|
||||
<view class="webViewWrapper" v-if="current == 0">
|
||||
<!-- #ifdef H5 -->
|
||||
<iframe :src="pammUrl" frameborder="0" style="width: 100%; height: 100%"></iframe>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="webViewWrapper" v-if="current == 1">
|
||||
<!-- #ifdef H5 -->
|
||||
<iframe :src="loginUrl" frameborder="0" style="width: 100%; height: 100%"></iframe>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Segmented from '@/pages/components/segmented/index.vue';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
items: [this.$t('pamm.pamm'), this.$t('pamm.login')],
|
||||
// pammUrl: 'https://stats.htfx.co/widgets/ratings?widgetKey=pamm-ratings',
|
||||
pammUrl: 'https://qq.com',
|
||||
// loginUrl: 'https://pamm.htfx.co/app/auth',
|
||||
loginUrl: 'https://qq.com',
|
||||
webviewStyles: {
|
||||
width: '100%',
|
||||
height: '50%'
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onClickItem(e) {
|
||||
if (this.current != e.currentIndex) {
|
||||
this.current = e.currentIndex;
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// #ifdef H5
|
||||
const tempArr = window.location.origin.split('.');
|
||||
const domain = tempArr?.[tempArr?.length - 1] ?? 'co';
|
||||
this.pammUrl = `https://stats.htfx.${domain}/widgets/ratings?widgetKey=pamm-ratings`;
|
||||
this.loginUrl = `https://pamm.htfx.${domain}/app/auth`;
|
||||
// #endif
|
||||
},
|
||||
components: {
|
||||
Segmented
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './index.scss';
|
||||
</style>
|
Reference in New Issue
Block a user