diff --git a/yudao-ui-app/.editorconfig b/yudao-ui-app/.editorconfig new file mode 100644 index 0000000..7034f9b --- /dev/null +++ b/yudao-ui-app/.editorconfig @@ -0,0 +1,22 @@ +# 告诉EditorConfig插件,这是根文件,不用继续往上查找 +root = true + +# 匹配全部文件 +[*] +# 设置字符集 +charset = utf-8 +# 缩进风格,可选space、tab +indent_style = space +# 缩进的空格数 +indent_size = 2 +# 结尾换行符,可选lf、cr、crlf +end_of_line = lf +# 在文件结尾插入新行 +insert_final_newline = true +# 删除一行中的前后空格 +trim_trailing_whitespace = true + +# 匹配md结尾的文件 +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/yudao-ui-app/uni_modules/uview-ui/components/u--text-price/u--text-price.vue b/yudao-ui-app/components/custom-text-price/custom-text-price.vue index 0911a36..15c5956 100644 --- a/yudao-ui-app/uni_modules/uview-ui/components/u--text-price/u--text-price.vue +++ b/yudao-ui-app/components/custom-text-price/custom-text-price.vue @@ -1,11 +1,7 @@ @@ -15,12 +11,11 @@ * 此组件存在只为简单的显示特定样式的(人名币)价格数字 */ export default { - name: "u--text-price", - components: { - }, + name: 'custom-text-price', + components: {}, props: { - text: { - type: String, + price: { + type: [String, Number], default: '0.00' }, color: { @@ -30,31 +25,30 @@ export default { //字体大小 size: { type: [String, Number], - default: uni.$u.props.text.size + default: 15 }, //整形部分字体大小可单独定义 intSize: { type: [String, Number], - default: uni.$u.props.text.size + default: 15 } }, computed: { textArray() { - let array = ['¥']; - if (!/^\d+(\.\d+)?$/.test(this.text)) { - uni.$u.error('组件 - \ No newline at end of file + diff --git a/yudao-ui-app/pages/cart/cart.vue b/yudao-ui-app/pages/cart/cart.vue index 793da35..7826e19 100644 --- a/yudao-ui-app/pages/cart/cart.vue +++ b/yudao-ui-app/pages/cart/cart.vue @@ -1,24 +1,17 @@ - + diff --git a/yudao-ui-app/pages/category/category.vue b/yudao-ui-app/pages/category/category.vue index 3e92eb6..bfd272a 100644 --- a/yudao-ui-app/pages/category/category.vue +++ b/yudao-ui-app/pages/category/category.vue @@ -1,14 +1,14 @@ diff --git a/yudao-ui-app/pages/index/index.vue b/yudao-ui-app/pages/index/index.vue index d20adb1..adb60d2 100644 --- a/yudao-ui-app/pages/index/index.vue +++ b/yudao-ui-app/pages/index/index.vue @@ -8,20 +8,20 @@ - + - - + - - - {{item.title}} - + + + {{ item.title }} + @@ -38,7 +38,7 @@ 查看更多 - + @@ -46,7 +46,7 @@ - + @@ -63,7 +63,7 @@ 更多 > - + @@ -72,7 +72,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -100,46 +100,40 @@ - + - - + diff --git a/yudao-ui-app/pages/login/login.vue b/yudao-ui-app/pages/login/login.vue index ad66efa..99735df 100644 --- a/yudao-ui-app/pages/login/login.vue +++ b/yudao-ui-app/pages/login/login.vue @@ -1,6 +1,5 @@ diff --git a/yudao-ui-app/pages/profile/profile.vue b/yudao-ui-app/pages/profile/profile.vue index f19c84d..2fceddc 100644 --- a/yudao-ui-app/pages/profile/profile.vue +++ b/yudao-ui-app/pages/profile/profile.vue @@ -1,24 +1,17 @@ - + diff --git a/yudao-ui-app/pages/register/register.vue b/yudao-ui-app/pages/register/register.vue index 062ebbc..cda5964 100644 --- a/yudao-ui-app/pages/register/register.vue +++ b/yudao-ui-app/pages/register/register.vue @@ -1,6 +1,5 @@ @@ -53,17 +43,17 @@ export default { inputType: 'password', formData: { username: '', - password: '', + password: '' }, rules: { - 'username': { + username: { type: 'string', max: 20, required: true, message: '请输入您的账号', trigger: ['blur', 'change'] }, - 'password': { + password: { type: 'string', max: 20, required: true, @@ -73,28 +63,27 @@ export default { } } }, - onLoad() { - - }, + onLoad() {}, methods: { - handleUsernameChange(e){ - let str = uni.$u.trim(e, 'all'); + handleUsernameChange(e) { + let str = uni.$u.trim(e, 'all') this.$nextTick(() => { this.formData.username = str }) }, - handlePasswordChange(e){ - let str = uni.$u.trim(e, 'all'); + handlePasswordChange(e) { + let str = uni.$u.trim(e, 'all') this.$nextTick(() => { this.formData.password = str }) }, handleSubmit() { - this.$refs.form.validate().then(res => { - uni.$u.toast('点击了注册账号') - }).catch(err => { - - }) + this.$refs.form + .validate() + .then(res => { + uni.$u.toast('点击了注册账号') + }) + .catch(err => {}) }, navigateBack() { uni.navigateBack() @@ -104,41 +93,28 @@ export default { diff --git a/yudao-ui-app/pages/user/user.vue b/yudao-ui-app/pages/user/user.vue index 7890161..99e0961 100644 --- a/yudao-ui-app/pages/user/user.vue +++ b/yudao-ui-app/pages/user/user.vue @@ -1,9 +1,9 @@ diff --git a/yudao-ui-app/uni.scss b/yudao-ui-app/uni.scss index 0ebf216..7b272df 100644 --- a/yudao-ui-app/uni.scss +++ b/yudao-ui-app/uni.scss @@ -22,3 +22,39 @@ $custom-bg-color: #ffffff; /* 边框样式 */ $custom-border-style: 1rpx solid #f3f3f3; + + +@mixin flex-left($direction: row) { + display: flex; + flex-direction: $direction; + align-items: center; + justify-content: left; +} + +@mixin flex-right($direction: row) { + display: flex; + flex-direction: $direction; + align-items: center; + justify-content: right; +} + +@mixin flex-center($direction: row) { + display: flex; + flex-direction: $direction; + align-items: center; + justify-content: center; +} + +@mixin flex-space-between($direction: row) { + display: flex; + flex-direction: $direction; + align-items: center; + justify-content: space-between; +} + +@mixin flex-space-around($direction: row) { + display: flex; + flex-direction: $direction; + align-items: center; + justify-content: space-around; +}