order-pay-list.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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-title" v-if="!showPayUnder" @click="handlePayunder">
  12. <view class="content">
  13. 因线上支付政策调整,请对每家店铺分别进行线上付款;若需要直接转账支付订单,请点击右侧箭头查看线下转账信息。
  14. <view class="content-icon"> <text class="iconfont icon-xiangyou"></text> </view>
  15. </view>
  16. </view>
  17. <view class="pay-content">
  18. <view class="pay-list" v-for="(list, index) in list" :key="index">
  19. <view class="pay-list-title">{{ list.shopName }}</view>
  20. <view class="pay-list-goods" v-for="(pros, prosIndex) in list.orderProductList" :key="prosIndex">
  21. <view class="pay-list-image"> <image :src="pros.image" class="image" mode=""></image> </view>
  22. <view class="pay-list-info">
  23. <view class="info-title">{{ pros.name }}</view>
  24. <view class="info-view" v-if="pros.productUnit != ''"> 规格:{{ pros.productUnit ? pros.productUnit : '' }} </view>
  25. <view class="info-view" v-if="pros.productCode != '' && pros.productCode != null">
  26. 商品编码:{{ pros.productCode ? pros.productCode : '' }}
  27. </view>
  28. <view class="info-price">
  29. <view class="price">¥{{ pros.price | NumFormat }}</view>
  30. <view class="count"><text class="sm">X</text> {{ pros.num }}</view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="pay-list-msg">
  35. <view class="list-msg" v-if="list.receiptAmount > 0"
  36. >已付:<text class="text">¥{{ list.receiptAmount | NumFormat }}</text></view
  37. >
  38. <view class="list-msg" v-if="list.eachDiscount > 0"
  39. >优惠:<text class="text">¥{{ list.eachDiscount | NumFormat }}</text></view
  40. >
  41. </view>
  42. <view class="pay-list-btn">
  43. <view class="btn" v-if="list.receiptStatus != 3" @click="handlePayOrder(list.shopOrderId)">付款</view>
  44. <view class="list-msg" v-if="list.obligation > 0"
  45. >待付:<text class="text red">¥{{ list.obligation | NumFormat }}</text></view
  46. >
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. orderId: 0,
  58. showPayUnder:false,
  59. skeletonShow:true,
  60. list: []
  61. }
  62. },
  63. onLoad(option) {
  64. this.initData(option)
  65. },
  66. filters: {
  67. NumFormat(value) {
  68. //处理金额
  69. if (value) {
  70. return Number(value).toFixed(2)
  71. } else {
  72. return '0.00'
  73. }
  74. }
  75. },
  76. methods: {
  77. initData(e) {
  78. console.log(e)
  79. this.orderId = e.orderId
  80. this.payOrderId = '#' + e.orderId + '#'
  81. this.PayOrderShoporders(this.orderId)
  82. },
  83. async PayOrderShoporders(orderId) {
  84. try{
  85. const res =await this.PayService.PayOrderShoporders({ orderId: orderId })
  86. this.list = res.data
  87. this.PayOrderCheckoutCounter(orderId)
  88. }catch(error){
  89. this.$util.msg(error.msg, 2000)
  90. }
  91. },
  92. async PayOrderCheckoutCounter(orderId){
  93. try{
  94. const res = await this.PayService.PayOrderCheckoutCounter({orderId:orderId})
  95. const data = res.data
  96. this.skeletonShow = false
  97. if(data.discernReceipt.length>0){
  98. this.showPayUnder = true
  99. }
  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(){
  108. this.$api.navigateTo(`/pages/user/pay/card-under?orderId=${this.orderId}`)
  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-title {
  123. width: 100%;
  124. height: 182rpx;
  125. box-sizing: border-box;
  126. padding: 24rpx 24rpx 0 24rpx;
  127. background-color: #ffffff;
  128. .content {
  129. width: 100%;
  130. height: 100%;
  131. position: relative;
  132. box-sizing: border-box;
  133. padding: 20rpx 100rpx 20rpx 24rpx;
  134. background: url(https://static.caimei365.com/app/img/bg/pay-bgtitle@2x.png) no-repeat;
  135. background-size: cover;
  136. line-height: 40rpx;
  137. font-size: $font-size-26;
  138. text-align: justify;
  139. color: $color-system;
  140. .content-icon {
  141. width: 40rpx;
  142. height: 100%;
  143. position: absolute;
  144. top: 0;
  145. right: 24rpx;
  146. line-height: 158rpx;
  147. .iconfont {
  148. font-size: $font-size-34;
  149. color: $color-system;
  150. text-align: right;
  151. }
  152. }
  153. }
  154. }
  155. .pay-content {
  156. width: 100%;
  157. height: auto;
  158. .pay-list {
  159. width: 100%;
  160. height: auto;
  161. padding: 30rpx 24rpx 30rpx 24rpx;
  162. box-sizing: border-box;
  163. background-color: #ffffff;
  164. margin-bottom: 20rpx;
  165. .pay-list-title {
  166. width: 100%;
  167. height: 42rpx;
  168. line-height: 42rpx;
  169. font-size: $font-size-30;
  170. color: #333333;
  171. margin-bottom: 20rpx;
  172. }
  173. .pay-list-goods {
  174. width: 100%;
  175. height: 180rpx;
  176. margin-bottom: 30rpx;
  177. .pay-list-image {
  178. width: 180rpx;
  179. height: 180rpx;
  180. box-sizing: border-box;
  181. border: 1px solid #e1e1e1;
  182. border-radius: 8rpx;
  183. float: left;
  184. margin-right: 13rpx;
  185. .image {
  186. width: 100%;
  187. height: 100%;
  188. display: block;
  189. border-radius: 8rpx;
  190. }
  191. }
  192. .pay-list-info {
  193. width: 508rpx;
  194. height: 100%;
  195. float: right;
  196. .info-title {
  197. width: 100%;
  198. display: inline-block;
  199. height: auto;
  200. text-overflow: ellipsis;
  201. display: -webkit-box;
  202. word-break: break-all;
  203. -webkit-box-orient: vertical;
  204. -webkit-line-clamp: 2;
  205. overflow: hidden;
  206. line-height: 38rpx;
  207. font-size: $font-size-28;
  208. color: #333333;
  209. }
  210. .info-view {
  211. height: 40rpx;
  212. line-height: 40rpx;
  213. color: #999999;
  214. text-overflow: ellipsis;
  215. display: -webkit-box;
  216. word-break: break-all;
  217. -webkit-box-orient: vertical;
  218. -webkit-line-clamp: 2;
  219. overflow: hidden;
  220. font-size: $font-size-22;
  221. color: #999999;
  222. }
  223. .info-price {
  224. height: 40rpx;
  225. width: 100%;
  226. float: left;
  227. line-height: 40rpx;
  228. font-size: $font-size-26;
  229. .price {
  230. color: #333333;
  231. float: left;
  232. }
  233. .count {
  234. float: right;
  235. color: #666666;
  236. .sm{
  237. font-size: $font-size-22;
  238. }
  239. }
  240. }
  241. }
  242. }
  243. .pay-list-msg {
  244. width: 100%;
  245. height: 40rpx;
  246. line-height: 40rpx;
  247. font-size: $font-size-26;
  248. margin-bottom: 30rpx;
  249. .list-msg {
  250. float: right;
  251. margin-left: 30rpx;
  252. font-size: $font-size-26;
  253. color: #333333;
  254. font-weight: bold;
  255. .text {
  256. font-weight: normal;
  257. &.red {
  258. color: #f94b4b;
  259. }
  260. }
  261. }
  262. }
  263. .pay-list-btn {
  264. width: 100%;
  265. height: 64rpx;
  266. .btn {
  267. width: 160rpx;
  268. height: 64rpx;
  269. line-height: 64rpx;
  270. background: $btn-confirm;
  271. font-size: $font-size-26;
  272. text-align: center;
  273. float: right;
  274. color: #ffffff;
  275. border-radius: 32rpx;
  276. }
  277. .list-msg {
  278. float: right;
  279. line-height: 64rpx;
  280. margin-right: 40rpx;
  281. font-size: $font-size-26;
  282. color: #333333;
  283. font-weight: bold;
  284. .text {
  285. font-weight: normal;
  286. &.red {
  287. color: #f94b4b;
  288. }
  289. }
  290. }
  291. }
  292. }
  293. }
  294. </style>