@10yun/cv-mobile-ui 0.4.6 → 0.4.8

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,3 +1,5 @@
1
+ import HttpObj from '@/plugins/http.js';
2
+
1
3
  uni.request({
2
4
  url: 'https://uniapp.dcloud.io/update', // 检查更新的服务器地址
3
5
  data: {
@@ -23,13 +25,17 @@ uni.request({
23
25
  });
24
26
  // APP检测更新 具体可以参考:https://ask.dcloud.net.cn/article/35667
25
27
  plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
26
- this.$Request.post(this.$api.common.update, {
27
- appid: widgetInfo.appid, //当前应用的APPID
28
- version: widgetInfo.version, // 当前应用的版本
29
- name: widgetInfo.name, // 当前应用的名称
30
- imei: plus.device.imei,
31
- os: plus.os.name // OS环境 ios / android
32
- }).then((res) => {
28
+
29
+ uni.request({
30
+ url: 'https://uniapp.dcloud.io/update', // 检查更新的服务器地址
31
+ data: {
32
+ appid: widgetInfo.appid, //当前应用的APPID
33
+ version: widgetInfo.version, // 当前应用的版本
34
+ name: widgetInfo.name, // 当前应用的名称
35
+ imei: plus.device.imei,
36
+ os: plus.os.name // OS环境 ios / android
37
+ },
38
+ success: res => {
33
39
  if (res.code == 200) {
34
40
  uni.downloadFile({
35
41
  url: res.data.wgtUrl,
@@ -45,9 +51,9 @@ plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
45
51
  })
46
52
  }
47
53
  }
48
- })
54
+ });
49
55
  }
50
- })
56
+ }
51
57
  });
52
58
 
53
59
 
