mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-17 16:05:53 +08:00
commit message
This commit is contained in:
183
pages/mine/msgTips/main.vue
Normal file
183
pages/mine/msgTips/main.vue
Normal file
@@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="list-cell b-b m-t" hover-class="cell-hover" :hover-stay-time="50">
|
||||
<u-row gutter="12" justify="start" @click="navigateTo('/pages/msgTips/sysMsg/index')">
|
||||
<u-col span="2" class="uCol" style="text-align:center;">
|
||||
<image class="img" src="/static/mine/setting.png"></image>
|
||||
</u-col>
|
||||
<u-col span="7">
|
||||
<p class="tit_title">系统消息</p>
|
||||
<p class="tit_tips">查看系统消息</p>
|
||||
</u-col>
|
||||
<u-col span="3">
|
||||
<view class="cell-more">
|
||||
<u-tag size="mini" v-if="no_read.system_num>0" shape="circle" mode="dark" type="error" :text="no_read.system_num"></u-tag>
|
||||
<span class="yticon icon-you"></span>
|
||||
</view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
<!-- <view class="list-cell b-b m-t" hover-class="cell-hover" :hover-stay-time="50">
|
||||
<u-row gutter="12" justify="start" @click="navigateTo('/pages/msgTips/packagemsg/index')">
|
||||
<u-col span="2" class="uCol" style="text-align:center;">
|
||||
<image class="img" src="/static/mine/logistics.png"></image>
|
||||
|
||||
</u-col>
|
||||
<u-col span="7">
|
||||
<p class="tit_title">物流消息</p>
|
||||
<p class="tit_tips">查看物流消息</p>
|
||||
</u-col>
|
||||
<u-col span="3">
|
||||
<view class="cell-more">
|
||||
|
||||
<u-tag v-if="no_read.logistics_num>0" shape="circle" mode="dark" type="warning" :text="no_read.logistics_num"></u-tag>
|
||||
<span class="yticon icon-you"></span>
|
||||
</view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapMutations
|
||||
} from "vuex";
|
||||
import * as API_Message from "@/api/members.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
no_read: ''
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.GET_NoReadMessageNum();
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(["logout"]),
|
||||
navigateTo(url) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
});
|
||||
},
|
||||
/** 获取未读消息数量信息 */
|
||||
GET_NoReadMessageNum() {
|
||||
API_Message.getNoReadMessageNum().then(response => {
|
||||
this.no_read = response.data
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang='scss'>
|
||||
.uCol {
|
||||
display: flex;
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
|
||||
}
|
||||
|
||||
.container {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
/deep/ .u-col-2 {
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
text-align: center !important;
|
||||
|
||||
}
|
||||
|
||||
.qicon {
|
||||
text-align: center;
|
||||
display: block;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.redBox {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
line-height: 1.5em;
|
||||
font-size: 12px;
|
||||
min-width: 1.5em;
|
||||
min-height: 1.5em;
|
||||
|
||||
background: #ed6533;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tit_title {
|
||||
color: $u-main-color;
|
||||
}
|
||||
|
||||
.tit_tips {
|
||||
color: $u-tips-color;
|
||||
}
|
||||
|
||||
.u-col-3 {
|
||||
text-align: right !important;
|
||||
padding-right: 20rpx !important;
|
||||
}
|
||||
|
||||
.list-cell {
|
||||
background: #fff;
|
||||
align-items: baseline;
|
||||
padding: 20rpx 0;
|
||||
line-height: 60rpx;
|
||||
|
||||
background: #fff;
|
||||
justify-content: center;
|
||||
|
||||
&.log-out-btn {
|
||||
margin-top: 40rpx;
|
||||
|
||||
.cell-tit {
|
||||
color: $uni-color-primary;
|
||||
text-align: center;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&.cell-hover {
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
&.b-b:after {
|
||||
left: 30rpx;
|
||||
}
|
||||
|
||||
&.m-t {
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.cell-more {
|
||||
/* margin-top: 10rpx; */
|
||||
height: 60rpx;
|
||||
text-align: right;
|
||||
/* display: flex;
|
||||
justify-content: center; //这个是X轴居中
|
||||
align-items: center; //这个是 Y轴居中 */
|
||||
font-size: $font-lg;
|
||||
color: $font-color-light;
|
||||
/* width: 100rpx; */
|
||||
}
|
||||
|
||||
.cell-tit {
|
||||
flex: 1;
|
||||
font-size: $font-base + 2rpx;
|
||||
color: $font-color-dark;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.cell-tip {
|
||||
font-size: $font-base;
|
||||
color: $font-color-light;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
128
pages/mine/msgTips/packageMsg/index.vue
Normal file
128
pages/mine/msgTips/packageMsg/index.vue
Normal file
@@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<view class="container " style="font-size: 13px;">
|
||||
<block v-for="(row, index) in messageList" :key="index">
|
||||
<view class="msgItem">
|
||||
<div class="msgMsg">
|
||||
<div class="bagbar">{{$u.timeFormat(row.send_time, 'yyyy-mm-dd')}}</div>
|
||||
</div>
|
||||
<u-card @click="goDetail(row.sn,row.logi_id,row.ship_no)" :title="title" title-color="#666666" title-size="24" sub-title-color="#666666" sub-title-size="24" :border="false" :sub-title=row.status>
|
||||
<view class="msg-body" slot="body">
|
||||
<image class="msgImg" :src="row.goods_img" mode=""></image>
|
||||
<view class="msgView">
|
||||
<view>{{row.goodsName}}</view>
|
||||
<view class="msgNum">订单号:{{row.sn}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-card>
|
||||
</view>
|
||||
</block>
|
||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as API_Message from "@/api/message.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
messageList: [],
|
||||
title: "物流更新通知",
|
||||
subTitle: "运输中",
|
||||
loadStatus:'more',
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
loadStatus:'more'
|
||||
};
|
||||
},
|
||||
onLoad(){
|
||||
this.GET_LogisticsList(true);
|
||||
},
|
||||
onReachBottom() {
|
||||
this.params.pageNumber++
|
||||
this.GET_LogisticsList(false)
|
||||
},
|
||||
methods: {
|
||||
goDetail(sn,logi_id,ship_no){
|
||||
uni.navigateTo({
|
||||
url:'/pages/msgTips/packagemsg/logisticsDetail?order_sn=' + sn +'&logi_id='+logi_id+'&ship_no='+ship_no,
|
||||
})
|
||||
},
|
||||
//获取物流消息
|
||||
GET_LogisticsList(reset){
|
||||
if (reset) {
|
||||
this.params.pageNumber = 1
|
||||
}
|
||||
uni.showLoading({
|
||||
title:"加载中"
|
||||
})
|
||||
API_Message.getLogisticsMessages(this.params).then(async response => {
|
||||
uni.hideLoading()
|
||||
const { data } = response
|
||||
if (!data || !data.length) {
|
||||
this.messageList.push(...data.data)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang='scss'>
|
||||
.ddnumber {
|
||||
color: $u-tips-color;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.msg-body{
|
||||
display: flex;
|
||||
background-color: rgba(102, 110, 232, 0.0470588235294118);
|
||||
|
||||
|
||||
.msgImg{
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
.msgView{
|
||||
margin-left: 20rpx;
|
||||
.msgNum:last-child{
|
||||
margin-top: 60rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.bagbar {
|
||||
display: inline;
|
||||
border-radius: 500px;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
background: $u-type-info-disabled;
|
||||
}
|
||||
.storeImg {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.container {
|
||||
background: #F9F9F9;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.msgMsg {
|
||||
text-align: center;
|
||||
color: $u-tips-color;
|
||||
}
|
||||
.msgItem {
|
||||
padding: 1em 0;
|
||||
}
|
||||
view{
|
||||
font-size: 13px;
|
||||
color: #666666;
|
||||
}
|
||||
u-card{
|
||||
font-size: 13px;
|
||||
color: #666666;
|
||||
}
|
||||
</style>
|
||||
100
pages/mine/msgTips/packageMsg/logisticsDetail.vue
Normal file
100
pages/mine/msgTips/packageMsg/logisticsDetail.vue
Normal file
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<view class="logistics-detail">
|
||||
<view class="card">
|
||||
<view class="card-title">
|
||||
<span>{{ logiList.shipper }}</span>快递 <span>{{ logiList.logisticCode }}</span>
|
||||
</view>
|
||||
<view class="time-line">
|
||||
<u-time-line v-if="logiList.traces && logiList.traces.length != 0">
|
||||
<u-time-line-item nodeTop="2" v-for="(item, index) in logiList.traces" :key="index">
|
||||
<!-- 此处自定义了左边内容,用一个图标替代 -->
|
||||
<template v-slot:node >
|
||||
<view v-if="index == logiList.traces.length - 1" class="u-node" :style="{ background: $lightColor }" style="padding: 0 4px">
|
||||
<!-- 此处为uView的icon组件 -->
|
||||
<u-icon name="pushpin-fill" color="#fff" :size="24"></u-icon>
|
||||
</view>
|
||||
</template>
|
||||
<template v-slot:content>
|
||||
<view>
|
||||
<!-- <view class="u-order-title">待取件</view> -->
|
||||
<view class="u-order-desc">{{ item.AcceptStation }}</view>
|
||||
<view class="u-order-time">{{ item.AcceptTime }}</view>
|
||||
</view>
|
||||
</template>
|
||||
</u-time-line-item>
|
||||
</u-time-line>
|
||||
<u-empty class="empty" v-else text="目前没有物流订单" mode="list"></u-empty>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniSteps from "@/components/uni-steps/uni-steps.vue";
|
||||
import { getExpress } from "@/api/trade.js";
|
||||
|
||||
export default {
|
||||
components: { uniSteps },
|
||||
data() {
|
||||
return {
|
||||
express: "",
|
||||
resData: {
|
||||
title: "物流详情",
|
||||
},
|
||||
|
||||
logiList: "",
|
||||
activeStep: 0,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(sn) {
|
||||
getExpress(sn).then((res) => {
|
||||
this.logiList = res.data.result;
|
||||
});
|
||||
},
|
||||
},
|
||||
onLoad(option) {
|
||||
let sn = option.order_sn;
|
||||
this.init(sn);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.card-title {
|
||||
background: #f2f2f2;
|
||||
}
|
||||
.logistics-detail {
|
||||
margin-top: 20rpx;
|
||||
padding: 0 16rpx;
|
||||
}
|
||||
.card {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
width: 100%;
|
||||
> .card-title {
|
||||
font-size: 24rpx;
|
||||
border-top-left-radius: 20rpx;
|
||||
border-top-right-radius: 20rpx;
|
||||
padding: 16rpx;
|
||||
}
|
||||
> .time-line {
|
||||
padding: 16rpx 32rpx;
|
||||
}
|
||||
}
|
||||
.u-order-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
.u-order-desc {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
.u-order-time {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
.empty {
|
||||
padding: 40rpx 0;
|
||||
}
|
||||
</style>
|
||||
140
pages/mine/msgTips/serviceMsg/index.vue
Normal file
140
pages/mine/msgTips/serviceMsg/index.vue
Normal file
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="list-cell b-b m-t" hover-class="cell-hover" :hover-stay-time="50">
|
||||
<u-row gutter="12" justify="start">
|
||||
<u-col span="2">
|
||||
<img
|
||||
class="list_img"
|
||||
src="https://web-assets.fancynode.com.cn/web_v1/images/pxcook/features/icon-cloud.png"
|
||||
alt
|
||||
/>
|
||||
</u-col>
|
||||
<u-col span="7">
|
||||
<p class="tit_title">
|
||||
<img
|
||||
src="https://web-assets.fancynode.com.cn/web_v1/images/pxcook/features/icon-cloud.png"
|
||||
alt
|
||||
/>
|
||||
在线客服
|
||||
</p>
|
||||
<p class="tit_tips">查看回复客服的消息</p>
|
||||
</u-col>
|
||||
<u-col span="3">
|
||||
<text class="cell-more">
|
||||
<p class="msgTime">2020-12-12</p>
|
||||
<span class="redBox">55</span>
|
||||
</text>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapMutations } from "vuex";
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(["logout"]),
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang='scss'>
|
||||
.msgTime {
|
||||
font-size: 13px;
|
||||
}
|
||||
page {
|
||||
background: $page-color-base;
|
||||
}
|
||||
.list_img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
border-radius: 0.4em;
|
||||
}
|
||||
.qicon {
|
||||
text-align: center;
|
||||
display: block;
|
||||
font-size: 20px;
|
||||
}
|
||||
.redBox {
|
||||
padding: 10rpx 12rpx;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
line-height: 1em;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
background: #ed6533;
|
||||
border-radius: 50%;
|
||||
|
||||
color: #fff;
|
||||
}
|
||||
.tit_title,
|
||||
.tit_tips {
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
.tit_title {
|
||||
color: $u-main-color;
|
||||
> img {
|
||||
vertical-align: middle;
|
||||
margin-right: 10rpx;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
}
|
||||
.tit_tips {
|
||||
color: $u-tips-color;
|
||||
}
|
||||
.list-cell {
|
||||
align-items: baseline;
|
||||
padding: 20rpx 30rpx;
|
||||
line-height: 60rpx;
|
||||
position: relative;
|
||||
background: #fff;
|
||||
justify-content: center;
|
||||
&.log-out-btn {
|
||||
margin-top: 40rpx;
|
||||
.cell-tit {
|
||||
color: $uni-color-primary;
|
||||
text-align: center;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
&.cell-hover {
|
||||
background: #fafafa;
|
||||
}
|
||||
&.b-b:after {
|
||||
left: 30rpx;
|
||||
}
|
||||
&.m-t {
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
.cell-more {
|
||||
text-align: right;
|
||||
margin-top: 10rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: center; //这个是X轴居中
|
||||
align-items: center; //这个是 Y轴居中
|
||||
align-self: baseline;
|
||||
font-size: $font-lg;
|
||||
color: $font-color-light;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.cell-tit {
|
||||
flex: 1;
|
||||
font-size: $font-base + 2rpx;
|
||||
color: $font-color-dark;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.cell-tip {
|
||||
font-size: $font-base;
|
||||
color: $font-color-light;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
102
pages/mine/msgTips/sysMsg/index.vue
Normal file
102
pages/mine/msgTips/sysMsg/index.vue
Normal file
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<block v-for="(row, index) in messageList" :key="index">
|
||||
<view class="msgItem">
|
||||
<div class="is_read">
|
||||
<!-- {{row.is_read}} -->
|
||||
<span v-if="row.is_read"></span>
|
||||
<span v-else class="red">·</span>
|
||||
|
||||
</div>
|
||||
<div class="msgMsg">{{$u.timeFormat(row.send_time, 'yyyy-mm-dd')}}</div>
|
||||
<u-card :title="title" :title-size="35" :border="false">
|
||||
<view class slot="body">
|
||||
<view class="u-body-item u-flex u-row-between u-p-b-0">
|
||||
<view class="u-body-item-title u-line-2">{{row.content}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-card>
|
||||
</view>
|
||||
</block>
|
||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapMutations } from "vuex";
|
||||
import * as API_Message from "@/api/message.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: "系统消息",
|
||||
subTitle: "未读",
|
||||
finished: false,
|
||||
loadStatus: "more",
|
||||
params: {
|
||||
pageNumber: 0,
|
||||
pageSize: 5
|
||||
},
|
||||
messageList: []
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.GET_MessageList(true);
|
||||
},
|
||||
onReachBottom() {
|
||||
this.params.pageNumber++;
|
||||
this.GET_MessageList(false);
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(["logout"]),
|
||||
|
||||
/** 获取站内消息 */
|
||||
GET_MessageList(reset) {
|
||||
if (reset) {
|
||||
this.params.pageNumber = 1;
|
||||
this.messageList = [];
|
||||
}
|
||||
uni.showLoading({
|
||||
title: "加载中"
|
||||
});
|
||||
API_Message.getMessages(this.params).then(async response => {
|
||||
uni.hideLoading();
|
||||
const { data } = response;
|
||||
if (!data || !data.length) {
|
||||
this.messageList.push(...data.data);
|
||||
this.handleReadPageMessages();
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 设置消息已读 **/
|
||||
handleReadPageMessages() {
|
||||
const ids = this.messageList.map(item => item.id).join(",");
|
||||
API_Message.messageMarkAsRead(ids).then(async () => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang='scss'>
|
||||
.is_read{
|
||||
position: absolute;
|
||||
right: 25px;
|
||||
top: 80rpx;
|
||||
z-index: 999;
|
||||
}
|
||||
.container {
|
||||
background: #f9f9f9;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.red{
|
||||
color: coral;
|
||||
font-size: 100rpx;
|
||||
}
|
||||
.msgMsg {
|
||||
text-align: center;
|
||||
color: $u-tips-color;
|
||||
}
|
||||
.msgItem {
|
||||
padding: 1em 0;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user