order-pay-list.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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. shopOrderId:0,
  66. list: []
  67. }
  68. },
  69. onLoad(option) {
  70. this.initData(option)
  71. },
  72. filters: {
  73. NumFormat(value) {
  74. //处理金额
  75. if (value) {
  76. return Number(value).toFixed(2)
  77. } else {
  78. return '0.00'
  79. }
  80. }
  81. },
  82. methods: {
  83. initData(e) {
  84. console.log(e)
  85. this.orderId = e.orderId
  86. this.shopOrderId = e.shopOrderId
  87. this.PayOrderShoporders(this.orderId,this.shopOrderId)
  88. },
  89. async PayOrderShoporders(orderId,shopOrderId) {
  90. try{
  91. let params = {}
  92. if(orderId){
  93. params = { orderId: orderId }
  94. }
  95. if(shopOrderId){
  96. params = { shopOrderId: shopOrderId }
  97. }
  98. const res = await this.PayService.PayOrderShoporders(params)
  99. this.list = res.data
  100. }catch(error){
  101. this.$util.msg(error.msg, 2000)
  102. }
  103. },
  104. handlePayOrder(shopOrderId) {
  105. this.$api.navigateTo(`/pages/user/pay/card-order?shopOrderId=${shopOrderId}`)
  106. },
  107. handlePayunder(shopOrderId) {
  108. this.$api.navigateTo(`/pages/user/pay/card-under?shopOrderId=${shopOrderId}`)
  109. }
  110. },
  111. onShow() {}
  112. }
  113. </script>
  114. <style lang="scss">
  115. page {
  116. height: auto !important;
  117. background-color: #f7f7f7;
  118. }
  119. .cashier {
  120. width: 100%;
  121. }
  122. .pay-content {
  123. width: 100%;
  124. height: auto;
  125. .pay-list {
  126. width: 100%;
  127. height: auto;
  128. padding: 30rpx 24rpx 30rpx 24rpx;
  129. box-sizing: border-box;
  130. background-color: #ffffff;
  131. margin-bottom: 20rpx;
  132. .pay-list-title {
  133. width: 100%;
  134. height: 42rpx;
  135. line-height: 42rpx;
  136. font-size: $font-size-30;
  137. color: #333333;
  138. font-weight: bold;
  139. margin-bottom: 20rpx;
  140. }
  141. .pay-list-goods {
  142. width: 100%;
  143. height: 180rpx;
  144. margin-bottom: 30rpx;
  145. .pay-list-image {
  146. width: 180rpx;
  147. height: 180rpx;
  148. box-sizing: border-box;
  149. border: 1px solid #e1e1e1;
  150. border-radius: 8rpx;
  151. float: left;
  152. margin-right: 13rpx;
  153. .image {
  154. width: 100%;
  155. height: 100%;
  156. display: block;
  157. border-radius: 8rpx;
  158. }
  159. }
  160. .pay-list-info {
  161. width: 508rpx;
  162. height: 100%;
  163. float: right;
  164. .info-title {
  165. width: 100%;
  166. display: inline-block;
  167. height: auto;
  168. text-overflow: ellipsis;
  169. display: -webkit-box;
  170. word-break: break-all;
  171. -webkit-box-orient: vertical;
  172. -webkit-line-clamp: 2;
  173. overflow: hidden;
  174. line-height: 38rpx;
  175. font-size: $font-size-28;
  176. color: #333333;
  177. }
  178. .info-view {
  179. height: 40rpx;
  180. line-height: 40rpx;
  181. color: #999999;
  182. text-overflow: ellipsis;
  183. display: -webkit-box;
  184. word-break: break-all;
  185. -webkit-box-orient: vertical;
  186. -webkit-line-clamp: 2;
  187. overflow: hidden;
  188. font-size: $font-size-22;
  189. color: #999999;
  190. }
  191. .info-price {
  192. height: 40rpx;
  193. width: 100%;
  194. float: left;
  195. line-height: 40rpx;
  196. font-size: $font-size-28;
  197. margin-top: 40rpx;
  198. .price {
  199. color: #F85050;
  200. float: left;
  201. }
  202. .count {
  203. float: right;
  204. color: #666666;
  205. .sm {
  206. font-size: $font-size-22;
  207. }
  208. }
  209. }
  210. }
  211. }
  212. .pay-list-msg {
  213. width: 100%;
  214. height: 40rpx;
  215. line-height: 40rpx;
  216. font-size: $font-size-28;
  217. margin-bottom: 30rpx;
  218. .list-label{
  219. float: left;
  220. font-size: $font-size-28;
  221. color: #333333;
  222. }
  223. .list-msg {
  224. float: right;
  225. margin-left: 30rpx;
  226. font-size: $font-size-28;
  227. color: #333333;
  228. font-weight: bold;
  229. .text {
  230. font-weight: normal;
  231. &.red {
  232. color: #f94b4b;
  233. font-weight: bold;
  234. }
  235. }
  236. }
  237. }
  238. .pay-list-btn {
  239. width: 100%;
  240. height: 64rpx;
  241. .btn {
  242. width: 160rpx;
  243. height: 64rpx;
  244. line-height: 64rpx;
  245. background: #F94B4B;
  246. font-size: $font-size-26;
  247. text-align: center;
  248. float: right;
  249. color: #ffffff;
  250. border-radius: 32rpx;
  251. margin-left: 20rpx;
  252. &.none{
  253. background: #FF5B00;
  254. }
  255. }
  256. .list-msg {
  257. float: right;
  258. line-height: 64rpx;
  259. margin-right: 40rpx;
  260. font-size: $font-size-26;
  261. color: #333333;
  262. font-weight: bold;
  263. .text {
  264. font-weight: normal;
  265. &.red {
  266. color: #f94b4b;
  267. }
  268. }
  269. }
  270. }
  271. }
  272. }
  273. </style>