report.js
955 Bytes
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
export default {
data () {
return {
goodsId: '',
visitsId: '',
source: 1
}
},
onLoad (options) {
this.visitsId = options.visitsId || ''
this.goodsId = options.id
if (options.source) this.source = options.source
this.addRecord()
},
methods: {
addRecord () {
const { shopMerchantId: merchantId, shopMerchantName: merchantName } = uni.$storage.get('userInfo')
const params = {
goodsId: this.goodsId,
goodsType: 0,
merchantId,
merchantName,
searchSource: this.source
}
if (this.visitsId) params.visitsId = this.visitsId
uni.$api.commonApi.addRecord(params).then(res => {
this.addId = res
})
}
},
onUnload () {
const params = {
id: this.addId
}
if (this.visitsId) params.visitsId = this.visitsId
uni.$api.commonApi.leaveRecord(params).then(res => {
console.log(res, 888)
})
}
}