diff --git a/App.vue b/App.vue index e4cda22..3705ce8 100644 --- a/App.vue +++ b/App.vue @@ -1,591 +1,598 @@ \ No newline at end of file diff --git a/manifest.json b/manifest.json index 3b81b26..1753aac 100644 --- a/manifest.json +++ b/manifest.json @@ -1,352 +1,352 @@ { - "name" : "惠农生活", - "appid" : "__UNI__3A527D1", - "description" : "", - "versionName" : "2.0.35", - "versionCode" : 2035, - "transformPx" : false, - /* 5+App特有相关 */ - "app-plus" : { - "titleNView" : true, - "usingComponents" : true, - "nvueCompiler" : "uni-app", - "nvueStyleCompiler" : "uni-app", - "compilerVersion" : 3, - "compatible" : { - "ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持 - }, - "splashscreen" : { - "alwaysShowBeforeRender" : false, - "waiting" : false, - "autoclose" : true, - "delay" : 0 - }, - /* 模块配置 */ - "modules" : { - "VideoPlayer" : {}, - "OAuth" : {}, - "Payment" : {}, - "Share" : {}, - "iBeacon" : {}, - "Maps" : {}, - "Geolocation" : {}, - "UniMP" : { - "description" : "uni小程序" - }, - "Push" : {}, - "Barcode" : {}, - "Camera" : {} - }, - "safearea" : { - "bottom" : { - "offset" : "none" - } - }, - /* 应用发布信息 */ - "distribute" : { - /* android打包配置 */ - "android" : { - "permissions" : [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ], - "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ], - "permissionExternalStorage" : { - "request" : "none", - "prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。" - }, - "permissionPhoneState" : { - "request" : "none" //拨打电话权限关闭 - }, - "minSdkVersion" : 23, - "targetSdkVersion" : 30 - }, - /* ios打包配置 */ - "ios" : { - "privacyDescription" : { - "NSPhotoLibraryUsageDescription" : "上传用户头像保存分享海报", - "NSPhotoLibraryAddUsageDescription" : "上传用户头像保存分享海报", - "NSCameraUsageDescription" : "上传用户头像保存分享海报", - "NSLocationWhenInUseUsageDescription" : "根据客户地理位置推荐最近门店", - "NSLocationAlwaysUsageDescription" : "根据客户地理位置推荐最近门店" - }, - "idfa" : false, - "dSYMs" : false - }, - /* SDK配置 */ - "sdkConfigs" : { - "maps" : { - "amap" : { - "appkey_ios" : "0a3202688624938fd5d2f37b52c30d5d", - "appkey_android" : "0354f5ddc11e2ea76c5aac647f44d945", - "name" : "amapIvoVHpJR" - } - }, - "payment" : { - "weixin" : { - "__platform__" : [ "ios", "android" ], - "appid" : "wx2e8f79ff281284f5", - "UniversalLinks" : "https://shop.lihaink.cn/" - } - }, - "share" : { - "weixin" : { - "appid" : "wx2e8f79ff281284f5", - "UniversalLinks" : "https://shop.lihaink.cn/" - } - }, - "geolocation" : { - "amap" : { - "name" : "amapIvoVHpJR", - "__platform__" : [ "ios", "android" ], - "appkey_ios" : "0a3202688624938fd5d2f37b52c30d5d", - "appkey_android" : "0354f5ddc11e2ea76c5aac647f44d945" - } - }, - "push" : {}, - "oauth" : { - "weixin" : { - "appid" : "wx2e8f79ff281284f5", - "UniversalLinks" : "https://shop.lihaink.cn/" - } - }, - "ad" : {} - }, - "icons" : { - "android" : { - "hdpi" : "unpackage/res/icons/72x72.png", - "xhdpi" : "unpackage/res/icons/96x96.png", - "xxhdpi" : "unpackage/res/icons/144x144.png", - "xxxhdpi" : "unpackage/res/icons/192x192.png" - }, - "ios" : { - "appstore" : "unpackage/res/icons/1024x1024.png", - "ipad" : { - "app" : "unpackage/res/icons/76x76.png", - "app@2x" : "unpackage/res/icons/152x152.png", - "notification" : "unpackage/res/icons/20x20.png", - "notification@2x" : "unpackage/res/icons/40x40.png", - "proapp@2x" : "unpackage/res/icons/167x167.png", - "settings" : "unpackage/res/icons/29x29.png", - "settings@2x" : "unpackage/res/icons/58x58.png", - "spotlight" : "unpackage/res/icons/40x40.png", - "spotlight@2x" : "unpackage/res/icons/80x80.png" - }, - "iphone" : { - "app@2x" : "unpackage/res/icons/120x120.png", - "app@3x" : "unpackage/res/icons/180x180.png", - "notification@2x" : "unpackage/res/icons/40x40.png", - "notification@3x" : "unpackage/res/icons/60x60.png", - "settings@2x" : "unpackage/res/icons/58x58.png", - "settings@3x" : "unpackage/res/icons/87x87.png", - "spotlight@2x" : "unpackage/res/icons/80x80.png", - "spotlight@3x" : "unpackage/res/icons/120x120.png" - } - } - }, - "splashscreen" : { - "useOriginalMsgbox" : true, - "androidStyle" : "common" - } - }, - "nativePlugins" : { - "JG-JCore" : { - "JPUSH_APPKEY_IOS" : "8a5efd65cda14fafa6e64ad3", - "JPUSH_CHANNEL_IOS" : "8a5efd65cda14fafa6e64ad3", - "JPUSH_APPKEY_ANDROID" : "b5f679f4357018605ea6fd2e", - "JPUSH_CHANNEL_ANDROID" : "", - "__plugin_info__" : { - "name" : "JG-JCore", - "description" : "极光推送JCore插件", - "platforms" : "Android,iOS", - "url" : "", - "android_package_name" : "uni.UNI3A527D1", - "ios_bundle_id" : "", - "isCloud" : false, - "bought" : -1, - "pid" : "", - "parameters" : { - "JPUSH_APPKEY_IOS" : { - "des" : "[iOS]极光portal配置应用信息时分配的AppKey", - "key" : "JCore:APP_KEY", - "value" : "daebe19b547c43128796a078" - }, - "JPUSH_CHANNEL_IOS" : { - "des" : "[iOS]用于统计分发渠道,不需要可填默认值developer-default", - "key" : "JCore:CHANNEL", - "value" : "" - }, - "JPUSH_APPKEY_ANDROID" : { - "des" : "[Android]极光portal配置应用信息时分配的AppKey", - "key" : "JPUSH_APPKEY", - "value" : "" - }, - "JPUSH_CHANNEL_ANDROID" : { - "des" : "[Android]用于统计分发渠道,不需要可填默认值developer-default", - "key" : "JPUSH_CHANNEL", - "value" : "" - } - } - } - }, - "JG-JPush" : { - "JPUSH_ISPRODUCTION_IOS" : "true", - "JPUSH_ADVERTISINGID_IOS" : "", - "JPUSH_DEFAULTINITJPUSH_IOS" : "true", - "JPUSH_OPPO_APPKEY" : "", - "JPUSH_OPPO_APPID" : "", - "JPUSH_OPPO_APPSECRET" : "", - "JPUSH_VIVO_APPKEY" : "", - "JPUSH_VIVO_APPID" : "", - "JPUSH_MEIZU_APPKEY" : "", - "JPUSH_MEIZU_APPID" : "", - "JPUSH_XIAOMI_APPKEY" : "", - "JPUSH_XIAOMI_APPID" : "", - "__plugin_info__" : { - "name" : "JG-JPush", - "description" : "极光推送Hbuilder插件", - "platforms" : "Android,iOS", - "url" : "", - "android_package_name" : "uni.UNI3A527D1", - "ios_bundle_id" : "", - "isCloud" : false, - "bought" : -1, - "pid" : "", - "parameters" : { - "JPUSH_ISPRODUCTION_IOS" : { - "des" : "[iOS]是否是生产环境,是填true,不是填false或者不填", - "key" : "JPush:ISPRODUCTION", - "value" : "" - }, - "JPUSH_ADVERTISINGID_IOS" : { - "des" : "[iOS]广告标识符(IDFA)如果不需要使用IDFA,可不填", - "key" : "JPush:ADVERTISINGID", - "value" : "" - }, - "JPUSH_DEFAULTINITJPUSH_IOS" : { - "des" : "[iOS]是否默认初始化,是填true,不是填false或者不填", - "key" : "JPush:DEFAULTINITJPUSH", - "value" : "" - }, - "JPUSH_OPPO_APPKEY" : { - "des" : "厂商OPPO-appkey,示例:OP-12345678", - "key" : "OPPO_APPKEY", - "value" : "" - }, - "JPUSH_OPPO_APPID" : { - "des" : "厂商OPPO-appId,示例:OP-12345678", - "key" : "OPPO_APPID", - "value" : "" - }, - "JPUSH_OPPO_APPSECRET" : { - "des" : "厂商OPPO-appSecret,示例:OP-12345678", - "key" : "OPPO_APPSECRET", - "value" : "" - }, - "JPUSH_VIVO_APPKEY" : { - "des" : "厂商VIVO-appkey,示例:12345678", - "key" : "com.vivo.push.api_key", - "value" : "" - }, - "JPUSH_VIVO_APPID" : { - "des" : "厂商VIVO-appId,示例:12345678", - "key" : "com.vivo.push.app_id", - "value" : "" - }, - "JPUSH_MEIZU_APPKEY" : { - "des" : "厂商MEIZU-appKey,示例:MZ-12345678", - "key" : "MEIZU_APPKEY", - "value" : "" - }, - "JPUSH_MEIZU_APPID" : { - "des" : "厂商MEIZU-appId,示例:MZ-12345678", - "key" : "MEIZU_APPID", - "value" : "" - }, - "JPUSH_XIAOMI_APPKEY" : { - "des" : "厂商XIAOMI-appKey,示例:MI-12345678", - "key" : "XIAOMI_APPKEY", - "value" : "" - }, - "JPUSH_XIAOMI_APPID" : { - "des" : "厂商XIAOMI-appId,示例:MI-12345678", - "key" : "XIAOMI_APPID", - "value" : "" - } - } - } - } - } - }, - /* 快应用特有相关 */ - "quickapp" : {}, - /* 小程序特有相关 */ - "mp-weixin" : { - "appid" : "wx5fb1cc8edb3f8baa", - "setting" : { - "urlCheck" : false, - "minified" : true, - "postcss" : true, - "es6" : true - }, - "permission" : { - "scope.userLocation" : { - "desc" : "获取您的位置" - } - }, - "requiredPrivateInfos" : [ "getLocation", "chooseAddress" ], - "usingComponents" : true, - "__usePrivacyCheck__" : true - }, - "mp-alipay" : { - "usingComponents" : true - }, - "mp-baidu" : { - "usingComponents" : true - }, - "mp-toutiao" : { - "usingComponents" : true - }, - "h5" : { - "devServer" : { - "https" : false - }, - "router" : { - "mode" : "history", - "base" : "" - }, - "domain" : "", - "sdkConfigs" : { - "maps" : { - "qqmap" : { - "key" : "SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7" - } - } - }, - "title" : "加载中...", - "template" : "template.h5.html", - "optimization" : { - "treeShaking" : { - "enable" : true - } - } - } -} + "name": "惠农生活", + "appid": "__UNI__3A527D1", + "description": "", + "versionName": "2.0.37", + "versionCode": 2037, + "transformPx": false, + /* 5+App特有相关 */ + "app-plus": { + "titleNView": true, + "usingComponents": true, + "nvueCompiler": "uni-app", + "nvueStyleCompiler": "uni-app", + "compilerVersion": 3, + "compatible": { + "ignoreVersion": true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持 + }, + "splashscreen": { + "alwaysShowBeforeRender": false, + "waiting": false, + "autoclose": true, + "delay": 0 + }, + /* 模块配置 */ + "modules": { + "VideoPlayer": {}, + "OAuth": {}, + "Payment": {}, + "Share": {}, + "iBeacon": {}, + "Maps": {}, + "Geolocation": {}, + "UniMP": { + "description": "uni小程序" + }, + "Push": {}, + "Barcode": {}, + "Camera": {} + }, + "safearea": { + "bottom": { + "offset": "none" + } + }, + /* 应用发布信息 */ + "distribute": { + /* android打包配置 */ + "android": { + "permissions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "abiFilters": ["armeabi-v7a", "arm64-v8a", "x86"], + "permissionExternalStorage": { + "request": "none", + "prompt": "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。" + }, + "permissionPhoneState": { + "request": "none" //拨打电话权限关闭 + }, + "minSdkVersion": 23, + "targetSdkVersion": 30 + }, + /* ios打包配置 */ + "ios": { + "privacyDescription": { + "NSPhotoLibraryUsageDescription": "上传用户头像保存分享海报", + "NSPhotoLibraryAddUsageDescription": "上传用户头像保存分享海报", + "NSCameraUsageDescription": "上传用户头像保存分享海报", + "NSLocationWhenInUseUsageDescription": "根据客户地理位置推荐最近门店", + "NSLocationAlwaysUsageDescription": "根据客户地理位置推荐最近门店" + }, + "idfa": false, + "dSYMs": false + }, + /* SDK配置 */ + "sdkConfigs": { + "maps": { + "amap": { + "appkey_ios": "0a3202688624938fd5d2f37b52c30d5d", + "appkey_android": "0354f5ddc11e2ea76c5aac647f44d945", + "name": "amapIvoVHpJR" + } + }, + "payment": { + "weixin": { + "__platform__": ["ios", "android"], + "appid": "wx2e8f79ff281284f5", + "UniversalLinks": "https://shop.lihaink.cn/" + } + }, + "share": { + "weixin": { + "appid": "wx2e8f79ff281284f5", + "UniversalLinks": "https://shop.lihaink.cn/" + } + }, + "geolocation": { + "amap": { + "name": "amapIvoVHpJR", + "__platform__": ["ios", "android"], + "appkey_ios": "0a3202688624938fd5d2f37b52c30d5d", + "appkey_android": "0354f5ddc11e2ea76c5aac647f44d945" + } + }, + "push": {}, + "oauth": { + "weixin": { + "appid": "wx2e8f79ff281284f5", + "UniversalLinks": "https://shop.lihaink.cn/" + } + }, + "ad": {} + }, + "icons": { + "android": { + "hdpi": "unpackage/res/icons/72x72.png", + "xhdpi": "unpackage/res/icons/96x96.png", + "xxhdpi": "unpackage/res/icons/144x144.png", + "xxxhdpi": "unpackage/res/icons/192x192.png" + }, + "ios": { + "appstore": "unpackage/res/icons/1024x1024.png", + "ipad": { + "app": "unpackage/res/icons/76x76.png", + "app@2x": "unpackage/res/icons/152x152.png", + "notification": "unpackage/res/icons/20x20.png", + "notification@2x": "unpackage/res/icons/40x40.png", + "proapp@2x": "unpackage/res/icons/167x167.png", + "settings": "unpackage/res/icons/29x29.png", + "settings@2x": "unpackage/res/icons/58x58.png", + "spotlight": "unpackage/res/icons/40x40.png", + "spotlight@2x": "unpackage/res/icons/80x80.png" + }, + "iphone": { + "app@2x": "unpackage/res/icons/120x120.png", + "app@3x": "unpackage/res/icons/180x180.png", + "notification@2x": "unpackage/res/icons/40x40.png", + "notification@3x": "unpackage/res/icons/60x60.png", + "settings@2x": "unpackage/res/icons/58x58.png", + "settings@3x": "unpackage/res/icons/87x87.png", + "spotlight@2x": "unpackage/res/icons/80x80.png", + "spotlight@3x": "unpackage/res/icons/120x120.png" + } + } + }, + "splashscreen": { + "useOriginalMsgbox": true, + "androidStyle": "common" + } + }, + "nativePlugins": { + "JG-JCore": { + "JPUSH_APPKEY_IOS": "8a5efd65cda14fafa6e64ad3", + "JPUSH_CHANNEL_IOS": "8a5efd65cda14fafa6e64ad3", + "JPUSH_APPKEY_ANDROID": "b5f679f4357018605ea6fd2e", + "JPUSH_CHANNEL_ANDROID": "", + "__plugin_info__": { + "name": "JG-JCore", + "description": "极光推送JCore插件", + "platforms": "Android,iOS", + "url": "", + "android_package_name": "uni.UNI3A527D1", + "ios_bundle_id": "", + "isCloud": false, + "bought": -1, + "pid": "", + "parameters": { + "JPUSH_APPKEY_IOS": { + "des": "[iOS]极光portal配置应用信息时分配的AppKey", + "key": "JCore:APP_KEY", + "value": "daebe19b547c43128796a078" + }, + "JPUSH_CHANNEL_IOS": { + "des": "[iOS]用于统计分发渠道,不需要可填默认值developer-default", + "key": "JCore:CHANNEL", + "value": "" + }, + "JPUSH_APPKEY_ANDROID": { + "des": "[Android]极光portal配置应用信息时分配的AppKey", + "key": "JPUSH_APPKEY", + "value": "" + }, + "JPUSH_CHANNEL_ANDROID": { + "des": "[Android]用于统计分发渠道,不需要可填默认值developer-default", + "key": "JPUSH_CHANNEL", + "value": "" + } + } + } + }, + "JG-JPush": { + "JPUSH_ISPRODUCTION_IOS": "true", + "JPUSH_ADVERTISINGID_IOS": "", + "JPUSH_DEFAULTINITJPUSH_IOS": "true", + "JPUSH_OPPO_APPKEY": "", + "JPUSH_OPPO_APPID": "", + "JPUSH_OPPO_APPSECRET": "", + "JPUSH_VIVO_APPKEY": "", + "JPUSH_VIVO_APPID": "", + "JPUSH_MEIZU_APPKEY": "", + "JPUSH_MEIZU_APPID": "", + "JPUSH_XIAOMI_APPKEY": "", + "JPUSH_XIAOMI_APPID": "", + "__plugin_info__": { + "name": "JG-JPush", + "description": "极光推送Hbuilder插件", + "platforms": "Android,iOS", + "url": "", + "android_package_name": "uni.UNI3A527D1", + "ios_bundle_id": "", + "isCloud": false, + "bought": -1, + "pid": "", + "parameters": { + "JPUSH_ISPRODUCTION_IOS": { + "des": "[iOS]是否是生产环境,是填true,不是填false或者不填", + "key": "JPush:ISPRODUCTION", + "value": "" + }, + "JPUSH_ADVERTISINGID_IOS": { + "des": "[iOS]广告标识符(IDFA)如果不需要使用IDFA,可不填", + "key": "JPush:ADVERTISINGID", + "value": "" + }, + "JPUSH_DEFAULTINITJPUSH_IOS": { + "des": "[iOS]是否默认初始化,是填true,不是填false或者不填", + "key": "JPush:DEFAULTINITJPUSH", + "value": "" + }, + "JPUSH_OPPO_APPKEY": { + "des": "厂商OPPO-appkey,示例:OP-12345678", + "key": "OPPO_APPKEY", + "value": "" + }, + "JPUSH_OPPO_APPID": { + "des": "厂商OPPO-appId,示例:OP-12345678", + "key": "OPPO_APPID", + "value": "" + }, + "JPUSH_OPPO_APPSECRET": { + "des": "厂商OPPO-appSecret,示例:OP-12345678", + "key": "OPPO_APPSECRET", + "value": "" + }, + "JPUSH_VIVO_APPKEY": { + "des": "厂商VIVO-appkey,示例:12345678", + "key": "com.vivo.push.api_key", + "value": "" + }, + "JPUSH_VIVO_APPID": { + "des": "厂商VIVO-appId,示例:12345678", + "key": "com.vivo.push.app_id", + "value": "" + }, + "JPUSH_MEIZU_APPKEY": { + "des": "厂商MEIZU-appKey,示例:MZ-12345678", + "key": "MEIZU_APPKEY", + "value": "" + }, + "JPUSH_MEIZU_APPID": { + "des": "厂商MEIZU-appId,示例:MZ-12345678", + "key": "MEIZU_APPID", + "value": "" + }, + "JPUSH_XIAOMI_APPKEY": { + "des": "厂商XIAOMI-appKey,示例:MI-12345678", + "key": "XIAOMI_APPKEY", + "value": "" + }, + "JPUSH_XIAOMI_APPID": { + "des": "厂商XIAOMI-appId,示例:MI-12345678", + "key": "XIAOMI_APPID", + "value": "" + } + } + } + } + } + }, + /* 快应用特有相关 */ + "quickapp": {}, + /* 小程序特有相关 */ + "mp-weixin": { + "appid": "wx5fb1cc8edb3f8baa", + "setting": { + "urlCheck": false, + "minified": true, + "postcss": true, + "es6": true + }, + "permission": { + "scope.userLocation": { + "desc": "获取您的位置" + } + }, + "requiredPrivateInfos": ["getLocation", "chooseAddress"], + "usingComponents": true, + "__usePrivacyCheck__": true + }, + "mp-alipay": { + "usingComponents": true + }, + "mp-baidu": { + "usingComponents": true + }, + "mp-toutiao": { + "usingComponents": true + }, + "h5": { + "devServer": { + "https": false + }, + "router": { + "mode": "history", + "base": "" + }, + "domain": "", + "sdkConfigs": { + "maps": { + "qqmap": { + "key": "SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7" + } + } + }, + "title": "加载中...", + "template": "template.h5.html", + "optimization": { + "treeShaking": { + "enable": true + } + } + } +} \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index 8405a05..d692330 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -522,18 +522,26 @@ diyId: 0, preview: false, isSupport: true, + isIndexClick: true, + scrollTop: 0 }; }, onTabItemTap(e) { - uni.pageScrollTo({ - scrollTop: 0, - duration: 300 - }); + if (this.isIndexClick) { + uni.pageScrollTo({ + scrollTop: 0, + duration: 300 + }); + } else { + this.isIndexClick = true; + } }, // 滚动监听 onPageScroll(e) { + this.isIndexClick = true; + this.scrollTop = e.scrollTop; this.isFixed = e.scrollTop > 40; if (this.isHeaderSerch) { let isScroll = false @@ -545,7 +553,6 @@ // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件 uni.$emit('scroll'); - if (e.scrollTop >= 100) { uni.setTabBarItem({ index: 0, @@ -612,7 +619,8 @@ this.activeRouter = '/' + curRoute }, onShow() { - let that = this + let that = this; + that.isIntegral = uni.getStorageSync('isIntegral') // #ifdef APP-PLUS if (that.appUpdate.openUpgrade == '1') { @@ -628,6 +636,8 @@ that.isScrolled = res[0].top <= -60 }) }) + this.isIndexClick = false; + if (this.isLogin) { this.getUserInfo(); } diff --git a/pages/store/home/index.vue b/pages/store/home/index.vue index b0502f7..803e8aa 100644 --- a/pages/store/home/index.vue +++ b/pages/store/home/index.vue @@ -2,7 +2,6 @@ - - + @@ -151,11 +150,28 @@ - + + + + + + + {{item.cate_name}} + + + + + + + + :style="{'width':'calc(100vw - 152rpx)','padding-top':(!!asideCurr?'94rpx' :'')}"> @@ -197,7 +213,8 @@ - + {{loadTitle}} @@ -224,7 +241,8 @@ - + {{loadTitle}} @@ -373,7 +391,7 @@ navShow: false, navActive: 0, diyActive: 0, - tabActive: '', // 底部切换 + tabActive: 3, // 底部切换 isCoupon: 0, keyword: '', order: '', @@ -470,7 +488,11 @@ asideCurr: '', CartCount: 0, navHeight: 0, - listTop: 0 + listTop: 0, + mer_type: '', //区分云仓 + secondTabList: [], + secondTabCurr: '', //二级分类 + isChangeSecTabStyle: false } }, computed: { @@ -527,6 +549,7 @@ break; case 7: this.resetParmas(); + this.getMerClassifly(); this.goods = []; this.getGoods(); break; @@ -557,8 +580,9 @@ } } // #endif + // 店铺详情 this.getStore(); - this.diyData(); + // this.diyData(); shareScence(this.currSpid, this.isLogin); this.initHeight(); @@ -579,6 +603,8 @@ }) this.getMerClassifly(); + + // 购物车 this.getCart(); }, @@ -617,31 +643,97 @@ getCartCounts({ sale_type: this.where.sale_type }).then(res => { - console.log(res) that.CartCount = res.data[0].count; }); }, // 修改菜单 onChangeAsideMenu(e) { + // 获取二级分类 + this.getMerClassifly(e) this.asideCurr = e; this.resetParmas(); this.goods = []; this.loadend = false; + //重置二级菜单 + this.secondTabCurr = ''; + this.isChangeSecTabStyle = false; + }, + + // 获取分类 + getMerClassifly(pid) { + const param = { + mer_type: 2, + sale_type: this.where.sale_type, + mer_id: this.id, + mer_type: '', + pid: pid + }; + + // 云商品(不查询分类下边没有商品的分类) + if (this.tabActive == 7) { + param.mer_type = 1; + } + + //一般商品(不查询分类下边没有商品的分类) + if (this.tabActive == 3) { + param.mer_type = 2; + } + + getCategoryIndexList(param).then(res => { + //二级分类 + if (pid) { + this.secondTabList = [{ + cate_name: '全部', + store_category_id: '' + }, ...res.data]; + } else { //一级分类 + this.asideMenu = [{ + cate_name: '全部', + store_category_id: '' + }, ...res.data]; + } + this.getGoods(); + }) + }, + + // 二级分类 + onSecondTabChange(e) { + this.isChangeSecTabStyle = false; + this.secondTabCurr = e; + this.resetParmas(); + this.goods = []; + this.loadend = false; this.getGoods(); }, - // 获取分类 - getMerClassifly() { - getCategoryIndexList({ - mer_type: 2, - sale_type: this.where.sale_type - }).then(res => { - this.asideMenu = [{ - cate_name: '全部', - store_category_id: '' - }, ...res.data]; - }) + // 商铺底部切换 + tab: function(param) { + if (param == 9) return uni.switchTab({ + url: "/pages/order_addcart/order_addcart" + }); + + this.tabActive = param; + this.goodsLoading = this.loadend = this.loading = false; + + // 底部tab切换 + this.secondTabCurr = ''; + this.secondTabList = []; + this.asideCurr = ''; + this.asideMenu = []; + this.loadend = false; + this.getMerClassifly(); + }, + + // 二级类目样式 + onChangeSecTabStyle() { + this.isChangeSecTabStyle = !this.isChangeSecTabStyle; + }, + + // 商铺首页滚动 navbar 吸顶 + scrollHome: function(e) { + // uni.$emit('scroll'); + // this.navShow = e.detail.scrollTop >= 50; }, navTo(url) { @@ -862,7 +954,6 @@ }, // 获取商铺商品 getGoods: function() { - console.log(2) let that = this; if (that.loadend) return; if (that.loading) return; @@ -870,7 +961,11 @@ that.goodsLoading = true; that.loadTitle = ''; - that.where.cate_pid = that.asideCurr; + + if (that.secondTabCurr) //有二级查二级 + that.where.cate_pid = that.secondTabCurr; + else //无二级查一级 + that.where.cate_pid = that.asideCurr; if (this.tabActive == 7) getStoreCloudGoods(that.id, that.where).then(res => { that.goodsLoading = false; @@ -1079,11 +1174,6 @@ } }) }, - // 商铺首页滚动 navbar 吸顶 - scrollHome: function(e) { - // uni.$emit('scroll'); - // this.navShow = e.detail.scrollTop >= 50; - }, goback: function() { uni.navigateBack(); @@ -1095,16 +1185,6 @@ }); }, - // 商铺底部切换 - tab: function(param) { - console.log(param) - if (param == 9) return uni.switchTab({ - url: "/pages/order_addcart/order_addcart" - }) - this.tabActive = param; - this.goodsLoading = this.loadend = this.loading = false - }, - resetParmas() { this.navActive = 0; this.where = { @@ -1112,7 +1192,8 @@ keyword: '', page: 1, limit: 30, - sale_type: this.where.sale_type + sale_type: this.where.sale_type, + cate_pid: '' } }, @@ -1163,6 +1244,7 @@ } }, onPageScroll() { + this.isChangeSecTabStyle = false; uni.$emit('scroll'); }, onPullDownRefresh() { @@ -1177,6 +1259,56 @@