Commit 7fe1b9f8 authored by 刘怀志's avatar 刘怀志

feat(消息): 消息模块-1

parent 3dd01d04
...@@ -8,7 +8,13 @@ export function listPetmNotice(query) { ...@@ -8,7 +8,13 @@ export function listPetmNotice(query) {
params: query params: query
}) })
} }
export function sysMail(params) {
return request({
url: '/sysMail/queryByPagination',
method: 'get',
params
})
}
// 查询消息详细 // 查询消息详细
export function getPetmNotice(id) { export function getPetmNotice(id) {
return request({ return request({
......
{ {
"name" : "若依移动端", "name" : "若依移动端",
"appid" : "__UNI__25A9D80", "appid" : "__UNI__A3D4D74",
"description" : "", "description" : "",
"versionName" : "1.1.0", "versionName" : "1.1.0",
"versionCode" : "100", "versionCode" : "100",
......
<template> <template>
<view style="background-color: #fff;height: 100vh"> <view style="background-color: #fff;height: 100vh">
<ya-navbar title="消息中心" :left-icon="null" bg-style="#fff" :fixed="true" :title-style="titleStyle" /> <mine-navbar title="DHEC QMS" />
<view class="notice-container"> <view class="notice-container">
<!--顶部提示-->
<view v-if="tipsShow" class="topTips">
暂无可选消息
</view>
<!--顶部选择-->
<view v-if="!checkShow && !delShow" class="topContent">
<view class="topSelect">
<u-subsection
:list="topSelectList"
:current="queryNotice.isRead"
mode="subsection"
inactive-color="#343744"
@change="sectionChange"
/>
</view>
<view class="topButton">
<span v-if="queryNotice.isRead === 0" @click="toMark">选择</span>
<span v-else @click="toDelete">选择</span>
</view>
</view>
<view v-if="checkShow" class="topContent_read"> <!--顶部选择-->
<view style="width: 20%;" class="fontColor" @click="cancelMark"> <view class="top-tabs">
取消 <u-tabs :list="list1" lineWidth="90"
</view> lineColor="#333399"
<view style="text-align: right;width: 80%" class="fontColor" @click="setRead"> :activeStyle="{
标记已读 color: '#333399',
</view> }"
</view> :inactiveStyle="{
color: '#111111'}"
<view v-if="delShow" class="topContent_read"> @click="clickTabs"
<view style="width: 20%" class="fontColor" @click="cancelDel"> ></u-tabs>
取消
</view>
<view style="text-align: right;width: 80%" class="fontColor" @click="setDel">
删除
</view>
</view> </view>
<!--消息卡片--> <!--消息卡片-->
<view v-for="(item,key) in noticeList" :key="key" style="display: flex;background-color: #ffffff"> <view v-for="(item,key) in noticeList" :key="key" style="display: flex;background-color: #ffffff">
<!-- <view class="checkView" v-show="checkShow">-->
<view v-if="checkShow" class="checkView" @click="selectRead(item)"> <view v-if="checkShow" class="checkView" @click="selectRead(item)">
<u-checkbox-group v-model="item.checkStatus" @change="selectRead(item)"> <u-checkbox-group v-model="item.checkStatus" @change="selectRead(item)">
<u-checkbox <u-checkbox
...@@ -68,11 +42,11 @@ ...@@ -68,11 +42,11 @@
<view style="display: flex"> <view style="display: flex">
<u-icon v-if="item.isPlatform === '1'" size="24" :name="imageUrl + '/tmt-pic/pet-app/xiaoxi_icon_tuisong@2x.png'" /> <u-icon v-if="item.isPlatform === '1'" size="24" :name="imageUrl + '/tmt-pic/pet-app/xiaoxi_icon_tuisong@2x.png'" />
<u-icon v-else size="24" :name="imageUrl + '/tmt-pic/pet-app/xiaoxi_icon_xitong@2x.png'" /> <u-icon v-else size="24" :name="imageUrl + '/tmt-pic/pet-app/xiaoxi_icon_xitong@2x.png'" />
<view class="titleClass">{{ item.title }}</view> <view class="titleClass">{{ queryNotice.mesType === '1' ? '生产信息审批' : '基础数据审批' }}</view>
</view> </view>
<view class="subTitleClass">{{ item.subtitle }}</view> <view class="subTitleClass">{{ item.message }}</view>
<view class="timeClass"> <view class="timeClass">
{{ item.createTime !== undefined && item.createTime !== null ? parseTime(item.createTime, '{y}/{m}/{d} {h}:{i}') : '暂无数据' }} {{ item.updateDate !== undefined && item.updateDate !== null ? parseTime(item.updateDate, '{m}-{d} {h}:{i}:{s}') : '暂无数据' }}
</view> </view>
</view> </view>
</view> </view>
...@@ -84,7 +58,7 @@ ...@@ -84,7 +58,7 @@
</view> </view>
<view style="font-size: 26rpx;font-weight: 400;color: #666666;line-height: 30rpx;margin-top: 36rpx"> <view style="font-size: 26rpx;font-weight: 400;color: #666666;line-height: 30rpx;margin-top: 36rpx">
<text> <text>
{{ queryNotice.isRead === 0 ? '暂无未读消息': '暂无已读消息' }} {{ '暂无消息' }}
</text> </text>
</view> </view>
</view> </view>
...@@ -109,14 +83,20 @@ ...@@ -109,14 +83,20 @@
</template> </template>
<script> <script>
import { delPetmNotice, listPetmNotice, readPetmNotice, updatePetmNotice } from '../../api/system/petmNotice' import {delPetmNotice, listPetmNotice, readPetmNotice, sysMail, updatePetmNotice} from '../../api/system/petmNotice'
import { parseTime } from '../../api/utils/ruoyi' import { parseTime } from '../../api/utils/ruoyi'
import { imageUrl } from '../../config' import { imageUrl } from '../../config'
import MineNavbar from "../../components/mine-navbar/mineNavbar";
export default { export default {
name: 'Index', name: 'Index',
components: { MineNavbar },
data() { data() {
return { return {
list1: [{
name: '基础数据审批',
}, {
name: '生产信息审批',
}, ],
tipsShow: false, tipsShow: false,
loading: true, loading: true,
checkShow: false, checkShow: false,
...@@ -140,10 +120,10 @@ export default { ...@@ -140,10 +120,10 @@ export default {
topSelectValue: 0, topSelectValue: 0,
defaultPageSize: 10, defaultPageSize: 10,
queryNotice: { queryNotice: {
pageNum: 1, page: 1,
pageSize: 10, rows: 10,
receiverId: undefined, receiverId: undefined,
isRead: 0 mesType: '1'
}, },
noticeList: [], noticeList: [],
total: 0, total: 0,
...@@ -160,31 +140,25 @@ export default { ...@@ -160,31 +140,25 @@ export default {
readArrayId: [] readArrayId: []
} }
}, },
onShow() { created() {
const user = JSON.parse(uni.getStorageSync('user'))
console.log('user', user)
this.queryNotice.receiverId = user.userId
this.getPetmNoticeList() this.getPetmNoticeList()
// this.getUserOpenId()
}, },
methods: { methods: {
parseTime, clickTabs(item) {
sectionChange(index) { this.queryNotice.mesType = item === '基础数据审批' ? '1' : '2'
this.queryNotice.isRead = index
this.getPetmNoticeList() this.getPetmNoticeList()
}, },
parseTime,
getPetmNoticeList() { getPetmNoticeList() {
this.loading = true this.loading = true
listPetmNotice(this.queryNotice).then(res => { sysMail(this.queryNotice).then(res => {
if (res.code === 200) {
console.log('消息列表', res) console.log('消息列表', res)
this.noticeList = res.rows this.noticeList = res.rows
this.total = res.total this.total = res.total
if (this.queryNotice.pageSize * this.queryNotice.pageNum >= this.total) { if (this.queryNotice.rows * this.queryNotice.page >= this.total) {
this.loadStatus = 'nomore' this.loadStatus = 'nomore'
} }
this.loading = false this.loading = false
}
}) })
}, },
toMark() { toMark() {
...@@ -234,10 +208,10 @@ export default { ...@@ -234,10 +208,10 @@ export default {
}, },
onReachBottom() { onReachBottom() {
this.loadStatus = 'loading' this.loadStatus = 'loading'
if (this.queryNotice.pageSize * this.queryNotice.pageNum >= this.total) { if (this.queryNotice.rows * this.queryNotice.page >= this.total) {
this.loadStatus = 'nomore' this.loadStatus = 'nomore'
} else { } else {
this.queryNotice.pageSize += this.defaultPageSize this.queryNotice.rows += this.defaultPageSize
this.getPetmNoticeList() this.getPetmNoticeList()
this.loadStatus = 'loadmore' this.loadStatus = 'loadmore'
} }
...@@ -383,8 +357,9 @@ export default { ...@@ -383,8 +357,9 @@ export default {
} }
.notice-container { .notice-container {
width: 100%; width: 100%;
margin-top: 542rpx;
background-color: #fff; background-color: #fff;
min-height: calc(100vh - 160rpx); overflow-y: hidden;
} }
.topContent { .topContent {
display: flex; display: flex;
...@@ -511,20 +486,26 @@ export default { ...@@ -511,20 +486,26 @@ export default {
margin-right: 0 !important; margin-right: 0 !important;
} }
::v-deep .u-line-1 {
font-size: 24rpx !important;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400 !important;
color: #999BA1 !important;
line-height: 28rpx !important;
}
::v-deep .u-loading-page__warpper__loading-icon__img{ ::v-deep .u-loading-page__warpper__loading-icon__img{
width: 90rpx !important; width: 90rpx !important;
height: 90rpx !important; height: 90rpx !important;
} }
::v-deep .u-navbar--fixed { ::v-deep .u-tabs__wrapper__nav__item__text{
background-color: #fff !important; font-family: PingFangSC, PingFang SC;
font-weight: 500;
font-size: 28rpx;
}
.top-tabs{
display: flex;
justify-content: center;
align-items: center;
margin-top: 20rpx;
border-bottom: 2rpx solid #F2F2F2;
::v-deep .u-tabs{
width: 60%;
}
} }
//::v-deep .u-subsection { //::v-deep .u-subsection {
// background: black; // background: black;
......
...@@ -38,184 +38,6 @@ ...@@ -38,184 +38,6 @@
</view> </view>
</view> </view>
<!-- <view>
<view style="height: 16rpx;background: #F0F0F0;" />
</view>
<view class="second-section">
<view class=" justify-between">
<view class=" align-center">
<view class="third-card">
<view class="sub-title">我的账户</view>
<view v-if="cardListLength>0" class="container" @click="goMyAccount">
<text class="text">全部</text>
<u-icon name="arrow-right" color="#666666" size="20rpx" bold="true" />
</view>
</view>
<view class="rect" @touchmove.stop>
&lt;!&ndash; 会员卡集合模块&ndash;&gt;
<z-swiper v-if="cardListLength>0" v-model="cardList" :custom-style="{height:'300rpx'}" :options="options">
<z-swiper-item v-for="(item,index) in cardList" :key="index" :custom-style="slideCustomStyle">
<view class="rectangle" :style="{backgroundImage: `url(${baseUrl}${cardImage})`}">
<view class="card-item">
<view class="card-title">
<view class="card-title-left">
<image class="card-title-img" :src="baseUrl + item.hospitalPortrait" />
<text class="card-title-text">{{ item.hosName }}</text>
</view>
<view class="card-title-right">
<view v-show="user.ownersId!==null" class="flex align-center" @click="viewCode">
<text />
<image
:src="baseUrl+'/tmt-pic/pet-app/wode_icon_erweimabai@2x.png'"
class="twoImage"
/>
</view>
</view>
</view>
<view class="text-container">
<view>
<text class="money-single"></text>
<text class="money-text">{{ item.cardBalance ? moneyFormat(item.cardBalance) : '0.00' }}
</text>
</view>
<view class="text-btn" @click="goAccountDetails(item)">查看详情</view>
</view>
</view>
</view>
</z-swiper-item>
</z-swiper>
&lt;!&ndash; 没有会员卡添加会员卡&ndash;&gt;
<view v-else class="rectangleTwo">
<view style=" text-align: center;" @click="goAddCount">
<image
:src="baseUrl+'/tmt-pic/pet-app/wode_icon_tianjia@2x.png'"
style="width: 112rpx;height: 112rpx;"
/>
&lt;!&ndash; <text class="plus">+</text> &ndash;&gt;
<view class="text-container">
<text class="additional-text">添加我的账户</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="third-section">
<view class="justify-between">
<view class="align-center">
<view class="third-card">
<view class="sub-title">我的订单</view>
<view class="container" @click="openOrder({current:0,status:''})">
<text class="text">全部</text>
<u-icon name="arrow-right" color="#666666" size="20rpx" bold="true" />
</view>
</view>
<view style="display: flex; margin-top: 40rpx">
<view class="nav-bar" @click="openOrder({current:1,status:'1'})">
<image
:src="baseUrl+'/tmt-pic/pet-app/wode_icon_daifukuan@2x.png'"
style="width: 80rpx;height: 80rpx;"
/>
<text class="title">待付款</text>
</view>
<view class="nav-bar" @click="openOrder({current:2,status:'6'})">
<image
:src="baseUrl+'/tmt-pic/pet-app/wode_icon_daishouhuo@2x.png'"
style="width: 80rpx;height: 80rpx;"
/>
<text class="title">待收货</text>
</view>
<view class="nav-bar" @click="openOrder({current:3,status:'0'})">
<image
:src="baseUrl+'/tmt-pic/pet-app/wode_icon_daishiyong@2x.png'"
style="width: 80rpx;height: 80rpx;"
/>
<text class="title">待使用</text>
</view>
<view class="nav-bar" @click="openOrder({current:4,status:'2'})">
<image
:src="baseUrl+'/tmt-pic/pet-app/wode_icon_yiwancheng@2x.png'"
style="width: 80rpx;height: 80rpx;"
/>
<text class="title">已完成</text>
</view>
<view class="nav-bar" @click="openOrder({current:5,status:'3'})">
<image
:src="baseUrl+'/tmt-pic/pet-app/wode_icon_yishixiao@2x.png'"
style="width: 80rpx;height: 80rpx;"
/>
<text class="title">已失效</text>
</view>
</view>
</view>
</view>
</view>
<view style=" height: 1px; background: #efefef;margin: 0 32rpx;" />
<view class="card1" @click="handleToPet">
<view class="card1plus">
<view class="cardtitle">
<span>我的宠物</span>
</view>
<view style=" text-align: right;width: 100%;">
&lt;!&ndash; <view class="iconfont icon-right" ></view> &ndash;&gt;
<image
:src="baseUrl+'/tmt-pic/pet-app/wode_icon_rjiantou2@2x.png'"
style="width:48rpx ;height: 48rpx;"
/>
</view>
</view>
</view>
<view class="card1" @click="toastaction">
<view class="card1plus">
<view class="cardtitle">
<span>发票抬头</span>
</view>
<view style=" text-align: right;width: 100%;">
<image
:src="baseUrl+'/tmt-pic/pet-app/wode_icon_rjiantou2@2x.png'"
style="width:48rpx ;height: 48rpx;"
/>
</view>
</view>
</view>
<view class="card1" @click="callHospital">
<view class="card1plus">
<view class="cardtitle">
<span>客服中心</span>
</view>
<view style=" text-align: right;width: 100%;">
<image
:src="baseUrl+'/tmt-pic/pet-app/wode_icon_rjiantou2@2x.png'"
style="width:48rpx ;height: 48rpx;"
/>
</view>
</view>
</view>
<view class="card1" @click="handleSetting">
<view class="card1plus">
<view class="cardtitle">
<span>更多设置</span>
</view>
<view style=" text-align: right;width: 100%;">
<image
:src="baseUrl+'/tmt-pic/pet-app/wode_icon_rjiantou2@2x.png'"
style="width:48rpx ;height: 48rpx;"
/>
</view>
</view>
</view>-->
<!-- 二维码弹出层--> <!-- 二维码弹出层-->
<view> <view>
<u-popup :show="showCode" mode="center" :round="10" @close="close"> <u-popup :show="showCode" mode="center" :round="10" @close="close">
...@@ -242,33 +64,13 @@ ...@@ -242,33 +64,13 @@
</view> </view>
</u-popup> </u-popup>
</view> </view>
<view catchtouchmove="true">
<u-modal
:show="show"
width="500rpx"
title="联系医院"
:show-cancel-button="true"
confirm-color="#62AE79"
@cancel="cancelModel"
@confirm="confirmCall"
>
<view class="slot-content">
{{ content }}
<text style="color: #F7A64A ;">{{ hosConfig.phone }}</text>
</view>
</u-modal>
</view>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
<script> <script>
import { getUserProfile } from '@/api/system/user.js'
import drawQrcode from '../../utils/dist_weapp.qrcode.esm'
import { getPetOwners } from '../../api/system/pet'
import { myAccountList } from '../../api/system/my_account'
import config from '@/config' import config from '@/config'
import { listBaseConfig } from '../../api/system/baseConfig'
import MineNavbar from '../../components/mine-navbar/mineNavbar.vue' import MineNavbar from '../../components/mine-navbar/mineNavbar.vue'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
...@@ -386,106 +188,16 @@ export default { ...@@ -386,106 +188,16 @@ export default {
url: '/pages/my_account/account' url: '/pages/my_account/account'
}) })
}, },
// 去添加账户
goAddCount() {
uni.navigateTo({
url: '/pages/my_account/select-count'
})
},
// 去账户详情页面
goAccountDetails(data) {
console.log(data)
uni.navigateTo({
url: '/pages/my_account/account-detail-only?cardId=' + data.id
})
},
// 创建二维码
createQrcode: function() {
var that = this
const query = wx.createSelectorQuery()
query.select('#myQrcode')
.fields({
node: true,
size: true
})
.exec((res) => {
var canvas = res[0].node
// 调用方法drawQrcode生成二维码
drawQrcode({
canvas: canvas,
canvasId: 'myQrcode',
width: 260,
padding: 30,
background: '#ffffff',
foreground: '#000000',
text: that.form.ownersId
})
// 获取临时路径(得到之后,想干嘛就干嘛了)
wx.canvasToTempFilePath({
canvasId: 'myQrcode',
canvas: canvas,
x: 0,
y: 0,
width: 260,
height: 260,
destWidth: 260,
destHeight: 260,
success(res) {
console.log('二维码临时路径:', res.tempFilePath)
},
fail(res) {
console.error(res)
}
})
})
},
close() { close() {
this.showCode = false this.showCode = false
}, },
// 点击二维码
viewCode() {
this.createQrcode()
this.showCode = true
},
handleToInfo() {
this.$tab.navigateTo('/pages/mine/info/index')
},
handleToPet() {
this.$tab.navigateTo('/pages/mine/pet/index')
},
handleToEditInfo() {
this.$tab.navigateTo('/pages/mine/info/edit')
},
handleToSetting() {
this.$tab.navigateTo('/pages/mine/setting/index')
},
handleToLogin() {
this.$tab.reLaunch('/pages/login')
},
openOrder(value) {
this.$tab.navigateTo('/pages/order/list?current=' + value.current + '&status=' + value.status)
},
handleToAvatar() { handleToAvatar() {
this.$tab.navigateTo('/pages/mine/avatar/index') this.$tab.navigateTo('/pages/mine/avatar/index')
}, },
handleHelp() { handleHelp() {
this.$tab.navigateTo('/pages/mine/help/index') this.$tab.navigateTo('/pages/mine/help/index')
}, }
handleSetting() {
this.$tab.navigateTo('/pages/mine/setting/index')
},
handleAbout() {
this.$tab.navigateTo('/pages/mine/about/index')
},
handleJiaoLiuQun() {
this.$modal.showToast('QQ群:133713780')
},
handleBuilding() {
this.$modal.showToast('模块建设中~')
},
} }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment