|
@@ -1,55 +1,59 @@
|
|
|
<template>
|
|
|
- <mobile-frame>
|
|
|
- <view class="main">
|
|
|
- <view class="one">
|
|
|
- <rich-text :nodes="info.content"></rich-text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </mobile-frame>
|
|
|
+ <mobile-frame>
|
|
|
+ <view class="main">
|
|
|
+ <view class="one">
|
|
|
+ <u-parse :content="info.content"></u-parse>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </mobile-frame>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- id: '',
|
|
|
- info: {}
|
|
|
- };
|
|
|
- },
|
|
|
- onLoad: function(e) {
|
|
|
- const that = this;
|
|
|
- that.$set(that, `id`, e.id || '')
|
|
|
- },
|
|
|
- onShow: function() {
|
|
|
- const that = this;
|
|
|
- that.search();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- async search() {
|
|
|
- const that = this;
|
|
|
- const res = await that.$api(`/banner/${that.id}`, 'GET');
|
|
|
- if (res.errcode == '0') {
|
|
|
- that.$set(that, `info`, res.data)
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: res.errmsg,
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+import uParse from "@/components/u-parse/u-parse.vue";
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ uParse,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ id: "",
|
|
|
+ info: {},
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onLoad: function (e) {
|
|
|
+ const that = this;
|
|
|
+ that.$set(that, `id`, e.id || "");
|
|
|
+ },
|
|
|
+ onShow: function () {
|
|
|
+ const that = this;
|
|
|
+ that.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async search() {
|
|
|
+ const that = this;
|
|
|
+ const res = await that.$api(`/banner/${that.id}`, "GET");
|
|
|
+ if (res.errcode == "0") {
|
|
|
+ that.$set(that, `info`, res.data);
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.errmsg,
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
- .main {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- width: 100vw;
|
|
|
- height: 100vh;
|
|
|
+.main {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
|
|
|
- .one {
|
|
|
- padding: 2vw;
|
|
|
- }
|
|
|
- }
|
|
|
+ .one {
|
|
|
+ padding: 2vw;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|