u-text.js 4.5 KB

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