会员模块

This commit is contained in:
2023-12-15 17:53:08 +08:00
commit 2a998468d9
282 changed files with 14521 additions and 0 deletions

77
pages/water/index.js Normal file
View File

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

3
pages/water/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

45
pages/water/index.wxml Normal file
View File

@@ -0,0 +1,45 @@
<view class="tips">
水滴的使用规则:可以进行商品兑换
<image src="/static/icons/water_close.png"></image>
</view>
<view class="water">
<view class="water-top">
水滴账户<image src="/static/icons/water_icon.png"></image>
</view>
<view class="water-number">
{{score}}
</view>
<navigator hover-class="none" url="/pages/water/product/index" class="water-btn">水滴商城 ></navigator>
</view>
<view class="detailed">
<view class="title">
水滴明细
</view>
<view class="list" wx:if="{{logsArr.length > 0}}">
<view class="item" wx:for="{{logsArr}}" wx:key="logsArr">
<view class="top">
<view class="name">
{{item.remark}}
</view>
<view class="number">
{{item.amount}}<text>水滴</text>
</view>
</view>
<view class="time">
时间:<text>{{item.created_at}}</text>
</view>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icons/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
<view class="pages-no" wx:else>
<image src="/static/imgs/coupon_null.png" mode="widthFix"></image>
<view>暂无数据</view>
</view>
</view>

143
pages/water/index.wxss Normal file
View File

@@ -0,0 +1,143 @@
.tips {
background-color: #f7edee;
padding: 20rpx 180rpx 20rpx 30rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #b76371;
position: fixed;
width: 100%;
z-index: 9;
top: 0;
left: 0;
}
.tips image {
width: 40rpx;
height: 40rpx;
position: absolute;
right: 20rpx;
top: calc(50% - 24rpx);
}
.water {
background-color: #fff;
text-align: center;
padding: 10rpx 0 40rpx;
position: fixed;
width: 100%;
height: 200rpx;
top: 120rpx;
left: 0;
z-index: 9;
}
.water-top image {
width: 30rpx;
height: 30rpx;
vertical-align: -2rpx;
padding-left: 5rpx;
}
.water-number {
font-size: 62rpx;
margin-top: 10rpx;
color: #3d45e5;
font-weight: 600;
}
.water-btn {
display: inline-block;
background-color: #3d45e5;
color: #fff;
line-height: 58rpx;
padding: 0 20rpx;
border-radius: 10rpx;
font-size: 26rpx;
margin-top: 20rpx;
}
.detailed {
background-color: #f4f3f9;
left: 0;
top: 360rpx;
height: calc(100vh - 320rpx);
position: absolute;
width: 100%;
overflow: hidden;
overflow-y: scroll;
}
.title {
text-align: center;
color: #3f47d6;
position: relative;
line-height: 100rpx;
font-weight: 600;
}
.title::after {
position: absolute;
content: '';
left: calc(50% - 20rpx);
bottom: 0;
width: 40rpx;
height: 6rpx;
border-radius: 10rpx;
background-color: #4952e4;
}
.list {
padding: 30rpx;
box-sizing: border-box;
}
.item {
background-color: #fff;
border-radius: 20rpx;
margin-bottom: 30rpx;
padding: 20rpx;
box-sizing: border-box;
}
.top {
display: flex;
margin-bottom: 10rpx;
}
.name {
flex: 1;
font-weight: 600;
font-size: 30rpx;
}
.number {
color: red;
}
.number text {
color: #9d9d9d;
font-size: 28rpx;
padding-left: 5rpx;
}
.number.active {
color: green;
}
.time {
font-size: 28rpx;
color: #6d6d6d;
}
.pages-no {
background-color: #fff;
margin-top: 30rpx;
text-align: center;
padding: 120rpx 0;
color: #6d6d6d;
font-size: 28rpx;
}
.pages-no image {
width: 180rpx;
}

View File

