addressdetail.js
3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*获取*/
//$(document).ready(function(){
/* 在地址栏获取参数 */
var storeid=GetQueryString("id");
console.log(storeid);
new Vue({
el: '#addressdetail',
data: {
//详细地址
//adddressdetail:{
// distance_text:"",
// open_start:"",
// open_end:"",
// store_address:"",
// store_name:""
//
//},
addressdetail:[],
address:{
store_name:'',
store_address:'',
distance_text:'',
open_start:'',
open_end:''
},
photo:''
},
created: function() {
this.details();
//this.addresstail();
//this.addressinfo();
// this.store();
// this.attribute();
// this.change();
},
methods: {
//获取信息
details: function() {
var that = this;
var url = '/Store/storeList';
var params = {
unique_id: localStorage.getItem('unique_id')
};
ajaxsend(url, params, function(res) {
/*console.log(JSON.stringify(res))*/
console.log(res);
var data=res.data;
var addressdet=[];
for(var i=0;i<data.length;i++){
console.log(data[i].store_id);
if(data[i].store_id==storeid){
console.log(data[i]);
addressdet.push(data[i]);
that.address.store_name=data[i].store_name;
that.address.open_start=data[i].open_start;
that.address.open_end=data[i].open_end;
that.address.store_address=data[i].store_address;
that.address.distance_text=data[i].distance_text;
console.log(addressdet);
that.addressdetail=addressdet;
console.log(that.addressdetail);
that.addressinfo();
//that.addressdetail=data[i];
//console.log(that.adddressdetail);
//that.adddressdetail.istance_text=data[i].distance_text;
//console.log(that.adddressdetail.distance_text);
//var url = '/Store/addressdetail';
//var params = {
// distance_text:that.adddressdetail.distance_text,
// open_start:that.adddressdetail.open_start,
// open_end:that.adddressdetail.open_end,
// store_address:that.adddressdetail.store_address,
// store_name:that.adddressdetail.store_name,
// store_id:addressid
//
//};
// ajaxsend(url, params, function(res) {
// /*console.log(JSON.stringify(res))*/
// console.log(res);
//
//
//})
}
}
})
},
addressinfo(){
var that = this;
var info=that.addressdetail;
console.log(info);
var store_name=info[0].store_name;
var open_start=info[0].open_start;
var open_end=info[0].open_end;
var store_address=info[0].store_address;
var distance_text=info[0].distance_text;
//console.log(store_name);
//console.log(open_start);
//console.log(open_end);
//console.log(store_address);
//console.log(distance_text)
var url = '/Store/storeDetail';
var params = {
store_id:storeid,
store_name:that.addressdetail.store_name,
open_start:that.addressdetail.open_start,
open_end:that.addressdetail.open_end,
store_address:that.addressdetail.store_address,
distance_text:that.addressdetail.distance_text,
}
ajaxsend(url, params, function(res) {
/*console.log(JSON.stringify(res))*/
console.log(res);
var photo=JSON.stringify(res.data.photo)
that.photo=photo;
})
}
}
})
//});