12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <template>
- <!-- 轮播详情 -->
- <view>
- <u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }"
- :border-bottom="false"></u-navbar>
- <u-parse class="ql-editor" :html="dom"></u-parse>
- <u-toast ref="uToast" />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- dom: '',
- type: 0
- }
- },
- onLoad(page) {
- console.log(page);
- if (page.id) {
- this.type = page.type
- this.getDetails(page.id);
- }
- },
- 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>
|