Commit a6650e0e by LJM

订单列表

parent a54abba0
.page-userOrderDetail {
background-color: #f00;
}
......@@ -106,12 +106,7 @@
font-size: 22rpx;
color: #919399;
}
.color1 {
font-size: 24rpx;
color: #f98119;
font-weight: bold;
}
.color2 {
.color {
font-size: 24rpx;
color: #1969f9;
font-weight: bold;
......@@ -159,6 +154,8 @@
}
.right-bar {
.btn {
width: 120rpx;
height: 48rpx;
margin-right: 24rpx;
&:last-child {
margin-right: 0;
......@@ -166,32 +163,24 @@
}
.btn0 {
width: 142rpx;
height: 48rpx;
background: #f98119;
border-radius: 6rpx;
font-size: 22rpx;
color: #fff;
}
.btn1 {
width: 142rpx;
height: 48rpx;
border-radius: 6rpx;
border: 1px solid #1969f9;
font-size: 22rpx;
color: #1969f9;
}
.btn2 {
width: 142rpx;
height: 48rpx;
border-radius: 6rpx;
border: 1px solid #1969f9;
font-size: 22rpx;
color: #1969f9;
}
.btn3 {
width: 142rpx;
height: 48rpx;
background: #ffffff;
border-radius: 6rpx;
opacity: 0.54;
......@@ -200,16 +189,12 @@
color: #484b59;
}
.btn4 {
width: 142rpx;
height: 48rpx;
background: #1969f9;
border-radius: 6rpx;
font-size: 22rpx;
color: #fff;
}
.btn5 {
width: 142rpx;
height: 48rpx;
background: #ffffff;
border-radius: 6rpx;
opacity: 0.54;
......@@ -218,8 +203,6 @@
color: #484b59;
}
.btn6 {
width: 142rpx;
height: 48rpx;
background: #1969f9;
border-radius: 6rpx;
font-size: 22rpx;
......
......@@ -53,18 +53,18 @@
"navigationBarTitleText": "提交订单"
}
},
{
"path": "pages/confirm/pay",
"style": {
"navigationBarTitleText": "猎芯收银台"
}
},
{
"path": "pages/confirm/offline",
"style": {
"navigationBarTitleText": "转账支付"
}
},
{
"path": "pages/confirm/pay",
"style": {
"navigationBarTitleText": "猎芯收银台"
}
},
{
"path": "pages/confirm/offline",
"style": {
"navigationBarTitleText": "转账支付"
}
},
{
"path": "pages/confirm/confirmSuccess",
"style": {
......@@ -102,6 +102,12 @@
}
},
{
"path": "pages/mine/orderdetail",
"style": {
"navigationBarTitleText": "订单详情"
}
},
{
"path": "pages/mine/userCoupon",
"style": {
"navigationBarTitleText": "优惠券"
......
<template>
<view class="page-userOrderDetail">订单详情</view>
</template>
<script>
import { Api_Url } from '@/util/api.js';
export default {
data() {
return {};
},
onShow() {
this.getData();
},
methods: {
getData() {
this.request(Api_Url + '/order/lists', 'POST', this.searchParams, true, true).then(res => {
if (res.err_code === 0) {
this.list = res.data.list;
} else {
this.list = [];
}
});
}
}
};
</script>
<style lang="scss">
@import '@/assets/css/mine/orderdetail.scss';
</style>
......@@ -27,7 +27,21 @@
<text class="t2">{{ item.order_sn }}</text>
<text class="t3">{{ item.create_time }}</text>
</view>
<text class="color2">{{ item.status_val }}</text>
<!-- 已取消 -->
<template v-if="item.status == -1">
<text class="color" style="color: #919399;">{{ item.status_val }}</text>
</template>
<!-- 待审核 -->
<template v-else-if="item.status == 1">
<text class="color" style="color: #1969F9;">{{ item.status_val }}</text>
</template>
<!-- 交易成功 -->
<template v-else-if="item.status == 10">
<text class="color" style="color: #919399;">{{ item.status_val }}</text>
</template>
<template v-else>
<text class="color">{{ item.status_val }}</text>
</template>
</view>
<view class="p2 row bothSide verCenter">
<view class="row verCenter">
......@@ -36,12 +50,12 @@
<text class="t1">运费:</text>
<text class="t2">{{ item.shipping_price_format }}</text>
</view>
<view class="right-bar">
<navigator class="right-bar" :url="'/user/orderdetail?order_id=' + item.order_id" hover-class="none">
<text class="bar-t1"></text>
<text class="bar-t2">{{ item.list.length }}</text>
<text class="bar-t1">件商品</text>
<text class="iconfont icon-jt"></text>
</view>
</navigator>
</view>
<view class="p3 row bothSide verCenter">
<view class="row verCenter">
......@@ -52,7 +66,7 @@
<view class="btn btn0 row rowCenter verCenter" v-if="item.status == 2 || item.status == 3" @click.stop="nowPay(item.order_id)">立即支付</view>
<view class="btn btn1 row rowCenter verCenter" v-if="item.status == 10 || item.status == -1" @click.stop="rebuy(item.order_id)">再次购买</view>
<view class="btn btn2 row rowCenter verCenter" v-if="item.status == 4" @click.stop="sendTip(item.order_sn, item.user_id)">提醒发货</view>
<view class="btn btn3 row rowCenter verCenter" v-if="item.status != 1" @click.stop="downpd(item.order_id)">下载合同</view>
<view class="btn btn3 row rowCenter verCenter" v-if="item.status != 1" @click.stop="download(item.order_id)">下载合同</view>
<view class="btn btn4 row rowCenter verCenter" v-if="item.status == 7 || item.status == 8 || item.status == 10" @click.stop="ship(item.order_id, item.order_sn, item.zy_delivery_type, item.status)">查看物流</view>
<view class="btn btn5 row rowCenter verCenter" v-if="item.status == 2 || item.status == 1" @click.stop="cancelOrder(item.order_id)">取消订单</view>
<view class="btn btn6 row rowCenter verCenter" v-if="item.status == 8" @click.stop="sureSend(item.order_id)">确认收货</view>
......@@ -100,6 +114,32 @@
</view>
</view>
</uni-popup>
<!--提示 -->
<uni-popup ref="popupCenter" type="center">
<view class="layer-box-confirm">
<template v-if="tipType == 1">
<view class="tip-title column rowCenter verCenter">
<text>全部商品添加购物车成功</text>
<text>您可前往购物车结算~</text>
</view>
<view class="btn row bothSide verCenter">
<view class="btn1 row rowCenter verCenter" @click="close(1)">关闭</view>
<navigator url="joincart" hover-class="none" class="btn2 row rowCenter verCenter">前往购物车</navigator>
</view>
</template>
<template v-else-if="tipType == 2">
<view class="tip-title column rowCenter verCenter">
<text>非常抱歉当前订单商品暂无库存</text>
<text>请联系客服找料!</text>
</view>
<view class="btn row bothSide verCenter">
<view class="btn1 row rowCenter verCenter" @click="close(1)">关闭</view>
<view class="btn2 row rowCenter verCenter">联系客服</view>
</view>
</template>
</view>
</uni-popup>
</view>
</template>
......@@ -120,6 +160,7 @@ export default {
list: [],
currencyIndex: 0,
currency_arr: ['全部', '人民币', '美元'],
tipType: 1,
searchParams: {
order_sn: '',
p: 1,
......@@ -173,8 +214,12 @@ export default {
open() {
this.$refs.popup.open('bottom');
},
close() {
this.$refs.popup.close();
close(type) {
if (type == 1) {
this.$refs.popupCenter.close();
} else {
this.$refs.popup.close();
}
},
bindDateChange: function(e, type) {
if (type == 1) {
......@@ -210,23 +255,140 @@ export default {
* 立即支付
* @param {Object} order_id
*/
nowPay(order_id) {},
nowPay(order_id) {
uni.navigateTo({
url: '/pay/online?order_id=' + order_id
});
},
/**
* 再次购买
* @param {Object} order_id
*/
rebuy(order_id) {},
rebuy(order_id) {
this.request(Api_Url + '/cart/rebuy', 'POST', { order_id: order_id }, true, true).then(res => {
if (res.err_code === 0) {
var count = Number(res.data.count);
var successCount = Number(res.data.success);
if (count == successCount) {
//全部购买成功
this.tipType = 1;
this.$refs.popupCenter.open('center');
}
if (successCount == 0) {
//全部购买失败
this.tipType = 2;
this.$refs.popupCenter.open('center');
}
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
/**
* 提醒发货
* @param {Object} order_sn
* @param {Object} user_id
*/
sendTip(order_sn, user_id) {},
sendTip(order_sn, user_id) {
uni.showModal({
title: '提示',
content: '你确定要提醒发货吗?',
success: res => {
if (res.confirm) {
console.log('用户点击确定');
this.request(Api_Url + '/crm/remindDelivery', 'POST', { order_sn: order_sn, user_id: user_id }, true, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
title: '提醒成功',
icon: 'success'
});
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
/**
* 下载合同
*/
download(order_id) {
this.request(Api_Url + '/contract/checkPdf', 'POST', { id: order_id }, true, true).then(res => {
if (res.err_code === 0) {
var url = Api_Url + '/contract/pdf?id=' + order_id + '&pf=' + 2;
uni.downloadFile({
url: url,
success: function(res) {
const filePath = res.tempFilePath;
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
console.log('打开文档成功');
},
fail: function() {
uni.showModal({
title: '提示',
content: '暂不支持该文件类型预览',
showCancel: false
});
console.log('打开文档失败');
}
});
}
});
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
/**
* 取消订单
* @param {Object} order_id
*/
cancelOrder(order_id) {},
cancelOrder(order_id) {
uni.showModal({
title: '提示',
content: '你确定要取消该订单嘛?',
success: res => {
if (res.confirm) {
console.log('用户点击确定');
this.request(Api_Url + '/order/cancel', 'POST', { id: order_id }, true, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
title: '取消成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
}, 2000);
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
/**
* 查看物流
* @param {Object} order_id
......@@ -234,12 +396,44 @@ export default {
* @param {Object} zy_delivery_type
* @param {Object} status
*/
ship(order_id, order_sn, zy_delivery_type, status) {},
ship(order_id, order_sn, zy_delivery_type, status) {
uni.navigateTo({
url: '/user/orderdetail?order_id=' + order_id
});
},
/**
*确认收货
* @param {Object} order_id
*/
sureSend(order_id) {},
sureSend(order_id) {
uni.showModal({
title: '提示',
content: '您要确认收货吗?',
success: res => {
if (res.confirm) {
console.log('用户点击确定');
this.request(Api_Url + '/order/recive', 'POST', { order_id: order_id }, true, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
title: '收货成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
}, 2000);
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
getData() {
this.request(Api_Url + '/order/lists', 'POST', this.searchParams, true, true).then(res => {
if (res.err_code === 0) {
......
......@@ -79,20 +79,20 @@ const router = new Router({
title: '确认订单'
}
},
{
path: '/pages/confirm/pay',
aliasPath: '/pay/online',
meta: {
title: '猎芯收银台'
}
},
{
path: '/pages/confirm/offline',
aliasPath: '/pay/offline',
meta: {
title: '转账支付'
}
},
{
path: '/pages/confirm/pay',
aliasPath: '/pay/online',
meta: {
title: '猎芯收银台'
}
},
{
path: '/pages/confirm/offline',
aliasPath: '/pay/offline',
meta: {
title: '转账支付'
}
},
{
path: '/pages/confirm/confirmSuccess',
aliasPath: '/order/success',
......@@ -138,6 +138,14 @@ const router = new Router({
}
},
{
path: '/pages/mine/orderdetail',
aliasPath: '/user/orderdetail',
meta: {
title: '订单详情',
auth: true
}
},
{
path: '/pages/mine/userCoupon',
aliasPath: '/userCoupon',
meta: {
......
......@@ -79,3 +79,34 @@ image {
.verCenter {
align-items: center;
}
.layer-box-confirm {
background: #ffffff;
border-radius: 10rpx;
.tip-title {
padding: 48rpx;
width: 526rpx;
font-size: 32rpx;
color: #323233;
font-weight: 400;
}
.btn {
border-top: 1px solid #ebedf0;
height: 96rpx;
background: #ffffff;
border-radius: 0 0 10rpx 10rpx;
.btn1 {
width: 50%;
height: 100%;
font-size: 32rpx;
color: #323233;
border-right: 1px solid #ebedf0;
}
.btn2 {
width: 50%;
height: 100%;
font-size: 32rpx;
color: #1969f9;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment