锶源昆仑会员+体验官

This commit is contained in:
2023-07-22 19:04:56 +08:00
commit 5a6b3517e6
439 changed files with 20654 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
noticeData: [] //消息列表
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取消息通知列表
this.noticeInfo();
},
/**
* 消息通知列表
*/
noticeInfo (){
wx.$api.user.notice().then(res => {
this.setData({
noticeData: res.data
})
}).catch(err => {})
},
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "我的消息"
}

View File

@@ -0,0 +1,13 @@
<view class="news">
<navigator hover-class="none" url="../list/index?type={{item.type}}" class="item {{item.count > 0 ? 'active' : ''}}" wx:for="{{noticeData}}" wx:key="noticeData">
<image class="item-icon" src="{{item.icon}}" mode="widthFix"></image>
<view class="item-text">
<view class="item-name">
{{item.name}}
</view>
<view class="item-tips">
锶源昆仑饮水-平台系统通知
</view>
</view>
</navigator>
</view>

View File

@@ -0,0 +1,46 @@
.news {
background-color: #FFFFFF;
padding: 30rpx;
box-sizing: border-box;
}
.item {
margin-bottom: 30rpx;
padding-bottom: 30rpx;
display: flex;
position: relative;
}
.item.active::after {
position: absolute;
content: '';
left: 64rpx;
top: 2rpx;
background-color: #e44a3f;
border: 4rpx solid #FFFFFF;
width: 16rpx;
height: 16rpx;
border-radius: 50%;
}
.item-icon {
width: 84rpx;
height: 84rpx;
margin-top: 4rpx;
position: relative;
}
.item-text {
width: calc(100% - 114rpx);
border-bottom: 2rpx solid #f3f3f3;
margin-left: 30rpx;
padding-bottom: 40rpx;
}
.item-name {
margin-bottom: 10rpx;
}
.item-tips {
font-size: 26rpx;
color: #9d9d9d;
}

View File

@@ -0,0 +1,41 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
noticeData: [], //内容
noticeId : ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
noticeId: options.id
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取消息内容
this.noticeInfo();
},
// 消息通知列表
noticeInfo(){
wx.$api.user.noticeShow(this.data.noticeId).then(res => {
this.setData({
noticeData: res.data
})
}).catch(err => {})
},
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "消息详情"
}

View File

@@ -0,0 +1,11 @@
<view class="list">
<view class="list-name">
{{noticeData.title}}
</view>
<view class="list-time">
{{noticeData.created_at}}
</view>
<view class="list-text">
{{noticeData.content}}
</view>
</view>

View File

@@ -0,0 +1,25 @@
page{
background: #f4f5f9;
padding: 30rpx;
box-sizing: border-box;
height: 100vh;
}
.list {
padding: 30rpx;
box-sizing: border-box;
background-color: #FFFFFF;
border-radius: 10rpx;
margin-bottom: 30rpx;
}
.list-time {
font-size: 26rpx;
color: #9d9d9d;
margin: 20rpx 0 30rpx;
}
.list-text {
font-size: 28rpx;
color: #4a4a4a;
}

75
pages/news/list/index.js Normal file
View File

@@ -0,0 +1,75 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
type : '',
noticeArr: [] //列表
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
type: options.type
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取消息通知列表
this.noticeInfo();
},
/**
* 消息通知列表
*/
noticeInfo (page){
wx.$api.user.noticeList(this.data.type, {
page: page,
}).then(res => {
let listArr = this.data.noticeArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
this.setData({
noticeArr : newData,
page : res.data.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err => { })
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取消息通知列表
this.noticeInfo();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取消息通知列表
this.noticeInfo(pageNumber);
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "消息列表"
}

View File

@@ -0,0 +1,50 @@
<block wx:if="{{noticeArr.length > 0}}">
<navigator hover-class="none" url="../details/index?id={{item.notification_id}}" class="list" wx:for="{{noticeArr}}" wx:key="index">
<view class="unread" wx:if="{{item.read_at == ''}}">未读</view>
<view class="list-top">
<block wx:if="{{type == 'SystemOpenVip'}}">
<image src="http://api.siyuankunlun.com/storage/materials/2022/08/09/newsIcon_04.jpg" mode="widthFix"></image>
<text>开通会员通知</text>
</block>
<block wx:elif="{{type == 'SystemOrderDelivered'}}">
<image src="http://api.siyuankunlun.com/storage/materials/2022/08/09/newsIcon_02.jpg" mode="widthFix"></image>
<text>发货通知</text>
</block>
<block wx:elif="{{type == 'SystemRemindUserSign'}}">
<image src="http://api.siyuankunlun.com/storage/materials/2022/08/09/newsIcon_01.png" mode="widthFix"></image>
<text>打卡通知</text>
</block>
<block wx:else>
<image src="http://api.siyuankunlun.com/storage/materials/2022/08/09/newsIcon_05.png" mode="widthFix"></image>
<text>上传报告通知</text>
</block>
</view>
<view class="list-cont">
<view class="nowrap list-name">
{{item.title}}
</view>
<view class="list-label">
<view class="list-text">
<text>时间:</text>
<view class="list-time">
{{item.created_at}}
</view>
</view>
<view class="list-text">
<text>内容:</text>
<view class="list-time">
{{item.content}}
</view>
</view>
</view>
</view>
<view class="list-more">
<text>查看详情</text>
<image src="/static/icons/arrow_more.png"></image>
</view>
</navigator>
</block>
<view class="pack-center pages-hint" wx:else>
<image src="/static/imgs/coupon_null.png"></image>
<view>暂无数据</view>
</view>

View File

@@ -0,0 +1,88 @@
page{
background: #f4f5f9;
padding: 30rpx;
box-sizing: border-box;
}
.list {
background-color: #FFFFFF;
border-radius: 10rpx;
margin-bottom: 30rpx;
position: relative;
}
.unread {
position: absolute;
right: 0;
top: 0;
background-color: #e44a3f;
border-radius: 0 10rpx 0 10rpx;
font-size: 22rpx;
color: #FFFFFF;
padding: 0 15rpx;
line-height: 44rpx;
}
.list-top {
display: flex;
font-size: 26rpx;
line-height: 44rpx;
padding: 20rpx 25rpx;
box-sizing: border-box;
}
.list-top image {
width: 44rpx;
height: 44rpx;
margin-right: 20rpx;
}
.list-cont {
padding: 20rpx 25rpx;
box-sizing: border-box;
border-bottom: 2rpx solid rgb(243, 243, 243);
border-top: 2rpx solid rgb(243, 243, 243);
}
.list-label {
margin-top: 20rpx;
}
.list-name {
font-size: 30rpx;
}
.list-text {
display: flex;
font-size: 26rpx;
line-height: 60rpx;
}
.list-text text {
color: #999;
display: inline-block;
width: 90rpx;
}
.list-time {
width: calc(100% - 90rpx);
}
.list-more {
display: flex;
font-size: 26rpx;
padding: 0 25rpx;
box-sizing: border-box;
line-height: 70rpx;
}
.list-more text {
flex: 1;
display: inline-block;
}
.list-more image {
width: 24rpx;
height: 24rpx;
margin-top: 22rpx;
}