diff --git a/components/interact-fixed/interact-fixed.vue b/components/interact-fixed/interact-fixed.vue index b03a64f..1b9ad02 100644 --- a/components/interact-fixed/interact-fixed.vue +++ b/components/interact-fixed/interact-fixed.vue @@ -289,21 +289,25 @@ export default { }) }, checkHas(){ - if(this.type>0){ - apiPraises.has(this.type,this.data.id).then(rs=>{ - if(rs.status==200 && rs.result){ - this.isPraise=true; - }else{ - this.isPraise=false; - } - }); - apiFavorites.has(this.type,this.data.id).then(rs=>{ - if(rs.status==200 && rs.result){ - this.isFavorite=true; - }else{ - this.isFavorite=false; - } - }) + if(this.type>0 && this.data.id){ + if(this.praises){ + apiPraises.has(this.type,this.data.id).then(rs=>{ + if(rs.status==200 && rs.result){ + this.isPraise=true; + }else{ + this.isPraise=false; + } + }); + } + if(this.favorites){ + apiFavorites.has(this.type,this.data.id).then(rs=>{ + if(rs.status==200 && rs.result){ + this.isFavorite=true; + }else{ + this.isFavorite=false; + } + }) + } } }, submit(){ diff --git a/config/index.js b/config/index.js index 44b5335..364e637 100644 --- a/config/index.js +++ b/config/index.js @@ -9,10 +9,23 @@ let fileUrl=''; let version=1; if(process.env.NODE_ENV === 'development'){ + //本地开发环境 apiBaseUrl = '/systemapi'; oldApiBaseUrl = '/uboeApi'; fileUrl = 'http://localhost:9090/cdn/upload'; loginPath='/pages/login/login'; +}else if(process.env.NODE_ENV === 'preview'){ + // 预发布环境,当前配置未使用上 + apiBaseUrl = '/systemapi'; + oldApiBaseUrl = '/uboeApi'; + fileUrl = 'https://u-pre.boe.com/upload'; + loginPath='https://u-pre.boe.com/m/preview'; +}else if(process.env.NODE_ENV === 'testing'){ + // 测试环境 + apiBaseUrl = '/systemapi'; + oldApiBaseUrl = '/uboeApi'; + fileUrl = 'https://u-pre.boe.com/upload'; + loginPath='https://u-pre.boe.com/m/testing'; }else{ // 生产环境 apiBaseUrl = '/systemapi'; diff --git a/package.json b/package.json new file mode 100644 index 0000000..80e4f21 --- /dev/null +++ b/package.json @@ -0,0 +1,42 @@ +{ + "name": "mobile", + "version": "1.0.0", + "description": "移动端代码", + "main": "main.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://codeup.aliyun.com/6265f483e4166464dc2f9c14/boeu/mobile.git" + }, + "keywords": [], + "author": "", + "license": "ISC", + "uni-app": { + "scripts": { + "h5:testing": { + "BROWSER": "Chrome", + "title": "build:testing", + "env": { + "UNI_PLATFORM": "h5", + "ENV_TYPE": "testing" + }, + "define": { + + } + }, + "h5:preview": { + "BROWSER": "Chrome", + "title": "build:preview", + "env": { + "UNI_PLATFORM": "h5", + "ENV_TYPE": "preview" + }, + "define": { + + } + } + } + } +} diff --git a/pages/index/index.vue b/pages/index/index.vue index 79d38b0..0bd5cd0 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -196,6 +196,15 @@ + + + + + × + + + +