按钮操作更新

master
橙橙楊 5 years ago committed by 潘啟华
parent 30227b541c
commit 88e36bcfe3
  1. 15
      src/common/config.js
  2. 9
      src/pages/waste_sorting/baike.vue
  3. 7
      src/pages/waste_sorting/query.vue

@ -5,8 +5,19 @@ export var config={
// 接口
interface:{
//图片解析
image_parse:"/api/BaiduImage.php?XDEBUG_SESSION_START=PHPSTORM",
image_parse:"/api/BaiduImage.php",
// 文本查询
text_query:"/api/QueryText.php?XDEBUG_SESSION_START=PHPSTORM"
text_query:"/api/QueryText.php"
}
}
export var getInterface=function(url){
if(process.env.NODE_ENV === 'development'){
console.log("开发环境,通过XDEBUG调试接口")
return config.server+url+"?XDEBUG_SESSION_START=PHPSTORM"
}else{
console.log('生产环境')
return config.server+url
}
}

@ -55,7 +55,7 @@
</template>
<script>
import {config} from 'common/config'
import {config,getInterface} from 'common/config'
export default {
@ -109,6 +109,7 @@
}
},
methods: {
getInterface:getInterface,
//
update_status: function () {
console.info("动画播放完毕")
@ -116,12 +117,12 @@
let that = this
setTimeout(function () {
that.button_text="自动收缩"
},1000)
},500)
setTimeout(function () {
that.disabled_button = true
that.show_button = false
that.hide_button = true
}, 2000)
}, 1000)
}else{
this.button_text="长按返回"
}
@ -136,7 +137,7 @@
console.info("选中" + group.name)
this.current_group = group.name
let that = this
let url = config.server + config.interface.text_query
let url = this.getInterface(config.interface.text_query)
console.info("文本查询接口地址:" + url)
uni.showLoading({
title:"加载中"

@ -43,7 +43,7 @@
</template>
<script>
import {config} from 'common/config'
import {config,getInterface} from 'common/config'
export default {
name: "query",
@ -56,6 +56,7 @@
}
},
methods: {
getInterface:getInterface,
getWasteSorting:function(waste_type){
switch (waste_type) {
case 1:return "可回收垃圾";
@ -72,7 +73,7 @@
console.info("文本查询值:" + this.textValue)
let that=this
if(this.textValue.length>0){
let url = config.server + config.interface.text_query
let url = this.getInterface(config.interface.text_query)
console.info("文本查询接口地址:"+url)
uni.request({
url:url,
@ -126,7 +127,7 @@
uni.showLoading({
title: "图片解析中"
})
let url = config.server + config.interface.image_parse
let url = that.getInterface(config.interface.image_parse)
console.info("图片解析接口地址:" + url)
uni.uploadFile({
url: url,

Loading…
Cancel
Save