@dcloudio/uni-cli-shared 2.0.2-3090920231225001 → 2.0.2-4000720240327001

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.
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "uniCloud.component.add.success": "Success",
3
3
  "uniCloud.component.update.success": "Success",
4
+ "uniCloud.component.update.showModal.title": "Tips",
5
+ "uniCloud.component.update.showModal.content": "是否更新该数据",
4
6
  "uniCloud.component.remove.showModal.title": "Tips",
5
7
  "uniCloud.component.remove.showModal.content": "是否删除该数据"
6
8
  }
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "uniCloud.component.add.success": "新增成功",
3
3
  "uniCloud.component.update.success": "修改成功",
4
+ "uniCloud.component.update.showModal.title": "提示",
5
+ "uniCloud.component.update.showModal.content": "是否更新该数据",
4
6
  "uniCloud.component.remove.showModal.title": "提示",
5
7
  "uniCloud.component.remove.showModal.content": "是否删除该数据"
6
8
  }
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "uniCloud.component.add.success": "新增成功",
3
3
  "uniCloud.component.update.success": "修改成功",
4
+ "uniCloud.component.update.showModal.title": "提示",
5
+ "uniCloud.component.update.showModal.content": "是否更新该数据",
4
6
  "uniCloud.component.remove.showModal.title": "提示",
5
7
  "uniCloud.component.remove.showModal.content": "是否删除该数据"
6
8
  }
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "uniCloud.component.add.success": "新增成功",
3
3
  "uniCloud.component.update.success": "修改成功",
4
+ "uniCloud.component.update.showModal.title": "提示",
5
+ "uniCloud.component.update.showModal.content": "是否更新该数据",
4
6
  "uniCloud.component.remove.showModal.title": "提示",
5
7
  "uniCloud.component.remove.showModal.content": "是否删除该数据"
6
8
  }
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "uniCloud.component.add.success": "新增成功",
3
3
  "uniCloud.component.update.success": "修改成功",
4
+ "uniCloud.component.update.showModal.title": "提示",
5
+ "uniCloud.component.update.showModal.content": "是否更新该数据",
4
6
  "uniCloud.component.remove.showModal.title": "提示",
5
7
  "uniCloud.component.remove.showModal.content": "是否刪除數據"
6
8
  }
