order-pay-list.vue 5.8 KB

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