@@ -0,0 +1,81 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
categorieArr: [], //分类
articlesArr : [] , //列表
page : {}, //分页信息
listType : '', //类型
lodingStats : false, //加载状态
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取列表
this.articlesInfo();
},
// 列表
articlesInfo(page){
wx.$api.user.scoresGoods({
name : '',
page : page || 1
}).then(res => {
console.log(res.data.data)
let listArr = this.data.articlesArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
this.setData({
articlesArr : newData,
page : res.data.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err => {})
},
/**
* 状态筛选
*/
onTabs(val){
if(this.data.listType === val) return
this.setData({
listType: val.currentTarget.dataset.type
})
// 商品详情数据
this.articlesInfo();
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取列表
this.articlesInfo();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取列表
this.articlesInfo(pageNumber);
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "水滴商城"
}

View File

@@ -0,0 +1,31 @@
<!-- <view class="header">
<scroll-view class="header-view" scroll-x="true" bindscroll="scroll">
<view wx:for="{{categorieArr}}" wx:key="categorieArr" class="tabs-item {{listType == item.category_id ? 'show' : ''}}" bindtap="onTabs" data-type="{{item.category_id}}">{{item.name}}</view>
</scroll-view>
</view> -->
<view class="list" wx:if="{{articlesArr.length > 0}}">
<navigator hover-class="none" url="/pages/mall/buy/index?id={{item.goods_id}}&type=waterType" wx:for="{{articlesArr}}" wx:key="articlesArr" class="item">
<image class="itemImg" mode="aspectFill" src="{{item.cover}}"></image>
<view class="itemCont">
<view class="nowrap itemCont-name">{{item.name}}</view>
<view class="nowrap itemCont-text">{{item.description}}</view>
<view class="itemCont-price">
<!-- <image src="/static/icons/newIcon_03.png"></image> -->
¥{{item.price.price_max}}
</view>
</view>
</navigator>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
<view class="pack-center pages-hint" wx:else>
<image src="/static/imgs/coupon_null.png"></image>
<view>暂无数据</view>
</view>

View File

@@ -0,0 +1,108 @@
page {
background-color: #f6f6f6;
}
.list {
background-color: #ffffff;
padding: 30rpx;
box-sizing: border-box;
margin-top: 30rpx;
}
.item {
position: relative;
height: 180rpx;
margin-bottom: 30rpx;
border-bottom: 2rpx solid #eeeeee;
padding-bottom: 30rpx;
}
.item:last-child {
margin-bottom: 0;
padding-bottom: 0;
border: none;
}
.itemImg {
position: absolute;
left: 0;
top: 0;
width: 180rpx;
height: 180rpx;
border-radius: 10rpx;
overflow: hidden;
}
.itemCont {
position: absolute;
left: 0;
top: 0;
padding-left: 210rpx;
box-sizing: border-box;
width: 100%;
}
.itemCont-name {
line-height: 48rpx;
font-size: 30rpx;
}
.itemCont-text {
color: #999;
font-size: 26rpx;
margin: 15rpx 0 35rpx;
font-weight: 200;
}
.itemCont-price {
color: #f3ad47;
font-size: 36rpx;
}
.itemCont-price image {
width: 22rpx;
height: 22rpx;
padding-right: 5rpx;
}
/* tabs */
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 99;
background-color: #ffffff;
line-height: 78rpx;
}
.header-view {
padding: 0 30rpx;
box-sizing: border-box;
font-size: 30rpx;
}
.tabs {
display: flex;
justify-content: space-around;
background: white;
padding: 15rpx 0;
font-size: 30rpx;
color: #9d9d9d;
height: 74rpx;
}
.tabs-item {
display: inline-block;
padding: 0 50rpx;
}
.tabs-item.show {
color: #1d37e2;
background-color: #f6f6f6;
border-radius: 10rpx 10rpx 0 0;
}
/* .list {
margin-top: 110rpx;
} */