消息通知,支付页面优化
This commit is contained in:
parent
70154b9c7c
commit
b737bf73d6
3
app.json
3
app.json
@ -20,7 +20,8 @@
|
||||
"pages/mine/mineAccount/invoiceInfo/invoiceInfo",
|
||||
"pages/mine/mineAccount/makeInvoice/makeInvoice",
|
||||
"pages/mine/mineAccount/invoiceOrder/invoiceOrder",
|
||||
"pages/mine/mineAccount/invoiceRecordDetail/invoiceRecordDetail"
|
||||
"pages/mine/mineAccount/invoiceRecordDetail/invoiceRecordDetail",
|
||||
"pages/mine/mineAccount/mineMsgNotice/mineMsgNotice"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTextStyle": "black",
|
||||
|
5
app.wxss
5
app.wxss
@ -193,9 +193,8 @@
|
||||
}
|
||||
|
||||
.divider-v {
|
||||
margin-top: 5rpx;
|
||||
width: 90%;
|
||||
height: 3rpx;
|
||||
width: 95%;
|
||||
height: 1rpx;
|
||||
background-color: var(--divider-color);
|
||||
align-self: center;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
<view class="tabbar">
|
||||
<view class="tabbar-item" wx:for="{{tabList}}" wx:key="index" bind:tap="switchTab" data-index="{{index}}">
|
||||
<view wx:if="{{item.hasMsg}}" style="margin-left: 25px;border-radius: 15rpx;width: 15rpx;height: 15rpx;background-color: var(--primary-color);position: absolute;top: 22rpx;"></view>
|
||||
<image class="tabbar-icon" src="{{item.selected? item.selectedIconPath : item.iconPath}}"></image>
|
||||
<view class="tabbar-text" style="color: {{item.selected? selectedColor : color}}">{{item.text}}</view>
|
||||
</view>
|
||||
|
@ -9,9 +9,14 @@ App({
|
||||
localAssets: "/static/images",
|
||||
slideBtns: [],
|
||||
appTitle: 'AI喵著',
|
||||
appUrl: appUrl
|
||||
appUrl: appUrl,
|
||||
onlyDelBtns: []
|
||||
},
|
||||
onLaunch() {
|
||||
this.globalData.onlyDelBtns = [{
|
||||
text: '删除',
|
||||
src: this.globalData.localAssets + "/ic_delete_red.png" // icon的路径
|
||||
}]
|
||||
this.globalData.slideBtns = [{
|
||||
text: '编辑',
|
||||
src: this.globalData.localAssets + "/ic_edit_blue.png" // icon的路径
|
||||
|
@ -20,6 +20,9 @@ const apiPath = {
|
||||
canClaimsCoupons: '/api/coupon/list-can-claim', //获取可以申领的优惠卷
|
||||
saveCoupons: '/api/coupon/user/save', //领取优惠卷
|
||||
minePayRecord: '/api/account/listpage-item/self',
|
||||
mineMsgNotice: '/api/user-msg/listpage-simple/self', //获取消息通知
|
||||
readMsgNotice: '/api/user-msg/update-read/self', //标记读取消息
|
||||
deleteMsgNotice: '/api/user-msg/remove/self/{ids}', //删除消息通知
|
||||
}
|
||||
class UserService {
|
||||
static doLogin(data) {
|
||||
@ -85,6 +88,19 @@ class UserService {
|
||||
static doSaveCoupons(data) {
|
||||
return request(apiPath.saveCoupons, "POST", data)
|
||||
}
|
||||
//获取消息通知
|
||||
static doGetMineMsgNotice(data) {
|
||||
return request(apiPath.mineMsgNotice, "GET", data)
|
||||
}
|
||||
//标记读取状态
|
||||
static doReadMineMsgNotice(data) {
|
||||
return request(apiPath.readMsgNotice, 'PUT', data)
|
||||
}
|
||||
//删除消息通知
|
||||
static doDeleteMineMsgNotice(id) {
|
||||
const path = apiPath.deleteMsgNotice.replace('{ids}', id)
|
||||
return request(path, 'DELETE')
|
||||
}
|
||||
}
|
||||
|
||||
export default UserService;
|
@ -495,7 +495,7 @@ Page({
|
||||
wx.hideLoading()
|
||||
_self.setData({
|
||||
showError: true,
|
||||
errorHint: '未查询到相关推荐的系统名称,请重新输入'
|
||||
errorHint: err.msg ? err.msg : '未查询到相关推荐的系统名称,请重新输入'
|
||||
})
|
||||
console.log(err)
|
||||
})
|
||||
|
@ -112,6 +112,10 @@ Page({
|
||||
currentBagTab: e.currentTarget.dataset.value
|
||||
})
|
||||
this.doGetPackageList(this.data.currentBagTab)
|
||||
wx.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
})
|
||||
},
|
||||
//切换支付方式
|
||||
doChangePayWay(e) {
|
||||
|
@ -57,10 +57,11 @@
|
||||
<view class="bag-item">
|
||||
<view class="bag-item-title-box">
|
||||
<view class="p-title">{{item.packageName}}</view>
|
||||
<view class="sum">{{item.packageMoney/100}}</view>
|
||||
<view class="desc">{{item.packageDescription}}</view>
|
||||
|
||||
</view>
|
||||
<view class="bag-item-desc-box">
|
||||
<view class="desc">{{item.packageDescription}}</view>
|
||||
<rich-text class="num" nodes="{{tools.moneyTxt(10,item.packageMoney/100)}}"></rich-text>
|
||||
<view class="btn" bind:tap="chooseBag" data-value="{{item}}">选购</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -75,3 +76,4 @@
|
||||
|
||||
<mp-toptips msg="{{errorHint}}" type="error" show="{{showError}}"></mp-toptips>
|
||||
<mp-toptips msg="{{successHint}}" type="success" show="{{showSuccess}}"></mp-toptips>
|
||||
<wxs src="../../../utils/comm.wxs" module="tools"></wxs>
|
@ -121,8 +121,8 @@
|
||||
|
||||
.tab-select {
|
||||
font-size: 20rpx;
|
||||
color: black;
|
||||
background-color: var(--bg-primary-shallow-color);
|
||||
color: var(--text-color);
|
||||
background-color: var(--bg-primary-deep-color);
|
||||
text-align: center;
|
||||
padding: 5rpx 30rpx;
|
||||
white-space: nowrap;
|
||||
@ -193,9 +193,10 @@
|
||||
|
||||
.bag-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-direction: row;
|
||||
border: 1rpx solid var(--divider-color);
|
||||
padding: 20rpx;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.bag-item:nth-of-type(n+2) {
|
||||
@ -207,9 +208,8 @@
|
||||
|
||||
.bag-item-title-box {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.p-title {
|
||||
@ -239,10 +239,9 @@
|
||||
|
||||
.bag-item-desc-box {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
margin-top: 2px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.bag-item-desc-box .desc {
|
||||
|
@ -22,6 +22,8 @@ Page({
|
||||
localAssets: app.globalData.localAssets,
|
||||
appTitle: app.globalData.appTitle,
|
||||
statusBarHeight: statusBarHeight,
|
||||
menuRight: 0,
|
||||
hasMsg: false,
|
||||
navBarHeight: navBarHeight,
|
||||
totalHeight: navBarHeight, // 导航栏总高度
|
||||
contentHeight: windowHeight,
|
||||
@ -88,14 +90,16 @@ Page({
|
||||
"text": "首页",
|
||||
"iconPath": app.globalData.localAssets + "/ic_home_normal.png",
|
||||
"selectedIconPath": app.globalData.localAssets + "/ic_home_select.png",
|
||||
"selected": true
|
||||
"selected": true,
|
||||
"hasMsg": false,
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/mine/mineIndex/mine",
|
||||
"text": "我的",
|
||||
"iconPath": app.globalData.localAssets + "/ic_mine_normal.png",
|
||||
"selectedIconPath": app.globalData.localAssets + "/ic_mine_select.png",
|
||||
"selected": false
|
||||
"selected": false,
|
||||
"hasMsg": false
|
||||
}
|
||||
],
|
||||
},
|
||||
@ -119,6 +123,41 @@ Page({
|
||||
}
|
||||
this.countViewHeight()
|
||||
this.getMineInfo()
|
||||
//设置通知图标
|
||||
const rect = wx.getMenuButtonBoundingClientRect()
|
||||
this.setData({
|
||||
menuRight: rect.width + 5
|
||||
})
|
||||
//获取消息通知
|
||||
this.getMsgNotice()
|
||||
},
|
||||
//消息通知
|
||||
getMsgNotice() {
|
||||
const data = {
|
||||
page: 1,
|
||||
rows: 1,
|
||||
isRead: 0,
|
||||
keywords: ''
|
||||
}
|
||||
const _self = this
|
||||
UserApi.doGetMineMsgNotice(data)
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
if (res.rows && res.rows.length > 0) {
|
||||
_self.setData({
|
||||
'tabList[1].hasMsg': true
|
||||
})
|
||||
} else {
|
||||
_self.setData({
|
||||
'tabList[1].hasMsg': false
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
_self.setData({
|
||||
'tabList[1].hasMsg': false
|
||||
})
|
||||
})
|
||||
},
|
||||
//获取我的个人信息
|
||||
getMineInfo() {
|
||||
@ -140,6 +179,7 @@ Page({
|
||||
this.setData({
|
||||
tabList
|
||||
});
|
||||
this.getMsgNotice()
|
||||
},
|
||||
//计算剩余高度
|
||||
countViewHeight() {
|
||||
|
@ -2,8 +2,10 @@
|
||||
<view class="bg-title" style="position: absolute;height: 500rpx;width: 100vw;background-image: url({{imgAssets}}/main_bg.png);"></view>
|
||||
<view style="position: relative;top:0;left:0;">
|
||||
<view class="title-box" id="title-box">
|
||||
<view class="custom-navbar" style="height: {{totalHeight}}px; padding-top: {{statusBarHeight}}px;justify-content: flex-start;color: var(--white-color);">
|
||||
<view class="custom-navbar" style="height: {{totalHeight}}px; padding-top: {{statusBarHeight}}px;justify-content: space-between;color: var(--white-color);">
|
||||
<view class="navbar-title">{{appTitle}}</view>
|
||||
<view wx:if="{{hasMsg}}" style="margin-right:{{menuRight}}px;" class="msg-info-box icon-horn-ind">
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="title-func">
|
||||
|
@ -28,6 +28,18 @@
|
||||
padding: 0rpx 30rpx;
|
||||
}
|
||||
|
||||
.msg-info-box {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.notice-point {
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
border-radius: 2rpx;
|
||||
background-color: var(--red-color);
|
||||
}
|
||||
|
||||
.title-func {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@ -248,12 +260,12 @@
|
||||
}
|
||||
|
||||
.status-gray {
|
||||
background-color: var(--gray-color-light);
|
||||
background-color: var(--bg-gray-deep-color);
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.status-green {
|
||||
background-color: var(--green-color-light);
|
||||
background-color: var(--bg-green-status-deep-color);
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
@ -263,7 +275,7 @@
|
||||
}
|
||||
|
||||
.status-red {
|
||||
background-color: var(--red-color-light);
|
||||
background-color: var(--bg-red-deep-color);
|
||||
color: var(--white-color);
|
||||
}
|
||||
|
||||
|
186
pages/mine/mineAccount/mineMsgNotice/mineMsgNotice.js
Normal file
186
pages/mine/mineAccount/mineMsgNotice/mineMsgNotice.js
Normal file
@ -0,0 +1,186 @@
|
||||
// pages/mine/mineAccount/mineMsgNotice/mineMsgNotice.js
|
||||
import UserApi from '../../../../net/api/userApi'
|
||||
const app = getApp()
|
||||
const deviceInfo = wx.getDeviceInfo()
|
||||
const screenInfo = wx.getWindowInfo();
|
||||
const statusBarHeight = screenInfo.statusBarHeight; // 状态栏高度
|
||||
const navBarHeight = deviceInfo.platform == 'IOS' ? 48 : 50; // 导航栏高度(iOS 为 44px,Android 为 48px)
|
||||
const windowHeight = screenInfo.windowHeight - navBarHeight - statusBarHeight; //可用内容高度
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
currentStatus: '',
|
||||
height: windowHeight,
|
||||
onlyDelBtns: app.globalData.onlyDelBtns,
|
||||
msgList: [], //订单列表
|
||||
pageData: {
|
||||
page: 1,
|
||||
rows: 10,
|
||||
isRead: '', //默认已读
|
||||
}, //检索参数
|
||||
loadingState: 'loading', //加载状态
|
||||
listRefreshTrig: false, //list刷新状态
|
||||
isLoadMore: false, //加载更多的状态
|
||||
hasMore: true, //是否有更多数据
|
||||
keywords: '', //搜索关键字
|
||||
msgType: 'info',
|
||||
msgHint: '',
|
||||
msgShow: false
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
wx.setNavigationBarTitle({
|
||||
title: '消息通知',
|
||||
})
|
||||
wx.setNavigationBarColor({
|
||||
frontColor: '#000000', // 必写项,字体颜色仅支持#ffffff和#000000
|
||||
backgroundColor: '#F0F0F0', // 传递的颜色值,仅支持十六进制颜色
|
||||
animation: { // 可选项
|
||||
duration: 500,
|
||||
timingFunc: 'easeIn'
|
||||
}
|
||||
})
|
||||
this.doRefreshList()
|
||||
},
|
||||
//tab切换
|
||||
doChangeStatus(e) {
|
||||
const value = e.currentTarget.dataset.value
|
||||
this.setData({
|
||||
currentStatus: value
|
||||
})
|
||||
this.doRefreshList()
|
||||
},
|
||||
//下拉刷新
|
||||
doRefreshList() {
|
||||
const _self = this
|
||||
_self.setData({
|
||||
listRefreshTrig: true,
|
||||
loadingState: 'loading',
|
||||
hasMore: true,
|
||||
'pageData.page': 1,
|
||||
'pageData.isRead': _self.data.currentStatus,
|
||||
isLoadMore: false
|
||||
})
|
||||
_self.doGetMineMsgNotice(true)
|
||||
},
|
||||
|
||||
//加载更多
|
||||
doLoadMore() {
|
||||
//判断是否正在加载中 与是否存在更多数据
|
||||
const _self = this
|
||||
if (_self.data.isLoadMore || !_self.data.hasMore) {
|
||||
return
|
||||
}
|
||||
_self.setData({
|
||||
isLoadMore: true,
|
||||
'pageData.page': ++_self.data.pageData.page,
|
||||
'pageData.isRead': _self.data.currentStatus
|
||||
})
|
||||
_self.doGetMineMsgNotice(false)
|
||||
},
|
||||
//获取我的优惠卷
|
||||
doGetMineMsgNotice(isRefresh) {
|
||||
const _self = this
|
||||
_self.setData({
|
||||
msgList: isRefresh ? [] : _self.data.msgList,
|
||||
loadingState: isRefresh ? 'loading' : ''
|
||||
})
|
||||
UserApi.doGetMineMsgNotice(_self.data.pageData)
|
||||
.then(res => {
|
||||
var status = 'success'
|
||||
status = res.rows && res.rows.length > 0 ? 'success' : 'empty'
|
||||
_self.setData({
|
||||
loadingState: isRefresh ? status : '',
|
||||
msgList: _self.data.msgList.concat(res.rows),
|
||||
listRefreshTrig: false,
|
||||
isLoadMore: false
|
||||
})
|
||||
_self.setData({
|
||||
hasMore: _self.data.msgList.length < res.total
|
||||
})
|
||||
}, err => {
|
||||
_self.setData({
|
||||
loadingState: 'error',
|
||||
listRefreshTrig: false,
|
||||
isLoadMore: false,
|
||||
hasMore: true
|
||||
})
|
||||
})
|
||||
},
|
||||
readItem(e) {
|
||||
const item = e.currentTarget.dataset.value
|
||||
const _self = this
|
||||
if (item.isRead == 1) {
|
||||
return
|
||||
}
|
||||
wx.showLoading({
|
||||
title: '加载中...',
|
||||
})
|
||||
const ids = {
|
||||
ids: [item.userMsgId]
|
||||
}
|
||||
UserApi.doReadMineMsgNotice(ids)
|
||||
.then(res => {
|
||||
wx.hideLoading()
|
||||
_self.doRefreshList()
|
||||
})
|
||||
.catch(err => {
|
||||
wx.hideLoading()
|
||||
_self.setData({
|
||||
msgHint: err.msg ? err.msg : '读取失败,请稍后重试',
|
||||
msgType: 'error',
|
||||
msgShow: true
|
||||
})
|
||||
})
|
||||
},
|
||||
slideButtonTap(e) {
|
||||
const item = e.currentTarget.dataset.value
|
||||
const index = e.detail.index
|
||||
if (index == 0) {
|
||||
//显示删除
|
||||
this.showDel(item)
|
||||
}
|
||||
},
|
||||
showDel(item) {
|
||||
const _self = this
|
||||
wx.showModal({
|
||||
title: '警告',
|
||||
content: '确定要删除该消息吗?',
|
||||
complete: (res) => {
|
||||
if (res.confirm) {
|
||||
_self.doDelMsg(item)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
doDelMsg(item) {
|
||||
const _self = this
|
||||
wx.showLoading({
|
||||
title: '删除中...',
|
||||
})
|
||||
UserApi.doDeleteMineMsgNotice(item.userMsgId)
|
||||
.then(res => {
|
||||
wx.hideLoading()
|
||||
_self.setData({
|
||||
msgHint: '删除成功',
|
||||
msgType: 'success',
|
||||
msgShow: true
|
||||
})
|
||||
_self.doRefreshList()
|
||||
})
|
||||
.catch(err => {
|
||||
wx.hideLoading()
|
||||
_self.setData({
|
||||
msgHint: err.msg ? err.msg : '删除失败,请稍后重试',
|
||||
msgType: 'error',
|
||||
msgShow: true
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
8
pages/mine/mineAccount/mineMsgNotice/mineMsgNotice.json
Normal file
8
pages/mine/mineAccount/mineMsgNotice/mineMsgNotice.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"mp-loading": "weui-miniprogram/loading/loading",
|
||||
"container-loading": "/components/container-loading/container-loading",
|
||||
"mp-slideview": "weui-miniprogram/slideview/slideview",
|
||||
"mp-toptips": "weui-miniprogram/toptips/toptips"
|
||||
}
|
||||
}
|
45
pages/mine/mineAccount/mineMsgNotice/mineMsgNotice.wxml
Normal file
45
pages/mine/mineAccount/mineMsgNotice/mineMsgNotice.wxml
Normal file
@ -0,0 +1,45 @@
|
||||
<view class="list-title-btns">
|
||||
<view bind:tap="doChangeStatus" data-value="" class="{{currentStatus==''? 'btn-select':'btn-normal'}} border-left">
|
||||
<view class="tab">
|
||||
<text>全部</text>
|
||||
<view class="{{currentStatus==''?'border-select':'border-normal'}}"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view bind:tap="doChangeStatus" data-value="0" class="{{currentStatus=='0'? 'btn-select':'btn-normal'}} border-left">
|
||||
<view class="tab">
|
||||
<text>未读</text>
|
||||
<view class="{{currentStatus=='0'?'border-select':'border-normal'}}"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view bind:tap="doChangeStatus" data-value="1" class="{{currentStatus=='1'? 'btn-select':'btn-normal'}} border-right">
|
||||
<view class="tab">
|
||||
<text>已读</text>
|
||||
<view class="{{currentStatus=='1'?'border-select':'border-normal'}}"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="margin-top: 60px;">
|
||||
<container-loading loadingState="{{loadingState}}" bindrefresh="doRefreshList">
|
||||
<scroll-view scroll-y style="height: 85vh;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'>
|
||||
<view class="coupons-list-box">
|
||||
<block wx:for="{{msgList}}" wx:key="index">
|
||||
<mp-slideview id="mp-slide" buttons="{{onlyDelBtns}}" icon="{{true}}" bindshow="show" data-value="{{item}}" bindhide="hide" bindbuttontap="slideButtonTap">
|
||||
<view class="msg-item-box" bind:tap="readItem" data-value="{{item}}">
|
||||
<view class="msg-title-box">
|
||||
<view wx:if="{{item.isRead==0}}" class="msg-content-notice-point"></view>
|
||||
<view class="title-type">{{item.title}}</view>
|
||||
<view class="title-time">{{item.gmtCreate}}</view>
|
||||
</view>
|
||||
<view class="divider-v mt-10"></view>
|
||||
<view class="msg-content-box">
|
||||
<view style="color:{{item.isRead==0 ?'var(--text-color)':'var(--text-gray-hint-color)'}}" class="msg-content-content">{{item.content}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</mp-slideview>
|
||||
</block>
|
||||
<mp-loading show="{{isLoadMore}}" type="circle"></mp-loading>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</container-loading>
|
||||
</view>
|
||||
<mp-toptips msg="{{msgHint}}" type="{{msgType}}" show="{{msgShow}}" delay="{{2000}}"></mp-toptips>
|
111
pages/mine/mineAccount/mineMsgNotice/mineMsgNotice.wxss
Normal file
111
pages/mine/mineAccount/mineMsgNotice/mineMsgNotice.wxss
Normal file
@ -0,0 +1,111 @@
|
||||
.list-title-btns {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
.btn-select {
|
||||
line-height: 20px;
|
||||
color: var(--btn-primary-color);
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
flex: 1;
|
||||
padding: 10px;
|
||||
color: var(--btn-green-color);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.btn-normal {
|
||||
line-height: 20px;
|
||||
color: var(--text-color);
|
||||
flex: 1;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.border-select {
|
||||
width: 20px;
|
||||
height: 4px;
|
||||
background-color: var(--btn-green-color);
|
||||
margin-top: 10px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.tab {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.border-normal {
|
||||
width: 20px;
|
||||
height: 4px;
|
||||
margin-top: 10px;
|
||||
border-radius: 2px;
|
||||
background-color: var(--divider-color);
|
||||
}
|
||||
|
||||
.coupons-list-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.msg-item-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 0rpx 30rpx;
|
||||
padding: 20rpx;
|
||||
background-color: var(--white-color);
|
||||
border-radius: 5rpx;
|
||||
}
|
||||
|
||||
.msg-title-box {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.title-type {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.title-time {
|
||||
font-size: 24rpx;
|
||||
color: var(--text-gray-hint-color);
|
||||
}
|
||||
|
||||
.msg-content-box {
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
|
||||
.msg-content-notice-point {
|
||||
width: 15rpx;
|
||||
height: 15rpx;
|
||||
border-radius: 15rpx;
|
||||
background-color: var(--primary-color-active);
|
||||
position: absolute;
|
||||
right: -10rpx;
|
||||
top: -10rpx;
|
||||
}
|
||||
|
||||
.msg-content-content {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
#mp-slide:nth-of-type(n+2) {
|
||||
margin-top: 20rpx;
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
// pages/mine/mineAccount/minePayRecord/minePayRecord.js
|
||||
// 资金流水
|
||||
import UserApi from '../../../../net/api/userApi'
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
@ -8,6 +9,7 @@ Page({
|
||||
*/
|
||||
data: {
|
||||
recordList: [], //订单列表
|
||||
appTitle: app.globalData.appTitle,
|
||||
pageData: {
|
||||
page: 1,
|
||||
rows: 10,
|
||||
|
@ -30,7 +30,7 @@
|
||||
<view class="record-title-type-box">
|
||||
<text class="record-title-type {{tools.payTypeColor(item.type)}}">{{tools.payType(item.type)}}</text>
|
||||
<view class="record-title-order-box" wx:if="{{item.orderId != ''}}">
|
||||
<view class="record-title-order-type">AI喵著</view>
|
||||
<view class="record-title-order-type">{{appTitle}}</view>
|
||||
<view class="record-title-order-num">{{item.orderId}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -21,7 +21,7 @@ Page({
|
||||
*/
|
||||
data: {
|
||||
localAssets: app.globalData.localAssets,
|
||||
imgAssets:app.globalData.imgAssetsUrl,
|
||||
imgAssets: app.globalData.imgAssetsUrl,
|
||||
appTitle: app.globalData.appTitle,
|
||||
statusBarHeight: statusBarHeight,
|
||||
navBarHeight: navBarHeight,
|
||||
@ -37,6 +37,10 @@ Page({
|
||||
icon: "ic-user",
|
||||
title: "个人信息",
|
||||
path: "/pages/mine/mineAccount/mineInfo/mineInfo"
|
||||
}, {
|
||||
icon: 'ic-msg',
|
||||
title: '消息通知',
|
||||
path: '/pages/mine/mineAccount/mineMsgNotice/mineMsgNotice'
|
||||
}, {
|
||||
icon: 'ic-invoice-info',
|
||||
title: '开票信息',
|
||||
@ -76,14 +80,16 @@ Page({
|
||||
"text": "首页",
|
||||
"iconPath": app.globalData.localAssets + "/ic_home_normal.png",
|
||||
"selectedIconPath": app.globalData.localAssets + "/ic_home_select.png",
|
||||
"selected": true
|
||||
"selected": false,
|
||||
"hasMsg": false
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/mine/mineIndex/mine",
|
||||
"text": "我的",
|
||||
"iconPath": app.globalData.localAssets + "/ic_mine_normal.png",
|
||||
"selectedIconPath": app.globalData.localAssets + "/ic_mine_select.png",
|
||||
"selected": false
|
||||
"selected": true,
|
||||
"hasMsg": false
|
||||
}
|
||||
],
|
||||
allPrice: 0, //全托管价格
|
||||
@ -109,6 +115,38 @@ Page({
|
||||
this.countViewHeight()
|
||||
this.doGetPrice()
|
||||
},
|
||||
//消息通知
|
||||
getMsgNotice() {
|
||||
const data = {
|
||||
page: 1,
|
||||
rows: 1,
|
||||
isRead: 0,
|
||||
keywords: ''
|
||||
}
|
||||
const _self = this
|
||||
UserApi.doGetMineMsgNotice(data)
|
||||
.then(res => {
|
||||
if (res.rows && res.rows.length > 0) {
|
||||
_self.setData({
|
||||
'tabList[1].hasMsg': true,
|
||||
'menuList[1].hasMsg': true
|
||||
})
|
||||
} else {
|
||||
_self.setData({
|
||||
'tabList[1].hasMsg': false,
|
||||
'menuList[1].hasMsg': false
|
||||
})
|
||||
console.log('是否有消息', _self.data.menuList[1].hasMsg)
|
||||
console.log('是否有消息', _self.data.tabList[1].hasMsg)
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
_self.setData({
|
||||
'tabList[1].hasMsg': false,
|
||||
'menuList[1].hasMsg': false
|
||||
})
|
||||
})
|
||||
},
|
||||
//计算高度
|
||||
countViewHeight() {
|
||||
//
|
||||
@ -253,6 +291,7 @@ Page({
|
||||
}, 1100);
|
||||
},
|
||||
onShow(options) {
|
||||
console.log('页面显示')
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
const tabList = this.data.tabList;
|
||||
@ -264,6 +303,7 @@ Page({
|
||||
});
|
||||
this.getMineAccount() //获取账户信息
|
||||
this.getMinePackageCount() //获取套餐包信息
|
||||
this.getMsgNotice()
|
||||
},
|
||||
getMineAccount() {
|
||||
const _self = this
|
||||
|
@ -42,8 +42,9 @@
|
||||
<view class="menu-item" bind:tap="itemClick" hover-class="menu-item-active" data-title="{{item.title}}" data-path="{{item.path}}">
|
||||
<view class="{{item.icon}}"></view>
|
||||
<view class="menu-title">{{item.title}}</view>
|
||||
<view class="msg-notice-point" wx:if="{{item.hasMsg}}"></view>
|
||||
</view>
|
||||
<view class="divider-padding"></view>
|
||||
<view wx:if="{{(menuList.length-1) > index}}" class="divider-padding"></view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
@ -157,6 +157,17 @@
|
||||
margin-left: 20rpx;
|
||||
margin-right: 20rpx;
|
||||
width: 75vw;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.msg-notice-point {
|
||||
background-color: var(--primary-color);
|
||||
width: 15rpx;
|
||||
height: 15rpx;
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 50%;
|
||||
border-radius: 15rpx;
|
||||
}
|
||||
|
||||
.menu-container {
|
||||
@ -286,6 +297,15 @@
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.ic-msg {
|
||||
background-image: url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB0PSIxNzQ2NTE1Mjg3MDE2IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjI2MzIiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkzNC42Mjc1NTYgODI3LjczMzMzM2EyNzMuMDA5Nzc4IDI3My4wMDk3NzggMCAwIDAtMTA2LjMyNTMzNC0yMDQuNTcyNDQ0VjM5Ny40MjU3NzhjMC0xMzAuMzg5MzMzLTkyLjEwMzExMS0yNDAuMDcxMTExLTIxMy45MDIyMjItMjY2LjA2OTMzNHYtNS4xMkExMDcuOTc1MTExIDEwNy45NzUxMTEgMCAwIDAgNTA3LjE2NDQ0NCAxNy45NzY4ODljLTU4LjgyMzExMSAwLTEwNy4wMDggNDguNjk2ODg5LTEwNy4wMDggMTA4LjE0NTc3OHY1LjE3Njg4OWMtMTIxLjc0MjIyMiAyNS45OTgyMjItMjEzLjkwMjIyMiAxMzUuNjgtMjEzLjkwMjIyMiAyNjYuMDY5MzMzdjIyNS44NDg4ODlhMjczLjAwOTc3OCAyNzMuMDA5Nzc4IDAgMCAwLTEwNi4zODIyMjIgMjA0LjYyOTMzM2gxMDYuMzgyMjIydjAuNjgyNjY3SDgyOC4zMDIyMjJ2LTAuNjgyNjY3aDEwNi4zMjUzMzR2LTAuMTEzNzc4eiBtLTQ0OS45OTExMTIgMTgyLjk1NDY2N2gyNi41NjcxMTJjNjkuNzQ1Nzc4IDAgMTI3LjY1ODY2Ny01My4yNDggMTM2LjAyMTMzMy0xMjEuNDAwODg5SDM2Ny41MDIyMjJjOC40MTk1NTYgNjguMTUyODg5IDY2LjM4OTMzMyAxMjEuNDAwODg5IDEzNi4wNzgyMjIgMTIxLjQwMDg4OUg0ODQuNjkzMzMzeiIgZmlsbD0iI0ZGQjgwMCIgcC1pZD0iMjYzMyI+PC9wYXRoPjwvc3ZnPg==');
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
||||
}
|
||||
|
||||
.custom-tips {
|
||||
margin-top: 82px;
|
||||
}
|
@ -26,9 +26,11 @@ page {
|
||||
--bg-primary-deep-color: #FFA900;
|
||||
--bg-primary-shallow-color: #ffaa0017;
|
||||
--bg-red-color: #F7312A6B;
|
||||
--bg-green-color: rgba(122, 196, 131, 0.42);
|
||||
--bg-green-color: #78e2846b;
|
||||
--bg-green-deep-color: #39C7C1;
|
||||
--bg-gray-deep-color: #CCCCCC;
|
||||
--bg-green-status-deep-color: #4EAF79;
|
||||
--bg-red-deep-color: #F7312A;
|
||||
/* 按钮颜色 */
|
||||
--btn-cyan-color: #39C7C1;
|
||||
--btn-cyan-active: #39c7c08f;
|
||||
|
Loading…
Reference in New Issue
Block a user