|
|
<template> <view> <!-- 商品信息 --> <block v-if="isRight(orderDetails)"> <view class="bg-white"> <view class="flex justify-between align-start" style="padding: 32rpx 32rpx 30rpx 32rpx;"> <image :src="orderDetails.picture" mode="aspectFill" style="width: 240rpx; height: 240rpx;border-radius: 20rpx;" @click="$url('/pages/goodsDetail/index?goods_id='+orderDetails.agent_product_id)"></image> <view class="flex-sub padding-left-sm"> <view class="bref-box lf-line-2 text-black1 lf-font-28 lf-font-bold" style="height: 88rpx;line-height: 44rpx;"> {{orderDetails.title}} </view> <text class="block lf-color-gray lf-font-28" style="margin-top: 20rpx;line-height: 40rpx;">数量 <text class="margin-left margin-right-xs lf-color-gray">x</text>{{orderDetails.num}}</text>
<view class="flex justify-between" style="margin-top: 28rpx;"> <lf-price :price="orderDetails.price" style="margin-top: 8rpx;" /> <view> <button v-if="orderDetails.status == 2 || orderDetails.status == 3" class="cu-btn1 lf-color-gray lf-border-gray" @tap="$url('/pages/order/apply_refund?order_id='+orderDetails.id)">申请退款</button> </view> </view> </view> </view> </view>
<self-line /> <!-- 表单 --> <view class="bg-white"> <view class="cu-bar padding-lr flex justify-between align-center text-center"> <text class="lf-color-555 lf-font-28">订单编号</text> <view> <text class="margin-right lf-font-28 text-black1">{{orderDetails.order_no}}</text> <text class="text-orange lf-font-28" @click="copy(orderDetails.order_no)">复制</text> </view> </view> <view class="cu-bar padding-lr" v-if="orderDetails.created_at"> <text class="lf-color-555 lf-font-28">下单时间</text> <text class="lf-font-28 text-black1">{{ orderDetails.created_at }}</text> </view> <view class="cu-bar padding-lr" v-if="orderDetails.paid_at"> <text class="lf-color-555 lf-font-28">付款时间</text> <text class="lf-font-28 text-black1" v-if="orderDetails.paid_at == 0">暂未付款</text> <text class="lf-font-28 text-black1" v-else>{{ orderDetails.paid_at }}</text> </view> <view class="cu-bar padding-lr"> <text class="lf-color-555 lf-font-28">支付方式</text> <text class="lf-font-28 text-black1">{{orderDetails.pay_type_text}}</text> </view> <view class="cu-bar padding-lr" :class="item.type=='image' || item.type == 'textarea'?'flex-img':''" v-for="(item,index) of orderDetails.info" :key="index"> <text class="lf-color-555 lf-font-28">{{index}}</text> <text class="lf-font-28 text-black1" v-if="!item.type">{{item}}</text> <text class="lf-font-28 text-black1" v-if="item.type=='text'">{{item.value}}</text> <text class="lf-font-28 text-black1" v-if="item.type=='radio'">{{item.value}}</text> <text class="lf-font-28 text-black1" v-if="item.type=='checkbox'">{{item.value}}</text> <view v-if="item.type == 'image'"> <view class="grid col-3 grid-square flex-sub lf-m-t-30"> <view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="bg-img" v-for="(item2,index2) in item.value" :key="index2" @tap="showImg(item.value,index2)" :data-url="item.value[index2]"> <image :src="item.value[index2]" mode="aspectFill"></image> </view> </view> </view> <view class="cu-self menu lf-w-100" style="margin-top: 30rpx; position: relative;" v-if="item.type == 'textarea'"> <textarea :cursor-spacing="120" disabled maxlength="300" :adjust-position="true" type="text" style="background-color: #F8F8F8;border-radius: 20rpx;" class="text-left lf-font-28 area-self lf-w-100 lf-p-20" :placeholder="item.value" /> </view> </view> </view> <view> <self-line /> <view class="bg-white flex flex-direction justify-around align-center text-center padding-tb" style="padding-bottom: 140rpx;"> <view> <image v-if="orderDetails.verify_qrcode" :src="orderDetails.verify_qrcode" mode="aspectFill" style="width: 300rpx;height: 300rpx;" :class="!orderDetails.verify_qrcode?'filter-code':''"></image> <!-- <view class="qrcode-loading" v-else> <text class="lf-font-40 lf-color-333" :class="!orderDetails.verify_qrcode?'loading-more-text':''"></text> <view class="lf-m-t-40 lf-color-gray">核销码生成中</view> </view> --> </view> <view class="lf-m-t-10"> <view class="lf-font-28 text-black1"> <text>{{checkArea}} </text> <text v-if="checkArea" class="lf-color-blue lf-font-28 lf-m-l-10" @tap="copy(checkArea)">复制</text> </view> </view> <view v-if="checkArea"> <view class="lf-color-green lf-font-28 lf-flex lf-m-t-10"> <text v-if="orderDetails.verify_code && orderDetails.status != 16">待使用</text> <text v-if="orderDetails.verify_code && orderDetails.status == 16">已使用</text> </view> </view> </view> <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top1 btn-bottom"> <view class="flex align-center"> <text class="lf-color-555 lf-font-28" style="margin-right: 20rpx;">实付款</text> <lf-price :price="orderDetails.price" /> </view> <button class="btn bg-green" v-if="orderDetails.status == 0" @click="payAtonce()"> <text class="lf-font-32 text-white">立即付款</text> </button> <button class="btn bg-green" v-if="orderDetails.status == 1" @click="payAtonce()"> <text class="lf-font-32 text-white">支付尾款</text> </button> <button class="btn lf-bg-gray" v-if="orderDetails.status == 6"> <text class="lf-font-32 text-white">等待审核</text> </button> <button class="btn lf-bg-gray" v-if="orderDetails.status == 7"> <text class="lf-font-32 text-white">退款成功</text> </button> <button class="btn lf-bg-gray" v-if="orderDetails.status == 8"> <text class="lf-font-32 text-white">退款被拒绝</text> </button> <button class="btn lf-bg-gray" v-if="orderDetails.status == 4"> <text class="lf-font-32 text-white">{{orderDetails.status_text}}</text> </button> <button class="btn lf-bg-gray" v-if="orderDetails.status == -1"> <text class="lf-font-32 text-white">已取消</text> </button> </view> </view> </block> </view></template>
<script> import tkiQrcode from "tki-qrcode" // 二维码生成器
export default { components: { tkiQrcode }, data() { return { base64Img: '', //
skeletonLoading: true, loading: false, order_id: 1, orderDetails: { }, checkArea: '' } }, computed: { total(){ return this.num * this.price }, isRight(){ return function(val){ return this.$shared.isRight(val); } } }, onLoad(e) { this.order_id = e.order_id if (this.order_id) { this.getOrderDetails() } }, methods: { // 预览图片
showImg(url,index) { this.$u.throttle(() => { let goods_banner = url || []; let banners = goods_banner.map(item => item); uni.previewImage({ urls: banners, current: index }) }, 200); }, refreshCode() { this.getOrderDetails() this.$msg('刷新成功') }, payAtonce() { this.$http(this.API.API_ORDERPAY,{id: this.order_id}).then(res => { console.log('从订单列表进入') if(res.data.jump) { wx.navigateToMiniProgram({ appId: res.data.jump_appid, path: '/pages/order/confirm_atonce', envVersion: 'release', extraData: { order_id: res.data.id }, success(res) { console.log('---res---') console.log(res) }, fail(err) { console.log('---err---') console.log(err) } }) } }).catch(err => {}) }, //二维码回调
qrR(data) { this.base64Img = data; }, getOrderDetails() { this.$http(this.API.API_ORDER_DETAILS, { id: this.order_id }).then(res => { this.orderDetails = res.data this.checkArea = res.data.verify_code this.skeletonLoading = false console.log(res.data) }).catch(err => { setTimeout(() => { this.$toBack() }, 1000) }); }, // 点击复制
copy(text) { uni.setClipboardData({ data: text }); }, submit() { this.$routerGo('/pages/order/order?type=all') }, }, created() {
} }</script>
<style lang="scss" scoped> .flex-img { display: flex!important; align-items: flex-start!important; flex-direction: column!important; padding: 30rpx; justify-content: space-between!important; } .loading-more-text::before { height: 60rpx; width: 60rpx; } .qrcode-loading { width: 300rpx; height: 300rpx; background-color: rgba(25, 152, 254, 0.05); display: flex; align-items: center; text-align: center; flex-direction: column; justify-content: center; border-radius: 10rpx; } .filter-code{ filter: blur(6rpx); } .btn{ margin: 0; padding: 0; width: 212rpx; height: 82rpx; background-color: #1998FE; color: #FFFFFF; line-height: 80rpx; font-size: 32rpx; border-radius: 41rpx; } .tag-self { position: absolute !important; top: 0 !important; border-radius: 20rpx 0 20rpx 0 !important; width: max-content; height: 32rpx !important; }
.title { font-size: 28rpx; color: $u-content-color; height: 90rpx; }
// tab
.ctab { width: 100%; margin: 20rpx 0 0rpx 0rpx; padding: 0 22rpx; }
// 商品列表
.com { width: 100%; overflow: hidden;
.list { border-radius: 10rpx; overflow: hidden; margin: 20rpx 32rpx; background-color: #FFFFFF; // box-shadow: 0 0 10px 5px #e5e5e5;
box-shadow: 0 10rpx 20rpx 0 rgba(0, 0, 0, 0.1); align-items: flex-start;
.left { overflow: hidden;
image { width: 186rpx; height: 186rpx; margin: 20rpx; border-radius: 10rpx; } }
.right { overflow: hidden; width: 64%;
.title { margin: 0rpx 20rpx 10rpx 0; color: #222222; font-size: 32rpx; }
.tips { margin: 16rpx 0; overflow: hidden;
.u-line-progress { width: 112rpx; overflow: hidden; margin-right: 20rpx; }
.progress { color: #777777; font-size: 24rpx; }
.bought { color: #777777; font-size: 24rpx; margin-right: 20rpx; } }
.price { overflow: hidden; color: #FF0000; margin-top: 10rpx;
button { width: 176rpx; height: 60rpx; background: #FE9903; border-radius: 15px; font-size: 24rpx; color: #FFFFFF; margin: 0rpx 20rpx 0rpx 20rpx; border: none; } } } } }</style>
|