mali-applet-ui 0.2.58 → 0.2.60

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.
@@ -2,7 +2,7 @@
2
2
  <view v-if="isFromReadonly" class="ml-amount-input is-readonly" :class="[className || '', {'is-right': align === 'right'}]">
3
3
  <view class="ml-amount-input-readonly-content">¥{{ amountLabel }}</view>
4
4
  </view>
5
- <view v-else-if="!editable && (platformEnv.isWX || platformEnv.isQW)" class="ml-amount-input not-edit" :class="[className || '', {'is-right': align === 'right', 'is-border': border}]">
5
+ <view v-else-if="!editable && (platformEnv.isWXMP || platformEnv.isQWMP)" class="ml-amount-input not-edit" :class="[className || '', {'is-right': align === 'right', 'is-border': border}]">
6
6
  <view class="ml-amount-input-simulate">
7
7
  <text v-if="inpVal">{{ inpVal }}</text>
8
8
  <text v-else class="ml-amount-input-placeholder">{{ placeholder }}</text>
@@ -2,7 +2,7 @@
2
2
  <view v-if="isFromReadonly" class="ml-input is-readonly" :class="[className || '', {'is-right': align === 'right'}]">
3
3
  <view class="ml-input-readonly-content">{{ inpVal }}</view>
4
4
  </view>
5
- <view v-else-if="!editable && (platformEnv.isWX || platformEnv.isQW)" class="ml-input not-edit" :class="[className || '', {'is-right': align === 'right', 'is-border': border}]">
5
+ <view v-else-if="!editable && (platformEnv.isWXMP || platformEnv.isQWMP)" class="ml-input not-edit" :class="[className || '', {'is-right': align === 'right', 'is-border': border}]">
6
6
  <view class="ml-input-simulate">
7
7
  <text v-if="inpVal">{{ inpVal }}</text>
8
8
  <text v-else class="ml-input-placeholder">{{ placeholder }}</text>
@@ -2,7 +2,7 @@
2
2
  <view v-if="isFromReadonly" class="ml-number-input is-readonly">
3
3
  <view class="ml-number-input-readonly-content">{{ inpVal }}</view>
4
4
  </view>
5
- <view v-else-if="!editable && (platformEnv.isWX || platformEnv.isQW)" class="ml-number-input not-edit" :class="[className || '', {'is-right': align === 'right', 'is-border': border}]">
5
+ <view v-else-if="!editable && (platformEnv.isWXMP || platformEnv.isQWMP)" class="ml-number-input not-edit" :class="[className || '', {'is-right': align === 'right', 'is-border': border}]">
6
6
  <view class="ml-number-input-simulate">
7
7
  <text v-if="inpVal">{{ inpVal }}</text>
8
8
  <text v-else class="ml-number-input-placeholder">{{ placeholder }}</text>
@@ -18,6 +18,7 @@ export default {
18
18
  showDot: Boolean,
19
19
  dotStatus: String,
20
20
  dotNum: [String, Number],
21
+ width: [String, Number],
21
22
  className: String
22
23
  },
23
24
  inject: {
@@ -46,6 +47,9 @@ export default {
46
47
  },
47
48
  dotNum () {
48
49
  this.updateProp('dotNum')
50
+ },
51
+ width() {
52
+ this.updateProp('width')
49
53
  }
50
54
  },
51
55
  mounted () {
@@ -57,7 +61,8 @@ export default {
57
61
  title: this.title,
58
62
  showDot: this.showDot,
59
63
  dotStatus: this.dotStatus,
60
- dotNum: this.dotNum
64
+ dotNum: this.dotNum,
65
+ width: this.width
61
66
  })
62
67
  }
63
68
  })
@@ -3,7 +3,7 @@
3
3
  <view class="ml-tabs-header">
4
4
  <scroll-view scroll-x>
5
5
  <view class="ml-tabs-navs" :class="[itemAlign ? `is-${itemAlign}` : '']">
