开发手机维护工具
@ -0,0 +1,32 @@
|
||||
<script>
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
console.warn('当前组件仅支持 uni_modules 目录结构 ,请升级 HBuilderX 到 3.1.0 版本以上!')
|
||||
console.log('App Launch')
|
||||
},
|
||||
onShow: function() {
|
||||
console.log('App Show')
|
||||
},
|
||||
onHide: function() {
|
||||
console.log('App Hide')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/*每个页面公共css */
|
||||
@import '@/uni_modules/uni-scss/index.scss';
|
||||
/* #ifndef APP-NVUE */
|
||||
@import '@/static/customicons.css';
|
||||
// 设置整个项目的背景色
|
||||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
.example-info {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,49 @@
|
||||
import {
|
||||
useHttp
|
||||
} from '@/tools/http';
|
||||
const {
|
||||
isLoading,
|
||||
sendRequest
|
||||
} = useHttp();
|
||||
let Url='http://localhostcommon'
|
||||
//let Url='http://223.71.106.251:82/common/la/public';
|
||||
let BaseUrl=Url+'/api/'
|
||||
|
||||
export const BaseFileUrl=()=>{
|
||||
return Url;
|
||||
}
|
||||
//登录授权
|
||||
export const Login = (data) => {
|
||||
return sendRequest({url: BaseUrl+"admin/login",method: 'POST',data:data});
|
||||
}
|
||||
//添加会员
|
||||
export const PersonSave = (data) => {
|
||||
return sendRequest({url: BaseUrl+"v1/H5/PersonSave",method: 'POST',data:data});
|
||||
}
|
||||
//获取名下会员列表
|
||||
export const PersonGetList = (data) => {
|
||||
return sendRequest({url: BaseUrl+"v1/H5/PersonGetList",method: 'POST',data:data});
|
||||
}
|
||||
|
||||
export const PersonGetDetail = (data) => {
|
||||
return sendRequest({url: BaseUrl+"v1/H5/PersonGetDetail",method: 'POST',data:data});
|
||||
}
|
||||
export const PersonDel = (data) => {
|
||||
return sendRequest({url: BaseUrl+"v1/H5/PersonDel",method: 'POST',data:data});
|
||||
}
|
||||
|
||||
export const FenZhenGetTiJianLine = (data) => {
|
||||
return sendRequest({url: BaseUrl+"v1/H5/FenZhenGetTiJianLine",method: 'POST',data:data});
|
||||
}
|
||||
//获取会员详情
|
||||
export const MemberGetDetail = (data) => {
|
||||
return sendRequest({url: BaseUrl+"v1/H5/MemberGetDetail",method: 'POST',data:data});
|
||||
}
|
||||
//获取用户信息
|
||||
export const GetUserInfo = (data) => {
|
||||
return sendRequest({url: BaseUrl+"v1/H5/GetUserInfo",method: 'POST',data:data});
|
||||
}
|
||||
//消费
|
||||
export const MemberExpend = (data) => {
|
||||
return sendRequest({url: BaseUrl+"v1/H5/MemberExpend",method: 'POST',data:data});
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<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>
|
||||
<title></title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,25 @@
|
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
App.mpType = 'app'
|
||||
|
||||
const app = new Vue({
|
||||
...App
|
||||
})
|
||||
app.$mount()
|
||||
// #endif
|
||||
|
||||
// #ifdef VUE3
|
||||
import { createSSRApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App)
|
||||
return {
|
||||
app
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
@ -0,0 +1,65 @@
|
||||
{
|
||||
"name" : "MemberMngr",
|
||||
"appid" : "__UNI__8CD5FC5",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
/* 5+App特有相关 */
|
||||
"usingComponents" : true,
|
||||
"nvueCompiler" : "uni-app",
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
"modules" : {},
|
||||
/* 模块配置 */
|
||||
"distribute" : {
|
||||
/* 应用发布信息 */
|
||||
"android" : {
|
||||
/* 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" : {},
|
||||
/* ios打包配置 */
|
||||
"sdkConfigs" : {}
|
||||
}
|
||||
},
|
||||
/* SDK配置 */
|
||||
"quickapp" : {},
|
||||
/* 快应用特有相关 */
|
||||
"mp-weixin" : {
|
||||
/* 小程序特有相关 */
|
||||
"appid" : "",
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"usingComponents" : true
|
||||
},
|
||||
"vueVersion" : "3",
|
||||
"h5" : {
|
||||
"router" : {
|
||||
"base" : "/h5/"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
hoistPattern:
|
||||
- '*'
|
||||
hoistedDependencies:
|
||||
/@uni-ui/code-plugs/1.9.6:
|
||||
'@uni-ui/code-plugs': private
|
||||
included:
|
||||
dependencies: true
|
||||
devDependencies: true
|
||||
optionalDependencies: true
|
||||
injectedDeps: {}
|
||||
layoutVersion: 5
|
||||
nodeLinker: isolated
|
||||
packageManager: pnpm@8.14.0
|
||||
pendingBuilds: []
|
||||
prunedAt: Fri, 09 May 2025 13:23:07 GMT
|
||||
publicHoistPattern:
|
||||
- '*eslint*'
|
||||
- '*prettier*'
|
||||
registries:
|
||||
default: https://registry.npmjs.org/
|
||||
skipped: []
|
||||
storeDir: D:\.pnpm-store\v3
|
||||
virtualStoreDir: D:\Code\lanke\fenzhen\changchuntongyuan\tongyuan_fz_h5\node_modules\.pnpm
|
||||
@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "@uni-ui/code-plugs",
|
||||
"version": "1.9.6",
|
||||
"description": "条形码 二维码 js_sdk",
|
||||
"main": "dist/code.wmf.min.js",
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"dev": "rollup -c -w",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [
|
||||
"QR code",
|
||||
"barcode",
|
||||
"BarCode",
|
||||
"QRCode",
|
||||
"uni-code",
|
||||
"TS"
|
||||
],
|
||||
"author": "wmf",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.15.5",
|
||||
"@babel/preset-env": "^7.15.6",
|
||||
"@dcloudio/types": "^2.5.12",
|
||||
"rollup": "^2.57.0",
|
||||
"rollup-plugin-babel": "^4.4.0",
|
||||
"rollup-plugin-typescript2": "^0.30.0",
|
||||
"rollup-plugin-uglify": "^5.0.2",
|
||||
"typescript": "^4.4.3"
|
||||
}
|
||||
}
|
||||
108
weihu/node_modules/.pnpm/@uni-ui+code-ui@1.5.3/node_modules/@uni-ui/code-ui/common/helper.js
generated
vendored
20
weihu/node_modules/.pnpm/@uni-ui+code-ui@1.5.3/node_modules/@uni-ui/code-ui/package.json
generated
vendored
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "@uni-ui/code-ui",
|
||||
"version": "1.5.3",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "wmf",
|
||||
"license": "ISC",
|
||||
"keywords": [
|
||||
"QR code",
|
||||
"barcode",
|
||||
"BarCode",
|
||||
"QRCode",
|
||||
"uni-code"
|
||||
],
|
||||
"dependencies": {
|
||||
"@uni-ui/code-plugs": "^1.9.6"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
lockfileVersion: '6.0'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
dependencies:
|
||||
'@uni-ui/code-ui':
|
||||
specifier: ^1.5.3
|
||||
version: 1.5.3
|
||||
|
||||
packages:
|
||||
|
||||
/@uni-ui/code-plugs@1.9.6:
|
||||
resolution: {integrity: sha512-4bqP5FE3+suxZ7JxO2StJgELeYxk0iIh3HYAaEY9X8pR5/wxgv/mWXHZpv4TVvy1VewZbMIUg8Nj9l1w6htGtw==}
|
||||
dev: false
|
||||
|
||||
/@uni-ui/code-ui@1.5.3:
|
||||
resolution: {integrity: sha512-0ZoS2j7WTHl2SeV0LKIu8dtBygusXU82fgEa9GsBBT7V30nDVN3zmPEuszyYGBV62Td/WNNLTIyHIvGV4GQMGA==}
|
||||
dependencies:
|
||||
'@uni-ui/code-plugs': 1.9.6
|
||||
dev: false
|
||||
@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@uni-ui/code-ui": "^1.5.3"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,118 @@
|
||||
{
|
||||
"pages": [{
|
||||
"path" : "pages/wxLogin",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "",
|
||||
"enablePullDownRefresh" : false
|
||||
}
|
||||
},{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "会员管理",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/person_edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "用户信息",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/recharge",
|
||||
"style": {
|
||||
"navigationBarTitleText": "充值",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/expend",
|
||||
"style": {
|
||||
"navigationBarTitleText": "收费",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "用户列表",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/login",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "",
|
||||
"enablePullDownRefresh" : false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/wode",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "我的",
|
||||
"enablePullDownRefresh" : false,
|
||||
"navigationStyle": "custom"
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/fenzhen/fenzhen_paidui",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "分诊信息",
|
||||
"enablePullDownRefresh" : false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/fenzhen/map",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "",
|
||||
"enablePullDownRefresh" : false
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "会员管理",
|
||||
"navigationBarBackgroundColor": "#F8F8F8",
|
||||
"backgroundColor": "#F8F8F8",
|
||||
"app-plus": {
|
||||
"background": "#efeff4"
|
||||
}
|
||||
},
|
||||
"tabBar": {
|
||||
"backgroundColor": "#fff",
|
||||
"selectedColor": "#249EA3",
|
||||
"fontSize": "26rpx",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "/static/tabbar/index1.png",
|
||||
"selectedIconPath": "/static/tabbar/index2.png",
|
||||
"text": "首页"
|
||||
},
|
||||
|
||||
{
|
||||
"pagePath": "pages/wode",
|
||||
"iconPath": "/static/tabbar/wode1.png",
|
||||
"selectedIconPath": "/static/tabbar/wode2.png",
|
||||
"text": "我的"
|
||||
}
|
||||
]
|
||||
},
|
||||
"easycom": {
|
||||
"^w-(.*)": "@/uni_modules/wmf-code/components/w-$1/w-$1.vue"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<view style="overflow: hidden;">
|
||||
|
||||
<cover-image style="width: 100%;" :src="mapurl"></cover-image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
onMounted,
|
||||
nextTick,
|
||||
onUnmounted
|
||||
} from 'vue'
|
||||
import {
|
||||
onShow,
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
let mapurl=ref(null);
|
||||
onLoad((e)=>{
|
||||
console.log(e)
|
||||
if(e.type && e.type==1){
|
||||
mapurl.value='https://ccty-fz.sixinyun.com/map/nan.jpg'
|
||||
}
|
||||
if(e.type && e.type==2){
|
||||
mapurl.value='https://ccty-fz.sixinyun.com/map/nv.jpg'
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="top">
|
||||
<view class="top_left" @click="ToUserList('expend')">
|
||||
<view style="display: flex;margin-top: 60rpx;">
|
||||
<view>收费</view>
|
||||
<!-- <uni-icons type="wallet"
|
||||
style="color: #fff;margin-top: 4rpx;margin-left: 4rpx;" size="24"></uni-icons> -->
|
||||
</view>
|
||||
<view style="padding-top: 20rpx;text-align: center;">
|
||||
<uni-icons type="wallet" style="color: #fff;margin-top: 4rpx;margin-left: 4rpx;"
|
||||
size="99"></uni-icons>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="top_right">
|
||||
<view class="top_right1" @click="goto('/pages/user/user_add')">
|
||||
<view style="display: flex;">
|
||||
<view>新建</view>
|
||||
<!-- <uni-icons type="personadd" style="color: #fff;margin-top: 4rpx;margin-left: 4rpx;"
|
||||
size="24"></uni-icons> -->
|
||||
</view>
|
||||
<view style="text-align: center;">
|
||||
<uni-icons type="personadd" style="color: #fff;margin-top: 4rpx;margin-left: 4rpx;"
|
||||
size="60"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="top_right2" @click="ToUserList('recharge')">
|
||||
<view style="display: flex;">
|
||||
<view>充值</view>
|
||||
<!-- <uni-icons type="vip" style="color: #fff;margin-top: 4rpx;margin-left: 4rpx;"
|
||||
size="24"></uni-icons> -->
|
||||
</view>
|
||||
<view style="text-align: center;">
|
||||
<uni-icons type="vip" style="color: #fff;margin-top: 4rpx;margin-left: 4rpx;"
|
||||
size="60"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding: 15rpx;">
|
||||
<view class="title">
|
||||
<view>今日流水</view><uni-icons type="map" style="color: #00BBF9;margin-top: 2rpx;margin-left: 4rpx;"
|
||||
size="22"></uni-icons>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<uni-list>
|
||||
<view v-for="(item,index) in List" :key="index">
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="icon_chongzhi" v-if="item.type==1"
|
||||
:title="`充值${item.change_money}`" :note="item.name"
|
||||
:rightText="item.created_at.slice(-8)"></uni-list-item>
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="icon_xiaofei" v-if="item.type==2"
|
||||
:title="`${item.desc}${item.change_money}`" :note="item.name"
|
||||
:rightText="item.created_at.slice(-8)"></uni-list-item>
|
||||
</view>
|
||||
</uni-list>
|
||||
<view v-if="List.length==0" style="font-size: 28rpx;color: #ccc;text-align: center;padding-top: 20rpx;">
|
||||
今日暂无记录
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from "vue"
|
||||
import {
|
||||
|
||||
} from "@/api"
|
||||
import {
|
||||
onLoad,
|
||||
onShow
|
||||
} from "@dcloudio/uni-app"
|
||||
|
||||
let icon_chongzhi = ref({
|
||||
color: '#FF8A5B',
|
||||
size: '28',
|
||||
type: 'vip'
|
||||
});
|
||||
let icon_xiaofei = ref({
|
||||
color: '#26CED0',
|
||||
size: '28',
|
||||
type: 'hand-up'
|
||||
});
|
||||
const ToUserList = (type) => {
|
||||
sessionStorage.setItem('userlist_type', type)
|
||||
uni.switchTab({
|
||||
url: '/pages/user/list'
|
||||
})
|
||||
}
|
||||
const goto = (page) => {
|
||||
uni.navigateTo({
|
||||
url: page
|
||||
})
|
||||
}
|
||||
let List = ref([]);
|
||||
const GetAccountList = () => {
|
||||
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
sessionStorage.setItem('userlist_type', '')
|
||||
GetAccountList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.container {
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.top_left {
|
||||
border: 1rpx solid #ccc;
|
||||
width: 240rpx;
|
||||
padding: 40rpx;
|
||||
border-radius: 20rpx;
|
||||
height: 400rpx;
|
||||
font-size: 50rpx;
|
||||
font-weight: 700;
|
||||
background-color: #26CED0;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.top_right {
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.top_right1 {
|
||||
border: 1rpx solid #ccc;
|
||||
width: 240rpx;
|
||||
padding: 40rpx;
|
||||
border-radius: 20rpx;
|
||||
height: 145rpx;
|
||||
font-weight: 700;
|
||||
background-color: #00BBF9;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.top_right2 {
|
||||
border: 1rpx solid #ccc;
|
||||
width: 240rpx;
|
||||
padding: 40rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-top: 28rpx;
|
||||
height: 145rpx;
|
||||
font-weight: 700;
|
||||
background-color: #FF8A5B;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 35rpx;
|
||||
font-weight: 700;
|
||||
margin-top: 10rpx;
|
||||
margin-bottom: 18rpx;
|
||||
color: #00BBF9;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
height: calc(100vh - 720rpx);
|
||||
overflow: scroll;
|
||||
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<view class="login">
|
||||
<view class="welcome">
|
||||
<view style="font-size: 50rpx;font-weight: 700;margin-bottom: 20rpx;">
|
||||
Hello!
|
||||
</view>
|
||||
<view style="font-size: 40rpx;">
|
||||
欢迎使用会员管理平台
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="login_k">
|
||||
<view class="title">用户名</view>
|
||||
|
||||
<input class="input" v-model="username" placeholder-style="color:#d7fffd;" placeholder="请输入用户名" />
|
||||
<view class="title">密码</view>
|
||||
<input class="input" v-model="password" password placeholder-style="color:#d7fffd;" placeholder="请输入密码" />
|
||||
<view>
|
||||
<checkbox-group @change="checkboxChange">
|
||||
<label >
|
||||
<checkbox value="mianmi" />7天免密登录
|
||||
</label>
|
||||
</checkbox-group>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding-left: 40rpx;padding-right: 40rpx;">
|
||||
<view class="button" @click="LoginFuc('click')">登 录</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from "vue"
|
||||
import {
|
||||
Login
|
||||
} from "@/api"
|
||||
import {
|
||||
onLoad
|
||||
} from "@dcloudio/uni-app"
|
||||
let mianmi=ref(false);
|
||||
const checkboxChange=(e)=>{
|
||||
console.log(e.detail.value[0])
|
||||
if(e.detail.value[0]=='mianmi'){
|
||||
mianmi.value=true
|
||||
}
|
||||
|
||||
}
|
||||
let username = ref('');
|
||||
let password = ref('');
|
||||
const LoginFuc = (logintype='') => {
|
||||
Login({
|
||||
username: username.value,
|
||||
password: password.value
|
||||
}).then(res => {
|
||||
if (res.data.status == 'ok') {
|
||||
console.log(66666666)
|
||||
if(mianmi.value==true && logintype=='click'){
|
||||
localStorage.setItem("username",username.value)
|
||||
localStorage.setItem("password",password.value)
|
||||
localStorage.setItem("mianmi_date",day7())
|
||||
}
|
||||
sessionStorage.setItem("access_token", res.token)
|
||||
sessionStorage.setItem("refresh_token", res.refresh_token)
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
const day7=()=>{
|
||||
const now = new Date();
|
||||
const currentTimestamp = now.getTime();
|
||||
|
||||
// 计算7天后的时间戳
|
||||
const sevenDaysLaterTimestamp = currentTimestamp + 7 * 24 * 60 * 60 * 1000;
|
||||
return sevenDaysLaterTimestamp
|
||||
}
|
||||
onLoad(()=>{
|
||||
const now = new Date();
|
||||
const currentTimestamp = now.getTime();
|
||||
if(localStorage.getItem('mianmi_date')>currentTimestamp){
|
||||
username.value=localStorage.getItem('username')
|
||||
password.value=localStorage.getItem('password')
|
||||
LoginFuc()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.login {
|
||||
background-color: aliceblue;
|
||||
padding-top: 60rpx;
|
||||
height: calc(100vh - 60rpx);
|
||||
}
|
||||
|
||||
.welcome {
|
||||
margin: 0rpx auto 100rpx 60rpx;
|
||||
color: #53cdf9;
|
||||
}
|
||||
|
||||
.login_k {
|
||||
height: 450rpx;
|
||||
background-color: #a5eaf9;
|
||||
border-radius: 30rpx;
|
||||
margin: 40rpx;
|
||||
box-shadow: 2px 2px 5px #7c9fca;
|
||||
padding: 40rpx 40rpx 0rpx 40rpx;
|
||||
}
|
||||
|
||||
.button {
|
||||
width: 100%;
|
||||
background-color: #00BBF9;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
border-radius: 50rpx;
|
||||
margin-top: 80rpx;
|
||||
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
color: #316664;
|
||||
}
|
||||
|
||||
.input {
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
border: 0rpx;
|
||||
border-bottom: 1rpx solid #fff;
|
||||
height: 80rpx;
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,184 @@
|
||||
<template>
|
||||
<view class="expend">
|
||||
<view class="top">
|
||||
<view style="display: flex;justify-content: space-between;">
|
||||
<view>
|
||||
<view class="name">{{Info.name}}</view>
|
||||
<view class="tel">{{Info.tel}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<uni-icons type="wallet" style="color: #fff;margin-top: 4rpx;margin-left: 4rpx;"
|
||||
size="70"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
style="display: flex;justify-content: space-around; margin-top: 20rpx; background-color: #fff;border-radius: 40rpx; padding: 10rpx;">
|
||||
|
||||
<view>
|
||||
<view class="info_title">
|
||||
总充值金额(真实)
|
||||
</view>
|
||||
<view class="price">{{Info.all_true_money}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="info_title" style="color: #18bc37;">
|
||||
剩余额度
|
||||
</view>
|
||||
<view class="price" style="color: #55aa00;">{{Info.amount}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding: 40rpx; margin-top: 40rpx;">
|
||||
<view class="title">收费金额</view>
|
||||
<input class="input" v-model="money" placeholder-style="color:#ccc;font-size:45rpx" type="number" placeholder="输入扣款额" />
|
||||
<view class="title">收费内容</view>
|
||||
|
||||
<view class="uni-textarea" style="border: 1px solid #ccc; border-radius: 20rpx;padding: 20rpx;margin-top: 20rpx;">
|
||||
<textarea placeholder-style="color:#ccc" v-model="desc" placeholder="服务内容" />
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="button" @click="expendFuc">收 费</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from "vue"
|
||||
import {
|
||||
MemberGetDetail,MemberExpend
|
||||
} from "@/api"
|
||||
import {
|
||||
onLoad,onShow
|
||||
} from "@dcloudio/uni-app"
|
||||
let member_id=ref(0)
|
||||
let Info=ref({});
|
||||
const GetMemberInfo=()=>{
|
||||
MemberGetDetail({member_id:member_id.value}).then(res => {
|
||||
if (res.status) {
|
||||
Info.value=res.data.info
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
let money=ref(null);
|
||||
let desc=ref('');
|
||||
const expendFuc=()=>{
|
||||
if(money.value==null){
|
||||
uni.showToast({
|
||||
title: '请输入金额',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(desc.value==''){
|
||||
uni.showToast({
|
||||
title: '请输入收费内容',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定扣款吗?',
|
||||
confirmText:'确认',
|
||||
cancelText:'取消',
|
||||
success: function (r) {
|
||||
if (r.confirm) {
|
||||
MemberExpend({member_id:member_id.value,money:money.value,desc:desc.value}).then(res => {
|
||||
if (res.status) {
|
||||
uni.showToast({
|
||||
title: '扣款成功',
|
||||
});
|
||||
uni.switchTab({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
} else if (r.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
onLoad((e)=>{
|
||||
member_id.value=e.member_id
|
||||
GetMemberInfo()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.expend {
|
||||
height: calc(100vh - 90rpx);
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.top {
|
||||
height: 240rpx;
|
||||
padding: 50rpx;
|
||||
background-color: #26CED0;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 45rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.tel {
|
||||
font-size: 30rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.info_title {
|
||||
font-size: 30rpx;
|
||||
color: #733e29
|
||||
}
|
||||
|
||||
.price {
|
||||
text-align: center;
|
||||
color: #FF8A5B;
|
||||
font-weight: 700;
|
||||
margin-top: 10rpx;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.input {
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border: 0rpx;
|
||||
border-bottom: 1rpx solid #b0e2f9;
|
||||
height: 100rpx;
|
||||
color:#FF8A5B;
|
||||
font-size: 50rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
textarea{
|
||||
color:#666;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.button {
|
||||
width: 100%;
|
||||
background-color: #26CED0;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
border-radius: 50rpx;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,294 @@
|
||||
<template>
|
||||
<view class="list_main">
|
||||
<!-- <view style="display: flex;justify-content: space-between;">
|
||||
<input class="input search_input" v-model="search" placeholder-style="color:#ccc;" placeholder="搜索" />
|
||||
<view class="search_button" @click="GetList()">搜索</view>
|
||||
</view> -->
|
||||
<view v-if="List.length>0">
|
||||
<view class="person_list_wrapper">
|
||||
<view class="person_item_wrapper" v-for="(i, k) in List" :key="k">
|
||||
<view style="display: flex;align-items: center;" @click="PersonClick(i)">
|
||||
<view class="person_avatar_wrapper">
|
||||
<image v-if="i.sex === 1" src="@/static/images/userm.png"></image>
|
||||
<image v-else src="@/static/images/userw.png"></image>
|
||||
</view>
|
||||
<view class="person_info_wrapper">
|
||||
<view class="person_text_wrapper">
|
||||
<view class="person_name_wrapper">{{ i.name }}</view>
|
||||
<view class="person_sex_wrapper">{{ i.sex === 1 ? "男" : "女" }}性</view>
|
||||
</view>
|
||||
<view class="person_idnumber_wrapper">{{ i.id_number }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="display: flex; width: 300rpx;" >
|
||||
<view class="person_type_wrapper">本人</view>
|
||||
<view style="display: flex; justify-content: end; width: 100%; padding-right: 20rpx;">
|
||||
<view class="tools_row" @click="editClickFunc(i.id)">
|
||||
<uni-icons type="compose" size="20"></uni-icons>
|
||||
<view class="tools">编辑</view>
|
||||
</view>
|
||||
<view class="tools_row" @click="delClickFunc(i.id)">
|
||||
<uni-icons type="trash" size="20"></uni-icons>
|
||||
<view class="tools">删除</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else style="font-size: 28rpx;color: #666; width: 100%; text-align: center; padding-top: 200rpx;">
|
||||
请先添加体检人
|
||||
</view>
|
||||
<view class="add_button_wrapper">
|
||||
<view class="add_button_text_wrapper" @click="addClickFunc()">添加体检人</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from "vue"
|
||||
import {
|
||||
PersonGetList,PersonDel
|
||||
} from "@/api"
|
||||
import {
|
||||
onLoad,
|
||||
onShow
|
||||
} from "@dcloudio/uni-app"
|
||||
let search = ref('');
|
||||
let List = ref([]);
|
||||
const GetList = () => {
|
||||
PersonGetList({
|
||||
search: search.value
|
||||
}).then(res => {
|
||||
if (res.status) {
|
||||
List.value = res.data.list
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
const goto = (id) => {
|
||||
let userlist_type = sessionStorage.getItem('userlist_type')
|
||||
let url = null;
|
||||
if (userlist_type == 'expend') {
|
||||
url = '/pages/user/expend?member_id=' + id
|
||||
}
|
||||
if (userlist_type == 'recharge') {
|
||||
url = '/pages/user/recharge?member_id=' + id
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
}
|
||||
const addClickFunc=()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/user/person_edit'
|
||||
})
|
||||
}
|
||||
const editClickFunc=(id)=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/user/person_edit?personid=' + id
|
||||
})
|
||||
}
|
||||
const delClickFunc=(id)=>{
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定删除吗?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
PersonDel({
|
||||
id: id
|
||||
}).then(res => {
|
||||
if (res.status) {
|
||||
GetList()
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
const PersonClick=(person)=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/fenzhen/fenzhen_paidui?id_number='+person.id_number
|
||||
})
|
||||
}
|
||||
onShow(() => {
|
||||
GetList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.list_main {
|
||||
background-color: #fafafa;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.person_list_wrapper {
|
||||
width: 750rpx;
|
||||
margin: 0 auto;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.person_item_wrapper {
|
||||
width: 690rpx;
|
||||
height: 166rpx;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04);
|
||||
border-radius: 15rpx;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 20rpx auto 0;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.person_avatar_wrapper {
|
||||
width: 105rpx;
|
||||
height: 105rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
.person_avatar_wrapper image {
|
||||
width: 105rpx;
|
||||
height: 105rpx;
|
||||
display: inline-block;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.person_info_wrapper {
|
||||
margin-left: 14rpx;
|
||||
width: 250rpx;
|
||||
}
|
||||
|
||||
.person_text_wrapper {
|
||||
display: flex;
|
||||
align-items: end;
|
||||
}
|
||||
|
||||
.person_name_wrapper {
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #0e0e0e;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.person_sex_wrapper {
|
||||
font-size: 24rpx;
|
||||
color: #9e9e9e;
|
||||
line-height: 1;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.person_idnumber_wrapper {
|
||||
font-size: 26rpx;
|
||||
color: #0e0e0e;
|
||||
line-height: 1;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.person_type_wrapper {
|
||||
position: absolute;
|
||||
width: 100rpx;
|
||||
height: 46rpx;
|
||||
background: #c0c0c0;
|
||||
border-radius: 0rpx 15rpx 0rpx 15rpx;
|
||||
right: 0;
|
||||
top: 0;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
line-height: 46rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.list_left {
|
||||
color: #333;
|
||||
width: 280rpx;
|
||||
display: flex;
|
||||
font-size: 34rpx;
|
||||
|
||||
}
|
||||
|
||||
.name {}
|
||||
|
||||
.tel {
|
||||
color: #999;
|
||||
font-size: 26rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.yue {
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
font-size: 34rpx;
|
||||
margin-left: 20rpx;
|
||||
color: #FF8A5B;
|
||||
}
|
||||
|
||||
.tags {
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
font-size: 34rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.search_input {
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
height: 80rpx;
|
||||
margin: 10rpx 0rpx 10rpx 20rpx;
|
||||
padding-left: 30rpx;
|
||||
width: 500rpx;
|
||||
}
|
||||
|
||||
.search_button {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
margin: 10rpx 20rpx 10rpx 0rpx;
|
||||
background-color: #79e8e3;
|
||||
text-align: center;
|
||||
width: 180rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.add_button_text_wrapper {
|
||||
font-size: 31rpx;
|
||||
font-weight: 500;
|
||||
color: #F6FDFD;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
.add_button_wrapper {
|
||||
position: fixed;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 1;
|
||||
width: 580rpx;
|
||||
height: 90rpx;
|
||||
background: linear-gradient(-90deg, #23D3AF, #0DC5CF);
|
||||
border-radius: 45rpx;
|
||||
bottom: 60rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
.tools{
|
||||
|
||||
font-size: 28rpx;
|
||||
width: 60rpx;
|
||||
color:#666;
|
||||
}
|
||||
.tools_row{
|
||||
margin-left: 20rpx;
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,163 @@
|
||||
<template>
|
||||
<view class="UserAdd">
|
||||
<view class="top">
|
||||
<view style="font-size: 40rpx;padding: 40rpx;">人员基本信息</view>
|
||||
<view style="text-align: center;">
|
||||
<uni-icons type="personadd" style="color: #fff;margin-top: 4rpx;margin-left: 4rpx;"
|
||||
size="80"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding: 40rpx; margin-top: 40rpx;">
|
||||
<view class="title">姓名</view>
|
||||
<input v-model="Info.name" class="input" placeholder-style="color:#ccc;" placeholder="请输入姓名" />
|
||||
<view class="title">电话</view>
|
||||
<input v-model="Info.tel" class="input" type="tel" placeholder-style="color:#ccc;" placeholder="请输入电话" />
|
||||
<view class="title">性别</view>
|
||||
<radio-group @change="SexChange" style="display: flex;margin: 40rpx 20rpx 40rpx -10rpx;">
|
||||
<label class="radio_row">
|
||||
<view>
|
||||
<radio value="1" :checked="Info.sex == '1'" />
|
||||
</view>
|
||||
<view>男</view>
|
||||
</label>
|
||||
<label class="radio_row">
|
||||
<view>
|
||||
<radio value="2" :checked="Info.sex == '2'" />
|
||||
</view>
|
||||
<view>女</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
<view class="title">证件号码</view>
|
||||
<input v-model="Info.id_number" class="input" placeholder-style="color:#ccc;" placeholder="请输入证件号码" />
|
||||
<view @click="Save()" class="button">保 存</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from "vue"
|
||||
import {
|
||||
PersonSave,
|
||||
PersonGetDetail
|
||||
} from "@/api"
|
||||
import {
|
||||
onLoad
|
||||
} from "@dcloudio/uni-app"
|
||||
let Info = ref({});
|
||||
const GetDetail=()=>{
|
||||
PersonGetDetail({
|
||||
id: Info.value.id
|
||||
}).then(res => {
|
||||
if (res.status) {
|
||||
Info.value=res.data.info
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
const Save = () => {
|
||||
if (Info.value.name == undefined) {
|
||||
uni.showToast({
|
||||
title: '姓名不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false
|
||||
}
|
||||
if (Info.value.tel == undefined) {
|
||||
uni.showToast({
|
||||
title: '电话不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false
|
||||
}
|
||||
if (Info.value.sex == undefined) {
|
||||
uni.showToast({
|
||||
title: '请选择性别',
|
||||
icon: 'none'
|
||||
});
|
||||
return false
|
||||
}
|
||||
if (Info.value.id_number == undefined) {
|
||||
uni.showToast({
|
||||
title: '请输入证件号码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false
|
||||
}
|
||||
|
||||
PersonSave({
|
||||
info: Info.value
|
||||
}).then(res => {
|
||||
if (res.status) {
|
||||
uni.showToast({
|
||||
title: res.msg
|
||||
});
|
||||
uni.redirectTo({
|
||||
url: '/pages/user/list'
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
const SexChange=(e)=>{
|
||||
Info.value.sex=e.detail.value
|
||||
}
|
||||
onLoad((e)=>{
|
||||
if(e.personid){
|
||||
Info.value.id =e.personid
|
||||
GetDetail()
|
||||
}else{
|
||||
Info.value.id = 0
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.UserAdd {
|
||||
background-color: #fff;
|
||||
height: calc(100vh);
|
||||
}
|
||||
|
||||
.top {
|
||||
height: 180rpx;
|
||||
background-color: #53cdf9;
|
||||
padding-top: 110rpx;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.input {
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
border: 0rpx;
|
||||
border-bottom: 1rpx solid #b0e2f9;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.button {
|
||||
width: 100%;
|
||||
background-color: #00BBF9;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
border-radius: 50rpx;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
.radio_row{
|
||||
display: flex;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<view class="page_wode">
|
||||
<view class="top" >
|
||||
<view style="display: flex;padding: 30rpx;">
|
||||
<view class="heade_img">
|
||||
<uni-icons type="person-filled" style="color: #39aba7;margin-top: 4rpx;margin-left: 4rpx;"
|
||||
size="50"></uni-icons>
|
||||
</view>
|
||||
<view style="margin-left: 10rpx;">
|
||||
<view class="name">{{Info.cn_name}}</view>
|
||||
<view class="zhuce">陪伴时长:{{Info.days}}天</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
<view style="padding-left: 40rpx;padding-right: 40rpx;">
|
||||
<view class="button" @click="Logout()">退出登录</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from "vue"
|
||||
import {
|
||||
GetUserInfo
|
||||
} from "@/api"
|
||||
import {
|
||||
onShow
|
||||
} from "@dcloudio/uni-app"
|
||||
const Logout=()=>{
|
||||
localStorage.clear();
|
||||
sessionStorage.clear();
|
||||
uni.reLaunch({
|
||||
url:'/pages/login'
|
||||
})
|
||||
}
|
||||
let Info=ref({});
|
||||
const GetMemberInfoFuc=()=>{
|
||||
GetUserInfo().then(res => {
|
||||
if (res.status) {
|
||||
Info.value=res.data.info
|
||||
}
|
||||
})
|
||||
}
|
||||
onShow(() => {
|
||||
sessionStorage.setItem('userlist_type','')
|
||||
GetMemberInfoFuc()
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page_wode {
|
||||
|
||||
background-color: #fff;
|
||||
|
||||
height: calc(100vh - 100rpx);
|
||||
}
|
||||
.top{
|
||||
|
||||
background-color: #4ed1e5;
|
||||
|
||||
}
|
||||
.heade_img{
|
||||
border-radius: 50%;
|
||||
height: 100rpx;
|
||||
width: 100rpx;
|
||||
border: 1px solid #c0e4e5;
|
||||
text-align: center;padding-right: 4rpx;
|
||||
}
|
||||
.name{
|
||||
color: #fff;
|
||||
font-family: 700;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
.zhuce{
|
||||
color: #fff;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.button{
|
||||
width: 100%;
|
||||
background-color: #ff5f37;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
border-radius: 50rpx;
|
||||
margin-top:40rpx;
|
||||
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from "vue"
|
||||
|
||||
import {
|
||||
WXGetOpenid
|
||||
} from "@/api"
|
||||
import {
|
||||
onLoad
|
||||
} from "@dcloudio/uni-app"
|
||||
let code=ref('')
|
||||
const WXGetOpenidFuc = () => {
|
||||
WXGetOpenid({code:code.value}).then(res => {
|
||||
if (res.status) {
|
||||
sessionStorage.setItem("access_token", res.data.token)
|
||||
sessionStorage.setItem("refresh_token", res.data.refresh_token)
|
||||
uni.reLaunch({
|
||||
url:'/pages/user/list'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
onLoad((option) => {
|
||||
code.value=option.code
|
||||
WXGetOpenidFuc()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@ -0,0 +1,22 @@
|
||||
lockfileVersion: '6.0'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
dependencies:
|
||||
'@uni-ui/code-ui':
|
||||
specifier: ^1.5.3
|
||||
version: 1.5.3
|
||||
|
||||
packages:
|
||||
|
||||
/@uni-ui/code-plugs@1.9.6:
|
||||
resolution: {integrity: sha512-4bqP5FE3+suxZ7JxO2StJgELeYxk0iIh3HYAaEY9X8pR5/wxgv/mWXHZpv4TVvy1VewZbMIUg8Nj9l1w6htGtw==}
|
||||
dev: false
|
||||
|
||||
/@uni-ui/code-ui@1.5.3:
|
||||
resolution: {integrity: sha512-0ZoS2j7WTHl2SeV0LKIu8dtBygusXU82fgEa9GsBBT7V30nDVN3zmPEuszyYGBV62Td/WNNLTIyHIvGV4GQMGA==}
|
||||
dependencies:
|
||||
'@uni-ui/code-plugs': 1.9.6
|
||||
dev: false
|
||||
|
After Width: | Height: | Size: 401 B |
|
After Width: | Height: | Size: 470 B |
|
After Width: | Height: | Size: 511 B |
|
After Width: | Height: | Size: 476 B |
|
After Width: | Height: | Size: 472 B |
|
After Width: | Height: | Size: 545 B |
|
After Width: | Height: | Size: 365 B |
|
After Width: | Height: | Size: 587 B |
|
After Width: | Height: | Size: 565 B |
@ -0,0 +1,20 @@
|
||||
@font-face {
|
||||
font-family: "customicons"; /* Project id 2878519 */
|
||||
src:url('/static/customicons.ttf') format('truetype');
|
||||
}
|
||||
|
||||
.customicons {
|
||||
font-family: "customicons" !important;
|
||||
}
|
||||
|
||||
.youxi:before {
|
||||
content: "\e60e";
|
||||
}
|
||||
|
||||
.wenjian:before {
|
||||
content: "\e60f";
|
||||
}
|
||||
|
||||
.zhuanfa:before {
|
||||
content: "\e610";
|
||||
}
|
||||
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 497 B |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
@ -0,0 +1,80 @@
|
||||
// http.js
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
// 封装请求拦截器
|
||||
function requestInterceptor(options) {
|
||||
|
||||
// 在请求发送之前做一些处理
|
||||
// 比如添加请求头、修改请求参数等
|
||||
options.header = {
|
||||
'Authorization': 'Bearer ' + sessionStorage.getItem("access_token"), // 假设需要添加 token
|
||||
'Content-Type': 'application/json' // 设置请求头
|
||||
};
|
||||
return options;
|
||||
}
|
||||
|
||||
// 封装响应拦截器
|
||||
function responseInterceptor(response) {
|
||||
|
||||
// 对响应数据进行处理
|
||||
// 比如根据响应状态码进行不同的操作
|
||||
if (response.statusCode === 200) {
|
||||
// 请求成功
|
||||
if(response.data.status==false){
|
||||
uni.showToast({
|
||||
title: response.data.msg ,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
return response.data;
|
||||
} else {
|
||||
|
||||
// 请求失败
|
||||
uni.showToast({
|
||||
title: '请求失败,请稍后重试',
|
||||
icon: 'none'
|
||||
});
|
||||
return Promise.reject(response.data);
|
||||
}
|
||||
}
|
||||
|
||||
// 发送请求的方法,内部使用拦截器
|
||||
export function useHttp() {
|
||||
const isLoading = ref(false);
|
||||
|
||||
function sendRequest(options) {
|
||||
// 请求发送之前,先经过请求拦截器处理
|
||||
let processedOptions = requestInterceptor(options);
|
||||
|
||||
isLoading.value = true;
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask:true
|
||||
});
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
...processedOptions,
|
||||
success: (res) => {
|
||||
// 请求成功后,经过响应拦截器处理
|
||||
let processedResponse = responseInterceptor(res);
|
||||
isLoading.value = false;
|
||||
uni.hideLoading();
|
||||
resolve(processedResponse);
|
||||
},
|
||||
fail: (err) => {
|
||||
// 请求失败
|
||||
isLoading.value = false;
|
||||
uni.hideLoading();
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
isLoading,
|
||||
sendRequest
|
||||
};
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
@import '@/uni_modules/uni-scss/variables.scss';
|
||||
@ -0,0 +1,85 @@
|
||||
{
|
||||
"id": "uni-badge",
|
||||
"displayName": "uni-badge 数字角标",
|
||||
"version": "1.2.2",
|
||||
"description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。",
|
||||
"keywords": [
|
||||
"",
|
||||
"badge",
|
||||
"uni-ui",
|
||||
"uniui",
|
||||
"数字角标",
|
||||
"徽章"
|
||||
],
|
||||
"repository": "https://github.com/dcloudio/uni-ui",
|
||||
"engines": {
|
||||
"HBuilderX": ""
|
||||
},
|
||||
"directories": {
|
||||
"example": "../../temps/example_temps"
|
||||
},
|
||||
"dcloudext": {
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
||||
"type": "component-vue"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
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
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
{
|
||||
"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": "六"
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
{
|
||||
"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": "六"
|
||||
}
|
||||
@ -0,0 +1,187 @@
|
||||
<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 i18nMessages from './i18n/index.js'
|
||||
const { t } = initVueI18n(i18nMessages)
|
||||
|
||||
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-primary: #2979ff !default;
|
||||
.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-primary;
|
||||
}
|
||||
|
||||
.uni-calendar-item--isDay {
|
||||
background-color: $uni-primary;
|
||||
opacity: 0.8;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.uni-calendar-item--extra {
|
||||
color: $uni-color-error;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.uni-calendar-item--checked {
|
||||
background-color: $uni-primary;
|
||||
color: #fff;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.uni-calendar-item--multiple {
|
||||
background-color: $uni-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>
|
||||
@ -0,0 +1,85 @@
|
||||
{
|
||||
"id": "uni-calendar",
|
||||
"displayName": "uni-calendar 日历",
|
||||
"version": "1.4.11",
|
||||
"description": "日历组件",
|
||||
"keywords": [
|
||||
"uni-ui",
|
||||
"uniui",
|
||||
"日历",
|
||||
"",
|
||||
"打卡",
|
||||
"日历选择"
|
||||
],
|
||||
"repository": "https://github.com/dcloudio/uni-ui",
|
||||
"engines": {
|
||||
"HBuilderX": ""
|
||||
},
|
||||
"directories": {
|
||||
"example": "../../temps/example_temps"
|
||||
},
|
||||
"dcloudext": {
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
||||
"type": "component-vue"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,86 @@
|
||||
{
|
||||
"id": "uni-collapse",
|
||||
"displayName": "uni-collapse 折叠面板",
|
||||
"version": "1.4.4",
|
||||
"description": "Collapse 组件,可以折叠 / 展开的内容区域。",
|
||||
"keywords": [
|
||||
"uni-ui",
|
||||
"折叠",
|
||||
"折叠面板",
|
||||
"手风琴"
|
||||
],
|
||||
"repository": "https://github.com/dcloudio/uni-ui",
|
||||
"engines": {
|
||||
"HBuilderX": ""
|
||||
},
|
||||
"directories": {
|
||||
"example": "../../temps/example_temps"
|
||||
},
|
||||
"dcloudext": {
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
||||
"type": "component-vue"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,275 @@
|
||||
<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" scoped>
|
||||
.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>
|
||||
@ -0,0 +1,90 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
{
|
||||
"uni-countdown.day": "day",
|
||||
"uni-countdown.h": "h",
|
||||
"uni-countdown.m": "m",
|
||||
"uni-countdown.s": "s"
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
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
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
{
|
||||
"uni-countdown.day": "天",
|
||||
"uni-countdown.h": "时",
|
||||
"uni-countdown.m": "分",
|
||||
"uni-countdown.s": "秒"
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
{
|
||||
"uni-countdown.day": "天",
|
||||
"uni-countdown.h": "時",
|
||||
"uni-countdown.m": "分",
|
||||
"uni-countdown.s": "秒"
|
||||
}
|
||||
@ -0,0 +1,281 @@
|
||||
<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 v-if="showHour" :style="[timeStyle]" class="uni-countdown__number">{{ h }}</text>
|
||||
<text v-if="showHour" :style="[splitorStyle]" class="uni-countdown__splitor">{{ showColon ? ':' : hourText }}</text>
|
||||
<text v-if="showMinute" :style="[timeStyle]" class="uni-countdown__number">{{ i }}</text>
|
||||
<text v-if="showMinute" :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} showHour = [true|false] 是否显示小时
|
||||
* @property {Boolean} showMinute = [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
|
||||
},
|
||||
showHour: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
showMinute: {
|
||||
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>
|
||||
@ -0,0 +1,83 @@
|
||||
{
|
||||
"id": "uni-countdown",
|
||||
"displayName": "uni-countdown 倒计时",
|
||||
"version": "1.2.3",
|
||||
"description": "CountDown 倒计时组件",
|
||||
"keywords": [
|
||||
"uni-ui",
|
||||
"uniui",
|
||||
"countdown",
|
||||
"倒计时"
|
||||
],
|
||||
"repository": "https://github.com/dcloudio/uni-ui",
|
||||
"engines": {
|
||||
"HBuilderX": ""
|
||||
},
|
||||
"directories": {
|
||||
"example": "../../temps/example_temps"
|
||||
},
|
||||
"dcloudext": {
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
||||
"type": "component-vue"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
{
|
||||
"id": "uni-data-checkbox",
|
||||
"displayName": "uni-data-checkbox 数据选择器",
|
||||
"version": "1.0.5",
|
||||
"description": "通过数据驱动的单选框和复选框",
|
||||
"keywords": [
|
||||
"uni-ui",
|
||||
"checkbox",
|
||||
"单选",
|
||||
"多选",
|
||||
"单选多选"
|
||||
],
|
||||
"repository": "https://github.com/dcloudio/uni-ui",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.1.1"
|
||||
},
|
||||
"directories": {
|
||||
"example": "../../temps/example_temps"
|
||||
},
|
||||
"dcloudext": {
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
||||
"type": "component-vue"
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": ["uni-load-more","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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
// #ifdef H5
|
||||
export default {
|
||||
name: 'Keypress',
|
||||
props: {
|
||||
disable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
const keyNames = {
|
||||
esc: ['Esc', 'Escape'],
|
||||
tab: 'Tab',
|
||||
enter: 'Enter',
|
||||
space: [' ', 'Spacebar'],
|
||||
up: ['Up', 'ArrowUp'],
|
||||
left: ['Left', 'ArrowLeft'],
|
||||
right: ['Right', 'ArrowRight'],
|
||||
down: ['Down', 'ArrowDown'],
|
||||
delete: ['Backspace', 'Delete', 'Del']
|
||||
}
|
||||
const listener = ($event) => {
|
||||
if (this.disable) {
|
||||
return
|
||||
}
|
||||
const keyName = Object.keys(keyNames).find(key => {
|
||||
const keyName = $event.key
|
||||
const value = keyNames[key]
|
||||
return value === keyName || (Array.isArray(value) && value.includes(keyName))
|
||||
})
|
||||
if (keyName) {
|
||||
// 避免和其他按键事件冲突
|
||||
setTimeout(() => {
|
||||
this.$emit(keyName, {})
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
document.addEventListener('keyup', listener)
|
||||
this.$once('hook:beforeDestroy', () => {
|
||||
document.removeEventListener('keyup', listener)
|
||||
})
|
||||
},
|
||||
render: () => {}
|
||||
}
|
||||
// #endif
|
||||