Commit 5135c3d8 authored by 刘殿昕's avatar 刘殿昕

问答接口调整

parent 4682f556
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</div> </div>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<div v-if="cellItems.service_id != 0 && getSpecification" class="shopping_cell_specification"> <div v-if="cellItems.service_id != 0 && cellItems.service.request_spcs_info.spcs_type_1 && cellItems.service.request_spcs_info.spcs_type_1.length != 0" class="shopping_cell_specification">
<div class="shopping_cell_specification_val"> <div class="shopping_cell_specification_val">
<div class="shopping_cell_specification_val_specification"> <div class="shopping_cell_specification_val_specification">
计次收费:{{ getSpecification }} 计次收费:{{ getSpecification }}
...@@ -138,6 +138,8 @@ ...@@ -138,6 +138,8 @@
</div> </div>
</div> </div>
</div> </div>
<div v-else-if="cellItems.app_id != 0" class="shopping_cell_num">{{ cellItems.application.price }}金币/月</div>
<div v-else class="shopping_cell_num">{{ cellItems.service.request_spcs_info.spcs_type_2.single_money }}金币/月</div>
</el-col> </el-col>
<el-col :span="3" class="shopping_cell_num"> <el-col :span="3" class="shopping_cell_num">
<div v-if="cellIsService && specificationPop.spec_type == 1">不限时长</div> <div v-if="cellIsService && specificationPop.spec_type == 1">不限时长</div>
...@@ -152,7 +154,7 @@ ...@@ -152,7 +154,7 @@
</div> </div>
</el-col> </el-col>
<el-col :span="3" class="shopping_cell_num"> 200000000金币 </el-col> <el-col :span="3" class="shopping_cell_num"> {{ getSumMoney }}金币 </el-col>
<el-col :span="3" class="shopping_cell_options"> <el-col :span="3" class="shopping_cell_options">
<el-checkbox <el-checkbox
v-if="!readOnly" v-if="!readOnly"
...@@ -233,6 +235,11 @@ export default { ...@@ -233,6 +235,11 @@ export default {
getSpecification() { getSpecification() {
console.log() console.log()
}, },
getSumMoney() {
if (this.cellItems.app_id != 0) {
this.cellItems.application.price * this.cellItems.duration
}
}
}, },
mounted() {}, mounted() {},
methods: { methods: {
......
...@@ -257,13 +257,11 @@ export default { ...@@ -257,13 +257,11 @@ export default {
}); });
}, },
delQ() { delQ() {
let query = { let items = [];
items: [],
};
this.selected_date.forEach((item) => { this.selected_date.forEach((item) => {
query.items.push({ id: item.id, reason: this.reason_form.reason }); items.push({ id: item.id, reason: this.reason_form.reason });
}); });
this.$api.user.delQuestions(query).then((response) => { this.$api.user.delQuestions(items).then((response) => {
if (response.data.success == 1) { if (response.data.success == 1) {
this.$message({ this.$message({
message: "删除成功", message: "删除成功",
...@@ -273,13 +271,11 @@ export default { ...@@ -273,13 +271,11 @@ export default {
}); });
}, },
delA() { delA() {
let query = { let items = [];
items: [],
};
this.selected_date.forEach((item) => { this.selected_date.forEach((item) => {
query.items.push({ id: item.id, reason: this.reason_form.reason }); items.push({ id: item.id, reason: this.reason_form.reason });
}); });
this.$api.user.delAnswers(query).then((response) => { this.$api.user.delAnswers(items).then((response) => {
if (response.data.success == 1) { if (response.data.success == 1) {
this.$message({ this.$message({
message: "删除成功", message: "删除成功",
...@@ -367,7 +363,7 @@ export default { ...@@ -367,7 +363,7 @@ export default {
align: "left", align: "left",
type: "html", type: "html",
getHtml: (str) => { getHtml: (str) => {
return `<span style="color:#0f2683;font-weight:bold;width: 100%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;" title="${str.content}">${str.content}</span>`; return `<span style="color:#0f2683;font-weight:bold;width: 100%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;cursor: pointer;" title="${str.answer}" onclick="gotodetail(${str.question_id})">${str.answer}</span>`;
}, },
}, },
{ {
...@@ -376,19 +372,19 @@ export default { ...@@ -376,19 +372,19 @@ export default {
align: "left", align: "left",
type: "html", type: "html",
getHtml: (str) => { getHtml: (str) => {
return `<span style="width: 100%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;cursor: pointer;" title="${str.title}" onclick="gotodetail(${str.question_id})">${str.title}</span>`; return `<span style="width: 100%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;" title="${str.title}">${str.title}</span>`;
}, },
}, },
{ {
prop: "content", prop: "question_content",
label: "问题内容", label: "问题内容",
align: "left", align: "left",
type: "html", type: "html",
getHtml: (str) => { getHtml: (str) => {
return `<span style="width: 100%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;" title="${str.content.replace( return `<span style="width: 100%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;" title="${str.question_content.replace(
/<[^<>]+>/g, /<[^<>]+>/g,
"" ""
)}">${str.content.replace(/<[^<>]+>/g, "")}</span>`; )}">${str.question_content.replace(/<[^<>]+>/g, "")}</span>`;
}, },
}, },
{ {
......
...@@ -77,7 +77,11 @@ ...@@ -77,7 +77,11 @@
{{ item.title }} {{ item.title }}
</p> </p>
<p class="cell_cont"> <p class="cell_cont">
{{ item.content.replace(/<[^<>]+>/g, "") }} {{
item.answer
? item.question_content.replace(/<[^<>]+>/g, "")
: item.content.replace(/<[^<>]+>/g, "")
}}
</p> </p>
<p v-if="activeName == 2" class="cell_other"> <p v-if="activeName == 2" class="cell_other">
<span> <span>
...@@ -207,6 +211,12 @@ export default { ...@@ -207,6 +211,12 @@ export default {
watch: { watch: {
activeName: { activeName: {
handler(val) { handler(val) {
this.data_list = [];
this.total = 0;
this.pagination = {
rowsPerPage: 10,
page: 1,
};
if (val == "0") { if (val == "0") {
this.getQList(); this.getQList();
} else if (val == "1") { } else if (val == "1") {
...@@ -313,10 +323,9 @@ export default { ...@@ -313,10 +323,9 @@ export default {
} }
}, },
delQ() { delQ() {
let query = { let items = [{ id: this.delItem.id }];
items: [{ id: this.delItem.id }], console.log(items);
}; this.$api.user.delQuestions(items).then((response) => {
this.$api.user.delQuestions(query).then((response) => {
if (response.data.success == 1) { if (response.data.success == 1) {
this.$message({ this.$message({
message: "删除成功", message: "删除成功",
...@@ -326,10 +335,8 @@ export default { ...@@ -326,10 +335,8 @@ export default {
}); });
}, },
delA() { delA() {
let query = { let items = [{ id: this.delItem.id }];
items: [{ id: this.delItem.id }], this.$api.user.delAnswers(items).then((response) => {
};
this.$api.user.delAnswers(query).then((response) => {
if (response.data.success == 1) { if (response.data.success == 1) {
this.$message({ this.$message({
message: "删除成功", message: "删除成功",
......
...@@ -59,11 +59,11 @@ const user = { ...@@ -59,11 +59,11 @@ const user = {
getDeleteList() { getDeleteList() {
return axios.get(`/apaas/support/qa/deleted`); return axios.get(`/apaas/support/qa/deleted`);
}, },
delQuestions(params) { delQuestions(items) {
return axios.delete(`/apaas/support/qa/question/delete`, params); return axios.delete(`/apaas/support/qa/question/delete`, { data: { items } });
}, },
delAnswers(params) { delAnswers(items) {
return axios.delete(`/apaas/support/qa/answer/delete`, params); return axios.delete(`/apaas/support/qa/answer/delete`, { data: { items } });
}, },
getUserQA() { getUserQA() {
return axios.get(`/apaas/support/qa/info`) return axios.get(`/apaas/support/qa/info`)
......
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