order-pay-list.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <view class="container cashier">
  3. <view class="pay-content">
  4. <view class="pay-list" v-for="(list, index) in list" :key="index">
  5. <view class="pay-list-title">{{ list.shopName }}</view>
  6. <view class="pay-list-goods" v-for="(pros, prosIndex) in list.orderProductList" :key="prosIndex">
  7. <view class="pay-list-image"> <image :src="pros.image" class="image" mode=""></image> </view>
  8. <view class="pay-list-info">
  9. <view class="info-title">{{ pros.name }}</view>
  10. <view class="info-view" v-if="pros.productUnit != ''">
  11. 规格:{{ pros.productUnit ? pros.productUnit : '' }}
  12. </view>
  13. <view class="info-view" v-if="pros.productCode != '' && pros.productCode != null">
  14. 商品编码:{{ pros.productCode ? pros.productCode : '' }}
  15. </view>
  16. <view class="info-price">
  17. <view class="price">¥{{ pros.price | NumFormat }}</view>
  18. <view class="count"><text class="sm">X</text> {{ pros.num }}</view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="pay-list-msg">
  23. <view class="list-msg" v-if="list.shopPostFee > 0"
  24. >运费:<text class="text">¥{{ list.shopPostFee | NumFormat }}</text></view
  25. >
  26. <view class="list-msg" v-if="list.receiptAmount > 0">
  27. 已付:
  28. <text class="text">
  29. ¥{{ list.receiptAmount | NumFormat }}
  30. <text> 余额抵扣:(¥{{ list.canRefundAmount | NumFormat }}) </text>
  31. </text>
  32. </view>
  33. <view class="list-msg" v-if="list.eachDiscount > 0"
  34. >优惠:<text class="text">¥{{ list.eachDiscount | NumFormat }}</text></view
  35. >
  36. </view>
  37. <view class="pay-list-btn">
  38. <view
  39. class="btn"
  40. v-if="list.onlinePay === 0 || list.onlinePay === 2 || list.onlinePay === 3"
  41. @click="handlePayunder(list.shopOrderId)"
  42. >线下转账</view
  43. >
  44. <view
  45. class="btn"
  46. v-if="list.onlinePay === 0 || list.onlinePay === 1"
  47. @click="handlePayOrder(list.shopOrderId)"
  48. >线上支付</view
  49. >
  50. <view class="list-msg" v-if="list.obligation > 0"
  51. >待付:<text class="text red">¥{{ list.obligation | NumFormat }}</text></view
  52. >
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. orderId: 0,
  63. showPayUnder: false,
  64. list: []
  65. }
  66. },
  67. onLoad(option) {
  68. this.initData(option)
  69. },
  70. filters: {
  71. NumFormat(value) {
  72. //处理金额
  73. if (value) {
  74. return Number(value).toFixed(2)
  75. } else {
  76. return '0.00'
  77. }
  78. }
  79. },
  80. methods: {
  81. initData(e) {
  82. console.log(e)
  83. this.orderId = e.orderId
  84. this.payOrderId = '#' + e.orderId + '#'
  85. this.PayOrderShoporders(this.orderId)
  86. },
  87. PayOrderShoporders(orderId) {
  88. this.PayService.PayOrderShoporders({ orderId: orderId })
  89. .then(response => {
  90. this.list = response.data
  91. this.PayOrderCheckoutCounter(orderId)
  92. })
  93. .catch(error => {
  94. this.$util.msg(error.msg, 2000)
  95. })
  96. },
  97. PayOrderCheckoutCounter(orderId) {
  98. this.PayService.PayOrderCheckoutCounter({ orderId: orderId })
  99. .then(response => {
  100. let data = response.data
  101. if (data.discernReceipt.length > 0) {
  102. this.showPayUnder = true
  103. }
  104. })
  105. .catch(error => {
  106. this.$util.msg(error.msg, 2000)
  107. })
  108. },
  109. handlePayOrder(shopOrderId) {
  110. this.$api.navigateTo(`/pages/user/pay/card-order?shopOrderId=${shopOrderId}`)
  111. },
  112. handlePayunder(shopOrderId) {
  113. this.$api.navigateTo(`/pages/user/order/order-payunder?orderId=${this.orderId}`)
  114. }
  115. },
  116. onShow() {}
  117. }
  118. </script>
  119. <style lang="scss">
  120. page {
  121. height: auto !important;
  122. background-color: #f7f7f7;
  123. }
  124. .cashier {
  125. width: 100%;
  126. }
  127. .pay-content {
  128. width: 100%;
  129. height: auto;
  130. .pay-list {
  131. width: 100%;
  132. height: auto;
  133. padding: 30rpx 24rpx 30rpx 24rpx;
  134. box-sizing: border-box;
  135. background-color: #ffffff;
  136. margin-bottom: 20rpx;
  137. .pay-list-title {
  138. width: 100%;
  139. height: 42rpx;
  140. line-height: 42rpx;
  141. font-size: $font-size-30;
  142. color: #333333;
  143. margin-bottom: 20rpx;
  144. }
  145. .pay-list-goods {
  146. width: 100%;
  147. height: 180rpx;
  148. margin-bottom: 30rpx;
  149. .pay-list-image {
  150. width: 180rpx;
  151. height: 180rpx;
  152. box-sizing: border-box;
  153. border: 1px solid #e1e1e1;
  154. border-radius: 8rpx;
  155. float: left;
  156. margin-right: 13rpx;
  157. .image {
  158. width: 100%;
  159. height: 100%;
  160. display: block;
  161. border-radius: 8rpx;
  162. }
  163. }
  164. .pay-list-info {
  165. width: 508rpx;
  166. height: 100%;
  167. float: right;
  168. .info-title {
  169. width: 100%;
  170. display: inline-block;
  171. height: auto;
  172. text-overflow: ellipsis;
  173. display: -webkit-box;
  174. word-break: break-all;
  175. -webkit-box-orient: vertical;
  176. -webkit-line-clamp: 2;
  177. overflow: hidden;
  178. line-height: 38rpx;
  179. font-size: $font-size-28;
  180. color: #333333;
  181. }
  182. .info-view {
  183. height: 40rpx;
  184. line-height: 40rpx;
  185. color: #999999;
  186. text-overflow: ellipsis;
  187. display: -webkit-box;
  188. word-break: break-all;
  189. -webkit-box-orient: vertical;
  190. -webkit-line-clamp: 2;
  191. overflow: hidden;
  192. font-size: $font-size-22;
  193. color: #999999;
  194. }
  195. .info-price {
  196. height: 40rpx;
  197. width: 100%;
  198. float: left;
  199. line-height: 40rpx;
  200. font-size: $font-size-26;
  201. .price {
  202. color: #333333;
  203. float: left;
  204. }
  205. .count {
  206. float: right;
  207. color: #666666;
  208. .sm {
  209. font-size: $font-size-22;
  210. }
  211. }
  212. }
  213. }
  214. }
  215. .pay-list-msg {
  216. width: 100%;
  217. height: 40rpx;
  218. line-height: 40rpx;
  219. font-size: $font-size-26;
  220. margin-bottom: 30rpx;
  221. .list-msg {
  222. float: right;
  223. margin-left: 30rpx;
  224. font-size: $font-size-26;
  225. color: #333333;
  226. font-weight: bold;
  227. .text {
  228. font-weight: normal;
  229. &.red {
  230. color: #f94b4b;
  231. }
  232. }
  233. }
  234. }
  235. .pay-list-btn {
  236. width: 100%;
  237. height: 64rpx;
  238. .btn {
  239. width: 160rpx;
  240. height: 64rpx;
  241. line-height: 64rpx;
  242. background: $btn-confirm;
  243. font-size: $font-size-26;
  244. text-align: center;
  245. float: right;
  246. color: #ffffff;
  247. border-radius: 32rpx;
  248. }
  249. .list-msg {
  250. float: right;
  251. line-height: 64rpx;
  252. margin-right: 40rpx;
  253. font-size: $font-size-26;
  254. color: #333333;
  255. font-weight: bold;
  256. .text {
  257. font-weight: normal;
  258. &.red {
  259. color: #f94b4b;
  260. }
  261. }
  262. }
  263. }
  264. }
  265. }
  266. </style>