gxd-uni-library-editx 1.0.22 → 1.0.23

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.22",
3
+ "version": "1.0.23",
4
4
  "private": false,
5
5
  "description": "聚福宝基础插件专用库",
6
6
  "main": "index.js",
@@ -32,19 +32,17 @@
32
32
  </view>
33
33
  <view class="xd-dailog__body-btn" v-if="cancel || confirm">
34
34
  <slot name="btn">
35
- <view>
35
+ <view v-if="cancel">
36
36
  <xd-button
37
- v-if="cancel"
38
37
  @click="handleConfirm('cancel')"
39
38
  :type="cancelColorType"
40
39
  size="medium"
41
40
  :radius="btnRadius + 'rpx'"
42
41
  >{{cancelText}}</xd-button>
43
42
  </view>
44
- <view>
43
+ <view v-if="confirm">
45
44
  <xd-button
46
45
  @click="handleConfirm('confirm')"
47
- v-if="confirm"
48
46
  :type="confirmColorType"
49
47
  size="medium"
50
48
  :radius="btnRadius + 'rpx'"
@@ -135,7 +133,7 @@
135
133
  type: Number, //rpx
136
134
  default: 10,
137
135
  },
138
-
136
+
139
137
  isAuto:{
140
138
  type: Boolean,
141
139
  default: false,
@@ -167,7 +165,7 @@
167
165
  if(this.$configProject && this.$configProject.isPreview) {
168
166
  this.isPreview = !this.isAuto && this.$configProject.isPreview
169
167
  }
170
-
168
+
171
169
  },
172
170
  methods: {
173
171
 
@@ -19,7 +19,7 @@
19
19
  :id="`tab-scroll__index-${index}`"
20
20
  v-for="(item, index) in list"
21
21
  :key="index"
22
- :style="{color: activeIndex === index? styleMainColor: color}"
22
+ :style="{color: activeIndex === index? activeColor || styleMainColor: color}"
23
23
  class="tab-scroll__item"
24
24
  :class="{active:activeIndex === index}"
25
25
  @click="clickTab(item, index)"
@@ -32,7 +32,7 @@
32
32
  <view
33
33
  v-if="showFooterLine"
34
34
  :style="{
35
- background: activeIndex === index? styleMainColor: '',
35
+ background: activeIndex === index? activeColor || styleMainColor: '',
36
36
  bottom: (lineBottom) + 'rpx'
37
37
  }"
38
38
  ></view>
@@ -103,6 +103,10 @@
103
103
  type: String,
104
104
  default: '#333'
105
105
  },
106
+ activeColor:{
107
+ type: String,
108
+ default: ''
109
+ },
106
110
  bgColor: {
107
111
  type: String,
108
112
  default: '#fff'
@@ -143,7 +147,7 @@
143
147
  async created() {
144
148
  this.styleMainColor = await getParentsStyle(this.$parent, '$mainColor');
145
149
  },
146
-
150
+
147
151
  mounted(){
148
152
  this.$nextTick(()=>{
149
153
  this.toView = 'tab-scroll__index-0'
@@ -208,7 +212,7 @@
208
212
  display: flex;
209
213
  align-items: center;
210
214
  align-content: center;
211
-
215
+
212
216
  &.active {
213
217
  color: @xd-base-color;
214
218
  }
@@ -655,19 +655,23 @@ export function toProductDetail($vm, item, url, showCart = false) {
655
655
 
656
656
  /**
657
657
  * @description 获取图片信息
658
- * @param src {String} 图片地址
659
- * @param height {Number} 默认高度
658
+ * @param src {string} 图片地址
659
+ * @param height {number} 默认高度
660
+ * @param margin {number} 像素
660
661
  */
661
- export function getImageInfo(src, height = 100) {
662
+ export function getImageInfo(src, height = 100, margin = 0) {
662
663
  return new Promise((resolve, reject) => {
663
664
  uni.getImageInfo({
664
665
  src,
665
666
  complete:(image)=>{
666
- console.log('getImageInfo', image)
667
667
  if(image.errMsg === 'getImageInfo:ok') {
668
+ const system = uni.getSystemInfoSync()
669
+ const windowW = system.safeArea.width - Number(margin);
670
+ const windowH = Math.floor((image.height * windowW)/image.width);
671
+ console.log('getImageInfo', image,windowH)
668
672
  resolve({
669
- imgWidth: image.width,
670
- imgHeight: image.height,
673
+ imgWidth: windowW,
674
+ imgHeight: windowH,
671
675
  imgStatus: 'ok'
672
676
  });
673
677
  }