123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- <template>
- <view class="container cashier">
- <view class="pay-content">
- <view class="pay-list" v-for="(list, index) in list" :key="index">
- <view class="pay-list-title">{{ list.shopName }}</view>
- <view class="pay-list-goods" v-for="(pros, prosIndex) in list.orderProductList" :key="prosIndex">
- <view class="pay-list-image"> <image :src="pros.image" class="image" mode=""></image> </view>
- <view class="pay-list-info">
- <view class="info-title">{{ pros.name }}</view>
- <view class="info-view" v-if="pros.productUnit != ''">
- 规格:{{ pros.productUnit ? pros.productUnit : '' }}
- </view>
- <view class="info-price">
- <view class="price">¥{{ pros.price | NumFormat }}</view>
- <view class="count"><text class="sm">X</text> {{ pros.num }}</view>
- </view>
- </view>
- </view>
- <view class="pay-list-msg">
- <view class="list-label">运费:</view>
- <view class="list-msg">
- <text class="text"> {{ list.postageInfo }}</text>
- </view>
- </view>
- <view class="pay-list-msg">
- <view class="list-label">已付:</view>
- <view class="list-msg">
- <text class="text">
- ¥{{ list.receiptAmount | NumFormat }}
- <text v-if="list.accountAmount > 0"> (余额抵扣:¥{{ list.accountAmount | NumFormat }}) </text>
- </text>
- </view>
- </view>
- <view class="pay-list-msg" v-if="list.eachDiscount > 0">
- <view class="list-label">优惠:</view>
- <view class="list-msg">¥{{ list.shopeachDiscountPostFee | NumFormat }}</view>
- </view>
- <view class="pay-list-msg">
- <view class="list-label">待付:</view>
- <view class="list-msg"><text class="text red"> ¥{{ list.obligation | NumFormat }}</text></view>
- </view>
- <view class="pay-list-btn" >
- <view
- class="btn"
- v-if="list.onlinePay === 0 || list.onlinePay === 1"
- @click="handlePayOrder(list.shopOrderId)"
- >线上支付</view
- >
- <view
- class="btn none"
- v-if="list.onlinePay === 0 || list.onlinePay === 2"
- @click="handlePayunder(list.shopOrderId)"
- >线下转账</view
- >
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- orderId: 0,
- shopOrderId:0,
- list: []
- }
- },
- onLoad(option) {
- this.initData(option)
- },
- filters: {
- NumFormat(value) {
- //处理金额
- if (value) {
- return Number(value).toFixed(2)
- } else {
- return '0.00'
- }
- }
- },
- methods: {
- initData(e) {
- console.log(e)
- this.orderId = e.orderId
- this.shopOrderId = e.shopOrderId
- this.PayOrderShoporders(this.orderId,this.shopOrderId)
- },
- async PayOrderShoporders(orderId,shopOrderId) {
- try{
- let params = {}
- if(orderId){
- params = { orderId: orderId }
- }
- if(shopOrderId){
- params = { shopOrderId: shopOrderId }
- }
- const res = await this.PayService.PayOrderShoporders(params)
- this.list = res.data
- }catch(error){
- this.$util.msg(error.msg, 2000)
- }
- },
- handlePayOrder(shopOrderId) {
- this.$api.navigateTo(`/pages/user/pay/card-order?shopOrderId=${shopOrderId}`)
- },
- handlePayunder(shopOrderId) {
- this.$api.navigateTo(`/pages/user/pay/card-under?shopOrderId=${shopOrderId}`)
- }
- },
- onShow() {}
- }
- </script>
- <style lang="scss">
- page {
- height: auto !important;
- background-color: #f7f7f7;
- }
- .cashier {
- width: 100%;
- }
- .pay-content {
- width: 100%;
- height: auto;
- .pay-list {
- width: 100%;
- height: auto;
- padding: 30rpx 24rpx 30rpx 24rpx;
- box-sizing: border-box;
- background-color: #ffffff;
- margin-bottom: 20rpx;
- .pay-list-title {
- width: 100%;
- height: 42rpx;
- line-height: 42rpx;
- font-size: $font-size-30;
- color: #333333;
- font-weight: bold;
- margin-bottom: 20rpx;
- }
- .pay-list-goods {
- width: 100%;
- height: 180rpx;
- margin-bottom: 30rpx;
- .pay-list-image {
- width: 180rpx;
- height: 180rpx;
- box-sizing: border-box;
- border: 1px solid #e1e1e1;
- border-radius: 8rpx;
- float: left;
- margin-right: 13rpx;
- .image {
- width: 100%;
- height: 100%;
- display: block;
- border-radius: 8rpx;
- }
- }
- .pay-list-info {
- width: 508rpx;
- height: 100%;
- float: right;
- .info-title {
- width: 100%;
- display: inline-block;
- height: auto;
- text-overflow: ellipsis;
- display: -webkit-box;
- word-break: break-all;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
- line-height: 38rpx;
- font-size: $font-size-28;
- color: #333333;
- }
- .info-view {
- height: 40rpx;
- line-height: 40rpx;
- color: #999999;
- text-overflow: ellipsis;
- display: -webkit-box;
- word-break: break-all;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
- font-size: $font-size-22;
- color: #999999;
- }
- .info-price {
- height: 40rpx;
- width: 100%;
- float: left;
- line-height: 40rpx;
- font-size: $font-size-28;
- margin-top: 40rpx;
- .price {
- color: #F85050;
- float: left;
- }
- .count {
- float: right;
- color: #666666;
- .sm {
- font-size: $font-size-22;
- }
- }
- }
- }
- }
- .pay-list-msg {
- width: 100%;
- height: 40rpx;
- line-height: 40rpx;
- font-size: $font-size-28;
- margin-bottom: 30rpx;
- .list-label{
- float: left;
- font-size: $font-size-28;
- color: #333333;
- }
- .list-msg {
- float: right;
- margin-left: 30rpx;
- font-size: $font-size-28;
- color: #333333;
- font-weight: bold;
- .text {
- font-weight: normal;
- &.red {
- color: #f94b4b;
- font-weight: bold;
- }
- }
- }
- }
- .pay-list-btn {
- width: 100%;
- height: 64rpx;
- .btn {
- width: 160rpx;
- height: 64rpx;
- line-height: 64rpx;
- background: #F94B4B;
- font-size: $font-size-26;
- text-align: center;
- float: right;
- color: #ffffff;
- border-radius: 32rpx;
- margin-left: 20rpx;
- &.none{
- background: #FF5B00;
- }
- }
- .list-msg {
- float: right;
- line-height: 64rpx;
- margin-right: 40rpx;
- font-size: $font-size-26;
- color: #333333;
- font-weight: bold;
- .text {
- font-weight: normal;
- &.red {
- color: #f94b4b;
- }
- }
- }
- }
- }
- }
- </style>
|