作者 xiaoqiu

完成原型图上所以功能

正在显示 50 个修改的文件 包含 3907 行增加188 行删除

要显示太多修改。

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

不能预览此文件类型
... ... @@ -9,6 +9,9 @@ export const userWxLogin = (data, config = {}) => http.post('/wechat/login', dat
// 发起登记流程
export const carInfoAdd = (data) => http.post('/registration/add', data, {custom: {auth: true}})
// 修改登记信息
export const carInfoEdit = (data) => http.post('/registration/edit', data, {custom: {auth: true}})
// 办理一个用户任务
export const disposeUser = (taskId) => http.post(`​/registration/completeTask/${taskId}`, {}, {custom: {auth: true}})
... ... @@ -27,6 +30,9 @@ export const getUserInfo = (data) => http.get('/system/user/profile', {custom: {
// 修改用户信息
export const updateUserInfo = (data) => http.put('/system/user/profile', data, {custom: {auth: true}})
// 用户注销
export const userCancel = () => http.get('/system/user/deRegistration', {custom: {auth: true}})
// 获取验证码
export const getCodeImg = (data) => http.get('/captchaImage')
... ...
... ... @@ -3,9 +3,18 @@ import { http } from '@/uni_modules/uview-plus'
// 获取待办任务
export const queryMyList = (data) => http.get(`/registration/mylist`, {params: data, custom: {auth: true}})
// 查询待处理订单
export const queryPengdingList = (data) => http.get(`/registration/monitor/listPending`, {params: data, custom: {auth: true}})
// 查询已处理订单
export const queryProcessedList = (data) => http.get(`/registration/monitor/listProcessed`, {params: data, custom: {auth: true}})
// 查询进行中订单
export const queryOngoingList = (data) => http.get(`/registration/monitor/listOngoing`, {params: data, custom: {auth: true}})
// 查询已作废订单
export const queryDeprecatedList = (data) => http.get(`/registration/monitor/listDeprecated`, {params: data, custom: {auth: true}})
// 查询已承接保单
export const queryContinueList = (data) => http.get(`/registration/monitor/listReports`, {params: data, custom: {auth: true}})
... ... @@ -19,4 +28,14 @@ export const disposeUser = (data, taskId) => http.post(`/registration/completeTa
export const transfer = (data, taskId) => http.post(`/registratiom/transferTask/${taskId}`, data, {custom: {auth: true}})
// 获取人员列表
export const getUserList = (data) => http.post(`/system/user/otherEmployee`, data, {custom: {auth: true}})
\ No newline at end of file
export const getUserList = (data) => http.get(`/system/user/otherEmployee`, {params: data,custom: {auth: true}})
// 获取公司列表
export const listDept = (data) => http.get(`/system/dept/list`, {params: data, custom: {auth: true}})
// 查询保单回馈
export const queryResult = (data) => http.get(`/registration/monitor/getResult`, {params: data, custom: {auth: true}})
// 查询作废备注
export const queryDefeatContent = (data) => http.get(`/registration/monitor/getComment`, {params: data, custom: {auth: true}})
... ...
... ... @@ -4,7 +4,7 @@
<slot name="center"></slot>
<view class="rowLine"></view>
<slot name="footer"></slot>
<view class="tip" :style="{backgroundColor: bgColor, color: fontColor}">{{ carInfo?.status || tipContent }}</view>
<view class="tip" :style="{backgroundColor: bgColor, color: fontColor}">{{ carInfo?.policyStatus ?? tipContent }}</view>
</view>
</template>
... ... @@ -20,9 +20,8 @@ const props = defineProps({
default: ''
}
})
const emit = defineEmits(['onSkip'])
const bgColor = computed(() => {
let index = props.carInfo.status
let index = props.carInfo?.policyStatus || 0
let objColor = {
'进行中': '#D5E5FF',
'已完成': '#dbf1e1',
... ... @@ -31,7 +30,7 @@ const bgColor = computed(() => {
return objColor[index] || '#D5E5FF'
})
const fontColor = computed(() => {
let index = props.carInfo.status
let index = props.carInfo?.policyStatus || 0
let objColor = {
'进行中': '#3680FE',
'已完成': '#19be6b',
... ... @@ -39,10 +38,6 @@ const fontColor = computed(() => {
}
return objColor[index] || '#3680FE'
})
const skip = () => {
emit('onSkip', props.carInfo.carId)
}
</script>
<style lang="scss" scoped>
... ... @@ -62,8 +57,7 @@ const skip = () => {
position: absolute;
top: 0;
right: 0;
width: 120rpx;
height: 40rpx;
padding: 0 20rpx;
text-align: center;
font-size: 20rpx;
line-height: 40rpx;
... ...
<template>
<view class="centerLine" :style="{color: fontColor}">
<text @click="leftComfirn">{{ leftContent }}</text>
<text @click="leftComfirnButton">{{ leftContent }}</text>
<text class="line" :style="{backgroundColor: fontColor}"></text>
<text @click="rightComfirn">{{ rightContent }}</text>
<text @click="rightComfirnButton">{{ rightContent }}</text>
</view>
</template>
... ...
... ... @@ -2,35 +2,158 @@
<view class="operate">
<view class="operate_list">
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 0 }" @click="handleReturn">退回</text>
<text class="operate_btn" :class="{active: current === 0 }" @click="handleSuccess">通过</text>
</view>
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 1 }" @click="handleInvalid">作废</text>
<text class="operate_btn" :class="{active: current === 1 }" @click="handleReturn">退回</text>
</view>
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 2 }" @click="handleUpdate">修改</text>
<text class="operate_btn" :class="{active: current === 2 }" @click="handleInvalid">作废</text>
</view>
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 3 }" @click="handleCirculation">流转</text>
<text class="operate_btn" :class="{active: current === 3 }" @click="handleUpdate">修改</text>
</view>
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 4 }" @click="handleCirculation">流转</text>
</view>
</view>
<!-- 作废回馈弹出框 -->
<up-modal :show="showDefeat" showCancelButton title="填写作废回馈" @confirm="sunmitDeprecated" @cancel="showDefeat = false">
<up-textarea v-model="DefeatContent" placeholder="请输入内容" ></up-textarea>
</up-modal>
<!-- 分配保险公司 -->
<up-modal :show="showCompany" showCancelButton closeOnClickOverlay title="选择分配项" @confirm="submitForm" @cancel="showCompany = false" @close="showCompany = false">
<view class="slot-content">
<view class="company_box">
<view class="header_top">
<up-input
placeholder="请输入承保公司名称"
prefixIcon="search"
v-model="companyQueryParams.deptName"
></up-input>
<view class="btn" @click="getDeptList">查询</view>
</view>
<up-radio-group v-model="deptId" placement="column">
<up-radio
v-for="(item, index) in deptOptions"
:key="index"
:label="item.deptName"
:name="item.deptId"
/>
</up-radio-group>
</view>
</view>
</up-modal>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { ref, reactive} from 'vue'
import { disposeUser, listDept } from '@/api/work.js'
const props = defineProps({
carInfo: {
type: Object,
require: true
}
})
const emit = defineEmits(['refreshList'])
const deptOptions = ref([]);
const companyQueryParams = reactive({
deptName: undefined,
status: undefined,
});
const deptId = ref(0)
const current = ref(9)
const showDefeat = ref(false)
const DefeatContent = ref('')
const showCompany = ref(false)
// 通过
const handleSuccess = () => {
current.value = 0
uni.showModal({
title: '提示',
content: '是否通过',
success: function (res) {
if (res.confirm) {
disposeUser({ associationapprove: '0' }, props.carInfo.taskId).then((res) => {
uni.$u.toast('保单已通过')
emit('refreshList')
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
// 退回
const handleReturn = () => {
current.value = 0
current.value = 1
uni.showModal({
title: '提示',
content: '是否退回',
success: function (res) {
if (res.confirm) {
disposeUser({ associationapprove: '1' }, props.carInfo.taskId).then((res) => {
uni.$u.toast('保单已退回')
emit('refreshList')
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
// 作废
const handleInvalid = () => {
current.value = 1
current.value = 2
showDefeat.value = true
}
// 修改
const handleUpdate = () => {
current.value = 2
current.value = 3
const id = props.carInfo.businessKey
uni.navigateTo({
url: `/pages/carDetail/carDetail?carInfoId=${id}&roleId=1`
})
}
// 分配
const handleCirculation = () => {
current.value = 3
current.value = 4
getDeptList();
showCompany.value = true
}
/** 查询公司列表 */
const getDeptList = () => {
listDept(companyQueryParams).then((response) => {
deptOptions.value = response.data.filter((item) => item.parentId === 100);
});
}
// 提交作废表单
const sunmitDeprecated = () => {
const data = {
associationapprove: '2',
comment: DefeatContent.value,
};
const taskId = props.carInfo.taskId
disposeUser(data, taskId).then((res) => {
emit('refreshList')
uni.$u.toast('保单已作废')
showDefeat.value = false
});
}
/** 提交通过分配承保公司 */
const submitForm = () => {
const data = {
associationapprove: '0',
deptid: deptId.value.toString(),
};
const taskId = props.carInfo.taskId
disposeUser(data, taskId).then((res) => {
showCompany.value = false;
emit('refreshList')
uni.$u.toast('保单已分配成功')
});
}
</script>
... ... @@ -64,4 +187,17 @@ const handleReturn = () => {
}
}
}
.header_top {
display: flex;
align-items: center;
margin-bottom: 20rpx;
.btn{
height: 68rpx;
line-height: 68rpx;
padding: 0 28rpx;
font-size: 24rpx;
color: #fff;
background-color: #3c9cff;
}
}
</style>
\ No newline at end of file
... ...
<template>
<view class="wordInfo u-line-1">
<text style="min-width: 120rpx;">车主:{{ userName }}</text>
<text style="min-width: 140rpx; margin-right: 20rpx;">车主:{{ userName }}</text>
<text style="min-width: 160rpx; margin-right: 20rpx;">联系电话:{{ phone }}</text>
<text>上年承保公司:{{ company }}</text>
</view>
... ...
... ... @@ -52,8 +52,10 @@
"mp-weixin" : {
"appid" : "wx2884bf0a53ee40b3",
"setting" : {
"urlCheck" : false,
"minified" : true
"urlCheck" : true,
"minified" : true,
"es6" : true,
"postcss" : true
},
"usingComponents" : true,
"lazyCodeLoading" : "requiredComponents",
... ...
... ... @@ -20,7 +20,8 @@
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "客户首页",
"navigationStyle": "custom"
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
... ... @@ -51,7 +52,8 @@
"style" :
{
"navigationBarTitleText" : "公司员工首页",
"navigationStyle": "custom"
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
... ... @@ -75,7 +77,8 @@
"style" :
{
"navigationBarTitleText" : "协会员工首页",
"navigationStyle": "custom"
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
... ... @@ -90,7 +93,17 @@
"path" : "pages/employeeRealName/employeeRealName",
"style" :
{
"navigationBarTitleText" : ""
"navigationBarTitleText" : "员工实名页面",
"navigationStyle": "custom"
}
},
{
"path" : "pages/societyOrder/societyOrder",
"style" :
{
"navigationBarTitleText" : "协会保单页",
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
}
],
... ...
... ... @@ -22,49 +22,49 @@
<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-input v-model="userInfo.nickName" disabled disabledColor="#fff" 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-input v-model="userInfo.identificationNumber" disabled disabledColor="#fff" 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-form-item label="车牌号码" prop="licensePlateNumber" required>
<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-form-item label="号牌种类" prop="lincensePlateTypeId" required>
<uni-data-select
v-model="form.lincensePlateTypeId"
:localdata="carNumOption"
placeholder="请选择号牌种类"
/>
</up-form-item>
<up-form-item label="车架号" prop="frameNumber">
<up-form-item label="车架号" prop="frameNumber" required>
<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-form-item label="发动机号" prop="engineNumber" required>
<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-form-item label="车辆类型" prop="vehicleTypeId" required>
<uni-data-select
v-model="form.vehicleTypeId"
:localdata="carTypeOption"
placeholder="请选择车辆类型"
/>
</up-form-item>
<up-form-item label="车辆使用性质" prop="vehicleNature">
<up-form-item label="车辆使用性质" prop="vehicleNatureId" required>
<uni-data-select
v-model="form.vehicleNatureId"
:localdata="carNatureOption"
placeholder="请选择车辆使用性质"
/>
</up-form-item>
<up-form-item label="核定客载数(人)" prop="passengersNumber">
<up-form-item label="核定客载数(人)" prop="passengersNumber" required>
<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-form-item label="核定载质量(千克)" prop="passengerCapacity" required>
<up-input v-model="form.passengerCapacity" fontSize="28rpx" color="#999" placeholder="请输入核载重量" border="none" inputAlign="right" />
</up-form-item>
<up-form-item label="排量毫升" prop="emissions">
... ... @@ -92,7 +92,7 @@
<up-form-item v-else label="中文品牌" prop="vehicleBrand">
<up-input v-model="form.customizeVehicleBrand" fontSize="28rpx" color="#999" placeholder="请填写中文品牌" border="none" inputAlign="right" />
</up-form-item>
<up-form-item label="准牵引质量" prop="tractionMass">
<up-form-item label="准牵引质量" prop="tractionMass" required>
<up-input v-model="form.tractionMass" fontSize="28rpx" color="#999" placeholder="请填写准牵引准质量" border="none" inputAlign="right" />
</up-form-item>
<up-form-item label="保险需求" prop="requirements">
... ... @@ -106,7 +106,8 @@
<view class="tip">请认真核实车辆信息,实际投保车辆信息以保险公司确认为准</view>
<view class="btn confirmBtn" @click="submitInfo">确认</view>
<view v-show="!isEdit" class="btn confirmBtn" @click="submitInfo">确认</view>
<view v-show="isRole" class="btn confirmBtn" @click="submitEdit">提交修改</view>
</up-form>
<up-popup :show="showTip" mode="center" :safeAreaInsetBottom="false" round="20" @close="showTip = false">
<view class="notice">
... ... @@ -124,10 +125,13 @@
import { debounce } from '@/uni_modules/uview-plus';
import { computed, reactive, ref } from 'vue';
import navTop from '@/components/navTop.vue';
import { carInfoAdd } from '@/api/user.js'
import { onLoad } from '@dcloudio/uni-app'
import { carInfoAdd, carInfoEdit } from '@/api/user.js'
import { onLoad, onReady } from '@dcloudio/uni-app'
import { disposeUser } from '@/api/work.js'
import useUserStore from '@/store/modules/user';
import { getCarNumApi, getCarTypeApi, getCarNatureApi, getCarBrandApi, getCarModelApi, getNeedApi, getListDeptApi, getCarDetail } from '@/api/car.js'
const showTip = ref(true)
const { userInfo } = useUserStore()
const brandTitle = ref('请选择中文品牌')
const disable = ref(false)
const labelStyle = {
... ... @@ -135,8 +139,13 @@ const labelStyle = {
lineHeight: '38rpx',
color: '#3D3D3D'
}
// 表单引用
const uFormRef = ref(null)
const isShowHeader = ref(false)
const isCustom = ref(false)
const taskId = ref('')
const isEdit = ref(false)
const isRole = ref(false)
const searchList = ref([])
const showList = ref(false)
const form = ref({
... ... @@ -171,11 +180,41 @@ const queryModelParams = reactive({
pageNum: 1,
modelName: undefined
})
const rules = {
licensePlateNumber: [{ required: true, message: '请输入车牌号', trigger: ['blur', 'change']}],
lincensePlateTypeId: [{ required: true, message: '请选择号牌种类', trigger: ['change']}],
frameNumber: [{ required: true, message: '请输入车架号', trigger: ['blur', 'change']}],
engineNumber: [{ required: true, message: '请输入发动机号', trigger: ['blur', 'change']}],
vehicleTypeId: [{ required: true, message: '请选择车辆类型', trigger: ['change']}],
vehicleNatureId: [{ required: true, message: '请选择车辆使用性质', trigger: ['blur', 'change']}],
passengersNumber: [
{ required: true, message: '请输入载客人数', trigger: ['blur', 'change']},
{ type: 'number', message: '请输入整数', trigger: ['blur', 'change']}
],
passengerCapacity: [
{ required: true, message: '请输入核定载质量', trigger: ['blur', 'change']},
{ type: 'number', message: '请输入整数', trigger: ['blur', 'change']}
],
tractionMass: [
{ required: true, message: '请输入准牵引质量', trigger: ['blur', 'change']},
{ type: 'number', message: '请输入整数', trigger: ['blur', 'change']}
]
}
// 微信小程序需要在此注册校验规则
onReady(() => {
uFormRef.value.setRules(rules)
})
onLoad(async (options) => {
if(options.roleId !== undefined || options.taskId !== undefined){
isRole.value = true
taskId.value = options.taskId
}
if(options.carInfoId !== undefined) {
const { data } = await getCarDetail(options.carInfoId)
form.value = data
isCustom.value = data.isCustomizeBrandAndModel == "0"
isEdit.value = true
isShowHeader.value = true
}
})
... ... @@ -187,7 +226,7 @@ const getCompanyOption = () => {
const newList = data.filter(item => item.parentId === 100)
const arrList = newList.map(item => {
return {
value: item.deptId,
value: item.deptId.toString(),
text: item.deptName
}
})
... ... @@ -299,10 +338,52 @@ const selectModel = (item) => {
isCustom.value = true
form.value.isCustomizeBrandAndModel = '0'
}
// 添加车辆信息
const submitInfo = async () => {
await carInfoAdd(form.value)
uni.$u.toast('添加成功')
if(form.value.isCustomizeBrandAndModel === '1') {
if(form.value.customizeVehicleBrand === '' || form.value.customizeVehicleModel === '') {
return uni.$u.toast('车辆型号和品牌必须填写')
}
}else {
if(form.value.vehicleBrandId === '' || form.value.vehicleModelId === '') {
return uni.$u.toast('车辆型号和品牌必须填写')
}
}
uFormRef.value.validate().then(async valid => {
if (valid) {
await carInfoAdd(form.value)
uni.$u.toast('添加成功')
uni.navigateBack()
} else {
uni.$u.toast('校验失败')
}
}).catch((err) => {
// 处理验证错误
uni.$u.toast('校验失败')
});
}
// 提交修改
const submitEdit = async () => {
if(form.value.isCustomizeBrandAndModel === '1') {
if(form.value.customizeVehicleBrand === '' || form.value.customizeVehicleModel === '') {
return uni.$u.toast('车辆型号和品牌必须填写')
}
}else {
if(form.value.vehicleBrandId === '' || form.value.vehicleModelId === '') {
return uni.$u.toast('车辆型号和品牌必须填写')
}
}
if(!taskId.value === undefined) {
await carInfoEdit(form.value)
uni.$u.toast('修改成功')
uni.navigateBack()
}else {
await carInfoEdit(form.value)
disposeUser({reregistration:'true'}, taskId.value).then(res => {
uni.$u.toast('提交成功')
})
uni.navigateBack()
}
}
</script>
... ...
... ... @@ -25,7 +25,8 @@
<wordInfo :phone="carItem.phone" :userName="carItem.name" :company="carItem.sysDeptName" />
</template>
<template #footer>
<centerLine leftContent="承接" rightContent="转办" @leftComfirn="handleContinue(carItem.taskId)" @rightComfirn="handleSharing(carItem.taskId)"></centerLine>
<centerLine v-if="carItem.orderProgress === '已承接'" leftContent="承接回馈" rightContent="疑难件" @leftComfirn="handleFeedback(carItem.taskId)" @rightComfirn="handleTroubleshooting(carItem.taskId)"></centerLine>
<centerLine v-else leftContent="承接" rightContent="转办" @leftComfirn="handleContinue(carItem.taskId)" @rightComfirn="handleSharing(carItem.taskId)"></centerLine>
</template>
</carCard>
<up-empty
... ... @@ -33,6 +34,10 @@
mode="list"
text="暂无待办事项"
/>
<!-- 分页器 -->
<view v-show="List.length > 0">
<uni-pagination :total="allTotal" v-model="queryParams.pageNum" :pageSize="queryParams.pageSize" @change="getList" />
</view>
</view>
</scroll-view>
</view>
... ... @@ -57,6 +62,10 @@
mode="list"
text="暂无数据"
/>
<!-- 分页器 -->
<view v-show="ProcessedList.length > 0">
<uni-pagination :total="allTotal" v-model="continueQueryParams.pageNum" :pageSize="continueQueryParams.pageSize" @change="getProcessedList" />
</view>
</view>
</scroll-view>
</view>
... ... @@ -70,11 +79,11 @@
<navTop :carNum="carItem.licensePlateNumber" />
</template>
<template #center>
<ownerInfo :carInfo="carItem" />
<wordInfo :phone="carItem.phone" :userName="carItem.name" :company="carItem.sysDeptName" />
</template>
<template #footer>
<view class="delInfo">
<text @click="goCarDetail">查看详情</text>
<text @click="lookRemark(carItem.processInstanceId)">查看回馈</text>
</view>
</template>
</carCard>
... ... @@ -83,6 +92,10 @@
mode="list"
text="暂无数据"
/>
<!-- 分页器 -->
<view v-show="EndedList.length > 0">
<uni-pagination :total="allTotal" v-model="queryParams.pageNum" :pageSize="queryParams.pageSize" @change="getEndedList" />
</view>
</view>
</scroll-view>
</view>
... ... @@ -92,33 +105,37 @@
</view>
<!-- 填写承接回馈弹出框 -->
<up-modal :show="showFeedback" title="填写回馈及单号" @confirm="submitFeedback" @cancel="showFeedback = false">
<view class="slot-content">
<up-form :model="FeedbackForm">
<up-form-item label="承保单号" prop="name">
<up-input v-model="FeedbackForm.policynumber" />
</up-form-item>
<up-form-item label="回馈内容" prop="name">
<rich-text :nodes="FeedbackForm.message"></rich-text>
</up-form-item>
</up-form>
</view>
<up-modal :show="showFeedback" showCancelButton title="填写回馈及单号" @confirm="submitFeedback" @cancel="showFeedback = false">
<up-form :model="FeedbackForm" labelWidth="80">
<up-form-item label="承保单号" prop="name">
<up-input v-model="FeedbackForm.policynumber" />
</up-form-item>
<up-form-item label="回馈内容" prop="name">
<up-textarea v-model="FeedbackForm.message" placeholder="请输入内容" ></up-textarea>
</up-form-item>
</up-form>
</up-modal>
<!-- 查看回馈弹出框 -->
<up-modal :show="showRemark" title="回馈内容" @confirm="showRemark = false">
<up-form :model="remarkForm" labelWidth="80">
<up-form-item label="承保单号" prop="name">
<up-input v-model="remarkForm.policyNumber" />
</up-form-item>
<up-form-item label="回馈内容" prop="name">
<up-parse :content="remarkForm.message"></up-parse>
</up-form-item>
</up-form>
</up-modal>
<!-- 转办弹出框 -->
<up-modal :show="showSharing" title="选择转办人员" @confirm="submitSharing" @cancel="showSharing = false">
<view class="slot-content">
<up-radio-group
v-model="transferForm.username"
>
<up-radio
v-for="(item, index) in transferOptions"
:key="index"
:label="item.userName"
:name="item.userName"
/>
</up-radio-group>
</view>
<up-modal :show="showSharing" showCancelButton title="选择转办人员" @confirm="submitSharing" @cancel="showSharing = false">
<up-radio-group v-model="transferForm.username">
<up-radio
v-for="(item, index) in transferOptions"
:key="index"
:label="item.userName"
:name="item.userName"
/>
</up-radio-group>
</up-modal>
<!-- 底部导航栏 -->
<up-tabbar
... ... @@ -145,7 +162,7 @@
import centerLine from '@/components/centerLine.vue';
import wordInfo from '@/components/wordInfo.vue';
import navTop from '@/components/navTop.vue';
import { queryMyList, queryContinueList, queryEndedList ,disposeUser, getUserList, transfer } from '@/api/work.js'
import { queryMyList, queryContinueList, queryEndedList ,disposeUser, getUserList, transfer, queryResult } from '@/api/work.js'
import ownerInfo from '@/components/ownerInfo.vue';
import useTabbarStore from '@/store/modules/tabbar.js'
const useTabbar = useTabbarStore()
... ... @@ -153,13 +170,19 @@
const ProcessedList = ref([]) // 已处理列表
const EndedList = ref([]) // 已完结列表
const expertActive = ref(0)
const allTotal = ref(0)
const transferForm = ref({
username: '',
taskId: ''
})
const transferOptions = reactive([]);
const transferOptions = ref([]);
const showFeedback = ref(false)
const showSharing = ref(false)
const showRemark = ref(false)
const remarkForm = ref({
message: "",
policyNumber: ""
})
const FeedbackForm = ref({
policystatus: "2",
message: "",
... ... @@ -167,11 +190,11 @@
})
const queryParams = reactive({
pageNum: 1,
pageSize: 20
pageSize: 10
});
const continueQueryParams = reactive({
pageNum: 1,
pageSize: 20,
pageSize: 10,
orderprogress: 1,
policystatus: 0
});
... ... @@ -205,6 +228,7 @@
const getList = async () => {
const { data } = await queryMyList(queryParams);
List.value = data.rows;
allTotal.value = data.total
useTabbar.companyTotal = data.total;
};
... ... @@ -212,12 +236,14 @@
const getProcessedList = async () => {
const { rows, total } = await queryContinueList(continueQueryParams);
ProcessedList.value = rows;
allTotal.value = total
useTabbar.companyTotal = total;
};
// 获取已完结保单
const getEndedList = async () => {
const { rows, total } = await queryEndedList(queryParams);
EndedList.value = rows;
allTotal.value = total
useTabbar.companyTotal = total;
};
... ... @@ -295,11 +321,13 @@
url: '/pages/companyMy/companyMy'
})
}
// 车主详情
const goCarDetail = () => {
uni.navigateTo({
url: '/pages/ownerDetail/ownerDetail'
})
/**查看保单回馈 */
const lookRemark = (processInstanceId) => {
queryResult({ processInstanceId }).then((res) => {
remarkForm.value.policyNumber = res?.data?.policyNumber;
remarkForm.value.message = res?.data?.message;
showRemark.value = true;
});
}
getList()
</script>
... ...
... ... @@ -11,34 +11,34 @@
<up-form-item prop="nickName">
<up-input v-model="userInfo.nickName" 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>
<image style="width: 32rpx;height: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="userInfo.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>
<image style="width: 32rpx;height: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="phonenumber">
<up-input v-model="userInfo.phonenumber" 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>
<image style="width: 32rpx;height: 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">
<view class="line_title">
<text class="left_title">状态设置</text>
</view> -->
</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="status">
<view class="statusBtn" :class="{active: userInfo.jobStatus === '0'}" @click="changeStatus('0')">在岗</view>
<view class="statusBtn" :class="{active: userInfo.jobStatus === '1'}" @click="changeStatus('1')">离岗</view>
</view>
<view class="loginBtn" @click="loginOut">退出登录</view>
</view>
... ... @@ -60,9 +60,8 @@ import { updateUserInfo } from '@/api/user.js'
import { onReady } from '@dcloudio/uni-app'
import useTabbarStore from '@/store/modules/tabbar.js'
import useUserStore from '@/store/modules/user.js';
const { userInfo, Logout } = useUserStore()
const { userInfo, Logout, getUser } = useUserStore()
const useTabbar = useTabbarStore()
const status = ref(0)
const showNotice = ref(true)
const customStyle = {
height: '80rpx',
... ... @@ -138,11 +137,19 @@ const goRouter = (index) => {
})
}
// 设置在岗状态
const changeStatus = async (status) => {
userInfo.jobStatus = status
await updateUserInfo(userInfo)
await getUser()
uni.$u.toast('更新成功')
}
// 提交方法
const submit = () => {
userFormRef.value.validate().then(async valid => {
if (valid) {
await updateUserInfo(userInfo)
await getUser()
uni.$u.toast('更新成功')
} else {
uni.$u.toast('校验失败')
... ...
... ... @@ -3,7 +3,7 @@
<up-navbar placeholder :leftIconSize="0" bgColor="transparent" />
<view class="car_list">
<view class="title">车辆管理</view>
<carCard v-for="carItem in carList" :key="carItem.id" :carInfo="carItem">
<carCard v-for="carItem in carList" :key="carItem.id" tipContent="车辆信息" :carInfo="carItem">
<template #header>
<navTop :carNum="carItem.licensePlateNumber" />
</template>
... ... @@ -31,8 +31,9 @@
<script setup>
import { reactive, ref } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { onShow, onPullDownRefresh } from '@dcloudio/uni-app'
import { getUserCarInfo, getNotice } from '@/api/user.js'
import { queryMyList } from '@/api/work.js'
import carCard from '@/components/carCard.vue';
import centerLine from '@/components/centerLine.vue';
import navTop from '@/components/navTop.vue';
... ... @@ -40,14 +41,17 @@ import useUserStore from '@/store/modules/user';
const carList = ref([])
const advertisingTitle = ref('')
const advertisingContent = ref('')
const myTotal = ref('0')
const userStore = useUserStore()
const queryParams = reactive({
pageNum: 1,
pageSize: 10
pageSize: 20
})
const getMyList = async () => {
const { data } = await getUserCarInfo(queryParams)
carList.value = data.records
const { data:myData } = await queryMyList(queryParams)
myTotal.value = myData.total.toString()
}
const addCarInfo = () => {
uni.navigateTo({
... ... @@ -67,18 +71,36 @@ const getNoticeDetail = async () => {
const { data } = await getNotice(10)
advertisingContent.value = data.noticeContent
advertisingTitle.value = data.noticeTitle
userStore.isShowAdver = true
}
getNoticeDetail()
onShow(() => {
getMyList()
// 用户下拉刷新
onPullDownRefresh(async () => {
carList.value = []
//调用获取数据方法
await getMyList()
uni.stopPullDownRefresh()
})
onShow(async () => {
await getMyList()
if(myTotal.value !== '0') {
uni.setTabBarBadge({
index: 1,
text: myTotal.value
})
}else {
uni.removeTabBarBadge({
index: 1
})
}
})
</script>
<style lang="scss" scoped>
.app-container{
width: 100%;
height: 100vh;
padding: 0 30rpx;
min-height: 100vh;
padding: 0 30rpx 30rpx;
background: url('http://bxhd.crgx.net/profile/avatar/2024/09/25/bg-index_20240925113012A004.png') no-repeat;
background-size: 100% 100%;
overflow: hidden;
... ... @@ -123,7 +145,12 @@ onShow(() => {
.notice_content{
font-size: 28rpx;
line-height: 38rpx;
height: 375rpx;
color: #999;
overflow-y: scroll;
image{
width: 100%;
}
}
.btn{
position: absolute;
... ... @@ -135,6 +162,7 @@ onShow(() => {
height: 100rpx;
color: #3680FE;
font-size: 28rpx;
background-color: #fff;
border-top: 2rpx solid #eee;
}
}
... ...
... ... @@ -6,14 +6,14 @@
<up-form-item prop="username">
<up-input v-model="loginForm.username" 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>
<image style="width: 32rpx;height: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="password">
<up-input v-model="loginForm.password" type="password" 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>
<image style="width: 32rpx;height:32rpx;margin-right: 18rpx;margin-top: 10rpx;" src="@/static/commonImage/IdCard.png" mode="widthFix"></image>
</template>
</up-input>
</up-form-item>
... ... @@ -21,7 +21,7 @@
<view style="display: flex;">
<up-input v-model="loginForm.code" placeholder="验证码" shape="circle" border="none" fontSize="28rpx" color="#bbb" :placeholderStyle="placeholderStyle" :customStyle="codeCustomStyle">
<template #prefix>
<image style="width: 32rpx;margin-right: 18rpx;margin-top: 10rpx;" src="@/static/commonImage/code.png" mode="widthFix"></image>
<image style="width: 32rpx;height:32rpx;margin-right: 18rpx;margin-top: 10rpx;" src="@/static/commonImage/code.png" mode="widthFix"></image>
</template>
</up-input>
<view class="login-code">
... ... @@ -33,7 +33,7 @@
</view>
<view class="tip">
未注册或绑定该车型平台的身份证号,将帮你注册新账号,点击登录即代表你同意<text style="color: #3680FE;" @click="goPrivacy">《隐私政策》</text>
未注册或绑定该平台的身份证号,将帮你注册新账号,点击登录即代表你同意<text style="color: #3680FE;" @click="goPrivacy">《隐私政策》</text>
</view>
<view class="log-btn" @click="submit">登录</view>
</view>
... ... @@ -45,7 +45,7 @@ import { onReady } from '@dcloudio/uni-app'
import { getCodeImg } from '@/api/user.js'
import { encrypt } from "@/utils/jsencrypt";
import useUserStore from '@/store/modules/user'
import storage from '@/utils/storage.js'
const userStore = useUserStore()
// 登录参数
const loginForm = ref({
... ... @@ -60,7 +60,7 @@ const logFormRef = ref(null)
// 校验规则
const rules = {
username: [{ required: true, message: '请输入用户名', trigger: ['blur', 'change'] }],
password: [{ required: true, message: '请输入身份证号', trigger: ['blur', 'change']}],
password: [{ required: true, message: '请输入密码', trigger: ['blur', 'change']}],
code: [{ required: true, message: '请输入验证码', trigger: ['blur', 'change']}]
}
const customStyle = {
... ... @@ -104,6 +104,7 @@ const submit = () => {
// 调用action的登录方法
userStore.userlogin(loginForm.value).then(async () => {
const { data, roleGroup } = await userStore.getUser()
storage.set('crgx_roleGroup', roleGroup)
if(data.identificationNumber !== null) {
if(roleGroup === '公司员工'){
uni.redirectTo({
... ...
... ... @@ -14,54 +14,70 @@
<up-form-item prop="nickName">
<up-input v-model="userInfo.nickName" 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>
<image style="width: 32rpx;height: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="userInfo.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>
<image style="width: 32rpx;height: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="phonenumber">
<up-input v-model="userInfo.phonenumber" 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>
<image style="width: 32rpx;height: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 class="left_title">我的待办</text>
<text>去修改车辆信息</text>
</view>
<view class="car_data">
<view v-for="carItem in carList" :key="carItem.id" class="car_item">
<carCard v-for="carItem in carList" :key="carItem.taskId" tipContent="等待修改" :carInfo="carItem">
<template #header>
<navTop :carNum="carItem.licensePlateNumber" />
</template>
<template #center>
<centerLine :leftContent="carItem.customizeVehicleBrand || carItem.vehicleBrand" fontColor="#999" :rightContent="carItem.customizeVehicleModel || carItem.vehicleModel"></centerLine>
</view>
</view>
<view class="loginBtn" @click="loginOut">退出登录</view>
</template>
<template #footer>
<view style="display: flex;gap: 30rpx;">
<view style="color: #3680FE;font-size: 24rpx;" @click="updateCarInfo(carItem.businessKey,carItem.taskId)">修改提交</view>
<view style="color: #3680FE;font-size: 24rpx;" @click="dropEdit(carItem.taskId)">放弃修改</view>
</view>
</template>
</carCard>
<up-empty
:show="carList.length == 0"
mode="list"
text="暂无待办事项"
/>
<view class="loginBtn" @click="loginOut">注销信息</view>
</view>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue'
import { onReady } from '@dcloudio/uni-app'
import { onReady, onShow } from '@dcloudio/uni-app'
import carCard from '@/components/carCard.vue';
import centerLine from '@/components/centerLine.vue';
import navTop from '@/components/navTop.vue';
import { updateUserInfo, getUserCarInfo } from '@/api/user.js'
import { updateUserInfo, userCancel } from '@/api/user.js'
import { queryMyList, disposeUser } from '@/api/work.js'
import useUserStore from '@/store/modules/user.js'
const { userInfo, Logout } = useUserStore()
const carList = ref([])
const myTotal = ref('0')
const queryParams = reactive({
pageNum: 1,
pageSize: 10
pageSize: 20
})
const customStyle = {
height: '80rpx',
... ... @@ -108,6 +124,13 @@ const rules = {
}
]
}
// 修改车辆信息
const updateCarInfo = (id, taskId) => {
uni.navigateTo({
url: `/pages/carDetail/carDetail?carInfoId=${id}&taskId=${taskId}`
})
}
// 微信小程序需要在此注册校验规则
onReady(() => {
userFormRef.value.setRules(rules)
... ... @@ -115,12 +138,13 @@ onReady(() => {
const loginOut = () => {
uni.showModal({
title: '提示',
content: '是否退出登录',
content: '是否要注销信息 \n1、点击注销后工作人员在七个工作日内像你发送短信确认\n 2、注销后将删除你在该平台的所有信息',
success: async (res) => {
if (res.confirm) {
await userCancel()
await Logout()
uni.$u.toast('退出成功')
uni.navigateTo({
uni.$u.toast('注销成功')
uni.redirectTo({
url: '/pages/realName/realName'
})
} else if (res.cancel) {
... ... @@ -130,8 +154,25 @@ const loginOut = () => {
});
}
const getMyList = async () => {
const { data } = await getUserCarInfo(queryParams)
carList.value = data.records
const { data } = await queryMyList(queryParams)
carList.value = data.rows
myTotal.value = data.total.toString()
if(myTotal.value !== '0') {
uni.setTabBarBadge({
index: 1,
text: myTotal.value
})
}else {
uni.removeTabBarBadge({
index: 1
})
}
}
// 放弃修改
const dropEdit = async (taskId) => {
await disposeUser({reregistration:'false'}, taskId)
uni.$u.toast('已放弃修改')
getMyList()
}
// 提交方法
... ... @@ -148,7 +189,9 @@ const submit = () => {
uni.$u.toast('校验失败')
});
}
getMyList()
onShow(() => {
getMyList()
})
</script>
<style lang="scss" scoped>
... ...
<template>
<view class="privacy">
隐私政策
</view>
<view class="myOne">
<view class="my-div">
<text class="yhxy">隐私政策</text>
<view>
本应用非常重视用户隐私政策并严格遵守相关的法律规定。请您仔细阅读《隐私政策》后再继续使用。
如果您继续使用我们的服务,表示您已经充分阅读和理解我们协议的全部内容。
</view>
<view>
本小程序尊重并保护所有使用服务用户的个人隐私权。
为了给您提供更准确、更优质的服务,本应用会按照本隐私权政策的规定使用和披露您的个人信息。
除本隐私权政策另有规定外,在未征得您事先许可的情况下,本应用不会将这些信息对外披露或向第三方提供。
本应用会不时更新本隐私权政策。您在同意本应用服务使用协议之时,即视为您已经同意本隐私权政策全部内容。
</view>
<view>
1. 适用范围
<view>
(a) 在您注册本应用小程序帐号时,您根据小程序要求提供的个人注册信息。
(b) 在您使用本应用网络服务,或访问本应用平台网页时,本应用自动接收并记录的您的浏览器和计算机上的信息,
包括但不限于您的IP地址、浏览器的类型、使用的语言、访问日期和时间、软硬件特征信息及您需求的网页记录等数据。
(c) 本应用通过合法途径从商业伙伴处取得的用户个人数据。
(d) 本应用严禁用户发布不良信息,如裸露、色情和亵渎内容,发布的内容我们会进行审核,一经发现不良信息,会禁用该用户的所有权限,予以封号处理。
</view>
</view>
<view>
2. 信息使用
<view>
(a) 本应用不会向任何无关第三方提供、出售、出租、分享或交易您的个人登录信息。如果我们存储发生维修或升级,我们会事先发出推送消息来通知您,请您提前允许本应用消息通知。
(b) 本应用亦不允许任何第三方以任何手段收集、编辑、出售或者无偿传播您的个人信息。任何本应用平台用户如从事上述活动,一经发现,本应用有权立即终止与该用户的服务协议。包括但不限于您的IP地址、浏览器的类型、使用的语言、访问日期和时间、软硬件特征信息及您需求的网页记录等数据。
(c) 为服务用户的目的,本应用可能通过使用您的个人信息,向您提供您感兴趣的信息,包括但不限于向您发出产品和服务信息,
或者与本应用合作伙伴共享信息以便他们向您发送有关其产品和服务的信息。(后者需要您的事先同意)
</view>
<view>
3. 信息披露
<view>
在如下情况下,本应用将依据您的个人意愿或法律的规定全部或部分的披露您的个人信息:
(a) 未经您事先同意,我们不会向第三方披露。
(b) 为提供您所要求的产品和服务,而必须和第三方分享您的个人信息。
(c) 根据法律的有关规定,或者行政或司法机构的要求,向第三方或者行政、司法机构披露。
(d) 如您出现违反中国有关法律、法规或者本应用服务协议或相关规则的情况,需要向第三方披露。
(e) 如您是适格的知识产权投诉人并已提起投诉,应被投诉人要求,向被投诉人披露,以便双方处理可能的权利纠纷
</view>
</view>
<view>
4. 信息存储和交换
<view>
本应用收集的有关您的信息和资料将保存在本应用及(或)其关联公司的服务器上,这些信息和资料可能传送至您所在国家、地区或本应用收集信息和资料所在地的境外并在境外被访问、存储和展示。
</view>
</view>
<view>
5. Cookie的使用
<view>
(a) 在您未拒绝接受cookies的情况下,本应用会在您的计算机上设定或取用cookies,以便您能登录或使用依赖于cookies的本应用平台服务或功能。本应用使用cookies可为您提供更加周到的个性化服务,包括推广服务。
(b) 您有权选择接受或拒绝接受cookies。您可以通过修改浏览器设置的方式拒绝接受cookies。
但如果您选择拒绝接受cookies,则您可能无法登录或使用依赖于cookies的本应用网络服务或功能
(c) 通过本应用所设cookies所取得的有关信息,将适用本政策。
</view>
</view>
<view>
6.本隐私政策的更改
<view>
(a) 如果决定更改隐私政策,我们会在本政策中、本公司网站中以及我们认为适当的位置发布这些更改,以便您了解我们如何收集、使用您的个人信息,哪些人可以访问这些信息,以及在什么情况下我们会透露这些信息。
(b) 本公司保留随时修改本政策的权利,因此请经常查看。如对本政策作出重大更改,本公司会通过网站通知的形式告知。
</view>
</view>
<view>
请您妥善保护自己的个人信息,仅在必要的情形下向他人提供。如您发现自己的个人信息泄密,尤其是本应用用户名及密码发生泄露,请您立即联络本应用客服,以便本应用采取相应措施。
</view>
<view>
感谢您花时间了解我们的隐私政策!我们将尽全力保护您的个人信息和合法权益,再次感谢您的信任!
</view>
</view>
</view>
</view>
</template>
<script setup>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
<style>
.myOne{
width: 100%;
display: flex;
justify-content: center;
}
.my-div{
width: 80%;
margin: auto;
}
.yhxy{
justify-content: center;
color: black;
font-size: 40rpx;
font-weight: 600;
}
</style>
\ No newline at end of file
... ...
... ... @@ -29,7 +29,7 @@
</view>
<view class="tip">
未注册或绑定该车型平台的身份证号,将帮你注册新账号,点击提交即代表你同意<text style="color: #3680FE;" @click="goPrivacy">《隐私政策》</text>
未注册或绑定该平台的身份证号,将帮你注册新账号,点击提交即代表你同意<text style="color: #3680FE;" @click="goPrivacy">《隐私政策》</text>
</view>
<view class="log-btn" @click="submit">提交</view>
</view>
... ... @@ -40,40 +40,42 @@ import { reactive, ref } from 'vue';
import { userWxLogin, updateUserInfo } from '@/api/user.js'
import { onReady, onLoad } from '@dcloudio/uni-app'
import useUserStore from '@/store/modules/user.js'
import storage from '@/utils/storage.js'
import { test } from '@/uni_modules/uview-plus';
const { userInfo, login, getUser } = useUserStore()
// 表单引用
const logFormRef = ref(null)
// 校验规则
const rules = {
nickName: [
{ required: true, message: '请输入姓名', trigger: ['blur', 'change'] },
{ min: 2, max: 6, message: '名字应在2到6个字', trigger: ['blur', 'change'] },
{ required: true, message: '请输入姓名', trigger: ['blur'] },
{ min: 2, max: 6, message: '名字应在2到6个字', trigger: ['blur'] },
{ validator: (rule, value, callback) => {
return uni.$u.test.chinese(value)
return test.chinese(value)
},
message: '请输入中文',
// 触发器可以同时用blur和change
trigger: ['change','blur'],
trigger: ['blur'],
}
],
identificationNumber: [
{ required: true, message: '请输入身份证号', trigger: ['blur', 'change'] },
{ required: true, message: '请输入身份证号', trigger: ['blur'] },
{ validator: (rule, value, callback) => {
return uni.$u.test.idCard(value)
return test.idCard(value)
},
message: '身份证号码不正确',
// 触发器可以同时用blur和change
trigger: ['change','blur'],
trigger: ['blur'],
}
],
phonenumber: [
{ required: true, message: '请输入手机号', trigger: ['blur', 'change'] },
{ required: true, message: '请输入手机号', trigger: ['blur'] },
{ validator: (rule, value, callback) => {
return uni.$u.test.mobile(value)
return test.mobile(value)
},
message: '手机号码不正确',
// 触发器可以同时用blur和change
trigger: ['change','blur'],
trigger: ['blur'],
}
]
}
... ... @@ -94,7 +96,8 @@ onLoad((options) => {
uni.login({
success: async (loginRes) => {
await login({code: loginRes.code, type: 0})
const { data } = await getUser()
const { data, roleGroup } = await getUser()
storage.set('crgx_roleGroup', roleGroup)
if(data.identificationNumber !== null) {
uni.switchTab({
url: '/pages/index/index'
... ... @@ -113,6 +116,7 @@ const submit = () => {
logFormRef.value.validate().then(async valid => {
if (valid) {
await updateUserInfo(userInfo)
await getUser()
uni.$u.toast('登录成功')
uni.switchTab({
url: '/pages/index/index'
... ...
... ... @@ -3,17 +3,26 @@
<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">
<carCard v-for="carItem in List" :key="carItem.taskId" tipContent="待办" :carInfo="carItem">
<template #header>
<navTop :carNum="carItem.carNum" />
<navTop :carNum="carItem.licensePlateNumber" />
</template>
<template #center>
<wordInfo :carType="carItem.carType" :userName="carItem.name" :applyTime="carItem.createTime" />
<wordInfo :phone="carItem.phone" :userName="carItem.name" :company="carItem.sysDeptName" />
</template>
<template #footer>
<operateList />
<operateList :carInfo="carItem" @refreshList="getList" />
</template>
</carCard>
<up-empty
:show="List.length == 0"
mode="list"
text="暂无待办事项"
/>
</view>
<!-- 分页器 -->
<view v-show="List.length > 0">
<uni-pagination :total="allTotal" v-model="queryParams.pageNum" :pageSize="queryParams.pageSize" @change="getList" />
</view>
</view>
... ... @@ -23,7 +32,7 @@
activeColor="#3680FE"
inactiveColor="#707070"
>
<up-tabbar-item text="主页" icon="home" badge="11"></up-tabbar-item>
<up-tabbar-item text="主页" icon="home" :badge="useTabbar.societyTotal"></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>
... ... @@ -38,37 +47,47 @@
</template>
<script setup>
import { ref } from 'vue';
import { ref, reactive } from 'vue';
import { onPullDownRefresh } from '@dcloudio/uni-app'
import { queryMyList } from '@/api/work.js'
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 List = ref([])
const allTotal = ref(0)
const titleStyle = {
fontSize: '36rpx',
color: '#fff',
fontWeight: 500
}
const queryParams = reactive({
pageNum: 1,
pageSize: 10
});
// 获取待办任务
const getList = async () => {
const { data } = await queryMyList(queryParams);
List.value = data.rows;
allTotal.value = data.total;
useTabbar.societyTotal = data.total;
}
// 用户下拉刷新
onPullDownRefresh(async () => {
queryParams.pageNum = 1
List.value = []
await getList()
uni.stopPullDownRefresh()
})
const goRouter = (index) => {
useTabbar.societyCurrent = index
uni.redirectTo({
url: '/pages/societyMy/societyMy'
})
}
getList()
</script>
<style lang="scss" scoped>
... ... @@ -87,6 +106,7 @@
display: flex;
flex-direction: column;
gap: 20rpx;
margin-bottom: 30rpx;
}
}
}
... ...
... ... @@ -7,40 +7,75 @@
<text style="color: #fff;">更新实名信息</text>
</view>
<view class="user-box">
<up-form :model="userForm" ref="userFormRef">
<up-form :model="userInfo" 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="请输入真实姓名">
<up-input v-model="userInfo.nickName" 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>
<image style="width: 32rpx;height: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="请输入身份证号">
<up-input v-model="userInfo.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>
<image style="width: 32rpx;height: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="请输入手机号码">
<up-input v-model="userInfo.phonenumber" 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>
<image style="width: 32rpx;height: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="navList">
<view class="navItem">
<image style="width: 48rpx;height: 48rpx;" src="http://bxhd.crgx.net/profile/avatar/2024/10/12/pending_20241012174056A003.png" mode="widthFix" @click="goOrder(0)"></image>
<text>待处理</text>
</view>
<view class="navItem">
<image style="width: 48rpx;height: 48rpx;" src="http://bxhd.crgx.net/profile/avatar/2024/10/12/processed_20241012173936A002.png" mode="widthFix" @click="goOrder(1)"></image>
<text>已处理</text>
</view>
<view class="navItem">
<image style="width: 48rpx;height: 48rpx;" src="http://bxhd.crgx.net/profile/avatar/2024/10/12/ongoing_20241012174132A004.png" mode="widthFix" @click="goOrder(2)"></image>
<text>进行中</text>
</view>
<view class="navItem">
<image style="width: 48rpx;height: 48rpx;" src="http://bxhd.crgx.net/profile/avatar/2024/10/12/deprecated_20241012174204A005.png" mode="widthFix" @click="goOrder(4)"></image>
<text>已作废</text>
</view>
<view class="navItem">
<image style="width: 48rpx;height: 48rpx;" src="http://bxhd.crgx.net/profile/avatar/2024/10/12/ended_20241012174234A006.png" mode="widthFix" @click="goOrder(3)"></image>
<text>已完结</text>
</view>
</view>
<view class="line_title">
<text class="left_title">状态设置</text>
</view>
<view class="status">
<view class="statusBtn" :class="{active: userInfo.jobStatus === '0'}" @click="changeStatus('0')">在岗</view>
<view class="statusBtn" :class="{active: userInfo.jobStatus === '1'}" @click="changeStatus('1')">离岗</view>
</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="home" :badge="useTabbar.societyTotal" @click="goRouter"></up-tabbar-item>
<up-tabbar-item text="我的" icon="account"></up-tabbar-item>
</up-tabbar>
</view>
... ... @@ -48,16 +83,13 @@
<script setup>
import { ref } from 'vue'
import { updateUserInfo } from '@/api/user.js'
import { onReady } from '@dcloudio/uni-app'
import useTabbarStore from '@/store/modules/tabbar.js'
import useUserStore from '@/store/modules/user.js'
const { userInfo, Logout, getUser } = useUserStore()
const useTabbar = useTabbarStore()
const showNotice = ref(true)
// 用户参数
const userForm = ref({
name: '',
identificationNumber: '',
phone: ''
})
const customStyle = {
height: '80rpx',
backgroundColor: '#F9F9F9',
... ... @@ -108,7 +140,27 @@ onReady(() => {
userFormRef.value.setRules(rules)
})
const loginOut = () => {
uni.showModal({
title: '提示',
content: '是否退出登录',
success: async (res) => {
if (res.confirm) {
await Logout()
uni.$u.toast('退出成功')
uni.redirectTo({
url: '/pages/login/login'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
const goOrder = (index) => {
uni.navigateTo({
url: '/pages/societyOrder/societyOrder?type=' + index
})
}
const goRouter = (index) => {
... ... @@ -117,11 +169,22 @@ const goRouter = (index) => {
url: '/pages/societyHome/societyHome'
})
}
// 设置在岗状态
const changeStatus = async (status) => {
userInfo.jobStatus = status
await updateUserInfo(userInfo)
await getUser()
uni.$u.toast('更新成功')
}
// 提交方法
const submit = () => {
userFormRef.value.validate().then(async valid => {
if (valid) {
uni.$u.toast('登录成功')
await updateUserInfo(userInfo)
await getUser()
uni.$u.toast('更新成功')
} else {
uni.$u.toast('校验失败')
}
... ... @@ -182,6 +245,51 @@ const submit = () => {
}
}
}
.navList{
display: flex;
align-items: center;
justify-content: space-between;
padding: 25rpx 33rpx;
background: #FFFFFF;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(0,0,0,0.06);
border-radius: 40rpx;
margin-bottom: 40rpx;
.navItem{
display: flex;
flex-direction: column;
align-items: center;
gap: 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #333;
}
}
.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;
}
}
}
.loginBtn{
width: 100%;
height: 80rpx;
... ...
<template>
<view class="company_container">
<up-navbar placeholder leftIconColor="#fff" autoBack bgColor="transparent" />
<view class="work_box">
<view class="work_list">
<carCard v-for="carItem in List" :key="carItem.taskId" :tipContent="tipContent" :carInfo="carItem">
<template #header>
<navTop :carNum="carItem.licensePlateNumber" />
</template>
<template #center>
<wordInfo :phone="carItem.phone" :userName="carItem.name" :company="carItem.sysDeptName" />
</template>
<template #footer>
<operateList v-if="typeId === 0" :carInfo="carItem" @refreshList="getList"/>
<view style="display: flex;align-items: center;gap: 30rpx;">
<view class="btn" @click="lookDetail(carItem.businessKey)">查看详情</view>
<view v-if="typeId === 3" class="btn" @click="lookFeedback(carItem.processInstanceId)">查看回馈</view>
<view v-if="typeId === 4" class="btn" @click="lookRemark(carItem.processInstanceId)">查看备注</view>
</view>
</template>
</carCard>
<up-empty
:show="List.length == 0"
mode="list"
text="暂无待办事项"
/>
</view>
<!-- 分页器 -->
<view v-show="List.length > 0">
<uni-pagination :total="allTotal" v-model="queryParams.pageNum" :pageSize="queryParams.pageSize" @change="getList(typeId)"/>
</view>
</view>
<!-- 保单回馈 -->
<up-modal :show="showFeedback" title="保单回馈" @confirm="showFeedback = false" >
<up-parse :content="feedbakcForm.message"></up-parse>
</up-modal>
<!-- 作废备注 -->
<up-modal :show="showDefeat" title="作废备注" @confirm="showDefeat = false" >
<up-parse :content="defeatForm.message"></up-parse>
</up-modal>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
import { queryMyList, queryProcessedList, queryOngoingList, queryEndedList, queryDeprecatedList, queryDefeatContent, queryResult } from '@/api/work.js'
import carCard from '@/components/carCard.vue';
import navTop from '@/components/navTop.vue';
import wordInfo from '@/components/wordInfo.vue';
import operateList from '@/components/operateList.vue';
const List = ref([])
const allTotal = ref(0)
const typeId = ref(0)
const showFeedback = ref(false)
const showDefeat = ref(false)
const feedbakcForm = ref({
policyNumber: '',
message: ''
})
const defeatForm = ref({
message: ''
})
const titleStyle = {
fontSize: '36rpx',
color: '#fff',
fontWeight: 500
}
const queryParams = reactive({
pageNum: 1,
pageSize: 10
});
const tipContent = ref('')
// 初始加载数据
onLoad((options) => {
typeId.value = Number(options.type)
getList(typeId.value)
})
// 用户下拉刷新
onPullDownRefresh(async () => {
queryParams.pageNum = 1
List.value = []
getList(typeId.value)
})
const getList = (id) => {
//调用获取数据方法
switch (id) {
case 0:
tipContent.value = '待处理'
queryMyList(queryParams).then(res => {
List.value = res.data.rows
allTotal.value = res.data.total
uni.stopPullDownRefresh()
})
break;
case 1:
tipContent.value = '已处理'
queryProcessedList(queryParams).then(res => {
List.value = res.rows
allTotal.value = res.total
uni.stopPullDownRefresh()
})
break;
case 2:
tipContent.value = '进行中'
queryOngoingList(queryParams).then(res => {
List.value = res.rows
allTotal.value = res.total
uni.stopPullDownRefresh()
})
break;
case 3:
tipContent.value = '已完结'
queryEndedList(queryParams).then(res => {
List.value = res.rows
allTotal.value = res.total
uni.stopPullDownRefresh()
})
break;
case 4:
tipContent.value = '已作废'
queryDeprecatedList(queryParams).then(res => {
List.value = res.rows
allTotal.value = res.total
uni.stopPullDownRefresh()
})
break;
}
}
// 查看详情
const lookDetail = (id) => {
uni.navigateTo({
url: `/pages/carDetail/carDetail?carInfoId=${id}`
})
}
// 查看回馈
const lookFeedback = (processInstanceId) => {
queryResult({ processInstanceId}).then((res) => {
feedbakcForm.value.policyNumber = res?.data?.policyNumber;
feedbakcForm.value.message = res?.data?.message;
showFeedback.value = true;
});
}
// 查看备注
const lookRemark = (processInstanceId) => {
queryDefeatContent({ processInstanceId}).then((res) => {
defeatForm.value.message = res?.data?.message;
showDefeat.value = true;
});
}
</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;
height: calc(100vh - 288rpx);
background-color: #F8F9FF;
overflow-y: scroll;
.work_list{
display: flex;
flex-direction: column;
gap: 20rpx;
margin-bottom: 30rpx;
}
}
}
.btn {
width: 100rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 24rpx;
text-align: center;
color: #3c9cff;
}
</style>
... ...
不能预览此文件类型
... ... @@ -6,7 +6,8 @@ const useTabbarStore = defineStore('tabbar', {
return {
employeeCurrent: 0,
societyCurrent: 0,
companyTotal: 0
companyTotal: 0,
societyTotal: 0
}
}
})
... ...
... ... @@ -2,14 +2,14 @@ import { defineStore } from 'pinia'
import storage from '@/utils/storage.js'
import { userWxLogin, getUserInfo, userLogin } from '@/api/user.js'
const useUserStore = defineStore('user', {
unistorage: true, // 是否持久化到内存
state: () => {
return {
token: storage.get('crgx_token', ''),
userInfo: storage.get('crgx_userInfo', null),
isShowAdver: true
roleGroup: storage.get('crgx_roleGroup', null),
isShowAdver: false
}
},
actions: {
... ... @@ -54,9 +54,10 @@ const useUserStore = defineStore('user', {
const userInfo = response.data
// 过期时间30天
const expiryTime = 30 * 86400
storage.set('crgx_userInfo', userInfo, expiryTime)
// 记录到store全局变量
this.userInfo = userInfo
this.userInfo.nickName = uni.$u.trim(userInfo.nickName, 'all')
storage.set('crgx_userInfo', this.userInfo, expiryTime)
resolve(response)
})
.catch(reject)
... ...
## 2.0.10(2024-06-07)
- 优化 uni-app x 中,size 属性的类型
## 2.0.9(2024-01-12)
fix: 修复图标大小默认值错误的问题
## 2.0.8(2023-12-14)
- 修复 项目未使用 ts 情况下,打包报错的bug
## 2.0.7(2023-12-14)
- 修复 size 属性为 string 时,不加单位导致尺寸异常的bug
## 2.0.6(2023-12-11)
- 优化 兼容老版本icon类型,如 top ,bottom 等
## 2.0.5(2023-12-11)
- 优化 兼容老版本icon类型,如 top ,bottom 等
## 2.0.4(2023-12-06)
- 优化 uni-app x 下示例项目图标排序
## 2.0.3(2023-12-06)
- 修复 nvue下引入组件报错的bug
## 2.0.2(2023-12-05)
-优化 size 属性支持单位
## 2.0.1(2023-12-05)
- 新增 uni-app x 支持定义图标
## 1.3.5(2022-01-24)
- 优化 size 属性可以传入不带单位的字符串数值
## 1.3.4(2022-01-24)
- 优化 size 支持其他单位
## 1.3.3(2022-01-17)
- 修复 nvue 有些图标不显示的bug,兼容老版本图标
## 1.3.2(2021-12-01)
- 优化 示例可复制图标名称
## 1.3.1(2021-11-23)
- 优化 兼容旧组件 type 值
## 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-icons](https://uniapp.dcloud.io/component/uniui/uni-icons)
## 1.1.7(2021-11-08)
## 1.2.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.1.5(2021-05-12)
- 新增 组件示例地址
## 1.1.4(2021-02-05)
- 调整为uni_modules目录规范
... ...
<template>
<text class="uni-icons" :style="styleObj">
<slot>{{unicode}}</slot>
</text>
</template>
<script>
import { fontData, IconsDataItem } from './uniicons_file'
/**
* Icons 图标
* @description 用于展示 icon 图标
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
* @property {Number,String} size 图标大小
* @property {String} type 图标图案,参考示例
* @property {String} color 图标颜色
* @property {String} customPrefix 自定义图标
* @event {Function} click 点击 Icon 触发事件
*/
export default {
name: "uni-icons",
props: {
type: {
type: String,
default: ''
},
color: {
type: String,
default: '#333333'
},
size: {
type: [Number, String],
default: 16
},
fontFamily: {
type: String,
default: ''
}
},
data() {
return {};
},
computed: {
unicode() : string {
let codes = fontData.find((item : IconsDataItem) : boolean => { return item.font_class == this.type })
if (codes !== null) {
return codes.unicode
}
return ''
},
iconSize() : string {
const size = this.size
if (typeof size == 'string') {
const reg = /^[0-9]*$/g
return reg.test(size as string) ? '' + size + 'px' : '' + size;
// return '' + this.size
}
return this.getFontSize(size as number)
},
styleObj() : UTSJSONObject {
if (this.fontFamily !== '') {
return { color: this.color, fontSize: this.iconSize, fontFamily: this.fontFamily }
}
return { color: this.color, fontSize: this.iconSize }
}
},
created() { },
methods: {
/**
* 字体大小
*/
getFontSize(size : number) : string {
return size + 'px';
},
},
}
</script>
<style scoped>
@font-face {
font-family: UniIconsFontFamily;
src: url('./uniicons.ttf');
}
.uni-icons {
font-family: UniIconsFontFamily;
font-size: 18px;
font-style: normal;
color: #333;
}
</style>
... ...
<template>
<!-- #ifdef APP-NVUE -->
<text :style="styleObj" class="uni-icons" @click="_onClick">{{unicode}}</text>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<text :style="styleObj" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick">
<slot></slot>
</text>
<!-- #endif -->
</template>
<script>
import { fontData } from './uniicons_file_vue.js';
const getVal = (val) => {
const reg = /^[0-9]*$/g
return (typeof val === 'number' || reg.test(val)) ? val + 'px' : val;
}
// #ifdef APP-NVUE
var domModule = weex.requireModule('dom');
import iconUrl from './uniicons.ttf'
domModule.addRule('fontFace', {
'fontFamily': "uniicons",
'src': "url('" + iconUrl + "')"
});
// #endif
/**
* Icons 图标
* @description 用于展示 icons 图标
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
* @property {Number} size 图标大小
* @property {String} type 图标图案,参考示例
* @property {String} color 图标颜色
* @property {String} customPrefix 自定义图标
* @event {Function} click 点击 Icon 触发事件
*/
export default {
name: 'UniIcons',
emits: ['click'],
props: {
type: {
type: String,
default: ''
},
color: {
type: String,
default: '#333333'
},
size: {
type: [Number, String],
default: 16
},
customPrefix: {
type: String,
default: ''
},
fontFamily: {
type: String,
default: ''
}
},
data() {
return {
icons: fontData
}
},
computed: {
unicode() {
let code = this.icons.find(v => v.font_class === this.type)
if (code) {
return code.unicode
}
return ''
},
iconSize() {
return getVal(this.size)
},
styleObj() {
if (this.fontFamily !== '') {
return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`
}
return `color: ${this.color}; font-size: ${this.iconSize};`
}
},
methods: {
_onClick() {
this.$emit('click')
}
}
}
</script>
<style lang="scss">
/* #ifndef APP-NVUE */
@import './uniicons.css';
@font-face {
font-family: uniicons;
src: url('./uniicons.ttf');
}
/* #endif */
.uni-icons {
font-family: uniicons;
text-decoration: none;
text-align: center;
}
</style>
... ...
.uniui-cart-filled:before {
content: "\e6d0";
}
.uniui-gift-filled:before {
content: "\e6c4";
}
.uniui-color:before {
content: "\e6cf";
}
.uniui-wallet:before {
content: "\e6b1";
}
.uniui-settings-filled:before {
content: "\e6ce";
}
.uniui-auth-filled:before {
content: "\e6cc";
}
.uniui-shop-filled:before {
content: "\e6cd";
}
.uniui-staff-filled:before {
content: "\e6cb";
}
.uniui-vip-filled:before {
content: "\e6c6";
}
.uniui-plus-filled:before {
content: "\e6c7";
}
.uniui-folder-add-filled:before {
content: "\e6c8";
}
.uniui-color-filled:before {
content: "\e6c9";
}
.uniui-tune-filled:before {
content: "\e6ca";
}
.uniui-calendar-filled:before {
content: "\e6c0";
}
.uniui-notification-filled:before {
content: "\e6c1";
}
.uniui-wallet-filled:before {
content: "\e6c2";
}
.uniui-medal-filled:before {
content: "\e6c3";
}
.uniui-fire-filled:before {
content: "\e6c5";
}
.uniui-refreshempty:before {
content: "\e6bf";
}
.uniui-location-filled:before {
content: "\e6af";
}
.uniui-person-filled:before {
content: "\e69d";
}
.uniui-personadd-filled:before {
content: "\e698";
}
.uniui-arrowthinleft:before {
content: "\e6d2";
}
.uniui-arrowthinup:before {
content: "\e6d3";
}
.uniui-arrowthindown:before {
content: "\e6d4";
}
.uniui-back:before {
content: "\e6b9";
}
.uniui-forward:before {
content: "\e6ba";
}
.uniui-arrow-right:before {
content: "\e6bb";
}
.uniui-arrow-left:before {
content: "\e6bc";
}
.uniui-arrow-up:before {
content: "\e6bd";
}
.uniui-arrow-down:before {
content: "\e6be";
}
.uniui-arrowthinright:before {
content: "\e6d1";
}
.uniui-down:before {
content: "\e6b8";
}
.uniui-bottom:before {
content: "\e6b8";
}
.uniui-arrowright:before {
content: "\e6d5";
}
.uniui-right:before {
content: "\e6b5";
}
.uniui-up:before {
content: "\e6b6";
}
.uniui-top:before {
content: "\e6b6";
}
.uniui-left:before {
content: "\e6b7";
}
.uniui-arrowup:before {
content: "\e6d6";
}
.uniui-eye:before {
content: "\e651";
}
.uniui-eye-filled:before {
content: "\e66a";
}
.uniui-eye-slash:before {
content: "\e6b3";
}
.uniui-eye-slash-filled:before {
content: "\e6b4";
}
.uniui-info-filled:before {
content: "\e649";
}
.uniui-reload:before {
content: "\e6b2";
}
.uniui-micoff-filled:before {
content: "\e6b0";
}
.uniui-map-pin-ellipse:before {
content: "\e6ac";
}
.uniui-map-pin:before {
content: "\e6ad";
}
.uniui-location:before {
content: "\e6ae";
}
.uniui-starhalf:before {
content: "\e683";
}
.uniui-star:before {
content: "\e688";
}
.uniui-star-filled:before {
content: "\e68f";
}
.uniui-calendar:before {
content: "\e6a0";
}
.uniui-fire:before {
content: "\e6a1";
}
.uniui-medal:before {
content: "\e6a2";
}
.uniui-font:before {
content: "\e6a3";
}
.uniui-gift:before {
content: "\e6a4";
}
.uniui-link:before {
content: "\e6a5";
}
.uniui-notification:before {
content: "\e6a6";
}
.uniui-staff:before {
content: "\e6a7";
}
.uniui-vip:before {
content: "\e6a8";
}
.uniui-folder-add:before {
content: "\e6a9";
}
.uniui-tune:before {
content: "\e6aa";
}
.uniui-auth:before {
content: "\e6ab";
}
.uniui-person:before {
content: "\e699";
}
.uniui-email-filled:before {
content: "\e69a";
}
.uniui-phone-filled:before {
content: "\e69b";
}
.uniui-phone:before {
content: "\e69c";
}
.uniui-email:before {
content: "\e69e";
}
.uniui-personadd:before {
content: "\e69f";
}
.uniui-chatboxes-filled:before {
content: "\e692";
}
.uniui-contact:before {
content: "\e693";
}
.uniui-chatbubble-filled:before {
content: "\e694";
}
.uniui-contact-filled:before {
content: "\e695";
}
.uniui-chatboxes:before {
content: "\e696";
}
.uniui-chatbubble:before {
content: "\e697";
}
.uniui-upload-filled:before {
content: "\e68e";
}
.uniui-upload:before {
content: "\e690";
}
.uniui-weixin:before {
content: "\e691";
}
.uniui-compose:before {
content: "\e67f";
}
.uniui-qq:before {
content: "\e680";
}
.uniui-download-filled:before {
content: "\e681";
}
.uniui-pyq:before {
content: "\e682";
}
.uniui-sound:before {
content: "\e684";
}
.uniui-trash-filled:before {
content: "\e685";
}
.uniui-sound-filled:before {
content: "\e686";
}
.uniui-trash:before {
content: "\e687";
}
.uniui-videocam-filled:before {
content: "\e689";
}
.uniui-spinner-cycle:before {
content: "\e68a";
}
.uniui-weibo:before {
content: "\e68b";
}
.uniui-videocam:before {
content: "\e68c";
}
.uniui-download:before {
content: "\e68d";
}
.uniui-help:before {
content: "\e679";
}
.uniui-navigate-filled:before {
content: "\e67a";
}
.uniui-plusempty:before {
content: "\e67b";
}
.uniui-smallcircle:before {
content: "\e67c";
}
.uniui-minus-filled:before {
content: "\e67d";
}
.uniui-micoff:before {
content: "\e67e";
}
.uniui-closeempty:before {
content: "\e66c";
}
.uniui-clear:before {
content: "\e66d";
}
.uniui-navigate:before {
content: "\e66e";
}
.uniui-minus:before {
content: "\e66f";
}
.uniui-image:before {
content: "\e670";
}
.uniui-mic:before {
content: "\e671";
}
.uniui-paperplane:before {
content: "\e672";
}
.uniui-close:before {
content: "\e673";
}
.uniui-help-filled:before {
content: "\e674";
}
.uniui-paperplane-filled:before {
content: "\e675";
}
.uniui-plus:before {
content: "\e676";
}
.uniui-mic-filled:before {
content: "\e677";
}
.uniui-image-filled:before {
content: "\e678";
}
.uniui-locked-filled:before {
content: "\e668";
}
.uniui-info:before {
content: "\e669";
}
.uniui-locked:before {
content: "\e66b";
}
.uniui-camera-filled:before {
content: "\e658";
}
.uniui-chat-filled:before {
content: "\e659";
}
.uniui-camera:before {
content: "\e65a";
}
.uniui-circle:before {
content: "\e65b";
}
.uniui-checkmarkempty:before {
content: "\e65c";
}
.uniui-chat:before {
content: "\e65d";
}
.uniui-circle-filled:before {
content: "\e65e";
}
.uniui-flag:before {
content: "\e65f";
}
.uniui-flag-filled:before {
content: "\e660";
}
.uniui-gear-filled:before {
content: "\e661";
}
.uniui-home:before {
content: "\e662";
}
.uniui-home-filled:before {
content: "\e663";
}
.uniui-gear:before {
content: "\e664";
}
.uniui-smallcircle-filled:before {
content: "\e665";
}
.uniui-map-filled:before {
content: "\e666";
}
.uniui-map:before {
content: "\e667";
}
.uniui-refresh-filled:before {
content: "\e656";
}
.uniui-refresh:before {
content: "\e657";
}
.uniui-cloud-upload:before {
content: "\e645";
}
.uniui-cloud-download-filled:before {
content: "\e646";
}
.uniui-cloud-download:before {
content: "\e647";
}
.uniui-cloud-upload-filled:before {
content: "\e648";
}
.uniui-redo:before {
content: "\e64a";
}
.uniui-images-filled:before {
content: "\e64b";
}
.uniui-undo-filled:before {
content: "\e64c";
}
.uniui-more:before {
content: "\e64d";
}
.uniui-more-filled:before {
content: "\e64e";
}
.uniui-undo:before {
content: "\e64f";
}
.uniui-images:before {
content: "\e650";
}
.uniui-paperclip:before {
content: "\e652";
}
.uniui-settings:before {
content: "\e653";
}
.uniui-search:before {
content: "\e654";
}
.uniui-redo-filled:before {
content: "\e655";
}
.uniui-list:before {
content: "\e644";
}
.uniui-mail-open-filled:before {
content: "\e63a";
}
.uniui-hand-down-filled:before {
content: "\e63c";
}
.uniui-hand-down:before {
content: "\e63d";
}
.uniui-hand-up-filled:before {
content: "\e63e";
}
.uniui-hand-up:before {
content: "\e63f";
}
.uniui-heart-filled:before {
content: "\e641";
}
.uniui-mail-open:before {
content: "\e643";
}
.uniui-heart:before {
content: "\e639";
}
.uniui-loop:before {
content: "\e633";
}
.uniui-pulldown:before {
content: "\e632";
}
.uniui-scan:before {
content: "\e62a";
}
.uniui-bars:before {
content: "\e627";
}
.uniui-checkbox:before {
content: "\e62b";
}
.uniui-checkbox-filled:before {
content: "\e62c";
}
.uniui-shop:before {
content: "\e62f";
}
.uniui-headphones:before {
content: "\e630";
}
.uniui-cart:before {
content: "\e631";
}
... ...
export type IconsData = {
id : string
name : string
font_family : string
css_prefix_text : string
description : string
glyphs : Array<IconsDataItem>
}
export type IconsDataItem = {
font_class : string
unicode : string
}
export const fontData = [
{
"font_class": "arrow-down",
"unicode": "\ue6be"
},
{
"font_class": "arrow-left",
"unicode": "\ue6bc"
},
{
"font_class": "arrow-right",
"unicode": "\ue6bb"
},
{
"font_class": "arrow-up",
"unicode": "\ue6bd"
},
{
"font_class": "auth",
"unicode": "\ue6ab"
},
{
"font_class": "auth-filled",
"unicode": "\ue6cc"
},
{
"font_class": "back",
"unicode": "\ue6b9"
},
{
"font_class": "bars",
"unicode": "\ue627"
},
{
"font_class": "calendar",
"unicode": "\ue6a0"
},
{
"font_class": "calendar-filled",
"unicode": "\ue6c0"
},
{
"font_class": "camera",
"unicode": "\ue65a"
},
{
"font_class": "camera-filled",
"unicode": "\ue658"
},
{
"font_class": "cart",
"unicode": "\ue631"
},
{
"font_class": "cart-filled",
"unicode": "\ue6d0"
},
{
"font_class": "chat",
"unicode": "\ue65d"
},
{
"font_class": "chat-filled",
"unicode": "\ue659"
},
{
"font_class": "chatboxes",
"unicode": "\ue696"
},
{
"font_class": "chatboxes-filled",
"unicode": "\ue692"
},
{
"font_class": "chatbubble",
"unicode": "\ue697"
},
{
"font_class": "chatbubble-filled",
"unicode": "\ue694"
},
{
"font_class": "checkbox",
"unicode": "\ue62b"
},
{
"font_class": "checkbox-filled",
"unicode": "\ue62c"
},
{
"font_class": "checkmarkempty",
"unicode": "\ue65c"
},
{
"font_class": "circle",
"unicode": "\ue65b"
},
{
"font_class": "circle-filled",
"unicode": "\ue65e"
},
{
"font_class": "clear",
"unicode": "\ue66d"
},
{
"font_class": "close",
"unicode": "\ue673"
},
{
"font_class": "closeempty",
"unicode": "\ue66c"
},
{
"font_class": "cloud-download",
"unicode": "\ue647"
},
{
"font_class": "cloud-download-filled",
"unicode": "\ue646"
},
{
"font_class": "cloud-upload",
"unicode": "\ue645"
},
{
"font_class": "cloud-upload-filled",
"unicode": "\ue648"
},
{
"font_class": "color",
"unicode": "\ue6cf"
},
{
"font_class": "color-filled",
"unicode": "\ue6c9"
},
{
"font_class": "compose",
"unicode": "\ue67f"
},
{
"font_class": "contact",
"unicode": "\ue693"
},
{
"font_class": "contact-filled",
"unicode": "\ue695"
},
{
"font_class": "down",
"unicode": "\ue6b8"
},
{
"font_class": "bottom",
"unicode": "\ue6b8"
},
{
"font_class": "download",
"unicode": "\ue68d"
},
{
"font_class": "download-filled",
"unicode": "\ue681"
},
{
"font_class": "email",
"unicode": "\ue69e"
},
{
"font_class": "email-filled",
"unicode": "\ue69a"
},
{
"font_class": "eye",
"unicode": "\ue651"
},
{
"font_class": "eye-filled",
"unicode": "\ue66a"
},
{
"font_class": "eye-slash",
"unicode": "\ue6b3"
},
{
"font_class": "eye-slash-filled",
"unicode": "\ue6b4"
},
{
"font_class": "fire",
"unicode": "\ue6a1"
},
{
"font_class": "fire-filled",
"unicode": "\ue6c5"
},
{
"font_class": "flag",
"unicode": "\ue65f"
},
{
"font_class": "flag-filled",
"unicode": "\ue660"
},
{
"font_class": "folder-add",
"unicode": "\ue6a9"
},
{
"font_class": "folder-add-filled",
"unicode": "\ue6c8"
},
{
"font_class": "font",
"unicode": "\ue6a3"
},
{
"font_class": "forward",
"unicode": "\ue6ba"
},
{
"font_class": "gear",
"unicode": "\ue664"
},
{
"font_class": "gear-filled",
"unicode": "\ue661"
},
{
"font_class": "gift",
"unicode": "\ue6a4"
},
{
"font_class": "gift-filled",
"unicode": "\ue6c4"
},
{
"font_class": "hand-down",
"unicode": "\ue63d"
},
{
"font_class": "hand-down-filled",
"unicode": "\ue63c"
},
{
"font_class": "hand-up",
"unicode": "\ue63f"
},
{
"font_class": "hand-up-filled",
"unicode": "\ue63e"
},
{
"font_class": "headphones",
"unicode": "\ue630"
},
{
"font_class": "heart",
"unicode": "\ue639"
},
{
"font_class": "heart-filled",
"unicode": "\ue641"
},
{
"font_class": "help",
"unicode": "\ue679"
},
{
"font_class": "help-filled",
"unicode": "\ue674"
},
{
"font_class": "home",
"unicode": "\ue662"
},
{
"font_class": "home-filled",
"unicode": "\ue663"
},
{
"font_class": "image",
"unicode": "\ue670"
},
{
"font_class": "image-filled",
"unicode": "\ue678"
},
{
"font_class": "images",
"unicode": "\ue650"
},
{
"font_class": "images-filled",
"unicode": "\ue64b"
},
{
"font_class": "info",
"unicode": "\ue669"
},
{
"font_class": "info-filled",
"unicode": "\ue649"
},
{
"font_class": "left",
"unicode": "\ue6b7"
},
{
"font_class": "link",
"unicode": "\ue6a5"
},
{
"font_class": "list",
"unicode": "\ue644"
},
{
"font_class": "location",
"unicode": "\ue6ae"
},
{
"font_class": "location-filled",
"unicode": "\ue6af"
},
{
"font_class": "locked",
"unicode": "\ue66b"
},
{
"font_class": "locked-filled",
"unicode": "\ue668"
},
{
"font_class": "loop",
"unicode": "\ue633"
},
{
"font_class": "mail-open",
"unicode": "\ue643"
},
{
"font_class": "mail-open-filled",
"unicode": "\ue63a"
},
{
"font_class": "map",
"unicode": "\ue667"
},
{
"font_class": "map-filled",
"unicode": "\ue666"
},
{
"font_class": "map-pin",
"unicode": "\ue6ad"
},
{
"font_class": "map-pin-ellipse",
"unicode": "\ue6ac"
},
{
"font_class": "medal",
"unicode": "\ue6a2"
},
{
"font_class": "medal-filled",
"unicode": "\ue6c3"
},
{
"font_class": "mic",
"unicode": "\ue671"
},
{
"font_class": "mic-filled",
"unicode": "\ue677"
},
{
"font_class": "micoff",
"unicode": "\ue67e"
},
{
"font_class": "micoff-filled",
"unicode": "\ue6b0"
},
{
"font_class": "minus",
"unicode": "\ue66f"
},
{
"font_class": "minus-filled",
"unicode": "\ue67d"
},
{
"font_class": "more",
"unicode": "\ue64d"
},
{
"font_class": "more-filled",
"unicode": "\ue64e"
},
{
"font_class": "navigate",
"unicode": "\ue66e"
},
{
"font_class": "navigate-filled",
"unicode": "\ue67a"
},
{
"font_class": "notification",
"unicode": "\ue6a6"
},
{
"font_class": "notification-filled",
"unicode": "\ue6c1"
},
{
"font_class": "paperclip",
"unicode": "\ue652"
},
{
"font_class": "paperplane",
"unicode": "\ue672"
},
{
"font_class": "paperplane-filled",
"unicode": "\ue675"
},
{
"font_class": "person",
"unicode": "\ue699"
},
{
"font_class": "person-filled",
"unicode": "\ue69d"
},
{
"font_class": "personadd",
"unicode": "\ue69f"
},
{
"font_class": "personadd-filled",
"unicode": "\ue698"
},
{
"font_class": "personadd-filled-copy",
"unicode": "\ue6d1"
},
{
"font_class": "phone",
"unicode": "\ue69c"
},
{
"font_class": "phone-filled",
"unicode": "\ue69b"
},
{
"font_class": "plus",
"unicode": "\ue676"
},
{
"font_class": "plus-filled",
"unicode": "\ue6c7"
},
{
"font_class": "plusempty",
"unicode": "\ue67b"
},
{
"font_class": "pulldown",
"unicode": "\ue632"
},
{
"font_class": "pyq",
"unicode": "\ue682"
},
{
"font_class": "qq",
"unicode": "\ue680"
},
{
"font_class": "redo",
"unicode": "\ue64a"
},
{
"font_class": "redo-filled",
"unicode": "\ue655"
},
{
"font_class": "refresh",
"unicode": "\ue657"
},
{
"font_class": "refresh-filled",
"unicode": "\ue656"
},
{
"font_class": "refreshempty",
"unicode": "\ue6bf"
},
{
"font_class": "reload",
"unicode": "\ue6b2"
},
{
"font_class": "right",
"unicode": "\ue6b5"
},
{
"font_class": "scan",
"unicode": "\ue62a"
},
{
"font_class": "search",
"unicode": "\ue654"
},
{
"font_class": "settings",
"unicode": "\ue653"
},
{
"font_class": "settings-filled",
"unicode": "\ue6ce"
},
{
"font_class": "shop",
"unicode": "\ue62f"
},
{
"font_class": "shop-filled",
"unicode": "\ue6cd"
},
{
"font_class": "smallcircle",
"unicode": "\ue67c"
},
{
"font_class": "smallcircle-filled",
"unicode": "\ue665"
},
{
"font_class": "sound",
"unicode": "\ue684"
},
{
"font_class": "sound-filled",
"unicode": "\ue686"
},
{
"font_class": "spinner-cycle",
"unicode": "\ue68a"
},
{
"font_class": "staff",
"unicode": "\ue6a7"
},
{
"font_class": "staff-filled",
"unicode": "\ue6cb"
},
{
"font_class": "star",
"unicode": "\ue688"
},
{
"font_class": "star-filled",
"unicode": "\ue68f"
},
{
"font_class": "starhalf",
"unicode": "\ue683"
},
{
"font_class": "trash",
"unicode": "\ue687"
},
{
"font_class": "trash-filled",
"unicode": "\ue685"
},
{
"font_class": "tune",
"unicode": "\ue6aa"
},
{
"font_class": "tune-filled",
"unicode": "\ue6ca"
},
{
"font_class": "undo",
"unicode": "\ue64f"
},
{
"font_class": "undo-filled",
"unicode": "\ue64c"
},
{
"font_class": "up",
"unicode": "\ue6b6"
},
{
"font_class": "top",
"unicode": "\ue6b6"
},
{
"font_class": "upload",
"unicode": "\ue690"
},
{
"font_class": "upload-filled",
"unicode": "\ue68e"
},
{
"font_class": "videocam",
"unicode": "\ue68c"
},
{
"font_class": "videocam-filled",
"unicode": "\ue689"
},
{
"font_class": "vip",
"unicode": "\ue6a8"
},
{
"font_class": "vip-filled",
"unicode": "\ue6c6"
},
{
"font_class": "wallet",
"unicode": "\ue6b1"
},
{
"font_class": "wallet-filled",
"unicode": "\ue6c2"
},
{
"font_class": "weibo",
"unicode": "\ue68b"
},
{
"font_class": "weixin",
"unicode": "\ue691"
}
] as IconsDataItem[]
// export const fontData = JSON.parse<IconsDataItem>(fontDataJson)
... ...
export const fontData = [
{
"font_class": "arrow-down",
"unicode": "\ue6be"
},
{
"font_class": "arrow-left",
"unicode": "\ue6bc"
},
{
"font_class": "arrow-right",
"unicode": "\ue6bb"
},
{
"font_class": "arrow-up",
"unicode": "\ue6bd"
},
{
"font_class": "auth",
"unicode": "\ue6ab"
},
{
"font_class": "auth-filled",
"unicode": "\ue6cc"
},
{
"font_class": "back",
"unicode": "\ue6b9"
},
{
"font_class": "bars",
"unicode": "\ue627"
},
{
"font_class": "calendar",
"unicode": "\ue6a0"
},
{
"font_class": "calendar-filled",
"unicode": "\ue6c0"
},
{
"font_class": "camera",
"unicode": "\ue65a"
},
{
"font_class": "camera-filled",
"unicode": "\ue658"
},
{
"font_class": "cart",
"unicode": "\ue631"
},
{
"font_class": "cart-filled",
"unicode": "\ue6d0"
},
{
"font_class": "chat",
"unicode": "\ue65d"
},
{
"font_class": "chat-filled",
"unicode": "\ue659"
},
{
"font_class": "chatboxes",
"unicode": "\ue696"
},
{
"font_class": "chatboxes-filled",
"unicode": "\ue692"
},
{
"font_class": "chatbubble",
"unicode": "\ue697"
},
{
"font_class": "chatbubble-filled",
"unicode": "\ue694"
},
{
"font_class": "checkbox",
"unicode": "\ue62b"
},
{
"font_class": "checkbox-filled",
"unicode": "\ue62c"
},
{
"font_class": "checkmarkempty",
"unicode": "\ue65c"
},
{
"font_class": "circle",
"unicode": "\ue65b"
},
{
"font_class": "circle-filled",
"unicode": "\ue65e"
},
{
"font_class": "clear",
"unicode": "\ue66d"
},
{
"font_class": "close",
"unicode": "\ue673"
},
{
"font_class": "closeempty",
"unicode": "\ue66c"
},
{
"font_class": "cloud-download",
"unicode": "\ue647"
},
{
"font_class": "cloud-download-filled",
"unicode": "\ue646"
},
{
"font_class": "cloud-upload",
"unicode": "\ue645"
},
{
"font_class": "cloud-upload-filled",
"unicode": "\ue648"
},
{
"font_class": "color",
"unicode": "\ue6cf"
},
{
"font_class": "color-filled",
"unicode": "\ue6c9"
},
{
"font_class": "compose",
"unicode": "\ue67f"
},
{
"font_class": "contact",
"unicode": "\ue693"
},
{
"font_class": "contact-filled",
"unicode": "\ue695"
},
{
"font_class": "down",
"unicode": "\ue6b8"
},
{
"font_class": "bottom",
"unicode": "\ue6b8"
},
{
"font_class": "download",
"unicode": "\ue68d"
},
{
"font_class": "download-filled",
"unicode": "\ue681"
},
{
"font_class": "email",
"unicode": "\ue69e"
},
{
"font_class": "email-filled",
"unicode": "\ue69a"
},
{
"font_class": "eye",
"unicode": "\ue651"
},
{
"font_class": "eye-filled",
"unicode": "\ue66a"
},
{
"font_class": "eye-slash",
"unicode": "\ue6b3"
},
{
"font_class": "eye-slash-filled",
"unicode": "\ue6b4"
},
{
"font_class": "fire",
"unicode": "\ue6a1"
},
{
"font_class": "fire-filled",
"unicode": "\ue6c5"
},
{
"font_class": "flag",
"unicode": "\ue65f"
},
{
"font_class": "flag-filled",
"unicode": "\ue660"
},
{
"font_class": "folder-add",
"unicode": "\ue6a9"
},
{
"font_class": "folder-add-filled",
"unicode": "\ue6c8"
},
{
"font_class": "font",
"unicode": "\ue6a3"
},
{
"font_class": "forward",
"unicode": "\ue6ba"
},
{
"font_class": "gear",
"unicode": "\ue664"
},
{
"font_class": "gear-filled",
"unicode": "\ue661"
},
{
"font_class": "gift",
"unicode": "\ue6a4"
},
{
"font_class": "gift-filled",
"unicode": "\ue6c4"
},
{
"font_class": "hand-down",
"unicode": "\ue63d"
},
{
"font_class": "hand-down-filled",
"unicode": "\ue63c"
},
{
"font_class": "hand-up",
"unicode": "\ue63f"
},
{
"font_class": "hand-up-filled",
"unicode": "\ue63e"
},
{
"font_class": "headphones",
"unicode": "\ue630"
},
{
"font_class": "heart",
"unicode": "\ue639"
},
{
"font_class": "heart-filled",
"unicode": "\ue641"
},
{
"font_class": "help",
"unicode": "\ue679"
},
{
"font_class": "help-filled",
"unicode": "\ue674"
},
{
"font_class": "home",
"unicode": "\ue662"
},
{
"font_class": "home-filled",
"unicode": "\ue663"
},
{
"font_class": "image",
"unicode": "\ue670"
},
{
"font_class": "image-filled",
"unicode": "\ue678"
},
{
"font_class": "images",
"unicode": "\ue650"
},
{
"font_class": "images-filled",
"unicode": "\ue64b"
},
{
"font_class": "info",
"unicode": "\ue669"
},
{
"font_class": "info-filled",
"unicode": "\ue649"
},
{
"font_class": "left",
"unicode": "\ue6b7"
},
{
"font_class": "link",
"unicode": "\ue6a5"
},
{
"font_class": "list",
"unicode": "\ue644"
},
{
"font_class": "location",
"unicode": "\ue6ae"
},
{
"font_class": "location-filled",
"unicode": "\ue6af"
},
{
"font_class": "locked",
"unicode": "\ue66b"
},
{
"font_class": "locked-filled",
"unicode": "\ue668"
},
{
"font_class": "loop",
"unicode": "\ue633"
},
{
"font_class": "mail-open",
"unicode": "\ue643"
},
{
"font_class": "mail-open-filled",
"unicode": "\ue63a"
},
{
"font_class": "map",
"unicode": "\ue667"
},
{
"font_class": "map-filled",
"unicode": "\ue666"
},
{
"font_class": "map-pin",
"unicode": "\ue6ad"
},
{
"font_class": "map-pin-ellipse",
"unicode": "\ue6ac"
},
{
"font_class": "medal",
"unicode": "\ue6a2"
},
{
"font_class": "medal-filled",
"unicode": "\ue6c3"
},
{
"font_class": "mic",
"unicode": "\ue671"
},
{
"font_class": "mic-filled",
"unicode": "\ue677"
},
{
"font_class": "micoff",
"unicode": "\ue67e"
},
{
"font_class": "micoff-filled",
"unicode": "\ue6b0"
},
{
"font_class": "minus",
"unicode": "\ue66f"
},
{
"font_class": "minus-filled",
"unicode": "\ue67d"
},
{
"font_class": "more",
"unicode": "\ue64d"
},
{
"font_class": "more-filled",
"unicode": "\ue64e"
},
{
"font_class": "navigate",
"unicode": "\ue66e"
},
{
"font_class": "navigate-filled",
"unicode": "\ue67a"
},
{
"font_class": "notification",
"unicode": "\ue6a6"
},
{
"font_class": "notification-filled",
"unicode": "\ue6c1"
},
{
"font_class": "paperclip",
"unicode": "\ue652"
},
{
"font_class": "paperplane",
"unicode": "\ue672"
},
{
"font_class": "paperplane-filled",
"unicode": "\ue675"
},
{
"font_class": "person",
"unicode": "\ue699"
},
{
"font_class": "person-filled",
"unicode": "\ue69d"
},
{
"font_class": "personadd",
"unicode": "\ue69f"
},
{
"font_class": "personadd-filled",
"unicode": "\ue698"
},
{
"font_class": "personadd-filled-copy",
"unicode": "\ue6d1"
},
{
"font_class": "phone",
"unicode": "\ue69c"
},
{
"font_class": "phone-filled",
"unicode": "\ue69b"
},
{
"font_class": "plus",
"unicode": "\ue676"
},
{
"font_class": "plus-filled",
"unicode": "\ue6c7"
},
{
"font_class": "plusempty",
"unicode": "\ue67b"
},
{
"font_class": "pulldown",
"unicode": "\ue632"
},
{
"font_class": "pyq",
"unicode": "\ue682"
},
{
"font_class": "qq",
"unicode": "\ue680"
},
{
"font_class": "redo",
"unicode": "\ue64a"
},
{
"font_class": "redo-filled",
"unicode": "\ue655"
},
{
"font_class": "refresh",
"unicode": "\ue657"
},
{
"font_class": "refresh-filled",
"unicode": "\ue656"
},
{
"font_class": "refreshempty",
"unicode": "\ue6bf"
},
{
"font_class": "reload",
"unicode": "\ue6b2"
},
{
"font_class": "right",
"unicode": "\ue6b5"
},
{
"font_class": "scan",
"unicode": "\ue62a"
},
{
"font_class": "search",
"unicode": "\ue654"
},
{
"font_class": "settings",
"unicode": "\ue653"
},
{
"font_class": "settings-filled",
"unicode": "\ue6ce"
},
{
"font_class": "shop",
"unicode": "\ue62f"
},
{
"font_class": "shop-filled",
"unicode": "\ue6cd"
},
{
"font_class": "smallcircle",
"unicode": "\ue67c"
},
{
"font_class": "smallcircle-filled",
"unicode": "\ue665"
},
{
"font_class": "sound",
"unicode": "\ue684"
},
{
"font_class": "sound-filled",
"unicode": "\ue686"
},
{
"font_class": "spinner-cycle",
"unicode": "\ue68a"
},
{
"font_class": "staff",
"unicode": "\ue6a7"
},
{
"font_class": "staff-filled",
"unicode": "\ue6cb"
},
{
"font_class": "star",
"unicode": "\ue688"
},
{
"font_class": "star-filled",
"unicode": "\ue68f"
},
{
"font_class": "starhalf",
"unicode": "\ue683"
},
{
"font_class": "trash",
"unicode": "\ue687"
},
{
"font_class": "trash-filled",
"unicode": "\ue685"
},
{
"font_class": "tune",
"unicode": "\ue6aa"
},
{
"font_class": "tune-filled",
"unicode": "\ue6ca"
},
{
"font_class": "undo",
"unicode": "\ue64f"
},
{
"font_class": "undo-filled",
"unicode": "\ue64c"
},
{
"font_class": "up",
"unicode": "\ue6b6"
},
{
"font_class": "top",
"unicode": "\ue6b6"
},
{
"font_class": "upload",
"unicode": "\ue690"
},
{
"font_class": "upload-filled",
"unicode": "\ue68e"
},
{
"font_class": "videocam",
"unicode": "\ue68c"
},
{
"font_class": "videocam-filled",
"unicode": "\ue689"
},
{
"font_class": "vip",
"unicode": "\ue6a8"
},
{
"font_class": "vip-filled",
"unicode": "\ue6c6"
},
{
"font_class": "wallet",
"unicode": "\ue6b1"
},
{
"font_class": "wallet-filled",
"unicode": "\ue6c2"
},
{
"font_class": "weibo",
"unicode": "\ue68b"
},
{
"font_class": "weixin",
"unicode": "\ue691"
}
]
// export const fontData = JSON.parse<IconsDataItem>(fontDataJson)
... ...
{
"id": "uni-icons",
"displayName": "uni-icons 图标",
"version": "2.0.10",
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
"keywords": [
"uni-ui",
"uniui",
"icon",
"图标"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": "^3.2.14"
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": ["uni-scss"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y",
"alipay": "n"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y",
"app-uvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"钉钉": "y",
"快手": "y",
"飞书": "y",
"京东": "y"
},
"快应用": {
"华为": "y",
"联盟": "y"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
... ...
## Icons 图标
> **组件名:uni-icons**
> 代码块: `uIcons`
用于展示 icons 图标 。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-icons)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
... ...
## 1.2.4(2022-09-19)
- 修复,未对主题色设置默认色,导致未引入 uni-scss 变量文件报错。
- 修复,未对移动端当前页文字做主题色适配。
## 1.2.3(2022-09-15)
- 修复未使用 uni-scss 主题色的 bug。
## 1.2.2(2022-07-06)
- 修复 es 语言 i18n 错误
## 1.2.1(2021-11-22)
- 修复 vue3中某些scss变量无法找到的问题
## 1.2.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-pagination](https://uniapp.dcloud.io/component/uniui/uni-pagination)
## 1.1.2(2021-10-08)
- 修复 current 、value 属性未监听,导致高亮样式失效的 bug
## 1.1.1(2021-08-20)
- 新增 支持国际化
## 1.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.0.7(2021-05-12)
- 新增 组件示例地址
## 1.0.6(2021-04-12)
- 新增 PC 和 移动端适配不同的 ui
## 1.0.5(2021-02-05)
- 优化 组件引用关系,通过uni_modules引用组件
## 1.0.4(2021-02-05)
- 调整为uni_modules目录规范
... ...
{
"uni-pagination.prevText": "prev",
"uni-pagination.nextText": "next",
"uni-pagination.piecePerPage": "piece/page"
}
... ...
{
"uni-pagination.prevText": "anterior",
"uni-pagination.nextText": "prxima",
"uni-pagination.piecePerPage": "Art¨ªculo/P¨¢gina"
}
... ...
{
"uni-pagination.prevText": "précédente",
"uni-pagination.nextText": "suivante",
"uni-pagination.piecePerPage": "Articles/Pages"
}
... ...
import en from './en.json'
import es from './es.json'
import fr from './fr.json'
import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json'
export default {
en,
es,
fr,
'zh-Hans': zhHans,
'zh-Hant': zhHant
}
... ...
{
"uni-pagination.prevText": "上一页",
"uni-pagination.nextText": "下一页",
"uni-pagination.piecePerPage": "条/页"
}
... ...
{
"uni-pagination.prevText": "上一頁",
"uni-pagination.nextText": "下一頁",
"uni-pagination.piecePerPage": "條/頁"
}
... ...
<template>
<view class="uni-pagination">
<!-- #ifndef MP -->
<picker v-if="showPageSize === true || showPageSize === 'true'" class="select-picker" mode="selector"
:value="pageSizeIndex" :range="pageSizeRange" @change="pickerChange" @cancel="pickerClick"
@click.native="pickerClick">
<button type="default" size="mini" :plain="true">
<text>{{pageSizeRange[pageSizeIndex]}} {{piecePerPage}}</text>
<uni-icons class="select-picker-icon" type="arrowdown" size="12" color="#999"></uni-icons>
</button>
</picker>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<view class="uni-pagination__total is-phone-hide"> {{ total }} </view>
<!-- #endif -->
<view class="uni-pagination__btn"
:class="currentIndex === 1 ? 'uni-pagination--disabled' : 'uni-pagination--enabled'"
:hover-class="currentIndex === 1 ? '' : 'uni-pagination--hover'" :hover-start-time="20"
:hover-stay-time="70" @click="clickLeft">
<template v-if="showIcon === true || showIcon === 'true'">
<uni-icons color="#666" size="16" type="left" />
</template>
<template v-else>
<text class="uni-pagination__child-btn">{{ prevPageText }}</text>
</template>
</view>
<view class="uni-pagination__num uni-pagination__num-flex-none">
<view class="uni-pagination__num-current">
<text class="uni-pagination__num-current-text is-pc-hide current-index-text">{{ currentIndex }}</text>
<text class="uni-pagination__num-current-text is-pc-hide">/{{ maxPage || 0 }}</text>
<!-- #ifndef APP-NVUE -->
<view v-for="(item, index) in paper" :key="index" :class="{ 'page--active': item === currentIndex }"
class="uni-pagination__num-tag tag--active is-phone-hide" @click.top="selectPage(item, index)">
<text>{{ item }}</text>
</view>
<!-- #endif -->
</view>
</view>
<view class="uni-pagination__btn"
:class="currentIndex >= maxPage ? 'uni-pagination--disabled' : 'uni-pagination--enabled'"
:hover-class="currentIndex === maxPage ? '' : 'uni-pagination--hover'" :hover-start-time="20"
:hover-stay-time="70" @click="clickRight">
<template v-if="showIcon === true || showIcon === 'true'">
<uni-icons color="#666" size="16" type="right" />
</template>
<template v-else>
<text class="uni-pagination__child-btn">{{ nextPageText }}</text>
</template>
</view>
</view>
</template>
<script>
/**
* Pagination 分页器
* @description 分页器组件,用于展示页码、请求数据等
* @tutorial https://ext.dcloud.net.cn/plugin?id=32
* @property {String} prevText 左侧按钮文字
* @property {String} nextText 右侧按钮文字
* @property {String} piecePerPageText 条/页文字
* @property {Number} current 当前页
* @property {Number} total 数据总量
* @property {Number} pageSize 每页数据量
* @property {Boolean} showIcon = [true|false] 是否以 icon 形式展示按钮
* @property {Boolean} showPageSize = [true|false] 是否展示每页条数
* @property {Array} pageSizeRange = [20, 50, 100, 500] 每页条数选框
* @event {Function} change 点击页码按钮时触发 ,e={type,current} current为当前页,type值为:next/prev,表示点击的是上一页还是下一个
* * @event {Function} pageSizeChange 当前每页条数改变时触发 ,e={pageSize} pageSize 为当前所选的每页条数
*/
import {
initVueI18n
} from '@dcloudio/uni-i18n'
import messages from './i18n/index.js'
const {
t
} = initVueI18n(messages)
export default {
name: 'UniPagination',
emits: ['update:modelValue', 'input', 'change', 'pageSizeChange'],
props: {
value: {
type: [Number, String],
default: 1
},
modelValue: {
type: [Number, String],
default: 1
},
prevText: {
type: String,
},
nextText: {
type: String,
},
piecePerPageText: {
type: String
},
current: {
type: [Number, String],
default: 1
},
total: {
// 数据总量
type: [Number, String],
default: 0
},
pageSize: {
// 每页数据量
type: [Number, String],
default: 10
},
showIcon: {
// 是否以 icon 形式展示按钮
type: [Boolean, String],
default: false
},
showPageSize: {
// 是否以 icon 形式展示按钮
type: [Boolean, String],
default: false
},
pagerCount: {
type: Number,
default: 7
},
pageSizeRange: {
type: Array,
default: () => [20, 50, 100, 500]
}
},
data() {
return {
pageSizeIndex: 0,
currentIndex: 1,
paperData: [],
pickerShow: false
}
},
computed: {
piecePerPage() {
return this.piecePerPageText || t('uni-pagination.piecePerPage')
},
prevPageText() {
return this.prevText || t('uni-pagination.prevText')
},
nextPageText() {
return this.nextText || t('uni-pagination.nextText')
},
maxPage() {
let maxPage = 1
let total = Number(this.total)
let pageSize = Number(this.pageSize)
if (total && pageSize) {
maxPage = Math.ceil(total / pageSize)
}
return maxPage
},
paper() {
const num = this.currentIndex
// TODO 最大页数
const pagerCount = this.pagerCount
// const total = 181
const total = this.total
const pageSize = this.pageSize
let totalArr = []
let showPagerArr = []
let pagerNum = Math.ceil(total / pageSize)
for (let i = 0; i < pagerNum; i++) {
totalArr.push(i + 1)
}
showPagerArr.push(1)
const totalNum = totalArr[totalArr.length - (pagerCount + 1) / 2]
totalArr.forEach((item, index) => {
if ((pagerCount + 1) / 2 >= num) {
if (item < pagerCount + 1 && item > 1) {
showPagerArr.push(item)
}
} else if (num + 2 <= totalNum) {
if (item > num - (pagerCount + 1) / 2 && item < num + (pagerCount + 1) / 2) {
showPagerArr.push(item)
}
} else {
if ((item > num - (pagerCount + 1) / 2 || pagerNum - pagerCount < item) && item < totalArr[
totalArr.length - 1]) {
showPagerArr.push(item)
}
}
})
if (pagerNum > pagerCount) {
if ((pagerCount + 1) / 2 >= num) {
showPagerArr[showPagerArr.length - 1] = '...'
} else if (num + 2 <= totalNum) {
showPagerArr[1] = '...'
showPagerArr[showPagerArr.length - 1] = '...'
} else {
showPagerArr[1] = '...'
}
showPagerArr.push(totalArr[totalArr.length - 1])
} else {
if ((pagerCount + 1) / 2 >= num) {} else if (num + 2 <= totalNum) {} else {
showPagerArr.shift()
showPagerArr.push(totalArr[totalArr.length - 1])
}
}
return showPagerArr
}
},
watch: {
current: {
immediate: true,
handler(val, old) {
if (val < 1) {
this.currentIndex = 1
} else {
this.currentIndex = val
}
}
},
value: {
immediate: true,
handler(val) {
if (Number(this.current) !== 1) return
if (val < 1) {
this.currentIndex = 1
} else {
this.currentIndex = val
}
}
},
pageSizeIndex(val) {
this.$emit('pageSizeChange', this.pageSizeRange[val])
}
},
methods: {
pickerChange(e) {
this.pageSizeIndex = e.detail.value
this.pickerClick()
},
pickerClick() {
// #ifdef H5
const body = document.querySelector('body')
if (!body) return
const className = 'uni-pagination-picker-show'
this.pickerShow = !this.pickerShow
if (this.pickerShow) {
body.classList.add(className)
} else {
setTimeout(() => body.classList.remove(className), 300)
}
// #endif
},
// 选择标签
selectPage(e, index) {
if (parseInt(e)) {
this.currentIndex = e
this.change('current')
} else {
let pagerNum = Math.ceil(this.total / this.pageSize)
// let pagerNum = Math.ceil(181 / this.pageSize)
// 上一页
if (index <= 1) {
if (this.currentIndex - 5 > 1) {
this.currentIndex -= 5
} else {
this.currentIndex = 1
}
return
}
// 下一页
if (index >= 6) {
if (this.currentIndex + 5 > pagerNum) {
this.currentIndex = pagerNum
} else {
this.currentIndex += 5
}
return
}
}
},
clickLeft() {
if (Number(this.currentIndex) === 1) {
return
}
this.currentIndex -= 1
this.change('prev')
},
clickRight() {
if (Number(this.currentIndex) >= this.maxPage) {
return
}
this.currentIndex += 1
this.change('next')
},
change(e) {
this.$emit('input', this.currentIndex)
this.$emit('update:modelValue', this.currentIndex)
this.$emit('change', {
type: e,
current: this.currentIndex
})
}
}
}
</script>
<style lang="scss" scoped>
$uni-primary: #2979ff !default;
.uni-pagination {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
position: relative;
overflow: hidden;
flex-direction: row;
justify-content: center;
align-items: center;
}
.uni-pagination__total {
font-size: 14px;
color: #999;
margin-right: 15px;
}
.uni-pagination__btn {
/* #ifndef APP-NVUE */
display: flex;
cursor: pointer;
/* #endif */
padding: 0 8px;
line-height: 30px;
font-size: 12px;
position: relative;
background-color: #F0F0F0;
flex-direction: row;
justify-content: center;
align-items: center;
text-align: center;
border-radius: 5px;
// border-width: 1px;
// border-style: solid;
// border-color: $uni-border-color;
}
.uni-pagination__child-btn {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
font-size: 12px;
position: relative;
flex-direction: row;
justify-content: center;
align-items: center;
text-align: center;
color: #666;
font-size: 12px;
}
.uni-pagination__num {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
justify-content: center;
align-items: center;
height: 30px;
line-height: 30px;
font-size: 12px;
color: #666;
margin: 0 5px;
}
.uni-pagination__num-tag {
/* #ifdef H5 */
cursor: pointer;
min-width: 30px;
/* #endif */
margin: 0 5px;
height: 30px;
text-align: center;
line-height: 30px;
// border: 1px red solid;
color: #999;
border-radius: 4px;
// border-width: 1px;
// border-style: solid;
// border-color: $uni-border-color;
}
.uni-pagination__num-current {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
}
.uni-pagination__num-current-text {
font-size: 15px;
}
.current-index-text{
color: $uni-primary;
}
.uni-pagination--enabled {
color: #333333;
opacity: 1;
}
.uni-pagination--disabled {
opacity: 0.5;
/* #ifdef H5 */
cursor: default;
/* #endif */
}
.uni-pagination--hover {
color: rgba(0, 0, 0, 0.6);
background-color: #eee;
}
.tag--active:hover {
color: $uni-primary;
}
.page--active {
color: #fff;
background-color: $uni-primary;
}
.page--active:hover {
color: #fff;
}
/* #ifndef APP-NVUE */
.is-pc-hide {
display: block;
}
.is-phone-hide {
display: none;
}
@media screen and (min-width: 450px) {
.is-pc-hide {
display: none;
}
.is-phone-hide {
display: block;
}
.uni-pagination__num-flex-none {
flex: none;
}
}
/* #endif */
</style>
... ...
{
"id": "uni-pagination",
"displayName": "uni-pagination 分页器",
"version": "1.2.4",
"description": "Pagination 分页器组件,用于展示页码、请求数据等。",
"keywords": [
"uni-ui",
"uniui",
"分页器",
"页码"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": ["uni-scss","uni-icons"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
\ No newline at end of file
... ...
## Pagination 分页器
> **组件名:uni-pagination**
> 代码块: `uPagination`
分页器组件,用于展示页码、请求数据等。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-pagination)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
... ...
"use strict";const t=require("../uni_modules/uview-plus/index.js");exports.carInfoAdd=e=>t.http.post("/registration/add",e,{custom:{auth:!0}}),exports.getCodeImg=e=>t.http.get("/captchaImage"),exports.getNotice=e=>t.http.get(`/system/notice/${e}`,{custom:{auth:!0}}),exports.getUserCarInfo=e=>t.http.get("/registration/listRegistration",{params:e,custom:{auth:!0}}),exports.getUserInfo=e=>t.http.get("/system/user/profile",{custom:{auth:!0}}),exports.updateUserInfo=e=>t.http.put("/system/user/profile",e,{custom:{auth:!0}}),exports.userLogin=e=>t.http.post("/login",e),exports.userWxLogin=(e,s={})=>t.http.post("/wechat/login",e,s);
"use strict";const t=require("../uni_modules/uview-plus/index.js");exports.carInfoAdd=e=>t.http.post("/registration/add",e,{custom:{auth:!0}}),exports.carInfoEdit=e=>t.http.post("/registration/edit",e,{custom:{auth:!0}}),exports.getCodeImg=e=>t.http.get("/captchaImage"),exports.getNotice=e=>t.http.get(`/system/notice/${e}`,{custom:{auth:!0}}),exports.getUserCarInfo=e=>t.http.get("/registration/listRegistration",{params:e,custom:{auth:!0}}),exports.getUserInfo=e=>t.http.get("/system/user/profile",{custom:{auth:!0}}),exports.updateUserInfo=e=>t.http.put("/system/user/profile",e,{custom:{auth:!0}}),exports.userCancel=()=>t.http.get("/system/user/deRegistration",{custom:{auth:!0}}),exports.userLogin=e=>t.http.post("/login",e),exports.userWxLogin=(e,s={})=>t.http.post("/wechat/login",e,s);
... ...
"use strict";const t=require("../uni_modules/uview-plus/index.js");exports.disposeUser=(s,e)=>t.http.post(`/registration/completeTask/${e}`,s,{custom:{auth:!0}}),exports.getUserList=s=>t.http.post("/system/user/otherEmployee",s,{custom:{auth:!0}}),exports.queryContinueList=s=>t.http.get("/registration/monitor/listReports",{params:s,custom:{auth:!0}}),exports.queryEndedList=s=>t.http.get("/registration/monitor/listEnded",{params:s,custom:{auth:!0}}),exports.queryMyList=s=>t.http.get("/registration/mylist",{params:s,custom:{auth:!0}}),exports.transfer=(s,e)=>t.http.post(`/registratiom/transferTask/${e}`,s,{custom:{auth:!0}});
"use strict";const t=require("../uni_modules/uview-plus/index.js");exports.disposeUser=(s,e)=>t.http.post(`/registration/completeTask/${e}`,s,{custom:{auth:!0}}),exports.getUserList=s=>t.http.get("/system/user/otherEmployee",{params:s,custom:{auth:!0}}),exports.listDept=s=>t.http.get("/system/dept/list",{params:s,custom:{auth:!0}}),exports.queryContinueList=s=>t.http.get("/registration/monitor/listReports",{params:s,custom:{auth:!0}}),exports.queryDefeatContent=s=>t.http.get("/registration/monitor/getComment",{params:s,custom:{auth:!0}}),exports.queryDeprecatedList=s=>t.http.get("/registration/monitor/listDeprecated",{params:s,custom:{auth:!0}}),exports.queryEndedList=s=>t.http.get("/registration/monitor/listEnded",{params:s,custom:{auth:!0}}),exports.queryMyList=s=>t.http.get("/registration/mylist",{params:s,custom:{auth:!0}}),exports.queryOngoingList=s=>t.http.get("/registration/monitor/listOngoing",{params:s,custom:{auth:!0}}),exports.queryProcessedList=s=>t.http.get("/registration/monitor/listProcessed",{params:s,custom:{auth:!0}}),exports.queryResult=s=>t.http.get("/registration/monitor/getResult",{params:s,custom:{auth:!0}}),exports.transfer=(s,e)=>t.http.post(`/registratiom/transferTask/${e}`,s,{custom:{auth:!0}});
... ...