123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329 |
- <template>
- <view class="order-pay">
- <view class="top-tip">请对每家店铺分别进行付款</view>
- <template v-for="item in orderList">
- <view class="shop-info" :key="item.shopId">
- <view class="shop-name">{{ item.shopName }}</view>
- <view class="product-list">
- <template v-for="product in item.orderProductList">
- <view class="product" :key="product.orderProductId">
- <image class="cover" :src="product.productImage" mode="widthFix"></image>
- <view class="content">
- <view class="title">{{ product.name }}</view>
- <view class="unit">规格:{{ product.productUnit }}</view>
- <view class="tags">
- <template v-if="product.activeStatus">
- <view class="tag type1" v-if="userId === product.heUserId">促销</view>
- <view class="tag type1" v-else>自营</view>
- <view
- class="tag type2"
- v-if="product.ladderList && product.ladderList.length > 0"
- >
- 活动价
- </view>
- </template>
- </view>
- <view class="price">
- <text class="active">¥{{ product.price | formatPrice }}</text>
- <text class="deleted">¥{{ product.normalPrice | formatPrice }}</text>
- </view>
- </view>
- </view>
- </template>
- </view>
- <view class="total">
- <text v-if="item.eachDiscount">优惠:¥{{ item.eachDiscount }}</text>
- <text v-if="item.receiptAmount">已付:¥{{ item.receiptAmount }}</text>
- </view>
- <view class="foot">
- <view class="price">
- <text>待付:</text>
- <text class="active">¥{{ item.restAmount | formatPrice }}</text>
- </view>
- <view class="submit" @click="onPayOrder(item)">付款</view>
- </view>
- </view>
- </template>
- <!-- <view class="shop-info">
- <view class="shop-name">采美快递物流商</view>
- <view class="product-list">
- <view class="product">
- <image class="cover" src="https://static.caimei365.com/app/mini-hehe/icon/icon-logistics.png" mode="widthFix"></image>
- <view class="content between">
- <view class="title">运费</view>
- <view class="price"><text>¥50.00</text></view>
- <view class="count">×7</view>
- </view>
- </view>
- </view>
- <view class="total">
- <text>优惠:¥20.00</text>
- <text>已付:¥0</text>
- </view>
- <view class="foot">
- <view class="price">
- <text>待付:</text>
- <text class="active">¥100.00</text>
- </view>
- <view class="submit" @click="onPay">付款</view>
- </view>
- </view> -->
- <!-- 弹框 -->
- <!-- <tui-modal
- :show="modal"
- :size="30"
- :button="[{ text: '确定', type: 'danger' }]"
- shape="circle"
- color="#333333"
- title="提示"
- content="抱歉,该商品支付正在调整暂不支持下单!"
- @click="onConfirm"
- ></tui-modal> -->
- <!-- 操作弹窗 -->
- <tui-modal
- :show="modal"
- content="确认支付?"
- :size="32"
- :maskClosable="false"
- color="#333"
- shape="circle"
- @click="handleModalConfirm"
- ></tui-modal>
- <!-- 加载框 -->
- <cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
- </view>
- </template>
- <script>
- import { mapGetters } from 'vuex'
- import wechatPay from './mixins/wechatPay.js'
- import CmLoading from '@/components/cm-module/cm-loading/cm-loading.vue'
- export default {
- mixins: [wechatPay],
- components: {
- CmLoading
- },
- data() {
- return {
- orderId: '',
- modal: false,
- orderList: [],
- hanldOrder: {
- order: {}
- }
- }
- },
- computed: {
- ...mapGetters(['userId'])
- },
- onLoad(option) {
- this.orderId = option.orderId
- this.getOrderDetail()
- },
- methods: {
- // 支付回调执行函数
- orderPaySuccess() {
- this.$on('orderPaySuccess', () => {
- const orderInfo = this.hanldOrder.order
- this.getOrderDetail()
- if (orderInfo.collageFlag) {
- uni.navigateTo({ url: `/pages/fight-order/fight-detail?collageId=${orderInfo.collageId}` })
- } else {
- uni.redirectTo({ url: '/pages/order/success' })
- }
- })
- },
- handleModalConfirm() {
- this.modal = false
- this.miniWxPayFor(this.hanldOrder.order)
- },
- // 子订单支付
- onPayOrder(orderInfo) {
- orderInfo.payableAmount = orderInfo.restAmount
- this.hanldOrder.order = orderInfo
- this.modal = true
- },
- getOrderDetail() {
- this.OrderService.QueryOrderDetails({ orderId: this.orderId })
- .then(res => {
- this.orderList = res.data.shopOrderList
- })
- .catch(err => {
- this.$util.modal('提示', '订单查询失败,请稍后重试~', '确定', '', false, () => {
- this.$api.switchTabTo('/pages/tabBar/index/index')
- })
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .order-pay {
- min-height: 100vh;
- background: #f7f7f7;
- .top-tip {
- position: sticky;
- top: 0;
- z-index: 99;
- width: 750rpx;
- height: 80rpx;
- line-height: 80rpx;
- padding: 0 24rpx;
- background: #fff3f7;
- color: #ff457b;
- font-size: 26rpx;
- box-sizing: border-box;
- }
- .shop-info {
- padding: 32rpx 24rpx;
- background-color: #fff;
- margin-bottom: 20rpx;
- .shop-name {
- font-size: 30rpx;
- color: #333333;
- font-weight: bold;
- }
- .product-list {
- .product {
- display: flex;
- margin: 20rpx 0;
- .cover {
- width: 180rpx;
- height: 180rpx;
- border-radius: 8rpx;
- background-color: #f7f7f7;
- }
- .content {
- position: relative;
- width: 500rpx;
- margin-left: 16rpx;
- .count {
- position: absolute;
- bottom: 0;
- right: 0;
- font-size: 26rpx;
- color: #666;
- }
- &.between {
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- }
- .title {
- font-size: 28rpx;
- color: #333333;
- text-align: justify;
- height: 72rpx;
- line-height: 36rpx;
- }
- .unit {
- font-size: 20rpx;
- color: #999999;
- margin: 8rpx 0;
- }
- .tags {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- width: 100%;
- height: 30rpx;
- .tag {
- margin-right: 8rpx;
- font-size: 22rpx;
- height: 30rpx;
- line-height: 30rpx;
- text-align: center;
- &.type1 {
- padding: 0 8rpx;
- background: #f83c6c;
- border-radius: 4rpx;
- color: #fff;
- }
- &.type2 {
- width: 80rpx;
- color: #f83c6c;
- background: url(https://static.caimei365.com/app/mini-hehe/icon/icon-active.png) top
- center no-repeat;
- background-size: contain;
- }
- &.type3 {
- width: 80rpx;
- background: linear-gradient(270deg, #ff457b 0%, #b03bb8 51%, #6431f2 100%);
- color: #fff;
- border-radius: 4rpx;
- }
- &.type4 {
- border: 1rpx solid #f83c6c;
- padding: 0 6rpx;
- color: #f83c6c;
- border-radius: 4rpx;
- }
- }
- }
- }
- .price {
- font-size: 26rpx;
- .active {
- color: #ff457b;
- }
- .deleted {
- margin-left: 24rpx;
- font-size: 24rpx;
- color: #999;
- text-decoration: line-through;
- }
- }
- }
- }
- .total {
- padding-left: 220rpx - 24rpx;
- margin: 16rpx 0 20rpx;
- font-size: 26rpx;
- color: #333;
- text {
- &:nth-child(2) {
- margin-left: 56rpx;
- }
- }
- }
- .foot {
- display: flex;
- justify-content: flex-end;
- align-items: center;
- .price {
- font-size: 26rpx;
- color: #333333;
- .active {
- color: #ff457b;
- }
- }
- .submit {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 160rpx;
- height: 64rpx;
- margin-left: 40rpx;
- background: linear-gradient(90deg, #fa55bf 0%, #f83c6c 100%);
- color: #ffffff;
- border-radius: 32rpx;
- font-size: 26rpx;
- }
- }
- }
- }
- </style>
|