@uxda/appkit 4.2.58 → 4.2.59

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
@@ -4,7 +4,7 @@ import '@nutui/nutui-taro/dist/packages/checkbox/style/css';
4
4
  import { defineComponent, reactive, createBlock, openBlock, withCtx, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, createTextVNode, ref, computed, onUnmounted, createCommentVNode, renderSlot, createVNode, normalizeStyle, unref, isRef, onMounted, createStaticVNode, watch, withDirectives, vShow, useModel, mergeModels, resolveComponent, vModelText, watchPostEffect, withModifiers } from 'vue';
5
5
  import '@nutui/nutui-taro/dist/packages/grid/style/css';
6
6
  import '@nutui/nutui-taro/dist/packages/griditem/style/css';
7
- import Taro, { getSystemInfoSync, getMenuButtonBoundingClientRect, uploadFile, request as request$1, showToast, chooseMedia, chooseMessageFile, showLoading, hideLoading, useDidShow, getStorageSync, useRouter } from '@tarojs/taro';
7
+ import Taro, { getSystemInfoSync, getMenuButtonBoundingClientRect, uploadFile, request as request$1, showToast, chooseMedia, chooseMessageFile, showLoading, hideLoading, useDidShow, showModal, getStorageSync, chooseImage, useRouter } from '@tarojs/taro';
8
8
  import '@nutui/nutui-taro/dist/packages/popup/style/css';
9
9
  import isMobilePhone from 'validator/es/lib/isMobilePhone';
10
10
  import isIdentityCard from 'validator/es/lib/isIdentityCard';
