水滴兑换模块开发完成

This commit is contained in:
2023-07-27 13:46:43 +08:00
parent d7d54f5009
commit 454b6963a4
26 changed files with 1126 additions and 30 deletions

View File

@@ -0,0 +1,98 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
data: {
goodsData : '', //详情
canState : '', //操作按钮
express : '', //物流
orderNo : '' //订单号
},
onLoad(options) {
this.setData({
orderNo: options.order_no
})
},
onShow() {
// 获取订单详情
this.goodsInfo();
},
/**
* 订单详情
*/
goodsInfo() {
wx.$api.recruit.orderDet(this.data.orderNo).then(res => {
this.setData({
goodsData : res.data,
express : res.data.express
})
}).catch(err => {})
},
/**
* 复制订单号
*/
copyUrl(val) {
wx.setClipboardData({
data: val.currentTarget.dataset.no,
success: () => {
wx.showToast({
title: "订单编号复制成功",
icon : "none"
})
}
})
},
/**
* 订单签收
*/
signClick() {
wx.showModal({
title : '提示',
content : '是否签收',
success : res=> {
if (res.confirm) {
wx.$api.recruit.orderSign(this.data.goodsData.exchange_id).then(res => {
wx.showToast({
title:'签收成功',
icon:'none'
})
// 获取订单详情
this.goodsInfo();
}).catch(err => {})
}
}
})
},
/**
* 复制物流单号
*/
copyExpress(val) {
wx.setClipboardData({
data: val.currentTarget.dataset.no,
success: () => {
wx.showToast({
title: "物流单号复制成功",
icon : "none"
})
}
})
},
// 查看物流
h5url() {
// var data = JSON.stringify(this.data.goodsData.express)
// url: `/pages/water/logistic/logistic?newData=` + encodeURIComponent(data) + '&title=' + this.data.goodsData.express.express.name +
wx.navigateTo({
url: "/pages/water/logistic/logistic?exchange_id=" + this.data.goodsData.exchange_id + "&title=" + this.data.goodsData.express.express.name
})
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "水滴兑换订单详情"
}

View File

@@ -0,0 +1,77 @@
<view class="orderData">
<view class="While">
<view class="orderData-cont-label">
<image class="orderData-cont-img" src="https://cdn.shuiganying.com/images/2023/04/04/3b3938e3a883e6b173b4d49a5242666a.png" mode="aspectFill"></image>
<view class="orderData-cont-text">
<view class="orderData-cont-name">订单状态</view>
<view class="orderData-cont-copy">
<text class="nowrap">{{goodsData.status_text}}</text>
</view>
</view>
</view>
<view class="orderData-cont-label">
<image class="orderData-cont-img" src="/static/icons/siteIcon.png" mode="aspectFill"></image>
<view class="orderData-cont-text orderData-cont-site">
<view class="orderData-cont-name">{{ goodsData.express.name }} <text>{{ goodsData.express.mobile }}</text></view>
<view class="orderData-cont-copy">
{{ goodsData.express.full_address }}
</view>
</view>
</view>
</view>
<view class="While list-goods">
<image class="list-goods-img" mode="aspectFill" src="{{goodsData.goods.cover}}"></image>
<view class="list-goods-cont">
<view class="nowrap list-goods-name">{{goodsData.goods.name}}</view>
<view class="list-goods-text">
<text>规格 99ml</text>x 1
</view>
<view class="list-goods-parice">
¥<text>{{goodsData.goods.price.vip}}</text>
</view>
</view>
</view>
<view class="While reserveCont">
<view class="reserveCont-title">订单信息</view>
<view class="reserve-label">
<view class="reserve-name">交易时间</view>
<view class="reserve-text">{{goodsData.created_at}}</view>
</view>
<view class="reserve-label">
<view class="reserve-name">交易状态</view>
<view class="reserve-text reserve-status">{{goodsData.status_text}}</view>
</view>
<view class="reserve-label">
<view class="reserve-name">使用水滴</view>
<view class="reserve-text reserve-price">¥{{goodsData.water_number}}</view>
</view>
</view>
<view class="While reserveCont" wx:if="{{goodsData.express.express_no}}">
<view class="reserveCont-title">物流信息</view>
<view class="reserve-label">
<view class="reserve-name">物流名称</view>
<view class="reserve-text">{{goodsData.express.express.name}}</view>
</view>
<view class="reserve-label">
<view class="reserve-name">物流单号</view>
<view class="reserve-text reserve-text-copy">
{{goodsData.express.express_no}}<view bindtap="copyExpress" class="reserve-text-tap" data-no="{{goodsData.express.express_no}}">复制</view>
</view>
</view>
<view class="reserve-label">
<view class="reserve-name">查看物流信息</view>
<view class="reserve-text reserve-text-btn" bindtap="h5url">
去查看
</view>
</view>
</view>
</view>
<view class="order-data-footer">
<view class="list-btn">
<view class="order-btn" bindtap="signClick" wx:if="{{goodsData.can_sign}}">签收订单</view>
<navigator hover-class="none" class="order-btn grey" open-type="navigateBack">返回订单</navigator>
</view>
</view>

