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
|
| // const app = getApp<IAppOption>();
| Component({
| /**
| * 组件的属性列表
| */
| options: {
| addGlobalClass:true,
| multipleSlots: true // 在组件定义时的选项中启用多slot支持
| },
| properties: {
| detail:{
| type: Object,
| value: {}
| },
| sellerList:{
| type: Array,
| value: []
| },
| },
| observers:{ //观察者:属性监听
| 'detail'(data) { //单个监听
| console.log('数据改变了',data)
| if (JSON.stringify(data) != '{}'){
| let imgList = [] as any;
| data.imagesUrl.forEach((item:any)=>{
| imgList.push(item.url)
| })
| this.setData({
| imgList
| })
| }
| },
| },
|
| /**
| * 组件的初始数据
| */
| data: {
| // location: undefined,
| imgList:[]
| },
| lifetimes:{
| ready(){
| this.getHadRelationList()
| }
| },
| pageLifetimes: {
| show: function() {
| // 页面被展示
|
| },
| hide() {
|
| }
| },
| /**
| * 组件的方法列表
| */
| methods: {
| async getHadRelationList(){
| let doccode = this.data.detail.doccode;
| let [error, result] = await wx.$utils.to(
| wx.$http.request({
| url:`/shopping/panicBuying.do?m=getHadRelationList`,
| data:{
| doccode
| }
| })
| )
| if (error){
| console.log(error);
| return;
| }
| console.log(result);
| this.setData({
| hadRelationList:result.hadRelationList
| })
| },
| /*查看图片*/
| // viewImg(e){
| // let src = e.currentTarget.dataset.src;
| // // console.log(src)
| // wx.previewImage({
| // current: src, // 当前显示图片的http链接
| // urls: this.data.imgList // 需要预览的图片http链接列表
| // })
| // },
| }
| })
|
|