@uxda/appkit 4.2.85 → 4.2.88

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/appkit.css CHANGED
@@ -2701,8 +2701,6 @@ page {
2701
2701
  --nut-primary-color: #017fff;
2702
2702
  position: absolute;
2703
2703
  top: -36px;
2704
- left: 50%;
2705
- transform: translateX(-50%);
2706
2704
  white-space: nowrap;
2707
2705
  display: flex;
2708
2706
  align-items: center;
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ import '@nutui/nutui-taro/dist/packages/datepicker/style/css';
16
16
  import dayjs from 'dayjs';
17
17
  import groupBy from 'lodash-es/groupBy';
18
18
  import { ScrollView, Swiper, SwiperItem } from '@tarojs/components';
19
+ import dsBridge from 'dsbridge';
19
20
  import { IconFont } from '@nutui/icons-vue-taro';
20
21
  import '@nutui/nutui-taro/dist/packages/form/style/css';
21
22
  import '@nutui/nutui-taro/dist/packages/formitem/style/css';
@@ -2988,6 +2989,24 @@ var script$u = /* @__PURE__ */ defineComponent({
2988
2989
 
2989
2990
  script$u.__file = "src/balance/components/Tip.vue";
2990
2991
 
2992
+ function dataURItoBlob(dataURI) {
2993
+ const byteString = atob(dataURI.split(",")[1]);
2994
+ const mimeString = dataURI.split(",")[0].split(":")[1].split(";")[0];
2995
+ const ab = new ArrayBuffer(byteString.length);
2996
+ const ia = new Uint8Array(ab);
2997
+ for (let i = 0; i < byteString.length; i++) {
2998
+ ia[i] = byteString.charCodeAt(i);
2999
+ }
3000
+ return new Blob([ab], { type: mimeString });
3001
+ }
3002
+ function isWeb() {
3003
+ const env = process.env.TARO_ENV || "";
3004
+ return env === "h5" || Taro.getEnv() === "WEB";
3005
+ }
3006
+ function isApp() {
3007
+ return dsBridge.hasNativeMethod("openWebPage");
3008
+ }
3009
+
2991
3010
  const _hoisted_1$q = { class: "account-view" };
2992
3011
  const _hoisted_2$j = { class: "scroll-content" };
2993
3012
  const _hoisted_3$d = { class: "balance" };
@@ -3186,9 +3205,6 @@ var script$t = /* @__PURE__ */ defineComponent({
3186
3205
  }
3187
3206
  loadNextPage();
3188
3207
  };
3189
- computed(() => {
3190
- return rulesPopupOpen.value || datePickerOpen.value || filterOpen.value || secondBalanceOpen.value;
3191
- });
3192
3208
  const secondBalanceOpen = ref(false);
3193
3209
  function onSecondBalanceButtonClick() {
3194
3210
  secondBalanceOpen.value = true;
@@ -3220,6 +3236,9 @@ var script$t = /* @__PURE__ */ defineComponent({
3220
3236
  delta: 1
3221
3237
  });
3222
3238
  }
3239
+ const isAppEnv = computed(() => {
3240
+ return isApp();
3241
+ });
3223
3242
  onMounted(() => {
3224
3243
  resetDateRange();
3225
3244
  });
@@ -3278,10 +3297,11 @@ var script$t = /* @__PURE__ */ defineComponent({
3278
3297
  1
3279
3298
  /* TEXT */
3280
3299
  ),
3281
- createElementVNode("div", {
3300
+ !isAppEnv.value ? (openBlock(), createElementBlock("div", {
3301
+ key: 0,
3282
3302
  class: "pay",
3283
3303
  onClick: gotoRecharge
3284
- }, "\u4E91\u8C46\u5145\u503C")
3304
+ }, "\u4E91\u8C46\u5145\u503C")) : createCommentVNode("v-if", true)
3285
3305
  ])
3286
3306
  ]),
3287
3307
  createVNode(script$u),
