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

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

parent 3dd01d04
......@@ -8,7 +8,13 @@ export function listPetmNotice(query) {
params: query
})
}
export function sysMail(params) {
return request({
url: '/sysMail/queryByPagination',
method: 'get',
params
})
}
// 查询消息详细
export function getPetmNotice(id) {
return request({
......
{
"name" : "若依移动端",
"appid" : "__UNI__25A9D80",
"appid" : "__UNI__A3D4D74",
"description" : "",
"versionName" : "1.1.0",
"versionCode" : "100",
......
<template>
<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 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>
<view style="text-align: right;width: 80%" class="fontColor" @click="setRead">
标记已读
</view>
</view>
<view v-if="delShow" class="topContent_read">
<view style="width: 20%" class="fontColor" @click="cancelDel">
取消
</view>
<view style="text-align: right;width: 80%" class="fontColor" @click="setDel">
删除
</view>
<!--顶部选择-->
<view class="top-tabs">
<u-tabs :list="list1" lineWidth="90"
lineColor="#333399"
:activeStyle="{
color: '#333399',
}"
:inactiveStyle="{
color: '#111111'}"
@click="clickTabs"
></u-tabs>
</view>
<!--消息卡片-->
<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)">
<u-checkbox-group v-model="item.checkStatus" @change="selectRead(item)">
<u-checkbox
......@@ -68,11 +42,11 @@
<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-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 class="subTitleClass">{{ item.subtitle }}</view>
<view class="subTitleClass">{{ item.message }}</view>
<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>
......@@ -84,7 +58,7 @@
</view>
<view style="font-size: 26rpx;font-weight: 400;color: #666666;line-height: 30rpx;margin-top: 36rpx">
<text>
{{ queryNotice.isRead === 0 ? '暂无未读消息': '暂无已读消息' }}
{{ '暂无消息' }}
</text>
</view>
</view>
......@@ -109,14 +83,20 @@
</template>
<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 { imageUrl } from '../../config'
import MineNavbar from "../../components/mine-navbar/mineNavbar";
export default {
name: 'Index',
components: { MineNavbar },
data() {
return {
list1: [{
name: '基础数据审批',
}, {
name: '生产信息审批',
}, ],
tipsShow: false,
loading: true,
checkShow: false,
......@@ -140,10 +120,10 @@ export default {
topSelectValue: 0,
defaultPageSize: 10,
queryNotice: {
pageNum: 1,
pageSize: 10,
page: 1,
rows: 10,
receiverId: undefined,
isRead: 0
mesType: '1'
},
noticeList: [],
total: 0,
......@@ -160,31 +140,25 @@ export default {
readArrayId: []
}
},
onShow() {
const user = JSON.parse(uni.getStorageSync('user'))
console.log('user', user)
this.queryNotice.receiverId = user.userId
created() {
this.getPetmNoticeList()
// this.getUserOpenId()
},
methods: {
parseTime,
sectionChange(index) {
this.queryNotice.isRead = index
clickTabs(item) {
this.queryNotice.mesType = item === '基础数据审批' ? '1' : '2'
this.getPetmNoticeList()
},
parseTime,
getPetmNoticeList() {
this.loading = true
listPetmNotice(this.queryNotice).then(res => {
if (res.code === 200) {
sysMail(this.queryNotice).then(res => {
console.log('消息列表', res)
this.noticeList = res.rows
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.loading = false
}
})
},
toMark() {
......@@ -234,10 +208,10 @@ export default {
},
onReachBottom() {
this.loadStatus = 'loading'
if (this.queryNotice.pageSize * this.queryNotice.pageNum >= this.total) {
if (this.queryNotice.rows * this.queryNotice.page >= this.total) {
this.loadStatus = 'nomore'
} else {
this.queryNotice.pageSize += this.defaultPageSize
this.queryNotice.rows += this.defaultPageSize
this.getPetmNoticeList()
this.loadStatus = 'loadmore'
}
......@@ -383,8 +357,9 @@ export default {
}
.notice-container {
width: 100%;
margin-top: 542rpx;
background-color: #fff;
min-height: calc(100vh - 160rpx);
overflow-y: hidden;
}
.topContent {
display: flex;
......@@ -511,20 +486,26 @@ export default {
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{
width: 90rpx !important;
height: 90rpx !important;
}
::v-deep .u-navbar--fixed {
background-color: #fff !important;
::v-deep .u-tabs__wrapper__nav__item__text{
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 {
// background: black;
......
......@@ -38,184 +38,6 @@
</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>
<u-popup :show="showCode" mode="center" :round="10" @close="close">
......@@ -242,33 +64,13 @@
</view>
</u-popup>
</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>
</view>
</template>
<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 { listBaseConfig } from '../../api/system/baseConfig'
import MineNavbar from '../../components/mine-navbar/mineNavbar.vue'
import { mapGetters } from 'vuex'
export default {
......@@ -386,106 +188,16 @@ export default {
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() {
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() {
this.$tab.navigateTo('/pages/mine/avatar/index')
},
handleHelp() {
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>
......
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