刘嘉炜
4 years ago
13 changed files with 435 additions and 47 deletions
-
7src/js/api.js
-
2src/js/server.js
-
13src/pages.json
-
5src/pages/index/index.vue
-
57src/pages/message/detail/detail.vue
-
102src/pages/message/list/list.vue
-
17src/pages/order_list/order_list.vue
-
12src/pages/order_search/order_search.vue
-
34src/pages/order_send/order_send.vue
-
217src/pages/turnover/turnover.vue
-
BINsrc/static/images/icon/calendar.png
-
4src/utils/util.js
@ -0,0 +1,57 @@ |
|||
<template> |
|||
<view class="message-detail"> |
|||
<view class="md-title">{{mesInfo.title || '-'}}</view> |
|||
<view class="md-time">{{mesInfo.created_at || '-'}}</view> |
|||
<rich-text :nodes="mesInfo.content || '-'"></rich-text> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { API } from '../../../js/api' |
|||
import { servers } from '../../../js/server' |
|||
export default { |
|||
data(){ |
|||
return { |
|||
mesInfo: {} |
|||
} |
|||
}, |
|||
onLoad(options){ |
|||
this.getMesInfo(options.id) |
|||
}, |
|||
methods: { |
|||
getMesInfo(id){ |
|||
servers.get({ |
|||
url: API.messageRead + `/${id}`, |
|||
data: { id }, |
|||
failMsg: '加载失败!', |
|||
|
|||
}) |
|||
.then(res=>{ |
|||
this.mesInfo =res; |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
@import "../../../style/public.scss"; |
|||
page{ |
|||
background-color: #fff; |
|||
} |
|||
.message-detail{ |
|||
padding: 40upx; |
|||
.md-title{ |
|||
margin-bottom: 16upx; |
|||
line-height: 56upx; |
|||
font-size: 40upx; |
|||
color: #1a1a1a; |
|||
} |
|||
.md-time{ |
|||
margin-bottom: 60upx; |
|||
line-height: 34upx; |
|||
font-size: 24upx; |
|||
color: #b2b2b2; |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,102 @@ |
|||
<template> |
|||
<view class="message-list"> |
|||
<view class="ml-list"> |
|||
<view class="ml-item" v-for="(e,i) in mesList" :key="e" @click="toDetail(i)"> |
|||
<view> |
|||
<text>{{e.title || '-'}}</text> |
|||
<view v-if="e.is_view == 0"></view> |
|||
<!-- 0未读 1已读 --> |
|||
</view> |
|||
<view>{{e.created_at || '-'}}</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { API } from '../../../js/api'; |
|||
import { servers } from '../../../js/server'; |
|||
import util from '../../../utils/util' |
|||
export default { |
|||
data(){ |
|||
return { |
|||
mesList: [], |
|||
page: 1 |
|||
} |
|||
}, |
|||
onReachBottom(){ |
|||
let { page } = this; |
|||
this.getMesList(++page); |
|||
}, |
|||
onLoad(){ |
|||
this.getMesList(); |
|||
}, |
|||
methods: { |
|||
toDetail(i){ |
|||
let _mesList = [...this.mesList]; |
|||
_mesList[i].is_view = 1; |
|||
this.mesList = _mesList; |
|||
util.routeTo(`/pages/message/detail/detail?id=${_mesList[i].id}`,'nT'); |
|||
}, |
|||
getMesList(page = 1){ |
|||
servers.get({ |
|||
url: API.messageList, |
|||
data: { |
|||
page, |
|||
page_size: 15, |
|||
msg_type: 1 |
|||
}, |
|||
failMsg: '加载失败!' |
|||
}) |
|||
.then(res=>{ |
|||
let _list = res.list || []; |
|||
if(page == 1)return this.mesList = _list; |
|||
this.page = page; |
|||
this.mesList = [...this.mesList, ..._list]; |
|||
console.log('xiaoxi',res); |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../../style/public.scss"; |
|||
.message-list{ |
|||
|
|||
} |
|||
.ml-list{ |
|||
padding: 24upx; |
|||
.ml-item{ |
|||
padding: 24upx 20upx; |
|||
margin-bottom: 24upx; |
|||
border-radius: 10upx; |
|||
background-color: #fff; |
|||
>view{ |
|||
&:first-child{ |
|||
position: relative; |
|||
display: inline-block; |
|||
line-height: 44upx; |
|||
font-size: 32upx; |
|||
color: #1a1a1a; |
|||
text-align: justify; |
|||
>view{ |
|||
position: absolute; |
|||
top: 0upx; |
|||
right: -16upx; |
|||
display: block; |
|||
width: 16upx; |
|||
height: 16upx; |
|||
border-radius: 50%; |
|||
background-color: #EA5061; |
|||
} |
|||
} |
|||
&+view{ |
|||
line-height: 34upx; |
|||
font-size: 24upx; |
|||
color: #b2b2b2; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
After Width: 40 | Height: 40 | Size: 199 B |
Write
Preview
Loading…
Cancel
Save
Reference in new issue