| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 | 
							- "use strict";
 
- const common_vendor = require("../../../common/vendor.js");
 
- require("../../index.js");
 
- require("../../url/index.js");
 
- require("../../store/index.js");
 
- require("../../store/app.js");
 
- require("../../api/promotion/diy.js");
 
- require("../../request/index.js");
 
- require("../../config/index.js");
 
- require("../../platform/index.js");
 
- require("../../platform/provider/wechat/index.js");
 
- require("../../platform/provider/wechat/miniProgram.js");
 
- require("../../api/member/auth.js");
 
- require("../../api/member/social.js");
 
- require("../../api/member/user.js");
 
- require("../../platform/provider/apple/index.js");
 
- require("../../platform/share.js");
 
- require("../../router/index.js");
 
- require("../../hooks/useModal.js");
 
- require("../../helper/index.js");
 
- require("../../helper/test.js");
 
- require("../../helper/digit.js");
 
- require("../../helper/throttle.js");
 
- require("../../platform/pay.js");
 
- require("../../api/pay/order.js");
 
- require("../../store/user.js");
 
- require("../../store/cart.js");
 
- require("../../api/trade/cart.js");
 
- require("../../api/pay/wallet.js");
 
- require("../../api/trade/order.js");
 
- require("../../api/promotion/coupon.js");
 
- require("../../store/sys.js");
 
- require("../../store/modal.js");
 
- require("../../config/zIndex.js");
 
- const _sfc_main = {
 
-   name: "UniNoticeBar",
 
-   emits: ["click", "getmore", "close"],
 
-   props: {
 
-     text: {
 
-       type: String,
 
-       default: ""
 
-     },
 
-     moreText: {
 
-       type: String,
 
-       default: ""
 
-     },
 
-     backgroundColor: {
 
-       type: String,
 
-       default: ""
 
-     },
 
-     speed: {
 
-       // 默认1s滚动100px
 
-       type: Number,
 
-       default: 100
 
-     },
 
-     color: {
 
-       type: String,
 
-       default: "var(--ui-BG-Main)"
 
-     },
 
-     moreColor: {
 
-       type: String,
 
-       default: "#FF9A43"
 
-     },
 
-     single: {
 
-       // 是否单行
 
-       type: [Boolean, String],
 
-       default: false
 
-     },
 
-     scrollable: {
 
-       // 是否滚动,添加后控制单行效果取消
 
-       type: [Boolean, String],
 
-       default: false
 
-     },
 
-     showIcon: {
 
-       // 是否显示左侧icon
 
-       type: [Boolean, String],
 
-       default: false
 
-     },
 
-     showGetMore: {
 
-       // 是否显示右侧查看更多
 
-       type: [Boolean, String],
 
-       default: false
 
-     },
 
-     showClose: {
 
-       // 是否显示左侧关闭按钮
 
-       type: [Boolean, String],
 
-       default: false
 
-     }
 
-   },
 
-   data() {
 
-     const elId = `Uni_${Math.ceil(Math.random() * 1e6).toString(36)}`;
 
-     const elIdBox = `Uni_${Math.ceil(Math.random() * 1e6).toString(36)}`;
 
-     return {
 
-       textWidth: 0,
 
-       boxWidth: 0,
 
-       wrapWidth: "",
 
-       webviewHide: false,
 
-       elId,
 
-       elIdBox,
 
-       show: true,
 
-       animationDuration: "none",
 
-       animationPlayState: "paused",
 
-       animationDelay: "0s"
 
-     };
 
-   },
 
-   mounted() {
 
-     this.$nextTick(() => {
 
-       this.initSize();
 
-     });
 
-   },
 
-   methods: {
 
-     initSize() {
 
-       if (this.scrollable) {
 
-         let query = [];
 
-         let textQuery = new Promise((resolve, reject) => {
 
-           common_vendor.index.createSelectorQuery().in(this).select(`#${this.elId}`).boundingClientRect().exec((ret) => {
 
-             this.textWidth = ret[0].width;
 
-             resolve();
 
-           });
 
-         });
 
-         let boxQuery = new Promise((resolve, reject) => {
 
-           common_vendor.index.createSelectorQuery().in(this).select(`#${this.elIdBox}`).boundingClientRect().exec((ret) => {
 
-             this.boxWidth = ret[0].width;
 
-             resolve();
 
-           });
 
-         });
 
-         query.push(textQuery);
 
-         query.push(boxQuery);
 
-         Promise.all(query).then(() => {
 
-           this.animationDuration = `${this.textWidth / this.speed}s`;
 
-           this.animationDelay = `-${this.boxWidth / this.speed}s`;
 
-           setTimeout(() => {
 
-             this.animationPlayState = "running";
 
-           }, 1e3);
 
-         });
 
-       }
 
-     },
 
-     loopAnimation() {
 
-     },
 
-     clickMore() {
 
-       this.$emit("getmore");
 
-     },
 
-     close() {
 
-       this.show = false;
 
-       this.$emit("close");
 
-     },
 
-     onClick() {
 
-       this.$emit("click");
 
-     }
 
-   }
 
- };
 
