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

pages/template: rpx to px

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