修改完善首页,消除bug
This commit is contained in:
parent
e4fe05035c
commit
00ad605bc2
64
App.vue
64
App.vue
@ -5,6 +5,7 @@
|
|||||||
import {
|
import {
|
||||||
listConvert
|
listConvert
|
||||||
} from '@/api/system/unitConverter/sysUnitConverter.js';
|
} from '@/api/system/unitConverter/sysUnitConverter.js';
|
||||||
|
|
||||||
const queryParams = ref({
|
const queryParams = ref({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 1000,
|
pageSize: 1000,
|
||||||
@ -16,8 +17,14 @@
|
|||||||
status: null,
|
status: null,
|
||||||
unitOrder: null
|
unitOrder: null
|
||||||
});
|
});
|
||||||
|
|
||||||
// 保留原有单位换算方法
|
// 保留原有单位换算方法
|
||||||
const groupByUnitType = (data) => {
|
const groupByUnitType = (data) => {
|
||||||
|
if (!data || !Array.isArray(data)) {
|
||||||
|
console.warn('groupByUnitType: 数据为空或不是数组');
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
return data.reduce((acc, unit) => {
|
return data.reduce((acc, unit) => {
|
||||||
const type = unit.unitType;
|
const type = unit.unitType;
|
||||||
if (!acc[type]) acc[type] = [];
|
if (!acc[type]) acc[type] = [];
|
||||||
@ -34,44 +41,65 @@
|
|||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
try {
|
try {
|
||||||
|
console.log('开始请求单位数据...');
|
||||||
const response = await listConvert(queryParams.value);
|
const response = await listConvert(queryParams.value);
|
||||||
|
console.log('API响应:', response);
|
||||||
|
|
||||||
|
if (!response || !response.rows) {
|
||||||
|
console.error('API响应格式错误');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.rows.length === 0) {
|
||||||
|
console.warn('单位数据为空数组');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const unitDataGrouped = groupByUnitType(response.rows);
|
const unitDataGrouped = groupByUnitType(response.rows);
|
||||||
console.log('开始缓存' + unitDataGrouped);
|
console.log('分组后的单位数据:', unitDataGrouped);
|
||||||
|
|
||||||
// #ifdef APP || APP-PLUS
|
// #ifdef APP || APP-PLUS
|
||||||
uni.setStorageSync({
|
try {
|
||||||
key: 'unitData',
|
// 使用正确的同步写法
|
||||||
data: unitDataGrouped,
|
uni.setStorageSync('unitData', unitDataGrouped);
|
||||||
success: function() {
|
console.log('APP端缓存成功');
|
||||||
console.log('缓存成功');
|
|
||||||
}
|
// 立即验证
|
||||||
});
|
const verifyData = uni.getStorageSync('unitData');
|
||||||
|
console.log('APP缓存验证:', verifyData ? '成功' : '失败', verifyData);
|
||||||
|
} catch (storageError) {
|
||||||
|
console.error('APP缓存设置失败:', storageError);
|
||||||
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
localStorage.setItem('unitData', JSON.stringify(unitDataGrouped))
|
try {
|
||||||
|
localStorage.setItem('unitData', JSON.stringify(unitDataGrouped));
|
||||||
|
console.log('H5端缓存成功');
|
||||||
|
} catch (storageError) {
|
||||||
|
console.error('H5缓存设置失败:', storageError);
|
||||||
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取单位数据失败:', error);
|
console.error('获取单位数据失败:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
|
console.log('App Launch - 开始初始化');
|
||||||
getList();
|
getList();
|
||||||
console.log('App Launch')
|
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
console.log('App Show')
|
console.log('App Show');
|
||||||
},
|
},
|
||||||
onHide: function() {
|
onHide: function() {
|
||||||
console.log('App Hide')
|
console.log('App Hide');
|
||||||
},
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -1,123 +1,123 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="confirm-dialog" v-if="visible">
|
<view class="confirm-dialog" v-if="visible">
|
||||||
<view class="dialog-mask"></view>
|
<view class="dialog-mask"></view>
|
||||||
<view class="dialog-content">
|
<view class="dialog-content">
|
||||||
<view class="dialog-header">提示</view>
|
<view class="dialog-header">提示</view>
|
||||||
<view class="dialog-title">{{ title }}</view>
|
<view class="dialog-title">{{ title }}</view>
|
||||||
<view class="dialog-buttons">
|
<view class="dialog-buttons">
|
||||||
<button class="button cancel-btn" @click="handleCancel" hover-class="button-hover">{{ cancelText
|
<button class="button cancel-btn" @click="handleCancel" hover-class="button-hover">{{ cancelText
|
||||||
}}</button>
|
}}</button>
|
||||||
<button class="button confirm-btn" @click="handleConfirm" hover-class="button-hover"
|
<button class="button confirm-btn" @click="handleConfirm" hover-class="button-hover"
|
||||||
:style="{ background: color }">{{ confirmText }}</button>
|
:style="{ background: color }">{{ confirmText }}</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { defineProps, defineEmits } from 'vue'
|
// import { defineProps, defineEmits } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '提示'
|
default: '提示'
|
||||||
},
|
},
|
||||||
cancelText: {
|
cancelText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '取消'
|
default: '取消'
|
||||||
},
|
},
|
||||||
confirmText: {
|
confirmText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '确认'
|
default: '确认'
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '#1E88E5'
|
default: '#1E88E5'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const emit = defineEmits(['update:visible', 'confirm', 'cancel']);
|
const emit = defineEmits(['update:visible', 'confirm', 'cancel']);
|
||||||
const handleConfirm = () => {
|
const handleConfirm = () => {
|
||||||
emit('update:visible', false);
|
emit('update:visible', false);
|
||||||
emit('confirm')
|
emit('confirm')
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
emit('cancel')
|
emit('cancel')
|
||||||
emit('update:visible', false);
|
emit('update:visible', false);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.confirm-dialog {
|
.confirm-dialog {
|
||||||
.dialog-mask {
|
.dialog-mask {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background: rgba(0, 0, 0, 0.4);
|
background: rgba(0, 0, 0, 0.4);
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-content {
|
.dialog-content {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
width: 280px;
|
width: 280px;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
|
|
||||||
.dialog-header {
|
.dialog-header {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-title {
|
.dialog-title {
|
||||||
padding: 10px 20px 20px 20px;
|
padding: 10px 20px 20px 20px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #333;
|
color: #333;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-buttons {
|
.dialog-buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
line-height: 80rpx;
|
line-height: 80rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
border: none;
|
border: none;
|
||||||
|
|
||||||
&.button-hover {
|
&.button-hover {
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cancel-btn {
|
.cancel-btn {
|
||||||
background: #F5F5F5;
|
background: #F5F5F5;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.confirm-btn {
|
.confirm-btn {
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -1,270 +1,274 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="upload-box">
|
<view class="upload-box">
|
||||||
<view>
|
<view>
|
||||||
<view class="upload-container" v-if="!videoCover" @click="chooseVideo">
|
<view class="upload-container" v-if="!videoCover" @click="chooseVideo">
|
||||||
<uni-icons type="cloud-upload-filled" size="60" color="#ff6634"></uni-icons>
|
<uni-icons type="cloud-upload-filled" size="60" color="#ff6634"></uni-icons>
|
||||||
<text class="upload-text">{{ uploadText }}</text>
|
<text class="upload-text">{{ uploadText }}</text>
|
||||||
<text class="upload-desc">{{ displayUploadDesc }}</text>
|
<text class="upload-desc">{{ displayUploadDesc }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="video-preview">
|
<view v-else class="video-preview">
|
||||||
<view class="cover-container">
|
<view class="cover-container">
|
||||||
<view class="icon-cuo" @tap.stop="delectVideo">
|
<view class="icon-cuo" @tap.stop="delectVideo">
|
||||||
<uni-icons type="close" size="16" color="#ffffff"></uni-icons>
|
<uni-icons type="close" size="16" color="#ffffff"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<video :src="videoCover" class="video-cover" />
|
<video :src="videoCover" class="video-cover" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<ConfirmDialog v-model:visible="showModal" title="是否要删除此视频" @confirm="confirmDelete" />
|
<ConfirmDialog v-model:visible="showModal" title="是否要删除此视频" @confirm="confirmDelete" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch, computed } from 'vue'
|
import {
|
||||||
import { defineProps, defineEmits } from 'vue'
|
ref,
|
||||||
import modal from '@/plugins/modal';
|
watch,
|
||||||
import ConfirmDialog from '@/components/geek-xd/components/geek-confirm-dialog/geek-confirm-dialog.vue'
|
computed
|
||||||
|
} from 'vue'
|
||||||
|
// import { defineProps, defineEmits } from 'vue'
|
||||||
|
import modal from '@/plugins/modal';
|
||||||
|
import ConfirmDialog from '@/components/geek-xd/components/geek-confirm-dialog/geek-confirm-dialog.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
uploadText: {
|
uploadText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '点击上传视频文件'
|
default: '点击上传视频文件'
|
||||||
},
|
},
|
||||||
uploadDesc: {
|
uploadDesc: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
sourceType: {
|
sourceType: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => ['album', 'camera']
|
default: () => ['album', 'camera']
|
||||||
},
|
},
|
||||||
maxSize: {
|
maxSize: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 500 // 默认500M
|
default: 500 // 默认500M
|
||||||
},
|
},
|
||||||
supportedTypes: {
|
supportedTypes: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => ['mp4', 'mov', 'avi'] // 支持的视频格式
|
default: () => ['mp4', 'mov', 'avi'] // 支持的视频格式
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['upload', 'delete'])
|
const emit = defineEmits(['upload', 'delete'])
|
||||||
|
|
||||||
const videoCover = ref('')
|
const videoCover = ref('')
|
||||||
const showModal = ref(false)
|
const showModal = ref(false)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 动态生成上传描述文本
|
* 动态生成上传描述文本
|
||||||
* 如果用户提供了自定义描述则使用,否则根据支持的格式和文件大小限制自动生成
|
* 如果用户提供了自定义描述则使用,否则根据支持的格式和文件大小限制自动生成
|
||||||
* @returns {string} 上传描述文本
|
* @returns {string} 上传描述文本
|
||||||
*/
|
*/
|
||||||
const displayUploadDesc = computed(() => {
|
const displayUploadDesc = computed(() => {
|
||||||
return props.uploadDesc || `支持${props.supportedTypes.join('/')}等格式,文件大小不超过${props.maxSize}M`
|
return props.uploadDesc || `支持${props.supportedTypes.join('/')}等格式,文件大小不超过${props.maxSize}M`
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除视频处理函数
|
* 删除视频处理函数
|
||||||
* 阻止事件冒泡并显示确认删除对话框
|
* 阻止事件冒泡并显示确认删除对话框
|
||||||
* @param {Event} event - 点击事件对象
|
* @param {Event} event - 点击事件对象
|
||||||
*/
|
*/
|
||||||
const delectVideo = (event) => {
|
const delectVideo = (event) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
showModal.value = true;
|
showModal.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认删除视频
|
* 确认删除视频
|
||||||
* 关闭确认对话框,清空视频封面,并触发删除事件
|
* 关闭确认对话框,清空视频封面,并触发删除事件
|
||||||
*/
|
*/
|
||||||
const confirmDelete = () => {
|
const confirmDelete = () => {
|
||||||
showModal.value = false
|
showModal.value = false
|
||||||
videoCover.value = null
|
videoCover.value = null
|
||||||
emit('delete')
|
emit('delete')
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 从文件路径中提取文件扩展名
|
* 从文件路径中提取文件扩展名
|
||||||
* @param {string} filePath - 文件路径
|
* @param {string} filePath - 文件路径
|
||||||
* @returns {string} 文件扩展名(小写),如果没有扩展名则返回空字符串
|
* @returns {string} 文件扩展名(小写),如果没有扩展名则返回空字符串
|
||||||
*/
|
*/
|
||||||
const getFileExtension = (filePath) => {
|
const getFileExtension = (filePath) => {
|
||||||
if (!filePath) {
|
if (!filePath) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
const dotIndex = filePath.lastIndexOf('.');
|
const dotIndex = filePath.lastIndexOf('.');
|
||||||
if (dotIndex === -1) {
|
if (dotIndex === -1) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
return filePath.substring(dotIndex + 1).toLowerCase();
|
return filePath.substring(dotIndex + 1).toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证视频文件类型是否符合支持的格式
|
* 验证视频文件类型是否符合支持的格式
|
||||||
* 统一的跨平台文件类型验证
|
* 统一的跨平台文件类型验证
|
||||||
* @param {string} filePath - 视频文件路径
|
* @param {string} filePath - 视频文件路径
|
||||||
* @returns {boolean} 验证通过返回true,否则返回false
|
* @returns {boolean} 验证通过返回true,否则返回false
|
||||||
*/
|
*/
|
||||||
const validateVideoFileType = (filePath) => {
|
const validateVideoFileType = (filePath) => {
|
||||||
if (!filePath) {
|
if (!filePath) {
|
||||||
modal.msg('无法识别文件类型');
|
modal.msg('无法识别文件类型');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileExtension = getFileExtension(filePath);
|
const fileExtension = getFileExtension(filePath);
|
||||||
console.log('文件类型:', fileExtension);
|
console.log('文件类型:', fileExtension);
|
||||||
|
|
||||||
if (props.supportedTypes.includes(fileExtension)) return true;
|
if (props.supportedTypes.includes(fileExtension)) return true;
|
||||||
|
|
||||||
modal.msg(`请上传正确格式的视频`);
|
modal.msg(`请上传正确格式的视频`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查视频文件大小是否超过限制
|
* 检查视频文件大小是否超过限制
|
||||||
* @param {number} fileSize - 文件大小(字节)
|
* @param {number} fileSize - 文件大小(字节)
|
||||||
* @returns {boolean} 文件大小符合要求返回true,否则返回false
|
* @returns {boolean} 文件大小符合要求返回true,否则返回false
|
||||||
*/
|
*/
|
||||||
const checkVideoFileSize = (fileSize) => {
|
const checkVideoFileSize = (fileSize) => {
|
||||||
const maxSize = props.maxSize * 1024 * 1024;
|
const maxSize = props.maxSize * 1024 * 1024;
|
||||||
if (fileSize <= maxSize) return true;
|
if (fileSize <= maxSize) return true;
|
||||||
modal.msg(`视频大小不能超过${props.maxSize}M`);
|
modal.msg(`视频大小不能超过${props.maxSize}M`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组装视频数据对象
|
* 组装视频数据对象
|
||||||
* 根据不同平台返回不同格式的视频数据
|
* 根据不同平台返回不同格式的视频数据
|
||||||
* @param {Object} res - uni.chooseVideo返回的结果对象
|
* @param {Object} res - uni.chooseVideo返回的结果对象
|
||||||
* @returns {Object} 组装后的视频数据对象
|
* @returns {Object} 组装后的视频数据对象
|
||||||
*/
|
*/
|
||||||
const buildVideoData = (res) => {
|
const buildVideoData = (res) => {
|
||||||
let videoData = {}
|
let videoData = {}
|
||||||
console.log('选择的视频文件:', res);
|
console.log('选择的视频文件:', res);
|
||||||
|
|
||||||
// #ifdef APP-PLUS || H5
|
// #ifdef APP-PLUS || H5
|
||||||
videoData = {
|
videoData = {
|
||||||
path: res.tempFilePath,
|
path: res.tempFilePath,
|
||||||
size: res.size,
|
size: res.size,
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
videoData = {
|
videoData = {
|
||||||
path: res.tempFilePath,
|
path: res.tempFilePath,
|
||||||
size:res.size
|
size: res.size
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
console.log('组装后的视频数据:', videoData);
|
console.log('组装后的视频数据:', videoData);
|
||||||
|
|
||||||
return videoData;
|
return videoData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择视频文件
|
* 选择视频文件
|
||||||
* 调用uni-app的chooseVideo API选择视频文件
|
* 调用uni-app的chooseVideo API选择视频文件
|
||||||
* 包含文件类型验证、大小验证和数据处理
|
* 包含文件类型验证、大小验证和数据处理
|
||||||
*/
|
*/
|
||||||
const chooseVideo = () => {
|
const chooseVideo = () => {
|
||||||
uni.chooseVideo({
|
uni.chooseVideo({
|
||||||
count: 1,
|
count: 1,
|
||||||
compressed: false,
|
compressed: false,
|
||||||
sourceType: props.sourceType,
|
sourceType: props.sourceType,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (!validateVideoFileType(res.tempFilePath)) return;
|
if (!validateVideoFileType(res.tempFilePath)) return;
|
||||||
if (!checkVideoFileSize(res.size)) return;
|
if (!checkVideoFileSize(res.size)) return;
|
||||||
videoCover.value = res.tempFilePath
|
videoCover.value = res.tempFilePath
|
||||||
const videoData = buildVideoData(res)
|
const videoData = buildVideoData(res)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
modal.msgSuccess('上传成功')
|
modal.msgSuccess('上传成功')
|
||||||
emit('upload', videoData)
|
emit('upload', videoData)
|
||||||
}, 1000)
|
}, 1000)
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
modal.msg('选择视频失败')
|
modal.msg('选择视频失败')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.upload-box {
|
.upload-box {
|
||||||
height: 350rpx;
|
height: 350rpx;
|
||||||
margin: 0 20rpx;
|
margin: 0 20rpx;
|
||||||
background: #FFFCFA;
|
background: #FFFCFA;
|
||||||
border: 2rpx dashed #ff6634;
|
border: 2rpx dashed #ff6634;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
padding: 40rpx 0;
|
padding: 40rpx 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
|
|
||||||
.upload-container {
|
.upload-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.upload-text {
|
.upload-text {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #ff6634;
|
color: #ff6634;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.upload-desc {
|
.upload-desc {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-preview {
|
.video-preview {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.cover-container {
|
.cover-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.icon-cuo {
|
.icon-cuo {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -20rpx;
|
top: -20rpx;
|
||||||
right: -30rpx;
|
right: -30rpx;
|
||||||
width: 44rpx;
|
width: 44rpx;
|
||||||
height: 44rpx;
|
height: 44rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
background-color: rgba(0, 0, 0, 0.7);
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3);
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3);
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
transform: scale(0.9);
|
transform: scale(0.9);
|
||||||
background-color: #ff4d4f;
|
background-color: #ff4d4f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-cover {
|
.video-cover {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 220rpx;
|
height: 220rpx;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
590
pages.json
590
pages.json
@ -1,298 +1,296 @@
|
|||||||
{
|
{
|
||||||
"easycom": {
|
"easycom": {
|
||||||
"custom": {
|
"custom": {
|
||||||
"u-city-select": "@/components/u-city-select/u-city-select.vue",
|
"u-city-select": "@/components/u-city-select/u-city-select.vue",
|
||||||
"geek-(.*)": "@/components/geek-xd/components/geek-$1/geek-$1.vue",
|
"geek-(.*)": "@/components/geek-xd/components/geek-$1/geek-$1.vue",
|
||||||
"gx-(.*)": "@/components/geek-xd/components/geek-$1/geek-$1.vue",
|
"gx-(.*)": "@/components/geek-xd/components/geek-$1/geek-$1.vue",
|
||||||
"^u--(.*)": "uview-plus/components/u-$1/u-$1.vue",
|
"^u--(.*)": "uview-plus/components/u-$1/u-$1.vue",
|
||||||
"^up-(.*)": "uview-plus/components/u-$1/u-$1.vue",
|
"^up-(.*)": "uview-plus/components/u-$1/u-$1.vue",
|
||||||
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue",
|
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue",
|
||||||
"qiun-(.*)": "@/components/qiun-data-charts/components/qiun-$1/qiun-$1.vue"
|
"qiun-(.*)": "@/components/qiun-data-charts/components/qiun-$1/qiun-$1.vue"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pages": [
|
"pages": [{
|
||||||
{
|
"path": "pages/index",
|
||||||
"path": "pages/index",
|
"style": {
|
||||||
"style": {
|
"navigationBarTitleText": "天然气工具集",
|
||||||
"navigationBarTitleText": "天然气工具集",
|
"navigationStyle": "custom"
|
||||||
"navigationStyle": "custom"
|
}
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
"path": "pages/login",
|
||||||
"path": "pages/login",
|
"style": {
|
||||||
"style": {
|
"navigationBarTitleText": "登录"
|
||||||
"navigationBarTitleText": "登录"
|
}
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
"path": "pages/work",
|
||||||
"path": "pages/work",
|
"style": {
|
||||||
"style": {
|
"navigationBarTitleText": "工作台"
|
||||||
"navigationBarTitleText": "工作台"
|
}
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
"path": "pages/template",
|
||||||
"path": "pages/template",
|
"style": {
|
||||||
"style": {
|
"navigationBarTitleText": "模板"
|
||||||
"navigationBarTitleText": "模板"
|
}
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
"path": "pages/mine",
|
||||||
"path": "pages/mine",
|
"style": {
|
||||||
"style": {
|
"navigationBarTitleText": "我的"
|
||||||
"navigationBarTitleText": "我的"
|
}
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
"path": "pages/common/webview/index",
|
||||||
"path": "pages/common/webview/index",
|
"style": {
|
||||||
"style": {
|
"navigationBarTitleText": "浏览网页"
|
||||||
"navigationBarTitleText": "浏览网页"
|
}
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
"path": "pages/common/textview/index",
|
||||||
"path": "pages/common/textview/index",
|
"style": {
|
||||||
"style": {
|
"navigationBarTitleText": "浏览文本"
|
||||||
"navigationBarTitleText": "浏览文本"
|
}
|
||||||
}
|
}
|
||||||
}
|
],
|
||||||
],
|
"subPackages": [{
|
||||||
"subPackages": [
|
"root": "pages_mine/pages",
|
||||||
{
|
"pages": [{
|
||||||
"root": "pages_mine/pages",
|
"path": "register/index",
|
||||||
"pages": [
|
"style": {
|
||||||
{
|
"navigationBarTitleText": "注册"
|
||||||
"path": "avatar/index",
|
}
|
||||||
"style": {
|
},
|
||||||
"navigationBarTitleText": "修改头像"
|
{
|
||||||
}
|
"path": "avatar/index",
|
||||||
},
|
"style": {
|
||||||
{
|
"navigationBarTitleText": "修改头像"
|
||||||
"path": "info/index",
|
}
|
||||||
"style": {
|
},
|
||||||
"navigationBarTitleText": "个人信息"
|
{
|
||||||
}
|
"path": "info/index",
|
||||||
},
|
"style": {
|
||||||
{
|
"navigationBarTitleText": "个人信息"
|
||||||
"path": "info/edit",
|
}
|
||||||
"style": {
|
},
|
||||||
"navigationBarTitleText": "编辑资料"
|
{
|
||||||
}
|
"path": "info/edit",
|
||||||
},
|
"style": {
|
||||||
{
|
"navigationBarTitleText": "编辑资料"
|
||||||
"path": "pwd/index",
|
}
|
||||||
"style": {
|
},
|
||||||
"navigationBarTitleText": "修改密码"
|
{
|
||||||
}
|
"path": "pwd/index",
|
||||||
},
|
"style": {
|
||||||
{
|
"navigationBarTitleText": "修改密码"
|
||||||
"path": "setting/index",
|
}
|
||||||
"style": {
|
},
|
||||||
"navigationBarTitleText": "应用设置"
|
{
|
||||||
}
|
"path": "setting/index",
|
||||||
},
|
"style": {
|
||||||
{
|
"navigationBarTitleText": "应用设置"
|
||||||
"path": "help/index",
|
}
|
||||||
"style": {
|
},
|
||||||
"navigationBarTitleText": "常见问题"
|
{
|
||||||
}
|
"path": "help/index",
|
||||||
},
|
"style": {
|
||||||
{
|
"navigationBarTitleText": "常见问题"
|
||||||
"path": "about/index",
|
}
|
||||||
"style": {
|
},
|
||||||
"navigationBarTitleText": "关于我们"
|
{
|
||||||
}
|
"path": "about/index",
|
||||||
}
|
"style": {
|
||||||
]
|
"navigationBarTitleText": "关于我们"
|
||||||
},
|
}
|
||||||
{
|
}
|
||||||
"root": "pages_template/pages",
|
]
|
||||||
"pages": [
|
},
|
||||||
{
|
{
|
||||||
"path": "wxCenter/index",
|
"root": "pages_template/pages",
|
||||||
"style": {
|
"pages": [{
|
||||||
"navigationBarTitleText": "wxCenter 仿微信个人中心",
|
"path": "wxCenter/index",
|
||||||
"navigationStyle": "custom"
|
"style": {
|
||||||
}
|
"navigationBarTitleText": "wxCenter 仿微信个人中心",
|
||||||
},
|
"navigationStyle": "custom"
|
||||||
{
|
}
|
||||||
"path": "keyboardPay/index",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "keyboardPay 自定义键盘支付"
|
"path": "keyboardPay/index",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "keyboardPay 自定义键盘支付"
|
||||||
{
|
}
|
||||||
"path": "mallMenu/index2",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "mallMenu-商城分类"
|
"path": "mallMenu/index2",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "mallMenu-商城分类"
|
||||||
{
|
}
|
||||||
"path": "mallMenu/index1",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "mallMenu-商城分类"
|
"path": "mallMenu/index1",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "mallMenu-商城分类"
|
||||||
{
|
}
|
||||||
"path": "coupon/index",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "coupon-优惠券"
|
"path": "coupon/index",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "coupon-优惠券"
|
||||||
{
|
}
|
||||||
"path": "login/index1",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "美团登录"
|
"path": "login/index1",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "美团登录"
|
||||||
{
|
}
|
||||||
"path": "login/index2",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "水滴登录"
|
"path": "login/index2",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "水滴登录"
|
||||||
{
|
}
|
||||||
"path": "citySelect/index",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "城市选择"
|
"path": "citySelect/index",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "城市选择"
|
||||||
{
|
}
|
||||||
"path": "submitBar/index",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "提交订单栏"
|
"path": "submitBar/index",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "提交订单栏"
|
||||||
{
|
}
|
||||||
"path": "comment/index",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "评论"
|
"path": "comment/index",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "评论"
|
||||||
{
|
}
|
||||||
"path": "comment/reply",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "评论详情"
|
"path": "comment/reply",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "评论详情"
|
||||||
{
|
}
|
||||||
"path": "order/index",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "订单"
|
"path": "order/index",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "订单"
|
||||||
{
|
}
|
||||||
"path": "login/code",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "登录获取验证码"
|
"path": "login/code",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "登录获取验证码"
|
||||||
{
|
}
|
||||||
"path": "address/index",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "用户地址"
|
"path": "address/index",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "用户地址"
|
||||||
{
|
}
|
||||||
"path": "address/addSite",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "添加用户地址"
|
"path": "address/addSite",
|
||||||
}
|
"style": {
|
||||||
}
|
"navigationBarTitleText": "添加用户地址"
|
||||||
]
|
}
|
||||||
},
|
}
|
||||||
{
|
]
|
||||||
"root": "pages_qiun/pages",
|
},
|
||||||
"pages": [
|
{
|
||||||
{
|
"root": "pages_qiun/pages",
|
||||||
"path": "sport/index",
|
"pages": [{
|
||||||
"style": {
|
"path": "sport/index",
|
||||||
"pageOrientation": "auto"
|
"style": {
|
||||||
}
|
"pageOrientation": "auto"
|
||||||
},
|
}
|
||||||
{
|
},
|
||||||
"path": "school/index",
|
{
|
||||||
"style": {
|
"path": "school/index",
|
||||||
"pageOrientation": "auto"
|
"style": {
|
||||||
}
|
"pageOrientation": "auto"
|
||||||
},
|
}
|
||||||
{
|
},
|
||||||
"path": "finance/index",
|
{
|
||||||
"style": {
|
"path": "finance/index",
|
||||||
"pageOrientation": "auto"
|
"style": {
|
||||||
}
|
"pageOrientation": "auto"
|
||||||
},
|
}
|
||||||
{
|
},
|
||||||
"path": "main/index",
|
{
|
||||||
"style": {
|
"path": "main/index",
|
||||||
"pageOrientation": "auto"
|
"style": {
|
||||||
}
|
"pageOrientation": "auto"
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
},
|
]
|
||||||
{
|
},
|
||||||
|
{
|
||||||
"root": "pages_geek/pages",
|
|
||||||
"pages": [
|
"root": "pages_geek/pages",
|
||||||
{
|
"pages": [{
|
||||||
"path": "index/index"
|
"path": "index/index"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "code/index"
|
"path": "code/index"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "upload/index"
|
"path": "upload/index"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
||||||
"root": "pages_caltools/pages",
|
"root": "pages_caltools/pages",
|
||||||
"pages": [
|
"pages": [{
|
||||||
{
|
"path": "index"
|
||||||
"path": "index"
|
},
|
||||||
},
|
{
|
||||||
{
|
"path": "main"
|
||||||
"path": "main"
|
}
|
||||||
}
|
]
|
||||||
]
|
}
|
||||||
|
|
||||||
|
|
||||||
|
],
|
||||||
|
"tabBar": {
|
||||||
|
"color": "#000000",
|
||||||
|
"selectedColor": "#000000",
|
||||||
|
"borderStyle": "white",
|
||||||
|
"backgroundColor": "#ffffff",
|
||||||
|
"list": [{
|
||||||
|
"pagePath": "pages/index",
|
||||||
|
"iconPath": "static/images/tabbar/home.png",
|
||||||
|
"selectedIconPath": "static/images/tabbar/home_.png",
|
||||||
|
"text": "首页"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/work",
|
||||||
|
"iconPath": "static/images/tabbar/work.png",
|
||||||
|
"selectedIconPath": "static/images/tabbar/work_.png",
|
||||||
|
"text": "计算"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/template",
|
||||||
|
"iconPath": "static/images/tabbar/work.png",
|
||||||
|
"selectedIconPath": "static/images/tabbar/work_.png",
|
||||||
|
"text": "资料"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/mine",
|
||||||
|
"iconPath": "static/images/tabbar/mine.png",
|
||||||
|
"selectedIconPath": "static/images/tabbar/mine_.png",
|
||||||
|
"text": "我的"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"globalStyle": {
|
||||||
|
"navigationBarTextStyle": "black",
|
||||||
|
"navigationBarTitleText": "RuoYi",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
],
|
|
||||||
"tabBar": {
|
|
||||||
"color": "#000000",
|
|
||||||
"selectedColor": "#000000",
|
|
||||||
"borderStyle": "white",
|
|
||||||
"backgroundColor": "#ffffff",
|
|
||||||
"list": [
|
|
||||||
{
|
|
||||||
"pagePath": "pages/index",
|
|
||||||
"iconPath": "static/images/tabbar/home.png",
|
|
||||||
"selectedIconPath": "static/images/tabbar/home_.png",
|
|
||||||
"text": "首页"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pagePath": "pages/work",
|
|
||||||
"iconPath": "static/images/tabbar/work.png",
|
|
||||||
"selectedIconPath": "static/images/tabbar/work_.png",
|
|
||||||
"text": "工作台"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pagePath": "pages/template",
|
|
||||||
"iconPath": "static/images/tabbar/work.png",
|
|
||||||
"selectedIconPath": "static/images/tabbar/work_.png",
|
|
||||||
"text": "模板"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pagePath": "pages/mine",
|
|
||||||
"iconPath": "static/images/tabbar/mine.png",
|
|
||||||
"selectedIconPath": "static/images/tabbar/mine_.png",
|
|
||||||
"text": "我的"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"globalStyle": {
|
|
||||||
"navigationBarTextStyle": "black",
|
|
||||||
"navigationBarTitleText": "RuoYi",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
211
pages/index.vue
211
pages/index.vue
@ -1,50 +1,179 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="work-container">
|
||||||
<image class="logo" src="@/static/logo.png"></image>
|
<!-- 轮播图 -->
|
||||||
<view class="text-area">
|
<uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
|
||||||
<text class="title"> 天然气工具集</text>
|
<swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
|
||||||
</view>
|
<swiper-item v-for="(item, index) in data" :key="index">
|
||||||
<NG-cal-tools></NG-cal-tools>
|
<view class="swiper-item" @click="clickBannerItem(item)">
|
||||||
</view>
|
<image :src="item.image" mode="aspectFill" :draggable="false" />
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
</uni-swiper-dot>
|
||||||
|
|
||||||
|
<!-- 宫格组件 -->
|
||||||
|
<uni-section title="系统管理" type="line"></uni-section>
|
||||||
|
<view class="grid-body">
|
||||||
|
<uni-grid :column="4" :showBorder="false" @change="changeGrid">
|
||||||
|
<uni-grid-item>
|
||||||
|
<view class="grid-item-box">
|
||||||
|
<uni-icons type="person-filled" size="30"></uni-icons>
|
||||||
|
<text class="text">用户管理</text>
|
||||||
|
</view>
|
||||||
|
</uni-grid-item>
|
||||||
|
<uni-grid-item>
|
||||||
|
<view class="grid-item-box">
|
||||||
|
<uni-icons type="staff-filled" size="30"></uni-icons>
|
||||||
|
<text class="text">角色管理</text>
|
||||||
|
</view>
|
||||||
|
</uni-grid-item>
|
||||||
|
<uni-grid-item>
|
||||||
|
<view class="grid-item-box">
|
||||||
|
<uni-icons type="color" size="30"></uni-icons>
|
||||||
|
<text class="text">菜单管理</text>
|
||||||
|
</view>
|
||||||
|
</uni-grid-item>
|
||||||
|
<uni-grid-item>
|
||||||
|
<view class="grid-item-box">
|
||||||
|
<uni-icons type="settings-filled" size="30"></uni-icons>
|
||||||
|
<text class="text">部门管理</text>
|
||||||
|
</view>
|
||||||
|
</uni-grid-item>
|
||||||
|
<uni-grid-item>
|
||||||
|
<view class="grid-item-box">
|
||||||
|
<uni-icons type="heart-filled" size="30"></uni-icons>
|
||||||
|
<text class="text">岗位管理</text>
|
||||||
|
</view>
|
||||||
|
</uni-grid-item>
|
||||||
|
<uni-grid-item>
|
||||||
|
<view class="grid-item-box">
|
||||||
|
<uni-icons type="bars" size="30"></uni-icons>
|
||||||
|
<text class="text">字典管理</text>
|
||||||
|
</view>
|
||||||
|
</uni-grid-item>
|
||||||
|
<uni-grid-item>
|
||||||
|
<view class="grid-item-box">
|
||||||
|
<uni-icons type="gear-filled" size="30"></uni-icons>
|
||||||
|
<text class="text">参数设置</text>
|
||||||
|
</view>
|
||||||
|
</uni-grid-item>
|
||||||
|
<uni-grid-item>
|
||||||
|
<view class="grid-item-box">
|
||||||
|
<uni-icons type="chat-filled" size="30"></uni-icons>
|
||||||
|
<text class="text">通知公告</text>
|
||||||
|
</view>
|
||||||
|
</uni-grid-item>
|
||||||
|
<uni-grid-item>
|
||||||
|
<view class="grid-item-box">
|
||||||
|
<uni-icons type="wallet-filled" size="30"></uni-icons>
|
||||||
|
<text class="text">日志管理</text>
|
||||||
|
</view>
|
||||||
|
</uni-grid-item>
|
||||||
|
</uni-grid>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { ref } from "vue";
|
||||||
ref,
|
import modal from "@/plugins/modal"
|
||||||
onMounted
|
const current = ref(0);
|
||||||
} from 'vue';
|
const swiperDotIndex = ref(0);
|
||||||
import NGCalTools from '@/pages_caltools/pages/index'
|
const data = ref([
|
||||||
|
{ image: '/static/images/banner/banner01.jpg' },
|
||||||
|
{ image: '/static/images/banner/banner02.jpg' },
|
||||||
|
{ image: '/static/images/banner/banner03.jpg' }
|
||||||
|
]);
|
||||||
|
|
||||||
|
function clickBannerItem(item) {
|
||||||
|
console.info(item)
|
||||||
|
};
|
||||||
|
function changeSwiper(e) {
|
||||||
|
current.value = e.detail.current
|
||||||
|
}
|
||||||
|
function changeGrid(e) {
|
||||||
|
modal.showToast({
|
||||||
|
title: '模块建设中',
|
||||||
|
mask: false,
|
||||||
|
icon: 'loading',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
<style lang="scss">
|
||||||
height: 200rpx;
|
/* #ifndef APP-NVUE */
|
||||||
width: 200rpx;
|
page {
|
||||||
margin-top: 200rpx;
|
display: flex;
|
||||||
margin-left: auto;
|
flex-direction: column;
|
||||||
margin-right: auto;
|
box-sizing: border-box;
|
||||||
margin-bottom: 50rpx;
|
background-color: #fff;
|
||||||
}
|
min-height: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.text-area {
|
view {
|
||||||
display: flex;
|
font-size: 14px;
|
||||||
justify-content: center;
|
line-height: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
/* #endif */
|
||||||
font-size: 36rpx;
|
|
||||||
color: #8f8f94;
|
|
||||||
}
|
|
||||||
|
|
||||||
.charts-box {
|
.text {
|
||||||
width: 100%;
|
text-align: center;
|
||||||
height: 300px;
|
font-size: 26rpx;
|
||||||
}
|
margin-top: 10rpx;
|
||||||
</style>
|
}
|
||||||
|
|
||||||
|
.grid-item-box {
|
||||||
|
flex: 1;
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-margin-wrap {
|
||||||
|
width: 690rpx;
|
||||||
|
width: 100%;
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper {
|
||||||
|
height: 300rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-box {
|
||||||
|
height: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-item {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
color: #fff;
|
||||||
|
height: 300rpx;
|
||||||
|
line-height: 300rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 500px) {
|
||||||
|
.uni-swiper-dot-box {
|
||||||
|
width: 400px;
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
margin: 0 auto;
|
||||||
|
/* #endif */
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
211
pages/work.vue
211
pages/work.vue
@ -1,179 +1,50 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="work-container">
|
<view class="content">
|
||||||
<!-- 轮播图 -->
|
<image class="logo" src="@/static/logo.png"></image>
|
||||||
<uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
|
<view class="text-area">
|
||||||
<swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
|
<text class="title"> 天然气工具集</text>
|
||||||
<swiper-item v-for="(item, index) in data" :key="index">
|
</view>
|
||||||
<view class="swiper-item" @click="clickBannerItem(item)">
|
<NG-cal-tools></NG-cal-tools>
|
||||||
<image :src="item.image" mode="aspectFill" :draggable="false" />
|
</view>
|
||||||
</view>
|
|
||||||
</swiper-item>
|
|
||||||
</swiper>
|
|
||||||
</uni-swiper-dot>
|
|
||||||
|
|
||||||
<!-- 宫格组件 -->
|
|
||||||
<uni-section title="系统管理" type="line"></uni-section>
|
|
||||||
<view class="grid-body">
|
|
||||||
<uni-grid :column="4" :showBorder="false" @change="changeGrid">
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="person-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">用户管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="staff-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">角色管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="color" size="30"></uni-icons>
|
|
||||||
<text class="text">菜单管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="settings-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">部门管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="heart-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">岗位管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="bars" size="30"></uni-icons>
|
|
||||||
<text class="text">字典管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="gear-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">参数设置</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="chat-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">通知公告</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="wallet-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">日志管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
</uni-grid>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from "vue";
|
import {
|
||||||
import modal from "@/plugins/modal"
|
ref,
|
||||||
const current = ref(0);
|
onMounted
|
||||||
const swiperDotIndex = ref(0);
|
} from 'vue';
|
||||||
const data = ref([
|
import NGCalTools from '@/pages_caltools/pages/index'
|
||||||
{ image: '/static/images/banner/banner01.jpg' },
|
|
||||||
{ image: '/static/images/banner/banner02.jpg' },
|
|
||||||
{ image: '/static/images/banner/banner03.jpg' }
|
|
||||||
]);
|
|
||||||
|
|
||||||
function clickBannerItem(item) {
|
|
||||||
console.info(item)
|
|
||||||
};
|
|
||||||
function changeSwiper(e) {
|
|
||||||
current.value = e.detail.current
|
|
||||||
}
|
|
||||||
function changeGrid(e) {
|
|
||||||
modal.showToast({
|
|
||||||
title: '模块建设中',
|
|
||||||
mask: false,
|
|
||||||
icon: 'loading',
|
|
||||||
duration: 1000
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
<style lang="scss">
|
.logo {
|
||||||
/* #ifndef APP-NVUE */
|
height: 200rpx;
|
||||||
page {
|
width: 200rpx;
|
||||||
display: flex;
|
margin-top: 200rpx;
|
||||||
flex-direction: column;
|
margin-left: auto;
|
||||||
box-sizing: border-box;
|
margin-right: auto;
|
||||||
background-color: #fff;
|
margin-bottom: 50rpx;
|
||||||
min-height: 100%;
|
}
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
view {
|
.text-area {
|
||||||
font-size: 14px;
|
display: flex;
|
||||||
line-height: inherit;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* #endif */
|
.title {
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #8f8f94;
|
||||||
|
}
|
||||||
|
|
||||||
.text {
|
.charts-box {
|
||||||
text-align: center;
|
width: 100%;
|
||||||
font-size: 26rpx;
|
height: 300px;
|
||||||
margin-top: 10rpx;
|
}
|
||||||
}
|
</style>
|
||||||
|
|
||||||
.grid-item-box {
|
|
||||||
flex: 1;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 15px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-margin-wrap {
|
|
||||||
width: 690rpx;
|
|
||||||
width: 100%;
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper {
|
|
||||||
height: 300rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper-box {
|
|
||||||
height: 150px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper-item {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
color: #fff;
|
|
||||||
height: 300rpx;
|
|
||||||
line-height: 300rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (min-width: 500px) {
|
|
||||||
.uni-swiper-dot-box {
|
|
||||||
width: 400px;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
margin: 0 auto;
|
|
||||||
/* #endif */
|
|
||||||
margin-top: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,23 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
|
|
||||||
<!-- Swiper 组件,用于在不同计算分组间滑动 -->
|
<!-- Swiper 组件,用于在不同计算分组间滑动 -->
|
||||||
<swiper class="calc-swiper" :current="currentTab" @change="handleSwiperChange" indicator-dots
|
<swiper class="calc-swiper" :current="currentTab" @change="handleSwiperChange" :indicator-dots="true"
|
||||||
indicator-color="#BBBBBB" indicator-active-color="#007AFF">
|
indicator-color="#BBBBBB" indicator-active-color="#007AFF">
|
||||||
<!-- 遍历分组数据,动态生成 swiper-item -->
|
<!-- 遍历分组数据,动态生成 swiper-item -->
|
||||||
<swiper-item v-for="(group, groupIndex) in calcGroups" :key="groupIndex">
|
<swiper-item v-for="(group, groupIndex) in calcGroups" :key="groupIndex">
|
||||||
<!-- 3x3 宫格布局 -->
|
<scroll-view scroll-y="true" class="scroll-content">
|
||||||
<view class="page-header">{{group.name}}</view>
|
<view class="page-header">{{group.name}}</view>
|
||||||
<uni-grid :column-num="3" :show-border="true" border-color="#EEEEEE">
|
<uni-grid :column="3" :show-border="true" :border="true" border-color="#EEEEEE" class="custom-grid">
|
||||||
<!-- 遍历每个分组下的功能项,动态生成宫格 -->
|
<!-- 遍历每个分组下的功能项,动态生成宫格 -->
|
||||||
<uni-grid-item class="grid-item" v-for="(item, itemIndex) in group.items" :key="itemIndex"
|
<uni-grid-item v-for="(item, itemIndex) in group.items" :key="itemIndex"
|
||||||
@click="navigateToCalc(item)">
|
@click="navigateToCalc(item)" class="grid-item">
|
||||||
<view class="grid-icon">
|
<view class="grid-content">
|
||||||
<uni-icons :type="item.icon" size="32" :color="group.color"></uni-icons>
|
<view class="grid-icon">
|
||||||
</view>
|
<uni-icons :type="item.icon" size="32" :color="group.color"></uni-icons>
|
||||||
<view class="grid-text">{{ item.name }}</view>
|
</view>
|
||||||
</uni-grid-item>
|
<text class="grid-text">{{ item.name }}</text>
|
||||||
</uni-grid>
|
</view>
|
||||||
|
</uni-grid-item>
|
||||||
|
</uni-grid>
|
||||||
|
</scroll-view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
@ -27,30 +29,24 @@
|
|||||||
import {
|
import {
|
||||||
ref
|
ref
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import {
|
|
||||||
useRouter
|
|
||||||
} from 'vue-router'; // Vue 3 推荐使用 vue-router
|
|
||||||
|
|
||||||
// 响应式数据:当前激活的 Swiper 标签索引
|
// 响应式数据:当前激活的 Swiper 标签索引
|
||||||
const currentTab = ref(0);
|
const currentTab = ref(0);
|
||||||
|
|
||||||
// 路由实例
|
|
||||||
const router = useRouter();
|
|
||||||
// 核心数据:计算分组和功能项定义
|
// 核心数据:计算分组和功能项定义
|
||||||
const calcGroups = [{
|
const calcGroups = [{
|
||||||
name: '流量计算',
|
name: '流量计算',
|
||||||
color: '#007AFF',
|
color: '#007AFF',
|
||||||
items: [{
|
items: [{
|
||||||
name: '差压式流量计算',
|
name: '差压式流量计算',
|
||||||
icon: 'flow',
|
icon: 'smallcircle',
|
||||||
dMeterType:0
|
dMeterType: 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '速度式流量计算',
|
name: '速度式流量计算',
|
||||||
icon: 'speedometer',
|
icon: 'paperplane',
|
||||||
dMeterType:1
|
dMeterType: 1
|
||||||
},
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -58,23 +54,23 @@
|
|||||||
color: '#5AC8FA',
|
color: '#5AC8FA',
|
||||||
items: [{
|
items: [{
|
||||||
name: '压缩因子',
|
name: '压缩因子',
|
||||||
icon: 'compress',
|
icon: 'pyq',
|
||||||
dMeterType:4
|
dMeterType: 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '声速计算',
|
name: '声速计算',
|
||||||
icon: 'fire',
|
icon: 'sound',
|
||||||
dMeterType:5
|
dMeterType: 5
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '发热量',
|
name: '发热量',
|
||||||
icon: 'volume-high',
|
icon: 'fire',
|
||||||
dMeterType:6
|
dMeterType: 6
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '其他参数',
|
name: '其他参数',
|
||||||
icon: 'density',
|
icon: 'more',
|
||||||
dMeterType:7
|
dMeterType: 7
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -90,70 +86,78 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 导航到具体的计算页面
|
* 导航到具体的计算页面
|
||||||
* @param {Object} group 当前点击的分组对象
|
* @param {Object} item 点击的项
|
||||||
* @param {number} itemIndex 点击项在分组内的索引
|
|
||||||
*/
|
*/
|
||||||
const navigateToCalc = (item) => {
|
const navigateToCalc = (item) => {
|
||||||
const dMeterType = item.dMeterType;
|
const dMeterType = item.dMeterType;
|
||||||
|
|
||||||
console.log(`导航到计算页面,dMeterType: ${dMeterType}`);
|
console.log(`导航到计算页面,dMeterType: ${dMeterType}`);
|
||||||
|
|
||||||
// 使用 UniApp 原生导航 API
|
// 使用 UniApp 原生导航 API
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
// 注意:路径前要加 '/',并且 query 参数直接拼接在 URL 后面
|
url: `/pages_caltools/pages/main?dMeterType=${dMeterType}`
|
||||||
url: `/pages_caltools/pages/main?dMeterType=${dMeterType}`
|
});
|
||||||
});
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.container {
|
.container {
|
||||||
padding: 16px;
|
padding: 16rpx;
|
||||||
background-color: #F5F5F5;
|
background-color: #F5F5F5;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
/* 使用 min-height 确保在内容不足时也占满屏幕 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-header {
|
.page-header {
|
||||||
font-size: 18px;
|
font-size: 36rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
margin-bottom: 16px;
|
margin: 30rpx 0;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calc-swiper {
|
.calc-swiper {
|
||||||
/* 关键:让 swiper 占满剩余空间 */
|
width: 100vw;
|
||||||
width: calc(100vw - 100px);
|
height: 800rpx;
|
||||||
;
|
|
||||||
height: calc(100vh - 70px);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 确保宫格充满父容器 */
|
.scroll-content {
|
||||||
uni-grid {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .custom-grid {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.grid-item {
|
.grid-item {
|
||||||
|
height: 200rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 10px 0;
|
height: 100%;
|
||||||
|
padding: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.grid-icon {
|
.grid-icon {
|
||||||
margin-bottom: 8px;
|
margin-bottom: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.grid-text {
|
.grid-text {
|
||||||
font-size: 10px;
|
font-size: 24rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 100%;
|
line-height: 1.4;
|
||||||
white-space: nowrap;
|
/* 允许文字换行 */
|
||||||
overflow: hidden;
|
word-break: break-all;
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
273
pages_mine/pages/register/index.vue
Normal file
273
pages_mine/pages/register/index.vue
Normal file
@ -0,0 +1,273 @@
|
|||||||
|
<template>
|
||||||
|
<view class="register-container">
|
||||||
|
<!-- 背景图建议在 pages.json 中配置,这里作为备用 -->
|
||||||
|
<view class="register-form-wrapper">
|
||||||
|
<uni-forms ref="registerFormRef" :modelValue="registerForm" :rules="registerRules" label-width="0">
|
||||||
|
|
||||||
|
<view class="title">天然气工具平台</view>
|
||||||
|
|
||||||
|
<uni-forms-item name="username">
|
||||||
|
<uni-easyinput v-model="registerForm.username" type="text" placeholder="账号" prefixIcon="person"
|
||||||
|
@confirm="handleRegister" />
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item name="password">
|
||||||
|
<uni-easyinput v-model="registerForm.password" type="password" placeholder="密码" prefixIcon="locked"
|
||||||
|
@confirm="handleRegister" />
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item name="confirmPassword">
|
||||||
|
<uni-easyinput v-model="registerForm.confirmPassword" type="password" placeholder="确认密码"
|
||||||
|
prefixIcon="locked" @confirm="handleRegister" />
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item name="code" v-if="captchaEnabled">
|
||||||
|
<view class="code-input-wrapper">
|
||||||
|
<uni-easyinput v-model="registerForm.code" type="text" placeholder="验证码" prefixIcon="code"
|
||||||
|
@confirm="handleRegister" />
|
||||||
|
<view class="code-img-wrapper">
|
||||||
|
<image :src="codeUrl" class="code-img" @tap="getCode"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item>
|
||||||
|
<uni-button type="primary" size="default" :loading="loading" @click="handleRegister"
|
||||||
|
class="register-btn">
|
||||||
|
注册
|
||||||
|
</uni-button>
|
||||||
|
<view class="login-link">
|
||||||
|
<text>已有账号?</text>
|
||||||
|
<navigator url="/pages/login/login" class="link-text">立即登录</navigator>
|
||||||
|
</view>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
</uni-forms>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="el-register-footer">
|
||||||
|
<text>Copyright © 2018-2025 ruoyi.vip All Rights Reserved.</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
ref,
|
||||||
|
onReady
|
||||||
|
} from 'vue';
|
||||||
|
import {
|
||||||
|
getCodeImg,
|
||||||
|
register
|
||||||
|
} from '@/api/login'; // 假设 API 适配了 Uniapp
|
||||||
|
|
||||||
|
// 表单引用
|
||||||
|
const registerFormRef = ref(null);
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const registerForm = ref({
|
||||||
|
username: "",
|
||||||
|
password: "",
|
||||||
|
confirmPassword: "",
|
||||||
|
code: "",
|
||||||
|
uuid: ""
|
||||||
|
});
|
||||||
|
|
||||||
|
// 校验规则
|
||||||
|
const registerRules = {
|
||||||
|
username: [{
|
||||||
|
required: true,
|
||||||
|
errorMessage: '请输入您的账号'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
minLength: 2,
|
||||||
|
maxLength: 20,
|
||||||
|
errorMessage: '用户账号长度必须介于 2 和 20 之间'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
password: [{
|
||||||
|
required: true,
|
||||||
|
errorMessage: '请输入您的密码'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
minLength: 5,
|
||||||
|
maxLength: 20,
|
||||||
|
errorMessage: '用户密码长度必须介于 5 和 20 之间'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: /^[^<>"'|\\]+$/,
|
||||||
|
errorMessage: '不能包含非法字符:< > " \' \\ |'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
confirmPassword: [{
|
||||||
|
required: true,
|
||||||
|
errorMessage: '请再次输入您的密码'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback, source, options) => {
|
||||||
|
if (value !== registerForm.value.password) {
|
||||||
|
callback(new Error('两次输入的密码不一致'));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
errorMessage: '两次输入的密码不一致'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
code: [{
|
||||||
|
required: true,
|
||||||
|
errorMessage: '请输入验证码'
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
|
||||||
|
// 状态变量
|
||||||
|
const codeUrl = ref("");
|
||||||
|
const loading = ref(false);
|
||||||
|
const captchaEnabled = ref(true);
|
||||||
|
|
||||||
|
// 获取验证码
|
||||||
|
const getCode = () => {
|
||||||
|
getCodeImg().then(res => {
|
||||||
|
// 假设 res.data 结构为 { img: 'base64...', uuid: '...', captchaEnabled: true }
|
||||||
|
captchaEnabled.value = res.data.captchaEnabled !== false;
|
||||||
|
if (captchaEnabled.value) {
|
||||||
|
codeUrl.value = res.data.img; // Uniapp 的 image 组件可以直接显示 base64
|
||||||
|
registerForm.value.uuid = res.data.uuid;
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.error("获取验证码失败:", err);
|
||||||
|
uni.showToast({
|
||||||
|
title: '获取验证码失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理注册
|
||||||
|
const handleRegister = () => {
|
||||||
|
// 使用 uni-forms 的 validate 方法
|
||||||
|
registerFormRef.value.validate().then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
register(registerForm.value).then(res => {
|
||||||
|
uni.showModal({
|
||||||
|
title: '系统提示',
|
||||||
|
content: `<font color='red'>恭喜你,您的账号 ${registerForm.value.username} 注册成功!</font>`,
|
||||||
|
showCancel: false,
|
||||||
|
success: () => {
|
||||||
|
// 注册成功跳转到登录页,关闭当前页
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pages/login/login'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).catch(err => {
|
||||||
|
// 错误处理,如用户名已存在等
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message || '注册失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
if (captchaEnabled.value) {
|
||||||
|
getCode(); // 刷新验证码
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
}).catch(errors => {
|
||||||
|
// 表单校验失败,由 uni-forms 自动提示错误信息
|
||||||
|
console.log('表单校验失败:', errors);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 页面加载时获取验证码
|
||||||
|
onReady(() => {
|
||||||
|
getCode();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/* 页面整体背景,建议在 pages.json 中配置 "style": { "backgroundImage": "url('/static/login-background.jpg')" } */
|
||||||
|
.register-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
padding: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
/* 备用背景色 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 表单外层容器 */
|
||||||
|
.register-form-wrapper {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 400rpx;
|
||||||
|
padding: 40rpx 30rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 验证码输入框和图片一行显示 */
|
||||||
|
.code-input-wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-img-wrapper {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 140rpx;
|
||||||
|
height: 72rpx;
|
||||||
|
/* 与输入框高度对齐 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 注册按钮 */
|
||||||
|
.register-btn {
|
||||||
|
width: 100%;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 登录链接 */
|
||||||
|
.login-link {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-text {
|
||||||
|
color: #007aff;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 页脚 */
|
||||||
|
.el-register-footer {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 20rpx;
|
||||||
|
color: #ccc;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -1,197 +1,197 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { defineProps } from 'vue';
|
// import { defineProps } from 'vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
order: {
|
order: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 价格小数
|
// 价格小数
|
||||||
const priceDecimal = (val) => {
|
const priceDecimal = (val) => {
|
||||||
if (val !== parseInt(val)) return val.slice(-2);
|
if (val !== parseInt(val)) return val.slice(-2);
|
||||||
else return '00';
|
else return '00';
|
||||||
};
|
};
|
||||||
|
|
||||||
// 价格整数
|
// 价格整数
|
||||||
const priceInt = (val) => {
|
const priceInt = (val) => {
|
||||||
if (val !== parseInt(val)) return val.split('.')[0];
|
if (val !== parseInt(val)) return val.split('.')[0];
|
||||||
else return val;
|
else return val;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 总价
|
// 总价
|
||||||
const totalPrice = (item) => {
|
const totalPrice = (item) => {
|
||||||
let price = 0;
|
let price = 0;
|
||||||
item.forEach(val => {
|
item.forEach(val => {
|
||||||
price += parseFloat(val.price);
|
price += parseFloat(val.price);
|
||||||
});
|
});
|
||||||
return price.toFixed(2);
|
return price.toFixed(2);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 总件数
|
// 总件数
|
||||||
const totalNum = (item) => {
|
const totalNum = (item) => {
|
||||||
let num = 0;
|
let num = 0;
|
||||||
item.forEach(val => {
|
item.forEach(val => {
|
||||||
num += val.number;
|
num += val.number;
|
||||||
});
|
});
|
||||||
return num;
|
return num;
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="order">
|
<view class="order">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<u-icon name="home" :size="30" color="rgb(94,94,94)"></u-icon>
|
<u-icon name="home" :size="30" color="rgb(94,94,94)"></u-icon>
|
||||||
<view class="store">{{ order.store }}</view>
|
<view class="store">{{ order.store }}</view>
|
||||||
<u-icon name="arrow-right" color="rgb(203,203,203)" :size="26"></u-icon>
|
<u-icon name="arrow-right" color="rgb(203,203,203)" :size="26"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">{{ order.deal }}</view>
|
<view class="right">{{ order.deal }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item" v-for="(item, index) in order.goodsList" :key="index">
|
<view class="item" v-for="(item, index) in order.goodsList" :key="index">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<image :src="item.goodsUrl" mode="aspectFill"></image>
|
<image :src="item.goodsUrl" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="title u-line-2">{{ item.title }}</view>
|
<view class="title u-line-2">{{ item.title }}</view>
|
||||||
<view class="type">{{ item.type }}</view>
|
<view class="type">{{ item.type }}</view>
|
||||||
<view class="delivery-time">发货时间 {{ item.deliveryTime }}</view>
|
<view class="delivery-time">发货时间 {{ item.deliveryTime }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view class="price">
|
<view class="price">
|
||||||
¥{{ priceInt(item.price) }}
|
¥{{ priceInt(item.price) }}
|
||||||
<text class="decimal">.{{ priceDecimal(item.price) }}</text>
|
<text class="decimal">.{{ priceDecimal(item.price) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="number">x{{ item.number }}</view>
|
<view class="number">x{{ item.number }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="total">
|
<view class="total">
|
||||||
共{{ totalNum(order.goodsList) }}件商品 合计:
|
共{{ totalNum(order.goodsList) }}件商品 合计:
|
||||||
<text class="total-price">
|
<text class="total-price">
|
||||||
¥{{ priceInt(totalPrice(order.goodsList)) }}.
|
¥{{ priceInt(totalPrice(order.goodsList)) }}.
|
||||||
<text class="decimal">{{ priceDecimal(totalPrice(order.goodsList)) }}</text>
|
<text class="decimal">{{ priceDecimal(totalPrice(order.goodsList)) }}</text>
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<view class="more"><u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon></view>
|
<view class="more"><u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon></view>
|
||||||
<view class="logistics btn">查看物流</view>
|
<view class="logistics btn">查看物流</view>
|
||||||
<view class="exchange btn">卖了换钱</view>
|
<view class="exchange btn">卖了换钱</view>
|
||||||
<view class="evaluate btn">评价</view>
|
<view class="evaluate btn">评价</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.order {
|
.order {
|
||||||
width: 710rpx;
|
width: 710rpx;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
margin: 20rpx auto;
|
margin: 20rpx auto;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.store {
|
.store {
|
||||||
margin: 0 10rpx;
|
margin: 0 10rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
color: $u-warning-dark;
|
color: $u-warning-dark;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: 20rpx 0 0;
|
margin: 20rpx 0 0;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 200rpx;
|
width: 200rpx;
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
.title {
|
.title {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
line-height: 50rpx;
|
line-height: 50rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.type {
|
.type {
|
||||||
margin: 10rpx 0;
|
margin: 10rpx 0;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: $u-tips-color;
|
color: $u-tips-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.delivery-time {
|
.delivery-time {
|
||||||
color: #e5d001;
|
color: #e5d001;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
padding-top: 20rpx;
|
padding-top: 20rpx;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
|
||||||
.decimal {
|
.decimal {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
margin-top: 4rpx;
|
margin-top: 4rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.number {
|
.number {
|
||||||
color: $u-tips-color;
|
color: $u-tips-color;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.total {
|
.total {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
|
||||||
.total-price {
|
.total-price {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 40rpx;
|
margin-top: 40rpx;
|
||||||
padding: 0 10rpx;
|
padding: 0 10rpx;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
line-height: 52rpx;
|
line-height: 52rpx;
|
||||||
width: 160rpx;
|
width: 160rpx;
|
||||||
border-radius: 26rpx;
|
border-radius: 26rpx;
|
||||||
border: 2rpx solid $u-border-color;
|
border: 2rpx solid $u-border-color;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: $u-info-dark;
|
color: $u-info-dark;
|
||||||
}
|
}
|
||||||
|
|
||||||
.evaluate {
|
.evaluate {
|
||||||
color: $u-warning-dark;
|
color: $u-warning-dark;
|
||||||
border-color: $u-warning-dark;
|
border-color: $u-warning-dark;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -195,10 +195,12 @@
|
|||||||
var tempData = [];
|
var tempData = [];
|
||||||
// #ifdef APP || APP-PLUS
|
// #ifdef APP || APP-PLUS
|
||||||
tempData = uni.getStorageSync("unitData");
|
tempData = uni.getStorageSync("unitData");
|
||||||
this.unitData = tempData[unitType];
|
console.log((tempData));
|
||||||
|
this.unitData = (tempData[unitType]);
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
tempData = localStorage.getItem("unitData");
|
tempData = localStorage.getItem("unitData");
|
||||||
|
console.log((tempData));
|
||||||
var unitDatalist = JSON.parse(tempData);
|
var unitDatalist = JSON.parse(tempData);
|
||||||
this.unitData = unitDatalist[unitType];
|
this.unitData = unitDatalist[unitType];
|
||||||
// #endif
|
// #endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user