Commit ed0d66d5 authored by 刘殿昕's avatar 刘殿昕

应用商店的列表不是一个人写的,数据结构可能会遇见不可知问题,over

parent 26abfa03
......@@ -34,12 +34,12 @@
</div>
<div class="com_cell_item">
<span class="com_cell_item_title">更新时间:</span>
<span class="com_cell_data">{{ cellData.update_date }}</span>
<span class="com_cell_data">{{ helper.dateStringTransform(cellData.update_date) }}</span>
</div>
</div>
<div class="com_cell_right">
<el-rate
v-model="cellData.rate"
v-model="cellData.score"
disabled
show-score
text-color="#58617a"
......@@ -55,6 +55,8 @@
</template>
<script>
import helper from "@/services/helper.js";
// if you meet date which like 2020-06-05T00:00:00+08:00, use helper.dateStringTransform()
export default {
components: {},
props: {
......
......@@ -25,7 +25,10 @@
<!-- filter -->
<div v-if="urlFilter" class="classification">
<div v-for="(item, index) in filterLists" :key="'cd' + index" class="classification_line">
<div class="classification_line_if" v-if="item.childDomains">
<div
class="classification_line_if"
v-if="item.childDomains && item.childDomains.length != 0"
>
<div class="classification_line_title">{{ item.name }}</div>
<div
:class="index == filterLists.length - 1 ? 'classification_line_items':'classification_line_items classification_line_items_border'"
......@@ -106,7 +109,10 @@
</div>
</div>
</div>
<div class="gray_line"></div>
<div
class="gray_line"
v-if="filterLists[0].childDomains.length != 0 || filterLists[1].childDomains.length != 0 || filterLists[2].childDomains.length != 0"
></div>
<!-- filter button -->
<div class="btn_group">
<el-button
......@@ -147,6 +153,7 @@ export default {
name: { type: String, default: "" }
},
data: () => ({
helper: helper,
search: "",
openList: [0, 0, 0, 0],
openChildren: [
......@@ -223,35 +230,38 @@ export default {
if (response.data.success == "1") {
this.lists = response.data.data;
} else {
console.log(response.data.message);
console.log(response.data.errMsg);
}
});
},
getShopFilter() {
let query = {
type: this.urlFilter
};
this.$api.serviceShop.getServiceShopFilter(query).then(response => {
if (response.data.success == 1) {
let data = response.data.data;
this.filterLists[0].childDomains = data.serviceTypeInfo
? data.serviceTypeInfo
: [];
this.filterLists[1].childDomains = data.serviceDomain
? data.serviceDomain
: [];
this.filterLists[2].childDomains = data.organizations
? data.organizations
: [];
console.log(this.filterLists);
setTimeout(() => {
this.judgeHeight();
}, 0);
this.getShopList();
} else {
console.log(response.data.errMsg);
}
});
if (this.urlFilter == "app") {
} else {
let query = {
type: this.urlFilter
};
this.$api.serviceShop.getServiceShopFilter(query).then(response => {
if (response.data.success == 1) {
let data = response.data.data;
this.filterLists[0].childDomains = data.serviceTypeInfo
? data.serviceTypeInfo
: [];
this.filterLists[1].childDomains = data.serviceDomain
? data.serviceDomain
: [];
this.filterLists[2].childDomains = data.organizations
? data.organizations
: [];
setTimeout(() => {
this.judgeHeight();
}, 0);
this.getShopList();
} else {
console.log(response.data.errMsg);
}
});
}
},
judgeHeight() {
let list = this.filterLists;
......@@ -290,7 +300,6 @@ export default {
});
}
}
console.log(this.activeOptions);
this.getFilterValue();
},
clickItemChild(index, indexs, items) {
......@@ -331,7 +340,6 @@ export default {
} else {
this.activeChildOptions[index].splice(i, 1);
}
console.log(this.activeChildOptions, i, fatherId);
this.getFilterValue();
},
getFilterValue() {
......@@ -350,8 +358,9 @@ export default {
this.getShopList();
},
clickAll(item) {
this.activeOptions[item] = [];
this.activeChildOptions[item] = [];
this.$set(this.activeOptions, item, []);
this.$set(this.activeChildOptions, item, []);
this.getShopList();
}
}
};
......
......@@ -60,7 +60,7 @@ export default {
break;
case "app_store_list":
this.name = "应用商店";
this.urlFilter = "";
this.urlFilter = "app";
this.url = "/shop/yysdDetail";
break;
default:
......
......@@ -21,7 +21,23 @@ Page=${params.Page}&Size=${params.Size}`);
getServiceShopDetail(params) {
return axios.get(`/apaas/serviceapp/v3/servicemarket/detail?serviceId=`)
},
// service list application
getApparea() {
return axios.get(`/apaas/hubApi/market/businessAreas`)
},
getAppArea() {
return axios.get(`/apaas/hubApi/market/businessAreas`)
},
getAppType() {
return axios.get(`/apaas/hubApi/market/appTypes`)
},
getAppOrg() {
return axios.get(`/apaas/hubApi/market/departments`)
},
getAppList(params) {
return axios.get(`/apaas/hubApi/market/list?online_state=${params.online_state}&appTypes=${params.appTypes}&
businessArea=${params.businessArea}&developable=${params.developable}&page=${params.page}&limit=${params.limit}&search=${params.search}`);
},
// shopping cart
addShoppingCart(params) {
return axios.post(`/apaas/serviceapp/v3/shopcart/add`, params);
......
......@@ -34,3 +34,18 @@ module.exports.dateFormat = function (fmt, timestamp) {
};
return fmt;
}
module.exports.dateStringTransform = function (date) {
let arr = date.split("T");
let d = arr[0];
let darr = d.split('-');
let t = arr[1];
let tarr = t.split('.000');
let marr = tarr[0].split(':');
let h = parseInt(marr[0]) >= 10 ? parseInt(marr[0]) : "0" + parseInt(marr[0]);
let m = parseInt(marr[1]) >= 10 ? parseInt(marr[1]) : "0" + parseInt(marr[1]);
let s = parseInt(marr[2]) >= 10 ? parseInt(marr[2]) : "0" + parseInt(marr[2]);
let dd = arr[0] + " " + h + ":" + m + ":" + s;
return dd;
}
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