cb-biz-ui 1.2.1 → 1.2.2

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.
@@ -17,9 +17,7 @@
17
17
  <!-- <text v-else>{{ ` ` }}{{ data.discount }}折劵</text> -->
18
18
  </view>
19
19
  <view class="rule">仅限线下店内消费</view>
20
- <view class="date"
21
- >有效期: {{ fmtTime(data.receiveEndTime) }} 过期</view
22
- >
20
+ <view class="date">有效期: {{ data.receiveEndTime }} 过期</view>
23
21
  </view>
24
22
  <view
25
23
  class="button"
@@ -44,7 +42,6 @@
44
42
  </template>
45
43
  <script setup lang="ts">
46
44
  import { computed } from 'vue';
47
- import { fmtTime } from './utils';
48
45
  import type { dataTypes } from './interface';
49
46
 
50
47
  interface IProps {
@@ -17,7 +17,7 @@
17
17
  <!-- <text v-else>{{ ` ` }}{{ data.discount }}折劵</text> -->
18
18
  </view>
19
19
  <view class="rule">仅限线下店内消费</view>
20
- <view class="date">有效期: {{ receiveEndTime }} 过期</view>
20
+ <view class="date">有效期: {{ data.receiveEndTime }} 过期</view>
21
21
  </view>
22
22
  <view
23
23
  class="button"
@@ -44,7 +44,6 @@
44
44
  </template>
45
45
  <script setup lang="ts">
46
46
  import { computed } from 'vue';
47
- import { fmtTime } from './utils';
48
47
  import type { dataTypes } from './interface';
49
48
 
50
49
  interface IProps {
@@ -81,10 +80,6 @@ const emit = defineEmits<{
81
80
  (e: 'select', data: dataTypes): void;
82
81
  }>();
83
82
 
84
- const receiveEndTime = computed(() => {
85
- return fmtTime('yyyy-MM-dd', new Date(props.data.receiveEndTime));
86
- });
87
-
88
83
  const nameStr = computed(() => {
89
84
  const { discountType, thresholdStr, amountStr, discountStr } = props.data;
90
85
  if (discountType === 2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cb-biz-ui",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "cb-biz-ui",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -1,10 +0,0 @@
1
- export const fmtTime = (time: string) => {
2
- const time1 = new Date(
3
- time.replace(/-/g, '/').replace('T', ' ')
4
- ).toISOString(); // 转为国际标准化时间
5
- const time2 = time1.replace(/-/, '/');
6
- const time3 = time2.replace(/-/, '/');
7
- const time4 = time3.replace(/T/, ' ');
8
- const times = time4.split('.');
9
- return times[0];
10
- };
@@ -1,23 +0,0 @@
1
- export const fmtTime = (fmt: string, date: any) => {
2
- const o = {
3
- 'M+': date.getMonth() + 1,
4
- 'd+': date.getDate(),
5
- 'h+': date.getHours(),
6
- 'm+': date.getMinutes(),
7
- 's+': date.getSeconds(),
8
- 'q+': Math.floor((date.getMonth() + 3) / 3),
9
- S: date.getMilliseconds()
10
- };
11
- if (/(y+)/.test(fmt))
12
- fmt = fmt.replace(
13
- RegExp.$1,
14
- (date.getFullYear() + '').substr(4 - RegExp.$1.length)
15
- );
16
- for (let k in o)
17
- if (new RegExp('(' + k + ')').test(fmt))
18
- fmt = fmt.replace(
19
- RegExp.$1,
20
- RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr((o[k] + '').length)
21
- );
22
- return fmt;
23
- };