uniapp获取用户手机型号
时间: 2023-09-13 14:04:18 浏览: 201
在uni-app中,可以使用plus.device.getInfo()方法来获取用户手机的型号。该方法会返回一个包含设备信息的对象,其中包括了手机的型号信息。通过访问该对象的model属性即可获取到用户手机的型号。具体的代码可以参考以下示例:
```javascript
plus.device.getInfo({
success: function(e) {
console.log('getDeviceInfo success:', JSON.stringify(e));
var model = e.model;
console.log('手机型号:', model);
},
fail: function(e) {
console.log('getDeviceInfo failed:', JSON.stringify(e));
}
});
```
以上代码会在控制台输出用户手机的型号信息。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Java微信小程序B2C商城 H5+APP源码 前后端分离](https://download.csdn.net/download/m0_55416028/88263033)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [关于uni-app获取设备IMEI、IMSI、型号、厂商](https://blog.csdn.net/qq_35620498/article/details/112172115)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文