消息和积分ui
parent
efe3f31f6c
commit
11bcd78cfe
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,11 @@
|
|||||||
|
.common-popup-btn {
|
||||||
|
width: 690rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
text-align: center;
|
||||||
|
border: 1rpx solid #000;
|
||||||
|
border-radius: 45rpx;
|
||||||
|
color: #fff;
|
||||||
|
background: #000000;
|
||||||
|
}
|
||||||
@ -0,0 +1,108 @@
|
|||||||
|
import classnames from "classnames";
|
||||||
|
import { Component } from "react";
|
||||||
|
|
||||||
|
import { Block, View, Button, PageMeta } from "@tarojs/components";
|
||||||
|
|
||||||
|
import { Popup } from "@antmjs/vantui";
|
||||||
|
|
||||||
|
import "./popup.less";
|
||||||
|
import "./popup-drawer.less";
|
||||||
|
/*** props
|
||||||
|
* isLarge 是否大尺寸
|
||||||
|
* isShow 是否显示
|
||||||
|
* isClose 右上角关闭图标
|
||||||
|
* postion 抽屉弹出位置 left right top bottom
|
||||||
|
* title 弹窗标题
|
||||||
|
* content 弹窗内容
|
||||||
|
* confirmButtonText 确定按钮
|
||||||
|
* textAlgin 文本对齐 left right center
|
||||||
|
* @confirm 关闭回调
|
||||||
|
* ***/
|
||||||
|
export default class PopupDrawer extends Component<any, any> {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
name: "抽屉组件",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async onLoad() {}
|
||||||
|
componentDidMount() {}
|
||||||
|
|
||||||
|
componentWillUnmount() {}
|
||||||
|
|
||||||
|
componentDidShow() {}
|
||||||
|
|
||||||
|
componentDidHide() {}
|
||||||
|
|
||||||
|
async initData() {}
|
||||||
|
|
||||||
|
onClose = () => {
|
||||||
|
this.props.close();
|
||||||
|
};
|
||||||
|
|
||||||
|
onConfirm = () => {
|
||||||
|
this.props.confirm();
|
||||||
|
};
|
||||||
|
|
||||||
|
onClickStop = (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
let {
|
||||||
|
title,
|
||||||
|
content,
|
||||||
|
confirmButtonText,
|
||||||
|
textAlgin,
|
||||||
|
isShow,
|
||||||
|
isClose,
|
||||||
|
isLarge,
|
||||||
|
postion,
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Block>
|
||||||
|
<PageMeta pageStyle={isShow ? "overflow: hidden;" : ""} />
|
||||||
|
<Popup
|
||||||
|
show={isShow}
|
||||||
|
closeOnClickOverlay={false}
|
||||||
|
position={postion || "bottom"}
|
||||||
|
round
|
||||||
|
overlayStyle="width: 100vw;padding: 0;"
|
||||||
|
onClick={this.onClickStop}
|
||||||
|
>
|
||||||
|
{isClose && (
|
||||||
|
<View
|
||||||
|
className="at-icon at-icon-close common-close"
|
||||||
|
onClick={this.onClose}
|
||||||
|
></View>
|
||||||
|
)}
|
||||||
|
<View
|
||||||
|
className={classnames("common-box", {
|
||||||
|
large: isLarge,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<View className="common-popup-title">{title}</View>
|
||||||
|
<View className="common-popup-content-box">
|
||||||
|
<View
|
||||||
|
className={classnames("common-popup-content", {
|
||||||
|
"text-left": textAlgin === "left",
|
||||||
|
"text-right": textAlgin === "right",
|
||||||
|
"text-center": textAlgin === "center",
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
{content}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View className="common-popup-btns">
|
||||||
|
<Button className="common-popup-btn" onClick={this.onConfirm}>
|
||||||
|
{confirmButtonText}
|
||||||
|
</Button>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</Popup>
|
||||||
|
</Block>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,85 @@
|
|||||||
|
@import "@antmjs/vantui/lib/popup/index.less";
|
||||||
|
@import "@antmjs/vantui/lib/transition/index.less";
|
||||||
|
@import "@antmjs/vantui/lib/overlay/index.less";
|
||||||
|
|
||||||
|
.large {
|
||||||
|
width: 670rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.common-box {
|
||||||
|
padding: 38rpx 30rpx;
|
||||||
|
padding-bottom: 40rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.common-popup-title {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
text-align: center;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.common-popup-content-box {
|
||||||
|
margin-top: 60rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.common-popup-content {
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
max-height: 600rpx;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.common-popup-content.is-common {
|
||||||
|
color: #41a9fc;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.common-popup-content.is-last {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.common-popup-btns {
|
||||||
|
display: flex;
|
||||||
|
margin-top: 76rpx;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.common-popup-btn {
|
||||||
|
width: 480rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
text-align: center;
|
||||||
|
border: 1rpx solid #000;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
color: #fff;
|
||||||
|
background-color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.common-popup-btn2 {
|
||||||
|
width: 240rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
text-align: center;
|
||||||
|
border: 1rpx solid #000;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.common-popup-btn2:first-child {
|
||||||
|
margin-left: 22rpx;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.common-popup-btn2:last-child {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.common-close {
|
||||||
|
position: absolute;
|
||||||
|
right: 36rpx;
|
||||||
|
top: 36rpx;
|
||||||
|
color: #000;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@ -0,0 +1,16 @@
|
|||||||
|
page {
|
||||||
|
background: #f3f3f3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell {
|
||||||
|
border-bottom: 1px solid #f3f3f3;
|
||||||
|
background: #fff;
|
||||||
|
padding: 30rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
.cell .label {
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
.cell .value {
|
||||||
|
color: #a19fa2;
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
import { Component, PropsWithChildren, useEffect, useState } from "react";
|
||||||
|
import Taro from "@tarojs/taro";
|
||||||
|
import { Block, View, Text } from "@tarojs/components";
|
||||||
|
|
||||||
|
import Navbar from "../../components/navbar/navbar";
|
||||||
|
|
||||||
|
import { GetAboutUs } from "../../utils/Interface";
|
||||||
|
|
||||||
|
import "./about.less";
|
||||||
|
|
||||||
|
export default class About extends Component<any, any> {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
name: "更多设置",
|
||||||
|
version: "",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async onLoad() {
|
||||||
|
this.initData();
|
||||||
|
}
|
||||||
|
componentDidMount() {}
|
||||||
|
|
||||||
|
componentWillUnmount() {}
|
||||||
|
|
||||||
|
componentDidShow() {}
|
||||||
|
|
||||||
|
componentDidHide() {}
|
||||||
|
|
||||||
|
async initData() {
|
||||||
|
let res = await GetAboutUs();
|
||||||
|
if (res.data.code === 200) {
|
||||||
|
this.setState({ version: res.data.data.value });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
let { version } = this.state;
|
||||||
|
return (
|
||||||
|
<Block>
|
||||||
|
<Navbar titleSlot="更多设置" isBack={true} />
|
||||||
|
<View className="cell flex aitems sb" style="margin-top:20rpx;">
|
||||||
|
<View className="label">版本管理</View>
|
||||||
|
<View className="value">{version}</View>
|
||||||
|
</View>
|
||||||
|
</Block>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
.img {
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.tip {
|
||||||
|
color: #666666;
|
||||||
|
font-size: 30rpx;
|
||||||
|
margin: 50rpx 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
import { Component, PropsWithChildren, useEffect, useState } from "react";
|
||||||
|
import Taro from "@tarojs/taro";
|
||||||
|
import { Block, View, Text, Image, Input, Button } from "@tarojs/components";
|
||||||
|
|
||||||
|
import Navbar from "../../components/navbar/navbar";
|
||||||
|
|
||||||
|
import "./consultant.less";
|
||||||
|
|
||||||
|
import { getContactWorker } from "../../utils/Interface";
|
||||||
|
|
||||||
|
export default class Consultant extends Component<any, any> {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
name: "consultant",
|
||||||
|
pictureUrl: "",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async onLoad() {
|
||||||
|
this.initData();
|
||||||
|
}
|
||||||
|
componentDidMount() {}
|
||||||
|
|
||||||
|
componentWillUnmount() {}
|
||||||
|
|
||||||
|
componentDidShow() {}
|
||||||
|
|
||||||
|
componentDidHide() {}
|
||||||
|
|
||||||
|
async initData() {
|
||||||
|
let res = await getContactWorker();
|
||||||
|
console.log("initData", res);
|
||||||
|
if (res.data.code === 200) {
|
||||||
|
this.setState({ pictureUrl: res.data.data.pictureUrl });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { pictureUrl } = this.state;
|
||||||
|
return (
|
||||||
|
<Block>
|
||||||
|
<Navbar titleSlot="联系客服" isBack={true} />
|
||||||
|
<View className="img">
|
||||||
|
<Image
|
||||||
|
src={pictureUrl}
|
||||||
|
show-menu-by-longpress
|
||||||
|
mode="widthFix"
|
||||||
|
></Image>
|
||||||
|
</View>
|
||||||
|
</Block>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,165 @@
|
|||||||
|
page {
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
.infobox1 {
|
||||||
|
height: 320rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
z-index: 9;
|
||||||
|
.point_bg {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
.info1 {
|
||||||
|
justify-content: flex-end;
|
||||||
|
position: absolute;
|
||||||
|
top: 20rpx;
|
||||||
|
right: 0rpx;
|
||||||
|
min-width: 193rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
background: #ffffff;
|
||||||
|
border-radius: 25rpx 0rpx 0rpx 25rpx;
|
||||||
|
padding-right: 25rpx;
|
||||||
|
.tip1 {
|
||||||
|
padding-right: 23rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
.icon {
|
||||||
|
width: 10rpx;
|
||||||
|
height: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.info2 {
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 22rpx;
|
||||||
|
font-size: 72rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.info3 {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #000000;
|
||||||
|
padding-top: 55rpx;
|
||||||
|
}
|
||||||
|
.info4 {
|
||||||
|
margin: 30rpx auto 0;
|
||||||
|
text-align: center;
|
||||||
|
.tip1 {
|
||||||
|
font-weight: bold;
|
||||||
|
width: 210rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
background: #000000;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.icon {
|
||||||
|
width: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.infobox2 {
|
||||||
|
.nodata {
|
||||||
|
width: 160rpx;
|
||||||
|
height: 160rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 310rpx;
|
||||||
|
.nodata_img {
|
||||||
|
margin-bottom: 34rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.list_block {
|
||||||
|
width: 100%;
|
||||||
|
border-bottom: 2rpx solid #dddddd;
|
||||||
|
padding: 27rpx 0;
|
||||||
|
}
|
||||||
|
.list {
|
||||||
|
background: #fff;
|
||||||
|
padding: 0rpx 30rpx;
|
||||||
|
.left {
|
||||||
|
.tip1 {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #030000;
|
||||||
|
}
|
||||||
|
.tip2 {
|
||||||
|
margin-top: 14rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #999999;
|
||||||
|
/*line-height: 36rpx;*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.right {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #adadad;
|
||||||
|
}
|
||||||
|
.rights {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.popbox3 {
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
padding: 38rpx 0;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #030000;
|
||||||
|
line-height: 60rpx;
|
||||||
|
}
|
||||||
|
.tipimg {
|
||||||
|
margin: 20rpx 28rpx 0;
|
||||||
|
}
|
||||||
|
.tiptext {
|
||||||
|
/* text-align: center;
|
||||||
|
color: #4E4E4E; */
|
||||||
|
margin-top: 4rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
/* font-size: 32rpx; */
|
||||||
|
max-height: 800rpx;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
.popbox3btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.nextbtn {
|
||||||
|
background: #000000;
|
||||||
|
width: 270rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
margin: 41rpx auto 44rpx;
|
||||||
|
border-radius: 45rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.prebtn {
|
||||||
|
width: 180rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #d3bc8d;
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
margin: 50rpx auto 30rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
border: 1px solid #d3bc8d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,155 @@
|
|||||||
|
import { Component, PropsWithChildren, useEffect, useState } from "react";
|
||||||
|
import Taro from "@tarojs/taro";
|
||||||
|
import { Block, View, Text, Image, RichText } from "@tarojs/components";
|
||||||
|
|
||||||
|
import "./integral_list.less";
|
||||||
|
|
||||||
|
/** 自定义组件 **/
|
||||||
|
import Navbar from "../../components/navbar/navbar";
|
||||||
|
/** 自定义组件 **/
|
||||||
|
|
||||||
|
import PopupAlert from "../../components/popup/popup-alert";
|
||||||
|
|
||||||
|
import { GetIntegralRule, GetObtainUserIntegral } from "../../utils/Interface";
|
||||||
|
|
||||||
|
export default class IntegralList extends Component<any, any> {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
name: "我的积分",
|
||||||
|
userinfo: {},
|
||||||
|
page: 1,
|
||||||
|
list: [],
|
||||||
|
isIntegral: false,
|
||||||
|
nodes: "",
|
||||||
|
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async onLoad() {}
|
||||||
|
componentDidMount() {}
|
||||||
|
|
||||||
|
componentWillUnmount() {}
|
||||||
|
|
||||||
|
componentDidShow() {
|
||||||
|
this.initData();
|
||||||
|
this.GetIntegralRule();
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidHide() {}
|
||||||
|
|
||||||
|
async initData() {
|
||||||
|
this.GetObtainUserIntegral();
|
||||||
|
}
|
||||||
|
|
||||||
|
GetObtainUserIntegral = async () => {
|
||||||
|
let { list, pageNum, pageSize } = this.state;
|
||||||
|
let res = await GetObtainUserIntegral({
|
||||||
|
pageNum,
|
||||||
|
pageSize,
|
||||||
|
});
|
||||||
|
console.log("GetObtainUserIntegral", res);
|
||||||
|
if (res.data.code === 200) {
|
||||||
|
if (res.data.rows.length) {
|
||||||
|
list = [].concat(list, res.data.rows);
|
||||||
|
this.setState({ list: list });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
GetIntegralRule = async () => {
|
||||||
|
let res = await GetIntegralRule();
|
||||||
|
console.log("GetIntegralRule", res);
|
||||||
|
if (res.data.code === 200) {
|
||||||
|
this.setState({ nodes: res.data.data.value });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
integralPopupShow = () => {
|
||||||
|
this.setState({ isIntegral: true });
|
||||||
|
};
|
||||||
|
|
||||||
|
navigateToMiniProgram = () => {};
|
||||||
|
|
||||||
|
integralPopupClose = () => {
|
||||||
|
this.setState({ isIntegral: false });
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
let { list, userinfo, isIntegral, nodes } = this.state;
|
||||||
|
return (
|
||||||
|
<Block>
|
||||||
|
<PopupAlert
|
||||||
|
isLarge={true}
|
||||||
|
isClose={true}
|
||||||
|
isShow={isIntegral}
|
||||||
|
title="积分规则"
|
||||||
|
content={<RichText nodes={nodes} />}
|
||||||
|
confirmButtonText="我知道了"
|
||||||
|
textAlgin="center"
|
||||||
|
close={this.integralPopupClose}
|
||||||
|
confirm={this.integralPopupClose}
|
||||||
|
></PopupAlert>
|
||||||
|
<Navbar titleSlot="我的积分" isBack={true}></Navbar>
|
||||||
|
<View style="background: #f3f3f3;padding: 33rpx 30rpx 31rpx;">
|
||||||
|
<View className="infobox1">
|
||||||
|
<View
|
||||||
|
className="info1 flex aitems"
|
||||||
|
onClick={this.integralPopupShow}
|
||||||
|
>
|
||||||
|
<View className="tip1">积分规则</View>
|
||||||
|
<View className="icon">
|
||||||
|
<Image
|
||||||
|
src={require("../../img/user/right.png")}
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View className="info3">可用积分</View>
|
||||||
|
<View className="info2">{userinfo.credit2}</View>
|
||||||
|
<View className="info4 flex aitems jcenter">
|
||||||
|
<View className="tip1" onClick={this.navigateToMiniProgram}>
|
||||||
|
前往积分商城
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<Image
|
||||||
|
className="point_bg"
|
||||||
|
src={require("../../img/user/point-bg.png")}
|
||||||
|
mode="aspectFill"
|
||||||
|
></Image>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View className="infobox2">
|
||||||
|
{list.length === 0 && (
|
||||||
|
<View className="nodata">
|
||||||
|
<Image
|
||||||
|
className="nodata_img"
|
||||||
|
src={require("../../img/user/points.png")}
|
||||||
|
mode="aspectFill"
|
||||||
|
></Image>
|
||||||
|
<View>暂无数据</View>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
{list.map((item: any, key: number) => {
|
||||||
|
return (
|
||||||
|
<View className="list" key={key}>
|
||||||
|
<View className="list_block flex aitems sb">
|
||||||
|
<View className="left">
|
||||||
|
<View className="tip1">{item.log}</View>
|
||||||
|
<View className="tip2">{item.addtime}</View>
|
||||||
|
</View>
|
||||||
|
<View className="rights" style={item.style}>
|
||||||
|
{item.credit}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
</Block>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
page {
|
||||||
|
background: #f3f3f3;
|
||||||
|
}
|
||||||
|
.infobox1 {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
margin: 20rpx 30rpx 0;
|
||||||
|
padding: 20rpx 34rpx 48rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.info1 {
|
||||||
|
.left {
|
||||||
|
.icon {
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
.tip1 {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-left: 28rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.right {
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.info2 {
|
||||||
|
margin-top: 40rpx;
|
||||||
|
.content {
|
||||||
|
line-height: 50rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.no_message {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 200rpx;
|
||||||
|
& > .icon {
|
||||||
|
width: 200rpx;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
& > .tip {
|
||||||
|
text-align: center;
|
||||||
|
color: #666666;
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,110 @@
|
|||||||
|
import { MpSplashDetail, WCUserLogin } from "../../utils/Interface";
|
||||||
|
import { Component, PropsWithChildren, useEffect, useState } from "react";
|
||||||
|
import Taro from "@tarojs/taro";
|
||||||
|
import { Block, View, Text, Image, Button } from "@tarojs/components";
|
||||||
|
|
||||||
|
import "./message.less";
|
||||||
|
|
||||||
|
/** 自定义组件 **/
|
||||||
|
import Navbar from "../../components/navbar/navbar";
|
||||||
|
/** 自定义组件 **/
|
||||||
|
|
||||||
|
import { GetHasBeenRead, GetMessageList } from "../../utils/Interface";
|
||||||
|
|
||||||
|
export default class Message extends Component<any, any> {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
name: "message",
|
||||||
|
list: [],
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async onLoad() {}
|
||||||
|
componentDidMount() {}
|
||||||
|
|
||||||
|
componentWillUnmount() {}
|
||||||
|
|
||||||
|
componentDidShow() {
|
||||||
|
this.initData(); // 每次进入清空所有消息
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidHide() {}
|
||||||
|
|
||||||
|
async initData() {
|
||||||
|
this.GetHasBeenRead();
|
||||||
|
this.GetMessageList();
|
||||||
|
}
|
||||||
|
|
||||||
|
godetail = () => {};
|
||||||
|
|
||||||
|
// 获取消息分页
|
||||||
|
GetMessageList = async () => {
|
||||||
|
let { list } = this.state;
|
||||||
|
let res = await GetMessageList({
|
||||||
|
pageNum: this.state.pageNum,
|
||||||
|
pageSize: this.state.pageSize,
|
||||||
|
});
|
||||||
|
if (res.data.code === 200) {
|
||||||
|
if (res.data.rows.length) {
|
||||||
|
list = [].concat(list, res.data.rows);
|
||||||
|
this.setState({ list: list });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 清除所有消息数
|
||||||
|
GetHasBeenRead = async () => {
|
||||||
|
let res = await GetHasBeenRead();
|
||||||
|
if (res.data.code === 200) {
|
||||||
|
Taro.setStorageSync("messageCount", res.data.data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
let { list } = this.state;
|
||||||
|
return (
|
||||||
|
<Block>
|
||||||
|
<Navbar isBack={true}></Navbar>
|
||||||
|
<View style="padding-top: 13rpx">
|
||||||
|
{list.map((item: any, key: number) => {
|
||||||
|
<Block>
|
||||||
|
<View
|
||||||
|
className="infobox1"
|
||||||
|
onClick={this.godetail}
|
||||||
|
data-item={item}
|
||||||
|
key={key}
|
||||||
|
>
|
||||||
|
<View className="info1 flex aitems sb">
|
||||||
|
<View className="left flex aitems">
|
||||||
|
<View className="icon">
|
||||||
|
<Image
|
||||||
|
src={require("../../img/logos.png")}
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
<View className="tip1">系统通知</View>
|
||||||
|
</View>
|
||||||
|
<View className="right">{item.addtime}</View>
|
||||||
|
</View>
|
||||||
|
<View className="info2">
|
||||||
|
<View className="content">
|
||||||
|
<Text>
|
||||||
|
[花至官方旗舰店]: {item.content ? item.content : ""}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</Block>;
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style="height: 100rpx;"></View>
|
||||||
|
|
||||||
|
{list.length == 0 && <View className="nodata">暂无相关消息</View>}
|
||||||
|
</Block>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
.nodes {
|
||||||
|
padding: 30rpx;
|
||||||
|
word-break: break-all;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue