From 0a13a11ec6eed1c68c5c38bcb96c562dc991e2f7 Mon Sep 17 00:00:00 2001 From: Gao xiaosong <704041637@qq.com> Date: Sun, 7 Nov 2021 23:00:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=88=87=E6=8D=A2=E6=97=A0=E6=95=B0=E6=8D=AE,?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E6=95=B0=E6=8D=AE=E9=87=8D=E5=A4=8D=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hbuilderx/launch.json | 15 +- manifest.json | 350 +++++++++++++++++---------------- pages/shop/GoodsList/index.vue | 21 +- utils/request.js | 9 +- 4 files changed, 210 insertions(+), 185 deletions(-) diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 501e01c..bfc78ae 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -2,10 +2,15 @@ // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 "version": "0.0", "configurations": [{ - "type": "uniCloud", - "default": { - "launchtype": "remote" - } - } + "default" : + { + "launchtype" : "remote" + }, + "h5" : + { + "launchtype" : "remote" + }, + "type" : "uniCloud" + } ] } diff --git a/manifest.json b/manifest.json index 4335985..54bbd88 100644 --- a/manifest.json +++ b/manifest.json @@ -1,181 +1,191 @@ { - "name" : "yshopmall", - "appid" : "__UNI__C7A519E", - "description" : "", - "versionName" : "1.0.1", - "versionCode" : 1, - "transformPx" : false, - /* 5+App特有相关 */ - "app-plus" : { - "usingComponents" : true, - "nvueCompiler" : "uni-app", - "compilerVersion" : 3, - "splashscreen" : { - "alwaysShowBeforeRender" : true, - "waiting" : false, - "autoclose" : true, - "delay" : 0 + "name": "yshopmall", + "appid": "__UNI__C7A519E", + "description": "", + "versionName": "1.0.1", + "versionCode": 1, + "transformPx": false, + /* 5+App特有相关 */ + "app-plus": { + "usingComponents": true, + "nvueCompiler": "uni-app", + "compilerVersion": 3, + "splashscreen": { + "alwaysShowBeforeRender": true, + "waiting": false, + "autoclose": true, + "delay": 0 + }, + /* 模块配置 */ + "modules": { + "OAuth": {}, + "Payment": {}, + "Share": {}, + "Geolocation": {} + }, + /* 应用发布信息 */ + "distribute": { + /* android打包配置 */ + "android": { + "permissions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + /* ios打包配置 */ + "ios": {}, + /* SDK配置 */ + "sdkConfigs": { + "oauth": { + "weixin": { + "appid": "wx7c84ede33062d1e4", + "appsecret": "c47ef66d3311194da44e60387d5c1abd", + "UniversalLinks": "https://yixiang.co/app/" + } }, - /* 模块配置 */ - "modules" : { - "OAuth" : {}, - "Payment" : {}, - "Share" : {}, - "Geolocation" : {} + "payment": { + "weixin": { + "appid": "wx7c84ede33062d1e4", + "UniversalLinks": "https://yixiang.co/app/" + } }, - /* 应用发布信息 */ - "distribute" : { - /* android打包配置 */ - "android" : { - "permissions" : [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ] - }, - /* ios打包配置 */ - "ios" : {}, - /* SDK配置 */ - "sdkConfigs" : { - "oauth" : { - "weixin" : { - "appid" : "wx7c84ede33062d1e4", - "appsecret" : "c47ef66d3311194da44e60387d5c1abd", - "UniversalLinks" : "https://yixiang.co/app/" - } - }, - "payment" : { - "weixin" : { - "appid" : "wx7c84ede33062d1e4", - "UniversalLinks" : "https://yixiang.co/app/" - } - }, - "share" : { - "weixin" : { - "appid" : "wx7c84ede33062d1e4", - "UniversalLinks" : "https://yixiang.co/app/" - } - }, - "ad" : {}, - "geolocation" : {} - }, - "splashscreen" : { - "ios" : { - "iphone" : { - "portrait-896h@3x" : "splash/1242+2688.png", - "portrait-896h@2x" : "splash/828+1792.png", - "iphonex" : "splash/1125+2436.png", - "retina55" : "splash/1142+2208.png", - "retina47" : "splash/750+1334.png", - "retina40" : "splash/640+1136.png", - "retina35" : "splash/640+960.png" - } - }, - "android" : { - "hdpi" : "splash/480+762.png", - "xhdpi" : "splash/720+1242.png", - "xxhdpi" : "splash/1080+1882.png" - }, - "iosStyle" : "common" - }, - "icons" : { - "android" : { - "hdpi" : "icons/72x72.png", - "xhdpi" : "icons/96x96.png", - "xxhdpi" : "icons/144x144.png", - "xxxhdpi" : "icons/192x192.png" - }, - "ios" : { - "appstore" : "icons/1024x1024.png", - "ipad" : { - "app" : "icons/76x76.png", - "app@2x" : "icons/152x152.png", - "notification" : "icons/20x20.png", - "notification@2x" : "icons/40x40.png", - "proapp@2x" : "icons/167x167.png", - "settings" : "icons/29x29.png", - "settings@2x" : "icons/58x58.png", - "spotlight" : "icons/40x40.png", - "spotlight@2x" : "icons/80x80.png" - }, - "iphone" : { - "app@2x" : "icons/120x120.png", - "app@3x" : "icons/180x180.png", - "notification@2x" : "icons/40x40.png", - "notification@3x" : "icons/60x60.png", - "settings@2x" : "icons/58x58.png", - "settings@3x" : "icons/87x87.png", - "spotlight@2x" : "icons/80x80.png", - "spotlight@3x" : "icons/120x120.png" - } - } - } - } - }, - "quickapp" : {}, - "mp-weixin" : { - "appid" : "wx604d2ea4702620d2", - "setting" : { - "urlCheck" : false + "share": { + "weixin": { + "appid": "wx7c84ede33062d1e4", + "UniversalLinks": "https://yixiang.co/app/" + } }, - "usingComponents" : true, - "permission" : { - "scope.userLocation" : { - "desc" : "你的位置信息将用于小程序位置接口的效果展示" - } + "ad": {}, + "geolocation": {} + }, + "splashscreen": { + "ios": { + "iphone": { + "portrait-896h@3x": "splash/1242+2688.png", + "portrait-896h@2x": "splash/828+1792.png", + "iphonex": "splash/1125+2436.png", + "retina55": "splash/1142+2208.png", + "retina47": "splash/750+1334.png", + "retina40": "splash/640+1136.png", + "retina35": "splash/640+960.png" + } }, - "plugins" : { - // #ifdef MP-WEIXIN - "live-player-plugin" : { - "version" : "1.2.8", - "provider" : "wx2b03c6e691cd7370" - } + "android": { + "hdpi": "splash/480+762.png", + "xhdpi": "splash/720+1242.png", + "xxhdpi": "splash/1080+1882.png" + }, + "iosStyle": "common" + }, + "icons": { + "android": { + "hdpi": "icons/72x72.png", + "xhdpi": "icons/96x96.png", + "xxhdpi": "icons/144x144.png", + "xxxhdpi": "icons/192x192.png" + }, + "ios": { + "appstore": "icons/1024x1024.png", + "ipad": { + "app": "icons/76x76.png", + "app@2x": "icons/152x152.png", + "notification": "icons/20x20.png", + "notification@2x": "icons/40x40.png", + "proapp@2x": "icons/167x167.png", + "settings": "icons/29x29.png", + "settings@2x": "icons/58x58.png", + "spotlight": "icons/40x40.png", + "spotlight@2x": "icons/80x80.png" + }, + "iphone": { + "app@2x": "icons/120x120.png", + "app@3x": "icons/180x180.png", + "notification@2x": "icons/40x40.png", + "notification@3x": "icons/60x60.png", + "settings@2x": "icons/58x58.png", + "settings@3x": "icons/87x87.png", + "spotlight@2x": "icons/80x80.png", + "spotlight@3x": "icons/120x120.png" + } } + } + } + }, + "quickapp": {}, + "mp-weixin": { + "appid": "wx604d2ea4702620d2", + "setting": { + "urlCheck": false }, - // #endif - "mp-alipay" : { - "usingComponents" : true + "usingComponents": true, + "permission": { + "scope.userLocation": { + "desc": "你的位置信息将用于小程序位置接口的效果展示" + } }, - "mp-baidu" : { - "usingComponents" : true + "plugins": { + // #ifdef MP-WEIXIN + "live-player-plugin": { + "version": "1.2.8", + "provider": "wx2b03c6e691cd7370" + } + } + }, + // #endif + "mp-alipay": { + "usingComponents": true + }, + "mp-baidu": { + "usingComponents": true + }, + "mp-toutiao": { + "usingComponents": true + }, + "h5": { + "title": "yshop", + "devServer": { + "disableHostCheck": true, + "proxy": { + "/api": { + "target": "https://wxapi.yixiang.co", + "changeOrigin": true, + "secure": true, + "pathRewrite": { + "^/api": "/api" + } + } + } }, - "mp-toutiao" : { - "usingComponents" : true + "router": { + "mode": "history" }, - "h5" : { - "title" : "yshop", - "devServer" : { - "disableHostCheck" : true - }, - "router" : { - "mode" : "history" - }, - "sdkConfigs" : { - "maps" : { - "qqmap" : { - "key" : "" - } - } - }, - "domain" : "h5.yixiang.co" - } + "sdkConfigs": { + "maps": { + "qqmap": { + "key": "" + } + } + }, + "domain": "h5.yixiang.co" + } } diff --git a/pages/shop/GoodsList/index.vue b/pages/shop/GoodsList/index.vue index 4a828f7..cefa856 100644 --- a/pages/shop/GoodsList/index.vue +++ b/pages/shop/GoodsList/index.vue @@ -86,7 +86,6 @@ export default { const s = '', id = 0, title = '' - return { hostProduct: [], productList: [], @@ -127,8 +126,7 @@ export default { }) } }, - $yroute(to) { - }, + $yroute(to) {}, }, mounted: function() { const { s = '', id = 0, title = '', isIntegral = false } = this.$yroute.query @@ -143,8 +141,7 @@ export default { this.recommendLoading = true !this.loading && this.getProductList() }, - onHide() { - }, + onHide() {}, methods: { changeRecommendLoading(recommendLoading) { this.recommendLoading = recommendLoading @@ -173,6 +170,10 @@ export default { }) }, getProductList() { + if (this.loading) { + return + } + this.loading = true var that = this this.setWhere() const { s = '', id = 0, title = '' } = this.$yroute.query @@ -211,26 +212,30 @@ export default { }, //点击事件处理 set_where: function(index) { + const { s = '', id = 0, title = '', isIntegral = false } = this.$yroute.query + let that = this switch (index) { case 0: - return that.$yrouter.push({ - path: '/pages/shop/GoodsClass/index', - }) + this.where.keyword = '' + break case 1: if (that.price === 0) that.price = 1 else if (that.price === 1) that.price = 2 else if (that.price === 2) that.price = 0 that.stock = 0 + this.where.keyword = s break case 2: if (that.stock === 0) that.stock = 1 else if (that.stock === 1) that.stock = 2 else if (that.stock === 2) that.stock = 0 that.price = 0 + this.where.keyword = s break case 3: that.nows = !that.nows + this.where.keyword = s break default: break diff --git a/utils/request.js b/utils/request.js index bbe4574..e31f34f 100644 --- a/utils/request.js +++ b/utils/request.js @@ -60,15 +60,20 @@ function baseRequest(options) { // 合并传参过来的 headers // 如果接口需要登录,携带 token 去请求 +console.log(options) options.headers = { - ...options.headers, + ...options.headers, + // hahah: 'Bearer2 ', + } + if(options.method=='post'){ + options.headers.hahah='Bearer2 ' } if (options.login === true) { options.headers = { ...options.headers, - Authorization: 'Bearer ' + token, + Authorization: 'Bearer ' + token, } }