order-pay-list.vue 6.8 KB

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