detal.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // pages/tabber/news/index.js
  2. const app=getApp();
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. selectdetail: {},
  9. img:{
  10. 大衣外套:'/image/icon/dayiwaitao.png',
  11. 家纺:'/image/icon/jiafang',
  12. 库类:'/image/icon/kulei.png',
  13. 配件:'/image/icon/peijian.png',
  14. 皮衣:'/image/icon/piyi.png',
  15. 裙类:'/image/icon/qunlei.png',
  16. 上衣:'/image/icon/shangyi.png',
  17. 箱包:'/image/icon/xiangbao.png',
  18. 鞋类:'/image/icon/xixie.png',
  19. }
  20. },
  21. /**
  22. * 生命周期函数--监听页面加载
  23. */
  24. onLoad: function (options) {
  25. class Select {
  26. in = 1
  27. getSelet(){
  28. console.log(2);
  29. return 10
  30. }
  31. }
  32. var b = new Select();
  33. console.log(b.getSelet());
  34. this.serchdetail(options.id)
  35. },
  36. /**
  37. * 生命周期函数--监听页面初次渲染完成
  38. */
  39. onReady: function () {
  40. const query = wx.createSelectorQuery()
  41. query.select('#nav').boundingClientRect((res) => {
  42. console.log(res);
  43. this.setData({
  44. selectInfo: res
  45. })
  46. })
  47. query.exec()
  48. },
  49. serchdetail(id){
  50. var that=this;
  51. app.api.useApi(app.globalData.baseAppUrl + "api/admin/WaybillDetails", {
  52. id: id,
  53. }, "get").then(function (res) {
  54. console.log(res);
  55. if (res.code != 200) {
  56. wx.showLoading({
  57. title: res.message.msg,
  58. })
  59. setTimeout(function () {
  60. wx.hideLoading();
  61. }, 1000);
  62. } else {
  63. wx.hideLoading();
  64. that.setData({
  65. selectdetail:res.message.data
  66. })
  67. }
  68. }).catch(function (err) {
  69. console.log(222);
  70. })
  71. },
  72. tel(e){
  73. wx.makePhoneCall({
  74. phoneNumber: e.currentTarget.dataset.phone //仅为示例,并非真实的电话号码
  75. })
  76. }
  77. })