hand.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // pages/tabber/news/index.js
  2. const app=getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. selectInfo: {},
  9. orderSn:'',
  10. admin_type:1,
  11. networker_id:0
  12. },
  13. /**
  14. * 生命周期函数--监听页面加载
  15. */
  16. onLoad: function (options) {
  17. class Select {
  18. in = 1
  19. getSelet(){
  20. console.log(2);
  21. return 10
  22. }
  23. }
  24. var b = new Select();
  25. console.log(b.getSelet());
  26. let admin_type=options.admin_type//1物流员;2代收点
  27. let networker_id= options.networker_id
  28. this.setData({
  29. admin_type,
  30. networker_id
  31. })
  32. },
  33. bindinput(e){
  34. this.setData({
  35. orderSn:e.detail.value,
  36. })
  37. },
  38. /**
  39. * 生命周期函数--监听页面初次渲染完成
  40. */
  41. onReady: function () {
  42. const query = wx.createSelectorQuery()
  43. query.select('#nav').boundingClientRect((res) => {
  44. console.log(res);
  45. this.setData({
  46. selectInfo: res
  47. })
  48. })
  49. query.exec()
  50. },
  51. onSubmit:function(){
  52. var that=this
  53. if(that.data.orderSn=='')
  54. return wx.showToast({title: '物流号不能为空',icon:'none'})
  55. app.api.useApi(app.globalData.baseAppUrl + "api/admin/CodeSign", {
  56. order_no: that.data.orderSn,
  57. admin_type:that.data.admin_type,//1物流员;2代收点
  58. networker_id:that.data.networker_id,
  59. }, "post").then(function (res) {
  60. wx.hideLoading();
  61. if (res.code== 200) {
  62. wx.showToast({title: res.message.msg,icon:'none'})
  63. }else
  64. wx.showModal({
  65. title: '异常',
  66. content: res.message.msg,
  67. showCancel:false,
  68. success (res) {
  69. if (res.confirm) {
  70. console.log('用户点击确定')
  71. } else if (res.cancel) {
  72. console.log('用户点击取消')
  73. }
  74. }
  75. })
  76. }).catch(function (err) {
  77. console.log(222);
  78. })
  79. },
  80. })