1、优化空组件、自定义图标组件; 2、优化检测更新提示; 3、增加多提打印(暂不支持图片打印)

unocss
chris 8 months ago
parent 601e687c48
commit 8f0855a0e7

@ -1,3 +1,7 @@
.ch-empty { .ch-empty {
padding: 60rpx 60rpx; padding: 20rpx 30rpx;
}
.ch-empty--text {
color: #bbb;
} }

@ -1,6 +1,7 @@
<template> <template>
<ch-flex class="ch-empty" justify="center" items="center"> <ch-flex class="ch-empty" justify="center" items="center" direction="column">
<ch-icon name="empty" :size="100" color="#bbb"></ch-icon> <ch-icon name="empty" :size="100" color="#bbb"></ch-icon>
<text class="ch-empty--text">暂无数据</text>
</ch-flex> </ch-flex>
</template> </template>

@ -0,0 +1,3 @@
.ch-icon {
line-height: 1.5;
}

@ -30,6 +30,6 @@ const style = computed(() => {
}) })
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
@import './ch-icon.scss';
</style> </style>

@ -2,7 +2,7 @@
"name" : "smart_campus", "name" : "smart_campus",
"appid" : "__UNI__C183B0D", "appid" : "__UNI__C183B0D",
"description" : "", "description" : "",
"versionName" : "0.0.0.3", "versionName" : "0.0.0.4",
"versionCode" : 100, "versionCode" : 100,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */

@ -34,6 +34,8 @@
<text>{{ item.name }}</text> <text>{{ item.name }}</text>
</ch-flex> </ch-flex>
</uni-grid-item> </uni-grid-item>
<uni-grid-item>
</uni-grid-item>
</uni-grid> </uni-grid>
</view> </view>
</template> </template>
@ -72,7 +74,7 @@ const data = reactive({
icon: task, icon: task,
url: '/pages/task/task' url: '/pages/task/task'
} }
] ],
}) })
const { gridList, userInfo } = toRefs(data); const { gridList, userInfo } = toRefs(data);

@ -5,9 +5,9 @@
<ch-nav-btn icon="paperplane-filled" iconSize="28" color="#fff" @click="print"> <ch-nav-btn icon="paperplane-filled" iconSize="28" color="#fff" @click="print">
打印 打印
</ch-nav-btn> </ch-nav-btn>
<ch-nav-btn icon="paperplane-filled" iconSize="28" color="#fff" @click="printImg"> <!-- <ch-nav-btn icon="paperplane-filled" iconSize="28" color="#fff" @click="printImg">
图片 图片
</ch-nav-btn> </ch-nav-btn> -->
</block> </block>
</ch-nav-bar> </ch-nav-bar>
<canvas ref="canvasRef" canvas-id="imgCanvas" id="imgCanvas" :style="`width: ${canvasW}px; height: ${canvasH}px;`"/> <canvas ref="canvasRef" canvas-id="imgCanvas" id="imgCanvas" :style="`width: ${canvasW}px; height: ${canvasH}px;`"/>
@ -139,6 +139,13 @@ import { getImgData } from '@/api/common.js';
// //
function print(){ function print(){
if (!writeId.value) {
uni.showToast({
icon: 'none',
title: '请连接打印机'
})
return;
}
const printerJobs = new PrinterJobs(); const printerJobs = new PrinterJobs();
const quesArr = questions.value.forEach(ques => { const quesArr = questions.value.forEach(ques => {

@ -118,7 +118,14 @@ function checkChange (e) {
} }
function print () { function print () {
const quesList = checkIds.value.map(id => questionList.value.find(item => item.questionid == id))
uni.setStorage({
key: 'questions',
data: JSON.stringify(quesList)
})
uni.navigateTo({
url: '/pages/print/print'
})
} }
function cancel () { function cancel () {

@ -43,6 +43,12 @@ function checkAppUpdate () {
}) })
checkUpdate().then(res => { checkUpdate().then(res => {
console.log('检查更新结果:', res) console.log('检查更新结果:', res)
if (res.code === 0) {
uni.showToast({
icon: 'none',
title: '暂无更新'
})
}
}).catch(error => { }).catch(error => {
console.log("检查更新错误:", error) console.log("检查更新错误:", error)
}).finally(() => { }).finally(() => {

Loading…
Cancel
Save