Commit 5d38cc4f authored by 张俊's avatar 张俊

Merge branch 'dev' of https://cloud.wodcloud.com/git/apaas/apaas-v3-ui into dev

parents 0ccb7040 54268e7b
...@@ -400,6 +400,7 @@ export default { ...@@ -400,6 +400,7 @@ export default {
font-size: 14px; font-size: 14px;
display: none; display: none;
z-index: 1; z-index: 1;
text-align: center;
} }
.shop_menu { .shop_menu {
width: 280px; width: 280px;
...@@ -435,7 +436,7 @@ export default { ...@@ -435,7 +436,7 @@ export default {
height: 44px; height: 44px;
line-height: 44px; line-height: 44px;
padding: 0 30px; padding: 0 30px;
text-align: left; text-align: center;
color: #0d1847; color: #0d1847;
} }
.user_menu div:hover { .user_menu div:hover {
......
...@@ -246,6 +246,11 @@ export default { ...@@ -246,6 +246,11 @@ export default {
{ length: this.data.length }, { length: this.data.length },
(item, index) => (item = 0) (item, index) => (item = 0)
); );
let self = this;
window.gotodetail = (val) => {
console.log(val)
self.$emit("gotodetail", val)
}
}, },
methods: { methods: {
toggleSelection(rows) { toggleSelection(rows) {
...@@ -348,6 +353,10 @@ export default { ...@@ -348,6 +353,10 @@ export default {
this.$refs.multipleTable.clearSelection(); this.$refs.multipleTable.clearSelection();
this.$emit("selectnum", { select: [], rows: [] }); this.$emit("selectnum", { select: [], rows: [] });
}, },
gotodetail(val) {
console.log(val)
this.$emit("gotodetail", val)
}
}, },
}; };
</script> </script>
......
...@@ -82,8 +82,9 @@ ...@@ -82,8 +82,9 @@
<span>计次收费规格:</span> <span>计次收费规格:</span>
<span <span
v-if=" v-if="
data.serviceRequestSpcs.spcs_type_1 && (data.serviceRequestSpcs.spcs_type_1 &&
data.serviceRequestSpcs.spcs_type_1.length == 0 data.serviceRequestSpcs.spcs_type_1.length == 0) ||
!data.serviceRequestSpcs.spcs_type_1
" "
class="commodity_text" class="commodity_text"
>暂无</span >暂无</span
...@@ -103,8 +104,9 @@ ...@@ -103,8 +104,9 @@
<span>时长收费规格:</span> <span>时长收费规格:</span>
<span <span
v-if=" v-if="
data.serviceRequestSpcs.spcs_type_2 && (data.serviceRequestSpcs.spcs_type_2 &&
data.serviceRequestSpcs.spcs_type_2.length == 0 data.serviceRequestSpcs.spcs_type_2.length == 0) ||
!data.serviceRequestSpcs.spcs_type_2
" "
class="commodity_text" class="commodity_text"
>暂无</span >暂无</span
...@@ -185,7 +187,7 @@ export default { ...@@ -185,7 +187,7 @@ export default {
}, },
data: () => ({ data: () => ({
types: [], types: [],
type: 0, // 购买方式 1:按月,2:按年 type: 1, // 购买方式 1:按月,2:按年
specification: {}, // 规格 specification: {}, // 规格
duration: 1, // 时长 duration: 1, // 时长
showTime: false, showTime: false,
...@@ -193,7 +195,13 @@ export default { ...@@ -193,7 +195,13 @@ export default {
computed: { computed: {
actionDisabled() { actionDisabled() {
let a = this.data.serviceRequestSpcs; let a = this.data.serviceRequestSpcs;
return a.spcs_type_1.length == 0 && a.spcs_type_2.length == 0; return (
a &&
a.spcs_type_1 &&
a.spcs_type_1.length == 0 &&
a.spcs_type_2 &&
a.spcs_type_2.length == 0
);
}, },
}, },
watch: {}, watch: {},
...@@ -250,6 +258,7 @@ export default { ...@@ -250,6 +258,7 @@ export default {
query: { query: {
service_id: parseFloat(this.data.service_id), service_id: parseFloat(this.data.service_id),
spec_id: this.specification.id, spec_id: this.specification.id,
spcs_type: this.specification.spcs_type,
duration: this.duration, duration: this.duration,
duration_unit: this.type, duration_unit: this.type,
}, },
...@@ -294,9 +303,17 @@ export default { ...@@ -294,9 +303,17 @@ export default {
} }
// 初始化规格 // 初始化规格
if (this.data.serviceRequestSpcs.spcs_type_1.length > 0) { if (
this.data.serviceRequestSpcs &&
this.data.serviceRequestSpcs.spcs_type_1 &&
this.data.serviceRequestSpcs.spcs_type_1.length > 0
) {
this.specification = this.data.serviceRequestSpcs.spcs_type_1[0]; this.specification = this.data.serviceRequestSpcs.spcs_type_1[0];
} else if (this.data.serviceRequestSpcs.spcs_type_2.length > 0) { } else if (
this.data.serviceRequestSpcs &&
this.data.serviceRequestSpcs.spcs_type_2 &&
this.data.serviceRequestSpcs.spcs_type_2.length > 0
) {
this.specification = this.data.serviceRequestSpcs.spcs_type_2[0]; this.specification = this.data.serviceRequestSpcs.spcs_type_2[0];
} }
}, },
......
...@@ -639,7 +639,7 @@ ...@@ -639,7 +639,7 @@
<div class="btn_footer fyzj_item"> <div class="btn_footer fyzj_item">
<div class="fyzj"> <div class="fyzj">
<p class="fyzj_p"> <p class="fyzj_p">
<span v-if="getSumCoin > 20000" class="yebz"> <span v-if="getSumCoin > userInfo.account_balance" class="yebz">
余额不足,请联系超级管理员进行充值 余额不足,请联系超级管理员进行充值
</span> </span>
费用总计:<span class="fyzj_span"> 费用总计:<span class="fyzj_span">
...@@ -651,12 +651,12 @@ ...@@ -651,12 +651,12 @@
<span @click="dialogFymx = true" class="ckfymx_a"> <span @click="dialogFymx = true" class="ckfymx_a">
查看费用明细 查看费用明细
</span> </span>
<span class="ckfymx_qian">账户余额:20,000 金币</span> <span class="ckfymx_qian">账户余额:{{ userInfo.account_balance }} 金币</span>
</p> </p>
</div> </div>
<el-button <el-button
:class="getSumCoin <= 20000 ? 'submit' : 'nosubmit'" :class="getSumCoin <= userInfo.account_balance ? 'submit' : 'nosubmit'"
:disabled="getSumCoin > 20000" :disabled="getSumCoin > userInfo.account_balance"
@click="submitApp" @click="submitApp"
> >
提交申请 提交申请
...@@ -951,11 +951,11 @@ ...@@ -951,11 +951,11 @@
<div class="fyzj_dia"> <div class="fyzj_dia">
<div class="fyzj_dia_init"> <div class="fyzj_dia_init">
<p v-if="activeName == '1'" class="fyzj_2"> <p v-if="activeName == '1'" class="fyzj_2">
升级费用:<span class="fyzj_2_num">2000000000 金币</span> 升级费用:<span class="fyzj_2_num">{{ amounts_payable }} 金币</span>
</p> </p>
<p v-if="activeName == '1'" class="fyzj_2"> <!-- <p v-if="activeName == '1'" class="fyzj_2">
原规格抵扣费用:<span class="fyzj_2_num">2000 金币</span> 原规格抵扣费用:<span class="fyzj_2_num">2000 金币</span>
</p> </p> -->
<div class="fyzj_1"> <div class="fyzj_1">
费用总计: 费用总计:
<p> <p>
...@@ -964,7 +964,7 @@ ...@@ -964,7 +964,7 @@
</p> </p>
</div> </div>
<p class="fyzj_2"> <p class="fyzj_2">
账户余额:<span class="fyzj_2_num">2000 金币</span> 账户余额:<span class="fyzj_2_num">{{ userInfo.account_balance }} 金币</span>
</p> </p>
</div> </div>
<div class="clear_xxx"></div> <div class="clear_xxx"></div>
...@@ -995,7 +995,7 @@ ...@@ -995,7 +995,7 @@
:datas="jifeiList1" :datas="jifeiList1"
:maxheight="260" :maxheight="260"
></table-um> ></table-um>
<div v-if="activeName == '1'" class="sjfy_title"> <!-- <div v-if="activeName == '1'" class="sjfy_title">
原规格抵扣费用 原规格抵扣费用
<el-tooltip <el-tooltip
class="tool_item" class="tool_item"
...@@ -1014,7 +1014,7 @@ ...@@ -1014,7 +1014,7 @@
:stripe="true" :stripe="true"
:datas="jifeiList2" :datas="jifeiList2"
:maxheight="260" :maxheight="260"
></table-um> ></table-um> -->
</el-dialog> </el-dialog>
<ApassDialog <ApassDialog
ref="dialog" ref="dialog"
...@@ -1031,6 +1031,7 @@ import TableUm from "@/components/table/table-um"; ...@@ -1031,6 +1031,7 @@ import TableUm from "@/components/table/table-um";
import InfoList from "@/components/infoList"; import InfoList from "@/components/infoList";
import ApassDialog from "@/components/apass-dialog"; import ApassDialog from "@/components/apass-dialog";
import helper from "@/services/helper.js"; import helper from "@/services/helper.js";
import { mapState } from "vuex";
export default { export default {
components: { components: {
...@@ -1144,9 +1145,10 @@ export default { ...@@ -1144,9 +1145,10 @@ export default {
}个月`; }个月`;
} }
this.amounts_payable = sumCM + sumDisk; this.amounts_payable = sumCM + sumDisk;
this.total_money = sumCM + sumDisk - a_deductions; // this.total_money = sumCM + sumDisk - a_deductions;
return this.total_money; return this.amounts_payable;
}, },
...mapState(["userInfo"]),
}, },
data() { data() {
var checkName = (rule, value, callback) => { var checkName = (rule, value, callback) => {
...@@ -1439,7 +1441,7 @@ export default { ...@@ -1439,7 +1441,7 @@ export default {
name: "数据盘", name: "数据盘",
num: "0个数据盘,每个数据盘0GB", num: "0个数据盘,每个数据盘0GB",
time: "0个月", time: "0个月",
sum: "2000金币", sum: "金币",
}, },
], ],
}; };
...@@ -1565,7 +1567,7 @@ export default { ...@@ -1565,7 +1567,7 @@ export default {
sum: "2000金币", sum: "2000金币",
}, },
]; ];
this.deductions = 20000; this.deductions = this.userInfo.account_balance;
} else { } else {
this.formShow = false; this.formShow = false;
} }
......
...@@ -75,10 +75,25 @@ ...@@ -75,10 +75,25 @@
</div> </div>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<div 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 }} {{
cellItems.service.spcs_info.spcs_type == 1
? "计次收费"
: "时长收费"
}}{{ cellItems.service.spcs_info.money }}金币/{{
cellItems.service.spcs_info.spcs_type == 1
? cellItems.service.spcs_info.spcs_count + ""
: ""
}}
</div> </div>
<div class="shopping_cell_specification_edit"> <div class="shopping_cell_specification_edit">
<el-popover <el-popover
...@@ -93,53 +108,40 @@ ...@@ -93,53 +108,40 @@
<div <div
v-if=" v-if="
cellItems.service.request_spcs_info && cellItems.service.request_spcs_info &&
cellItems.service.request_spcs_info.length != 0 cellItems.service.request_spcs_info.spcs_type_1 &&
cellItems.service.request_spcs_info.spcs_type_1
.length != 0
" "
> >
<el-button <el-button
v-for="(item, index) in cellItems.service v-for="(item, index) in cellItems.service
.request_spcs_info" .request_spcs_info.spcs_type_1"
:key="'specification' + index" :key="'specification' + index"
:class=" :class="
specificationPop == item.id specificationPop.id == item.id
? 'shopping_cell_specification_btn active' ? 'shopping_cell_specification_btn active'
: 'shopping_cell_specification_btn' : 'shopping_cell_specification_btn'
" "
size="mini" size="mini"
@click="changeSpecification(item.id)" @click="changeSpecification(item)"
> >
{{ {{ item.money }}金币/{{ item.spcs_count }}
index +
1 +
". " +
"访问次数:" +
item.pv +
"/日," +
"访问量:" +
item.count +
"/日"
}}
</el-button> </el-button>
</div>
<div class="no_option" v-else>暂无规格</div>
</div>
<div v-else>
<div class="shopping_cell_specification_title">规格:</div>
<div>
<el-button <el-button
v-for="(item, index) in appSpecificationBtns"
:key="'specification' + index"
:class=" :class="
specificationPop == item.id specificationPop.spcs_type == 2
? 'shopping_cell_specification_btn active' ? 'shopping_cell_specification_btn active'
: 'shopping_cell_specification_btn' : 'shopping_cell_specification_btn'
" "
size="mini" size="mini"
@click="changeSpecification(item)" @click="changeSpecification(cellItems.service.request_spcs_info.spcs_type_2[0])"
>{{
cellItems.service.request_spcs_info.spcs_type_2[0]
.money
}}金币/月</el-button
> >
{{ index + 1 + ". " + item.value }}
</el-button>
</div> </div>
<div class="no_option" v-else>暂无规格</div>
</div> </div>
</div> </div>
<div class="pop_footer"> <div class="pop_footer">
...@@ -166,9 +168,22 @@ ...@@ -166,9 +168,22 @@
</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 &&
cellItems.service.request_spcs_info.spcs_type_2.length != 0
? cellItems.service.request_spcs_info.spcs_type_2[0].money
: 0
}}金币/月
</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 && cellItems.service.spcs_info.spcs_type == 1">
不限时长
</div>
<div v-else> <div v-else>
<el-input-number <el-input-number
:disabled="readOnly" :disabled="readOnly"
...@@ -178,9 +193,16 @@ ...@@ -178,9 +193,16 @@
:min="1" :min="1"
></el-input-number> ></el-input-number>
</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">
{{
cellItems.service_id != 0
? (cellItems.service.spcs_info.money * cellItems.duration).toFixed(
2
)
: (cellItems.application.price * cellItems.duration).toFixed(2)
}}金币
</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"
...@@ -246,7 +268,7 @@ export default { ...@@ -246,7 +268,7 @@ export default {
specificationEdit: require("../../assets/imgs/ic_edit.png"), specificationEdit: require("../../assets/imgs/ic_edit.png"),
checkedSubscription: false, checkedSubscription: false,
visible: false, visible: false,
specificationPop: 1, specificationPop: {},
specificationApplicationPop: 1, specificationApplicationPop: 1,
appSpecificationBtns: [ appSpecificationBtns: [
{ id: 1, value: "部署" }, { id: 1, value: "部署" },
...@@ -259,42 +281,32 @@ export default { ...@@ -259,42 +281,32 @@ export default {
}), }),
computed: { computed: {
getSpecification() { getSpecification() {
if (this.cellIsService) { console.log();
let arr = []; },
if ( getSumMoney() {
this.cellItems.service.request_spcs_info && let sum = 0;
this.cellItems.service.request_spcs_info.length != 0 if (this.cellItems.app_id != 0) {
) { sum += this.cellItems.application.price * this.cellItems.duration;
let requestArr = this.cellItems.service.request_spcs_info; } else if (this.cellItems.service_id != 0) {
requestArr.forEach((item) => {
arr.push(item.id);
});
}
let num = arr.indexOf(this.cellItems.spec_id);
let specification = "";
if (num != -1) {
specification =
"访问次数:" +
this.cellItems.service.request_spcs_info[num].pv +
"/日," +
"访问量:" +
this.cellItems.service.request_spcs_info[num].count +
"/日";
}
return specification;
} else {
if (this.cellItems.spec_id == 1) {
return "部署";
} else {
return "开发";
}
} }
return sum;
}, },
}, },
mounted() {}, mounted() {},
methods: { methods: {
getState(val) { getState(val) {
this.$emit("changeState", { state: val, index: this.cellIndex }); if (
this.cellItems.service_id != 0 &&
!this.cellItems.service.spcs_info.id
) {
this.$message({
message: "该服务暂不支持购买",
type: "error",
});
this.checkedItem = false;
} else {
this.$emit("changeState", { state: val, index: this.cellIndex });
}
}, },
changeSpecification(val) { changeSpecification(val) {
this.specificationPop = val; this.specificationPop = val;
...@@ -303,15 +315,19 @@ export default { ...@@ -303,15 +315,19 @@ export default {
this.specificationApplicationPop = val; this.specificationApplicationPop = val;
}, },
submitPop() { submitPop() {
this.cellItems.spec_id = this.specificationPop; this.cellItems.service.spcs_info =
this.cellItems.duration_method = this.specificationApplicationPop; this.specificationPop.spcs_type == 1
this.visible = false; ? this.cellItems.service.request_spcs_info.spcs_type_1[val]
this.changeCellItem(); : this.specificationPop.spcs_type == 2
? this.cellItems.service.request_spcs_info.spcs_type_2[val]
: "";
this.updateShoppingCart();
this.updateShoppingCart(); this.updateShoppingCart();
}, },
setSpecificationPop() { setSpecificationPop() {
this.specificationPop = this.cellItems.spec_id; this.specificationPop = this.cellItems.service.spcs_info;
this.specificationApplicationPop = this.cellItems.duration_method; console.log(this.specificationPop)
// this.specificationApplicationPop = this.cellItems.duration_method;
}, },
changeSubscription(val) { changeSubscription(val) {
this.changeCellItem(); this.changeCellItem();
...@@ -319,7 +335,6 @@ export default { ...@@ -319,7 +335,6 @@ export default {
}, },
changeNum(val) { changeNum(val) {
this.changeCellItem(); this.changeCellItem();
this.updateShoppingCart();
}, },
changeCellItem() { changeCellItem() {
this.$emit("changeCellMsg", { this.$emit("changeCellMsg", {
...@@ -463,8 +478,8 @@ export default { ...@@ -463,8 +478,8 @@ export default {
} }
.shopping_cell_specification { .shopping_cell_specification {
width: 80%; width: 80%;
height: 100px; height: 70px;
margin: 0 10%; margin: 15px 10%;
background-color: #f9fafc; background-color: #f9fafc;
border-radius: 8px; border-radius: 8px;
padding: 10px; padding: 10px;
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<el-col :span="15" class="shopping_cart_options_num"> <el-col :span="15" class="shopping_cart_options_num">
<div class="fyzj"> <div class="fyzj">
<p class="fyzj_p"> <p class="fyzj_p">
<span v-if="getSumCoin > 20000" class="yebz"> <span v-if="getSumCoin > userInfo.account_balance" class="yebz">
余额不足,请联系超级管理员进行充值 余额不足,请联系超级管理员进行充值
</span> </span>
费用总计:<span class="fyzj_span"> 费用总计:<span class="fyzj_span">
...@@ -72,22 +72,24 @@ ...@@ -72,22 +72,24 @@
<p class="ckfymx_a"> <p class="ckfymx_a">
{{ list.length }} 项服务,已选择 {{ list.length }} 项服务,已选择
<span class="dwa_djf">{{ getNum }}</span> <span class="dwa_djf">{{ getNum }}</span>
<span class="ckfymx_qian">账户余额:20,000 金币</span> <span class="ckfymx_qian"
>账户余额:{{ userInfo.account_balance }} 金币</span
>
</p> </p>
</div> </div>
</div> </div>
</el-col> </el-col>
<el-col :span="4" class="shopping_cart_options_cell"> <el-col :span="4" class="shopping_cart_options_cell">
<el-button <el-button
v-if="getNum == 0" v-if="getNum != 0 && getSumCoin <= userInfo.account_balance"
:disabled="true" @click="oneClickApplication"
class="shopping_cart_options_cell_btn" class="shopping_cart_options_cell_btn_act"
>一键申请</el-button >一键申请</el-button
> >
<el-button <el-button
v-else v-else
@click="oneClickApplication" :disabled="true"
class="shopping_cart_options_cell_btn_act" class="shopping_cart_options_cell_btn"
>一键申请</el-button >一键申请</el-button
> >
</el-col> </el-col>
...@@ -99,6 +101,8 @@ ...@@ -99,6 +101,8 @@
<script> <script>
import ShoppingCartList from "@/components/shopping-cart/shopping-cart-list"; import ShoppingCartList from "@/components/shopping-cart/shopping-cart-list";
import { mapState } from "vuex";
export default { export default {
components: { components: {
ShoppingCartList, ShoppingCartList,
...@@ -124,9 +128,14 @@ export default { ...@@ -124,9 +128,14 @@ export default {
}, },
getSumCoin() { getSumCoin() {
let sum = 0; let sum = 0;
console.log(this.checkList);
this.checkList.forEach((item, index) => { this.checkList.forEach((item, index) => {
if (item) { if (item) {
sum += item.total_money; if (this.list[index].service_id != 0) {
sum += (this.list[index].service.spcs_info.money * this.list[index].duration).toFixed(2);
} else {
sum += (this.list[index].application.price * this.list[index].duration).toFixed(2);
}
} }
}); });
return sum; return sum;
...@@ -134,6 +143,7 @@ export default { ...@@ -134,6 +143,7 @@ export default {
getCartState() { getCartState() {
return this.$store.state.cartState; return this.$store.state.cartState;
}, },
...mapState(["userInfo"]),
}, },
watch: { watch: {
getCartState(newVal) { getCartState(newVal) {
...@@ -341,6 +351,11 @@ export default { ...@@ -341,6 +351,11 @@ export default {
left: -10px; left: -10px;
top: 2px; top: 2px;
} }
.yebz {
color: #e15260;
font-size: 18px;
margin-right: 20px;
}
</style> </style>
<style> <style>
.shopping_cart_options_cell .el-checkbox { .shopping_cart_options_cell .el-checkbox {
......
...@@ -89,6 +89,7 @@ export default { ...@@ -89,6 +89,7 @@ export default {
descript: datas.descript, descript: datas.descript,
serviceRequestSpcs: specificationData, serviceRequestSpcs: specificationData,
scoreDetail: datas.scoreDetail, scoreDetail: datas.scoreDetail,
month_sale: data.month_sale,
}; };
this.detailData = [ this.detailData = [
......
...@@ -37,8 +37,8 @@ export default { ...@@ -37,8 +37,8 @@ export default {
preson: "", preson: "",
phone: "", phone: "",
}, },
all_cost:'', all_cost: 0,
now_money:'', now_money: 0,
module_arr: [ module_arr: [
{ {
title: "服务申请", title: "服务申请",
...@@ -122,7 +122,7 @@ export default { ...@@ -122,7 +122,7 @@ export default {
} else if (this.$route.query.app_id) { } else if (this.$route.query.app_id) {
this.get_one_app(this.$route.query); this.get_one_app(this.$route.query);
} else { } else {
console.log(JSON.parse(window.sessionStorage.getItem("shoppingCart"))); // console.log(JSON.parse(window.sessionStorage.getItem("shoppingCart")));
var temp_arr = []; var temp_arr = [];
JSON.parse(window.sessionStorage.getItem("shoppingCart")).forEach((e) => { JSON.parse(window.sessionStorage.getItem("shoppingCart")).forEach((e) => {
temp_arr.push(e.id); temp_arr.push(e.id);
...@@ -136,9 +136,8 @@ export default { ...@@ -136,9 +136,8 @@ export default {
get_account_money(){ get_account_money(){
this.$http this.$http
.get(`/apaas/backmgt/user/myAccount`).then(res=>{ .get(`/apaas/backmgt/user/myAccount`).then(res=>{
console.log(res);
if(res.data.success){ if(res.data.success){
this.now_money = res.data.data.account_balance this.now_money = res.data.data.account_balance || 0
} }
}) })
}, },
...@@ -201,21 +200,27 @@ export default { ...@@ -201,21 +200,27 @@ export default {
}, },
]; ];
this.service_arr[0]["auth"] = data.organization_name; this.service_arr[0]["auth"] = data.organization_name;
this.service_arr[0]["size"] = "规格:"; this.service_arr[0]["size"] = "";
this.service_arr[0]["count"] = "";
data.request_spcs_info.forEach((el) => { data.request_spcs_info.forEach((el) => {
if (service_data.spec_id == el.id) { if (service_data.spec_id == el.id) {
this.service_arr[0]["size"] = let size = "";
this.service_arr[0]["size"] +
"访问次数:" + if (el.spcs_type==1) {
el.count + size = `${el.money}金币/${el.spcs_count}次`
",访问量:" + this.service_arr[0]["num"] = "不限时长"
el.pv + } else {
","; size = `${el.money}金币/${el.duration_unit == 1 ? "" : ""}`
this.service_arr[0]["num"] = service_data.duration;
}
this.service_arr[0]["size"] = size;
this.service_arr[0]["count"] = service_data.duration*el.money+'金币';
this.all_cost = service_data.duration*el.money
} }
}); });
this.service_arr[0]["applytype"] = this.service_arr[0]["applytype"] =
"申请方式:" + (service_data.duration_unit == 1 ? "" : ""); "申请方式:" + (service_data.duration_unit == 1 ? "" : "");
this.service_arr[0]["num"] = service_data.duration;
this.service_arr[0]["isMg"] = data.openness == 3; this.service_arr[0]["isMg"] = data.openness == 3;
this.service_arr[0]["data"] = JSON.parse(data.res_fields); this.service_arr[0]["data"] = JSON.parse(data.res_fields);
console.log(this.service_arr[0]["data"]); console.log(this.service_arr[0]["data"]);
...@@ -377,7 +382,7 @@ export default { ...@@ -377,7 +382,7 @@ export default {
this.service_arr[l]["count"] = e.duration*parseFloat(e.application.price)+'金币'; this.service_arr[l]["count"] = e.duration*parseFloat(e.application.price)+'金币';
this.service_arr[l]["isMg"] = false; this.service_arr[l]["isMg"] = false;
this.service_arr[l]["isapp"] = true; this.service_arr[l]["isapp"] = true;
temp_cost = temp_cost + e.duration*parseFloat(e.application.price) temp_cost = this.floatAdd(temp_cost, e.duration*parseFloat(e.application.price))
} else { } else {
//服务 //服务
this.service_arr[l]["img"] = e.service.cover; this.service_arr[l]["img"] = e.service.cover;
...@@ -390,21 +395,30 @@ export default { ...@@ -390,21 +395,30 @@ export default {
}, },
]; ];
this.service_arr[l]["auth"] = e.service.organization_name; this.service_arr[l]["auth"] = e.service.organization_name;
this.service_arr[l]["size"] = "规格:"; this.service_arr[l]["size"] = "";
e.service.request_spcs_info.forEach((el) => { this.service_arr[l]["count"] = "";
let spcs_type_1 = e.service.request_spcs_info.spcs_type_1 || [];
let spcs_type_2 = e.service.request_spcs_info.spcs_type_2 || [];
spcs_type_1.forEach((el,ind) => {
if (e.spec_id == el.id) { if (e.spec_id == el.id) {
this.service_arr[l]["size"] = this.service_arr[l]["size"] = `时长收费:${el.money}金币/${el.spcs_count}次 * ${e.duration}`;
this.service_arr[l]["size"] + this.service_arr[l]["num"] = "不限时长";
"访问次数:" + this.service_arr[l]["count"] = e.duration*el.money+'金币';
el.count + temp_cost = this.floatAdd(temp_cost, e.duration*el.money);
",访问量:" +
el.pv +
",";
} }
}); });
spcs_type_2.forEach((el,ind) => {
if (e.spec_id == el.id) {
this.service_arr[l]["size"] = `应用镜像部署权限:${el.money}金币/${el.duration_unit == 1 ? "" : ""}`;
this.service_arr[l]["num"] = e.duration;
this.service_arr[l]["count"] = e.duration*el.money+'金币';
temp_cost = this.floatAdd(temp_cost, e.duration*el.money);
}
});
this.service_arr[l]["applytype"] = this.service_arr[l]["applytype"] =
"申请方式:" + (e.duration_method == 1 ? "" : ""); "申请方式:" + (e.duration_method == 1 ? "" : "");
this.service_arr[l]["num"] = e.duration;
this.service_arr[l]["isMg"] = e.service.openness == 3; this.service_arr[l]["isMg"] = e.service.openness == 3;
this.service_arr[l]["data"] = e.service.res_fields this.service_arr[l]["data"] = e.service.res_fields
? JSON.parse(e.service.res_fields) ? JSON.parse(e.service.res_fields)
...@@ -418,7 +432,39 @@ export default { ...@@ -418,7 +432,39 @@ export default {
}) })
.catch((response) => {}); .catch((response) => {});
}, },
}, floatAdd(arg1, arg2) {
let r1, r2, m, c;
try {
r1 = arg1.toString().split(".")[1].length;
} catch (e) {
r1 = 0;
}
try {
r2 = arg2.toString().split(".")[1].length;
} catch (e) {
r2 = 0;
}
c = Math.abs(r1 - r2);
m = Math.pow(10, Math.max(r1, r2));
if (c > 0) {
let cm = Math.pow(10, c);
if (r1 > r2) {
arg1 = Number(arg1.toString().replace(".", ""));
arg2 = Number(arg2.toString().replace(".", "")) * cm;
} else {
arg1 = Number(arg1.toString().replace(".", "")) * cm;
arg2 = Number(arg2.toString().replace(".", ""));
}
} else {
arg1 = Number(arg1.toString().replace(".", ""));
arg2 = Number(arg2.toString().replace(".", ""));
}
return (arg1 + arg2) / m;
},
}
}; };
</script> </script>
......
...@@ -75,6 +75,7 @@ export default { ...@@ -75,6 +75,7 @@ export default {
descript: datas.descript, descript: datas.descript,
serviceRequestSpcs: datas.serviceRequestSpcs, serviceRequestSpcs: datas.serviceRequestSpcs,
scoreDetail: datas.scoreDetail, scoreDetail: datas.scoreDetail,
month_sale: data.month_sale,
}; };
this.detailData = [ this.detailData = [
......
...@@ -95,6 +95,7 @@ export default { ...@@ -95,6 +95,7 @@ export default {
descript: datas.descript, descript: datas.descript,
serviceRequestSpcs: specificationData, serviceRequestSpcs: specificationData,
scoreDetail: datas.scoreDetail, scoreDetail: datas.scoreDetail,
month_sale: data.month_sale,
}; };
this.detailData = [ this.detailData = [
......
...@@ -90,6 +90,7 @@ export default { ...@@ -90,6 +90,7 @@ export default {
descript: datas.descript, descript: datas.descript,
serviceRequestSpcs: specificationData, serviceRequestSpcs: specificationData,
scoreDetail: datas.scoreDetail, scoreDetail: datas.scoreDetail,
month_sale: data.month_sale,
}; };
this.detailData = [ this.detailData = [
{ {
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
v-if="tableData.length" v-if="tableData.length"
:data="tableData" :data="tableData"
:header="table_header" :header="table_header"
@gotodetail="gotodeta"
></apass-table> ></apass-table>
<list-pagination <list-pagination
v-if="tableData.length" v-if="tableData.length"
...@@ -145,6 +146,9 @@ export default { ...@@ -145,6 +146,9 @@ export default {
watch: { watch: {
$route(to, from) { $route(to, from) {
this.now_state = to.path; this.now_state = to.path;
this.currentPage = 1;
this.currentlimit = 10;
this.total_list = 0;
this.changeState(this.now_state); this.changeState(this.now_state);
}, },
}, },
...@@ -253,13 +257,11 @@ export default { ...@@ -253,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: "删除成功",
...@@ -269,13 +271,11 @@ export default { ...@@ -269,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: "删除成功",
...@@ -284,7 +284,11 @@ export default { ...@@ -284,7 +284,11 @@ export default {
} }
}); });
}, },
gotodeta(val) {
this.$router.push("/technical_support/answer_center/detail/" + val);
},
changeState(val) { changeState(val) {
this.tableData = [];
this.table_header = []; this.table_header = [];
if (val == "/qa/questions") { if (val == "/qa/questions") {
this.form_data[1].label = "发布人搜索"; this.form_data[1].label = "发布人搜索";
...@@ -296,7 +300,7 @@ export default { ...@@ -296,7 +300,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.title}">${str.title}</span>`; return `<span style="color:#0f2683;font-weight:bold;width: 100%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;cursor: pointer;" title="${str.title}" onclick="gotodetail(${str.question_id})">${str.title}</span>`;
}, },
}, },
{ {
...@@ -359,7 +363,7 @@ export default { ...@@ -359,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>`;
}, },
}, },
{ {
...@@ -372,15 +376,15 @@ export default { ...@@ -372,15 +376,15 @@ export default {
}, },
}, },
{ {
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>`;
}, },
}, },
{ {
......
...@@ -70,11 +70,18 @@ ...@@ -70,11 +70,18 @@
<p v-if="activeName == 1" class="cell_answer"> <p v-if="activeName == 1" class="cell_answer">
{{ item.answer }} {{ item.answer }}
</p> </p>
<p :class="activeName == 0 ? 'cell_title' : 'cell_ans_title'"> <p
@click="gotodeta(item.question_id)"
:class="activeName == 0 ? 'cell_title' : 'cell_ans_title'"
>
{{ 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>
...@@ -189,21 +196,7 @@ export default { ...@@ -189,21 +196,7 @@ export default {
label: "50", label: "50",
}, },
], ],
data_list: [ data_list: [],
{
id: 1,
title: "平台的流程引擎怎么样", // 标题
content: "我们想用流程引擎,不会用,求大神指点", // 内容
created_by: "abc", // 发布人的userid
created: "2020-10-21T14:28:10+08:00", // 发布时间
updated: "2020-10-21T14:28:10+08:00", // 更新时间
view: 0, // 浏览量
answer_num: 2, // 回答数,
user_name: "普通neo", // 发布人
picture_path:
"/apaas/static/docs/image/image/blob_18f512d3-ee8f-4112-89a9-b2e7bfdfdec1.blob", // 头像
},
],
user_info: { user_info: {
user_name: "", user_name: "",
role: "", role: "",
...@@ -218,6 +211,12 @@ export default { ...@@ -218,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") {
...@@ -239,7 +238,13 @@ export default { ...@@ -239,7 +238,13 @@ export default {
this.refreshData(); this.refreshData();
}, },
refreshData() { refreshData() {
this.$emit("refresh", this.pagination); if (this.activeName == "0") {
this.getQList();
} else if (this.activeName == "1") {
this.getAList();
} else if (this.activeName == "2") {
this.getDeleteList();
}
}, },
pageResize() { pageResize() {
let listWidth = this.$refs.commodityCardIn.clientWidth; let listWidth = this.$refs.commodityCardIn.clientWidth;
...@@ -304,6 +309,9 @@ export default { ...@@ -304,6 +309,9 @@ export default {
} }
}); });
}, },
gotodeta(val) {
this.$router.push("/technical_support/answer_center/detail/" + val);
},
cancelDel() { cancelDel() {
this.diaDelItem = false; this.diaDelItem = false;
}, },
...@@ -315,10 +323,9 @@ export default { ...@@ -315,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: "删除成功",
...@@ -328,10 +335,8 @@ export default { ...@@ -328,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: "删除成功",
...@@ -343,7 +348,7 @@ export default { ...@@ -343,7 +348,7 @@ export default {
}, },
mounted() { mounted() {
this.getUserQA(); this.getUserQA();
// this.getQList(); this.getQList();
}, },
}; };
</script> </script>
......
...@@ -342,6 +342,10 @@ export default { ...@@ -342,6 +342,10 @@ export default {
title: "剩余使用天数:", title: "剩余使用天数:",
info: "1000天", info: "1000天",
}, },
{
title: "支付总价:",
info: "0 金币",
},
{ {
title: "到期时间:", title: "到期时间:",
info: "2020-06-02 15:54:21", info: "2020-06-02 15:54:21",
...@@ -698,7 +702,8 @@ export default { ...@@ -698,7 +702,8 @@ export default {
this.list_arr[3].url = data.apply_file; // application file url this.list_arr[3].url = data.apply_file; // application file url
this.list_arr[6].info = data.bgn_time; // get time this.list_arr[6].info = data.bgn_time; // get time
this.list_arr[7].info = data.time_remaining; // remaining days this.list_arr[7].info = data.time_remaining; // remaining days
this.list_arr[8].info = data.end_time; // maturity time this.list_arr[8].info = data.amounts_payable;
this.list_arr[9].info = data.end_time; // maturity time
this.list_arr_my[0].info = data.first_level_time || "暂未提交"; // submit application time this.list_arr_my[0].info = data.first_level_time || "暂未提交"; // submit application time
this.list_arr_my[1].info = data.second_level_time || "暂未获取"; // super get time this.list_arr_my[1].info = data.second_level_time || "暂未获取"; // super get time
this.super_status = data.second_level; // super status this.super_status = data.second_level; // super status
......
...@@ -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