|
@@ -10,104 +10,100 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="my-page">
|
|
<view class="my-page">
|
|
|
<!-- 自定义导航栏 -->
|
|
<!-- 自定义导航栏 -->
|
|
|
- <pyh-nv ref="nvRef" :config="nvConfig">
|
|
|
|
|
- <wd-img :src="logoSrc" height="30" mode="heightFix"></wd-img>
|
|
|
|
|
- </pyh-nv>
|
|
|
|
|
|
|
+ <pyh-nv ref="nvRef" :config="nvConfig"></pyh-nv>
|
|
|
|
|
|
|
|
- <view class="px-4">
|
|
|
|
|
- <!-- 主图轮播 1:1 height="calc(100vw - 60rpx)" -->
|
|
|
|
|
|
|
+ <view class="page-contain">
|
|
|
<wd-swiper
|
|
<wd-swiper
|
|
|
v-model:current="current"
|
|
v-model:current="current"
|
|
|
:list="swiperList"
|
|
:list="swiperList"
|
|
|
:indicator="{ type: 'dots-bar' }"
|
|
:indicator="{ type: 'dots-bar' }"
|
|
|
value-key="url"
|
|
value-key="url"
|
|
|
- height="calc(66.6vw - 20rpx)"
|
|
|
|
|
|
|
+ height="400rpx"
|
|
|
imageMode="widthFix"
|
|
imageMode="widthFix"
|
|
|
:duration="500"
|
|
:duration="500"
|
|
|
- custom-class="my-swiper shadow-class"
|
|
|
|
|
|
|
+ custom-class="my-swiper"
|
|
|
></wd-swiper>
|
|
></wd-swiper>
|
|
|
- <!-- 功能区 -->
|
|
|
|
|
- <view class="guide-box shadow-class">
|
|
|
|
|
- <view class="guide-item" @click="toUserHub('')">
|
|
|
|
|
- <wd-img :src="deviceImgSrc" width="90" mode="widthFix"></wd-img>
|
|
|
|
|
- <view class="item-title">打印助手</view>
|
|
|
|
|
- <view class="item-desc">我的打印助手</view>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 主入口 -->
|
|
|
|
|
+ <view class="guide-box">
|
|
|
|
|
+ <view class="guide-item bg-orange" @click="openWebView()">
|
|
|
|
|
+ <view class="item-title">文档打印</view>
|
|
|
|
|
+ <view class="item-desc">支持PDF、Word、PPT、Excel</view>
|
|
|
|
|
+ <view class="item-btn">去打印</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="guide-item" @click="openWebView()">
|
|
|
|
|
- <wd-img :src="fileImgSrc" width="90" mode="widthFix"></wd-img>
|
|
|
|
|
- <view class="item-title">手机文件</view>
|
|
|
|
|
- <view class="item-desc">无需驱动 隔空打印</view>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <view class="guide-item bg-blue-light" @click="toPrint('image')">
|
|
|
|
|
+ <view class="item-title">照片打印</view>
|
|
|
|
|
+ <view class="item-desc">支持jpg、png、gif、webp</view>
|
|
|
|
|
+ <view class="item-btn">去打印</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- 补充入口 -->
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 次入口 -->
|
|
|
<view class="content">
|
|
<view class="content">
|
|
|
- <view class="section">
|
|
|
|
|
- <view class="item">
|
|
|
|
|
- <view class="title" @click="toPrint('wxImg')">
|
|
|
|
|
- <wd-img :src="wechatImageSrc" width="40" mode="widthFix"></wd-img>
|
|
|
|
|
- <view class="title-text">微信图片</view>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <view class="item wx-file" @click="toPrint('wxFile')">
|
|
|
|
|
+ <view class="item-text">
|
|
|
|
|
+ <view class="title-text">微信文件打印</view>
|
|
|
|
|
+ <view class="desc-text">聊天文件、云文档等打印</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- msg -->
|
|
|
|
|
- <view class="item" @click="toPrint('image')">
|
|
|
|
|
- <view class="title">
|
|
|
|
|
- <wd-img :src="pictureSrc" width="40" mode="widthFix"></wd-img>
|
|
|
|
|
- <view class="title-text">相册图片</view>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <view class="item-icon">
|
|
|
|
|
+ <wd-img :src="documentSrc" width="48" mode="widthFix"></wd-img>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="item">
|
|
|
|
|
- <view class="title" @click="toPrint('wxFile')">
|
|
|
|
|
- <wd-img :src="wechatFileSrc" width="40" mode="widthFix"></wd-img>
|
|
|
|
|
- <view class="title-text">微信文件</view>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="item wx-invoice" @click="toPrint('invoice')">
|
|
|
|
|
+ <view class="item-text">
|
|
|
|
|
+ <view class="title-text">发票打印</view>
|
|
|
|
|
+ <view class="desc-text">快速选择发票打印</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="item">
|
|
|
|
|
- <view class="title" @click="toPrint('invoice')">
|
|
|
|
|
- <wd-img :src="wechatInvoiceSrc" width="40" mode="widthFix"></wd-img>
|
|
|
|
|
- <view class="title-text">微信发票</view>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <view class="item-icon">
|
|
|
|
|
+ <wd-img :src="invoiceSrc" width="48" mode="widthFix"></wd-img>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="item" @click="toConnect()">
|
|
|
|
|
- <view class="title">
|
|
|
|
|
- <wd-img :src="connectSrc" width="40" mode="widthFix"></wd-img>
|
|
|
|
|
- <view class="title-text">设备配网</view>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="item wx-image" @click="toPrint('wxImg')">
|
|
|
|
|
+ <view class="item-text">
|
|
|
|
|
+ <view class="title-text">微信图片打印</view>
|
|
|
|
|
+ <view class="desc-text">聊天图片、云图片等打印</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="item" @click="toJob()">
|
|
|
|
|
- <view class="title">
|
|
|
|
|
- <wd-img :src="historySrc" width="40" mode="widthFix"></wd-img>
|
|
|
|
|
- <view class="title-text">打印任务</view>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <view class="item-icon">
|
|
|
|
|
+ <wd-img :src="pictureSrc" width="48" mode="widthFix"></wd-img>
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- <view class="item">
|
|
|
|
|
- <view class="title">
|
|
|
|
|
- <image :src="settingSrc"></image>
|
|
|
|
|
- <view class="title-text">预留入口</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="tips">描述信息</view>
|
|
|
|
|
- </view> -->
|
|
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 临时入口 -->
|
|
|
|
|
+ <!-- <view @click="toUserHub()">打印助手</view>
|
|
|
|
|
+ <view @click="toConnect()">设备配网</view>
|
|
|
|
|
+ <view @click="toJob()">打印任务</view> -->
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- TODO: showGuide 增加自定义confirm, 引导添加设备 -->
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { useUserStore } from '@/store'
|
|
import { useUserStore } from '@/store'
|
|
|
-import { useToast } from 'wot-design-uni'
|
|
|
|
|
|
|
+import { useToast, useMessage } from 'wot-design-uni'
|
|
|
import { toLogin } from '@/utils'
|
|
import { toLogin } from '@/utils'
|
|
|
|
|
+import { getUserHubPage } from '@/service/api'
|
|
|
|
|
|
|
|
defineOptions({
|
|
defineOptions({
|
|
|
name: 'Home',
|
|
name: 'Home',
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const deviceInfo = uni.getDeviceInfo() // 更多系统信息用 getSystemInfoSync
|
|
|
|
|
const toast = useToast()
|
|
const toast = useToast()
|
|
|
|
|
+const message = useMessage()
|
|
|
|
|
+const deviceInfo = uni.getDeviceInfo() // 更多系统信息用 getSystemInfoSync
|
|
|
const isLogined = computed(() => !!useUserStore().token)
|
|
const isLogined = computed(() => !!useUserStore().token)
|
|
|
const nvRef: any = ref()
|
|
const nvRef: any = ref()
|
|
|
const nvConfig = ref({
|
|
const nvConfig = ref({
|
|
|
title: '首页',
|
|
title: '首页',
|
|
|
- type: 'slot', // default slot logo
|
|
|
|
|
|
|
+ type: 'logo', // default slot logo
|
|
|
|
|
+ logo: {
|
|
|
|
|
+ src: '/static/images/logo_top.png',
|
|
|
|
|
+ style: 'height: 60rpx'
|
|
|
|
|
+ },
|
|
|
back: {
|
|
back: {
|
|
|
hide: true,
|
|
hide: true,
|
|
|
},
|
|
},
|
|
@@ -118,29 +114,12 @@ const nvConfig = ref({
|
|
|
initColor: '#000000',
|
|
initColor: '#000000',
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
|
|
+const showGuide = ref(false)
|
|
|
const swiperList = ref([])
|
|
const swiperList = ref([])
|
|
|
const current = ref(0)
|
|
const current = ref(0)
|
|
|
-
|
|
|
|
|
-const logoSrc = ref('/static/images/logo_temp1.png')
|
|
|
|
|
-// const deviceImgSrc = ref('/static/images/device.png')
|
|
|
|
|
-// const fileImgSrc = ref('/static/images/file.png')
|
|
|
|
|
-// const connectSrc = ref('/static/images/connect.png')
|
|
|
|
|
-// const pictureSrc = ref('/static/images/picture.png')
|
|
|
|
|
-// const wechatImageSrc = ref('/static/images/wechat_file.png')
|
|
|
|
|
-// const wechatFileSrc = ref('/static/images/wechatFile.png')
|
|
|
|
|
-// const wechatInvoiceSrc = ref('/static/images/wechat_invoice.png')
|
|
|
|
|
-// const historySrc = ref('/static/images/history.png')
|
|
|
|
|
-// const shareSrc = ref('/static/images/share.png')
|
|
|
|
|
-
|
|
|
|
|
-const deviceImgSrc = ref('/static/images/icon/printer-two.png')
|
|
|
|
|
-const fileImgSrc = ref('/static/images/icon/folder-open.png')
|
|
|
|
|
-const connectSrc = ref('/static/images/icon/connect.png')
|
|
|
|
|
-const pictureSrc = ref('/static/images/icon/album.png')
|
|
|
|
|
-const wechatImageSrc = ref('/static/images/icon/picture.png')
|
|
|
|
|
-const wechatFileSrc = ref('/static/images/icon/file.png')
|
|
|
|
|
-const wechatInvoiceSrc = ref('/static/images/icon/cards.png')
|
|
|
|
|
-const historySrc = ref('/static/images/icon/history-query.png')
|
|
|
|
|
-const shareSrc = ref('/static/images/icon/wechat.png')
|
|
|
|
|
|
|
+const documentSrc = ref('/static/images/document.png')
|
|
|
|
|
+const invoiceSrc = ref('/static/images/invoice.png')
|
|
|
|
|
+const pictureSrc = ref('/static/images/picture.png')
|
|
|
|
|
|
|
|
// 初始化 swiperList 数组
|
|
// 初始化 swiperList 数组
|
|
|
function initSwiperList() {
|
|
function initSwiperList() {
|
|
@@ -208,8 +187,42 @@ function toJob() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function checkHub() {
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ pageNo: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ }
|
|
|
|
|
+ getUserHubPage(params).then((res :any) => {
|
|
|
|
|
+ if (res.code == 0 && res.body && res.body.total == 0) {
|
|
|
|
|
+ showGuide.value = true
|
|
|
|
|
+ // TODO: 需修改为自定义的全局弹窗
|
|
|
|
|
+ message.confirm({
|
|
|
|
|
+ msg: "您还没添加猫耳打印助手,现在就去添加吗?",
|
|
|
|
|
+ closeOnClickModal: false,
|
|
|
|
|
+ confirmButtonText: "立即添加",
|
|
|
|
|
+ cancelButtonText: "不感兴趣",
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ toAddUserHub()
|
|
|
|
|
+ }).catch(() => {})
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(() => {})
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function toAddUserHub() {
|
|
|
|
|
+ if (isLogined.value) {
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: `/pages/assistant/detail?type=add`,
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ toast.warning('请先前往登录')
|
|
|
|
|
+ toLogin(1500)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
onLoad((option: any) => {
|
|
onLoad((option: any) => {
|
|
|
initSwiperList()
|
|
initSwiperList()
|
|
|
|
|
+ // 检查是否已添加助手, 没有则弹窗提示
|
|
|
|
|
+ if (isLogined.value) checkHub()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 监听滚动
|
|
// 监听滚动
|
|
@@ -220,7 +233,6 @@ onPageScroll((e) => {
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.my-page {
|
|
.my-page {
|
|
|
- background-color: #eeeeee;
|
|
|
|
|
background-size: 100% auto;
|
|
background-size: 100% auto;
|
|
|
background-position: top;
|
|
background-position: top;
|
|
|
background-repeat: no-repeat;
|
|
background-repeat: no-repeat;
|
|
@@ -230,79 +242,129 @@ onPageScroll((e) => {
|
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+.page-contain {
|
|
|
|
|
+ padding: 0 20rpx;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
:deep(.my-swiper) {
|
|
:deep(.my-swiper) {
|
|
|
- border-radius: 40rpx !important;
|
|
|
|
|
|
|
+ border-radius: 20rpx !important;
|
|
|
swiper {
|
|
swiper {
|
|
|
- border-radius: 40rpx !important;
|
|
|
|
|
|
|
+ border-radius: 20rpx !important;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.guide-box {
|
|
.guide-box {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- padding: 20rpx 0 20rpx;
|
|
|
|
|
- margin-top: 30rpx;
|
|
|
|
|
- border-radius: 40rpx;
|
|
|
|
|
- background-color: #fff;
|
|
|
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
|
+
|
|
|
.guide-item {
|
|
.guide-item {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
- text-align: center;
|
|
|
|
|
|
|
+ color: #ffffff;
|
|
|
|
|
+ border-radius: 40rpx;
|
|
|
|
|
+ padding: 50rpx 20rpx;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ min-height: 300rpx;
|
|
|
|
|
+
|
|
|
.item-title {
|
|
.item-title {
|
|
|
- font-size: 32rpx;
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
- margin-top: 4rpx;
|
|
|
|
|
|
|
+ font-size: 48rpx;
|
|
|
}
|
|
}
|
|
|
.item-desc {
|
|
.item-desc {
|
|
|
font-size: 24rpx;
|
|
font-size: 24rpx;
|
|
|
- margin-top: 4rpx;
|
|
|
|
|
- margin-bottom: 20rpx;
|
|
|
|
|
|
|
+ margin-top: 24rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ .item-btn {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ min-width: 100rpx;
|
|
|
|
|
+ padding: 10rpx 40rpx;
|
|
|
|
|
+ right: 30rpx;
|
|
|
|
|
+ bottom: 50rpx;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ font-size: 36rpx;
|
|
|
|
|
+ color: #6E0000;
|
|
|
|
|
+ background-color: #FDDD62;
|
|
|
|
|
+ border: 4rpx solid #FFF3CD;
|
|
|
|
|
+ border-radius: 32rpx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.guide-item + .guide-item {
|
|
.guide-item + .guide-item {
|
|
|
- border-left: 1px solid transparent; /* 设置透明边框以便于渐变可见 */
|
|
|
|
|
- border-image: linear-gradient(to bottom, white, #b8b8b8, white) 10 10; /* 使用渐变作为边框图片 */
|
|
|
|
|
|
|
+ margin-left: 20rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ .bg-orange {
|
|
|
|
|
+ background-color: #FF894F;
|
|
|
|
|
+ border: 10rpx solid #FFE7DC;
|
|
|
|
|
+ }
|
|
|
|
|
+ .bg-blue-light {
|
|
|
|
|
+ background-color: #58BEFF;
|
|
|
|
|
+ border: 10rpx solid #DEF2FF;
|
|
|
|
|
+ }
|
|
|
|
|
+ .bg-blue {
|
|
|
|
|
+ background-color: var(--wot-color-theme);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.content {
|
|
.content {
|
|
|
- width: 100%;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- margin-top: 30rpx;
|
|
|
|
|
-
|
|
|
|
|
- .section {
|
|
|
|
|
|
|
+ .item {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- margin-left: -20rpx;
|
|
|
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
|
+ padding: 30rpx;
|
|
|
|
|
+ border-radius: 20rpx;
|
|
|
|
|
|
|
|
- .item {
|
|
|
|
|
- flex: 1 1 calc(50% - 20px);
|
|
|
|
|
- // background-color: #e1e1e1;
|
|
|
|
|
- background-color: #ffffff;
|
|
|
|
|
- padding: $uni-spacing-row-lg 0;
|
|
|
|
|
- margin: 0 0 20rpx 20rpx;
|
|
|
|
|
|
|
+ .item-text {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ .title-text {
|
|
|
|
|
+ font-size: 36rpx;;
|
|
|
|
|
+ }
|
|
|
|
|
+ .desc-text {
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ margin-top: 16rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .item-icon {
|
|
|
|
|
+ width: 160rpx;
|
|
|
|
|
+ height: 160rpx;
|
|
|
|
|
+ line-height: 160rpx;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
- border-radius: 30rpx;
|
|
|
|
|
-
|
|
|
|
|
- .title {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- font-size: $uni-font-size-lg;
|
|
|
|
|
-
|
|
|
|
|
- .title-text {
|
|
|
|
|
- margin-left: 20rpx;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .tips {
|
|
|
|
|
- color: $uni-text-color-grey;
|
|
|
|
|
- font-size: $uni-font-size-base;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .wx-file {
|
|
|
|
|
+ background-color: rgba(226, 233, 251, 0.5);
|
|
|
|
|
+ .title-text {
|
|
|
|
|
+ color: #0F62FE;
|
|
|
|
|
+ }
|
|
|
|
|
+ .desc-text {
|
|
|
|
|
+ color: rgba(15, 98, 254, 0.6);
|
|
|
|
|
+ }
|
|
|
|
|
+ .item-icon {
|
|
|
|
|
+ background-color: rgba(86, 142, 254, 0.2);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .wx-invoice {
|
|
|
|
|
+ background-color: rgba(225, 242, 230, 0.8);
|
|
|
|
|
+ .title-text {
|
|
|
|
|
+ color: #66CC00;
|
|
|
|
|
+ }
|
|
|
|
|
+ .desc-text {
|
|
|
|
|
+ color: rgba(102, 204, 0, 0.6);
|
|
|
|
|
+ }
|
|
|
|
|
+ .item-icon {
|
|
|
|
|
+ background-color: rgba(186, 232, 119, 0.3);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .wx-image {
|
|
|
|
|
+ background-color: rgba(248, 244, 233, 0.5);
|
|
|
|
|
+ .title-text {
|
|
|
|
|
+ color: #FC7234;
|
|
|
|
|
+ }
|
|
|
|
|
+ .desc-text {
|
|
|
|
|
+ color: rgba(252, 114, 52, 0.6);
|
|
|
|
|
+ }
|
|
|
|
|
+ .item-icon {
|
|
|
|
|
+ background-color: rgba(255, 153, 0, 0.2);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|