Files
xdd-uniapp-new/pkg_common/views/xiaoZhi.vue
T
2023-10-10 23:15:58 +08:00

71 lines
1.4 KiB
Vue

<script>
import {getXiaoZhi} from "@/api/public";
export default ({
name: "xiaoZhi",
data() {
return {
info: null
}
},
onLoad() {
this.init()
},
methods: {
init() {
getXiaoZhi().then(({data}) => {
this.info = data[0] || null
if (this.info) {
uni.setNavigationBarTitle({
title: this.info.name
})
}
})
},
gotoXiaoZhi() {
if (this.info.urlType !== 1) return;
uni.navigateToMiniProgram({
appId: this.info.appId,
path: this.info.url,
extraData: this.info.extraData,
envVersion: this.info.envVersion === '1' ? 'release' : 'trial'
})
}
}
})
</script>
<template>
<view class="pkg-common-zhi">
<template v-if="info">
<rich-text :nodes="info.content"/>
<view class="btn-fixed" @click="gotoXiaoZhi">{{ info.buttonText }}</view>
</template>
</view>
</template>
<style scoped lang="less">
.pkg-common-zhi {
max-width: 100vw;
overflow-x: hidden;
.btn-fixed {
position: fixed;
bottom: 40rpx;
left: 50%;
transform: translate(-50%, 0);
width: 440rpx;
height: 110rpx;
line-height: 110rpx;
border-radius: 50rpx;
background-color: #4481EB;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
color: #FFFFFF;
font-size: 56rpx;
font-weight: bold;
text-align: center;
}
}
</style>