@@ -387,10 +387,29 @@ export default {
387
387
  success,
388
388
  fail,
389
389
  complete,
390
+ confirmTitle,
391
+ confirmContent,
390
392
  needConfirm = true,
391
393
  needLoading = true,
392
394
  loadingTitle = ''
393
395
  } = {}) {
396
+ if (!needConfirm) {
397
+ this._doUpdate(id, value, action, success, fail, complete, needConfirm, needLoading, loadingTitle)
398
+ return
399
+ }
400
+ uni.showModal({
401
+ title: confirmTitle || t('uniCloud.component.update.showModal.title'),
402
+ content: confirmContent || t('uniCloud.component.update.showModal.content'),
403
+ showCancel: true,
404
+ success: (res) => {
405
+ if (!res.confirm) {
406
+ return
407
+ }
408
+ this._doUpdate(id, value, action, success, fail, complete, needConfirm, needLoading, loadingTitle)
409
+ }
410
+ })
411
+ },
412
+ _doUpdate (id, value, action, success, fail, complete, needConfirm, needLoading, loadingTitle) {
394
413
  if (needLoading) {
395
414
  uni.showLoading({
396
415
  title: loadingTitle
@@ -402,7 +421,7 @@ export default {
402
421
  db = db.action(action)
403
422
  }
404
423
 
405
- return db.collection(this.getMainCollection()).doc(id).update(value).then((res) => {
424
+ db.collection(this.getMainCollection()).doc(id).update(value).then((res) => {
406
425
  success && success(res)
407
426
  if (showToast) {
408
427
  uni.showToast({
@@ -1,16 +1,35 @@
1
1
  const path = require('path')
2
+ const webpack = require('webpack')
2
3
  const {
3
- normalizeNodeModules
4
+ normalizePath
5
+ // normalizeNodeModules
4
6
  } = require('./util')
5
7
 
8
+ let inputDir
9
+
6
10
  module.exports = {
7
11
  loader: 'file-loader',
8
12
  options: {
9
- publicPath (url, resourcePath, context) {
10
- return '/' + normalizeNodeModules(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
11
- },
12
- outputPath (url, resourcePath, context) {
13
- return normalizeNodeModules(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
13
+ name (resourcePath, resourceQuery) {
14
+ if (!inputDir) {
15
+ inputDir = normalizePath(process.env.UNI_INPUT_DIR)
16
+ }
17
+ resourcePath = normalizePath(resourcePath)
18
+ if (resourcePath.startsWith(inputDir)) {
19
+ const relativePath = normalizePath(path.relative(inputDir,
20
+ resourcePath))
21
+ if (relativePath.startsWith('static/') || relativePath.includes(
22
+ '/static/')) {
23
+ return relativePath
24
+ }
25
+ }
26
+ return `assets/[name].[hash:8]${webpack.version[0] > 4 ? '' : '.'}[ext]`
14
27
  }
28
+ // publicPath (url, resourcePath, context) {
29
+ // return '/' + normalizeNodeModules(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
30
+ // },
31
+ // outputPath (url, resourcePath, context) {
32
+ // return normalizeNodeModules(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
33
+ // }
15
34
  }
16
- }
35
+ }
package/lib/pages.js CHANGED
@@ -122,7 +122,15 @@ function isValidPage (page, root = '') {
122
122
  let pagePath = page.path
123
123
 
124
124
  if (pagePath.indexOf('platforms') === 0) { // 平台相关
125
- if (pagePath.indexOf('platforms/' + process.env.UNI_PLATFORM) === -1) { // 非本平台
125
+ if (process.env.UNI_PLATFORM === 'h5' || process.env.UNI_PLATFORM === 'web') {
126
+ if (!(pagePath.indexOf('platforms/h5/') === 0 || pagePath.indexOf('platforms/web/') === 0)) {
127
+ return false
128
+ }
129
+ } else if (process.env.UNI_PLATFORM === 'app-plus' || process.env.UNI_PLATFORM === 'app') {
130
+ if (!(pagePath.indexOf('platforms/app-plus/') === 0 || pagePath.indexOf('platforms/app/') === 0)) {
131
+ return false
132
+ }
133
+ } else if (pagePath.indexOf('platforms/' + process.env.UNI_PLATFORM) === -1) { // 非本平台
126
134
  return false
127
135
  }
128
136
  }
@@ -578,4 +586,4 @@ module.exports = {
578
586
  getGlobalUsingComponentsCode,
579
587
  parseUsingAutoImportComponents,
580
588
  generateGlobalUsingComponentsCode
581
- }
589
+ }
package/lib/url-loader.js CHANGED
@@ -35,8 +35,11 @@ module.exports = {
35
35
  loader: 'url-loader',
36
36
  options () {
37
37
  if (process.env.UNI_PLATFORM === 'h5') {
38
- // h5平台,不对 url-loader 作调整,默认limit:4096,也不修改file-loader输出路径
39
- return {}
38
+ // h5平台,不对 url-loader 作调整,默认limit:4096,也不修改file-loader输出路径(已做处理)
39
+ return {
40
+ ...defaultOptions,
41
+ limit: 4096
42
+ }
40
43
  }
41
44
  if (inlineLimit) {
42
45
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-cli-shared",
3
- "version": "2.0.2-3090920231225001",
3
+ "version": "2.0.2-4000720240327001",
4
4
  "description": "uni-cli-shared",
5
5
  "main": "lib/index.js",
6
6
  "repository": {
@@ -26,5 +26,5 @@
26
26
  "postcss-urlrewrite": "^0.2.2",
27
27
  "strip-json-comments": "^2.0.1"
28
28
  },
29
- "gitHead": "930c6d04bc26067ed5f7b8a1e782ad43760509fd"
29
+ "gitHead": "634a6ff45add875e73214448a857ff8a65b7401b"
30
30
  }