Compare commits
2 Commits
12c03c004d
...
c43b6513e4
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c43b6513e4 | ||
![]() |
69508f5256 |
@ -25,7 +25,7 @@
|
|||||||
<!--app-html-->
|
<!--app-html-->
|
||||||
</div>
|
</div>
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
//
|
<!-- // -->
|
||||||
<script>
|
<script>
|
||||||
// var _hmt = _hmt || []
|
// var _hmt = _hmt || []
|
||||||
// ;(function () {
|
// ;(function () {
|
||||||
|
@ -133,6 +133,13 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "修改密码"
|
"navigationBarTitleText": "修改密码"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/messageNotification/messageNotification",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "消息通知"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
@ -15,6 +15,7 @@ defineProps<{
|
|||||||
}>()
|
}>()
|
||||||
|
|
||||||
const handleToBooking = (item: Object) => {
|
const handleToBooking = (item: Object) => {
|
||||||
|
console.log('点击了分类', JSON.stringify(item))
|
||||||
if (item.auth) {
|
if (item.auth) {
|
||||||
const path = item.path
|
const path = item.path
|
||||||
const url = `/pages/${path}/${path}`
|
const url = `/pages/${path}/${path}`
|
||||||
@ -30,8 +31,16 @@ const handleToBooking = (item: Object) => {
|
|||||||
<template v-if="list.length">
|
<template v-if="list.length">
|
||||||
<view class="category-item" hover-class="none" v-for="item in list" :key="item.path"
|
<view class="category-item" hover-class="none" v-for="item in list" :key="item.path"
|
||||||
@click="handleToBooking(item)">
|
@click="handleToBooking(item)">
|
||||||
<image v-if="item.auth" class="icon" :src="item.imgUrl" mode="scaleToFill"></image>
|
|
||||||
<image v-else class="icon" :src="item.defaultImgUrl" mode="scaleToFill"></image>
|
<view v-if="item.unReadCount>=0" class="center-msg">
|
||||||
|
<span class="msg-text">消息通知</span>
|
||||||
|
<text class="unread-badge" v-if="item.unReadCount>0">{{ item.unReadCount }}</text>
|
||||||
|
</view>
|
||||||
|
<view v-else >
|
||||||
|
<image v-if="item.auth" class="icon" :src="item.imgUrl" mode="scaleToFill"></image>
|
||||||
|
<image v-else class="icon" :src="item.defaultImgUrl" mode="scaleToFill"></image>
|
||||||
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<view v-else class="empty-data">
|
<view v-else class="empty-data">
|
||||||
@ -42,4 +51,31 @@ const handleToBooking = (item: Object) => {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import '../styles/category.scss';
|
@import '../styles/category.scss';
|
||||||
|
.center-msg {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 240rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.msg-text {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.unread-badge {
|
||||||
|
position: absolute;
|
||||||
|
top: 20rpx;
|
||||||
|
right: 28rpx;
|
||||||
|
background: #ff4d4f;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
padding: 0 12rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
min-width: 32rpx;
|
||||||
|
text-align: center;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,103 +1,121 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||||
import { useLoginStore } from '@/stores/modules/login'
|
import { useLoginStore } from "@/stores/modules/login";
|
||||||
import { computed, ref, reactive } from 'vue'
|
import { computed, ref, reactive } from "vue";
|
||||||
import CustomNavbar from './components/CustomNavbar.vue'
|
import CustomNavbar from "./components/CustomNavbar.vue";
|
||||||
import CategoryPanel from './components/CategoryPanel.vue'
|
import CategoryPanel from "./components/CategoryPanel.vue";
|
||||||
import footRight from './components/footRight.vue'
|
import footRight from "./components/footRight.vue";
|
||||||
import PageSkeleton from './components/PageSkeleton.vue'
|
import PageSkeleton from "./components/PageSkeleton.vue";
|
||||||
import { getHomeCategoryAPI } from '@/services/home'
|
import { getHomeCategoryAPI, getUnreadMessage } from "@/services/home";
|
||||||
// 获取前台分类数据
|
// 获取前台分类数据
|
||||||
const categoryList = ref([
|
const categoryList = ref([
|
||||||
{
|
{
|
||||||
path: 'approveOrder',
|
path: "approveOrder",
|
||||||
name: '订单批准',
|
name: "订单批准",
|
||||||
auth: false,
|
auth: false,
|
||||||
imgUrl: '/static/images/approveOrder.png',
|
imgUrl: "/static/images/approveOrder.png",
|
||||||
defaultImgUrl: '/static/images/approveOrder-default.png',
|
defaultImgUrl: "/static/images/approveOrder-default.png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'unqualifiedNotification',
|
path: "unqualifiedNotification",
|
||||||
name: '品质异常通知',
|
name: "品质异常通知",
|
||||||
auth: false,
|
auth: false,
|
||||||
imgUrl: '/static/images/unqualifiedNotification.png',
|
imgUrl: "/static/images/unqualifiedNotification.png",
|
||||||
defaultImgUrl: '/static/images/unqualifiedNotification-default.png',
|
defaultImgUrl: "/static/images/unqualifiedNotification-default.png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'productionReport',
|
path: "productionReport",
|
||||||
name: '生产报工',
|
name: "生产报工",
|
||||||
auth: false,
|
auth: false,
|
||||||
imgUrl: '/static/images/productionReport.png',
|
imgUrl: "/static/images/productionReport.png",
|
||||||
defaultImgUrl: '/static/images/productionReport-default.png',
|
defaultImgUrl: "/static/images/productionReport-default.png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'assembleReport',
|
path: "assembleReport",
|
||||||
name: '装配报工',
|
name: "装配报工",
|
||||||
auth: false,
|
auth: false,
|
||||||
imgUrl: '/static/images/assembleReport.png',
|
imgUrl: "/static/images/assembleReport.png",
|
||||||
defaultImgUrl: '/static/images/assembleReport-default.png',
|
defaultImgUrl: "/static/images/assembleReport-default.png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "pgMaster",
|
path: "pgMaster",
|
||||||
name: "过程检报工",
|
name: "过程检报工",
|
||||||
auth: true,
|
auth: true,
|
||||||
imgUrl: "/static/images/guochengjian.png",
|
imgUrl: "/static/images/guochengjian.png",
|
||||||
defaultImgUrl: "/static/images/assembleReport-default.png"
|
defaultImgUrl: "/static/images/assembleReport-default.png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "zjPgMaster",
|
path: "zjPgMaster",
|
||||||
name: "终检报工",
|
name: "终检报工",
|
||||||
auth: true,
|
auth: true,
|
||||||
imgUrl: "/static/images/zhongjian.png",
|
imgUrl: "/static/images/zhongjian.png",
|
||||||
defaultImgUrl: "/static/images/assembleReport-default.png"
|
defaultImgUrl: "/static/images/assembleReport-default.png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "moJuSheJiReport",
|
path: "moJuSheJiReport",
|
||||||
name: "进度上报",
|
name: "进度上报",
|
||||||
auth: true,
|
auth: true,
|
||||||
imgUrl: "/static/images/mojusheji.png",
|
imgUrl: "/static/images/mojusheji.png",
|
||||||
defaultImgUrl: "/static/images/assembleReport-default.png"
|
defaultImgUrl: "/static/images/assembleReport-default.png",
|
||||||
},
|
},
|
||||||
])
|
{
|
||||||
const loginStore = useLoginStore()
|
path: "messageNotification",
|
||||||
|
name: "消息通知",
|
||||||
|
auth: true,
|
||||||
|
imgUrl: "",
|
||||||
|
defaultImgUrl: "",
|
||||||
|
unReadCount: 0, // 未读消息数
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
const loginStore = useLoginStore();
|
||||||
const isLogin = computed(() => {
|
const isLogin = computed(() => {
|
||||||
const accessToken = loginStore.userInfo?.accessToken
|
const accessToken = loginStore.userInfo?.accessToken;
|
||||||
const storage_token = uni.getStorageSync('storage_userInfo')?.accessToken
|
const storage_token = uni.getStorageSync("storage_userInfo")?.accessToken;
|
||||||
return !!accessToken || !!storage_token
|
return !!accessToken || !!storage_token;
|
||||||
})
|
});
|
||||||
// 是否加载中标记
|
// 是否加载中标记
|
||||||
const isLoading = ref(false)
|
const isLoading = ref(false);
|
||||||
// 页面加载
|
// 页面加载
|
||||||
onShow(async() => {
|
onShow(async () => {
|
||||||
if (isLogin.value) {
|
if (isLogin.value) {
|
||||||
await getHomeCategory()
|
await getHomeCategory();
|
||||||
} else {
|
} else {
|
||||||
categoryList.value.forEach((e) => {
|
categoryList.value.forEach((e) => {
|
||||||
e.auth = true
|
e.auth = true;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
const getHomeCategory = async () => {
|
const getHomeCategory = async () => {
|
||||||
isLoading.value = true
|
isLoading.value = true;
|
||||||
const params = {}
|
|
||||||
const data = await getHomeCategoryAPI(params)
|
const params = {};
|
||||||
const menus = data?.menus.find((e) => e.path == '/applet')?.children || []
|
const data = await getHomeCategoryAPI(params);
|
||||||
|
const menus = data?.menus.find((e) => e.path == "/applet")?.children || [];
|
||||||
if (menus.length) {
|
if (menus.length) {
|
||||||
const arr = []
|
const arr = [];
|
||||||
categoryList.value.forEach((e) => {
|
categoryList.value.forEach((e) => {
|
||||||
const target = menus.find((q) => q.path == e.path)
|
const target = menus.find((q) => q.path == e.path);
|
||||||
e.auth = !!target
|
e.auth = !!target;
|
||||||
})
|
});
|
||||||
|
}
|
||||||
|
const unReadCount = await getUnreadMessage();
|
||||||
|
// 把未读数放到消息通知项
|
||||||
|
const msgItem = categoryList.value.find(
|
||||||
|
(e) => e.path === "messageNotification"
|
||||||
|
);
|
||||||
|
if (msgItem) {
|
||||||
|
msgItem.unReadCount = unReadCount;
|
||||||
|
msgItem.auth=true
|
||||||
}
|
}
|
||||||
if (loginStore.userInfo.userId) {
|
if (loginStore.userInfo.userId) {
|
||||||
const obj = {
|
const obj = {
|
||||||
...loginStore.userInfo,
|
...loginStore.userInfo,
|
||||||
nickname: data.user.nickname
|
nickname: data.user.nickname,
|
||||||
}
|
};
|
||||||
loginStore.setInfo(obj)
|
loginStore.setInfo(obj);
|
||||||
}
|
}
|
||||||
isLoading.value = false
|
isLoading.value = false;
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<view class="viewport">
|
<view class="viewport">
|
||||||
@ -118,7 +136,7 @@ const getHomeCategory = async () => {
|
|||||||
page {
|
page {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: #F8FAFD;
|
background-color: #f8fafd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.viewport {
|
.viewport {
|
||||||
|
@ -0,0 +1,401 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted, computed, ref } from "vue";
|
||||||
|
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||||
|
import { getApproveOrderAPI, getMessage, read } from "@/services/approveOrder";
|
||||||
|
import { useLoginStore } from "@/stores/modules/login";
|
||||||
|
import { formatDate } from "@/utils/index";
|
||||||
|
const userStore = useLoginStore();
|
||||||
|
const dictInfo = userStore.dictInfo;
|
||||||
|
const propertyDictData =
|
||||||
|
dictInfo.filter((e) => e.dictType == "heli_project_property") || [];
|
||||||
|
// 是否分页结束
|
||||||
|
const isFinish = ref(false);
|
||||||
|
// 是否触发下拉刷新
|
||||||
|
const isTriggered = ref(false);
|
||||||
|
// 定义 porps
|
||||||
|
const props = defineProps<{
|
||||||
|
orderState: number;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 是否加载中标记,用于防止滚动触底触发多次请求
|
||||||
|
const isLoading = ref(false);
|
||||||
|
// 请求参数
|
||||||
|
const queryParams: Required<any> = {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
status: props.orderState,
|
||||||
|
isSnapshot: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
const dataList = ref([]);
|
||||||
|
const getListData = async () => {
|
||||||
|
if (isLoading.value) return;
|
||||||
|
if (isFinish.value === true) {
|
||||||
|
return uni.showToast({ icon: "none", title: "没有更多数据~" });
|
||||||
|
}
|
||||||
|
isLoading.value = true;
|
||||||
|
const data = await getMessage(queryParams);
|
||||||
|
isLoading.value = false;
|
||||||
|
data.list.forEach((e) => {
|
||||||
|
const obj = propertyDictData.find((q) => q.value == e.property) || {};
|
||||||
|
e.property = obj?.label;
|
||||||
|
e.createTime = formatDate(e.createTime, "YYYY-MM-DD HH:mm:ss");
|
||||||
|
// e.projectStartTime = formatDate(e.projectStartTime, 'YYYY-MM-DD')
|
||||||
|
// e.projectEndTime = formatDate(e.projectEndTime, 'YYYY-MM-DD')
|
||||||
|
});
|
||||||
|
dataList.value.push(...data.list);
|
||||||
|
// 判断是否还有更多数据
|
||||||
|
if (data.list.length < queryParams.pageSize) {
|
||||||
|
isFinish.value = true;
|
||||||
|
} else {
|
||||||
|
queryParams.pageNo++;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
function handlerRead(id: any) {
|
||||||
|
isLoading.value = true;
|
||||||
|
read(id)
|
||||||
|
.then(() => {
|
||||||
|
isLoading.value = false;
|
||||||
|
onRefresherrefresh();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
isLoading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
onMounted(async () => {
|
||||||
|
console.log("props", props);
|
||||||
|
await getListData();
|
||||||
|
});
|
||||||
|
onShow(async () => {
|
||||||
|
isLoading.value = false;
|
||||||
|
queryParams.pageNo = 1;
|
||||||
|
dataList.value = [];
|
||||||
|
isFinish.value = false;
|
||||||
|
await getListData();
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleDetail = (id) => {
|
||||||
|
const url = `/pages/approveOrder/approveOrder-detail?id=${id}`;
|
||||||
|
uni.navigateTo({ url });
|
||||||
|
};
|
||||||
|
|
||||||
|
// 自定义下拉刷新被触发
|
||||||
|
const onRefresherrefresh = async () => {
|
||||||
|
// 开始动画
|
||||||
|
isTriggered.value = true;
|
||||||
|
// 重置数据
|
||||||
|
queryParams.pageNo = 1;
|
||||||
|
dataList.value = [];
|
||||||
|
isFinish.value = false;
|
||||||
|
// 加载数据
|
||||||
|
await getListData();
|
||||||
|
// 关闭动画
|
||||||
|
isTriggered.value = false;
|
||||||
|
};
|
||||||
|
// const searchVal = ref('')
|
||||||
|
// const handleSearch = async () => {
|
||||||
|
// let dataListDefault = []
|
||||||
|
// const code = searchVal.value
|
||||||
|
// if (code) {
|
||||||
|
// dataListDefault = dataList.value
|
||||||
|
// dataList.value = dataList.value.filter((e) => {
|
||||||
|
// return e.code == code
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// dataList.value = dataListDefault
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<view class="cont">
|
||||||
|
<!-- <view class="search" v-if="dataList.length > 5">
|
||||||
|
<view class="title"></view>
|
||||||
|
<input class="uni-input" v-model="searchVal" @change="handleSearch" placeholder="根据编号搜索" />
|
||||||
|
</view> -->
|
||||||
|
<scroll-view
|
||||||
|
enable-back-to-top
|
||||||
|
scroll-y
|
||||||
|
class="data-list"
|
||||||
|
refresher-enabled
|
||||||
|
:refresher-triggered="isTriggered"
|
||||||
|
@refresherrefresh="onRefresherrefresh"
|
||||||
|
@scrolltolower="getListData"
|
||||||
|
>
|
||||||
|
<view class="item" v-for="item in dataList" :key="item.id">
|
||||||
|
<!-- 方案1: 使用 flex 布局,推荐 -->
|
||||||
|
<view
|
||||||
|
class="hd"
|
||||||
|
style="
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<view style="display: flex; flex-direction: column">
|
||||||
|
<view class="statusLabel">{{ item.thingname }}</view>
|
||||||
|
<view
|
||||||
|
class="product-item"
|
||||||
|
style="margin: 0; color: #333; font-size: 22rpx"
|
||||||
|
>{{ item.createTime }}</view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="read-btn"
|
||||||
|
v-if="orderState == 0"
|
||||||
|
@click="handlerRead(item.id)"
|
||||||
|
>已读</view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
<view class="md">
|
||||||
|
<view class="product-item"
|
||||||
|
>客户简称:<span class="item-value">{{ item.attr6 }}</span></view
|
||||||
|
>
|
||||||
|
<view class="product-item"
|
||||||
|
>项目名称:<span class="item-value">{{ item.attr7 }}</span></view
|
||||||
|
>
|
||||||
|
<view class="product-item"
|
||||||
|
>子项目名称:<span class="item-value">{{ item.attr8 }}</span></view
|
||||||
|
>
|
||||||
|
<view class="product-item"
|
||||||
|
>备注内容:<span class="item-value">{{ item.attr9 }}</span></view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 底部提示文字 -->
|
||||||
|
<view
|
||||||
|
class="loading-text"
|
||||||
|
:style="{ paddingBottom: safeAreaInsets?.bottom + 'px' }"
|
||||||
|
>
|
||||||
|
{{ isFinish ? "没有更多数据~" : "正在加载..." }}
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
// 订单列表
|
||||||
|
.search {
|
||||||
|
padding: 4rpx;
|
||||||
|
width: 80%;
|
||||||
|
margin: 30rpx auto;
|
||||||
|
|
||||||
|
.uni-input {
|
||||||
|
border: 1px solid #d1d6db;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
padding: 4rpx 10rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-list {
|
||||||
|
height: 90vh;
|
||||||
|
.item {
|
||||||
|
position: relative;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
margin: 20rpx 20rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
.hd {
|
||||||
|
padding: 10rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.statusLabel {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333333;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
.read-btn {
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 6rpx 24rpx;
|
||||||
|
border: 1rpx solid #3775f6;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
color: #3775f6;
|
||||||
|
background: #f7f8fa;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.md {
|
||||||
|
position: relative;
|
||||||
|
padding: 10rpx;
|
||||||
|
min-height: 100rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
border-top: 2rpx solid #f2f2f2;
|
||||||
|
|
||||||
|
.product-item {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
display: flex;
|
||||||
|
font-size: 22rpx;
|
||||||
|
align-items: center;
|
||||||
|
color: #737d88;
|
||||||
|
.item-value {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
padding-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-bottom: 15rpx;
|
||||||
|
|
||||||
|
.date {
|
||||||
|
color: #666;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primary {
|
||||||
|
color: #ff9240;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-delete {
|
||||||
|
line-height: 1;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
padding-left: 10rpx;
|
||||||
|
border-left: 1rpx solid #e3e3e3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
|
.cover {
|
||||||
|
width: 170rpx;
|
||||||
|
height: 170rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 170rpx;
|
||||||
|
height: 170rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.quantity {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
line-height: 1;
|
||||||
|
padding: 6rpx 4rpx 6rpx 8rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 10rpx 0 0 0;
|
||||||
|
background-color: rgba(0, 0, 0, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
.meta {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.name {
|
||||||
|
height: 80rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
|
||||||
|
.type {
|
||||||
|
line-height: 1.8;
|
||||||
|
padding: 0 15rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
align-self: flex-start;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
color: #888;
|
||||||
|
background-color: #f7f7f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.more {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.payment {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
line-height: 1;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
text-align: right;
|
||||||
|
color: #999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
border-bottom: 1rpx solid #eee;
|
||||||
|
|
||||||
|
.quantity {
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.amount {
|
||||||
|
color: #444;
|
||||||
|
margin-left: 6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.symbol {
|
||||||
|
font-size: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.action {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
padding-top: 20rpx;
|
||||||
|
|
||||||
|
.button {
|
||||||
|
width: 180rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
border-radius: 60rpx;
|
||||||
|
border: 1rpx solid #ccc;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
|
||||||
|
.secondary {
|
||||||
|
color: #3775f6;
|
||||||
|
border-color: #3775f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primary {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #3775f6;
|
||||||
|
border-color: #3775f6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-text {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #666;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>import type { stringify } from 'querystring';
|
@ -0,0 +1,38 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<web-view :src="showUrl" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { ref, onMounted, onUnmounted } from 'vue';
|
||||||
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const showUrl = ref('');
|
||||||
|
|
||||||
|
// 使用 onLoad 生命周期钩子
|
||||||
|
onLoad((options) => {
|
||||||
|
console.log('页面加载中...');
|
||||||
|
console.log(options.fileUrl);
|
||||||
|
if (options.fileUrl) {
|
||||||
|
showUrl.value = `https://star.hz-hl.com/FileServer/onlinePreview?url=${options.fileUrl}`;
|
||||||
|
console.log(showUrl.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 使用 onMounted 生命周期钩子(虽然在这个例子中可能不是必需的,因为 onLoad 已经足够)
|
||||||
|
onMounted(() => {
|
||||||
|
console.log('Vue 组件挂载完成');
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
showUrl,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/* 你的样式 */
|
||||||
|
</style>
|
@ -0,0 +1,150 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
|
import dataItem from './components/dataItem.vue'
|
||||||
|
|
||||||
|
// tabs 数据
|
||||||
|
const orderTabs = ref([
|
||||||
|
{ status: 0, title: '未读', isRender: false },
|
||||||
|
{ status: 1, title: '已读', isRender: false },
|
||||||
|
])
|
||||||
|
|
||||||
|
// 高亮下标
|
||||||
|
const activeIndex = ref(0)
|
||||||
|
const handleIndexChange = (index: any) => {
|
||||||
|
orderTabs.value.forEach((e) => {
|
||||||
|
e.isRender = false
|
||||||
|
})
|
||||||
|
activeIndex.value = index
|
||||||
|
orderTabs.value[index].isRender = true
|
||||||
|
}
|
||||||
|
onLoad(async (options) => {
|
||||||
|
|
||||||
|
orderTabs.value.forEach((e, index) => {
|
||||||
|
e.isRender = e.status ==0
|
||||||
|
if (e.isRender) {
|
||||||
|
activeIndex.value = index
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<view class="viewport">
|
||||||
|
<view class="tabs">
|
||||||
|
<text
|
||||||
|
class="item"
|
||||||
|
:class="{ active: activeIndex == index }"
|
||||||
|
v-for="(item, index) in orderTabs"
|
||||||
|
:key="item.title"
|
||||||
|
@tap="handleIndexChange(index)"
|
||||||
|
>
|
||||||
|
{{ item.title }}
|
||||||
|
</text>
|
||||||
|
<!-- 游标 -->
|
||||||
|
<view class="cursor" :style="{ left: activeIndex ? '65%' : '14%' }"></view>
|
||||||
|
</view>
|
||||||
|
<!-- 滑动容器 -->
|
||||||
|
<swiper
|
||||||
|
class="swiper"
|
||||||
|
:current="activeIndex"
|
||||||
|
@change="handleIndexChange($event.detail.current)"
|
||||||
|
>
|
||||||
|
<!-- 滑动项 -->
|
||||||
|
<swiper-item v-for="item in orderTabs" :key="item.title">
|
||||||
|
<dataItem v-if="item.isRender" :order-state="item.status" />
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.viewport {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
// background-color: #3775F6;
|
||||||
|
.navbar {
|
||||||
|
width: 750rpx;
|
||||||
|
color: #000;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 9;
|
||||||
|
/* background-color: #f8f8f8; */
|
||||||
|
background-color: #3775f6;
|
||||||
|
|
||||||
|
.wrap {
|
||||||
|
position: relative;
|
||||||
|
background-color: #3775f6;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
height: 44px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 32rpx;
|
||||||
|
/* color: #000; */
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
height: 44px;
|
||||||
|
width: 44px;
|
||||||
|
font-size: 44rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
/* color: #000; */
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabs {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
line-height: 60rpx;
|
||||||
|
position: relative;
|
||||||
|
z-index: 9;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
padding: 20rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #1D2129;
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
color: #356899;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cursor {
|
||||||
|
position: absolute;
|
||||||
|
left: 13%;
|
||||||
|
bottom: 0;
|
||||||
|
width: 20%;
|
||||||
|
height: 6rpx;
|
||||||
|
padding: 0 50rpx;
|
||||||
|
background-color: #356899;
|
||||||
|
/* 过渡效果 */
|
||||||
|
transition: all 0.4s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// swiper
|
||||||
|
.swiper {
|
||||||
|
background-color: #f7f7f8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -8,6 +8,24 @@
|
|||||||
*/
|
*/
|
||||||
import { http } from '@/utils/http'
|
import { http } from '@/utils/http'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export const getMessage = (data: Object) => {
|
||||||
|
return http<any[]>({
|
||||||
|
method: 'POST',
|
||||||
|
url: '/heli/bdgzsomthing/getMessage',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const read = (id:any) => {
|
||||||
|
return http<any[]>({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/heli/bdgzsomthing/read?id=' + id,
|
||||||
|
data: {},
|
||||||
|
})
|
||||||
|
}
|
||||||
export const getApproveOrderAPI = (data: Object) => {
|
export const getApproveOrderAPI = (data: Object) => {
|
||||||
return http<any[]>({
|
return http<any[]>({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
@ -9,5 +9,5 @@
|
|||||||
// export const serviceDomain = 'https://nxhs.cjyx.cc'
|
// export const serviceDomain = 'https://nxhs.cjyx.cc'
|
||||||
// export const serviceDomain = 'https://star.hz-hl.com'
|
// export const serviceDomain = 'https://star.hz-hl.com'
|
||||||
// export const serviceDomain = 'http://222.71.165.187:9010'
|
// export const serviceDomain = 'http://222.71.165.187:9010'
|
||||||
export const serviceDomain = 'http://localhost:8080'
|
// export const serviceDomain = 'http://localhost:8080'
|
||||||
// export const serviceDomain = 'https://nxhs.cjyx.cc'
|
export const serviceDomain = 'https://nxhs.cjyx.cc'
|
||||||
|
@ -17,3 +17,10 @@ export const getHomeCategoryAPI = () => {
|
|||||||
url: '/system/auth/get-permission-info',
|
url: '/system/auth/get-permission-info',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getUnreadMessage = () => {
|
||||||
|
return http<CategoryItem[]>({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/heli/bdgzsomthing/unreadMessage',
|
||||||
|
})
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user