@10yun/cv-mobile-ui 0.5.61 → 0.5.62

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@10yun/cv-mobile-ui",
3
- "version": "0.5.61",
3
+ "version": "0.5.62",
4
4
  "description": "十云cvjs移动端ui,适用uniapp",
5
5
  "homepage": "http://cvjs.cn/cv-mobile-ui/",
6
6
  "license": "Apache-2.0",
@@ -0,0 +1,109 @@
1
+ /**
2
+ * uni-app 自带地图
3
+ */
4
+ /**
5
+ * 选择地图
6
+ * @param {Object} keyword 搜索关键字
7
+ * @return {Object}
8
+ *
9
+ * 位置名称:res.name
10
+ * 详细地址: res.address
11
+ * 纬度: res.latitude
12
+ * 经度:res.longitude
13
+ */
14
+ export function extChooseLocation(keyword) {
15
+ return new Promise((resolve, reject) => {
16
+ uni.chooseLocation({
17
+ keyword: keyword,
18
+ success(res) {
19
+ resolve(res);
20
+ },
21
+ fail(err) {
22
+ reject(err);
23
+ }
24
+ });
25
+ });
26
+ }
27
+ /**
28
+ * 打开地图
29
+ * @param {Object} lat 经度
30
+ * @param {Object} lng 纬度
31
+ */
32
+ export function extOpenLocation(lat, lng) {
33
+ return new Promise((resolve, reject) => {
34
+ uni.openLocation({
35
+ latitude: lat,
36
+ longitude: lng,
37
+ success: function () {
38
+ resolve();
39
+ },
40
+ fail(err) {
41
+ reject(err);
42
+ }
43
+ });
44
+ });
45
+ }
46
+ export function extEleOffset(selector) {
47
+ // 获取高度
48
+ return new Promise((resolve) =>
49
+ uni
50
+ .createSelectorQuery()
51
+ .in(this)
52
+ .select(selector)
53
+ .boundingClientRect((data) => resolve(data))
54
+ .exec()
55
+ );
56
+ }
57
+ export function extScanCode() {
58
+ // #ifdef H5
59
+ uni.showToast({
60
+ title: 'h5不支持扫码'
61
+ });
62
+ // #endif
63
+ // #ifndef H5
64
+
65
+ // #ifdef APP-PLUS
66
+ var icon = plus.nativeObj.View.getViewById('icon0');
67
+ if (icon) {
68
+ setTimeout(function () {
69
+ icon.hide();
70
+ }, 5);
71
+ uni.setTabBarItem({
72
+ index: 0,
73
+ selectedIconPath: '/static/a2.png'
74
+ });
75
+ }
76
+ // #endif
77
+
78
+ return new Promise((resolve, reject) => {
79
+ uni.scanCode({
80
+ scanType: ['qrCode'],
81
+ success: function (res) {
82
+ // uni.showModal({
83
+ // title: '提示',
84
+ // showCancel: false,
85
+ // content:'条码内容:' + res.result
86
+ // });
87
+ console.log('条码类型:' + res.scanType);
88
+ console.log('条码内容:' + res.result);
89
+ let codeRes = res.result;
90
+ codeRes = codeRes.toString();
91
+ return resolve({
92
+ scanType: res.scanType,
93
+ result: codeRes
94
+ });
95
+ },
96
+ complete: function (res) {
97
+ console.log('scancomplete');
98
+ },
99
+ fail: (res) => {
100
+ reject(res.result);
101
+ console.log('failfailfailfailfailfailfailfailfailfailfail');
102
+ uni.showToast({
103
+ title: res.result
104
+ });
105
+ }
106
+ });
107
+ });
108
+ // #endif
109
+ }
@@ -1,9 +1,13 @@
1
1
  <template>
2
- <view class="cv-dialog-bottom__wrap" :class="show ? 'show' : ''">
2
+ <view class="cv-dialog-bottom__wrap" :class="isLastShow ? 'show' : ''">
3
+ <view class="cv-dialog-bottom__mask" @click.stop="maskClick"></view>
3
4
  <view class="cv-dialog-bottom__box">
4
5
  <view class="cv-dialog-bottom__bar">
5
- <view class="action cv-dialog-bottom__bar-left" @tap="cancel">取消</view>
6
- <view class="action cv-dialog-bottom__bar-right" @tap="confirm">确定</view>
6
+ <view class="cv-dialog-bottom__bar-left" v-if="showLeft" @tap="cancel">取消</view>
7
+ <view class="cv-dialog-bottom__bar-title">
8
+ <slot name="title">{{ title }}</slot>
9
+ </view>
10
+ <view class="cv-dialog-bottom__bar-right" v-if="showRight" @tap="confirm">确定</view>
7
11
  </view>
8
12
  <view class="cv-dialog-bottom__body" :style="bodyClass">
9
13
  <slot name="default" />
@@ -17,7 +21,7 @@ import mixin from '../../libs/mixin/mixin.js';
17
21
  export default {
18
22
  mixins: [mpMixin, mixin],
19
23
  name: 'cvDialogBottom',
20
- emits: ['confirm'],
24
+ emits: ['cancel', 'confirm'],
21
25
  props: {
22
26
  show: {
23
27
  type: Boolean,
@@ -26,28 +30,63 @@ export default {
26
30
  bodyClass: {
27
31
  type: [String],
28
32
  default: ''
33
+ },
34
+ isMaskClick: {
35
+ type: Boolean,
36
+ default: true
37
+ },
38
+ showLeft: {
39
+ type: Boolean,
40
+ default: true
41
+ },
42
+ showRight: {
43
+ type: Boolean,
44
+ default: true
45
+ },
46
+ title: {
47
+ type: [String],
48
+ default: ''
29
49
  }
30
50
  },
31
51
  watch: {},
52
+ computed: {
53
+ isLastShow() {
54
+ return this.localShow || this.show;
55
+ }
56
+ },
32
57
  data() {
33
- return {};
58
+ return {
59
+ localShow: false
60
+ };
34
61
  },
35
62
  created() {},
36
63
  methods: {
64
+ open() {
65
+ this.localShow = true;
66
+ },
67
+ close() {
68
+ this.localShow = false;
69
+ },
37
70
  confirm() {
38
- this.onConfirm(true);
71
+ this.close();
72
+ this.$emit('confirm');
39
73
  },
40
74
  cancel() {
41
- this.onConfirm(false);
75
+ this.close();
76
+ this.$emit('cancel');
42
77
  },
43
- onConfirm(e) {
44
- this.$emit('confirm', e);
78
+
79
+ maskClick() {
80
+ if (this.isMaskClick) {
81
+ this.close();
82
+ }
45
83
  }
46
84
  }
47
85
  };
48
86
  </script>
49
87
  <style>
50
88
  .cv-dialog-bottom__wrap {
89
+ background: rgba(0, 0, 0, 0.6);
51
90
  position: fixed;
52
91
  top: 0;
53
92
  right: 0;
@@ -55,36 +94,33 @@ export default {
55
94
  left: 0;
56
95
  z-index: 999;
57
96
  opacity: 0;
97
+ width: 100%;
58
98
  outline: 0;
59
- text-align: center;
60
- transform: scale(1.185);
61
99
  backface-visibility: hidden;
62
100
  -webkit-perspective: 1104px;
63
101
  perspective: 1104px;
64
- background: rgba(0, 0, 0, 0.6);
65
- transition: all 0.3s ease-in-out 0s;
66
102
  pointer-events: none;
103
+ text-align: center;
104
+ transform: scale(1.185);
105
+ transition: all 0.3s ease-in-out 0s;
67
106
  margin-bottom: -552px;
107
+ display: flex;
108
+ flex-direction: column;
68
109
  }
69
- .cv-dialog-bottom__wrap::before {
70
- vertical-align: bottom;
71
- }
72
- .cv-dialog-bottom__wrap::before {
73
- content: '\200B';
74
- display: inline-block;
75
- height: 100%;
110
+ .cv-dialog-bottom__mask {
111
+ flex: 1;
112
+ min-height: 60px;
76
113
  }
77
114
  .cv-dialog-bottom__wrap.show {
78
115
  opacity: 1;
79
- transition-duration: 0.3s;
80
- transform: scale(1);
81
116
  overflow-x: hidden;
82
117
  overflow-y: auto;
83
118
  pointer-events: auto;
119
+ transition-duration: 0.3s;
120
+ transform: scale(1);
84
121
  margin-bottom: 0;
85
122
  }
86
123
  .cv-dialog-bottom__box {
87
- position: relative;
88
124
  display: inline-block;
89
125
  vertical-align: middle;
90
126
  margin-left: auto;
@@ -100,7 +136,6 @@ export default {
100
136
  }
101
137
  .cv-dialog-bottom__bar {
102
138
  display: flex;
103
- position: relative;
104
139
  -webkit-box-align: center;
105
140
  -webkit-align-items: center;
106
141
  align-items: center;
@@ -110,44 +145,33 @@ export default {
110
145
  justify-content: space-between;
111
146
  background-color: #ffffff;
112
147
  color: #666666;
148
+ padding: 0 10px;
149
+ font-size: 15px;
150
+ }
151
+ .cv-dialog-bottom__bar-title {
152
+ flex: 1;
153
+ display: flex;
154
+ justify-content: center;
155
+ font-size: 15px;
156
+ font-weight: 400;
113
157
  }
114
158
  .cv-dialog-bottom__bar-left {
115
- min-width: 55px;
116
- min-height: 45px;
117
- margin-right: 0;
118
- margin-left: 16px;
119
159
  display: flex;
120
- -webkit-box-align: center;
121
- -webkit-align-items: center;
122
160
  align-items: center;
123
- height: 100%;
124
- -webkit-box-pack: center;
125
- -webkit-justify-content: center;
126
161
  justify-content: center;
127
- max-width: 100%;
162
+ min-width: 55px;
128
163
  color: #0081ff;
129
164
  }
130
165
  .cv-dialog-bottom__bar-right {
131
- min-width: 55px;
132
- min-height: 45px;
133
- margin-right: 16px;
134
- font-size: 16px;
135
166
  display: flex;
136
- -webkit-box-align: center;
137
- -webkit-align-items: center;
138
167
  align-items: center;
139
- height: 100%;
140
- -webkit-box-pack: center;
141
- -webkit-justify-content: center;
142
168
  justify-content: center;
143
- max-width: 100%;
169
+ min-width: 55px;
144
170
  color: #39b54a;
145
171
  }
146
172
  .cv-dialog-bottom__body {
147
- padding-top: 10px;
148
- max-height: 500px;
173
+ padding: 10px;
149
174
  overflow: auto;
150
- text-align: left;
151
175
  background-color: #fff;
152
176
  }
153
177
  </style>
@@ -1,9 +1,11 @@
1
1
  <template>
2
- <view class="cv-dialog-full__wrap" :class="localShow ? 'show' : ''">
2
+ <view class="cv-dialog-full__wrap" :class="isLastShow ? 'show' : ''">
3
3
  <view class="cv-dialog-full__box">
4
4
  <view class="cv-dialog-full__bar">
5
5
  <view class="cv-dialog-full__bar-left" v-if="showLeft" @tap="cancel">取消</view>
6
- <view class="cv-dialog-full__bar-title"><slot name="title">{{ title }}</slot></view>
6
+ <view class="cv-dialog-full__bar-title">
7
+ <slot name="title">{{ title }}</slot>
8
+ </view>
7
9
  <view class="cv-dialog-full__bar-right" v-if="showRight" @tap="confirm">确定</view>
8
10
  </view>
9
11
  <view class="cv-dialog-full__body" :style="bodyClass">
@@ -42,6 +44,11 @@ export default {
42
44
  }
43
45
  },
44
46
  watch: {},
47
+ computed: {
48
+ isLastShow() {
49
+ return this.localShow || this.show;
50
+ }
51
+ },
45
52
  data() {
46
53
  return {
47
54
  localShow: false
@@ -56,13 +63,12 @@ export default {
56
63
  this.localShow = false;
57
64
  },
58
65
  confirm() {
59
- this.onConfirm(true);
66
+ this.close();
67
+ this.$emit('confirm');
60
68
  },
61
69
  cancel() {
62
- this.onConfirm(false);
63
- },
64
- onConfirm(e) {
65
- this.$emit('confirm', e);
70
+ this.close();
71
+ this.$emit('cancel');
66
72
  }
67
73
  }
68
74
  };
@@ -81,16 +87,17 @@ export default {
81
87
  -webkit-perspective: 1104px;
82
88
  perspective: 1104px;
83
89
  background: rgba(0, 0, 0, 0.6);
84
- transition: all 0.2s ease-in-out 0s;
90
+
85
91
  pointer-events: none;
92
+ transition: all 0.2s ease-in-out 0s;
86
93
  }
87
94
  .cv-dialog-full__wrap.show {
88
- left: 0;
89
95
  opacity: 1;
90
- transition-duration: 0.2s;
91
96
  overflow-x: hidden;
92
97
  overflow-y: auto;
93
98
  pointer-events: auto;
99
+ left: 0;
100
+ transition-duration: 0.2s;
94
101
  }
95
102
  .cv-dialog-full__wrap::before {
96
103
  content: '\200B';
@@ -99,16 +106,12 @@ export default {
99
106
  vertical-align: middle;
100
107
  vertical-align: bottom;
101
108
  }
102
- .cv-dialog-full__wrap .cv-dialog {
103
- width: 100%;
104
- border-radius: 0;
105
- height: 100%;
106
- }
107
109
  .cv-dialog-full__box {
108
110
  display: inline-block;
109
111
  vertical-align: middle;
110
- width: 100%;
112
+
111
113
  max-width: 100%;
114
+ width: 100%;
112
115
  background-color: #f8f8f8;
113
116
  overflow: hidden;
114
117
  height: 100%;
@@ -149,8 +152,8 @@ export default {
149
152
  }
150
153
  .cv-dialog-full__body {
151
154
  padding: 10px;
152
- height: calc(100% - 45px);
153
155
  overflow: auto;
154
156
  background-color: #fff;
157
+ height: calc(100% - 45px);
155
158
  }
156
159
  </style>
@@ -93,7 +93,6 @@ export default {
93
93
  filePath: tempFilePaths,
94
94
  name: 'xcx_pper_avatar',
95
95
  formData: {
96
- postType: 'update',
97
96
  file_name: 'xcx_pper_avatar'
98
97
  }
99
98
  }).then((resData) => {
@@ -292,7 +292,6 @@ export default {
292
292
  let uploadParam = Object.assign(
293
293
  {},
294
294
  {
295
- postType: 'create',
296
295
  file_name: filename,
297
296
  savesign: 'uni-upload'
298
297
  },