Compare commits

..

No commits in common. "1c024d619ddbf55d6d225fcafa4ae85ed84342ff" and "747ee9226fbc81c51b09fbddd42762c6a8bf96fa" have entirely different histories.

9 changed files with 91 additions and 420 deletions

25
App.vue
View File

@ -55,11 +55,11 @@
float: right; float: right;
} }
.pr { .pr{
position: relative; position: relative;
} }
.pa { .pa{
position: absolute; position: absolute;
} }
@ -72,19 +72,16 @@
} }
.animation { .animation {
transition: all 0.2s ease; transition: all 0.2s ease;
} }
// //
.extra-space { .extra-space {
height: 156rpx; height: 156rpx;
} }
// //
.extra-space1 { .extra-space1 {
height: 400rpx; height: 400rpx;
} }
// //
.extra-space2 { .extra-space2 {
height: 200rpx; height: 200rpx;
@ -94,7 +91,6 @@
weight: 40rpx; weight: 40rpx;
height: 40rpx; height: 40rpx;
} }
// //
.numberBut { .numberBut {
width: 130rpx; width: 130rpx;
@ -130,10 +126,6 @@
background-color: #888; background-color: #888;
} }
.bg-mb {
background-color: $uni-text-color-disable;
}
.bg-b { .bg-b {
background-color: #383838; background-color: #383838;
} }
@ -307,8 +299,7 @@
.fb { .fb {
font-weight: bold; font-weight: bold;
} }
.fn{
.fn {
font-weight: normal; font-weight: normal;
} }
@ -320,10 +311,6 @@
line-height: 1.2em; line-height: 1.2em;
} }
.fz20 {
font-size: 20rpx;
}
.fz24 { .fz24 {
font-size: 24rpx; font-size: 24rpx;
} }
@ -349,11 +336,11 @@
} }
.fcb { .fcb {
color: $uni-text-color-disable; color: $uni-text-color-disable
} }
.fcm { .fcm {
color: $uni-color-error; color: $uni-color-error
} }
.z-top { .z-top {

View File

@ -6,7 +6,7 @@
</view> </view>
<view class="fcb fz28 flex mac"> <view class="fcb fz28 flex mac">
<view class="fz28" :class="conClass">{{cellCon}}</view> <view class="fz28" :class="conClass">{{cellCon}}</view>
<u-icon name="arrow-right" size="28rpx" v-if='isRightIcon'></u-icon> <u-icon name="arrow-right" size="28rpx"></u-icon>
</view> </view>
</view> </view>
</template> </template>
@ -36,11 +36,6 @@
required: { required: {
type: Boolean, type: Boolean,
default: false default: false
},
//
isRightIcon: {
type: Boolean,
default: true
} }
}, },
methods: { methods: {

View File

@ -1,82 +0,0 @@
<template>
<view class="m-l-24 m-r-24 m-t-24 p-24 bg-w rad8 boxshadow">
<view class="m-b-24 borderBDas flex msb mub">
<view class="fb fz36 l-h-18">{{tit}}</view>
<view class="fcb fz24 l-h-12">订单号{{order.order_sn}}</view>
</view>
<view class="m-t-24 flex msb">
<view class="flex3 ofh">
<scroll-view class="scroll-view_H" scroll-x="true">
<view class="scroll-view-item_H m-r-12" v-for="(ps,index) in order.product_snapshot" :key="index">
<u--image :src="ps.spu_photo[0]" width="147rpx" height="110rpx" radius="4rpx" />
</view>
</scroll-view>
</view>
<view class="flex1 fcb fz24 flex mr md">
{{order.total_num}}
</view>
</view>
<view class="fz28 borderBDas p-b-12 p-t-12" v-if="order!==null">
<view class="flex msb l-h-18">
<view>商品小计</view>
<view>¥{{order.total_price | formatPrice}}</view>
</view>
<view class="flex msb l-h-18">
<view>外送费</view>
<view>¥{{order.transport_price | formatPrice}}</view>
</view>
<view class="flex msb l-h-18">
<view>打包服务费</view>
<view>¥{{order.pack_price | formatPrice}}</view>
</view>
</view>
<view class="flex mr mac l-h-18 m-t-24">
<view class="fcb fz24">合计</view>
<view class="m-l-12 fz36 fb" v-if="fullPrice!==null">¥{{fullPrice | formatPrice}}</view>
</view>
</view>
</template>
<script>
import {
formatPrice
} from '@/utils/index.js'
export default {
name: "orderCon",
data() {
return {
}
},
props: {
tit: {
type: String
},
order: {
type: Object
}
},
filters: {
formatPrice, //
},
methods: {
formatPrice, //
},
computed: {
//
fullPrice() {
if (this.order) {
return this.formatPrice(Number(this.order.transport_price) + Number(this.order.pack_price) + Number(
this.order.total_price))
} else {
return 0
}
}
}
}
</script>
<style>
</style>

View File

@ -23,8 +23,7 @@
</view> </view>
</view> </view>
<view class="m-t-24 flex mr"> <view class="m-t-24 flex mr">
<navigator v-if="showPayButton" :url="`/pages/shop/pay?order_sn=${order.order_sn}&fullPrice=${fullPrice}`" <navigator v-if="showPayButton" :url="`/pages/shop/pay?order_sn=${order.order_sn}&fullPrice=${fullPrice}`" hover-class="navigator-hover">
hover-class="navigator-hover">
<view class="nullBut bg-m fci rad8 fz28 flex mac mc"> <view class="nullBut bg-m fci rad8 fz28 flex mac mc">
立即支付 立即支付
</view> </view>
@ -32,18 +31,14 @@
<view v-if="showPickupNumber" class="numberBut bg-m fci rad8 fz28 fb flex mac mc m-l-24"> <view v-if="showPickupNumber" class="numberBut bg-m fci rad8 fz28 fb flex mac mc m-l-24">
{{ foodSn }} {{ foodSn }}
</view> </view>
<navigator v-if="showAfterSaleButton" class="m-l-24" :url="`/pages/order/refund?order_sn=${order.order_sn}`" <navigator v-if="showAfterSaleButton" class="m-l-24" :url="`/pages/order/refund?order_sn=${order.order_sn}`" hover-class="navigator-hover">
hover-class="navigator-hover">
<view class="nullBut border fcb rad8 fz28 flex mac mc"> <view class="nullBut border fcb rad8 fz28 flex mac mc">
申请售后 申请售后
</view> </view>
</navigator> </navigator>
<navigator v-if="showRefundDetailsButton" class="m-l-24" <view v-if="showRefundDetailsButton" class="nullBut border fcb rad8 fz28 flex mac mc m-l-24">
:url="`/pages/order/refProcess?order_sn=${order.order_sn}`" hover-class="navigator-hover"> 退款详情
<view class="nullBut border fcb rad8 fz28 flex mac mc"> </view>
退款详情
</view>
</navigator>
</view> </view>
</view> </view>
</template> </template>
@ -72,9 +67,8 @@
}, },
computed: { computed: {
// //
fullPrice() { fullPrice(){
return this.formatPrice(Number(this.order.transport_price) + Number(this.order.pack_price) + Number(this return this.formatPrice(Number(this.order.transport_price) + Number(this.order.pack_price) + Number(this.order.total_price))
.order.total_price))
}, },
// "" // ""
showPayButton() { showPayButton() {
@ -100,37 +94,36 @@
if (this.order.main_status === '已付款' && this.order.refund_status === '未申请') { if (this.order.main_status === '已付款' && this.order.refund_status === '未申请') {
return this.order.shipment_status; return this.order.shipment_status;
} }
// 退退 switch (this.order.refund_status) {
if (this.order.main_status === '已退款') { case '申请中':
return '已退款'; return '申请中';
} case '已同意':
// 退退
if (this.order.main_status === '已付款') {
if (this.order.refund_status === '已同意') {
return '商家同意退款'; return '商家同意退款';
} case '主动退':
// 退退退
if (this.order.refund_status === '主动退') {
return '商家退单'; return '商家退单';
} case '拒绝退':
return '商家拒绝退款';
default:
return '';
} }
},
// 退 // 退
if (this.order.refund_status === '申请中') { refundStatusDisplay() {
return '申请中'; switch (this.order.refund_status) {
case '申请中':
return '申请中';
case '已同意':
return '商家同意退款';
case '主动退':
return '商家退单';
case '拒绝退':
return '商家拒绝退款';
default:
return '';
} }
if (this.order.refund_status === '拒绝退') {
return '商家拒绝退款';
}
//
return '';
}, },
}, },
methods: { methods:{
formatPrice // formatPrice //
}, },
props: { props: {

View File

@ -1,138 +0,0 @@
<template>
<view>
<!-- 时间线 -->
<view class="processBox">
<!-- 背景 线 -->
<view class="flex mac processRc h0" :style="{ width: `calc(100% - ${100 / processList.length}%)` }">
<view v-for='index in processList.length-1' :key="index" class="flex1 processLine"
:class="processList[index+1] ? 'bg-m' : 'bg-mb'"></view>
</view>
<!-- 背景 -->
<view class="flex mac msb processRc h36" :style="{ width: `calc(100% - ${100 / processList.length}%)` }">
<view v-for="(item, index) in processList" :key="index" class="rad-c"
:class="[processList[index] ? 'bg-m' : 'bg-mb', index === lastNonEmptyIndex ? 'wh40' : 'wh20']">
<u-icon name="checkbox-mark" size="40rpx" color="#fff" v-if="lastNonEmptyIndex ===index"></u-icon>
</view>
</view>
</view>
<!-- 时间线描述 -->
<view class="flex m-t-12">
<template v-if='processType ==="申请中" || processType ==="已同意"'>
<view class="flex1 flex mc mac column" :class="lastNonEmptyIndex===0?'':'fcb'">
<view class="fz28">申请退款</view>
<view class="fz20">{{ formatTime(processList[0]) }}</view>
</view>
<view class="flex1 flex mc mac column" :class="lastNonEmptyIndex===1?'':'fcb'">
<view class="fz28">{{ processList[1]?'卖家已同意':'等待卖家处理' }}</view>
<view class="fz20">{{ processList[1]?formatTime(processList[1]) : '&nbsp;' }}
</view>
</view>
<view class="flex1 flex mc mac column" :class="lastNonEmptyIndex===2?'':'fcb'">
<view class="fz28">退款成功</view>
<view class="fz20">{{ processList[2]?formatTime(processList[2]) : '&nbsp;' }}
</view>
</view>
</template>
<template v-if='processType ==="主动退"'>
<view class="flex1 flex mc mac column" :class="lastNonEmptyIndex===0?'':'fcb'">
<view class="fz28">卖家取消订单</view>
<view class="fz20">{{ formatTime(processList[0]) }}</view>
</view>
<view class="flex1 flex mc mac column" :class="lastNonEmptyIndex===1?'':'fcb'">
<view class="fz28">已退款</view>
<view class="fz20">{{ processList[1]?formatTime(processList[1]) : '&nbsp;' }}
</view>
</view>
</template>
<template v-if='processType ==="拒绝退"'>
<view class="flex1 flex mc mac column" :class="lastNonEmptyIndex===0?'':'fcb'">
<view class="fz28">申请退款</view>
<view class="fz20">{{ formatTime(processList[0]) }}</view>
</view>
<view class="flex1 flex mc mac column" :class="lastNonEmptyIndex===1?'':'fcb'">
<view class="fz28">卖家拒绝退款</view>
<view class="fz20">{{ processList[1]?formatTime(processList[1]) : '&nbsp;' }}
</view>
</view>
</template>
</view>
</view>
</template>
<script>
import {
parseTime,
formatPrice
} from '@/utils/index.js'
export default {
name: "process",
data() {
return {
}
},
created() {},
props: {
processList: {
type: Array,
deep: true
},
processType: {
type: String
}
},
computed: {
//
lastNonEmptyIndex() {
//
for (let i = this.processList.length - 1; i >= 0; i--) {
//
if (this.processList[i] !== '' && this.processList[i] !== null) {
return i;
}
}
return -1; // -1
}
},
methods: {
formatTime(time) {
return parseTime(time, '{m}-{d} {h}:{i}')
}
}
}
</script>
<style lang="scss" scoped>
.processBox {
height: 60rpx;
}
.processLine {
height: 2rpx;
}
.processRc {
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.h0 {
height: 0rpx;
}
.h30 {
height: 30rpx;
}
.wh20 {
width: 20rpx;
height: 20rpx;
}
.wh40 {
width: 40rpx;
height: 40rpx;
}
</style>

View File

@ -2,7 +2,8 @@
"easycom": { "easycom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}, },
"pages": [{ "pages": [
{
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
@ -45,26 +46,21 @@
} }
}, },
{ {
"path": "pages/main/login", "path" : "pages/main/login",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/order/index", "path" : "pages/order/index",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/order/refund", "path" : "pages/order/refund",
"style": { "style" :
"navigationStyle": "custom" {
}
},
{
"path": "pages/order/refProcess",
"style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
} }

View File

@ -1,118 +0,0 @@
<template>
<view>
<!-- topbar -->
<u-navbar title="退款详情" bgColor="#d43030" :titleStyle="{ color: '#FFF'}" :autoBack="true" placeholder>
<view class="u-nav-slot" slot="left">
<u-icon name="arrow-left" color="#fff" size="19"></u-icon>
</view>
</u-navbar>
<!-- 进度box -->
<view class="m-l-24 m-r-24 m-t-24 p-24 bg-w rad8 boxshadow">
<view class="m-b-24 borderBDas flex msb mub">
<view class="fb fz36 l-h-18">{{ order.refund_status !== "主动退"?"买家申请":"卖家取消订单" }}</view>
</view>
<process v-if="processList" :processList="processList" :processType='processType'></process>
</view>
<!-- 退款金额cell -->
<cell :cellTit='order.refund_status ==="主动退" ? "退款金额":"申请退款金额"' conClass="fcm" :cellCon="refundPrice"
:isRightIcon='false'></cell>
<!-- 退款说明cell -->
<cell cellTit="退款说明" :cellCon="refundRemark | truncate(8)" :isRightIcon='false'>
</cell>
<!-- 订单详情 -->
<orderCon tit='订单详情' :order='order'></orderCon>
<!-- 按钮 -->
<view class="m-l-24 m-r-24 m-t-24 flex mr">
<view class="nullBut border fcb rad8 fz28 flex mac mc" @click="callPhone(shopCon.tel)">
联系客服
</view>
</view>
</view>
</template>
<script>
import {
formatPrice,
truncate,
callPhone
} from '@/utils/index.js'
export default {
data() {
return {
order_sn: '', //]
}
},
onLoad(options) {
this.order_sn = options.order_sn //
},
methods: {
callPhone
},
filters: {
formatPrice, //
truncate
},
computed: {
//退
refundRemark() {
if (this.order) {
return this.order.refund_remark
} else {
return null
}
},
//退 ps:退 退 退
refundPrice() {
if (this.order) {
if (this.order.refund_price) {
return '¥' + String(this.order.refund_price)
} else {
return '¥' + String(this.order.apply_price)
}
} else {
return null
}
},
//
order() {
if (this.order_sn) {
return this.$store.state.orderList.find(item => item.order_sn === this.order_sn)
} else {
return null
}
},
//退线
processList() {
if (this.order) {
if (this.order.refund_status === '主动退') {
return [this.order.refundagree_time, this.order.refunded_time]
} else if (this.order.refund_status === '申请中' || this.order.refund_status === '已同意') {
return [this.order.refundapply_time, this.order.refundagree_time, this.order.refunded_time]
} else if (this.order.refund_status === '拒绝退') {
return [this.order.refundapply_time, this.order.rejected_time]
} else {
return null
}
} else {
return null
}
},
//线
processType() {
if (this.order) {
return this.order.refund_status
} else {
return null
}
},
//
shopCon() {
return this.$store.state.shopCon
},
},
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -7,7 +7,43 @@
</view> </view>
</u-navbar> </u-navbar>
<!-- 申请订单 --> <!-- 申请订单 -->
<orderCon tit='申请订单' :order='order'></orderCon> <view class="m-l-24 m-r-24 m-t-24 p-24 bg-w rad8 boxshadow">
<view class="m-b-24 borderBDas flex msb mub">
<view class="fb fz36 l-h-18">申请订单</view>
<view class="fcb fz24 l-h-12">订单号{{order_sn}}</view>
</view>
<view class="m-t-24 flex msb">
<view class="flex3 ofh">
<scroll-view class="scroll-view_H" scroll-x="true">
<view class="scroll-view-item_H m-r-12" v-for="(ps,index) in order.product_snapshot"
:key="index">
<u--image :src="ps.spu_photo[0]" width="147rpx" height="110rpx" radius="4rpx" />
</view>
</scroll-view>
</view>
<view class="flex1 fcb fz24 flex mr md">
{{order.total_num}}
</view>
</view>
<view class="fz28 borderBDas p-b-12 p-t-12" v-if="order!==null">
<view class="flex msb l-h-18">
<view>商品小计</view>
<view>¥{{order.total_price | formatPrice}}</view>
</view>
<view class="flex msb l-h-18">
<view>外送费</view>
<view>¥{{order.transport_price | formatPrice}}</view>
</view>
<view class="flex msb l-h-18">
<view>打包服务费</view>
<view>¥{{order.pack_price | formatPrice}}</view>
</view>
</view>
<view class="flex mr mac l-h-18 m-t-24">
<view class="fcb fz24">合计</view>
<view class="m-l-12 fz36 fb" v-if="fullPrice!==null">¥{{fullPrice | formatPrice}}</view>
</view>
</view>
<!-- 退款金额cell --> <!-- 退款金额cell -->
<cell cellTit="申请退款金额" :required="true" @click="handledrRefund_priceShow" conClass="fcm" <cell cellTit="申请退款金额" :required="true" @click="handledrRefund_priceShow" conClass="fcm"
:cellCon="requestRefund_price?'¥'+ requestRefund_price:''"></cell> :cellCon="requestRefund_price?'¥'+ requestRefund_price:''"></cell>
@ -88,6 +124,7 @@
<script> <script>
import { import {
parseTime,
formatPrice, formatPrice,
truncate, truncate,
callPhone callPhone
@ -206,12 +243,13 @@
} }
}, },
filters: { filters: {
parseTime, //
formatPrice, // formatPrice, //
truncate truncate
}, },
watch: {}, watch: {},
computed: { computed: {
// //
order() { order() {
if (this.order_sn) { if (this.order_sn) {
return this.$store.state.orderList.find(item => item.order_sn === this.order_sn) return this.$store.state.orderList.find(item => item.order_sn === this.order_sn)

View File

@ -9,8 +9,8 @@ import store from '../store/index.js'
* @returns {string} 截取完的内容最后加省略号 * @returns {string} 截取完的内容最后加省略号
*/ */
export function truncate(value, length = 5) { export function truncate(value, length = 5) {
if (!value) return '' if (!value) return '';
return value.length > length ? value.slice(0, length) + '...' : value return value.length > length ? value.slice(0, length) + '...' : value;
} }
/** /**
* Parse the time to string * Parse the time to string