This commit is contained in:
qijq 2024-11-19 16:55:58 +08:00
parent dd9a270507
commit 8983c50e47
12 changed files with 4863 additions and 4626 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
unpackage/
.hbuilderx

View File

@ -1,193 +1,233 @@
<template>
<scroll-view @scrolltolower="scrollbottom" class="m-orderlist" scroll-y="true" v-if="message_rows.length >0">
<view class="m-panel-bd">
<view class="m-media-box m-media-box-small-appmsg">
<view class="m-cells">
<block v-for="(item, idx) in message_rows" :key="idx">
<view :class="['m-cell','m-cell-access', item.message_is_read?'':'active']" style='padding:38rpx 30rpx;color:#747474' @click="showMsgDetail(item.message_id)">
<view class="m-cell-hd " style="color:#44afa4">
<view class='commodity_shopImg'>
<image class='commodity_shopImg' :src='item.user_other_avatar'></image>
</view>
</view>
<view class="m-cell-bd m-cell-primary">
<p style="font-size: 24rpx;padding-left:30rpx">
<label style="color:#007AFF;padding-right:10rpx" v-if="!item.message_is_read">{{__('未读')}}</label> <label style="color:#007AFF;padding-right:10rpx">{{item.message_time_str}}</label>
<u-parse :content="item.message_content + ''" :imageProp="{lazyLoad:true}"></u-parse>
</p>
</view>
<span class="qkk hide">{{__('去看看')}}</span>
<text class="m-cell-ft hide"></text>
</view>
</block>
</view>
</view>
</view>
<view class="m-loading-box">
<block v-if="ispage">
<view class="u-loadmore">
<label class="u-loading"></label>
<text class="u-loadmore-tips">{{__('正在加载')}}</text>
</view>
<view>
<text></text>
</view>
</block>
<block v-else>
<view class="u-loadmore u-loadmore-line">
<text class="u-loadmore-tips" style='background-color: #fff'>{{__('已经没有了')}}</text>
</view>
</block>
</view>
</scroll-view>
<view class="m-nullpage" v-else>
<view class="m-nullpage-middle">
<view class="m-null-tip">
<text>{{__('没有社区相关消息')}}</text>
</view>
</view>
</view>
<scroll-view
@scrolltolower="scrollbottom"
class="m-orderlist"
scroll-y="true"
v-if="message_rows.length > 0"
>
<view class="m-panel-bd">
<view class="m-media-box m-media-box-small-appmsg">
<view class="m-cells">
<block v-for="(item, idx) in message_rows" :key="idx">
<view
:class="[
'm-cell',
'm-cell-access',
item.message_is_read ? '' : 'active',
]"
style="padding: 38rpx 30rpx; color: #747474"
@click="showMsgDetail(item.message_id)"
>
<view class="m-cell-hd" style="color: #44afa4">
<view class="commodity_shopImg">
<image
class="commodity_shopImg"
:src="item.user_other_avatar"
></image>
</view>
</view>
<view class="m-cell-bd m-cell-primary">
<p style="font-size: 24rpx; padding-left: 30rpx">
<label
style="color: #007aff; padding-right: 10rpx"
v-if="!item.message_is_read"
>{{ __("未读") }}</label
>
<label style="color: #007aff; padding-right: 10rpx">{{
item.message_time_str
}}</label>
<u-parse
:content="item.message_content + ''"
:imageProp="{ lazyLoad: true }"
></u-parse>
</p>
</view>
<span class="qkk hide">{{ __("去看看") }}</span>
<text class="m-cell-ft hide"></text>
</view>
</block>
</view>
</view>
</view>
<view class="m-loading-box">
<block v-if="ispage">
<view class="u-loadmore">
<label class="u-loading"></label>
<text class="u-loadmore-tips">{{ __("正在加载") }}</text>
</view>
<view>
<text></text>
</view>
</block>
<block v-else>
<view class="u-loadmore u-loadmore-line">
<text class="u-loadmore-tips" style="background-color: #fff">{{
__("已经没有了")
}}</text>
</view>
</block>
</view>
</scroll-view>
<view class="m-nullpage" v-else>
<view class="m-nullpage-middle">
<view class="m-null-tip">
<text>{{ __("没有社区相关消息") }}</text>
</view>
</view>
</view>
</template>
<script>
import dateUtil from "../../helpers/util_date";
import uParse from '@/components/u-parse/u-parse.vue'
import dateUtil from "../../helpers/util_date";
import uParse from "@/components/u-parse/u-parse.vue";
import {
mapState,
mapMutations
} from 'vuex'
import { mapState, mapMutations } from "vuex";
export default {
components: {
uParse
},
data() {
return {
message_rows: [],
page: 1,
ispage: false,
flag: false
}
},
computed: mapState(['Config', 'StateCode', 'notice', 'plantformInfo', 'shopInfo', 'userInfo', 'hasLogin']),
onLoad(options) {
uni.setNavigationBarTitle({
title: this.__('消息')
});
var that = this;
that.getUserMessage();
},
methods: {
...mapMutations(['login', 'logout', 'getPlantformInfo', 'forceUserInfo', 'getUserInfo']),
export default {
components: {
uParse,
},
data() {
return {
message_rows: [],
page: 1,
ispage: false,
flag: false,
};
},
computed: mapState([
"Config",
"StateCode",
"notice",
"plantformInfo",
"shopInfo",
"userInfo",
"hasLogin",
]),
onLoad(options) {
uni.setNavigationBarTitle({
title: this.__("消息"),
});
var that = this;
that.getUserMessage();
},
methods: {
...mapMutations([
"login",
"logout",
"getPlantformInfo",
"forceUserInfo",
"getUserInfo",
]),
getUserMessage: function() {
let that = this;
var params = {
page: this.page
};
getUserMessage: function () {
let that = this;
var params = {
page: this.page,
};
that.$.request({
url: this.Config.URL.user.msg_lists,
data: params,
success: function(data, status, msg, code) {
if (data.items.length > 0) {
for (var r = 0; r < data.items.length; r++) {
data.items[r]['message_time_str'] = dateUtil.dateUtils.format(that.$.datetimeFormatter(data.items[r]['message_time']));
}
that.$.request({
url: this.Config.URL.user.msg_lists,
data: params,
success: function (data, status, msg, code) {
if (data && data.items.length > 0) {
for (var r = 0; r < data.items.length; r++) {
data.items[r]["message_time_str"] = dateUtil.dateUtils.format(
that.$.datetimeFormatter(data.items[r]["message_time"])
);
}
if (data.page >= data.total) {
that.setData({
message_rows: that.message_rows.concat(data.items),
flag: false,
ispage: false
});
} else {
that.setData({
message_rows: that.message_rows.concat(data.items),
flag: true,
ispage: true
})
}
if (data.page >= data.total) {
that.setData({
message_rows: that.message_rows.concat(data.items),
flag: false,
ispage: false,
});
} else {
that.setData({
message_rows: that.message_rows.concat(data.items),
flag: true,
ispage: true,
});
}
} else {
that.setData({
flag: false,
ispage: false,
});
}
},
});
},
} else {
that.setData({
flag: false,
ispage: false
})
}
}
});
},
scrollbottom: function (a) {
if (this.flag && this.ispage) {
var e = this;
e.setData({
flag: false,
}),
clearTimeout(t);
var t = setTimeout(function () {
e.setData({
page: parseInt(e.page) + 1,
}),
e.getUserMessage();
}, 500);
}
},
showMsgDetail(message_id) {
let url = "/member/member/messagedetail?message_id=" + message_id;
scrollbottom: function(a) {
if (this.flag && this.ispage) {
var e = this;
e.setData({
flag: false
}), clearTimeout(t);
var t = setTimeout(function() {
e.setData({
page: parseInt(e.page) + 1
}), e.getUserMessage()
}, 500)
}
},
showMsgDetail(message_id) {
let url = '/member/member/messagedetail?message_id=' + message_id;
for (var r = 0; r < this.message_rows.length; r++) {
if (message_id == this.message_rows[r]["message_id"]) {
this.$set(this.message_rows[r], "message_is_read", 1);
}
}
for (var r = 0; r < this.message_rows.length; r++) {
if (message_id == this.message_rows[r]['message_id']) {
this.$set(this.message_rows[r], 'message_is_read', 1);
}
}
uni.navigateTo({
url: url,
});
},
uni.navigateTo({
url: url
})
},
preview(src, e) {
// do something
},
navigate(href, e) {
// do something
console.info(href);
console.info(e);
preview(src, e) {
// do something
},
navigate(href, e) {
// do something
console.info(href);
console.info(e);
//this.$.gopage(href);
}
}
}
//this.$.gopage(href);
},
},
};
</script>
<style lang="scss">
@import "../../styles/_variables";
@import url("@/components/u-parse/u-parse.css");
@import "../../styles/_variables";
@import url("@/components/u-parse/u-parse.css");
.qkk {
font-size: 24rpx;
color: #999999;
}
.commodity_shopImg {
width: 70rpx;
height: 70rpx;
border-radius: 100%;
overflow: hidden;
}
.qkk {
font-size: 24rpx;
color: #999999
}
.m-orderlist {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.commodity_shopImg {
width: 70rpx;
height: 70rpx;
border-radius: 100%;
overflow: hidden
}
.m-orderlist {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.m-cell.active {
font-weight: 700;
}
.m-cell.active {
font-weight: 700;
}
</style>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB