zl程序教程

您现在的位置是:首页 >  其他

当前栏目

uni、小程序——扫码

程序 uni 扫码
2023-09-14 09:04:08 时间

代码

// 调起扫码
scanCode(index) {
	uni.scanCode({
		success: (res) => {
			// console.log('条码内容:' + res.result);
			uni.showModal({
				title: "提示",
				content: '确定核销这笔订单吗?',
				success: (r) => {
					if (r.confirm) {
						// 扫码核销接口
						this.$common.request('post', '/user/deliverGoods', {
							order_id: this.list[index].id,
							type: 2,
							pick_up_code: res.result
						}).then(res => {
							if (res.code == 1) {
								this.$common.success(res.msg)
								this.getList()
							}
						})
					}
				}
			})
		}
	});
}