@@ -324,13 +324,16 @@ const transformFields = (row) => {
324
324
  const useUpload = (config) => {
325
325
  const appkitOptions = useAppKitOptions();
326
326
  console.log("===config", config);
327
- console.log("===config", appkitOptions.tempToken() || appkitOptions.token());
328
327
  const upload = (url, file) => {
329
328
  return new Promise((resolve, reject) => {
329
+ console.log(file, "----file");
330
330
  uploadFile({
331
331
  url: config.baseUrl + url,
332
332
  filePath: file.path,
333
333
  name: "file",
334
+ formData: {
335
+ objectNo: `min${Date.now()}`
336
+ },
334
337
  header: {
335
338
  ...config.headers,
336
339
  token: appkitOptions.tempToken() || appkitOptions.token()
@@ -1267,7 +1270,7 @@ var script$C = /* @__PURE__ */ defineComponent({
1267
1270
  console.log("===onIconClick");
1268
1271
  let result = null;
1269
1272
  try {
1270
- const csRes = await Taro.chooseMedia({
1273
+ const csRes = await chooseMedia({
1271
1274
  count: 1,
1272
1275
  sourceType: ["album", "camera"]
1273
1276
  });
@@ -3975,7 +3978,7 @@ var script$l = /* @__PURE__ */ defineComponent({
3975
3978
  rebate: "\u63A8\u8350\u670B\u53CB\u4F7F\u7528\u5317\u6597\u661F\u3001\u4F01\u660E\u661F\u83B7\u53D6\uFF0C\u8FD4\u4F63\u6536\u76CA= \u8FD4\u4F63\u57FA\u6570 * \u8FD4\u4F63\u6BD4\u4F8B"
3976
3979
  };
3977
3980
  function onHelpClick(type) {
3978
- Taro.showModal({
3981
+ showModal({
3979
3982
  content: toastMap[type],
3980
3983
  showCancel: false,
3981
3984
  confirmText: "\u77E5\u9053\u4E86"
@@ -5997,7 +6000,7 @@ var script$9 = /* @__PURE__ */ defineComponent({
5997
6000
  }
5998
6001
  const avatarVisible = ref(false);
5999
6002
  async function toUpload() {
6000
- if (!userInfo.value.avatar) {
6003
+ if (!userInfo.value.avatar && Taro.getEnv() !== "WEB") {
6001
6004
  const profile = await Taro.getUserProfile({
6002
6005
  desc: "\u5934\u50CF\u7528\u4E8E\u6539\u53D8\u9ED8\u8BA4\u5934\u50CF"
6003
6006
  });
@@ -6006,7 +6009,7 @@ var script$9 = /* @__PURE__ */ defineComponent({
6006
6009
  });
6007
6010
  updateImage(res.tempFilePath);
6008
6011
  } else {
6009
- let res = await Taro.chooseImage({
6012
+ let res = await chooseImage({
6010
6013
  count: 1
6011
6014
  });
6012
6015
  if (res.tempFilePaths) {
@@ -6126,7 +6129,7 @@ var script$9 = /* @__PURE__ */ defineComponent({
6126
6129
  });
6127
6130
  }
6128
6131
  function toLogout() {
6129
- Taro.showModal({
6132
+ showModal({
6130
6133
  title: "\u63D0\u793A",
6131
6134
  content: "\u786E\u5B9A\u8981\u9000\u51FA\u767B\u5F55\u5417\uFF1F",
6132
6135
  confirmText: "\u786E\u5B9A",
@@ -7708,7 +7711,7 @@ var script$5 = /* @__PURE__ */ defineComponent({
7708
7711
  async function onConfirm() {
7709
7712
  const [err, res] = await cropperRef.value.crop();
7710
7713
  if (err) {
7711
- Taro.showModal({
7714
+ showModal({
7712
7715
  title: "\u6E29\u99A8\u63D0\u793A",
7713
7716
  content: err.message,
7714
7717
  confirmColor: "#017fff"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "4.2.58",
3
+ "version": "4.2.59",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -45,7 +45,7 @@
45
45
  import { ref, watch } from 'vue'
46
46
  import { endpoints, useHttp } from '../api'
47
47
  import { Promoter } from '../types'
48
- import Taro, { useDidShow } from '@tarojs/taro'
48
+ import Taro, { useDidShow, showModal } from '@tarojs/taro'
49
49
  import { useAmount } from '../../shared/composables/useAmount'
50
50
  import { IconFont } from '@nutui/icons-vue-taro'
51
51
 
@@ -118,7 +118,7 @@ const toastMap = {
118
118
  rebate: '推荐朋友使用北斗星、企明星获取,返佣收益= 返佣基数 * 返佣比例',
119
119
  }
120
120
  function onHelpClick(type: string) {
121
- Taro.showModal({
121
+ showModal({
122
122
  content: toastMap[type],
123
123
  showCancel: false,
124
124
  confirmText: '知道了',
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="second-balance">
3
- <page-header title="权益余额" />
3
+ <page-header :title="Taro.getEnv() !== 'WEB' ? '权益余额' : ''" />
4
4
  <div class="positions" v-if="data.length">
5
5
  <div class="position" v-for="(item, index) in data" :key="index">
6
6
  <div class="icon"></div>
@@ -13,6 +13,7 @@
13
13
  </template>
14
14
 
15
15
  <script lang="ts" setup>
16
+ import Taro from "@tarojs/taro";
16
17
  import { Privilege } from "../types";
17
18
  import EmptyView from "../../shared/components/EmptyView.vue";
18
19
 
@@ -30,8 +31,10 @@ withDefaults(defineProps<SecondBalanceProps>(), {
30
31
  <style lang="scss">
31
32
  .second-balance {
32
33
  width: 100vw;
34
+
33
35
  .positions {
34
36
  padding: 15px;
37
+
35
38
  .position {
36
39
  border-radius: 5px;
37
40
  background: #f7f8fa;
@@ -42,6 +45,7 @@ withDefaults(defineProps<SecondBalanceProps>(), {
42
45
  margin-bottom: 10px;
43
46
  padding: 0 10px;
44
47
  gap: 10px;
48
+
45
49
  .icon {
46
50
  width: 30px;
47
51
  height: 30px;
@@ -53,12 +57,14 @@ withDefaults(defineProps<SecondBalanceProps>(), {
53
57
  flex-basis: 30px;
54
58
  flex-grow: 0;
55
59
  }
60
+
56
61
  .title {
57
62
  flex-grow: 1;
58
63
  color: #353535;
59
64
  font-size: 14px;
60
65
  font-weight: 500;
61
66
  }
67
+
62
68
  .amount {
63
69
  flex-grow: 0;
64
70
  color: #9e7b5a;
@@ -5,7 +5,7 @@
5
5
  </template>
6
6
 
7
7
  <script lang="ts" setup>
8
- import Taro, { showToast, showLoading, hideLoading, uploadFile } from '@tarojs/taro';
8
+ import Taro, { showToast, showLoading, hideLoading, uploadFile, chooseMedia } from '@tarojs/taro';
9
9
  import { NsIcon } from '@uxda/nutshell/taro';
10
10
  import { useAppKitOptions } from '../../Appkit';
11
11
 
@@ -60,7 +60,7 @@ async function onIconClick() {
60
60
  console.log('===onIconClick');
61
61
  let result: OcrResult | null = null;
62
62
  try {
63
- const csRes = await Taro.chooseMedia({
63
+ const csRes = await chooseMedia({
64
64
  count: 1,
65
65
  sourceType: ['album', 'camera']
66
66
  });
@@ -27,14 +27,17 @@ type UploadFunction = (url: string, file: Media) => Promise<Media>
27
27
  export const useUpload = (config: UploadConfig) => {
28
28
  const appkitOptions = useAppKitOptions()
29
29
  console.log('===config', config)
30
- console.log('===config', appkitOptions.tempToken() || appkitOptions.token())
31
30
 
32
31
  const upload: UploadFunction = (url: string, file: Media) => {
33
32
  return new Promise<Media>((resolve, reject) => {
33
+ console.log(file, '----file')
34
34
  uploadFile({
35
35
  url: config.baseUrl + url,
36
36
  filePath: file.path!,
37
37
  name: 'file',
38
+ formData: {
39
+ objectNo: `min${Date.now()}`,
40
+ },
38
41
  header: {
39
42
  ...config.headers,
40
43
  token: appkitOptions.tempToken() || appkitOptions.token(),
@@ -10,7 +10,7 @@
10
10
  </template>
11
11
 
12
12
  <script lang="ts" setup>
13
- import Taro, { useRouter } from '@tarojs/taro'
13
+ import Taro, { useRouter, showModal } from '@tarojs/taro'
14
14
  import { ref } from 'vue'
15
15
  import btCropper from '../../components/bt-cropper/index.vue'
16
16
 
@@ -28,7 +28,7 @@ function onCancel() {
28
28
  async function onConfirm() {
29
29
  const [err, res] = await cropperRef.value.crop()
30
30
  if (err) {
31
- Taro.showModal({
31
+ showModal({
32
32
  title: '温馨提示',
33
33
  content: err.message,
34
34
  confirmColor: '#017fff',
@@ -128,7 +128,7 @@
128
128
  </template>
129
129
 
130
130
  <script lang="ts" setup>
131
- import Taro, { useDidShow, showToast, showLoading, hideLoading, uploadFile } from "@tarojs/taro";
131
+ import Taro, { useDidShow, showToast, showLoading, hideLoading, uploadFile, showModal, chooseImage } from "@tarojs/taro";
132
132
  import { ref, onMounted, reactive, onUnmounted } from "vue";
133
133
  import { useAppKitOptions } from "../../Appkit";
134
134
  import { useEncode } from "../../shared/composables/useEncode";
@@ -187,7 +187,7 @@ const avatarVisible = ref(false);
187
187
 
188
188
  // 去上传头像
189
189
  async function toUpload() {
190
- if (!userInfo.value.avatar) {
190
+ if (!userInfo.value.avatar && Taro.getEnv() !== "WEB") {
191
191
  const profile = await Taro.getUserProfile({
192
192
  desc: "头像用于改变默认头像",
193
193
  });
@@ -198,7 +198,7 @@ async function toUpload() {
198
198
 
199
199
  updateImage(res.tempFilePath);
200
200
  } else {
201
- let res = await Taro.chooseImage({
201
+ let res = await chooseImage({
202
202
  count: 1,
203
203
  });
204
204
  if (res.tempFilePaths) {
@@ -348,7 +348,7 @@ function onNickNameOk() {
348
348
  }
349
349
  // 退出登录
350
350
  function toLogout() {
351
- Taro.showModal({
351
+ showModal({
352
352
  title: "提示",
353
353
  content: "确定要退出登录吗?",
354
354
  confirmText: "确定",