|
@@ -85,7 +85,7 @@
|
|
</view>
|
|
</view>
|
|
<!-- banner -->
|
|
<!-- banner -->
|
|
<view class="banner">
|
|
<view class="banner">
|
|
- <u-swiper mode="dot" bg-color="" img-mode="widthFix" @click="clickBanner" :interval="3000" :height="hasShopiing?280:374" :list="imgList"></u-swiper>
|
|
|
|
|
|
+ <u-swiper mode="dot" bg-color="" img-mode="widthFix" @click="clickBanner" :interval="3000" :height="hasShopiing?280:350" :list="imgList"></u-swiper>
|
|
</view>
|
|
</view>
|
|
<!-- 快捷导航 -->
|
|
<!-- 快捷导航 -->
|
|
<view class="quick-nav pa-box" v-if="hasShopiing&&navList.length">
|
|
<view class="quick-nav pa-box" v-if="hasShopiing&&navList.length">
|
|
@@ -233,7 +233,7 @@
|
|
imgList(){
|
|
imgList(){
|
|
let list = [
|
|
let list = [
|
|
{
|
|
{
|
|
- image: this.hasShopiing ? '/static/banner1.jpg':'/static/banner1.png',
|
|
|
|
|
|
+ image: '/static/banner1.jpg',
|
|
activeType: ''
|
|
activeType: ''
|
|
}
|
|
}
|
|
]
|
|
]
|
|
@@ -241,7 +241,7 @@
|
|
if(this.hasRedPacket&&this.hasShelf){
|
|
if(this.hasRedPacket&&this.hasShelf){
|
|
list.push(
|
|
list.push(
|
|
{
|
|
{
|
|
- image: this.hasShopiing ? '/static/banner2.jpg':'/static/banner2.png',
|
|
|
|
|
|
+ image: '/static/banner2.jpg',
|
|
activeType: 'redPacket'
|
|
activeType: 'redPacket'
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -330,27 +330,6 @@
|
|
uni.$off('refashHome')
|
|
uni.$off('refashHome')
|
|
uni.$off('refashProm')
|
|
uni.$off('refashProm')
|
|
},
|
|
},
|
|
- // 下拉刷新
|
|
|
|
- onPullDownRefresh(){
|
|
|
|
- // 商品分类
|
|
|
|
- this.getGoodType()
|
|
|
|
- this.pageInit(true)
|
|
|
|
- setTimeout(function () {
|
|
|
|
- uni.stopPullDownRefresh();
|
|
|
|
- }, 1000);
|
|
|
|
- },
|
|
|
|
- onShareAppMessage() {},
|
|
|
|
- // 页面滚动
|
|
|
|
- onPageScroll(e) {
|
|
|
|
- this.showFixed = e.scrollTop > 120
|
|
|
|
- },
|
|
|
|
- // 滚动到底部,加载热门产品
|
|
|
|
- onReachBottom() {
|
|
|
|
- if(this.hasShopiing && this.hotProductPageNo < this.totalhotPage){
|
|
|
|
- this.hotProductPageNo++
|
|
|
|
- this.getProductList()
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
onShow() {
|
|
onShow() {
|
|
// 用户头像
|
|
// 用户头像
|
|
this.avatarUrl = uni.getStorageSync('userPhoto');
|
|
this.avatarUrl = uni.getStorageSync('userPhoto');
|
|
@@ -372,31 +351,28 @@
|
|
this.getScrollLog()
|
|
this.getScrollLog()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 下拉刷新
|
|
|
|
+ onPullDownRefresh(){
|
|
|
|
+ // 商品分类
|
|
|
|
+ this.getGoodType()
|
|
|
|
+ this.pageInit(true)
|
|
|
|
+ setTimeout(function () {
|
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
|
+ }, 1000);
|
|
|
|
+ },
|
|
|
|
+ onShareAppMessage() {},
|
|
|
|
+ // 页面滚动
|
|
|
|
+ onPageScroll(e) {
|
|
|
|
+ this.showFixed = e.scrollTop > 120
|
|
|
|
+ },
|
|
|
|
+ // 滚动到底部,加载热门产品
|
|
|
|
+ onReachBottom() {
|
|
|
|
+ if(this.hasShopiing && this.hotProductPageNo < this.totalhotPage){
|
|
|
|
+ this.hotProductPageNo++
|
|
|
|
+ this.getProductList()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
- // 扫描vin
|
|
|
|
- beforeSwitch(index){
|
|
|
|
- const row = this.$store.state.vuex_tabBarList[index]
|
|
|
|
- if(row.text == '促销'){
|
|
|
|
- uni.$emit('refashProm')
|
|
|
|
- }
|
|
|
|
- if(row.text == '购物车'){
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url:'/pagesB/cart/index',
|
|
|
|
- target: 'page'
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- if(row.text == '扫描VIN'){
|
|
|
|
- this.openCamera()
|
|
|
|
- }else{
|
|
|
|
- return true
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 去搜索产品
|
|
|
|
- toSearch(event){
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url:'/pagesB/shopiing/searchProduct?queryWord='+event.value+'&clzId='
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
// 初始化页面
|
|
// 初始化页面
|
|
pageInit(flag){
|
|
pageInit(flag){
|
|
this.carouselList = []
|
|
this.carouselList = []
|
|
@@ -417,11 +393,40 @@
|
|
// 商品分类
|
|
// 商品分类
|
|
this.getGoodType()
|
|
this.getGoodType()
|
|
}
|
|
}
|
|
-
|
|
|
|
}else{
|
|
}else{
|
|
uni.removeStorageSync('token')
|
|
uni.removeStorageSync('token')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 扫描vin
|
|
|
|
+ beforeSwitch(index){
|
|
|
|
+ const row = this.$store.state.vuex_tabBarList[index]
|
|
|
|
+ if(row.text == '促销'){
|
|
|
|
+ uni.$emit('refashProm')
|
|
|
|
+ }
|
|
|
|
+ if(row.text == '购物车'){
|
|
|
|
+ if(!this.hasLogin){
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/login/login'
|
|
|
|
+ })
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url:'/pagesB/cart/index',
|
|
|
|
+ target: 'page'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if(row.text == '扫描VIN'){
|
|
|
|
+ this.openCamera()
|
|
|
|
+ }else{
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 去搜索产品
|
|
|
|
+ toSearch(event){
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url:'/pagesB/shopiing/searchProduct?queryWord='+event.value+'&clzId='
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 轮播图片
|
|
// 轮播图片
|
|
getCarousel(){
|
|
getCarousel(){
|
|
this.carouselList = []
|
|
this.carouselList = []
|
|
@@ -575,7 +580,7 @@
|
|
// 商品一级分类
|
|
// 商品一级分类
|
|
getGoodType(){
|
|
getGoodType(){
|
|
this.productTypeList = []
|
|
this.productTypeList = []
|
|
- getShopCategory({categoryLevel: 1}).then(res => {
|
|
|
|
|
|
+ getShopCategory({categoryLevel: 1, status: 1}).then(res => {
|
|
const list = res.data || []
|
|
const list = res.data || []
|
|
const ret = []
|
|
const ret = []
|
|
list.forEach(item => {
|
|
list.forEach(item => {
|
|
@@ -605,7 +610,7 @@
|
|
// 商品列表查询
|
|
// 商品列表查询
|
|
getProductList(){
|
|
getProductList(){
|
|
this.status = "loading"
|
|
this.status = "loading"
|
|
- getShopProductList({pageNo:this.hotProductPageNo,pageSize:10,hotFlag:1}).then(res => {
|
|
|
|
|
|
+ getShopProductList({pageNo:this.hotProductPageNo,pageSize:10,hotFlag:1, status: 1}).then(res => {
|
|
if(res.status == 200){
|
|
if(res.status == 200){
|
|
const list = res.data ? res.data.list : []
|
|
const list = res.data ? res.data.list : []
|
|
this.productList.push(list)
|
|
this.productList.push(list)
|
|
@@ -636,6 +641,8 @@
|
|
// 商品分类
|
|
// 商品分类
|
|
this.getGoodType()
|
|
this.getGoodType()
|
|
}else{ // 没有商城
|
|
}else{ // 没有商城
|
|
|
|
+ // 隐藏tab 购物车,显示视频
|
|
|
|
+ this.showVideoTab()
|
|
// 滚动扫描记录
|
|
// 滚动扫描记录
|
|
this.getScrollLog()
|
|
this.getScrollLog()
|
|
// 获取扫描记录
|
|
// 获取扫描记录
|
|
@@ -671,6 +678,21 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 显示视频tab,隐藏购物车
|
|
|
|
+ showVideoTab(){
|
|
|
|
+ const videoIndex = this.$store.state.vuex_tabBarList.findIndex(item => item.text == '视频')
|
|
|
|
+ const catIndex = this.$store.state.vuex_tabBarList.findIndex(item => item.text == '购物车')
|
|
|
|
+ if(videoIndex<0 && catIndex >= 0){
|
|
|
|
+ // 替换购物车为视频
|
|
|
|
+ this.$store.state.vuex_tabBarList.splice(catIndex,1,{
|
|
|
|
+ "pagePath": "/pages/videos/index",
|
|
|
|
+ "iconPath": "/static/tab/tab_video_normal.png",
|
|
|
|
+ "selectedIconPath": "/static/tab/tab_video_pressed.png",
|
|
|
|
+ "text": "视频",
|
|
|
|
+ 'customIcon': false,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 查询是否支持数字货架, flag: true 再次刷新,false 首次加载
|
|
// 查询是否支持数字货架, flag: true 再次刷新,false 首次加载
|
|
getStoreShelf(flag){
|
|
getStoreShelf(flag){
|
|
findStoreShelf().then(res => {
|
|
findStoreShelf().then(res => {
|
|
@@ -982,13 +1004,14 @@
|
|
background: #fff;
|
|
background: #fff;
|
|
border-radius: 6px;
|
|
border-radius: 6px;
|
|
margin: 10px 0;
|
|
margin: 10px 0;
|
|
|
|
+ padding: 10px 0;
|
|
box-shadow: 1px 1px 3px #eee;
|
|
box-shadow: 1px 1px 3px #eee;
|
|
|
|
+ border: 1px solid #f8f8f8;
|
|
}
|
|
}
|
|
.product-box{
|
|
.product-box{
|
|
margin: 10px 0;
|
|
margin: 10px 0;
|
|
}
|
|
}
|
|
.ptype-nav{
|
|
.ptype-nav{
|
|
- padding: 10px 0;
|
|
|
|
position: relative;
|
|
position: relative;
|
|
.indicator-dots{
|
|
.indicator-dots{
|
|
width: 100%;
|
|
width: 100%;
|