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/ unpackage/
.hbuilderx

View File

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

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