123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <template>
- <!-- 轮播详情 -->
- <view>
- <u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }" :border-bottom="false"></u-navbar>
- <u-parse :html="dom"></u-parse>
- <u-toast ref="uToast" />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- dom: '',
- type: 0
- }
- },
- onLoad(page) {
- if (page.id) {
- this.getDetails(page.id);
- this.type = page.type
- }
- },
- methods: {
- // 获取详情
- getDetails(id) {
- this.$u.api.indexApi.indexBannerListApi({ type: this.type }).then(res => {
- if (res.code === 200) {
- const list = res.data
- list.forEach(item => {
- if (item.id == id) {
- this.dom = item.content
- }
- })
- } else {
- this.$refs.uToast.show({
- title: res.msg,
- type: 'error'
- })
- }
- })
- .catch(err => {
- this.$refs.uToast.show({
- title: '操作失败!',
- type: 'error'
- })
- })
- }
- }
- }
- </script>
- <style>
- page {
- padding: 24rpx;
- }
- </style>
|