This commit is contained in:
2025-10-27 15:55:29 +08:00
commit 6632080b83
513 changed files with 117442 additions and 0 deletions

824
pages/order/detail.vue Normal file
View File

@@ -0,0 +1,824 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view class="detail-container" :class="{ 'safe-area': isIphoneX }">
<!-- 订单状态 -->
<view class="status-wrap color-base-bg" :style="{ backgroundImage: 'url(' + $util.img('public/uniapp/order/status-wrap-bg.png') + ')' }">
<view class="order-status-left">
<image :src="$util.img(action.icon)"></image>
<view class="status-name">
<view class="name">
{{ orderData.order_status_name }}
<text v-if="orderData.promotion_status_name">{{ orderData.promotion_status_name }}</text>
</view>
<view class="desc" v-if="orderData.promotion_type == 'presale' && orderData.order_status == 1">
预计{{ $util.timeStampTurnTime(orderData.predict_delivery_time, true) }}日后发货
</view>
<view class="desc" v-if="orderData.close_cause">订单关闭原因{{ orderData.close_cause }}</view>
</view>
</view>
<view class="order-time" v-if="orderData.order_status == 0" id="action-date">
剩余时间
<uni-count-down :day="orderData.closeTimeMachine.d" :hour="orderData.closeTimeMachine.h"
:minute="orderData.closeTimeMachine.i" :second="orderData.closeTimeMachine.s" color="#fff"
splitorColor="#fff" />
</view>
</view>
<!-- 地址信息 -->
<view class="address-wrap" v-if="orderData.order_type == 1 || orderData.order_type == 3">
<view class="icon">
<view class="iconfont icon-location"></view>
</view>
<view class="address-info">
<view class="info">
<text class="font-size-base">{{ orderData.name }}&nbsp;{{ orderData.mobile }}</text>
</view>
<view class="detail">
<text class="font-size-base">收货地址{{ orderData.full_address }} {{ orderData.address }}</text>
</view>
</view>
<template v-if="orderData.order_type == 3">
<view class="pick-block first-pick-block">
<view class="font-size-base">送达时间</view>
<view class="last-child">{{ orderData.buyer_ask_delivery_time }}</view>
</view>
<block v-if="orderData.package_list">
<view class="pick-block">
<view>配送员</view>
<view class="last-child">{{ orderData.package_list.deliverer }}</view>
</view>
<view class="pick-block">
<view>外卖电话</view>
<view class="last-child">{{ orderData.package_list.deliverer_mobile }}</view>
</view>
</block>
</template>
</view>
<template v-if="orderData.order_type == 2">
<!-- 门店信息 -->
<view class="store-wrap">
<view>
<view class="store-info" v-if="orderData.delivery_store_info">
<view class="icon">
<view class="iconfont icon-mendian"></view>
</view>
<view class="store-info-detail">
<view class="store-name" @click="
$util.redirectTo('/pages_tool/store/detail', {
store_id: orderData.delivery_store_id
})
">
<text class="name font-size-base">{{ orderData.delivery_store_name }}</text>
<text class="iconfont icon-right font-size-base"></text>
</view>
<view class="detail store-detail">
<view class="color-tip" v-if="orderData.delivery_store_info.open_date">
营业时间{{ orderData.delivery_store_info.open_date }}</view>
<view class="color-tip">地址{{ orderData.delivery_store_info.full_address }}</view>
</view>
</view>
</view>
<view v-else>
<view class="address-empty">
<view class="color-base-text">当前无自提门店</view>
</view>
</view>
</view>
<view class="pick-block first-pick-block">
<view class="font-size-base">姓名</view>
<input class="last-child" type="text" disabled :value="orderData.name" />
</view>
<view class="pick-block first-pick-block">
<view class="font-size-base">预留手机</view>
<input class="last-child" type="number" disabled :value="orderData.mobile" />
</view>
<view class="pick-block first-pick-block">
<view class="font-size-base">提货时间</view>
<input class="last-child" disabled :value="orderData.buyer_ask_delivery_time" />
</view>
</view>
<view class="pickup-info" v-if="orderData.pay_status">
<view class="pickup-code-info">
<view class="info">
<text class="font-size-base">
<text class="color-tip font-size-base">提货码</text>
{{ orderData.delivery_code }}
</text>
<text class="copy" @click="$util.copy(orderData.delivery_code)">复制</text>
</view>
<view class="code">
<image :src="$util.img(orderData.pickup_barcode)" @click="previewMedia($util.img(orderData.pickup_barcode))" class="barcode" mode="widthFix"/>
<image :src="$util.img(orderData.pickup)" @click="previewMedia($util.img(orderData.pickup))" class="qrcode" mode="widthFix"/>
</view>
</view>
</view>
</template>
<!-- 店铺 -->
<view class="site-wrap" :style="orderData.order_type == 4 ? 'margin-top: -69rpx;' : ''">
<view class="site-body">
<view v-for="(goodsItem, goodsIndex) in orderData.order_goods" :key="goodsIndex" class="goods-item">
<view class="goods-wrap">
<view class="goods-img" @click="goDetail(goodsItem)">
<image :src="$util.img(goodsItem.sku_image, { size: 'mid' })" @error="imageError(goodsIndex)" mode="aspectFill"/>
</view>
<view class="goods-info" @click="goDetail(goodsItem)">
<view class="goods-name">{{ goodsItem.sku_name }}</view>
<view class="sku" v-if="goodsItem.sku_spec_format">
<view class="goods-spec">
<block v-for="(x, i) in goodsItem.sku_spec_format" :key="i">
{{ x.spec_value_name }}
{{ i < goodsItem.sku_spec_format.length - 1 ? '; ' : '' }}
</block>
</view>
</view>
<view class="goods-sub-section">
<view>
<text class="goods-price ">
<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
<text class="price-style large">{{ parseFloat(goodsItem.price).toFixed(2).split('.')[0] }}</text>
<text class="unit price-style small">.{{ parseFloat(goodsItem.price).toFixed(2).split('.')[1] }}</text>
</text>
</view>
<view>
<text class="font-size-base">
<text class="iconfont icon-close"></text>
{{ goodsItem.num }}
</text>
</view>
</view>
<view v-if="goodsItem.card_item_id" class="goods-card">
次卡抵扣
<text class="goods-price ">
<text class="unit price-style small">-{{ $lang('common.currencySymbol') }}</text>
<text class="price-style large">{{ parseFloat(goodsItem.card_promotion_money).toFixed(2).split('.')[0] }}</text>
<text class="unit price-style small">.{{ parseFloat(goodsItem.card_promotion_money).toFixed(2).split('.')[1] }}</text>
</text>
</view>
</view>
</view>
<view class="goods-form" v-if="goodsItem.form">
<view class="order-cell" v-for="(item, index) in goodsItem.form" :key="index">
<text class="tit">{{ item.value.title }}</text>
<view class="box img-box" v-if="item.controller == 'Img'">
<view class="img" v-for="(img, imgIndex) in item.img_lists" :key="imgIndex">
<image :src="$util.img(img)" mode="widthFix" @click="previewMedia($util.img(img))"/>
</view>
</view>
<view class="box" v-else>
<text class="color-title">{{ item.val }}</text>
<text class="copy" @click="$util.copy(item.val)">复制</text>
</view>
</view>
</view>
<view class="goods-action">
<block v-if="orderData.is_enable_refund">
<view @click="goRefund(goodsItem.order_goods_id)" v-if="orderData.order_scene == 'online' && (goodsItem.refund_status == 0 || goodsItem.refund_status == -1)">
<view class="order-box-btn" v-if="orderData.promotion_type != 'blindbox'">
{{ orderData.order_status == 10 ? '申请售后' : '申请退款' }}
</view>
</view>
</block>
<view @click="goRefundDetail(goodsItem.order_goods_id)" v-if="goodsItem.refund_status != 0 && goodsItem.refund_status != -1">
<view class="order-box-btn">{{ orderData.order_status == 10 ? '查看售后' : '查看退款' }}</view>
</view>
</view>
</view>
</view>
</view>
<!-- 订单概况 -->
<view class="order-summary">
<view class="order-cell">
<text class="tit">订单类型</text>
<view class="box">
<text class="color-title">{{ orderData.order_type_name }}</text>
</view>
</view>
<view class="order-cell">
<text class="tit">订单编号</text>
<view class="box">
<text class="color-title">{{ orderData.order_no }}</text>
<view class="copy" @click="$util.copy(orderData.order_no)">复制</view>
</view>
</view>
<view class="order-cell">
<text class="tit">订单交易号</text>
<view class="box">
<text class="color-title">{{ orderData.out_trade_no }}</text>
</view>
</view>
<view class="order-cell">
<text class="tit">创建时间</text>
<view class="box">
<text class="color-title">{{ $util.timeStampTurnTime(orderData.create_time) }}</text>
</view>
</view>
<view class="order-cell" v-if="orderData.close_time > 0">
<text class="tit">关闭时间</text>
<view class="box">
<text class="color-title">{{ $util.timeStampTurnTime(orderData.close_time) }}</text>
</view>
</view>
<block v-if="orderData.pay_status > 0">
<view class="hr"></view>
<view class="order-cell">
<text class="tit">支付方式</text>
<view class="box">
<text class="color-title">{{ orderData.pay_type_name }}</text>
</view>
</view>
<view class="order-cell">
<text class="tit">支付时间</text>
<view class="box">
<text class="color-title">{{ $util.timeStampTurnTime(orderData.pay_time) }}</text>
</view>
</view>
</block>
<view class="order-cell" v-if="orderData.delivery_type_name">
<text class="tit">配送方式</text>
<view class="box">
<text class="color-title">{{ orderData.delivery_type_name }}</text>
</view>
</view>
<view class="order-cell" v-if="orderData.buyer_message != ''">
<text class="tit">买家留言</text>
<view class="box">
<text class="color-title">{{ orderData.buyer_message }}</text>
</view>
</view>
<view class="order-cell" v-if="orderData.promotion_type_name != ''">
<text class="tit">活动优惠</text>
<view class="box">
<text class="color-title">{{ orderData.promotion_type_name }}</text>
</view>
</view>
<block v-if="orderData.is_invoice > 0">
<view class="hr"></view>
<view class="order-cell">
<text class="tit">发票类型</text>
<view class="box">
<text class="color-title">{{ orderData.invoice_type == 1 ? '纸质发票' : '电子发票' }}</text>
</view>
</view>
<view class="order-cell">
<text class="tit">发票抬头类型</text>
<view class="box">
<text class="color-title">{{ orderData.invoice_title_type == 1 ? '个人' : '企业' }}</text>
</view>
</view>
<view class="order-cell">
<text class="tit">发票抬头</text>
<view class="box">
<text class="color-title">{{ orderData.invoice_title }}</text>
</view>
</view>
<view class="order-cell">
<text class="tit">发票内容</text>
<view class="box">
<text class="color-title">{{ orderData.invoice_content }}</text>
</view>
</view>
<view class="order-cell" v-if="orderData.invoice_type == 1">
<text class="tit">发票邮寄地址</text>
<view class="box">
<text class="color-title">{{ orderData.invoice_full_address }}</text>
</view>
</view>
<view class="order-cell" v-else>
<text class="tit">发票接收邮件</text>
<view class="box">
<text class="color-title">{{ orderData.invoice_email }}</text>
</view>
</view>
</block>
<block v-if="orderData.form">
<view class="hr"></view>
<view class="order-cell order-form" v-for="(item, index) in orderData.form" :key="index">
<text class="tit">{{ item.value.title }}</text>
<view class="box img-box" v-if="item.controller == 'Img'">
<view class="img" v-for="(img, imgIndex) in item.img_lists" :key="imgIndex">
<image :src="$util.img(img)" mode="widthFix" @click="previewMedia($util.img(img))"></image>
</view>
</view>
<view class="box" v-else>
<text class="color-title">{{ item.val }}</text>
<text class="copy" @click="$util.copy(item.val)">复制</text>
</view>
</view>
</block>
<block v-if="orderData.goods_class == 5">
<view class="order-cell">
<text class="tit">我的卡包</text>
<view class="box"><text class="color-base-text" @click="$util.redirectTo('/pages_promotion/cardservice/card/my_card')">查看</text></view>
</view>
</block>
<!-- 联系客服 -->
<!-- <ns-contact :niushop="{ order_id: orderData.order_id }">
<view class="kefu">
<view>
<text class="iconfont icon-ziyuan"></text>
<text>联系客服</text>
</view>
</view>
</ns-contact> -->
</view>
<block v-if="orderData.virtual_goods && orderData.goods_class == 2 && orderData.virtual_goods.is_veirfy == 0">
<view class="verify-code-wrap">
<view class="code">
<image :src="$util.img(orderData.virtualgoods_barcode)" class="barcode" mode="widthFix"></image>
<image :src="$util.img(orderData.virtualgoods)" class="qrcode" mode="widthFix"></image>
<text>请将条形码或二维码出示给核销员</text>
</view>
<view class="hr"></view>
<view class="wrap">
<text class="font-size-base virtual-code">{{ orderData.virtual_code }}</text>
<view class="copy" @click="$util.copy(orderData.virtual_code)">复制</view>
</view>
</view>
<view class="verify-info-wrap">
<view class="head">核销信息</view>
<view class="order-cell">
<text class="tit">核销次数</text>
<view class="box align-right">
<text class="color-title">
剩余{{ orderData.virtual_goods.verify_total_count - orderData.virtual_goods.verify_use_num }}/{{ orderData.virtual_goods.verify_total_count }}
</text>
</view>
</view>
<view class="order-cell">
<text class="tit">有效期</text>
<view class="box align-right">
<text class="color-title" v-if="orderData.virtual_goods.expire_time > 0">{{ $util.timeStampTurnTime(orderData.virtual_goods.expire_time) }}</text>
<text v-else>永久有效</text>
</view>
</view>
</view>
<view class="verify-info-wrap">
<view class="head">核销记录</view>
<view v-if="orderData.virtual_goods.verify_record.length">
<view v-for="(item, index) in orderData.virtual_goods.verify_record" :key="index" class="record-item">
<view class="order-cell">
<text class="tit">核销人</text>
<view class="box align-right">
<text class="color-title">{{ item.verifier_name }}</text>
</view>
</view>
<view class="order-cell">
<text class="tit">核销时间</text>
<view class="box align-right">
<text class="color-title">{{ $util.timeStampTurnTime(item.verify_time) }}</text>
</view>
</view>
</view>
</view>
<view class="record-empty" v-else>暂无核销记录</view>
</view>
</block>
<block v-if="orderData.virtual_goods && orderData.goods_class == 3">
<view class="verify-info-wrap carmichael">
<view class="head">卡密信息</view>
<view v-for="(item, index) in orderData.virtual_goods" :key="index" class="record-item">
<view class="order-cell">
<text class="tit">卡号</text>
<view class="box">
<text class="color-title">{{ item.card_info.cardno }}</text>
<view class="copy" @click="$util.copy(item.card_info.cardno)">复制</view>
</view>
</view>
<view class="order-cell">
<text class="tit">密码</text>
<view class="box">
<text class="color-title">{{ item.card_info.password }}</text>
<view class="copy" @click="$util.copy(item.card_info.password)">复制</view>
</view>
</view>
</view>
</view>
</block>
<block v-if="orderData.virtual_goods && orderData.goods_class == 4">
<view class="verify-code-wrap" v-if="orderData.virtual_goods.is_veirfy == 0">
<view class="code">
<image :src="$util.img(orderData.virtualgoods_barcode)" class="barcode" mode="widthFix"></image>
<image :src="$util.img(orderData.virtualgoods)" class="qrcode" mode="widthFix"></image>
<text>请将条形码或二维码出示给核销员</text>
</view>
<view class="hr"></view>
<view class="wrap">
<text class="font-size-base virtual-code">{{ orderData.virtual_code }}</text>
<view class="copy" @click="$util.copy(orderData.virtual_code)">复制</view>
</view>
</view>
<view class="verify-info-wrap">
<view class="head">核销信息</view>
<view class="order-cell">
<text class="tit">核销次数</text>
<view class="box align-right">
<text class="color-title">
剩余{{ orderData.virtual_goods.verify_total_count - orderData.virtual_goods.verify_use_num }}/{{ orderData.virtual_goods.verify_total_count }}
</text>
</view>
</view>
<view class="order-cell">
<text class="tit">有效期</text>
<view class="box align-right">
<text class="color-title" v-if="orderData.virtual_goods.expire_time > 0">{{ $util.timeStampTurnTime(orderData.virtual_goods.expire_time) }}</text>
<text v-else>永久有效</text>
</view>
</view>
</view>
<view class="verify-info-wrap">
<view class="head">核销记录</view>
<view v-if="orderData.virtual_goods.verify_record.length">
<view v-for="(item, index) in orderData.virtual_goods.verify_record" :key="index" class="record-item">
<view class="order-cell">
<text class="tit">核销人</text>
<view class="box align-right">
<text class="color-title">{{ item.verifier_name }}</text>
</view>
</view>
<view class="order-cell">
<text class="tit">核销时间</text>
<view class="box align-right">
<text class="color-title">{{ $util.timeStampTurnTime(item.verify_time) }}</text>
</view>
</view>
</view>
</view>
<view class="record-empty" v-else>暂无核销记录</view>
</view>
</block>
<!-- 订单金额 -->
<view class="order-money">
<view class="order-cell">
<text class="tit">商品金额</text>
<view class="box align-right">
<text class="color-title price-font">
<text class="font-size-goods-tag">{{ $lang('common.currencySymbol') }}</text>
{{ orderData.goods_money }}
</text>
</view>
</view>
<view class="order-cell" v-if="orderData.order_type != 4">
<text class="tit">运费</text>
<view class="box align-right">
<text class="color-base-text price-font">
<text class="font-size-goods-tag">{{ $lang('common.currencySymbol') }}</text>
<text>{{ orderData.delivery_money }}</text>
</text>
</view>
</view>
<view class="order-cell" v-if="orderData.member_card_money > 0">
<text class="tit">会员卡</text>
<view class="box align-right">
<text class="color-base-text price-font">
<text class="font-size-goods-tag">{{ $lang('common.currencySymbol') }}</text>
<text>{{ orderData.member_card_money }}</text>
</text>
</view>
</view>
<view class="order-cell" v-if="orderData.invoice_money > 0">
<text class="tit">
税费
<text class="color-base-text">({{ orderData.invoice_rate }}%)</text>
</text>
<view class="box align-right">
<text class="color-base-text price-font">
<text class="operator">+</text>
<text class="font-size-goods-tag">{{ $lang('common.currencySymbol') }}</text>
<text>{{ orderData.invoice_money }}</text>
</text>
</view>
</view>
<view class="order-cell" v-if="orderData.invoice_delivery_money > 0">
<text class="tit">发票邮寄费</text>
<view class="box align-right">
<text class="color-base-text price-font">
<text class="operator">+</text>
<text class="font-size-goods-tag">{{ $lang('common.currencySymbol') }}</text>
<text>{{ orderData.invoice_delivery_money }}</text>
</text>
</view>
</view>
<view class="order-cell" v-if="orderData.adjust_money != 0">
<text class="tit">订单调整</text>
<view class="box align-right">
<text class="color-base-text price-font">
<text class="operator" v-if="orderData.adjust_money < 0">-</text>
<text class="operator" v-else>+</text>
<text class="font-size-goods-tag">{{ $lang('common.currencySymbol') }}</text>
<text>{{ orderData.adjust_money | abs }}</text>
</text>
</view>
</view>
<view class="order-cell" v-if="orderData.promotion_money > 0">
<text class="tit">优惠</text>
<view class="box align-right">
<text class="color-base-text price-font">
<text class="operator">-</text>
<text class="font-size-goods-tag">{{ $lang('common.currencySymbol') }}</text>
<text>{{ orderData.promotion_money }}</text>
</text>
</view>
</view>
<view class="order-cell" v-if="orderData.coupon_money > 0">
<text class="tit">优惠券</text>
<view class="box align-right">
<text class="color-base-text price-font">
<text class="operator">-</text>
<text class="font-size-goods-tag">{{ $lang('common.currencySymbol') }}</text>
<text>{{ orderData.coupon_money }}</text>
</text>
</view>
</view>
<view class="order-cell" v-if="orderData.balance_money > 0">
<text class="tit">使用余额</text>
<view class="box align-right">
<text class="color-base-text price-font">
<text class="operator">-</text>
<text class="font-size-goods-tag">{{ $lang('common.currencySymbol') }}</text>
<text>{{ orderData.balance_money }}</text>
</text>
</view>
</view>
<view class="order-cell" v-if="orderData.point_money > 0">
<text class="tit">积分抵扣</text>
<view class="box align-right">
<text class="color-base-text price-font">
<text class="operator">-</text>
<text class="font-size-goods-tag">{{ $lang('common.currencySymbol') }}</text>
<text>{{ orderData.point_money }}</text>
</text>
</view>
</view>
<view class="order-cell">
<view class="box align-right">
<text>实付金额</text>
<text class="color-base-text price-font">
<text class="font-size-goods-tag">{{ $lang('common.currencySymbol') }}</text>
<text class="font-size-base">{{ orderData.order_money }}</text>
</text>
</view>
</view>
<view class="order-action fixed-bottom bottom-safe-area" v-if="orderData.action.length > 0">
<view class="order-box-btn white" v-if="evaluateConfig.evaluate_status == 1 && orderData.is_evaluate == 1" @click="operation('memberOrderEvaluation')">
<text v-if="orderData.evaluate_status == 0">评价</text>
<text v-else-if="orderData.evaluate_status == 1">追评</text>
</view>
<block v-if="orderData.order_scene == 'online'">
<view class="order-box-btn"
:class="{ 'color-base-border color-base-bg': operationItem.action == 'orderPay' }"
v-for="(operationItem, operationIndex) in orderData.action" :key="operationIndex"
@click="operation(operationItem.action)">
{{ operationItem.title }}
</view>
</block>
</view>
<view class="order-action fixed-bottom bottom-safe-area" v-else-if="orderData.action.length == 0 && orderData.is_evaluate == 1 && evaluateConfig.evaluate_status == 1">
<view class="order-box-btn white" @click="operation('memberOrderEvaluation')">
<text v-if="orderData.evaluate_status == 0">评价</text>
<text v-else-if="orderData.evaluate_status == 1">追评</text>
</view>
</view>
</view>
<!-- 订单 -->
<view class="fixed-bottom-box bottom-safe-area" v-if="orderData.action.length > 0 || (orderData.is_evaluate == 1 && evaluateConfig.evaluate_status == 1)">
</view>
<ns-goods-recommend ref="goodrecommend" route="order_detail"></ns-goods-recommend>
<!-- 选择支付方式弹窗 -->
<ns-payment ref="choosePaymentPopup"></ns-payment>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
import nsGoodsRecommend from '@/components/ns-goods-recommend/ns-goods-recommend.vue';
import orderMethod from './public/js/orderMethod.js';
import nsPayment from '@/components/payment/payment.vue';
import nsContact from '@/components/ns-contact/ns-contact.vue';
export default {
data() {
return {
isIphoneX: false,
orderId: 0,
merchantTradeNo: '',
orderData: {
action: [],
virtual_goods: {
is_veirfy: 0,
verify_record: []
}
},
action: {
icon: ''
},
evaluateConfig: {
evaluate_audit: 1,
evaluate_show: 0,
evaluate_status: 1
}
};
},
mixins: [orderMethod],
components: {
nsGoodsRecommend,
nsPayment,
nsContact
},
onLoad(option) {
if (option.order_id) this.orderId = option.order_id;
if (option.merchant_trade_no) this.merchantTradeNo = option.merchant_trade_no;
},
onShow() {
this.isIphoneX = this.$util.uniappIsIPhoneX();
if (this.storeToken) {
this.getEvaluateConfig();
this.getOrderData();
} else {
this.$util.redirectTo('/pages_tool/login/login', {
back: '/pages/order/detail?order_id=' + this.orderId + '&merchant_trade_no=' + this.merchantTradeNo
});
}
},
methods: {
goDetail(e) {
this.$util.redirectTo('/pages/goods/detail', {
goods_id: e.goods_id
});
},
goRefund(id) {
this.$util.redirectTo('/pages_tool/order/refund', {
order_goods_id: id
});
},
goRefundDetail(id) {
this.$util.redirectTo('/pages_tool/order/refund_detail', {
order_goods_id: id
});
},
getOrderData() {
this.$api.sendRequest({
url: '/api/order/detail',
data: {
order_id: this.orderId,
merchant_trade_no: this.merchantTradeNo
},
success: res => {
if (res.code >= 0) {
if (res.data.order_status == 0) {
let date = Date.parse(new Date()) / 1000;
res.data.closeTimeMachine = this.$util.countDown(res.data.create_time + res.data.auto_close - date);
}
let num = 0;
this.orderData = res.data;
this.orderId = this.orderData.order_id;
let refund_order_goods_ids = [];
this.orderData.order_goods.forEach(v => {
if (v.sku_spec_format) {
v.sku_spec_format = JSON.parse(v.sku_spec_format);
} else {
v.sku_spec_format = [];
}
if (v.refund_status == 0 || v.refund_status == -1) {
num += 1;
refund_order_goods_ids.push(v.order_goods_id);
}
});
this.action = JSON.parse(res.data.order_status_action);
//判断在可退款商品数量大于1时出现批量删除按钮
if (num > 1) {
this.orderData.refund_batch_status = true;
this.orderData.refund_order_goods_ids = refund_order_goods_ids;
} else {
this.orderData.refund_batch_status = false;
}
if (this.orderData.delivery_store_info != '') this.orderData.delivery_store_info = JSON.parse(this.orderData.delivery_store_info);
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
} else {
this.$util.showToast({
title: '未获取到订单信息!'
});
setTimeout(() => {
this.$util.redirectTo('/pages/order/list');
}, 1500);
}
},
fail: res => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
/**
* 下拉刷新
*/
onPullDownRefresh() {
this.getOrderData();
},
operation(action) {
switch (action) {
case 'orderPay': // 支付
this.orderPay(this.orderData);
break;
case 'orderClose': //关闭
this.orderClose(this.orderData.order_id, () => {
this.getOrderData();
});
break;
case 'memberTakeDelivery': //收货
this.orderDelivery(this.orderData, () => {
this.getOrderData();
});
break;
case 'trace': //查看物流
this.$util.redirectTo('/pages_tool/order/logistics', {
order_id: this.orderData.order_id
});
break;
case 'memberOrderEvaluation': //评价
this.$util.redirectTo('/pages_tool/order/evaluate', {
order_id: this.orderData.order_id
});
break;
//批量退款
case 'memberBatchRefund':
this.$util.redirectTo('/pages_tool/order/refund_type_select', {
order_id: this.orderId
});
break;
case 'memberVirtualTakeDelivery':
this.orderVirtualDelivery(this.orderData, () => {
this.getOrderData();
});
break;
}
},
imageError(index) {
this.orderData.order_goods[index].sku_image = this.$util.getDefaultImage().goods;
this.$forceUpdate();
},
getEvaluateConfig() {
this.$api.sendRequest({
url: '/api/goodsevaluate/config',
success: res => {
if (res.code == 0) {
var data = res.data;
this.evaluateConfig = data;
}
}
});
},
// 显示选择支付方式弹框
openChoosePayment() {
this.$refs.choosePaymentPopup.open();
},
// 预览图片
previewMedia(pickup) {
var paths = [];
paths.push(pickup);
uni.previewImage({
urls: paths
});
}
},
filters: {
abs(value) {
return Math.abs(parseFloat(value)).toFixed(2);
}
}
};
</script>
<style lang="scss">
@import './public/css/detail.scss';
</style>
<style scoped>
.pickup-code-info .code img:nth-child(1) {
margin-bottom: 30rpx;
}
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important;
}
</style>

View File

@@ -0,0 +1,22 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
export default {
data() {
return {};
},
onLoad(option) {
if (option.order_id) {
this.$util.redirectTo('/pages/order/detail', {order_id: option.order_id}, 'redirectTo');
}
}
};
</script>
<style lang="scss">
</style>

View File

@@ -0,0 +1,22 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
export default {
data() {
return {};
},
onLoad(option) {
if (option.order_id) {
this.$util.redirectTo('/pages/order/detail', {order_id: option.order_id}, 'redirectTo');
}
}
};
</script>
<style lang="scss">
</style>

View File

@@ -0,0 +1,304 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view class="detail-container" :class="{ 'safe-area': isIphoneX }">
<!-- 订单状态 -->
<view class="status-wrap color-base-bg" :style="{ backgroundImage: 'url(' + $util.img('public/uniapp/order/status-wrap-bg.png') + ')' }">
<view class="order-status-left">
<image v-if="orderData.order_status == 0" :src="$util.img('public/uniapp/order/order-icon.png')"/>
<image v-if="orderData.order_status == 1" :src="$util.img('public/uniapp/order/order-icon-received.png')"/>
<image v-if="orderData.order_status == -1" :src="$util.img('public/uniapp/order/order-icon-close.png')"/>
<view class="status-name">
<view class="status-name">
{{ orderData.order_status == 0 ? '待支付' : orderData.order_status == 1 ? '已完成' : orderData.order_status == -1 ? '已关闭' : '' }}
</view>
</view>
</view>
</view>
<!-- 店铺 -->
<view class="site-wrap" style="margin-top: -69rpx">
<view class="site-body">
<view class="goods-item">
<view class="goods-wrap">
<view @click="goDetail(orderData.exchange_goods_id)" class="goods-img">
<image :src="exchangeImage(orderData)" @error="imageError()" mode="aspectFill"></image>
</view>
<view class="goods-info" @click="goDetail(orderData.exchange_goods_id)">
<view class="goods-name">{{ orderData.exchange_name }}</view>
<view class="goods-sub-section">
<view>
<text class="goods-price color-base-text">
<text>
<text>{{ orderData.point }}积分</text>
<text v-if="orderData.price > 0" class="price-color">
+
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
{{ orderData.price }}
</text>
</text>
</text>
</view>
<view>
<text>
<text class="iconfont icon-close"></text>
{{ orderData.num }}
</text>
</view>
</view>
</view>
</view>
<view class="goods-action"></view>
</view>
</view>
</view>
<!-- 订单概况 -->
<view class="order-summary">
<view class="order-cell">
<text class="tit">订单编号</text>
<view class="box">
<text class="color-title">{{ orderData.order_no }}</text>
<view class="copy" @click="$util.copy(orderData.order_no)">复制</view>
</view>
</view>
<view class="order-cell">
<text class="tit">订单交易号</text>
<view class="box">
<text class="color-title">{{ orderData.out_trade_no }}</text>
</view>
</view>
<view class="order-cell">
<text class="tit">创建时间</text>
<view class="box">
<text class="color-title">{{ $util.timeStampTurnTime(orderData.create_time) }}</text>
</view>
</view>
<view class="order-cell" v-if="orderData.close_time > 0">
<text class="tit">关闭时间</text>
<view class="box">
<text class="color-title">{{ $util.timeStampTurnTime(orderData.close_time) }}</text>
</view>
</view>
<!-- 联系客服 -->
<!-- <ns-contact :niushop="{ order_id: orderData.order_id }">
<view class="kefu">
<view>
<text class="iconfont icon-ziyuan"></text>
<text>联系客服</text>
</view>
</view>
</ns-contact> -->
</view>
<!-- 订单金额 -->
<view class="order-money">
<view class="order-cell" v-if="orderData.point > 0">
<text class="tit">使用积分</text>
<view class="box align-right">
<text class="color-base-text price-font">
<text>{{ orderData.point }}</text>
</text>
</view>
</view>
<view class="order-cell" v-if="orderData.delivery_price > 0">
<text class="tit">运费</text>
<view class="box align-right">
<text class="color-base-text price-font">
<text class="unit font-size-tag">{{ $lang('common.currencySymbol') }}</text>
<text>{{ orderData.delivery_price }}</text>
</text>
</view>
</view>
<view class="order-cell" v-if="orderData.order_money > 0">
<view class="box align-right">
<text>实付金额</text>
<text class="color-base-text price-font">
<text class="font-size-goods-tag">{{ $lang('common.currencySymbol') }}</text>
<text class="font-size-base">{{ orderData.order_money }}</text>
</text>
</view>
</view>
<view class="order-action" v-if="orderData.order_status == 0 && orderData.type == 1">
<view class="order-box-btn" @click="orderClose()">关闭</view>
<view class="order-box-btn color-base-bg color-base-border color-text-white" @click="openChoosePayment()">支付</view>
</view>
</view>
<ns-goods-recommend ref="goodrecommend" route="order_detail"></ns-goods-recommend>
<!-- 选择支付方式弹窗 -->
<ns-payment ref="choosePaymentPopup" :payMoney="orderData.order_money"
@confirm="orderPay(orderData)"></ns-payment>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
import nsGoodsRecommend from '@/components/ns-goods-recommend/ns-goods-recommend.vue';
import nsContact from '@/components/ns-contact/ns-contact.vue';
export default {
components: {
nsGoodsRecommend,
nsContact
},
data() {
return {
isIphoneX: false,
orderId: 0,
orderData: {
action: []
},
action: {
icon: ''
},
storeDetail: {}
};
},
onLoad(option) {
if (option.order_id) this.orderId = option.order_id;
},
onShow() {
this.isIphoneX = this.$util.uniappIsIPhoneX();
if (this.storeToken) {
this.getOrderData();
} else {
this.$util.redirectTo('/pages_tool/login/login', {
back: '/pages/order/detail_point?order_id=' + this.orderId
});
}
},
methods: {
goRefund(id) {
this.$util.redirectTo('/pages_tool/order/refund', {
order_goods_id: id
});
},
goRefundDetail(id) {
this.$util.redirectTo('/pages_tool/order/refund_detail', {
order_goods_id: id
});
},
goDetail(id) {
this.$util.redirectTo('/pages_promotion/point/detail', {
id: id
});
},
navigateBack() {
this.$util.goBack();
},
getOrderData() {
this.$api.sendRequest({
url: '/pointexchange/api/order/info',
data: {
order_id: this.orderId
},
success: res => {
uni.stopPullDownRefresh();
if (res.code >= 0) {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
this.orderData = res.data;
if (this.orderData.delivery_store_info != '') this.orderData.delivery_store_info =
JSON.parse(this.orderData.delivery_store_info);
} else {
this.$util.showToast({
title: '未获取到订单信息!'
});
setTimeout(() => {
this.$util.redirectTo('/pages/order/list');
}, 1500);
}
},
fail: res => {
uni.stopPullDownRefresh();
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
/**
* 下拉刷新
*/
onPullDownRefresh() {
this.getOrderData();
},
orderClose() {
uni.showModal({
title: '提示',
content: '确定关闭此次兑换?',
success: res => {
if (res.confirm) {
this.$api.sendRequest({
url: '/pointexchange/api/order/close',
data: {
order_id: this.orderData.order_id
},
success: res => {
if (res.code >= 0) {
this.$util.showToast({
title: '关闭成功'
});
this.getOrderData();
}
}
});
}
}
});
},
// 显示选择支付方式弹框
openChoosePayment() {
this.$refs.choosePaymentPopup.open();
},
orderPay() {
uni.setStorageSync('paySource', 'pointexchange');
this.$refs.choosePaymentPopup.getPayInfo(this.orderData.out_trade_no);
},
exchangeImage(data) {
let img = '';
switch (data.type) {
case 1:
img = this.$util.img(data.exchange_image, {
size: 'mid'
});
break;
case 2:
img = data.exchange_image ? this.$util.img(data.exchange_image) : this.$util.img(
'public/uniapp/point/coupon.png');
break;
case 3:
img = data.exchange_image ? this.$util.img(data.exchange_image) : this.$util.img(
'public/uniapp/point/hongbao.png');
break;
}
return img;
},
imageError() {
switch (this.orderData.type) {
case 2:
this.orderData.exchange_image = this.$util.img('public/uniapp/point/coupon.png');
break;
case 3:
this.orderData.exchange_image = this.$util.img('public/uniapp/point/hongbao.png');
break;
default:
this.orderData.exchange_image = this.$util.getDefaultImage().goods;
}
this.$forceUpdate();
},
},
filters: {
abs(value) {
return Math.abs(parseFloat(value)).toFixed(2);
}
}
};
</script>
<style lang="scss">
@import './public/css/detail.scss';
</style>
<style scoped>
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important;
}
</style>

453
pages/order/list.vue Normal file
View File

@@ -0,0 +1,453 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view class="order-container">
<view class="cate-search">
<view class="search-box">
<input class="uni-input" maxlength="50" v-model="searchText" confirm-type="search" placeholder="请输入商品名称/订单编号" @confirm="search()" />
<text class="iconfont icon-sousuo3" @click="search()"></text>
</view>
</view>
<view class="order-nav" v-if="storeToken">
<view v-for="(statusItem, statusIndex) in statusList" :key="statusIndex" class="uni-tab-item" :id="statusItem.id" :data-current="statusIndex" @click="ontabtap">
<text class="uni-tab-item-title" :class="statusItem.status == orderStatus ? 'uni-tab-item-title-active color-base-text' : ''">
{{ statusItem.name }}
</text>
</view>
</view>
<!-- #ifdef MP -->
<mescroll-uni ref="mescroll" @getData="getListData" top="176rpx" v-if="storeToken">
<!-- #endif -->
<!-- #ifndef MP -->
<mescroll-uni ref="mescroll" @getData="getListData" top="196rpx" v-if="storeToken">
<!-- #endif -->
<block slot="list">
<view class="order-list" v-if="orderList.length > 0">
<view class="order-item" v-for="(orderItem, orderIndex) in orderList" :key="orderIndex">
<view class="order-header" :class="{ waitpay: orderStatus == 'waitpay' && orderItem.order_status == 0 }">
<!-- <view class="iconfont"
:class="$util.inArray(orderItem.order_id, mergePayOrder) == -1 ? 'icon-yuan_checkbox' : 'icon-yuan_checked color-base-text'"
@click="selectOrder(orderItem.order_id, orderItem.pay_money)"
v-if="orderStatus == 'waitpay' && orderItem.order_status == 0"></view> -->
<text class="order-no">订单号{{ orderItem.order_no }}</text>
<text class="order-type-name">{{ orderItem.order_type_name }}</text>
<text class="status-name">{{ orderItem.order_status_name }}</text>
</view>
<view class="order-body" @click="orderDetail(orderItem)">
<block v-if="orderItem.order_goods.length == 1">
<view class="goods-wrap" v-for="(goodsItem, goodsIndex) in orderItem.order_goods" :key="goodsIndex">
<view class="goods-img">
<image :src="$util.img(goodsItem.sku_image, { size: 'mid' })" @error="imageError(orderIndex, goodsIndex)" mode="aspectFill" :lazy-load="true"/>
</view>
<view class="goods-info">
<view class="pro-info">
<view class="goods-name" v-if="goodsItem.goods_class == 2">{{ goodsItem.goods_name }}</view>
<view class="goods-name" v-else>{{ goodsItem.sku_name }}</view>
<view class="sku" v-if="goodsItem.sku_spec_format">
<view class="goods-spec">
<block v-for="(x, i) in goodsItem.sku_spec_format" :key="i">
{{ x.spec_value_name }}
{{ i < goodsItem.sku_spec_format.length - 1 ? '; ' : '' }}
</block>
</view>
</view>
</view>
<!-- <view class="goods-sub-section">
<text class="goods-price">
<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
<text class="price-style large">{{ parseFloat(goodsItem.price).toFixed(2).split(".")[0] }}</text>
<text class="unit price-style small">.{{ parseFloat(goodsItem.price).toFixed(2).split(".")[1] }}</text>
</text>
<text class="goods-num">
<text class="iconfont icon-close"></text>
{{ goodsItem.num }}
</text>
</view> -->
<view class="goods-action"><!-- <view class="action-btn">加购物车</view> -->
</view>
</view>
</view>
</block>
<block v-else>
<view class="multi-order-goods">
<scroll-view scroll-x="true" class="scroll-view">
<view class="goods-wrap">
<view class="goods-img" v-for="(goodsItem, goodsIndex) in orderItem.order_goods" :key="goodsIndex">
<image :src="$util.img(goodsItem.sku_image, { size: 'mid' })" @error="imageError(orderIndex, goodsIndex)" mode="aspectFill" :lazy-load="true"/>
</view>
</view>
</scroll-view>
<view class="shade">
<image :src="$util.img('public/uniapp/order/order-shade.png')"></image>
</view>
</view>
</block>
</view>
<view class="order-footer">
<view class="order-base-info">
<view class="total">
<text class="font-size-sub">{{ orderItem.goods_num }}件商品</text>
<text class="align-right font-size-base">
实付款
<text class="font-size-base price-font">{{ $lang('common.currencySymbol') }}{{ orderItem.order_money }}</text>
</text>
</view>
</view>
<view class="order-action" v-if="orderItem.action.length > 0">
<view class="order-time" v-if="orderItem.order_status == 0" id="action-date">
<image :src="$util.img('public/uniapp/order/time.png')"></image>
剩余时间
<uni-count-down :day="orderItem.discountTimeMachine.d"
:hour="orderItem.discountTimeMachine.h"
:minute="orderItem.discountTimeMachine.i"
:second="orderItem.discountTimeMachine.s" color="#FF4644"
splitorColor="#FF4644" />
</view>
<view class="order-box-btn"
v-if="evaluateConfig.evaluate_status == 1 && orderItem.is_evaluate == 1"
@click="operation('memberOrderEvaluation', orderItem)">
<text v-if="orderItem.evaluate_status == 0">评价</text>
<text v-else-if="orderItem.evaluate_status == 1">追评</text>
</view>
<view class="order-box-btn"
:class="{ 'color-base-border color-base-bg': operationItem.action == 'orderPay' }"
v-for="(operationItem, operationIndex) in orderItem.action"
:key="operationIndex" @click="operation(operationItem.action, orderItem)">
{{ operationItem.title }}
</view>
</view>
<view class="order-action" v-else-if="orderItem.action.length == 0 && orderItem.is_evaluate == 1 && evaluateConfig.evaluate_status == 1">
<view class="order-box-btn" v-if="orderItem.is_evaluate == 1" @click="operation('memberOrderEvaluation', orderItem)">
<text v-if="orderItem.evaluate_status == 0">评价</text>
<text v-else-if="orderItem.evaluate_status == 1">追评</text>
</view>
</view>
<view class="order-action" v-else>
<view class="order-box-btn" @click="orderDetail(orderItem)">查看详情</view>
</view>
</view>
</view>
</view>
<view v-else><ns-empty :isIndex="false" :text="$lang('emptyTips')"></ns-empty></view>
</block>
</mescroll-uni>
<!-- <view class="order-batch-action" :class="{ 'bottom-safe-area': isIphoneX }" v-if="mergePayOrder.length">
<view class="action-btn color-base-text color-base-border" @click="mergePay()">合并付款</view>
</view> -->
<!-- 选择支付方式弹窗 -->
<ns-payment ref="choosePaymentPopup"></ns-payment>
<ns-payment ref="choosePaymentMergePopup"></ns-payment>
<ns-login ref="login"></ns-login>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
import orderMethod from './public/js/orderMethod.js';
import nsPayment from '@/components/payment/payment.vue';
export default {
data() {
return {
scrollInto: '',
orderStatus: 'all',
statusList: [],
orderList: [],
contentText: {},
mergePayOrder: [],
isIphoneX: false,
evaluateConfig: {
evaluate_audit: 1,
evaluate_show: 0,
evaluate_status: 1
},
orderData: {},
payMoney: 0,
payMoneyMerge: 0,
order_id: 0,
searchText: "",
pageText: "",
payConfig: null,
isTradeManaged: false // 检测微信小程序是否已开通发货信息管理服务
};
},
components: {
nsPayment
},
mixins: [orderMethod],
onLoad(option) {
if (option.status) this.orderStatus = option.status;
if (option.order_id) this.order_id = option.order_id;
},
onShow() {
this.isIphoneX = this.$util.uniappIsIPhoneX();
this.getEvaluateConfig();
this.getOrderStatus();
if (this.storeToken) {
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
} else {
this.$nextTick(() => {
this.$refs.login.open('/pages/order/list?status=' + this.orderStatus);
})
}
},
onUnload() {
if (!this.storeToken && this.$refs.login) this.$refs.login.cancelCompleteInfo();
},
methods: {
ontabtap(e) {
let index = e.target.dataset.current || e.currentTarget.dataset.current;
this.orderStatus = this.statusList[index].status;
if (this.orderStatus == '') this.mergePayOrder = [];
this.$refs.loadingCover.show();
this.$refs.mescroll.refresh();
},
getListData(mescroll) {
this.$api.sendRequest({
url: '/api/order/lists',
data: {
page: mescroll.num,
page_size: mescroll.size,
order_status: this.orderStatus,
order_id: this.order_id,
searchText: this.pageText
},
success: res => {
let newArr = [];
let msg = res.message;
let auto_close = 0
if (res.code == 0 && res.data) {
newArr = res.data.list;
auto_close = res.data.auto_close;
this.payConfig = res.data.pay_config;
this.isTradeManaged = res.data.is_trade_managed;
} else {
this.$util.showToast({
title: msg
});
}
mescroll.endSuccess(newArr.length);
//设置列表数据
if (mescroll.num == 1) {
this.orderList = []; //如果是第一页需手动制空列表
this.order_id = 0
}
this.orderList = this.orderList.concat(newArr); //追加新数据
let date = (Date.parse(new Date())) / 1000
this.orderList.forEach(v => {
v.discountTimeMachine = this.$util.countDown((v.create_time + auto_close) - date);
v.order_goods.forEach(vo => {
if (vo.sku_spec_format) {
try {
vo.sku_spec_format = JSON.parse(vo.sku_spec_format);
} catch (e) {
vo.sku_spec_format = vo.sku_spec_format;
}
} else {
vo.sku_spec_format = [];
}
});
});
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail: res => {
mescroll.endErr();
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
/**
* 获取订单状态
*/
getOrderStatus() {
this.statusList = [{
status: 'all',
name:'全部',
id: 'status_0'
},
{
status: 'waitpay',
name: '待付款',
id: 'status_1'
},
{
status: 'waitsend',
name: '待发货',
id: 'status_2'
},
{
status: 'waitconfirm',
name: '待收货',
id: 'status_3'
},
{
status: 'waitrate',
name: '已完成',
id: 'status_4'
},
/*{
status: 'wait_use',
name: '待使用',
id: 'status_4'
}*/
];
},
operation(action, orderData) {
let index = this.status;
switch (action) {
case 'orderPay': // 支付
this.orderData = orderData;
this.payMoney = parseFloat(orderData.pay_money);
this.orderPay(orderData);
break;
case 'orderClose': //关闭
this.orderClose(orderData.order_id, () => {
this.$refs.mescroll.refresh();
});
break;
case 'memberTakeDelivery': //收货
this.orderData = orderData;
this.orderData.pay_config = {};
this.orderData.pay_config.mch_id = this.payConfig.mch_id;
this.orderData.is_trade_managed = this.isTradeManaged;
this.orderDelivery(this.orderData, () => {
this.$refs.mescroll.refresh();
});
break;
case 'trace': //查看物流
this.$util.redirectTo('/pages_tool/order/logistics', {
order_id: orderData.order_id
});
break;
case 'memberOrderEvaluation': //评价
this.$util.redirectTo('/pages_tool/order/evaluate', {
order_id: orderData.order_id
});
break;
case 'memberVirtualTakeDelivery':
this.orderData = orderData;
this.orderData.pay_config = {};
this.orderData.pay_config.mch_id = this.payConfig.mch_id;
this.orderData.is_trade_managed = this.isTradeManaged;
this.orderVirtualDelivery(this.orderData, () => {
this.$refs.mescroll.refresh();
});
break;
}
},
orderDetail(data) {
switch (parseInt(data.order_type)) {
case 2:
// 自提订单
this.$util.redirectTo('/pages/order/detail_pickup', {
order_id: data.order_id
});
break;
case 3:
// 本地配送订单
this.$util.redirectTo('/pages/order/detail_local_delivery', {
order_id: data.order_id
});
break;
case 4:
// 虚拟订单
this.$util.redirectTo('/pages_tool/order/detail_virtual', {
order_id: data.order_id
});
break;
default:
this.$util.redirectTo('/pages/order/detail', {
order_id: data.order_id
});
break;
}
},
/**
* 选择订单
* @param {Object} orderId
*/
selectOrder(orderId, pay_money) {
if (this.$util.inArray(orderId, this.mergePayOrder) != -1) {
this.mergePayOrder.splice(this.$util.inArray(orderId, this.mergePayOrder), 1);
this.payMoneyMerge -= parseFloat(pay_money);
} else {
this.payMoneyMerge += parseFloat(pay_money);
this.mergePayOrder.push(orderId);
}
},
/**
* 合并支付
*/
mergePay() {
if (this.mergePayOrder.length) {
this.$api.sendRequest({
url: '/api/order/pay',
data: {
order_ids: this.mergePayOrder.toString()
},
success: res => {
if (res.code >= 0) {
this.$refs.choosePaymentMergePopup.getPayInfo(res.data);
} else {
this.$util.showToast({
title: res.message
});
}
}
});
}
},
imageError(orderIndex, goodsIndex) {
this.orderList[orderIndex].order_goods[goodsIndex].sku_image = this.$util.getDefaultImage().goods;
this.$forceUpdate();
},
getEvaluateConfig() {
this.$api.sendRequest({
url: '/api/goodsevaluate/config',
success: res => {
if (res.code == 0) {
var data = res.data;
this.evaluateConfig = data;
}
}
});
},
search() {
this.pageText = this.searchText;
this.$refs.mescroll.refresh();
}
},
computed: {
mpOrderList() {
if (!this.orderList[this.status]) return;
return this.orderList[this.status].list || [];
}
},
watch: {
storeToken: function(nVal, oVal) {
if (nVal) {
this.$refs.mescroll.refresh();
}
}
}
};
</script>
<style lang="scss">
@import './public/css/list.scss';
</style>
<style scoped>
/deep/ .uni-page {
overflow: hidden;
}
/deep/ .mescroll-upwarp {
padding-bottom: 100rpx;
}
</style>

105
pages/order/payment.vue Normal file
View File

@@ -0,0 +1,105 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view>
<common-payment :api="api" create-data-key="orderCreateData" ref="payment"></common-payment>
</view>
</template>
<script>
export default {
data() {
return {
api: {
payment: '/api/ordercreate/payment',
calculate: '/api/ordercreate/calculate',
create: '/api/ordercreate/create',
}
}
},
provide() {
return {
promotion: this.promotion.bind(this)
}
},
onShow() {
if (this.$refs.payment) this.$refs.payment.pageShow();
},
methods: {
/**
* 处理活动信息 如不需要则定义为空方法
*/
promotion(data){
if (data.promotion && data.promotion.manjian && data.promotion.manjian.length) {
let promotionStr = {title: `满减送`, content: ''}
data.promotion.manjian.forEach((mItem,mIndex)=>{
let promotion = '';
let content = {};
let limit = mItem.type == 0 ? '元' : '件';
if(mItem.rule){
var item = mItem.discount_array.rule;
item.limit = mItem.type == 0 ? parseFloat(item.limit).toFixed(2) : parseInt(item.limit);
// 满减
if (item.discount_money != undefined) {
if (content.manjian == undefined) {
content.manjian = '购买可享受满' + item.limit + limit + '减' + item.discount_money + '元';
} else {
content.manjian += ';满' + item.limit + limit + '减' + item.discount_money + '元';
}
}
// 满送优惠券
if (item.coupon && item.coupon_list) {
let text = '';
item.coupon_list.forEach((couponItem, couponIndex) => {
if (couponItem.type == 'discount') {
if (text == '') text = '送'+ couponItem.give_num +'张' + parseFloat(couponItem.discount) + '折优惠券';
else text += '、送'+ couponItem.give_num +'张' + parseFloat(couponItem.discount) + '折优惠券';
} else {
if (text == '') text = '送'+ couponItem.give_num +'张' + parseFloat(couponItem.money) + '元优惠券';
else text += '、送'+ couponItem.give_num +'张' + parseFloat(couponItem.money) + '元优惠券';
}
})
if (content.mansong == undefined) {
content.mansong = '购物满' + item.limit + limit + text;
} else {
content.mansong += '' + '满' + item.limit + limit + text;
}
}
// 满送积分
if (item.point) {
let point_text = '可得' + item.point + '积分';
if(content.point_text == undefined) {
content.point_text = '购物满' + item.limit + limit + point_text
}else {
content.point_text += '' + '满' + item.limit + limit + point_text;
}
}
// 包邮
if (item.free_shipping != undefined) {
if (content.free_shipping == undefined) {
content.free_shipping = '购物满' + item.limit + limit + '包邮';
}
}
}
promotion = Object.values(content).join('\n');
promotionStr.content = promotionStr.content + promotion + '\n';
})
return (promotionStr.content ? promotionStr : null);
}
}
}
};
</script>
<style scoped lang="scss">
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
background: none;
max-height: unset !important;
overflow-y: hidden !important;
}
/deep/ .uni-popup__wrapper {
border-radius: 20rpx 20rpx 0 0;
}
/deep/ .uni-popup {
z-index: 8;
}
</style>

View File

@@ -0,0 +1,871 @@
@mixin flex-row-center {
display: flex;
justify-content: center;
align-items: center;
}
@mixin wrap {
margin: $margin-updown 24rpx;
padding: 30rpx;
border-radius: 16rpx;
background: #fff;
position: relative;
}
text,
view {
font-size: $font-size-tag;
}
.bottom-safe-area {
padding-bottom: calc(constant(safe-area-inset-bottom) + 10rpx) !important;
padding-bottom: calc(env(safe-area-inset-bottom) + 10rpx) !important;
}
.align-right {
text-align: right;
}
.color-text-white {
color: #fff;
}
.detail-container {
// height: 100vh;
.height-box {
display: block;
padding-bottom: 100rpx;
}
&.safe-area {
.height-box {
display: block;
padding-bottom: 168rpx;
}
}
}
.status-wrap {
background-size: 100% 100%;
padding: 40rpx;
height: 180rpx;
position: relative;
image {
width: 104rpx;
height: 86rpx;
margin-right: 20rpx;
margin-top: 20rpx;
}
.order-status-left {
display: flex;
}
.order-time {
position: absolute;
top: 70rpx;
right: 30rpx;
display: flex;
align-items: center;
font-size: 10px;
color: #fff;
image {
width: 26rpx;
height: 26rpx;
margin-right: 6rpx;
}
}
& > view {
text-align: center;
color: #fff;
}
.desc {
margin-left: 20rpx;
}
.price {
font-weight: 600;
}
.action-group {
text-align: center;
padding-top: 20rpx;
.action-btn {
line-height: 1;
padding: 16rpx 50rpx;
display: inline-block;
border-radius: $border-radius;
background: #fff;
box-shadow: 0 0 14rpx rgba(158, 158, 158, 0.6);
}
}
}
/deep/ #action-date .uni-countdown .uni-countdown__number {
border: none !important;
padding: 0 !important;
margin: 0 !important;
background: rgba(0, 0, 0, 0) !important;
}
.address-wrap {
@include wrap;
min-height: 100rpx;
margin-top: -69rpx;
.icon {
position: absolute;
top: 20rpx;
margin-right: 20rpx;
image {
width: 60rpx;
height: 60rpx;
}
.iconfont {
line-height: 50rpx;
font-size: $font-size-base;
}
.icon-mendian {
font-size: $font-size-toolbar;
}
}
.address-info {
padding-left: 40rpx;
.info {
display: flex;
line-height: 1;
color: #333;
}
.detail {
line-height: 1.3;
color: #333;
margin-top: 20rpx;
}
}
.store-info {
padding-left: 100rpx;
}
.cell-more {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 10rpx;
.iconfont {
color: #999;
}
}
}
.pickup-info {
@include wrap;
.pickup-point-info {
.name {
display: flex;
height: 50rpx;
align-items: flex-end;
margin-bottom: 10px;
text {
line-height: 1;
&.mark {
font-size: $font-size-activity-tag;
padding: 1px 10rpx;
border: 0.5px solid #ffffff;
border-radius: 4rpx;
margin-left: 10rpx;
}
}
}
.address,
.time,
.contact {
font-size: $font-size-tag;
line-height: 1;
margin-top: 16rpx;
.iconfont {
color: #999;
font-size: $font-size-tag;
line-height: 1;
margin-right: 10rpx;
}
}
}
.hr {
border-top: 1px dashed #e5e5e5;
margin: 20rpx 0;
}
.pickup-code-info {
.info {
text-align: center;
}
.code {
display: flex;
flex-direction: column;
align-items: center;
image.barcode {
width: 360rpx;
height: auto;
will-change: transform;
margin-top: 20rpx;
}
image.qrcode {
width: 240rpx;
height: auto;
will-change: transform;
margin-top: 50rpx;
}
}
.copy {
font-size: $font-size-tag;
display: inline-block;
color: #666;
background: #f7f7f7;
line-height: 1;
padding: 6rpx 14rpx;
margin-left: 10rpx;
border-radius: $border-radius;
border: 0.5px solid #666;
}
}
}
.virtual-mobile-wrap {
@include wrap;
margin-top: -69rpx;
display: flex;
view:nth-child(2) {
flex: 1;
text-align: right;
}
}
.verify-code-wrap {
@include wrap;
.wrap {
text-align: center;
line-height: 2;
.copy {
font-size: $font-size-tag;
display: inline-block;
color: #666;
background: #f7f7f7;
line-height: 1;
padding: 6rpx 14rpx;
margin-left: 10rpx;
border-radius: $border-radius;
border: 0.5px solid #666;
}
.virtual-code {
font-weight: bold;
}
}
.hr {
border-top: 1px dashed #e5e5e5;
margin: 20rpx 0;
}
.code {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
image.barcode {
width: 400rpx;
margin-top: 10rpx;
}
image.qrcode {
width: 300rpx;
margin-top: 50rpx;
}
text {
margin-top: 20rpx;
}
}
}
.verify-info-wrap {
@include wrap;
.head {
font-size: $font-size-base;
border-bottom: 1px dashed #f7f7f7;
line-height: 1;
padding: 10rpx 0 30rpx 0;
}
.order-cell {
.tit {
font-size: $font-size-base;
}
.box text {
font-size: $font-size-base;
font-weight: bold;
}
}
.record-empty {
text-align: center;
padding-top: 30rpx;
}
.record-item {
margin-bottom: 40rpx;
&:last-child {
margin-bottom: 0;
}
}
}
.carmichael {
.order-cell {
.tit {
font-size: $font-size-base;
}
.box text {
font-size: $font-size-base;
font-weight: normal;
}
.copy {
font-size: $font-size-activity-tag;
display: inline-block;
background: #f7f7f7;
line-height: 1;
padding: 6rpx 10rpx;
margin-left: 10rpx;
border-radius: $border-radius;
border: 2rpx solid #d2d2d2;
}
}
}
.site-wrap {
@include wrap;
padding: 10rpx 30rpx;
.site-header {
display: flex;
align-items: center;
.icon-dianpu {
display: inline-block;
line-height: 1;
margin-right: 12rpx;
font-size: $font-size-base;
}
}
.site-body {
.goods-item {
padding-top: 20rpx;
border-bottom: 2rpx solid #f7f7f7;
&:last-child {
border-bottom: 0;
}
}
.goods-wrap {
margin-bottom: 20rpx;
display: flex;
position: relative;
&:last-of-type {
margin-bottom: 0;
}
.goods-img {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx;
image {
width: 100%;
height: 100%;
border-radius: $border-radius;
}
}
.goods-info {
flex: 1;
position: relative;
display: flex;
flex-direction: column;
justify-content: space-between;
max-width: calc(100% - 180rpx);
.goods-name {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
line-height: 1.5;
font-size: $font-size-base;
font-weight: bold;
}
.goods-sub-section {
width: 100%;
line-height: 1.3;
display: flex;
margin-top: 20rpx;
.goods-price {
font-weight: 700;
font-size: $font-size-activity-tag;
color: var(--price-color);
}
.unit {
font-weight: 700;
font-size: $font-size-tag;
margin-right: 2rpx;
}
view {
flex: 1;
line-height: 1.3;
&:last-of-type {
text-align: right;
font-weight: bold;
.iconfont {
line-height: 1;
font-size: $font-size-tag;
}
}
}
}
.goods-card {
text-align: right;
}
}
}
.goods-form {
.tit {
font-size: $font-size-base;
width: 190rpx;
}
.box {
padding-right: 0;
text {
font-size: $font-size-base;
word-wrap: break-word;
word-break: break-all;
}
.copy {
font-size: $font-size-activity-tag !important;
display: inline-block;
background: #f7f7f7;
line-height: 1;
padding: 6rpx 10rpx;
margin-left: 20rpx;
border-radius: $border-radius;
border: 2rpx solid #d2d2d2;
float: right;
}
}
}
.goods-action {
text-align: right;
margin: 20rpx 0;
navigator {
display: inline-block;
}
.order-box-btn {
height: 48rpx !important;
line-height: 48rpx !important;
font-size: $font-size-tag !important;
display: inline-block;
background: #fff;
border: 2rpx solid #999;
margin-left: 10rpx;
box-sizing: content-box;
}
}
}
}
.order-cell {
display: flex;
margin: 20rpx 0;
align-items: center;
background: #fff;
line-height: 40rpx;
.tit {
text-align: left;
}
.box {
flex: 1;
padding: 0 20rpx;
line-height: inherit;
.textarea {
height: 40rpx;
}
}
.img-box {
display: flex;
flex-wrap: wrap;
.img {
width: 100rpx;
height: 100rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-right: 30rpx;
margin-bottom: 30rpx;
position: relative;
border-radius: $border-radius;
line-height: 1;
overflow: hidden;
image {
width: 100%;
}
}
}
.iconfont {
color: #bbb;
font-size: $font-size-base;
}
.order-pay {
padding: 0;
text {
display: inline-block;
margin-left: 6rpx;
}
}
}
.order-summary {
@include wrap;
.order-cell {
&:first-child {
margin-top: 0;
}
.tit {
font-size: $font-size-base;
width: 190rpx;
}
.box {
display: flex;
align-items: center;
text {
font-size: $font-size-base;
word-wrap: break-word;
word-break: break-all;
}
}
.copy {
white-space: nowrap;
font-size: $font-size-activity-tag !important;
display: inline-block;
background: #f7f7f7;
line-height: 1;
padding: 6rpx 10rpx;
margin-left: 10rpx;
border-radius: $border-radius;
border: 2rpx solid #d2d2d2;
}
}
.hr {
// width: calc(100% - 190rpx);
width: 100%;
height: 2rpx;
background: #f7f7f7;
margin-bottom: 20rpx;
}
}
.order-money {
@include wrap;
.order-cell {
.tit {
font-size: $font-size-base;
}
.box {
font-weight: 600;
padding: 0;
text-align: right;
text {
font-size: $font-size-base;
font-weight: bold;
}
> text.color-text {
color: var(--price-color);
}
.operator {
font-size: $font-size-tag;
margin-right: 6rpx;
}
&.align-right {
.color-base-text {
text {
color: var(--price-color);
}
}
}
}
}
}
.kefu {
@include wrap;
margin: 30rpx 0 10rpx;
border-top: 2rpx solid #f7f7f7;
padding-bottom: 0;
padding-top: 30rpx;
& > view {
@include flex-row-center;
.iconfont {
font-weight: bold;
margin-right: 10rpx;
font-size: $font-size-base;
line-height: 1;
}
}
button {
width: 100%;
// position: absolute;
border: none;
z-index: 1;
padding: 0;
margin: 0;
background: none;
height: 50rpx;
line-height: 50rpx;
display: flex;
justify-content: center;
&::after {
border: none !important;
}
.iconfont {
margin-right: 10rpx;
}
}
}
.fixed-bottom-box {
height: 80rpx;
}
.order-action {
text-align: right;
.order-box-btn {
margin-right: $margin-both;
margin-left: 0;
font-size: $font-size-tag;
height: 60rpx;
line-height: 60rpx;
box-sizing: content-box;
min-width: 60rpx;
text-align: center;
&.color-base-bg {
color: var(--btn-text-color);
}
&:last-child {
margin-right: 0;
}
}
}
.status-name {
view,
text {
font-size: $font-size-toolbar;
color: #fff;
line-height: 1;
margin-top: 40rpx;
text-align: left;
}
.desc {
font-size: $font-size-tag;
margin: 10rpx 0 0 0;
}
}
.head-nav {
width: 100%;
height: var(--status-bar-height);
}
.head-nav.active {
padding-top: 40rpx;
}
.head-return {
height: 90rpx;
line-height: 90rpx;
color: #fff;
font-weight: 600;
font-size: $font-size-toolbar;
position: relative;
text-align: center;
text {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 20rpx;
display: inline-block;
margin-right: 10rpx;
font-size: $font-size-toolbar;
}
}
.store-detail view {
font-size: $font-size-activity-tag;
}
.store-wrap {
@include wrap;
margin-top: -76rpx;
.store-info {
display: flex;
align-items: center;
padding-left: 50rpx;
position: relative;
.icon {
left: 0;
position: absolute;
top: 4rpx;
.iconfont {
line-height: 50rpx;
font-size: $font-size-base;
}
.icon-mendian {
font-size: $font-size-toolbar;
}
}
.store-name {
display: flex;
.name {
flex: 1;
}
}
.store-info-detail {
flex: 1;
.store-detail view {
font-size: $font-size-goods-tag + 2rpx;
}
& > view:first-of-type {
font-size: $font-size-tag + 2rpx;
}
}
.cell-more {
margin-left: 50rpx;
}
}
}
.pick-block {
&.first-pick-block {
border-top: 2rpx solid #f1f1f1;
}
display: flex;
align-items: center;
margin-top: 20rpx;
padding-top: 20rpx;
input,
.last-child {
flex: 1;
text-align: right;
font-size: $font-size-tag;
}
}
.sku {
display: flex;
line-height: 1;
margin-top: 10rpx;
margin-bottom: 10rpx;
}
.goods-spec {
color: #838383;
font-size: $font-size-goods-tag;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
}
.fixed-bottom {
width: 100%;
position: fixed;
left: 0;
bottom: 0;
padding: 10rpx 30rpx;
box-sizing: border-box;
background: #ffffff;
z-index: 5;
}
.order-cell.order-form {
.box {
display: block;
padding-right: 0;
.copy {
margin-left: 20rpx;
float: right;
}
}
}

View File

@@ -0,0 +1,410 @@
$margin-both: 24rpx;
.order-container {
width: 100vw;
}
.align-right {
text-align: right;
}
.cate-search {
width: calc(100% - 48rpx);
background: #ffffff;
padding: 10rpx 24rpx 0 24rpx;
/* #ifdef H5 */
padding-top: 30rpx;
/* #endif */
position: relative;
z-index: 998;
input {
font-size: $font-size-base;
height: 76rpx;
padding: 0 25rpx 0 30rpx;
line-height: 60rpx;
width: calc(100% - 120rpx);
background: none;
}
text {
font-size: 32rpx;
color: $color-tip;
width: 120rpx;
text-align: center;
}
.search-box {
width: 100%;
background: $color-bg;
display: flex;
justify-content: center;
align-items: center;
border-radius: 100rpx;
}
}
.order-nav {
width: 100vw;
height: 80rpx;
flex-direction: row;
/* #ifndef APP-PLUS */
white-space: nowrap;
/* #endif */
background: #fff;
display: flex;
position: fixed;
left: 0;
z-index: 998;
justify-content: space-around;
border-radius: 0px 0px 24rpx 24rpx;
.uni-tab-item {
width: 120rpx;
text-align: center;
}
.uni-tab-item-title {
display: inline-block;
height: 80rpx;
line-height: 80rpx;
border-bottom: 1px solid #fff;
flex-wrap: nowrap;
/* #ifndef APP-PLUS */
white-space: nowrap;
/* #endif */
text-align: center;
font-size: 30rpx;
position: relative;
}
.uni-tab-item-title-active::after {
content: ' ';
display: block;
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 6rpx;
background: linear-gradient(270deg, var(--base-color-light-9) 0%, var(--base-color) 100%);
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
}
.order-item {
margin: $margin-updown $margin-both;
border-radius: 12rpx;
background: #fff;
position: relative;
.order-header {
display: flex;
align-items: center;
position: relative;
padding: $padding 24rpx 26rpx 24rpx;
&.waitpay {
padding-left: 70rpx;
.icon-yuan_checked,
.icon-yuan_checkbox {
font-size: $font-size-toolbar;
position: absolute;
top: 48%;
left: 20rpx;
transform: translateY(-50%);
}
.icon-yuan_checkbox {
color: $color-tip;
}
}
.icon-dianpu {
display: inline-block;
line-height: 1;
margin-right: 12rpx;
font-size: $font-size-base;
}
.order-no {
font-size: 26rpx;
}
.order-type-name {
font-size: 26rpx;
margin-left: 10rpx;
}
.status-name {
flex: 1;
text-align: right;
font-size: 26rpx;
font-weight: 600;
}
}
.order-body {
.goods-wrap {
display: flex;
position: relative;
padding: 0 24rpx 30rpx 24rpx;
&:last-of-type {
margin-bottom: 0;
}
.goods-img {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx;
image {
width: 100%;
height: 100%;
border-radius: $border-radius;
}
}
.goods-info {
flex: 1;
position: relative;
max-width: calc(100% - 180rpx);
display: flex;
flex-direction: column;
.pro-info {
flex: 1;
}
.goods-name {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
line-height: 1.5;
font-size: $font-size-base;
color: $color-title;
}
.goods-sub-section {
width: 100%;
line-height: 1.3;
display: flex;
margin-top: 14rpx;
.goods-price {
font-size: $font-size-tag;
color: var(--price-color);
flex: 1;
font-weight: bold;
}
.goods-num {
font-size: $font-size-tag;
color: $color-tip;
flex: 1;
text-align: right;
line-height: 1;
.iconfont {
font-size: $font-size-tag;
}
}
.goods-type {
font-size: $font-size-tag;
}
.unit {
font-size: $font-size-tag;
margin-right: 2rpx;
}
view {
flex: 1;
line-height: 1.3;
display: flex;
flex-direction: column;
&:last-of-type {
text-align: right;
.iconfont {
line-height: 1;
font-size: $font-size-tag;
}
}
}
}
.goods-action {
text-align: right;
.action-btn {
line-height: 1;
padding: 14rpx 20rpx;
color: $color-title;
display: inline-block;
border-radius: $border-radius;
background: #fff;
border: 2rpx solid #999;
font-size: $font-size-tag;
margin-left: 10rpx;
}
}
}
}
.multi-order-goods {
width: calc(100vw - 96rpx);
white-space: nowrap;
margin: 0 24rpx 30rpx 24rpx !important;
position: relative;
.scroll-view {
width: 100%;
}
.goods-wrap {
padding: 0;
}
.goods-img {
min-width: 160rpx;
}
.shade {
position: absolute;
z-index: 5;
height: 100%;
width: 44rpx;
right: 0;
top: 0;
image {
width: 100%;
height: 100%;
}
}
}
}
.order-footer {
.order-base-info {
.total {
padding: $padding;
font-size: $font-size-tag;
background: rgba(248, 248, 248, 0.5);
display: flex;
margin: 0 24rpx;
& > text {
flex: 1;
line-height: 1;
margin-left: 10rpx;
}
}
.order-type {
padding-top: 20rpx;
flex: 0.5;
& > text {
line-height: 1;
}
}
}
.order-action {
text-align: right;
padding: 30rpx 24rpx;
position: relative;
.order-time {
position: absolute;
top: 35rpx;
left: 30rpx;
display: flex;
align-items: center;
font-size: 10px;
color: #b5b6b9;
image {
width: 26rpx;
height: 26rpx;
margin-right: 6rpx;
}
}
.action-btn {
line-height: 1;
padding: 20rpx 26rpx;
color: #333;
display: inline-block;
border-radius: $border-radius;
background: #fff;
border: 2rpx solid #999;
font-size: $font-size-tag;
margin-left: 10rpx;
}
}
}
}
/deep/ #action-date .uni-countdown .uni-countdown__number {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.order-batch-action {
position: fixed;
z-index: 5;
left: 0;
bottom: 0;
width: 100vw;
height: 100rpx;
background: #fff;
box-shadow: 0 0px 10px rgba(0, 0, 0, 0.1);
text-align: right;
&.bottom-safe-area {
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.action-btn {
height: 68rpx;
line-height: 68rpx;
background: #fff;
padding: 0 40rpx;
display: inline-block;
text-align: center;
margin: 16rpx 20rpx 16rpx 0;
border-radius: $border-radius;
border: 1px solid #ffffff;
&.white {
height: 68rpx;
line-height: 68rpx;
color: #333;
border: 1px solid #999;
background: #fff;
}
}
}
.sku {
display: flex;
line-height: 1;
margin-top: 10rpx;
}
.goods-spec {
color: $color-tip;
font-size: $font-size-goods-tag;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
}

View File

@@ -0,0 +1,262 @@
export default {
methods: {
/**
* 订单支付
* @param {Object} orderData
*/
orderPay(orderData) {
if (orderData.adjust_money == 0) {
this.pay();
} else {
uni.showModal({
title: '提示',
content: '商家已将支付金额调整为' + orderData.pay_money + '元,是否继续支付?',
success: res => {
if (res.confirm) {
this.pay();
}
}
})
}
},
pay() {
this.$api.sendRequest({
url: '/api/order/pay',
data: {
order_ids: this.orderData.order_id
},
success: res => {
if (res.code >= 0) {
this.$refs.choosePaymentPopup.getPayInfo(res.data);
} else {
this.$util.showToast({
title: res.message
});
}
}
})
},
/**
* 关闭订单
* @param order_id
* @param callback
*/
orderClose(order_id, callback) {
uni.showModal({
title: '提示',
content: '您确定要关闭该订单吗?',
success: res => {
if (res.confirm) {
this.$api.sendRequest({
url: '/api/order/close',
data: {
order_id
},
success: res => {
if (res.code >= 0) {
typeof callback == 'function' && callback();
} else {
this.$util.showToast({
title: '当前订单可能存在拼团,维权等操作,' + res.message +
'不可以关闭哦!',
duration: 2000
})
}
}
})
}
}
})
},
/**
* 订单收货
* @param orderData
* @param callback
*/
orderDelivery(orderData, callback) {
// 如果不在微信小程序中
// #ifndef MP-WEIXIN
uni.showModal({
title: '提示',
content: '您确定已经收到货物了吗?',
success: res => {
if (res.confirm) {
this.$api.sendRequest({
url: '/api/order/takedelivery',
data: {
order_id: orderData.order_id
},
success: res => {
this.$util.showToast({
title: res.message
})
typeof callback == 'function' && callback();
}
})
}
}
})
// #endif
// #ifdef MP-WEIXIN
// 检测微信小程序是否已开通发货信息管理服务
if (orderData.pay_type == 'wechatpay' && wx.openBusinessView && orderData.is_trade_managed) {
wx.openBusinessView({
businessType: 'weappOrderConfirm',
extraData: {
merchant_id: orderData.pay_config.mch_id,
merchant_trade_no: orderData.out_trade_no
},
success: res => {
if (res.extraData.status == 'success') {
this.$api.sendRequest({
url: '/api/order/takedelivery',
data: {
order_id: orderData.order_id
},
success: res => {
this.$util.showToast({
title: res.message
})
typeof callback == 'function' && callback();
}
})
} else {
this.$api.sendRequest({
url: '/api/order/takedelivery',
data: {
order_id: orderData.order_id
},
success: res => {
this.$util.showToast({
title: res.message
})
typeof callback == 'function' && callback();
}
})
}
},
fail: function(res) {
console.log('fail', res);
}
})
} else {
uni.showModal({
title: '提示',
content: '您确定已经收到货物了吗?',
success: res => {
if (res.confirm) {
this.$api.sendRequest({
url: '/api/order/takedelivery',
data: {
order_id: orderData.order_id
},
success: res => {
this.$util.showToast({
title: res.message
})
typeof callback == 'function' && callback();
}
})
}
}
})
}
// #endif
},
/**
* 订单虚拟商品收货
* @param orderData
* @param callback
*/
orderVirtualDelivery(orderData, callback) {
// 如果不在微信小程序中
// #ifndef MP-WEIXIN
uni.showModal({
title: '提示',
content: '您确定要进行收货吗?',
success: res => {
if (res.confirm) {
this.$api.sendRequest({
url: '/api/order/membervirtualtakedelivery',
data: {
order_id: orderData.order_id
},
success: res => {
this.$util.showToast({
title: res.message
})
typeof callback == 'function' && callback();
}
})
}
},
})
// #endif
// #ifdef MP-WEIXIN
// 检测微信小程序是否已开通发货信息管理服务
if (orderData.pay_type == 'wechatpay' && wx.openBusinessView && orderData.is_trade_managed) {
wx.openBusinessView({
businessType: 'weappOrderConfirm',
extraData: {
merchant_id: orderData.pay_config.mch_id,
merchant_trade_no: orderData.out_trade_no
},
success: res => {
if (res.extraData.status == 'success') {
this.$api.sendRequest({
url: '/api/order/membervirtualtakedelivery',
data: {
order_id: orderData.order_id
},
success: res => {
this.$util.showToast({
title: res.message
})
typeof callback == 'function' && callback();
}
})
} else {
this.$api.sendRequest({
url: '/api/order/membervirtualtakedelivery',
data: {
order_id: orderData.order_id
},
success: res => {
this.$util.showToast({
title: res.message
})
typeof callback == 'function' && callback();
}
})
}
},
fail: function(res) {}
})
} else {
uni.showModal({
title: '提示',
content: '您确定要进行收货吗?',
success: res => {
if (res.confirm) {
this.$api.sendRequest({
url: '/api/order/membervirtualtakedelivery',
data: {
order_id: orderData.order_id
},
success: res => {
this.$util.showToast({
title: res.message
})
typeof callback == 'function' && callback();
}
})
}
},
})
}
// #endif
},
}
}

View File

@@ -0,0 +1,30 @@
export default {
methods: {
/**
* 撤销退款申请
* @param {Object} order_goods_id
* @param {Object} callback
*/
cancleRefund(order_goods_id, callback) {
uni.showModal({
content: '撤销之后本次申请将会关闭,如后续仍有问题可再次发起申请。',
cancelText: '暂不撤销',
cancelColor: '#898989',
success: res => {
if (res.confirm) {
this.$api.sendRequest({
url: '/api/orderrefund/cancel',
data: {
order_goods_id
},
success: res => {
typeof callback == 'function' && callback(res);
}
})
}
}
})
},
}
}