酒店桌布为微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
2.7 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
6 months ago
8 months ago
6 months ago
8 months ago
6 months ago
8 months ago
7 months ago
6 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. export default {
  2. methods: {
  3. // 酒店支付订单
  4. payOrder(id, orderId, replacePay){
  5. console.log(id, orderId);
  6. let self = this
  7. this.$api(replacePay ? 'replacePay' : 'orderPay', {
  8. id : replacePay ? orderId : id,
  9. }, res => {
  10. if (res.code == 200) {
  11. uni.requestPayment({
  12. provider: 'wxpay', // 服务提提供商
  13. timeStamp: res.result.timeStamp, // 时间戳
  14. nonceStr: res.result.nonceStr, // 随机字符串
  15. package: res.result.packageValue,
  16. signType: res.result.signType, // 签名算法
  17. paySign: res.result.paySign, // 签名
  18. success: function(res) {
  19. self.getData()
  20. },
  21. fail: function(err) {
  22. console.log('支付失败', err);
  23. // self.$refs.confirmationPopup.close()
  24. uni.showToast({
  25. icon: 'none',
  26. title: "支付失败"
  27. })
  28. }
  29. });
  30. }else{
  31. setTimeout(self.getData, 500)
  32. }
  33. })
  34. },
  35. // 酒店取消订单
  36. orderCancel(item){
  37. let self = this
  38. uni.showModal({
  39. title: '您确认取消吗?',
  40. success(res) {
  41. if (res.confirm) {
  42. self.$api('orderCancel', {
  43. id: item.id
  44. }, res => {
  45. if (res.code == 200) {
  46. self.getData()
  47. }
  48. })
  49. }
  50. }
  51. })
  52. },
  53. // 确认收货
  54. confirmReceiveGoods(item) {
  55. let self = this
  56. let api = 'orderConfirm'
  57. // 水洗订单,确认快递收货完成
  58. if([21].includes(item.status)){
  59. api = 'orderConfirmWashReceipt'
  60. }
  61. uni.showModal({
  62. title: '您收到货了吗?',
  63. success(res) {
  64. if (res.confirm) {
  65. self.$api(api, {
  66. id: item.id
  67. }, res => {
  68. if (res.code == 200) {
  69. self.getData()
  70. }
  71. })
  72. }
  73. }
  74. })
  75. },
  76. // 水洗店确认接单, logisticsFlag = 0:快递取货、快递寄回,1自行配送
  77. orderConfirmAccept(item, args = {},flag = 0){
  78. if([6].includes(item.status)){
  79. flag = 1
  80. }
  81. let self = this
  82. this.$api('orderConfirmAccept', {
  83. id: item.id,
  84. flag,
  85. ...args,
  86. }, res => {
  87. if (res.code == 200) {
  88. uni.showToast({
  89. title: '接单成功',
  90. icon: 'none'
  91. })
  92. self.getData()
  93. }
  94. })
  95. },
  96. // 水洗店确认破损 0确认接单 1确认正常 2破损上报
  97. orderConfirmedDamage(item, flag, args = {}, fn){
  98. let self = this
  99. this.$api('orderConfirmAccept', {
  100. id: item.id,
  101. flag,
  102. ...args
  103. }, res => {
  104. if (res.code == 200) {
  105. uni.showToast({
  106. title: '上报成功',
  107. icon: 'none'
  108. })
  109. fn && fn()
  110. self.getData()
  111. }
  112. })
  113. },
  114. // 水洗店完成水洗
  115. orderFinishedWashing(item){
  116. let self = this
  117. self.$api('orderConfirm', {
  118. id: item.id
  119. }, res => {
  120. if (res.code == 200) {
  121. self.getData()
  122. }
  123. })
  124. },
  125. }
  126. }