前端小程序
这个提交包含在:
@@ -0,0 +1,329 @@
|
||||
<!-- 售后详情 -->
|
||||
<template>
|
||||
<view class="page_box">
|
||||
<view class="content_box">
|
||||
<!-- 步骤条 -->
|
||||
<view class="steps-box"><u-steps :current="stepsCurrent" :list="steps" activeColor="#39b54a" mode="number" icon="checkmark"></u-steps></view>
|
||||
|
||||
<!-- 服务状态 -->
|
||||
<view class="status-box u-flex u-row-between" @tap="jump('/pages/order/after-sale/log', { aftersaleId: aftersaleDetail.id })">
|
||||
<view class="">
|
||||
<view class="status-text">{{ aftersaleDetail.aftersale_status_desc }}</view>
|
||||
<view class="status-time">{{ aftersaleDetail.updatetime }}</view>
|
||||
</view>
|
||||
<text class="u-iconfont uicon-arrow-right" style="color: #666"></text>
|
||||
</view>
|
||||
|
||||
<!-- 退款金额 -->
|
||||
<view class="aftersale-money u-flex u-row-between">
|
||||
<view class="aftersale-money--title">退款总额</view>
|
||||
<view class="aftersale-money--num" v-if="Number(aftersaleDetail.refund_fee)">¥{{ aftersaleDetail.refund_fee }}</view>
|
||||
<view class="aftersale-money--num" v-else>未退款</view>
|
||||
</view>
|
||||
<!-- 服务商品 -->
|
||||
<view class="order-shop">
|
||||
<shopro-mini-card :title="aftersaleDetail.goods_title" :image="aftersaleDetail.goods_image">
|
||||
<template #describe>
|
||||
<view class="order-sku u-ellipsis-1">
|
||||
<text class="order-num">数量:{{ aftersaleDetail.goods_num || 0 }};</text>
|
||||
{{ aftersaleDetail.goods_sku_text ? aftersaleDetail.goods_sku_text : '' }}
|
||||
</view>
|
||||
</template>
|
||||
<template #cardBottom>
|
||||
<view class="card-price-box u-flex">
|
||||
<text class="order-price">¥{{ aftersaleDetail.goods_price || 0 }}</text>
|
||||
<button class="u-reset-button status-btn" v-if="aftersaleDetail.status_name">{{ aftersaleDetail.status_name }}</button>
|
||||
</view>
|
||||
</template>
|
||||
</shopro-mini-card>
|
||||
</view>
|
||||
|
||||
<!-- 服务内容 -->
|
||||
<view class="aftersale-content">
|
||||
<view class="aftersale-item u-flex">
|
||||
<view class="item-title">服务单号:</view>
|
||||
<view class="item-content">{{ aftersaleDetail.aftersale_sn }}</view>
|
||||
<button class="u-reset-button copy-btn" @tap="onCopy(aftersaleDetail.aftersale_sn)">复制</button>
|
||||
</view>
|
||||
<view class="aftersale-item u-flex">
|
||||
<view class="item-title">申请时间:</view>
|
||||
<view class="item-content">{{ aftersaleDetail.createtime }}</view>
|
||||
</view>
|
||||
<view class="aftersale-item u-flex">
|
||||
<view class="item-title">售后类型:</view>
|
||||
<view class="item-content">{{ aftersaleDetail.type_text }}</view>
|
||||
</view>
|
||||
<view class="aftersale-item u-flex" v-if="aftersaleLog && aftersaleLog.length">
|
||||
<view class="item-title">申请原因:</view>
|
||||
<view class="item-content">{{ aftersaleLog[aftersaleLog.length - 1].reason }}</view>
|
||||
</view>
|
||||
<view class="aftersale-item x-f" v-if="aftersaleLog && aftersaleLog.length">
|
||||
<view class="item-title">相关描述:</view>
|
||||
<view class="item-content">{{ aftersaleLog[aftersaleLog.length - 1].content }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="foot_box">
|
||||
<block v-for="orderBtn in aftersaleDetail.btns" :key="orderBtn">
|
||||
<button v-if="orderBtn === 'cancel'" @tap.stop="onCancel(aftersaleDetail.id)" class="u-reset-button btn">取消</button>
|
||||
<button v-if="orderBtn === 'delete'" @tap.stop="onDelete(aftersaleDetail.id)" class="u-reset-button btn delete-btn">删除</button>
|
||||
</block>
|
||||
<button class="u-reset-button contcat-btn btn" @tap="onService">联系客服</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
stepsCurrent: 0,
|
||||
steps: [
|
||||
{
|
||||
name: '提交申请'
|
||||
},
|
||||
{
|
||||
name: '进行中'
|
||||
},
|
||||
{
|
||||
name: '完成'
|
||||
}
|
||||
],
|
||||
aftersaleDetail: {}, //售后详情
|
||||
aftersaleLog: [] //售后记录
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
onLoad() {
|
||||
this.getAftersaleDetail();
|
||||
},
|
||||
methods: {
|
||||
jump(path, parmas) {
|
||||
this.$Router.push({
|
||||
path: path,
|
||||
query: parmas
|
||||
});
|
||||
},
|
||||
// 跳转客服
|
||||
onService() {
|
||||
this.$Router.push('/pages/public/chat/index');
|
||||
},
|
||||
// 复制
|
||||
onCopy(code) {
|
||||
let that = this;
|
||||
uni.setClipboardData({
|
||||
data: code,
|
||||
success: function(data) {
|
||||
that.$u.toast('已复制到剪切板');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 设置步骤条
|
||||
setSteps(step) {
|
||||
if (step >= 0 && step < 2) {
|
||||
this.stepsCurrent = step;
|
||||
} else {
|
||||
this.stepsCurrent = 2;
|
||||
let name = '';
|
||||
switch (step) {
|
||||
case 2:
|
||||
name = '完成';
|
||||
break;
|
||||
case -1:
|
||||
name = '取消';
|
||||
break;
|
||||
case -2:
|
||||
name = '驳回';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.steps[2].name = name;
|
||||
}
|
||||
},
|
||||
// 服务单详情
|
||||
getAftersaleDetail() {
|
||||
let that = this;
|
||||
that.$http('order.aftersaleDetail', {
|
||||
id: that.$Route.query.aftersaleId
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.aftersaleDetail = res.data;
|
||||
that.setSteps(res.data.aftersale_status);
|
||||
that.aftersaleLog = res.data.log;
|
||||
that.aftersaleDetail.createtime = that.$u.timeFormat(res.data.createtime, 'yyyy-mm-dd hh:MM');
|
||||
that.aftersaleDetail.updatetime = that.$u.timeFormat(res.data.updatetime, 'yyyy-mm-dd hh:MM');
|
||||
}
|
||||
});
|
||||
},
|
||||
//取消
|
||||
onCancel(aftersaleId) {
|
||||
let that = this;
|
||||
that.$http(
|
||||
'order.cancelAftersaleOrder',
|
||||
{
|
||||
id: aftersaleId
|
||||
},
|
||||
'取消中...'
|
||||
).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.$Router.back();
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
onDelete(aftersaleId) {
|
||||
let that = this;
|
||||
uni.showModal({
|
||||
title: '删除订单',
|
||||
content: '确定要删除这个订单么?',
|
||||
cancelText: '取消',
|
||||
confirmText: '删除',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
that.$http('order.deleteAftersaleOrder', {
|
||||
id: aftersaleId
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.$Router.back();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// 步骤条
|
||||
.steps-box {
|
||||
height: 190rpx;
|
||||
padding: 60rpx 0 0;
|
||||
background: #fff;
|
||||
}
|
||||
// 服务状态
|
||||
.status-box {
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx 20rpx 0px 0px;
|
||||
padding: 20rpx;
|
||||
margin-top: -20rpx;
|
||||
.status-text {
|
||||
font-size: 28rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.status-time {
|
||||
font-size: 24rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(153, 153, 153, 1);
|
||||
}
|
||||
}
|
||||
// 退款金额
|
||||
.aftersale-money {
|
||||
background-color: #fff;
|
||||
height: 98rpx;
|
||||
padding: 0 20rpx;
|
||||
margin: 20rpx 0;
|
||||
.aftersale-money--title {
|
||||
font-size: 28rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
.aftersale-money--num {
|
||||
font-size: 28rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: rgba(225, 33, 43, 1);
|
||||
}
|
||||
}
|
||||
// order-shop
|
||||
.order-shop {
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
.order-sku {
|
||||
font-size: 24rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(153, 153, 153, 1);
|
||||
width: 450rpx;
|
||||
margin-bottom: 20rpx;
|
||||
.order-num {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
.card-price-box {
|
||||
.status-btn {
|
||||
height: 32rpx;
|
||||
border: 1rpx solid rgba(207, 169, 114, 1);
|
||||
border-radius: 15rpx;
|
||||
font-size: 20rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(168, 112, 13, 1);
|
||||
padding: 0 10rpx;
|
||||
margin-left: 20rpx;
|
||||
background: rgba(233, 183, 102, 0.16);
|
||||
}
|
||||
.order-price {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 600;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 服务内容
|
||||
.aftersale-content {
|
||||
background-color: #fff;
|
||||
padding: 20rpx;
|
||||
.aftersale-item {
|
||||
height: 60rpx;
|
||||
.copy-btn {
|
||||
background: none;
|
||||
color: #b38436;
|
||||
font-size: 26rpx;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
.item-tilte {
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.item-content {
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 底部功能
|
||||
.foot_box {
|
||||
height: 100rpx;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
.btn {
|
||||
width: 160rpx;
|
||||
line-height: 60rpx;
|
||||
background: rgba(238, 238, 238, 1);
|
||||
border-radius: 30rpx;
|
||||
padding: 0;
|
||||
margin-right: 20rpx;
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
.delete-btn {
|
||||
background: #ffeeee;
|
||||
color: $brand-price;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,329 @@
|
||||
<!-- 售后列表 -->
|
||||
<template>
|
||||
<view class="page_box">
|
||||
<!-- tab -->
|
||||
<view class="head_box">
|
||||
<view class="order-nav u-flex">
|
||||
<view class="nav-item u-flex-col u-flex-1 u-col-center" v-for="nav in orderState" :key="nav.id" @tap="onNav(nav.type)">
|
||||
<view class="item-title">{{ nav.title }}</view>
|
||||
<text class="nav-line" :class="{ 'line-active': orderType === nav.type }"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="content_box">
|
||||
<scroll-view scroll-y="true" enable-back-to-top @scrolltolower="loadMore" class="scroll-box">
|
||||
<view class="order-list" v-for="(order, orderIndex) in orderList" :key="order.id" @tap="jump('/pages/order/after-sale/detail', { aftersaleId: order.id })">
|
||||
<view class="order-head u-flex u-row-between">
|
||||
<text class="no">服务单号:{{ order.aftersale_sn }}</text>
|
||||
<view class="order-status u-flex">
|
||||
<text class="status-text">{{ order.aftersale_status_text }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-content">
|
||||
<shopro-mini-card :title="order.goods_title" :image="order.goods_image">
|
||||
<template #describe>
|
||||
<view class="order-sku u-ellipsis-1">
|
||||
<text class="order-num">数量:{{ order.goods_num || 0 }};</text>
|
||||
{{ order.goods_sku_text ? order.goods_sku_text : '' }}
|
||||
</view>
|
||||
</template>
|
||||
<template #cardBottom>
|
||||
<view class="card-price-box u-flex">
|
||||
<text class="order-price font-OPPOSANS">¥{{ order.goods_price || 0 }}</text>
|
||||
<button class="u-reset-button status-btn">{{ order.type_text }}</button>
|
||||
</view>
|
||||
</template>
|
||||
</shopro-mini-card>
|
||||
</view>
|
||||
<view class="order-bottom">
|
||||
<view class="serve-status u-flex u-row-between" @tap.stop="jump('/pages/order/after-sale/log', { aftersaleId: order.id })">
|
||||
<view class="u-flex">
|
||||
<view class="serve-title">{{ order.aftersale_status_text }}</view>
|
||||
<view class="serve-content">{{ order.aftersale_status_desc }}</view>
|
||||
</view>
|
||||
<text class="u-iconfont uicon-arrow-right" style="color: #666"></text>
|
||||
</view>
|
||||
<view class="btn-box u-flex" v-for="orderBtn in order.btns" :key="orderBtn">
|
||||
<button v-if="orderBtn === 'cancel'" @tap.stop="onCancel(order.id, orderIndex)" class="u-reset-button obtn">取消</button>
|
||||
<button v-if="orderBtn === 'delete'" style="background:#FFEEEE;color:#E50808" @tap.stop="onDelete(order.id, orderIndex)" class="u-reset-button obtn">
|
||||
删除
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 缺省页 -->
|
||||
<shopro-empty v-if="isEmpty" :image="$IMG_URL + '/imgs/empty/empty_groupon.png'" tipText="暂无相关记录~"></shopro-empty>
|
||||
<!-- 更多 -->
|
||||
<u-loadmore v-if="orderList.length" height="80rpx" :status="loadStatus" icon-type="flower" color="#ccc" />
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="foot_box"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
orderType: 'all', //分类id
|
||||
isEmpty: false,
|
||||
orderList: [], //售后列表
|
||||
loadStatus: 'loadmore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
|
||||
currentPage: 1,
|
||||
lastPage: 1,
|
||||
orderState: [
|
||||
{
|
||||
id: 0,
|
||||
title: '全部',
|
||||
type: 'all'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '处理中',
|
||||
type: 'ing'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '已完成',
|
||||
type: 'finish'
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
onLoad() {},
|
||||
onShow() {
|
||||
this.orderList = [];
|
||||
this.currentPage = 1;
|
||||
this.lastPage = 1;
|
||||
this.getAftersaleList();
|
||||
},
|
||||
methods: {
|
||||
jump(path, parmas) {
|
||||
this.$Router.push({
|
||||
path: path,
|
||||
query: parmas
|
||||
});
|
||||
},
|
||||
// 切换导航
|
||||
onNav(type) {
|
||||
if (this.orderType !== type) {
|
||||
this.orderType = type;
|
||||
this.currentPage = 1;
|
||||
this.lastPage = 1;
|
||||
this.orderList = [];
|
||||
this.getAftersaleList();
|
||||
}
|
||||
},
|
||||
// 售后列表
|
||||
getAftersaleList() {
|
||||
let that = this;
|
||||
that.loadStatus = 'loading';
|
||||
that.$http('order.aftersaleList', {
|
||||
type: that.orderType,
|
||||
page: that.currentPage
|
||||
}, '加载中...').then(res => {
|
||||
if (res.code === 1) {
|
||||
that.orderList = [...that.orderList, ...res.data.data];
|
||||
that.isEmpty = !that.orderList.length;
|
||||
that.lastPage = res.data.last_page;
|
||||
that.loadStatus = that.currentPage < res.data.last_page ? 'loadmore' : 'nomore';
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//取消
|
||||
onCancel(aftersaleId, orderIndex) {
|
||||
let that = this;
|
||||
that.$http(
|
||||
'order.cancelAftersaleOrder',
|
||||
{
|
||||
id: aftersaleId
|
||||
},
|
||||
'取消中...'
|
||||
).then(res => {
|
||||
if (res.code === 1) {
|
||||
this.$u.toast(res.msg);
|
||||
this.orderList.splice(orderIndex, 1);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 删除
|
||||
onDelete(aftersaleId, orderIndex) {
|
||||
let that = this;
|
||||
uni.showModal({
|
||||
title: '删除订单',
|
||||
content: '确定要删除这个订单么?',
|
||||
cancelText: '取消',
|
||||
confirmText: '删除',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
that.$http(
|
||||
'order.deleteAftersaleOrder',
|
||||
{
|
||||
id: aftersaleId
|
||||
},
|
||||
'删除中...'
|
||||
).then(res => {
|
||||
if (res.code === 1) {
|
||||
this.$u.toast(res.msg);
|
||||
this.orderList.splice(orderIndex, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 加载更多
|
||||
loadMore() {
|
||||
if (this.currentPage < this.lastPage) {
|
||||
this.currentPage += 1;
|
||||
this.getAftersaleList();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// 导航切换
|
||||
.order-nav {
|
||||
background: #fff;
|
||||
height: 80rpx;
|
||||
border-top: 1rpx solid $brand-border;
|
||||
.nav-item {
|
||||
flex: 1;
|
||||
.item-title {
|
||||
font-size: 30rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
line-height: 76rpx;
|
||||
}
|
||||
.nav-line {
|
||||
width: 100rpx;
|
||||
height: 4rpx;
|
||||
background: #fff;
|
||||
}
|
||||
.line-active {
|
||||
background: $brand-gold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 售后列表卡片
|
||||
.order-list {
|
||||
background: #fff;
|
||||
margin: 20rpx 0;
|
||||
.order-bottom {
|
||||
padding-bottom: 20rpx;
|
||||
.serve-status {
|
||||
height: 94rpx;
|
||||
background: rgba(246, 246, 246, 1);
|
||||
border-radius: 4rpx;
|
||||
margin: 0 20rpx 20rpx;
|
||||
padding: 0 20rpx;
|
||||
.serve-title {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
.serve-content {
|
||||
font-size: 20rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(102, 102, 102, 1);
|
||||
}
|
||||
}
|
||||
.btn-box {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.obtn {
|
||||
width: 160rpx;
|
||||
line-height: 60rpx;
|
||||
background: rgba(238, 238, 238, 1);
|
||||
border-radius: 30rpx;
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(102, 102, 102, 1);
|
||||
margin-right: 20rpx;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
.order-head {
|
||||
padding: 0 25rpx;
|
||||
height: 77rpx;
|
||||
border-bottom: 1rpx solid #dfdfdf;
|
||||
|
||||
.no {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.order-status {
|
||||
.iconfont {
|
||||
color: #f83942;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.status-text {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: #f83942;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.order-content {
|
||||
padding: 20rpx;
|
||||
.order-sku {
|
||||
font-size: 24rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(153, 153, 153, 1);
|
||||
width: 450rpx;
|
||||
margin-bottom: 20rpx;
|
||||
.order-num {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
.card-price-box {
|
||||
.status-btn {
|
||||
height: 32rpx;
|
||||
border: 1rpx solid rgba(207, 169, 114, 1);
|
||||
border-radius: 15rpx;
|
||||
font-size: 20rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(168, 112, 13, 1);
|
||||
padding: 0 10rpx;
|
||||
margin-left: 20rpx;
|
||||
background: rgba(233, 183, 102, 0.16);
|
||||
}
|
||||
.order-price {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 600;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
.goods-order {
|
||||
border-bottom: 1px solid rgba(223, 223, 223, 0.5);
|
||||
padding: 20rpx 20rpx 0;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.goods-bottom {
|
||||
background: #fff;
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,96 @@
|
||||
<!-- 售后进行 -->
|
||||
<template>
|
||||
<view class="log-box wrap">
|
||||
<u-time-line>
|
||||
<u-time-line-item v-for="(log, index) in aftersaleLog" :key="log.id" nodeTop="4">
|
||||
<template v-slot:node>
|
||||
<view class="u-node" :style="index === 0 ? 'background: #19be6b;' : ''"><text class="u-iconfont uicon-bell-fill" style="color: #fff;font-size: 26rpx;"></text></view>
|
||||
</template>
|
||||
<template v-slot:content>
|
||||
<view class="u-order-title unacive u-m-b-20">{{ log.reason }}</view>
|
||||
<view class="u-order-desc u-m-b-10" v-show="log.content"><u-parse :html="log.content"></u-parse></view>
|
||||
<view class="item-img-box u-flex u-flex-wrap" v-show="log.images.length">
|
||||
<block v-for="(img, index) in log.images" :key="index"><image :src="img" class="log-img" mode="aspectFill"></image></block>
|
||||
</view>
|
||||
<view class="u-order-time">{{ $u.timeFormat(log.createtime, 'yyyy-mm-dd hh:MM') }}</view>
|
||||
</template>
|
||||
</u-time-line-item>
|
||||
</u-time-line>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
aftersaleLog: []
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
onLoad() {
|
||||
this.getAftersaleDetail();
|
||||
},
|
||||
methods: {
|
||||
// 服务单详情
|
||||
getAftersaleDetail() {
|
||||
let that = this;
|
||||
that.$http('order.aftersaleDetail', {
|
||||
id: that.$Route.query.aftersaleId
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.aftersaleLog = res.data.logs;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.wrap {
|
||||
padding: 24rpx 24rpx 24rpx 40rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.u-node {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
border-radius: 100rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #d0d0d0;
|
||||
}
|
||||
|
||||
.u-order-title {
|
||||
color: #333333;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.u-order-title.unacive {
|
||||
color: rgb(150, 150, 150);
|
||||
}
|
||||
|
||||
.u-order-desc {
|
||||
color: rgb(150, 150, 150);
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 6rpx;
|
||||
}
|
||||
.item-img-box {
|
||||
.log-img {
|
||||
display: block;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
background-color: #ccc;
|
||||
margin-right: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
}
|
||||
.u-order-time {
|
||||
color: rgb(200, 200, 200);
|
||||
font-size: 26rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,430 @@
|
||||
<!-- 申请售后 -->
|
||||
<template>
|
||||
<view class="refund-wrap">
|
||||
<!-- 售后商品 -->
|
||||
<view class="goods-box">
|
||||
<shopro-mini-card :title="orderItemDetail.goods_title" :image="orderItemDetail.goods_image">
|
||||
<template #describe>
|
||||
<view class="order-sku u-ellipsis-1">
|
||||
<text class="order-num">数量:{{ orderItemDetail.goods_num || 0 }};</text>
|
||||
{{ orderItemDetail.goods_sku_text ? orderItemDetail.goods_sku_text : '' }}
|
||||
</view>
|
||||
</template>
|
||||
<template #cardBottom>
|
||||
<view class="card-price-box u-flex">
|
||||
<text class="order-price font-OPPOSANS">¥{{ orderItemDetail.goods_price || 0 }}</text>
|
||||
<button class="u-reset-button status-btn" v-if="orderItemDetail.status_name">{{ orderItemDetail.status_name }}</button>
|
||||
</view>
|
||||
</template>
|
||||
</shopro-mini-card>
|
||||
</view>
|
||||
|
||||
<!-- 售后类型 -->
|
||||
<view class="refund-item">
|
||||
<view class="item-title">请选择售后类型</view>
|
||||
<u-radio-group v-model="refundType" active-color="#d89f64" width="100%">
|
||||
<u-radio shape="circle" v-for="(item, index) in refundTypeList" :key="index" :name="item.value">{{ item.title }}</u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
|
||||
<!-- 申请原因 -->
|
||||
<view class="goods-item u-flex u-row-between" @tap="showModal = true">
|
||||
<text class="item-title">选择申请原因</text>
|
||||
<view class="u-flex refund-cause">
|
||||
<text class="u-m-r-20" style="color: #333;" v-if="refundCause">{{ refundCause }}</text>
|
||||
<text class="u-m-r-20" v-else>请选择申请原因~</text>
|
||||
<text class="u-iconfont uicon-arrow-right" style="color: #666"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 联系方式 -->
|
||||
<view class="refund-item u-m-b-20">
|
||||
<view class="item-title">联系方式</view>
|
||||
<view class="input-box u-flex"><input type="number" class="item-input" v-model="phone" placeholder="请输入您的联系电话" placeholder-class="input--pl" /></view>
|
||||
</view>
|
||||
|
||||
<!-- 留言 -->
|
||||
<view class="refund-item u-m-b-20">
|
||||
<view class="item-title">相关描述</view>
|
||||
<view class="describe-box">
|
||||
<textarea
|
||||
class="describe-content"
|
||||
v-model="refundContent"
|
||||
maxlength="120"
|
||||
placeholder="客官~请描述您遇到的问题,建议上传照片"
|
||||
placeholder-class="input--pl"
|
||||
fixed
|
||||
></textarea>
|
||||
<view class="upload-img">
|
||||
<u-upload
|
||||
:showProgress="false"
|
||||
@on-uploaded="uploadSuccess"
|
||||
@on-remove="uploadRemove"
|
||||
:action="`${$API_URL}index/upload`"
|
||||
width="140"
|
||||
height="140"
|
||||
maxCount="9"
|
||||
></u-upload>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<view class="foot-wrap safe-area-inset-bottom">
|
||||
<view class="foot_box u-flex u-row-between safe-area-inset-bottom">
|
||||
<button class="u-reset-button contcat-btn" @tap="onService">联系客服</button>
|
||||
<button class="u-reset-button sub-btn" @tap="postAftersale">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 申请原因弹窗 -->
|
||||
<u-popup v-model="showModal" safe-area-inset-bottom @close="showModal = false" mode="bottom" :closeable="true" close-icon-pos="top-left">
|
||||
<view class="modal-box page_box">
|
||||
<view class="modal-head head_box u-flex u-row-center u-col-center">{{ refundList.title }}</view>
|
||||
<view class="modal-content content_box">
|
||||
<view class="u-flex-col u-p-20">
|
||||
<u-radio-group v-model="refundCause" active-color="#d89f64" width="100%">
|
||||
<u-radio class="u-m-y-10" shape="circle" v-for="item in refundList.list" :key="item.id" :name="item.val">
|
||||
<text class="u-p-l-20">{{ item.val }}</text>
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="modal-foot foot_box u-flex u-row-center u-col-center"><button class="u-reset-button close-btn" @tap="showModal = false">确定</button></view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
showModal: false,
|
||||
imgList: [], //图片地址
|
||||
orderId: 0, //订单ID
|
||||
orderItemDetail: {}, //订单信息
|
||||
refundType: '', //售后类型
|
||||
refundCause: '', //退款原因
|
||||
refundContent: '', //相关描述
|
||||
phone: '', //联系方式
|
||||
refundTypeList: [
|
||||
//售后类型
|
||||
{
|
||||
title: '退款',
|
||||
value: 'refund'
|
||||
},
|
||||
{
|
||||
title: '退货',
|
||||
value: 'return'
|
||||
},
|
||||
{
|
||||
title: '其他',
|
||||
value: 'other'
|
||||
}
|
||||
],
|
||||
refundList: {
|
||||
//申请原因
|
||||
title: '申请原因',
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
val: '卖家发错货了'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
val: '退运费'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
val: '大小/重量于商品描述不符'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
val: '生产日期、保质期与商品不符'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
val: '质量问题'
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
onLoad() {
|
||||
this.getOrderItemDetail();
|
||||
},
|
||||
methods: {
|
||||
// 跳转客服
|
||||
onService() {
|
||||
this.$Router.push('/pages/public/chat/index');
|
||||
},
|
||||
|
||||
// 上传图片成功
|
||||
uploadSuccess(e) {
|
||||
this.imgList = [];
|
||||
e.forEach(item => {
|
||||
this.imgList.push(item.response.data.url);
|
||||
});
|
||||
},
|
||||
|
||||
// 移除图片
|
||||
uploadRemove(index) {
|
||||
this.imgList.splice(index, 1);
|
||||
},
|
||||
|
||||
// 订单item详情
|
||||
getOrderItemDetail() {
|
||||
let that = this;
|
||||
that.$http('order.itemDetail', {
|
||||
id: that.$Route.query.orderId,
|
||||
order_item_id: that.$Route.query.orderItemId
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.orderItemDetail = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 提交售后
|
||||
postAftersale() {
|
||||
let that = this;
|
||||
that.$http('order.aftersale', {
|
||||
type: that.refundType,
|
||||
order_id: that.$Route.query.orderId,
|
||||
order_item_id: that.$Route.query.orderItemId,
|
||||
reason: that.refundCause,
|
||||
content: that.refundContent,
|
||||
images: that.imgList,
|
||||
phone: that.phone
|
||||
}, '申请中...').then(res => {
|
||||
if (res.code === 1) {
|
||||
// #ifdef MP-WEIXIN
|
||||
that.$store.commit('subscribeMessage', 'aftersale');
|
||||
// #endif
|
||||
that.$Router.back();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// 售后项目
|
||||
.refund-item {
|
||||
background-color: #fff;
|
||||
border-bottom: 1rpx solid $brand-border;
|
||||
padding: 30rpx;
|
||||
.item-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
// 留言
|
||||
.describe-box {
|
||||
width: 690rpx;
|
||||
background: rgba(249, 250, 251, 1);
|
||||
border-radius: 20rpx;
|
||||
.describe-content {
|
||||
width: 660rpx;
|
||||
padding: 30rpx;
|
||||
height: 200rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
.input--pl {
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(177, 179, 199, 1);
|
||||
}
|
||||
// 联系方式
|
||||
.input-box {
|
||||
height: 84rpx;
|
||||
background: rgba(249, 250, 251, 1);
|
||||
border-radius: 20rpx;
|
||||
.item-input {
|
||||
padding: 0 30rpx;
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.goods-box {
|
||||
background: #fff;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
.order-sku {
|
||||
font-size: 24rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(153, 153, 153, 1);
|
||||
width: 450rpx;
|
||||
margin-bottom: 20rpx;
|
||||
.order-num {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
.card-price-box {
|
||||
.status-btn {
|
||||
height: 32rpx;
|
||||
border: 1rpx solid rgba(207, 169, 114, 1);
|
||||
border-radius: 15rpx;
|
||||
font-size: 20rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(168, 112, 13, 1);
|
||||
padding: 0 10rpx;
|
||||
margin-left: 20rpx;
|
||||
background: rgba(233, 183, 102, 0.16);
|
||||
}
|
||||
.order-price {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 600;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.goods-item {
|
||||
height: 95rpx;
|
||||
background: #fff;
|
||||
padding: 0 25rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
// 售后原因
|
||||
.refund-cause {
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(177, 179, 199, 1);
|
||||
}
|
||||
|
||||
&:nth-of-type(2n) {
|
||||
margin-bottom: 0;
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 28rpx;
|
||||
color: $brand-price;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-img {
|
||||
padding: 25rpx;
|
||||
|
||||
.upload-title {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.img-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.choose-img,
|
||||
.preview-box {
|
||||
width: 110rpx;
|
||||
height: 110rpx;
|
||||
background: rgba(249, 250, 251, 1);
|
||||
border: 1rpx solid rgba(223, 223, 223, 1);
|
||||
margin-right: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
position: relative;
|
||||
|
||||
&:nth-child(5n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
.preview-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.foot-wrap {
|
||||
height: 100rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.foot_box {
|
||||
height: 100rpx;
|
||||
background-color: #fff;
|
||||
padding: 0 30rpx;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-top: 1rpx solid $brand-border;
|
||||
.sub-btn {
|
||||
width: 340rpx;
|
||||
line-height: 74rpx;
|
||||
background: linear-gradient(90deg, #1677FF, #4096FF);
|
||||
border: 1rpx solid rgba(238, 238, 238, 1);
|
||||
border-radius: 38rpx;
|
||||
color: rgba(#fff, 0.9);
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.contcat-btn {
|
||||
width: 340rpx;
|
||||
line-height: 74rpx;
|
||||
background: rgba(238, 238, 238, 1);
|
||||
border-radius: 38rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
}
|
||||
|
||||
.modal-box {
|
||||
width: 750rpx;
|
||||
height: 680rpx;
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
background: #fff;
|
||||
|
||||
.modal-head {
|
||||
height: 100rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
font-size: 28rpx;
|
||||
|
||||
.sel-item {
|
||||
height: 100rpx;
|
||||
width: 100%;
|
||||
padding: 0 20rpx;
|
||||
border-bottom: 1rpx solid rgba(223, 223, 223, 0.5);
|
||||
|
||||
.sel-radio {
|
||||
transform: scale(0.7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.modal-foot {
|
||||
.close-btn {
|
||||
width: 710rpx;
|
||||
line-height: 80rpx;
|
||||
background: linear-gradient(90deg, #1677FF, #4096FF);
|
||||
border: 1rpx solid rgba(238, 238, 238, 1);
|
||||
border-radius: 40rpx;
|
||||
color: rgba(#fff, 0.9);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<view class="select-coupon-wrap ">
|
||||
<view class="coupon-item u-flex u-row-between">
|
||||
<view class="item-title">优惠券</view>
|
||||
<view class="u-flex" @tap="showModal = true">
|
||||
<text class="price" v-if="couponList.length">{{ title }}</text>
|
||||
<text class="sel-coupon" v-else>暂无优惠券</text>
|
||||
<text class="u-iconfont uicon-arrow-right" style="color: #bfbfbf"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-popup v-model="showModal" mode="bottom" :closeable="true" close-icon-pos="top-right" border-radius="30">
|
||||
<view class="modal-box page_box">
|
||||
<view class="modal-head u-flex u-row-center u-col-center"><text class="head-title">选择优惠券</text></view>
|
||||
<view class="modal-content content_box u-flex-col u-p-20">
|
||||
<u-radio-group v-model="radio" @change="radioGroupChange" width="100%" activeColor="#e9b564">
|
||||
<view class="radio-item">
|
||||
<u-radio :name="0"><text class="coupon-title u-p-l-10">不使用优惠券</text></u-radio>
|
||||
</view>
|
||||
<view class="radio-item" v-for="(radio, index) in couponList" :key="radio.user_coupons_id">
|
||||
<u-radio :name="index + 1">
|
||||
<text
|
||||
class="coupon-title u-p-l-10">{{ radio.name }}:{{ `满${radio.enough}减${radio.amount}` }}</text>
|
||||
</u-radio>
|
||||
</view>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
<button class="u-reset-button serve-btn" @tap="showModal = false">确定</button>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 选择优惠券模态框
|
||||
* @property {Object} couponList - 可用优惠券列表数据
|
||||
*
|
||||
*/
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
showModal: false,
|
||||
radio: 0,
|
||||
title: '选择优惠券'
|
||||
};
|
||||
},
|
||||
props: {
|
||||
couponList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
radioGroupChange(index) {
|
||||
this.title = index > 0 ? '-¥' + this.couponList[index - 1].amount : '选择优惠券';
|
||||
this.$emit('change', index - 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 优惠券项
|
||||
.coupon-item {
|
||||
border-top: 1rpx solid rgba(#dfdfdf, 0.5);
|
||||
height: 100rpx;
|
||||
background: #fff;
|
||||
padding: 0 25rpx;
|
||||
|
||||
.item-title {
|
||||
font-size: 28rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 26rpx;
|
||||
color: $brand-price;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.sel-coupon {
|
||||
font-size: 26rpx;
|
||||
color: #c4c4c4;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// 模态框
|
||||
.modal-box {
|
||||
width: 750rpx;
|
||||
height: 700rpx;
|
||||
background: #fff;
|
||||
padding: 30rpx;
|
||||
|
||||
// 按钮
|
||||
.serve-btn {
|
||||
width: 690rpx;
|
||||
line-height: 80rpx;
|
||||
background: linear-gradient(90deg, rgba(240, 199, 133, 1), rgba(246, 214, 157, 1));
|
||||
border-radius: 40rpx;
|
||||
color: rgba(#fff, 0.9);
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.radio-item {
|
||||
width: 690rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
// 标题
|
||||
.modal-head {
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
.head-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
文件差异内容过多而无法显示
加载差异
@@ -0,0 +1,748 @@
|
||||
<!-- 订单详情 -->
|
||||
<template>
|
||||
<view class="order-detail-wrap">
|
||||
<!-- 订单状态 -->
|
||||
<view class="detail-head" :style="orderDetail.consignee ? '' : 'height:120rpx'">
|
||||
<view class="state-box u-flex">
|
||||
<image class="state-img" :src="$IMG_URL + '/imgs/order/order_state1.png'" mode=""></image>
|
||||
<text>{{ orderDetail.status_desc }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 收货地址 -->
|
||||
<view class="address-wrap" v-if="orderDetail.consignee">
|
||||
<view class="order-address-box">
|
||||
<view class="u-flex">
|
||||
<text class="address-username">{{ orderDetail.consignee }}</text>
|
||||
<text class="address-phone">{{ orderDetail.phone }}</text>
|
||||
</view>
|
||||
<view class="address-detail">{{ orderDetail.province_name }}{{ orderDetail.city_name }}{{ orderDetail.area_name }}{{ orderDetail.address }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="detail-goods">
|
||||
<!-- 订单信息 -->
|
||||
<view class="order-list" v-for="order in orderDetail.item" :key="order.id">
|
||||
<view class="order-card" @tap="jump('/pages/goods/detail', { id: order.goods_id })">
|
||||
<shopro-mini-card :title="order.goods_title" :image="order.goods_image">
|
||||
<template #describe>
|
||||
<view class="order-sku u-ellipsis-1">
|
||||
<text class="order-num">数量:{{ order.goods_num || 0 }};</text>
|
||||
{{ order.goods_sku_text ? order.goods_sku_text : '' }}
|
||||
</view>
|
||||
</template>
|
||||
<template #cardBottom>
|
||||
<view class="card-price-box u-flex">
|
||||
<text class="order-price font-OPPOSANS">¥{{ order.goods_price || 0 }}</text>
|
||||
<button class="u-reset-button status-btn" v-if="order.status_name">{{ order.status_name }}</button>
|
||||
</view>
|
||||
</template>
|
||||
</shopro-mini-card>
|
||||
</view>
|
||||
<!-- 配送方式 -->
|
||||
<view class="express-type-box u-flex u-row-between">
|
||||
<view class="u-flex">
|
||||
<view class="express-type--title">配送:</view>
|
||||
<view class="express-type--content">{{ expressType[order.dispatch_type] }}</view>
|
||||
</view>
|
||||
<!-- 发货详情 -->
|
||||
<view
|
||||
class="u-flex express-type--detail"
|
||||
v-if="order.dispatch_type !== 'express'"
|
||||
@tap="goDistribution(order.dispatch_type, orderDetail.id, order.id, order.dispatch_status)"
|
||||
>
|
||||
<text>详情</text>
|
||||
<text class="u-iconfont uicon-arrow-right" style="color: #666;"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="order-bottom u-flex">
|
||||
<!-- 退款原因 -->
|
||||
<view class="refund_msg" v-if="order.refund_msg">
|
||||
<text class="refund-title">退款原因:</text>
|
||||
{{ order.refund_msg }}
|
||||
</view>
|
||||
<view class="btn-box" v-for="(btn, index) in order.btns" :key="btn">
|
||||
<button @tap.stop="onConfirm(orderDetail.id, order.id)" class="u-reset-button btn1" :class="{ btn2: index + 1 === order.btns.length }" v-if="btn === 'get'">
|
||||
确认收货
|
||||
</button>
|
||||
<button
|
||||
@tap.stop="onComment(orderDetail.id, order.id)"
|
||||
class="u-reset-button btn1"
|
||||
:class="{ btn2: index + 1 === order.btns.length }"
|
||||
v-if="btn === 'comment'"
|
||||
>
|
||||
去评价
|
||||
</button>
|
||||
<button
|
||||
@tap.stop="jump('/pages/goods/detail', { id: order.goods_id })"
|
||||
class="u-reset-button btn1"
|
||||
:class="{ btn2: index + 1 === order.btns.length }"
|
||||
v-if="btn === 'buy_again'"
|
||||
>
|
||||
再次购买
|
||||
</button>
|
||||
<button
|
||||
@tap="onAftersaleDetail(order.ext_arr.aftersale_id)"
|
||||
class="u-reset-button btn1"
|
||||
:class="{ btn2: index + 1 === order.btns.length }"
|
||||
v-if="btn === 'aftersale_info'"
|
||||
>
|
||||
售后详情
|
||||
</button>
|
||||
<button
|
||||
@tap.stop="onAftersale(orderDetail.id, order.id)"
|
||||
class="u-reset-button btn1"
|
||||
:class="{ btn2: index + 1 === order.btns.length }"
|
||||
v-if="btn === 'aftersale'"
|
||||
>
|
||||
申请售后
|
||||
</button>
|
||||
<button
|
||||
@tap.stop="onAftersale(orderDetail.id, order.id)"
|
||||
class="u-reset-button btn1"
|
||||
:class="{ btn2: index + 1 === order.btns.length }"
|
||||
v-if="btn === 're_aftersale'"
|
||||
>
|
||||
重新售后
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 订单信息 -->
|
||||
<view class="notice-box" v-if="orderDetail.id">
|
||||
<view class="notice-box__content">
|
||||
<view class="notice-item--center u-flex">
|
||||
<text class="title">订单编号:</text>
|
||||
<text class="detail">{{ orderDetail.order_sn }}</text>
|
||||
<button class="u-reset-button copy-btn" @tap="onCopy(orderDetail.order_sn)">复制</button>
|
||||
</view>
|
||||
<view class="notice-item u-flex">
|
||||
<text class="title">下单时间:</text>
|
||||
<text class="detail">{{ orderDetail.createtime }}</text>
|
||||
</view>
|
||||
<view class="notice-item u-flex" v-if="orderDetail.status > 0">
|
||||
<text class="title">支付方式:</text>
|
||||
<text class="detail">{{ payType[orderDetail.pay_type] }}</text>
|
||||
</view>
|
||||
<view class="notice-item u-flex" v-if="orderDetail.status > 0">
|
||||
<text class="title">支付时间:</text>
|
||||
<text class="detail">{{ orderDetail.paytime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 价格信息 -->
|
||||
<view class="order-price-box u-m-b-20" v-if="orderDetail.id">
|
||||
<view class="notice-item u-flex u-row-between">
|
||||
<text class="title">商品总额</text>
|
||||
<text class="detail font-OPPOSANS">¥{{ orderDetail.goods_amount }}</text>
|
||||
</view>
|
||||
<view v-if="orderDetail.status >= 1 && orderDetail.pay_type == 'group' && orderDetail.pay_money" class="notice-item u-flex u-row-between">
|
||||
<text class="title">余额支付</text>
|
||||
<text class="detail font-OPPOSANS">-¥{{ orderDetail.pay_money }}</text>
|
||||
</view>
|
||||
<view class="notice-item u-flex u-row-between">
|
||||
<text class="title">运费</text>
|
||||
<text class="detail font-OPPOSANS">¥{{ orderDetail.dispatch_amount }}</text>
|
||||
</view>
|
||||
<view class="notice-item u-flex u-row-between">
|
||||
<text class="title">商家配送费</text>
|
||||
<text class="detail font-OPPOSANS">¥{{ orderDetail.store_delivery_fee }}</text>
|
||||
</view>
|
||||
<view class="notice-item u-flex u-row-between">
|
||||
<text class="title">优惠金额</text>
|
||||
<text class="detail font-OPPOSANS">-¥{{ orderDetail.discount_fee }}</text>
|
||||
</view>
|
||||
<view class="notice-item u-flex u-row-between" v-if="orderDetail.score_fee">
|
||||
<text class="title">积分</text>
|
||||
<text class="detail font-OPPOSANS">-{{ orderDetail.score_fee }}积分</text>
|
||||
</view>
|
||||
<view class="notice-item all-rpice-item u-flex" style="width: 100%;">
|
||||
<text class="title">{{ orderDetail.status <= 0 ? '需付款' : '实付款' }}:</text>
|
||||
<text class="detail all-price font-OPPOSANS">¥{{ orderDetail.total_fee }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<view class="foot-wrap safe-area-inset-bottom">
|
||||
<view class="foot_box safe-area-inset-bottom">
|
||||
<view class="money-box u-flex ">
|
||||
<text class="money-title">共{{ allNum || '0' }}件商品 合计:</text>
|
||||
<text class="all-price font-OPPOSANS">¥{{ orderDetail.total_fee || '0.00' }}</text>
|
||||
</view>
|
||||
<view class="btn-box u-flex">
|
||||
<view class="" v-for="btn in orderDetail.btns" :key="btn">
|
||||
<button v-if="btn === 'cancel'" @tap.stop="onCancel(orderDetail.id)" class="u-reset-button obtn1">取消订单</button>
|
||||
<button v-if="btn === 'pay'" @tap.stop="onPay(orderDetail.id)" class="u-reset-button obtn2">付款</button>
|
||||
<button v-if="btn === 'groupon'" @tap.stop="jump('/pages/activity/groupon/detail', { id: orderDetail.ext_arr.groupon_id })" class="u-reset-button obtn2">
|
||||
拼团详情
|
||||
</button>
|
||||
<button v-if="btn === 'delete'" @tap.stop="onDelete(orderDetail.id)" class="u-reset-button delete-btn">删除</button>
|
||||
<button v-if="btn === 'express'" @tap.stop="onExpress(orderDetail.id)" class="u-reset-button obtn1">查看物流</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
time: 0,
|
||||
orderDetail: {},
|
||||
orderStatus: {
|
||||
'-2': '已关闭',
|
||||
'-1': '已取消',
|
||||
'0': '未付款',
|
||||
'1': '已付款',
|
||||
'2': '已完成'
|
||||
},
|
||||
payType: {
|
||||
wallet: '余额支付',
|
||||
wechat: '微信支付',
|
||||
alipay: '支付宝支付',
|
||||
iospay: 'ApplePay',
|
||||
group: '组合支付'
|
||||
},
|
||||
expressType: {
|
||||
express: '物流快递',
|
||||
selfetch: '到店/自提',
|
||||
store: '商家配送',
|
||||
autosend: '自动发货'
|
||||
}
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.getOrderDetail();
|
||||
},
|
||||
onLoad() {},
|
||||
computed: {
|
||||
allNum() {
|
||||
if (this.orderDetail.item) {
|
||||
let items = this.orderDetail.item;
|
||||
let allPrice = 0;
|
||||
items.forEach(p => {
|
||||
allPrice += p.goods_num;
|
||||
});
|
||||
return allPrice;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
jump(path, parmas) {
|
||||
this.$Router.push({
|
||||
path: path,
|
||||
query: parmas
|
||||
});
|
||||
},
|
||||
// 详情发货信息
|
||||
goDistribution(dispatchType, orderId, orderItemId) {
|
||||
this.jump('/pages/order/express/distribution-detail', { expressType: dispatchType, orderId: orderId, orderItemId: orderItemId });
|
||||
},
|
||||
// 订单详情
|
||||
getOrderDetail() {
|
||||
let that = this;
|
||||
const query = that.$Route.query || {};
|
||||
const params = {};
|
||||
// 微信购物订单跳转:id=${商品订单号},值为商户 order_sn
|
||||
if (query.order_sn) {
|
||||
params.order_sn = query.order_sn;
|
||||
} else if (query.id) {
|
||||
params.id = query.id;
|
||||
}
|
||||
that.$http('order.detail', params).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.orderDetail = res.data;
|
||||
that.orderDetail.createtime = that.$u.timeFormat(res.data.createtime, 'yyyy-mm-dd hh:MM');
|
||||
that.orderDetail.paytime = that.$u.timeFormat(res.data.paytime, 'yyyy-mm-dd hh:MM');
|
||||
}
|
||||
});
|
||||
},
|
||||
// 复制
|
||||
onCopy(code) {
|
||||
let that = this;
|
||||
uni.setClipboardData({
|
||||
data: code,
|
||||
success: function(data) {
|
||||
that.$u.toast('已复制到剪切板');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 确认收货
|
||||
onConfirm(id, itemId) {
|
||||
let that = this;
|
||||
that.$http(
|
||||
'order.confirm',
|
||||
{
|
||||
id: id,
|
||||
order_item_id: itemId
|
||||
},
|
||||
'确认中...'
|
||||
).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.getOrderDetail();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 申请售后
|
||||
onAftersale(orderId, orderItemId) {
|
||||
this.$Router.push({
|
||||
path: '/pages/order/after-sale/refund',
|
||||
query: { orderId: orderId, orderItemId: orderItemId }
|
||||
});
|
||||
},
|
||||
|
||||
// 售后详情
|
||||
onAftersaleDetail(id) {
|
||||
this.jump('/pages/order/after-sale/detail', { aftersaleId: id });
|
||||
},
|
||||
|
||||
// 取消订单
|
||||
onCancel(id) {
|
||||
let that = this;
|
||||
that.$http(
|
||||
'order.cancel',
|
||||
{
|
||||
id: id
|
||||
},
|
||||
'取消中...'
|
||||
).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.$Router.back();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 立即购买
|
||||
onPay(id) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/payment/method?orderId=${id}`
|
||||
});
|
||||
},
|
||||
|
||||
// 删除订单
|
||||
onDelete(orderId) {
|
||||
let that = this;
|
||||
uni.showModal({
|
||||
title: '删除订单',
|
||||
content: '确定要删除这个订单么?',
|
||||
cancelText: '取消',
|
||||
confirmText: '删除',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
that.$http('order.deleteOrder', {
|
||||
id: orderId
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.$Router.back();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 待评价
|
||||
onComment(orderId, orderItemId) {
|
||||
this.jump('/pages/goods/comment/add-comment', { orderId: orderId, orderItemId: orderItemId });
|
||||
},
|
||||
|
||||
// 查看物流
|
||||
onExpress(orderId, orderItemId) {
|
||||
let that = this;
|
||||
that.$http('order.expressList', {
|
||||
order_id: orderId
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
if (res.data.length == 1) {
|
||||
this.jump('/pages/order/express/express-detail', { orderId: orderId, expressId: res.data[0].id });
|
||||
} else if (res.data.length > 1) {
|
||||
this.jump('/pages/order/express/express-list', { orderId: orderId });
|
||||
} else {
|
||||
this.$u.toast('暂无包裹~');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.detail-head {
|
||||
background: linear-gradient(0deg, #0A2463 0%, #1E3A8A 100%) no-repeat;
|
||||
background-size: 100% 180rpx;
|
||||
height: 180rpx;
|
||||
|
||||
.state-box {
|
||||
padding: 30rpx 40rpx;
|
||||
color: rgba(#fff, 0.9);
|
||||
|
||||
.state-img {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
// background: #ccc;
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 收货地址
|
||||
.address-wrap {
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
min-height: 160rpx;
|
||||
width: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.order-address-box {
|
||||
width: 710rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
top: -50rpx;
|
||||
background-color: #fff;
|
||||
min-height: 160rpx;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
font-size: 30rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
position: absolute;
|
||||
.address-username {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.address-detail {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: rgba(153, 153, 153, 1);
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
.detail-goods {
|
||||
margin-bottom: 20rpx;
|
||||
.order-list {
|
||||
margin-bottom: 20rpx;
|
||||
background-color: #fff;
|
||||
padding: 0 20rpx;
|
||||
.order-card {
|
||||
padding: 20rpx 0;
|
||||
.order-sku {
|
||||
font-size: 24rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(153, 153, 153, 1);
|
||||
width: 450rpx;
|
||||
margin-bottom: 20rpx;
|
||||
.order-num {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
.card-price-box {
|
||||
.status-btn {
|
||||
height: 32rpx;
|
||||
border: 1rpx solid rgba(207, 169, 114, 1);
|
||||
border-radius: 15rpx;
|
||||
font-size: 20rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(168, 112, 13, 1);
|
||||
padding: 0 10rpx;
|
||||
margin-left: 20rpx;
|
||||
background: rgba(233, 183, 102, 0.16);
|
||||
}
|
||||
.order-price {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 600;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 配送方式
|
||||
.express-type-box {
|
||||
width: 710rpx;
|
||||
height: 90rpx;
|
||||
background: rgba(247, 247, 247, 1);
|
||||
border-radius: 10rpx;
|
||||
padding: 0 20rpx;
|
||||
.express-type--title {
|
||||
font-size: 28rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(153, 153, 153, 1);
|
||||
}
|
||||
.express-type--content {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
.express-type--detail {
|
||||
font-size: 24rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(153, 153, 153, 1);
|
||||
line-height: 30rpx;
|
||||
}
|
||||
}
|
||||
.refund_msg {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
}
|
||||
.order-bottom {
|
||||
background: #fff;
|
||||
justify-content: flex-end;
|
||||
padding: 20rpx 0;
|
||||
.btn1 {
|
||||
width: 160rpx;
|
||||
line-height: 60rpx;
|
||||
border: 1rpx solid rgba(223, 223, 223, 1);
|
||||
border-radius: 30rpx;
|
||||
font-size: 26rpx;
|
||||
background: #fff;
|
||||
padding: 0;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.btn2 {
|
||||
width: 160rpx;
|
||||
line-height: 60rpx;
|
||||
border: 1rpx solid $brand-primary !important;
|
||||
border-radius: 30rpx;
|
||||
font-size: 26rpx;
|
||||
color: $brand-primary !important;
|
||||
padding: 0;
|
||||
background: #fff;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 拼团项目
|
||||
.group-box {
|
||||
background: #fff;
|
||||
padding: 40rpx 0;
|
||||
height: 250rpx;
|
||||
margin-bottom: 20rpx;
|
||||
.tip-box {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.title-box {
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
.group-num {
|
||||
color: #f8002c;
|
||||
}
|
||||
.count-down-tip {
|
||||
font-size: 24rpx;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
.time-box {
|
||||
font-size: 18rpx;
|
||||
.count-text {
|
||||
display: inline-block;
|
||||
background-color: #383a46;
|
||||
color: #fff;
|
||||
font-size: 18rpx;
|
||||
border-radius: 2rpx;
|
||||
padding: 0 5rpx;
|
||||
height: 28rpx;
|
||||
text-align: center;
|
||||
line-height: 28rpx;
|
||||
margin: 0 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.group-people {
|
||||
.img-box {
|
||||
position: relative;
|
||||
margin-right: 20rpx;
|
||||
.tag {
|
||||
position: absolute;
|
||||
line-height: 36rpx;
|
||||
background: linear-gradient(132deg, rgba(243, 223, 177, 1), rgba(243, 223, 177, 1), rgba(236, 190, 96, 1));
|
||||
border-radius: 18rpx;
|
||||
padding: 0 10rpx;
|
||||
white-space: nowrap;
|
||||
font-size: 24rpx;
|
||||
color: #784f06;
|
||||
z-index: 2;
|
||||
top: -10rpx;
|
||||
}
|
||||
.avatar {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
background: #ccc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 收货信息、订单信息。
|
||||
.notice-box {
|
||||
background: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
.notice-box__head {
|
||||
font-size: 30rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
line-height: 80rpx;
|
||||
border-bottom: 1rpx solid #dfdfdf;
|
||||
padding: 0 25rpx;
|
||||
}
|
||||
.notice-box__content {
|
||||
padding: 25rpx;
|
||||
.self-pickup-box {
|
||||
width: 100%;
|
||||
.self-pickup--img {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
margin: 40rpx 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.notice-item--center {
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.notice-item,
|
||||
.notice-item--center {
|
||||
height: 50rpx;
|
||||
align-items: flex-start;
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
text-align: justify;
|
||||
text-align-last: justify;
|
||||
text-justify: distribute-all-lines;
|
||||
width: 140rpx;
|
||||
}
|
||||
|
||||
.detail {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
flex: 1;
|
||||
}
|
||||
.copy-btn {
|
||||
width: 100rpx;
|
||||
line-height: 50rpx;
|
||||
border-radius: 25rpx;
|
||||
padding: 0;
|
||||
background: rgba(238, 238, 238, 1);
|
||||
font-size: 22rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
}
|
||||
.notice-item--center {
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
// 订单价格信息
|
||||
.order-price-box {
|
||||
background-color: #fff;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
.notice-item {
|
||||
height: 50rpx;
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.detail {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
.all-rpice-item {
|
||||
justify-content: flex-end;
|
||||
.all-price {
|
||||
font-size: 26rpx;
|
||||
color: $brand-price;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.foot-wrap {
|
||||
width: 750rpx;
|
||||
height: 140rpx;
|
||||
}
|
||||
.foot_box {
|
||||
width: 750rpx;
|
||||
min-height: 100rpx;
|
||||
background: rgba(255, 255, 255, 1);
|
||||
border: 1rpx solid rgba(238, 238, 238, 1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
.money-box {
|
||||
height: 60rpx;
|
||||
padding: 0 20rpx;
|
||||
.money-title {
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.all-price {
|
||||
color: #333;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
.btn-box {
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 20rpx;
|
||||
.delete-btn {
|
||||
background: #ffeeee;
|
||||
color: $brand-price;
|
||||
width: 160rpx;
|
||||
line-height: 60rpx;
|
||||
border-radius: 30rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
margin-right: 20rpx;
|
||||
padding: 0;
|
||||
}
|
||||
.obtn1 {
|
||||
width: 160rpx;
|
||||
line-height: 60rpx;
|
||||
background: rgba(238, 238, 238, 1);
|
||||
border-radius: 30rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
margin-right: 20rpx;
|
||||
padding: 0;
|
||||
}
|
||||
.obtn2 {
|
||||
width: 160rpx;
|
||||
line-height: 60rpx;
|
||||
background: linear-gradient(90deg, #1677FF, #4096FF);
|
||||
box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
|
||||
border-radius: 30rpx;
|
||||
margin-right: 20rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
color: #fff;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,411 @@
|
||||
<!-- 自提配送详情,自动发货详情 -->
|
||||
<template>
|
||||
<view class="page_box">
|
||||
<view class="content_box">
|
||||
<view class="card-wrap" :style="expressType !== 'selfetch' ? 'border-bottom-left-radius:0;border-bottom-right-radius:0;' : ''">
|
||||
<!-- 商品卡片 -->
|
||||
<view class="order-card-box">
|
||||
<shopro-mini-card :title="itemDetail.goods_title" :image="itemDetail.goods_image">
|
||||
<template #describe>
|
||||
<view class="order-sku u-ellipsis-1">
|
||||
<text class="order-num">数量:{{ itemDetail.goods_num || 0 }};</text>
|
||||
{{ itemDetail.goods_sku_text ? itemDetail.goods_sku_text : '' }}
|
||||
</view>
|
||||
</template>
|
||||
<template #cardBottom>
|
||||
<view class="card-price-box u-flex">
|
||||
<text class="order-price font-OPPOSANS">¥{{ itemDetail.goods_price || 0 }}</text>
|
||||
<button class="u-reset-button status-btn" v-if="itemDetail.status_name">{{ itemDetail.status_name }}</button>
|
||||
</view>
|
||||
</template>
|
||||
</shopro-mini-card>
|
||||
</view>
|
||||
|
||||
<!-- 到店自提 -->
|
||||
<view class="u-flex-col u-col-center u-m-b-20 u-p-y-20" v-if="expressType == 'selfetch' && itemDetail.status_code !== 'refund_finish' && qrcodeList.length">
|
||||
<image class="qr-code--img u-m-y-20" :src="allqrcodepath" mode=""></image>
|
||||
<view class="all-qrcode-title u-m-b-20">总核销码</view>
|
||||
<view class="detail-item">
|
||||
<view class="item-title u-flex">核销码</view>
|
||||
<view class="u-flex u-row-between u-m-y-20" v-for="code in qrcodeList" :key="code.code">
|
||||
<view>
|
||||
<text :style="code.status_code !== 'nouse' ? 'color:#999' : ''" class="item-content">{{ code.code }}</text>
|
||||
<text :style="code.status_code !== 'nouse' ? 'color:#999' : ''" class="item-status u-m-x-30">{{ code.status_name }}</text>
|
||||
</view>
|
||||
<button class="u-reset-button check-code" v-if="code.status_code == 'nouse'" @tap="checkCode(code.code)">查看</button>
|
||||
</view>
|
||||
|
||||
<view class="item-tip">为保障您的权益,未到店消费前请不要将提货码提供给商家</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 自提 -->
|
||||
<view class="detail-item u-p-20 " v-if="expressType == 'selfetch'">
|
||||
<view class="item-title">{{ storeInfo.name }}</view>
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="u-m-r-20" style="flex: 3;">
|
||||
<view class="item-content">
|
||||
{{ storeInfo.province_name || '' }}{{ storeInfo.city_name || '' }}{{ storeInfo.area_name || '' }}{{ storeInfo.address || '' }}
|
||||
</view>
|
||||
<view class="item-content">营业时间:{{ storeInfo.openhours || '' }}</view>
|
||||
</view>
|
||||
<view class="u-flex-col u-col-center location-box" style="flex: 1;" @tap="openStoreMap">
|
||||
<text class="u-iconfont uicon-map-fill" style="color: #4fbbff;font-size: 34rpx;"></text>
|
||||
<text class="location-text u-m-t-10">到这去</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 配送 -->
|
||||
<view
|
||||
class="detail-item u-p-20"
|
||||
:style="expressType !== 'selfetch' ? 'border-top-left-radius:0;border-top-right-radius:0;' : ''"
|
||||
v-if="expressType == 'store' && itemDetail.order"
|
||||
>
|
||||
<view class="item-title">配送信息</view>
|
||||
<view class="item-content">配送地址:{{ itemDetail.order.city_name || '' }}{{ itemDetail.order.area_name || '' }}{{ itemDetail.order.address || '' }}</view>
|
||||
<view class="item-content">配送时间:{{ itemDetail.ext_arr.dispatch_date || '' }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 自动 -->
|
||||
<view class="detail-item u-p-20" :style="expressType !== 'selfetch' ? 'border-top-left-radius:0;border-top-right-radius:0;' : ''" v-if="expressType == 'autosend'">
|
||||
<view class="item-title">发货信息</view>
|
||||
<view v-if="itemDetail.ext_arr && itemDetail.ext_arr.autosend_type == 'params'" v-for="item in autosendList" :key="item.value" class="item-content">
|
||||
{{ item.name }}:{{ item.value }}
|
||||
</view>
|
||||
<view v-if="itemDetail.ext_arr && itemDetail.ext_arr.autosend_type == 'text'" class="item-content">{{ itemDetail.ext_arr.autosend_content }}</view>
|
||||
<view v-if="!(itemDetail.ext_arr && itemDetail.ext_arr.autosend_type)" style="color: #999;" class="item-content">暂未发货~</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="foot_box u-flex u-row-center u-col-center u-p-b-20" v-if="expressType == 'selfetch' || expressType == 'store'">
|
||||
<button class="service-btn u-reset-button u-flex u-col-center u-row-center" @tap="onService">
|
||||
<text class="u-iconfont uicon-phone-fill u-m-r-10" style="color: #fff;font-size: 40rpx;"></text>
|
||||
联系商家
|
||||
</button>
|
||||
</view>
|
||||
<!-- 二维码弹窗 -->
|
||||
<u-popup v-model="showQrcode" border-radius="20" mode="center">
|
||||
<view class="qr-code-modal u-flex-col u-row-center u-col-center">
|
||||
<image class="qr-code-img" :src="qrcodepath" mode=""></image>
|
||||
<view class="qr-code-text">核销码:{{ qrcode }}</view>
|
||||
<button class="u-reset-button hide-qrcode" @tap="showQrcode = false">关闭</button>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<!-- 二维码绘制 -->
|
||||
<view class="hideCanvasView">
|
||||
<canvas class="hideCanvas" canvas-id="qrcode_img" :style="{ width: (poster.width || 1) + 'px', height: (poster.height || 1) + 'px' }"></canvas>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import _app from '@/shopro/poster/QS-SharePoster/app.js';
|
||||
import { getSharePoster } from '@/shopro/poster/QS-SharePoster/QS-SharePoster.js';
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
poster: {},
|
||||
canvasId: 'qrcode_img',
|
||||
qrcode: '', //核销总码
|
||||
qrcodeList: [], //核销码列表
|
||||
storeInfo: {}, //自提点信息
|
||||
qrcodepath: '', //单核销码
|
||||
allqrcodepath: '', //总核销码
|
||||
autosendList: [], //自动发货列表。
|
||||
itemDetail: {}, //订单商品详情
|
||||
expressType: 'express',
|
||||
barTitle: {
|
||||
express: '物流快递',
|
||||
selfetch: '到店/自提',
|
||||
store: '商家配送',
|
||||
autosend: '自动发货'
|
||||
},
|
||||
showQrcode: false //二维码弹窗
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
onLoad() {
|
||||
this.expressType = this.$Route.query.expressType;
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.barTitle[this.expressType]
|
||||
});
|
||||
this.getItemGoodsDetail();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getItemGoodsDetail();
|
||||
},
|
||||
methods: {
|
||||
jump(path, parmas) {
|
||||
this.$Router.push({
|
||||
path: path,
|
||||
query: parmas
|
||||
});
|
||||
},
|
||||
// 自提打开地图
|
||||
openStoreMap() {
|
||||
uni.openLocation({
|
||||
latitude: +this.storeInfo.latitude,
|
||||
longitude: +this.storeInfo.longitude,
|
||||
success: function() {
|
||||
console.log('success');
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 跳转客服
|
||||
onService() {
|
||||
this.$tools.callPhone(this.itemDetail.store.phone);
|
||||
},
|
||||
// 查看核销码
|
||||
checkCode(code) {
|
||||
this.qrcode = code;
|
||||
this.shareFc('qrcode').then(res => {
|
||||
this.showQrcode = true;
|
||||
});
|
||||
},
|
||||
// 订单详情
|
||||
getItemGoodsDetail() {
|
||||
let that = this;
|
||||
that.$http('order.itemDetail', {
|
||||
id: that.$Route.query.orderId,
|
||||
order_item_id: that.$Route.query.orderItemId,
|
||||
type: 'dispatch'
|
||||
}).then(res => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.code === 1) {
|
||||
that.itemDetail = res.data;
|
||||
that.qrcodeList = res.data.verify;
|
||||
that.storeInfo = res.data.store;
|
||||
if (res.data.ext_arr.autosend_content && res.data.ext_arr.autosend_type == 'params') {
|
||||
that.autosendList = JSON.parse(res.data.ext_arr.autosend_content);
|
||||
}
|
||||
if (that.expressType == 'selfetch') {
|
||||
let _arr = [];
|
||||
that.qrcodeList.forEach(code => {
|
||||
_arr.push(code.code);
|
||||
});
|
||||
that.qrcode = _arr.join(',');
|
||||
if (that.qrcodeList.length) {
|
||||
that.shareFc();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 绘制二维码
|
||||
async shareFc(type) {
|
||||
let that = this;
|
||||
try {
|
||||
console.log('准备生成:' + new Date());
|
||||
const d = await getSharePoster({
|
||||
_this: this, //若在组件中使用 必传
|
||||
posterCanvasId: this.canvasId, //canvasId
|
||||
delayTimeScale: 20, //延时系数
|
||||
drawDelayTime: 500, //draw延时时间
|
||||
background: {
|
||||
width: 100,
|
||||
height: 100,
|
||||
backgroundColor: '#fff'
|
||||
},
|
||||
drawArray: ({ bgObj, type, bgScale }) => {
|
||||
return new Promise((rs, rj) => {
|
||||
rs([
|
||||
{
|
||||
type: 'qrcode',
|
||||
text: this.qrcode,
|
||||
size: bgObj.width,
|
||||
dx: 0,
|
||||
dy: 0,
|
||||
correctLevel: 1
|
||||
}
|
||||
]);
|
||||
});
|
||||
},
|
||||
setCanvasWH: ({ bgObj, type, bgScale }) => {
|
||||
// 为动态设置画布宽高的方法,
|
||||
this.poster = bgObj;
|
||||
}
|
||||
});
|
||||
if (type == 'qrcode') {
|
||||
this.qrcodepath = d.poster.tempFilePath;
|
||||
} else {
|
||||
this.allqrcodepath = d.poster.tempFilePath;
|
||||
}
|
||||
} catch (e) {
|
||||
_app.hideLoading();
|
||||
_app.showToast(JSON.stringify(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// 二维码
|
||||
.hideCanvasView {
|
||||
position: relative;
|
||||
.hideCanvas {
|
||||
position: fixed;
|
||||
top: -99999upx;
|
||||
left: -99999upx;
|
||||
z-index: -99999;
|
||||
}
|
||||
}
|
||||
// 二维码弹窗
|
||||
.qr-code-modal {
|
||||
width: 610rpx;
|
||||
border-radius: 20rpx;
|
||||
background-color: #fff;
|
||||
margin: 0 auto;
|
||||
.qr-code-img {
|
||||
margin: 100rpx;
|
||||
width: 400rpx;
|
||||
height: 400rpx;
|
||||
}
|
||||
.qr-code-text {
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.hide-qrcode {
|
||||
width: 492rpx;
|
||||
line-height: 70rpx;
|
||||
background: linear-gradient(90deg, #1677FF, #4096FF);
|
||||
box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
|
||||
border-radius: 35rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(255, 255, 255, 1);
|
||||
margin: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content_box {
|
||||
padding: 20rpx;
|
||||
}
|
||||
.no-radius {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
.card-wrap {
|
||||
background-color: #fff;
|
||||
padding: 20rpx 20rpx 0;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.order-card-box {
|
||||
height: 200rpx;
|
||||
border-bottom: 2rpx solid rgba(238, 238, 238, 0.6);
|
||||
.order-sku {
|
||||
font-size: 24rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(153, 153, 153, 1);
|
||||
width: 450rpx;
|
||||
margin-bottom: 20rpx;
|
||||
.order-num {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
.card-price-box {
|
||||
.status-btn {
|
||||
height: 32rpx;
|
||||
border: 1rpx solid rgba(207, 169, 114, 1);
|
||||
border-radius: 15rpx;
|
||||
font-size: 20rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(168, 112, 13, 1);
|
||||
padding: 0 10rpx;
|
||||
margin-left: 20rpx;
|
||||
background: rgba(233, 183, 102, 0.16);
|
||||
}
|
||||
.order-price {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 600;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
.qr-code--img {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
}
|
||||
.detail-item {
|
||||
background: rgba(255, 255, 255, 1);
|
||||
border-radius: 20rpx;
|
||||
width: 100%;
|
||||
.item-title {
|
||||
font-size: 28rpx;
|
||||
|
||||
font-weight: bold;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
height: 60rpx;
|
||||
}
|
||||
.item-content {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
line-height: 50rpx;
|
||||
}
|
||||
.item-status {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(179, 132, 54, 1);
|
||||
}
|
||||
.item-tip {
|
||||
font-size: 24rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(196, 196, 196, 1);
|
||||
}
|
||||
.check-code {
|
||||
background: none;
|
||||
border-radius: 25rpx;
|
||||
border: 1rpx solid rgba(179, 132, 54, 1);
|
||||
padding: 0;
|
||||
width: 100rpx;
|
||||
line-height: 50rpx;
|
||||
font-size: 28rpx;
|
||||
color: rgba(179, 132, 54, 1);
|
||||
}
|
||||
.location-box {
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
&::before {
|
||||
content: '';
|
||||
width: 2rpx;
|
||||
height: 94rpx;
|
||||
background: #eeeeee;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
left: 0;
|
||||
}
|
||||
.location-icon {
|
||||
color: #4fbbff;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.location-text {
|
||||
color: #999;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.service-btn {
|
||||
padding: 0;
|
||||
width: 710rpx;
|
||||
line-height: 80rpx;
|
||||
background: linear-gradient(90deg, #1677FF, #4096FF);
|
||||
box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
|
||||
border-radius: 40rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(255, 255, 255, 1);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,231 @@
|
||||
<!-- 物流信息 -->
|
||||
<template>
|
||||
<view class="map-box">
|
||||
<!-- 商品卡片 -->
|
||||
<view class="oilStation-top">
|
||||
<view class="u-flex u-row-between express-card__head">
|
||||
<view class="u-flex">
|
||||
<view class="img-box">
|
||||
<image class="goods-image" :src="firstGoods.goods_image" mode="aspectFill"></image>
|
||||
<view class="shop-tag">{{ goodsList.length || 0 }}件商品</view>
|
||||
</view>
|
||||
<view class="u-flex u-flex-col">
|
||||
<text class="express-status">{{ expressStatus || firstGoods.status_name || '' }}</text>
|
||||
<text v-if="expressCompanyName" class="express-company">{{ expressCompanyName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="express-sn u-flex u-col-center ">
|
||||
<text class="u-m-r-30">{{ expressDetail.express_name || '' }}
|
||||
{{ expressDetail.express_no || '' }}</text>
|
||||
<text class="u-iconfont uicon-file-text" style="color: #666;font-size: 32rpx;"
|
||||
@tap="copyCode(expressDetail.express_no)"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 物流时间轴 -->
|
||||
<view class="oilStation-bottom">
|
||||
<view class="u-p-y-30">
|
||||
<view v-if="trackList.length" class="express-item u-flex u-col-center"
|
||||
v-for="(log, index) in trackList" :key="log.id">
|
||||
<view class="item-left">
|
||||
<view class="day">{{ log.AcceptTime.split(' ')[0] }}</view>
|
||||
<view class="time">{{ log.AcceptTime.split(' ')[1] }}</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<image class="express-tag"
|
||||
:src="$IMG_URL + `/imgs/order/ex_${log.Action}.png?a=2`"
|
||||
mode="aspectFill"></image>
|
||||
<view class="express-title">{{ log.Location }}</view>
|
||||
<view class="express-detail">{{ log.AcceptStation }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!trackList.length" class="no-log u-flex u-row-center u-col-center">暂无物流信息~</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
expressDetail: {}, // 物流信息
|
||||
exrpessLog: [], // 包裹轨迹
|
||||
firstGoods: {}, // 商品列表
|
||||
goodsList: [],
|
||||
trackList: [], // 快递轨迹
|
||||
expressStatus: '',
|
||||
expressCompanyName: '',
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
onLoad() {
|
||||
this.getExpressDetail();
|
||||
},
|
||||
methods: {
|
||||
// 复制物流码
|
||||
copyCode(code) {
|
||||
let that = this;
|
||||
uni.setClipboardData({
|
||||
data: code,
|
||||
success: () => {
|
||||
that.$u.toast('已复制到剪切板');
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取物流信息
|
||||
getExpressDetail() {
|
||||
let that = this;
|
||||
that.$http('order.expressDetail', {
|
||||
id: that.$Route.query.expressId,
|
||||
order_id: that.$Route.query.orderId
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.expressDetail = res.data;
|
||||
that.goodsList = res.data.item;
|
||||
that.exrpessLog = res.data.log;
|
||||
that.trackList = res.data.trackList || [];
|
||||
that.expressStatus = res.data.expressStatus || '';
|
||||
that.expressCompanyName = res.data.expressCompanyName || '';
|
||||
that.firstGoods = res.data.item[0];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/* 物流卡片 */
|
||||
.oilStation-top {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
margin: 20rpx;
|
||||
background: rgba(255, 255, 255, 1);
|
||||
box-shadow: 0 1rpx 18rpx 0 rgba(184, 184, 184, 0.55);
|
||||
border-radius: 20rpx;
|
||||
|
||||
.express-card__head {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.img-box {
|
||||
position: relative;
|
||||
width: 129rpx;
|
||||
height: 129rpx;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
background: #ccc;
|
||||
|
||||
.goods-image {
|
||||
width: 129rpx;
|
||||
height: 129rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.shop-tag {
|
||||
position: absolute;
|
||||
width: 129rpx;
|
||||
height: 30rpx;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
font-size: 18rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(255, 255, 255, 1);
|
||||
text-align: center;
|
||||
bottom: 0;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.express-status {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.express-company {
|
||||
font-size: 22rpx;
|
||||
color: rgba(102, 102, 102, 1);
|
||||
margin-left: 20rpx;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.express-sn {
|
||||
width: 100%;
|
||||
// height: 65rpx;
|
||||
background: rgba(250, 251, 255, 1);
|
||||
border-radius: 0 0 20rpx 20rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(102, 102, 102, 1);
|
||||
padding: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.oilStation-bottom {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
background: #fff;
|
||||
width: 710rpx;
|
||||
margin: 0 20rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 1rpx 18rpx 0 rgba(184, 184, 184, 0.55);
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
// 物流步骤条
|
||||
.no-log {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.express-item {
|
||||
align-items: flex-start;
|
||||
.item-left {
|
||||
.day {
|
||||
font-size: 26rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.time {
|
||||
font-size: 20rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.item-right {
|
||||
position: relative;
|
||||
padding-left: 54rpx;
|
||||
margin-left: 54rpx;
|
||||
border-left: 1rpx solid #e7e7e7;
|
||||
padding-bottom: 40rpx;
|
||||
|
||||
.express-tag {
|
||||
width: 54rpx;
|
||||
height: 54rpx;
|
||||
position: absolute;
|
||||
left: -27rpx;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.express-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.express-detail {
|
||||
width: 400rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,114 @@
|
||||
<!-- 物流分包 -->
|
||||
<template>
|
||||
<view class="express-list-wrap u-p-b-30">
|
||||
<view class="tip-box u-flex u-col-center u-p-x-20">{{ expressList.length }}个包裹已发出</view>
|
||||
<view class="express-list u-m-b-20" v-for="express in expressList" :key="express.id" @tap="toExpressDetail(express.id)">
|
||||
<view class="u-flex u-row-between list-head u-p-x-20">
|
||||
<text class="list-status" v-if="express.log.length">{{ express.log[0].status_name }}</text>
|
||||
<view class="express-name">{{ express.express_name }}:{{ express.express_no }}</view>
|
||||
</view>
|
||||
<view class="list-content u-p-20">
|
||||
<view class="express-detail u-m-b-20" v-if="express.log.length">{{ express.log[0].content }}</view>
|
||||
<view class="goods-box u-flex u-col-center">
|
||||
<view class="goods-img-box" v-for="img in express.item" :key="img.id"><image class="goods-img" :src="img.goods_image" mode="aspectFill"></image></view>
|
||||
</view>
|
||||
<view class="all-goods">共{{ express.item.length }}件商品</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
expressList: []
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
onLoad() {
|
||||
this.getExpressList();
|
||||
},
|
||||
methods: {
|
||||
jump(path, parmas) {
|
||||
this.$Router.push({
|
||||
path: path,
|
||||
query: parmas
|
||||
});
|
||||
},
|
||||
// 物流详情
|
||||
toExpressDetail(id) {
|
||||
this.jump('/pages/order/express/express-detail', { orderId: this.$Route.query.orderId, expressId: id });
|
||||
},
|
||||
// 包裹列表
|
||||
getExpressList() {
|
||||
let that = this;
|
||||
that.$http('order.expressList', {
|
||||
order_id: that.$Route.query.orderId
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.expressList = res.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.tip-box {
|
||||
width: 750rpx;
|
||||
height: 84rpx;
|
||||
font-size: 30rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: rgba(168, 112, 13, 1);
|
||||
background: rgba(255, 226, 182, 1);
|
||||
}
|
||||
// 物流包裹
|
||||
.express-list {
|
||||
background-color: #fff;
|
||||
.list-head {
|
||||
height: 76rpx;
|
||||
border-bottom: 1rpx solid rgba(223, 223, 223, 0.5);
|
||||
.list-status {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: rgba(168, 112, 13, 1);
|
||||
}
|
||||
.express-name {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(153, 153, 153, 1);
|
||||
}
|
||||
}
|
||||
.list-content {
|
||||
.express-detail {
|
||||
font-size: 28rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
.goods-box {
|
||||
flex-wrap: wrap;
|
||||
.goods-img-box {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
overflow: hidden;
|
||||
margin-right: 22rpx;
|
||||
margin-bottom: 22rpx;
|
||||
&:nth-child(4n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
.goods-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,351 @@
|
||||
<!-- 自提点 -->
|
||||
<template>
|
||||
<view class="map-box">
|
||||
<!-- 标题栏 -->
|
||||
<shopro-navbar>
|
||||
<view class="search-wrap u-flex" slot="content">
|
||||
<u-search
|
||||
class="u-m-r-20"
|
||||
placeholder="输入自提点名称"
|
||||
@change="onSearch"
|
||||
@search="onSearch"
|
||||
@clear="clearSearch"
|
||||
v-model="searchVal"
|
||||
:showAction="false"
|
||||
height="60"
|
||||
></u-search>
|
||||
</view>
|
||||
</shopro-navbar>
|
||||
|
||||
<map id="map" :style="{ width: '750rpx', height: mapHeight + 'px' }" :latitude="latitude" :longitude="longitude" show-location @tap="onMap"></map>
|
||||
<view class="dragLayer safe-area-inset-bottom" :class="moveCard">
|
||||
<view class="oilStation">
|
||||
<!-- 上下箭头 -->
|
||||
<view class="oilStation-top">
|
||||
<view class="touch-guide u-flex u-row-center u-col-center" @tap="onShowCard">
|
||||
<image class="touch-jintou" :src="$IMG_URL + (showCard ? '/imgs/order/arrows2.png' : '/imgs/order/arrows1.png')" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 自提点列表 -->
|
||||
<scroll-view class="oilStation-bottom" enable-back-to-top scroll-y @scrolltolower="loadMore">
|
||||
<view class=" list-content">
|
||||
<u-radio-group style="width: 100%;" v-model="storeId" active-color="#e9b561">
|
||||
<view style="width: 100%;" @tap="selStoreAddress(address.id, index)" v-for="(address, index) in addressList" :key="address.id">
|
||||
<view class="address-item u-flex u-col-center u-row-between">
|
||||
<view class="address-left">
|
||||
<!-- 门店 -->
|
||||
<view class="address-name">{{ address.name }}</view>
|
||||
<!-- 时间 -->
|
||||
<view class="time-box ">
|
||||
<view class=" u-flex u-col-center">
|
||||
<text class="u-iconfont uicon-clock u-m-r-20" style="color: #999;"></text>
|
||||
{{ address.openhours }}
|
||||
</view>
|
||||
<view class="u-flex u-col-center u-p-l-30 u-m-t-20">
|
||||
<text v-for="week in address.openweeks_arr" :key="week">{{ weekMap[week] }}、</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 地址 -->
|
||||
<view class="address-detail u-flex u-col-center">
|
||||
<text class="u-iconfont uicon-map u-m-r-20" style="color: #999;"></text>
|
||||
{{ address.province_name }}{{ address.city_name }}{{ address.area_name }}{{ address.address }}
|
||||
</view>
|
||||
<!-- 电话 -->
|
||||
<view class="address-phone u-flex u-col-center">
|
||||
<text class="u-iconfont uicon-phone u-m-r-20" style="color: #999;"></text>
|
||||
{{ address.phone }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="address-right u-flex-col u-row-center u-col-center">
|
||||
<u-radio :name="address.id"></u-radio>
|
||||
<text class="address-distance u-m-t-10">{{ address.distance_text || 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-radio-group>
|
||||
|
||||
<!-- 更多 -->
|
||||
<u-loadmore v-if="addressList.length" height="80rpx" :status="loadStatus" icon-type="flower" color="#ccc" />
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="foot_box u-flex u-row-center u-col-center"><button class="u-reset-button save-btn" @tap="onSave">确认</button></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
longitude: 0,
|
||||
latitude: 0,
|
||||
mapHeight: 0,
|
||||
showCard: false,
|
||||
moveCard: 'dragLayer-bottom',
|
||||
distance: 0,
|
||||
storeId: 0, //默认门店ID
|
||||
addressList: [], //门店列表
|
||||
storeInfo: [], //当前门店信息
|
||||
weekMap: {
|
||||
1: '周一',
|
||||
2: '周二',
|
||||
3: '周三',
|
||||
4: '周四',
|
||||
5: '周五',
|
||||
6: '周六',
|
||||
7: '周日'
|
||||
},
|
||||
loadStatus: 'loadmore',
|
||||
currentPage: 1,
|
||||
lastPage: 1,
|
||||
searchVal: ''
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
onLoad(options) {
|
||||
this.latitude = this.$Route.query.lat;
|
||||
this.longitude = this.$Route.query.lng;
|
||||
this.storeId = this.$Route.query.storeId;
|
||||
this.getStoreAddress();
|
||||
},
|
||||
onReady() {
|
||||
this.editHeight();
|
||||
},
|
||||
methods: {
|
||||
// 选中门店
|
||||
onSave() {
|
||||
if (this.storeId) {
|
||||
uni.$emit('SELECT_STORE', { storeInfo: JSON.stringify(this.storeInfo) });
|
||||
this.$Router.back();
|
||||
} else {
|
||||
this.$u.toast('请选择门店');
|
||||
}
|
||||
},
|
||||
// 搜索
|
||||
onSearch() {
|
||||
this.addressList = [];
|
||||
this.$u.debounce(this.getStoreAddress());
|
||||
},
|
||||
|
||||
// 清除搜索框
|
||||
clearSearch() {
|
||||
this.searchVal = '';
|
||||
this.onSearch();
|
||||
},
|
||||
// 设置地图,卡片高度。
|
||||
editHeight() {
|
||||
let that = this;
|
||||
uni.getSystemInfo({
|
||||
success: res => {
|
||||
let view = uni
|
||||
.createSelectorQuery()
|
||||
.in(this)
|
||||
.select('.dragLayer');
|
||||
view.fields(
|
||||
{
|
||||
size: true,
|
||||
scrollOffset: true
|
||||
},
|
||||
data => {
|
||||
that.mapHeight = res.windowHeight - data.height;
|
||||
//#ifdef APP-PLUS
|
||||
that.mapHeight = res.windowHeight - data.height - 40;
|
||||
//#endif
|
||||
}
|
||||
).exec();
|
||||
}
|
||||
});
|
||||
},
|
||||
// 点击地图
|
||||
onMap() {
|
||||
this.showCard = false;
|
||||
this.moveCard = 'dragLayer-bottom';
|
||||
},
|
||||
// 选择门店
|
||||
selStoreAddress(id, index) {
|
||||
this.storeId = id;
|
||||
this.latitude = this.addressList[index].latitude;
|
||||
this.longitude = this.addressList[index].longitude;
|
||||
this.storeInfo = this.addressList[index];
|
||||
},
|
||||
loadMore() {
|
||||
if (this.currentPage < this.lastPage) {
|
||||
this.currentPage += 1;
|
||||
this.getStoreAddress();
|
||||
}
|
||||
},
|
||||
// 获取商品支持的自提点。
|
||||
getStoreAddress() {
|
||||
let that = this;
|
||||
that.loadStatus = 'loading';
|
||||
that.$http('goods.storeAddress', {
|
||||
id: that.$Route.query.goodsId,
|
||||
latitude: that.$Route.query.lat,
|
||||
longitude: that.$Route.query.lng,
|
||||
keyword: that.searchVal,
|
||||
page: that.currentPage,
|
||||
per_page: 3
|
||||
}).then(res => {
|
||||
if (res.code == 1) {
|
||||
that.addressList = [...that.addressList, ...res.data.data];
|
||||
that.lastPage = res.data.last_page;
|
||||
that.loadStatus = that.currentPage < res.data.last_page ? 'loadmore' : 'nomore';
|
||||
if (this.currentPage === 1) {
|
||||
this.storeId = res.data.data[0].id;
|
||||
this.storeInfo = res.data.data[0];
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 点击显隐
|
||||
onShowCard() {
|
||||
this.showCard = !this.showCard;
|
||||
this.moveCard = this.showCard ? 'dragLayer-top' : 'dragLayer-bottom';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.search-wrap {
|
||||
/* #ifdef MP-WEIXIN */
|
||||
width: 460rpx;
|
||||
/* #endif */
|
||||
/* #ifndef MP-WEIXIN */
|
||||
width: 100%;
|
||||
/* #endif */
|
||||
}
|
||||
/* 浮层 */
|
||||
.dragLayer {
|
||||
width: 750rpx;
|
||||
position: fixed;
|
||||
z-index: 996;
|
||||
background-color: #fff;
|
||||
border-top-left-radius: 20rpx;
|
||||
border-top-right-radius: 20rpx;
|
||||
bottom: 0;
|
||||
box-shadow: 0px 1rpx 18rpx 0px rgba(83, 83, 83, 0.35);
|
||||
display: flex;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
// 点击上下
|
||||
.dragLayer-bottom {
|
||||
height: 450rpx !important;
|
||||
/*#ifdef APP-PLUS */
|
||||
height: 800rpx !important;
|
||||
/*#endif*/
|
||||
transition: all ease-in-out 0.2s;
|
||||
}
|
||||
.dragLayer-top {
|
||||
height: 800rpx !important;
|
||||
transition: all ease-in-out 0.2s;
|
||||
}
|
||||
.oilStation {
|
||||
width: 690rpx;
|
||||
margin: 0 30rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
}
|
||||
.oilStation-top {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
.touch-guide {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
}
|
||||
.touch-jintou {
|
||||
width: 60rpx;
|
||||
height: 8rpx;
|
||||
}
|
||||
// 确认门店
|
||||
.foot_box {
|
||||
height: 100rpx;
|
||||
background-color: #fff;
|
||||
.save-btn {
|
||||
color: #fff;
|
||||
width: 690rpx;
|
||||
line-height: 80rpx;
|
||||
background: linear-gradient(90deg, rgba(233, 181, 97, 1), rgba(238, 204, 138, 1));
|
||||
box-shadow: 1rpx 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
|
||||
border-radius: 40rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// 自提点列表
|
||||
.oilStation-bottom {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.list-content {
|
||||
background-color: #fff;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.address-item {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-color: #eef1f4;
|
||||
padding: 15rpx 0 15rpx;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
}
|
||||
.address-name {
|
||||
font-size: 30rpx;
|
||||
|
||||
font-weight: 600;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.time-box,
|
||||
.address-detail,
|
||||
.address-phone {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: #666;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.address-icon {
|
||||
color: #bdbdbd;
|
||||
margin-right: 10rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.address-left {
|
||||
flex: 1;
|
||||
}
|
||||
.address-right {
|
||||
align-items: center;
|
||||
color: #a8700e;
|
||||
font-size: 24rpx;
|
||||
margin-bottom: 20rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.more {
|
||||
width: 750rpx;
|
||||
height: 90rpx;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.more-text {
|
||||
font-size: 24rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,407 @@
|
||||
<template>
|
||||
<view class="page_box">
|
||||
<view class="head_box">
|
||||
<!-- tab -->
|
||||
<view class="order-nav u-flex">
|
||||
<view class="nav-item u-flex-col u-flex-1 u-col-center" v-for="nav in orderState" :key="nav.id"
|
||||
@tap="onNav(nav.type)">
|
||||
<view class="item-title">{{ nav.title }}</view>
|
||||
<text class="nav-line" :class="{ 'line-active': orderType === nav.type }"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="content_box">
|
||||
<scroll-view scroll-y="true" enable-back-to-top @scrolltolower="loadMore" class="scroll-box">
|
||||
<!-- 订单列表 -->
|
||||
<view class="order-list" v-for="(order, orderIndex) in orderList" :key="order.id"
|
||||
@tap.stop="jump('/pages/order/detail', { id: order.id })">
|
||||
<view class="order-head u-flex u-row-between">
|
||||
<text class="no">订单编号:{{ order.order_sn }}</text>
|
||||
<text class="state">{{ order.status_name }}</text>
|
||||
</view>
|
||||
<view class="goods-order" v-for="goods in order.item" :key="goods.id">
|
||||
<view class="order-content">
|
||||
<shopro-mini-card :title="goods.goods_title" :image="goods.goods_image">
|
||||
<template #describe>
|
||||
<view class="order-sku u-ellipsis-1">
|
||||
<text class="order-num">数量:{{ goods.goods_num || 0 }};</text>
|
||||
{{ goods.goods_sku_text ? goods.goods_sku_text : '' }}
|
||||
</view>
|
||||
</template>
|
||||
<template #cardBottom>
|
||||
<view class="order-price-box u-flex ">
|
||||
<text class="order-price font-OPPOSANS">¥{{ goods.goods_price || 0 }}</text>
|
||||
<button class="u-reset-button status-btn"
|
||||
v-if="goods.status_name">{{ goods.status_name }}</button>
|
||||
</view>
|
||||
</template>
|
||||
</shopro-mini-card>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-bottom">
|
||||
<view class="all-msg u-flex font-OPPOSANS">
|
||||
优惠:
|
||||
<text class="all-unit">¥</text>
|
||||
{{ order.discount_fee }} ,运费:
|
||||
<text class="all-unit">¥</text>
|
||||
{{ order.dispatch_amount }} ,{{ order.status <= 0 ? '需付款' : '实付款' }}:
|
||||
<view class="all-money font-OPPOSANS">{{ order.total_fee }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 按钮 -->
|
||||
<view class="btn-box u-flex" v-if="order.btns.length">
|
||||
<block v-for="orderBtn in order.btns" :key="orderBtn">
|
||||
<button v-if="orderBtn === 'cancel'" @tap.stop="onCancel(order.id, orderIndex)"
|
||||
class="u-reset-button obtn1">取消订单</button>
|
||||
<button v-if="orderBtn === 'pay'" @tap.stop="onPay(order.id)"
|
||||
class="u-reset-button obtn2">立即支付</button>
|
||||
<button v-if="orderBtn === 'groupon'"
|
||||
@tap.stop="jump('/pages/activity/groupon/detail', { id: order.ext_arr.groupon_id })"
|
||||
class="u-reset-button obtn2">
|
||||
拼团详情
|
||||
</button>
|
||||
<button v-if="orderBtn === 'delete'" @tap.stop="onDelete(order.id, orderIndex)"
|
||||
class="u-reset-button obtn3">删除</button>
|
||||
<button v-if="orderBtn === 'express'" @tap.stop="onExpress(order.id, orderIndex)"
|
||||
class="u-reset-button obtn1">查看物流</button>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空白页 -->
|
||||
<shopro-empty v-if="isEmpty" :image="$IMG_URL + '/imgs/empty/empty_groupon.png'"
|
||||
tipText="暂无商品,还有更多好货等着你噢~"></shopro-empty>
|
||||
<!-- 更多 -->
|
||||
<u-loadmore v-show="orderList.length" height="80rpx" :status="loadStatus" icon-type="flower"
|
||||
color="#ccc" />
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
isEmpty: false,
|
||||
loadStatus: 'loadmore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
|
||||
currentPage: 1,
|
||||
lastPage: 1,
|
||||
orderType: 'all',
|
||||
orderList: [],
|
||||
orderState: [{
|
||||
id: 0,
|
||||
title: '全部',
|
||||
type: 'all'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '待付款',
|
||||
type: 'nopay'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '待发货',
|
||||
type: 'nosend'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: '待收货',
|
||||
type: 'noget'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: '待评价',
|
||||
type: 'nocomment'
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (this.$Route.query.type) {
|
||||
this.orderType = this.$Route.query.type;
|
||||
}
|
||||
this.orderList = [];
|
||||
this.currentPage = 1;
|
||||
this.lastPage = 1;
|
||||
this.getOrderList();
|
||||
},
|
||||
methods: {
|
||||
jump(path, parmas) {
|
||||
this.$Router.push({
|
||||
path: path,
|
||||
query: parmas
|
||||
});
|
||||
},
|
||||
|
||||
// tab切换
|
||||
onNav(id) {
|
||||
if (this.orderType !== id) {
|
||||
this.orderType = id;
|
||||
this.orderList = [];
|
||||
this.currentPage = 1;
|
||||
this.lastPage = 1;
|
||||
this.getOrderList();
|
||||
}
|
||||
},
|
||||
|
||||
// 订单列表
|
||||
getOrderList() {
|
||||
let that = this;
|
||||
that.loadStatus = 'loading';
|
||||
that.$http('order.index', {
|
||||
type: that.orderType,
|
||||
page: that.currentPage
|
||||
}, '加载中...').then(res => {
|
||||
if (res.code === 1) {
|
||||
that.orderList = [...that.orderList, ...res.data.data];
|
||||
that.isEmpty = !that.orderList.length;
|
||||
that.lastPage = res.data.last_page;
|
||||
that.loadStatus = that.currentPage < res.data.last_page ? 'loadmore' : 'nomore';
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 加载更多
|
||||
loadMore() {
|
||||
if (this.currentPage < this.lastPage) {
|
||||
this.currentPage += 1;
|
||||
this.getOrderList();
|
||||
}
|
||||
},
|
||||
|
||||
// 删除订单
|
||||
onDelete(orderId, orderIndex) {
|
||||
let that = this;
|
||||
uni.showModal({
|
||||
title: '删除订单',
|
||||
content: '确定要删除这个订单么?',
|
||||
cancelText: '取消',
|
||||
confirmText: '删除',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
that.$http('order.deleteOrder', {
|
||||
id: orderId
|
||||
},
|
||||
'删除中...'
|
||||
).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.$u.toast(res.msg);
|
||||
that.orderList.splice(orderIndex, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 取消订单
|
||||
onCancel(id, orderIndex) {
|
||||
let that = this;
|
||||
that.$http('order.cancel', {
|
||||
id: id
|
||||
},
|
||||
'取消中...'
|
||||
).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.$u.toast(res.msg);
|
||||
this.orderList.splice(orderIndex, 1);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 立即购买
|
||||
onPay(id) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/payment/method?orderId=${id}&orderType=goods`
|
||||
});
|
||||
},
|
||||
|
||||
// 查看物流
|
||||
onExpress(orderId) {
|
||||
let that = this;
|
||||
that.$http('order.expressList', {
|
||||
order_id: orderId
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
if (res.data.length == 1) {
|
||||
this.jump('/pages/order/express/express-detail', { orderId: orderId, expressId: res
|
||||
.data[0].id });
|
||||
} else if (res.data.length > 1) {
|
||||
this.jump('/pages/order/express/express-list', { orderId: orderId });
|
||||
} else {
|
||||
that.$u.toast('暂无包裹~');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.order-nav {
|
||||
background: #fff;
|
||||
height: 80rpx;
|
||||
|
||||
.nav-item {
|
||||
flex: 1;
|
||||
|
||||
.item-title {
|
||||
font-size: 30rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
line-height: 76rpx;
|
||||
}
|
||||
|
||||
.nav-line {
|
||||
width: 100rpx;
|
||||
height: 4rpx;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.line-active {
|
||||
background: $brand-gold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order-list {
|
||||
background: #fff;
|
||||
margin: 20rpx 0;
|
||||
|
||||
.order-bottom {
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
.btn-box {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.all-msg {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 10rpx;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.all-unit {
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.all-money {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
|
||||
&::before {
|
||||
content: '¥';
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.obtn1 {
|
||||
width: 160rpx;
|
||||
line-height: 60rpx;
|
||||
background: rgba(238, 238, 238, 1);
|
||||
border-radius: 30rpx;
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
margin-right: 20rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.obtn2 {
|
||||
width: 160rpx;
|
||||
line-height: 60rpx;
|
||||
background: linear-gradient(90deg, #1677FF, #4096FF);
|
||||
box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
|
||||
border-radius: 30rpx;
|
||||
margin-right: 20rpx;
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: #fff;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.obtn3 {
|
||||
background: rgba($brand-price, 0.08);
|
||||
color: $brand-price;
|
||||
width: 160rpx;
|
||||
line-height: 60rpx;
|
||||
border-radius: 30rpx;
|
||||
margin-right: 20rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.order-head {
|
||||
padding: 0 25rpx;
|
||||
height: 77rpx;
|
||||
border-bottom: 1rpx solid #dfdfdf;
|
||||
|
||||
.no {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.state {
|
||||
font-size: 26rpx;
|
||||
color: $brand-price;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-order {
|
||||
border-bottom: 1px solid rgba(223, 223, 223, 0.5);
|
||||
padding: 20rpx 20rpx 0;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.order-content {
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
.order-sku {
|
||||
font-size: 24rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(153, 153, 153, 1);
|
||||
width: 450rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.order-num {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.order-price-box {
|
||||
.status-btn {
|
||||
height: 32rpx;
|
||||
border: 1rpx solid rgba(207, 169, 114, 1);
|
||||
border-radius: 15rpx;
|
||||
font-size: 20rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(168, 112, 13, 1);
|
||||
padding: 0 10rpx;
|
||||
margin-left: 20rpx;
|
||||
background: rgba(233, 183, 102, 0.16);
|
||||
}
|
||||
|
||||
.order-price {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 600;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,436 @@
|
||||
<!-- 收银台 -->
|
||||
<template>
|
||||
<view class="pay-method-wrap">
|
||||
<view class="u-flex-col u-col-center money-box" v-if="orderDetail.total_fee">
|
||||
<text class="time" v-show="isCountDown">{{ timeText }}</text>
|
||||
<view class="money">{{ orderDetail.total_fee }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付方式单选项 -->
|
||||
<u-radio-group v-if="paymentList && paymentList.length" class="pay-box" v-model="payType"
|
||||
active-color="#1677FF">
|
||||
<!-- 微信支付 -->
|
||||
<view class="u-flex u-row-between pay-item" v-show="paymentList.includes('wechat')"
|
||||
@tap="payType = 'wechat'">
|
||||
<view class="u-flex">
|
||||
<image class="pay-img" :src="$IMG_URL + '/imgs/order/order_wx_pay.png'" mode=""></image>
|
||||
<text>微信支付</text>
|
||||
</view>
|
||||
<u-radio shape="circle" name="wechat"></u-radio>
|
||||
</view>
|
||||
<!-- 支付宝支付 -->
|
||||
<view class="u-flex u-row-between pay-item" v-show="paymentList.includes('alipay')"
|
||||
@tap="payType = 'alipay'">
|
||||
<view class="u-flex">
|
||||
<image class="pay-img" :src="$IMG_URL + '/imgs/order/order_ali_pay.png'" mode=""></image>
|
||||
<text>支付宝支付</text>
|
||||
</view>
|
||||
<u-radio shape="circle" name="alipay"></u-radio>
|
||||
</view>
|
||||
<!-- 苹果支付 -->
|
||||
<view class="u-flex u-row-between pay-item" v-show="paymentList.includes('iospay') && appPlatfrom === 'ios'"
|
||||
@tap="payType = 'iospay'">
|
||||
<view class="u-flex">
|
||||
<image class="pay-img" :src="$IMG_URL + '/imgs/order/order_apple_pay.png'" mode=""></image>
|
||||
<text>ApplePay</text>
|
||||
</view>
|
||||
<u-radio shape="circle" name="iospay"></u-radio>
|
||||
</view>
|
||||
<!-- 余额支付 -->
|
||||
<view class="u-flex u-row-between pay-item" v-show="paymentList.includes('wallet')"
|
||||
@tap="payType = 'wallet'">
|
||||
<view class="u-flex">
|
||||
<image class="pay-img" :src="$IMG_URL + '/imgs/order/order_wallet_pay.png'" mode=""></image>
|
||||
<text>余额支付</text>
|
||||
</view>
|
||||
<u-radio shape="circle" name="wallet"></u-radio>
|
||||
</view>
|
||||
</u-radio-group>
|
||||
|
||||
<button class="u-reset-button pay-btn" @tap="confirmPay">确认支付 ¥{{ orderDetail.total_fee || '0.00' }}</button>
|
||||
|
||||
<!-- 组合支付弹窗 -->
|
||||
<u-popup v-model="showGrpupDialog" @close="handleCloseGroupDialog" mode="bottom" :mask-close-able="false" :border-radius="20" closeable
|
||||
close-icon-pos="top-left">
|
||||
<view class="group-box">
|
||||
<view class="price"><text>¥</text>{{orderDetail.total_fee}}</view>
|
||||
<view class="content">
|
||||
<view class="account">
|
||||
<view class="name">支付账号</view>
|
||||
<view class="mobile">{{orderDetail.user_mobile}}</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view class="name">组合支付</view>
|
||||
<view class="icon">
|
||||
<!-- <image :src="$IMG_URL + '/imgs/order/money.png'" mode=""></image> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="price-box">
|
||||
<view class="div">
|
||||
<view class="left">
|
||||
<image class="pay-img" :src="$IMG_URL + '/imgs/order/order_wallet_pay.png'" mode="">
|
||||
</image>
|
||||
<text>余额支付</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
¥{{orderDetail.user_money}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="div">
|
||||
<view class="left">
|
||||
<image class="pay-img" :src="$IMG_URL + '/imgs/order/order_wx_pay.png'" mode=""></image>
|
||||
<text>微信支付</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
¥{{orderDetail.group_fee}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @tap="confirmPay" class="pay-btn">
|
||||
<!-- <image class="pay-img" :src="$IMG_URL + '/imgs/order/group-pay.png'" mode=""></image> -->
|
||||
<text>确认支付 ¥{{ orderDetail.group_fee}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 接收商品订单orderType:goods,充值订单orderType:recharge
|
||||
*/
|
||||
import Pay from '@/shopro/pay';
|
||||
import {
|
||||
mapMutations,
|
||||
mapActions,
|
||||
mapState,
|
||||
mapGetters
|
||||
} from 'vuex';
|
||||
let timer;
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
showGrpupDialog: false, // 组合支付弹窗
|
||||
payType: '', // 支付方式
|
||||
isGroupPay: false,
|
||||
isCountDown: true, // 是否显示订单倒计时。
|
||||
orderDetail: {},
|
||||
timeText: '', // 倒计时文本
|
||||
platform: this.$platform.get(),
|
||||
appPlatfrom: '',
|
||||
orderType: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['initPayment', 'initRecharge']),
|
||||
paymentList() {
|
||||
let list = []
|
||||
switch (this.orderType) {
|
||||
case 'goods':
|
||||
list = this.initPayment
|
||||
break;
|
||||
case 'recharge':
|
||||
list = this.initPayment?.length && this.initPayment.filter(item => {
|
||||
if (this.initRecharge.methods.includes(item)) return item
|
||||
})
|
||||
break;
|
||||
default:
|
||||
list = this.initPayment
|
||||
break;
|
||||
}
|
||||
console.log(list);
|
||||
this.payType = list?.[0];
|
||||
return list
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.orderDetail.id && this.countDown();
|
||||
},
|
||||
onLoad() {
|
||||
this.orderType = this.$Route.query.orderType
|
||||
if (this.$platform.get() === 'wxOfficialAccount' && this.$platform.device() === 'ios' && this.$platform
|
||||
.entry() !== location.href) location.reload();
|
||||
// 获取订单详情
|
||||
this.getOrderDetail()
|
||||
},
|
||||
onHide() {
|
||||
clearInterval(timer);
|
||||
timer = null;
|
||||
},
|
||||
methods: {
|
||||
// 关闭组合支付弹窗
|
||||
handleCloseGroupDialog() {
|
||||
this.showGrpupDialog = false;
|
||||
this.isGroupPay = false;
|
||||
},
|
||||
// 获取订单详情
|
||||
getOrderDetail() {
|
||||
switch (this.$Route.query.orderType) {
|
||||
case 'goods':
|
||||
this.getGoodsOrderDetail()
|
||||
break;
|
||||
case 'recharge':
|
||||
this.getRechargeOrderDetail()
|
||||
break;
|
||||
default:
|
||||
this.getGoodsOrderDetail()
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 倒计时
|
||||
countDown() {
|
||||
let that = this;
|
||||
let t = parseInt(that.orderDetail.ext_arr.expired_time * 1000) - parseInt(new Date().getTime());
|
||||
t = t / 1000;
|
||||
timer = setInterval(() => {
|
||||
if (t > 0) {
|
||||
let time = that.$tools.format(t);
|
||||
that.timeText = `支付剩余时间 ${time.m}:${time.s}`;
|
||||
t--;
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
that.timeText = '订单已过期!';
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
// 发起支付
|
||||
confirmPay() {
|
||||
let that = this;
|
||||
let pay = null;
|
||||
let userMoney = parseFloat(that.orderDetail.user_money);
|
||||
let totalFee = parseFloat(that.orderDetail.total_fee);
|
||||
|
||||
if (!that.payType) {
|
||||
this.$u.toast('请选择支付方式');
|
||||
return;
|
||||
}
|
||||
if (userMoney <= 0 && that.payType === 'wallet') {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
confirmColor: '#1677FF',
|
||||
content: `您的余额不足无法支付`,
|
||||
showCancel: false,
|
||||
success: res => {
|
||||
|
||||
}
|
||||
});
|
||||
return false;
|
||||
} else if (that.payType === 'wallet' && userMoney >= totalFee) {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
confirmColor: '#1677FF',
|
||||
content: `是否确认使用余额支付:${that.orderDetail.total_fee || '0.00'}元?`,
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
pay = new Pay(that.payType, that.orderDetail, that.$Route.query.orderType);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (that.payType === 'wallet' && userMoney < totalFee && that.isGroupPay == false && userMoney > 0) {
|
||||
// 组合支付
|
||||
that.showGrpupDialog = true;
|
||||
that.isGroupPay = true;
|
||||
} else {
|
||||
pay = new Pay(that.isGroupPay ? 'group' : that.payType, that.orderDetail, that.$Route.query.orderType);
|
||||
}
|
||||
},
|
||||
|
||||
// 支付商品订单信息
|
||||
getGoodsOrderDetail() {
|
||||
let that = this;
|
||||
that.$http('order.detail', {
|
||||
id: that.$Route.query.orderId
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.orderDetail = res.data;
|
||||
if (res.data.ext_arr !== null) {
|
||||
that.countDown();
|
||||
} else {
|
||||
that.isCountDown = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 充值订单信息
|
||||
getRechargeOrderDetail() {
|
||||
let that = this;
|
||||
that.$http('money.rechargeDetail', {
|
||||
id: that.$Route.query.orderId
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.orderDetail = res.data;
|
||||
if (res.data.ext_arr !== null) {
|
||||
that.countDown();
|
||||
} else {
|
||||
that.isCountDown = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.group-box {
|
||||
min-height: 620rpx;
|
||||
margin: 120rpx 40rpx 40rpx 40rpx;
|
||||
|
||||
.content {
|
||||
margin-top: 50rpx;
|
||||
|
||||
.pay-btn {
|
||||
margin-top: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
image {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.price-box {
|
||||
margin-top: 30rpx;
|
||||
border-bottom: 2rpx solid $brand-border;
|
||||
padding-bottom: 10rpx;
|
||||
|
||||
.div {
|
||||
margin-bottom: 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
text {
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.pay-img {
|
||||
margin-right: 10rpx;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
font-size: 30rpx;
|
||||
color: #585454;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
margin-top: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.name {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.icon {
|
||||
image {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.account {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 2rpx solid $brand-border;
|
||||
padding-bottom: 30rpx;
|
||||
|
||||
.name {
|
||||
font-size: 30rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.mobile {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.price {
|
||||
text-align: center;
|
||||
color: #e1212b;
|
||||
font-size: 60rpx;
|
||||
font-weight: bold;
|
||||
|
||||
text {
|
||||
font-size: 32rpx;
|
||||
margin-right: 5rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.money-box {
|
||||
background: #fff;
|
||||
height: 250rpx;
|
||||
margin-bottom: 20rpx;
|
||||
padding-top: 30rpx;
|
||||
|
||||
.time {
|
||||
font-size: 28rpx;
|
||||
color: #c4c4c4;
|
||||
}
|
||||
|
||||
.money {
|
||||
color: #e1212b;
|
||||
font-size: 60rpx;
|
||||
margin-top: 60rpx;
|
||||
|
||||
&::before {
|
||||
content: '¥';
|
||||
font-size: 46rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pay-box {
|
||||
.pay-item {
|
||||
height: 90rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 26rpx;
|
||||
background: #fff;
|
||||
width: 750rpx;
|
||||
border-bottom: 1rpx solid #eeeeee;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.pay-img {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 25rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pay-btn {
|
||||
width: 690rpx;
|
||||
line-height: 80rpx;
|
||||
background: linear-gradient(90deg, rgba(240, 199, 133, 1), rgba(246, 214, 157, 1));
|
||||
border-radius: 40rpx;
|
||||
color: rgba(#fff, 0.9);
|
||||
margin: 100rpx auto 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,292 @@
|
||||
<!-- 支付结果页 -->
|
||||
<template>
|
||||
<view class="success-page">
|
||||
|
||||
<!-- 商品结果页 -->
|
||||
<template v-if="orderType==='goods'">
|
||||
<view class="success-box u-flex-col u-row-center u-col-center">
|
||||
<image class="pay-img" :src="payImg[payState]" mode=""></image>
|
||||
<text class="notice">{{ payText[payState] }}</text>
|
||||
<text class="pay-money"
|
||||
v-if="payState === 'success' && orderDetail.total_fee">¥{{ orderDetail.total_fee }}</text>
|
||||
<view class="btn-box u-flex u-row-between">
|
||||
<block
|
||||
v-if="payState === 'success' && orderDetail.activity_type === 'groupon' && orderDetail.ext_arr.buy_type === 'groupon'">
|
||||
<button class="u-reset-button base-btn" v-if="orderDetail.ext_arr.groupon_id > 0"
|
||||
@tap="$Router.replace({ path: '/pages/activity/groupon/detail', query: { id: orderDetail.ext_arr.groupon_id } })">
|
||||
拼团详情
|
||||
</button>
|
||||
<button class="u-reset-button base-btn" v-else
|
||||
@tap="$Router.push('/pages/activity/groupon/my-groupon')">我的拼团</button>
|
||||
</block>
|
||||
|
||||
<button class="u-reset-button base-btn" v-else
|
||||
@tap="$Router.pushTab('/pages/index/index')">返回首页</button>
|
||||
|
||||
|
||||
<button class="u-reset-button base-btn u-m-l-10 u-m-r-10"
|
||||
@tap="$Router.replace({ path: '/pages/order/detail', query: { id: orderDetail.id } })">查看订单</button>
|
||||
<button class="u-reset-button again-pay " v-show="payState === 'fail'" @tap="onPay">重新支付</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- modal -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<u-modal v-if="payState === 'success'" ref="uModal" v-model="showModal" :show-cancel-button="true"
|
||||
confirm-color="#F0E6C8" cancel-color="#666666" @confirm="onConfirm" confirm-text="订阅消息" cancel-text="取消"
|
||||
content="是否订阅消息,追踪订单信息?" title="提示"></u-modal>
|
||||
<!-- #endif -->
|
||||
</template>
|
||||
|
||||
<template v-if="orderType==='recharge'">
|
||||
<view class="success-box u-flex-col u-row-center u-col-center">
|
||||
<image class="pay-img" :src="payImg[payState]" mode=""></image>
|
||||
<text class="notice">{{ payText[payState] }}</text>
|
||||
<text class="pay-money"
|
||||
v-if="payState === 'success' && orderDetail.total_fee">¥{{ orderDetail.total_fee }}</text>
|
||||
<view class="btn-box u-flex u-row-between">
|
||||
|
||||
<button class="u-reset-button base-btn" @tap="$Router.pushTab('/pages/index/index')">返回首页</button>
|
||||
<button v-if="payState === 'fail'" class="u-reset-button again-pay" @tap="onPay">重新支付</button>
|
||||
<button v-else class="u-reset-button base-btn"
|
||||
@tap="$Router.pushTab('/pages/index/user')">个人中心</button>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pay from '@/shopro/pay';
|
||||
import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
|
||||
let payTimer = null;
|
||||
const payCount = 5;
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
showModal: false,
|
||||
messageType: '',
|
||||
templateIds: [],
|
||||
wxOpenTags: '',
|
||||
orderDetail: {}, //订单详情
|
||||
orderType: '', //订单类型
|
||||
payText: {
|
||||
fail: '支付失败',
|
||||
success: '支付成功',
|
||||
paying: '查询中...'
|
||||
},
|
||||
payImg: {
|
||||
fail: this.$IMG_URL + '/imgs/order/order_pay_fail.gif',
|
||||
success: this.$IMG_URL + '/imgs/order/order_pay_success.gif',
|
||||
paying: this.$IMG_URL + '/imgs/order/order_paying.gif'
|
||||
},
|
||||
payState: '' //支付状态
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['subscribeMessageIdsMap'])
|
||||
},
|
||||
onLoad() {
|
||||
this.payState = this.$Route.query.payState ? this.$Route.query.payState : 'paying';
|
||||
this.orderType = this.$Route.query.orderType
|
||||
this.$Route.query.orderId && this.getOrderDetail();
|
||||
switch (this.payState) {
|
||||
case 'success':
|
||||
this.getCartList();
|
||||
break;
|
||||
case 'fail':
|
||||
break;
|
||||
case 'paying':
|
||||
this.checkTimer();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
onHide() {
|
||||
clearInterval(payTimer);
|
||||
payTimer = null;
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['getCartList']),
|
||||
|
||||
// 订阅消息
|
||||
onConfirm() {
|
||||
// #ifdef MP-WEIXIN
|
||||
this.templateIds.length && this.$store.commit('subscribeMessage', this.messageType);
|
||||
// #endif
|
||||
},
|
||||
|
||||
// 获取订单详情
|
||||
getOrderDetail() {
|
||||
switch (this.$Route.query.orderType) {
|
||||
case 'goods':
|
||||
this.getGoodsOrderDetail()
|
||||
break;
|
||||
case 'recharge':
|
||||
this.getRechargeOrderDetail()
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
// 支付订单信息
|
||||
getGoodsOrderDetail() {
|
||||
let that = this;
|
||||
that.$http('order.detail', {
|
||||
id: that.$Route.query.orderId
|
||||
}).then(async res => {
|
||||
if (res.code === 1) {
|
||||
that.orderDetail = res.data;
|
||||
if (res.data.status > 0) {
|
||||
this.messageType = this.orderDetail.activity_type == 'groupon' ? 'grouponResult' :
|
||||
'result';
|
||||
// #ifdef MP-WEIXIN
|
||||
this.templateIds = this.subscribeMessageIdsMap[this.messageType];
|
||||
this.showModal = this.templateIds.length;
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 充值订单信息
|
||||
getRechargeOrderDetail() {
|
||||
let that = this;
|
||||
that.$http('money.rechargeDetail', {
|
||||
id: that.$Route.query.orderId
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.orderDetail = res.data;
|
||||
if (res.data.status > 0) {
|
||||
this.messageType = 'result';
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 支付倒计时
|
||||
checkTimer() {
|
||||
let that = this;
|
||||
let count = 0;
|
||||
that.payState = 'paying';
|
||||
payTimer = setInterval(() => {
|
||||
count++;
|
||||
if (count < payCount) {
|
||||
that.checkPay();
|
||||
} else {
|
||||
clearInterval(payTimer);
|
||||
that.payState = 'fail';
|
||||
}
|
||||
}, 800);
|
||||
},
|
||||
|
||||
// 检测支付
|
||||
async checkPay() {
|
||||
let that = this;
|
||||
let paiMap = {
|
||||
'goods': 'order.detail',
|
||||
'recharge': 'money.rechargeDetail'
|
||||
}
|
||||
if (that.orderType === 'goods') {
|
||||
await that.$http('money.syncHuifu', {
|
||||
order_id: that.$Route.query.orderId
|
||||
}, '', false).catch(() => {});
|
||||
}
|
||||
let res = await that.$http(
|
||||
paiMap[that.orderType], {
|
||||
id: that.$Route.query.orderId
|
||||
},
|
||||
false
|
||||
);
|
||||
if (res.code === 1 && res.data.status > 0) {
|
||||
that.payState = 'success';
|
||||
clearInterval(payTimer);
|
||||
}
|
||||
},
|
||||
|
||||
// 重新支付
|
||||
onPay() {
|
||||
let that = this;
|
||||
let pay = new Pay(that.$Route.query.type, that.orderDetail, that.orderType);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scopeds>
|
||||
.success-box {
|
||||
background: #fff;
|
||||
width: 750rpx;
|
||||
padding: 40rpx 0;
|
||||
|
||||
.pay-img {
|
||||
width: 130rpx;
|
||||
height: 130rpx;
|
||||
}
|
||||
|
||||
.notice {
|
||||
font-size: 30rpx;
|
||||
|
||||
font-weight: bold;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
line-height: 30rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.pay-money {
|
||||
font-size: 36rpx;
|
||||
color: #ff3000;
|
||||
font-weight: 600;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.btn-box {
|
||||
margin-top: 30rpx;
|
||||
width: 660rpx;
|
||||
|
||||
.base-btn {
|
||||
width: 320rpx;
|
||||
line-height: 70rpx;
|
||||
background: rgba(255, 255, 255, 1);
|
||||
border: 1rpx solid rgba(223, 223, 223, 0.5);
|
||||
border-radius: 35rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(153, 153, 153, 1);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.again-pay {
|
||||
width: 320rpx;
|
||||
line-height: 70rpx;
|
||||
background: linear-gradient(90deg, #1677FF, #4096FF);
|
||||
box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
|
||||
border-radius: 35rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hot-box {
|
||||
background: #fff;
|
||||
padding: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.hot-title {
|
||||
font-size: 30rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
height: 80rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
在新工单中引用
屏蔽一个用户