123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- <template>
- <div class="shop-index">
- <van-search placeholder="请输入商品关键词" />
- <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
- <!-- <van-swipe-item v-for="(image, index) in images" :key="index">
- <img v-lazy="image" />
- </van-swipe-item> -->
- <van-swipe-item v-for="(image) in swiperImgList" :key="image.id"> <img :src="image.url" alt=""></van-swipe-item>
- </van-swipe>
- <div class="show">
- <product-list />
- </div>
- </div>
- </template>
- <script type="text/javascript">
- import Vue from "vue";
- // import axios from "axios";
- import ProductList from "../../components/ProductList";
- import {
- NavBar,
- Search,
- Swipe,
- SwipeItem,
- Lazyload,
- Card,
- PullRefresh,
- List,
- } from "vant";
- Vue.use(NavBar);
- Vue.use(Search);
- Vue.use(Swipe);
- Vue.use(SwipeItem);
- Vue.use(Lazyload);
- Vue.use(Card);
- Vue.use(PullRefresh);
- Vue.use(List);
- // Vue.prototype.$http = axios;
- export default {
- head() {
- return {
- title: "积分商城",
- };
- },
- data() {
- return {
- images: [],
- list: [],
- loading: false, //加载状态
- finished: false, //是否完成加载
- refreshing: false, //是否正在上拉刷新
- swiperImgList:[]
- };
- },
- components: {
- ProductList,
- },
- beforeCreate() {},
- created() {
- this.initSwiperImg();
- },
- mounted() {
- },
- methods: {
- onLoad() {
- var that = this;
- that.$axios
- .get("/getIntegralWaresInfoList", {
- params: {
- stationId: "1",
- },
- })
- .then((res) => {
- if (res.data.retCode == 0) {
- that.list = res.data.data; //追加数据
- // 加载状态结束
- that.loading = false;
- that.finished = true;
- }
- });
- },
- onRefresh() {
- // 清空列表数据
- that.finished = true;
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- that.loading = true;
- that.onLoad();
- },
- initSwiperImg() {
- this.$axios
- .$get("/getStationPicList", {
- params: {
- stationId: this.stationId,
- },
- })
- .then((res) => {
- if(res.retCode === 0){
- this.swiperImgList = res.data
- }
- });
- },
- },
- };
- </script>
- <style scope>
- .shop-index * {
- box-sizing: border-box;
- }
- .shop-index .my-swipe .van-swipe-item {
- color: #fff;
- width:3.2rem;
- text-align: center;
- border-radius: 4vw;
- box-sizing: border-box;
- }
- .shop-index .my-swipe .van-swipe-item img{
- width:100%;
- height:100%;
- border-radius: 4vw;
- }
- .shop-index {
- width: 92vw;
- margin: 0 auto;
- }
- .shop-index .list {
- width: 92vw;
- }
- .shop-index .list .list-item {
- display: flex;
- margin-top: 30px;
- width: 92vw;
- height: 28.5vw;
- }
- .shop-index .list .list-item .list-item-left {
- width: 28.5vw;
- height: 28.5vw;
- border: 0.26vw solid #eeeeee;
- flex-shrink: 0;
- }
- .shop-index .list .list-item .list-item-left img {
- display: inline-block;
- width: 100%;
- height: 100%;
- border-radius: 3vw;
- }
- .shop-index .list .list-item .list-item-right {
- margin-left: 3vw;
- width: 60.5vw;
- color: red;
- display: flex;
- flex-direction: column;
- flex-shrink: 0;
- font-size: 4.266vw;
- font-weight: 400;
- color: #111111;
- line-height: 6vw;
- height: 28.5vw;
- }
- .shop-index .list .list-item .list-item-right .item-right-top {
- width: 60.5vw;
- height: 12vm;
- flex-shrink: 0;
- word-break: break-all;
- height: 20vw;
- }
- .shop-index .list .list-item .list-item-right .item-right-top {
- width: 60.5vw;
- height: 12vm;
- flex-shrink: 0;
- }
- </style>
|