| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <template>
- <view>
- <image style="width: 100%;" mode="widthFix" :src="config.index_post?config.index_post:''" show-menu-by-longpress="true"></image>
- </view>
- </template>
- <script>
- const app = getApp();
- const req = require("../../utils/request.js");
- export default {
- components: {},
- props: {},
- data() {
- return {
- systems: {},
- isTop:0,
- config:{}
- }
- },
- onLoad(options) {
- this.getConfig();
- },
- onShow() {
-
- },
- methods: {
- getConfig(){
- req.getRequest('/api/other/config',{},data=>{
- req.setStorage('configRes',JSON.stringify(data));
- this.config = data;
- })
- },
- },
- mounted() {
- const systemInfo = uni.getSystemInfoSync();
- // px转换到rpx的比例
- let pxToRpxScale = 750 / systemInfo.windowWidth;
- let systems = {
- ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
- navigationHeight: 44 * pxToRpxScale // 导航栏的高度
- };
- systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
- this.systems = systems;
- },
- onPageScroll: function(e) {
- if (e.scrollTop > this.systems.barHeight) {
- this.isTop = 1;
- } else {
- this.isTop = 0;
- }
- }
- }
- </script>
- <style>
- @import "./post.css";
- </style>
|