|
@@ -1,15 +1,9 @@
|
|
|
<template>
|
|
|
- <view class="uni-padding-wrap">
|
|
|
- <view class="page-section swiper">
|
|
|
- <view class="page-section-spacing">
|
|
|
- <swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="time" :duration="duration">
|
|
|
- <swiper-item v-for="(item, index) in imgList" :key="index" @click="itemClick(item)">
|
|
|
- <img :src="`http://192.168.3.45:9002${item.url}`" alt="" srcset="" />
|
|
|
- </swiper-item>
|
|
|
- </swiper>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="time" :duration="duration">
|
|
|
+ <swiper-item v-for="(item, index) in imgList" :key="index" @click="itemClick(item)">
|
|
|
+ <img class="img" :src="`http://192.168.3.45:9002${item.img}`" />
|
|
|
+ </swiper-item>
|
|
|
+ </swiper>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
@@ -33,24 +27,39 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
async mounted() {
|
|
|
- console.log(123);
|
|
|
await this.imgQuery();
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['imgQuery']),
|
|
|
async itemClick(e) {
|
|
|
+ console.log(e, '123');
|
|
|
let path;
|
|
|
// 栏目
|
|
|
- if (e.type == 0) path = `pages/list/index?column=${e.column}`;
|
|
|
+ if (e.type == 0) path = `/pages/list/index?column=${e.column}`;
|
|
|
// 单页
|
|
|
- if (e.type == 1) path = `pages/details/index?id=${e._id}`;
|
|
|
+ if (e.type == 1) path = `/pages/details/index?id=${e._id}`;
|
|
|
// 链接
|
|
|
if (e.type == 2) {
|
|
|
location.href = e.url;
|
|
|
return;
|
|
|
}
|
|
|
- uni.navigateTo({ url: path });
|
|
|
+ console.log(path);
|
|
|
+ uni.navigateTo({ url: path,
|
|
|
+ success: res => {
|
|
|
+ console.log(res, 'res');
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.log(err, 123);
|
|
|
+ },
|
|
|
+ complete: () => {
|
|
|
+ console.log(231);
|
|
|
+ }});
|
|
|
}
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.img {
|
|
|
+ width: 100%
|
|
|
+}
|
|
|
+</style>
|