u-text.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. "use strict";
  2. const common_vendor = require("../../../../common/vendor.js");
  3. const _sfc_main = {
  4. name: "u--text",
  5. mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.value, common_vendor.button, common_vendor.openType, common_vendor.props$15],
  6. emits: ["click"],
  7. computed: {
  8. valueStyle() {
  9. const style = {
  10. textDecoration: this.decoration,
  11. fontWeight: this.bold ? "bold" : "normal",
  12. wordWrap: this.wordWrap,
  13. fontSize: common_vendor.index.$u.addUnit(this.size)
  14. };
  15. !this.type && (style.color = this.color);
  16. this.isNvue && this.lines && (style.lines = this.lines);
  17. this.lineHeight && (style.lineHeight = common_vendor.index.$u.addUnit(this.lineHeight));
  18. !this.isNvue && this.block && (style.display = "block");
  19. return common_vendor.index.$u.deepMerge(style, common_vendor.index.$u.addStyle(this.customStyle));
  20. },
  21. isNvue() {
  22. let nvue = false;
  23. return nvue;
  24. },
  25. isMp() {
  26. let mp = false;
  27. mp = true;
  28. return mp;
  29. }
  30. },
  31. data() {
  32. return {};
  33. },
  34. methods: {
  35. clickHandler() {
  36. if (this.call && this.mode === "phone") {
  37. common_vendor.index.makePhoneCall({
  38. phoneNumber: this.text
  39. });
  40. }
  41. this.$emit("click");
  42. }
  43. }
  44. };
  45. if (!Array) {
  46. const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  47. const _easycom_u_link2 = common_vendor.resolveComponent("u-link");
  48. (_easycom_u_icon2 + _easycom_u_link2)();
  49. }
  50. const _easycom_u_icon = () => "../u-icon/u-icon.js";
  51. const _easycom_u_link = () => "../u-link/u-link.js";
  52. if (!Math) {
  53. (_easycom_u_icon + _easycom_u_link)();
  54. }
  55. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  56. return common_vendor.e({
  57. a: _ctx.show
  58. }, _ctx.show ? common_vendor.e({
  59. b: _ctx.mode === "price"
  60. }, _ctx.mode === "price" ? {
  61. c: common_vendor.n(_ctx.type && `u-text__value--${_ctx.type}`),
  62. d: common_vendor.s($options.valueStyle)
  63. } : {}, {
  64. e: _ctx.prefixIcon
  65. }, _ctx.prefixIcon ? {
  66. f: common_vendor.p({
  67. name: _ctx.prefixIcon,
  68. customStyle: _ctx.$u.addStyle(_ctx.iconStyle)
  69. })
  70. } : {}, {
  71. g: _ctx.mode === "link"
  72. }, _ctx.mode === "link" ? {
  73. h: common_vendor.p({
  74. text: _ctx.value,
  75. href: _ctx.href,
  76. underLine: true
  77. })
  78. } : _ctx.openType && $options.isMp ? {
  79. j: common_vendor.t(_ctx.value),
  80. k: common_vendor.s($options.valueStyle),
  81. l: _ctx.index,
  82. m: _ctx.openType,
  83. n: common_vendor.o((...args) => _ctx.onGetUserInfo && _ctx.onGetUserInfo(...args)),
  84. o: common_vendor.o((...args) => _ctx.onContact && _ctx.onContact(...args)),
  85. p: common_vendor.o((...args) => _ctx.onGetPhoneNumber && _ctx.onGetPhoneNumber(...args)),
  86. q: common_vendor.o((...args) => _ctx.onError && _ctx.onError(...args)),
  87. r: common_vendor.o((...args) => _ctx.onLaunchApp && _ctx.onLaunchApp(...args)),
  88. s: common_vendor.o((...args) => _ctx.onOpenSetting && _ctx.onOpenSetting(...args)),
  89. t: _ctx.lang,
  90. v: _ctx.sessionFrom,
  91. w: _ctx.sendMessageTitle,
  92. x: _ctx.sendMessagePath,
  93. y: _ctx.sendMessageImg,
  94. z: _ctx.showMessageCard,
  95. A: _ctx.appParameter
  96. } : {
  97. B: common_vendor.t(_ctx.value),
  98. C: common_vendor.s($options.valueStyle),
  99. D: common_vendor.n(_ctx.type && `u-text__value--${_ctx.type}`),
  100. E: common_vendor.n(_ctx.lines && `u-line-${_ctx.lines}`)
  101. }, {
  102. i: _ctx.openType && $options.isMp,
  103. F: _ctx.suffixIcon
  104. }, _ctx.suffixIcon ? {
  105. G: common_vendor.p({
  106. name: _ctx.suffixIcon,
  107. customStyle: _ctx.$u.addStyle(_ctx.iconStyle)
  108. })
  109. } : {}, {
  110. H: _ctx.margin,
  111. I: _ctx.align === "left" ? "flex-start" : _ctx.align === "center" ? "center" : "flex-end",
  112. J: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args))
  113. }) : {});
  114. }
  115. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-5fec1d8b"], ["__file", "D:/project/赋强公证/notarization_applet/node_modules/uview-plus/components/u-text/u-text.vue"]]);
  116. wx.createComponent(Component);