order-pay-list.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <template>
  2. <view class="container cashier">
  3. <tui-skeleton
  4. v-if="skeletonShow"
  5. backgroundColor="#fafafa"
  6. borderRadius="10rpx"
  7. :isLoading="true"
  8. :loadingType="5"
  9. ></tui-skeleton>
  10. <template v-else>
  11. <view class="pay-content">
  12. <view class="pay-list" v-for="(list, index) in list" :key="index">
  13. <view class="pay-list-title">{{ list.shopName }}</view>
  14. <view class="pay-list-goods" v-for="(pros, prosIndex) in list.orderProductList" :key="prosIndex">
  15. <view class="pay-list-image"><image :src="pros.image" class="image" mode=""></image></view>
  16. <view class="pay-list-info">
  17. <view class="info-title">{{ pros.name }}</view>
  18. <view class="info-view" v-if="pros.productUnit != ''">
  19. 规格:{{ pros.productUnit ? pros.productUnit : '' }}
  20. </view>
  21. <!-- <view class="info-view" v-if="pros.productCode != '' && pros.productCode != null">
  22. 商品编码:{{ pros.productCode ? pros.productCode : '' }}
  23. </view> -->
  24. <view class="info-price">
  25. <view class="price">¥{{ pros.price | NumFormat }}</view>
  26. <view class="count">
  27. <text class="sm">X</text>
  28. {{ pros.num }}
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="pay-list-msg">
  34. <view class="list-msg" >
  35. 运费:
  36. <text class="text">{{ list.postageInfo }}</text>
  37. </view>
  38. <view class="list-msg" v-if="Number(list.receiptAmount) > 0">
  39. 已付:
  40. <text class="text">¥{{ list.receiptAmount | NumFormat }}</text>
  41. </view>
  42. <view class="list-msg" v-if="Number(list.obligation) > 0">
  43. 待付:
  44. <text class="text red">¥{{ list.obligation | NumFormat }}</text>
  45. </view>
  46. <!-- <view class="list-msg" v-if="list.eachDiscount > 0"
  47. >优惠:<text class="text">¥{{ list.eachDiscount | NumFormat }}</text></view
  48. > -->
  49. </view>
  50. <!-- <view class="pay-list-btn">
  51. <view class="btn" v-if="list.receiptStatus != 3" @click="handlePayOrder(list.shopOrderId)">付款</view>
  52. <view class="list-msg" v-if="list.obligation > 0"
  53. >待付:<text class="text red">¥{{ list.obligation | NumFormat }}</text></view
  54. >
  55. </view> -->
  56. <view class="pay-list-btn pay-btn">
  57. <view
  58. class="btn"
  59. @click="handlePayunder(list.shopOrderId)"
  60. v-if="list.onlinePay === 0 || list.onlinePay === 2"
  61. >
  62. 线下转账
  63. </view>
  64. <view
  65. class="btn"
  66. @click="handlePayOrder(list.shopOrderId)"
  67. v-if="list.onlinePay === 0 || list.onlinePay === 1"
  68. >
  69. 线上支付
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. </view>
  76. </template>
  77. <script>
  78. export default {
  79. data() {
  80. return {
  81. orderId: 0,
  82. showPayUnder: false,
  83. shopOrderId: 0,
  84. skeletonShow: true,
  85. list: []
  86. }
  87. },
  88. onLoad(option) {
  89. this.initData(option)
  90. },
  91. filters: {
  92. NumFormat(value) {
  93. //处理金额
  94. if (value) {
  95. return Number(value).toFixed(2)
  96. } else {
  97. return '0.00'
  98. }
  99. }
  100. },
  101. methods: {
  102. initData(e) {
  103. console.log(e)
  104. this.orderId = e.orderId
  105. this.shopOrderId = e.shopOrderId
  106. this.payOrderId = '#' + e.orderId + '#'
  107. this.PayOrderShoporders(this.orderId, this.shopOrderId)
  108. },
  109. async PayOrderShoporders(orderId, shopOrderId) {
  110. try {
  111. let params = {}
  112. if(orderId) {
  113. params = { orderId }
  114. }
  115. if(shopOrderId) {
  116. params = { shopOrderId }
  117. }
  118. const res = await this.PayService.PayOrderShoporders(params)
  119. this.list = res.data
  120. // this.PayOrderCheckoutCounter(orderId)
  121. this.skeletonShow = false
  122. } catch (error) {
  123. this.$util.msg(error.msg, 2000)
  124. }
  125. },
  126. handlePayOrder(shopOrderId) {
  127. this.$api.navigateTo(`/pages/user/pay/card-order?shopOrderId=${shopOrderId}`)
  128. },
  129. handlePayunder(shopOrderId) {
  130. this.$api.navigateTo(
  131. `/pages/user/pay/card-under?shopOrderId=${shopOrderId}`
  132. )
  133. }
  134. },
  135. onShow() {}
  136. }
  137. </script>
  138. <style lang="scss">
  139. page {
  140. height: auto !important;
  141. background-color: #f7f7f7;
  142. }
  143. .cashier {
  144. width: 100%;
  145. }
  146. .pay-title {
  147. width: 100%;
  148. height: 144rpx;
  149. box-sizing: border-box;
  150. padding: 24rpx 24rpx 0 24rpx;
  151. background-color: #ffffff;
  152. .content {
  153. width: 100%;
  154. height: 100%;
  155. position: relative;
  156. box-sizing: border-box;
  157. padding: 20rpx 100rpx 20rpx 24rpx;
  158. background: url(https://static.caimei365.com/app/img/bg/pay-bgtitle@2x.png) no-repeat;
  159. background-size: 100% 100%;
  160. line-height: 40rpx;
  161. font-size: $font-size-26;
  162. text-align: justify;
  163. color: $color-system;
  164. .content-icon {
  165. width: 40rpx;
  166. height: 100%;
  167. position: absolute;
  168. top: 0;
  169. right: 24rpx;
  170. line-height: 120rpx;
  171. .iconfont {
  172. font-size: $font-size-34;
  173. color: $color-system;
  174. text-align: right;
  175. }
  176. }
  177. }
  178. }
  179. .pay-content {
  180. width: 100%;
  181. height: auto;
  182. .pay-list {
  183. width: 100%;
  184. height: auto;
  185. padding: 30rpx 24rpx 30rpx 24rpx;
  186. box-sizing: border-box;
  187. background-color: #ffffff;
  188. margin-bottom: 20rpx;
  189. .pay-list-title {
  190. width: 100%;
  191. height: 42rpx;
  192. line-height: 42rpx;
  193. font-size: $font-size-30;
  194. color: #333333;
  195. margin-bottom: 20rpx;
  196. }
  197. .pay-list-goods {
  198. width: 100%;
  199. height: 180rpx;
  200. margin-bottom: 56rpx;
  201. .pay-list-image {
  202. width: 180rpx;
  203. height: 180rpx;
  204. box-sizing: border-box;
  205. border: 1px solid #e1e1e1;
  206. border-radius: 8rpx;
  207. float: left;
  208. margin-right: 13rpx;
  209. .image {
  210. width: 100%;
  211. height: 100%;
  212. display: block;
  213. border-radius: 8rpx;
  214. }
  215. }
  216. .pay-list-info {
  217. width: 508rpx;
  218. height: 100%;
  219. float: right;
  220. .info-title {
  221. width: 100%;
  222. display: inline-block;
  223. height: auto;
  224. text-overflow: ellipsis;
  225. display: -webkit-box;
  226. word-break: break-all;
  227. -webkit-box-orient: vertical;
  228. -webkit-line-clamp: 2;
  229. overflow: hidden;
  230. line-height: 40rpx;
  231. font-size: $font-size-28;
  232. color: #333333;
  233. margin-bottom: 8rpx;
  234. }
  235. .info-view {
  236. height: 40rpx;
  237. line-height: 40rpx;
  238. color: #999999;
  239. text-overflow: ellipsis;
  240. display: -webkit-box;
  241. word-break: break-all;
  242. -webkit-box-orient: vertical;
  243. -webkit-line-clamp: 2;
  244. overflow: hidden;
  245. font-size: $font-size-22;
  246. margin-bottom: 24rpx;
  247. }
  248. .info-price {
  249. height: 40rpx;
  250. width: 100%;
  251. float: left;
  252. line-height: 40rpx;
  253. font-size: $font-size-26;
  254. .price {
  255. color: #f85050;
  256. float: left;
  257. font-size: 28rpx;
  258. }
  259. .count {
  260. float: right;
  261. color: #666666;
  262. .sm {
  263. font-size: $font-size-22;
  264. }
  265. }
  266. }
  267. }
  268. }
  269. .pay-list-msg {
  270. width: 100%;
  271. line-height: 40rpx;
  272. font-size: $font-size-28;
  273. margin-bottom: 30rpx;
  274. .list-msg {
  275. font-size: $font-size-28;
  276. color: #333333;
  277. display: flex;
  278. justify-content: space-between;
  279. margin-bottom: 16rpx;
  280. .text {
  281. font-weight: normal;
  282. &.red {
  283. color: #f94b4b;
  284. }
  285. }
  286. }
  287. }
  288. .pay-list-btn {
  289. width: 100%;
  290. flex-direction: row-reverse;
  291. display: flex;
  292. .btn {
  293. width: 160rpx;
  294. height: 64rpx;
  295. line-height: 64rpx;
  296. background: $btn-confirm;
  297. font-size: $font-size-26;
  298. text-align: center;
  299. color: #ffffff;
  300. border-radius: 32rpx;
  301. margin-left: 20rpx;
  302. }
  303. .list-msg {
  304. line-height: 64rpx;
  305. margin-right: 40rpx;
  306. font-size: $font-size-26;
  307. color: #333333;
  308. font-weight: bold;
  309. .text {
  310. font-weight: normal;
  311. &.red {
  312. color: #f94b4b;
  313. }
  314. }
  315. }
  316. }
  317. }
  318. }
  319. </style>