test.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // pages/test/test.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. },
  8. /**
  9. * 生命周期函数--监听页面加载
  10. */
  11. onLoad: function(options) {
  12. wx.getSystemInfo({
  13. success(res) {
  14. var arr = [{
  15. label: '品牌',
  16. type: 'brand',
  17. value: res.brand
  18. },
  19. {
  20. label: '型号',
  21. type: 'model',
  22. value: res.model
  23. },
  24. {
  25. label: '系统平台',
  26. type: 'platform',
  27. value: res.platform
  28. },
  29. {
  30. label: '系统版本',
  31. type: 'system',
  32. value: res.system,
  33. },
  34. {
  35. label: '微信版本',
  36. type: 'version',
  37. value: res.version
  38. },
  39. {
  40. label: '小程序版本',
  41. type: 'SDKVersion',
  42. value: res.SDKVersion
  43. },
  44. {
  45. label: '定位状态',
  46. type: 'locationEnabled',
  47. value: res.locationEnabled ? '开' : '关'
  48. },
  49. {
  50. label: '定位授权',
  51. type: 'locationAuthorized',
  52. value: res.locationAuthorized ? '已授权': '未授权'
  53. }
  54. ]
  55. wx.request({
  56. url: 'http://api.xiaobanma.com/api/t',
  57. methods:'GET',
  58. data:{
  59. phone_detail:arr
  60. },
  61. success:function(res){
  62. console.log(res);
  63. }
  64. })
  65. }
  66. })
  67. },
  68. /**
  69. * 生命周期函数--监听页面初次渲染完成
  70. */
  71. onReady: function() {
  72. },
  73. /**
  74. * 生命周期函数--监听页面显示
  75. */
  76. onShow: function() {
  77. },
  78. /**
  79. * 生命周期函数--监听页面隐藏
  80. */
  81. onHide: function() {
  82. },
  83. /**
  84. * 生命周期函数--监听页面卸载
  85. */
  86. onUnload: function() {
  87. },
  88. /**
  89. * 页面相关事件处理函数--监听用户下拉动作
  90. */
  91. onPullDownRefresh: function() {
  92. },
  93. /**
  94. * 页面上拉触底事件的处理函数
  95. */
  96. onReachBottom: function() {
  97. },
  98. /**
  99. * 用户点击右上角分享
  100. */
  101. onShareAppMessage: function() {
  102. }
  103. })