Commit 0df3ddeb authored by 夏彬's avatar 夏彬

添加按钮的disable组件并使用

parent 4e6eebb4
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
"dev": "cross-env NODE_ENV=development webpack-dev-server --watch -d --progress --color --open", "dev": "cross-env NODE_ENV=development webpack-dev-server --watch -d --progress --color --open",
"test": "cross-env NODE_ENV=test webpack --progress --hide-modules", "test": "cross-env NODE_ENV=test webpack --progress --hide-modules",
"prod": "cross-env NODE_ENV=production webpack --progress --hide-modules" "prod": "cross-env NODE_ENV=production webpack --progress --hide-modules"
}, },
"keywords": [ "keywords": [
"webpack" "webpack"
...@@ -48,6 +47,7 @@ ...@@ -48,6 +47,7 @@
"moment": "^2.13.0", "moment": "^2.13.0",
"video.js": "^5.11.9", "video.js": "^5.11.9",
"vue": "^2.0.8", "vue": "^2.0.8",
"vue-disabled": "^0.0.2",
"vue-router": "^2.5.3" "vue-router": "^2.5.3"
} }
} }
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<p><i v-show="!hasResult"></i>请填写手机号 <br/> 快查官方将 “第一时间” 为您提供服务</p> <p><i v-show="!hasResult"></i>请填写手机号 <br/> 快查官方将 “第一时间” 为您提供服务</p>
<div class="provide-phone"> <div class="provide-phone">
<input v-model="telephone" type="text" placeholder="请输入手机号"> <input v-model="telephone" type="text" placeholder="请输入手机号">
<button @click="missFeedback">提交</button> <button v-disabled="missFeedbackRuning" @click="missFeedback">提交</button>
</div> </div>
</div> </div>
...@@ -66,10 +66,14 @@ ...@@ -66,10 +66,14 @@
import weixinShare from '../utils/weixin-share'; import weixinShare from '../utils/weixin-share';
import shareImg from '../components/share-image'; import shareImg from '../components/share-image';
import api from '../utils/api'; import api from '../utils/api';
import VueDisabled from 'vue-disabled'
import Vue from 'vue'
Vue.use(VueDisabled);
export default { export default {
data() { data() {
return { return {
missFeedbackRuning: false,
hasResult: false, hasResult: false,
contact: '', contact: '',
content: '', content: '',
...@@ -164,20 +168,23 @@ ...@@ -164,20 +168,23 @@
if (this.telephone == '') { if (this.telephone == '') {
return false; return false;
} }
self.missFeedbackRuning = true;
api.post('feedback/add-miss', { api.post('feedback/add-miss', {
'contact': this.telephone, 'contact': this.telephone,
'brand-id': this.brandId, 'brand-id': this.brandId,
'category-id': this.categoryId, 'category-id': this.categoryId,
'code': this.code, 'code': this.code,
}).done(function (rep) { }).done(function (rep) {
if (!rep.status) { if (!rep.status) {
layer.alert(rep.message); layer.alert(rep.message);
} else { } else {
self.$router.push({path:"/"}); self.$router.push({path: "/"});
} }
}).fail(function () { self.missFeedbackRuning = false;
layer.alert('反馈错误'); }).fail(function () {
}); layer.alert('反馈错误');
self.missFeedbackRuning = false;
});
}, },
back() { back() {
history.back(); history.back();
...@@ -188,22 +195,22 @@ ...@@ -188,22 +195,22 @@
return false; return false;
} }
let self = this; let self = this;
api.post('feedback/add', { api.post('feedback/add', {
'content': this.content, 'content': this.content,
'contact': this.contact 'contact': this.contact
}).done(function (rep) { }).done(function (rep) {
if (!rep.status) { if (!rep.status) {
layer.alert(rep.message); layer.alert(rep.message);
} else { } else {
self.showFeedback = false; self.showFeedback = false;
self.contact = ''; self.contact = '';
self.content = ''; self.content = '';
} }
}).fail(function () { }).fail(function () {
layer.alert('反馈错误'); layer.alert('反馈错误');
}); });
}, },
thumbClick(way) { thumbClick(way) {
let self = this; let self = this;
...@@ -242,4 +249,6 @@ ...@@ -242,4 +249,6 @@
} }
} }
</script> </script>
<style>body{background-color: #f3f3f3}</style> <style>body {
\ No newline at end of file background-color: #f3f3f3
}</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment