gxd-uni-library-editx 1.0.150 → 1.0.152

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": "gxd-uni-library-editx",
3
- "version": "1.0.150",
3
+ "version": "1.0.152",
4
4
  "private": false,
5
5
  "description": "聚福宝基础插件专用库",
6
6
  "main": "index.js",
@@ -1,9 +1,34 @@
1
1
  <template>
2
- <button
3
- :disabled="disabled"
4
- v-if="status"
5
- @click.stop="handleClick"
6
- :style="[{
2
+ <view v-if="status">
3
+ <button
4
+ v-if="openType === 'getPhoneNumber' || openType === 'getUserInfo' || openType === 'chooseAvatar'"
5
+ :disabled="disabled"
6
+ :open-type="openType"
7
+ @getphonenumber="handleClick"
8
+ @getuserinfo="handleClick"
9
+ @chooseavatar="handleClick"
10
+ :style="[{
11
+ opacity: disabled ? 0.4 : 1,
12
+ background: getBgColor(uiType),
13
+ fontSize: getInfo(uiSize,'fontSize','btnFontSieList'),
14
+ height: getInfo(uiSize,'height','btnHeightList'),
15
+ lineHeight: getInfo(uiSize,'height','btnHeightList'),
16
+ borderRadius: getRadius(uiSize),
17
+ color: getTextColor,
18
+ width: width ? width : 'auto',
19
+ boxShadow: getBoxShadow,
20
+ border: uiType === 'default'? '2rpx solid #dcdfe6': 0,
21
+ padding: '0 ' + btnPaddingtList[uiSize] + 'rpx'
22
+ },cusStyleComp,plainStyle]"
23
+ :class="getClassName"
24
+ type="default"
25
+ plain="true"
26
+ ><slot>按钮</slot></button>
27
+ <button
28
+ v-else
29
+ :disabled="disabled"
30
+ @click.stop="handleClick"
31
+ :style="[{
7
32
  opacity: disabled ? 0.4 : 1,
8
33
  background: getBgColor(uiType),
9
34
  fontSize: getInfo(uiSize,'fontSize','btnFontSieList'),
@@ -15,7 +40,7 @@
15
40
  boxShadow: getBoxShadow,
16
41
  border: uiType === 'default'? '2rpx solid #dcdfe6': 0,
17
42
  padding: '0 ' + btnPaddingtList[uiSize] + 'rpx'
18
- },cusStyleComp]"
43
+ }, plainStyle, cusStyleComp]"
19
44
  :class="getClassName"
20
45
  type="default"
21
46
  plain="true"
@@ -55,6 +80,12 @@
55
80
  type: String,
56
81
  default: ''
57
82
  },
83
+ //#ifdef MP
84
+ openType:{
85
+ type: String,
86
+ default: ''
87
+ },
88
+ //#endif
58
89
 
59
90
  systemStyle: {
60
91
  type: Object|null,
@@ -134,6 +165,10 @@
134
165
  isBoxShadow:{
135
166
  type: Boolean,
136
167
  default: false,
168
+ },
169
+ plain: {
170
+ type: Boolean,
171
+ default: false
137
172
  }
138
173
  },
139
174
  data(){
@@ -224,6 +259,19 @@
224
259
  if(this.boxShadow) return this.boxShadow;
225
260
  return `0 ${this.btnShadowList[this.uiSize]}rpx ${this.btnShadowList[this.uiSize] - 2}rpx ${color}`;
226
261
  },
262
+ plainStyle(){
263
+ let color = this.getBgColor(this.uiType);
264
+ if(this.plain){
265
+ return {
266
+ background: 'transparent',
267
+ borderColor: color,
268
+ color: color,
269
+ borderWidth: '1rpx',
270
+ borderStyle: 'solid'
271
+ }
272
+ }
273
+ return {}
274
+ }
227
275
  },
228
276
  async created(){
229
277
  let pageStyle = this.systemStyle || {};
@@ -427,16 +427,17 @@ export default {
427
427
  //选卡弹出项
428
428
  useCardPop(data){
429
429
  return new Promise((resolve, reject) => {
430
- uni.showModal({
430
+ this.$xdConfirm({
431
431
  title: '提示',
432
432
  content: data.pop_message,
433
433
  confirmText: data.confirm_text,
434
434
  cancelText: data.cancel_text,
435
- success: function (res) {
435
+ width: '85%',
436
+ isTitle: true,
437
+ success: (res) => {
436
438
  if (res.confirm) {
437
439
  resolve(2);
438
440
  } else if (res.cancel) {
439
- // reject("取消支付");
440
441
  if(data.pop_type == 'confirm'){
441
442
  resolve();
442
443
  }else{
@@ -554,10 +555,12 @@ export default {
554
555
  else if(!cardForm.card_number && !cardForm.card_password) err_tip = "票券和密码不能为空";
555
556
  }
556
557
  if(err_tip) {
557
- return uni.showToast({
558
- title: err_tip,
559
- icon: "none"
560
- })
558
+ return this.$xdAlert({
559
+ content: err_tip,
560
+ time: 2500,
561
+ isClose: false,
562
+ zIndex: 5000
563
+ });
561
564
  }
562
565
  let callThis = this;
563
566
  // #ifdef MP
@@ -650,17 +653,19 @@ export default {
650
653
  return Promise.reject("请选择兑换方式");
651
654
  }
652
655
  return new Promise((resolve, reject) => {
653
- uni.showModal({
656
+ this.$xdConfirm({
654
657
  title: '提示',
655
658
  content: '您当前未使用票券,您将全部用微信支付',
656
659
  confirmText: "我知道了",
657
- success: function (res) {
660
+ width: '85%',
661
+ isTitle: true,
662
+ success: (res) => {
658
663
  if (res.confirm) {
659
664
  resolve();
660
665
  } else if (res.cancel) {
661
666
  reject("取消支付");
662
667
  }
663
- }
668
+ },
664
669
  });
665
670
  })
666
671
  },
@@ -668,10 +673,14 @@ export default {
668
673
  async doTicketPay(){
669
674
  const { total_price, submitCardList, needPayPrice } = this;
670
675
  if(!submitCardList.length){
671
- if(this.isGift) return uni.showToast({
672
- title: '请选择票券支付',
673
- duration: 2000
674
- });
676
+ if(this.isGift){
677
+ return this.$xdAlert({
678
+ content: '请选择票券支付',
679
+ time: 2500,
680
+ isClose: false,
681
+ zIndex: 5000
682
+ });
683
+ }
675
684
  else await this.handleConfirmAllWxPay();
676
685
  }
677
686
  let postData = {
@@ -473,16 +473,17 @@ export default {
473
473
  //选卡弹出项
474
474
  useCardPop(data){
475
475
  return new Promise((resolve, reject) => {
476
- uni.showModal({
476
+ this.$xdConfirm({
477
477
  title: '提示',
478
478
  content: data.pop_message,
479
479
  confirmText: data.confirm_text,
480
480
  cancelText: data.cancel_text,
481
- success: function (res) {
481
+ width: '85%',
482
+ isTitle: true,
483
+ success: (res) => {
482
484
  if (res.confirm) {
483
485
  resolve(2);
484
486
  } else if (res.cancel) {
485
- // reject("取消支付");
486
487
  if(data.pop_type == 'confirm'){
487
488
  resolve();
488
489
  }else{
@@ -617,10 +618,12 @@ export default {
617
618
  else if(!cardForm.card_number && !cardForm.card_password) err_tip = "票券和密码不能为空";
618
619
  }
619
620
  if(err_tip) {
620
- return uni.showToast({
621
- title: err_tip,
622
- icon: "none"
623
- })
621
+ return this.$xdAlert({
622
+ content: err_tip,
623
+ time: 2500,
624
+ isClose: false,
625
+ zIndex: 5000
626
+ });
624
627
  }
625
628
  let callThis = this;
626
629
  // #ifdef MP
@@ -10,6 +10,7 @@
10
10
  transform: isPreview ? 'translate(-50%, 0)': 'translate(-50%, -50%)'
11
11
  }"
12
12
  >
13
+ <view class="xd-input-confirm__body-cover" :style="[bodyCoverBoxStyle]"></view>
13
14
  <view class="xd-input-confirm__body-close" v-if="confirm.showClose">
14
15
  <xd-font-icon @click="close" icon="icondanchuangguanbi_xian" size="32"></xd-font-icon>
15
16
  </view>
@@ -55,6 +56,7 @@
55
56
  <view class="btn-wrapper" v-if="isBtnFull === false">
56
57
  <view :style="[cancelWidthComp]" v-if="confirm.cancel">
57
58
  <xd-button
59
+ :plain="isPlain"
58
60
  :font-size="32"
59
61
  style="padding: 0 30rpx; min-width: 200rpx"
60
62
  @click="handleConfirm('cancel')"
@@ -68,6 +70,7 @@
68
70
  </view>
69
71
  <view :style="[confirmWidthComp]" v-if="confirm.confirm">
70
72
  <xd-button
73
+ :plain="isPlain"
71
74
  style="padding: 0 30rpx; min-width: 200rpx"
72
75
  :font-size="32"
73
76
  @click="handleConfirm('confirm')"
@@ -116,6 +119,11 @@
116
119
  import {mapState, mapMutations} from 'vuex';
117
120
  import XdContentXss from "@/components/XdContentXss/XdContentXss";
118
121
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
122
+ import Color from "color"
123
+ import {
124
+ getParentsStyle, //获取页面风格单个键值值
125
+ getParentsStyles //获取页面风格列表
126
+ } from '@/utils/xd.base';
119
127
 
120
128
  export default {
121
129
  name: "XdConfirm",
@@ -134,6 +142,7 @@
134
142
  ...mapState([
135
143
  'xdInputConfirm',
136
144
  'styleCommon',
145
+ 'brandInfo'
137
146
  ]),
138
147
  ...mapState({
139
148
  currentStyle:(state)=>{
@@ -163,7 +172,21 @@
163
172
  },
164
173
  cancelWidthComp(){
165
174
  return this.getWidth('btnCancelWidth');
166
- }
175
+ },
176
+ isPlain(){
177
+ let type = this.brandInfo.base_style;
178
+ if(type === 'whiteConfirmPlain') return true;
179
+ return false;
180
+ },
181
+ bodyCoverBoxStyle(){
182
+ let type = this.brandInfo.base_style;
183
+ let style = {};
184
+ if(type === 'bgColorGradient'){
185
+ let color1 = Color(this.uiStyle.$mainColor).alpha(0.25).toString();
186
+ style.background = `linear-gradient(180deg, ${color1} 0%, rgba(255,255,255,0) 20%, rgba(255,255,255,0) 100%)`
187
+ }
188
+ return style;
189
+ },
167
190
 
168
191
  },
169
192
  data() {
@@ -217,12 +240,16 @@
217
240
  msgIcon:'',
218
241
  msgIconColor:'',
219
242
  msgIconSize:'70',
220
- }
243
+ },
244
+ uiStyle: {},
221
245
  }
222
246
  },
223
247
  watch: {
224
248
  xdInputConfirm(value) {
225
249
  this.init(value);
250
+ },
251
+ styleCommon(val){
252
+ this.uiStyle = val;
226
253
  }
227
254
  },
228
255
  created() {
@@ -326,6 +353,14 @@
326
353
  padding: unit(30,rpx);
327
354
  box-sizing: border-box;
328
355
 
356
+ &-cover{
357
+ position: absolute;
358
+ left: 0;
359
+ top: 0;
360
+ width: 100%;
361
+ height: 100%;
362
+ }
363
+
329
364
  &-title {
330
365
  padding: 0 unit(30, rpx);
331
366
  font-size: unit(40, rpx);
@@ -481,26 +481,27 @@ export default {
481
481
  //选卡弹出项
482
482
  useCardPop(data) {
483
483
  return new Promise((resolve, reject) => {
484
- uni.showModal({
485
- title: "提示",
484
+ this.$xdConfirm({
485
+ title: '提示',
486
486
  content: data.pop_message,
487
487
  confirmText: data.confirm_text,
488
488
  cancelText: data.cancel_text,
489
- success: function (res) {
489
+ width: '85%',
490
+ isTitle: true,
491
+ success: (res) => {
490
492
  if (res.confirm) {
491
493
  resolve(2);
492
494
  } else if (res.cancel) {
493
- // reject("取消支付");
494
- if (data.pop_type == "confirm") {
495
+ if(data.pop_type == 'confirm'){
495
496
  resolve();
496
- } else {
497
+ }else{
497
498
  resolve(3);
498
499
  }
499
500
  }
500
501
  },
501
502
  fail: function (res) {
502
503
  reject(res);
503
- },
504
+ }
504
505
  });
505
506
  });
506
507
  },
@@ -658,9 +659,11 @@ export default {
658
659
  err_tip = "优惠券和密码不能为空";
659
660
  }
660
661
  if (err_tip) {
661
- return uni.showToast({
662
- title: err_tip,
663
- icon: "none",
662
+ return this.$xdAlert({
663
+ content: err_tip,
664
+ time: 2500,
665
+ isClose: false,
666
+ zIndex: 5000
664
667
  });
665
668
  }
666
669
  let callThis = this;
@@ -12,6 +12,7 @@
12
12
  transform: isPreview ? 'translate(-50%, 0)': 'translate(-50%, -50%)'
13
13
  }"
14
14
  >
15
+ <view class="xd-dailog__body-cover" :style="[bodyCoverBoxStyle]"></view>
15
16
  <view class="xd-dailog__body-title" v-if="showTitleComp">
16
17
  <slot name="title">
17
18
  {{title}}
@@ -58,6 +59,12 @@
58
59
  <script>
59
60
  import XdButton from "@/components/XdButton/XdButton";
60
61
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
62
+ import {mapState, mapMutations} from 'vuex';
63
+ import Color from "color"
64
+ import {
65
+ getParentsStyle, //获取页面风格单个键值值
66
+ getParentsStyles //获取页面风格列表
67
+ } from '@/utils/xd.base';
61
68
 
62
69
  export default {
63
70
  name: "XdDailog",
@@ -151,10 +158,14 @@
151
158
  uiShow: false,
152
159
  uiRadius: 11.2,
153
160
  uiDisabled: false,
161
+ uiStyle: {}
154
162
  }
155
163
  },
156
164
 
157
165
  computed:{
166
+ ...mapState([
167
+ 'brandInfo'
168
+ ]),
158
169
  showTitleComp(){
159
170
  let temp = true;
160
171
  // #ifdef MP-WEIXIN
@@ -165,7 +176,16 @@
165
176
  if(this.title === '' || this.title === null || this.title === undefined) temp = false;
166
177
  // #endif
167
178
  return temp;
168
- }
179
+ },
180
+ bodyCoverBoxStyle(){
181
+ let type = this.brandInfo.base_style;
182
+ let style = {};
183
+ if(type === 'bgColorGradient'){
184
+ let color1 = Color(this.uiStyle.$mainColor).alpha(0.25).toString();
185
+ style.background = `linear-gradient(180deg, ${color1} 0%, rgba(255,255,255,0) 100%)`
186
+ }
187
+ return style;
188
+ },
169
189
  },
170
190
 
171
191
  watch:{
@@ -176,7 +196,12 @@
176
196
  this.uiDisabled = value;
177
197
  },
178
198
  },
179
- created(){
199
+ async created(){
200
+ let pageStyle = this.systemStyle || {};
201
+ let style = await getParentsStyles();
202
+ style = Object.assign({}, JSON.parse(JSON.stringify(style)) , pageStyle);
203
+ this.uiStyle = style;
204
+
180
205
  this.uiShow = this.show;
181
206
  this.uiDisabled = this.disabled;
182
207
  this.uiRadius = this.radius;
@@ -237,6 +262,14 @@
237
262
  position: absolute;
238
263
  left: 50%;
239
264
 
265
+ &-cover{
266
+ position: absolute;
267
+ left: 0;
268
+ top: 0;
269
+ width: 100%;
270
+ height: 100rpx;
271
+ }
272
+
240
273
  &-close {
241
274
  position: absolute;
242
275
  width:unit(52/@scale, rpx);
@@ -3,25 +3,26 @@
3
3
  <view class="xd-tips__mask"></view>
4
4
  <view
5
5
  class="xd-tips__body"
6
- :style="{
6
+ :style="[{
7
7
  borderRadius: tips.radius,
8
8
  background: tips.background,
9
9
  color: tips.contentColor,
10
10
  width: tips.width,
11
11
  top: isPreview ? '400rpx': '50%',
12
12
  transform: isPreview ? 'translate(-50%, 0)': 'translate(-50%, -50%)'
13
- }"
13
+ }, bodyBoxStyle]"
14
14
  >
15
+ <view class="xd-tips__body-cover" :style="[bodyCoverBoxStyle]"></view>
15
16
  <view class="xd-tips__body-close" @click="close" v-if="tips.isClose">
16
17
  <xd-font-icon icon="iconguanbi" width="30" height="30" size="25" :color="tips.contentColor"></xd-font-icon>
17
18
  </view>
18
- <view class="xd-tips__body-icon" v-if="tips.iconShow">
19
+ <!-- <view class="xd-tips__body-icon" v-if="tips.iconShow">
19
20
  <xd-font-icon :icon="tips.icon" :size="tips.iconSize" :color="tips.iconColor"></xd-font-icon>
20
- </view>
21
- <view class="xd-tips__body-content" v-if="tips.isHtml">
21
+ </view> -->
22
+ <view class="xd-tips__body-content" v-if="tips.isHtml" :style="[bodyContentStyle]">
22
23
  <xd-content-xss :html="tips.content"></xd-content-xss>
23
24
  </view>
24
- <view v-else class="xd-tips__body-content">
25
+ <view v-else class="xd-tips__body-content" :style="[bodyContentStyle]">
25
26
  {{tips.content}}
26
27
  </view>
27
28
  </view>
@@ -32,6 +33,11 @@
32
33
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
33
34
  import {mapState, mapMutations} from 'vuex';
34
35
  import XdContentXss from "@/components/XdContentXss/XdContentXss";
36
+ import Color from "color"
37
+ import {
38
+ getParentsStyle, //获取页面风格单个键值值
39
+ getParentsStyles //获取页面风格列表
40
+ } from '@/utils/xd.base';
35
41
 
36
42
  export default {
37
43
  name: "XdTips",
@@ -47,8 +53,37 @@ export default {
47
53
  },
48
54
  computed: {
49
55
  ...mapState([
50
- 'xdTips'
51
- ])
56
+ 'xdTips',
57
+ 'brandInfo',
58
+ 'styleCommon',
59
+ ]),
60
+ bodyBoxStyle(){
61
+ let type = this.brandInfo.base_style;
62
+ let style = {};
63
+ if(type !== 'default'){
64
+ style.background = '#FFFFFF';
65
+ }
66
+ return style
67
+ },
68
+ bodyCoverBoxStyle(){
69
+ let type = this.brandInfo.base_style;
70
+ let color1 = Color(this.uiStyle.$mainColor).alpha(0.25).toString();
71
+ let style = {
72
+ background: '',
73
+ }
74
+ if(type === 'bgColorGradient'){
75
+ style.background = `linear-gradient(180deg, ${color1} 0%, rgba(255,255,255,0) 20%, rgba(255,255,255,0) 100%)`
76
+ }
77
+ return style
78
+ },
79
+ bodyContentStyle(){
80
+ let type = this.brandInfo.base_style;
81
+ let style = {};
82
+ if(type !== 'default'){
83
+ style.color = '#333';
84
+ }
85
+ return style
86
+ }
52
87
  },
53
88
  data(){
54
89
  return {
@@ -75,8 +110,8 @@ export default {
75
110
  tips: {},
76
111
 
77
112
  defaultTips: {
78
- width: '300rpx',
79
- isClose: true,
113
+ width: '500rpx',
114
+ isClose: false,
80
115
  zIndex: 1700,
81
116
  content: '',
82
117
  contentColor: '#eee',
@@ -90,12 +125,16 @@ export default {
90
125
  radius: '30rpx',
91
126
  close: null,
92
127
  type: 'success'
93
- }
128
+ },
129
+ uiStyle: {}
94
130
  }
95
131
  },
96
132
  watch:{
97
133
  xdTips(value){
98
134
  this.init(value);
135
+ },
136
+ styleCommon(val){
137
+ this.uiStyle = val;
99
138
  }
100
139
  },
101
140
  created(){
@@ -175,6 +214,7 @@ export default {
175
214
 
176
215
  &__mask {
177
216
  position: absolute;
217
+ top: 0;
178
218
  bottom: 0;
179
219
  left: 0;
180
220
  right: 0;
@@ -190,6 +230,15 @@ export default {
190
230
  box-shadow: 0 0 unit(20,rpx) rgba(0,0,0,0.3);
191
231
  box-sizing: border-box;
192
232
  padding: unit(60,rpx) unit(30, rpx);
233
+ overflow: hidden;
234
+
235
+ &-cover{
236
+ position: absolute;
237
+ left: 0;
238
+ top: 0;
239
+ width: 100%;
240
+ height: 100%;
241
+ }
193
242
 
194
243
  &-close {
195
244
  position: absolute;
@@ -214,7 +263,8 @@ export default {
214
263
 
215
264
  &-content {
216
265
  text-align: center;
217
- font-size: unit(40, rpx)
266
+ font-size: unit(32, rpx);
267
+ position: relative;
218
268
  }
219
269
 
220
270
  }