Commit 276575ec by LJM

我的消息

parent ba551534
.page-userCoupon {
padding-top: 88rpx;
.go-coupon {
text-align: right;
font-size: 28rpx;
color: #1969f9;
}
.tab {
background: #ffffff;
height: 88rpx;
margin-bottom: 16rpx;
.box {
position: relative;
height: 100%;
transition: all 0.4s ease;
.t1 {
font-size: 28rpx;
color: #484b59;
}
.t2 {
font-size: 28rpx;
color: #292b33;
font-weight: bold;
}
.t3 {
font-size: 24rpx;
color: #919399;
}
&.curr {
&::after {
position: absolute;
bottom: 0;
left: 0;
right: 0;
width: 53rpx;
height: 7rpx;
margin: 0 auto;
background: #1969f9;
border-radius: 4rpx;
content: '';
}
}
}
}
.list {
padding: 0 24rpx;
.box {
position: relative;
height: 176rpx;
background: #ffffff;
border-radius: 0px 10rpx 10rpx 0px;
margin-bottom: 16rpx;
.left {
width: 230rpx;
height: 176rpx;
background: url('https://img.ichunt.com/images/ichunt/202305/19/e8f03900544551d09436a542ee7d0ea0.png') no-repeat center;
background-size: cover;
.p1 {
margin-bottom: 8rpx;
.t1 {
font-size: 22rpx;
color: #ffffff;
}
.t2 {
margin-left: 10rpx;
font-size: 60rpx;
color: #ffffff;
font-family: Impact;
}
}
.p2 {
font-size: 20rpx;
color: #ffffff;
}
}
.right {
padding-left: 24rpx;
.p1 {
margin-bottom: 16rpx;
.t1 {
font-size: 22rpx;
color: #484b59;
}
.t2 {
font-size: 22rpx;
color: #1969f9;
}
}
.p2 {
margin-bottom: 16rpx;
}
.p3 {
width: 142rpx;
height: 40rpx;
border-radius: 6rpx;
border: 1px solid #1969f9;
font-size: 22rpx;
color: #1969f9;
}
}
.type {
position: absolute;
right: 0;
top: 0;
width: 82rpx;
height: 68rpx;
background: url('https://img.ichunt.com/images/ichunt/202305/22/0aaf37437c984408376b330da3dbf323.png') no-repeat center;
background-size: cover;
z-index: 99;
.tt {
margin-left: 22rpx;
margin-top: 6rpx;
text-align: center;
transform: rotate(45deg);
color: #fff;
font-size: 22rpx;
}
}
&.disabled {
.left {
background: url('https://img.ichunt.com/images/ichunt/202305/19/ebf691eb49a2a3dffe612baea352a7b6.png') no-repeat center;
background-size: cover;
}
}
}
}
}
.no-data {
image {
width: 356rpx;
height: 356rpx;
}
.tt {
margin-top: 32rpx;
font-size: 28rpx;
color: #292b33;
}
}
<template>
<view class="page-userCoupon">
<navElement title="我的优惠券">
<template slot="title-bar">
<navigator class="go-coupon" url="/user/activity" hover-class="none">去领券</navigator>
</template>
</navElement>
<view class="tab row avarage verCenter">
<view class="box row rowCenter verCenter" @click="tab(index)" :class="{ curr: index == curr }" :key="index" v-for="(item, index) in text_arr">
<text class="t2">{{ item }}</text>
<text class="t3">({{ count[index] }})</text>
</view>
</view>
<view class="list" v-if="list.length > 0">
<view class="box row verCenter" v-for="(item, index) in list" :key="index">
<view class="left column rowCenter verCenter">
<view class="p1">
<template v-if="item.coupon_type == 1">
<text class="t1"></text>
<text class="t2">{{ item.sale_amount.toFixed(2) }}</text>
</template>
<template v-else-if="item.coupon_type == 2">
<text class="t2">{{ (item.sale_amount * 10).toFixed(2) }}</text>
<text class="t1"></text>
</template>
</view>
<view class="p2">{{ item.require_desc }}</view>
</view>
<view class="right">
<view class="p1">
<template v-if="item.coupon_goods_range == 1">
<text class="t1">适用于</text>
<text class="t2">{{ item.coupon_mall_type == 1 ? '全站' : item.coupon_mall_type == 2 ? '全部自营' : '全部联营' }}</text>
<text class="t1">商品</text>
</template>
<template v-else>
<text class="t1">适用于</text>
<text class="t2">{{ item.selected_supplier ? '供应商' + item.selected_supplier : '' }}{{ item.selected_brand ? '制造商' + item.selected_brand : '' }}</text>
<text class="t1">所有商品</text>
</template>
</view>
<view class="p2">{{ item.start_time }} - {{ item.end_time }}</view>
<navigator class="p3 row rowCenter verCenter" v-if="item.status == -1" url="/" hover-class="none">立即使用</navigator>
</view>
<view class="type">
<view class="tt">{{ item.coupon_mall_type == 1 ? '全站' : item.coupon_mall_type == 2 ? '自营' : '联营' }}</view>
</view>
</view>
</view>
<template v-else>
<view class="no-data column rowCenter verCenter">
<image src="../../static/nodate.png"></image>
<text class="tt">暂无优惠券信息</text>
</view>
</template>
</view>
</template>
<script>
import { Api_Url } from '@/util/api.js';
import navElement from '@/components/nav.vue';
export default {
components: {
navElement
},
data() {
return {
curr: 0,
text_arr: ['未使用', '已使用', '已过期'],
list: [],
count: [],
searchParams: {
status: -1
}
};
},
onShow() {
this.getData();
},
methods: {
tab(index) {
this.curr = index;
if (index == 0) {
this.searchParams.status = -1;
} else if (index == 1) {
this.searchParams.status = 1;
} else if (index == 2) {
this.searchParams.status = -2;
}
this.getData();
},
getData() {
this.request(Api_Url + '/ucoupon/count', 'POST', {}, true, true).then(res => {
if (res.err_code === 0) {
this.count[0] = res.data[-1];
this.count[1] = res.data[1];
this.count[2] = res.data[-2];
}
});
this.request(Api_Url + '/ucoupon/lists', 'POST', this.searchParams, true, true).then(res => {
if (res.err_code === 0) {
this.list = res.data;
} else if (res.err_code == 11012) {
uni.navigateTo({
url: '/login?referer=/user/inquery'
});
}
});
}
}
};
</script>
<style lang="scss">
@import '@/assets/css/mine/coupon.scss';
</style>
......@@ -4,10 +4,11 @@
<view class="tab row avarage verCenter">
<text class="box row verCenter" @click="tab(index)" :class="{ curr: index == curr }" :key="index" v-for="(item, index) in text_arr">
<text class="tt">{{ item }}</text>
<text class="msg row rowCenter verCenter" v-if="index == 1">{{ unreadcount }}</text>
</text>
</view>
<view class="list" v-if="list.length > 0">
<navigator class="box row verCenter" v-for="(item, index) in list" :key="index" url="/user/msgDetail" hover-class="none">
<navigator class="box row verCenter" v-for="(item, index) in list" :key="index" :url="'/user/msgDetail?msg_id=' + item.msg_id" hover-class="none">
<!-- 公告 -->
<template v-if="item.msg_type == 1">
<text class="iconfont icon-a-juxing4"></text>
......@@ -27,9 +28,7 @@
<view class="text column">
<view class="row">
<view class="t1">{{ item.title }}</view>
<template v-if="item.status == 1">
<text class="arrow"></text>
</template>
<text class="arrow" v-if="item.status == 1"></text>
</view>
<view class="content" v-html="item.content"></view>
</view>
......@@ -53,6 +52,7 @@ export default {
data() {
return {
curr: 0,
unreadcount: 0,
text_arr: ['全部', '未读', '已读'],
searchParams: {
p: 1,
......@@ -77,25 +77,11 @@ export default {
}
this.getData();
},
/**
* 已读消息
*/
changeMessageStatus(msg_id) {
this.request(Api_Url + '/msg/getMessageListsByUserId', 'POST', { status: 1, msg_id: msg_id }, true, true).then(res => {
if (res.err_code === 0) {
this.getData();
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
getData() {
this.request(Api_Url + '/msg/getMessageListsByUserId', 'POST', this.searchParams, true, true).then(res => {
if (res.err_code === 0) {
this.list = res.data.list;
this.unreadcount = res.data.unreadcount;
} else if (res.err_code === 11012) {
uni.navigateTo({
url: '/login'
......
......@@ -2,9 +2,9 @@
<view class="page-msg-detail">
<navElement title="消息详情"></navElement>
<view class="content">
<view class="t1">恭喜您获得会员专享200.00元抵扣券一张!</view>
<view class="t2">2023-04-12 11:16</view>
<view class="desc">尊敬的会员: 您好! 恭喜您获得会员专享200.00元抵扣券一张,有效期:2023-04-06,可用于猎芯网下单。 使用规则: 1、该券可用于猎芯网下单; 2、该券仅用于您个人账户下单; 3、该券满10000元可用,可用于全站所有商品; 再次感谢您对猎芯网的支持,我们为您提供涵盖购买、报关、仓储、金融等整个交易环节服务,品质可追溯,服务更贴心。 *活动最终解释权由猎芯网所有</view>
<view class="t1">{{ detail.title }}</view>
<view class="t2">{{ detail.actual_send_time_format }}</view>
<view class="desc" v-html="detail.content"></view>
</view>
</view>
</template>
......@@ -17,10 +17,57 @@ export default {
navElement
},
data() {
return {};
return {
detail: {},
msg_id: '',
searchParams: {
p: 1,
limit: 1000,
status: ''
}
};
},
onShow() {},
methods: {}
onLoad(options) {
this.msg_id = options.msg_id;
},
onShow() {
this.getData();
},
methods: {
/**
* 已读消息
*/
changeMessageStatus() {
this.request(Api_Url + '/msg/changeMessageStatus', 'POST', { msg_id: this.msg_id, status: 1 }, true, true).then(res => {
if (res.err_code === 0) {
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
getData() {
var self = this;
this.request(Api_Url + '/msg/getMessageListsByUserId', 'POST', this.searchParams, true, true).then(res => {
if (res.err_code === 0) {
var data = res.data.list.filter(function(item) {
return item.msg_id == self.msg_id;
});
this.detail = data[0];
//已读
if (data[0].status == 1) {
this.changeMessageStatus();
}
} else if (res.err_code === 11012) {
uni.navigateTo({
url: '/login'
});
}
});
}
}
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment