前端项目,独立仓库
@ -1,16 +0,0 @@
|
|||||||
######################################################################
|
|
||||||
# Build Tools
|
|
||||||
|
|
||||||
/unpackage/*
|
|
||||||
/node_modules/*
|
|
||||||
|
|
||||||
######################################################################
|
|
||||||
# Development Tools
|
|
||||||
|
|
||||||
/.idea/*
|
|
||||||
/.vscode/*
|
|
||||||
/.hbuilderx/*
|
|
||||||
|
|
||||||
package-lock.json
|
|
||||||
yarn.lock
|
|
||||||
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
<script>
|
|
||||||
import config from './config'
|
|
||||||
import store from '@/store'
|
|
||||||
import { getAccessToken } from '@/utils/auth'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
onLaunch: function() {
|
|
||||||
this.initApp()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 初始化应用
|
|
||||||
initApp() {
|
|
||||||
// 初始化应用配置
|
|
||||||
this.initConfig()
|
|
||||||
// 检查用户登录状态
|
|
||||||
//#ifdef H5
|
|
||||||
this.checkLogin()
|
|
||||||
//#endif
|
|
||||||
},
|
|
||||||
initConfig() {
|
|
||||||
this.globalData.config = config
|
|
||||||
},
|
|
||||||
checkLogin() {
|
|
||||||
if (!getAccessToken()) {
|
|
||||||
this.$tab.reLaunch('/pages/login')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
@import '@/static/scss/index.scss'
|
|
||||||
</style>
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 芋道
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 登录方法
|
|
||||||
export function login(username, password, captchaVerification) {
|
|
||||||
const data = {
|
|
||||||
username,
|
|
||||||
password,
|
|
||||||
captchaVerification
|
|
||||||
}
|
|
||||||
return request({
|
|
||||||
url: '/system/auth/login',
|
|
||||||
headers: {
|
|
||||||
isToken: false
|
|
||||||
},
|
|
||||||
'method': 'POST',
|
|
||||||
'data': data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取用户详细信息
|
|
||||||
export function getInfo() {
|
|
||||||
return request({
|
|
||||||
url: '/system/auth/get-permission-info',
|
|
||||||
'method': 'GET'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 退出方法
|
|
||||||
export function logout() {
|
|
||||||
return request({
|
|
||||||
url: '/system/auth/logout',
|
|
||||||
'method': 'POST'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
import upload from '@/utils/upload'
|
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 用户密码重置
|
|
||||||
export function updateUserPwd(oldPassword, newPassword) {
|
|
||||||
const data = {
|
|
||||||
oldPassword,
|
|
||||||
newPassword
|
|
||||||
}
|
|
||||||
return request({
|
|
||||||
url: '/system/user/profile/update-password',
|
|
||||||
method: 'PUT',
|
|
||||||
params: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询用户个人信息
|
|
||||||
export function getUserProfile() {
|
|
||||||
return request({
|
|
||||||
url: '/system/user/profile/get',
|
|
||||||
method: 'GET'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改用户个人信息
|
|
||||||
export function updateUserProfile(data) {
|
|
||||||
return request({
|
|
||||||
url: '/system/user/profile/update',
|
|
||||||
method: 'PUT',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 用户头像上传
|
|
||||||
export function uploadAvatar(data) {
|
|
||||||
return upload({
|
|
||||||
url: '/system/user/profile/update-avatar',
|
|
||||||
method: 'PUT',
|
|
||||||
name: data.name,
|
|
||||||
filePath: data.filePath
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@ -1,167 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="uni-section">
|
|
||||||
<view class="uni-section-header" @click="onClick">
|
|
||||||
<view class="uni-section-header__decoration" v-if="type" :class="type" />
|
|
||||||
<slot v-else name="decoration"></slot>
|
|
||||||
|
|
||||||
<view class="uni-section-header__content">
|
|
||||||
<text :style="{'font-size':titleFontSize,'color':titleColor}" class="uni-section__content-title" :class="{'distraction':!subTitle}">{{ title }}</text>
|
|
||||||
<text v-if="subTitle" :style="{'font-size':subTitleFontSize,'color':subTitleColor}" class="uni-section-header__content-sub">{{ subTitle }}</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="uni-section-header__slot-right">
|
|
||||||
<slot name="right"></slot>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="uni-section-content" :style="{padding: _padding}">
|
|
||||||
<slot />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Section 标题栏
|
|
||||||
* @description 标题栏
|
|
||||||
* @property {String} type = [line|circle|square] 标题装饰类型
|
|
||||||
* @value line 竖线
|
|
||||||
* @value circle 圆形
|
|
||||||
* @value square 正方形
|
|
||||||
* @property {String} title 主标题
|
|
||||||
* @property {String} titleFontSize 主标题字体大小
|
|
||||||
* @property {String} titleColor 主标题字体颜色
|
|
||||||
* @property {String} subTitle 副标题
|
|
||||||
* @property {String} subTitleFontSize 副标题字体大小
|
|
||||||
* @property {String} subTitleColor 副标题字体颜色
|
|
||||||
* @property {String} padding 默认插槽 padding
|
|
||||||
*/
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'UniSection',
|
|
||||||
emits:['click'],
|
|
||||||
props: {
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
titleFontSize: {
|
|
||||||
type: String,
|
|
||||||
default: '14px'
|
|
||||||
},
|
|
||||||
titleColor:{
|
|
||||||
type: String,
|
|
||||||
default: '#333'
|
|
||||||
},
|
|
||||||
subTitle: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
subTitleFontSize: {
|
|
||||||
type: String,
|
|
||||||
default: '12px'
|
|
||||||
},
|
|
||||||
subTitleColor: {
|
|
||||||
type: String,
|
|
||||||
default: '#999'
|
|
||||||
},
|
|
||||||
padding: {
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed:{
|
|
||||||
_padding(){
|
|
||||||
if(typeof this.padding === 'string'){
|
|
||||||
return this.padding
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.padding?'10px':''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
title(newVal) {
|
|
||||||
if (uni.report && newVal !== '') {
|
|
||||||
uni.report('title', newVal)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
onClick() {
|
|
||||||
this.$emit('click')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" >
|
|
||||||
$uni-primary: #2979ff !default;
|
|
||||||
|
|
||||||
.uni-section {
|
|
||||||
background-color: #fff;
|
|
||||||
.uni-section-header {
|
|
||||||
position: relative;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
padding: 12px 10px;
|
|
||||||
font-weight: normal;
|
|
||||||
|
|
||||||
&__decoration{
|
|
||||||
margin-right: 6px;
|
|
||||||
background-color: $uni-primary;
|
|
||||||
&.line {
|
|
||||||
width: 4px;
|
|
||||||
height: 12px;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.circle {
|
|
||||||
width: 8px;
|
|
||||||
height: 8px;
|
|
||||||
border-top-right-radius: 50px;
|
|
||||||
border-top-left-radius: 50px;
|
|
||||||
border-bottom-left-radius: 50px;
|
|
||||||
border-bottom-right-radius: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.square {
|
|
||||||
width: 8px;
|
|
||||||
height: 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__content {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
flex: 1;
|
|
||||||
color: #333;
|
|
||||||
|
|
||||||
.distraction {
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
&-sub {
|
|
||||||
margin-top: 2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__slot-right{
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-section-content{
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
import CryptoJS from 'crypto-js'
|
|
||||||
/**
|
|
||||||
* @word 要加密的内容
|
|
||||||
* @keyWord String 服务器随机返回的关键字
|
|
||||||
* */
|
|
||||||
export function aesEncrypt(word, keyWord = "XwKsGlMcdPMEhR1B") {
|
|
||||||
var key = CryptoJS.enc.Utf8.parse(keyWord);
|
|
||||||
var srcs = CryptoJS.enc.Utf8.parse(word);
|
|
||||||
var encrypted = CryptoJS.AES.encrypt(srcs, key, {
|
|
||||||
mode: CryptoJS.mode.ECB,
|
|
||||||
padding: CryptoJS.pad.Pkcs7
|
|
||||||
});
|
|
||||||
return encrypted.toString();
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
import config from '@/config'
|
|
||||||
const baseUrl = config.baseUrl
|
|
||||||
export const myRequest = (option = {}) => {
|
|
||||||
return new Promise((reslove, reject) => {
|
|
||||||
uni.request({
|
|
||||||
url: baseUrl + option.url,
|
|
||||||
data: option.data,
|
|
||||||
method: option.method || "GET",
|
|
||||||
success: (result) => {
|
|
||||||
reslove(result)
|
|
||||||
},
|
|
||||||
fail: (error) => {
|
|
||||||
reject(error)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
// 应用全局配置
|
|
||||||
module.exports = {
|
|
||||||
// baseUrl: 'http://api-dashboard.yudao.iocoder.cn',
|
|
||||||
baseUrl: 'http://localhost:48080',
|
|
||||||
baseApi: '/admin-api',
|
|
||||||
// 应用信息
|
|
||||||
appInfo: {
|
|
||||||
// 应用名称
|
|
||||||
name: "yudao-app",
|
|
||||||
// 应用版本
|
|
||||||
version: "1.0.0",
|
|
||||||
// 应用logo
|
|
||||||
logo: "/static/logo.png",
|
|
||||||
// 官方网站
|
|
||||||
site_url: "https://iocoder.cn",
|
|
||||||
// 政策协议
|
|
||||||
agreements: [{
|
|
||||||
title: "隐私政策",
|
|
||||||
url: "https://iocoder.cn"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "用户服务协议",
|
|
||||||
url: "https://iocoder.cn"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
import Vue from 'vue'
|
|
||||||
import App from './App'
|
|
||||||
import store from './store' // store
|
|
||||||
import plugins from './plugins' // plugins
|
|
||||||
import './permission' // permission
|
|
||||||
Vue.use(plugins)
|
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
|
||||||
Vue.prototype.$store = store
|
|
||||||
|
|
||||||
App.mpType = 'app'
|
|
||||||
|
|
||||||
const app = new Vue({
|
|
||||||
...App
|
|
||||||
})
|
|
||||||
|
|
||||||
app.$mount()
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
{
|
|
||||||
"name" : "芋道移动端",
|
|
||||||
"appid" : "__UNI__25A9D80",
|
|
||||||
"description" : "",
|
|
||||||
"versionName" : "1.0.0",
|
|
||||||
"versionCode" : "100",
|
|
||||||
"transformPx" : false,
|
|
||||||
"app-plus" : {
|
|
||||||
"usingComponents" : true,
|
|
||||||
"nvueCompiler" : "uni-app",
|
|
||||||
"splashscreen" : {
|
|
||||||
"alwaysShowBeforeRender" : true,
|
|
||||||
"waiting" : true,
|
|
||||||
"autoclose" : true,
|
|
||||||
"delay" : 0
|
|
||||||
},
|
|
||||||
"modules" : {},
|
|
||||||
"distribute" : {
|
|
||||||
"android" : {
|
|
||||||
"permissions" : [
|
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"ios" : {},
|
|
||||||
"sdkConfigs" : {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"quickapp" : {},
|
|
||||||
"mp-weixin" : {
|
|
||||||
"appid" : "wxccd7e2a0911b3397",
|
|
||||||
"setting" : {
|
|
||||||
"urlCheck" : false,
|
|
||||||
"es6" : false,
|
|
||||||
"minified" : true,
|
|
||||||
"postcss" : true
|
|
||||||
},
|
|
||||||
"optimization" : {
|
|
||||||
"subPackages" : true
|
|
||||||
},
|
|
||||||
"usingComponents" : true
|
|
||||||
},
|
|
||||||
"vueVersion" : "2",
|
|
||||||
"h5" : {
|
|
||||||
"template" : "static/index.html",
|
|
||||||
"devServer" : {
|
|
||||||
"port" : 9090,
|
|
||||||
"https" : false
|
|
||||||
},
|
|
||||||
"title" : "Yudao-App",
|
|
||||||
"router" : {
|
|
||||||
"mode" : "hash",
|
|
||||||
"base" : "./"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"dependencies": {
|
|
||||||
"crypto-js": "^4.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,97 +0,0 @@
|
|||||||
{
|
|
||||||
"pages": [{
|
|
||||||
"path": "pages/login",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "登录"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "芋道移动端框架",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/work/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "工作台"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/mine/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "我的"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/mine/avatar/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "修改头像"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/mine/info/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "个人信息"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/mine/info/edit",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "编辑资料"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/mine/pwd/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "修改密码"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/mine/setting/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "应用设置"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/mine/help/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "常见问题"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/mine/about/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "关于我们"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/common/webview/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "浏览网页"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/common/textview/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "浏览文本"
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
"tabBar": {
|
|
||||||
"color": "#000000",
|
|
||||||
"selectedColor": "#000000",
|
|
||||||
"borderStyle": "white",
|
|
||||||
"backgroundColor": "#ffffff",
|
|
||||||
"list": [{
|
|
||||||
"pagePath": "pages/index",
|
|
||||||
"iconPath": "static/images/tabbar/home.png",
|
|
||||||
"selectedIconPath": "static/images/tabbar/home_.png",
|
|
||||||
"text": "首页"
|
|
||||||
}, {
|
|
||||||
"pagePath": "pages/work/index",
|
|
||||||
"iconPath": "static/images/tabbar/work.png",
|
|
||||||
"selectedIconPath": "static/images/tabbar/work_.png",
|
|
||||||
"text": "工作台"
|
|
||||||
}, {
|
|
||||||
"pagePath": "pages/mine/index",
|
|
||||||
"iconPath": "static/images/tabbar/mine.png",
|
|
||||||
"selectedIconPath": "static/images/tabbar/mine_.png",
|
|
||||||
"text": "我的"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"globalStyle": {
|
|
||||||
"navigationBarTextStyle": "black",
|
|
||||||
"navigationBarTitleText": "RuoYi",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<uni-card class="view-title" :title="title">
|
|
||||||
<text class="uni-body view-content">{{ content }}</text>
|
|
||||||
</uni-card>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
title: '',
|
|
||||||
content: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
this.title = options.title
|
|
||||||
this.content = options.content
|
|
||||||
uni.setNavigationBarTitle({
|
|
||||||
title: options.title
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
page {
|
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.view-title {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.view-content {
|
|
||||||
font-size: 26rpx;
|
|
||||||
padding: 12px 5px 0;
|
|
||||||
color: #333;
|
|
||||||
line-height: 24px;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view v-if="params.url">
|
|
||||||
<web-view :webview-styles="webviewStyles" :src="`${params.url}`"></web-view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
params: {},
|
|
||||||
webviewStyles: {
|
|
||||||
progress: {
|
|
||||||
color: "#FF3333"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
src: {
|
|
||||||
type: [String],
|
|
||||||
default: null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(event) {
|
|
||||||
this.params = event
|
|
||||||
if (event.title) {
|
|
||||||
uni.setNavigationBarTitle({
|
|
||||||
title: event.title
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<image class="logo" src="/static/logo.png"></image>
|
|
||||||
<view class="text-area">
|
|
||||||
<text class="title">Hello 芋道</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
onLoad: function() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
|
||||||
height: 200rpx;
|
|
||||||
width: 200rpx;
|
|
||||||
margin-top: 200rpx;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
margin-bottom: 50rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-area {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 36rpx;
|
|
||||||
color: #8f8f94;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,75 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="about-container">
|
|
||||||
<view class="header-section text-center">
|
|
||||||
<image style="width: 150rpx;height: 150rpx;" src="/static/logo200.png" mode="widthFix">
|
|
||||||
</image>
|
|
||||||
<uni-title type="h2" title="芋道移动端"></uni-title>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="content-section">
|
|
||||||
<view class="menu-list">
|
|
||||||
<view class="list-cell list-cell-arrow">
|
|
||||||
<view class="menu-item-box">
|
|
||||||
<view>版本信息</view>
|
|
||||||
<view class="text-right">v{{version}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="list-cell list-cell-arrow">
|
|
||||||
<view class="menu-item-box">
|
|
||||||
<view>官方邮箱</view>
|
|
||||||
<view class="text-right">7685413@qq.com</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="list-cell list-cell-arrow">
|
|
||||||
<view class="menu-item-box">
|
|
||||||
<view>服务热线</view>
|
|
||||||
<view class="text-right">400-999-9999</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="list-cell list-cell-arrow">
|
|
||||||
<view class="menu-item-box">
|
|
||||||
<view>公司网站</view>
|
|
||||||
<view class="text-right">
|
|
||||||
<uni-link :href="url" :text="url" showUnderLine="false"></uni-link>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="copyright">
|
|
||||||
<view>Copyright © 2022 iocoder.cn All Rights Reserved.</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
url: getApp().globalData.config.appInfo.site_url,
|
|
||||||
version: getApp().globalData.config.appInfo.version
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
page {
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.copyright {
|
|
||||||
margin-top: 50rpx;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 60rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-section {
|
|
||||||
display: flex;
|
|
||||||
padding: 30rpx 0 0;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,112 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="help-container">
|
|
||||||
<view v-for="(item, findex) in list" :key="findex" :title="item.title" class="list-title">
|
|
||||||
<view class="text-title">
|
|
||||||
<view :class="item.icon"></view>{{ item.title }}
|
|
||||||
</view>
|
|
||||||
<view class="childList">
|
|
||||||
<view v-for="(child, zindex) in item.childList" :key="zindex" class="question" hover-class="hover"
|
|
||||||
@click="handleText(child)">
|
|
||||||
<view class="text-item">{{ child.title }}</view>
|
|
||||||
<view class="line" v-if="zindex !== item.childList.length - 1"></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
list: [{
|
|
||||||
icon: 'iconfont icon-github',
|
|
||||||
title: '芋道问题',
|
|
||||||
childList: [{
|
|
||||||
title: '芋道开源吗?',
|
|
||||||
content: '开源'
|
|
||||||
}, {
|
|
||||||
title: '芋道可以商用吗?',
|
|
||||||
content: '可以'
|
|
||||||
}, {
|
|
||||||
title: '芋道官网地址多少?',
|
|
||||||
content: 'https://www.iocoder.cn'
|
|
||||||
}, {
|
|
||||||
title: '芋道文档地址多少?',
|
|
||||||
content: 'https://doc.iocoder.cn'
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'iconfont icon-help',
|
|
||||||
title: '其他问题',
|
|
||||||
childList: [{
|
|
||||||
title: '如何退出登录?',
|
|
||||||
content: '请点击[我的] - [应用设置] - [退出登录]即可退出登录',
|
|
||||||
}, {
|
|
||||||
title: '如何修改用户头像?',
|
|
||||||
content: '请点击[我的] - [选择头像] - [点击提交]即可更换用户头像',
|
|
||||||
}, {
|
|
||||||
title: '如何修改登录密码?',
|
|
||||||
content: '请点击[我的] - [应用设置] - [修改密码]即可修改登录密码',
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleText(item) {
|
|
||||||
this.$tab.navigateTo(`/pages/common/textview/index?title=${item.title}&content=${item.content}`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
page {
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.help-container {
|
|
||||||
margin-bottom: 100rpx;
|
|
||||||
padding: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-title {
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.childList {
|
|
||||||
background: #ffffff;
|
|
||||||
box-shadow: 0px 0px 10rpx rgba(193, 193, 193, 0.2);
|
|
||||||
border-radius: 16rpx;
|
|
||||||
margin-top: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line {
|
|
||||||
width: 100%;
|
|
||||||
height: 1rpx;
|
|
||||||
background-color: #F5F5F5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-title {
|
|
||||||
color: #303133;
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
font-size: 16px;
|
|
||||||
margin-right: 10rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-item {
|
|
||||||
font-size: 28rpx;
|
|
||||||
padding: 24rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.question {
|
|
||||||
color: #606266;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="container">
|
|
||||||
<uni-list>
|
|
||||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.nickname" />
|
|
||||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="user.mobile" />
|
|
||||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="邮箱" :rightText="user.email" />
|
|
||||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="岗位" :rightText="(user.posts || []).map(post => post.name).join(',')" />
|
|
||||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'staff-filled'}" title="角色" :rightText="(user.roles || []).map(role => role.name).join(',')" />
|
|
||||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="创建日期" :rightText="this.parseTime(user.createTime)" />
|
|
||||||
</uni-list>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getUserProfile } from "@/api/system/user"
|
|
||||||
import { parseTime } from "@/utils/ruoyi"
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
user: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.getUser()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getUser() {
|
|
||||||
getUserProfile().then(response => {
|
|
||||||
this.user = response.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
parseTime(time) {
|
|
||||||
return parseTime(time)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
page {
|
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,85 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="pwd-retrieve-container">
|
|
||||||
<uni-forms ref="form" :value="user" labelWidth="80px">
|
|
||||||
<uni-forms-item name="oldPassword" label="旧密码">
|
|
||||||
<uni-easyinput type="password" v-model="user.oldPassword" placeholder="请输入旧密码" />
|
|
||||||
</uni-forms-item>
|
|
||||||
<uni-forms-item name="newPassword" label="新密码">
|
|
||||||
<uni-easyinput type="password" v-model="user.newPassword" placeholder="请输入新密码" />
|
|
||||||
</uni-forms-item>
|
|
||||||
<uni-forms-item name="confirmPassword" label="确认密码">
|
|
||||||
<uni-easyinput type="password" v-model="user.confirmPassword" placeholder="请确认新密码" />
|
|
||||||
</uni-forms-item>
|
|
||||||
<button type="primary" @click="submit">提交</button>
|
|
||||||
</uni-forms>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { updateUserPwd } from "@/api/system/user"
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
user: {
|
|
||||||
oldPassword: undefined,
|
|
||||||
newPassword: undefined,
|
|
||||||
confirmPassword: undefined
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
oldPassword: {
|
|
||||||
rules: [{
|
|
||||||
required: true,
|
|
||||||
errorMessage: '旧密码不能为空'
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
newPassword: {
|
|
||||||
rules: [{
|
|
||||||
required: true,
|
|
||||||
errorMessage: '新密码不能为空',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
minLength: 6,
|
|
||||||
maxLength: 20,
|
|
||||||
errorMessage: '长度在 6 到 20 个字符'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
confirmPassword: {
|
|
||||||
rules: [{
|
|
||||||
required: true,
|
|
||||||
errorMessage: '确认密码不能为空'
|
|
||||||
}, {
|
|
||||||
validateFunction: (rule, value, data) => data.newPassword === value,
|
|
||||||
errorMessage: '两次输入的密码不一致'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onReady() {
|
|
||||||
this.$refs.form.setRules(this.rules)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
submit() {
|
|
||||||
this.$refs.form.validate().then(res => {
|
|
||||||
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功")
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
page {
|
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pwd-retrieve-container {
|
|
||||||
padding-top: 36rpx;
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="setting-container" :style="{height: `${windowHeight}px`}">
|
|
||||||
<view class="menu-list">
|
|
||||||
<view class="list-cell list-cell-arrow" @click="handleToPwd">
|
|
||||||
<view class="menu-item-box">
|
|
||||||
<view class="iconfont icon-password menu-icon"></view>
|
|
||||||
<view>修改密码</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="list-cell list-cell-arrow" @click="handleToUpgrade">
|
|
||||||
<view class="menu-item-box">
|
|
||||||
<view class="iconfont icon-refresh menu-icon"></view>
|
|
||||||
<view>检查更新</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="list-cell list-cell-arrow" @click="handleCleanTmp">
|
|
||||||
<view class="menu-item-box">
|
|
||||||
<view class="iconfont icon-clean menu-icon"></view>
|
|
||||||
<view>清理缓存</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="cu-list menu">
|
|
||||||
<view class="cu-item item-box">
|
|
||||||
<view class="content text-center" @click="handleLogout">
|
|
||||||
<text class="text-black">退出登录</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
windowHeight: uni.getSystemInfoSync().windowHeight
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleToPwd() {
|
|
||||||
this.$tab.navigateTo('/pages/mine/pwd/index')
|
|
||||||
},
|
|
||||||
handleToUpgrade() {
|
|
||||||
this.$modal.showToast('模块建设中~')
|
|
||||||
},
|
|
||||||
handleCleanTmp() {
|
|
||||||
this.$modal.showToast('模块建设中~')
|
|
||||||
},
|
|
||||||
handleLogout() {
|
|
||||||
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
|
|
||||||
this.$store.dispatch('LogOut').then(() => {
|
|
||||||
this.$tab.reLaunch('/pages/index')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.page {
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-box {
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
margin: 30rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
padding: 10rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
color: #303133;
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,183 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="work-container">
|
|
||||||
<!-- 轮播图 -->
|
|
||||||
<uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
|
|
||||||
<swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
|
|
||||||
<swiper-item v-for="(item, index) in data" :key="index">
|
|
||||||
<view class="swiper-item" @click="clickBannerItem(item)">
|
|
||||||
<image :src="item.image" mode="aspectFill" :draggable="false" />
|
|
||||||
</view>
|
|
||||||
</swiper-item>
|
|
||||||
</swiper>
|
|
||||||
</uni-swiper-dot>
|
|
||||||
|
|
||||||
<!-- 宫格组件 -->
|
|
||||||
<uni-section title="系统管理" type="line"></uni-section>
|
|
||||||
<view class="grid-body">
|
|
||||||
<uni-grid :column="4" :showBorder="false" @change="changeGrid">
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="person-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">用户管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="staff-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">角色管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="color" size="30"></uni-icons>
|
|
||||||
<text class="text">菜单管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="settings-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">部门管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="heart-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">岗位管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="bars" size="30"></uni-icons>
|
|
||||||
<text class="text">字典管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="gear-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">参数设置</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="chat-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">通知公告</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="wallet-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">日志管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
</uni-grid>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
current: 0,
|
|
||||||
swiperDotIndex: 0,
|
|
||||||
data: [{
|
|
||||||
image: '/static/images/banner/banner01.jpg'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
image: '/static/images/banner/banner02.jpg'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
image: '/static/images/banner/banner03.jpg'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
clickBannerItem(item) {
|
|
||||||
console.info(item)
|
|
||||||
},
|
|
||||||
changeSwiper(e) {
|
|
||||||
this.current = e.detail.current
|
|
||||||
},
|
|
||||||
changeGrid(e) {
|
|
||||||
this.$modal.showToast('模块建设中~')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
page {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
box-sizing: border-box;
|
|
||||||
background-color: #fff;
|
|
||||||
min-height: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
view {
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
.text {
|
|
||||||
text-align: center;
|
|
||||||
font-size: 26rpx;
|
|
||||||
margin-top: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.grid-item-box {
|
|
||||||
flex: 1;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 15px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-margin-wrap {
|
|
||||||
width: 690rpx;
|
|
||||||
width: 100%;
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper {
|
|
||||||
height: 300rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper-box {
|
|
||||||
height: 150px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper-item {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
color: #fff;
|
|
||||||
height: 300rpx;
|
|
||||||
line-height: 300rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (min-width: 500px) {
|
|
||||||
.uni-swiper-dot-box {
|
|
||||||
width: 400px;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
margin: 0 auto;
|
|
||||||
/* #endif */
|
|
||||||
margin-top: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
import { getAccessToken } from '@/utils/auth'
|
|
||||||
|
|
||||||
// 登录页面
|
|
||||||
const loginPage = "/pages/login"
|
|
||||||
|
|
||||||
// 页面白名单
|
|
||||||
const whiteList = [
|
|
||||||
'/pages/login', '/pages/common/webview/index'
|
|
||||||
]
|
|
||||||
|
|
||||||
// 检查地址白名单
|
|
||||||
function checkWhite(url) {
|
|
||||||
const path = url.split('?')[0]
|
|
||||||
return whiteList.indexOf(path) !== -1
|
|
||||||
}
|
|
||||||
|
|
||||||
// 页面跳转验证拦截器
|
|
||||||
let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"]
|
|
||||||
list.forEach(item => {
|
|
||||||
uni.addInterceptor(item, {
|
|
||||||
invoke(to) {
|
|
||||||
if (getAccessToken()) {
|
|
||||||
if (to.path === loginPage) {
|
|
||||||
uni.reLaunch({ url: "/" })
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
} else {
|
|
||||||
if (checkWhite(to.url)) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
uni.reLaunch({ url: loginPage })
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail(err) {
|
|
||||||
console.log(err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
import store from '@/store'
|
|
||||||
|
|
||||||
function authPermission(permission) {
|
|
||||||
const all_permission = "*:*:*"
|
|
||||||
const permissions = store.getters && store.getters.permissions
|
|
||||||
if (permission && permission.length > 0) {
|
|
||||||
return permissions.some(v => {
|
|
||||||
return all_permission === v || v === permission
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function authRole(role) {
|
|
||||||
const super_admin = "admin"
|
|
||||||
const roles = store.getters && store.getters.roles
|
|
||||||
if (role && role.length > 0) {
|
|
||||||
return roles.some(v => {
|
|
||||||
return super_admin === v || v === role
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
|
||||||
// 验证用户是否具备某权限
|
|
||||||
hasPermi(permission) {
|
|
||||||
return authPermission(permission)
|
|
||||||
},
|
|
||||||
// 验证用户是否含有指定权限,只需包含其中一个
|
|
||||||
hasPermiOr(permissions) {
|
|
||||||
return permissions.some(item => {
|
|
||||||
return authPermission(item)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 验证用户是否含有指定权限,必须全部拥有
|
|
||||||
hasPermiAnd(permissions) {
|
|
||||||
return permissions.every(item => {
|
|
||||||
return authPermission(item)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 验证用户是否具备某角色
|
|
||||||
hasRole(role) {
|
|
||||||
return authRole(role)
|
|
||||||
},
|
|
||||||
// 验证用户是否含有指定角色,只需包含其中一个
|
|
||||||
hasRoleOr(roles) {
|
|
||||||
return roles.some(item => {
|
|
||||||
return authRole(item)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 验证用户是否含有指定角色,必须全部拥有
|
|
||||||
hasRoleAnd(roles) {
|
|
||||||
return roles.every(item => {
|
|
||||||
return authRole(item)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
import tab from './tab'
|
|
||||||
import auth from './auth'
|
|
||||||
import modal from './modal'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
install(Vue) {
|
|
||||||
// 页签操作
|
|
||||||
Vue.prototype.$tab = tab
|
|
||||||
// 认证对象
|
|
||||||
Vue.prototype.$auth = auth
|
|
||||||
// 模态框对象
|
|
||||||
Vue.prototype.$modal = modal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
export default {
|
|
||||||
// 消息提示
|
|
||||||
msg(content) {
|
|
||||||
uni.showToast({
|
|
||||||
title: content,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 错误消息
|
|
||||||
msgError(content) {
|
|
||||||
uni.showToast({
|
|
||||||
title: content,
|
|
||||||
icon: 'error'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 成功消息
|
|
||||||
msgSuccess(content) {
|
|
||||||
uni.showToast({
|
|
||||||
title: content,
|
|
||||||
icon: 'success'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 隐藏消息
|
|
||||||
hideMsg(content) {
|
|
||||||
uni.hideToast()
|
|
||||||
},
|
|
||||||
// 弹出提示
|
|
||||||
alert(content) {
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: content,
|
|
||||||
showCancel: false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 确认窗体
|
|
||||||
confirm(content) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
uni.showModal({
|
|
||||||
title: '系统提示',
|
|
||||||
content: content,
|
|
||||||
cancelText: '取消',
|
|
||||||
confirmText: '确定',
|
|
||||||
success: function(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
resolve(res.confirm)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 提示信息
|
|
||||||
showToast(option) {
|
|
||||||
if (typeof option === "object") {
|
|
||||||
uni.showToast(option)
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: option,
|
|
||||||
icon: "none",
|
|
||||||
duration: 2500
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 打开遮罩层
|
|
||||||
loading(content) {
|
|
||||||
uni.showLoading({
|
|
||||||
title: content,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 关闭遮罩层
|
|
||||||
closeLoading() {
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 17 KiB |
@ -1,90 +0,0 @@
|
|||||||
@font-face {
|
|
||||||
font-family: "iconfont";
|
|
||||||
src: url('/static/font/iconfont.ttf') format('truetype');
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
font-family: "iconfont" !important;
|
|
||||||
font-size: 16px;
|
|
||||||
display: inline-block;
|
|
||||||
font-style: normal;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-user:before {
|
|
||||||
content: "\e7ae";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-password:before {
|
|
||||||
content: "\e8b2";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-code:before {
|
|
||||||
content: "\e699";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-setting:before {
|
|
||||||
content: "\e6cc";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-share:before {
|
|
||||||
content: "\e739";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-edit:before {
|
|
||||||
content: "\e60c";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-version:before {
|
|
||||||
content: "\e63f";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-service:before {
|
|
||||||
content: "\e6ff";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-friendfill:before {
|
|
||||||
content: "\e726";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-community:before {
|
|
||||||
content: "\e741";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-people:before {
|
|
||||||
content: "\e736";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-dianzan:before {
|
|
||||||
content: "\ec7f";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-right:before {
|
|
||||||
content: "\e7eb";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-logout:before {
|
|
||||||
content: "\e61d";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-help:before {
|
|
||||||
content: "\e616";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-github:before {
|
|
||||||
content: "\e628";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-aixin:before {
|
|
||||||
content: "\e601";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-clean:before {
|
|
||||||
content: "\e607";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-refresh:before {
|
|
||||||
content: "\e604";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
@ -1,20 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh-CN">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
||||||
<meta name="renderer" content="webkit">
|
|
||||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="<%= BASE_URL %>static/favicon.ico">
|
|
||||||
<script>
|
|
||||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
|
||||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
|
||||||
</script>
|
|
||||||
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<noscript>
|
|
||||||
<strong>本站点必须要开启JavaScript才能运行.</strong>
|
|
||||||
</noscript>
|
|
||||||
<div id="app"></div>
|
|
||||||
</html>
|
|
||||||
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
@ -1,90 +0,0 @@
|
|||||||
.text-center {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.font-13 {
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.font-12 {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.font-11 {
|
|
||||||
font-size: 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-grey1 {
|
|
||||||
color: #888;
|
|
||||||
}
|
|
||||||
.text-grey2 {
|
|
||||||
color: #aaa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-cell-arrow::before {
|
|
||||||
content: ' ';
|
|
||||||
height: 10px;
|
|
||||||
width: 10px;
|
|
||||||
border-width: 2px 2px 0 0;
|
|
||||||
border-color: #c0c0c0;
|
|
||||||
border-style: solid;
|
|
||||||
-webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
|
|
||||||
transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
margin-top: -6px;
|
|
||||||
right: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-cell {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
background-color: #fff;
|
|
||||||
color: #333;
|
|
||||||
padding: 26rpx 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-cell:first-child {
|
|
||||||
border-radius: 8rpx 8rpx 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-cell:last-child {
|
|
||||||
border-radius: 0 0 8rpx 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-cell::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
border-bottom: 1px solid #eaeef1;
|
|
||||||
-webkit-transform: scaleY(0.5) translateZ(0);
|
|
||||||
transform: scaleY(0.5) translateZ(0);
|
|
||||||
transform-origin: 0 100%;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.menu-list {
|
|
||||||
margin: 15px 15px;
|
|
||||||
|
|
||||||
.menu-item-box {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.menu-icon {
|
|
||||||
color: #007AFF;
|
|
||||||
font-size: 16px;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-right {
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: 34rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
// global
|
|
||||||
@import "./global.scss";
|
|
||||||
// color-ui
|
|
||||||
@import "@/static/scss/colorui.css";
|
|
||||||
// iconfont
|
|
||||||
@import "@/static/font/iconfont.css";
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
const getters = {
|
|
||||||
token: state => state.user.token,
|
|
||||||
avatar: state => state.user.avatar,
|
|
||||||
name: state => state.user.name,
|
|
||||||
roles: state => state.user.roles,
|
|
||||||
permissions: state => state.user.permissions
|
|
||||||
}
|
|
||||||
export default getters
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
import Vue from 'vue'
|
|
||||||
import Vuex from 'vuex'
|
|
||||||
import user from '@/store/modules/user'
|
|
||||||
import getters from './getters'
|
|
||||||
|
|
||||||
Vue.use(Vuex)
|
|
||||||
|
|
||||||
const store = new Vuex.Store({
|
|
||||||
modules: {
|
|
||||||
user
|
|
||||||
},
|
|
||||||
getters
|
|
||||||
})
|
|
||||||
|
|
||||||
export default store
|
|
||||||
@ -1,98 +0,0 @@
|
|||||||
import config from '@/config'
|
|
||||||
import storage from '@/utils/storage'
|
|
||||||
import constant from '@/utils/constant'
|
|
||||||
import { login, logout, getInfo } from '@/api/login'
|
|
||||||
import { setToken, removeToken } from '@/utils/auth'
|
|
||||||
|
|
||||||
const baseUrl = config.baseUrl
|
|
||||||
|
|
||||||
const user = {
|
|
||||||
state: {
|
|
||||||
id: 0, // 用户编号
|
|
||||||
name: storage.get(constant.name),
|
|
||||||
avatar: storage.get(constant.avatar),
|
|
||||||
roles: storage.get(constant.roles),
|
|
||||||
permissions: storage.get(constant.permissions)
|
|
||||||
},
|
|
||||||
|
|
||||||
mutations: {
|
|
||||||
SET_ID: (state, id) => {
|
|
||||||
state.id = id
|
|
||||||
},
|
|
||||||
SET_NAME: (state, name) => {
|
|
||||||
state.name = name
|
|
||||||
storage.set(constant.name, name)
|
|
||||||
},
|
|
||||||
SET_AVATAR: (state, avatar) => {
|
|
||||||
state.avatar = avatar
|
|
||||||
storage.set(constant.avatar, avatar)
|
|
||||||
},
|
|
||||||
SET_ROLES: (state, roles) => {
|
|
||||||
state.roles = roles
|
|
||||||
storage.set(constant.roles, roles)
|
|
||||||
},
|
|
||||||
SET_PERMISSIONS: (state, permissions) => {
|
|
||||||
state.permissions = permissions
|
|
||||||
storage.set(constant.permissions, permissions)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
actions: {
|
|
||||||
// 登录
|
|
||||||
Login({ commit }, userInfo) {
|
|
||||||
const username = userInfo.username.trim()
|
|
||||||
const password = userInfo.password
|
|
||||||
const captchaVerification = userInfo.captchaVerification
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
login(username, password, captchaVerification).then(res => {
|
|
||||||
res = res.data;
|
|
||||||
// 设置 token
|
|
||||||
setToken(res)
|
|
||||||
resolve()
|
|
||||||
}).catch(error => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 获取用户信息
|
|
||||||
GetInfo({ commit, state }) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
getInfo().then(res => {
|
|
||||||
res = res.data; // 读取 data 数据
|
|
||||||
const user = res.user
|
|
||||||
const avatar = (user == null || user.avatar === "" || user.avatar == null) ? require("@/static/images/profile.jpg") : user.avatar
|
|
||||||
const nickname = (user == null || user.nickname === "" || user.nickname == null) ? "" : user.nickname
|
|
||||||
if (res.roles && res.roles.length > 0) {
|
|
||||||
commit('SET_ROLES', res.roles)
|
|
||||||
commit('SET_PERMISSIONS', res.permissions)
|
|
||||||
} else {
|
|
||||||
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
|
||||||
}
|
|
||||||
commit('SET_NAME', nickname)
|
|
||||||
commit('SET_AVATAR', avatar)
|
|
||||||
resolve(res)
|
|
||||||
}).catch(error => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 退出系统
|
|
||||||
LogOut({ commit, state }) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
logout(state.token).then(() => {
|
|
||||||
commit('SET_ROLES', [])
|
|
||||||
commit('SET_PERMISSIONS', [])
|
|
||||||
removeToken()
|
|
||||||
storage.clean()
|
|
||||||
resolve()
|
|
||||||
}).catch(error => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default user
|
|
||||||
@ -1,88 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "uni-badge",
|
|
||||||
"displayName": "uni-badge 数字角标",
|
|
||||||
"version": "1.2.0",
|
|
||||||
"description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。",
|
|
||||||
"keywords": [
|
|
||||||
"",
|
|
||||||
"badge",
|
|
||||||
"uni-ui",
|
|
||||||
"uniui",
|
|
||||||
"数字角标",
|
|
||||||
"徽章"
|
|
||||||
],
|
|
||||||
"repository": "https://github.com/dcloudio/uni-ui",
|
|
||||||
"engines": {
|
|
||||||
"HBuilderX": ""
|
|
||||||
},
|
|
||||||
"directories": {
|
|
||||||
"example": "../../temps/example_temps"
|
|
||||||
},
|
|
||||||
"dcloudext": {
|
|
||||||
"category": [
|
|
||||||
"前端组件",
|
|
||||||
"通用组件"
|
|
||||||
],
|
|
||||||
"sale": {
|
|
||||||
"regular": {
|
|
||||||
"price": "0.00"
|
|
||||||
},
|
|
||||||
"sourcecode": {
|
|
||||||
"price": "0.00"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"contact": {
|
|
||||||
"qq": ""
|
|
||||||
},
|
|
||||||
"declaration": {
|
|
||||||
"ads": "无",
|
|
||||||
"data": "无",
|
|
||||||
"permissions": "无"
|
|
||||||
},
|
|
||||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
|
||||||
},
|
|
||||||
"uni_modules": {
|
|
||||||
"dependencies": ["uni-scss"],
|
|
||||||
"encrypt": [],
|
|
||||||
"platforms": {
|
|
||||||
"cloud": {
|
|
||||||
"tcb": "y",
|
|
||||||
"aliyun": "y"
|
|
||||||
},
|
|
||||||
"client": {
|
|
||||||
"App": {
|
|
||||||
"app-vue": "y",
|
|
||||||
"app-nvue": "y"
|
|
||||||
},
|
|
||||||
"H5-mobile": {
|
|
||||||
"Safari": "y",
|
|
||||||
"Android Browser": "y",
|
|
||||||
"微信浏览器(Android)": "y",
|
|
||||||
"QQ浏览器(Android)": "y"
|
|
||||||
},
|
|
||||||
"H5-pc": {
|
|
||||||
"Chrome": "y",
|
|
||||||
"IE": "y",
|
|
||||||
"Edge": "y",
|
|
||||||
"Firefox": "y",
|
|
||||||
"Safari": "y"
|
|
||||||
},
|
|
||||||
"小程序": {
|
|
||||||
"微信": "y",
|
|
||||||
"阿里": "y",
|
|
||||||
"百度": "y",
|
|
||||||
"字节跳动": "y",
|
|
||||||
"QQ": "y"
|
|
||||||
},
|
|
||||||
"快应用": {
|
|
||||||
"华为": "y",
|
|
||||||
"联盟": "y"
|
|
||||||
},
|
|
||||||
"Vue": {
|
|
||||||
"vue2": "y",
|
|
||||||
"vue3": "y"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,88 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "uni-breadcrumb",
|
|
||||||
"displayName": "uni-breadcrumb 面包屑",
|
|
||||||
"version": "0.1.2",
|
|
||||||
"description": "Breadcrumb 面包屑",
|
|
||||||
"keywords": [
|
|
||||||
"uni-breadcrumb",
|
|
||||||
"breadcrumb",
|
|
||||||
"uni-ui",
|
|
||||||
"面包屑导航",
|
|
||||||
"面包屑"
|
|
||||||
],
|
|
||||||
"repository": "",
|
|
||||||
"engines": {
|
|
||||||
"HBuilderX": "^3.1.0"
|
|
||||||
},
|
|
||||||
"directories": {
|
|
||||||
"example": "../../temps/example_temps"
|
|
||||||
},
|
|
||||||
"dcloudext": {
|
|
||||||
"category": [
|
|
||||||
"前端组件",
|
|
||||||
"通用组件"
|
|
||||||
],
|
|
||||||
"sale": {
|
|
||||||
"regular": {
|
|
||||||
"price": "0.00"
|
|
||||||
},
|
|
||||||
"sourcecode": {
|
|
||||||
"price": "0.00"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"contact": {
|
|
||||||
"qq": ""
|
|
||||||
},
|
|
||||||
"declaration": {
|
|
||||||
"ads": "无",
|
|
||||||
"data": "无",
|
|
||||||
"permissions": "无"
|
|
||||||
},
|
|
||||||
"npmurl": ""
|
|
||||||
},
|
|
||||||
"uni_modules": {
|
|
||||||
"dependencies": [],
|
|
||||||
"encrypt": [],
|
|
||||||
"platforms": {
|
|
||||||
"cloud": {
|
|
||||||
"tcb": "y",
|
|
||||||
"aliyun": "y"
|
|
||||||
},
|
|
||||||
"client": {
|
|
||||||
"Vue": {
|
|
||||||
"vue2": "y",
|
|
||||||
"vue3": "y"
|
|
||||||
},
|
|
||||||
"App": {
|
|
||||||
"app-vue": "y",
|
|
||||||
"app-nvue": "n"
|
|
||||||
},
|
|
||||||
"H5-mobile": {
|
|
||||||
"Safari": "y",
|
|
||||||
"Android Browser": "y",
|
|
||||||
"微信浏览器(Android)": "y",
|
|
||||||
"QQ浏览器(Android)": "y"
|
|
||||||
},
|
|
||||||
"H5-pc": {
|
|
||||||
"Chrome": "y",
|
|
||||||
"IE": "y",
|
|
||||||
"Edge": "y",
|
|
||||||
"Firefox": "y",
|
|
||||||
"Safari": "y"
|
|
||||||
},
|
|
||||||
"小程序": {
|
|
||||||
"微信": "y",
|
|
||||||
"阿里": "u",
|
|
||||||
"百度": "u",
|
|
||||||
"字节跳动": "u",
|
|
||||||
"QQ": "u",
|
|
||||||
"京东": "u"
|
|
||||||
},
|
|
||||||
"快应用": {
|
|
||||||
"华为": "u",
|
|
||||||
"联盟": "u"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"uni-calender.ok": "ok",
|
|
||||||
"uni-calender.cancel": "cancel",
|
|
||||||
"uni-calender.today": "today",
|
|
||||||
"uni-calender.MON": "MON",
|
|
||||||
"uni-calender.TUE": "TUE",
|
|
||||||
"uni-calender.WED": "WED",
|
|
||||||
"uni-calender.THU": "THU",
|
|
||||||
"uni-calender.FRI": "FRI",
|
|
||||||
"uni-calender.SAT": "SAT",
|
|
||||||
"uni-calender.SUN": "SUN"
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
import en from './en.json'
|
|
||||||
import zhHans from './zh-Hans.json'
|
|
||||||
import zhHant from './zh-Hant.json'
|
|
||||||
export default {
|
|
||||||
en,
|
|
||||||
'zh-Hans': zhHans,
|
|
||||||
'zh-Hant': zhHant
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"uni-calender.ok": "确定",
|
|
||||||
"uni-calender.cancel": "取消",
|
|
||||||
"uni-calender.today": "今日",
|
|
||||||
"uni-calender.SUN": "日",
|
|
||||||
"uni-calender.MON": "一",
|
|
||||||
"uni-calender.TUE": "二",
|
|
||||||
"uni-calender.WED": "三",
|
|
||||||
"uni-calender.THU": "四",
|
|
||||||
"uni-calender.FRI": "五",
|
|
||||||
"uni-calender.SAT": "六"
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"uni-calender.ok": "確定",
|
|
||||||
"uni-calender.cancel": "取消",
|
|
||||||
"uni-calender.today": "今日",
|
|
||||||
"uni-calender.SUN": "日",
|
|
||||||
"uni-calender.MON": "一",
|
|
||||||
"uni-calender.TUE": "二",
|
|
||||||
"uni-calender.WED": "三",
|
|
||||||
"uni-calender.THU": "四",
|
|
||||||
"uni-calender.FRI": "五",
|
|
||||||
"uni-calender.SAT": "六"
|
|
||||||
}
|
|
||||||
@ -1,188 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="uni-calendar-item__weeks-box" :class="{
|
|
||||||
'uni-calendar-item--disable':weeks.disable,
|
|
||||||
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
|
|
||||||
'uni-calendar-item--checked':(calendar.fullDate === weeks.fullDate && !weeks.isDay) ,
|
|
||||||
'uni-calendar-item--before-checked':weeks.beforeMultiple,
|
|
||||||
'uni-calendar-item--multiple': weeks.multiple,
|
|
||||||
'uni-calendar-item--after-checked':weeks.afterMultiple,
|
|
||||||
}"
|
|
||||||
@click="choiceDate(weeks)">
|
|
||||||
<view class="uni-calendar-item__weeks-box-item">
|
|
||||||
<text v-if="selected&&weeks.extraInfo" class="uni-calendar-item__weeks-box-circle"></text>
|
|
||||||
<text class="uni-calendar-item__weeks-box-text" :class="{
|
|
||||||
'uni-calendar-item--isDay-text': weeks.isDay,
|
|
||||||
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
|
|
||||||
'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
|
|
||||||
'uni-calendar-item--before-checked':weeks.beforeMultiple,
|
|
||||||
'uni-calendar-item--multiple': weeks.multiple,
|
|
||||||
'uni-calendar-item--after-checked':weeks.afterMultiple,
|
|
||||||
'uni-calendar-item--disable':weeks.disable,
|
|
||||||
}">{{weeks.date}}</text>
|
|
||||||
<text v-if="!lunar&&!weeks.extraInfo && weeks.isDay" class="uni-calendar-item__weeks-lunar-text" :class="{
|
|
||||||
'uni-calendar-item--isDay-text':weeks.isDay,
|
|
||||||
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
|
|
||||||
'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
|
|
||||||
'uni-calendar-item--before-checked':weeks.beforeMultiple,
|
|
||||||
'uni-calendar-item--multiple': weeks.multiple,
|
|
||||||
'uni-calendar-item--after-checked':weeks.afterMultiple,
|
|
||||||
}">{{todayText}}</text>
|
|
||||||
<text v-if="lunar&&!weeks.extraInfo" class="uni-calendar-item__weeks-lunar-text" :class="{
|
|
||||||
'uni-calendar-item--isDay-text':weeks.isDay,
|
|
||||||
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
|
|
||||||
'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
|
|
||||||
'uni-calendar-item--before-checked':weeks.beforeMultiple,
|
|
||||||
'uni-calendar-item--multiple': weeks.multiple,
|
|
||||||
'uni-calendar-item--after-checked':weeks.afterMultiple,
|
|
||||||
'uni-calendar-item--disable':weeks.disable,
|
|
||||||
}">{{weeks.isDay ? todayText : (weeks.lunar.IDayCn === '初一'?weeks.lunar.IMonthCn:weeks.lunar.IDayCn)}}</text>
|
|
||||||
<text v-if="weeks.extraInfo&&weeks.extraInfo.info" class="uni-calendar-item__weeks-lunar-text" :class="{
|
|
||||||
'uni-calendar-item--extra':weeks.extraInfo.info,
|
|
||||||
'uni-calendar-item--isDay-text':weeks.isDay,
|
|
||||||
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
|
|
||||||
'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
|
|
||||||
'uni-calendar-item--before-checked':weeks.beforeMultiple,
|
|
||||||
'uni-calendar-item--multiple': weeks.multiple,
|
|
||||||
'uni-calendar-item--after-checked':weeks.afterMultiple,
|
|
||||||
'uni-calendar-item--disable':weeks.disable,
|
|
||||||
}">{{weeks.extraInfo.info}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
initVueI18n
|
|
||||||
} from '@dcloudio/uni-i18n'
|
|
||||||
import messages from './i18n/index.js'
|
|
||||||
const { t } = initVueI18n(messages)
|
|
||||||
export default {
|
|
||||||
emits:['change'],
|
|
||||||
props: {
|
|
||||||
weeks: {
|
|
||||||
type: Object,
|
|
||||||
default () {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
calendar: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
selected: {
|
|
||||||
type: Array,
|
|
||||||
default: () => {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
lunar: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
todayText() {
|
|
||||||
return t("uni-calender.today")
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
choiceDate(weeks) {
|
|
||||||
this.$emit('change', weeks)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
$uni-font-size-base:14px;
|
|
||||||
$uni-text-color:#333;
|
|
||||||
$uni-font-size-sm:12px;
|
|
||||||
$uni-color-error: #e43d33;
|
|
||||||
$uni-opacity-disabled: 0.3;
|
|
||||||
$uni-text-color-disable:#c0c0c0;
|
|
||||||
$uni-color-primary: #2979ff;
|
|
||||||
.uni-calendar-item__weeks-box {
|
|
||||||
flex: 1;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-calendar-item__weeks-box-text {
|
|
||||||
font-size: $uni-font-size-base;
|
|
||||||
color: $uni-text-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-calendar-item__weeks-lunar-text {
|
|
||||||
font-size: $uni-font-size-sm;
|
|
||||||
color: $uni-text-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-calendar-item__weeks-box-item {
|
|
||||||
position: relative;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
width: 100rpx;
|
|
||||||
height: 100rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-calendar-item__weeks-box-circle {
|
|
||||||
position: absolute;
|
|
||||||
top: 5px;
|
|
||||||
right: 5px;
|
|
||||||
width: 8px;
|
|
||||||
height: 8px;
|
|
||||||
border-radius: 8px;
|
|
||||||
background-color: $uni-color-error;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-calendar-item--disable {
|
|
||||||
background-color: rgba(249, 249, 249, $uni-opacity-disabled);
|
|
||||||
color: $uni-text-color-disable;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-calendar-item--isDay-text {
|
|
||||||
color: $uni-color-primary;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-calendar-item--isDay {
|
|
||||||
background-color: $uni-color-primary;
|
|
||||||
opacity: 0.8;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-calendar-item--extra {
|
|
||||||
color: $uni-color-error;
|
|
||||||
opacity: 0.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-calendar-item--checked {
|
|
||||||
background-color: $uni-color-primary;
|
|
||||||
color: #fff;
|
|
||||||
opacity: 0.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-calendar-item--multiple {
|
|
||||||
background-color: $uni-color-primary;
|
|
||||||
color: #fff;
|
|
||||||
opacity: 0.8;
|
|
||||||
}
|
|
||||||
.uni-calendar-item--before-checked {
|
|
||||||
background-color: #ff5a5f;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.uni-calendar-item--after-checked {
|
|
||||||
background-color: #ff5a5f;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,88 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "uni-calendar",
|
|
||||||
"displayName": "uni-calendar 日历",
|
|
||||||
"version": "1.4.5",
|
|
||||||
"description": "日历组件",
|
|
||||||
"keywords": [
|
|
||||||
"uni-ui",
|
|
||||||
"uniui",
|
|
||||||
"日历",
|
|
||||||
"",
|
|
||||||
"打卡",
|
|
||||||
"日历选择"
|
|
||||||
],
|
|
||||||
"repository": "https://github.com/dcloudio/uni-ui",
|
|
||||||
"engines": {
|
|
||||||
"HBuilderX": ""
|
|
||||||
},
|
|
||||||
"directories": {
|
|
||||||
"example": "../../temps/example_temps"
|
|
||||||
},
|
|
||||||
"dcloudext": {
|
|
||||||
"category": [
|
|
||||||
"前端组件",
|
|
||||||
"通用组件"
|
|
||||||
],
|
|
||||||
"sale": {
|
|
||||||
"regular": {
|
|
||||||
"price": "0.00"
|
|
||||||
},
|
|
||||||
"sourcecode": {
|
|
||||||
"price": "0.00"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"contact": {
|
|
||||||
"qq": ""
|
|
||||||
},
|
|
||||||
"declaration": {
|
|
||||||
"ads": "无",
|
|
||||||
"data": "无",
|
|
||||||
"permissions": "无"
|
|
||||||
},
|
|
||||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
|
||||||
},
|
|
||||||
"uni_modules": {
|
|
||||||
"dependencies": [],
|
|
||||||
"encrypt": [],
|
|
||||||
"platforms": {
|
|
||||||
"cloud": {
|
|
||||||
"tcb": "y",
|
|
||||||
"aliyun": "y"
|
|
||||||
},
|
|
||||||
"client": {
|
|
||||||
"App": {
|
|
||||||
"app-vue": "y",
|
|
||||||
"app-nvue": "y"
|
|
||||||
},
|
|
||||||
"H5-mobile": {
|
|
||||||
"Safari": "y",
|
|
||||||
"Android Browser": "y",
|
|
||||||
"微信浏览器(Android)": "y",
|
|
||||||
"QQ浏览器(Android)": "y"
|
|
||||||
},
|
|
||||||
"H5-pc": {
|
|
||||||
"Chrome": "y",
|
|
||||||
"IE": "y",
|
|
||||||
"Edge": "y",
|
|
||||||
"Firefox": "y",
|
|
||||||
"Safari": "y"
|
|
||||||
},
|
|
||||||
"小程序": {
|
|
||||||
"微信": "y",
|
|
||||||
"阿里": "y",
|
|
||||||
"百度": "y",
|
|
||||||
"字节跳动": "y",
|
|
||||||
"QQ": "y"
|
|
||||||
},
|
|
||||||
"快应用": {
|
|
||||||
"华为": "u",
|
|
||||||
"联盟": "u"
|
|
||||||
},
|
|
||||||
"Vue": {
|
|
||||||
"vue2": "y",
|
|
||||||
"vue3": "y"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,90 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "uni-card",
|
|
||||||
"displayName": "uni-card 卡片",
|
|
||||||
"version": "1.3.1",
|
|
||||||
"description": "Card 组件,提供常见的卡片样式。",
|
|
||||||
"keywords": [
|
|
||||||
"uni-ui",
|
|
||||||
"uniui",
|
|
||||||
"card",
|
|
||||||
"",
|
|
||||||
"卡片"
|
|
||||||
],
|
|
||||||
"repository": "https://github.com/dcloudio/uni-ui",
|
|
||||||
"engines": {
|
|
||||||
"HBuilderX": ""
|
|
||||||
},
|
|
||||||
"directories": {
|
|
||||||
"example": "../../temps/example_temps"
|
|
||||||
},
|
|
||||||
"dcloudext": {
|
|
||||||
"category": [
|
|
||||||
"前端组件",
|
|
||||||
"通用组件"
|
|
||||||
],
|
|
||||||
"sale": {
|
|
||||||
"regular": {
|
|
||||||
"price": "0.00"
|
|
||||||
},
|
|
||||||
"sourcecode": {
|
|
||||||
"price": "0.00"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"contact": {
|
|
||||||
"qq": ""
|
|
||||||
},
|
|
||||||
"declaration": {
|
|
||||||
"ads": "无",
|
|
||||||
"data": "无",
|
|
||||||
"permissions": "无"
|
|
||||||
},
|
|
||||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
|
||||||
},
|
|
||||||
"uni_modules": {
|
|
||||||
"dependencies": [
|
|
||||||
"uni-icons",
|
|
||||||
"uni-scss"
|
|
||||||
],
|
|
||||||
"encrypt": [],
|
|
||||||
"platforms": {
|
|
||||||
"cloud": {
|
|
||||||
"tcb": "y",
|
|
||||||
"aliyun": "y"
|
|
||||||
},
|
|
||||||
"client": {
|
|
||||||
"App": {
|
|
||||||
"app-vue": "y",
|
|
||||||
"app-nvue": "y"
|
|
||||||
},
|
|
||||||
"H5-mobile": {
|
|
||||||
"Safari": "y",
|
|
||||||
"Android Browser": "y",
|
|
||||||
"微信浏览器(Android)": "y",
|
|
||||||
"QQ浏览器(Android)": "y"
|
|
||||||
},
|
|
||||||
"H5-pc": {
|
|
||||||
"Chrome": "y",
|
|
||||||
"IE": "y",
|
|
||||||
"Edge": "y",
|
|
||||||
"Firefox": "y",
|
|
||||||
"Safari": "y"
|
|
||||||
},
|
|
||||||
"小程序": {
|
|
||||||
"微信": "y",
|
|
||||||
"阿里": "y",
|
|
||||||
"百度": "y",
|
|
||||||
"字节跳动": "y",
|
|
||||||
"QQ": "y"
|
|
||||||
},
|
|
||||||
"快应用": {
|
|
||||||
"华为": "u",
|
|
||||||
"联盟": "u"
|
|
||||||
},
|
|
||||||
"Vue": {
|
|
||||||
"vue2": "y",
|
|
||||||
"vue3": "y"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,89 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "uni-collapse",
|
|
||||||
"displayName": "uni-collapse 折叠面板",
|
|
||||||
"version": "1.4.3",
|
|
||||||
"description": "Collapse 组件,可以折叠 / 展开的内容区域。",
|
|
||||||
"keywords": [
|
|
||||||
"uni-ui",
|
|
||||||
"折叠",
|
|
||||||
"折叠面板",
|
|
||||||
"手风琴"
|
|
||||||
],
|
|
||||||
"repository": "https://github.com/dcloudio/uni-ui",
|
|
||||||
"engines": {
|
|
||||||
"HBuilderX": ""
|
|
||||||
},
|
|
||||||
"directories": {
|
|
||||||
"example": "../../temps/example_temps"
|
|
||||||
},
|
|
||||||
"dcloudext": {
|
|
||||||
"category": [
|
|
||||||
"前端组件",
|
|
||||||
"通用组件"
|
|
||||||
],
|
|
||||||
"sale": {
|
|
||||||
"regular": {
|
|
||||||
"price": "0.00"
|
|
||||||
},
|
|
||||||
"sourcecode": {
|
|
||||||
"price": "0.00"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"contact": {
|
|
||||||
"qq": ""
|
|
||||||
},
|
|
||||||
"declaration": {
|
|
||||||
"ads": "无",
|
|
||||||
"data": "无",
|
|
||||||
"permissions": "无"
|
|
||||||
},
|
|
||||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
|
||||||
},
|
|
||||||
"uni_modules": {
|
|
||||||
"dependencies": [
|
|
||||||
"uni-scss",
|
|
||||||
"uni-icons"
|
|
||||||
],
|
|
||||||
"encrypt": [],
|
|
||||||
"platforms": {
|
|
||||||
"cloud": {
|
|
||||||
"tcb": "y",
|
|
||||||
"aliyun": "y"
|
|
||||||
},
|
|
||||||
"client": {
|
|
||||||
"App": {
|
|
||||||
"app-vue": "y",
|
|
||||||
"app-nvue": "y"
|
|
||||||
},
|
|
||||||
"H5-mobile": {
|
|
||||||
"Safari": "y",
|
|
||||||
"Android Browser": "y",
|
|
||||||
"微信浏览器(Android)": "y",
|
|
||||||
"QQ浏览器(Android)": "y"
|
|
||||||
},
|
|
||||||
"H5-pc": {
|
|
||||||
"Chrome": "y",
|
|
||||||
"IE": "y",
|
|
||||||
"Edge": "y",
|
|
||||||
"Firefox": "y",
|
|
||||||
"Safari": "y"
|
|
||||||
},
|
|
||||||
"小程序": {
|
|
||||||
"微信": "y",
|
|
||||||
"阿里": "y",
|
|
||||||
"百度": "y",
|
|
||||||
"字节跳动": "y",
|
|
||||||
"QQ": "y"
|
|
||||||
},
|
|
||||||
"快应用": {
|
|
||||||
"华为": "u",
|
|
||||||
"联盟": "u"
|
|
||||||
},
|
|
||||||
"Vue": {
|
|
||||||
"vue2": "y",
|
|
||||||
"vue3": "y"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,275 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="uni-combox" :class="border ? '' : 'uni-combox__no-border'">
|
|
||||||
<view v-if="label" class="uni-combox__label" :style="labelStyle">
|
|
||||||
<text>{{label}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="uni-combox__input-box">
|
|
||||||
<input class="uni-combox__input" type="text" :placeholder="placeholder"
|
|
||||||
placeholder-class="uni-combox__input-plac" v-model="inputVal" @input="onInput" @focus="onFocus"
|
|
||||||
@blur="onBlur" />
|
|
||||||
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" @click="toggleSelector">
|
|
||||||
</uni-icons>
|
|
||||||
</view>
|
|
||||||
<view class="uni-combox__selector" v-if="showSelector">
|
|
||||||
<view class="uni-popper__arrow"></view>
|
|
||||||
<scroll-view scroll-y="true" class="uni-combox__selector-scroll">
|
|
||||||
<view class="uni-combox__selector-empty" v-if="filterCandidatesLength === 0">
|
|
||||||
<text>{{emptyTips}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="uni-combox__selector-item" v-for="(item,index) in filterCandidates" :key="index"
|
|
||||||
@click="onSelectorClick(index)">
|
|
||||||
<text>{{item}}</text>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
/**
|
|
||||||
* Combox 组合输入框
|
|
||||||
* @description 组合输入框一般用于既可以输入也可以选择的场景
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=1261
|
|
||||||
* @property {String} label 左侧文字
|
|
||||||
* @property {String} labelWidth 左侧内容宽度
|
|
||||||
* @property {String} placeholder 输入框占位符
|
|
||||||
* @property {Array} candidates 候选项列表
|
|
||||||
* @property {String} emptyTips 筛选结果为空时显示的文字
|
|
||||||
* @property {String} value 组合框的值
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: 'uniCombox',
|
|
||||||
emits: ['input', 'update:modelValue'],
|
|
||||||
props: {
|
|
||||||
border: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
label: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
labelWidth: {
|
|
||||||
type: String,
|
|
||||||
default: 'auto'
|
|
||||||
},
|
|
||||||
placeholder: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
candidates: {
|
|
||||||
type: Array,
|
|
||||||
default () {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
emptyTips: {
|
|
||||||
type: String,
|
|
||||||
default: '无匹配项'
|
|
||||||
},
|
|
||||||
// #ifndef VUE3
|
|
||||||
value: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
// #ifdef VUE3
|
|
||||||
modelValue: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
showSelector: false,
|
|
||||||
inputVal: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
labelStyle() {
|
|
||||||
if (this.labelWidth === 'auto') {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return `width: ${this.labelWidth}`
|
|
||||||
},
|
|
||||||
filterCandidates() {
|
|
||||||
return this.candidates.filter((item) => {
|
|
||||||
return item.toString().indexOf(this.inputVal) > -1
|
|
||||||
})
|
|
||||||
},
|
|
||||||
filterCandidatesLength() {
|
|
||||||
return this.filterCandidates.length
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
// #ifndef VUE3
|
|
||||||
value: {
|
|
||||||
handler(newVal) {
|
|
||||||
this.inputVal = newVal
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
// #ifdef VUE3
|
|
||||||
modelValue: {
|
|
||||||
handler(newVal) {
|
|
||||||
this.inputVal = newVal
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toggleSelector() {
|
|
||||||
this.showSelector = !this.showSelector
|
|
||||||
},
|
|
||||||
onFocus() {
|
|
||||||
this.showSelector = true
|
|
||||||
},
|
|
||||||
onBlur() {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.showSelector = false
|
|
||||||
}, 153)
|
|
||||||
},
|
|
||||||
onSelectorClick(index) {
|
|
||||||
this.inputVal = this.filterCandidates[index]
|
|
||||||
this.showSelector = false
|
|
||||||
this.$emit('input', this.inputVal)
|
|
||||||
this.$emit('update:modelValue', this.inputVal)
|
|
||||||
},
|
|
||||||
onInput() {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.$emit('input', this.inputVal)
|
|
||||||
this.$emit('update:modelValue', this.inputVal)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" >
|
|
||||||
.uni-combox {
|
|
||||||
font-size: 14px;
|
|
||||||
border: 1px solid #DCDFE6;
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 6px 10px;
|
|
||||||
position: relative;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
// height: 40px;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
// border-bottom: solid 1px #DDDDDD;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-combox__label {
|
|
||||||
font-size: 16px;
|
|
||||||
line-height: 22px;
|
|
||||||
padding-right: 10px;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-combox__input-box {
|
|
||||||
position: relative;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex: 1;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-combox__input {
|
|
||||||
flex: 1;
|
|
||||||
font-size: 14px;
|
|
||||||
height: 22px;
|
|
||||||
line-height: 22px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-combox__input-plac {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-combox__selector {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* #endif */
|
|
||||||
position: absolute;
|
|
||||||
top: calc(100% + 12px);
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
border: 1px solid #EBEEF5;
|
|
||||||
border-radius: 6px;
|
|
||||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
||||||
z-index: 2;
|
|
||||||
padding: 4px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-combox__selector-scroll {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
max-height: 200px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-combox__selector-empty,
|
|
||||||
.uni-combox__selector-item {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
cursor: pointer;
|
|
||||||
/* #endif */
|
|
||||||
line-height: 36px;
|
|
||||||
font-size: 14px;
|
|
||||||
text-align: center;
|
|
||||||
// border-bottom: solid 1px #DDDDDD;
|
|
||||||
padding: 0px 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-combox__selector-item:hover {
|
|
||||||
background-color: #f9f9f9;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-combox__selector-empty:last-child,
|
|
||||||
.uni-combox__selector-item:last-child {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
border-bottom: none;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
// picker 弹出层通用的指示小三角
|
|
||||||
.uni-popper__arrow,
|
|
||||||
.uni-popper__arrow::after {
|
|
||||||
position: absolute;
|
|
||||||
display: block;
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
border-color: transparent;
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popper__arrow {
|
|
||||||
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
|
||||||
top: -6px;
|
|
||||||
left: 10%;
|
|
||||||
margin-right: 3px;
|
|
||||||
border-top-width: 0;
|
|
||||||
border-bottom-color: #EBEEF5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popper__arrow::after {
|
|
||||||
content: " ";
|
|
||||||
top: 1px;
|
|
||||||
margin-left: -6px;
|
|
||||||
border-top-width: 0;
|
|
||||||
border-bottom-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-combox__no-border {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,90 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "uni-combox",
|
|
||||||
"displayName": "uni-combox 组合框",
|
|
||||||
"version": "1.0.1",
|
|
||||||
"description": "可以选择也可以输入的表单项 ",
|
|
||||||
"keywords": [
|
|
||||||
"uni-ui",
|
|
||||||
"uniui",
|
|
||||||
"combox",
|
|
||||||
"组合框",
|
|
||||||
"select"
|
|
||||||
],
|
|
||||||
"repository": "https://github.com/dcloudio/uni-ui",
|
|
||||||
"engines": {
|
|
||||||
"HBuilderX": ""
|
|
||||||
},
|
|
||||||
"directories": {
|
|
||||||
"example": "../../temps/example_temps"
|
|
||||||
},
|
|
||||||
"dcloudext": {
|
|
||||||
"category": [
|
|
||||||
"前端组件",
|
|
||||||
"通用组件"
|
|
||||||
],
|
|
||||||
"sale": {
|
|
||||||
"regular": {
|
|
||||||
"price": "0.00"
|
|
||||||
},
|
|
||||||
"sourcecode": {
|
|
||||||
"price": "0.00"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"contact": {
|
|
||||||
"qq": ""
|
|
||||||
},
|
|
||||||
"declaration": {
|
|
||||||
"ads": "无",
|
|
||||||
"data": "无",
|
|
||||||
"permissions": "无"
|
|
||||||
},
|
|
||||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
|
||||||
},
|
|
||||||
"uni_modules": {
|
|
||||||
"dependencies": [
|
|
||||||
"uni-scss",
|
|
||||||
"uni-icons"
|
|
||||||
],
|
|
||||||
"encrypt": [],
|
|
||||||
"platforms": {
|
|
||||||
"cloud": {
|
|
||||||
"tcb": "y",
|
|
||||||
"aliyun": "y"
|
|
||||||
},
|
|
||||||
"client": {
|
|
||||||
"App": {
|
|
||||||
"app-vue": "y",
|
|
||||||
"app-nvue": "n"
|
|
||||||
},
|
|
||||||
"H5-mobile": {
|
|
||||||
"Safari": "y",
|
|
||||||
"Android Browser": "y",
|
|
||||||
"微信浏览器(Android)": "y",
|
|
||||||
"QQ浏览器(Android)": "y"
|
|
||||||
},
|
|
||||||
"H5-pc": {
|
|
||||||
"Chrome": "y",
|
|
||||||
"IE": "y",
|
|
||||||
"Edge": "y",
|
|
||||||
"Firefox": "y",
|
|
||||||
"Safari": "y"
|
|
||||||
},
|
|
||||||
"小程序": {
|
|
||||||
"微信": "y",
|
|
||||||
"阿里": "y",
|
|
||||||
"百度": "y",
|
|
||||||
"字节跳动": "y",
|
|
||||||
"QQ": "y"
|
|
||||||
},
|
|
||||||
"快应用": {
|
|
||||||
"华为": "u",
|
|
||||||
"联盟": "u"
|
|
||||||
},
|
|
||||||
"Vue": {
|
|
||||||
"vue2": "y",
|
|
||||||
"vue3": "y"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"uni-countdown.day": "day",
|
|
||||||
"uni-countdown.h": "h",
|
|
||||||
"uni-countdown.m": "m",
|
|
||||||
"uni-countdown.s": "s"
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
import en from './en.json'
|
|
||||||
import zhHans from './zh-Hans.json'
|
|
||||||
import zhHant from './zh-Hant.json'
|
|
||||||
export default {
|
|
||||||
en,
|
|
||||||
'zh-Hans': zhHans,
|
|
||||||
'zh-Hant': zhHant
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"uni-countdown.day": "天",
|
|
||||||
"uni-countdown.h": "时",
|
|
||||||
"uni-countdown.m": "分",
|
|
||||||
"uni-countdown.s": "秒"
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"uni-countdown.day": "天",
|
|
||||||
"uni-countdown.h": "時",
|
|
||||||
"uni-countdown.m": "分",
|
|
||||||
"uni-countdown.s": "秒"
|
|
||||||
}
|
|
||||||
@ -1,271 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="uni-countdown">
|
|
||||||
<text v-if="showDay" :style="[timeStyle]" class="uni-countdown__number">{{ d }}</text>
|
|
||||||
<text v-if="showDay" :style="[splitorStyle]" class="uni-countdown__splitor">{{dayText}}</text>
|
|
||||||
<text :style="[timeStyle]" class="uni-countdown__number">{{ h }}</text>
|
|
||||||
<text :style="[splitorStyle]" class="uni-countdown__splitor">{{ showColon ? ':' : hourText }}</text>
|
|
||||||
<text :style="[timeStyle]" class="uni-countdown__number">{{ i }}</text>
|
|
||||||
<text :style="[splitorStyle]" class="uni-countdown__splitor">{{ showColon ? ':' : minuteText }}</text>
|
|
||||||
<text :style="[timeStyle]" class="uni-countdown__number">{{ s }}</text>
|
|
||||||
<text v-if="!showColon" :style="[splitorStyle]" class="uni-countdown__splitor">{{secondText}}</text>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
initVueI18n
|
|
||||||
} from '@dcloudio/uni-i18n'
|
|
||||||
import messages from './i18n/index.js'
|
|
||||||
const {
|
|
||||||
t
|
|
||||||
} = initVueI18n(messages)
|
|
||||||
/**
|
|
||||||
* Countdown 倒计时
|
|
||||||
* @description 倒计时组件
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=25
|
|
||||||
* @property {String} backgroundColor 背景色
|
|
||||||
* @property {String} color 文字颜色
|
|
||||||
* @property {Number} day 天数
|
|
||||||
* @property {Number} hour 小时
|
|
||||||
* @property {Number} minute 分钟
|
|
||||||
* @property {Number} second 秒
|
|
||||||
* @property {Number} timestamp 时间戳
|
|
||||||
* @property {Boolean} showDay = [true|false] 是否显示天数
|
|
||||||
* @property {Boolean} show-colon = [true|false] 是否以冒号为分隔符
|
|
||||||
* @property {String} splitorColor 分割符号颜色
|
|
||||||
* @event {Function} timeup 倒计时时间到触发事件
|
|
||||||
* @example <uni-countdown :day="1" :hour="1" :minute="12" :second="40"></uni-countdown>
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: 'UniCountdown',
|
|
||||||
emits: ['timeup'],
|
|
||||||
props: {
|
|
||||||
showDay: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
showColon: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
start: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
backgroundColor: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
color: {
|
|
||||||
type: String,
|
|
||||||
default: '#333'
|
|
||||||
},
|
|
||||||
fontSize: {
|
|
||||||
type: Number,
|
|
||||||
default: 14
|
|
||||||
},
|
|
||||||
splitorColor: {
|
|
||||||
type: String,
|
|
||||||
default: '#333'
|
|
||||||
},
|
|
||||||
day: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
hour: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
minute: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
second: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
timestamp: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
timer: null,
|
|
||||||
syncFlag: false,
|
|
||||||
d: '00',
|
|
||||||
h: '00',
|
|
||||||
i: '00',
|
|
||||||
s: '00',
|
|
||||||
leftTime: 0,
|
|
||||||
seconds: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
dayText() {
|
|
||||||
return t("uni-countdown.day")
|
|
||||||
},
|
|
||||||
hourText(val) {
|
|
||||||
return t("uni-countdown.h")
|
|
||||||
},
|
|
||||||
minuteText(val) {
|
|
||||||
return t("uni-countdown.m")
|
|
||||||
},
|
|
||||||
secondText(val) {
|
|
||||||
return t("uni-countdown.s")
|
|
||||||
},
|
|
||||||
timeStyle() {
|
|
||||||
const {
|
|
||||||
color,
|
|
||||||
backgroundColor,
|
|
||||||
fontSize
|
|
||||||
} = this
|
|
||||||
return {
|
|
||||||
color,
|
|
||||||
backgroundColor,
|
|
||||||
fontSize: `${fontSize}px`,
|
|
||||||
width: `${fontSize * 22 / 14}px`, // 按字体大小为 14px 时的比例缩放
|
|
||||||
lineHeight: `${fontSize * 20 / 14}px`,
|
|
||||||
borderRadius: `${fontSize * 3 / 14}px`,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
splitorStyle() {
|
|
||||||
const { splitorColor, fontSize, backgroundColor } = this
|
|
||||||
return {
|
|
||||||
color: splitorColor,
|
|
||||||
fontSize: `${fontSize * 12 / 14}px`,
|
|
||||||
margin: backgroundColor ? `${fontSize * 4 / 14}px` : ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
day(val) {
|
|
||||||
this.changeFlag()
|
|
||||||
},
|
|
||||||
hour(val) {
|
|
||||||
this.changeFlag()
|
|
||||||
},
|
|
||||||
minute(val) {
|
|
||||||
this.changeFlag()
|
|
||||||
},
|
|
||||||
second(val) {
|
|
||||||
this.changeFlag()
|
|
||||||
},
|
|
||||||
start: {
|
|
||||||
immediate: true,
|
|
||||||
handler(newVal, oldVal) {
|
|
||||||
if (newVal) {
|
|
||||||
this.startData();
|
|
||||||
} else {
|
|
||||||
if (!oldVal) return
|
|
||||||
clearInterval(this.timer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created: function(e) {
|
|
||||||
this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
|
|
||||||
this.countDown()
|
|
||||||
},
|
|
||||||
// #ifndef VUE3
|
|
||||||
destroyed() {
|
|
||||||
clearInterval(this.timer)
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
// #ifdef VUE3
|
|
||||||
unmounted() {
|
|
||||||
clearInterval(this.timer)
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
methods: {
|
|
||||||
toSeconds(timestamp, day, hours, minutes, seconds) {
|
|
||||||
if (timestamp) {
|
|
||||||
return timestamp - parseInt(new Date().getTime() / 1000, 10)
|
|
||||||
}
|
|
||||||
return day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds
|
|
||||||
},
|
|
||||||
timeUp() {
|
|
||||||
clearInterval(this.timer)
|
|
||||||
this.$emit('timeup')
|
|
||||||
},
|
|
||||||
countDown() {
|
|
||||||
let seconds = this.seconds
|
|
||||||
let [day, hour, minute, second] = [0, 0, 0, 0]
|
|
||||||
if (seconds > 0) {
|
|
||||||
day = Math.floor(seconds / (60 * 60 * 24))
|
|
||||||
hour = Math.floor(seconds / (60 * 60)) - (day * 24)
|
|
||||||
minute = Math.floor(seconds / 60) - (day * 24 * 60) - (hour * 60)
|
|
||||||
second = Math.floor(seconds) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60)
|
|
||||||
} else {
|
|
||||||
this.timeUp()
|
|
||||||
}
|
|
||||||
if (day < 10) {
|
|
||||||
day = '0' + day
|
|
||||||
}
|
|
||||||
if (hour < 10) {
|
|
||||||
hour = '0' + hour
|
|
||||||
}
|
|
||||||
if (minute < 10) {
|
|
||||||
minute = '0' + minute
|
|
||||||
}
|
|
||||||
if (second < 10) {
|
|
||||||
second = '0' + second
|
|
||||||
}
|
|
||||||
this.d = day
|
|
||||||
this.h = hour
|
|
||||||
this.i = minute
|
|
||||||
this.s = second
|
|
||||||
},
|
|
||||||
startData() {
|
|
||||||
this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
|
|
||||||
if (this.seconds <= 0) {
|
|
||||||
this.seconds = this.toSeconds(0, 0, 0, 0, 0)
|
|
||||||
this.countDown()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
clearInterval(this.timer)
|
|
||||||
this.countDown()
|
|
||||||
this.timer = setInterval(() => {
|
|
||||||
this.seconds--
|
|
||||||
if (this.seconds < 0) {
|
|
||||||
this.timeUp()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.countDown()
|
|
||||||
}, 1000)
|
|
||||||
},
|
|
||||||
update(){
|
|
||||||
this.startData();
|
|
||||||
},
|
|
||||||
changeFlag() {
|
|
||||||
if (!this.syncFlag) {
|
|
||||||
this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
|
|
||||||
this.startData();
|
|
||||||
this.syncFlag = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
$font-size: 14px;
|
|
||||||
|
|
||||||
.uni-countdown {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
&__splitor {
|
|
||||||
margin: 0 2px;
|
|
||||||
font-size: $font-size;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__number {
|
|
||||||
border-radius: 3px;
|
|
||||||
text-align: center;
|
|
||||||
font-size: $font-size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "uni-countdown",
|
|
||||||
"displayName": "uni-countdown 倒计时",
|
|
||||||
"version": "1.2.2",
|
|
||||||
"description": "CountDown 倒计时组件",
|
|
||||||
"keywords": [
|
|
||||||
"uni-ui",
|
|
||||||
"uniui",
|
|
||||||
"countdown",
|
|
||||||
"倒计时"
|
|
||||||
],
|
|
||||||
"repository": "https://github.com/dcloudio/uni-ui",
|
|
||||||
"engines": {
|
|
||||||
"HBuilderX": ""
|
|
||||||
},
|
|
||||||
"directories": {
|
|
||||||
"example": "../../temps/example_temps"
|
|
||||||
},
|
|
||||||
"dcloudext": {
|
|
||||||
"category": [
|
|
||||||
"前端组件",
|
|
||||||
"通用组件"
|
|
||||||
],
|
|
||||||
"sale": {
|
|
||||||
"regular": {
|
|
||||||
"price": "0.00"
|
|
||||||
},
|
|
||||||
"sourcecode": {
|
|
||||||
"price": "0.00"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"contact": {
|
|
||||||
"qq": ""
|
|
||||||
},
|
|
||||||
"declaration": {
|
|
||||||
"ads": "无",
|
|
||||||
"data": "无",
|
|
||||||
"permissions": "无"
|
|
||||||
},
|
|
||||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
|
||||||
},
|
|
||||||
"uni_modules": {
|
|
||||||
"dependencies": ["uni-scss"],
|
|
||||||
"encrypt": [],
|
|
||||||
"platforms": {
|
|
||||||
"cloud": {
|
|
||||||
"tcb": "y",
|
|
||||||
"aliyun": "y"
|
|
||||||
},
|
|
||||||
"client": {
|
|
||||||
"App": {
|
|
||||||
"app-vue": "y",
|
|
||||||
"app-nvue": "y"
|
|
||||||
},
|
|
||||||
"H5-mobile": {
|
|
||||||
"Safari": "y",
|
|
||||||
"Android Browser": "y",
|
|
||||||
"微信浏览器(Android)": "y",
|
|
||||||
"QQ浏览器(Android)": "y"
|
|
||||||
},
|
|
||||||
"H5-pc": {
|
|
||||||
"Chrome": "y",
|
|
||||||
"IE": "y",
|
|
||||||
"Edge": "y",
|
|
||||||
"Firefox": "y",
|
|
||||||
"Safari": "y"
|
|
||||||
},
|
|
||||||
"小程序": {
|
|
||||||
"微信": "y",
|
|
||||||
"阿里": "y",
|
|
||||||
"百度": "y",
|
|
||||||
"字节跳动": "y",
|
|
||||||
"QQ": "y"
|
|
||||||
},
|
|
||||||
"快应用": {
|
|
||||||
"华为": "u",
|
|
||||||
"联盟": "u"
|
|
||||||
},
|
|
||||||
"Vue": {
|
|
||||||
"vue2": "y",
|
|
||||||
"vue3": "y"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||