作者 卢胜

订单详情

... ... @@ -4,10 +4,14 @@
export default {
onLaunch: function(e) {
const openId = uni.getStorageSync('openId')
console.log(openId);
if(!openId && !e.query.code){
getApp().authorization()
console.log(!openId , !e.query.code);
console.log(1)
// getApp().authorization()
}else if(e.query.code) {
getApp().getOpenid(e.query.code)
// getApp().getOpenid(e.query.code)
console.log(2)
}
console.log(e.query.code);
console.log('App Launch')
... ...
... ... @@ -17,4 +17,7 @@ export const order_confirm = (data) => request({url: 'order/order_confirm',metho
export const order_send = (order_id) => request({url: 'order/order_send',method: 'post',data: {order_id}})
// 卖家上传证明
export const order_license = (data) => request({url: 'order/order_license',method: 'post',data: data})
\ No newline at end of file
export const order_license = (data) => request({url: 'order/order_license',method: 'post',data: data})
// 订单详情
export const order_detail = (order_id) => request({url: 'order/order_detail',method: 'post',data: {order_id}})
\ No newline at end of file
... ...
... ... @@ -198,6 +198,15 @@
}
}
,{
"path" : "pages/mine/order_detail",
"style" :
{
"navigationBarTitleText": "进度详情",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
... ...
... ... @@ -5,7 +5,7 @@
<u-tabs :list="list2" lineColor="#FED000" :scrollable="false" @click="onclick"></u-tabs>
</u-sticky>
<view class="group">
<view class="item" v-for="(item,idx) in showlist" :key="idx">
<view class="item" v-for="(item,idx) in showlist" :key="idx" @click.stop="ondetail(item.id)">
<view class="top flexA">
<view class="left flexA">
<image src="/static/order.png" mode=""></image>
... ... @@ -34,14 +34,19 @@
</view>
<view class="right">
<text style="font-size: 20rpx;">¥</text>{{item.orderinfo.price}}
<view class="staright">
<text v-if="item.status==5">审核中</text>
<text v-if="item.status==7">已退回</text>
</view>
</view>
</view>
<view class="line"></view>
<view class="botBtn flexA">
<view v-if="item.license_preview" class="flexC yellow" @click="openshow(item.license_preview)">交易证明
<view v-if="item.license_preview" class="flexC yellow"
@click.stop="openshow(item.id,idx,item.license_preview,item.status)">交易证明
</view>
<view v-if="reChest(item.status)" class="flexC" @click="order_confirm(item.id,idx,1)">已收货</view>
<view v-if="reChest(item.status)" class="flexC" @click="order_confirm(item.id,idx,2)" >未收货</view>
<view v-if="reChest(item.status)" class="flexC" @click.stop="order_confirm(item.id,idx,1)">已收货</view>
<view v-if="reChest(item.status)" class="flexC" @click.stop="order_confirm(item.id,idx,2)">未收货</view>
</view>
</view>
</view>
... ... @@ -52,8 +57,10 @@
</view>
<image class="popImage" :src="showimg" mode=""></image>
<view class="popBtn flexA">
<view class="btn flexC" @click="show=false">未接收</view>
<view class="btn flexC" @click="show=false">已接收</view>
<view class="btn flexC" v-if="reChest(showstatus)" @click="order_confirm(showid,showindex,2)">未收货
</view>
<view class="btn flexC" v-if="reChest(showstatus)" @click="order_confirm(showid,showindex,1)">已收货
</view>
</view>
</view>
</u-popup>
... ... @@ -77,22 +84,31 @@
}, {
name: '已完成'
}],
show: true,
show: false,
typeindex: 0,
currentpage: 1,
num: 10,
showlist: [],
//交易证明
showid: "",
showindex: "",
showstatus: "",
showimg: "",
}
},
onLoad() {
this.buyerOrderList()
},
methods: {
// 跳转详情
ondetail(id) {
console.log(id)
uni.navigateTo({
url: "/pages/mine/order_detail?id=" + id
})
},
//确认收货
async order_confirm(id,idx,type) {
async order_confirm(id, idx, type) {
let obj = {
order_id: id,
type: type,
... ... @@ -100,16 +116,16 @@
try {
const res = await order_confirm(obj)
console.log('order_confirm', res)
if(this.typeindex=2){
this.showlist.splice(idx,1)
}else{
if(type==2){
this.showlist[idx].status=5
}else{
this.showlist[idx].status=6
this.show = false
if (this.typeindex = 2) {
this.showlist.splice(idx, 1)
} else {
if (type == 2) {
this.showlist[idx].status = 5
} else {
this.showlist[idx].status = 6
}
}
// 保存数据
} catch (err) {
uni.showToast({
... ... @@ -120,9 +136,12 @@
}
},
// 查看交易证明
openshow(img) {
openshow(id, index, img, status) {
this.showimg = img
this.show = true
this.showid = id
this.showstatus = status
this.showindex = index
},
//复制
copy(it) {
... ... @@ -170,7 +189,7 @@
if (s == 3) return true;
},
reNest(s) {
},
},
}
... ... @@ -222,6 +241,9 @@
.right {
color: rgba(0, 0, 0, 0.6);
font-size: 26rpx;
}
}
... ... @@ -256,6 +278,13 @@
.right {
font-size: 30rpx;
font-weight: 700;
.staright {
margin-top: 12rpx;
color: rgba(0, 0, 0, 0.3);
font-size: 26rpx;
font-weight: 400;
font-family: "PingFang SC";
}
}
}
... ... @@ -293,7 +322,6 @@
padding: 48rpx 32rpx 24rpx;
box-sizing: border-box;
width: 622rpx;
height: 962rpx;
background: #fff;
border-radius: 15rpx;
... ...
<template>
<view class="orderDetail">
<view class="dettop">
<view class="top flexA">
<text>{{detail.orderinfo.seller_name}}</text>
<image src="/static/2.png" mode=""></image>
<text>{{detail.buyer_name}}</text>
</view>
<view class="topbox">
<view class="boxtop flexD">
<view class="order">
订单号:{{detail.order_no}}
</view>
<view class="ordstats">
<text v-if="detail.status==1">待支付</text>
<text v-if="detail.status==2">待接收</text>
<text v-if="detail.status==3">待买家确认</text>
<text v-if="detail.status==4">已收货</text>
<text v-if="detail.status==5">平台裁决</text>
<text v-if="detail.status==6">已完成</text>
<text v-if="detail.status==7">交易失败</text>
</view>
</view>
<view class="item flexA">
<view class="left">
<image :src="detail.orderinfo.images_preview" mode=""></image>
</view>
<view class="right">
<view class="">{{detail.orderinfo.product_name}}</view>
<view class="money"><text>¥</text> {{detail.orderinfo.price}}</view>
</view>
</view>
</view>
</view>
<view class="express">
<view class="bar" v-for="(item,index) in expresslist" :key="index">
<view class="time">
<view>{{item.date}}</view>
<view>{{item.time}}</view>
</view>
<view class="centers flexcolum">
<image v-if="detail.status==6" src="/static/3.png" mode=""></image>
<image v-else src="/static/4.png" mode=""></image>
<view class="tip">
</view>
</view>
<view class="contant">
{{item.name}}
</view>
</view>
</view>
</view>
</template>
<script>
import {
order_detail
} from '@/api/order.js'
export default {
data() {
return {
id: '',
expresslist: [],
detail: {
buyer_name: "",
order_no: "",
status: "",
orderinfo: {
seller_name: "",
product_name: "",
price: "",
images_preview: "",
}
},
};
},
onLoad(options) {
this.id = options.id
this.order_detail()
},
methods: {
//订单详情
async order_detail() {
try {
const res = await order_detail(this.id)
console.log('order_detail', res)
this.detail = res.detail
this.expresslist = res.detail.time_data
// 保存数据
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
console.log('order_detail', err)
}
},
}
}
</script>
<style lang="scss">
page {
background: #f6f6f6;
}
.orderDetail {
.dettop {
height: 294rpx;
opacity: 1;
padding: 40rpx 32rpx;
background: linear-gradient(180deg, rgba(254, 208, 0, 1) 0%, rgba(254, 208, 0, 0) 92%);
.top {
color: rgba(0, 0, 0, 1);
font-size: 26rpx;
font-weight: 400;
font-family: "PingFang SC";
text-align: left;
image {
margin: 0 12rpx;
width: 80rpx;
height: 9rpx;
}
}
.topbox {
margin-top: 24rpx;
border-radius: 24rpx;
padding: 28rpx 32rpx;
background: #ffffff;
.boxtop {
.order {
color: rgba(0, 0, 0, 0.6);
font-size: 24rpx;
font-weight: 400;
font-family: "PingFang SC";
}
.ordstats {
color: rgba(254, 208, 0, 1);
font-size: 28rpx;
font-weight: 500;
font-family: "PingFang SC";
text-align: left;
line-height: 40rpx;
}
}
.item {
margin-top: 20rpx;
.left {
image {
margin-right: 16rpx;
width: 120rpx;
height: 120rpx;
border-radius: 16rpx;
}
}
.right {
color: rgba(0, 0, 0, 0.9);
font-size: 28rpx;
font-weight: 400;
font-family: "PingFang SC";
text-align: center;
.money {
margin-top: 32rpx;
color: rgba(248, 83, 23, 1);
font-size: 32rpx;
font-weight: 700;
font-family: "Montserrat";
text {
font-size: 28rpx;
}
}
}
}
}
}
.express {
padding: 66rpx 30rpx;
background-color: #ffffff;
box-sizing: border-box;
width: 686rpx;
// height: 628rpx;
border-radius: 24rpx;
margin: 0 auto;
.bar {
display: flex;
.time {
color: rgba(135, 144, 153, 1);
font-size: 22rpx;
font-weight: 400;
font-family: "PingFang SC";
}
.centers {
image {
width: 48rpx;
height: 48rpx;
}
.tip {
height: 80rpx;
width: 4rpx;
background-color: #f6f6f6;
}
}
.contant {
margin-left: 8rpx;
color: rgba(135, 144, 153, 1);
font-size: 28rpx;
font-weight: 400;
font-family: "PingFang SC";
}
&:last-child {
.centers {
.tip {
height: 0;
width: 0;
background-color: #f6f6f6;
}
}
}
}
}
}
</style>
... ...
... ... @@ -4,7 +4,7 @@
<u-tabs :list="list2" lineColor="#FED000" :scrollable="false" @click="onclick"></u-tabs>
</u-sticky>
<view class="group">
<view class="item" v-for="(item,idx) in list" :key="idx">
<view class="item" v-for="(item,idx) in list" :key="idx" @click.stop="ondetail(item.id)">
<view class="top flexA">
<view class="left flexA">
<image src="/static/order.png" mode=""></image>
... ... @@ -40,11 +40,11 @@
</view>
<view class="line"></view>
<view class="botBtn flexA">
<view v-if="reseller(item.status)" class="flexC" @click="openshowBuyer(item)">买家信息</view>
<view v-if="!item.license_preview" class="flexC" @click="openimag(item.id,idx)">上传转赠证明</view>
<view v-if="reseller(item.status)" class="flexC" @click="order_send(item.id,idx)">发货</view>
<view v-if="item.license_preview" class="flexC yellow" @click="openshow(item.license_preview)">查看交易证明</view>
<view v-if="item.license_preview" class="flexC yellow" @click="openimag(item.id,idx)">重新上传证明</view>
<view v-if="reseller(item.status)" class="flexC" @click.stop="openshowBuyer(item)">买家信息</view>
<view v-if="!item.license_preview" class="flexC" @click.stop="openimag(item.id,idx)">上传转赠证明</view>
<view v-if="reseller(item.status)" class="flexC" @click.stop="order_send(item.id,idx)">发货</view>
<view v-if="item.license_preview" class="flexC yellow" @click.stop="openshow(item.license_preview)">查看交易证明</view>
<view v-if="item.license_preview" class="flexC yellow" @click.stop="openimag(item.id,idx)">重新上传证明</view>
</view>
</view>
</view>
... ... @@ -149,6 +149,12 @@
},
methods: {
// 跳转详情
ondetail(id){
uni.navigateTo({
url:"/pages/mine/order_detail?id="+id
})
},
// 状态筛选
reseller(s) {
if (s == 2) return true;
... ...

393 字节

567 字节