main
张宇 2 years ago
parent 48cb65941e
commit e368285be3

@ -2,109 +2,114 @@
<view class="content pt-2"> <view class="content pt-2">
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading> <kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<view class="px-2 my-1"> <wd-transition :duration="320" :show="true" name="zoom-in">
<div class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm"> <view class="px-2 my-1">
<div class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm">
<div class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<div class="flex items-baseline text-xs px-2"> <div class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<span class="mr-2 warn-state warn-status-processing bg-emerald-400"></span> <div class="flex items-baseline text-xs px-2">
基础功能 <span class="mr-2 warn-state warn-status-processing bg-emerald-400"></span>
基础功能
</div>
</div> </div>
</div>
<view class="grid grid-cols-3 gap-3"> <view class="grid grid-cols-3 gap-3">
<div @click="utils.toUrl('/mall/cat/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
商品分类
</div>
<div @click="utils.toUrl('/mall/goods/index')" <div @click="utils.toUrl('/mall/cat/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;"> style="font-size: 0.75rem;">
商品管理 商品分类
</div> </div>
</view> <div @click="utils.toUrl('/mall/goods/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
商品管理
</div>
</div> </view>
</view>
<view class="px-2 my-1">
<div class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm">
<div class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<div class="flex items-baseline text-xs px-2">
<span class="mr-2 warn-state warn-status-processing bg-yellow-600"></span>
订单管理
</div>
</div> </div>
</view>
<view class="grid grid-cols-3 gap-3"> </wd-transition>
<div @click="utils.toUrl('/mall/order/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" <wd-transition :duration="340" :show="true" name="zoom-in">
style="font-size: 0.75rem;"> <view class="px-2 my-1">
普通订单 <div class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm">
</div>
<div class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<div @click="utils.toUrl('/mall/pickUp/index')" <div class="flex items-baseline text-xs px-2">
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" <span class="mr-2 warn-state warn-status-processing bg-yellow-600"></span>
style="font-size: 0.75rem;"> 订单管理
自提订单 </div>
</div> </div>
<div @click="utils.toUrl('/mall/inpersonPay/index')" <view class="grid grid-cols-3 gap-3">
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" <div @click="utils.toUrl('/mall/order/index')"
style="font-size: 0.75rem;"> class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
当面付订单 style="font-size: 0.75rem;">
</div> 普通订单
</view> </div>
<div @click="utils.toUrl('/mall/pickUp/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
自提订单
</div>
</div> <div @click="utils.toUrl('/mall/inpersonPay/index')"
</view> class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
当面付订单
</div>
</view>
<view class="px-2 my-1">
<div class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm">
<div class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<div class="flex items-baseline text-xs px-2">
<span class="mr-2 warn-state warn-status-processing bg-stone-800"></span>
折扣管理
</div>
</div> </div>
</view>
<view class="grid grid-cols-3 gap-3"> </wd-transition>
<div @click="utils.toUrl('/mall/discount/discount/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" <wd-transition :duration="360" :show="true" name="zoom-in">
style="font-size: 0.75rem;"> <view class="px-2 my-1">
限时折扣 <div class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm">
<div class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<div class="flex items-baseline text-xs px-2">
<span class="mr-2 warn-state warn-status-processing bg-stone-800"></span>
折扣管理
</div>
</div> </div>
<div @click="utils.toUrl('/mall/discount/full_discount/index')" <view class="grid grid-cols-3 gap-3">
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" <div @click="utils.toUrl('/mall/discount/discount/index')"
style="font-size: 0.75rem;"> class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
梯度折扣 style="font-size: 0.75rem;">
</div> 限时折扣
</div>
<div @click="utils.toUrl('/mall/discount/full_set_redution/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" <div @click="utils.toUrl('/mall/discount/full_discount/index')"
style="font-size: 0.75rem;"> class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
满额立减 style="font-size: 0.75rem;">
</div> 梯度折扣
</div>
<!-- <div class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
<div @click="utils.toUrl('/mall/discount/full_set_redution/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
满额立减
</div>
<!-- <div class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;"> style="font-size: 0.75rem;">
套餐优惠 套餐优惠
</div> --> </div> -->
</view> </view>
</div> </div>
</view> </view>
</wd-transition>
<view class="bg-transparent h-[80px]"></view> <view class="bg-transparent h-[80px]"></view>

@ -9,10 +9,7 @@
</template> </template>
</wd-navbar> </wd-navbar>
</view> </view>
<view bg-color="#f7f8fa" class="w-full grid grid-cols-3 gap-3 px-3 my-4"> <view bg-color="#f7f8fa" class="w-full grid grid-cols-3 gap-3 px-3 my-4">
<view @click="utils.toUrl('/mall/cat/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden" <view @click="utils.toUrl('/mall/cat/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);"> style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">分类管理</view> <view class="font-bold">分类管理</view>

@ -14,7 +14,7 @@ if (token) {
} else if (user_info.type == 3) { } else if (user_info.type == 3) {
utils.toUrl("/mall/index/index", "redirectTo") utils.toUrl("/mall/index/index", "redirectTo")
} else { } else {
uni.clearStorage(); //
} }
} else { } else {
utils.toUrl("/pages/login/index", "redirectTo") utils.toUrl("/pages/login/index", "redirectTo")

@ -3,13 +3,13 @@
<div class="flex items-center justify-center mb-2 fixed top-4 left-4"> <div class="flex items-center justify-center mb-2 fixed top-4 left-4">
<wd-transition duration="300" :show="true" name="fade-left"> <wd-transition :duration="300" :show="true" name="fade-left">
<view class="flex-1 overflow-hidden "> <view class="flex-1 overflow-hidden ">
<wd-img :width="34" :height="34" :src="webInfo.logo" mode="aspectFill" /> <wd-img :width="34" :height="34" :src="webInfo.logo" mode="aspectFill" />
</view> </view>
</wd-transition> </wd-transition>
<wd-transition duration="400" :show="true" name="fade-left"> <wd-transition :duration="400" :show="true" name="fade-left">
<text class="flex px-2 text-center justify-center"> <text class="flex px-2 text-center justify-center">
{{ webInfo.name }} {{ webInfo.name }}
</text> </text>
@ -22,12 +22,12 @@
<view class="rounded-md overflow-hidden"> <view class="rounded-md overflow-hidden">
<wd-cell-group border> <wd-cell-group border>
<wd-transition duration="400" :show="true" name="fade-left"> <wd-transition :duration="400" :show="true" name="fade-left">
<wd-input label="用户名" label-width="100px" prop="username" clearable v-model="model.username" <wd-input label="用户名" label-width="100px" prop="username" clearable v-model="model.username"
placeholder="请输入用户名" :rules="[{ required: true, message: '请填写用户名' }]" /> placeholder="请输入用户名" :rules="[{ required: true, message: '请填写用户名' }]" />
</wd-transition> </wd-transition>
<wd-transition duration="450" :show="true" name="fade-left"> <wd-transition :duration="450" :show="true" name="fade-left">
<wd-input label="密码" label-width="100px" prop="password" show-password clearable v-model="model.password" <wd-input label="密码" label-width="100px" prop="password" show-password clearable v-model="model.password"
placeholder="请输入密码" :rules="[{ required: true, message: '请填写密码' }]" /> placeholder="请输入密码" :rules="[{ required: true, message: '请填写密码' }]" />
</wd-transition> </wd-transition>
@ -36,7 +36,7 @@
</view> </view>
<view class="footer mt-4 px-6"> <view class="footer mt-4 px-6">
<wd-transition duration="500" :show="true" name="fade-left"> <wd-transition :duration="500" :show="true" name="fade-left">
<wd-button :loading="loading" type="primary" size="medium" @click="handleSubmit" block>登录</wd-button> <wd-button :loading="loading" type="primary" size="medium" @click="handleSubmit" block>登录</wd-button>
</wd-transition> </wd-transition>
</view> </view>

@ -1,14 +1,47 @@
## 0.2.132024-01-12 ## 0.2.172024-01-23
### [0.2.13](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.12...v0.2.13) (2024-01-12) ### [0.2.17](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.16...v0.2.17) (2024-01-23)
### Bug Fixes | Bug 修复 ### ✨ Features | 新功能
* 修复演示文档刷新后指向localhost的问题 ([4cd8b16](https://github.com/Moonofweisheng/wot-design-uni/commit/4cd8b16bdf5ea8e93cff85396025844e9ebd031c)) * ✨ Form 表单组件提供开关控制是否model变化时重置提示信息 ([b9f46ba](https://github.com/Moonofweisheng/wot-design-uni/commit/b9f46ba0da85acd7312753a34dd0ad3f2f7379a2)), closes [#166](https://github.com/Moonofweisheng/wot-design-uni/issues/166)
# 更新日志 # 更新日志
### [0.2.17](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.16...v0.2.17) (2024-01-23)
### ✨ Features | 新功能
* ✨ Form 表单组件提供开关控制是否model变化时重置提示信息 ([b9f46ba](https://github.com/Moonofweisheng/wot-design-uni/commit/b9f46ba0da85acd7312753a34dd0ad3f2f7379a2)), closes [#166](https://github.com/Moonofweisheng/wot-design-uni/issues/166)
### [0.2.16](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.15...v0.2.16) (2024-01-21)
### ✏️ Documentation | 文档
* ✏️ 修复文档中关于日期选择器最大日期描述错误的问题 ([bb76ce3](https://github.com/Moonofweisheng/wot-design-uni/commit/bb76ce332c6977cbae981790aa356bc27c0d9efa))
### [0.2.15](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.14...v0.2.15) (2024-01-15)
### 🐛 Bug Fixes | Bug 修复
* 🐛 修复 Tab class类名属性错误的问题 ([dc87df7](https://github.com/Moonofweisheng/wot-design-uni/commit/dc87df70c7920d7cfabc571ace8beb2ce0dc2a7c))
### ✏️ Documentation | 文档
* ✏️ 修复 Upload 文档中before-upload钩子参数描述错误的问题 ([3ec7299](https://github.com/Moonofweisheng/wot-design-uni/commit/3ec7299ce724fce771b782f6110ba6ec29376291))
### [0.2.14](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.13...v0.2.14) (2024-01-14)
### ✨ Features | 新功能
* ✨ InputNumber步进器支持禁用输入框 ([933bce3](https://github.com/Moonofweisheng/wot-design-uni/commit/933bce314618956ff922daacef5b3594f36baf9b))
### [0.2.13](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.12...v0.2.13) (2024-01-12) ### [0.2.13](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.12...v0.2.13) (2024-01-12)

@ -26,12 +26,15 @@ interface Props {
model: Record<string, any> model: Record<string, any>
// //
rules?: FormRules rules?: FormRules
//
resetOnChange?: boolean
customClass?: string customClass?: string
customStyle?: string customStyle?: string
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
rules: () => ({}), rules: () => ({}),
resetOnChange: true,
customClass: '', customClass: '',
customStyle: '' customStyle: ''
}) })
@ -44,7 +47,9 @@ linkChildren({ props, errorMessages: errorMessages })
watch( watch(
() => props.model, () => props.model,
() => { () => {
clearMessage() if (props.resetOnChange) {
clearMessage()
}
}, },
{ immediate: true, deep: true } { immediate: true, deep: true }
) )
@ -129,6 +134,14 @@ async function validate(prop?: string): Promise<{ valid: boolean; errors: ErrorM
showMessage(error) showMessage(error)
}) })
if (valid) {
if (prop) {
clearMessage(prop)
} else {
clearMessage()
}
}
return { return {
valid, valid,
errors errors
@ -156,10 +169,14 @@ function showMessage(errorMsg: ErrorMessage) {
} }
} }
function clearMessage() { function clearMessage(prop?: string) {
Object.keys(errorMessages).forEach((key) => { if (prop) {
errorMessages[key] = '' errorMessages[prop] = ''
}) } else {
Object.keys(errorMessages).forEach((key) => {
errorMessages[key] = ''
})
}
} }
function reset() { function reset() {

@ -1,14 +1,14 @@
<template> <template>
<view :class="`wd-input-number ${customClass} ${disabled ? 'is-disabled' : ''} ${withoutInput ? 'is-without-input' : ''}`"> <view :class="`wd-input-number ${customClass} ${disabled ? 'is-disabled' : ''} ${withoutInput ? 'is-without-input' : ''}`">
<view :class="`wd-input-number__action ${minDisabled ? 'is-disabled' : ''}`" @click="sub"> <view :class="`wd-input-number__action ${minDisabled || disableMinus ? 'is-disabled' : ''}`" @click="sub">
<wd-icon name="decrease" custom-class="wd-input-number__action-icon"></wd-icon> <wd-icon name="decrease" custom-class="wd-input-number__action-icon"></wd-icon>
</view> </view>
<view v-if="!withoutInput" class="wd-input-number__inner"> <view v-if="!withoutInput" class="wd-input-number__inner" @click.stop="">
<input <input
class="wd-input-number__input" class="wd-input-number__input"
:style="`${inputWidth ? 'width: ' + inputWidth : ''}`" :style="`${inputWidth ? 'width: ' + inputWidth : ''}`"
type="digit" type="digit"
:disabled="disabled" :disabled="disabled || disableInput"
v-model="inputValue" v-model="inputValue"
:placeholder="placeholder" :placeholder="placeholder"
@input="handleInput" @input="handleInput"
@ -17,7 +17,7 @@
/> />
<view class="wd-input-number__input-border"></view> <view class="wd-input-number__input-border"></view>
</view> </view>
<view :class="`wd-input-number__action ${maxDisabled ? 'is-disabled' : ''}`" @click="add"> <view :class="`wd-input-number__action ${maxDisabled || disablePlus ? 'is-disabled' : ''}`" @click="add">
<wd-icon name="add" custom-class="wd-input-number__action-icon"></wd-icon> <wd-icon name="add" custom-class="wd-input-number__action-icon"></wd-icon>
</view> </view>
</view> </view>
@ -47,11 +47,13 @@ interface Props {
stepStrictly?: boolean stepStrictly?: boolean
precision?: number precision?: number
disabled?: boolean disabled?: boolean
disableInput?: boolean
disableMinus?: boolean
disablePlus?: boolean
withoutInput?: boolean withoutInput?: boolean
inputWidth?: string | number inputWidth?: string | number
allowNull?: boolean allowNull?: boolean
placeholder?: string placeholder?: string
name?: string
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
@ -62,11 +64,13 @@ const props = withDefaults(defineProps<Props>(), {
stepStrictly: false, stepStrictly: false,
precision: 0, precision: 0,
disabled: false, disabled: false,
disableInput: false,
disableMinus: false,
disablePlus: false,
withoutInput: false, withoutInput: false,
inputWidth: 36, inputWidth: 36,
allowNull: false, allowNull: false,
placeholder: '', placeholder: ''
name: ''
}) })
const minDisabled = ref<boolean>(false) const minDisabled = ref<boolean>(false)
@ -168,14 +172,14 @@ function changeStep(val: string | number, step: number) {
} }
function sub() { function sub() {
if (minDisabled.value) return if (minDisabled.value || props.disableMinus) return
const newValue = changeStep(inputValue.value, -props.step) const newValue = changeStep(inputValue.value, -props.step)
dispatchChangeEvent(newValue) dispatchChangeEvent(newValue)
} }
function add() { function add() {
if (maxDisabled.value) return if (maxDisabled.value || props.disablePlus) return
const newValue = changeStep(inputValue.value, props.step) const newValue = changeStep(inputValue.value, props.step)
dispatchChangeEvent(newValue) dispatchChangeEvent(newValue)

@ -1,6 +1,6 @@
<template> <template>
<view :class="`wd-tab ${customClass}`"> <view :class="`wd-tab ${customClass}`">
<view v-if="painted" cclass="wd-tab__body" :style="isShow ? '' : 'display: none;'"> <view v-if="painted" class="wd-tab__body" :style="isShow ? '' : 'display: none;'">
<slot /> <slot />
</view> </view>
</view> </view>
@ -16,7 +16,7 @@ export default {
} }
</script> </script>
<script lang="ts" setup> <script lang="ts" setup>
import { getCurrentInstance, onBeforeMount, ref, watch } from 'vue' import { getCurrentInstance, ref, watch } from 'vue'
import { getType, isDef } from '../common/util' import { getType, isDef } from '../common/util'
import { useParent } from '../composables/useParent' import { useParent } from '../composables/useParent'
import { TABS_KEY } from '../wd-tabs/types' import { TABS_KEY } from '../wd-tabs/types'

@ -2,7 +2,7 @@
"id": "wot-design-uni", "id": "wot-design-uni",
"name": "wot-design-uni", "name": "wot-design-uni",
"displayName": "wot-design-uni 基于vue3+Typescript的高颜值组件库", "displayName": "wot-design-uni 基于vue3+Typescript的高颜值组件库",
"version": "0.2.13", "version": "0.2.17",
"description": "一个基于Vue3+TS开发的uni-app组件库提供60+高质量组件,支持暗黑模式和自定义主题。", "description": "一个基于Vue3+TS开发的uni-app组件库提供60+高质量组件,支持暗黑模式和自定义主题。",
"keywords": [ "keywords": [
"wot-design-uni", "wot-design-uni",

Loading…
Cancel
Save