@@ -3326,7 +3346,7 @@ var script$t = /* @__PURE__ */ defineComponent({
3326
3346
  1
3327
3347
  /* TEXT */
3328
3348
  ),
3329
- item.id ? (openBlock(), createElementBlock("div", _hoisted_11$2, [
3349
+ item.id && !isAppEnv.value ? (openBlock(), createElementBlock("div", _hoisted_11$2, [
3330
3350
  createElementVNode("div", {
3331
3351
  onClick: ($event) => gotoTrade(item)
3332
3352
  }, "\u4F01\u660E\u661F\u4F18\u60E0\u5145\u503C", 8, _hoisted_12$2),
@@ -3381,7 +3401,7 @@ var script$t = /* @__PURE__ */ defineComponent({
3381
3401
  1
3382
3402
  /* TEXT */
3383
3403
  ),
3384
- item.id ? (openBlock(), createElementBlock("div", _hoisted_17$1, [
3404
+ item.id && !isAppEnv.value ? (openBlock(), createElementBlock("div", _hoisted_17$1, [
3385
3405
  createElementVNode("div", {
3386
3406
  onClick: ($event) => gotoTrade(item)
3387
3407
  }, "AI\u5BA1\u6279\u5145\u503C", 8, _hoisted_18$1),
@@ -5911,21 +5931,6 @@ var script$f = /* @__PURE__ */ defineComponent({
5911
5931
 
5912
5932
  script$f.__file = "src/notice/components/NoticeList.vue";
5913
5933
 
5914
- function dataURItoBlob(dataURI) {
5915
- const byteString = atob(dataURI.split(",")[1]);
5916
- const mimeString = dataURI.split(",")[0].split(":")[1].split(";")[0];
5917
- const ab = new ArrayBuffer(byteString.length);
5918
- const ia = new Uint8Array(ab);
5919
- for (let i = 0; i < byteString.length; i++) {
5920
- ia[i] = byteString.charCodeAt(i);
5921
- }
5922
- return new Blob([ab], { type: mimeString });
5923
- }
5924
- function isWeb() {
5925
- const env = process.env.TARO_ENV || "";
5926
- return env === "h5" || Taro.getEnv() === "WEB";
5927
- }
5928
-
5929
5934
  const _hoisted_1$d = {
5930
5935
  key: 0,
5931
5936
  class: "read-all"
@@ -6949,7 +6954,8 @@ var script$b = /* @__PURE__ */ defineComponent({
6949
6954
  )) : createCommentVNode("v-if", true)
6950
6955
  ]),
6951
6956
  createElementVNode("div", _hoisted_23, [
6952
- createVNode(_component_nut_button, {
6957
+ !unref(isApp)() ? (openBlock(), createBlock(_component_nut_button, {
6958
+ key: 0,
6953
6959
  class: "user-info-ft-btn",
6954
6960
  style: { "width": "100%", "margin-top": "12px" },
6955
6961
  onClick: toLogout,
@@ -6965,7 +6971,7 @@ var script$b = /* @__PURE__ */ defineComponent({
6965
6971
  ])]),
6966
6972
  _: 1
6967
6973
  /* STABLE */
6968
- })
6974
+ })) : createCommentVNode("v-if", true)
6969
6975
  ])
6970
6976
  ]))
6971
6977
  ]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "4.2.85",
3
+ "version": "4.2.88",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -34,8 +34,9 @@
34
34
  "@tarojs/shared": "^4.1.7",
35
35
  "@tarojs/taro": "^4.1.7",
36
36
  "@types/wechat-miniprogram": "^3.4.7",
37
- "@uxda/nutshell": "^1.6.86",
37
+ "@uxda/nutshell": "^1.0.0",
38
38
  "dayjs": "^1.11.18",
39
+ "dsbridge": "^3.1.4",
39
40
  "lodash-es": "^4.17.21",
40
41
  "validator": "^13.15.15",
41
42
  "vue": "^3.5.22"
package/rollup.config.mjs CHANGED
@@ -60,6 +60,7 @@ export default [
60
60
  '@uxda/nutshell',
61
61
  'dayjs',
62
62
  'validator',
63
+ 'dsbridge',
63
64
  ],
64
65
  },
65
66
  // {
@@ -18,7 +18,7 @@
18
18
  </div>
19
19
  <div class="bean-counts spa-between">
20
20
  <div class="counts number">{{ formatAmount(balance.total || 0) }}</div>
21
- <div class="pay" @click="gotoRecharge">云豆充值</div>
21
+ <div v-if="!isAppEnv" class="pay" @click="gotoRecharge">云豆充值</div>
22
22
  </div>
23
23
  </div>
24
24
  <Tip />
@@ -31,7 +31,7 @@
31
31
  </div>
32
32
  <div class="item-title">
33
33
  <div>{{ item.title }}</div>
34
- <div class="item-title-button" v-if="item.id">
34
+ <div class="item-title-button" v-if="item.id && !isAppEnv">
35
35
  <div @click="gotoTrade(item)">企明星优惠充值</div>
36
36
  <img class="button-icon" src="https://cdn.ddjf.com/static/images/bpms-workBench/button-hg.svg" />
37
37
  </div>
@@ -46,7 +46,7 @@
46
46
  <div class="item-count">{{ formatAmount(item.count || 0) }}{{ item.unit }}</div>
47
47
  <div class="item-title">
48
48
  <div>{{ item.title }}</div>
49
- <div class="item-title-button" v-if="item.id">
49
+ <div class="item-title-button" v-if="item.id && !isAppEnv">
50
50
  <div @click="gotoTrade(item)">AI审批充值</div>
51
51
  <img class="button-icon" src="https://cdn.ddjf.com/static/images/bpms-workBench/button-hg.svg" />
52
52
  </div>
@@ -148,6 +148,7 @@ import Tip from './Tip.vue'
148
148
  import groupBy from 'lodash-es/groupBy'
149
149
  import { useAmount } from '../../shared/composables/useAmount'
150
150
  import { ScrollView } from '@tarojs/components'
151
+ import { isApp } from '../../utils/utils'
151
152
 
152
153
  type AccountViewProps = {
153
154
  app: string
@@ -358,15 +359,6 @@ const onReachBottom = () => {
358
359
  loadNextPage()
359
360
  }
360
361
 
361
- /**
362
- * 浮窗弹出时不允许
363
- * 1. 下拉刷新
364
- * 2. 上滑分页
365
- */
366
- const isAnyPopupOpen = computed(() => {
367
- return rulesPopupOpen.value || datePickerOpen.value || filterOpen.value || secondBalanceOpen.value
368
- })
369
-
370
362
  const secondBalanceOpen = ref<boolean>(false)
371
363
 
372
364
  function onSecondBalanceButtonClick() {
@@ -408,6 +400,10 @@ function onPageHeaderClose() {
408
400
  })
409
401
  }
410
402
 
403
+ const isAppEnv = computed(() => {
404
+ return isApp()
405
+ })
406
+
411
407
  onMounted(() => {
412
408
  resetDateRange()
413
409
  })
@@ -191,8 +191,6 @@ const emits = defineEmits(["toAgreement"]);
191
191
  --nut-primary-color: #017fff;
192
192
  position: absolute;
193
193
  top: -36px;
194
- left: 50%;
195
- transform: translateX(-50%);
196
194
  white-space: nowrap;
197
195
  display: flex;
198
196
  align-items: center;
@@ -74,7 +74,7 @@
74
74
  </div>
75
75
 
76
76
  <div class="user-info-ft">
77
- <nut-button class="user-info-ft-btn" style="width: 100%; margin-top: 12px" @click="toLogout" plain
77
+ <nut-button v-if="!isApp()" class="user-info-ft-btn" style="width: 100%; margin-top: 12px" @click="toLogout" plain
78
78
  type="primary">退出登录</nut-button>
79
79
  </div>
80
80
  </div>
@@ -135,6 +135,7 @@ import { useEncode } from "../../shared/composables/useEncode";
135
135
  import DdSkeleton from "../../components/dd-skeleton/index.vue";
136
136
  import { useHttp } from "../api";
137
137
  import { ScrollView } from '@tarojs/components'
138
+ import { isApp } from '../../utils/utils'
138
139
 
139
140
  const props = withDefaults(
140
141
  defineProps<{
@@ -1,4 +1,5 @@
1
1
  import Taro from "@tarojs/taro"
2
+ import dsBridge from 'dsbridge'
2
3
 
3
4
  // 工具函数:DataURL转Blob
4
5
  export function dataURItoBlob(dataURI) {
@@ -26,3 +27,7 @@ export function generateUniqueId(pre?: string, delimiter = '-') {
26
27
  .substr(2)}`
27
28
  }
28
29
 
30
+ // 是否是App环境
31
+ export function isApp() {
32
+ return dsBridge.hasNativeMethod('openWebPage')
33
+ }