6
- <view class="ml-tabs-nav-item" v-for="(item, index) in tabList" :key="index" :class="{'is-active': value === item.name}" :style="itemStyles" @tap="changeEvent(item)">
6
+ <view class="ml-tabs-nav-item" v-for="(item, index) in tabList" :key="index" :class="{'is-active': value === item.name}" :style="getItemStyles(item)" @tap="changeEvent(item)">
7
7
  <view class="ml-tabs-nav-title">{{ item.title }}</view>
8
8
  <view v-if="item.showDot && item.dotNum > 0" class="ml-tabs-nav-title-dot-num" :class="[item.dotStatus ? `s-${item.dotStatus}` : '']">{{ getDotNum(item.dotNum) }}</view>
9
9
  <view v-else-if="item.showDot" class="ml-tabs-nav-title-dot" :class="[item.dotStatus ? `s-${item.dotStatus}` : '']"></view>
@@ -36,12 +36,13 @@ export default {
36
36
  tabList: []
37
37
  }
38
38
  },
39
- computed: {
40
- itemStyles () {
41
- return this.itemWidth ? `width:${this.itemWidth};` : ''
42
- }
43
- },
44
39
  methods: {
40
+ getItemStyles (item) {
41
+ if (item.width) {
42
+ return `width:${item.itemWidth};`
43
+ }
44
+ return this.itemWidth ? `width:${this.itemWidth};` : ''
45
+ },
45
46
  getDotNum (num) {
46
47
  return num > 99 ? '99+' : num
47
48
  },
@@ -2,7 +2,7 @@
2
2
  <view v-if="isFromReadonly" class="ml-textarea is-readonly" :class="[className || '', {'is-right': align === 'right'}]">
3
3
  <view class="ml-textarea-readonly-content">{{ inpVal }}</view>
4
4
  </view>
5
- <view v-else-if="!editable && (platformEnv.isWX || platformEnv.isQW)" class="ml-textarea not-edit" :class="[className || '', {'is-right': align === 'right', 'is-border': border}]">
5
+ <view v-else-if="!editable && (platformEnv.isWXMP || platformEnv.isQWMP)" class="ml-textarea not-edit" :class="[className || '', {'is-right': align === 'right', 'is-border': border}]">
6
6
  <view class="ml-textarea-simulate" :style="{color: fontColor, height: `${rows * 30}rpx`}">
7
7
  <text v-if="inpVal">{{ inpVal }}</text>
8
8
  <text v-else class="ml-textarea-placeholder">{{ placeholder }}</text>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "0.2.58",
3
+ "version": "0.2.60",
4
4
  "description": "码里云小程序组件库",
5
5
  "scripts": {
6
6
  "release": "node script/release.js && npm publish"
package/utils/applet.js CHANGED
@@ -10,13 +10,13 @@ export function getPlatformEnv () {
10
10
  isQWH5: false,
11
11
  isDDH5: false,
12
12
  // 微信
13
- isWX: false,
13
+ isWXMP: false,
14
14
  // 企业微信
15
- isQW: false,
15
+ isQWMP: false,
16
16
  // 钉钉
17
- isDD: false,
17
+ isDDMP: false,
18
18
  // 支付宝
19
- isZFB: false
19
+ isZFBMP: false
20
20
  }
21
21
  if (/web/.test(sysRes.uniPlatform)) {
22
22
  platform.isH5 = true
@@ -25,12 +25,16 @@ export function getPlatformEnv () {
25
25
  } else {
26
26
  if (/WeChat/i.test(hostName)) {
27
27
  platform.isWX = true
28
+ platform.isWXMP = true
28
29
  } else if (/wxwork/i.test(hostName)) {
29
30
  platform.isQW = true
31
+ platform.isQWMP = true
30
32
  } else if (/DingTalk/i.test(hostName)) {
31
33
  platform.isDD = true
34
+ platform.isDDMP = true
32
35
  } else if (/alipay/i.test(hostName)) {
33
36
  platform.isZFB = true
37
+ platform.isZFBMP = true
34
38
  }
35
39
  }
36
40
  return platform