info.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. const app = getApp()
  2. Page({
  3. data: {
  4. },
  5. onUnload(){
  6. if(this.innerAudioContext)this.innerAudioContext.stop()
  7. },
  8. onLoad: function (options) {
  9. const {imei,devicetype} = options;
  10. var that = this
  11. app.requestP({
  12. url: "/query/scanChip2",
  13. method:"post",
  14. needToken:false,
  15. contentType:' application/json',
  16. data:{
  17. payload:imei,
  18. deviceType:devicetype,
  19. }
  20. }).then(function(res){
  21. // var data = res.data
  22. var temp = res.data.data.warning
  23. if(temp == 1){
  24. const innerAudioContext = wx.createInnerAudioContext()
  25. innerAudioContext.autoplay = true
  26. innerAudioContext.src = 'http://oss.zhongyihz.cn/group156/default/20210618/15/56/6/niyouyigexyfyhe.mp3'
  27. that.innerAudioContext = innerAudioContext
  28. }
  29. that.setData({
  30. info:res.data.data
  31. })
  32. }).catch(function(err){
  33. app.showToptip(that,'error',err.data.msg);
  34. setTimeout(() => {
  35. wx.navigateBack()
  36. }, 2000);
  37. })
  38. },
  39. copyTxt(){
  40. var txt = "IMEI:"+this.data.info.imei+" ICCID:"+this.data.info.iccid
  41. wx.setClipboardData({
  42. data:txt
  43. })
  44. }
  45. })