const _Http = getApp().globalData.http;
Component({
	data: {
		steps: [],
		sa_logisticsid: 0,
		content: {
			nocache: true,
			pageNumber: 1,
			pageTotal: 1,
			total: null
		}
	},
	methods: {
		copyNum(e) {
			if (this.data.un) wx.setClipboardData({
				data: this.data.un,
				success: function (res) {
					wx.showToast({
						title: '快递单号复制成功',
						icon: "none"
					})
				}
			})
		},
		getList(id) {
			let content = this.data.content;
			content.sa_logisticsid = id;
			_Http.basic({
				"id": "20230110135004",
				content
			}).then(res => {
				console.log("物流查询", res)
				if (res.msg != '成功') return wx.showToast({
					title: JSON.parse(res.msg).message,
					icon: "none"
				})
				if (res.data.message) this.setData({
					steps: res.data.data.map(v => {
						return {
							text: v.time,
							desc: v.context
						}
					}),
					nu: res.data.nu,
					"content.total": 1,
					sa_logisticsid: id
				})
			})
		}
	}
})