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

问答接口调整

parent 4682f556
......@@ -75,7 +75,7 @@
</div>
</el-col>
<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_specification">
计次收费:{{ getSpecification }}
......@@ -138,6 +138,8 @@
</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 :span="3" class="shopping_cell_num">
<div v-if="cellIsService && specificationPop.spec_type == 1">不限时长</div>
......@@ -152,7 +154,7 @@
</div>
</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-checkbox
v-if="!readOnly"
......@@ -233,6 +235,11 @@ export default {
getSpecification() {
console.log()
},
getSumMoney() {
if (this.cellItems.app_id != 0) {
this.cellItems.application.price * this.cellItems.duration
}
}
},
mounted() {},
methods: {
......
......@@ -257,13 +257,11 @@ export default {
});
},
delQ() {
let query = {
items: [],
};
let items = [];
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) {
this.$message({
message: "删除成功",
......@@ -273,13 +271,11 @@ export default {
});
},
delA() {
let query = {
items: [],
};
let items = [];
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) {
this.$message({
message: "删除成功",
......@@ -367,7 +363,7 @@ export default {
align: "left",
type: "html",
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 {
align: "left",
type: "html",
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: "问题内容",
align: "left",
type: "html",
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,
""
)}">${str.content.replace(/<[^<>]+>/g, "")}</span>`;
)}">${str.question_content.replace(/<[^<>]+>/g, "")}</span>`;
},
},
{
......
......@@ -77,7 +77,11 @@
{{ item.title }}
</p>
<p class="cell_cont">
{{ item.content.replace(/<[^<>]+>/g, "") }}
{{
item.answer
? item.question_content.replace(/<[^<>]+>/g, "")
: item.content.replace(/<[^<>]+>/g, "")
}}
</p>
<p v-if="activeName == 2" class="cell_other">
<span>
......@@ -207,6 +211,12 @@ export default {
watch: {
activeName: {
handler(val) {
this.data_list = [];
this.total = 0;
this.pagination = {
rowsPerPage: 10,
page: 1,
};
if (val == "0") {
this.getQList();
} else if (val == "1") {
......@@ -313,10 +323,9 @@ export default {
}
},
delQ() {
let query = {
items: [{ id: this.delItem.id }],
};
this.$api.user.delQuestions(query).then((response) => {
let items = [{ id: this.delItem.id }];
console.log(items);
this.$api.user.delQuestions(items).then((response) => {
if (response.data.success == 1) {
this.$message({
message: "删除成功",
......@@ -326,10 +335,8 @@ export default {
});
},
delA() {
let query = {
items: [{ id: this.delItem.id }],
};
this.$api.user.delAnswers(query).then((response) => {
let items = [{ id: this.delItem.id }];
this.$api.user.delAnswers(items).then((response) => {
if (response.data.success == 1) {
this.$message({
message: "删除成功",
......
......@@ -59,11 +59,11 @@ const user = {
getDeleteList() {
return axios.get(`/apaas/support/qa/deleted`);
},
delQuestions(params) {
return axios.delete(`/apaas/support/qa/question/delete`, params);
delQuestions(items) {
return axios.delete(`/apaas/support/qa/question/delete`, { data: { items } });
},
delAnswers(params) {
return axios.delete(`/apaas/support/qa/answer/delete`, params);
delAnswers(items) {
return axios.delete(`/apaas/support/qa/answer/delete`, { data: { items } });
},
getUserQA() {
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