123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- <template>
- <view class="switchRecord-container">
- <!--顶部导航栏-->
- <scroll-view class="scroll-view" scroll-x="true" @scroll="scroll">
- <view class="scroll-view-item" v-for="(tab,index) in tabBars" :key="tab.id" :id="tab.id" :class="navIndex==index ? 'activite' : ''" @tap="checkIndex(index)">
- {{tab.name}}
- </view>
- </scroll-view>
- <!-- 内容 -->
- <swiper :current="navIndex" @change="tabChange" class="swiper_content">
- <swiper-item class="swiper_item">
- <FeedbackList :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
- </swiper-item>
- <swiper-item class="swiper_item">
- <FeedbackList :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
- </swiper-item>
- <swiper-item class="swiper_item">
- <FeedbackList :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
- </swiper-item>
- <swiper-item class="swiper_item">
- <FeedbackList :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
- </swiper-item>
- </swiper>
- <!-- 新增 -->
- <view class="feedback-add-icon" @click="onClickAdd">
- <image class="add-icon" src="/static/image/add-icon.svg" mode="aspectFit"></image>
- <view class="add-title">登记</view>
- </view>
- <!-- 脚注 -->
- <view class="footnote_content">
- <view>本服务由重庆两江新区社会发展局提供</view>
- <view class="footnote_phone">服务咨询热线:<view class="phone_text" @click="makeCall">023-67685085</view></view>
- </view>
- </view>
- </template>
- <script setup lang="ts">
- import { ref, onMounted } from "vue"
- import * as link from '@/lib/link'
- import rest from '@/stores/rest'
- import { onLoad, onShow } from "@dcloudio/uni-app";
- import { aesEncrypt, aesDecrypt } from "@/lib/encryption";
- import { formatDate } from '@/lib/util'
- import FeedbackList from './FeedbackList.vue'
-
- import { useUserStore } from '@/lib/store';
- import { storeToRefs } from 'pinia';
- const store = useUserStore();
- const { globalParameter } = storeToRefs(store);
-
- const queryParams = ref({
- pageNo: 1,
- pageSize: 10,
- fkzt: '',
- zjhm: '',
- })
- const scrollTop = ref(0)
- const navIndex = ref(0)
- const tabBars = ref([
- {
- name:'全部',
- id: 0
- },
- {
- name:'待受理',
- id: 1
- },
- {
- name:'受理中 ',
- id: 2
- },
- {
- name:'已办结 ',
- id: 3
- }
- ])
-
- const scroll = (e: any) => {
- console.log("scroll",e);
- scrollTop.value = e.detail.scrollTop;
- };
- const checkIndex = (idx:number) => {
- if (navIndex.value !== idx){
- navIndex.value = idx;
- switch (idx) {
- case 0:
- queryParams.value.fkzt = ''
- break;
- case 1:
- queryParams.value.fkzt = '1'
- break;
- case 2:
- queryParams.value.fkzt = '2'
- break;
- case 3:
- queryParams.value.fkzt = '3'
- break;
- }
- queryParams.value.pageNo = 1
- list.value = []
- getList()
- }
- }
- const tabChange = async(e:any) => {
- let _idx = e.detail.current
- checkIndex(_idx)
- }
-
- const listArray = ref([])
- const list = ref() //处方列表
- const total = ref(0)
- const status = ref('loading')
-
- const getList = async () => {
- try {
- // loaded.value = true;
- let res = await rest.get('/zyyp/feedback/page', queryParams.value,globalParameter.value.authCode)
- let _list = res.list
-
-
- if (queryParams.value.pageNo === 1) {
- list.value = _list;
- } else {
- list.value = list.value.concat(_list);
- }
- getFormattedData(list.value)
- total.value = res.total
- if (res.total && queryParams.value.pageNo >= total.value / queryParams.value.pageSize) {
- status.value = "noMore"
- }
-
- } catch (e) {
- } finally {
- }
- }
-
-
- const titleArray = [
- { title: '办件编号', key: 'id' },
- { title: '登记时间', key: 'createTime' },
- ];
-
- const getFormattedData = (listData) => {
- const formattedData = listData.map(item => {
- const formattedItem = titleArray.map(titleItem => {
- let value = item[titleItem.key];
- if (titleItem.key === 'createTime') {
- value = formatDate(item[titleItem.key], '{y}-{m}-{d} {h}:{i}:{s}');
- }
- return {
- title: titleItem.title,
- value: value
- };
- });
- return {
- ...item,
- formattedData: formattedItem ,
- };
- });
- listArray.value = formattedData;
- console.log("查询",listArray.value)
- };
-
- const onNextPage = ()=> {
- if (!list.value || queryParams.value.pageNo > (total.value / queryParams.value.pageSize)) {
- return false;
- }
- if (queryParams.value.pageNo < total.value / queryParams.value.pageSize) {
- status.value = "loading";
- } else {
- status.value = "noMore"
- return;
- }
- queryParams.value.pageNo++;
- getList();
- }
-
- const makeCall = ()=> {
- window.location.href = 'tel:023-67685085';
- }
-
- const onClick = (e)=> {
- link.goBJDetails(e.id)
- }
- const onClickAdd = ()=> {
- link.goBJDetails()
- }
-
- onLoad((data) => {
- alert("onLoad:" + JSON.stringify(globalParameter.value))
- queryParams.value.zjhm = aesDecrypt(data.hzsfzh)
- let zjhm = aesDecrypt(data.hzsfzh)
- let name = aesDecrypt(data.hzxm)
- globalParameter.value.zjhm = zjhm
- globalParameter.value.userName = name
- })
-
- onShow(() => {
- alert("onShow:" + JSON.stringify(globalParameter.value))
- queryParams.value.pageNo = 1;
- getList()
- })
- onMounted(() => {
- alert("onMounted:" + JSON.stringify(globalParameter.value))
- });
- </script>
- <style lang="scss">
- .switchRecord-container {
- display: flex;
- background-color: #f2f2f2;
- flex-direction: column;
- height: calc(100vh - 84rpx);
- position: relative;
- .scroll-view {
- background-color: #fff;
- color: #3D3D3D;
- display: flex;
- overflow-x: auto;
- white-space: nowrap;
- box-sizing: border-box;
- }
- .scroll-view-item {
- display: inline-block;
- width: calc(100% / 4);
- height: 88rpx;
- line-height: 88rpx;
- text-align: center;
- font-size: 24rpx;
- font-weight: 400;
- position: relative; /* 添加相对定位 */
- box-sizing: border-box; /* 确保边框在总宽度内计算 */
- &::after {
- content: '';
- display: inline-block;
- width: 50%; /* 默认宽度为50% */
- margin: 0 auto;
- position: absolute;
- bottom: 0;
- left: 25%; /* 使其居中 */
- height: 2rpx; /* 默认未选中的高度 */
- background: #fff; /* 默认未选中的颜色 */
- z-index: 1;
- }
- &.activite {
- font-weight: 600;
- color: #1E92F0;
- &::after {
- background: #1E92F0;
- height: 4rpx;
- width: 50%;
- }
- }
- }
- .swiper_content {
- background-color: #f2f2f2;
- flex: 1;
- }
- .feedback-add-icon {
- position: absolute;
- bottom: 300rpx;
- right: 32rpx;
- width: 120rpx;
- height: 120rpx;
- @include flex-center;
- flex-direction: column;
- border-radius: 50%;
- background-color: #fff;
- box-shadow: 0px 4px 10px 0px rgba(216, 216, 216, 0.8),inset 0px 4px 10px 0px rgba(216, 216, 216, 0.3);
- .add-icon {
- margin-top: 16rpx;
- width: 55rpx;
- height: 55rpx;
- }
- .add-title {
- color: #1E92F0;
- font-size: 24rpx;
- font-weight: 600;
- }
- }
- .footnote_content {
- background-color: #F6F7F8;
- @include flex-center;
- height: 136rpx;
- flex-direction: column;
- font-weight: 400;
- font-size: 24rpx;
- color: #B3B5B9;
- line-height: 40rpx;
- .footnote_phone {
- display: flex;
- .phone_text {
- color: #1E92F0;
- }
- }
- }
- }
- </style>
|