Browse Source

Merge branch 'v4' of https://github.com/jdf2e/nutui into v4

Ymm0008 3 years ago
parent
commit
9f0fb8aa49

+ 14 - 14
src/packages/__VUE/comment/doc.en-US.md

@@ -179,14 +179,14 @@ export default {
 
 | Attribute            | Description               | Type   | Default  |
 |--------------|----------------------------------|--------|------------------|
-| header-type         | Header type      | String | default               |
-| images-rows         | Comment picture shows type of lines    | String | one               |
-| ellipsis        | Ellipsis number       | [String,Number] | 2               |
-| videos         | Videos data | Array | []              |
-| images | Images data    | Array | [] |
-| info     | Comment data                      | Object | {}             |
-| follow     | Additional review data                      | Object | {}             |
-| operation | Bottom button   | Array | ["replay", "like", "more"] |
+| header-type         | Header type      | string | `default`               |
+| images-rows         | Comment picture shows type of lines    | string | `one`               |
+| ellipsis        | Ellipsis number       | string \| number | `2`               |
+| videos         | Videos data | array | `[]`              |
+| images | Images data    | array | `[]` |
+| info     | Comment data                      | object | `{}`             |
+| follow     | Additional review data                      | object | `{}`             |
+| operation | Bottom button   | array | `["replay", "like", "more"]` |
 
 ### Events
 
@@ -244,9 +244,9 @@ const info = [{
 
 The component provides the following CSS variables, which can be used to customize styles. Please refer to [ConfigProvider component](#/en-US/config-provider).
 
-| Name | Default Value | Description |
-| --------------------------------------- | -------------------------- | ---- |
-| --nut-comment-header-user-name-color| _rgba(51, 51, 51, 1)_ | -  |
-| --nut-comment-header-time-color| _rgba(153, 153, 153, 1)_ | -  |
-| --nut-comment-bottom-label-color| _rgba(153, 153, 153, 1)_ | -  |
-| --nut-comment-shop-color| _var(--nut-primary-color)_ | -  |
+| Name | Default Value | 
+| --------------------------------------- | -------------------------- | 
+| --nut-comment-header-user-name-color| _rgba(51, 51, 51, 1)_ |
+| --nut-comment-header-time-color| _rgba(153, 153, 153, 1)_ |
+| --nut-comment-bottom-label-color| _rgba(153, 153, 153, 1)_ |
+| --nut-comment-shop-color| _var(--nut-primary-color)_ |

+ 14 - 14
src/packages/__VUE/comment/doc.md

@@ -179,14 +179,14 @@ export default {
 
 | 参数         | 说明                             | 类型   | 默认值           |
 |--------------|----------------------------------|--------|------------------|
-| header-type         | 头部样式展示类型,可选: default,complex      | String | default               |
-| images-rows         | 评论图片展示行数,可选: one,multi     | String | one               |
-| ellipsis        | 设置评论内容省略行数       | [String,Number] | 2               |
-| videos         | 视频信息 | Array | []              |
-| images | 图片信息    | Array | [] |
-| info     | 评论详情                      | Object | {}             |
-| follow     | 追评内容                      | Object | {}             |
-| operation | 配置底部按钮   | Array | ["replay", "like", "more"] |
+| header-type         | 头部样式展示类型,可选: default,complex      | string | `default`               |
+| images-rows         | 评论图片展示行数,可选: one,multi     | string | `one`               |
+| ellipsis        | 设置评论内容省略行数       | string \| number | `2`               |
+| videos         | 视频信息 | array | `[]`             |
+| images | 图片信息    | array | `[]` |
+| info     | 评论详情                      | object | `{}`             |
+| follow     | 追评内容                      | object | `{}`             |
+| operation | 配置底部按钮   | array | `["replay", "like", "more"]` |
 
 ### Events
 
@@ -248,9 +248,9 @@ const info = [{
 
 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/config-provider)。
 
-| 名称                                    | 默认值                     | 描述 |
-| --------------------------------------- | -------------------------- | ---- |
-| --nut-comment-header-user-name-color| _rgba(51, 51, 51, 1)_ | -  |
-| --nut-comment-header-time-color| _rgba(153, 153, 153, 1)_ | -  |
-| --nut-comment-bottom-label-color| _rgba(153, 153, 153, 1)_ | -  |
-| --nut-comment-shop-color| _var(--nut-primary-color)_ | -  |
+| 名称                                    | 默认值                     | 
+| --------------------------------------- | -------------------------- | 
+| --nut-comment-header-user-name-color| _rgba(51, 51, 51, 1)_ |
+| --nut-comment-header-time-color| _rgba(153, 153, 153, 1)_ |
+| --nut-comment-bottom-label-color| _rgba(153, 153, 153, 1)_ |
+| --nut-comment-shop-color| _var(--nut-primary-color)_ |

+ 14 - 14
src/packages/__VUE/comment/doc.taro.md

@@ -179,14 +179,14 @@ export default {
 
 | 参数         | 说明                             | 类型   | 默认值           |
 |--------------|----------------------------------|--------|------------------|
-| header-type         | 头部样式展示类型,可选: default,complex      | String | default               |
-| images-rows         | 评论图片展示行数,可选: one,multi     | String | one               |
-| ellipsis        | 设置评论内容省略行数       | [String,Number] | 2               |
-| videos         | 视频信息 | Array | []              |
-| images | 图片信息    | Array | [] |
-| info     | 评论详情                      | Object | {}             |
-| follow     | 追评内容                      | Object | {}             |
-| operation | 配置底部按钮   | Array | ["replay", "like", "more"] |
+| header-type         | 头部样式展示类型,可选: default,complex      | string | `default`               |
+| images-rows         | 评论图片展示行数,可选: one,multi     | string | `one`               |
+| ellipsis        | 设置评论内容省略行数       | string \| number | `2`               |
+| videos         | 视频信息 | array | `[]`             |
+| images | 图片信息    | array | `[]` |
+| info     | 评论详情                      | object | `{}`             |
+| follow     | 追评内容                      | object | `{}`             |
+| operation | 配置底部按钮   | array | `["replay", "like", "more"]` |
 
 ### Events
 
@@ -249,9 +249,9 @@ const info = [{
 
 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/config-provider)。
 
-| 名称                                    | 默认值                     | 描述 |
-| --------------------------------------- | -------------------------- | ---- |
-| --nut-comment-header-user-name-color| _rgba(51, 51, 51, 1)_ | -  |
-| --nut-comment-header-time-color| _rgba(153, 153, 153, 1)_ | -  |
-| --nut-comment-bottom-label-color| _rgba(153, 153, 153, 1)_ | -  |
-| --nut-comment-shop-color| _var(--nut-primary-color)_ | -  |
+| 名称                                    | 默认值                     | 
+| --------------------------------------- | -------------------------- | 
+| --nut-comment-header-user-name-color| _rgba(51, 51, 51, 1)_ |
+| --nut-comment-header-time-color| _rgba(153, 153, 153, 1)_ |
+| --nut-comment-bottom-label-color| _rgba(153, 153, 153, 1)_ |
+| --nut-comment-shop-color| _var(--nut-primary-color)_ |

+ 10 - 10
src/packages/__VUE/ellipsis/doc.en-US.md

@@ -84,13 +84,13 @@ app.use(Ellipsis);
 
 | Attribute         | Description                             | Type   | Default           |
 |--------------|----------------------------------|--------|------------------|
-| content         | Content               | String | -                |
-| direction         | Direction                | 'start' | 'end' | 'middle' | 'end'               |
-| rows         | Rows               | Number | 1              |
-| expand-text         | Expand text               | String | ''              |
-| collapse-text         | Collapse text               | String | ''               |
-| symbol         | Symbol     | String | '...'       |
-| line-height         | the row height of the container     | String、Number | 20       |
+| content         | Content               | string | -                |
+| direction         | Direction                | 'start' \| 'end' \| 'middle' | `end`               |
+| rows         | Rows               | number | `1`              |
+| expand-text         | Expand text               | string | `''`             |
+| collapse-text         | Collapse text               | string | `''`               |
+| symbol         | Symbol     | string | `...`       |
+| line-height         | the row height of the container     | string \| number | `20`       |
 
 ### Events
 
@@ -105,6 +105,6 @@ app.use(Ellipsis);
 
 The component provides the following CSS variables, which can be used to customize styles. Please refer to [ConfigProvider component](#/en-US/config-provider).
 
-| Name | Default Value | Description |
-| --------------------------------------- | -------------------------- | ---- |
-|  --nut-ellipsis-expand-collapse-color       | _#3460fa_        | -    |
+| Name | Default Value | 
+| --------------------------------------- | -------------------------- | 
+|  --nut-ellipsis-expand-collapse-color       | _#3460fa_        | 

+ 10 - 10
src/packages/__VUE/ellipsis/doc.md

@@ -84,13 +84,13 @@ app.use(Ellipsis);
 
 | 参数         | 说明                             | 类型   | 默认值           |
 |--------------|----------------------------------|--------|------------------|
-| content         | 文本内容               | String | -                |
-| direction         | 省略位置               | 'start' | 'end' | 'middle' | 'end'               |
-| rows         | 展示几行               | Number | 1              |
-| expand-text         | 展开操作的文案               | String | ''              |
-| collapse-text         | 收起操作的文案               | String | ''               |
-| symbol         | 省略的符号     | String | '...'       |
-| line-height          | 容器的行高     | String、Number | 20       |
+| content         | 文本内容               | string | -                |
+| direction         | 省略位置               | 'start' \| 'end' \| 'middle' | `end`               |
+| rows         | 展示几行               | number | `1`              |
+| expand-text         | 展开操作的文案               | string | `''`             |
+| collapse-text         | 收起操作的文案               | string | `''`               |
+| symbol         | 省略的符号     | string | `...`       |
+| line-height          | 容器的行高     | string \| number | `20`       |
 
 ### Events
 
@@ -105,6 +105,6 @@ app.use(Ellipsis);
 
 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/config-provider)。
 
-| 名称                                    | 默认值                     | 描述 |
-| --------------------------------------- | -------------------------- | ---- |
-|  --nut-ellipsis-expand-collapse-color       | _#3460fa_        | -    |
+| 名称                                    | 默认值                     | 
+| --------------------------------------- | -------------------------- | 
+|  --nut-ellipsis-expand-collapse-color       | _#3460fa_        |

+ 10 - 10
src/packages/__VUE/ellipsis/doc.taro.md

@@ -84,13 +84,13 @@ app.use(Ellipsis);
 
 | 参数         | 说明                             | 类型   | 默认值           |
 |--------------|----------------------------------|--------|------------------|
-| content         | 文本内容               | String | -                |
-| direction         | 省略位置               | 'start' | 'end' | 'middle' | 'end'               |
-| rows         | 展示几行               | Number | 1              |
-| expand-text         | 展开操作的文案               | String | ''              |
-| collapse-text         | 收起操作的文案               | String | ''               |
-| symbol         | 省略的符号     | String | '...'       |
-| line-height          | 容器的行高     | String、Number | 20       |
+| content         | 文本内容               | string | -                |
+| direction         | 省略位置               | 'start' \| 'end' \| 'middle' | `end`               |
+| rows         | 展示几行               | number | `1`             |
+| expand-text         | 展开操作的文案               | string | `''`             |
+| collapse-text         | 收起操作的文案               | string | `''`               |
+| symbol         | 省略的符号     | string | `...`       |
+| line-height          | 容器的行高     | string \| number | `20`       |
 
 ### Events
 
@@ -105,6 +105,6 @@ app.use(Ellipsis);
 
 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/config-provider)。
 
-| 名称                                    | 默认值                     | 描述 |
-| --------------------------------------- | -------------------------- | ---- |
-|  --nut-ellipsis-expand-collapse-color       | _#3460fa_        | -    |
+| 名称                                    | 默认值                     | 
+| --------------------------------------- | -------------------------- | 
+|  --nut-ellipsis-expand-collapse-color       | _#3460fa_        | 

+ 1 - 1
src/packages/__VUE/sku/components/SkuHeader.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="nut-sku-header">
-    <img :src="goods.imagePath" />
+    <img class="nut-sku-header-img" :src="goods.imagePath" />
     <view class="nut-sku-header-right">
       <template v-if="getSlots('sku-header-price')">
         <slot name="sku-header-price"></slot>

+ 43 - 0
src/packages/__VUE/sku/components/SkuHeaderTaro.vue

@@ -0,0 +1,43 @@
+<template>
+  <view class="nut-sku-header">
+    <image class="nut-sku-header-img" :src="goods.imagePath" />
+    <view class="nut-sku-header-right">
+      <template v-if="getSlots('sku-header-price')">
+        <slot name="sku-header-price"></slot>
+      </template>
+      <nut-price v-else :price="goods.price" :needSymbol="true" :thousands="false"> </nut-price>
+
+      <template v-if="getSlots('sku-header-extra')">
+        <slot name="sku-header-extra"></slot>
+      </template>
+      <view class="nut-sku-header-right-extra" v-if="goods.skuId && !getSlots('sku-header-extra')"
+        >{{ translate('skuId') }}&nbsp;:&nbsp;{{ goods.skuId }}</view
+      >
+    </view>
+  </view>
+</template>
+<script lang="ts">
+import { ref, watch, onMounted } from 'vue';
+
+import { createComponent } from '@/packages/utils/create';
+const { componentName, create, translate } = createComponent('sku-header');
+
+export default create({
+  props: {
+    goods: {
+      type: Object,
+      default: {}
+    }
+  },
+  emits: [],
+
+  setup(props: any, { emit, slots }) {
+    const getSlots = (name: string) => slots[name];
+
+    return {
+      getSlots,
+      translate
+    };
+  }
+});
+</script>

+ 1 - 1
src/packages/__VUE/sku/index.scss

@@ -50,7 +50,7 @@
     flex-shrink: 0;
     margin-top: 18px;
     padding: 0 18px;
-    > img {
+    .nut-sku-header-img {
       width: $sku-product-img-width;
       height: $sku-product-img-height;
       flex-shrink: 0;

+ 3 - 1
src/packages/__VUE/sku/index.taro.vue

@@ -63,7 +63,7 @@
 </template>
 <script lang="ts">
 import { ref, watch, PropType } from 'vue';
-import SkuHeader from './components/SkuHeader.vue';
+import SkuHeader from './components/SkuHeaderTaro.vue';
 import SkuSelect from './components/SkuSelect.vue';
 import SkuStepper from './components/SkuStepper.vue';
 import SkuOperate from './components/SkuOperate.vue';
@@ -208,6 +208,8 @@ export default create({
         if (value == false) {
           close();
         }
+
+        console.log(props.goods);
       }
     );
 

+ 2 - 0
src/sites/mobile-taro/vue/src/business/pages/comment/index.vue

@@ -82,6 +82,8 @@ export default defineComponent({
         method: 'GET',
         url: 'https://storage.360buyimg.com/nutui/3x/comment_data.json',
         success: (res) => {
+          res.data.Comment.info.avatar =
+            'https://img14.360buyimg.com/imagetools/jfs/t1/167902/2/8762/791358/603742d7E9b4275e3/e09d8f9a8bf4c0ef.png';
           cmt.value = res.data.Comment;
         }
       });

+ 2 - 0
src/sites/mobile-taro/vue/src/business/pages/sku/index.vue

@@ -207,6 +207,8 @@ export default defineComponent({
         data.skuData = Sku;
         data.goodsInfo = Goods;
         data.imagePathMap = imagePathMap;
+
+        console.log(Goods);
       }, 500);
     };
     const selectSku = (s: any) => {