- if (!Array) {
 
-   const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
 
-   _easycom_uni_icons2();
 
- }
 
- const _easycom_uni_icons = () => "../../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
 
- if (!Math) {
 
-   _easycom_uni_icons();
 
- }
 
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
 
-   return common_vendor.e({
 
-     a: $data.show
 
-   }, $data.show ? common_vendor.e({
 
-     b: $props.showIcon === true || $props.showIcon === "true"
 
-   }, $props.showIcon === true || $props.showIcon === "true" ? {
 
-     c: common_vendor.p({
 
-       type: "sound",
 
-       color: $props.color,
 
-       size: "22"
 
-     })
 
-   } : {}, {
 
-     d: common_vendor.t($props.text),
 
-     e: $data.elId,
 
-     f: $props.scrollable ? 1 : "",
 
-     g: !$props.scrollable && ($props.single || $props.showGetMore) ? 1 : "",
 
-     h: $props.color,
 
-     i: $data.wrapWidth + "px",
 
-     j: $data.animationDuration,
 
-     k: $data.animationDuration,
 
-     l: $data.webviewHide ? "paused" : $data.animationPlayState,
 
-     m: $data.webviewHide ? "paused" : $data.animationPlayState,
 
-     n: $data.animationDelay,
 
-     o: $data.animationDelay,
 
-     p: $data.elIdBox,
 
-     q: $props.scrollable ? 1 : "",
 
-     r: !$props.scrollable && ($props.single || $props.moreText) ? 1 : "",
 
-     s: $props.scrollable ? 1 : "",
 
-     t: !$props.scrollable && ($props.single || $props.moreText) ? 1 : "",
 
-     v: $props.showGetMore === true || $props.showGetMore === "true"
 
-   }, $props.showGetMore === true || $props.showGetMore === "true" ? common_vendor.e({
 
-     w: $props.moreText.length > 0
 
-   }, $props.moreText.length > 0 ? {
 
-     x: common_vendor.t($props.moreText),
 
-     y: $props.moreColor
 
-   } : {
 
-     z: common_vendor.p({
 
-       type: "right",
 
-       color: $props.moreColor,
 
-       size: "16"
 
-     })
 
-   }, {
 
-     A: common_vendor.o((...args) => $options.clickMore && $options.clickMore(...args))
 
-   }) : {}, {
 
-     B: ($props.showClose === true || $props.showClose === "true") && ($props.showGetMore === false || $props.showGetMore === "false")
 
-   }, ($props.showClose === true || $props.showClose === "true") && ($props.showGetMore === false || $props.showGetMore === "false") ? {
 
-     C: common_vendor.p({
 
-       type: "closeempty",
 
-       color: $props.color,
 
-       size: "16"
 
-     }),
 
-     D: common_vendor.o((...args) => $options.close && $options.close(...args))
 
-   } : {}, {
 
-     E: $props.backgroundColor,
 
-     F: common_vendor.o((...args) => $options.onClick && $options.onClick(...args))
 
-   }) : {});
 
- }
 
- const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-8eee8640"], ["__file", "/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-app/sheep/ui/su-notice-bar/su-notice-bar.vue"]]);
 
- wx.createComponent(Component);
 
 
  |