u-text.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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$17],
  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.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.addUnit(this.lineHeight));
  18. !this.isNvue && this.block && (style.display = "block");
  19. return common_vendor.deepMerge(style, common_vendor.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. addStyle: common_vendor.addStyle,
  36. clickHandler() {
  37. if (this.call && this.mode === "phone") {
  38. common_vendor.index.makePhoneCall({
  39. phoneNumber: this.text
  40. });
  41. }
  42. this.$emit("click");
  43. }
  44. }
  45. };
  46. if (!Array) {
  47. const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  48. const _easycom_u_link2 = common_vendor.resolveComponent("u-link");
  49. (_easycom_u_icon2 + _easycom_u_link2)();
  50. }
  51. const _easycom_u_icon = () => "../u-icon/u-icon.js";
  52. const _easycom_u_link = () => "../u-link/u-link.js";
  53. if (!Math) {
  54. (_easycom_u_icon + _easycom_u_link)();
  55. }
  56. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  57. return common_vendor.e({
  58. a: _ctx.show
  59. }, _ctx.show ? common_vendor.e({
  60. b: _ctx.mode === "price"
  61. }, _ctx.mode === "price" ? {
  62. c: common_vendor.n(_ctx.type && `u-text__value--${_ctx.type}`),
  63. d: common_vendor.s($options.valueStyle)
  64. } : {}, {
  65. e: _ctx.prefixIcon
  66. }, _ctx.prefixIcon ? {
  67. f: common_vendor.p({
  68. name: _ctx.prefixIcon,
  69. customStyle: $options.addStyle(_ctx.iconStyle)
  70. })
  71. } : {}, {
  72. g: _ctx.mode === "link"
  73. }, _ctx.mode === "link" ? {
  74. h: $options.valueStyle.fontWeight,
  75. i: $options.valueStyle.wordWrap,
  76. j: $options.valueStyle.fontSize,
  77. k: common_vendor.n(_ctx.type && `u-text__value--${_ctx.type}`),
  78. l: common_vendor.n(_ctx.lines && `u-line-${_ctx.lines}`),
  79. m: common_vendor.p({
  80. text: _ctx.value,
  81. href: _ctx.href,
  82. underLine: true
  83. })
  84. } : _ctx.openType && $options.isMp ? {
  85. o: common_vendor.t(_ctx.value),
  86. p: common_vendor.s($options.valueStyle),
  87. q: _ctx.index,
  88. r: _ctx.openType,
  89. s: common_vendor.o((...args) => _ctx.onGetUserInfo && _ctx.onGetUserInfo(...args)),
  90. t: common_vendor.o((...args) => _ctx.onContact && _ctx.onContact(...args)),
  91. v: common_vendor.o((...args) => _ctx.onGetPhoneNumber && _ctx.onGetPhoneNumber(...args)),
  92. w: common_vendor.o((...args) => _ctx.onError && _ctx.onError(...args)),
  93. x: common_vendor.o((...args) => _ctx.onLaunchApp && _ctx.onLaunchApp(...args)),
  94. y: common_vendor.o((...args) => _ctx.onOpenSetting && _ctx.onOpenSetting(...args)),
  95. z: _ctx.lang,
  96. A: _ctx.sessionFrom,
  97. B: _ctx.sendMessageTitle,
  98. C: _ctx.sendMessagePath,
  99. D: _ctx.sendMessageImg,
  100. E: _ctx.showMessageCard,
  101. F: _ctx.appParameter
  102. } : {
  103. G: common_vendor.t(_ctx.value),
  104. H: common_vendor.s($options.valueStyle),
  105. I: common_vendor.n(_ctx.type && `u-text__value--${_ctx.type}`),
  106. J: common_vendor.n(_ctx.lines && `u-line-${_ctx.lines}`)
  107. }, {
  108. n: _ctx.openType && $options.isMp,
  109. K: _ctx.suffixIcon
  110. }, _ctx.suffixIcon ? {
  111. L: common_vendor.p({
  112. name: _ctx.suffixIcon,
  113. customStyle: $options.addStyle(_ctx.iconStyle)
  114. })
  115. } : {}, {
  116. M: _ctx.margin,
  117. N: _ctx.align === "left" ? "flex-start" : _ctx.align === "center" ? "center" : "flex-end",
  118. O: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args))
  119. }) : {});
  120. }
  121. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-5fec1d8b"], ["__file", "D:/project/学吧/learn_applet/node_modules/uview-plus/components/u-text/u-text.vue"]]);
  122. wx.createComponent(Component);