Commit 8f6c37755c295583f08bd52bc32e5cb1008aa215

Authored by YunaiV
2 parents 00e66216 dc3e353a

Merge remote-tracking branch 'origin/feature/1.8.0-uniapp' into feature/1.8.0-uniapp

Showing 55 changed files with 889 additions and 687 deletions
yudao-ui-app/components/yd-banner/yd-banner.vue 0 → 100644
  1 +<template>
  2 + <u-swiper :list="bannerList" :keyName="keyName" previousMargin="20" nextMargin="20" circular height="150" @change="e => (current = e.current)" :autoplay="true" @click="handleSwiperClick">
  3 + <view slot="indicator" class="indicator">
  4 + <view class="indicator__dot" v-for="(item, index) in bannerList" :key="index" :class="[index === current && 'indicator__dot--active']"></view>
  5 + </view>
  6 + </u-swiper>
  7 +</template>
  8 +
  9 +<script>
  10 +/**
  11 + * 广告滚动图
  12 + */
  13 +export default {
  14 + name: 'mkt-banner',
  15 + components: {},
  16 + props: {
  17 + keyName: {
  18 + type: String,
  19 + default: 'url'
  20 + },
  21 + bannerList: {
  22 + type: Array,
  23 + default: () => []
  24 + }
  25 + },
  26 + data() {
  27 + return {
  28 + current: 0,
  29 + currentNum: 0
  30 + }
  31 + },
  32 + methods: {
  33 + handleSwiperClick(index) {
  34 + console.log('点击了图片索引值:', index)
  35 + }
  36 + }
  37 +}
  38 +</script>
  39 +
  40 +<style lang="scss" scoped>
  41 +.indicator {
  42 + @include flex(row);
  43 + justify-content: center;
  44 +
  45 + &__dot {
  46 + height: 15rpx;
  47 + width: 15rpx;
  48 + border-radius: 100rpx;
  49 + background-color: rgba(255, 255, 255, 0.35);
  50 + margin: 0 10rpx;
  51 + transition: background-color 0.3s;
  52 +
  53 + &--active {
  54 + background-color: $custom-bg-color;
  55 + }
  56 + }
  57 +}
  58 +</style>
yudao-ui-app/components/yd-product-box/yd-product-box.vue 0 → 100644
  1 +<template>
  2 + <view>
  3 + <view v-if="showType === 'normal'">
  4 + <u-gap height="180" bgColor="#398ade"></u-gap>
  5 + <view class="prod-block">
  6 + <view class="bloc-header">
  7 + <text class="bloc-title">{{title}}</text>
  8 + <text class="see-more">查看更多</text>
  9 + </view>
  10 + <view class="prod-grid">
  11 + <view class="prod-item" v-for="(item, index) in productList" :key="item.id" @click="handleProdItemClick(item.id)">
  12 + <image class="prod-image" :src="item.image"></image>
  13 + <view class="item-info">
  14 + <view class="info-text">
  15 + <u--text :lines="2" size="14px" color="#333333" :text="item.title"></u--text>
  16 + </view>
  17 + <view class="price-and-cart">
  18 + <yd-text-price color="red" size="12" intSize="18" :price="item.price"></yd-text-price>
  19 + <u-icon name="shopping-cart" color="#2979ff" size="28"></u-icon>
  20 + </view>
  21 + </view>
  22 + </view>
  23 + </view>
  24 + </view>
  25 + </view>
  26 +
  27 + <view v-if="showType === 'half'">
  28 + <view class="prod-block half">
  29 + <view class="bloc-header">
  30 + <text class="bloc-title">{{title}}</text>
  31 + <text class="more">更多 &gt;</text>
  32 + </view>
  33 + <view class="prod-grid half">
  34 + <view class="prod-item" v-for="(item, index) in productList" :key="item.id" @click="handleProdItemClick(item.id)">
  35 + <image class="prod-image" :src="item.image"></image>
  36 + <view class="item-info">
  37 + <view class="info-text">
  38 + <u--text :lines="1" size="14px" color="#333333" :text="item.title"></u--text>
  39 + <u--text :lines="1" size="12px" color="#939393" :text="item.desc"></u--text>
  40 + </view>
  41 + <view class="price-and-cart">
  42 + <yd-text-price color="red" size="12" intSize="18" :price="item.price"></yd-text-price>
  43 + <u-icon name="shopping-cart" color="#2979ff" size="28"></u-icon>
  44 + </view>
  45 + </view>
  46 + </view>
  47 + </view>
  48 + </view>
  49 + </view>
  50 +
  51 + </view>
  52 +</template>
  53 +
  54 +<script>
  55 +/**
  56 + * 商品列表
  57 + */
  58 +export default {
  59 + name: 'yd-product-box',
  60 + components: {},
  61 + props: {
  62 + showType: {
  63 + type: String,
  64 + default: 'normal'
  65 + },
  66 + title: {
  67 + type: String,
  68 + default: '商品推荐'
  69 + },
  70 + productList: {
  71 + type: Array,
  72 + default: () => []
  73 + }
  74 + },
  75 + computed: {},
  76 + methods: {
  77 + handleProdItemClick(productId) {
  78 + uni.$u.route('/pages/product/product', {
  79 + productId: productId
  80 + })
  81 + }
  82 + }
  83 +}
  84 +</script>
  85 +<style lang="scss" scoped>
  86 +.prod-block {
  87 + margin-top: -160px;
  88 +
  89 + .bloc-header {
  90 + @include flex-space-between;
  91 + padding: 10rpx 20rpx;
  92 +
  93 + .bloc-title {
  94 + color: $custom-bg-color;
  95 + font-size: 34rpx;
  96 + }
  97 +
  98 + .see-more {
  99 + color: $custom-bg-color;
  100 + background: $u-primary;
  101 + padding: 0 30rpx;
  102 + height: 50rpx;
  103 + line-height: 50rpx;
  104 + border-radius: 50rpx;
  105 + font-size: 24rpx;
  106 + }
  107 + }
  108 +
  109 + &.half {
  110 + margin-top: 0;
  111 +
  112 + .bloc-header {
  113 + margin-top: 50rpx;
  114 + margin-bottom: 20rpx;
  115 +
  116 + .bloc-title {
  117 + color: #333333;
  118 + }
  119 +
  120 + .more {
  121 + font-size: 24rpx;
  122 + }
  123 + }
  124 + }
  125 +
  126 + .prod-grid {
  127 + width: 730rpx;
  128 + margin: 0 auto;
  129 + @include flex;
  130 + flex-wrap: wrap;
  131 + justify-content: left;
  132 +
  133 + &.half {
  134 + .prod-item {
  135 + width: 345rpx;
  136 + margin: 10rpx;
  137 +
  138 + .prod-image {
  139 + width: 345rpx;
  140 + height: 345rpx;
  141 + }
  142 + }
  143 + }
  144 +
  145 + .prod-item {
  146 + width: 223rpx;
  147 + margin: 10rpx;
  148 + background: #ffffff;
  149 + border-radius: 10rpx;
  150 + box-shadow: 0rpx 6rpx 8rpx rgba(58, 134, 185, 0.2);
  151 +
  152 + .prod-image {
  153 + width: 223rpx;
  154 + height: 223rpx;
  155 + border-radius: 10rpx 10rpx 0 0;
  156 + }
  157 +
  158 + .item-info {
  159 + padding: 15rpx;
  160 +
  161 + .info-text {
  162 + height: 70rpx;
  163 + padding-bottom: 10rpx;
  164 + }
  165 +
  166 + .price-and-cart {
  167 + @include flex-space-between;
  168 + }
  169 + }
  170 + }
  171 + }
  172 +}
  173 +</style>
yudao-ui-app/components/yd-product-more/yd-product-more.vue 0 → 100644
  1 +<template>
  2 + <view>
  3 + <view class="prod-block list">
  4 + <view class="bloc-header">
  5 + <text class="bloc-title">更多宝贝</text>
  6 + <text></text>
  7 + </view>
  8 +
  9 + <view class="prod-list" v-for="(item, index) in productList" :key="item.id">
  10 + <view class="prod-item" @click="handleProdItemClick(item.id)">
  11 + <image class="prod-image" :src="item.image"></image>
  12 + <view class="item-info">
  13 + <view class="info-text">
  14 + <u--text :lines="1" size="14px" color="#333333" :text="item.title"></u--text>
  15 + <u-gap height="2px"></u-gap>
  16 + <u--text class="info-desc" :lines="2" size="12px" color="#939393" :text="item.desc"></u--text>
  17 + </view>
  18 + <view class="price-and-cart">
  19 + <yd-text-price color="red" size="12" intSize="18" :price="item.price"></yd-text-price>
  20 + <u-icon name="shopping-cart" color="#2979ff" size="28"></u-icon>
  21 + </view>
  22 + </view>
  23 + </view>
  24 + </view>
  25 + </view>
  26 +
  27 + <!--加载更多-->
  28 + <u-loadmore fontSize="28rpx" :line="true" :status="moreStatus" :loading-text="loadingText" :loadmore-text="loadmoreText" :nomore-text="nomoreText" />
  29 +
  30 + </view>
  31 +</template>
  32 +
  33 +<script>
  34 +/**
  35 + * 商品列表
  36 + */
  37 +export default {
  38 + name: 'yd-product-more',
  39 + components: {},
  40 + props: {
  41 + title: {
  42 + type: String,
  43 + default: '商品推荐'
  44 + },
  45 + productList: {
  46 + type: Array,
  47 + default: () => []
  48 + },
  49 + moreStatus: {
  50 + type: String,
  51 + default: 'nomore'
  52 + }
  53 + },
  54 + data() {
  55 + return {
  56 + //status: 'nomore',
  57 + loadingText: '加载中...',
  58 + loadmoreText: '上拉加载更多',
  59 + nomoreText: '已经到底了'
  60 + }
  61 + },
  62 + methods: {
  63 + handleProdItemClick(productId) {
  64 + uni.$u.route('/pages/product/product', {
  65 + productId: productId
  66 + })
  67 + }
  68 + }
  69 +}
  70 +</script>
  71 +<style lang="scss" scoped>
  72 +.prod-block {
  73 + margin-top: 0;
  74 +
  75 + .bloc-header {
  76 + margin-top: 50rpx;
  77 + margin-bottom: 20rpx;
  78 +
  79 + .bloc-title {
  80 + margin-left: 20rpx;
  81 + color: #333333;
  82 + }
  83 + }
  84 +
  85 + .prod-list {
  86 + .prod-item {
  87 + background: #ffffff;
  88 + @include flex-space-between;
  89 + border-bottom: $custom-border-style;
  90 + padding: 20rpx;
  91 +
  92 + .prod-image {
  93 + width: 200rpx;
  94 + height: 200rpx;
  95 + border-radius: 10rpx;
  96 + }
  97 +
  98 + .item-info {
  99 + flex: 1;
  100 + padding: 20rpx 20rpx 0;
  101 +
  102 + .info-text {
  103 + height: 100rpx;
  104 + padding-bottom: 10rpx;
  105 + }
  106 +
  107 + .price-and-cart {
  108 + @include flex-space-between;
  109 + }
  110 + }
  111 + }
  112 + }
  113 +}
  114 +</style>
yudao-ui-app/components/custom-text-price/custom-text-price.vue renamed to yudao-ui-app/components/yd-text-price/yd-text-price.vue
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 * 此组件简单的显示特定样式的(人名币)价格数字 11 * 此组件简单的显示特定样式的(人名币)价格数字
12 */ 12 */
13 export default { 13 export default {
14 - name: 'custom-text-price', 14 + name: 'yd-text-price',
15 components: {}, 15 components: {},
16 props: { 16 props: {
17 price: { 17 price: {
yudao-ui-app/pages/index/index.vue
@@ -8,17 +8,13 @@ @@ -8,17 +8,13 @@
8 </u-sticky> 8 </u-sticky>
9 9
10 <!--轮播图--> 10 <!--轮播图-->
11 - <u-swiper :list="swiperList" previousMargin="20" nextMargin="20" circular height="200" @change="e => (current = e.current)" :autoplay="true" @click="handleSwiperClick">  
12 - <view slot="indicator" class="indicator">  
13 - <view class="indicator__dot" v-for="(item, index) in swiperList" :key="index" :class="[index === current && 'indicator__dot--active']"> </view>  
14 - </view>  
15 - </u-swiper> 11 + <mkt-banner :banner-list="bannerList"></mkt-banner>
16 12
17 <u-gap height="20px"></u-gap> 13 <u-gap height="20px"></u-gap>
18 14
19 <!--宫格菜单按钮--> 15 <!--宫格菜单按钮-->
20 - <u-grid :border="false" col="4"  
21 - ><u-grid-item v-for="(item, index) in menuList" :key="index"> 16 + <u-grid :border="false" col="4">
  17 + <u-grid-item v-for="(item, index) in menuList" :key="index">
22 <u-icon :name="item.icon" :size="40"></u-icon> 18 <u-icon :name="item.icon" :size="40"></u-icon>
23 <text class="grid-title">{{ item.title }}</text> 19 <text class="grid-title">{{ item.title }}</text>
24 </u-grid-item> 20 </u-grid-item>
@@ -30,81 +26,11 @@ @@ -30,81 +26,11 @@
30 <u-notice-bar style="padding: 13px 12px" :text="noticeList" mode="link" direction="column" @click="click"></u-notice-bar> 26 <u-notice-bar style="padding: 13px 12px" :text="noticeList" mode="link" direction="column" @click="click"></u-notice-bar>
31 27
32 <!--商品展示栏--> 28 <!--商品展示栏-->
33 - <view>  
34 - <u-gap height="180" bgColor="#398ade"></u-gap>  
35 - <view class="prod-block">  
36 - <view class="bloc-header">  
37 - <text class="bloc-title">每日上新</text>  
38 - <text class="see-more">查看更多</text>  
39 - </view>  
40 - <view class="prod-grid">  
41 - <view class="prod-item" v-for="(item, index) in productList" :key="item.id" @click="handleProdItemClick(item.id)">  
42 - <image class="prod-image" :src="item.image"></image>  
43 - <view class="item-info">  
44 - <view class="info-text">  
45 - <u--text :lines="2" size="14px" color="#333333" :text="item.title"></u--text>  
46 - </view>  
47 - <view class="price-and-cart">  
48 - <custom-text-price color="red" size="12" intSize="18" :price="item.price"></custom-text-price>  
49 - <u-icon name="shopping-cart" color="#2979ff" size="28"></u-icon>  
50 - </view>  
51 - </view>  
52 - </view>  
53 - </view>  
54 - </view>  
55 - </view>  
56 -  
57 - <view>  
58 - <view class="prod-block half">  
59 - <view class="bloc-header">  
60 - <text class="bloc-title">商品热卖</text>  
61 - <text class="more">更多 &gt;</text>  
62 - </view>  
63 - <view class="prod-grid half">  
64 - <view class="prod-item" v-for="(item, index) in productList" :key="item.id" @click="handleProdItemClick(item.id)">  
65 - <image class="prod-image" :src="item.image"></image>  
66 - <view class="item-info">  
67 - <view class="info-text">  
68 - <u--text :lines="1" size="14px" color="#333333" :text="item.title"></u--text>  
69 - <u--text :lines="1" size="12px" color="#939393" :text="item.desc"></u--text>  
70 - </view>  
71 - <view class="price-and-cart">  
72 - <custom-text-price color="red" size="12" intSize="18" :price="item.price"></custom-text-price>  
73 - <u-icon name="shopping-cart" color="#2979ff" size="28"></u-icon>  
74 - </view>  
75 - </view>  
76 - </view>  
77 - </view>  
78 - </view>  
79 - </view> 29 + <yd-product-box :product-list="productList" :title="'每日上新'" show-type="normal"></yd-product-box>
  30 + <yd-product-box :product-list="productList" :title="'热卖商品'" show-type="half"></yd-product-box>
  31 + <yd-product-more :product-list="productList" more-status="moreStatus"></yd-product-more>
80 32
81 - <view>  
82 - <view class="prod-block list">  
83 - <view class="bloc-header">  
84 - <text class="bloc-title">更多宝贝</text>  
85 - <text></text>  
86 - </view>  
87 -  
88 - <view class="prod-list" v-for="(item, index) in productList" :key="item.id">  
89 - <view class="prod-item" @click="handleProdItemClick(item.id)">  
90 - <image class="prod-image" :src="item.image"></image>  
91 - <view class="item-info">  
92 - <view class="info-text">  
93 - <u--text :lines="1" size="14px" color="#333333" :text="item.title"></u--text>  
94 - <u-gap height="2px"></u-gap>  
95 - <u--text class="info-desc" :lines="2" size="12px" color="#939393" :text="item.desc"></u--text>  
96 - </view>  
97 - <view class="price-and-cart">  
98 - <custom-text-price color="red" size="12" intSize="18" :price="item.price"></custom-text-price>  
99 - <u-icon name="shopping-cart" color="#2979ff" size="28"></u-icon>  
100 - </view>  
101 - </view>  
102 - </view>  
103 - </view>  
104 - </view>  
105 - </view>  
106 - <!--加载更多-->  
107 - <u-loadmore fontSize="28rpx" :status="status" :loading-text="loadingText" :loadmore-text="loadmoreText" :nomore-text="nomoreText" /> 33 + <u-gap height="5px"></u-gap>
108 </view> 34 </view>
109 </template> 35 </template>
110 36
@@ -115,9 +41,23 @@ export default { @@ -115,9 +41,23 @@ export default {
115 components: {}, 41 components: {},
116 data() { 42 data() {
117 return { 43 return {
118 - current: 0,  
119 - currentNum: 0,  
120 - bannerList: ['https://cdn.uviewui.com/uview/swiper/swiper3.png', 'https://cdn.uviewui.com/uview/swiper/swiper2.png', 'https://cdn.uviewui.com/uview/swiper/swiper1.png'], 44 + bannerList: [
  45 + {
  46 + id: 1,
  47 + title: '山不在高,有仙则名',
  48 + url: 'https://cdn.uviewui.com/uview/swiper/swiper1.png'
  49 + },
  50 + {
  51 + id: 2,
  52 + title: '水不在深,有龙则灵',
  53 + url: 'https://cdn.uviewui.com/uview/swiper/swiper2.png'
  54 + },
  55 + {
  56 + id: 3,
  57 + title: '斯是陋室,惟吾德馨',
  58 + url: 'https://cdn.uviewui.com/uview/swiper/swiper3.png'
  59 + }
  60 + ],
121 menuList: [ 61 menuList: [
122 { icon: 'gift', title: '热门推荐' }, 62 { icon: 'gift', title: '热门推荐' },
123 { icon: 'star', title: '收藏转发' }, 63 { icon: 'star', title: '收藏转发' },
@@ -162,15 +102,12 @@ export default { @@ -162,15 +102,12 @@ export default {
162 price: '53.00' 102 price: '53.00'
163 } 103 }
164 ], 104 ],
165 - status: 'nomore',  
166 - loadingText: '努力加载中...',  
167 - loadmoreText: '轻轻上拉',  
168 - nomoreText: '实在没有了...' 105 + moreStatus: 'nomore'
169 } 106 }
170 }, 107 },
171 onLoad() { 108 onLoad() {
172 - this.loadBannerData();  
173 - this.loadNoticeData(); 109 + this.loadBannerData()
  110 + this.loadNoticeData()
174 }, 111 },
175 methods: { 112 methods: {
176 loadBannerData() { 113 loadBannerData() {
@@ -185,24 +122,9 @@ export default { @@ -185,24 +122,9 @@ export default {
185 }, 122 },
186 handleSearchClick(e) { 123 handleSearchClick(e) {
187 uni.$u.route('/pages/search/search') 124 uni.$u.route('/pages/search/search')
188 - },  
189 - handleSwiperClick(index) {  
190 - console.log('点击了图片索引值:', index)  
191 - },  
192 - handleProdItemClick(productId) {  
193 - uni.$u.route('/pages/product/product', {  
194 - productId: productId  
195 - })  
196 } 125 }
197 }, 126 },
198 computed: { 127 computed: {
199 - swiperList() {  
200 - return this.bannerList.map(item => {  
201 - if (item) {  
202 - return item  
203 - }  
204 - })  
205 - },  
206 noticeTextList() { 128 noticeTextList() {
207 return this.noticeList.map(item => { 129 return this.noticeList.map(item => {
208 if (item.title) { 130 if (item.title) {
@@ -220,131 +142,8 @@ export default { @@ -220,131 +142,8 @@ export default {
220 padding: 20rpx; 142 padding: 20rpx;
221 } 143 }
222 144
223 -.indicator {  
224 - @include flex(row);  
225 - justify-content: center;  
226 -  
227 - &__dot {  
228 - height: 15rpx;  
229 - width: 15rpx;  
230 - border-radius: 100rpx;  
231 - background-color: rgba(255, 255, 255, 0.35);  
232 - margin: 0 10rpx;  
233 - transition: background-color 0.3s;  
234 -  
235 - &--active {  
236 - background-color: $custom-bg-color;  
237 - }  
238 - }  
239 -}  
240 -  
241 .grid-title { 145 .grid-title {
242 line-height: 50rpx; 146 line-height: 50rpx;
243 font-size: 26rpx; 147 font-size: 26rpx;
244 } 148 }
245 -  
246 -.prod-block {  
247 - margin-top: -160px;  
248 - .bloc-header {  
249 - @include flex-space-between;  
250 - padding: 10rpx 20rpx;  
251 -  
252 - .bloc-title {  
253 - color: $custom-bg-color;  
254 - font-size: 34rpx;  
255 - }  
256 - .see-more {  
257 - color: $custom-bg-color;  
258 - background: $u-primary;  
259 - padding: 0 30rpx;  
260 - height: 50rpx;  
261 - line-height: 50rpx;  
262 - border-radius: 50rpx;  
263 - font-size: 24rpx;  
264 - }  
265 - }  
266 -  
267 - &.half,  
268 - &.list {  
269 - margin-top: 0;  
270 - .bloc-header {  
271 - margin-top: 50rpx;  
272 - margin-bottom: 20rpx;  
273 - .bloc-title {  
274 - color: #333333;  
275 - }  
276 - .more {  
277 - font-size: 24rpx;  
278 - }  
279 - }  
280 - }  
281 -  
282 - .prod-grid {  
283 - width: 730rpx;  
284 - margin: 0 auto;  
285 - @include flex;  
286 - flex-wrap: wrap;  
287 - justify-content: left;  
288 -  
289 - &.half {  
290 - .prod-item {  
291 - width: 345rpx;  
292 - margin: 10rpx;  
293 - .prod-image {  
294 - width: 345rpx;  
295 - height: 345rpx;  
296 - }  
297 - }  
298 - }  
299 -  
300 - .prod-item {  
301 - width: 223rpx;  
302 - margin: 10rpx;  
303 - background: #ffffff;  
304 - border-radius: 10rpx;  
305 - box-shadow: 0rpx 6rpx 8rpx rgba(58,134,185,0.2);  
306 - .prod-image {  
307 - width: 223rpx;  
308 - height: 223rpx;  
309 - border-radius: 10rpx 10rpx 0 0;  
310 - }  
311 - .item-info {  
312 - padding: 15rpx;  
313 - .info-text {  
314 - height: 70rpx;  
315 - padding-bottom: 10rpx;  
316 - }  
317 - .price-and-cart {  
318 - @include flex-space-between;  
319 - }  
320 - }  
321 - }  
322 - }  
323 -}  
324 -  
325 -.prod-list {  
326 - .prod-item {  
327 - background: #ffffff;  
328 - @include flex-space-between;  
329 - border-bottom: $custom-border-style;  
330 - padding: 20rpx;  
331 - .prod-image {  
332 - width: 200rpx;  
333 - height: 200rpx;  
334 - border-radius: 10rpx;  
335 - }  
336 -  
337 - .item-info {  
338 - flex: 1;  
339 - padding: 20rpx 20rpx 0;  
340 - .info-text {  
341 - height: 100rpx;  
342 - padding-bottom: 10rpx;  
343 - }  
344 - .price-and-cart {  
345 - @include flex-space-between;  
346 - }  
347 - }  
348 - }  
349 -}  
350 </style> 149 </style>
yudao-ui-app/pages/profile/profile.vue
@@ -10,43 +10,22 @@ @@ -10,43 +10,22 @@
10 </view> 10 </view>
11 <view class="info-item"> 11 <view class="info-item">
12 <view class="label">昵称:</view> 12 <view class="label">昵称:</view>
13 - <view v-if="!nameEditOn" class="info">  
14 - <view class="value">{{ userInfo.nickname }}</view>  
15 - <u-icon  
16 - class="btn"  
17 - name="edit-pen"  
18 - @click="  
19 - tempName = userInfo.nickname  
20 - nameEditOn = true  
21 - "  
22 - ></u-icon>  
23 - </view>  
24 - <view v-else class="name-edit">  
25 - <u--input maxlength="10" border="bottom" v-model="tempName"></u--input>  
26 - <view class="edit-btn-group">  
27 - <u-tag class="edit-btn" text="保存" plain size="mini" type="primary" @click="handleSaveBtnClick"></u-tag>  
28 - <u-tag  
29 - class="edit-btn"  
30 - text="取消"  
31 - plain  
32 - size="mini"  
33 - type="info"  
34 - @click="  
35 - tempName = ''  
36 - nameEditOn = false  
37 - "  
38 - ></u-tag>  
39 - </view> 13 + <view class="info">
  14 + <u--input maxlength="10" :border="borderStyle" v-model="userInfo.nickname" @focus="borderStyle = 'bottom'" inputAlign="right" @blur="borderStyle = 'none'" @change="handleNameChange"></u--input>
40 </view> 15 </view>
41 </view> 16 </view>
42 <view class="info-item"> 17 <view class="info-item">
43 <view class="label">手机:</view> 18 <view class="label">手机:</view>
44 <view class="info"> 19 <view class="info">
45 <view class="value">{{ userInfo.mobile }}</view> 20 <view class="value">{{ userInfo.mobile }}</view>
46 - <u-icon class="btn" name="edit-pen"></u-icon>  
47 </view> 21 </view>
48 </view> 22 </view>
49 </view> 23 </view>
  24 +
  25 + <view v-if="nameUpdateVisible" class="btn-group">
  26 + <u-button type="primary" text="保存" customStyle="margin-top: 50px" @click="handleSaveBtnClick"></u-button>
  27 + </view>
  28 +
50 </view> 29 </view>
51 </template> 30 </template>
52 31
@@ -62,8 +41,13 @@ export default { @@ -62,8 +41,13 @@ export default {
62 mobile: '' 41 mobile: ''
63 }, 42 },
64 avatarFiles: [], 43 avatarFiles: [],
65 - nameEditOn: false,  
66 - tempName: '' 44 + tempName: '',
  45 + borderStyle: 'none'
  46 + }
  47 + },
  48 + computed: {
  49 + nameUpdateVisible: function () {
  50 + return this.userInfo.nickname !== this.tempName
67 } 51 }
68 }, 52 },
69 onLoad() { 53 onLoad() {
@@ -73,6 +57,7 @@ export default { @@ -73,6 +57,7 @@ export default {
73 loadUserInfoData() { 57 loadUserInfoData() {
74 getUserInfo().then(res => { 58 getUserInfo().then(res => {
75 this.userInfo = res.data 59 this.userInfo = res.data
  60 + this.tempName = this.userInfo.nickname
76 }) 61 })
77 }, 62 },
78 handleAvatarClick() { 63 handleAvatarClick() {
@@ -86,11 +71,22 @@ export default { @@ -86,11 +71,22 @@ export default {
86 } 71 }
87 }) 72 })
88 }, 73 },
  74 + handleNameChange(val) {
  75 + let str = uni.$u.trim(val, 'all')
  76 + this.$nextTick(() => {
  77 + this.userInfo.nickname = str
  78 + })
  79 + },
89 handleSaveBtnClick() { 80 handleSaveBtnClick() {
90 - updateNickname({ nickname: this.tempName }).then(res => {  
91 - this.nameEditOn = false;  
92 - this.userInfo.nickname = this.tempName 81 + updateNickname({ nickname: this.userInfo.nickname }).then(res => {
  82 + this.tempName = this.userInfo.nickname
93 this.$store.commit('SET_USER_INFO', this.userInfo) 83 this.$store.commit('SET_USER_INFO', this.userInfo)
  84 + uni.$u.toast('已保存')
  85 + setTimeout(() => {
  86 + uni.switchTab({
  87 + url: '/pages/user/user'
  88 + })
  89 + }, 300)
94 }) 90 })
95 } 91 }
96 } 92 }
@@ -107,7 +103,7 @@ export default { @@ -107,7 +103,7 @@ export default {
107 font-size: 30rpx; 103 font-size: 30rpx;
108 } 104 }
109 .info { 105 .info {
110 - @include flex-right; 106 + @include flex-left;
111 .value { 107 .value {
112 font-size: 30rpx; 108 font-size: 30rpx;
113 } 109 }
@@ -126,4 +122,8 @@ export default { @@ -126,4 +122,8 @@ export default {
126 } 122 }
127 } 123 }
128 } 124 }
  125 +
  126 +.btn-group {
  127 + padding: 0 30rpx;
  128 +}
129 </style> 129 </style>
yudao-ui-app/uni_modules/uview-ui/README.md
1 <p align="center"> 1 <p align="center">
2 <img alt="logo" src="https://uviewui.com/common/logo.png" width="120" height="120" style="margin-bottom: 10px;"> 2 <img alt="logo" src="https://uviewui.com/common/logo.png" width="120" height="120" style="margin-bottom: 10px;">
3 </p> 3 </p>
4 -<h3 align="center" style="margin: 30px 0 30px;font-weight: bold;font-size:40px;">uView</h3> 4 +<h3 align="center" style="margin: 30px 0 30px;font-weight: bold;font-size:40px;">uView 2.0</h3>
5 <h3 align="center">多平台快速开发的UI框架</h3> 5 <h3 align="center">多平台快速开发的UI框架</h3>
6 6
  7 +[![stars](https://img.shields.io/github/stars/umicro/uView2.0?style=flat-square&logo=GitHub)](https://github.com/umicro/uView2.0)
  8 +[![forks](https://img.shields.io/github/forks/umicro/uView2.0?style=flat-square&logo=GitHub)](https://github.com/umicro/uView2.0)
  9 +[![issues](https://img.shields.io/github/issues/umicro/uView2.0?style=flat-square&logo=GitHub)](https://github.com/umicro/uView2.0/issues)
  10 +[![Website](https://img.shields.io/badge/uView-up-blue?style=flat-square)](https://uviewui.com)
  11 +[![release](https://img.shields.io/github/v/release/umicro/uView2.0?style=flat-square)](https://gitee.com/umicro/uView2.0/releases)
  12 +[![license](https://img.shields.io/github/license/umicro/uView2.0?style=flat-square)](https://en.wikipedia.org/wiki/MIT_License)
  13 +
7 ## 说明 14 ## 说明
8 15
9 -uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水 16 +uView UI,是[uni-app](https://uniapp.dcloud.io/)全面兼容nvue的uni-app生态框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水
10 17
11 -## 特性 18 +## [官方文档:https://uviewui.com](https://uviewui.com)
12 19
13 -- 兼容安卓,iOS,微信小程序,H5,QQ小程序,百度小程序,支付宝小程序,头条小程序  
14 -- 60+精选组件,功能丰富,多端兼容,让您快速集成,开箱即用  
15 -- 众多贴心的JS利器,让您飞镖在手,召之即来,百步穿杨  
16 -- 众多的常用页面和布局,让您专注逻辑,事半功倍  
17 -- 详尽的文档支持,现代化的演示效果  
18 -- 按需引入,精简打包体积  
19 20
  21 +## 预览
20 22
21 -## 安装 23 +您可以通过**微信**扫码,查看最佳的演示效果。
  24 +<br>
  25 +<br>
  26 +<img src="https://uviewui.com/common/weixin_mini_qrcode.png" width="220" height="220" >
22 27
23 -```bash  
24 -# npm方式安装,插件市场导入无需执行此命令  
25 -npm i uview-ui  
26 -```  
27 28
28 -## 快速上手 29 +## 链接
29 30
30 -1. `main.js`引入uView库  
31 -```js  
32 -// main.js  
33 -import uView from 'uview-ui';  
34 -Vue.use(uView);  
35 -``` 31 +- [官方文档](https://www.uviewui.com/)
  32 +- [更新日志](https://www.uviewui.com/components/changelog.html)
  33 +- [升级指南](https://www.uviewui.com/components/changeGuide.html)
  34 +- [关于我们](https://www.uviewui.com/cooperation/about.html)
36 35
37 -2. `App.vue`引入基础样式(注意style标签需声明scss属性支持)  
38 -```css  
39 -/* App.vue */  
40 -<style lang="scss">  
41 -@import "uview-ui/index.scss";  
42 -</style>  
43 -``` 36 +## 交流反馈
44 37
45 -3. `uni.scss`引入全局scss变量文件  
46 -```css  
47 -/* uni.scss */  
48 -@import "uview-ui/theme.scss";  
49 -``` 38 +欢迎加入我们的QQ群交流反馈:[点此跳转](https://www.uviewui.com/components/addQQGroup.html)
50 39
51 -4. `pages.json`配置easycom规则(按需引入)  
52 -  
53 -```js  
54 -// pages.json  
55 -{  
56 - "easycom": {  
57 - // npm安装的方式不需要前面的"@/",下载安装的方式需要"@/"  
58 - // npm安装方式  
59 - "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"  
60 - // 下载安装方式  
61 - // "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"  
62 - },  
63 - // 此为本身已有的内容  
64 - "pages": [  
65 - // ......  
66 - ]  
67 -}  
68 -``` 40 +## 关于PR
  41 +
  42 +> 我们非常乐意接受各位的优质PR,但在此之前我希望您了解uView2.0是一个需要兼容多个平台的(小程序、h5、ios app、android app)包括nvue页面、vue页面。
  43 +> 所以希望在您修复bug并提交之前尽可能的去这些平台测试一下兼容性。最好能携带测试截图以方便审核。非常感谢!
  44 +
  45 +## 安装
  46 +
  47 +#### **uni-app插件市场链接** —— [https://ext.dcloud.net.cn/plugin?id=1593](https://ext.dcloud.net.cn/plugin?id=1593)
69 48
70 -请通过[快速上手](https://www.uviewui.com/components/quickstart.html)了解更详细的内容 49 +请通过[官网安装文档](https://www.uviewui.com/components/install.html)了解更详细的内容
  50 +
  51 +## 快速上手
  52 +
  53 +请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
71 54
72 ## 使用方法 55 ## 使用方法
73 配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。 56 配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。
@@ -78,27 +61,6 @@ Vue.use(uView); @@ -78,27 +61,6 @@ Vue.use(uView);
78 </template> 61 </template>
79 ``` 62 ```
80 63
81 -请通过[快速上手](https://www.uviewui.com/components/quickstart.html)了解更详细的内容  
82 -  
83 -## 链接  
84 -  
85 -- [官方文档](https://www.uviewui.com/)  
86 -- [更新日志](https://www.www.uviewui.com/components/changelog.html)  
87 -- [升级指南](https://www.uviewui.com/components/changelog.html)  
88 -- [关于我们](https://www.uviewui.com/cooperation/about.html)  
89 -  
90 -## 预览  
91 -  
92 -您可以通过**微信**扫码,查看最佳的演示效果。  
93 -<br>  
94 -<br>  
95 -<img src="https://uviewui.com/common/weixin_mini_qrcode.png" width="220" height="220" >  
96 -  
97 -## 捐赠uView的研发  
98 -  
99 -uView文档和源码全部开源免费,如果您认为uView帮到了您的开发工作,您可以捐赠uView的研发工作,捐赠无门槛,哪怕是一杯可乐也好(相信这比打赏主播更有意义)。  
100 -  
101 -<img src="https://uviewui.com/common/alipay.png" width="220" ><img style="margin-left: 100px;" src="https://uviewui.com/common/wechat.png" width="220" >  
102 -  
103 ## 版权信息 64 ## 版权信息
104 uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。 65 uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。
  66 +
yudao-ui-app/uni_modules/uview-ui/changelog.md
  1 +## 2.0.34(2022-09-25)
  2 +# uView2.0重磅发布,利剑出鞘,一统江湖
  3 +
  4 +1. `u-input`、`u-textarea`增加`ignoreCompositionEvent`属性
  5 +2. 修复`route`方法调用可能报错的问题
  6 +3. 修复`u-no-network`组件`z-index`无效的问题
  7 +4. 修复`textarea`组件在h5上confirmType=""报错的问题
  8 +5. `u-rate`适配`nvue`
  9 +6. 优化验证手机号码的正则表达式(根据工信部发布的《电信网编号计划(2017年版)》进行修改。)
  10 +7. `form-item`添加`labelPosition`属性
  11 +8. `u-calendar`修复`maxDate`设置为当前日期,并且当前时间大于08:00时无法显示日期列表的问题 (#724)
  12 +9. `u-radio`增加一个默认插槽用于自定义修改label内容 (#680)
  13 +10. 修复`timeFormat`函数在safari重的兼容性问题 (#664)
  14 +## 2.0.33(2022-06-17)
  15 +# uView2.0重磅发布,利剑出鞘,一统江湖
  16 +
  17 +1. 修复`loadmore`组件`lineColor`类型错误问题
  18 +2. 修复`u-parse`组件`imgtap`、`linktap`不生效问题
  19 +## 2.0.32(2022-06-16)
  20 +# uView2.0重磅发布,利剑出鞘,一统江湖
  21 +1. `u-loadmore`新增自定义颜色、虚/实线
  22 +2. 修复`u-swiper-action`组件部分平台不能上下滑动的问题
  23 +3. 修复`u-list`回弹问题
  24 +4. 修复`notice-bar`组件动画在低端安卓机可能会抖动的问题
  25 +5. `u-loading-page`添加控制图标大小的属性`iconSize`
  26 +6. 修复`u-tooltip`组件`color`参数不生效的问题
  27 +7. 修复`u--input`组件使用`blur`事件输出为`undefined`的bug
  28 +8. `u-code-input`组件新增键盘弹起时,是否自动上推页面参数`adjustPosition`
  29 +9. 修复`image`组件`load`事件无回调对象问题
  30 +10. 修复`button`组件`loadingSize`设置无效问题
  31 +10. 其他修复
  32 +## 2.0.31(2022-04-19)
  33 +# uView2.0重磅发布,利剑出鞘,一统江湖
  34 +
  35 +1. 修复`upload`在`vue`页面上传成功后没有成功标志的问题
  36 +2. 解决演示项目中微信小程序模拟上传图片一直出于上传中问题
  37 +3. 修复`u-code-input`组件在`nvue`页面编译到`app`平台上光标异常问题(`app`去除此功能)
  38 +4. 修复`actionSheet`组件标题关闭按钮点击事件名称错误的问题
  39 +5. 其他修复
1 ## 2.0.30(2022-04-04) 40 ## 2.0.30(2022-04-04)
2 # uView2.0重磅发布,利剑出鞘,一统江湖 41 # uView2.0重磅发布,利剑出鞘,一统江湖
3 42
yudao-ui-app/uni_modules/uview-ui/components/u--input/u--input.vue
@@ -35,8 +35,9 @@ @@ -35,8 +35,9 @@
35 :shape="shape" 35 :shape="shape"
36 :customStyle="customStyle" 36 :customStyle="customStyle"
37 :formatter="formatter" 37 :formatter="formatter"
  38 + :ignoreCompositionEvent="ignoreCompositionEvent"
38 @focus="$emit('focus')" 39 @focus="$emit('focus')"
39 - @blur="$emit('blur')" 40 + @blur="e => $emit('blur', e)"
40 @keyboardheightchange="$emit('keyboardheightchange')" 41 @keyboardheightchange="$emit('keyboardheightchange')"
41 @change="e => $emit('change', e)" 42 @change="e => $emit('change', e)"
42 @input="e => $emit('input', e)" 43 @input="e => $emit('input', e)"
yudao-ui-app/uni_modules/uview-ui/components/u--textarea/u--textarea.vue
@@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
21 :border="border" 21 :border="border"
22 :customStyle="customStyle" 22 :customStyle="customStyle"
23 :formatter="formatter" 23 :formatter="formatter"
  24 + :ignoreCompositionEvent="ignoreCompositionEvent"
24 @focus="e => $emit('focus')" 25 @focus="e => $emit('focus')"
25 @blur="e => $emit('blur')" 26 @blur="e => $emit('blur')"
26 @linechange="e => $emit('linechange', e)" 27 @linechange="e => $emit('linechange', e)"
yudao-ui-app/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 <text class="u-action-sheet__header__title u-line-1">{{title}}</text> 15 <text class="u-action-sheet__header__title u-line-1">{{title}}</text>
16 <view 16 <view
17 class="u-action-sheet__header__icon-wrap" 17 class="u-action-sheet__header__icon-wrap"
18 - @tap.stop="close" 18 + @tap.stop="cancel"
19 > 19 >
20 <u-icon 20 <u-icon
21 name="close" 21 name="close"
yudao-ui-app/uni_modules/uview-ui/components/u-button/u-button.vue
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 <template v-if="loading"> 28 <template v-if="loading">
29 <u-loading-icon 29 <u-loading-icon
30 :mode="loadingMode" 30 :mode="loadingMode"
31 - :size="textSize * 1.15" 31 + :size="loadingSize * 1.15"
32 :color="loadingColor" 32 :color="loadingColor"
33 ></u-loading-icon> 33 ></u-loading-icon>
34 <text 34 <text
@@ -75,7 +75,7 @@ @@ -75,7 +75,7 @@
75 <template v-if="loading"> 75 <template v-if="loading">
76 <u-loading-icon 76 <u-loading-icon
77 :mode="loadingMode" 77 :mode="loadingMode"
78 - :size="textSize * 1.15" 78 + :size="loadingSize * 1.15"
79 :color="loadingColor" 79 :color="loadingColor"
80 ></u-loading-icon> 80 ></u-loading-icon>
81 <text 81 <text
yudao-ui-app/uni_modules/uview-ui/components/u-calendar/u-calendar.vue
@@ -209,12 +209,13 @@ export default { @@ -209,12 +209,13 @@ export default {
209 } 209 }
210 }, 210 },
211 init() { 211 init() {
212 - // 校验maxDate,不能小于当前时间 212 + // 校验maxDate,不能小于minDate
213 if ( 213 if (
214 this.innerMaxDate && 214 this.innerMaxDate &&
215 - new Date(this.innerMaxDate).getTime() <= Date.now() 215 + this.innerMinDate &&
  216 + new Date(this.innerMaxDate).getTime() < new Date(this.innerMinDate).getTime()
216 ) { 217 ) {
217 - return uni.$u.error('maxDate不能小于当前时间') 218 + return uni.$u.error('maxDate不能小于minDate')
218 } 219 }
219 // 滚动区域的高度 220 // 滚动区域的高度
220 this.listHeight = this.rowHeight * 5 + 30 221 this.listHeight = this.rowHeight * 5 + 30
yudao-ui-app/uni_modules/uview-ui/components/u-code-input/props.js
1 export default { 1 export default {
2 props: { 2 props: {
  3 + // 键盘弹起时,是否自动上推页面
  4 + adjustPosition: {
  5 + type: Boolean,
  6 + default: uni.$u.props.codeInput.adjustPosition
  7 + },
3 // 最大输入长度 8 // 最大输入长度
4 maxlength: { 9 maxlength: {
5 type: [String, Number], 10 type: [String, Number],
yudao-ui-app/uni_modules/uview-ui/components/u-code-input/u-code-input.vue
@@ -23,7 +23,9 @@ @@ -23,7 +23,9 @@
23 v-if="mode === 'line'" 23 v-if="mode === 'line'"
24 :style="[lineStyle]" 24 :style="[lineStyle]"
25 ></view> 25 ></view>
26 - <view v-if="codeArray.length === index" :style="{backgroundColor: color}" class="u-code-input__item__cursor"></view> 26 + <!-- #ifndef APP-PLUS -->
  27 + <view v-if="isFocus && codeArray.length === index" :style="{backgroundColor: color}" class="u-code-input__item__cursor"></view>
  28 + <!-- #endif -->
27 </view> 29 </view>
28 <input 30 <input
29 :disabled="disabledKeyboard" 31 :disabled="disabledKeyboard"
@@ -31,11 +33,14 @@ @@ -31,11 +33,14 @@
31 :focus="focus" 33 :focus="focus"
32 :value="inputValue" 34 :value="inputValue"
33 :maxlength="maxlength" 35 :maxlength="maxlength"
  36 + :adjustPosition="adjustPosition"
34 class="u-code-input__input" 37 class="u-code-input__input"
35 @input="inputHandler" 38 @input="inputHandler"
36 :style="{ 39 :style="{
37 height: $u.addUnit(size) 40 height: $u.addUnit(size)
38 }" 41 }"
  42 + @focus="isFocus = true"
  43 + @blur="isFocus = false"
39 /> 44 />
40 </view> 45 </view>
41 </template> 46 </template>
@@ -70,7 +75,8 @@ @@ -70,7 +75,8 @@
70 mixins: [uni.$u.mpMixin, uni.$u.mixin, props], 75 mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
71 data() { 76 data() {
72 return { 77 return {
73 - inputValue: '' 78 + inputValue: '',
  79 + isFocus: this.focus
74 } 80 }
75 }, 81 },
76 watch: { 82 watch: {
@@ -203,6 +209,7 @@ @@ -203,6 +209,7 @@
203 width: 40px; 209 width: 40px;
204 background-color: $u-content-color; 210 background-color: $u-content-color;
205 } 211 }
  212 + /* #ifndef APP-PLUS */
206 &__cursor { 213 &__cursor {
207 position: absolute; 214 position: absolute;
208 top: 50%; 215 top: 50%;
@@ -212,6 +219,8 @@ @@ -212,6 +219,8 @@
212 height: $u-code-input-cursor-height; 219 height: $u-code-input-cursor-height;
213 animation: $u-code-input-cursor-animation-duration u-cursor-flicker infinite; 220 animation: $u-code-input-cursor-animation-duration u-cursor-flicker infinite;
214 } 221 }
  222 + /* #endif */
  223 +
215 } 224 }
216 225
217 &__input { 226 &__input {
@@ -226,6 +235,7 @@ @@ -226,6 +235,7 @@
226 } 235 }
227 } 236 }
228 237
  238 + /* #ifndef APP-PLUS */
229 @keyframes u-cursor-flicker { 239 @keyframes u-cursor-flicker {
230 0% { 240 0% {
231 opacity: 0; 241 opacity: 0;
@@ -237,4 +247,6 @@ @@ -237,4 +247,6 @@
237 opacity: 0; 247 opacity: 0;
238 } 248 }
239 } 249 }
  250 + /* #endif */
  251 +
240 </style> 252 </style>
yudao-ui-app/uni_modules/uview-ui/components/u-code/u-code.vue
@@ -16,11 +16,11 @@ @@ -16,11 +16,11 @@
16 * @property {String} endText 倒计结束的提示语,见官网说明(默认 '重新获取' ) 16 * @property {String} endText 倒计结束的提示语,见官网说明(默认 '重新获取' )
17 * @property {Boolean} keepRunning 是否在H5刷新或各端返回再进入时继续倒计时( 默认false ) 17 * @property {Boolean} keepRunning 是否在H5刷新或各端返回再进入时继续倒计时( 默认false )
18 * @property {String} uniqueKey 为了区分多个页面,或者一个页面多个倒计时组件本地存储的继续倒计时变了 18 * @property {String} uniqueKey 为了区分多个页面,或者一个页面多个倒计时组件本地存储的继续倒计时变了
19 - * 19 + *
20 * @event {Function} change 倒计时期间,每秒触发一次 20 * @event {Function} change 倒计时期间,每秒触发一次
21 * @event {Function} start 开始倒计时触发 21 * @event {Function} start 开始倒计时触发
22 * @event {Function} end 结束倒计时触发 22 * @event {Function} end 结束倒计时触发
23 - * @example <u-code ref="uCode" @change="codeChange" seconds="20"></u-code> 23 + * @example <u-code ref="uCode" @change="codeChange" seconds="20"></u-code>
24 */ 24 */
25 export default { 25 export default {
26 name: "u-code", 26 name: "u-code",
@@ -74,7 +74,6 @@ @@ -74,7 +74,6 @@
74 this.canGetCode = false 74 this.canGetCode = false
75 // 这里放这句,是为了一开始时就提示,否则要等setInterval的1秒后才会有提示 75 // 这里放这句,是为了一开始时就提示,否则要等setInterval的1秒后才会有提示
76 this.changeEvent(this.changeText.replace(/x|X/, this.secNum)) 76 this.changeEvent(this.changeText.replace(/x|X/, this.secNum))
77 - this.setTimeToStorage()  
78 this.timer = setInterval(() => { 77 this.timer = setInterval(() => {
79 if (--this.secNum) { 78 if (--this.secNum) {
80 // 用当前倒计时的秒数替换提示字符串中的"x"字母 79 // 用当前倒计时的秒数替换提示字符串中的"x"字母
@@ -88,7 +87,8 @@ @@ -88,7 +87,8 @@
88 this.canGetCode = true 87 this.canGetCode = true
89 } 88 }
90 }, 1000) 89 }, 1000)
91 - }, 90 + this.setTimeToStorage()
  91 + },
92 // 重置,可以让用户再次获取验证码 92 // 重置,可以让用户再次获取验证码
93 reset() { 93 reset() {
94 this.canGetCode = true 94 this.canGetCode = true
yudao-ui-app/uni_modules/uview-ui/components/u-dropdown-item/u-dropdown-item.vue
1 <template> 1 <template>
2 - <view class="u-drawdown-item">  
3 - <u-overlay  
4 - customStyle="top: 126px"  
5 - :show="show"  
6 - :closeOnClickOverlay="closeOnClickOverlay"  
7 - @click="overlayClick"  
8 - ></u-overlay>  
9 - <view  
10 - class="u-drawdown-item__content"  
11 - :style="[style]"  
12 - :animation="animationData"  
13 - ref="animation"  
14 - >  
15 - <slot />  
16 - </view>  
17 - </view> 2 + <view class="u-drawdown">
  3 + <view
  4 + class="u-dropdown__menu"
  5 + :style="{
  6 + height: $u.addUnit(height)
  7 + }"
  8 + ref="u-dropdown__menu"
  9 + >
  10 + <view
  11 + class="u-dropdown__menu__item"
  12 + v-for="(item, index) in menuList"
  13 + :key="index"
  14 + @tap.stop="clickHandler(item, index)"
  15 + >
  16 + <view class="u-dropdown__menu__item__content">
  17 + <text
  18 + class="u-dropdown__menu__item__content__text"
  19 + :style="[index === current ? activeStyle : inactiveStyle]"
  20 + >{{item.title}}</text>
  21 + <view
  22 + class="u-dropdown__menu__item__content__arrow"
  23 + :class="[index === current && 'u-dropdown__menu__item__content__arrow--rotate']"
  24 + >
  25 + <u-icon
  26 + :name="menuIcon"
  27 + :size="$u.addUnit(menuIconSize)"
  28 + ></u-icon>
  29 + </view>
  30 + </view>
  31 + </view>
  32 + </view>
  33 + <view class="u-dropdown__content">
  34 + <slot />
  35 + </view>
  36 + </view>
18 </template> 37 </template>
19 38
20 <script> 39 <script>
21 - // #ifdef APP-NVUE  
22 - const animation = uni.requireNativePlugin('animation')  
23 - const dom = uni.requireNativePlugin('dom')  
24 - // #endif  
25 - import props from './props.js';  
26 - /**  
27 - * Drawdownitem  
28 - * @description  
29 - * @tutorial url  
30 - * @property {String}  
31 - * @event {Function}  
32 - * @example  
33 - */  
34 - export default {  
35 - name: 'u-drawdown-item',  
36 - mixins: [uni.$u.mpMixin, uni.$u.mixin, props],  
37 - data() {  
38 - return {  
39 - show: false,  
40 - top: '126px',  
41 - // uni.createAnimation的导出数据  
42 - animationData: {},  
43 - }  
44 - },  
45 - mounted() {  
46 - this.init()  
47 - },  
48 - watch: {  
49 - // 发生变化时,需要去更新父组件对应的值  
50 - dataChange(newValue, oldValue) {  
51 - this.updateParentData()  
52 - }  
53 - },  
54 - computed: {  
55 - // 监听对应变量的变化  
56 - dataChange() {  
57 - return [this.title, this.disabled]  
58 - },  
59 - style() {  
60 - const style = {  
61 - zIndex: 10071,  
62 - position: 'fixed',  
63 - display: 'flex',  
64 - left: 0,  
65 - right: 0  
66 - }  
67 - style.top = uni.$u.addUnit(this.top)  
68 - return style  
69 - }  
70 - },  
71 - methods: {  
72 - init() {  
73 - this.updateParentData()  
74 - },  
75 - // 更新父组件所需的数据  
76 - updateParentData() {  
77 - // 获取父组件u-dropdown  
78 - this.getParentData('u-dropdown')  
79 - if (!this.parent) uni.$u.error('u-dropdown-item必须配合u-dropdown使用')  
80 - // 查找父组件menuList数组中对应的标题数据  
81 - const menuIndex = this.parent.menuList.findIndex(item => item.title === this.title)  
82 - const menuContent = {  
83 - title: this.title,  
84 - disabled: this.disabled  
85 - }  
86 - if (menuIndex >= 0) {  
87 - // 如果能找到,则直接修改  
88 - this.parent.menuList[menuIndex] = menuContent;  
89 - } else {  
90 - // 如果无法找到,则为第一次添加,直接push即可  
91 - this.parent.menuList.push(menuContent);  
92 - }  
93 - },  
94 - async setContentAnimate(height) {  
95 - this.animating = true  
96 - // #ifdef APP-NVUE  
97 - const ref = this.$refs['animation'].ref  
98 - animation.transition(ref, {  
99 - styles: {  
100 - height: uni.$u.addUnit(height)  
101 - },  
102 - duration: this.duration,  
103 - timingFunction: 'ease-in-out',  
104 - }, () => {  
105 - this.animating = false  
106 - })  
107 - // #endif  
108 -  
109 - // #ifndef APP-NVUE  
110 - const animation = uni.createAnimation({  
111 - timingFunction: 'ease-in-out',  
112 - });  
113 - animation  
114 - .height(height)  
115 - .step({  
116 - duration: this.duration,  
117 - })  
118 - .step()  
119 - // 导出动画数据给面板的animationData值  
120 - this.animationData = animation.export()  
121 - // 标识动画结束  
122 - uni.$u.sleep(this.duration).then(() => {  
123 - this.animating = false  
124 - })  
125 - // #endif  
126 - },  
127 - overlayClick() {  
128 - this.show = false  
129 - this.setContentAnimate(0)  
130 - }  
131 - },  
132 - } 40 +import props from './props.js';
  41 +/**
  42 + * Dropdown
  43 + * @description
  44 + * @tutorial url
  45 + * @property {String}
  46 + * @event {Function}
  47 + * @example
  48 + */
  49 +export default {
  50 + name: 'u-dropdown',
  51 + mixins: [uni.$u.mixin, props],
  52 + data() {
  53 + return {
  54 + // �˵�����
  55 + menuList: [],
  56 + current: 0
  57 + }
  58 + },
  59 + computed: {
  60 +
  61 + },
  62 + created() {
  63 + // �������������(u-dropdown-item)��this��������data������������������΢��С��������ѭ�����ö�����
  64 + this.children = [];
  65 + },
  66 + methods: {
  67 + clickHandler(item, index) {
  68 + this.children.map(child => {
  69 + if(child.title === item.title) {
  70 + // this.queryRect('u-dropdown__menu').then(size => {
  71 + child.$emit('click')
  72 + child.setContentAnimate(child.show ? 0 : 300)
  73 + child.show = !child.show
  74 + // })
  75 + } else {
  76 + child.show = false
  77 + child.setContentAnimate(0)
  78 + }
  79 + })
  80 + },
  81 + // ��ȡ��ǩ�ijߴ�λ��
  82 + queryRect(el) {
  83 + // #ifndef APP-NVUE
  84 + // $uGetRectΪuView�Դ��Ľڵ��ѯ�򻯷���������ĵ����ܣ�https://www.uviewui.com/js/getRect.html
  85 + // ����ڲ�һ����this.$uGetRect�������Ϊthis.$u.getRect�����߹���һ�£����Ʋ�ͬ
  86 + return new Promise(resolve => {
  87 + this.$uGetRect(`.${el}`).then(size => {
  88 + resolve(size)
  89 + })
  90 + })
  91 + // #endif
  92 +
  93 + // #ifdef APP-NVUE
  94 + // nvue�£�ʹ��domģ���ѯԪ�ظ߶�
  95 + // ����һ��promise���õ��ô˷�����������ʹ��then�ص�
  96 + return new Promise(resolve => {
  97 + dom.getComponentRect(this.$refs[el], res => {
  98 + resolve(res.size)
  99 + })
  100 + })
  101 + // #endif
  102 + },
  103 + },
  104 +}
133 </script> 105 </script>
134 106
135 -<style lang="scss" scoped>  
136 - @import '../../libs/css/components.scss';  
137 -  
138 - .u-drawdown-item {  
139 -  
140 - &__content {  
141 - background-color: #FFFFFF;  
142 - overflow: hidden;  
143 - height: 0;  
144 - }  
145 - } 107 +<style lang="scss">
  108 +@import '../../libs/css/components.scss';
  109 +
  110 +.u-dropdown {
  111 +
  112 + &__menu {
  113 + @include flex;
  114 +
  115 + &__item {
  116 + flex: 1;
  117 + @include flex;
  118 + justify-content: center;
  119 +
  120 + &__content {
  121 + @include flex;
  122 + align-items: center;
  123 + }
  124 + }
  125 + }
  126 +}
146 </style> 127 </style>
yudao-ui-app/uni_modules/uview-ui/components/u-dropdown/u-dropdown.vue
1 <template> 1 <template>
2 - <view class="u-drawdown">  
3 - <view  
4 - class="u-dropdown__menu"  
5 - :style="{ 2 + <view class="u-drawdown">
  3 + <view
  4 + class="u-dropdown__menu"
  5 + :style="{
6 height: $u.addUnit(height) 6 height: $u.addUnit(height)
7 }" 7 }"
8 - ref="u-dropdown__menu"  
9 - >  
10 - <view  
11 - class="u-dropdown__menu__item"  
12 - v-for="(item, index) in menuList"  
13 - :key="index"  
14 - @tap.stop="clickHandler(item, index)"  
15 - >  
16 - <view class="u-dropdown__menu__item__content">  
17 - <text  
18 - class="u-dropdown__menu__item__content__text"  
19 - :style="[index === current ? activeStyle : inactiveStyle]"  
20 - >{{item.title}}</text>  
21 - <view  
22 - class="u-dropdown__menu__item__content__arrow"  
23 - :class="[index === current && 'u-dropdown__menu__item__content__arrow--rotate']"  
24 - >  
25 - <u-icon  
26 - :name="menuIcon"  
27 - :size="$u.addUnit(menuIconSize)"  
28 - ></u-icon>  
29 - </view>  
30 - </view>  
31 - </view>  
32 - </view>  
33 - <view class="u-dropdown__content">  
34 - <slot />  
35 - </view>  
36 - </view> 8 + ref="u-dropdown__menu"
  9 + >
  10 + <view
  11 + class="u-dropdown__menu__item"
  12 + v-for="(item, index) in menuList"
  13 + :key="index"
  14 + @tap.stop="clickHandler(item, index)"
  15 + >
  16 + <view class="u-dropdown__menu__item__content">
  17 + <text
  18 + class="u-dropdown__menu__item__content__text"
  19 + :style="[index === current ? activeStyle : inactiveStyle]"
  20 + >{{item.title}}</text>
  21 + <view
  22 + class="u-dropdown__menu__item__content__arrow"
  23 + :class="[index === current && 'u-dropdown__menu__item__content__arrow--rotate']"
  24 + >
  25 + <u-icon
  26 + :name="menuIcon"
  27 + :size="$u.addUnit(menuIconSize)"
  28 + ></u-icon>
  29 + </view>
  30 + </view>
  31 + </view>
  32 + </view>
  33 + <view class="u-dropdown__content">
  34 + <slot />
  35 + </view>
  36 + </view>
37 </template> 37 </template>
38 38
39 <script> 39 <script>
40 - import props from './props.js';  
41 - /**  
42 - * Dropdown  
43 - * @description  
44 - * @tutorial url  
45 - * @property {String}  
46 - * @event {Function}  
47 - * @example  
48 - */  
49 - export default {  
50 - name: 'u-dropdown',  
51 - mixins: [uni.$u.mixin, props],  
52 - data() {  
53 - return {  
54 - // 菜单数组  
55 - menuList: [],  
56 - current: 0  
57 - }  
58 - },  
59 - computed: {  
60 -  
61 - },  
62 - created() {  
63 - // 引用所有子组件(u-dropdown-item)的this,不能在data中声明变量,否则在微信小程序会造成循环引用而报错  
64 - this.children = [];  
65 - },  
66 - methods: {  
67 - clickHandler(item, index) {  
68 - this.children.map(child => {  
69 - if(child.title === item.title) {  
70 - // this.queryRect('u-dropdown__menu').then(size => {  
71 - child.$emit('click')  
72 - child.setContentAnimate(child.show ? 0 : 300)  
73 - child.show = !child.show  
74 - // })  
75 - } else {  
76 - child.show = false  
77 - child.setContentAnimate(0)  
78 - }  
79 - })  
80 - },  
81 - // 获取标签的尺寸位置  
82 - queryRect(el) {  
83 - // #ifndef APP-NVUE  
84 - // $uGetRect为uView自带的节点查询简化方法,详见文档介绍:https://www.uviewui.com/js/getRect.html  
85 - // 组件内部一般用this.$uGetRect,对外的为this.$u.getRect,二者功能一致,名称不同  
86 - return new Promise(resolve => {  
87 - this.$uGetRect(`.${el}`).then(size => {  
88 - resolve(size)  
89 - })  
90 - })  
91 - // #endif  
92 -  
93 - // #ifdef APP-NVUE  
94 - // nvue下,使用dom模块查询元素高度  
95 - // 返回一个promise,让调用此方法的主体能使用then回调  
96 - return new Promise(resolve => {  
97 - dom.getComponentRect(this.$refs[el], res => {  
98 - resolve(res.size)  
99 - })  
100 - })  
101 - // #endif  
102 - },  
103 - },  
104 - } 40 +import props from './props.js';
  41 +/**
  42 + * Dropdown
  43 + * @description
  44 + * @tutorial url
  45 + * @property {String}
  46 + * @event {Function}
  47 + * @example
  48 + */
  49 +export default {
  50 + name: 'u-dropdown',
  51 + mixins: [uni.$u.mixin, props],
  52 + data() {
  53 + return {
  54 + // 锟剿碉拷锟斤拷锟斤拷
  55 + menuList: [],
  56 + current: 0
  57 + }
  58 + },
  59 + computed: {
  60 +
  61 + },
  62 + created() {
  63 + // 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟(u-dropdown-item)锟斤拷this锟斤拷锟斤拷锟斤拷锟斤拷data锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷微锟斤拷小锟斤拷锟斤拷锟斤拷锟斤拷循锟斤拷锟斤拷锟矫讹拷锟斤拷锟斤拷
  64 + this.children = [];
  65 + },
  66 + methods: {
  67 + clickHandler(item, index) {
  68 + this.children.map(child => {
  69 + if(child.title === item.title) {
  70 + // this.queryRect('u-dropdown__menu').then(size => {
  71 + child.$emit('click')
  72 + child.setContentAnimate(child.show ? 0 : 300)
  73 + child.show = !child.show
  74 + // })
  75 + } else {
  76 + child.show = false
  77 + child.setContentAnimate(0)
  78 + }
  79 + })
  80 + },
  81 + // 锟斤拷取锟斤拷签锟侥尺达拷位锟斤拷
  82 + queryRect(el) {
  83 + // #ifndef APP-NVUE
  84 + // $uGetRect为uView锟皆达拷锟侥节碉拷锟窖拷蚧锟斤拷锟斤拷锟斤拷锟斤拷锟侥碉拷锟斤拷锟杰o拷https://www.uviewui.com/js/getRect.html
  85 + // 锟斤拷锟斤拷诓锟揭伙拷锟斤拷锟絫his.$uGetRect锟斤拷锟斤拷锟斤拷锟轿猼his.$u.getRect锟斤拷锟斤拷锟竭癸拷锟斤拷一锟铰o拷锟斤拷锟狡诧拷同
  86 + return new Promise(resolve => {
  87 + this.$uGetRect(`.${el}`).then(size => {
  88 + resolve(size)
  89 + })
  90 + })
  91 + // #endif
  92 +
  93 + // #ifdef APP-NVUE
  94 + // nvue锟铰o拷使锟斤拷dom模锟斤拷锟窖拷馗叨锟
  95 + // 锟斤拷锟斤拷一锟斤拷promise锟斤拷锟矫碉拷锟矫此凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷使锟斤拷then锟截碉拷
  96 + return new Promise(resolve => {
  97 + dom.getComponentRect(this.$refs[el], res => {
  98 + resolve(res.size)
  99 + })
  100 + })
  101 + // #endif
  102 + },
  103 + },
  104 +}
105 </script> 105 </script>
106 106
107 <style lang="scss"> 107 <style lang="scss">
108 - @import '../../libs/css/components.scss'; 108 +@import '../../libs/css/components.scss';
109 109
110 - .u-dropdown {  
111 -  
112 - &__menu {  
113 - @include flex;  
114 -  
115 - &__item {  
116 - flex: 1;  
117 - @include flex;  
118 - justify-content: center;  
119 -  
120 - &__content {  
121 - @include flex;  
122 - align-items: center;  
123 - }  
124 - }  
125 - }  
126 - } 110 +.u-dropdown {
  111 +
  112 + &__menu {
  113 + @include flex;
  114 +
  115 + &__item {
  116 + flex: 1;
  117 + @include flex;
  118 + justify-content: center;
  119 +
  120 + &__content {
  121 + @include flex;
  122 + align-items: center;
  123 + }
  124 + }
  125 + }
  126 +}
127 </style> 127 </style>
yudao-ui-app/uni_modules/uview-ui/components/u-form-item/props.js
@@ -15,6 +15,11 @@ export default { @@ -15,6 +15,11 @@ export default {
15 type: [String, Boolean], 15 type: [String, Boolean],
16 default: uni.$u.props.formItem.borderBottom 16 default: uni.$u.props.formItem.borderBottom
17 }, 17 },
  18 + // label的位置,left-左边,top-上边
  19 + labelPosition: {
  20 + type: String,
  21 + default: uni.$u.props.formItem.labelPosition
  22 + },
18 // label的宽度,单位px 23 // label的宽度,单位px
19 labelWidth: { 24 labelWidth: {
20 type: [String, Number], 25 type: [String, Number],
yudao-ui-app/uni_modules/uview-ui/components/u-form-item/u-form-item.vue
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 class="u-form-item__body" 4 class="u-form-item__body"
5 @tap="clickHandler" 5 @tap="clickHandler"
6 :style="[$u.addStyle(customStyle), { 6 :style="[$u.addStyle(customStyle), {
7 - flexDirection: parentData.labelPosition === 'left' ? 'row' : 'column' 7 + flexDirection: (labelPosition || parentData.labelPosition) === 'left' ? 'row' : 'column'
8 }]" 8 }]"
9 > 9 >
10 <!-- 微信小程序中,将一个参数设置空字符串,结果会变成字符串"true" --> 10 <!-- 微信小程序中,将一个参数设置空字符串,结果会变成字符串"true" -->
yudao-ui-app/uni_modules/uview-ui/components/u-image/u-image.vue
@@ -161,10 +161,10 @@ @@ -161,10 +161,10 @@
161 this.$emit('error', err) 161 this.$emit('error', err)
162 }, 162 },
163 // 图片加载完成,标记loading结束 163 // 图片加载完成,标记loading结束
164 - onLoadHandler() { 164 + onLoadHandler(event) {
165 this.loading = false 165 this.loading = false
166 this.isError = false 166 this.isError = false
167 - this.$emit('load') 167 + this.$emit('load', event)
168 this.removeBgColor() 168 this.removeBgColor()
169 // 如果不需要动画效果,就不执行下方代码,同时移除加载时的背景颜色 169 // 如果不需要动画效果,就不执行下方代码,同时移除加载时的背景颜色
170 // 否则无需fade效果时,png图片依然能看到下方的背景色 170 // 否则无需fade效果时,png图片依然能看到下方的背景色
yudao-ui-app/uni_modules/uview-ui/components/u-input/props.js
@@ -177,6 +177,11 @@ export default { @@ -177,6 +177,11 @@ export default {
177 formatter: { 177 formatter: {
178 type: [Function, null], 178 type: [Function, null],
179 default: uni.$u.props.input.formatter 179 default: uni.$u.props.input.formatter
  180 + },
  181 + // 是否忽略组件内对文本合成系统事件的处理
  182 + ignoreCompositionEvent: {
  183 + type: Boolean,
  184 + default: true
180 } 185 }
181 } 186 }
182 } 187 }
yudao-ui-app/uni_modules/uview-ui/components/u-input/u-input.vue
@@ -38,6 +38,7 @@ @@ -38,6 +38,7 @@
38 :selection-end="selectionEnd" 38 :selection-end="selectionEnd"
39 :selection-start="selectionStart" 39 :selection-start="selectionStart"
40 :password="password || type === 'password' || undefined" 40 :password="password || type === 'password' || undefined"
  41 + :ignoreCompositionEvent="ignoreCompositionEvent"
41 @input="onInput" 42 @input="onInput"
42 @blur="onBlur" 43 @blur="onBlur"
43 @focus="onFocus" 44 @focus="onFocus"
@@ -114,7 +115,7 @@ import props from &quot;./props.js&quot;; @@ -114,7 +115,7 @@ import props from &quot;./props.js&quot;;
114 * @property {Boolean} readonly 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会 ( 默认 false ) 115 * @property {Boolean} readonly 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会 ( 默认 false )
115 * @property {String} shape 输入框形状,circle-圆形,square-方形 ( 默认 'square' ) 116 * @property {String} shape 输入框形状,circle-圆形,square-方形 ( 默认 'square' )
116 * @property {Object} customStyle 定义需要用到的外部样式 117 * @property {Object} customStyle 定义需要用到的外部样式
117 - * 118 + * @property {Boolean} ignoreCompositionEvent 是否忽略组件内对文本合成系统事件的处理。
118 * @example <u-input v-model="value" :password="true" suffix-icon="lock-fill" /> 119 * @example <u-input v-model="value" :password="true" suffix-icon="lock-fill" />
119 */ 120 */
120 export default { 121 export default {
yudao-ui-app/uni_modules/uview-ui/components/u-line/props.js
@@ -24,7 +24,7 @@ export default { @@ -24,7 +24,7 @@ export default {
24 type: [String, Number], 24 type: [String, Number],
25 default: uni.$u.props.line.margin 25 default: uni.$u.props.line.margin
26 }, 26 },
27 - // 是否虚线,true-实线,false-虚线 27 + // 是否虚线,true-虚线,false-实线
28 dashed: { 28 dashed: {
29 type: Boolean, 29 type: Boolean,
30 default: uni.$u.props.line.dashed 30 default: uni.$u.props.line.dashed
yudao-ui-app/uni_modules/uview-ui/components/u-list/u-list.vue
@@ -29,9 +29,7 @@ @@ -29,9 +29,7 @@
29 @scrolltolower="scrolltolower" 29 @scrolltolower="scrolltolower"
30 @scrolltoupper="scrolltoupper" 30 @scrolltoupper="scrolltoupper"
31 > 31 >
32 - <view :style="{  
33 - paddingTop: `${offset}px`  
34 - }"> 32 + <view>
35 <slot /> 33 <slot />
36 </view> 34 </view>
37 </scroll-view> 35 </scroll-view>
yudao-ui-app/uni_modules/uview-ui/components/u-loading-page/props.js
@@ -35,6 +35,11 @@ export default { @@ -35,6 +35,11 @@ export default {
35 type: [String, Number], 35 type: [String, Number],
36 default: uni.$u.props.loadingPage.fontSize 36 default: uni.$u.props.loadingPage.fontSize
37 }, 37 },
  38 + // 图标大小
  39 + iconSize: {
  40 + type: [String, Number],
  41 + default: uni.$u.props.loadingPage.fontSize
  42 + },
38 // 加载中图标的颜色,只能rgb或者十六进制颜色值 43 // 加载中图标的颜色,只能rgb或者十六进制颜色值
39 loadingColor: { 44 loadingColor: {
40 type: String, 45 type: String,
yudao-ui-app/uni_modules/uview-ui/components/u-loading-page/u-loading-page.vue
@@ -19,11 +19,15 @@ @@ -19,11 +19,15 @@
19 :src="image" 19 :src="image"
20 class="u-loading-page__warpper__loading-icon__img" 20 class="u-loading-page__warpper__loading-icon__img"
21 mode="widthFit" 21 mode="widthFit"
  22 + :style="{
  23 + width: $u.addUnit(iconSize),
  24 + height: $u.addUnit(iconSize)
  25 + }"
22 ></image> 26 ></image>
23 <u-loading-icon 27 <u-loading-icon
24 v-else 28 v-else
25 :mode="loadingMode" 29 :mode="loadingMode"
26 - size="28" 30 + :size="$u.addUnit(iconSize)"
27 :color="loadingColor" 31 :color="loadingColor"
28 ></u-loading-icon> 32 ></u-loading-icon>
29 </view> 33 </view>
@@ -55,6 +59,7 @@ import props from &quot;./props.js&quot;; @@ -55,6 +59,7 @@ import props from &quot;./props.js&quot;;
55 * @property {String} bgColor 背景色 (默认 '#ffffff' ) 59 * @property {String} bgColor 背景色 (默认 '#ffffff' )
56 * @property {String} color 文字颜色 (默认 '#C8C8C8' ) 60 * @property {String} color 文字颜色 (默认 '#C8C8C8' )
57 * @property {String | Number} fontSize 文字大小 (默认 19 ) 61 * @property {String | Number} fontSize 文字大小 (默认 19 )
  62 + * @property {String | Number} iconSize 图标大小 (默认 28 )
58 * @property {String} loadingColor 加载中图标的颜色,只能rgb或者十六进制颜色值 (默认 '#C8C8C8' ) 63 * @property {String} loadingColor 加载中图标的颜色,只能rgb或者十六进制颜色值 (默认 '#C8C8C8' )
59 * @property {Object} customStyle 自定义样式 64 * @property {Object} customStyle 自定义样式
60 * @example <u-loading mode="circle"></u-loading> 65 * @example <u-loading mode="circle"></u-loading>
yudao-ui-app/uni_modules/uview-ui/components/u-loadmore/props.js
@@ -20,12 +20,16 @@ export default { @@ -20,12 +20,16 @@ export default {
20 type: [String, Number], 20 type: [String, Number],
21 default: uni.$u.props.loadmore.fontSize 21 default: uni.$u.props.loadmore.fontSize
22 }, 22 },
  23 + // 图标大小
  24 + iconSize: {
  25 + type: [String, Number],
  26 + default: uni.$u.props.loadmore.iconSize
  27 + },
23 // 字体颜色 28 // 字体颜色
24 color: { 29 color: {
25 type: String, 30 type: String,
26 default: uni.$u.props.loadmore.color 31 default: uni.$u.props.loadmore.color
27 }, 32 },
28 -  
29 // 加载中状态的图标,spinner-花朵状图标,circle-圆圈状,semicircle-半圆 33 // 加载中状态的图标,spinner-花朵状图标,circle-圆圈状,semicircle-半圆
30 loadingIcon: { 34 loadingIcon: {
31 type: String, 35 type: String,
@@ -75,6 +79,16 @@ export default { @@ -75,6 +79,16 @@ export default {
75 line: { 79 line: {
76 type: Boolean, 80 type: Boolean,
77 default: uni.$u.props.loadmore.line 81 default: uni.$u.props.loadmore.line
  82 + },
  83 + // 线条颜色
  84 + lineColor: {
  85 + type: String,
  86 + default: uni.$u.props.loadmore.lineColor
  87 + },
  88 + // 是否虚线,true-虚线,false-实线
  89 + dashed: {
  90 + type: Boolean,
  91 + default: uni.$u.props.loadmore.dashed
78 } 92 }
79 } 93 }
80 } 94 }
yudao-ui-app/uni_modules/uview-ui/components/u-loadmore/u-loadmore.vue
@@ -13,8 +13,9 @@ @@ -13,8 +13,9 @@
13 > 13 >
14 <u-line 14 <u-line
15 length="140rpx" 15 length="140rpx"
16 - color="#E6E8EB" 16 + :color="lineColor"
17 :hairline="false" 17 :hairline="false"
  18 + :dashed="dashed"
18 v-if="line" 19 v-if="line"
19 ></u-line> 20 ></u-line>
20 <!-- 加载中和没有更多的状态才显示两边的横线 --> 21 <!-- 加载中和没有更多的状态才显示两边的横线 -->
@@ -28,7 +29,7 @@ @@ -28,7 +29,7 @@
28 > 29 >
29 <u-loading-icon 30 <u-loading-icon
30 :color="iconColor" 31 :color="iconColor"
31 - size="17" 32 + :size="iconSize"
32 :mode="loadingIcon" 33 :mode="loadingIcon"
33 ></u-loading-icon> 34 ></u-loading-icon>
34 </view> 35 </view>
@@ -42,8 +43,9 @@ @@ -42,8 +43,9 @@
42 </view> 43 </view>
43 <u-line 44 <u-line
44 length="140rpx" 45 length="140rpx"
45 - color="#E6E8EB" 46 + :color="lineColor"
46 :hairline="false" 47 :hairline="false"
  48 + :dashed="dashed"
47 v-if="line" 49 v-if="line"
48 ></u-line> 50 ></u-line>
49 </view> 51 </view>
@@ -60,6 +62,7 @@ @@ -60,6 +62,7 @@
60 * @property {String} bgColor 组件背景颜色,在页面是非白色时会用到(默认 'transparent' ) 62 * @property {String} bgColor 组件背景颜色,在页面是非白色时会用到(默认 'transparent' )
61 * @property {Boolean} icon 加载中时是否显示图标(默认 true ) 63 * @property {Boolean} icon 加载中时是否显示图标(默认 true )
62 * @property {String | Number} fontSize 字体大小(默认 14 ) 64 * @property {String | Number} fontSize 字体大小(默认 14 )
  65 + * @property {String | Number} iconSize 图标大小(默认 17 )
63 * @property {String} color 字体颜色(默认 '#606266' ) 66 * @property {String} color 字体颜色(默认 '#606266' )
64 * @property {String} loadingIcon 加载图标(默认 'circle' ) 67 * @property {String} loadingIcon 加载图标(默认 'circle' )
65 * @property {String} loadmoreText 加载前的提示语(默认 '加载更多' ) 68 * @property {String} loadmoreText 加载前的提示语(默认 '加载更多' )
@@ -67,10 +70,12 @@ @@ -67,10 +70,12 @@
67 * @property {String} nomoreText 没有更多的提示语(默认 '没有更多了' ) 70 * @property {String} nomoreText 没有更多的提示语(默认 '没有更多了' )
68 * @property {Boolean} isDot 到上一个相邻元素的距离 (默认 false ) 71 * @property {Boolean} isDot 到上一个相邻元素的距离 (默认 false )
69 * @property {String} iconColor 加载中图标的颜色 (默认 '#b7b7b7' ) 72 * @property {String} iconColor 加载中图标的颜色 (默认 '#b7b7b7' )
  73 + * @property {String} lineColor 线条颜色(默认 #E6E8EB )
70 * @property {String | Number} marginTop 上边距 (默认 10 ) 74 * @property {String | Number} marginTop 上边距 (默认 10 )
71 * @property {String | Number} marginBottom 下边距 (默认 10 ) 75 * @property {String | Number} marginBottom 下边距 (默认 10 )
72 * @property {String | Number} height 高度,单位px (默认 'auto' ) 76 * @property {String | Number} height 高度,单位px (默认 'auto' )
73 * @property {Boolean} line 是否显示左边分割线 (默认 false ) 77 * @property {Boolean} line 是否显示左边分割线 (默认 false )
  78 + * @property {Boolean} dashed // 是否虚线,true-虚线,false-实线 (默认 false )
74 * @event {Function} loadmore status为loadmore时,点击组件会发出此事件 79 * @event {Function} loadmore status为loadmore时,点击组件会发出此事件
75 * @example <u-loadmore :status="status" icon-type="iconType" load-text="loadText" /> 80 * @example <u-loadmore :status="status" icon-type="iconType" load-text="loadText" />
76 */ 81 */
yudao-ui-app/uni_modules/uview-ui/components/u-no-network/u-no-network.vue
1 <template> 1 <template>
2 <u-overlay 2 <u-overlay
3 :show="!isConnected" 3 :show="!isConnected"
  4 + :zIndex="zIndex"
4 @touchmove.stop.prevent="noop" 5 @touchmove.stop.prevent="noop"
5 :customStyle="{ 6 :customStyle="{
6 backgroundColor: '#fff', 7 backgroundColor: '#fff',
yudao-ui-app/uni_modules/uview-ui/components/u-parse/node/node.vue
@@ -201,7 +201,7 @@ export default { @@ -201,7 +201,7 @@ export default {
201 // #ifdef H5 || APP-PLUS 201 // #ifdef H5 || APP-PLUS
202 node.attrs.src = node.attrs.src || node.attrs['data-src'] 202 node.attrs.src = node.attrs.src || node.attrs['data-src']
203 // #endif 203 // #endif
204 - this.root.$emit('imgtap', node.attrs) 204 + this.root.$emit('imgTap', node.attrs)
205 // 自动预览图片 205 // 自动预览图片
206 if (this.root.previewImg) 206 if (this.root.previewImg)
207 uni.previewImage({ 207 uni.previewImage({
@@ -262,7 +262,7 @@ export default { @@ -262,7 +262,7 @@ export default {
262 linkTap(e) { 262 linkTap(e) {
263 var attrs = e.currentTarget ? this.childs[e.currentTarget.dataset.i].attrs : e, 263 var attrs = e.currentTarget ? this.childs[e.currentTarget.dataset.i].attrs : e,
264 href = attrs.href 264 href = attrs.href
265 - this.root.$emit('linktap', attrs) 265 + this.root.$emit('linkTap', attrs)
266 if (href) { 266 if (href) {
267 // 跳转锚点 267 // 跳转锚点
268 if (href[0] == '#') 268 if (href[0] == '#')
@@ -496,4 +496,4 @@ export default { @@ -496,4 +496,4 @@ export default {
496 height: 225px; 496 height: 225px;
497 } 497 }
498 /* #endif */ 498 /* #endif */
499 -</style>  
500 \ No newline at end of file 499 \ No newline at end of file
  500 +</style>
yudao-ui-app/uni_modules/uview-ui/components/u-picker/props.js
@@ -50,11 +50,6 @@ export default { @@ -50,11 +50,6 @@ export default {
50 type: String, 50 type: String,
51 default: uni.$u.props.picker.confirmColor 51 default: uni.$u.props.picker.confirmColor
52 }, 52 },
53 - // 选择器只有一列时,默认选中项的索引,从0开始  
54 - singleIndex: {  
55 - type: [String, Number],  
56 - default: uni.$u.props.picker.singleIndex  
57 - },  
58 // 每列中可见选项的数量 53 // 每列中可见选项的数量
59 visibleItemCount: { 54 visibleItemCount: {
60 type: [String, Number], 55 type: [String, Number],
yudao-ui-app/uni_modules/uview-ui/components/u-picker/u-picker.vue
@@ -66,7 +66,6 @@ @@ -66,7 +66,6 @@
66 * @property {String} confirmText 确认按钮的文字(默认 '确定' ) 66 * @property {String} confirmText 确认按钮的文字(默认 '确定' )
67 * @property {String} cancelColor 取消按钮的颜色(默认 '#909193' ) 67 * @property {String} cancelColor 取消按钮的颜色(默认 '#909193' )
68 * @property {String} confirmColor 确认按钮的颜色(默认 '#3c9cff' ) 68 * @property {String} confirmColor 确认按钮的颜色(默认 '#3c9cff' )
69 - * @property {Array} singleIndex 选择器只有一列时,默认选中项的索引,从0开始(默认 0 )  
70 * @property {String | Number} visibleItemCount 每列中可见选项的数量(默认 5 ) 69 * @property {String | Number} visibleItemCount 每列中可见选项的数量(默认 5 )
71 * @property {String} keyName 选项对象中,需要展示的属性键名(默认 'text' ) 70 * @property {String} keyName 选项对象中,需要展示的属性键名(默认 'text' )
72 * @property {Boolean} closeOnClickOverlay 是否允许点击遮罩关闭选择器(默认 false ) 71 * @property {Boolean} closeOnClickOverlay 是否允许点击遮罩关闭选择器(默认 false )
@@ -161,7 +160,7 @@ export default { @@ -161,7 +160,7 @@ export default {
161 this.setIndexs(value) 160 this.setIndexs(value)
162 161
163 this.$emit('change', { 162 this.$emit('change', {
164 - // #ifndef MP-WEIXIN 163 + // #ifndef MP-WEIXIN || MP-LARK
165 // 微信小程序不能传递this,会因为循环引用而报错 164 // 微信小程序不能传递this,会因为循环引用而报错
166 picker: this, 165 picker: this,
167 // #endif 166 // #endif
yudao-ui-app/uni_modules/uview-ui/components/u-radio/u-radio.vue
@@ -20,15 +20,17 @@ @@ -20,15 +20,17 @@
20 /> 20 />
21 </slot> 21 </slot>
22 </view> 22 </view>
23 - <text  
24 - class="u-radio__text"  
25 - @tap.stop="labelClickHandler"  
26 - :style="{  
27 - color: elDisabled ? elInactiveColor : elLabelColor,  
28 - fontSize: elLabelSize,  
29 - lineHeight: elLabelSize  
30 - }"  
31 - >{{label}}</text> 23 + <slot>
  24 + <text
  25 + class="u-radio__text"
  26 + @tap.stop="labelClickHandler"
  27 + :style="{
  28 + color: elDisabled ? elInactiveColor : elLabelColor,
  29 + fontSize: elLabelSize,
  30 + lineHeight: elLabelSize
  31 + }"
  32 + >{{label}}</text>
  33 + </slot>
32 </view> 34 </view>
33 </template> 35 </template>
34 36
yudao-ui-app/uni_modules/uview-ui/components/u-rate/u-rate.vue
@@ -35,7 +35,8 @@ @@ -35,7 +35,8 @@
35 : inactiveColor 35 : inactiveColor
36 " 36 "
37 :custom-style="{ 37 :custom-style="{
38 - padding: `0 ${$u.addUnit(gutter / 2)}`, 38 + 'padding-left': $u.addUnit(gutter / 2),
  39 + 'padding-right': $u.addUnit(gutter / 2)
39 }" 40 }"
40 :size="size" 41 :size="size"
41 ></u-icon> 42 ></u-icon>
@@ -63,7 +64,8 @@ @@ -63,7 +64,8 @@
63 : inactiveColor 64 : inactiveColor
64 " 65 "
65 :custom-style="{ 66 :custom-style="{
66 - padding: `0 ${$u.addUnit(gutter / 2)}` 67 + 'padding-left': $u.addUnit(gutter / 2),
  68 + 'padding-right': $u.addUnit(gutter / 2)
67 }" 69 }"
68 :size="size" 70 :size="size"
69 ></u-icon> 71 ></u-icon>
yudao-ui-app/uni_modules/uview-ui/components/u-row-notice/u-row-notice.vue
@@ -19,11 +19,17 @@ @@ -19,11 +19,17 @@
19 class="u-notice__content" 19 class="u-notice__content"
20 ref="u-notice__content" 20 ref="u-notice__content"
21 > 21 >
22 - <text 22 + <view
23 ref="u-notice__content__text" 23 ref="u-notice__content__text"
24 class="u-notice__content__text" 24 class="u-notice__content__text"
25 - :style="[textStyle]"  
26 - >{{text}}</text> 25 + :style="[animationStyle]"
  26 + >
  27 + <text
  28 + v-for="(item, index) in innerText"
  29 + :key="index"
  30 + :style="[textStyle]"
  31 + >{{item}}</text>
  32 + </view>
27 </view> 33 </view>
28 <view 34 <view
29 class="u-notice__right-icon" 35 class="u-notice__right-icon"
@@ -118,11 +124,28 @@ @@ -118,11 +124,28 @@
118 textStyle() { 124 textStyle() {
119 let style = {} 125 let style = {}
120 style.color = this.color 126 style.color = this.color
  127 + style.fontSize = uni.$u.addUnit(this.fontSize)
  128 + return style
  129 + },
  130 + animationStyle() {
  131 + let style = {}
121 style.animationDuration = this.animationDuration 132 style.animationDuration = this.animationDuration
122 style.animationPlayState = this.animationPlayState 133 style.animationPlayState = this.animationPlayState
123 - style.fontSize = uni.$u.addUnit(this.fontSize)  
124 return style 134 return style
125 }, 135 },
  136 + // 内部对用户传入的数据进一步分割,放到多个text标签循环,否则如果用户传入的字符串很长(100个字符以上)
  137 + // 放在一个text标签中进行滚动,在低端安卓机上,动画可能会出现抖动现象,需要分割到多个text中可解决此问题
  138 + innerText() {
  139 + let result = [],
  140 + // 每组text标签的字符长度
  141 + len = 20
  142 + const textArr = this.text.split('')
  143 + for (let i = 0; i < textArr.length; i += len) {
  144 + // 对拆分的后的text进行slice分割,得到的为数组再进行join拼接为字符串
  145 + result.push(textArr.slice(i, i + len).join(''))
  146 + }
  147 + return result
  148 + }
126 }, 149 },
127 mounted() { 150 mounted() {
128 // #ifdef APP-PLUS 151 // #ifdef APP-PLUS
@@ -289,6 +312,7 @@ @@ -289,6 +312,7 @@
289 white-space: nowrap; 312 white-space: nowrap;
290 animation: u-loop-animation 10s linear infinite both; 313 animation: u-loop-animation 10s linear infinite both;
291 /* #endif */ 314 /* #endif */
  315 + @include flex(row);
292 } 316 }
293 } 317 }
294 318
yudao-ui-app/uni_modules/uview-ui/components/u-scroll-list/u-scroll-list.vue
@@ -72,13 +72,11 @@ @@ -72,13 +72,11 @@
72 </view> 72 </view>
73 </template> 73 </template>
74 74
75 -<!-- #ifndef APP-NVUE || MP-WEIXIN || H5 || APP-VUE || MP-QQ -->  
76 <script 75 <script
77 src="./scrollWxs.wxs" 76 src="./scrollWxs.wxs"
78 module="wxs" 77 module="wxs"
79 lang="wxs" 78 lang="wxs"
80 ></script> 79 ></script>
81 -<!-- #endif -->  
82 80
83 <script> 81 <script>
84 /** 82 /**
yudao-ui-app/uni_modules/uview-ui/components/u-swipe-action-item/u-swipe-action-item.vue
@@ -148,7 +148,7 @@ @@ -148,7 +148,7 @@
148 position: relative; 148 position: relative;
149 overflow: hidden; 149 overflow: hidden;
150 /* #ifndef APP-NVUE || MP-WEIXIN */ 150 /* #ifndef APP-NVUE || MP-WEIXIN */
151 - touch-action: none; 151 + touch-action: pan-y;
152 /* #endif */ 152 /* #endif */
153 153
154 &__content { 154 &__content {
yudao-ui-app/uni_modules/uview-ui/components/u-textarea/props.js
@@ -109,6 +109,11 @@ export default { @@ -109,6 +109,11 @@ export default {
109 formatter: { 109 formatter: {
110 type: [Function, null], 110 type: [Function, null],
111 default: uni.$u.props.textarea.formatter 111 default: uni.$u.props.textarea.formatter
  112 + },
  113 + // 是否忽略组件内对文本合成系统事件的处理
  114 + ignoreCompositionEvent: {
  115 + type: Boolean,
  116 + default: true
112 } 117 }
113 } 118 }
114 } 119 }
yudao-ui-app/uni_modules/uview-ui/components/u-textarea/u-textarea.vue
@@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
21 :holdKeyboard="holdKeyboard" 21 :holdKeyboard="holdKeyboard"
22 :maxlength="maxlength" 22 :maxlength="maxlength"
23 :confirmType="confirmType" 23 :confirmType="confirmType"
  24 + :ignoreCompositionEvent="ignoreCompositionEvent"
24 @focus="onFocus" 25 @focus="onFocus"
25 @blur="onBlur" 26 @blur="onBlur"
26 @linechange="onLinechange" 27 @linechange="onLinechange"
@@ -68,6 +69,7 @@ import props from &quot;./props.js&quot;; @@ -68,6 +69,7 @@ import props from &quot;./props.js&quot;;
68 * @property {Boolean} holdKeyboard focus时,点击页面的时候不收起键盘,只微信小程序有效(默认 false ) 69 * @property {Boolean} holdKeyboard focus时,点击页面的时候不收起键盘,只微信小程序有效(默认 false )
69 * @property {String | Number} maxlength 最大输入长度,设置为 -1 的时候不限制最大长度(默认 140 ) 70 * @property {String | Number} maxlength 最大输入长度,设置为 -1 的时候不限制最大长度(默认 140 )
70 * @property {String} border 边框类型,surround-四周边框,none-无边框,bottom-底部边框(默认 'surround' ) 71 * @property {String} border 边框类型,surround-四周边框,none-无边框,bottom-底部边框(默认 'surround' )
  72 + * @property {Boolean} ignoreCompositionEvent 是否忽略组件内对文本合成系统事件的处理
71 * 73 *
72 * @event {Function(e)} focus 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度 74 * @event {Function(e)} focus 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度
73 * @event {Function(e)} blur 输入框失去焦点时触发,event.detail = {value, cursor} 75 * @event {Function(e)} blur 输入框失去焦点时触发,event.detail = {value, cursor}
yudao-ui-app/uni_modules/uview-ui/components/u-tooltip/u-tooltip.vue
@@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
17 :selectable="false" 17 :selectable="false"
18 @longpress.stop="longpressHandler" 18 @longpress.stop="longpressHandler"
19 :style="{ 19 :style="{
  20 + color: color,
20 backgroundColor: bgColor && showTooltip && tooltipTop !== -10000 ? bgColor : 'transparent' 21 backgroundColor: bgColor && showTooltip && tooltipTop !== -10000 ? bgColor : 'transparent'
21 }" 22 }"
22 >{{ text }}</text> 23 >{{ text }}</text>
@@ -312,7 +313,6 @@ @@ -312,7 +313,6 @@
312 /* #endif */ 313 /* #endif */
313 314
314 &__text { 315 &__text {
315 - color: $u-content-color;  
316 font-size: 14px; 316 font-size: 14px;
317 } 317 }
318 318
yudao-ui-app/uni_modules/uview-ui/components/u-upload/u-upload.vue
@@ -374,6 +374,7 @@ @@ -374,6 +374,7 @@
374 $u-upload-deletable-zIndex:3 !default; 374 $u-upload-deletable-zIndex:3 !default;
375 $u-upload-success-bottom:0 !default; 375 $u-upload-success-bottom:0 !default;
376 $u-upload-success-right:0 !default; 376 $u-upload-success-right:0 !default;
  377 + $u-upload-success-border-style:solid !default;
377 $u-upload-success-border-top-color:transparent !default; 378 $u-upload-success-border-top-color:transparent !default;
378 $u-upload-success-border-left-color:transparent !default; 379 $u-upload-success-border-left-color:transparent !default;
379 $u-upload-success-border-bottom-color: $u-success !default; 380 $u-upload-success-border-bottom-color: $u-success !default;
@@ -479,6 +480,7 @@ @@ -479,6 +480,7 @@
479 // 由于weex(nvue)为阿里巴巴的KPI(部门业绩考核)的laji产物,不支持css绘制三角形 480 // 由于weex(nvue)为阿里巴巴的KPI(部门业绩考核)的laji产物,不支持css绘制三角形
480 // 所以在nvue下使用图片,非nvue下使用css实现 481 // 所以在nvue下使用图片,非nvue下使用css实现
481 /* #ifndef APP-NVUE */ 482 /* #ifndef APP-NVUE */
  483 + border-style: $u-upload-success-border-style;
482 border-top-color: $u-upload-success-border-top-color; 484 border-top-color: $u-upload-success-border-top-color;
483 border-left-color: $u-upload-success-border-left-color; 485 border-left-color: $u-upload-success-border-left-color;
484 border-bottom-color: $u-upload-success-border-bottom-color; 486 border-bottom-color: $u-upload-success-border-bottom-color;
yudao-ui-app/uni_modules/uview-ui/libs/config/config.js
1 -// 此版本发布于2022-04-04  
2 -const version = '2.0.30' 1 +// 此版本发布于2022-00-24
  2 +const version = '2.0.34'
3 3
4 // 开发环境才提示,生产环境不会提示 4 // 开发环境才提示,生产环境不会提示
5 if (process.env.NODE_ENV === 'development') { 5 if (process.env.NODE_ENV === 'development') {
6 - console.log(`\n %c uView V${version} %c https://www.uviewui.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #ffffff; padding:5px 0;'); 6 + console.log(`\n %c uView V${version} %c https://uviewui.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0; border-radius: 5px;');
7 } 7 }
8 8
9 export default { 9 export default {
yudao-ui-app/uni_modules/uview-ui/libs/config/props/codeInput.js
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 export default { 10 export default {
11 // codeInput 组件 11 // codeInput 组件
12 codeInput: { 12 codeInput: {
  13 + adjustPosition: true,
13 maxlength: 6, 14 maxlength: 6,
14 dot: false, 15 dot: false,
15 mode: 'box', 16 mode: 'box',
yudao-ui-app/uni_modules/uview-ui/libs/config/props/formItem.js
@@ -13,6 +13,7 @@ export default { @@ -13,6 +13,7 @@ export default {
13 label: '', 13 label: '',
14 prop: '', 14 prop: '',
15 borderBottom: '', 15 borderBottom: '',
  16 + labelPosition: '',
16 labelWidth: '', 17 labelWidth: '',
17 rightIcon: '', 18 rightIcon: '',
18 leftIcon: '', 19 leftIcon: '',
yudao-ui-app/uni_modules/uview-ui/libs/config/props/loadingPage.js
@@ -17,6 +17,7 @@ export default { @@ -17,6 +17,7 @@ export default {
17 bgColor: '#ffffff', 17 bgColor: '#ffffff',
18 color: '#C8C8C8', 18 color: '#C8C8C8',
19 fontSize: 19, 19 fontSize: 19,
  20 + iconSize: 28,
20 loadingColor: '#C8C8C8' 21 loadingColor: '#C8C8C8'
21 } 22 }
22 } 23 }
yudao-ui-app/uni_modules/uview-ui/libs/config/props/loadmore.js
@@ -14,6 +14,7 @@ export default { @@ -14,6 +14,7 @@ export default {
14 bgColor: 'transparent', 14 bgColor: 'transparent',
15 icon: true, 15 icon: true,
16 fontSize: 14, 16 fontSize: 14,
  17 + iconSize: 17,
17 color: '#606266', 18 color: '#606266',
18 loadingIcon: 'spinner', 19 loadingIcon: 'spinner',
19 loadmoreText: '加载更多', 20 loadmoreText: '加载更多',
@@ -24,6 +25,8 @@ export default { @@ -24,6 +25,8 @@ export default {
24 marginTop: 10, 25 marginTop: 10,
25 marginBottom: 10, 26 marginBottom: 10,
26 height: 'auto', 27 height: 'auto',
27 - line: false 28 + line: false,
  29 + lineColor: '#E6E8EB',
  30 + dashed: false,
28 } 31 }
29 } 32 }
yudao-ui-app/uni_modules/uview-ui/libs/config/props/picker.js
@@ -20,7 +20,6 @@ export default { @@ -20,7 +20,6 @@ export default {
20 confirmText: '确定', 20 confirmText: '确定',
21 cancelColor: '#909193', 21 cancelColor: '#909193',
22 confirmColor: '#3c9cff', 22 confirmColor: '#3c9cff',
23 - singleIndex: 0,  
24 visibleItemCount: 5, 23 visibleItemCount: 5,
25 keyName: 'text', 24 keyName: 'text',
26 closeOnClickOverlay: false, 25 closeOnClickOverlay: false,
yudao-ui-app/uni_modules/uview-ui/libs/config/props/textarea.js
@@ -15,7 +15,7 @@ export default { @@ -15,7 +15,7 @@ export default {
15 placeholderClass: 'textarea-placeholder', 15 placeholderClass: 'textarea-placeholder',
16 placeholderStyle: 'color: #c0c4cc', 16 placeholderStyle: 'color: #c0c4cc',
17 height: 70, 17 height: 70,
18 - confirmType: '', 18 + confirmType: 'done',
19 disabled: false, 19 disabled: false,
20 count: false, 20 count: false,
21 focus: false, 21 focus: false,
yudao-ui-app/uni_modules/uview-ui/libs/function/index.js
@@ -292,15 +292,15 @@ if (!String.prototype.padStart) { @@ -292,15 +292,15 @@ if (!String.prototype.padStart) {
292 else if (typeof dateTime === 'string' && /^\d+$/.test(dateTime.trim())) { 292 else if (typeof dateTime === 'string' && /^\d+$/.test(dateTime.trim())) {
293 date = new Date(Number(dateTime)) 293 date = new Date(Number(dateTime))
294 } 294 }
295 - // 其他都认为符合 RFC 2822 规范  
296 - else {  
297 - // 处理平台性差异,在Safari/Webkit中,new Date仅支持/作为分割符的字符串时间  
298 - date = new Date(  
299 - typeof dateTime === 'string'  
300 - ? dateTime.replace(/-/g, '/')  
301 - : dateTime  
302 - )  
303 - } 295 + // 处理平台性差异,在Safari/Webkit中,new Date仅支持/作为分割符的字符串时间
  296 + // 处理 '2022-07-10 01:02:03',跳过 '2022-07-10T01:02:03'
  297 + else if (typeof dateTime === 'string' && dateTime.includes('-') && !dateTime.includes('T')) {
  298 + date = new Date(dateTime.replace(/-/g, '/'))
  299 + }
  300 + // 其他都认为符合 RFC 2822 规范
  301 + else {
  302 + date = new Date(dateTime)
  303 + }
304 304
305 const timeSource = { 305 const timeSource = {
306 'y': date.getFullYear().toString(), // 年 306 'y': date.getFullYear().toString(), // 年
yudao-ui-app/uni_modules/uview-ui/libs/function/test.js
@@ -9,7 +9,7 @@ function email(value) { @@ -9,7 +9,7 @@ function email(value) {
9 * 验证手机格式 9 * 验证手机格式
10 */ 10 */
11 function mobile(value) { 11 function mobile(value) {
12 - return /^1[23456789]\d{9}$/.test(value) 12 + return /^1([3589]\d|4[5-9]|6[1-2,4-7]|7[0-8])\d{8}$/.test(value)
13 } 13 }
14 14
15 /** 15 /**
yudao-ui-app/uni_modules/uview-ui/libs/mixin/mixin.js
@@ -77,7 +77,7 @@ module.exports = { @@ -77,7 +77,7 @@ module.exports = {
77 } 77 }
78 return Object.keys(classes) 78 return Object.keys(classes)
79 // 支付宝,头条小程序无法动态绑定一个数组类名,否则解析出来的结果会带有",",而导致失效 79 // 支付宝,头条小程序无法动态绑定一个数组类名,否则解析出来的结果会带有",",而导致失效
80 - // #ifdef MP-ALIPAY || MP-TOUTIAO 80 + // #ifdef MP-ALIPAY || MP-TOUTIAO || MP-LARK
81 .join(' ') 81 .join(' ')
82 // #endif 82 // #endif
83 } 83 }
yudao-ui-app/uni_modules/uview-ui/libs/util/route.js
@@ -53,7 +53,7 @@ class Router { @@ -53,7 +53,7 @@ class Router {
53 mergeConfig.url = this.mixinParam(options, params) 53 mergeConfig.url = this.mixinParam(options, params)
54 mergeConfig.type = 'navigateTo' 54 mergeConfig.type = 'navigateTo'
55 } else { 55 } else {
56 - mergeConfig = uni.$u.deepClone(options, this.config) 56 + mergeConfig = uni.$u.deepMerge(options, this.config)
57 // 否则正常使用mergeConfig中的url和params进行拼接 57 // 否则正常使用mergeConfig中的url和params进行拼接
58 mergeConfig.url = this.mixinParam(options.url, options.params) 58 mergeConfig.url = this.mixinParam(options.url, options.params)
59 } 59 }
yudao-ui-app/uni_modules/uview-ui/package.json
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 "id": "uview-ui", 2 "id": "uview-ui",
3 "name": "uview-ui", 3 "name": "uview-ui",
4 "displayName": "uView2.0重磅发布,利剑出鞘,一统江湖", 4 "displayName": "uView2.0重磅发布,利剑出鞘,一统江湖",
5 - "version": "2.0.30", 5 + "version": "2.0.34",
6 "description": "uView UI已完美兼容nvue,全面的组件和便捷的工具会让您信手拈来,如鱼得水", 6 "description": "uView UI已完美兼容nvue,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7 "keywords": [ 7 "keywords": [
8 "uview", 8 "uview",
@@ -17,12 +17,8 @@ @@ -17,12 +17,8 @@
17 "engines": { 17 "engines": {
18 "HBuilderX": "^3.1.0" 18 "HBuilderX": "^3.1.0"
19 }, 19 },
20 - "dcloudext": {  
21 - "category": [  
22 - "前端组件",  
23 - "通用组件"  
24 - ],  
25 - "sale": { 20 + "dcloudext": {
  21 + "sale": {
26 "regular": { 22 "regular": {
27 "price": "0.00" 23 "price": "0.00"
28 }, 24 },
@@ -38,7 +34,8 @@ @@ -38,7 +34,8 @@
38 "data": "无", 34 "data": "无",
39 "permissions": "无" 35 "permissions": "无"
40 }, 36 },
41 - "npmurl": "https://www.npmjs.com/package/uview-ui" 37 + "npmurl": "https://www.npmjs.com/package/uview-ui",
  38 + "type": "component-vue"
42 }, 39 },
43 "uni_modules": { 40 "uni_modules": {
44 "dependencies": [], 41 "dependencies": [],
yudao-ui-app/util/request/index.js deleted
1 -// 引入配置  
2 -import config from '@/common/config'  
3 -// 初始化请求配置  
4 -uni.$u.http.setConfig((defaultConfig) => {  
5 - /* defaultConfig 为默认全局配置 */  
6 - defaultConfig.baseURL = config.baseUrl /* 根域名 */  
7 - defaultConfig.header = config.header  
8 - return defaultConfig  
9 -})  
10 -  
11 -module.exports = (vm) => {  
12 - require('./requestInterceptors')(vm)  
13 - require('./responseInterceptors')(vm)  
14 -}