order-pay-list.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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 === 1"
  46. @click="handlePayOrder(list.shopOrderId)"
  47. >线上支付</view
  48. >
  49. <view
  50. class="btn none"
  51. v-if="list.onlinePay === 0 || list.onlinePay === 2"
  52. @click="handlePayunder(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. font-weight: bold;
  130. margin-bottom: 20rpx;
  131. }
  132. .pay-list-goods {
  133. width: 100%;
  134. height: 180rpx;
  135. margin-bottom: 30rpx;
  136. .pay-list-image {
  137. width: 180rpx;
  138. height: 180rpx;
  139. box-sizing: border-box;
  140. border: 1px solid #e1e1e1;
  141. border-radius: 8rpx;
  142. float: left;
  143. margin-right: 13rpx;
  144. .image {
  145. width: 100%;
  146. height: 100%;
  147. display: block;
  148. border-radius: 8rpx;
  149. }
  150. }
  151. .pay-list-info {
  152. width: 508rpx;
  153. height: 100%;
  154. float: right;
  155. .info-title {
  156. width: 100%;
  157. display: inline-block;
  158. height: auto;
  159. text-overflow: ellipsis;
  160. display: -webkit-box;
  161. word-break: break-all;
  162. -webkit-box-orient: vertical;
  163. -webkit-line-clamp: 2;
  164. overflow: hidden;
  165. line-height: 38rpx;
  166. font-size: $font-size-28;
  167. color: #333333;
  168. }
  169. .info-view {
  170. height: 40rpx;
  171. line-height: 40rpx;
  172. color: #999999;
  173. text-overflow: ellipsis;
  174. display: -webkit-box;
  175. word-break: break-all;
  176. -webkit-box-orient: vertical;
  177. -webkit-line-clamp: 2;
  178. overflow: hidden;
  179. font-size: $font-size-22;
  180. color: #999999;
  181. }
  182. .info-price {
  183. height: 40rpx;
  184. width: 100%;
  185. float: left;
  186. line-height: 40rpx;
  187. font-size: $font-size-28;
  188. margin-top: 40rpx;
  189. .price {
  190. color: #F85050;
  191. float: left;
  192. }
  193. .count {
  194. float: right;
  195. color: #666666;
  196. .sm {
  197. font-size: $font-size-22;
  198. }
  199. }
  200. }
  201. }
  202. }
  203. .pay-list-msg {
  204. width: 100%;
  205. height: 40rpx;
  206. line-height: 40rpx;
  207. font-size: $font-size-28;
  208. margin-bottom: 30rpx;
  209. .list-label{
  210. float: left;
  211. font-size: $font-size-28;
  212. color: #333333;
  213. }
  214. .list-msg {
  215. float: right;
  216. margin-left: 30rpx;
  217. font-size: $font-size-28;
  218. color: #333333;
  219. font-weight: bold;
  220. .text {
  221. font-weight: normal;
  222. &.red {
  223. color: #f94b4b;
  224. font-weight: bold;
  225. }
  226. }
  227. }
  228. }
  229. .pay-list-btn {
  230. width: 100%;
  231. height: 64rpx;
  232. .btn {
  233. width: 160rpx;
  234. height: 64rpx;
  235. line-height: 64rpx;
  236. background: #F94B4B;
  237. font-size: $font-size-26;
  238. text-align: center;
  239. float: right;
  240. color: #ffffff;
  241. border-radius: 32rpx;
  242. margin-left: 20rpx;
  243. &.none{
  244. background: #FF5B00;
  245. }
  246. }
  247. .list-msg {
  248. float: right;
  249. line-height: 64rpx;
  250. margin-right: 40rpx;
  251. font-size: $font-size-26;
  252. color: #333333;
  253. font-weight: bold;
  254. .text {
  255. font-weight: normal;
  256. &.red {
  257. color: #f94b4b;
  258. }
  259. }
  260. }
  261. }
  262. }
  263. }
  264. </style>