@uxda/appkit 4.2.78 → 4.2.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4990,7 +4990,8 @@ const _hoisted_2$c = { style: { "white-space": "pre-wrap" } };
4990
4990
  var script$i = /* @__PURE__ */ defineComponent({
4991
4991
  __name: "NoticePopup",
4992
4992
  props: {
4993
- message: { type: null, required: true, default: {} }
4993
+ message: { type: null, required: true, default: {} },
4994
+ device: { type: String, required: false, default: "MINI" }
4994
4995
  },
4995
4996
  emits: ["close", "view"],
4996
4997
  setup(__props, { emit: __emit }) {
@@ -5009,7 +5010,7 @@ var script$i = /* @__PURE__ */ defineComponent({
5009
5010
  async function onClose() {
5010
5011
  const $http = useHttp$1();
5011
5012
  $http.post("/cas/msg/setMsgStatus", {
5012
- device: "MINI",
5013
+ device: props.device || "MINI",
5013
5014
  noticeStatus: 0,
5014
5015
  receiveId: props.message.id
5015
5016
  }).then(() => {
@@ -5104,7 +5105,8 @@ var script$h = /* @__PURE__ */ defineComponent({
5104
5105
  props: {
5105
5106
  app: { type: String, required: true, default: "" },
5106
5107
  bannerStyle: { type: null, required: false, default: "" },
5107
- fixed: { type: Boolean, required: false, default: false }
5108
+ fixed: { type: Boolean, required: false, default: false },
5109
+ device: { type: String, required: false, default: "MINI" }
5108
5110
  },
5109
5111
  emits: ["detail", "close", "view", "popup", "hasBanner"],
5110
5112
  setup(__props, { emit: __emit }) {
@@ -5140,7 +5142,7 @@ var script$h = /* @__PURE__ */ defineComponent({
5140
5142
  const appkitOptions = useAppKitOptions();
5141
5143
  const $http = useHttp$1();
5142
5144
  $http.post("/cas/msg/queryNoticeMsg", {
5143
- device: "MINI",
5145
+ device: props.device || "MINI",
5144
5146
  deviceType: 2,
5145
5147
  msgType: 3,
5146
5148
  appCode: props.app || appkitOptions.app(),
@@ -5180,8 +5182,7 @@ var script$h = /* @__PURE__ */ defineComponent({
5180
5182
  stopMessageCarousel();
5181
5183
  const $http = useHttp$1();
5182
5184
  $http.post("/cas/msg/setMsgStatus", {
5183
- device: "MINI",
5184
- deviceType: 0,
5185
+ device: props.device || "MINI",
5185
5186
  noticeStatus: 1,
5186
5187
  receiveId: item.id
5187
5188
  }).then(() => {
@@ -5209,6 +5210,11 @@ var script$h = /* @__PURE__ */ defineComponent({
5209
5210
  startMessageCarousel();
5210
5211
  }, 100);
5211
5212
  const emits = __emit;
5213
+ function onPopupClose() {
5214
+ setTimeout(() => {
5215
+ popMessages.value.splice(0, 1);
5216
+ }, 100);
5217
+ }
5212
5218
  return (_ctx, _cache) => {
5213
5219
  return openBlock(), createElementBlock(
5214
5220
  Fragment,
@@ -5236,7 +5242,7 @@ var script$h = /* @__PURE__ */ defineComponent({
5236
5242
  onClose: ($event) => unref(onClose)(item, key)
5237
5243
  }, {
5238
5244
  default: withCtx(() => [
5239
- _cache[3] || (_cache[3] = createElementVNode(
5245
+ _cache[2] || (_cache[2] = createElementVNode(
5240
5246
  "img",
5241
5247
  {
5242
5248
  class: "notice-banner-icon",
@@ -5273,10 +5279,11 @@ var script$h = /* @__PURE__ */ defineComponent({
5273
5279
  createCommentVNode(" \u7CFB\u7EDF\u516C\u544A\u5F3A\u5236\u5F39\u6846 "),
5274
5280
  popMessages.value.length ? (openBlock(), createBlock(script$i, {
5275
5281
  key: 1,
5282
+ device: _ctx.device,
5276
5283
  message: popMessages.value[0],
5277
- onClose: _cache[1] || (_cache[1] = ($event) => popMessages.value.splice(0, 1)),
5278
- onView: _cache[2] || (_cache[2] = ($event) => onView(popMessages.value[0]))
5279
- }, null, 8, ["message"])) : createCommentVNode("v-if", true)
5284
+ onClose: onPopupClose,
5285
+ onView: _cache[1] || (_cache[1] = ($event) => onView(popMessages.value[0]))
5286
+ }, null, 8, ["device", "message"])) : createCommentVNode("v-if", true)
5280
5287
  ],
5281
5288
  64
5282
5289
  /* STABLE_FRAGMENT */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "4.2.78",
3
+ "version": "4.2.79",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
 
14
14
  <!-- 系统公告强制弹框 -->
15
- <NoticePopup v-if="popMessages.length" :message="popMessages[0]" @close="popMessages.splice(0, 1)"
15
+ <NoticePopup v-if="popMessages.length" :device="device" :message="popMessages[0]" @close="onPopupClose"
16
16
  @view="onView(popMessages[0])" />
17
17
  </template>
18
18
 
@@ -32,11 +32,13 @@ const props = withDefaults(
32
32
  app: string
33
33
  bannerStyle?: any
34
34
  fixed?: boolean
35
+ device?: string
35
36
  }>(),
36
37
  {
37
38
  app: '',
38
39
  bannerStyle: '',
39
40
  fixed: false,
41
+ device: 'MINI',
40
42
  }
41
43
  )
42
44
 
@@ -78,7 +80,7 @@ async function queryNoticeMsg() {
78
80
  const $http = useHttp()
79
81
  $http
80
82
  .post('/cas/msg/queryNoticeMsg', {
81
- device: 'MINI',
83
+ device: props.device || 'MINI',
82
84
  deviceType: 2,
83
85
  msgType: 3,
84
86
  appCode: props.app || appkitOptions.app(),
@@ -128,8 +130,7 @@ const onClose = debounce((item: any, index: number) => {
128
130
  const $http = useHttp()
129
131
  $http
130
132
  .post('/cas/msg/setMsgStatus', {
131
- device: 'MINI',
132
- deviceType: 0,
133
+ device: props.device || 'MINI',
133
134
  noticeStatus: 1,
134
135
  receiveId: item.id,
135
136
  })
@@ -173,6 +174,12 @@ const onTouchEnd = debounce(() => {
173
174
 
174
175
  // 父组件事件
175
176
  const emits = defineEmits(['detail', 'close', 'view', 'popup', 'hasBanner'])
177
+
178
+ function onPopupClose() {
179
+ setTimeout(() => {
180
+ popMessages.value.splice(0, 1)
181
+ }, 100);
182
+ }
176
183
  </script>
177
184
 
178
185
  <style lang="scss">
@@ -23,9 +23,11 @@ import { useHttp } from '../api'
23
23
  const props = withDefaults(
24
24
  defineProps<{
25
25
  message: any
26
+ device?: string
26
27
  }>(),
27
28
  {
28
29
  message: {},
30
+ device: 'MINI',
29
31
  }
30
32
  )
31
33
 
@@ -53,7 +55,7 @@ async function onClose() {
53
55
 
54
56
  $http
55
57
  .post('/cas/msg/setMsgStatus', {
56
- device: 'MINI',
58
+ device: props.device || 'MINI',
57
59
  noticeStatus: 0,
58
60
  receiveId: props.message.id,
59
61
  })