锶源昆仑会员+体验官

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

109
pages/stock/index/index.js Normal file
View File

@@ -0,0 +1,109 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
stockData: '', //数据
address : '', //地址
listArr : [], //提货列表数据
avatar : '', //头像
identity : '', //身份
page : {}, //下一页
lodingStats : false,//加载状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取用户信息
this.userInfo();
// 获取提货前置
this.pickInfo();
// 获取提货列表
this.pickList();
},
/**
* 用户信息
*/
userInfo() {
wx.$api.user.userIndex().then(res => {
this.setData({
avatar : res.data.avatar,
identity : res.data.identity
})
}).catch(err => {})
},
/**
* 提货前置
*/
pickInfo (){
wx.$api.stock.pick().then(res => {
this.setData({
stockData : res.data.stockData,
address : res.data.address
})
}).catch(err => {})
},
/**
* 提货列表
*/
pickList (page){
wx.$api.stock.list({
page: page
}).then(res => {
let listArr = this.data.listArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
this.setData({
listArr : newData,
page : res.data.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err => {})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取提货列表
this.pickList();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取提货列表
this.pickList(pageNumber);
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "库存量"
}

View File

@@ -0,0 +1,90 @@
<view class="user">
<navigator hover-class="none" url="../detailed/index" class="user-order">
<image src="/static/icons/stock_order.png" mode=""></image>
</navigator>
<image class="user-head" src="{{avatar ? avatar : '/static/imgs/default_myHead.png'}}"></image>
<view class="user-member" wx:if="{{identity.order == '2'}}">
<image src="/static/icons/stock_icon.png" mode=""></image>
</view>
</view>
<view class="stock-top">
<view class="top-title">
<text>库存总数量</text>(单位:箱)
</view>
<view class="top-number">
<image src="/static/icons/water.png" mode="widthFix"></image>{{stockData.residue}}
</view>
</view>
<view class="stock-label">
<view class="stock-cont">
<view class="stock-item">
<image class="stock-icon" src="/static/icons/stock_icon_01.png" mode="widthFix"></image>
<view class="stock-number">{{stockData.hold}}<text>箱</text></view>
<view class="stock-tips">已提数量</view>
</view>
<view class="stock-item">
<image class="stock-icon" src="/static/icons/stock_icon_02.png" mode="widthFix"></image>
<view class="stock-number">{{stockData.residue}}<text>箱</text></view>
<view class="stock-tips">待提数量</view>
</view>
<view class="stock-btn">
<navigator hover-class="none" url="../take/index" class="btn">
<text>申请提货</text>
<image src="/static/icons/arrow.png"></image>
</navigator>
<navigator hover-class="none" url="../site/index" class="btn">
<text>地址管理</text>
<image src="/static/icons/arrow_grey.png"></image>
</navigator>
</view>
</view>
</view>
<view class="record">
<view class="title">
<view class="name">
<image src="/static/icons/stock_nav.png" mode="widthFix"></image> 提货记录
</view>
<navigator hover-class="none" url="../list/index" class="more" wx:if="{{listArr.length > 0}}">
查看全部
<image src="/static/icons/arrow_more.png"></image>
</navigator>
</view>
<view class="list" wx:if="{{listArr.length > 0}}">
<view class="item" wx:for="{{listArr}}" wx:key="listArr">
<view class="item-top">
<view class="item-name">
提货量
</view>
<view class="item-number">
{{item.items[0].qty}}<text>(箱)</text>
</view>
</view>
<view class="item-label">
<view class="item-left">申请时间</view>
<view class="item-right">{{item.created_at}}</view>
</view>
<view class="item-label">
<view class="item-left">申请状态</view>
<view class="item-right item-state green" wx:if="{{item.can.cancel}}">{{item.state}}</view>
<view class="item-right item-state yellow" wx:elif="{{item.can.sign}}">{{item.state}}</view>
<view class="item-right item-state" wx:else>{{item.state}}</view>
</view>
</view>
<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="recommend-hint" wx:else>
<image src="/static/imgs/coupon_null.png"></image>
<view>~抱歉,暂无内容~</view>
</view>
</view>

View File

@@ -0,0 +1,261 @@
/* 用户 */
.user {
text-align: right;
box-sizing: border-box;
position: relative;
height: 150rpx;
}
.user-order {
position: absolute;
left: 55rpx;
top: 30rpx;
background-color: #e9eaef;
width: 80rpx;
height: 80rpx;
text-align: center;
border-radius: 50%;
padding: 16rpx;
box-sizing: border-box;
}
.user-order image {
width: 100%;
height: 100%;
}
.user-head {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
position: absolute;
right: 30rpx;
top: 30rpx;
border: 2rpx solid #efefef;
}
.user-member {
position: absolute;
right: 80rpx;
top: 84rpx;
width: 30rpx;
height: 30rpx;
line-height: 26rpx;
text-align: center;
background-color: #1835c1;
border-radius: 50%;
}
.user-member image {
width: 16rpx;
height: 16rpx;
}
.stock-top {
padding: 0 30rpx 30rpx 60rpx;
box-sizing: border-box;
}
.top-title {
color: #82828e;
margin-bottom: 20rpx;
display: flex;
line-height: 34rpx;
font-size: 32rpx;
}
.top-title text {
flex: 1;
}
.top-number {
font-size: 72rpx;
color: #333657;
}
.top-number image {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
}
.stock-label {
padding-left: 60rpx;
box-sizing: border-box;
background: #ecf4f6;
padding-top: 40rpx;
height: 430rpx;
}
.stock-cont {
background-color: #1d37e2;
border-radius: 60rpx 0 0 60rpx;
padding: 60rpx 30rpx 90rpx 90rpx;
box-sizing: border-box;
display: flex;
position: relative;
}
.stock-item {
color: #FFFFFF;
flex: 2;
}
.stock-icon {
width: 34rpx;
height: 34rpx;
}
.stock-number {
font-size: 50rpx;
margin-bottom: 10rpx;
}
.stock-numbe text {
font-size: 28rpx;
padding-left: 10rpx;
}
.stock-tips {
font-size: 28rpx;
color: #8999ff;
}
.stock-btn {
position: absolute;
bottom: -40rpx;
right: 0;
display: flex;
}
.btn {
background-color: #FFFFFF;
height: 80rpx;
line-height: 80rpx;
margin-right: 30rpx;
padding: 0 40rpx;
border-radius: 30rpx;
}
.btn:first-child {
color: #FFFFFF;
background-color: #4d70fe;
box-shadow: 0 3rpx 6rpx 2rpx rgba(79, 99, 226, .6);
}
.btn:last-child {
color: #8a5400;
background-color: #f9d093;
box-shadow: 0 3rpx 6rpx 2rpx rgba(255, 192, 92, .6);
}
.btn text {
padding-right: 10rpx;
}
.btn image {
width: 24rpx;
height: 24rpx;
}
.record {
padding: 30rpx;
box-sizing: border-box;
}
.title {
display: flex;
}
.name {
flex: 1;
font-weight: 600;
display: flex;
}
.name image {
width: 42rpx;
height: 42rpx;
margin-right: 10rpx;
}
.more {
font-size: 30rpx;
color: #9d9d9d;
line-height: 42rpx;
}
.more image {
width: 24rpx;
height: 24rpx;
}
.list {
margin-top: 30rpx;
}
.item {
border: 2rpx solid #f3f3f3;
padding: 30rpx 30rpx 20rpx;
box-sizing: border-box;
border-radius: 30rpx;
margin-bottom: 30rpx;
}
.item-top {
display: flex;
margin-bottom: 20rpx;
}
.item-name {
flex: 1;
font-weight: 600;
}
.item-number {
color: #2487ff;
font-weight: 600;
}
.item-number text {
font-size: 26rpx;
padding-left: 10rpx;
font-weight: normal;
}
.item-label {
line-height: 60rpx;
display: flex;
font-size: 28rpx;
color: #9d9d9d;
}
.item-left {
flex: 1;
}
.item-state {
color: #eb504c;
}
.item-state.green {
color: #03af03;
}
.item-state.yellow {
color: #8a5400;
}
/* 暂无内容 */
.recommend-hint {
text-align: center;
color: #999;
padding: 100rpx 0;
font-size: 28rpx;
}
.recommend-hint image {
width: 160rpx;
height: 160rpx;
}