From c5437b487a3cd54f64bb5ca5fdee867e64189434 Mon Sep 17 00:00:00 2001
From: 1154079537 <1154079537@qq.com>
Date: Fri, 10 May 2024 16:32:04 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 48 ++--------
components/recommend/index.vue | 12 ---
manifest.json | 6 +-
pages/index/component/homeComb.vue | 4 +-
pages/index/component/tabNav.vue | 140 ++++++++++++++++++-----------
pages/index/index.vue | 59 ++++++++----
pages/whole_sale/index.vue | 99 ++++++++++----------
utils/util.js | 9 ++
8 files changed, 198 insertions(+), 179 deletions(-)
diff --git a/App.vue b/App.vue
index eb29ee3..cb17a2b 100644
--- a/App.vue
+++ b/App.vue
@@ -30,6 +30,7 @@
data() {
return {
audioTeam: [],
+ timer: null
}
},
globalData: {
@@ -108,22 +109,6 @@
// 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 => {
let notificationEventType = result.notificationEventType
@@ -132,8 +117,6 @@
let content = result.content
let extras = result.extras
- console.log("通知", result)
-
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/pay.MP3')
@@ -287,37 +270,24 @@
methods: {
//网络检测
checknetwork() {
-
uni.onNetworkStatusChange(function(res) {
-
if (res.isConnected) {
-
uni.reLaunch({
url: '/pages/index/index'
})
-
} else {
-
+ let that = this;
uni.showModal({
-
title: '系统提示',
-
content: '当前设备无网络或网络较差',
-
cancelText: '取消',
-
confirmText: '确定',
-
success: (res) => {
-
if (res.confirm) {
-
+ that.timer = null;
uni.reLaunch({
-
url: '/pages/index/index'
-
})
-
} else {
// #ifdef H5
@@ -325,25 +295,17 @@
uni.navigateTo({
url: '/pages/users/login/login_copy'
})
-
// #endif
// #ifdef APP-PLUS
-
+ that.timer = null;
plus.runtime.quit()
-
// #endif
-
}
-
}
-
})
-
}
-
})
-
},
/**
* 语音播报
@@ -537,6 +499,7 @@
/*#endif*/
// 圆形指示点
.circular {
+
/deep/.uni-swiper-dot,
/deep/.wx-swiper-dot {
width: 10rpx;
@@ -552,6 +515,7 @@
// 方形指示点
.square {
+
/deep/.uni-swiper-dot,
/deep/.wx-swiper-dot {
width: 20rpx;
diff --git a/components/recommend/index.vue b/components/recommend/index.vue
index 55a73a6..1846bbd 100644
--- a/components/recommend/index.vue
+++ b/components/recommend/index.vue
@@ -166,18 +166,6 @@
},
mounted() {
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: {
changeTab(e) {
diff --git a/manifest.json b/manifest.json
index 8f45f06..49ba7da 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name": "惠农生活",
"appid": "__UNI__3A527D1",
"description": "",
- "versionName": "2.0.51",
- "versionCode": 2051,
+ "versionName": "2.0.52",
+ "versionCode": 2052,
"transformPx": false,
/* 5+App特有相关 */
"app-plus": {
@@ -349,4 +349,4 @@
}
}
}
-}
+}
\ No newline at end of file
diff --git a/pages/index/component/homeComb.vue b/pages/index/component/homeComb.vue
index 38be26a..10535b7 100644
--- a/pages/index/component/homeComb.vue
+++ b/pages/index/component/homeComb.vue
@@ -24,8 +24,10 @@
+
+
-
+
-
+
-
- {{item.cate_name}}
+
+
+ {{item.cate_name}}
-
+
分类
-
+
分类
-
+
@@ -32,7 +40,9 @@
// +----------------------------------------------------------------------
// | Author: CRMEB Team
// +----------------------------------------------------------------------
- import { getCateData } from '@/api/api.js';
+ import {
+ getCateData
+ } from '@/api/api.js';
let app = getApp();
export default {
name: 'navTab',
@@ -61,13 +71,13 @@
isLeft: 0, //导航栏下划线位置
isWidth: 0, //每个导航栏占位
mainWidth: 0,
- tabLeft:0,
- swiperIndex:0,
- childIndex:0,
- childID:0,
- bgColor:this.dataConfig.bgColor.color[0].item,
- mbConfig:this.dataConfig.mbConfig.val * 2,
- txtColor:this.dataConfig.txtColor.color[0].item,
+ tabLeft: 0,
+ swiperIndex: 0,
+ childIndex: 0,
+ childID: 0,
+ bgColor: this.dataConfig.bgColor.color[0].item,
+ mbConfig: this.dataConfig.mbConfig.val * 2,
+ txtColor: this.dataConfig.txtColor.color[0].item,
activeColor: this.dataConfig.activeColor.color[0].item,
fixedTop: 0,
isTop: 0,
@@ -76,12 +86,12 @@
unique: this.dataConfig.timestamp,
};
},
- watch:{
+ watch: {
// #ifdef MP || APP-PLUS
- isFixed(nVal,oVal){
- if(nVal){
+ isFixed(nVal, oVal) {
+ if (nVal) {
this.isTop = (uni.getSystemInfoSync().statusBarHeight + 43) + 'px'
- }else{
+ } else {
this.isTop = 0
}
}
@@ -92,9 +102,9 @@
that.getCateData()
// 获取设备宽度
uni.getSystemInfo({
- success(e) {
+ success(e) {
that.mainWidth = e.windowWidth
- that.isWidth = (e.windowWidth-65) / 4
+ that.isWidth = (e.windowWidth - 65) / 4
}
})
setTimeout((e) => {
@@ -117,14 +127,14 @@
// #ifdef H5
this.isTop = 0
// #endif
-
+
},
methods: {
- getCateData(){
+ getCateData() {
getCateData({
diy_id: this.diy_id,
unique: this.unique,
- }).then(res => {
+ }).then(res => {
res.data.unshift({
cate_name: '首页'
});
@@ -132,36 +142,36 @@
});
},
// 导航栏点击
- longClick(index,id,fid){
+ longClick(index, id, fid) {
app.globalData.fid = fid;
this.childIndex = 0;
- if(this.tabTitle.length>3){
+ if (this.tabTitle.length > 3) {
var tempIndex = index - 2;
- tempIndex = tempIndex<=0 ? 0 : tempIndex;
- this.tabLeft = (index-2) * this.isWidth //设置下划线位置
+ tempIndex = tempIndex <= 0 ? 0 : tempIndex;
+ this.tabLeft = (index - 2) * this.isWidth //设置下划线位置
}
this.tabClick = index //设置导航点击了哪一个
this.isLeft = index * this.isWidth //设置下划线位置
let obj = {
- index:index,
- pid:id//自己的id
+ index: index,
+ pid: id //自己的id
}
- if(!this.merId){
+ if (!this.merId) {
this.parentEmit(obj);
- }else{
- if(id){
+ } else {
+ if (id) {
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({
- url: '/pages/store/home/index?id='+this.merId
+ url: '/pages/store/home/index?id=' + this.merId
});
}
-
- }
+
+ }
},
- parentEmit(obj){
+ parentEmit(obj) {
this.$emit('changeTab', obj);
}
}
@@ -172,11 +182,13 @@
.tabNav {
padding-top: 10rpx;
}
+
.navTabBox {
width: 100%;
color: rgba(255, 255, 255, 1);
position: relative;
padding-bottom: 10rpx;
+
&.isFixed {
z-index: 10;
position: fixed;
@@ -186,18 +198,21 @@
top: 0;
/* #endif */
}
+
.click {
color: white;
}
+
.longTab {
/* #ifdef H5 */
padding-right: 106rpx;
/* #endif */
/* #ifdef MP || APP-PLUS */
padding-right: 116rpx;
+
/* #endif */
- .longItem{
- height: 50upx;
+ .longItem {
+ height: 50upx;
display: inline-block;
line-height: 50upx;
text-align: center;
@@ -207,12 +222,14 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
- &.click{
+
+ &.click {
font-weight: bold;
font-size: 30rpx;
color: #E93323;
}
}
+
.underlineBox {
height: 3px;
width: 20%;
@@ -220,13 +237,20 @@
align-content: center;
justify-content: center;
transition: .5s;
+
.underline {
width: 33rpx;
height: 4rpx;
}
}
}
- .category{
+
+ .category_wrap {
+ transition: height .4s;
+ overflow: hidden;
+ }
+
+ .category {
position: absolute;
right: 0;
top: 10rpx;
@@ -243,13 +267,15 @@
line-height: 50upx;
z-index: 3;
padding: 0 15rpx 0 25rpx;
- .iconfont{
+
+ .iconfont {
font-size: 30rpx;
- margin-right:6rpx;
+ margin-right: 6rpx;
}
}
}
- .child-box{
+
+ .child-box {
width: 100%;
position: relative;
background-color: #fff;
@@ -258,40 +284,46 @@
/* #endif */
/* #ifdef MP */
box-shadow: 0 2rpx 3rpx 1rpx #f9f9f9;
+
/* #endif */
- .wrapper{
+ .wrapper {
display: flex;
align-items: center;
padding: 20rpx 0;
background: #fff;
}
- .child-item{
+
+ .child-item {
flex-shrink: 0;
- width:140rpx;
+ width: 140rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-left: 10rpx;
- image{
+
+ image {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
}
- .txt{
+
+ .txt {
font-size: 24rpx;
color: #282828;
text-align: center;
margin-top: 10rpx;
}
- &.on{
- image{
+
+ &.on {
+ image {
border: 1px solid $theme-color-opacity;
}
- .txt{
+
+ .txt {
color: $theme-color;
}
}
}
}
-
+
\ No newline at end of file
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 3f99db3..b49b590 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -12,7 +12,6 @@
-
@@ -39,12 +38,33 @@
+
+
+
+
+
+
+
+
+ {{ hotTitle }}
+
+
+
+
+
+ {{ loadTitle }}
+
+
-
-
-
-
-
+
+
+
-
{{ loadTitle }}
+
@@ -1074,16 +1094,21 @@
this.loadGoods(e);
},
loadGoods(e = 1) {
- if (e == 1) return this.get_host_product(0);
- if (e == 2) return this.get_host_home({
- mer_type: 1
- }, 1);
- if (e == 3) return this.get_host_home({
- mer_type: 2
- }, 2);
- if (e == 4) return this.get_host_home({
- mer_type: 3
- }, 3);
+
+ console.log(e);
+
+ this.$nextTick(() => {
+ if (e == 1) return this.get_host_product(0);
+ if (e == 2) return this.get_host_home({
+ mer_type: 1
+ }, 1);
+ if (e == 3) return this.get_host_home({
+ mer_type: 2
+ }, 2);
+ if (e == 4) return this.get_host_home({
+ mer_type: 3
+ }, 3);
+ })
},
/**
* 获取我的推荐
diff --git a/pages/whole_sale/index.vue b/pages/whole_sale/index.vue
index ae4afac..c27fd89 100644
--- a/pages/whole_sale/index.vue
+++ b/pages/whole_sale/index.vue
@@ -38,50 +38,49 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.cate_name}}
-
-
-
-
-
-
-
- {{item.category_name}}
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.cate_name}}
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ {{item.cate_name}}
+
+
+
+
+
+
+
+ {{item.category_name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.cate_name}}
+
+
+
+
@@ -330,10 +329,10 @@
},
onReady() {
// 获取dom信息
- this.$util.getDom(this, '.category', (res) => {
- this.bigTypeDomInfo = res;
- this.categoryWrapHeight = res.height;
- });
+ // this.$util.getDom(this, '.category', (res) => {
+ // this.bigTypeDomInfo = res;
+ // this.categoryWrapHeight = res.height;
+ // });
},
methods: {
initData(re = false, stop = false) {
@@ -431,9 +430,9 @@
this.getProductslist(true);
// 获取小分类高度 为了上下滑动隐藏分类
- this.$util.getDom(this, '.cate', (res) => {
- if (res) this.smallTypeDomInfo = res.data;
- })
+ // this.$util.getDom(this, '.cate', (res) => {
+ // if (res) this.smallTypeDomInfo = res.data;
+ // })
},
changeChildrenCate(e) {
this.cate_change_children = e;
diff --git a/utils/util.js b/utils/util.js
index ccb5068..816ad4b 100644
--- a/utils/util.js
+++ b/utils/util.js
@@ -24,6 +24,15 @@ import permision from "./permission.js"
// #endif
export default {
+ getDom: (that, selector, fn) => {
+ that.$nextTick(() => {
+ const query = uni.createSelectorQuery().in(that);
+ query.select(selector).boundingClientRect((data) => {
+ fn && fn(data);
+ }).exec();
+ })
+ },
+
//复制
uniCopy: ({
content,