|
|
|
<template>
|
|
|
|
<view class="page">
|
|
|
|
<!-- 订单商品 -->
|
|
|
|
<view class="order-goods">
|
|
|
|
<view class="goods-list">
|
|
|
|
<view v-for="(item,index) in orderInfo" :key="index">
|
|
|
|
<view class="orderNum">
|
|
|
|
订单编号:{{orderDetails.order_sn}}
|
|
|
|
</view>
|
|
|
|
<view class="list">
|
|
|
|
<view class="thumb">
|
|
|
|
<image :src="item.goods_image" mode=""></image>
|
|
|
|
</view>
|
|
|
|
<view class="item">
|
|
|
|
<view class="title">
|
|
|
|
<text class="one-omit">{{item.goods_name}}</text>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="price">
|
|
|
|
<text>购买价格:¥{{item.goods_price}}</text>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
<!-- 订单信息 -->
|
|
|
|
<view class="order-info">
|
|
|
|
<view class="weituotitle">
|
|
|
|
委托价格
|
|
|
|
</view>
|
|
|
|
<view class="priceContent">
|
|
|
|
¥{{orderDetails.order_amount}}
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="slide">
|
|
|
|
<slider :value="value" @changing="sliderChange" :min="min" disabled :max="max"/>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
<view class="numContent">
|
|
|
|
<view class="">
|
|
|
|
{{min}}
|
|
|
|
</view>
|
|
|
|
<view class="">
|
|
|
|
{{max}}
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="order-info">
|
|
|
|
<view class="info-list">
|
|
|
|
<view class="list" @click="goyhq">
|
|
|
|
<view class="title">优惠券:</view>
|
|
|
|
<view class="content">
|
|
|
|
<text>{{couponNum}}</text>
|
|
|
|
<text class="iconfont icon-more"></text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="list">
|
|
|
|
<view class="title">上架手续费:</view>
|
|
|
|
<view class="content">
|
|
|
|
<text>¥{{sxf}}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 订单明细 -->
|
|
|
|
<view class="order-details">
|
|
|
|
<view class="details-list">
|
|
|
|
<view class="list">
|
|
|
|
<view class="title">
|
|
|
|
<text>使用佣金</text>
|
|
|
|
</view>
|
|
|
|
<view class="price">
|
|
|
|
<u-switch v-model="switchValue"
|
|
|
|
:activeValue="1"
|
|
|
|
:inactiveValue="0"
|
|
|
|
></u-switch>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="btnContainer">
|
|
|
|
<view class="heji">
|
|
|
|
合计:¥{{total}}
|
|
|
|
</view>
|
|
|
|
<view class="btnItem" @click="submitHandle">
|
|
|
|
确认上架
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import {orderDetail,payUpGoods} from '@/common/api.js'
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
orderInfo:[],
|
|
|
|
warehouse:[],
|
|
|
|
orderDetails:{},
|
|
|
|
value:30,
|
|
|
|
min:0,
|
|
|
|
max:0,
|
|
|
|
coupon_id:null,
|
|
|
|
couponNum:0,
|
|
|
|
sxfRadio:null,
|
|
|
|
sxf:null,
|
|
|
|
switchValue:1,
|
|
|
|
total:0,
|
|
|
|
enough:0,
|
|
|
|
couponNumOrgin:0,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods:{
|
|
|
|
submitHandle(){
|
|
|
|
let params={
|
|
|
|
order_id:this.id,
|
|
|
|
coupon_id:this.coupon_id,
|
|
|
|
use_commission:this.switchValue,
|
|
|
|
}
|
|
|
|
payUpGoods(params).then(res=>{
|
|
|
|
|
|
|
|
if (typeof WeixinJSBridge != "undefined") {
|
|
|
|
WeixinJSBridge.invoke(
|
|
|
|
'getBrandWCPayRequest', {
|
|
|
|
"appId": rea.data.pay_data.appId,
|
|
|
|
"timeStamp": rea.data.pay_data.timeStamp,
|
|
|
|
"nonceStr": rea.data.pay_data.nonceStr,
|
|
|
|
"package": rea.data.pay_data.package,
|
|
|
|
"signType": rea.data.pay_data.signType,
|
|
|
|
"paySign": rea.data.pay_data.paySign
|
|
|
|
},
|
|
|
|
function(res) {
|
|
|
|
if (res.err_msg == "get_brand_wcpay_request:ok") {
|
|
|
|
uni.showToast({
|
|
|
|
title:"支付成功",
|
|
|
|
icon:'none'
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
uni.showToast({
|
|
|
|
title:"支付失败",
|
|
|
|
icon:'none'
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
this.getOrderDetails()
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
goyhq(){
|
|
|
|
uni.navigateTo({
|
|
|
|
url:"/pages/MyCoupon/MyCoupon?id="+this.id
|
|
|
|
})
|
|
|
|
},
|
|
|
|
gopay(){
|
|
|
|
uni.navigateTo({
|
|
|
|
url:"/pages/warehouse/pay?num="+this.orderDetails.order_amount+'&id='+this.orderDetails.id
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getOrderDetails(){
|
|
|
|
orderDetail({id:this.id,custom: { auth: true }}).then(res=>{
|
|
|
|
this.min = res.data.order_amount
|
|
|
|
this.orderDetails = Object.assign({},this.orderDetails,res.data);
|
|
|
|
this.orderInfo = res.data.order_goods
|
|
|
|
this.warehouse = res.data.warehouse
|
|
|
|
this.sxfRadio = res.data.entrustment_ratio
|
|
|
|
this.max = Number(this.min)*(1+(Number(res.data.entrusted_ratio)/100))
|
|
|
|
this.value = this.max
|
|
|
|
console.log(this.max)
|
|
|
|
let sxf = Number(res.data.order_amount)*(Number(this.sxfRadio)/100)
|
|
|
|
this.sxf = sxf.toFixed(2)
|
|
|
|
if(this.sxf>this.enough){
|
|
|
|
this.total = (Number(this.sxf) - Number(this.couponNum)).toFixed(2);
|
|
|
|
this.couponNum = this.couponNumOrgin
|
|
|
|
}else{
|
|
|
|
this.total = (Number(this.sxf)).toFixed(2);
|
|
|
|
this.couponNum = 0
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
},
|
|
|
|
sliderChange(val){
|
|
|
|
this.orderDetails.order_amount = val.detail.value;
|
|
|
|
let sxf = Number(val.detail.value)*(Number(this.sxfRadio)/100)
|
|
|
|
this.sxf = sxf.toFixed(2)
|
|
|
|
this.total = (Number(this.orderDetails.order_amount)+ Number(this.sxf) - Number(this.couponNum)).toFixed(2);
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
onLoad(option) {
|
|
|
|
if(option.coupon){
|
|
|
|
this.coupon_id = option.coupon_id;
|
|
|
|
this.couponNumOrgin = Number(option.num);
|
|
|
|
this.enough = Number(option.enough)
|
|
|
|
}
|
|
|
|
this.id = option.id;
|
|
|
|
this.getOrderDetails()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
@import 'weituo.scss';
|
|
|
|
.numContent{
|
|
|
|
display: flex;
|
|
|
|
width:100%;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
padding:0 24rpx 24rpx 24rpx;
|
|
|
|
color:gray;
|
|
|
|
}
|
|
|
|
</style>
|