作者 xiaoqiu

首次提交

正在显示 73 个修改的文件 包含 4481 行增加0 行删除

要显示太多修改。

为保证性能只显示 73 of 73+ 个文件。

不能预览此文件类型
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"default" :
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}
]
}
... ...
<script>
export default {
onLaunch: function() {
console.log('App Launch')
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style lang="scss">
/*每个页面公共css */
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
@import "@/uni_modules/uview-plus/index.scss";
view {
box-sizing: border-box;
}
</style>
... ...
import { http } from '@/uni_modules/uview-plus'
// 用户登录
export const userLogin = (data, config = {}) => http.post('/api/users/login', data, config)
// 用户注册
export const userReg = (data) => http.post('/api/users/register', data)
// 获取用户信息
export const getUserInfo = () => http.get('/update/getInfo', {custom: {auth: true}})
// 更新用户信息
export const updateUserInfo = (data) => http.put('/update/editInfo', data, {custom: {auth: true}})
... ...
<template>
<view class="carCard" @click="skip">
<slot name="header"></slot>
<slot name="center"></slot>
<view class="rowLine"></view>
<slot name="footer"></slot>
<view class="tip" :style="{backgroundColor: bgColor, color: fontColor}">{{ tipContent === '' ? textContent : tipContent }}</view>
</view>
</template>
<script setup>
import { computed } from 'vue';
const props = defineProps({
carInfo: {
type: Object,
require: true
},
tipContent: {
type: String,
default: ''
}
})
const emit = defineEmits(['onSkip'])
const bgColor = computed(() => {
let index = props.carInfo.status || 99
let objColor = {
0: '#D5E5FF',
1: '#DED5FF',
2: '#FFD5D5'
}
return objColor[index] || '#D5E5FF'
})
const fontColor = computed(() => {
let index = props.carInfo.status || 99
let objColor = {
0: '#3680FE',
1: '#7F36FE',
2: '#C81515'
}
return objColor[index] || '#3680FE'
})
const textContent = computed(() => {
let index = props.carInfo.status || 99
let objColor = {
0: '已提交',
1: '等待修改',
2: '已作废'
}
return objColor[index] || ''
})
const skip = () => {
emit('onSkip', props.carInfo.carId)
}
</script>
<style lang="scss" scoped>
.carCard{
position: relative;
padding: 20rpx 30rpx 34rpx;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
background: #fff;
border-radius: 20rpx;
.rowLine{
width: 100%;
height: 2rpx;
background-color: #eee;
margin: 20rpx 0;
}
.tip{
position: absolute;
top: 0;
right: 0;
width: 120rpx;
height: 40rpx;
text-align: center;
font-size: 20rpx;
line-height: 40rpx;
border-radius: 0rpx 20rpx 0rpx 20rpx;
color: #3680FE;
background-color: #D5E5FF;
}
}
</style>
\ No newline at end of file
... ...
<template>
<view class="centerLine" :style="{color: fontColor}">
<text @click="updateCarInfo">{{ leftContent }}</text>
<text class="line" :style="{backgroundColor: fontColor}"></text>
<text @click="deleteCar">{{ rightContent }}</text>
</view>
</template>
<script setup>
const props = defineProps({
fontColor: {
type: String,
default: '#3680FE'
},
leftContent: {
type: String,
default: '修改车辆信息'
},
rightContent: {
type: String,
default: '删除车辆'
},
})
// 修改车辆信息
const updateCarInfo = () => {
if(props.leftContent === '修改车辆信息') {
}
}
// 删除车辆信息
const deleteCar = () => {
if(props.rightContent === '删除车辆'){
}
}
</script>
<style lang="scss" scoped>
.centerLine{
display: flex;
align-items: center;
font-size: 20rpx;
.line{
height: 20rpx;
width: 2rpx;
margin: 0 20rpx;
}
}
</style>
\ No newline at end of file
... ...
<template>
<view class="commentCard">
<view class="u-line-1 title">客户对产品意向很高,希望价格优惠...</view>
<view class="line-row">
<view class="line-item">
<u-icon name="clock" color="#231F20" size="18"></u-icon>
<text class="content">2024-09-09</text>
</view>
<view class="line-item">
<u-icon name="order" color="#231F20" size="18"></u-icon>
<text class="content">admin</text>
</view>
</view>
</view>
</template>
<script setup>
</script>
<style lang="scss" scoped>
.commentCard{
padding: 30rpx 22rpx 40rpx;
background: #EFF1FF;
border-radius: 12rpx;
.title{
color: #3D3D3D;
font-size: 28rpx;
line-height: 38rpx;
}
.line-row{
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20rpx;
.line-item{
display: flex;
align-items: center;
.content{
color: #3D3D3D;
font-size: 24rpx;
line-height: 32rpx;
margin-left: 20rpx;
}
}
}
}
</style>
\ No newline at end of file
... ...
<template>
<view class="navTop">
<image style="width: 32rpx;" src="@/static/commonImage/big-car.png" mode="widthFix"></image>
<text class="top-text">{{ carNum }}</text>
</view>
</template>
<script setup>
defineProps({
carNum: {
type: String,
default: '桂A·66666'
}
})
</script>
<style lang="scss" scoped>
.navTop{
display: flex;
align-items: center;
gap: 20rpx;
margin-bottom: 20rpx;
.top-text{
font-weight: 500;
font-size: 28rpx;
line-height: 38rpx;
color: #3d3d3d;
}
}
</style>
\ No newline at end of file
... ...
<template>
<view class="operate">
<view class="operate_list">
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 0 }" @click="handleReturn">退回</text>
</view>
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 1 }" @click="handleInvalid">作废</text>
</view>
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 2 }" @click="handleUpdate">修改</text>
</view>
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 3 }" @click="handleCirculation">流转</text>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
const current = ref(9)
const handleReturn = () => {
current.value = 0
}
const handleInvalid = () => {
current.value = 1
}
const handleUpdate = () => {
current.value = 2
}
const handleCirculation = () => {
current.value = 3
}
</script>
<style lang="scss" scoped>
.operate{
.operate_list{
display: flex;
align-items: center;
.operate_item{
display: flex;
align-items: center;
justify-content: center;
flex: 1;
height: 40rpx;
border-right: 2rpx solid #3680FE;
&:last-child{
border-right: 0;
}
.operate_btn{
width: 100rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 24rpx;
text-align: center;
border-radius: 8rpx;
&.active{
background: #3680FE;
color: #fff;
}
}
}
}
}
</style>
\ No newline at end of file
... ...
<template>
<view class="ownerInfo">
<view class="info_item">车主:张三</view>
<view class="info_item">客户来源:客户介绍</view>
<view class="info_item">车辆类型:奔驰C级</view>
<view class="info_item">客户归属:admin</view>
<view class="info_item">下次跟进:2024-09-08</view>
<view class="info_item">创建日期:2024-09-01</view>
</view>
</template>
<script setup>
</script>
<style lang="scss" scoped>
.ownerInfo{
display: flex;
flex-wrap: wrap;
.info_item{
width: 50%;
font-size: 20rpx;
line-height: 26rpx;
color: #999;
margin-bottom: 10rpx;
}
}
</style>
\ No newline at end of file
... ...
<template>
<view class="wordInfo">
<text style="min-width: 160rpx;">车主:{{ userName }}</text>
<text>车辆类型:{{ carType }}</text>
<text class="applyTime">{{ applyTime }}</text>
</view>
</template>
<script setup>
defineProps({
carType: {
type: String,
default: ''
},
userName: {
type: String,
default: ''
},
applyTime: {
type: String,
default: ''
}
})
</script>
<style lang="scss" scoped>
.wordInfo{
position: relative;
display: flex;
align-items: center;
line-height: 26rpx;
color: #999;
font-size: 20rpx;
.applyTime{
position: absolute;
top: -20rpx;
right: 0;
}
}
</style>
\ No newline at end of file
... ...
<!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>
... ...
import App from './App'
import uviewPlus from '@/uni_modules/uview-plus'
import store from './store'
import {initRequest} from './utils/request.js'
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
initRequest(app)
app.use(uviewPlus).use(store)
return {
app
}
}
// #endif
\ No newline at end of file
... ...
{
"name" : "car-insurance",
"appid" : "__UNI__65AAA9F",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"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" : {},
/* SDK配置 */
"sdkConfigs" : {}
}
},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wx2884bf0a53ee40b3",
"setting" : {
"urlCheck" : false,
"minified" : true
},
"usingComponents" : true,
"lazyCodeLoading": "requiredComponents"
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "3"
}
... ...
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path" : "pages/login/login",
"style" :
{
"navigationBarTitleText" : "",
"navigationStyle": "custom"
}
},
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path" : "pages/my/my",
"style" :
{
"navigationBarTitleText" : "",
"navigationStyle": "custom"
}
},
{
"path" : "pages/carDetail/carDetail",
"style" :
{
"navigationBarTitleText" : "车辆信息",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path" : "pages/privacy/privacy",
"style" :
{
"navigationBarTitleText" : "车险小程序隐私政策"
}
},
{
"path" : "pages/companyHome/companyHome",
"style" :
{
"navigationBarTitleText" : "",
"navigationStyle": "custom"
}
},
{
"path" : "pages/companyMy/companyMy",
"style" :
{
"navigationBarTitleText" : "",
"navigationStyle": "custom"
}
},
{
"path" : "pages/ownerDetail/ownerDetail",
"style" :
{
"navigationBarTitleText" : "",
"navigationStyle": "custom"
}
},
{
"path" : "pages/societyHome/societyHome",
"style" :
{
"navigationBarTitleText" : "",
"navigationStyle": "custom"
}
},
{
"path" : "pages/societyMy/societyMy",
"style" :
{
"navigationBarTitleText" : "",
"navigationStyle": "custom"
}
}
],
// 底部导航管理
"tabBar": {
"color": "#707070",
"selectedColor": "#3680FE",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/index/index",
"iconPath": "static/tabbarIcon/car.png",
"selectedIconPath": "static/tabbarIcon/car-active.png",
"text": "车辆管理"
},
{
"pagePath": "pages/my/my",
"iconPath": "static/tabbarIcon/my.png",
"selectedIconPath": "static/tabbarIcon/my-active.png",
"text": "我的"
}]
},
"easycom": {
"autoscan": true,
// 注意一定要放在custom里,否则无效,https://ask.dcloud.net.cn/question/131175
"custom": {
"^u--(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
"^up-(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
"^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue"
}
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"uniIdRouter": {}
}
... ...
<template>
<view class="carDetail" :style="{height:showPicker?'100vh':'',overflow:showPicker?'hidden':''}">
<up-form :model="form" ref="uFormRef" label-width="130" :labelStyle="labelStyle">
<view class="carInfo">
<navTop carNum="桂A·66666" />
<view class="centerContent">
<view class="carBand">梅赛德斯奔驰</view>
<view class="carModel">2024 1.6L双离合变速器 两厢 双离合 舒适型 国IV 5座</view>
</view>
<view class="rowLine"></view>
<up-form-item label="上年承保公司" prop="sysDeptName">
<up-input v-model="form.sysDeptName" fontSize="28rpx" color="#999" placeholder="请输入上年承保公司" border="none" inputAlign="right" />
</up-form-item>
</view>
<!-- 车主信息 -->
<view class="carInfo">
<view class="card_title">车主信息</view>
<up-form-item label="车主姓名" prop="name">
<up-input v-model="form.name" fontSize="28rpx" color="#999" placeholder="请输入真实姓名" border="none" inputAlign="right" />
</up-form-item>
<up-form-item label="身份证号" prop="identificationNumber">
<up-input v-model="form.identificationNumber" fontSize="28rpx" color="#999" placeholder="请输入身份证号" border="none" inputAlign="right" />
</up-form-item>
</view>
<!-- 行驶信息 -->
<view class="carInfo">
<view class="card_title">行驶证信息</view>
<up-form-item label="车牌号码" prop="licensePlateNumber">
<up-input v-model="form.licensePlateNumber" fontSize="28rpx" color="#999" placeholder="请输入车牌号码" border="none" inputAlign="right" />
</up-form-item>
<up-form-item label="号牌种类" prop="lincensePlateType">
<up-input v-model="form.lincensePlateType" fontSize="28rpx" color="#999" placeholder="请选择号牌种类" :suffixIcon="icon" suffixIconStyle="font-size: 28rpx" border="none" inputAlign="right" @focus="openSelect(['黄色车牌', '绿色车牌', '白色车牌', '蓝色车牌'])" />
</up-form-item>
<up-form-item label="车架号" prop="frameNumber">
<up-input v-model="form.frameNumber" fontSize="28rpx" color="#999" placeholder="请输入车架号" border="none" inputAlign="right" />
</up-form-item>
<up-form-item label="发动机号" prop="engineNumber">
<up-input v-model="form.engineNumber" fontSize="28rpx" color="#999" placeholder="请输入发动机号" border="none" inputAlign="right" />
</up-form-item>
<up-form-item label="车辆类型" prop="vehicleType">
<up-input v-model="form.vehicleType" fontSize="28rpx" color="#999" placeholder="请选择车辆类型" :suffixIcon="icon" suffixIconStyle="font-size: 28rpx" border="none" inputAlign="right" @focus="openSelect(['小轿车', '大货车', '两厢车'])" />
</up-form-item>
<up-form-item label="车辆使用性质" prop="vehicleNature">
<up-input v-model="form.vehicleNature" fontSize="28rpx" color="#999" placeholder="请选择车辆使用性质" :suffixIcon="icon" suffixIconStyle="font-size: 28rpx" border="none" inputAlign="right" @focus="openSelect(['运营车辆', '私家车', '公务车'])" />
</up-form-item>
<up-form-item label="核定客载数(人)" prop="passengersNumber">
<up-input v-model="form.passengersNumber" fontSize="28rpx" color="#999" placeholder="请输入核载人数" border="none" inputAlign="right" />
</up-form-item>
<up-form-item label="核定载质量(千克)" prop="passengerCapacity">
<up-input v-model="form.passengerCapacity" fontSize="28rpx" color="#999" placeholder="请输入核载重量" border="none" inputAlign="right" />
</up-form-item>
<up-form-item label="排量毫升" prop="emissions">
<up-input v-model="form.emissions" fontSize="28rpx" color="#999" placeholder="请输入排放量" border="none" inputAlign="right" />
</up-form-item>
<view class="carModelBox">
<view class="model_line">
<text class="leftContent">车辆型号</text>
<up-input v-model="form.vehicleModel" fontSize="28rpx" color="#999" placeholder="请填写车辆型号" border="none" inputAlign="right" @change="getSearch" />
</view>
<up-transition :show="showList">
<view class="searchList">
<view class="searchItem">123</view>
<view class="searchItem">123</view>
<view class="searchItem">123</view>
<view class="searchItem">123</view>
</view>
</up-transition>
</view>
<up-form-item label="中文品牌" prop="vehicleBrand">
<up-input v-model="form.vehicleBrand" fontSize="28rpx" color="#999" placeholder="请选择车辆品牌" :suffixIcon="icon" suffixIconStyle="font-size: 28rpx" border="none" inputAlign="right" @focus="openSelect(['宝马', '奔驰', '劳斯莱斯'])" />
</up-form-item>
<up-form-item label="准牵引质量" prop="tractionMass">
<up-input v-model="form.tractionMass" fontSize="28rpx" color="#999" placeholder="请填写准牵引准质量" border="none" inputAlign="right" />
</up-form-item>
<up-form-item label="保险需求" prop="requirements">
<up-input v-model="form.requirements" fontSize="28rpx" color="#999" placeholder="请选择保险需求" :suffixIcon="icon" suffixIconStyle="font-size: 28rpx" border="none" inputAlign="right" @focus="openSelect(['强险', '商险'])" />
</up-form-item>
</view>
<view class="tip">请认真核实车辆信息,实际投保车辆信息以保险公司确认为准</view>
<view class="btn delBtn" @click="deleteCar">删除车辆</view>
<view class="btn confirmBtn">确认</view>
</up-form>
<up-picker :show="showPicker" :columns="columns" :closeOnClickOverlay="true" @close="onCancel" @cancel="onCancel" @confirm="showPicker = false"></up-picker>
<up-popup :show="showTip" mode="center" :safeAreaInsetBottom="false" round="20" @close="showTip = false">
<view class="notice">
<view class="notice_title">温馨提示</view>
<view class="notice_content">
本平台仅供出租租赁车辆提供登记服务
</view>
<view class="btn" @click="showTip = false">我已认真阅读并同意以上内容</view>
</view>
</up-popup>
</view>
</template>
<script setup>
import { ref } from 'vue';
import navTop from '@/components/navTop.vue';
import { onLoad } from '@dcloudio/uni-app'
const showPicker = ref(false)
const showTip = ref(true)
const columns = ref([])
const labelStyle = {
fontSize: '28rpx',
lineHeight: '38rpx',
color: '#3D3D3D'
}
const showList = ref(false)
const icon = ref('arrow-down')
const form = ref({
name: '',
identificationNumber: '',
sysDeptName: '',
licensePlateNumber: '',
lincensePlateType: '',
frameNumber: '',
engineNumber: '',
vehicleType: '',
vehicleNature: '',
passengersNumber: '',
passengerCapacity: '',
emissions: '',
vehicleModel: '',
vehicleBrand: '',
tractionMass: '',
requirements: ''
})
onLoad((options) => {
})
const getSearch = (value) => {
if(uni.$u.trim(value)){
showList.value = true
} else {
showList.value = false
}
}
const openSelect = (arr) => {
columns.value = []
columns.value.push(arr)
showPicker.value = true
icon.value = 'arrow-up'
}
const onCancel = () => {
showPicker.value = false
icon.value = 'arrow-down'
}
const deleteCar = () => {
uni.showModal({
title: '删除车辆提示',
content: '删除车辆后将无法及时收到投保方案解答与最新优惠,且无法恢复车辆信息。是否继续删除?',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
</script>
<style lang="scss" scoped>
.carDetail{
padding: 20rpx 30rpx 40rpx;
background: #F8F9FF;
.carInfo{
padding: 22rpx 30rpx;
background: #FFFFFF;
border-radius: 20rpx;
margin-bottom: 20rpx;
.card_title{
color: #3d3d3d;
font-size: 28rpx;
line-height: 38rpx;
font-weight: 500;
}
.carBand{
font-size: 24rpx;
color: #333;
margin-bottom: 10rpx;
}
.carModel{
font-size: 20rpx;
color: #999;
}
.rowLine{
width: 100%;
height: 2rpx;
background-color: #eee;
margin: 16rpx 0 20rpx;
}
}
.tip{
color: #999;
font-size: 20rpx;
line-height: 26rpx;
margin: 20px 0;
}
.btn{
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size: 28rpx;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 20rpx;
}
.delBtn{
color: #999999;
background: #FFFFFF;
margin-bottom: 20rpx;
}
.confirmBtn{
color: #fff;
background: #3680FE;
}
}
.notice{
position: relative;
width: 690rpx;
height: 360rpx;
background: #FFFFFF;
padding: 40rpx 30rpx 0;
border-radius: 20rpx;
overflow: hidden;
.notice_title{
text-align: center;
font-size: 36rpx;
line-height: 48rpx;
color: #3D3D3D;
margin-bottom: 40rpx;
}
.notice_content{
text-align: center;
font-size: 28rpx;
line-height: 38rpx;
color: #999;
}
.btn{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
line-height: 100rpx;
text-align: center;
height: 100rpx;
color: #3680FE;
font-size: 28rpx;
border-top: 2rpx solid #eee;
}
}
.carModelBox{
position: relative;
padding: 20rpx 0;
.model_line{
display: flex;
align-items: center;
.leftContent{
width: 130px;
font-size: 28rpx;
line-height: 38rpx;
color: #3d3d3d;
}
}
.searchList{
position: absolute;
bottom: 200%;
left: 0;
width: 100%;
background-color: #fff;
box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
z-index: 9;
border-radius: 20rpx;
padding: 20rpx 30rpx;
transition: all .5s;
&::after{
position: absolute;
bottom: -50rpx;
left: 20rpx;
content: '';
width: 0px;
height: 0px;
border: 30rpx solid transparent;
border-top-color: #fff;
}
}
}
</style>
... ...
<template>
<view class="company_container">
<up-navbar placeholder :leftIconSize="0" bgColor="transparent" />
<view class="work_box">
<!-- 头部导航 -->
<view class="nav_header">
<view class="nav_item" :class="{ active: expertActive === 0 }" @click="expertActive = 0">待办事项</view>
<view class="colLine"></view>
<view class="nav_item" :class="{ active: expertActive === 1 }" @click="expertActive = 1">车主信息</view>
</view>
<!-- 内容模块 -->
<view class="expert_content">
<swiper class="swiper" circular :current="expertActive" @animationfinish="toggleSwiper">
<swiper-item>
<view class="swiper-item">
<scroll-view scroll-y="true" class="scroll-history">
<view class="work_list">
<carCard v-for="carItem in carList" :key="carItem.carId" tipContent="待办" :carInfo="carItem">
<template #header>
<navTop :carNum="carItem.carNum" />
</template>
<template #center>
<wordInfo :carType="carItem.carType" :userName="carItem.name" :applyTime="carItem.createTime" />
</template>
<template #footer>
<centerLine></centerLine>
</template>
</carCard>
</view>
</scroll-view>
</view>
</swiper-item>
<swiper-item>
<view class="swiper-item">
<scroll-view scroll-y="true" class="scroll-history">
<view class="work_list">
<carCard v-for="carItem in carList" :key="carItem.carId" tipContent="查看详情" :carInfo="carItem" @onSkip="goCarDetail">
<template #header>
<navTop :carNum="carItem.carNum" />
</template>
<template #center>
<ownerInfo />
</template>
<template #footer>
<view class="delInfo">
<text @click="delOwnerInfo(carItem.carId)">删除车主信息</text>
</view>
</template>
</carCard>
</view>
</scroll-view>
</view>
</swiper-item>
</swiper>
</view>
</view>
<!-- 底部导航栏 -->
<up-tabbar
:value="useTabbar.employeeCurrent"
activeColor="#3680FE"
inactiveColor="#707070"
>
<up-tabbar-item text="主页" icon="home" badge="11"></up-tabbar-item>
<up-tabbar-item text="我的" icon="account" @click="goRouter">
<template #active-icon>
<image style="width: 48rpx;" class="u-page__item__slot-icon" src="@/static/tabbarIcon/my-active.png" mode="widthFix"></image>
</template>
<template #inactive-icon>
<image style="width: 48rpx;" class="u-page__item__slot-icon" src="@/static/tabbarIcon/my.png" mode="widthFix"></image>
</template>
</up-tabbar-item>
</up-tabbar>
</view>
</template>
<script setup>
import { ref } from 'vue';
import carCard from '@/components/carCard.vue';
import centerLine from '@/components/centerLine.vue';
import wordInfo from '@/components/wordInfo.vue';
import navTop from '@/components/navTop.vue';
import ownerInfo from '@/components/ownerInfo.vue';
import useTabbarStore from '@/store/modules/tabbar.js'
const useTabbar = useTabbarStore()
const carList = ref([
{ carId: 1, carNum: '桂A·66666', carType: '奔驰C级', name: '张三', createTime: '2024-09-08 10:12' },
{ carId: 2, carNum: '桂A·77777', carType: '奔驰C级', name: '李四', createTime: '2024-09-08 10:12' },
{ carId: 3, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 4, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 5, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 6, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 7, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 8, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 9, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 10, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 11, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
])
const expertActive = ref(0)
// 检测手机滑动
const toggleSwiper = (event) => {
expertActive.value = event.detail?.current
}
// 删除车主信息
const delOwnerInfo = (id) => {
uni.showModal({
title: '删除车主信息',
content: '是否删除车主信息,该操作不可逆?',
success: function (res) {
if (res.confirm) {
uni.$u.toast('删除成功')
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
const goRouter = (index) => {
useTabbar.employeeCurrent = index
uni.redirectTo({
url: '/pages/companyMy/companyMy'
})
}
// 车主详情
const goCarDetail = () => {
uni.navigateTo({
url: '/pages/ownerDetail/ownerDetail'
})
}
</script>
<style lang="scss" scoped>
.company_container{
width: 100%;
height: 100vh;
background: url('http://bxhd.crgx.net/profile/avatar/2024/09/25/bg-index_20240925113012A004.png') no-repeat;
background-size: 100% 100%;
overflow: hidden;
.work_box{
height: calc(100vh - 88rpx);
background-color: #F8F9FF;
.nav_header{
display: flex;
align-items: center;
width: 100%;
height: 80rpx;
background: #FFFFFF;
.nav_item{
flex: 1;
text-align: center;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
color: #999;
&.active{
font-weight: 500;
color: #333;
}
}
.colLine{
width: 2rpx;
height: 40rpx;
background: #D8D8D8;
}
}
.work_list{
padding: 20rpx 30rpx 200rpx;
display: flex;
flex-direction: column;
gap: 20rpx;
}
}
}
.delInfo{
font-size: 20rpx;
line-height: 26rpx;
color: #3680FE;
}
.scroll-history {
height: calc(100vh - 256rpx);
}
.swiper {
height: calc(100vh - 256rpx);
}
</style>
... ...
<template>
<view class="app-container">
<up-navbar placeholder :leftIconSize="0" bgColor="transparent" />
<view class="car_list">
<view class="line_title">
<text class="left_title" style="color: #fff;">我的信息</text>
<text style="color: #fff;">更新实名信息</text>
</view>
<view class="user-box">
<up-form :model="userForm" ref="userFormRef">
<up-form-item prop="name">
<up-input v-model="userForm.name" shape="circle" border="none" fontSize="28rpx" color="#bbb" :placeholderStyle="placeholderStyle" :customStyle="customStyle" placeholder="请输入真实姓名">
<template #prefix>
<image style="width: 32rpx;margin-right: 18rpx;margin-top: 10rpx;" src="@/static/commonImage/user.png" mode="widthFix"></image>
</template>
</up-input>
</up-form-item>
<up-form-item prop="identificationNumber">
<up-input v-model="userForm.identificationNumber" shape="circle" border="none" fontSize="28rpx" color="#bbb" :placeholderStyle="placeholderStyle" :customStyle="customStyle" placeholder="请输入身份证号">
<template #prefix>
<image style="width: 32rpx;margin-right: 18rpx;margin-top: 10rpx;" src="@/static/commonImage/IdCard.png" mode="widthFix"></image>
</template>
</up-input>
</up-form-item>
<up-form-item prop="phone">
<up-input v-model="userForm.phone" shape="circle" border="none" fontSize="28rpx" color="#bbb" :placeholderStyle="placeholderStyle" :customStyle="customStyle" placeholder="请输入手机号码">
<template #prefix>
<image style="width: 32rpx;margin-right: 18rpx;margin-top: 10rpx;" src="@/static/commonImage/phone.png" mode="widthFix"></image>
</template>
</up-input>
</up-form-item>
</up-form>
</view>
<view class="line_title">
<text class="left_title">状态设置</text>
</view>
<view class="status">
<view class="statusBtn" :class="{active: status === 0}" @click="status = 0">在岗</view>
<view class="statusBtn" :class="{active: status === 1}" @click="status = 1">离岗</view>
</view>
<view class="loginBtn" @click="loginOut">退出登录</view>
</view>
<!-- 底部导航栏 -->
<up-tabbar
:value="useTabbar.employeeCurrent"
activeColor="#3680FE"
inactiveColor="#707070"
>
<up-tabbar-item text="主页" icon="home" @click="goRouter"></up-tabbar-item>
<up-tabbar-item text="我的" icon="account"></up-tabbar-item>
</up-tabbar>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { onReady } from '@dcloudio/uni-app'
import useTabbarStore from '@/store/modules/tabbar.js'
const useTabbar = useTabbarStore()
const status = ref(0)
const showNotice = ref(true)
// 用户参数
const userForm = ref({
name: '',
identificationNumber: '',
phone: ''
})
const customStyle = {
height: '80rpx',
backgroundColor: '#F9F9F9',
paddingLeft: '40rpx'
}
const placeholderStyle = {
color: '#bbb',
fontSize: '28rpx'
}
// 表单引用
const userFormRef = ref(null)
// 校验规则
const rules = {
name: [
{ required: true, message: '请输入姓名', trigger: ['blur', 'change'] },
{ min: 2, max: 6, message: '名字应在2到6个字', trigger: ['blur', 'change'] },
{ validator: (rule, value, callback) => {
return uni.$u.test.chinese(value)
},
message: '请输入中文',
// 触发器可以同时用blur和change
trigger: ['change','blur'],
}
],
identificationNumber: [
{ required: true, message: '请输入身份证号', trigger: ['blur', 'change'] },
{ validator: (rule, value, callback) => {
return uni.$u.test.idCard(value)
},
message: '身份证号码不正确',
// 触发器可以同时用blur和change
trigger: ['change','blur'],
}
],
phone: [
{ required: true, message: '请输入手机号', trigger: ['blur', 'change'] },
{ validator: (rule, value, callback) => {
return uni.$u.test.mobile(value)
},
message: '手机号码不正确',
// 触发器可以同时用blur和change
trigger: ['change','blur'],
}
]
}
// 微信小程序需要在此注册校验规则
onReady(() => {
userFormRef.value.setRules(rules)
})
const loginOut = () => {
}
const goRouter = (index) => {
useTabbar.employeeCurrent = index
uni.redirectTo({
url: '/pages/companyHome/companyHome'
})
}
// 提交方法
const submit = () => {
userFormRef.value.validate().then(async valid => {
if (valid) {
uni.$u.toast('登录成功')
} else {
uni.$u.toast('校验失败')
}
}).catch(() => {
// 处理验证错误
uni.$u.toast('校验失败')
});
}
</script>
<style lang="scss" scoped>
.app-container{
width: 100%;
height: 100vh;
padding: 0 30rpx;
background: url('http://bxhd.crgx.net/profile/avatar/2024/09/25/bg-index_20240925113012A004.png') no-repeat;
background-size: 100% 100%;
overflow: hidden;
.user-box{
width: 690rpx;
padding: 40rpx 44rpx;
background-color: #fff;
z-index: 10;
margin: 0 auto 40rpx;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 40rpx;
}
// 车辆列表
.car_list{
display: flex;
flex-direction: column;
gap: 20rpx;
.line_title{
display: flex;
justify-content: space-between;
font-size: 24rpx;
color: #999;
line-height: 32rpx;
.left_title{
font-size: 32rpx;
line-height: 42rpx;
color: #333;
}
}
.car_data{
padding: 0 30rpx;
background: #FFFFFF;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 40rpx;
margin-bottom: 60rpx;
.car_item{
padding: 30rpx 0;
border-bottom: 2rpx solid #eee;
&:last-child{
border-bottom: 0;
}
}
}
.loginBtn{
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size: 28rpx;
color: #fff;
font-weight: 500;
background: #3680FE;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 40rpx;
margin-top: 40rpx;
}
}
}
.status{
display: flex;
align-items: center;
justify-content: space-between;
padding: 40rpx 46rpx;
background: #FFFFFF;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 40rpx;
.statusBtn{
width: 280rpx;
height: 80rpx;
text-align: center;
line-height: 80rpx;
color: #999;
background: #FFFFFF;
border-radius: 200rpx;
border: 2rpx solid #BBBBBB;
&.active{
color: #fff;
background: #75A8FF;
}
}
}
</style>
... ...
<template>
<view class="app-container">
<up-navbar placeholder :leftIconSize="0" bgColor="transparent" />
<view class="car_list">
<view class="title">车辆管理</view>
<carCard v-for="carItem in carList" :key="carItem.carId" :carInfo="carItem">
<template #header>
<navTop :carNum="carItem.carNum" />
</template>
<template #center>
<centerLine :leftContent="carItem.carBrand" fontColor="#999" :rightContent="carItem.address"></centerLine>
</template>
<template #footer>
<centerLine></centerLine>
</template>
</carCard>
<view class="addBtn" @click="addCarInfo">登记车辆保险信息</view>
</view>
<up-popup :show="showNotice" mode="center" :safeAreaInsetBottom="false" round="20" @close="showNotice = false">
<view class="notice">
<view class="notice_title">通知公告</view>
<view class="notice_content">
1.我是公告我是公告我是公告我是公告我是公告我是公告我是公告我是公告我是公告
2.我是公告我是公告我是公告我是公告我是公告我是公告我是公告我是公告我是公告我是公告我是公告我是公告我是公告
3.我是公告我是公告我是公告我是公告
</view>
<view class="btn" @click="showNotice = false">确认</view>
</view>
</up-popup>
</view>
</template>
<script setup>
import { ref } from 'vue'
import carCard from '@/components/carCard.vue';
import centerLine from '@/components/centerLine.vue';
import navTop from '@/components/navTop.vue';
const showNotice = ref(true)
const carList = ref([
{ carId: 1, carNum: '桂A·66666', carBrand: '梅赛德斯奔驰', address: '广西壮族自治区 南宁市 兴宁区投保', status: 0 },
{ carId: 2, carNum: '桂A·77777', carBrand: '梅赛德斯奔驰', address: '广西壮族自治区 南宁市 兴宁区投保', status: 1 },
{ carId: 3, carNum: '桂A·77777', carBrand: '梅赛德斯奔驰', address: '广西壮族自治区 南宁市 兴宁区投保', status: 2 }
])
const addCarInfo = () => {
uni.navigateTo({
url: '/pages/carDetail/carDetail'
})
}
</script>
<style lang="scss" scoped>
.app-container{
width: 100%;
height: 100vh;
padding: 0 30rpx;
background: url('http://bxhd.crgx.net/profile/avatar/2024/09/25/bg-index_20240925113012A004.png') no-repeat;
background-size: 100% 100%;
overflow: hidden;
.car_list{
display: flex;
flex-direction: column;
gap: 20rpx;
.title{
font-size: 32rpx;
line-height: 42rpx;
color: #fff;
}
.addBtn{
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size: 28rpx;
color: #3d3d3d;
font-weight: 500;
background: #FFFFFF;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 20rpx;
}
}
}
.notice{
position: relative;
width: 690rpx;
height: 600rpx;
background: #FFFFFF;
padding: 40rpx 30rpx 0;
border-radius: 20rpx;
overflow: hidden;
.notice_title{
text-align: center;
font-size: 36rpx;
line-height: 48rpx;
color: #3D3D3D;
margin-bottom: 40rpx;
}
.notice_content{
font-size: 28rpx;
line-height: 38rpx;
color: #999;
}
.btn{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
line-height: 100rpx;
text-align: center;
height: 100rpx;
color: #3680FE;
font-size: 28rpx;
border-top: 2rpx solid #eee;
}
}
</style>
... ...
<template>
<view class="login-container">
<view class="login-box">
<up-form :model="logForm" ref="logFormRef">
<up-form-item prop="name">
<up-input v-model="logForm.name" shape="circle" border="none" fontSize="28rpx" color="#bbb" :placeholderStyle="placeholderStyle" :customStyle="customStyle" placeholder="请输入真实姓名">
<template #prefix>
<image style="width: 32rpx;margin-right: 18rpx;margin-top: 10rpx;" src="@/static/commonImage/user.png" mode="widthFix"></image>
</template>
</up-input>
</up-form-item>
<up-form-item prop="identificationNumber">
<up-input v-model="logForm.identificationNumber" shape="circle" border="none" fontSize="28rpx" color="#bbb" :placeholderStyle="placeholderStyle" :customStyle="customStyle" placeholder="请输入身份证号">
<template #prefix>
<image style="width: 32rpx;margin-right: 18rpx;margin-top: 10rpx;" src="@/static/commonImage/IdCard.png" mode="widthFix"></image>
</template>
</up-input>
</up-form-item>
</up-form>
</view>
<view class="tip">
未注册或绑定该车型平台的身份证号,将帮你注册新账号,点击登录即代表你同意<text style="color: #3680FE;" @click="goPrivacy">《隐私政策》</text>
</view>
<view class="log-btn" @click="submit">登录</view>
</view>
</template>
<script setup>
import { reactive, ref } from 'vue';
import { onReady } from '@dcloudio/uni-app'
// 登录参数
const logForm = ref({
name: '',
identificationNumber: ''
})
// 表单引用
const logFormRef = ref(null)
// 校验规则
const rules = {
name: [
{ required: true, message: '请输入姓名', trigger: ['blur', 'change'] },
{ min: 2, max: 6, message: '名字应在2到6个字', trigger: ['blur', 'change'] },
{ validator: (rule, value, callback) => {
return uni.$u.test.chinese(value)
},
message: '请输入中文',
// 触发器可以同时用blur和change
trigger: ['change','blur'],
}
],
identificationNumber: [
{ required: true, message: '请输入身份证号', trigger: ['blur', 'change'] },
{ validator: (rule, value, callback) => {
return uni.$u.test.idCard(value)
},
message: '身份证号码不正确',
// 触发器可以同时用blur和change
trigger: ['change','blur'],
}
]
}
const customStyle = {
height: '80rpx',
backgroundColor: '#F9F9F9',
paddingLeft: '40rpx'
}
const placeholderStyle = {
color: '#bbb',
fontSize: '28rpx'
}
// 微信小程序需要在此注册校验规则
onReady(() => {
logFormRef.value.setRules(rules)
})
const goPrivacy = () => {
uni.navigateTo({
url: '/pages/privacy/privacy'
})
}
// 提交方法
const submit = () => {
logFormRef.value.validate().then(async valid => {
if (valid) {
uni.$u.toast('登录成功')
} else {
uni.$u.toast('校验失败')
}
}).catch(() => {
// 处理验证错误
uni.$u.toast('校验失败')
});
}
</script>
<style lang="scss" scoped>
.login-container{
width: 100%;
height: 100vh;
background: url('http://bxhd.crgx.net/profile/avatar/2024/09/25/bg-login_20240925112841A003.png') no-repeat;
background-size: 100% 100%;
overflow: hidden;
.login-box{
width: 690rpx;
padding: 40rpx 44rpx;
background-color: #fff;
z-index: 10;
margin: 442rpx auto 40rpx;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 40rpx;
.employeeStatus{
display: flex;
align-items: center;
gap: 40rpx;
margin-top: 30rpx;
.btn{
flex: 1;
height: 80rpx;
background: #FFFFFF;
border-radius: 200rpx;
border: 2rpx solid #BBBBBB;
font-size: 28rpx;
text-align: center;
line-height: 80rpx;
color: #999;
&.active{
background: #75A8FF;
color: #fff;
}
}
}
}
.tip{
color: #666;
font-size: 24rpx;
line-height: 28rpx;
padding: 0 40rpx;
margin-bottom: 20rpx;
}
.log-btn{
width: 690rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
background: #3680FE;
font-size: 28rpx;
margin: 0 auto;
color: #fff;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 200rpx;
}
}
</style>
... ...
<template>
<view class="app-container">
<up-navbar placeholder :leftIconSize="0" bgColor="transparent" />
<view class="car_list">
<view class="line_title">
<text class="left_title" style="color: #fff;">我的信息</text>
<text style="color: #fff;">去实名认证</text>
</view>
<view class="user-box">
<up-form :model="userForm" ref="userFormRef">
<up-form-item prop="name">
<up-input v-model="userForm.name" shape="circle" border="none" fontSize="28rpx" color="#bbb" :placeholderStyle="placeholderStyle" :customStyle="customStyle" placeholder="请输入真实姓名">
<template #prefix>
<image style="width: 32rpx;margin-right: 18rpx;margin-top: 10rpx;" src="@/static/commonImage/user.png" mode="widthFix"></image>
</template>
</up-input>
</up-form-item>
<up-form-item prop="identificationNumber">
<up-input v-model="userForm.identificationNumber" shape="circle" border="none" fontSize="28rpx" color="#bbb" :placeholderStyle="placeholderStyle" :customStyle="customStyle" placeholder="请输入身份证号">
<template #prefix>
<image style="width: 32rpx;margin-right: 18rpx;margin-top: 10rpx;" src="@/static/commonImage/IdCard.png" mode="widthFix"></image>
</template>
</up-input>
</up-form-item>
<up-form-item prop="phone">
<up-input v-model="userForm.phone" shape="circle" border="none" fontSize="28rpx" color="#bbb" :placeholderStyle="placeholderStyle" :customStyle="customStyle" placeholder="请输入身份证号">
<template #prefix>
<image style="width: 32rpx;margin-right: 18rpx;margin-top: 10rpx;" src="@/static/commonImage/IdCard.png" mode="widthFix"></image>
</template>
</up-input>
</up-form-item>
</up-form>
</view>
<view class="line_title">
<text class="left_title">我的车辆</text>
<text>去修改车辆信息</text>
</view>
<view class="car_data">
<view v-for="carItem in carList" :key="carItem.carId" class="car_item">
<navTop :carNum="carItem.carNum" />
<centerLine :leftContent="carItem.carBrand" fontColor="#999" :rightContent="carItem.address" />
</view>
</view>
<view class="loginBtn" @click="addCarInfo">退出登录</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { onReady } from '@dcloudio/uni-app'
import centerLine from '@/components/centerLine.vue';
import navTop from '@/components/navTop.vue';
const showNotice = ref(true)
const carList = ref([
{ carId: 1, carNum: '桂A·66666', carBrand: '梅赛德斯奔驰', address: '广西壮族自治区 南宁市 兴宁区投保', status: 0 },
{ carId: 2, carNum: '桂A·77777', carBrand: '梅赛德斯奔驰', address: '广西壮族自治区 南宁市 兴宁区投保', status: 1 },
{ carId: 3, carNum: '桂A·77777', carBrand: '梅赛德斯奔驰', address: '广西壮族自治区 南宁市 兴宁区投保', status: 2 }
])
// 用户参数
const userForm = ref({
name: '',
identificationNumber: '',
phone: ''
})
const customStyle = {
height: '80rpx',
backgroundColor: '#F9F9F9',
paddingLeft: '40rpx'
}
const placeholderStyle = {
color: '#bbb',
fontSize: '28rpx'
}
// 表单引用
const userFormRef = ref(null)
// 校验规则
const rules = {
name: [
{ required: true, message: '请输入姓名', trigger: ['blur', 'change'] },
{ min: 2, max: 6, message: '名字应在2到6个字', trigger: ['blur', 'change'] },
{ validator: (rule, value, callback) => {
return uni.$u.test.chinese(value)
},
message: '请输入中文',
// 触发器可以同时用blur和change
trigger: ['change','blur'],
}
],
identificationNumber: [
{ required: true, message: '请输入身份证号', trigger: ['blur', 'change'] },
{ validator: (rule, value, callback) => {
return uni.$u.test.idCard(value)
},
message: '身份证号码不正确',
// 触发器可以同时用blur和change
trigger: ['change','blur'],
}
],
phone: [
{ required: true, message: '请输入手机号', trigger: ['blur', 'change'] },
{ validator: (rule, value, callback) => {
return uni.$u.test.mobile(value)
},
message: '手机号码不正确',
// 触发器可以同时用blur和change
trigger: ['change','blur'],
}
]
}
// 微信小程序需要在此注册校验规则
onReady(() => {
userFormRef.value.setRules(rules)
})
const addCarInfo = () => {
uni.navigateTo({
url: '/pages/carDetail/carDetail'
})
}
// 提交方法
const submit = () => {
userFormRef.value.validate().then(async valid => {
if (valid) {
uni.$u.toast('登录成功')
} else {
uni.$u.toast('校验失败')
}
}).catch(() => {
// 处理验证错误
uni.$u.toast('校验失败')
});
}
</script>
<style lang="scss" scoped>
.app-container{
width: 100%;
height: 100vh;
padding: 0 30rpx;
background: url('http://bxhd.crgx.net/profile/avatar/2024/09/25/bg-index_20240925113012A004.png') no-repeat;
background-size: 100% 100%;
overflow: hidden;
.user-box{
width: 690rpx;
padding: 40rpx 44rpx;
background-color: #fff;
z-index: 10;
margin: 0 auto 40rpx;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 40rpx;
}
// 车辆列表
.car_list{
display: flex;
flex-direction: column;
gap: 20rpx;
.line_title{
display: flex;
justify-content: space-between;
font-size: 24rpx;
color: #999;
line-height: 32rpx;
.left_title{
font-size: 32rpx;
line-height: 42rpx;
color: #333;
}
}
.car_data{
padding: 0 30rpx;
background: #FFFFFF;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 40rpx;
margin-bottom: 60rpx;
.car_item{
padding: 30rpx 0;
border-bottom: 2rpx solid #eee;
&:last-child{
border-bottom: 0;
}
}
}
.loginBtn{
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size: 28rpx;
color: #fff;
font-weight: 500;
background: #3680FE;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 40rpx;
}
}
}
</style>
... ...
<template>
<view class="company_container">
<up-navbar placeholder title="车主详情" autoBack leftIconColor="#fff" :titleStyle="titleStyle" bgColor="transparent" />
<view class="work_box">
<!-- 车主信息 -->
<view class="ownerInfo">
<view class="header_info">
<navTop />
<ownerInfo />
</view>
<view class="navlist">
<view v-for="(item, index) in navList" :key="item.id" class="nav_item" :class="{active: current === index}" @click="toggle(index)">
{{ item.title }}
</view>
<view class="line"></view>
</view>
<view v-for="scheduleItem in 10" :key="scheduleItem" class="schedule">
<view class="applyTime">
<text class="li"></text>
<text>2024-09-09</text>
</view>
<commentCard />
</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue';
import navTop from '@/components/navTop.vue';
import ownerInfo from '@/components/ownerInfo.vue';
import commentCard from '@/components/commentCard.vue';
const current = ref(0)
const navList = ref([
{ id: 1, title: "进度汇报" },
{ id: 2, title: "转单" },
{ id: 3, title: "办结" }
])
const titleStyle = {
fontSize: '36rpx',
color: '#fff',
fontWeight: 500
}
const leftWidth = ref(0)
const toggle = (index) => {
leftWidth.value = `${index * 230}rpx`
current.value = index
}
</script>
<style lang="scss" scoped>
.company_container{
width: 100%;
height: 100vh;
background: url('http://bxhd.crgx.net/profile/avatar/2024/09/25/bg-index_20240925113012A004.png') no-repeat;
background-size: 100% 100%;
overflow: hidden;
.work_box{
padding: 20rpx 30rpx 180rpx;
height: calc(100vh - 88rpx);
background-color: #F8F9FF;
overflow-y: scroll;
.ownerInfo{
background: #fff;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 20rpx;
overflow: hidden;
.header_info{
padding: 22rpx 30rpx;
}
}
}
}
.navlist{
position: relative;
display: flex;
align-items: center;
height: 58rpx;
.line{
position: absolute;
bottom: 0;
left: v-bind(leftWidth);
width: 230rpx;
height: 4rpx;
background-color: #3680FE;
transition: all .5s;
}
.nav_item{
flex: 1;
text-align: center;
color: #999999;
font-size: 24rpx;
line-height: 58rpx;
&.active{
color: #3680FE;
font-weight: 500;
}
}
}
.schedule{
padding: 20rpx 30rpx 30rpx;
border-bottom: 2rpx solid #eee;
.applyTime{
display: flex;
align-items: center;
gap: 20rpx;
color: #3d3d3d;
font-size: 24rpx;
line-height: 32rpx;
margin-bottom: 20rpx;
.li{
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background-color: #3680FE;
}
}
&:last-child{
border-bottom: 0;
}
}
</style>
... ...
<template>
<view class="privacy">
隐私政策
</view>
</template>
<script setup>
</script>
<style lang="scss" scoped>
</style>
... ...
<template>
<view class="company_container">
<up-navbar placeholder :leftIconSize="0" bgColor="transparent" />
<view class="work_box">
<view class="work_list">
<carCard v-for="carItem in carList" :key="carItem.carId" tipContent="待办" :carInfo="carItem">
<template #header>
<navTop :carNum="carItem.carNum" />
</template>
<template #center>
<wordInfo :carType="carItem.carType" :userName="carItem.name" :applyTime="carItem.createTime" />
</template>
<template #footer>
<operateList />
</template>
</carCard>
</view>
</view>
<!-- 底部导航栏 -->
<up-tabbar
:value="useTabbar.societyCurrent"
activeColor="#3680FE"
inactiveColor="#707070"
>
<up-tabbar-item text="主页" icon="home" badge="11"></up-tabbar-item>
<up-tabbar-item text="我的" icon="account" @click="goRouter">
<template #active-icon>
<image style="width: 48rpx;" class="u-page__item__slot-icon" src="@/static/tabbarIcon/my-active.png" mode="widthFix"></image>
</template>
<template #inactive-icon>
<image style="width: 48rpx;" class="u-page__item__slot-icon" src="@/static/tabbarIcon/my.png" mode="widthFix"></image>
</template>
</up-tabbar-item>
</up-tabbar>
</view>
</template>
<script setup>
import { ref } from 'vue';
import carCard from '@/components/carCard.vue';
import navTop from '@/components/navTop.vue';
import wordInfo from '@/components/wordInfo.vue';
import operateList from '@/components/operateList.vue';
import useTabbarStore from '@/store/modules/tabbar.js'
const useTabbar = useTabbarStore()
const carList = ref([
{ carId: 1, carNum: '桂A·66666', carType: '奔驰C级', name: '张三', createTime: '2024-09-08 10:12' },
{ carId: 2, carNum: '桂A·77777', carType: '奔驰C级', name: '李四', createTime: '2024-09-08 10:12' },
{ carId: 3, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 4, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 5, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 6, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 7, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 8, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 9, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 10, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 11, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
])
const titleStyle = {
fontSize: '36rpx',
color: '#fff',
fontWeight: 500
}
const goRouter = (index) => {
useTabbar.societyCurrent = index
uni.redirectTo({
url: '/pages/societyMy/societyMy'
})
}
</script>
<style lang="scss" scoped>
.company_container{
width: 100%;
height: 100vh;
background: url('http://bxhd.crgx.net/profile/avatar/2024/09/25/bg-index_20240925113012A004.png') no-repeat;
background-size: 100% 100%;
overflow: hidden;
.work_box{
padding: 20rpx 30rpx 250rpx;
height: calc(100vh - 88rpx);
background-color: #F8F9FF;
overflow-y: scroll;
.work_list{
display: flex;
flex-direction: column;
gap: 20rpx;
}
}
}
</style>
... ...
<template>
<view class="app-container">
<up-navbar placeholder :leftIconSize="0" bgColor="transparent" />
<view class="car_list">
<view class="line_title">
<text class="left_title" style="color: #fff;">我的信息</text>
<text style="color: #fff;">更新实名信息</text>
</view>
<view class="user-box">
<up-form :model="userForm" ref="userFormRef">
<up-form-item prop="name">
<up-input v-model="userForm.name" shape="circle" border="none" fontSize="28rpx" color="#bbb" :placeholderStyle="placeholderStyle" :customStyle="customStyle" placeholder="请输入真实姓名">
<template #prefix>
<image style="width: 32rpx;margin-right: 18rpx;margin-top: 10rpx;" src="@/static/commonImage/user.png" mode="widthFix"></image>
</template>
</up-input>
</up-form-item>
<up-form-item prop="identificationNumber">
<up-input v-model="userForm.identificationNumber" shape="circle" border="none" fontSize="28rpx" color="#bbb" :placeholderStyle="placeholderStyle" :customStyle="customStyle" placeholder="请输入身份证号">
<template #prefix>
<image style="width: 32rpx;margin-right: 18rpx;margin-top: 10rpx;" src="@/static/commonImage/IdCard.png" mode="widthFix"></image>
</template>
</up-input>
</up-form-item>
<up-form-item prop="phone">
<up-input v-model="userForm.phone" shape="circle" border="none" fontSize="28rpx" color="#bbb" :placeholderStyle="placeholderStyle" :customStyle="customStyle" placeholder="请输入手机号码">
<template #prefix>
<image style="width: 32rpx;margin-right: 18rpx;margin-top: 10rpx;" src="@/static/commonImage/phone.png" mode="widthFix"></image>
</template>
</up-input>
</up-form-item>
</up-form>
</view>
<view class="loginBtn" @click="loginOut">退出登录</view>
</view>
<!-- 底部导航栏 -->
<up-tabbar
:value="useTabbar.societyCurrent"
activeColor="#3680FE"
inactiveColor="#707070"
>
<up-tabbar-item text="主页" icon="home" @click="goRouter"></up-tabbar-item>
<up-tabbar-item text="我的" icon="account"></up-tabbar-item>
</up-tabbar>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { onReady } from '@dcloudio/uni-app'
import useTabbarStore from '@/store/modules/tabbar.js'
const useTabbar = useTabbarStore()
const showNotice = ref(true)
// 用户参数
const userForm = ref({
name: '',
identificationNumber: '',
phone: ''
})
const customStyle = {
height: '80rpx',
backgroundColor: '#F9F9F9',
paddingLeft: '40rpx'
}
const placeholderStyle = {
color: '#bbb',
fontSize: '28rpx'
}
// 表单引用
const userFormRef = ref(null)
// 校验规则
const rules = {
name: [
{ required: true, message: '请输入姓名', trigger: ['blur', 'change'] },
{ min: 2, max: 6, message: '名字应在2到6个字', trigger: ['blur', 'change'] },
{ validator: (rule, value, callback) => {
return uni.$u.test.chinese(value)
},
message: '请输入中文',
// 触发器可以同时用blur和change
trigger: ['change','blur'],
}
],
identificationNumber: [
{ required: true, message: '请输入身份证号', trigger: ['blur', 'change'] },
{ validator: (rule, value, callback) => {
return uni.$u.test.idCard(value)
},
message: '身份证号码不正确',
// 触发器可以同时用blur和change
trigger: ['change','blur'],
}
],
phone: [
{ required: true, message: '请输入手机号', trigger: ['blur', 'change'] },
{ validator: (rule, value, callback) => {
return uni.$u.test.mobile(value)
},
message: '手机号码不正确',
// 触发器可以同时用blur和change
trigger: ['change','blur'],
}
]
}
// 微信小程序需要在此注册校验规则
onReady(() => {
userFormRef.value.setRules(rules)
})
const loginOut = () => {
}
const goRouter = (index) => {
useTabbar.societyCurrent = index
uni.redirectTo({
url: '/pages/societyHome/societyHome'
})
}
// 提交方法
const submit = () => {
userFormRef.value.validate().then(async valid => {
if (valid) {
uni.$u.toast('登录成功')
} else {
uni.$u.toast('校验失败')
}
}).catch(() => {
// 处理验证错误
uni.$u.toast('校验失败')
});
}
</script>
<style lang="scss" scoped>
.app-container{
width: 100%;
height: 100vh;
padding: 0 30rpx;
background: url('http://bxhd.crgx.net/profile/avatar/2024/09/25/bg-index_20240925113012A004.png') no-repeat;
background-size: 100% 100%;
overflow: hidden;
.user-box{
width: 690rpx;
padding: 40rpx 44rpx;
background-color: #fff;
z-index: 10;
margin: 0 auto 40rpx;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 40rpx;
}
// 车辆列表
.car_list{
display: flex;
flex-direction: column;
gap: 20rpx;
.line_title{
display: flex;
justify-content: space-between;
font-size: 24rpx;
color: #999;
line-height: 32rpx;
.left_title{
font-size: 32rpx;
line-height: 42rpx;
color: #333;
}
}
.car_data{
padding: 0 30rpx;
background: #FFFFFF;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 40rpx;
margin-bottom: 60rpx;
.car_item{
padding: 30rpx 0;
border-bottom: 2rpx solid #eee;
&:last-child{
border-bottom: 0;
}
}
}
.loginBtn{
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size: 28rpx;
color: #fff;
font-weight: 500;
background: #3680FE;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(10,22,44,0.06);
border-radius: 40rpx;
margin-top: 40rpx;
}
}
}
</style>
... ...
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
import { createPinia } from 'pinia'
const store = createPinia()
export default store
\ No newline at end of file
... ...
import { defineStore } from 'pinia'
const useTabbarStore = defineStore('tabbar', {
unistorage: true, // 是否持久化到内存
state: () => {
return {
employeeCurrent: 0,
societyCurrent: 0
}
}
})
export default useTabbarStore
\ No newline at end of file
... ...
import { defineStore } from 'pinia'
import storage from '@/utils/storage.js'
import { userLogin, getUserInfo } from '@/api/user'
// 登陆成功后执行
const loginSuccess = (that, token) => {
// 过期时间30天
const expiryTime = 30 * 86400
// 保存tokne到缓存
storage.set('xiaoming_token', token, expiryTime)
// 记录到store全局变量
that.token = token
}
// 保存用户信息
const userInfoSuccess = (that, userInfo) => {
// 过期时间30天
const expiryTime = 30 * 86400
storage.set('xiaoming_userInfo', userInfo, expiryTime)
// 记录到store全局变量
that.userInfo = userInfo
}
const useUserStore = defineStore('user', {
unistorage: true, // 是否持久化到内存
state: () => {
return {
token: storage.get('xiaoming_token', '123'),
userInfo: storage.get('xiaoming_userInfo', null)
}
},
actions: {
// 用户登录
login(data) {
let that = this
return new Promise((resolve, reject) => {
userLogin(data)
.then(response => {
const { token } = response
loginSuccess(that, token)
resolve(response)
})
.catch(reject)
})
},
// 获取用户信息
getUser() {
let that = this
return new Promise((resolve, reject) => {
getUserInfo()
.then(response => {
userInfoSuccess(that, response.data)
resolve(response)
})
.catch(reject)
})
},
// 退出登录
Logout() {
const store = this
return new Promise((resolve, reject) => {
// 删除缓存中的tokne和userInfo
storage.remove('xiaoming_token')
storage.remove('xiaoming_userInfo')
resolve()
})
}
}
})
export default useUserStore
\ No newline at end of file
... ...
uni.addInterceptor({
returnValue (res) {
if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
return res;
}
return new Promise((resolve, reject) => {
res.then((res) => res[0] ? reject(res[0]) : resolve(res[1]));
});
},
});
\ No newline at end of file
... ...
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
$uni-color-primary: #007aff;
$uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d;
/* 文字基本颜色 */
$uni-text-color:#333;//基本色
$uni-text-color-inverse:#fff;//反色
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
$uni-text-color-placeholder: #808080;
$uni-text-color-disable:#c0c0c0;
/* 背景颜色 */
$uni-bg-color:#ffffff;
$uni-bg-color-grey:#f8f8f8;
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
/* 边框颜色 */
$uni-border-color:#c8c7cc;
/* 尺寸变量 */
/* 文字尺寸 */
$uni-font-size-sm:12px;
$uni-font-size-base:14px;
$uni-font-size-lg:16px;
/* 图片尺寸 */
$uni-img-size-sm:20px;
$uni-img-size-base:26px;
$uni-img-size-lg:40px;
/* Border Radius */
$uni-border-radius-sm: 2px;
$uni-border-radius-base: 3px;
$uni-border-radius-lg: 6px;
$uni-border-radius-circle: 50%;
/* 水平间距 */
$uni-spacing-row-sm: 5px;
$uni-spacing-row-base: 10px;
$uni-spacing-row-lg: 15px;
/* 垂直间距 */
$uni-spacing-col-sm: 4px;
$uni-spacing-col-base: 8px;
$uni-spacing-col-lg: 12px;
/* 透明度 */
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */
$uni-color-title: #2C405A; // 文章标题颜色
$uni-font-size-title:20px;
$uni-color-subtitle: #555555; // 二级标题颜色
$uni-font-size-subtitle:26px;
$uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px;
/* uni.scss */
@import '@/uni_modules/uview-plus/theme.scss';
... ...
## 1.0.8(2024-03-28)
- 修复 在vue2下:style动态绑定导致编译失败的bug
## 1.0.7(2024-01-20)
- 修复 长文本回显超过容器的bug,超过容器部分显示省略号
## 1.0.6(2023-04-12)
- 修复 微信小程序点击时会改变背景颜色的 bug
## 1.0.5(2023-02-03)
- 修复 禁用时会显示清空按钮
## 1.0.4(2023-02-02)
- 优化 查询条件短期内多次变更只查询最后一次变更后的结果
- 调整 内部缓存键名调整为 uni-data-select-lastSelectedValue
## 1.0.3(2023-01-16)
- 修复 不关联服务空间报错的问题
## 1.0.2(2023-01-14)
- 新增 属性 `format` 可用于格式化显示选项内容
## 1.0.1(2022-12-06)
- 修复 当where变化时,数据不会自动更新的问题
## 0.1.9(2022-09-05)
- 修复 微信小程序下拉框出现后选择会点击到蒙板后面的输入框
## 0.1.8(2022-08-29)
- 修复 点击的位置不准确
## 0.1.7(2022-08-12)
- 新增 支持 disabled 属性
## 0.1.6(2022-07-06)
- 修复 pc端宽度异常的bug
## 0.1.5
- 修复 pc端宽度异常的bug
## 0.1.4(2022-07-05)
- 优化 显示样式
## 0.1.3(2022-06-02)
- 修复 localdata 赋值不生效的 bug
- 新增 支持 uni.scss 修改颜色
- 新增 支持选项禁用(数据选项设置 disabled: true 即禁用)
## 0.1.2(2022-05-08)
- 修复 当 value 为 0 时选择不生效的 bug
## 0.1.1(2022-05-07)
- 新增 记住上次的选项(仅 collection 存在时有效)
## 0.1.0(2022-04-22)
- 初始化
... ...
<template>
<view class="uni-stat__select">
<span v-if="label" class="uni-label-text hide-on-phone">{{label + ':'}}</span>
<view class="uni-stat-box" :class="{'uni-stat__actived': current}">
<view class="uni-select" :class="{'uni-select--disabled':disabled}">
<view class="uni-select__input-box" @click="toggleSelector">
<view v-if="current" class="uni-select__input-text">{{textShow}}</view>
<view v-else class="uni-select__input-text uni-select__input-placeholder">{{typePlaceholder}}</view>
<view v-if="current && clear && !disabled" @click.stop="clearVal">
<uni-icons type="clear" color="#c0c4cc" size="24" />
</view>
<view v-else>
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" />
</view>
</view>
<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
<view class="uni-select__selector" :style="getOffsetByPlacement" v-if="showSelector">
<view :class="placement=='bottom'?'uni-popper__arrow_bottom':'uni-popper__arrow_top'"></view>
<scroll-view scroll-y="true" class="uni-select__selector-scroll">
<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0">
<text>{{emptyTips}}</text>
</view>
<view v-else class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData" :key="index"
@click="change(item)">
<text :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
</template>
<script>
/**
* DataChecklist 数据选择器
* @description 通过数据渲染的下拉框组件
* @tutorial https://uniapp.dcloud.io/component/uniui/uni-data-select
* @property {String} value 默认值
* @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}]
* @property {Boolean} clear 是否可以清空已选项
* @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效
* @property {String} label 左侧标题
* @property {String} placeholder 输入框的提示文字
* @property {Boolean} disabled 是否禁用
* @property {String} placement 弹出位置
* @value top 顶部弹出
* @value bottom 底部弹出(default)
* @event {Function} change 选中发生变化触发
*/
export default {
name: "uni-data-select",
mixins: [uniCloud.mixinDatacom || {}],
props: {
localdata: {
type: Array,
default () {
return []
}
},
value: {
type: [String, Number],
default: ''
},
modelValue: {
type: [String, Number],
default: ''
},
label: {
type: String,
default: ''
},
placeholder: {
type: String,
default: '请选择'
},
emptyTips: {
type: String,
default: '无选项'
},
clear: {
type: Boolean,
default: true
},
defItem: {
type: Number,
default: 0
},
disabled: {
type: Boolean,
default: false
},
// 格式化输出 用法 field="_id as value, version as text, uni_platform as label" format="{label} - {text}"
format: {
type: String,
default: ''
},
placement: {
type: String,
default: 'bottom'
}
},
data() {
return {
showSelector: false,
current: '',
mixinDatacomResData: [],
apps: [],
channels: [],
cacheKey: "uni-data-select-lastSelectedValue",
};
},
created() {
this.debounceGet = this.debounce(() => {
this.query();
}, 300);
if (this.collection && !this.localdata.length) {
this.debounceGet();
}
},
computed: {
typePlaceholder() {
const text = {
'opendb-stat-app-versions': '版本',
'opendb-app-channels': '渠道',
'opendb-app-list': '应用'
}
const common = this.placeholder
const placeholder = text[this.collection]
return placeholder ?
common + placeholder :
common
},
valueCom() {
// #ifdef VUE3
return this.modelValue;
// #endif
// #ifndef VUE3
return this.value;
// #endif
},
textShow() {
// 长文本显示
let text = this.current;
if (text.length > 10) {
return text.slice(0, 25) + '...';
}
return text;
},
getOffsetByPlacement() {
switch (this.placement) {
case 'top':
return "bottom:calc(100% + 12px);";
case 'bottom':
return "top:calc(100% + 12px);";
}
}
},
watch: {
localdata: {
immediate: true,
handler(val, old) {
if (Array.isArray(val) && old !== val) {
this.mixinDatacomResData = val
}
}
},
valueCom(val, old) {
this.initDefVal()
},
mixinDatacomResData: {
immediate: true,
handler(val) {
if (val.length) {
this.initDefVal()
}
}
},
},
methods: {
debounce(fn, time = 100) {
let timer = null
return function(...args) {
if (timer) clearTimeout(timer)
timer = setTimeout(() => {
fn.apply(this, args)
}, time)
}
},
// 执行数据库查询
query() {
this.mixinDatacomEasyGet();
},
// 监听查询条件变更事件
onMixinDatacomPropsChange() {
if (this.collection) {
this.debounceGet();
}
},
initDefVal() {
let defValue = ''
if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) {
defValue = this.valueCom
} else {
let strogeValue
if (this.collection) {
strogeValue = this.getCache()
}
if (strogeValue || strogeValue === 0) {
defValue = strogeValue
} else {
let defItem = ''
if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) {
defItem = this.mixinDatacomResData[this.defItem - 1].value
}
defValue = defItem
}
if (defValue || defValue === 0) {
this.emit(defValue)
}
}
const def = this.mixinDatacomResData.find(item => item.value === defValue)
this.current = def ? this.formatItemName(def) : ''
},
/**
* @param {[String, Number]} value
* 判断用户给的 value 是否同时为禁用状态
*/
isDisabled(value) {
let isDisabled = false;
this.mixinDatacomResData.forEach(item => {
if (item.value === value) {
isDisabled = item.disable
}
})
return isDisabled;
},
clearVal() {
this.emit('')
if (this.collection) {
this.removeCache()
}
},
change(item) {
if (!item.disable) {
this.showSelector = false
this.current = this.formatItemName(item)
this.emit(item.value)
}
},
emit(val) {
this.$emit('input', val)
this.$emit('update:modelValue', val)
this.$emit('change', val)
if (this.collection) {
this.setCache(val);
}
},
toggleSelector() {
if (this.disabled) {
return
}
this.showSelector = !this.showSelector
},
formatItemName(item) {
let {
text,
value,
channel_code
} = item
channel_code = channel_code ? `(${channel_code})` : ''
if (this.format) {
// 格式化输出
let str = "";
str = this.format;
for (let key in item) {
str = str.replace(new RegExp(`{${key}}`, "g"), item[key]);
}
return str;
} else {
return this.collection.indexOf('app-list') > 0 ?
`${text}(${value})` :
(
text ?
text :
`未命名${channel_code}`
)
}
},
// 获取当前加载的数据
getLoadData() {
return this.mixinDatacomResData;
},
// 获取当前缓存key
getCurrentCacheKey() {
return this.collection;
},
// 获取缓存
getCache(name = this.getCurrentCacheKey()) {
let cacheData = uni.getStorageSync(this.cacheKey) || {};
return cacheData[name];
},
// 设置缓存
setCache(value, name = this.getCurrentCacheKey()) {
let cacheData = uni.getStorageSync(this.cacheKey) || {};
cacheData[name] = value;
uni.setStorageSync(this.cacheKey, cacheData);
},
// 删除缓存
removeCache(name = this.getCurrentCacheKey()) {
let cacheData = uni.getStorageSync(this.cacheKey) || {};
delete cacheData[name];
uni.setStorageSync(this.cacheKey, cacheData);
},
}
}
</script>
<style lang="scss">
$uni-base-color: #6a6a6a !default;
$uni-main-color: #333 !default;
$uni-secondary-color: #909399 !default;
$uni-border-3: #e5e5e5;
/* #ifndef APP-NVUE */
@media screen and (max-width: 500px) {
.hide-on-phone {
display: none;
}
}
/* #endif */
.uni-stat__select {
display: flex;
align-items: center;
// padding: 15px;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
width: 100%;
flex: 1;
box-sizing: border-box;
}
.uni-stat-box {
width: 100%;
flex: 1;
}
.uni-stat__actived {
width: 100%;
flex: 1;
// outline: 1px solid #2979ff;
}
.uni-label-text {
font-size: 14px;
font-weight: bold;
color: $uni-base-color;
margin: auto 0;
margin-right: 5px;
}
.uni-select {
font-size: 14px;
border: 1px solid $uni-border-3;
box-sizing: border-box;
border-radius: 4px;
padding: 0 5px;
padding-left: 10px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
user-select: none;
/* #endif */
flex-direction: row;
align-items: center;
border-bottom: solid 1px $uni-border-3;
width: 100%;
flex: 1;
height: 35px;
&--disabled {
background-color: #f5f7fa;
cursor: not-allowed;
}
}
.uni-select__label {
font-size: 16px;
// line-height: 22px;
height: 35px;
padding-right: 10px;
color: $uni-secondary-color;
}
.uni-select__input-box {
height: 35px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
align-items: center;
}
.uni-select__input {
flex: 1;
font-size: 14px;
height: 22px;
line-height: 22px;
}
.uni-select__input-plac {
font-size: 14px;
color: $uni-secondary-color;
}
.uni-select__selector {
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
position: absolute;
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: 3;
padding: 4px 0;
}
.uni-select__selector-scroll {
/* #ifndef APP-NVUE */
max-height: 200px;
box-sizing: border-box;
/* #endif */
}
/* #ifdef H5 */
@media (min-width: 768px) {
.uni-select__selector-scroll {
max-height: 600px;
}
}
/* #endif */
.uni-select__selector-empty,
.uni-select__selector-item {
/* #ifndef APP-NVUE */
display: flex;
cursor: pointer;
/* #endif */
line-height: 35px;
font-size: 14px;
text-align: center;
/* border-bottom: solid 1px $uni-border-3; */
padding: 0px 10px;
}
.uni-select__selector-item:hover {
background-color: #f9f9f9;
}
.uni-select__selector-empty:last-child,
.uni-select__selector-item:last-child {
/* #ifndef APP-NVUE */
border-bottom: none;
/* #endif */
}
.uni-select__selector__disabled {
opacity: 0.4;
cursor: default;
}
/* picker 弹出层通用的指示小三角 */
.uni-popper__arrow_bottom,
.uni-popper__arrow_bottom::after,
.uni-popper__arrow_top,
.uni-popper__arrow_top::after,
{
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 6px;
}
.uni-popper__arrow_bottom {
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_bottom::after {
content: " ";
top: 1px;
margin-left: -6px;
border-top-width: 0;
border-bottom-color: #fff;
}
.uni-popper__arrow_top {
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
bottom: -6px;
left: 10%;
margin-right: 3px;
border-bottom-width: 0;
border-top-color: #EBEEF5;
}
.uni-popper__arrow_top::after {
content: " ";
bottom: 1px;
margin-left: -6px;
border-bottom-width: 0;
border-top-color: #fff;
}
.uni-select__input-text {
// width: 280px;
width: 100%;
color: $uni-main-color;
white-space: nowrap;
text-overflow: ellipsis;
--o-text-overflow: ellipsis;
overflow: hidden;
}
.uni-select__input-placeholder {
color: $uni-base-color;
font-size: 12px;
}
.uni-select--mask {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
z-index: 2;
}
</style>
... ...
{
"id": "uni-data-select",
"displayName": "uni-data-select 下拉框选择器",
"version": "1.0.8",
"description": "通过数据驱动的下拉框选择器",
"keywords": [
"uni-ui",
"select",
"uni-data-select",
"下拉框",
"下拉选"
],
"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"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y",
"alipay": "n"
},
"client": {
"App": {
"app-vue": "u",
"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"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
... ...
## DataSelect 下拉框选择器
> **组件名:uni-data-select**
> 代码块: `uDataSelect`
当选项过多时,使用下拉菜单展示并选择内容
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-select)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
... ...
## 1.3.3(2022-01-20)
- 新增 showText属性 ,是否显示文本
## 1.3.2(2022-01-19)
- 修复 nvue 平台下不显示文本的bug
## 1.3.1(2022-01-19)
- 修复 微信小程序平台样式选择器报警告的问题
## 1.3.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-load-more](https://uniapp.dcloud.io/component/uniui/uni-load-more)
## 1.2.1(2021-08-24)
- 新增 支持国际化
## 1.2.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.1.8(2021-05-12)
- 新增 组件示例地址
## 1.1.7(2021-03-30)
- 修复 uni-load-more 在首页使用时,h5 平台报 'uni is not defined' 的 bug
## 1.1.6(2021-02-05)
- 调整为uni_modules目录规范
... ...
{
"uni-load-more.contentdown": "Pull up to show more",
"uni-load-more.contentrefresh": "loading...",
"uni-load-more.contentnomore": "No more data"
}
... ...
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
}
... ...
{
"uni-load-more.contentdown": "上拉显示更多",
"uni-load-more.contentrefresh": "正在加载...",
"uni-load-more.contentnomore": "没有更多数据了"
}
... ...
{
"uni-load-more.contentdown": "上拉顯示更多",
"uni-load-more.contentrefresh": "正在加載...",
"uni-load-more.contentnomore": "沒有更多數據了"
}
... ...
<template>
<view class="uni-load-more" @click="onClick">
<!-- #ifdef APP-NVUE -->
<loading-indicator v-if="!webviewHide && status === 'loading' && showIcon"
:style="{color: color,width:iconSize+'px',height:iconSize+'px'}" :animating="true"
class="uni-load-more__img uni-load-more__img--nvue"></loading-indicator>
<!-- #endif -->
<!-- #ifdef H5 -->
<svg width="24" height="24" viewBox="25 25 50 50"
v-if="!webviewHide && (iconType==='circle' || iconType==='auto' && platform === 'android') && status === 'loading' && showIcon"
:style="{width:iconSize+'px',height:iconSize+'px'}"
class="uni-load-more__img uni-load-more__img--android-H5">
<circle cx="50" cy="50" r="20" fill="none" :style="{color:color}" :stroke-width="3"></circle>
</svg>
<!-- #endif -->
<!-- #ifndef APP-NVUE || H5 -->
<view
v-if="!webviewHide && (iconType==='circle' || iconType==='auto' && platform === 'android') && status === 'loading' && showIcon"
:style="{width:iconSize+'px',height:iconSize+'px'}"
class="uni-load-more__img uni-load-more__img--android-MP">
<view class="uni-load-more__img-icon" :style="{borderTopColor:color,borderTopWidth:iconSize/12}"></view>
<view class="uni-load-more__img-icon" :style="{borderTopColor:color,borderTopWidth:iconSize/12}"></view>
<view class="uni-load-more__img-icon" :style="{borderTopColor:color,borderTopWidth:iconSize/12}"></view>
</view>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<view v-else-if="!webviewHide && status === 'loading' && showIcon"
:style="{width:iconSize+'px',height:iconSize+'px'}" class="uni-load-more__img uni-load-more__img--ios-H5">
<image :src="imgBase64" mode="widthFix"></image>
</view>
<!-- #endif -->
<text v-if="showText" class="uni-load-more__text"
:style="{color: color}">{{ status === 'more' ? contentdownText : status === 'loading' ? contentrefreshText : contentnomoreText }}</text>
</view>
</template>
<script>
let platform
setTimeout(() => {
platform = uni.getSystemInfoSync().platform
}, 16)
import {
initVueI18n
} from '@dcloudio/uni-i18n'
import messages from './i18n/index.js'
const {
t
} = initVueI18n(messages)
/**
* LoadMore 加载更多
* @description 用于列表中,做滚动加载使用,展示 loading 的各种状态
* @tutorial https://ext.dcloud.net.cn/plugin?id=29
* @property {String} status = [more|loading|noMore] loading 的状态
* @value more loading前
* @value loading loading中
* @value noMore 没有更多了
* @property {Number} iconSize 指定图标大小
* @property {Boolean} iconSize = [true|false] 是否显示 loading 图标
* @property {String} iconType = [snow|circle|auto] 指定图标样式
* @value snow ios雪花加载样式
* @value circle 安卓唤醒加载样式
* @value auto 根据平台自动选择加载样式
* @property {String} color 图标和文字颜色
* @property {Object} contentText 各状态文字说明,值为:{contentdown: "上拉显示更多",contentrefresh: "正在加载...",contentnomore: "没有更多数据了"}
* @event {Function} clickLoadMore 点击加载更多时触发
*/
export default {
name: 'UniLoadMore',
emits: ['clickLoadMore'],
props: {
status: {
// 上拉的状态:more-loading前;loading-loading中;noMore-没有更多了
type: String,
default: 'more'
},
showIcon: {
type: Boolean,
default: true
},
iconType: {
type: String,
default: 'auto'
},
iconSize: {
type: Number,
default: 24
},
color: {
type: String,
default: '#777777'
},
contentText: {
type: Object,
default () {
return {
contentdown: '',
contentrefresh: '',
contentnomore: ''
}
}
},
showText: {
type: Boolean,
default: true
}
},
data() {
return {
webviewHide: false,
platform: platform,
imgBase64: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QzlBMzU3OTlEOUM0MTFFOUI0NTZDNERBQURBQzI4RkUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QzlBMzU3OUFEOUM0MTFFOUI0NTZDNERBQURBQzI4RkUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDOUEzNTc5N0Q5QzQxMUU5QjQ1NkM0REFBREFDMjhGRSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDOUEzNTc5OEQ5QzQxMUU5QjQ1NkM0REFBREFDMjhGRSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pt+ALSwAAA6CSURBVHja1FsLkFZV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'
}
},
computed: {
iconSnowWidth() {
return (Math.floor(this.iconSize / 24) || 1) * 2
},
contentdownText() {
return this.contentText.contentdown || t("uni-load-more.contentdown")
},
contentrefreshText() {
return this.contentText.contentrefresh || t("uni-load-more.contentrefresh")
},
contentnomoreText() {
return this.contentText.contentnomore || t("uni-load-more.contentnomore")
}
},
mounted() {
// #ifdef APP-PLUS
var pages = getCurrentPages();
var page = pages[pages.length - 1];
var currentWebview = page.$getAppWebview();
currentWebview.addEventListener('hide', () => {
this.webviewHide = true
})
currentWebview.addEventListener('show', () => {
this.webviewHide = false
})
// #endif
},
methods: {
onClick() {
this.$emit('clickLoadMore', {
detail: {
status: this.status,
}
})
}
}
}
</script>
<style lang="scss" >
.uni-load-more {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
height: 40px;
align-items: center;
justify-content: center;
}
.uni-load-more__text {
font-size: 14px;
margin-left: 8px;
}
.uni-load-more__img {
width: 24px;
height: 24px;
// margin-right: 8px;
}
.uni-load-more__img--nvue {
color: #666666;
}
.uni-load-more__img--android,
.uni-load-more__img--ios {
width: 24px;
height: 24px;
transform: rotate(0deg);
}
/* #ifndef APP-NVUE */
.uni-load-more__img--android {
animation: loading-ios 1s 0s linear infinite;
}
@keyframes loading-android {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.uni-load-more__img--ios-H5 {
position: relative;
animation: loading-ios-H5 1s 0s step-end infinite;
}
.uni-load-more__img--ios-H5 image {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
@keyframes loading-ios-H5 {
0% {
transform: rotate(0deg);
}
8% {
transform: rotate(30deg);
}
16% {
transform: rotate(60deg);
}
24% {
transform: rotate(90deg);
}
32% {
transform: rotate(120deg);
}
40% {
transform: rotate(150deg);
}
48% {
transform: rotate(180deg);
}
56% {
transform: rotate(210deg);
}
64% {
transform: rotate(240deg);
}
73% {
transform: rotate(270deg);
}
82% {
transform: rotate(300deg);
}
91% {
transform: rotate(330deg);
}
100% {
transform: rotate(360deg);
}
}
/* #endif */
/* #ifdef H5 */
.uni-load-more__img--android-H5 {
animation: loading-android-H5-rotate 2s linear infinite;
transform-origin: center center;
}
.uni-load-more__img--android-H5 circle {
display: inline-block;
animation: loading-android-H5-dash 1.5s ease-in-out infinite;
stroke: currentColor;
stroke-linecap: round;
}
@keyframes loading-android-H5-rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes loading-android-H5-dash {
0% {
stroke-dasharray: 1, 200;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 90, 150;
stroke-dashoffset: -40;
}
100% {
stroke-dasharray: 90, 150;
stroke-dashoffset: -120;
}
}
/* #endif */
/* #ifndef APP-NVUE || H5 */
.uni-load-more__img--android-MP {
position: relative;
width: 24px;
height: 24px;
transform: rotate(0deg);
animation: loading-ios 1s 0s ease infinite;
}
.uni-load-more__img--android-MP .uni-load-more__img-icon {
position: absolute;
box-sizing: border-box;
width: 100%;
height: 100%;
border-radius: 50%;
border: solid 2px transparent;
border-top: solid 2px #777777;
transform-origin: center;
}
.uni-load-more__img--android-MP .uni-load-more__img-icon:nth-child(1) {
animation: loading-android-MP-1 1s 0s linear infinite;
}
.uni-load-more__img--android-MP .uni-load-more__img-icon:nth-child(2) {
animation: loading-android-MP-2 1s 0s linear infinite;
}
.uni-load-more__img--android-MP .uni-load-more__img-icon:nth-child(3) {
animation: loading-android-MP-3 1s 0s linear infinite;
}
@keyframes loading-android {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes loading-android-MP-1 {
0% {
transform: rotate(0deg);
}
50% {
transform: rotate(90deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes loading-android-MP-2 {
0% {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes loading-android-MP-3 {
0% {
transform: rotate(0deg);
}
50% {
transform: rotate(270deg);
}
100% {
transform: rotate(360deg);
}
}
/* #endif */
</style>
... ...
{
"id": "uni-load-more",
"displayName": "uni-load-more 加载更多",
"version": "1.3.3",
"description": "LoadMore 组件,常用在列表里面,做滚动加载使用。",
"keywords": [
"uni-ui",
"uniui",
"加载更多",
"load-more"
],
"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"
}
}
}
}
}
\ No newline at end of file
... ...
### LoadMore 加载更多
> **组件名:uni-load-more**
> 代码块: `uLoadMore`
用于列表中,做滚动加载使用,展示 loading 的各种状态。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-load-more)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
... ...
## 1.0.3(2022-01-21)
- 优化 组件示例
## 1.0.2(2021-11-22)
- 修复 / 符号在 vue 不同版本兼容问题引起的报错问题
## 1.0.1(2021-11-22)
- 修复 vue3中scss语法兼容问题
## 1.0.0(2021-11-18)
- init
... ...
@import './styles/index.scss';
... ...
{
"id": "uni-scss",
"displayName": "uni-scss 辅助样式",
"version": "1.0.3",
"description": "uni-sass是uni-ui提供的一套全局样式 ,通过一些简单的类名和sass变量,实现简单的页面布局操作,比如颜色、边距、圆角等。",
"keywords": [
"uni-scss",
"uni-ui",
"辅助样式"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"JS SDK",
"通用 SDK"
],
"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": "u"
},
"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"
},
"快应用": {
"华为": "n",
"联盟": "n"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
... ...
`uni-sass` 是 `uni-ui`提供的一套全局样式 ,通过一些简单的类名和`sass`变量,实现简单的页面布局操作,比如颜色、边距、圆角等。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-sass)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
\ No newline at end of file
... ...
@import './setting/_variables.scss';
@import './setting/_border.scss';
@import './setting/_color.scss';
@import './setting/_space.scss';
@import './setting/_radius.scss';
@import './setting/_text.scss';
@import './setting/_styles.scss';
... ...
.uni-border {
border: 1px $uni-border-1 solid;
}
\ No newline at end of file
... ...
// TODO 暂时不需要 class ,需要用户使用变量实现 ,如果使用类名其实并不推荐
// @mixin get-styles($k,$c) {
// @if $k == size or $k == weight{
// font-#{$k}:#{$c}
// }@else{
// #{$k}:#{$c}
// }
// }
$uni-ui-color:(
// 主色
primary: $uni-primary,
primary-disable: $uni-primary-disable,
primary-light: $uni-primary-light,
// 辅助色
success: $uni-success,
success-disable: $uni-success-disable,
success-light: $uni-success-light,
warning: $uni-warning,
warning-disable: $uni-warning-disable,
warning-light: $uni-warning-light,
error: $uni-error,
error-disable: $uni-error-disable,
error-light: $uni-error-light,
info: $uni-info,
info-disable: $uni-info-disable,
info-light: $uni-info-light,
// 中性色
main-color: $uni-main-color,
base-color: $uni-base-color,
secondary-color: $uni-secondary-color,
extra-color: $uni-extra-color,
// 背景色
bg-color: $uni-bg-color,
// 边框颜色
border-1: $uni-border-1,
border-2: $uni-border-2,
border-3: $uni-border-3,
border-4: $uni-border-4,
// 黑色
black:$uni-black,
// 白色
white:$uni-white,
// 透明
transparent:$uni-transparent
) !default;
@each $key, $child in $uni-ui-color {
.uni-#{"" + $key} {
color: $child;
}
.uni-#{"" + $key}-bg {
background-color: $child;
}
}
.uni-shadow-sm {
box-shadow: $uni-shadow-sm;
}
.uni-shadow-base {
box-shadow: $uni-shadow-base;
}
.uni-shadow-lg {
box-shadow: $uni-shadow-lg;
}
.uni-mask {
background-color:$uni-mask;
}
... ...
@mixin radius($r,$d:null ,$important: false){
$radius-value:map-get($uni-radius, $r) if($important, !important, null);
// Key exists within the $uni-radius variable
@if (map-has-key($uni-radius, $r) and $d){
@if $d == t {
border-top-left-radius:$radius-value;
border-top-right-radius:$radius-value;
}@else if $d == r {
border-top-right-radius:$radius-value;
border-bottom-right-radius:$radius-value;
}@else if $d == b {
border-bottom-left-radius:$radius-value;
border-bottom-right-radius:$radius-value;
}@else if $d == l {
border-top-left-radius:$radius-value;
border-bottom-left-radius:$radius-value;
}@else if $d == tl {
border-top-left-radius:$radius-value;
}@else if $d == tr {
border-top-right-radius:$radius-value;
}@else if $d == br {
border-bottom-right-radius:$radius-value;
}@else if $d == bl {
border-bottom-left-radius:$radius-value;
}
}@else{
border-radius:$radius-value;
}
}
@each $key, $child in $uni-radius {
@if($key){
.uni-radius-#{"" + $key} {
@include radius($key)
}
}@else{
.uni-radius {
@include radius($key)
}
}
}
@each $direction in t, r, b, l,tl, tr, br, bl {
@each $key, $child in $uni-radius {
@if($key){
.uni-radius-#{"" + $direction}-#{"" + $key} {
@include radius($key,$direction,false)
}
}@else{
.uni-radius-#{$direction} {
@include radius($key,$direction,false)
}
}
}
}
... ...
@mixin fn($space,$direction,$size,$n) {
@if $n {
#{$space}-#{$direction}: #{$size*$uni-space-root}px
} @else {
#{$space}-#{$direction}: #{-$size*$uni-space-root}px
}
}
@mixin get-styles($direction,$i,$space,$n){
@if $direction == t {
@include fn($space, top,$i,$n);
}
@if $direction == r {
@include fn($space, right,$i,$n);
}
@if $direction == b {
@include fn($space, bottom,$i,$n);
}
@if $direction == l {
@include fn($space, left,$i,$n);
}
@if $direction == x {
@include fn($space, left,$i,$n);
@include fn($space, right,$i,$n);
}
@if $direction == y {
@include fn($space, top,$i,$n);
@include fn($space, bottom,$i,$n);
}
@if $direction == a {
@if $n {
#{$space}:#{$i*$uni-space-root}px;
} @else {
#{$space}:#{-$i*$uni-space-root}px;
}
}
}
@each $orientation in m,p {
$space: margin;
@if $orientation == m {
$space: margin;
} @else {
$space: padding;
}
@for $i from 0 through 16 {
@each $direction in t, r, b, l, x, y, a {
.uni-#{$orientation}#{$direction}-#{$i} {
@include get-styles($direction,$i,$space,true);
}
.uni-#{$orientation}#{$direction}-n#{$i} {
@include get-styles($direction,$i,$space,false);
}
}
}
}
\ No newline at end of file
... ...
/* #ifndef APP-NVUE */
$-color-white:#fff;
$-color-black:#000;
@mixin base-style($color) {
color: #fff;
background-color: $color;
border-color: mix($-color-black, $color, 8%);
&:not([hover-class]):active {
background: mix($-color-black, $color, 10%);
border-color: mix($-color-black, $color, 20%);
color: $-color-white;
outline: none;
}
}
@mixin is-color($color) {
@include base-style($color);
&[loading] {
@include base-style($color);
&::before {
margin-right:5px;
}
}
&[disabled] {
&,
&[loading],
&:not([hover-class]):active {
color: $-color-white;
border-color: mix(darken($color,10%), $-color-white);
background-color: mix($color, $-color-white);
}
}
}
@mixin base-plain-style($color) {
color:$color;
background-color: mix($-color-white, $color, 90%);
border-color: mix($-color-white, $color, 70%);
&:not([hover-class]):active {
background: mix($-color-white, $color, 80%);
color: $color;
outline: none;
border-color: mix($-color-white, $color, 50%);
}
}
@mixin is-plain($color){
&[plain] {
@include base-plain-style($color);
&[loading] {
@include base-plain-style($color);
&::before {
margin-right:5px;
}
}
&[disabled] {
&,
&:active {
color: mix($-color-white, $color, 40%);
background-color: mix($-color-white, $color, 90%);
border-color: mix($-color-white, $color, 80%);
}
}
}
}
.uni-btn {
margin: 5px;
color: #393939;
border:1px solid #ccc;
font-size: 16px;
font-weight: 200;
background-color: #F9F9F9;
// TODO 暂时处理边框隐藏一边的问题
overflow: visible;
&::after{
border: none;
}
&:not([type]),&[type=default] {
color: #999;
&[loading] {
background: none;
&::before {
margin-right:5px;
}
}
&[disabled]{
color: mix($-color-white, #999, 60%);
&,
&[loading],
&:active {
color: mix($-color-white, #999, 60%);
background-color: mix($-color-white,$-color-black , 98%);
border-color: mix($-color-white, #999, 85%);
}
}
&[plain] {
color: #999;
background: none;
border-color: $uni-border-1;
&:not([hover-class]):active {
background: none;
color: mix($-color-white, $-color-black, 80%);
border-color: mix($-color-white, $-color-black, 90%);
outline: none;
}
&[disabled]{
&,
&[loading],
&:active {
background: none;
color: mix($-color-white, #999, 60%);
border-color: mix($-color-white, #999, 85%);
}
}
}
}
&:not([hover-class]):active {
color: mix($-color-white, $-color-black, 50%);
}
&[size=mini] {
font-size: 16px;
font-weight: 200;
border-radius: 8px;
}
&.uni-btn-small {
font-size: 14px;
}
&.uni-btn-mini {
font-size: 12px;
}
&.uni-btn-radius {
border-radius: 999px;
}
&[type=primary] {
@include is-color($uni-primary);
@include is-plain($uni-primary)
}
&[type=success] {
@include is-color($uni-success);
@include is-plain($uni-success)
}
&[type=error] {
@include is-color($uni-error);
@include is-plain($uni-error)
}
&[type=warning] {
@include is-color($uni-warning);
@include is-plain($uni-warning)
}
&[type=info] {
@include is-color($uni-info);
@include is-plain($uni-info)
}
}
/* #endif */
... ...
@mixin get-styles($k,$c) {
@if $k == size or $k == weight{
font-#{$k}:#{$c}
}@else{
#{$k}:#{$c}
}
}
@each $key, $child in $uni-headings {
/* #ifndef APP-NVUE */
.uni-#{$key} {
@each $k, $c in $child {
@include get-styles($k,$c)
}
}
/* #endif */
/* #ifdef APP-NVUE */
.container .uni-#{$key} {
@each $k, $c in $child {
@include get-styles($k,$c)
}
}
/* #endif */
}
... ...
// @use "sass:math";
@import '../tools/functions.scss';
// 间距基础倍数
$uni-space-root: 2 !default;
// 边框半径默认值
$uni-radius-root:5px !default;
$uni-radius: () !default;
// 边框半径断点
$uni-radius: map-deep-merge(
(
0: 0,
// TODO 当前版本暂时不支持 sm 属性
// 'sm': math.div($uni-radius-root, 2),
null: $uni-radius-root,
'lg': $uni-radius-root * 2,
'xl': $uni-radius-root * 6,
'pill': 9999px,
'circle': 50%
),
$uni-radius
);
// 字体家族
$body-font-family: 'Roboto', sans-serif !default;
// 文本
$heading-font-family: $body-font-family !default;
$uni-headings: () !default;
$letterSpacing: -0.01562em;
$uni-headings: map-deep-merge(
(
'h1': (
size: 32px,
weight: 300,
line-height: 50px,
// letter-spacing:-0.01562em
),
'h2': (
size: 28px,
weight: 300,
line-height: 40px,
// letter-spacing: -0.00833em
),
'h3': (
size: 24px,
weight: 400,
line-height: 32px,
// letter-spacing: normal
),
'h4': (
size: 20px,
weight: 400,
line-height: 30px,
// letter-spacing: 0.00735em
),
'h5': (
size: 16px,
weight: 400,
line-height: 24px,
// letter-spacing: normal
),
'h6': (
size: 14px,
weight: 500,
line-height: 18px,
// letter-spacing: 0.0125em
),
'subtitle': (
size: 12px,
weight: 400,
line-height: 20px,
// letter-spacing: 0.00937em
),
'body': (
font-size: 14px,
font-weight: 400,
line-height: 22px,
// letter-spacing: 0.03125em
),
'caption': (
'size': 12px,
'weight': 400,
'line-height': 20px,
// 'letter-spacing': 0.03333em,
// 'text-transform': false
)
),
$uni-headings
);
// 主色
$uni-primary: #2979ff !default;
$uni-primary-disable:lighten($uni-primary,20%) !default;
$uni-primary-light: lighten($uni-primary,25%) !default;
// 辅助色
// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
$uni-success: #18bc37 !default;
$uni-success-disable:lighten($uni-success,20%) !default;
$uni-success-light: lighten($uni-success,25%) !default;
$uni-warning: #f3a73f !default;
$uni-warning-disable:lighten($uni-warning,20%) !default;
$uni-warning-light: lighten($uni-warning,25%) !default;
$uni-error: #e43d33 !default;
$uni-error-disable:lighten($uni-error,20%) !default;
$uni-error-light: lighten($uni-error,25%) !default;
$uni-info: #8f939c !default;
$uni-info-disable:lighten($uni-info,20%) !default;
$uni-info-light: lighten($uni-info,25%) !default;
// 中性色
// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
$uni-main-color: #3a3a3a !default; // 主要文字
$uni-base-color: #6a6a6a !default; // 常规文字
$uni-secondary-color: #909399 !default; // 次要文字
$uni-extra-color: #c7c7c7 !default; // 辅助说明
// 边框颜色
$uni-border-1: #F0F0F0 !default;
$uni-border-2: #EDEDED !default;
$uni-border-3: #DCDCDC !default;
$uni-border-4: #B9B9B9 !default;
// 常规色
$uni-black: #000000 !default;
$uni-white: #ffffff !default;
$uni-transparent: rgba($color: #000000, $alpha: 0) !default;
// 背景色
$uni-bg-color: #f7f7f7 !default;
/* 水平间距 */
$uni-spacing-sm: 8px !default;
$uni-spacing-base: 15px !default;
$uni-spacing-lg: 30px !default;
// 阴影
$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5) !default;
$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2) !default;
$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5) !default;
// 蒙版
$uni-mask: rgba($color: #000000, $alpha: 0.4) !default;
... ...
// 合并 map
@function map-deep-merge($parent-map, $child-map){
$result: $parent-map;
@each $key, $child in $child-map {
$parent-has-key: map-has-key($result, $key);
$parent-value: map-get($result, $key);
$parent-type: type-of($parent-value);
$child-type: type-of($child);
$parent-is-map: $parent-type == map;
$child-is-map: $child-type == map;
@if (not $parent-has-key) or ($parent-type != $child-type) or (not ($parent-is-map and $child-is-map)){
$result: map-merge($result, ( $key: $child ));
}@else {
$result: map-merge($result, ( $key: map-deep-merge($parent-value, $child) ));
}
}
@return $result;
};
... ...
// 间距基础倍数
$uni-space-root: 2;
// 边框半径默认值
$uni-radius-root:5px;
// 主色
$uni-primary: #2979ff;
// 辅助色
$uni-success: #4cd964;
// 警告色
$uni-warning: #f0ad4e;
// 错误色
$uni-error: #dd524d;
// 描述色
$uni-info: #909399;
// 中性色
$uni-main-color: #303133;
$uni-base-color: #606266;
$uni-secondary-color: #909399;
$uni-extra-color: #C0C4CC;
// 背景色
$uni-bg-color: #f5f5f5;
// 边框颜色
$uni-border-1: #DCDFE6;
$uni-border-2: #E4E7ED;
$uni-border-3: #EBEEF5;
$uni-border-4: #F2F6FC;
// 常规色
$uni-black: #000000;
$uni-white: #ffffff;
$uni-transparent: rgba($color: #000000, $alpha: 0);
... ...
@import './styles/setting/_variables.scss';
// 间距基础倍数
$uni-space-root: 2;
// 边框半径默认值
$uni-radius-root:5px;
// 主色
$uni-primary: #2979ff;
$uni-primary-disable:mix(#fff,$uni-primary,50%);
$uni-primary-light: mix(#fff,$uni-primary,80%);
// 辅助色
// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
$uni-success: #18bc37;
$uni-success-disable:mix(#fff,$uni-success,50%);
$uni-success-light: mix(#fff,$uni-success,80%);
$uni-warning: #f3a73f;
$uni-warning-disable:mix(#fff,$uni-warning,50%);
$uni-warning-light: mix(#fff,$uni-warning,80%);
$uni-error: #e43d33;
$uni-error-disable:mix(#fff,$uni-error,50%);
$uni-error-light: mix(#fff,$uni-error,80%);
$uni-info: #8f939c;
$uni-info-disable:mix(#fff,$uni-info,50%);
$uni-info-light: mix(#fff,$uni-info,80%);
// 中性色
// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
$uni-main-color: #3a3a3a; // 主要文字
$uni-base-color: #6a6a6a; // 常规文字
$uni-secondary-color: #909399; // 次要文字
$uni-extra-color: #c7c7c7; // 辅助说明
// 边框颜色
$uni-border-1: #F0F0F0;
$uni-border-2: #EDEDED;
$uni-border-3: #DCDCDC;
$uni-border-4: #B9B9B9;
// 常规色
$uni-black: #000000;
$uni-white: #ffffff;
$uni-transparent: rgba($color: #000000, $alpha: 0);
// 背景色
$uni-bg-color: #f7f7f7;
/* 水平间距 */
$uni-spacing-sm: 8px;
$uni-spacing-base: 15px;
$uni-spacing-lg: 30px;
// 阴影
$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5);
$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2);
$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5);
// 蒙版
$uni-mask: rgba($color: #000000, $alpha: 0.4);
... ...
MIT License
Copyright (c) 2020 www.uviewui.com
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.
\ No newline at end of file
... ...
<p align="center">
<img alt="logo" src="https://uviewui.com/common/logo.png" width="120" height="120" style="margin-bottom: 10px;">
</p>
<h3 align="center" style="margin: 30px 0 30px;font-weight: bold;font-size:40px;">uview-plus 3.0</h3>
<h3 align="center">多平台快速开发的UI框架</h3>
[![stars](https://img.shields.io/github/stars/ijry/uview-plus?style=flat-square&logo=GitHub)](https://github.com/ijry/uview-plus)
[![forks](https://img.shields.io/github/forks/ijry/uview-plus?style=flat-square&logo=GitHub)](https://github.com/ijry/uview-plus)
[![issues](https://img.shields.io/github/issues/ijry/uview-plus?style=flat-square&logo=GitHub)](https://github.com/ijry/uview-plus/issues)
[![release](https://img.shields.io/github/v/release/ijry/uview-plus?style=flat-square)](https://gitee.com/jry/uview-plus/releases)
[![license](https://img.shields.io/github/license/ijry/uview-plus?style=flat-square)](https://en.wikipedia.org/wiki/MIT_License)
## 说明
uview-plus,是uni-app全面兼容vue3/nvue的uni-app生态框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水。uview-plus是基于uView2.x移植的支持vue3的版本,感谢uView。
## [官方文档:https://uview-plus.jiangruyi.com](https://uview-plus.jiangruyi.com)
## 预览
您可以通过**微信**扫码,查看最佳的演示效果。
<br>
<br>
<img src="https://uview-plus.jiangruyi.com/common/h5_qrcode.png" width="220" height="220" >
## 链接
- [官方文档](https://uview-plus.jiangruyi.com)
- [更新日志](https://uview-plus.jiangruyi.com/components/changelog.html)
- [升级指南](https://uview-plus.jiangruyi.com/components/changeGuide.html)
- [关于我们](https://uview-plus.jiangruyi.com/cooperation/about.html)
## 交流反馈
欢迎加入我们的QQ群交流反馈:[点此跳转](https://uview-plus.jiangruyi.com/components/addQQGroup.html)
## 关于PR
> 我们非常乐意接受各位的优质PR,但在此之前我希望您了解uview-plus是一个需要兼容多个平台的(小程序、h5、ios app、android app)包括nvue页面、vue页面。
> 所以希望在您修复bug并提交之前尽可能的去这些平台测试一下兼容性。最好能携带测试截图以方便审核。非常感谢!
## 安装
#### **uni-app插件市场链接** —— [https://ext.dcloud.net.cn/plugin?name=uview-plus](https://ext.dcloud.net.cn/plugin?name=uview-plus)
请通过[官网安装文档](https://uview-plus.jiangruyi.com/components/install.html)了解更详细的内容
## 快速上手
请通过[快速上手](https://uview-plus.jiangruyi.com/components/quickstart.html)了解更详细的内容
## 使用方法
配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。
```html
<template>
<u-button text="按钮"></u-button>
</template>
```
## 版权信息
uview-plus遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uview-plus应用到您的产品中。
... ...