index.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. "use strict";
  2. var common_vendor = require("../common/vendor.js");
  3. var api_companyUser = require("../api/companyUser.js");
  4. require("../common/request.js");
  5. const _sfc_main = {
  6. data() {
  7. return {
  8. companyId: null,
  9. companyUserId: null,
  10. user: null
  11. };
  12. },
  13. onLoad() {
  14. },
  15. onShow() {
  16. this.companyId = common_vendor.index.getStorageSync("companyId");
  17. this.companyUserId = common_vendor.index.getStorageSync("companyUserId");
  18. console.log(this.companyUserId);
  19. this.getUserInfo();
  20. },
  21. onShareAppMessage(res) {
  22. return {
  23. title: "\u95EE\u8BCA",
  24. path: "/pages/TUIKit/TUIPages/TUIConversation/index",
  25. imageUrl: "https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png"
  26. };
  27. },
  28. methods: {
  29. navTo(url) {
  30. common_vendor.index.navigateTo({
  31. url
  32. });
  33. },
  34. getUserInfo() {
  35. var data = {};
  36. api_companyUser.getUserInfo(data).then((res) => {
  37. if (res.code == 200) {
  38. this.user = res.data;
  39. } else {
  40. common_vendor.index.setStorageSync("CompanyUserToken", null);
  41. common_vendor.index.showToast({
  42. icon: "none",
  43. title: res.msg
  44. });
  45. common_vendor.index.navigateBack({
  46. delta: -1
  47. });
  48. }
  49. }, (rej) => {
  50. });
  51. },
  52. logout() {
  53. common_vendor.index.showModal({
  54. title: "\u63D0\u793A",
  55. content: "\u786E\u8BA4\u9000\u51FA\u767B\u5F55\u5417?",
  56. showCancel: true,
  57. cancelText: "\u53D6\u6D88",
  58. confirmText: "\u786E\u5B9A",
  59. success: (res) => {
  60. if (res.confirm) {
  61. common_vendor.index.setStorageSync("CompanyUserToken", null);
  62. common_vendor.index.navigateBack({
  63. delta: -1
  64. });
  65. }
  66. }
  67. });
  68. },
  69. navgetTo(url) {
  70. this.$isLogin().then((res) => {
  71. if (res) {
  72. common_vendor.index.navigateTo({
  73. url
  74. });
  75. }
  76. });
  77. }
  78. }
  79. };
  80. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  81. return common_vendor.e({
  82. a: $data.user != null
  83. }, $data.user != null ? {
  84. b: common_vendor.t($data.user.nickName)
  85. } : {}, {
  86. c: $data.user != null
  87. }, $data.user != null ? {
  88. d: common_vendor.t(_ctx.$parsePhone($data.user.phonenumber))
  89. } : {}, {
  90. e: $data.user != null
  91. }, $data.user != null ? {
  92. f: common_vendor.t($data.user.deptName)
  93. } : {}, {
  94. g: common_vendor.o(($event) => $options.navTo("/pages_company/couponList?isShare=1&couponType=5")),
  95. h: common_vendor.o(($event) => $options.navTo("/pages_company/couponList?isShare=1&couponType=2")),
  96. i: common_vendor.o(($event) => $options.navTo("/pages_company/packageList")),
  97. j: common_vendor.o(($event) => $options.navTo("/pages_order/inquirySelectType?companyId=" + $data.companyId + "&companyUserId=" + $data.companyUserId + "&isShare=1")),
  98. k: common_vendor.o(($event) => $options.navTo("/pages_order/inquirySelect?inquiryType=3&companyId=" + $data.companyId + "&companyUserId=" + $data.companyUserId + "&isShare=1")),
  99. l: common_vendor.o(($event) => $options.navTo("/pages_company/packageOrderList")),
  100. m: common_vendor.o(($event) => $options.navTo("/pages_company/inquiryOrderList")),
  101. n: common_vendor.o(($event) => $options.navTo("/pages_company/storeOrderList")),
  102. o: common_vendor.o(($event) => $options.navTo("/pages_user/healthRecords/index")),
  103. p: common_vendor.o((...args) => $options.logout && $options.logout(...args))
  104. });
  105. }
  106. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_company/index.vue"]]);
  107. _sfc_main.__runtimeHooks = 2;
  108. wx.createPage(MiniProgramPage);