init
This commit is contained in:
1
wx05cb767e6530b48f/pages/order/detail.js
Normal file
1
wx05cb767e6530b48f/pages/order/detail.js
Normal file
@@ -0,0 +1 @@
|
||||
var r=getApp();Page({data:{order_id:null,order:{}},onLoad:function(r){this.data.order_id=r.order_id,this.getOrderDetail(r.order_id)},getOrderDetail:function(t){var e=this;r._get("user.order/detail",{order_id:t},(function(r){e.setData(r.data)}))},goodsDetail:function(r){var t=r.currentTarget.dataset.id;wx.navigateTo({url:"../goods/index?goods_id="+t})},cancelOrder:function(t){var e=this.data.order_id;wx.showModal({title:"提示",content:"确认取消订单?",success:function(t){t.confirm&&r._post_form("user.order/cancel",{order_id:e},(function(r){wx.navigateBack()}))}})},aftermarketOrder:function(r){var t=r.currentTarget.dataset.id;wx.navigateTo({url:"../aftermarket/create?order_goods_id="+t})},payOrder:function(t){var e=this,a=e.data.order_id;wx.showLoading({title:"正在处理..."}),r._post_form("user.order/pay",{order_id:a},(function(t){if(-10===t.code)return r.showError(t.msg),!1;wx.requestPayment({timeStamp:t.data.timeStamp,nonceStr:t.data.nonceStr,package:"prepay_id="+t.data.prepay_id,signType:"MD5",paySign:t.data.paySign,success:function(r){e.getOrderDetail(a)},fail:function(){r.showError("订单未支付")}})}))},receipt:function(t){var e=this,a=e.data.order_id;wx.showModal({title:"提示",content:"确认收到商品?",success:function(t){t.confirm&&r._post_form("user.order/receipt",{order_id:a},(function(r){e.getOrderDetail(a)}))}})}});
|
||||
1
wx05cb767e6530b48f/pages/order/detail.json
Normal file
1
wx05cb767e6530b48f/pages/order/detail.json
Normal file
@@ -0,0 +1 @@
|
||||
{"navigationBarTitleText":"订单详情","usingComponents":{}}
|
||||
96
wx05cb767e6530b48f/pages/order/detail.wxml
Normal file
96
wx05cb767e6530b48f/pages/order/detail.wxml
Normal file
@@ -0,0 +1,96 @@
|
||||
<view class="container p-bottom" wx:if="{{order.order_id}}">
|
||||
<scroll-view scrollY="true">
|
||||
<view class="b-f">
|
||||
<view class="flow-checkout-header b-f dis-flex">
|
||||
<view class="flow-header-left padding-box">
|
||||
<view class="flow-checkout-admin f-26 col-3">{{order.address.name}} <text class="f-26 col-m">{{order.address.phone}}</text>
|
||||
</view>
|
||||
<view class="flow-checkout-address"> {{order.address.region.province}} {{order.address.region.city}} {{order.address.region.region}} {{order.address.detail}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flow-all-money b-f padding-box m-top20" wx:if="{{order.delivery_status.value==20}}">
|
||||
<view class="dis-flex flow-all-list-cont">
|
||||
<text class="col-7">快递公司: {{order.express_company}}</text>
|
||||
</view>
|
||||
<view class="dis-flex flow-all-list-cont">
|
||||
<text class="col-7" selectable="{{true}}">快递单号: {{order.express_no}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-cont b-f m-top20">
|
||||
<view class="padding-box b-f">
|
||||
<view class="order-header dis-flex">
|
||||
<view class="flex-box t-l">
|
||||
<text class="title">商品列表</text>
|
||||
</view>
|
||||
<view class="flex-box t-r">
|
||||
<text class="col-m" wx:if="{{order.pay_status.value==10}}">{{order.pay_status.text}}</text>
|
||||
<text class="col-m" wx:if="{{order.pay_status.value==20&&order.delivery_status.value==10}}">{{order.delivery_status.text}}</text>
|
||||
<text class="col-m" wx:if="{{order.pay_status.value==20&&order.delivery_status.value==20&&order.receipt_status.value==10}}">{{order.receipt_status.text}}</text>
|
||||
<text class="col-m" wx:if="{{order.order_status.value==30}}">{{order.order_status.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-box b-f">
|
||||
<view class="order-cont dis-flex">
|
||||
<view class="order-num">
|
||||
<text selectable="{{true}}">订单号:{{order.order_no}}</text>
|
||||
</view>
|
||||
<view class="order-time">
|
||||
<text>{{order.create_time}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-box b-f">
|
||||
<view class="dis-flex flow-shopList b-f" data-id="{{item.goods_id}}" wx:for="{{order.goods}}" wx:key="this">
|
||||
<view bindtap="goodsDetail" class="flow-list-left" data-id="{{item.goods_id}}">
|
||||
<image mode="scaleToFill" src="{{item.image.file_path}}"></image>
|
||||
</view>
|
||||
<view class="flow-list-right">
|
||||
<text class="h4 twolist-hidden">{{item.goods_name}}</text>
|
||||
<text class="p f-22 col-7">{{item.goods_attr}}</text>
|
||||
<view class="flow-list-cont">
|
||||
<text class="flow-cont">¥{{item.goods_price}}</text>
|
||||
<text class="small">×{{item.total_num}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<view class="flex-box" wx:if="{{order.pay_status.value==20&&(order.order_status.value==10||order.order_status.value==30)&&item.refund_status==0&&order.delivery_status.value==20}}">
|
||||
<view bindtap="aftermarketOrder" class="btn-main1" data-id="{{item.order_goods_id}}">申请售后</view>
|
||||
</view>
|
||||
<view class="flex-box" wx:if="{{item.refund_status>0}}">
|
||||
<view bindtap="aftermarketOrder" class="btn-default" data-id="{{item.order_goods_id}}">售后详情</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="select b-f">
|
||||
<view class="flow-num-box b-f">共{{order.goods.length}}件商品,合计: <text class="flow-money">{{order.total_price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flow-all-money b-f padding-box m-top20">
|
||||
<view class="dis-flex flow-all-list">
|
||||
<text class="flex-five">订单金额</text>
|
||||
</view>
|
||||
<view class="dis-flex flow-all-list-cont">
|
||||
<text class="flex-five col-7">商品金额:</text>
|
||||
<text class="flex-five col-m t-r">¥{{order.total_price}}</text>
|
||||
</view>
|
||||
<view class="dis-flex flow-all-list-cont">
|
||||
<text class="flex-five col-7">应付金额:</text>
|
||||
<text class="flex-five col-m t-r">¥{{order.pay_price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="flow-fixed-footer b-f">
|
||||
<view class="dis-flex chackout-box" wx:if="{{order.pay_status.value==10}}">
|
||||
<button class="flex-box chackout-right-detail btn-normal" openType="contact">
|
||||
<text bindtap="payOrder" class="flow-btn" wx:if="{{order.pay_status.value==10}}">联系客服付款</text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="flow-btn h3" wx:if="{{order.delivery_status.value==20&&order.receipt_status.value==10}}">
|
||||
<view bindtap="receipt">确认收货</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
1
wx05cb767e6530b48f/pages/order/detail.wxss
Normal file
1
wx05cb767e6530b48f/pages/order/detail.wxss
Normal file
@@ -0,0 +1 @@
|
||||
.flow-distribution{border-bottom:1rpx solid #eee;padding:18rpx 0}.flow-distribution .flow-dis{font-size:30rpx}.flow-distribution-left{flex:14}.btn-default{border:1rpx solid #ccc;border-radius:4px;color:#555;float:right;font-size:28rpx;padding:6rpx 20rpx}.flow-distribution-left .m-l{color:#333;float:right}.flow-distribution-right{flex:1}.flow-distribution image{float:right;height:30rpx;margin-top:6rpx;width:30rpx}.flow-message-box{padding:20rpx 15px;position:relative}.flow-message-box .flow-message-title{color:#777}.flow-message-box textarea{border-bottom:1rpx solid #eee;height:100rpx;margin-top:10rpx;padding:10rpx 0;width:100%}.flow-message-box .flow-message-num{bottom:34rpx;color:#777;font-size:26rpx;position:absolute;right:30rpx}.flow-distribution .flow-dis{padding-right:15px}.flow-message-box{border-bottom:1rpx solid #f1f1f1}.flow-message-box .cont{color:#000;padding:10px 0}.order-cont{justify-content:space-between}.order-cont .order-num text,.order-cont .time{color:#888}.order-cont .order-num text,.order-cont .order-time text{color:#777;font-size:26rpx}.order-header{border-bottom:1rpx solid #f1f1f1;padding:15rpx 0}.order-header text{font-size:28rpx}.order-header text.title{color:#333}.flow-list .header{background:#fff;border-bottom:1rpx solid #f1f1f1;padding:15rpx 0;position:relative}.flow-list .header text{font-size:32rpx;padding-left:80rpx}.flow-list .header image{height:37rpx;left:15px;margin-top:-18rpx;position:absolute;top:50%;width:34rpx}.chackout-left-detail,.chackout-right-detail{color:#333;font-size:34rpx}.chackout-left-detail{line-height:44px}.btn-main1{border:1rpx solid #fd4a5f;border-radius:4px;color:#fd4a5f;float:right;font-size:28rpx;padding:6rpx 20rpx}
|
||||
1
wx05cb767e6530b48f/pages/order/index.js
Normal file
1
wx05cb767e6530b48f/pages/order/index.js
Normal file
@@ -0,0 +1 @@
|
||||
var t=getApp();Page({data:{dataType:"all",list:[]},onLoad:function(t){this.data.dataType=t.type||"all",this.setData({dataType:this.data.dataType})},onShow:function(){this.getOrderList(this.data.dataType)},getOrderList:function(a){var e=this;t._get("user.order/lists",{dataType:a},(function(t){e.setData(t.data),t.data.list.length&&wx.pageScrollTo({scrollTop:0})}))},bindHeaderTap:function(t){this.setData({dataType:t.target.dataset.type}),this.getOrderList(t.target.dataset.type)},cancelOrder:function(a){var e=this,r=a.currentTarget.dataset.id;wx.showModal({title:"提示",content:"确认取消订单?",success:function(a){a.confirm&&t._post_form("user.order/cancel",{order_id:r},(function(t){e.getOrderList(e.data.dataType)}))}})},receipt:function(a){var e=this,r=a.currentTarget.dataset.id;wx.showModal({title:"提示",content:"确认收到商品?",success:function(a){a.confirm&&t._post_form("user.order/receipt",{order_id:r},(function(t){e.getOrderList(e.data.dataType)}))}})},payOrder:function(a){var e=a.currentTarget.dataset.id;wx.showLoading({title:"正在处理..."}),t._post_form("user.order/pay",{order_id:e},(function(a){if(-10===a.code)return t.showError(a.msg),!1;wx.requestPayment({timeStamp:a.data.timeStamp,nonceStr:a.data.nonceStr,package:"prepay_id="+a.data.prepay_id,signType:"MD5",paySign:a.data.paySign,success:function(t){wx.navigateTo({url:"../order/detail?order_id="+e})},fail:function(){t.showError("订单未支付")}})}))},detail:function(t){var a=t.currentTarget.dataset.id;wx.navigateTo({url:"../order/detail?order_id="+a})},onPullDownRefresh:function(){wx.stopPullDownRefresh()}});
|
||||
1
wx05cb767e6530b48f/pages/order/index.json
Normal file
1
wx05cb767e6530b48f/pages/order/index.json
Normal file
@@ -0,0 +1 @@
|
||||
{"navigationBarTitleText":"我的订单","usingComponents":{}}
|
||||
84
wx05cb767e6530b48f/pages/order/index.wxml
Normal file
84
wx05cb767e6530b48f/pages/order/index.wxml
Normal file
@@ -0,0 +1,84 @@
|
||||
<view class="container m-b5">
|
||||
<view class="goods-detail-box">
|
||||
<view class="header f-28 col-3">
|
||||
<view catchtap="bindHeaderTap" class="{{dataType==='all'?'active':''}}" data-type="all">全部订单</view>
|
||||
<view bindtap="bindHeaderTap" class="{{dataType==='payment'?'active':''}}" data-type="payment">待付款</view>
|
||||
<view bindtap="bindHeaderTap" class="{{dataType==='delivery'?'active':''}}" data-type="delivery">待发货</view>
|
||||
<view bindtap="bindHeaderTap" class="{{dataType==='received'?'active':''}}" data-type="received">待收货</view>
|
||||
</view>
|
||||
<scroll-view scrollY="{{true}}">
|
||||
<view class="wrapper">
|
||||
<view wx:if="{{list.length}}">
|
||||
<view class="m-top20 " wx:for="{{list}}" wx:key="this">
|
||||
<view class="order-box b-f">
|
||||
<view class="order-header dis-flex">
|
||||
<view class="flex-box t-l">
|
||||
<text class="title">商品列表</text>
|
||||
</view>
|
||||
<view class="flex-box t-r">
|
||||
<text class="cont" wx:if="{{item.pay_status.value==10}}">{{item.pay_status.text}}</text>
|
||||
<text class="cont" wx:if="{{item.pay_status.value==20&&item.delivery_status.value==10}}">{{item.delivery_status.text}}</text>
|
||||
<text class="cont" wx:if="{{item.pay_status.value==20&&item.delivery_status.value==20&&item.receipt_status.value==10}}">{{item.receipt_status.text}}</text>
|
||||
<text class="cont" wx:if="{{item.order_status.value==30}}">{{item.order_status.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-box b-f">
|
||||
<view class="order-cont dis-flex">
|
||||
<view class="order-num">
|
||||
<text>订单号:{{item.order_no}}</text>
|
||||
</view>
|
||||
<view class="order-time">
|
||||
<text>{{item.create_time}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-box order-img_list">
|
||||
<view class="order-shop">
|
||||
<view bindtap="detail" class="order-list-box dis-flex" data-id="{{item.order_id}}">
|
||||
<view class="left">
|
||||
<view class="dis-flex">
|
||||
<view class="order-shop-left" wx:for="{{item.goods}}" wx:key="goods">
|
||||
<image src="{{item.image.file_path}}"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right p-r">
|
||||
<text class="goods-number">共{{item.goods.length}}件</text>
|
||||
<text class="iconfont icon-xiangyoujiantou user-orderJtou"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-box b-f">
|
||||
<view class="order-btn dis-flex">
|
||||
<view class="order-left">
|
||||
<view class="text">
|
||||
<text>合计:</text>
|
||||
<text class="col-m">¥{{item.pay_price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-right">
|
||||
<view class="dis-flex">
|
||||
<view class="" wx:if="{{item.pay_status.value==10}}">
|
||||
<button class="btn-main btn-normal" data-id="{{item.order_id}}" openType="contact">联系客服付款</button>
|
||||
</view>
|
||||
<view class="flex-box" wx:if="{{item.delivery_status.value==20&&item.receipt_status.value==10}}">
|
||||
<view bindtap="receipt" class="btn-main" data-id="{{item.order_id}}">确认收货</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:else>
|
||||
<view class="yoshop-notcont">
|
||||
<text class="iconfont icon-ziyuan"></text>
|
||||
<text class="cont">亲,您还没有订单信息哦!</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
1
wx05cb767e6530b48f/pages/order/index.wxss
Normal file
1
wx05cb767e6530b48f/pages/order/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
.header{background:#fff;border-bottom:1rpx solid #e4e4e4;display:-webkit-flex;display:flex;height:44px;line-height:44px;position:fixed;top:0;width:100%;z-index:100}.header view{flex:1;text-align:center}.header .active{color:#fd4a5f}.wrapper{margin-top:54px}.order-box{padding:0 15px}.order-header{padding-top:10rpx}.order-header .title{color:#333;font-size:30rpx}.order-header .cont{color:#fd4a5f;font-size:30rpx}.order-cont{justify-content:space-between;padding:15rpx 0}.order-cont .order-num text,.order-cont .order-time text{color:#777;font-size:26rpx}.order-shop{padding:16rpx 0}.order-shop-left,.order-shop-left image{background:#fff;display:inline-block;height:160rpx;margin-right:15rpx;width:160rpx}.order-shop .num{float:right}.order-btn{padding:18rpx 0}.order-btn .order-left{flex:3}.order-btn .order-left .text,.order-btn .order-left text{font-size:30rpx}.order-btn .order-left .text{color:#777}.order-btn .order-right{flex:1.5}.order-list-box .left{flex:4;overflow:hidden;position:relative}.order-list-box .right{flex:1}.goods-number{color:#777;font-size:28rpx;position:absolute;right:12px;top:35%}.btn-default{border:1rpx solid #ccc;border-radius:4px;color:#555}.btn-default,.btn-main{float:right;font-size:28rpx;padding:6rpx 20rpx}.btn-main{border:1rpx solid #fd4a5f;border-radius:4px;color:#fd4a5f;margin-left:10rpx}.user-orderJtou{color:#888;font-size:24rpx;margin-top:-20rpx;position:absolute;right:0;top:50%}.order-img_list{background:#fff;border-bottom:1rpx solid #f1f1f1;border-top:1rpx solid #f1f1f1}.order-right-name{color:#555;font-size:30rpx;left:180rpx;line-height:1.6;margin-top:-46rpx;position:absolute;top:50%;width:100%}
|
||||
Reference in New Issue
Block a user