123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- <template>
- <view class="order-detail" :class="{ hasBottom: hasControlNav }">
- <tui-skeleton v-if="isRequest" loadingType="2"></tui-skeleton>
-
- <view class="detail-top">
- <!-- 订单状态 -->
- <view class="order-status">{{ stateExpFormat(orderInfo.status) }}</view>
- <!-- 收货地址 -->
- <cm-choose-address :addressData="userInfo" disabled></cm-choose-address>
- </view>
- <!-- 订单商品列表 -->
- <template v-for="(shopOrder, shopOrderIndex) in shopOrderList">
- <view class="grid" :key="shopOrderIndex"></view>
- <view class="shop-section" :key="shopOrderIndex">
- <!-- 供应商 -->
- <view class="origin">
- <image class="cover" :src="shopOrder.shopLogo"></image>
- <view class="name">{{ shopOrder.shopName }}</view>
- </view>
- <!-- 商品列表 -->
- <view class="goods-list">
- <!-- 商品信息 -->
- <view class="order-goods" v-for="goods in shopOrder.orderProductList" :key="goods.productId">
- <cm-order-prodcut :goods-data="goods"></cm-order-prodcut>
- </view>
- </view>
- <view class="line"></view>
- <!-- 统计 -->
- <view class="total">
- <view class="count">共{{ shopOrder.itemCount }}件商品</view>
- <view class="status">
- <text class="label">商品总额:</text>
- <text>¥{{ shopOrder.totalAmount | formatPrice }}</text>
- </view>
- </view>
- </view>
- </template>
- <view class="grid"></view>
- <!-- 订单详细信息 -->
- <cm-order-information :orderInfo="orderInfo"></cm-order-information>
- <!-- 操作 -->
- <view class="order-control" v-if="hasControlNav">
- <cm-order-control-nav
- :orderInfo="orderInfo"
- @confirm="handleConfirmClick"
- @change="getCount"
- ></cm-order-control-nav>
- </view>
- <!-- 操作弹窗 -->
- <tui-modal
- :show="modal"
- :content="modalText"
- :size="32"
- :maskClosable="false"
- color="#333"
- shape="circle"
- @click="handleModalConfirm"
- ></tui-modal>
- <!-- 加载框 -->
- <cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
- <!-- 失效商品列表 -->
- <cm-order-invalid-modal
- :goodsList="invalidList"
- :visible="buyAgainModal"
- @confirm="buyAgainModalClick"
- @cancel="buyAgainModalHide"
- ></cm-order-invalid-modal>
- <!-- 底部占位 -->
- <view class="reserved" v-if="isIphoneX"></view>
- </view>
- </template>
- <script>
- import CmChooseAddress from '@/components/cm-module/cm-choose-address/cm-choose-address.vue' //地址信息
- import CmOrderProdcut from '@/components/cm-module/cm-order-prodcut/cm-order-prodcut.vue'
- import CmOrderInformation from '@/components/cm-module/cm-order-information/cm-order-information.vue'
- import CmOrderControlNav from '@/components/cm-module/cm-order-control-nav/cm-order-control-nav.vue'
- import CmOrderInvalidModal from '@/components/cm-module/cm-order-invalid-modal/cm-order-invalid-modal.vue'
- import CmLoading from '@/components/cm-module/cm-loading/cm-loading.vue'
- import orderList from './mixins/orderList.js'
- import wechatPay from './mixins/wechatPay.js'
- import { mapGetters } from 'vuex'
- export default {
- mixins: [wechatPay, orderList],
- components: {
- CmOrderProdcut,
- CmOrderInformation,
- CmOrderControlNav,
- CmOrderInvalidModal,
- CmLoading,
- CmChooseAddress
- },
- data() {
- return {
- isRequest: false,
- orderId: '',
- discernReceiptList: [],
- shopOrderList: [],
- orderInfo: {},
- userInfo: {},
- buttonCount: 0
- }
- },
- computed: {
- ...mapGetters(['userId', 'userIdentity', 'isIphoneX']),
- // 当前用户是否为协销
- isDealer() {
- return this.userIdentity === 2
- },
- hasControlNav() {
- return this.orderInfo.buyUserId === this.userId && this.buttonCount > 0
- }
- },
- onLoad(option) {
- this.orderId = option.orderId
- this.getOrderDetail()
- },
- methods: {
- getOrderDetail() {
- this.OrderService.QueryOrderDetails({ orderId: this.orderId })
- .then(res => {
- this.discernReceiptList = res.data.discernReceiptList
- this.shopOrderList = res.data.shopOrderList
- this.orderInfo = res.data.order
- this.userInfo = res.data.userInfo
- })
- .catch(err => {
- this.$util.modal('提示', '订单查询失败,请稍后重试~', '确定', '', false, () => {
- this.$api.switchTabTo('/pages/tabBar/index/index')
- })
- })
- .finally(() => {
- this.isRequest = false
- })
- },
- getCount(e) {
- this.buttonCount = e.count
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .order-detail {
- min-height: 100vh;
- background: #f7f7f7;
- padding-top: 138rpx + 60rpx;
- box-sizing: border-box;
- &.has-bottom {
- padding-bottom: 100rpx;
- }
-
- .order-status{
- height: 60rpx;
- font-size: 26rpx;
- line-height: 26rpx;
- padding: 34rpx 24rpx 0;
- box-sizing: border-box;
- color: #FF457B;
- background: #fff;
- }
-
- .detail-top {
- height: 134rpx + 60rpx;
- position: fixed;
- top: 0;
- z-index: 999;
- }
-
- .grid {
- height: 20rpx;
- background: #f7f7f7;
- }
- .shop-section {
- background: #fff;
- overflow: hidden;
- .line {
- width: 702rpx;
- height: 1px;
- background: #f7f7f7;
- margin: 0 auto;
- }
- .origin {
- padding: 0 24rpx;
- margin-top: 24rpx;
- margin-bottom: 16rpx;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .cover {
- width: 56rpx;
- height: 56rpx;
- border-radius: 4rpx;
- border: 1px solid #f7f7f7;
- box-sizing: border-box;
- }
- .name {
- margin-left: 16rpx;
- font-size: 30rpx;
- color: #333333;
- font-weight: bold;
- }
- }
- .goods-list {
- margin-bottom: 32rpx;
- .order-goods {
- padding-top: 32rpx;
- &:first-child {
- padding-top: 0;
- }
- }
- }
- }
- .total {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 24rpx;
- margin: 32rpx 0;
- font-size: 26rpx;
- color: #333333;
- .count {
- font-weight: bold;
- }
- .status {
- color: #ff457b;
- .label {
- color: #333333;
- }
- }
- }
- .order-control {
- position: fixed;
- width: 100%;
- box-sizing: border-box;
- height: 100rpx;
- display: flex;
- justify-content: flex-end;
- align-items: center;
- bottom: 0;
- background: #fff;
- }
- }
- </style>
|