shop-detail.js
1.68 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
import api from '@/api/api'
import {
httpGet,
httpPost
} from '@/api/fetch-api.js'
import ContactUsComp from '@/components/contact-us-comp/contact-us-comp.vue'
export default {
data() {
return {
key: 'value',
contactUsVisible: true,
store: {},
storeCollect: 0,
page: 1,
size: 10,
total: 0,
productList: [],
}
},
components: {
ContactUsComp
},
methods: {
toProduct(item) {
this.$router.push({
path: "/product/detail",
query: {
c: item.productCode
}
})
},
onFavoriteHandler() {
// this./
},
onContactUsHandler() {
this.contactUsVisible = true;
},
// 店铺产品列表
queryProductStore() {
httpGet({
url: api.productStore,
data: {
page: this.page,
size: this.size,
storeCode: this.$route.query.c
}
}).then((result) => {
this.productList = result.list;
this.total = result.total;
// console.log("productList:", this.productList);
console.log("productList item:", this.productList[0]);
});
},
// 店铺详情
queryStoreDetail() {
httpGet({
url: api.storeDetail,
data: {
storeCode: this.$route.query.c
}
}).then((result) => {
this.store = result.store || {};
this.storeCollect = result.storeCollect || 0;
console.log("this.store:", this.store);
console.log("this.storeCollect:", this.storeCollect);
});
},
initData() {
this.queryStoreDetail();
this.queryProductStore();
}
},
mounted() {},
created() {
this.initData();
}
}