You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
hezhiying/pages/warehouse/weituo.vue

171 lines
4.2 KiB

<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">
{{value}}
</view>
<view class="slide">
<u-slider activeColor="#236030" v-model="value" min="30" max="80"></u-slider>
</view>
</view>
<view class="order-info">
<view class="info-list">
<view class="list">
<view class="title">优惠券:</view>
<view class="content">
<text class="iconfont icon-more"></text>
</view>
</view>
<view class="list">
<view class="title">上架手续费:</view>
<view class="content">
<text>¥1.00</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">
<text>¥0</text>
</view>
</view>
</view>
</view>
<view class="btnContainer">
<view class="heji">
合计:¥200
</view>
<view class="btnItem">
确认上架
</view>
</view>
</view>
</template>
<script>
import {orderDetail} from '@/common/api.js'
export default {
data() {
return {
orderInfo:[],
warehouse:[],
orderDetails:{},
value:30,
};
},
methods:{
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.orderDetails = Object.assign({},this.orderDetails,res.data);
this.orderInfo = res.data.order_goods
this.warehouse = res.data.warehouse
})
},
getTime(time){
// 时间戳
let timestamp = time
// 此处时间戳以毫秒为单位
let date = new Date(parseInt(timestamp) * 1000);
let Year = date.getFullYear();
let Moth = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
let Day = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate());
let Hour = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
let Minute = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
let Sechond = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
let GMT = Year + '-' + Moth + '-' + Day + ' '+ Hour +':'+ Minute + ':' + Sechond;
return GMT
// console.log(GMT) // 2022-09-07 15:56:07
},
// 微信支付
async pay(pay_list) {
let that = this;
// #ifdef H5
if (typeof WeixinJSBridge != "undefined") {
return new Promise((resove, reject) => {
WeixinJSBridge.invoke(
'getBrandWCPayRequest', {
"appId": "", //公众号ID,由商户传入
"timeStamp": "", //时间戳,自1970年以来的秒数
"nonceStr": "", //随机串
"package": "",
"signType": "", //微信签名方式:
"paySign": "" //微信签名
},
function(res) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
setTimeout(() => {
resove(true)
}, 1000)
} else {
that.showToast({
title: `支付失败`
})
setTimeout(() => {
reject("支付失败")
}, 1000)
}
})
});
}
// #endif
},
},
onLoad(option) {
this.id = option.id;
this.getOrderDetails()
}
}
</script>
<style scoped lang="scss">
@import 'weituo.scss';
</style>