锶源昆仑会员+体验官
This commit is contained in:
183
pages/stock/addSite/index.js
Normal file
183
pages/stock/addSite/index.js
Normal file
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
name : '', // 姓名
|
||||
mobile : '', // 电话
|
||||
address : '', // 地址
|
||||
defaultVal: '', // 默认地址
|
||||
// 省份选择
|
||||
areasArr : [],
|
||||
areaId : '',
|
||||
areaIndex : 0,
|
||||
|
||||
// 市级选择
|
||||
cityArr : [],
|
||||
cityId : 0,
|
||||
cityIndex : 0,
|
||||
|
||||
// 区域选择
|
||||
regiArr : [],
|
||||
regiId : 0,
|
||||
regiIndex : 0,
|
||||
|
||||
disabled : false
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
experience: options.experience
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
if(this.data.experience != false) {
|
||||
this.setData({
|
||||
areaIndex: 18
|
||||
})
|
||||
}
|
||||
|
||||
// 获取省市区列表
|
||||
this.createInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 省市区列表
|
||||
*/
|
||||
createInfo() {
|
||||
wx.$api.stock.create().then(res => {
|
||||
let areas = res.data,
|
||||
areaIndex = this.data.areaIndex
|
||||
|
||||
this.setData({
|
||||
areasArr : areas,
|
||||
areaId : areas[areaIndex].id,
|
||||
|
||||
})
|
||||
this.citylist(areas[areaIndex].id)
|
||||
}).catch(err => {})
|
||||
},
|
||||
|
||||
/**
|
||||
* 所在省份-下拉
|
||||
*/
|
||||
areasChange(e) {
|
||||
let area = this.data.areasArr,
|
||||
index = e.detail.value,
|
||||
atcode = area[index].id
|
||||
if (index != this.data.areaIndex) {
|
||||
this.setData({
|
||||
areaIndex : index,
|
||||
areaId : atcode
|
||||
})
|
||||
// 获取市级列表
|
||||
this.citylist(atcode)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 市级列表
|
||||
*/
|
||||
citylist(cityId) {
|
||||
wx.$api.stock.create({
|
||||
parent_id: cityId
|
||||
}).then(res=>{
|
||||
let cityArr = res.data
|
||||
// 从体验官入口进入 默认为深圳
|
||||
if(this.data.experience) {
|
||||
this.setData({
|
||||
cityId : cityArr[2].id,
|
||||
cityIndex : 2,
|
||||
cityArr : cityArr
|
||||
})
|
||||
this.regilist(cityArr[2].id)
|
||||
return
|
||||
}
|
||||
|
||||
this.setData({
|
||||
cityId : cityArr[0].id,
|
||||
cityIndex : 0,
|
||||
cityArr : cityArr
|
||||
})
|
||||
|
||||
// 获取区级列表
|
||||
this.regilist(cityArr[0].id)
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 市级下拉筛选
|
||||
*/
|
||||
cityDrop(e) {
|
||||
let city = this.data.cityArr,
|
||||
index = e.detail.value,
|
||||
citycode = city[index].id
|
||||
if (index != this.data.areaIndex) {
|
||||
this.setData({
|
||||
cityIndex : index,
|
||||
qcityId : citycode
|
||||
})
|
||||
|
||||
// 获取市级列表
|
||||
this.regilist(citycode)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 区列表
|
||||
*/
|
||||
regilist(areaId) {
|
||||
wx.$api.stock.create({
|
||||
parent_id: areaId
|
||||
}).then(res=>{
|
||||
this.setData({
|
||||
regiArr : res.data,
|
||||
regiId : res.data[0].id,
|
||||
regiIndex : 0
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 区下拉筛选
|
||||
*/
|
||||
regiDrop(e) {
|
||||
let newIndex = e.detail.value
|
||||
this.setData({
|
||||
regiIndex : newIndex,
|
||||
regiId : this.data.regiArr[newIndex].id
|
||||
})
|
||||
},
|
||||
|
||||
// 提交表单
|
||||
siteform(e) {
|
||||
let value = e.detail.value
|
||||
let data = {
|
||||
name : value.name,
|
||||
mobile : value.mobile,
|
||||
address : value.address,
|
||||
province_id : this.data.areaId,
|
||||
city_id : this.data.cityId,
|
||||
district_id : this.data.regiId
|
||||
}
|
||||
wx.$api.stock.siteAdd(data).then(res => {
|
||||
this.setData({
|
||||
disabled: true
|
||||
})
|
||||
wx.navigateBack()
|
||||
}).catch(err => {})
|
||||
}
|
||||
})
|
||||
4
pages/stock/addSite/index.json
Normal file
4
pages/stock/addSite/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "新增地址"
|
||||
}
|
||||
48
pages/stock/addSite/index.wxml
Normal file
48
pages/stock/addSite/index.wxml
Normal file
@@ -0,0 +1,48 @@
|
||||
<form bindsubmit="siteform" class="site-form">
|
||||
<view class="site-input">
|
||||
<label>收货人</label>
|
||||
<input placeholder="请输入收货人姓名" name="name"></input>
|
||||
</view>
|
||||
<view class="site-input">
|
||||
<label>手机号码</label>
|
||||
<input placeholder="请输入手机号码" maxlength="11" name="mobile" type="number"></input>
|
||||
</view>
|
||||
<view class="site-input">
|
||||
<label>所在省份</label>
|
||||
<picker bindchange="areasChange" value="{{areaIndex}}" range="{{areasArr}}" range-key="name">
|
||||
<view class="picker">
|
||||
{{ areasArr[areaIndex].name }}
|
||||
</view>
|
||||
<image src="/static/icons/userLogin_icon.png"></image>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="site-input">
|
||||
<label>所在城市</label>
|
||||
<picker bindchange="cityDrop" value="{{cityIndex}}" range="{{cityArr}}" range-key="name" class="conneColor">
|
||||
<view class="picker">
|
||||
{{ cityArr[cityIndex].name }}
|
||||
</view>
|
||||
<image src="/static/icons/userLogin_icon.png"></image>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="site-input">
|
||||
<label>所在区域</label>
|
||||
<picker bindchange="regiDrop" value="{{regiIndex}}" range="{{regiArr}}" range-key="name" class="conneColor">
|
||||
<view class="picker">
|
||||
{{ regiArr[regiIndex].name }}
|
||||
</view>
|
||||
<image src="/static/icons/userLogin_icon.png"></image>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="site-input">
|
||||
<label>收货地址</label>
|
||||
<input placeholder="请输入详细地址" name="address"></input>
|
||||
</view>
|
||||
<!-- <view class="site-switch">
|
||||
<text>设置默认地址</text>
|
||||
<switch style='zoom:.6;' bindchange="addressDefault" color="#eb504c" />
|
||||
</view> -->
|
||||
<view class="site-btn">
|
||||
<button form-type="submit" size="mini" disabled="{{disabled}}">保存</button>
|
||||
</view>
|
||||
</form>
|
||||
79
pages/stock/addSite/index.wxss
Normal file
79
pages/stock/addSite/index.wxss
Normal file
@@ -0,0 +1,79 @@
|
||||
.site-form {
|
||||
background: white;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.site-input {
|
||||
padding: 0 30rpx 0 200rpx;
|
||||
position: relative;
|
||||
line-height: 110rpx;
|
||||
min-height: 110rpx;
|
||||
border-bottom: 2rpx solid #f3f3f3;
|
||||
}
|
||||
|
||||
.site-input::before {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 30rpx;
|
||||
right: 0;
|
||||
height: 1rpx;
|
||||
content: "";
|
||||
background: #e4e6f2;
|
||||
}
|
||||
|
||||
.site-input:last-child::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.site-input label {
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.site-input input {
|
||||
height: 110rpx;
|
||||
}
|
||||
|
||||
.site-input image {
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: calc(50% - 19rpx);
|
||||
}
|
||||
|
||||
.site-btn {
|
||||
padding: 20rpx 30rpx;
|
||||
margin-top: 100rpx;
|
||||
}
|
||||
|
||||
.site-btn button[size="mini"] {
|
||||
width: 100%;
|
||||
background: #1d37e2;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
font-size: 30rpx;
|
||||
color: white;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.site-btn button[disabled] {
|
||||
background: #7789ff !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.site-switch {
|
||||
font-size: 32rpx;
|
||||
margin: 30rpx;
|
||||
display: flex;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.site-switch text {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.site-switch-active {
|
||||
color: #797979;
|
||||
}
|
||||
87
pages/stock/detailed/index.js
Normal file
87
pages/stock/detailed/index.js
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
stockData : '', //前置
|
||||
logsArr : [], // 提货列表数据
|
||||
page : {}, //下一页
|
||||
lodingStats : false, //加载状态
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
// 获取提货前置
|
||||
this.pickInfo();
|
||||
|
||||
// 获取账变记录
|
||||
this.logsList();
|
||||
},
|
||||
|
||||
/**
|
||||
* 提货前置
|
||||
*/
|
||||
pickInfo (){
|
||||
wx.$api.stock.pick().then(res => {
|
||||
this.setData({
|
||||
stockData : res.data.stockData
|
||||
})
|
||||
}).catch(err => {})
|
||||
},
|
||||
|
||||
/**
|
||||
* 账变记录
|
||||
*/
|
||||
logsList (page){
|
||||
wx.$api.stock.logs({
|
||||
page: page
|
||||
}).then(res => {
|
||||
let listArr = this.data.logsArr,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) listArr = []
|
||||
newData = listArr.concat(res.data.data)
|
||||
this.setData({
|
||||
logsArr : newData,
|
||||
page : res.data.page,
|
||||
lodingStats : false
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
}).catch(err => {})
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
// 获取账变记录
|
||||
this.logsList();
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载
|
||||
*/
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
// 获取账变记录
|
||||
this.logsList(pageNumber);
|
||||
}
|
||||
}
|
||||
})
|
||||
4
pages/stock/detailed/index.json
Normal file
4
pages/stock/detailed/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "库存明细"
|
||||
}
|
||||
44
pages/stock/detailed/index.wxml
Normal file
44
pages/stock/detailed/index.wxml
Normal file
@@ -0,0 +1,44 @@
|
||||
<view class="top">
|
||||
<image class="top-img" src="http://api.siyuankunlun.com/storage/materials/2022/09/14/stock_list.png" mode="aspectFill"></image>
|
||||
<view class="top-back">
|
||||
<view class="top-item">
|
||||
<view class="item-name">库存总量</view>
|
||||
<view class="item-number">{{stockData.stock}}<text>箱</text></view>
|
||||
</view>
|
||||
<view class="top-item">
|
||||
<view class="item-name">提货量</view>
|
||||
<view class="item-number">{{stockData.hold}}<text>箱</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="list">
|
||||
<view class="list-name">库存明细</view>
|
||||
<block wx:if="{{logsArr.length > 0}}">
|
||||
<view class="item" wx:for="{{logsArr}}" wx:key="logsArr">
|
||||
<view class="title">
|
||||
<view class="name">
|
||||
<image src="/static/icons/stockList_01.png" mode="widthFix"></image>{{item.type}}
|
||||
</view>
|
||||
<view class="number reduce">
|
||||
{{item.variable}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="time">
|
||||
{{item.created_at}}
|
||||
</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>
|
||||
</block>
|
||||
<view class="pages-no" wx:else>
|
||||
<image src="/static/imgs/coupon_null.png" mode="widthFix"></image>
|
||||
<view>~暂无数据哦~</view>
|
||||
</view>
|
||||
</view>
|
||||
107
pages/stock/detailed/index.wxss
Normal file
107
pages/stock/detailed/index.wxss
Normal file
@@ -0,0 +1,107 @@
|
||||
/* 头部 */
|
||||
.top {
|
||||
position: relative;
|
||||
height: 200rpx;
|
||||
}
|
||||
|
||||
.top-img {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.top-back {
|
||||
position: absolute;
|
||||
padding: 45rpx 30rpx 0 90rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
color: #FFFFFF;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.top-item {
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
.item-name {
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 10rpx;
|
||||
opacity: .8;
|
||||
}
|
||||
|
||||
.item-number {
|
||||
font-size:54rpx;
|
||||
}
|
||||
|
||||
.item-number text {
|
||||
font-size: 26rpx;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
|
||||
/* 列表 */
|
||||
.list {
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.list-name {
|
||||
color: #13234a;
|
||||
font-weight: 600;
|
||||
margin-bottom: 40rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin-bottom: 30rpx;
|
||||
padding-bottom: 30rpx;
|
||||
border-bottom: 2rpx solid #f3f3f3;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.name {
|
||||
flex: 1;
|
||||
font-weight: 600;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
line-height: 28rpx;
|
||||
}
|
||||
|
||||
.name image {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.number {
|
||||
font-weight: 600;
|
||||
color: #175ad6;
|
||||
line-height: 28rpx;
|
||||
}
|
||||
.reduce {
|
||||
color: #ef5555;
|
||||
}
|
||||
|
||||
.time {
|
||||
color: #676767;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.pages-no {
|
||||
text-align: center;
|
||||
padding: 120rpx 0 30rpx;
|
||||
color: #9d9d9d;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.pages-no image {
|
||||
width: 180rpx;
|
||||
}
|
||||
66
pages/stock/examine/index.js
Normal file
66
pages/stock/examine/index.js
Normal file
@@ -0,0 +1,66 @@
|
||||
// pages/stock/examine/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
4
pages/stock/examine/index.json
Normal file
4
pages/stock/examine/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "等待审核"
|
||||
}
|
||||
9
pages/stock/examine/index.wxml
Normal file
9
pages/stock/examine/index.wxml
Normal file
@@ -0,0 +1,9 @@
|
||||
<view class="examine">
|
||||
<image src="http://api.siyuankunlun.com/storage/materials/2022/09/14/examine.png" mode="widthFix"></image>
|
||||
<view class="text">
|
||||
<view class="title">审核中</view>
|
||||
<view class="time">预计审核时间:1个工作日</view>
|
||||
<view class="time">审核结果会微信消息提醒,请您耐心等待</view>
|
||||
</view>
|
||||
<navigator hover-class="none" open-type="navigateBack" class="return">返回</navigator>
|
||||
</view>
|
||||
33
pages/stock/examine/index.wxss
Normal file
33
pages/stock/examine/index.wxss
Normal file
@@ -0,0 +1,33 @@
|
||||
.examine {
|
||||
padding: 240rpx 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.examine image {
|
||||
width: 35%;
|
||||
margin: 0 auto 30rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-weight: 600;
|
||||
font-size: 42rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
color: #999999;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
.return {
|
||||
display: inline-block;
|
||||
margin-top: 80rpx;
|
||||
background-color: #1d37e2;
|
||||
padding: 0 180rpx;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 10rpx;
|
||||
box-shadow: 0 3rpx 6rpx 4rpx rgba(6, 34, 214, .6);
|
||||
color: #FFFFFF;
|
||||
}
|
||||
109
pages/stock/index/index.js
Normal file
109
pages/stock/index/index.js
Normal 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);
|
||||
}
|
||||
}
|
||||
})
|
||||
4
pages/stock/index/index.json
Normal file
4
pages/stock/index/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "库存量"
|
||||
}
|
||||
90
pages/stock/index/index.wxml
Normal file
90
pages/stock/index/index.wxml
Normal 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>
|
||||
261
pages/stock/index/index.wxss
Normal file
261
pages/stock/index/index.wxss
Normal 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;
|
||||
}
|
||||
73
pages/stock/list/index.js
Normal file
73
pages/stock/list/index.js
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
listArr : [], //提货列表数据
|
||||
page : {}, //下一页
|
||||
lodingStats : false,//加载状态
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
// 获取提货列表
|
||||
this.pickList();
|
||||
},
|
||||
|
||||
/**
|
||||
* 提货列表
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
})
|
||||
4
pages/stock/list/index.json
Normal file
4
pages/stock/list/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "提货记录"
|
||||
}
|
||||
35
pages/stock/list/index.wxml
Normal file
35
pages/stock/list/index.wxml
Normal file
@@ -0,0 +1,35 @@
|
||||
<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>
|
||||
69
pages/stock/list/index.wxss
Normal file
69
pages/stock/list/index.wxss
Normal file
@@ -0,0 +1,69 @@
|
||||
|
||||
.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;
|
||||
}
|
||||
91
pages/stock/site/index.js
Normal file
91
pages/stock/site/index.js
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
Experience : '', //是否从体验官进入
|
||||
type : '', //类型
|
||||
listArr : [] //收货地址
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
console.log(options)
|
||||
this.setData({
|
||||
type: options.type,
|
||||
Experience: options.experience
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
// 获取地址列表
|
||||
this.listInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 地址列表
|
||||
*/
|
||||
listInfo (){
|
||||
wx.$api.stock.siteList().then(res => {
|
||||
this.setData({
|
||||
listArr: res.data
|
||||
})
|
||||
}).catch(err => { })
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除地址
|
||||
*/
|
||||
addressRemove(e){
|
||||
let newid = e.currentTarget.dataset.id
|
||||
wx.showModal({
|
||||
title : '提示',
|
||||
content : '是否删除地址',
|
||||
success : res=> {
|
||||
if (res.confirm) {
|
||||
wx.showLoading({
|
||||
title: '删除中',
|
||||
})
|
||||
wx.$api.stock.siteDel(newid).then(res=>{
|
||||
// 获取地址列表
|
||||
this.listInfo();
|
||||
wx.hideLoading()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 选择地址
|
||||
*/
|
||||
selectAddress(e){
|
||||
let atAdds = this.data.listArr[e.currentTarget.dataset.index]
|
||||
let pages = getCurrentPages(),
|
||||
prepage = pages[pages.length-2]
|
||||
|
||||
if(this.data.type == 'goodsAddress') {
|
||||
prepage.setData({
|
||||
address: atAdds,
|
||||
addressId: atAdds.address_id
|
||||
})
|
||||
wx.navigateBack()
|
||||
return
|
||||
}
|
||||
prepage.setData({
|
||||
address: atAdds
|
||||
})
|
||||
wx.navigateBack()
|
||||
}
|
||||
})
|
||||
4
pages/stock/site/index.json
Normal file
4
pages/stock/site/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "地址管理"
|
||||
}
|
||||
27
pages/stock/site/index.wxml
Normal file
27
pages/stock/site/index.wxml
Normal file
@@ -0,0 +1,27 @@
|
||||
<view class="list" wx:if="{{listArr.length > 0}}">
|
||||
<view class="address" wx:for="{{listArr}}" wx:key="listArr">
|
||||
<view class="address-name">
|
||||
<view class="defaultEdit" wx:if="{{item.default}}">默认</view><text>{{item.name}}</text>{{item.mobile}}
|
||||
</view>
|
||||
<view class="address-info">
|
||||
{{item.full_address}}
|
||||
</view>
|
||||
<view class="address-tool">
|
||||
<view class="address-tool-btn" bindtap="addressRemove" data-id="{{item.address_id}}">
|
||||
<image src="/static/icons/address_01.png" mode="widthFix"></image>删除
|
||||
</view>
|
||||
</view>
|
||||
<view class="select" wx:if="{{type == 'selectAddress' || type == 'goodsAddress'}}">
|
||||
<view class="select-btn" bindtap="selectAddress" data-index="{{index}}">
|
||||
选择地址
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="edit-no" wx:else>
|
||||
<image src="http://api.siyuankunlun.com/storage/materials/2022/09/14/site_no.png"></image>
|
||||
<view>暂无地址</view>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<navigator hover-class="none" url="../addSite/index?experience={{Experience}}" class="btn">添加地址</navigator>
|
||||
</view>
|
||||
123
pages/stock/site/index.wxss
Normal file
123
pages/stock/site/index.wxss
Normal file
@@ -0,0 +1,123 @@
|
||||
page{
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
.list {
|
||||
border-bottom: 60px solid transparent;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.address {
|
||||
background-color: #FFFFFF;
|
||||
margin-bottom: 30rpx;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
|
||||
.address:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.address-name {
|
||||
display: flex;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.address-name text {
|
||||
font-weight: normal;
|
||||
font-size: 34rpx;
|
||||
flex: 1;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.defaultEdit {
|
||||
font-size: 26rpx;
|
||||
height: 36rpx;
|
||||
line-height: 36rpx;
|
||||
border: 2rpx solid #eb504c;
|
||||
color: #eb504c;
|
||||
padding: 0 10rpx;
|
||||
margin-right: 20rpx;
|
||||
margin-top: 4rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.address-info {
|
||||
margin: 20rpx 0;
|
||||
font-size: 30rpx;
|
||||
color: #9d9d9d;
|
||||
}
|
||||
|
||||
.address-tool {
|
||||
border-top: 2rpx solid #f3f3f3;
|
||||
padding-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.address-tool-btn {
|
||||
display: inline-block;
|
||||
color: #666666;
|
||||
margin-left: 60rpx;
|
||||
}
|
||||
|
||||
.address-tool-btn image {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
vertical-align: -2rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.select {
|
||||
text-align: center;
|
||||
border: 2rpx solid #e64248;
|
||||
color: #e64248;
|
||||
font-size: 28rpx;
|
||||
margin-top: 30rpx;
|
||||
line-height: 72rpx;
|
||||
font-weight: 600;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
background-color: #FFFFFF;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 9;
|
||||
padding: 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.btn {
|
||||
line-height: 44px;
|
||||
background-color: #1d37e2;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
/* 无列表 */
|
||||
.edit-no {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-pack: center;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 1;
|
||||
text-align: center;
|
||||
color: #9d9d9d;
|
||||
}
|
||||
|
||||
.edit-no image {
|
||||
width: 240rpx;
|
||||
height: 240rpx;
|
||||
}
|
||||
134
pages/stock/take/index.js
Normal file
134
pages/stock/take/index.js
Normal file
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
num : 1, //数量默认1
|
||||
address : '', //地址
|
||||
stockData : '', //数据
|
||||
disabled : false
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
// 获取提货前置
|
||||
this.pickInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {},
|
||||
|
||||
/**
|
||||
* 提货前置
|
||||
*/
|
||||
pickInfo (){
|
||||
wx.$api.stock.pick().then(res => {
|
||||
console.log(res.data.dientity.is_experience)
|
||||
this.setData({
|
||||
address : res.data.address,
|
||||
stockData : res.data.stockData,
|
||||
isExperience : res.data.dientity.is_experience
|
||||
})
|
||||
}).catch(err => {})
|
||||
},
|
||||
|
||||
/**
|
||||
* 商品数量加减
|
||||
*/
|
||||
goodsNumber(e){
|
||||
let num = this.data.num,
|
||||
val = e.currentTarget.dataset.type
|
||||
if (val == 'plus'){
|
||||
num ++;
|
||||
if(num > this.data.stockData.stock ){
|
||||
wx.showToast({
|
||||
title: '商品数量不能大于库存量',
|
||||
icon: 'none'
|
||||
});
|
||||
num = this.data.stockData.stock
|
||||
}
|
||||
|
||||
}else{
|
||||
if (num > 1){
|
||||
num --;
|
||||
}else{
|
||||
wx.showToast({
|
||||
title : '商品数量不能小于1',
|
||||
icon : 'none'
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
num: num
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
num: num
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 输入商品数量
|
||||
*/
|
||||
goodsNumberInput(e) {
|
||||
let goodsNum = e.detail.value;
|
||||
if (goodsNum > 0) {
|
||||
if(goodsNum > this.data.stockData.stock ){
|
||||
wx.showToast({
|
||||
title: '商品数量不能大于库存量',
|
||||
icon: 'none'
|
||||
});
|
||||
this.setData({
|
||||
num: this.data.stockData.stock
|
||||
})
|
||||
return
|
||||
}
|
||||
this.setData({
|
||||
num: goodsNum
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '商品数量不能小于1',
|
||||
icon: 'none'
|
||||
});
|
||||
this.setData({
|
||||
num: 1
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 申请提货
|
||||
*/
|
||||
stockForm(e) {
|
||||
let newQty = this.data.num
|
||||
if(this.data.isExperience) {
|
||||
newQty = this.data.stockData.stock
|
||||
}
|
||||
let data = {
|
||||
remark : e.detail.value.remark,
|
||||
qty : newQty,
|
||||
address_id : this.data.address.address_id
|
||||
}
|
||||
|
||||
wx.$api.stock.pickTake(data).then(res => {
|
||||
this.setData({
|
||||
disabled: true
|
||||
})
|
||||
|
||||
// 跳到审核页面
|
||||
wx.redirectTo({
|
||||
url: '../examine/index'
|
||||
})
|
||||
}).catch(err => {})
|
||||
}
|
||||
})
|
||||
4
pages/stock/take/index.json
Normal file
4
pages/stock/take/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "申请提现"
|
||||
}
|
||||
69
pages/stock/take/index.wxml
Normal file
69
pages/stock/take/index.wxml
Normal file
@@ -0,0 +1,69 @@
|
||||
<form bindsubmit="stockForm" class="take">
|
||||
<view class="take">
|
||||
<view class="take-label" wx:if="{{isExperience}}">
|
||||
<view class="reminder">
|
||||
<view class="reminder-tips">
|
||||
<image src="/static/icons/reminder_tips.png"></image>温馨提示
|
||||
</view>
|
||||
<text>收货地址只限制广东省深圳市地区</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="take-label">
|
||||
<view class="item" wx:if="{{isExperience}}">
|
||||
<view class="name">
|
||||
<image src="/static/icons/takeIcon_01.png" mode="widthFix"></image>提货数量
|
||||
</view>
|
||||
<view class="time stock">
|
||||
{{stockData.stock}}<text>箱</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" wx:else>
|
||||
<view class="name">
|
||||
<image src="/static/icons/takeIcon_01.png" mode="widthFix"></image>提货数量
|
||||
</view>
|
||||
<view class="number">
|
||||
<view class="btn" bindtap="goodsNumber" data-type="remove">-</view>
|
||||
<input bindinput="goodsNumberInput" class="see" type="text" value="{{num}}" />
|
||||
<view class="btn" bindtap="goodsNumber" data-type="plus">+</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="name">
|
||||
<image src="/static/icons/takeIcon_02.png" mode="widthFix"></image>备注信息
|
||||
</view>
|
||||
<textarea class="remarks" name="remark" placeholder="请输入备注信息~" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="take-label">
|
||||
<view class="item site {{address == '' ? 'active' : ''}}" wx:if="{{address}}">
|
||||
<view class="site-title">
|
||||
{{address.name}}<text>{{address.mobile}}</text>
|
||||
</view>
|
||||
<view class="site-text">
|
||||
{{address.full_address}}
|
||||
</view>
|
||||
<navigator hover-class="none" wx:if="{{isExperience}}" url="../site/index?type=selectAddress&experience={{isExperience}}" class="site-change">
|
||||
更改地址
|
||||
</navigator>
|
||||
<navigator hover-class="none" wx:else="" url="../site/index?type=selectAddress" class="site-change">
|
||||
更改地址
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="edit-no" wx:else>
|
||||
<image src="http://api.siyuankunlun.com/storage/materials/2022/09/14/site_no_add.png"></image>
|
||||
<navigator wx:if="{{isExperience}}" hover-class="none" url="../site/index?type=selectAddress&experience={{isExperience}}" class="site-change">
|
||||
新增地址
|
||||
</navigator>
|
||||
<navigator wx:else hover-class="none" url="../site/index?type=selectAddress" class="site-change">
|
||||
新增地址
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="site-btn">
|
||||
<button form-type="submit" disabled="{{disabled}}">提交申请</button>
|
||||
</view>
|
||||
</form>
|
||||
196
pages/stock/take/index.wxss
Normal file
196
pages/stock/take/index.wxss
Normal file
@@ -0,0 +1,196 @@
|
||||
.take {
|
||||
border-bottom: 180rpx solid transparent;
|
||||
}
|
||||
|
||||
.take-label {
|
||||
padding: 30rpx 10rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #FFFFFF;
|
||||
border-bottom: 2rpx solid #f3f3f3;
|
||||
position: relative;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.name {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.name image {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
color: #565656;
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 30rpx;
|
||||
}
|
||||
|
||||
.stock {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.stock text {
|
||||
padding-left: 5rpx;
|
||||
}
|
||||
|
||||
.number {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 30rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 34rpx;
|
||||
font-weight: 600;
|
||||
border-radius: 50%;
|
||||
color: #1d37e2;
|
||||
border: #1d37e2 2rpx solid;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.see {
|
||||
width: 60rpx;
|
||||
text-align: center;
|
||||
padding: 0 20rpx;
|
||||
line-height: 42rpx;
|
||||
font-size: 32rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.remarks {
|
||||
margin-top: 30rpx;
|
||||
background-color: #f4f4f4;
|
||||
font-size: 30rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 10rpx;
|
||||
color: #9d9d9d;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.site {
|
||||
padding: 30rpx 40rpx 30rpx 100rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.site::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
left: 40rpx;
|
||||
top: 60rpx;
|
||||
background-color: #FFFFFF;
|
||||
border: #e64248 solid 6rpx;
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.site.active::after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.site-title {
|
||||
margin-bottom: 10rpx;
|
||||
font-weight: 600;
|
||||
font-size: 32rpx;
|
||||
|
||||
}
|
||||
|
||||
.site-title text {
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
|
||||
.site-text {
|
||||
color: #565656;
|
||||
}
|
||||
|
||||
.site-change {
|
||||
border: 2rpx solid #e64248;
|
||||
text-align: center;
|
||||
line-height: 74rpx;
|
||||
color: #e64248;
|
||||
border-radius: 10rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
/* 按钮 */
|
||||
.site-btn {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 99;
|
||||
right: 0;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.site-btn button {
|
||||
background: #1d37e2;
|
||||
text-align: center;
|
||||
color: white;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: normal;
|
||||
width: 100% !important;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.site-btn button[disabled] {
|
||||
background: #7789ff !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.edit-no {
|
||||
text-align: center;
|
||||
color: #9d9d9d;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.edit-no image {
|
||||
width: 240rpx;
|
||||
height: 240rpx;
|
||||
}
|
||||
|
||||
/* 温馨提示 */
|
||||
.reminder {
|
||||
background-color: #eef0ff;
|
||||
color: #001bca;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.reminder text {
|
||||
font-size: 30rpx;
|
||||
padding-left: 44rpx;
|
||||
}
|
||||
|
||||
.reminder-tips {
|
||||
font-weight: 600;
|
||||
margin-bottom: 10rpx;
|
||||
display: flex;
|
||||
line-height: 34rpx;
|
||||
}
|
||||
|
||||
.reminder-tips image {
|
||||
width: 34rpx;
|
||||
height: 34rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user