pull/1/head
liudan 1 year ago
parent 55e47f9ecf
commit e61fa865dc
  1. 98
      pages/OrderDetails/OrderDetails.scss
  2. 148
      pages/OrderDetails/OrderDetails.vue
  3. 72
      pages/warehouse/weituo.vue

@ -6,21 +6,30 @@
/* 订单状态 */ /* 订单状态 */
.order-status{ .order-status{
width: 100%; // width: 100%;
background: linear-gradient(to right,$base,$change-clor); margin:24rpx;
border-radius:10rpx;
// background: linear-gradient(to right,$base,$change-clor);
background-color: #fff;
.status{ .status{
display: flex; // display: flex;
align-items: center; // align-items: center;
justify-content: center; // justify-content: center;
width: 100%; width: 100%;
height: 100rpx; padding:24rpx;
// height: 100rpx;
text{ text{
font-size: 38rpx; font-size: 30rpx;
// font-weight: bold; // font-weight: bold;
color: #FFFFFF; color: $base;
} }
.iconfont{ .iconfont{
margin-right: 20rpx; margin-right: 20rpx;
font-size: 38rpx;
}
.time{
margin-left:60rpx;
margin-top:10rpx;
} }
} }
.reason{ .reason{
@ -38,15 +47,31 @@
/* 订单商品 */ /* 订单商品 */
.order-goods{ .order-goods{
width: 100%; // width: 100%;
margin:24rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 20rpx; border-radius: 10rpx;
.goods-list{ .goods-list{
padding: 0 4%; padding: 0 4%;
.list{ .list{
display: flex; .sellerInfo{
align-items: center; display: flex;
width: 100%; align-items: center;
width: 100%;
color:$base;
padding:20rpx 0;
border-bottom:1px solid #eaeaea;
}
.orderInfo,.orderNum{
display: flex;
align-items: center;
width: 100%;
}
.orderNum{
padding:20rpx 0;
}
min-height: 200rpx; min-height: 200rpx;
.thumb{ .thumb{
display: flex; display: flex;
@ -61,14 +86,16 @@
.item{ .item{
width: 70%; width: 70%;
height: 100%; height: 100%;
color:$base;
.title{ .title{
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; width: 100%;
height: 60rpx; height: 60rpx;
text{ text{
font-size: 26rpx; font-size: 26rpx;
color: #222222;
} }
} }
.num-size{ .num-size{
@ -78,7 +105,7 @@
height: 60rpx; height: 60rpx;
text{ text{
font-size: 26rpx; font-size: 26rpx;
color: #959595; color:$base;
margin-right: 20rpx; margin-right: 20rpx;
} }
text:last-child{ text:last-child{
@ -93,7 +120,7 @@
text{ text{
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
color: #222222; color:$base;
} }
} }
.order-btn{ .order-btn{
@ -150,21 +177,22 @@
/* 订单信息 */ /* 订单信息 */
.order-info{ .order-info{
width: 100%; // width: 100%;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 20rpx; border-radius: 10rpx;
margin: 20rpx auto; margin: 24rpx;
.info-list{ .info-list{
padding: 0 4%; padding: 0 4%;
.list{ .list{
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
border-bottom: 2rpx solid #f6f6f6; border-bottom: 2rpx solid #f6f6f6;
.title{ .title{
font-size: 26rpx; font-size: 26rpx;
color: #959595; color: $base;
} }
.content{ .content{
display: flex; display: flex;
@ -172,8 +200,8 @@
margin-left: 20rpx; margin-left: 20rpx;
text{ text{
font-size: 26rpx; font-size: 26rpx;
font-weight: bold; // font-weight: bold;
color: #222222; color: $base;
} }
.btn{ .btn{
padding: 6rpx 20rpx; padding: 6rpx 20rpx;
@ -190,10 +218,10 @@
/* 订单明细 */ /* 订单明细 */
.order-details{ .order-details{
width: 100%; // width: 100%;
margin:24rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 20rpx; border-radius: 10rpx;
margin: 20rpx auto;
.details-list{ .details-list{
padding: 0 4%; padding: 0 4%;
.list{ .list{
@ -205,11 +233,12 @@
border-bottom: 2rpx solid #f6f6f6; border-bottom: 2rpx solid #f6f6f6;
.title{ .title{
font-size: 26rpx; font-size: 26rpx;
color: #959595; color: $base;
} }
.price{ .price{
font-size: 26rpx; font-size: 26rpx;
font-weight: bold; color: $base;
// font-weight: bold;
} }
} }
.action{ .action{
@ -218,12 +247,24 @@
justify-content: flex-end; justify-content: flex-end;
.price{ .price{
font-size: 32rpx; font-size: 32rpx;
font-weight: bold;
color: $base; color: $base;
} }
} }
} }
} }
.pic{
margin:24rpx;
padding-bottom:100rpx;
.title{
color:$base;
}
image{
width:300rpx;
height:300rpx;
border:1px solid #eaeaea;
margin-top:10rpx;
}
}
.btnContainer{ .btnContainer{
position: absolute; position: absolute;
bottom:20rpx; bottom:20rpx;
@ -238,5 +279,6 @@
background-color: $base; background-color: $base;
padding:10rpx 20rpx; padding:10rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
margin:0 10rpx;
} }
} }

@ -5,6 +5,9 @@
<view class="status"> <view class="status">
<text class="iconfont icon-zhuyi"></text> <text class="iconfont icon-zhuyi"></text>
<text>{{orderDetails.status==0?'待支付':orderDetails.status==1?'待确认':orderDetails.status==2?'待委托':orderDetails.status==3?'已投诉':orderDetails.status==4?'待发货':orderDetails.status==5?'待收货':orderDetails.status==-1?'已取消':''}}</text> <text>{{orderDetails.status==0?'待支付':orderDetails.status==1?'待确认':orderDetails.status==2?'待委托':orderDetails.status==3?'已投诉':orderDetails.status==4?'待发货':orderDetails.status==5?'待收货':orderDetails.status==-1?'已取消':''}}</text>
<!-- <view class="time" v-if="orderDetails.status==0">
剩余<text>19小时59分钟24秒</text>请您尽快完成支付
</view> -->
</view> </view>
</view> </view>
@ -13,21 +16,36 @@
<view class="order-goods"> <view class="order-goods">
<view class="goods-list"> <view class="goods-list">
<view class="list" v-for="(item,index) in orderInfo" :key="index"> <view class="list" v-for="(item,index) in orderInfo" :key="index">
<view class="thumb"> <view class="sellerInfo">
<image :src="item.goods_image" mode="aspectFill"></image> <view class="title">{{orderDetails.seller?orderDetails.seller.nickname:'-'}}</view>
<view class="content" style="margin-left:20rpx;">
<text>{{orderDetails.seller?orderDetails.seller.mobile:'-'}}</text>
</view>
</view> </view>
<view class="item"> <view class="orderNum">
<view class="title"> <view class="title">订单号:</view>
<text class="one-omit">{{item.goods_name}}</text> <view class="content">
<text>{{orderDetails.order_sn}}</text>
</view> </view>
<view class="num-size"> </view>
<text>数量{{item.num}}</text> <view class="orderInfo">
<view class="thumb">
<image :src="item.goods_image" mode="aspectFill"></image>
</view> </view>
<view class="price"> <view class="item">
<text>{{item.goods_price}}</text> <view class="title">
<text class="one-omit">{{item.goods_name}}</text>
</view>
<!-- <view class="num-size">
<text>数量{{item.num}}</text>
</view> -->
<view class="price">
<text>{{item.goods_price}}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
@ -36,18 +54,19 @@
<view class="order-info"> <view class="order-info">
<view class="info-list"> <view class="info-list">
<view class="list"> <view class="list">
<view class="title">订单编号:</view> <view class="title">订单提交时间:</view>
<view class="content"> <view class="content">
<text>{{orderDetails.order_sn}}</text> <text>{{getTime(orderDetails.createtime)}}</text>
</view> </view>
</view> </view>
<view class="list"> <view class="list">
<view class="title">下单时间:</view> <view class="title">付款确认时间:</view>
<view class="content"> <view class="content">
<text>{{getTime(orderDetails.createtime)}}</text> <text>{{orderDetails.pay_time_text}}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 订单明细 --> <!-- 订单明细 -->
@ -61,19 +80,43 @@
<text>{{orderDetails.order_amount}}</text> <text>{{orderDetails.order_amount}}</text>
</view> </view>
</view> </view>
<view class="list">
<view class="title">
<text>实付款</text>
</view>
<view class="price">
<text>{{orderDetails.pay_amount}}</text>
</view>
</view>
</view> </view>
</view> </view>
<view class="btnContainer"> <view class="pic">
<view class="btnItem" @click="gopay"> <view class="title">
去支付 款截图
</view> </view>
<image :src="orderDetails.pay_voucher" mode="aspectFit"></image>
</view> </view>
<view class="btnContainer" v-if="orderDetails.status==0">
<view class="btnItem" @click.native.stop="uploadPay()">上传凭证</view>
<view class="btnItem" @click.native.stop="goPay()">去支付</view>
<view class="btnItem" @click.native.stop="confirmPay()">支付确认</view>
</view>
<u-upload
:previewFullImage="false"
@afterRead="afterRead"
width="176" height="176"
style="display: none;"
ref="uploadPay"
name="1"
></u-upload>
<u-toast ref="uToast"></u-toast>
</view> </view>
</template> </template>
<script> <script>
import {orderDetail} from '@/common/api.js' import {getToken} from '@/common/auth.js'
import {orderDetail,orderPay} from '@/common/api.js'
export default { export default {
data() { data() {
return { return {
@ -83,6 +126,75 @@
}; };
}, },
methods:{ methods:{
//
async afterRead(event) {
console.log(event)
// multiple true , file
let lists = [].concat(event.file)
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
this.$refs.uToast.show({
message:'上传成功'
})
if(event.name==1){
this.getOrderDetails()
// this.tableData[this.selectedIndex].pay_voucher = JSON.parse(result).data.url;
}
}
},
//
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: this.baseUrl+'api/common/upload',
filePath: url,
name: 'file',
header:{
token:getToken()
},
formData: {
},
success: (res) => {
if(JSON.parse(res.data).code==1){
setTimeout(() => {
resolve(res.data)
}, 1000)
}else{
uni.$u.toast(JSON.parse(res.data).msg)
resolve(res.data)
}
},
fail: (res) => {
console.log(res,"rrr")
}
});
})
},
uploadPay(item,index){
this.$refs.uploadPay.chooseFile();
},
confirmPay(item){
if(!this.orderDetails.pay_voucher){
this.$refs.uToast.show({
message:'请上传支付凭证'
})
return;
}
let params={
pay_voucher:this.orderDetails.pay_voucher,
id:this.orderDetails.id,
status:1
}
orderPay(params).then(res=>{
this.getOrderDetails()
})
},
gopay(){ gopay(){
uni.navigateTo({ uni.navigateTo({
url:"/pages/warehouse/pay?num="+this.orderDetails.order_amount+'&id='+this.orderDetails.id url:"/pages/warehouse/pay?num="+this.orderDetails.order_amount+'&id='+this.orderDetails.id

@ -54,7 +54,7 @@
<view class="list" @click="goyhq"> <view class="list" @click="goyhq">
<view class="title">优惠券:</view> <view class="title">优惠券:</view>
<view class="content"> <view class="content">
<text>{{couponNum}}</text> <text>{{couponNumOrgin}}</text>
<text class="iconfont icon-more"></text> <text class="iconfont icon-more"></text>
</view> </view>
</view> </view>
@ -74,10 +74,12 @@
<view class="list"> <view class="list">
<view class="title"> <view class="title">
<text>使用佣金</text> <text>使用佣金</text>
<text class="yongjin">{{available_commission_amount}}</text>
</view> </view>
<view class="price"> <view class="price">
<u-switch v-model="switchValue" <u-switch v-model="switchValue"
:activeValue="1" :activeValue="1"
@change="changeYongjin"
:inactiveValue="0" :inactiveValue="0"
></u-switch> ></u-switch>
</view> </view>
@ -99,7 +101,7 @@
<script> <script>
import jweixin from 'jweixin-module' import jweixin from 'jweixin-module'
// Vue.use(jweixin) // Vue.use(jweixin)
import {orderDetail,payUpGoods} from '@/common/api.js' import {orderDetail,payUpGoods,getUserCommissionStatistic} from '@/common/api.js'
export default { export default {
data() { data() {
return { return {
@ -110,16 +112,25 @@
min:0, min:0,
max:0, max:0,
coupon_id:null, coupon_id:null,
couponNum:0,
sxfRadio:null, sxfRadio:null,
sxf:null, sxf:null,
switchValue:1, switchValue:1,
total:0, total:0,
enough:0, enough:0,
couponNumOrgin:0, couponNumOrgin:0,
available_commission_amount:0,
}; };
}, },
methods:{ methods:{
changeYongjin(val){
console.log(val)
if(val){
this.total = (Number(this.sxf) - Number(this.couponNumOrgin) - Number(this.available_commission_amount)).toFixed(2);
}else{
this.total = (Number(this.sxf) - Number(this.couponNumOrgin)).toFixed(2);
}
},
submitHandle(){ submitHandle(){
let params={ let params={
order_id:this.id, order_id:this.id,
@ -221,23 +232,37 @@
}, },
getOrderDetails(){ getOrderDetails(){
orderDetail({id:this.id,custom: { auth: true }}).then(res=>{ orderDetail({id:this.id,custom: { auth: true }}).then(res=>{
this.min = Number(res.data.order_amount).toFixed(2) getUserCommissionStatistic().then(result=>{
this.orderDetails = Object.assign({},this.orderDetails,res.data);
this.orderInfo = res.data.order_goods this.available_commission_amount = result.data.available_commission_amount
this.warehouse = res.data.warehouse // this.available_commission_amount = 10
this.sxfRadio = res.data.entrustment_ratio
this.max =Number((Number(this.min)*(1+(Number(res.data.entrusted_ratio)/100)))).toFixed(2) this.min = Number(res.data.order_amount).toFixed(2)
this.value = this.max this.orderDetails = Object.assign({},this.orderDetails,res.data);
console.log(this.max) this.orderInfo = res.data.order_goods
let sxf = Number(res.data.order_amount)*(Number(this.sxfRadio)/100) this.warehouse = res.data.warehouse
this.sxf = sxf.toFixed(2) this.sxfRadio = res.data.entrustment_ratio
// if(this.sxf>this.enough){ this.max =Number((Number(this.min)*(1+(Number(res.data.entrusted_ratio)/100)))).toFixed(2)
this.total = (Number(this.sxf) - Number(this.couponNum)).toFixed(2); this.value = this.max
this.couponNum = this.couponNumOrgin console.log(this.max)
// }else{ let sxf = Number(res.data.order_amount)*(Number(this.sxfRadio)/100)
// this.total = (Number(this.sxf)).toFixed(2); this.sxf = sxf.toFixed(2)
// this.couponNum = 0 // if(this.sxf>this.enough){
// } if(this.switchValue==1){
this.total = (Number(this.sxf) - Number(this.couponNumOrgin) - Number(this.available_commission_amount)).toFixed(2);
console.log(Number(this.available_commission_amount))
}else{
this.total = (Number(this.sxf) - Number(this.couponNumOrgin)).toFixed(2);
}
if(this.total<0){
this.total = 0
}
// }else{
// this.total = (Number(this.sxf)).toFixed(2);
// this.couponNum = 0
// }
})
}) })
}, },
@ -255,9 +280,12 @@
this.coupon_id = option.coupon_id; this.coupon_id = option.coupon_id;
this.couponNumOrgin = Number(option.num); this.couponNumOrgin = Number(option.num);
this.enough = Number(option.enough) this.enough = Number(option.enough)
}else{
this.couponNumOrgin = 0;
} }
this.id = option.id; this.id = option.id;
this.getOrderDetails() this.getOrderDetails()
} }
} }
</script> </script>
@ -272,4 +300,8 @@
padding:0 24rpx 24rpx 24rpx; padding:0 24rpx 24rpx 24rpx;
color:gray; color:gray;
} }
.yongjin{
color:$base;
margin-left:40rpx;
}
</style> </style>

Loading…
Cancel
Save