order-pay-list.vue 6.6 KB

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