提交 6275a6ec 编写于 作者: zhangzhiwei's avatar zhangzhiwei

智能专区

上级 e2c5e9eb
......@@ -5,7 +5,7 @@
loading-icon="https://img.edsmall.com/ROOT/ETao/fenxiao/h5/default1.png" icon-size="30vw" />
</div>
<view style="padding: 15rpx;background: #ffffff">
<text class="text-s ellipsis line_over2" style="text-align: left;background: #ffffff;">
<text class="text-s ellipsis line_over2" style="text-align: left;background: #ffffff;min-height: 60rpx;overflow: hidden">
{{ item.title }}
</text>
</view>
......
......@@ -161,6 +161,11 @@
"style": {
"navigationBarTitleText": ""
}
},{
"path": "pages/index/znList",
"style": {
"navigationBarTitleText": ""
}
},{
"path": "pages/index/userInfo",
"style": {
......
......@@ -4,6 +4,10 @@
<div style="display: flex;align-items:center;background: #ffffff">
<van-icon size="1.5rem" name="arrow-left" style="color: #757575;" @click="goBack" />
<van-search v-model="state.keyword" style="flex: 1" placeholder="请输入搜索关键词" @click.stop="topSearch" />
<img v-if="state.showStyle" src="../../static/img/icon_search1.jpg" alt="" @click="changeIcon"
style="width: 1.8rem;height: 1.6rem;margin-right: 3px">
<img v-if="!state.showStyle" src="../../static/img/icon_search2.jpg" alt="" @click="changeIcon"
style="width: 1.8rem;height: 1.6rem;margin-right: 3px">
</div>
<van-tabs v-model:active="state.active" color="#EBA926" line-width="206rpx"
title-active-color="#EBA926" @click-tab="changeTab">
......@@ -22,11 +26,47 @@
<div style="margin-top: .2rem"></div>
<van-list :loading="state.good.loading" :finished="state.good.finished" finished-text="没有更多了"
@load="onGoodLoad">
<van-row gutter="12" style="margin: 20rpx 20rpx;">
<van-row gutter="12" style="margin: 20rpx 20rpx;" v-if="state.showStyle">
<van-col span="12" v-for="item in state.good.list" style="margin-bottom: 25rpx">
<ShopCard :item="item"></ShopCard>
</van-col>
</van-row>
<van-grid :center="false" :column-num="1" :gutter="7" v-else style="border-radius: 50%">
<van-grid-item class="text-left" v-for="(item, index) in state.good.list" :key="index"
>
<van-row style="">
<van-col span="7" style="position: relative" @click="goto(`/pages/good/detail?skuId=${item.skuId}&spuId=${item.spuId}`)">
<van-image class="self_center" width="6rem" height="6rem" lazy-load
:src="item.mainImg" />
</van-col>
<van-col span="16">
<view style="padding: 15rpx;background: #ffffff" @click="goto(`/pages/good/detail?skuId=${item.skuId}&spuId=${item.spuId}`)">
<text class="text-s ellipsis line_over2" style="text-align: left;background: #ffffff;line-height: 36rpx">
{{ item.title }}
</text>
</view>
<van-row style="padding-top: 50rpx">
<van-col span="24">
<view style="display: flex;justify-content: space-between;align-items: center">
<view style="display: flex;background: #ffffff;padding: 15rpx;margin-top: 10rpx" class="text01">
<view class="text-orange text-ss">
<text class="text-bold text-l">{{ item.salePrice }}</text>
</view>
<view class="text-ss" style="margin-left: 16rpx">
<text class="text-gray text-ss line-through">¥{{ item.productPrice }}</text>
</view>
</view>
<view @click="check(item)">
<img src="../../static/img/car_search.png"
style="width: 1.8rem;margin-right: 6rpx" alt="">
</view>
</view>
</van-col>
</van-row>
</van-col>
</van-row>
</van-grid-item>
</van-grid>
</van-list>
<view v-if="state.good.fail" class="text-ss text-gray pd-50" @click="failReset">请求失败,点击重试
<van-icon name="replay" />
......
......@@ -212,7 +212,7 @@ border: 1rpx solid #EBA926;color: #EBA926;padding: 2rpx 10rpx" @click="goPhoneBt
});
}else {
uni.navigateTo({
url: `/pages/index/intelligent`,
url: `/pages/index/znList`,
});
}
}
......
<template>
<div class="container">
<van-sticky>
<view class="justify-center bg-white sh pd-px-20 mg-b-20">
<van-icon class="top-left" name="arrow-left" @tap="goBack" />
<view class="top-center">智能专区</view>
</view>
</van-sticky>
<view style="margin-top: 16px;margin-bottom: 50rpx" >
<view>
<van-row gutter="10" class="pd-h-px-10" >
<van-col span="12" v-for="(item,index) in categoryList" :key="index">
<van-image @click="goUrl(item.id)" style="margin-bottom: 20rpx" width="100%;" radius="20rpx" :src="item.logoImg"
/>
</van-col>
</van-row>
</view>
</view>
</div>
</template>
<script lang="ts">
import api from "@/api";
import {reactive, toRefs, onMounted} from 'vue';
import { PageUtils } from '@/utils/utils';
export default {
setup() {
const that = reactive({
categoryList: [],
goBack() {
PageUtils.goBack()
},
goUrl(e){
uni.navigateTo({
url: `/pages/goodList/index?menuId=${e}`,
});
},
getBanner: () => {
api.dzResource().then((res: any) => {
that.categoryList = res.benDiMenu
console.log(res.benDiMenu);
})
},
});
onMounted(() => {
that.getBanner()
})
const refState = toRefs(that)
return {
...refState
}
}
}
</script>
<style scoped>
.container{
-webkit-overflow-scrolling: touch;
}
</style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册