修改
This commit is contained in:
parent
5aa85f600a
commit
c5437b487a
48
App.vue
48
App.vue
@ -30,6 +30,7 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
audioTeam: [],
|
audioTeam: [],
|
||||||
|
timer: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
globalData: {
|
globalData: {
|
||||||
@ -108,22 +109,6 @@
|
|||||||
// console.log("jpush连接", connectEnable)
|
// console.log("jpush连接", connectEnable)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// 设置别名
|
|
||||||
// jpushModule.setAlias({
|
|
||||||
// 'alias': uni.getStorageSync('userId'),
|
|
||||||
// 'sequence': 1
|
|
||||||
// })
|
|
||||||
//
|
|
||||||
// jpushModule.addTagAliasListener(result => {
|
|
||||||
// let code = result.code
|
|
||||||
// let sequence = result.sequence
|
|
||||||
// let tags = result.tags
|
|
||||||
// let tag = result.tag
|
|
||||||
// let tagEnable = result.tagEnable
|
|
||||||
// let alias = result.alias
|
|
||||||
// console.log(alias, '别名')
|
|
||||||
// })
|
|
||||||
// 通知事件回调
|
// 通知事件回调
|
||||||
jpushModule.addNotificationListener(result => {
|
jpushModule.addNotificationListener(result => {
|
||||||
let notificationEventType = result.notificationEventType
|
let notificationEventType = result.notificationEventType
|
||||||
@ -132,8 +117,6 @@
|
|||||||
let content = result.content
|
let content = result.content
|
||||||
let extras = result.extras
|
let extras = result.extras
|
||||||
|
|
||||||
console.log("通知", result)
|
|
||||||
|
|
||||||
if (result.extras.type == 'ORDER_CREATE' && result.extras.mp3.length > 0) {
|
if (result.extras.type == 'ORDER_CREATE' && result.extras.mp3.length > 0) {
|
||||||
if (result.extras.mp3[0] == '微信') this.audioTeam.push('/static/audio/wechat.MP3')
|
if (result.extras.mp3[0] == '微信') this.audioTeam.push('/static/audio/wechat.MP3')
|
||||||
if (result.extras.mp3[0] == '支付宝') this.audioTeam.push('/static/audio/pay.MP3')
|
if (result.extras.mp3[0] == '支付宝') this.audioTeam.push('/static/audio/pay.MP3')
|
||||||
@ -287,37 +270,24 @@
|
|||||||
methods: {
|
methods: {
|
||||||
//网络检测
|
//网络检测
|
||||||
checknetwork() {
|
checknetwork() {
|
||||||
|
|
||||||
uni.onNetworkStatusChange(function(res) {
|
uni.onNetworkStatusChange(function(res) {
|
||||||
|
|
||||||
if (res.isConnected) {
|
if (res.isConnected) {
|
||||||
|
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/index/index'
|
url: '/pages/index/index'
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
let that = this;
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
|
|
||||||
title: '系统提示',
|
title: '系统提示',
|
||||||
|
|
||||||
content: '当前设备无网络或网络较差',
|
content: '当前设备无网络或网络较差',
|
||||||
|
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
|
|
||||||
confirmText: '确定',
|
confirmText: '确定',
|
||||||
|
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
|
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
|
that.timer = null;
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
|
|
||||||
url: '/pages/index/index'
|
url: '/pages/index/index'
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
@ -325,25 +295,17 @@
|
|||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/users/login/login_copy'
|
url: '/pages/users/login/login_copy'
|
||||||
})
|
})
|
||||||
|
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
|
that.timer = null;
|
||||||
plus.runtime.quit()
|
plus.runtime.quit()
|
||||||
|
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 语音播报
|
* 语音播报
|
||||||
@ -537,6 +499,7 @@
|
|||||||
/*#endif*/
|
/*#endif*/
|
||||||
// 圆形指示点
|
// 圆形指示点
|
||||||
.circular {
|
.circular {
|
||||||
|
|
||||||
/deep/.uni-swiper-dot,
|
/deep/.uni-swiper-dot,
|
||||||
/deep/.wx-swiper-dot {
|
/deep/.wx-swiper-dot {
|
||||||
width: 10rpx;
|
width: 10rpx;
|
||||||
@ -552,6 +515,7 @@
|
|||||||
|
|
||||||
// 方形指示点
|
// 方形指示点
|
||||||
.square {
|
.square {
|
||||||
|
|
||||||
/deep/.uni-swiper-dot,
|
/deep/.uni-swiper-dot,
|
||||||
/deep/.wx-swiper-dot {
|
/deep/.wx-swiper-dot {
|
||||||
width: 20rpx;
|
width: 20rpx;
|
||||||
|
@ -166,18 +166,6 @@
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getArticleList();
|
this.getArticleList();
|
||||||
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
|
||||||
const query = uni.createSelectorQuery().in(this);
|
|
||||||
query
|
|
||||||
.select(".my-main")
|
|
||||||
.boundingClientRect((data) => {
|
|
||||||
console.log("得到布局位置信息" + JSON.stringify(data));
|
|
||||||
console.log("节点离页面顶部的距离为" + data.top);
|
|
||||||
})
|
|
||||||
.exec();
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeTab(e) {
|
changeTab(e) {
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
"name": "惠农生活",
|
"name": "惠农生活",
|
||||||
"appid": "__UNI__3A527D1",
|
"appid": "__UNI__3A527D1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"versionName": "2.0.51",
|
"versionName": "2.0.52",
|
||||||
"versionCode": 2051,
|
"versionCode": 2052,
|
||||||
"transformPx": false,
|
"transformPx": false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
|
@ -24,8 +24,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view :style="{ height: (swiperTop)+'px','background':'#40AE36','margin-bottom':'20rpx'}"></view>
|
||||||
|
|
||||||
<!--轮播图-->
|
<!--轮播图-->
|
||||||
<view class="swiperBg" :style="{ marginTop: (swiperTop + 13)+'px'}">
|
<view class="swiperBg">
|
||||||
<view class="swiper page_swiper" v-if="imgUrls.length">
|
<view class="swiper page_swiper" v-if="imgUrls.length">
|
||||||
<swiper :autoplay="true" :circular="circular" :interval="intervals" :duration="duration"
|
<swiper :autoplay="true" :circular="circular" :interval="intervals" :duration="duration"
|
||||||
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff" :current="swiperCur"
|
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff" :current="swiperCur"
|
||||||
|
@ -3,19 +3,27 @@
|
|||||||
<!-- #ifdef MP || APP-PLUS -->
|
<!-- #ifdef MP || APP-PLUS -->
|
||||||
<view style="visibility: hidden;" :style="{ height: navHeight + 'rpx' }" v-if="isFixed"></view>
|
<view style="visibility: hidden;" :style="{ height: navHeight + 'rpx' }" v-if="isFixed"></view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view class="navTabBox tabNav" :class="{isFixed:isFixed}" :style="'background:'+bgColor+';margin-top:'+mbConfig+'rpx;color:'+txtColor+';top:'+isTop">
|
<view class="navTabBox tabNav" :class="{isFixed:isFixed}"
|
||||||
|
:style="'background:'+bgColor+';margin-top:'+mbConfig+'rpx;color:'+txtColor+';top:'+isTop">
|
||||||
<view class="longTab" :style='"width:"+mainWidth+"px"'>
|
<view class="longTab" :style='"width:"+mainWidth+"px"'>
|
||||||
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex;" scroll-with-animation :scroll-left="tabLeft" show-scrollbar="true">
|
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex;" scroll-with-animation
|
||||||
<view class="longItem" :style="'width:'+isWidth+'px;color:'+(index===tabClick ? activeColor : txtColor)" :data-index="index" :class="index===tabClick?'click':''" v-for="(item,index) in tabTitle" :key="index" :id="'id'+index" @click="longClick(index,item.store_category_id,item.pid)">{{item.cate_name}}</view>
|
:scroll-left="tabLeft" show-scrollbar="true">
|
||||||
|
<view class="longItem"
|
||||||
|
:style="'width:'+isWidth+'px;color:'+(index===tabClick ? activeColor : txtColor)"
|
||||||
|
:data-index="index" :class="index===tabClick?'click':''" v-for="(item,index) in tabTitle"
|
||||||
|
:key="index" :id="'id'+index" @click="longClick(index,item.store_category_id,item.pid)">
|
||||||
|
{{item.cate_name}}</view>
|
||||||
<view class="underlineBox" :style='"transform:translateX("+isLeft+"px);width:"+isWidth+"px"'>
|
<view class="underlineBox" :style='"transform:translateX("+isLeft+"px);width:"+isWidth+"px"'>
|
||||||
<view class="underline" :style="'background-color:'+activeColor"></view>
|
<view class="underline" :style="'background-color:'+activeColor"></view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
<navigator v-if="merId" :url="'/pages/store/home/index?id='+merId+'&type=2'" class="category" hover-class="none" :style="'background-color:'+bgColor+';color:'+txtColor">
|
<navigator v-if="merId" :url="'/pages/store/home/index?id='+merId+'&type=2'" class="category"
|
||||||
|
hover-class="none" :style="'background-color:'+bgColor+';color:'+txtColor">
|
||||||
<text class="iconfont icon-fenlei3"></text>分类
|
<text class="iconfont icon-fenlei3"></text>分类
|
||||||
</navigator>
|
</navigator>
|
||||||
<navigator v-else open-type='switchTab' url="/pages/goods_cate/goods_cate" class="category" hover-class="none" :style="'background-color:'+bgColor+';color:'+txtColor">
|
<navigator v-else open-type='switchTab' url="/pages/goods_cate/goods_cate" class="category"
|
||||||
|
hover-class="none" :style="'background-color:'+bgColor+';color:'+txtColor">
|
||||||
<text class="iconfont icon-fenlei3"></text>分类
|
<text class="iconfont icon-fenlei3"></text>分类
|
||||||
</navigator>
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
@ -32,7 +40,9 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
import { getCateData } from '@/api/api.js';
|
import {
|
||||||
|
getCateData
|
||||||
|
} from '@/api/api.js';
|
||||||
let app = getApp();
|
let app = getApp();
|
||||||
export default {
|
export default {
|
||||||
name: 'navTab',
|
name: 'navTab',
|
||||||
@ -61,13 +71,13 @@
|
|||||||
isLeft: 0, //导航栏下划线位置
|
isLeft: 0, //导航栏下划线位置
|
||||||
isWidth: 0, //每个导航栏占位
|
isWidth: 0, //每个导航栏占位
|
||||||
mainWidth: 0,
|
mainWidth: 0,
|
||||||
tabLeft:0,
|
tabLeft: 0,
|
||||||
swiperIndex:0,
|
swiperIndex: 0,
|
||||||
childIndex:0,
|
childIndex: 0,
|
||||||
childID:0,
|
childID: 0,
|
||||||
bgColor:this.dataConfig.bgColor.color[0].item,
|
bgColor: this.dataConfig.bgColor.color[0].item,
|
||||||
mbConfig:this.dataConfig.mbConfig.val * 2,
|
mbConfig: this.dataConfig.mbConfig.val * 2,
|
||||||
txtColor:this.dataConfig.txtColor.color[0].item,
|
txtColor: this.dataConfig.txtColor.color[0].item,
|
||||||
activeColor: this.dataConfig.activeColor.color[0].item,
|
activeColor: this.dataConfig.activeColor.color[0].item,
|
||||||
fixedTop: 0,
|
fixedTop: 0,
|
||||||
isTop: 0,
|
isTop: 0,
|
||||||
@ -76,12 +86,12 @@
|
|||||||
unique: this.dataConfig.timestamp,
|
unique: this.dataConfig.timestamp,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch:{
|
watch: {
|
||||||
// #ifdef MP || APP-PLUS
|
// #ifdef MP || APP-PLUS
|
||||||
isFixed(nVal,oVal){
|
isFixed(nVal, oVal) {
|
||||||
if(nVal){
|
if (nVal) {
|
||||||
this.isTop = (uni.getSystemInfoSync().statusBarHeight + 43) + 'px'
|
this.isTop = (uni.getSystemInfoSync().statusBarHeight + 43) + 'px'
|
||||||
}else{
|
} else {
|
||||||
this.isTop = 0
|
this.isTop = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -94,7 +104,7 @@
|
|||||||
uni.getSystemInfo({
|
uni.getSystemInfo({
|
||||||
success(e) {
|
success(e) {
|
||||||
that.mainWidth = e.windowWidth
|
that.mainWidth = e.windowWidth
|
||||||
that.isWidth = (e.windowWidth-65) / 4
|
that.isWidth = (e.windowWidth - 65) / 4
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
setTimeout((e) => {
|
setTimeout((e) => {
|
||||||
@ -120,7 +130,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getCateData(){
|
getCateData() {
|
||||||
getCateData({
|
getCateData({
|
||||||
diy_id: this.diy_id,
|
diy_id: this.diy_id,
|
||||||
unique: this.unique,
|
unique: this.unique,
|
||||||
@ -132,36 +142,36 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 导航栏点击
|
// 导航栏点击
|
||||||
longClick(index,id,fid){
|
longClick(index, id, fid) {
|
||||||
app.globalData.fid = fid;
|
app.globalData.fid = fid;
|
||||||
this.childIndex = 0;
|
this.childIndex = 0;
|
||||||
if(this.tabTitle.length>3){
|
if (this.tabTitle.length > 3) {
|
||||||
var tempIndex = index - 2;
|
var tempIndex = index - 2;
|
||||||
tempIndex = tempIndex<=0 ? 0 : tempIndex;
|
tempIndex = tempIndex <= 0 ? 0 : tempIndex;
|
||||||
this.tabLeft = (index-2) * this.isWidth //设置下划线位置
|
this.tabLeft = (index - 2) * this.isWidth //设置下划线位置
|
||||||
}
|
}
|
||||||
this.tabClick = index //设置导航点击了哪一个
|
this.tabClick = index //设置导航点击了哪一个
|
||||||
this.isLeft = index * this.isWidth //设置下划线位置
|
this.isLeft = index * this.isWidth //设置下划线位置
|
||||||
let obj = {
|
let obj = {
|
||||||
index:index,
|
index: index,
|
||||||
pid:id//自己的id
|
pid: id //自己的id
|
||||||
}
|
}
|
||||||
if(!this.merId){
|
if (!this.merId) {
|
||||||
this.parentEmit(obj);
|
this.parentEmit(obj);
|
||||||
}else{
|
} else {
|
||||||
if(id){
|
if (id) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/store/list/index?id='+id+'&mer_id='+this.merId
|
url: '/pages/store/list/index?id=' + id + '&mer_id=' + this.merId
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/store/home/index?id='+this.merId
|
url: '/pages/store/home/index?id=' + this.merId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
parentEmit(obj){
|
parentEmit(obj) {
|
||||||
this.$emit('changeTab', obj);
|
this.$emit('changeTab', obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -172,11 +182,13 @@
|
|||||||
.tabNav {
|
.tabNav {
|
||||||
padding-top: 10rpx;
|
padding-top: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navTabBox {
|
.navTabBox {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
color: rgba(255, 255, 255, 1);
|
color: rgba(255, 255, 255, 1);
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-bottom: 10rpx;
|
padding-bottom: 10rpx;
|
||||||
|
|
||||||
&.isFixed {
|
&.isFixed {
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@ -186,17 +198,20 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
}
|
}
|
||||||
|
|
||||||
.click {
|
.click {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.longTab {
|
.longTab {
|
||||||
/* #ifdef H5 */
|
/* #ifdef H5 */
|
||||||
padding-right: 106rpx;
|
padding-right: 106rpx;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
/* #ifdef MP || APP-PLUS */
|
/* #ifdef MP || APP-PLUS */
|
||||||
padding-right: 116rpx;
|
padding-right: 116rpx;
|
||||||
|
|
||||||
/* #endif */
|
/* #endif */
|
||||||
.longItem{
|
.longItem {
|
||||||
height: 50upx;
|
height: 50upx;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
line-height: 50upx;
|
line-height: 50upx;
|
||||||
@ -207,12 +222,14 @@
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
&.click{
|
|
||||||
|
&.click {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #E93323;
|
color: #E93323;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.underlineBox {
|
.underlineBox {
|
||||||
height: 3px;
|
height: 3px;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
@ -220,13 +237,20 @@
|
|||||||
align-content: center;
|
align-content: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
transition: .5s;
|
transition: .5s;
|
||||||
|
|
||||||
.underline {
|
.underline {
|
||||||
width: 33rpx;
|
width: 33rpx;
|
||||||
height: 4rpx;
|
height: 4rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.category{
|
|
||||||
|
.category_wrap {
|
||||||
|
transition: height .4s;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.category {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 10rpx;
|
top: 10rpx;
|
||||||
@ -243,13 +267,15 @@
|
|||||||
line-height: 50upx;
|
line-height: 50upx;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
padding: 0 15rpx 0 25rpx;
|
padding: 0 15rpx 0 25rpx;
|
||||||
.iconfont{
|
|
||||||
|
.iconfont {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
margin-right:6rpx;
|
margin-right: 6rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.child-box{
|
|
||||||
|
.child-box {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@ -258,37 +284,43 @@
|
|||||||
/* #endif */
|
/* #endif */
|
||||||
/* #ifdef MP */
|
/* #ifdef MP */
|
||||||
box-shadow: 0 2rpx 3rpx 1rpx #f9f9f9;
|
box-shadow: 0 2rpx 3rpx 1rpx #f9f9f9;
|
||||||
|
|
||||||
/* #endif */
|
/* #endif */
|
||||||
.wrapper{
|
.wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20rpx 0;
|
padding: 20rpx 0;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
.child-item{
|
|
||||||
|
.child-item {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
width:140rpx;
|
width: 140rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
image{
|
|
||||||
|
image {
|
||||||
width: 90rpx;
|
width: 90rpx;
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
.txt{
|
|
||||||
|
.txt {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #282828;
|
color: #282828;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
}
|
}
|
||||||
&.on{
|
|
||||||
image{
|
&.on {
|
||||||
|
image {
|
||||||
border: 1px solid $theme-color-opacity;
|
border: 1px solid $theme-color-opacity;
|
||||||
}
|
}
|
||||||
.txt{
|
|
||||||
|
.txt {
|
||||||
color: $theme-color;
|
color: $theme-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
<homeComb v-if="smallPage" class="home-comb" :isScale="isScale" :isMenu="isMenu"
|
<homeComb v-if="smallPage" class="home-comb" :isScale="isScale" :isMenu="isMenu"
|
||||||
:dataConfig="homeCombData" :userInfo="userInfo" :isFixed="isFixed" :isScrolled="isScrolled"
|
:dataConfig="homeCombData" :userInfo="userInfo" :isFixed="isFixed" :isScrolled="isScrolled"
|
||||||
@changeDiy="changeDiy"></homeComb>
|
@changeDiy="changeDiy"></homeComb>
|
||||||
<!-- <card></card> -->
|
|
||||||
<view v-for="(item, index) in styleConfig" :key="index">
|
<view v-for="(item, index) in styleConfig" :key="index">
|
||||||
<block
|
<block
|
||||||
v-if="item.name != 'headerSerch' && item.name != 'tabNav' && item.name != 'shopList' && item.name != 'homeComb' && item.name != 'hotRanking' && item.name != 'pageFoot'">
|
v-if="item.name != 'headerSerch' && item.name != 'tabNav' && item.name != 'shopList' && item.name != 'homeComb' && item.name != 'hotRanking' && item.name != 'pageFoot'">
|
||||||
@ -39,12 +38,33 @@
|
|||||||
<hotRanking :dataConfig="item"></hotRanking>
|
<hotRanking :dataConfig="item"></hotRanking>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="main" v-show="navIndex == 0">
|
||||||
|
<!-- 首页推荐 -->
|
||||||
|
<view v-if="recommend_switch == 1" class="index-product-wrapper">
|
||||||
|
<!-- 首发新品 -->
|
||||||
|
<recommend ref="recommendRef" :hostProduct="hostProduct[hostIndex]"
|
||||||
|
@changeRecommedTab="changeRecommedTab" showTab :indexP="true" :isLogin="isLogin"
|
||||||
|
:loading="loading">
|
||||||
|
</recommend>
|
||||||
|
<view class="loadingicon acea-row row-center-wrapper"
|
||||||
|
v-if="hostProduct[hostIndex].length > 0 || hotLoading[hostIndex]">
|
||||||
|
<text class="loading iconfont icon-jiazai"
|
||||||
|
:hidden="hotLoading[hostIndex] == false"></text>
|
||||||
|
{{ hotTitle }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-show="navIndex == 0" class="loadingicon acea-row row-center-wrapper"
|
||||||
|
v-if="tempArr.length && styleConfig[styleConfig.length - 1].name == 'promotionList'">
|
||||||
|
<text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
|
||||||
|
{{ loadTitle }}
|
||||||
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
<!-- #ifdef MP || APP-PLUS -->
|
<!-- #ifdef MP || APP-PLUS -->
|
||||||
<homeComb class="home-comb" v-if="smallPage" :isScale="isScale" :isMenu="isMenu"
|
<homeComb class="home-comb" v-if="smallPage" :isScale="isScale" :isMenu="isMenu"
|
||||||
:dataConfig="homeCombData" :isFixed="isFixed" :isScrolled="isScrolled" :userInfo="userInfo"
|
:dataConfig="homeCombData" :isFixed="isFixed" :isScrolled="isScrolled" :userInfo="userInfo"
|
||||||
@changeDiy="changeDiy" @bindHeight="bindHeighta"></homeComb>
|
@changeDiy="changeDiy" @bindHeight="bindHeighta"></homeComb>
|
||||||
<!-- <card></card> -->
|
|
||||||
<block v-for="(item, index) in styleConfig" :key="index">
|
<block v-for="(item, index) in styleConfig" :key="index">
|
||||||
<view v-show="navIndex == 0">
|
<view v-show="navIndex == 0">
|
||||||
<homeComb v-if="item.name == 'homeComb' && !smallPage" :isMenu="isMenu" :dataConfig="item"
|
<homeComb v-if="item.name == 'homeComb' && !smallPage" :isMenu="isMenu" :dataConfig="item"
|
||||||
@ -82,11 +102,10 @@
|
|||||||
<tabNav v-if="item.name == 'tabNav'" :dataConfig="item" class="tabNav" :tabTitle="navTop"
|
<tabNav v-if="item.name == 'tabNav'" :dataConfig="item" class="tabNav" :tabTitle="navTop"
|
||||||
@bindHeight="bindHeighta" @changeTab="changeTab" :isFixed="isFixed"></tabNav>
|
@bindHeight="bindHeighta" @changeTab="changeTab" :isFixed="isFixed"></tabNav>
|
||||||
</block>
|
</block>
|
||||||
<!-- #endif -->
|
|
||||||
|
|
||||||
<view class="main" v-show="navIndex == 0">
|
<!-- 首页推荐 -->
|
||||||
<!-- 首页推荐 -->
|
<view class="main">
|
||||||
<view v-if="recommend_switch == 1" class="index-product-wrapper">
|
<view class="index-product-wrapper">
|
||||||
<!-- 首发新品 -->
|
<!-- 首发新品 -->
|
||||||
<recommend ref="recommendRef" :hostProduct="hostProduct[hostIndex]"
|
<recommend ref="recommendRef" :hostProduct="hostProduct[hostIndex]"
|
||||||
@changeRecommedTab="changeRecommedTab" showTab :indexP="true" :isLogin="isLogin"
|
@changeRecommedTab="changeRecommedTab" showTab :indexP="true" :isLogin="isLogin"
|
||||||
@ -100,11 +119,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-show="navIndex == 0" class="loadingicon acea-row row-center-wrapper"
|
<view class="loadingicon acea-row row-center-wrapper"
|
||||||
v-if="tempArr.length && styleConfig[styleConfig.length - 1].name == 'promotionList'">
|
v-if="tempArr.length && styleConfig[styleConfig.length - 1].name == 'promotionList'">
|
||||||
<text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
|
<text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
|
||||||
{{ loadTitle }}
|
{{ loadTitle }}
|
||||||
</view>
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
</block>
|
</block>
|
||||||
<!-- 分类页 -->
|
<!-- 分类页 -->
|
||||||
<view class="productList" v-if="navIndex > 0">
|
<view class="productList" v-if="navIndex > 0">
|
||||||
@ -1074,16 +1094,21 @@
|
|||||||
this.loadGoods(e);
|
this.loadGoods(e);
|
||||||
},
|
},
|
||||||
loadGoods(e = 1) {
|
loadGoods(e = 1) {
|
||||||
if (e == 1) return this.get_host_product(0);
|
|
||||||
if (e == 2) return this.get_host_home({
|
console.log(e);
|
||||||
mer_type: 1
|
|
||||||
}, 1);
|
this.$nextTick(() => {
|
||||||
if (e == 3) return this.get_host_home({
|
if (e == 1) return this.get_host_product(0);
|
||||||
mer_type: 2
|
if (e == 2) return this.get_host_home({
|
||||||
}, 2);
|
mer_type: 1
|
||||||
if (e == 4) return this.get_host_home({
|
}, 1);
|
||||||
mer_type: 3
|
if (e == 3) return this.get_host_home({
|
||||||
}, 3);
|
mer_type: 2
|
||||||
|
}, 2);
|
||||||
|
if (e == 4) return this.get_host_home({
|
||||||
|
mer_type: 3
|
||||||
|
}, 3);
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 获取我的推荐
|
* 获取我的推荐
|
||||||
|
@ -38,50 +38,49 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 商品大分类 -->
|
<!-- 商品大分类 -->
|
||||||
<view class="category_wrap" :style="{height:categoryWrapHeight+'px'}">
|
|
||||||
<view class="category">
|
|
||||||
<scroll-view scroll-x="true">
|
|
||||||
<view class="category-wrap">
|
|
||||||
<block v-for="(item,index) in store_category" :key="index">
|
|
||||||
<view class="category-item" :class="{'category-item-active': index==cate_change}"
|
|
||||||
@click="changeCate(index)">
|
|
||||||
<block v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)">
|
|
||||||
<u--image class="category-item-img" width="108rpx" :src="item.pic"
|
|
||||||
height="108rpx" shape="circle">
|
|
||||||
<template v-slot:loading>
|
|
||||||
<u-loading-icon color="#999" size="15" />
|
|
||||||
</template>
|
|
||||||
</u--image>
|
|
||||||
<text class="category-item-text">{{item.cate_name}}</text>
|
|
||||||
</block>
|
|
||||||
<block v-else>
|
|
||||||
<u--image class="category-item-img" width="108rpx" :src="item.background"
|
|
||||||
height="108rpx" shape="circle">
|
|
||||||
<template v-slot:loading>
|
|
||||||
<u-loading-icon color="#999" size="15" />
|
|
||||||
</template>
|
|
||||||
</u--image>
|
|
||||||
<text class="category-item-text">{{item.category_name}}</text>
|
|
||||||
</block>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 商品小分类 -->
|
<view class="category">
|
||||||
<view class="cate" v-if="store_category_children.length>1">
|
<scroll-view scroll-x="true">
|
||||||
<scroll-view scroll-x="true">
|
<view class="category-wrap">
|
||||||
<view class="cate-wrap">
|
<block v-for="(item,index) in store_category" :key="index">
|
||||||
<block v-for="(item,index) in store_category_children" :key="index">
|
<view class="category-item" :class="{'category-item-active': index==cate_change}"
|
||||||
<view class="cate-item" :class="{'cate-item-active':index == cate_change_children}"
|
@click="changeCate(index)">
|
||||||
@click="changeChildrenCate(index)">
|
<block v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)">
|
||||||
<text>{{item.cate_name}}</text>
|
<u--image class="category-item-img" width="108rpx" :src="item.pic"
|
||||||
</view>
|
height="108rpx" shape="circle">
|
||||||
</block>
|
<template v-slot:loading>
|
||||||
</view>
|
<u-loading-icon color="#999" size="15" />
|
||||||
</scroll-view>
|
</template>
|
||||||
</view>
|
</u--image>
|
||||||
|
<text class="category-item-text">{{item.cate_name}}</text>
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<u--image class="category-item-img" width="108rpx" :src="item.background"
|
||||||
|
height="108rpx" shape="circle">
|
||||||
|
<template v-slot:loading>
|
||||||
|
<u-loading-icon color="#999" size="15" />
|
||||||
|
</template>
|
||||||
|
</u--image>
|
||||||
|
<text class="category-item-text">{{item.category_name}}</text>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 商品小分类 -->
|
||||||
|
<view class="cate" v-if="store_category_children.length>1">
|
||||||
|
<scroll-view scroll-x="true">
|
||||||
|
<view class="cate-wrap">
|
||||||
|
<block v-for="(item,index) in store_category_children" :key="index">
|
||||||
|
<view class="cate-item" :class="{'cate-item-active':index == cate_change_children}"
|
||||||
|
@click="changeChildrenCate(index)">
|
||||||
|
<text>{{item.cate_name}}</text>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 综合查询 -->
|
<!-- 综合查询 -->
|
||||||
@ -330,10 +329,10 @@
|
|||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
// 获取dom信息
|
// 获取dom信息
|
||||||
this.$util.getDom(this, '.category', (res) => {
|
// this.$util.getDom(this, '.category', (res) => {
|
||||||
this.bigTypeDomInfo = res;
|
// this.bigTypeDomInfo = res;
|
||||||
this.categoryWrapHeight = res.height;
|
// this.categoryWrapHeight = res.height;
|
||||||
});
|
// });
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initData(re = false, stop = false) {
|
initData(re = false, stop = false) {
|
||||||
@ -431,9 +430,9 @@
|
|||||||
this.getProductslist(true);
|
this.getProductslist(true);
|
||||||
|
|
||||||
// 获取小分类高度 为了上下滑动隐藏分类
|
// 获取小分类高度 为了上下滑动隐藏分类
|
||||||
this.$util.getDom(this, '.cate', (res) => {
|
// this.$util.getDom(this, '.cate', (res) => {
|
||||||
if (res) this.smallTypeDomInfo = res.data;
|
// if (res) this.smallTypeDomInfo = res.data;
|
||||||
})
|
// })
|
||||||
},
|
},
|
||||||
changeChildrenCate(e) {
|
changeChildrenCate(e) {
|
||||||
this.cate_change_children = e;
|
this.cate_change_children = e;
|
||||||
|
@ -24,6 +24,15 @@ import permision from "./permission.js"
|
|||||||
// #endif
|
// #endif
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
getDom: (that, selector, fn) => {
|
||||||
|
that.$nextTick(() => {
|
||||||
|
const query = uni.createSelectorQuery().in(that);
|
||||||
|
query.select(selector).boundingClientRect((data) => {
|
||||||
|
fn && fn(data);
|
||||||
|
}).exec();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
//复制
|
//复制
|
||||||
uniCopy: ({
|
uniCopy: ({
|
||||||
content,
|
content,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user