View File

@@ -0,0 +1,235 @@
page {
background: #f3f4f6;
padding: 30rpx;
box-sizing: border-box;
}
.While {
border-radius: 10rpx;
margin-bottom: 30rpx;
background-color: #FFFFFF;
box-shadow: 0 0 10rpx rgba(0, 0, 0, .05);
}
.orderData {
border-bottom: 100rpx transparent solid;
}
/* 订单 */
.orderData-cont-label {
padding: 40rpx 30rpx;
display: flex;
box-sizing: border-box;
border-bottom: #f2f2f2 2rpx solid;
}
.orderData-cont-img {
width: 38rpx;
height: 38rpx;
margin-top: 4rpx;
}
.orderData-cont-text {
width: calc(100% - 68rpx);
margin-left: 20rpx;
box-sizing: border-box;
font-size: 30rpx;
}
.orderData-cont-site {
width: calc(100% - 108rpx);
}
.orderData-cont-name {
margin-bottom: 10rpx;
}
.orderData-cont-name text {
color: #999;
padding-left: 20rpx;
}
.orderData-cont-copy {
display: flex;
font-size: 28rpx;
color: #999;
}
.orderData-cont-copy text {
flex: 1;
display: inline-block;
margin-right: 20rpx;
}
.orderData-cont-copy view {
color: #3b7cff;
}
.address-btn {
width: 42rpx;
height: 42rpx;
margin-top: 46rpx;
}
/* 产品 */
.list-goods {
display: flex;
padding: 30rpx;
box-sizing: border-box;
}
.list-goods-img {
width: 184rpx;
height: 184rpx;
margin-right: 30rpx;
border-radius: 10rpx;
}
.list-goods-cont {
width: calc(100% - 214rpx);
}
.list-goods-name {
font-size: 32rpx;
}
.list-goods-text {
line-height: 90rpx;
display: flex;
font-size: 28rpx;
color: #999999;
}
.list-goods-text text {
flex: 1;
}
.list-goods-parice {
text-align: right;
font-size: 28rpx;
}
.list-goods-parice text {
font-size: 34rpx;
}
/* 规格 */
.reserveCont-title {
padding: 30rpx;
font-size: 30rpx;
}
.reserve-label {
display: flex;
padding: 0 30rpx 30rpx;
box-sizing: border-box;
font-size: 28rpx;
line-height: 48rpx;
}
.reserve-name {
flex: 1;
width: 200rpx;
margin-right: 20rpx;
color: #7e7e7e;
}
.reserve-text {
width: calc(100% - 240rpx);
text-align: right;
line-height: 50rpx;
}
.reserve-text-btn {
width: 120rpx;
text-align: center;
color: #ffffff;
background-color: #3b7cff;
font-size: 26rpx;
border-radius: 10rpx;
line-height: 54rpx;
}
.reserve-text-copy {
display: contents;
}
.reserve-text-tap {
color: #ff9951;
padding-left: 30rpx;
}
.reserve-text text {
font-size: 24rpx;
display: inline-block;
background-image: linear-gradient(to right, #f16e06, #f34206);
color: #FFFFFF;
border-radius: 6rpx;
padding: 0 10rpx;
height: 44rpx;
line-height: 44rpx;
margin-top: 6rpx;
}
.reserve-text text.active {
background-image: linear-gradient(to right, #027be6, #2855f0);
}
.reserve-text.reserve-price {
font-weight: 600;
font-size: 34rpx;
color: #3b7cff;
}
.reserve-copy {
color: #3b7cff;
border: #3b7cff 2rpx solid;
display: inline-block;
height: 34rpx;
line-height: 34rpx;
font-size: 26rpx;
padding: 0 10rpx;
border-radius: 4rpx;
margin-left: 10rpx;
}
.reserve-status {
color: #ff8100
}
/* 底部菜单 */
.order-data-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
border-top: solid 1rpx #f2f2f2;
padding-top: 20rpx;
padding-right: 30rpx;
padding-left: 30rpx;
height: 110rpx;
background: white;
flex-wrap: wrap;
flex-direction: row-reverse;
z-index: 9;
}
.list-btn {
text-align: right;
}
.order-btn {
border: 2rpx solid #ff8100;
color: #ff8100;
border-radius: 80rpx;
height: 56rpx;
line-height: 56rpx;
padding: 0 20rpx;
display: inline-block;
font-size: 26rpx;
margin-left: 30rpx;
}
.order-btn.grey {
color: grey;
border-color: grey;
}

View File

@@ -1,3 +1,4 @@
{
"usingComponents": {}
"usingComponents": {},
"navigationBarTitleText": "水滴账户"
}

View File

@@ -2,18 +2,20 @@
水滴的使用规则:可以进行商品兑换
<image src="/static/icons/water_close.png"></image>
</view>
<view class="water {{isExchange ? 'active' : ''}}">
<view class="water active">
<view class="water-top">
水滴账户<image src="/static/icons/water_icon.png"></image>
</view>
<view class="water-number">
{{score}}
</view>
<view class="water-convert" wx:if="{{isExchange}}">
<navigator hover-class="none" url="/pages/recruit/exchange/exchange" class="water-convert-go">水滴兑换 ></navigator>
<view class="water-convert">
<navigator hover-class="none" url="/pages/water/waterOrder/waterOrder" class="water-convert-go">兑换订单 ></navigator>
<navigator hover-class="none" url="/pages/recruit/exchange/exchange" class="water-convert-go" wx:if="{{isExchange}}">水滴兑换 ></navigator>
</view>
</view>
<view class="detailed {{isExchange ? 'active' : ''}}">
<!-- {{isExchange ? 'active' : ''}} -->
<view class="detailed active">
<view class="title">
水滴明细
</view>
@@ -28,7 +30,10 @@
</view>
</view>
<view class="time">
时间:<text>{{item.created_at}}</text>
兑换时间:<text>{{item.created_at}}</text>
</view>
<view class="time" wx:if="{{item.expired_at != ''}}">
过期时间:<text>{{item.expired_at}}</text>
</view>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">

View File

@@ -59,10 +59,16 @@
background-color: #ffde49;
color: #3a2f00;
display: inline-block;
line-height: 68rpx;
line-height: 74rpx;
padding: 0 35rpx;
border-radius: 80rpx;
font-size: 30rpx;
margin: 0 20rpx;
}
.water-convert-go:last-child{
color: #fff;
background-color: #5283ea;
}
.detailed {
@@ -140,6 +146,7 @@
.time {
font-size: 28rpx;
color: #6d6d6d;
margin-top: 15rpx;
}
.pages-no {

View File

@@ -0,0 +1,40 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
data: {
title : '', //物流快递
logisticArr : '',
expressData : '',
exchangeId : ''
},
onLoad(options) {
console.log(options)
// const {
// newData = {}
// } = options;
// const data = JSON.parse(decodeURIComponent(newData));
this.setData({
exchangeId : options.exchange_id,
title : options.title
})
},
onShow() {
// 查看物流
this.h5url();
},
// 查看物流
h5url() {
wx.$api.recruit.orderDi(this.data.exchangeId).then(res => {
this.setData({
expressData: res.data,
logisticArr: res.data.express_track.list
})
}).catch(err => {})
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "物流信息"
}

View File

@@ -0,0 +1,44 @@
<block wx:if="{{logisticArr.length > 0}}">
<view class="top">
<view class="top-logo">
<image src="{{expressData.express_track.logo ? expressData.express_track.logo : 'https://cdn.shuiganying.com/images/2023/07/27/eca556ea6028f859e53c13103bb312f1.png'}}" mode="aspectFill"></image>
</view>
<view class="top-cont">
<view class="top-name">
{{expressData.express_track.express_name}}
<view class="top-no">
{{expressData.express_track.no}}
</view>
</view>
<view class="top-type">
{{expressData.name}}<text>{{expressData.mobile}}</text>
</view>
</view>
</view>
<view class="white">
<view class="address">
<view class="address-tips">
</view>
<view class="address-text">
{{expressData.full_address}}
</view>
</view>
<view class="list">
<view class="item" wx:for="{{logisticArr}}" wx:key="logisticArr">
<view class="item-name">
<view class="item-time">
{{item.time}}
</view>
</view>
<view class="item-text">
{{item.context}}
</view>
</view>
</view>
</view>
</block>
<view class="pack-center pages-hint" wx:else>
<image src="/static/imgs/cont_null.png"></image>
<view>暂无物流信息</view>
</view>

View File

@@ -0,0 +1,141 @@
.top {
background-color: #3b7cff;
padding: 30rpx 30rpx 60rpx;
box-sizing: border-box;
display: flex;
}
.top-logo {
background-color: #ffffff;
border-radius: 10rpx;
width: 100rpx;
height: 100rpx;
padding: 10rpx;
box-sizing: border-box;
}
.top-logo image {
width: 100%;
height: 100%;
}
.top-cont {
color: #ffffff;
width: calc(100% - 130rpx);
margin-left: 30rpx;
}
.top-name {
display: flex;
line-height: 44rpx;
padding: 10rpx 0;
}
.top-no {
font-size: 26rpx;
padding-left: 30rpx;
opacity: .9;
}
.top-type {
font-size: 24rpx;
}
.top-type text {
padding-left: 20rpx;
}
.address {
color: #333333;
font-size: 24rpx;
display: flex;
padding: 30rpx 30rpx 0;
}
.address-tips {
width: 54rpx;
text-align: center;
height: 54rpx;
line-height: 54rpx;
border-radius: 50%;
background-color: #EEEEEE;
margin-left: -15rpx;
font-size: 24rpx
}
.address-text {
width: calc(100% - 74rpx);
margin-left: 20rpx;
padding-top: 10rpx;
}
.white {
margin-top: -30rpx;
background-color: #ffffff;
border-radius: 20rpx;
}
.list {
padding: 0 30rpx;
box-sizing: border-box;
}
.item {
padding-bottom: 40rpx;
padding-left: 40rpx;
box-sizing: border-box;
position: relative;
}
.item:first-child {
padding-top: 30rpx;
}
.item::after {
position: absolute;
content: '';
background-color: #DDDDDD;
width: 14rpx;
height: 14rpx;
border-radius: 50%;
left: 0;
top: calc(50% - 6rpx);
z-index: 3;
border: 2rpx solid #ffffff;
}
.item::before {
position: absolute;
content: '';
background-color: #F0F0F0;
width: 2rpx;
height: 100%;
border-radius: 50%;
left: 8rpx;
top: 0;
}
.item-name {
display: flex;
}
.item-status {
font-weight: 600;
padding-right: 20rpx;
}
.item-time {
color: #868686;
}
.item-text {
color: #868686;
font-size: 24rpx;
line-height: 40rpx;
margin-top: 20rpx;
}
.item:first-child .item-time,
.item:first-child .item-text {
color: #ff8100 !important;
}

View File

@@ -0,0 +1,115 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
data: {
listType : '', // 订单状态
listArr : '', // 订单列表
listsArr : [], // 订单列表
page : {}, // 分页信息
lodingStats : false,// 加载状态
},
onLoad(options) {},
onShow() {
// 获取订单状态栏
this.tabInfo()
// 获取订单列表
this.listInfo()
},
/**
* 订单状态栏
*/
tabInfo() {
wx.$api.recruit.tabList().then(res => {
this.setData({
listArr: res.data
})
}).catch(err => {})
},
/**
* 订单列表
*/
listInfo(page) {
wx.$api.recruit.orderList({
status: this.data.listType,
page : page || 1
}).then(res => {
let listArr = this.data.listsArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
this.setData({
listsArr : 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.listInfo()
},
/**
* 订单签收
*/
signClick(e) {
wx.showModal({
title : '提示',
content : '是否签收',
success : res=> {
if (res.confirm) {
wx.$api.recruit.orderSign(e.currentTarget.dataset.order_no).then(res => {
wx.showToast({
title:'签收成功',
icon:'none'
})
// 获取订单列表
this.listInfo()
}).catch(err => {})
}
}
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取订单列表
this.listInfo();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取订单列表
this.listInfo(pageNumber);
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "水滴兑换订单"
}

View File

@@ -0,0 +1,55 @@
<view class="header">
<view class="tabs">
<view class="tabs-item {{listType == item.status ? 'show' : ''}}" bindtap="onTabs" data-type="{{item.status}}" wx:for="{{listArr}}" wx:key="listArr">{{item.status_text}}</view>
</view>
</view>
<view class="list" wx:if="{{listsArr.length > 0}}">
<view class="list-item" wx:for="{{listsArr}}" wx:key="listsArr">
<view class="list-top">
<view class="list-top-no">订单状态</view>
<view class="list-top-status">{{item.status_text}}</view>
</view>
<view class="list-goods">
<image class="list-goods-img" mode="aspectFill" src="{{item.goods.cover}}"></image>
<view class="list-goods-cont">
<view class="nowrap list-goods-name">{{item.goods.name}}</view>
<view class="list-goods-text">
<text>规格 99ml</text>x 1
</view>
<view class="list-goods-parice">
¥<text>{{item.goods.price.vip}}</text>
</view>
</view>
</view>
<view class="list-total">
<view class="list-total-price">{{item.water_number}}</view><text>水滴</text>
</view>
<view class="list-tips">
<view class="list-tips-left">
<image class="list-tips-img" src="https://cdn.shuiganying.com/images/2023/04/04/d4543817b05d3aaac04dfb85ff9f8f8c.png"></image>收货城市
</view>
<view class="nowrap list-tips-right">{{item.express.full_address}}</view>
</view>
<view class="list-operate">
<view class="list-more"></view>
<view class="list-btn">
<view bindtap="signClick" data-order_no="{{item.exchange_id}}" class="list-btn-labor" wx:if="{{item.can_sign}}">签收订单</view>
<navigator hover-class="none" url="/pages/water/details/details?order_no={{item.exchange_id}}" class="list-btn-labor grey">查看详情</navigator>
</view>
</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="pack-center pages-hint" wx:else>
<image src="/static/imgs/text_null.png"></image>
<view>暂无数据</view>
</view>

View File

@@ -0,0 +1,176 @@
page {
background-color: #f7faff;
}
/* tabs */
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 99;
height: 100rpx;
background-color: #f7faff;
}
.tabs {
display: flex;
justify-content: space-around;
padding: 30rpx 10rpx;
font-size: 30rpx;
color: #3c3d3e;
}
.tabs-item.show {
color: #3b7cff;
}
/* 列表 */
.list {
padding: 20rpx 30rpx 30rpx;
box-sizing: border-box;
margin-top: 100rpx;
}
.list-item {
background-color: #ffffff;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
margin-bottom: 30rpx;
box-shadow: 0 4rpx 30rpx 2rpx rgba(0, 0, 0, .05);
}
.list-top {
display: flex;
margin-bottom: 30rpx;
line-height: 48rpx;
}
.list-top-no {
flex: 1;
}
.list-top-status {
color: #ff8100;
}
.list-goods {
display: flex;
}
.list-goods-img {
width: 184rpx;
height: 184rpx;
margin-right: 30rpx;
border-radius: 10rpx;
}
.list-goods-cont {
width: calc(100% - 214rpx);
}
.list-goods-name {
font-size: 32rpx;
}
.list-goods-text {
line-height: 90rpx;
display: flex;
font-size: 28rpx;
color: #999999;
}
.list-goods-text text {
flex: 1;
}
.list-goods-parice {
text-align: right;
font-size: 28rpx;
}
.list-goods-parice text {
font-size: 34rpx;
}
.list-total {
text-align: right;
margin-top: 30rpx;
font-size: 32rpx;
color: #3b7cff;
}
.list-total.active {
color: #3b7cff;
}
.list-total text {
font-size: 26rpx;
padding-left: 10rpx;
}
.list-total-price {
display: inline-block;
font-weight: 600;
font-size: 38rpx;
}
.list-tips {
background-color: #f7faff;
display: flex;
padding: 20rpx 30rpx;
box-sizing: border-box;
margin: 30rpx 0 40rpx;
border-radius: 10rpx;
line-height: 44rpx;
font-size: 28rpx;
}
.list-tips-left {
display: flex;
margin-right: 40rpx;
}
.list-tips-img {
width: 44rpx;
height: 44rpx;
margin-right: 10rpx;
}
.list-tips-right {
color: #707070;
width: calc(100% - 210rpx);
}
.list-operate {
display: flex;
}
.list-more {
flex: 1;
line-height: 56rpx;
font-size: 26rpx;
color: #999999;
}
.list-btn {
text-align: right;
}
.list-btn-labor {
border: 2rpx solid #ff8100;
color: #ff8100;
border-radius: 80rpx;
height: 56rpx;
line-height: 56rpx;
padding: 0 25rpx;
display: inline-block;
font-size: 26rpx;
margin-left: 30rpx;
}
.list-btn-labor.grey {
color: grey;
border-color: grey;
}