@@ -65,7 +71,10 @@ var UniUpgradeClass = function{
65
71
  updateManager.onCheckForUpdate((ForUpdateRes) => {
66
72
  // 请求完新版本信息的回调
67
73
  if (ForUpdateRes.hasUpdate === true) { //有新的版本
68
- this.$message.loading("应用升级中");
74
+ uni.showLoading({
75
+ title: '应用升级中', //正在加载中
76
+ mask: true
77
+ });
69
78
  }
70
79
  });
71
80
 
@@ -1,3 +1,4 @@
1
+ import HttpObj from '@/plugins/http.js';
1
2
  let xx = {
2
3
  //检测当前版本号
3
4
  dqbanben: function () {
@@ -13,11 +14,10 @@ let xx = {
13
14
  //检查更新
14
15
  checkUpdate: function () {
15
16
  var that = this;
16
- this.$http
17
- .post(this.GLOBAL.host + '/version/checkUpdate', {
18
- version: that.wgtVer
19
- })
20
- .then(function (res) {
17
+ HttpObj.post('/version/checkUpdate', {
18
+ version: that.wgtVer
19
+ })
20
+ .then((res) => {
21
21
  if (res.data.code == 0) {
22
22
  if (res.data.result == 1) {
23
23
  //跟后台传过来的版本号比对,如果版本号不一致
@@ -8,13 +8,13 @@
8
8
  export default {
9
9
  name: 'cvButton',
10
10
  props: {
11
- label: {
11
+ size: {
12
12
  type: [String],
13
- default: 'primary'
13
+ default: 'default'
14
14
  },
15
15
  type: {
16
16
  type: [String],
17
- default: 'save'
17
+ default: 'default'
18
18
  },
19
19
  formType: {
20
20
  type: [String],
@@ -25,15 +25,9 @@ export default {
25
25
  }
26
26
  },
27
27
  data() {
28
- return {
29
- themesData: {} // 获取用户主题配置
30
- };
31
- },
32
- created() {
33
- if (this.$store) {
34
- // this.themesData = this.$store.state.storeSystem.themesData || '';
35
- }
28
+ return {};
36
29
  },
30
+ created() {},
37
31
  methods: {
38
32
  diyClick() {
39
33
  if (typeof this.click == 'function') {
@@ -58,7 +52,6 @@ export default {
58
52
  margin: 0px 15px;
59
53
  line-height: 100%;
60
54
  padding: 10px 0;
61
- color: #fff;
62
55
  border-radius: 40px;
63
56
  }
64
57
 
@@ -39,13 +39,12 @@ export default {
39
39
  cvCheckboxOptBase,
40
40
  cvCheckboxOptTag
41
41
  },
42
- inject: {},
43
42
  props: {
44
43
  type: {
45
- type: String,
44
+ type: [String],
46
45
  default: 'base'
47
46
  },
48
- //默认输入框内容
47
+ //默认内容
49
48
  value: {
50
49
  type: [Array, String, Number],
51
50
  default: []
@@ -61,11 +60,6 @@ export default {
61
60
  return [];
62
61
  }
63
62
  },
64
- //选项数组的网络请求地址,用于获取dataLists但优先级高于dataLists
65
- dataUrl: {
66
- type: String,
67
- default: ''
68
- },
69
63
  //数据类型value的名称
70
64
  dataValue: {
71
65
  type: String,
@@ -94,6 +88,11 @@ export default {
94
88
  watch: {
95
89
  value(newVal) {
96
90
  this._doValueType(newVal);
91
+ },
92
+ dataLists(newVal) {
93
+ this.dataLists = newVal;
94
+ this.items = this.itemsSortOut();
95
+ // this._dealValue();
97
96
  }
98
97
  },
99
98
  created() {
@@ -121,11 +120,8 @@ export default {
121
120
  },
122
121
  itemsSortOut() {
123
122
  let original = [];
124
- if (this.dataUrl) {
125
- //网络请求
126
- } else {
127
- original = this.dataLists;
128
- }
123
+ original = this.dataLists || [];
124
+
129
125
  if (typeof original == 'string') {
130
126
  original = JSON.parse(original);
131
127
  }
@@ -298,10 +298,8 @@ export default {
298
298
  console.warn('执行方法', this.localTabs[this.tabCurr]['apiFunc']);
299
299
 
300
300
  // if (successRes.data.length == 0) {
301
- // this.$message.show('无更多商铺~');
302
301
  // return;
303
302
  // } else {
304
- // this.$message.show('加载中...');
305
303
  // }
306
304
  return new Promise((res) => {
307
305
  // console.log('--');
@@ -35,11 +35,6 @@ export default {
35
35
  type: [Array, String],
36
36
  default: []
37
37
  },
38
- //选项数组的网络请求地址,用于获取dataLists但优先级高于dataLists
39
- dataUrl: {
40
- type: String,
41
- default: ''
42
- },
43
38
  //数据类型value的名称
44
39
  dataValue: {
45
40
  type: String,
@@ -122,18 +117,8 @@ export default {
122
117
  },
123
118
  itemsSortOut() {
124
119
  let original = [];
125
- if (this.dataUrl) {
126
- //网络请求
127
- if (typeof this.dataUrl == 'function') {
128
- this.dataUrl({}).then((successRes) => {
129
- original = successRes.data;
130
- });
131
- } else {
132
- console.warn('此处需要自定义请求方法');
133
- }
134
- } else {
135
- original = this.dataLists;
136
- }
120
+ original = this.dataLists || [];
121
+
137
122
  if (typeof original == 'string') {
138
123
  original = JSON.parse(original);
139
124
  }
@@ -42,11 +42,6 @@ export default {
42
42
  type: [Array, String],
43
43
  default: []
44
44
  },
45
- //选项数组的网络请求地址,用于获取dataLists但优先级高于dataLists
46
- dataUrl: {
47
- type: String,
48
- default: ''
49
- },
50
45
  //数据类型value的名称
51
46
  dataValue: {
52
47
  type: String,
@@ -99,18 +94,8 @@ export default {
99
94
  methods: {
100
95
  itemsSortOut() {
101
96
  let original = [];
102
- if (this.dataUrl) {
103
- //网络请求
104
- if (typeof this.dataUrl == 'function') {
105
- this.dataUrl({}).then((successRes) => {
106
- original = successRes.data;
107
- });
108
- } else {
109
- console.warn('此处需要自定义请求方法');
110
- }
111
- } else {
112
- original = this.dataLists;
113
- }
97
+ original = this.dataLists || [];
98
+
114
99
  if (typeof original == 'string') {
115
100
  original = JSON.parse(original);
116
101
  }
@@ -53,11 +53,6 @@ export default {
53
53
  type: [Array, String],
54
54
  default: []
55
55
  },
56
- //选项数组的网络请求地址,用于获取dataLists但优先级高于dataLists
57
- dataUrl: {
58
- type: String,
59
- default: ''
60
- },
61
56
  //数据类型value的名称
62
57
  dataValue: {
63
58
  type: String,
@@ -111,18 +106,8 @@ export default {
111
106
  methods: {
112
107
  itemsSortOut() {
113
108
  let original = [];
114
- if (this.dataUrl) {
115
- //网络请求
116
- if (typeof this.dataUrl == 'function') {
117
- this.dataUrl({}).then((successRes) => {
118
- original = successRes.data;
119
- });
120
- } else {
121
- console.warn('此处需要自定义请求方法');
122
- }
123
- } else {
124
- original = this.dataLists;
125
- }
109
+ original = this.dataLists || [];
110
+
126
111
  if (typeof original == 'string') {
127
112
  original = JSON.parse(original);
128
113
  }
@@ -42,9 +42,10 @@ export default {
42
42
  },
43
43
  props: {
44
44
  type: {
45
- type: String,
45
+ type: [String],
46
46
  default: 'base'
47
47
  },
48
+ //默认内容
48
49
  value: {
49
50
  type: [String, Number],
50
51
  default: ''
@@ -53,24 +54,22 @@ export default {
53
54
  type: String,
54
55
  default: 'value'
55
56
  },
56
-
57
- dataUrl: {
58
- type: String,
59
- default: ''
57
+ //选项数组
58
+ dataLists: {
59
+ type: [Array, String],
60
+ default: () => {
61
+ return [];
62
+ }
60
63
  },
64
+ //数据类型value的名称
61
65
  dataValue: {
62
66
  type: String,
63
67
  default: 'value'
64
68
  },
69
+ //数据类型text的名称
65
70
  dataText: {
66
71
  type: String,
67
72
  default: 'text'
68
- },
69
- dataLists: {
70
- type: [Array, String],
71
- default: () => {
72
- return [];
73
- }
74
73
  }
75
74
  },
76
75
  data() {
@@ -86,11 +85,9 @@ export default {
86
85
  this._dealValue();
87
86
  },
88
87
  dataLists(newVal) {
89
- if (this.dataUrl == '') {
90
- this.dataLists = newVal;
91
- this.items = this.itemsSortOut();
92
- this._dealValue();
93
- }
88
+ this.dataLists = newVal;
89
+ this.items = this.itemsSortOut();
90
+ this._dealValue();
94
91
  }
95
92
  },
96
93
  created() {
@@ -115,37 +112,14 @@ export default {
115
112
  this.itemsValue = this.localVal;
116
113
  }
117
114
  },
118
- radioChange(e) {
119
- let value = e.detail.value;
120
- let localVal = value;
121
- if (this.dataType == 'text') {
122
- let items = this.items;
123
- for (let index = 0; index < items.length; index++) {
124
- if (localVal == items[index].value) {
125
- localVal = items[index].text;
126
- }
127
- }
128
- }
129
- this.localVal = localVal;
130
- this.$emit('input', this.localVal);
131
- },
132
115
  itemsSortOut() {
133
116
  let original = [];
134
- if (this.dataUrl) {
135
- //网络请求
136
- if (typeof this.dataUrl == 'function') {
137
- this.dataUrl({}).then((successRes) => {
138
- original = successRes.data;
139
- });
140
- } else {
141
- console.warn('此处需要自定义请求方法');
142
- }
143
- } else {
144
- original = this.dataLists;
145
- }
117
+ original = this.dataLists || [];
118
+
146
119
  if (typeof original == 'string') {
147
120
  original = JSON.parse(original);
148
121
  }
122
+
149
123
  //整理数据
150
124
  let items = [];
151
125
  let dataValue = this.dataValue ? this.dataValue : 'value';
@@ -159,6 +133,20 @@ export default {
159
133
  });
160
134
  }
161
135
  return items;
136
+ },
137
+ radioChange(e) {
138
+ let value = e.detail.value;
139
+ let localVal = value;
140
+ if (this.dataType == 'text') {
141
+ let items = this.items;
142
+ for (let index = 0; index < items.length; index++) {
143
+ if (localVal == items[index].value) {
144
+ localVal = items[index].text;
145
+ }
146
+ }
147
+ }
148
+ this.localVal = localVal;
149
+ this.$emit('input', this.localVal);
162
150
  }
163
151
  }
164
152
  };
@@ -59,11 +59,11 @@
59
59
  :disableTouch="disableTouch"
60
60
  >
61
61
  <swiper-item v-for="(item, index) in localTabLists" :key="index" :show-scrollbar="true">
62
+ <!-- refresher-background="#eeeeee" -->
62
63
  <scroll-view
63
64
  class="cv-tab-lists-data-scroll-box"
64
65
  scroll-y="true"
65
66
  :refresher-enabled="localTabLists[index].enabled && disableEnabled === false"
66
- refresher-background="#eeeeee"
67
67
  :refresher-triggered="localTabLists[index].triggered"
68
68
  @scrolltolower="onTolower(index)"
69
69
  @scrolltoupper="onToupper"
@@ -7,7 +7,7 @@ export default {
7
7
  default: false
8
8
  }
9
9
  },
10
- mounted () {
10
+ mounted() {
11
11
  const keyNames = {
12
12
  esc: ['Esc', 'Escape'],
13
13
  tab: 'Tab',
@@ -18,28 +18,28 @@ export default {
18
18
  right: ['Right', 'ArrowRight'],
19
19
  down: ['Down', 'ArrowDown'],
20
20
  delete: ['Backspace', 'Delete', 'Del']
21
- }
21
+ };
22
22
  const listener = ($event) => {
23
23
  if (this.disable) {
24
- return
24
+ return;
25
25
  }
26
- const keyName = Object.keys(keyNames).find(key => {
27
- const keyName = $event.key
28
- const value = keyNames[key]
29
- return value === keyName || (Array.isArray(value) && value.includes(keyName))
30
- })
26
+ const keyName = Object.keys(keyNames).find((key) => {
27
+ const keyName = $event.key;
28
+ const value = keyNames[key];
29
+ return value === keyName || (Array.isArray(value) && value.includes(keyName));
30
+ });
31
31
  if (keyName) {
32
32
  // 避免和其他按键事件冲突
33
33
  setTimeout(() => {
34
- this.$emit(keyName, {})
35
- }, 0)
34
+ this.$emit(keyName, {});
35
+ }, 0);
36
36
  }
37
- }
38
- document.addEventListener('keyup', listener)
37
+ };
38
+ document.addEventListener('keyup', listener);
39
39
  // this.$once('hook:beforeDestroy', () => {
40
40
  // document.removeEventListener('keyup', listener)
41
41
  // })
42
42
  },
43
- render: () => {}
44
- }
43
+ render: () => {}
44
+ };
45
45
  // #endif