123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- var app = new Vue({
- el: '#app',
- data: {
- title123: 'sss',
- backBanner: "",
- solution: [],
- solution_type: 1,
- id: null,
- array: [],
- solutionTypes: [],
- colin: '0'
- },
- computed: {
- },
- created: function () {
-
- this.solution_type = this.getQueryVariable('solution_type')
- this.id = this.getQueryVariable('id')
-
- this.backBanner = '../assets/img/solution/solution-banner1.jpg'
- },
- mounted: function () {
- console.log(this.solution_type)
- this.getColumnData()
- $.ajax({
- type: 'POST',
- dataType: 'json',
- url: window.FQDN + 'Solution/index',
- data: {
- id: '1'
- }
- }).done(function (arr) {
- _this.array = arr;
- }).fail(function (err) {});
- },
- methods: {
- getColumnData() {
- _this=this;
- $.ajax({
- type: 'get',
- dataType: 'json',
- url: window.FQDN2 + 'siteCategory/siteCategoryList',
- }).done(function (res) {
- for (let i = 0; i < res.data.length; i++) {
- // console.log('存值')
- console.log(res.data[i].sname)
- console.log(window.location.pathname)
- if (res.data[i].children.length > 0) {
- if (res.data[i].categoryName == '解决方案') {
- // console.log(res.data[i].children)
- _this.solutionTypes=res.data[i].children
- _this.colin=_this.getQueryVariable('id')
-
-
- }
- }
- }
- $.ajax({
- type: 'GET',
- dataType: 'json',
- url: window.FQDN2 + 'siteArticle/siteArticleList',
- data: {
- categoryid: _this.id ? _this.id : _this.solutionTypes[0].id
- }
- }).done(function (arr) {
- // _this.array = arr;
- }).fail(function (err) {});
-
- })
- },
- facilityClick(e, item) {
- this.colin = e
- },
- getQueryVariable: function (variable) {
- var query = window.location.search.substring(1);
- var vars = query.split("&");
- for (var i = 0; i < vars.length; i++) {
- var pair = vars[i].split("=");
- if (pair[0] == variable) {
- return pair[1];
- }
- }
- return (false);
- }
- }
- });
|