| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422 |
- <template>
- <view>
- <view class="goods-section">
- <view class="g-item" style="padding-top: 10px;">
- <view class="right">
- <view class="price-box">
- <text class="font12">¥</text>
- <text class="price">{{ ((state.detail.amount) / 100).toFixed(2) }}</text>
- <text class="font12">元</text>
- </view>
- <block class="price-dsc">洗车消费</block>
- </view>
- </view>
- </view>
- <view class="yt-list">
- <view class="yt-list-cell b-b">
- <text class="cell-tit clamp">订单编号</text>
- <text class="cell-tip copy" @click="handleCopy">{{ state.detail.orderId }}
- <uv-icon name="info-circle"></uv-icon>
- </text>
- </view>
- <view class="yt-list-cell b-b">
- <text class="cell-tit clamp">总消费金额</text>
- <text class="cell-tip red">-¥{{ ((state.detail.amount) / 100).toFixed(2) }}元</text>
- </view>
- <view class="yt-list-cell b-b">
- <text class="cell-tit clamp">充值款支付金额</text>
- <text class="cell-tip red">-¥{{ ((state.detail.rechargePayment) / 100).toFixed(2) }}元</text>
- </view>
- <view class="yt-list-cell b-b">
- <text class="cell-tit clamp">赠款支付金额</text>
- <text class="cell-tip red">-¥{{ ((state.detail.grantsPayment) / 100).toFixed(2) }}元</text>
- </view>
- <view class="yt-list-cell b-b">
- <text class="cell-tit clamp">优惠金额</text>
- <text class="cell-tip red">-¥{{ ((state.detail.discountMoney) / 100).toFixed(2) }}元</text>
- </view>
- <view class="yt-list-cell b-b">
- <text class="cell-tit clamp">订单状态</text>
- <text class="cell-tip" :class="state.detail.orderStatus==0?'primary':(state.detail.orderStatus==1?'success':'error')">
- {{ fmtDictName('Order.status', state.detail.orderStatus) }}
- </text>
- </view>
- <view class="yt-list-cell b-b">
- <text class="cell-tit clamp">支付状态</text>
- <text class="cell-tip" :class="state.detail.payStatus==0?'primary':(state.detail.payStatus==1?'success':'error')">
- {{ fmtDictName('Order.pay', state.detail.payStatus) }}
- </text>
- </view>
- <view class="yt-list-cell b-b">
- <text class="cell-tit clamp">开始时间</text>
- <text class="cell-tip">{{ fmtDateTime(state.detail.startTime) }}</text>
- </view>
- <view class="yt-list-cell b-b">
- <text class="cell-tit clamp">结束时间</text>
- <text class="cell-tip">{{ fmtDateTime(state.detail.endTime) }}</text>
- </view>
- <view class="yt-list-cell desc-cell">
- <text class="cell-tit clamp">备注</text>
- {{ state.detail.remark }}
- </view>
- <!-- <view class="yt-list-cell b-b">
- <text class="cell-tit clamp">交易时间</text>
- <text class="cell-tip">{{ fmtDateTime(state.detail.transactionTime) }}</text>
- </view>-->
- </view>
- <view class="btn">
- <!-- <view class="btn_2" @click="jump_torefund(my_order.order_id)">退款</view>-->
- </view>
- <view class="w100 gap"></view>
- <!-- 金额明细 -->
- <view class="order-item ml5 font14 color-info">费用明细</view>
- <!-- <view class="yt-list">
- <view class="yt-list-cell b-b">
- <text class="cell-tit clamp">订单编号</text>
- <text class="cell-tip copy" @click="handleCopy">{{ state.detail.orderNo }}
- <uv-icon name="info-circle"></uv-icon>
- </text>
- </view>
- </view>-->
- <view class="order-item_header">
- <view class="order-item_header_left">
- <text class="order-item_header_left_title">项目</text>
- <text class="order-item_header_left_price">时长</text>
- <text class="order-item_header_left_num">单价</text>
- <text class="order-item_header_left_total">小计</text>
- </view>
- </view>
- <view class="order-item_body">
- <view class="order-item_body_item" v-for="item in state.detail.orderItems" :key="item.id">
- <view class="order-item_body_item_left">
- <text class="order-item_body_item_left_name clamp">{{ item.name }}</text>
- <text class="order-item_body_item_left_num">{{ item.seconds }}</text>
- <text class="order-item_body_item_left_price">{{ item.price }}</text>
- <text class="order-item_body_item_left_total">¥{{ item.amount }}元</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script setup lang="ts">
- import {onHide, onShow, onLoad} from "@dcloudio/uni-app";
- import {reactive} from "vue";
- import {get} from "@/utils/https";
- import {fmtDictName, fmtDateTime, fmtDuration, fmtMoney} from "@/utils/common";
- const initState = () => ({
- detail: {
- orderItems:[] as any[]
- } as any
- })
- const state = reactive(initState())
- onLoad((options: any) => {
- console.log("onshow", options)
- let user = getApp<any>().globalData.user;
- if (!user || !user.id) {
- uni.showToast({
- title: '请先登录',
- icon: 'none'
- })
- setTimeout(() => {
- uni.redirectTo({url: '/pages/index/index'})
- }, 200)
- return;
- }
- let {orderNo, id, type} = options;
- get(`/wash-order/detailWashOrder?userId=${user.id}&orderId=${orderNo}`).then((res: any) => {
- state.detail = res;
- state.detail.orderItems = res.detail?.filter((k: any) => k.amount > 0 || k.seconds > 0).map((s: any) => {
- return {
- name: fmtDictName('Order.feeType',s.name),
- seconds: fmtDuration(s.seconds*1000),
- price: fmtMoney(s.price),
- amount: fmtMoney(s.amount),
- }
- })
- console.log(state.detail)
- })
- })
- onHide(() => {
- Object.assign(state, initState());
- })
- const handleCopy = () => {
- if (!state.detail.orderNo) return;
- uni.setClipboardData({
- data: state.detail.orderNo,
- success: function () {
- uni.showToast({
- title: '复制成功',
- icon: 'success',
- })
- }
- })
- }
- </script>
- <style lang="scss" scoped>
- page {
- background: #f8f8f8;
- padding-bottom: 100rpx;
- }
- .copy {
- color: $uni-color-primary !important;
- }
- .goods-section {
- margin-top: 16rpx;
- background: #fff;
- padding-bottom: 1px;
- .g-header {
- display: flex;
- align-items: center;
- height: 84rpx;
- padding: 0 30rpx;
- position: relative;
- }
- .logo {
- display: block;
- width: 50rpx;
- height: 50rpx;
- border-radius: 100px;
- }
- .name {
- font-size: 30rpx;
- color: #606266;
- margin-left: 24rpx;
- }
- .g-item {
- display: flex;
- margin: 20rpx 30rpx;
- image {
- flex-shrink: 0;
- display: block;
- width: 140rpx;
- height: 140rpx;
- border-radius: 4rpx;
- }
- .right {
- flex: 1;
- padding-left: 24rpx;
- overflow: hidden;
- text-align: center;
- }
- .title {
- font-size: 30rpx;
- color: #303133;
- }
- .spec {
- font-size: 26rpx;
- color: #909399;
- }
- .price-box {
- /* display: flex; */
- /* align-items: center; */
- color: #303133;
- padding-top: 10rpx;
- .price {
- margin-bottom: 4rpx;
- font-size: 48rpx;
- }
- .number {
- font-size: 26rpx;
- color: #606266;
- margin-left: 20rpx;
- }
- }
- .price-dsc {
- font-size: 26rpx;
- color: $uni-text-color-grey;
- }
- .step-box {
- position: relative;
- }
- }
- }
- .yt-list {
- margin-top: 16rpx;
- background: #fff;
- }
- .yt-list-cell {
- display: flex;
- align-items: center;
- padding: 10rpx 30rpx 10rpx 40rpx;
- line-height: 50rpx;
- position: relative;
- &.cell-hover {
- background: #fafafa;
- }
- &.b-b:after {
- left: 30rpx;
- }
- .cell-icon {
- height: 32rpx;
- width: 32rpx;
- font-size: 22rpx;
- color: #fff;
- text-align: center;
- line-height: 32rpx;
- background: #f85e52;
- border-radius: 4rpx;
- margin-right: 12rpx;
- &.hb {
- background: #ffaa0e;
- }
- &.lpk {
- background: #3ab54a;
- }
- }
- .cell-more {
- align-self: center;
- font-size: 24rpx;
- color: #909399;
- margin-left: 8rpx;
- margin-right: -10upx;
- }
- .cell-tit {
- flex: 1;
- font-size: 26rpx;
- color: #909399;
- margin-right: 10rpx;
- }
- .cell-tip {
- font-size: 26rpx;
- color: #303133;
- &.disabled {
- color: #909399;
- }
- &.active {
- color: #fa436a;
- }
- &.red {
- color: #fa436a;
- }
- }
- &.desc-cell {
- .cell-tit {
- max-width: 90rpx;
- }
- }
- .desc {
- flex: 1;
- font-size: 28rpx;
- color: #303133;
- }
- }
- .primary {
- color: $uni-color-primary !important;
- }
- .success {
- color: $uni-color-success !important;
- }
- .error {
- color: $uni-color-error !important;
- }
- .gap {
- width: 100%;
- height: 36rpx;
- background-color: #f5f3f3;
- margin-top: 15rpx;
- margin-bottom: 10rpx;
- }
- .order-item{
- &_header{
- width: 100%;
- &_left{
- padding:5px;
- width: 100%;
- background-color: #eeefff;
- color: #2c405a;
- font-size: 16px;
- display: inline-flex;
- justify-content: space-around;
- &_title,&_price,&_total,&_num{
- width: 25%;
- text-align: center;
- }
- }
- }
- &_body{
- width: 100%;
- &_item{
- font-size: 14px;
- &_left{
- display: inline-flex;
- justify-content: space-around;
- width: 100%;
- &_left,&_price,&_total,&_num,&_name{
- width: 25%;
- text-align: center;
- border: 1px solid #ccc;
- border-right: none;
- border-top: none;
- }
- }
- }
- }
- }
- </style>
|