order-pay-list.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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. skeletonShow: true,
  84. list: []
  85. }
  86. },
  87. onLoad(option) {
  88. this.initData(option)
  89. },
  90. filters: {
  91. NumFormat(value) {
  92. //处理金额
  93. if (value) {
  94. return Number(value).toFixed(2)
  95. } else {
  96. return '0.00'
  97. }
  98. }
  99. },
  100. methods: {
  101. initData(e) {
  102. console.log(e)
  103. this.orderId = e.orderId
  104. this.payOrderId = '#' + e.orderId + '#'
  105. this.PayOrderShoporders(this.orderId)
  106. },
  107. async PayOrderShoporders(orderId) {
  108. try {
  109. const res = await this.PayService.PayOrderShoporders({ orderId: orderId })
  110. this.list = res.data
  111. // this.PayOrderCheckoutCounter(orderId)
  112. this.skeletonShow = false
  113. } catch (error) {
  114. this.$util.msg(error.msg, 2000)
  115. }
  116. },
  117. handlePayOrder(shopOrderId) {
  118. this.$api.navigateTo(`/pages/user/pay/card-order?shopOrderId=${shopOrderId}`)
  119. },
  120. handlePayunder(shopOrderId) {
  121. this.$api.navigateTo(
  122. `/pages/user/pay/card-under?shopOrderId=${shopOrderId}`
  123. )
  124. }
  125. },
  126. onShow() {}
  127. }
  128. </script>
  129. <style lang="scss">
  130. page {
  131. height: auto !important;
  132. background-color: #f7f7f7;
  133. }
  134. .cashier {
  135. width: 100%;
  136. }
  137. .pay-title {
  138. width: 100%;
  139. height: 144rpx;
  140. box-sizing: border-box;
  141. padding: 24rpx 24rpx 0 24rpx;
  142. background-color: #ffffff;
  143. .content {
  144. width: 100%;
  145. height: 100%;
  146. position: relative;
  147. box-sizing: border-box;
  148. padding: 20rpx 100rpx 20rpx 24rpx;
  149. background: url(https://static.caimei365.com/app/img/bg/pay-bgtitle@2x.png) no-repeat;
  150. background-size: 100% 100%;
  151. line-height: 40rpx;
  152. font-size: $font-size-26;
  153. text-align: justify;
  154. color: $color-system;
  155. .content-icon {
  156. width: 40rpx;
  157. height: 100%;
  158. position: absolute;
  159. top: 0;
  160. right: 24rpx;
  161. line-height: 120rpx;
  162. .iconfont {
  163. font-size: $font-size-34;
  164. color: $color-system;
  165. text-align: right;
  166. }
  167. }
  168. }
  169. }
  170. .pay-content {
  171. width: 100%;
  172. height: auto;
  173. .pay-list {
  174. width: 100%;
  175. height: auto;
  176. padding: 30rpx 24rpx 30rpx 24rpx;
  177. box-sizing: border-box;
  178. background-color: #ffffff;
  179. margin-bottom: 20rpx;
  180. .pay-list-title {
  181. width: 100%;
  182. height: 42rpx;
  183. line-height: 42rpx;
  184. font-size: $font-size-30;
  185. color: #333333;
  186. margin-bottom: 20rpx;
  187. }
  188. .pay-list-goods {
  189. width: 100%;
  190. height: 180rpx;
  191. margin-bottom: 56rpx;
  192. .pay-list-image {
  193. width: 180rpx;
  194. height: 180rpx;
  195. box-sizing: border-box;
  196. border: 1px solid #e1e1e1;
  197. border-radius: 8rpx;
  198. float: left;
  199. margin-right: 13rpx;
  200. .image {
  201. width: 100%;
  202. height: 100%;
  203. display: block;
  204. border-radius: 8rpx;
  205. }
  206. }
  207. .pay-list-info {
  208. width: 508rpx;
  209. height: 100%;
  210. float: right;
  211. .info-title {
  212. width: 100%;
  213. display: inline-block;
  214. height: auto;
  215. text-overflow: ellipsis;
  216. display: -webkit-box;
  217. word-break: break-all;
  218. -webkit-box-orient: vertical;
  219. -webkit-line-clamp: 2;
  220. overflow: hidden;
  221. line-height: 40rpx;
  222. font-size: $font-size-28;
  223. color: #333333;
  224. margin-bottom: 8rpx;
  225. }
  226. .info-view {
  227. height: 40rpx;
  228. line-height: 40rpx;
  229. color: #999999;
  230. text-overflow: ellipsis;
  231. display: -webkit-box;
  232. word-break: break-all;
  233. -webkit-box-orient: vertical;
  234. -webkit-line-clamp: 2;
  235. overflow: hidden;
  236. font-size: $font-size-22;
  237. margin-bottom: 24rpx;
  238. }
  239. .info-price {
  240. height: 40rpx;
  241. width: 100%;
  242. float: left;
  243. line-height: 40rpx;
  244. font-size: $font-size-26;
  245. .price {
  246. color: #f85050;
  247. float: left;
  248. font-size: 28rpx;
  249. }
  250. .count {
  251. float: right;
  252. color: #666666;
  253. .sm {
  254. font-size: $font-size-22;
  255. }
  256. }
  257. }
  258. }
  259. }
  260. .pay-list-msg {
  261. width: 100%;
  262. line-height: 40rpx;
  263. font-size: $font-size-28;
  264. margin-bottom: 30rpx;
  265. .list-msg {
  266. font-size: $font-size-28;
  267. color: #333333;
  268. display: flex;
  269. justify-content: space-between;
  270. margin-bottom: 16rpx;
  271. .text {
  272. font-weight: normal;
  273. &.red {
  274. color: #f94b4b;
  275. }
  276. }
  277. }
  278. }
  279. .pay-list-btn {
  280. width: 100%;
  281. flex-direction: row-reverse;
  282. display: flex;
  283. .btn {
  284. width: 160rpx;
  285. height: 64rpx;
  286. line-height: 64rpx;
  287. background: $btn-confirm;
  288. font-size: $font-size-26;
  289. text-align: center;
  290. color: #ffffff;
  291. border-radius: 32rpx;
  292. margin-left: 20rpx;
  293. }
  294. .list-msg {
  295. line-height: 64rpx;
  296. margin-right: 40rpx;
  297. font-size: $font-size-26;
  298. color: #333333;
  299. font-weight: bold;
  300. .text {
  301. font-weight: normal;
  302. &.red {
  303. color: #f94b4b;
  304. }
  305. }
  306. }
  307. }
  308. }
  309. }
  310. </style>