order-pay-list.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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" v-if="list.couponAmount > 0">
  26. <view class="list-label">优惠:</view>
  27. <view class="list-msg">¥{{ list.couponAmount | NumFormat }}</view>
  28. </view>
  29. <view class="pay-list-msg" v-if="list.promotionFullReduction > 0">
  30. <view class="list-label">促销满减:</view>
  31. <view class="list-msg">¥{{ list.promotionFullReduction | NumFormat }}</view>
  32. </view>
  33. <view class="pay-list-msg">
  34. <view class="list-label">已付:</view>
  35. <view class="list-msg">
  36. <text class="text">
  37. ¥{{ list.receiptAmount | NumFormat }}
  38. <text v-if="list.accountAmount > 0"> (余额抵扣:¥{{ list.accountAmount | NumFormat }}) </text>
  39. </text>
  40. </view>
  41. </view>
  42. <view class="pay-list-msg">
  43. <view class="list-label">待付:</view>
  44. <view class="list-msg"><text class="text red"> ¥{{ list.obligation | NumFormat }}</text></view>
  45. </view>
  46. <view class="pay-list-btn" >
  47. <view
  48. class="btn"
  49. v-if="list.onlinePay === 0 || list.onlinePay === 1"
  50. @click="handlePayOrder(list.shopOrderId)"
  51. >线上支付</view
  52. >
  53. <view
  54. class="btn none"
  55. v-if="list.onlinePay === 0 || list.onlinePay === 2"
  56. @click="handlePayunder(list.shopOrderId)"
  57. >线下转账</view
  58. >
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. export default {
  66. data() {
  67. return {
  68. orderId: 0,
  69. shopOrderId:0,
  70. list: []
  71. }
  72. },
  73. onLoad(option) {
  74. this.initData(option)
  75. },
  76. filters: {
  77. NumFormat(value) {
  78. //处理金额
  79. if (value) {
  80. return Number(value).toFixed(2)
  81. } else {
  82. return '0.00'
  83. }
  84. }
  85. },
  86. methods: {
  87. initData(e) {
  88. console.log(e)
  89. this.orderId = e.orderId
  90. this.shopOrderId = e.shopOrderId
  91. this.PayOrderShoporders(this.orderId,this.shopOrderId)
  92. },
  93. async PayOrderShoporders(orderId,shopOrderId) {
  94. try{
  95. let params = {}
  96. if(orderId){
  97. params = { orderId: orderId }
  98. }
  99. if(shopOrderId){
  100. params = { shopOrderId: shopOrderId }
  101. }
  102. const res = await this.PayService.PayOrderShoporders(params)
  103. this.list = res.data
  104. }catch(error){
  105. this.$util.msg(error.msg, 2000)
  106. }
  107. },
  108. handlePayOrder(shopOrderId) {
  109. this.$api.navigateTo(`/pages/user/pay/card-order?shopOrderId=${shopOrderId}`)
  110. },
  111. handlePayunder(shopOrderId) {
  112. this.$api.navigateTo(`/pages/user/pay/card-under?shopOrderId=${shopOrderId}`)
  113. }
  114. },
  115. onShow() {}
  116. }
  117. </script>
  118. <style lang="scss">
  119. page {
  120. height: auto !important;
  121. background-color: #f7f7f7;
  122. }
  123. .cashier {
  124. width: 100%;
  125. }
  126. .pay-content {
  127. width: 100%;
  128. height: auto;
  129. .pay-list {
  130. width: 100%;
  131. height: auto;
  132. padding: 30rpx 24rpx 30rpx 24rpx;
  133. box-sizing: border-box;
  134. background-color: #ffffff;
  135. margin-bottom: 20rpx;
  136. .pay-list-title {
  137. width: 100%;
  138. height: 42rpx;
  139. line-height: 42rpx;
  140. font-size: $font-size-30;
  141. color: #333333;
  142. font-weight: bold;
  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-28;
  201. margin-top: 40rpx;
  202. .price {
  203. color: #F85050;
  204. float: left;
  205. }
  206. .count {
  207. float: right;
  208. color: #666666;
  209. .sm {
  210. font-size: $font-size-22;
  211. }
  212. }
  213. }
  214. }
  215. }
  216. .pay-list-msg {
  217. width: 100%;
  218. height: 40rpx;
  219. line-height: 40rpx;
  220. font-size: $font-size-28;
  221. margin-bottom: 30rpx;
  222. .list-label{
  223. float: left;
  224. font-size: $font-size-28;
  225. color: #333333;
  226. }
  227. .list-msg {
  228. float: right;
  229. margin-left: 30rpx;
  230. font-size: $font-size-28;
  231. color: #333333;
  232. font-weight: bold;
  233. .text {
  234. font-weight: normal;
  235. &.red {
  236. color: #f94b4b;
  237. font-weight: bold;
  238. }
  239. }
  240. }
  241. }
  242. .pay-list-btn {
  243. width: 100%;
  244. height: 64rpx;
  245. .btn {
  246. width: 160rpx;
  247. height: 64rpx;
  248. line-height: 64rpx;
  249. background: #F94B4B;
  250. font-size: $font-size-26;
  251. text-align: center;
  252. float: right;
  253. color: #ffffff;
  254. border-radius: 32rpx;
  255. margin-left: 20rpx;
  256. &.none{
  257. background: #FF5B00;
  258. }
  259. }
  260. .list-msg {
  261. float: right;
  262. line-height: 64rpx;
  263. margin-right: 40rpx;
  264. font-size: $font-size-26;
  265. color: #333333;
  266. font-weight: bold;
  267. .text {
  268. font-weight: normal;
  269. &.red {
  270. color: #f94b4b;
  271. }
  272. }
  273. }
  274. }
  275. }
  276. }
  277. </style>