提交 109286b7 编写于 作者: H hdx

pages/template: rpx to px

上级 b0603133
...@@ -209,7 +209,7 @@ ...@@ -209,7 +209,7 @@
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
margin: 0 25rpx; margin: 0 12px;
margin-top: 50px; margin-top: 50px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
...@@ -225,8 +225,8 @@ ...@@ -225,8 +225,8 @@
} }
.state { .state {
top: 20rpx; top: 10px;
left: 20rpx; left: 10px;
width: 650rpx; width: 650rpx;
padding: 4px; padding: 4px;
position: absolute; position: absolute;
......
...@@ -112,20 +112,20 @@ ...@@ -112,20 +112,20 @@
width: 700rpx; width: 700rpx;
height: 750rpx; height: 750rpx;
position: absolute; position: absolute;
margin: 0 25rpx; margin: 0 12px;
margin-top: 30px; margin-top: 30px;
border-radius: 10px; border-radius: 10px;
color: #FFF; color: #FFF;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
} }
.user-img{ .user-img{
border-radius: 10px; border-radius: 10px;
} }
.state { .state {
top: 20rpx; top: 10px;
left: 20rpx; left: 10px;
width: 650rpx; width: 650rpx;
padding: 4px; padding: 4px;
position: absolute; position: absolute;
...@@ -141,4 +141,4 @@ ...@@ -141,4 +141,4 @@
border-radius: 100px; border-radius: 100px;
box-shadow: 0 0 1px #EBEBEB; box-shadow: 0 0 1px #EBEBEB;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<!-- #ifdef APP --> <!-- #ifdef APP -->
<scroll-view style="flex: 1"> <scroll-view style="flex: 1">
<!-- #endif --> <!-- #endif -->
<view class="banner"> <view class="banner">
<image class="banner-img" :src="cover"></image> <image class="banner-img" :src="cover"></image>
<text class="banner-title">{{title}}</text> <text class="banner-title">{{title}}</text>
</view> </view>
<rich-text :nodes="htmlNodes" style="padding: 3px"></rich-text> <rich-text :nodes="htmlNodes" style="padding: 3px"></rich-text>
<!-- #ifdef APP --> <!-- #ifdef APP -->
</scroll-view> </scroll-view>
<!-- #endif --> <!-- #endif -->
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
htmlNodes: "", htmlNodes: "",
title: '', title: '',
cover: "", cover: "",
post_id: "", post_id: "",
} }
}, },
onLoad(event: OnLoadOptions) { onLoad(event : OnLoadOptions) {
this.post_id = event["post_id"] ?? ""; this.post_id = event["post_id"] ?? "";
this.cover = event["cover"] ?? ""; this.cover = event["cover"] ?? "";
this.title = event["title"] ?? ""; this.title = event["title"] ?? "";
this.getDetail(); this.getDetail();
}, },
methods: { methods: {
getDetail() { getDetail() {
uni.request({ uni.request({
url: 'https://unidemo.dcloud.net.cn/api/news/36kr/' + this.post_id, url: 'https://unidemo.dcloud.net.cn/api/news/36kr/' + this.post_id,
success: (data) => { success: (data) => {
if (data.statusCode == 200) { if (data.statusCode == 200) {
const result = data.data as UTSJSONObject const result = data.data as UTSJSONObject
// console.log(result["content"]); // console.log(result["content"]);
this.htmlNodes = result["content"] as string; this.htmlNodes = result["content"] as string;
} }
}, },
fail: () => { fail: () => {
console.log('fail'); console.log('fail');
} }
}); });
}, },
} }
} }
</script> </script>
<style> <style>
.banner { .banner {
height: 360rpx; height: 180px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
background-color: #ccc; background-color: #ccc;
} }
.banner-img { .banner-img {
width: 100%; width: 100%;
} }
.banner-title { .banner-title {
max-height: 84rpx; max-height: 42px;
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
left: 30rpx; left: 15px;
bottom: 30rpx; bottom: 15px;
width: 90%; width: 90%;
font-size: 32rpx; font-size: 16px;
font-weight: 400; font-weight: 400;
line-height: 42rpx; line-height: 21px;
color: white; color: white;
} }
</style> </style>
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
<style> <style>
.banner { .banner {
height: 360rpx; height: 180px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
background-color: #ccc; background-color: #ccc;
...@@ -159,20 +159,20 @@ ...@@ -159,20 +159,20 @@
} }
.banner-title { .banner-title {
max-height: 84rpx; max-height: 42px;
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
left: 30rpx; left: 15px;
bottom: 30rpx; bottom: 15px;
width: 90%; width: 90%;
font-size: 32rpx; font-size: 16px;
font-weight: 400; font-weight: 400;
line-height: 42rpx; line-height: 21px;
color: white; color: white;
} }
.uni-media-list { .uni-media-list {
padding: 22rpx 30rpx; padding: 11px 15px;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
width: 100%; width: 100%;
...@@ -180,19 +180,19 @@ ...@@ -180,19 +180,19 @@
} }
.uni-media-list-logo { .uni-media-list-logo {
width: 180rpx; width: 90px;
height: 140rpx; height: 70px;
} }
.uni-media-list-body { .uni-media-list-body {
flex: 1; flex: 1;
padding-left: 15rpx; padding-left: 7px;
justify-content: space-around; justify-content: space-around;
} }
.uni-media-list-text-top { .uni-media-list-text-top {
/* height: 74rpx; */ /* height: 37px; */
font-size: 28rpx; font-size: 14px;
lines: 2; lines: 2;
overflow: hidden; overflow: hidden;
} }
...@@ -205,6 +205,6 @@ ...@@ -205,6 +205,6 @@
.uni-media-list-text { .uni-media-list-text {
color: #9D9D9F; color: #9D9D9F;
font-size: 25rpx; font-size: 13px;
} }
</style> </style>
...@@ -127,8 +127,8 @@ ...@@ -127,8 +127,8 @@
} }
.user-info .user-avatar { .user-info .user-avatar {
width: 150rpx; width: 75px;
height: 150rpx; height: 75px;
border-radius: 100px; border-radius: 100px;
border: 3px solid #FFF; border: 3px solid #FFF;
} }
......
<template> <template>
<view> <view>
<button class="button" @click="openSchema('https://uniapp.dcloud.io/uni-app-x')">使用外部浏览器打开指定URL</button> <button class="button" @click="openSchema('https://uniapp.dcloud.io/uni-app-x')">使用外部浏览器打开指定URL</button>
<button class="button" @click="openSchema('market://details?id=com.tencent.mm')">使用应用商店打开指定App</button> <button class="button" @click="openSchema('market://details?id=com.tencent.mm')">使用应用商店打开指定App</button>
<button class="button" @click="openSchema('androidamap://viewMap?sourceApplication=Hello%20uni-app&poiname=DCloud&lat=39.9631018208&lon=116.3406135236&dev=0')">打开地图坐标</button> <button class="button"
</view> @click="openSchema('androidamap://viewMap?sourceApplication=Hello%20uni-app&poiname=DCloud&lat=39.9631018208&lon=116.3406135236&dev=0')">打开地图坐标</button>
</view>
</template> </template>
<script> <script>
import Intent from 'android.content.Intent'; import Intent from 'android.content.Intent';
import Uri from 'android.net.Uri'; import Uri from 'android.net.Uri';
export default { export default {
data() { data() {
return { return {
} }
}, },
methods: { methods: {
openSchema(url:string) { openSchema(url : string) {
const context = UTSAndroid.getUniActivity()!; const context = UTSAndroid.getUniActivity()!;
const uri = Uri.parse(url) const uri = Uri.parse(url)
const intent = new Intent(Intent.ACTION_VIEW, uri) const intent = new Intent(Intent.ACTION_VIEW, uri)
intent.setData(uri); intent.setData(uri);
context.startActivity(intent); context.startActivity(intent);
} }
} }
} }
</script> </script>
<style> <style>
.button { .button {
margin: 30rpx; margin: 15px;
} }
</style> </style>
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
border: 1px solid #fbdf0d; border: 1px solid #fbdf0d;
height: 35px; height: 35px;
border-radius: 100px; border-radius: 100px;
margin: 0 25rpx; margin: 0 12px;
padding: 8px; padding: 8px;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
border: 1px solid #fbdf0d; border: 1px solid #fbdf0d;
height: 35px; height: 35px;
border-radius: 100px; border-radius: 100px;
margin: 0 25rpx; margin: 0 12px;
padding: 8px; padding: 8px;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<script> <script>
import Intent from 'android.content.Intent'; import Intent from 'android.content.Intent';
import File from 'java.io.File'; import File from 'java.io.File';
export default { export default {
data() { data() {
...@@ -55,6 +55,6 @@ ...@@ -55,6 +55,6 @@
<style> <style>
.button { .button {
margin: 30rpx; margin: 15px;
} }
</style> </style>
...@@ -199,7 +199,6 @@ ...@@ -199,7 +199,6 @@
<style> <style>
.page { .page {
width: 750rpx;
flex: 1; flex: 1;
} }
...@@ -228,8 +227,8 @@ ...@@ -228,8 +227,8 @@
} }
.play-btn { .play-btn {
width: 80rpx; width: 40px;
height: 80rpx; height: 40px;
} }
.video-info { .video-info {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册