feat: 识别码机,追加商米SN标识

This commit is contained in:
liangzilin
2023-11-14 16:39:16 +08:00
parent 14b6100257
commit ea15f8e02b
3 changed files with 20 additions and 23 deletions

View File

@@ -130,21 +130,31 @@ export default {
onLoad() {
uni.showLoading();
// 写死
// this.machineId = "861299032410223";
// this.getShopInfoApi();
// return;
// #ifdef APP-PLUS
let imelSet = []
var Build = plus.android.importClass("android.os.Build");
var SystemProperties = plus.android.importClass("android.os.SystemProperties");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
imelSet.push(SystemProperties.get('ro.sunmi.serial'))
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
imelSet.push(Build.getSerial())
} else{
imelSet.push(Build.SERIAL)
}
plus.device.getInfo({
success: (e) => {
const imei = e.imei.split(",");
this.machineId = imei[0];
imelSet.push(imei[0])
this.machineId = imelSet.join(',');
this.getShopInfoApi();
},
fail: function (e) {
console.log("getDeviceInfo failed: " + JSON.stringify(e));
},
});
// #endif
},
methods: {
// 人数