12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <template>
- <mobile-frame>
- <view class="main">
- <view class="one">
- <rich-text :nodes="info.content"></rich-text>
- </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'
- })
- }
- }
- }
- }
- </script>
- <style lang="scss">
- .main {
- display: flex;
- flex-direction: column;
- width: 100vw;
- height: 100vh;
- .one {
- padding: 2vw;
- }
- }
- </style>
|