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,193 +1,233 @@
<template> <template>
<scroll-view @scrolltolower="scrollbottom" class="m-orderlist" scroll-y="true" v-if="message_rows.length >0"> <scroll-view
<view class="m-panel-bd"> @scrolltolower="scrollbottom"
<view class="m-media-box m-media-box-small-appmsg"> class="m-orderlist"
<view class="m-cells"> scroll-y="true"
<block v-for="(item, idx) in message_rows" :key="idx"> v-if="message_rows.length > 0"
<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-panel-bd">
<view class='commodity_shopImg'> <view class="m-media-box m-media-box-small-appmsg">
<image class='commodity_shopImg' :src='item.user_other_avatar'></image> <view class="m-cells">
</view> <block v-for="(item, idx) in message_rows" :key="idx">
</view> <view
<view class="m-cell-bd m-cell-primary"> :class="[
<p style="font-size: 24rpx;padding-left:30rpx"> 'm-cell',
<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> 'm-cell-access',
<u-parse :content="item.message_content + ''" :imageProp="{lazyLoad:true}"></u-parse> item.message_is_read ? '' : 'active',
</p> ]"
</view> style="padding: 38rpx 30rpx; color: #747474"
<span class="qkk hide">{{__('去看看')}}</span> @click="showMsgDetail(item.message_id)"
<text class="m-cell-ft hide"></text> >
</view> <view class="m-cell-hd" style="color: #44afa4">
</block> <view class="commodity_shopImg">
</view> <image
</view> class="commodity_shopImg"
</view> :src="item.user_other_avatar"
<view class="m-loading-box"> ></image>
<block v-if="ispage"> </view>
<view class="u-loadmore"> </view>
<label class="u-loading"></label> <view class="m-cell-bd m-cell-primary">
<text class="u-loadmore-tips">{{__('正在加载')}}</text> <p style="font-size: 24rpx; padding-left: 30rpx">
</view> <label
<view> style="color: #007aff; padding-right: 10rpx"
<text></text> v-if="!item.message_is_read"
</view> >{{ __("未读") }}</label
</block> >
<block v-else> <label style="color: #007aff; padding-right: 10rpx">{{
<view class="u-loadmore u-loadmore-line"> item.message_time_str
<text class="u-loadmore-tips" style='background-color: #fff'>{{__('已经没有了')}}</text> }}</label>
</view> <u-parse
</block> :content="item.message_content + ''"
</view> :imageProp="{ lazyLoad: true }"
</scroll-view> ></u-parse>
<view class="m-nullpage" v-else> </p>
<view class="m-nullpage-middle"> </view>
<view class="m-null-tip"> <span class="qkk hide">{{ __("去看看") }}</span>
<text>{{__('没有社区相关消息')}}</text> <text class="m-cell-ft hide"></text>
</view> </view>
</view> </block>
</view> </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> </template>
<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([
onLoad(options) { "Config",
uni.setNavigationBarTitle({ "StateCode",
title: this.__('消息') "notice",
}); "plantformInfo",
var that = this; "shopInfo",
that.getUserMessage(); "userInfo",
}, "hasLogin",
methods: { ]),
...mapMutations(['login', 'logout', 'getPlantformInfo', 'forceUserInfo', 'getUserInfo']), onLoad(options) {
uni.setNavigationBarTitle({
title: this.__("消息"),
});
var that = this;
that.getUserMessage();
},
methods: {
...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 {
that.setData({
flag: false,
ispage: false,
});
}
},
});
},
} else { scrollbottom: function (a) {
that.setData({ if (this.flag && this.ispage) {
flag: false, var e = this;
ispage: false 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) { for (var r = 0; r < this.message_rows.length; r++) {
if (this.flag && this.ispage) { if (message_id == this.message_rows[r]["message_id"]) {
var e = this; this.$set(this.message_rows[r], "message_is_read", 1);
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++) { uni.navigateTo({
if (message_id == this.message_rows[r]['message_id']) { url: url,
this.$set(this.message_rows[r], 'message_is_read', 1); });
} },
}
uni.navigateTo({ preview(src, e) {
url: url // do something
}) },
}, navigate(href, e) {
// do something
console.info(href);
console.info(e);
preview(src, e) { //this.$.gopage(href);
// do something },
}, },
navigate(href, e) { };
// do something
console.info(href);
console.info(e);
//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 {
font-size: 24rpx;
color: #999999;
}
.commodity_shopImg {
width: 70rpx;
height: 70rpx;
border-radius: 100%;
overflow: hidden;
}
.qkk { .m-orderlist {
font-size: 24rpx; position: absolute;
color: #999999 top: 0;
} left: 0;
width: 100%;
height: 100%;
}
.commodity_shopImg { .m-cell.active {
width: 70rpx; font-weight: 700;
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;
}
</style> </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