|
|
|
@ -1,9 +1,11 @@ |
|
|
|
|
<template> |
|
|
|
|
<view :class="['page', {oh: !per}]"> |
|
|
|
|
<uni-search-bar class="search" radius="30" placeholder="请输入" v-model="keyword" clearButton="auto" cancelButton="none" @confirm="searchConfirm" /> |
|
|
|
|
<view :class="[{oh: !per}]"> |
|
|
|
|
<image class="banner" src="@/static/image/index/banner.png" mode="widthFix"></image> |
|
|
|
|
|
|
|
|
|
<view class="banner"> |
|
|
|
|
<image class="img" src="@/static/image/index/banner.png" mode="widthFix"></image> |
|
|
|
|
<view class="page"> |
|
|
|
|
<view class="search-wrap"> |
|
|
|
|
<uni-search-bar class="search" radius="30" placeholder="请输入" v-model="keyword" clearButton="auto" cancelButton="none" @confirm="searchConfirm" /> |
|
|
|
|
<view class="all" @click="toProduct">全部产品</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="block" style="margin-top: 0"> |
|
|
|
@ -30,12 +32,8 @@ |
|
|
|
|
<image class="pic" :src="$util.getIcon(item)"></image> |
|
|
|
|
<view class="texts"> |
|
|
|
|
<view class="name ell">{{ item.productName }}</view> |
|
|
|
|
<view class="des ell">{{ item.productIntroduction }}</view> |
|
|
|
|
<view class="meta"> |
|
|
|
|
<image class="icon" src="@/static/image/index/9.png"></image> |
|
|
|
|
适用专业: |
|
|
|
|
<text class="ell">{{ item.professionalName }}</text> |
|
|
|
|
</view> |
|
|
|
|
<view class="des ell">{{ item.typeName }}</view> |
|
|
|
|
<view class="meta">{{ item.marketUnitPrice }}元/年</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -52,24 +50,27 @@ |
|
|
|
|
<image class="pic" :src="$util.getIcon(item)"></image> |
|
|
|
|
<view class="texts"> |
|
|
|
|
<view class="name ell">{{ item.productName }}</view> |
|
|
|
|
<view class="des ell">{{ item.productIntroduction }}</view> |
|
|
|
|
<view class="meta"> |
|
|
|
|
<image class="icon" src="@/static/image/index/9.png"></image> |
|
|
|
|
适用专业: |
|
|
|
|
<text class="ell">{{ item.professionalName }}</text> |
|
|
|
|
<view class="des ell">{{ item.typeName }}</view> |
|
|
|
|
<view class="meta">{{ item.marketUnitPrice }}元/年</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view v-if="auth('产品:购物车')" class="plus"> |
|
|
|
|
<uni-badge size="small" :text="total" absolute="topRight" type="error"> |
|
|
|
|
<image class="icon" src="@/static/image/product/shop-blue.png" mode="widthFix" @click="$util.to('../shopCart/shopCart')"></image> |
|
|
|
|
</uni-badge> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view v-if="!per" class="per-mask">功能升级中,敬请期待...</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { getUserRolesPermissionMenu } from '@/apis/modules/user.js' |
|
|
|
|
import { tagsList, listOfGoods } from '@/apis/modules/product.js' |
|
|
|
|
import { tagsList, listOfGoods, shoppingCartList } from '@/apis/modules/product.js' |
|
|
|
|
import { getTeamsByAccountId } from '@/apis/modules/client.js' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
@ -81,12 +82,14 @@ |
|
|
|
|
tags: [], |
|
|
|
|
hotProducts: [], |
|
|
|
|
offcialProducts: [], |
|
|
|
|
total: 0, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
this.keyword = '' |
|
|
|
|
this.per = true |
|
|
|
|
this.getInfo() |
|
|
|
|
this.getShopCart() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 初始化权限 |
|
|
|
@ -167,6 +170,15 @@ |
|
|
|
|
this.tags = res.tagsList.slice(0, 8) |
|
|
|
|
}).catch(e => {}) |
|
|
|
|
}, |
|
|
|
|
// 获取购物车数量 |
|
|
|
|
getShopCart() { |
|
|
|
|
shoppingCartList({ |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 1000, |
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
this.total = data.total |
|
|
|
|
}).catch(e => {}) |
|
|
|
|
}, |
|
|
|
|
// 产品 |
|
|
|
|
getProducts() { |
|
|
|
|
// 热销产品 |
|
|
|
@ -221,32 +233,24 @@ |
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|
.page { |
|
|
|
|
position: relative; |
|
|
|
|
min-height: 100%; |
|
|
|
|
padding: 10rpx 22rpx; |
|
|
|
|
box-sizing: border-box; |
|
|
|
|
background-color: #fff; |
|
|
|
|
} |
|
|
|
|
.banner { |
|
|
|
|
position: relative; |
|
|
|
|
.img { |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
.search-wrap { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: space-between; |
|
|
|
|
align-items: center; |
|
|
|
|
.search { |
|
|
|
|
flex: 1; |
|
|
|
|
} |
|
|
|
|
.info { |
|
|
|
|
position: absolute; |
|
|
|
|
top: 80rpx; |
|
|
|
|
left: 46rpx; |
|
|
|
|
} |
|
|
|
|
.title { |
|
|
|
|
margin-bottom: 15rpx; |
|
|
|
|
font-size: 36rpx; |
|
|
|
|
font-weight: 600; |
|
|
|
|
color: #001D67; |
|
|
|
|
} |
|
|
|
|
.text { |
|
|
|
|
font-size: 20rpx; |
|
|
|
|
font-family: PingFangSC-Regular, PingFang SC; |
|
|
|
|
color: #001D67; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.all { |
|
|
|
|
font-size: 24rpx; |
|
|
|
|
color: #666; |
|
|
|
|
} |
|
|
|
|
.block { |
|
|
|
|
margin: 20rpx 0; |
|
|
|
@ -254,10 +258,6 @@ |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: space-between; |
|
|
|
|
margin-bottom: 34rpx; |
|
|
|
|
.all { |
|
|
|
|
font-size: 24rpx; |
|
|
|
|
color: #666; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.title { |
|
|
|
|
display: inline-flex; |
|
|
|
@ -289,7 +289,7 @@ |
|
|
|
|
margin-bottom: 18rpx; |
|
|
|
|
} |
|
|
|
|
.text { |
|
|
|
|
width: 110rpx; |
|
|
|
|
width: 165rpx; |
|
|
|
|
margin: 0 auto; |
|
|
|
|
font-size: 24rpx; |
|
|
|
|
color: #333; |
|
|
|
@ -298,12 +298,14 @@ |
|
|
|
|
.list { |
|
|
|
|
.item { |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
margin-bottom: 28rpx; |
|
|
|
|
} |
|
|
|
|
.pic { |
|
|
|
|
width: 136rpx; |
|
|
|
|
height: 136rpx; |
|
|
|
|
width: 120rpx; |
|
|
|
|
height: 120rpx; |
|
|
|
|
margin-right: 20rpx; |
|
|
|
|
border-radius: 8px; |
|
|
|
|
} |
|
|
|
|
.texts { |
|
|
|
|
width: calc(100% - 156rpx); |
|
|
|
@ -314,7 +316,7 @@ |
|
|
|
|
color: #333; |
|
|
|
|
} |
|
|
|
|
.des { |
|
|
|
|
margin: 17rpx 0; |
|
|
|
|
margin: 10rpx 0; |
|
|
|
|
font-size: 24rpx; |
|
|
|
|
color: #666; |
|
|
|
|
} |
|
|
|
@ -333,4 +335,11 @@ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.plus { |
|
|
|
|
bottom: 140rpx; |
|
|
|
|
right: 60rpx; |
|
|
|
|
.icon { |
|
|
|
|
width: 80rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|