酒店桌布为微信小程序
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.

118 lines
2.4 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
8 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. uni.showModal({
  57. title: '您收到货了吗?',
  58. success(res) {
  59. if (res.confirm) {
  60. self.$api('orderConfirm', {
  61. id: item.id
  62. }, res => {
  63. if (res.code == 200) {
  64. self.getData()
  65. }
  66. })
  67. }
  68. }
  69. })
  70. },
  71. // 水洗店确认接单
  72. orderConfirmAccept(item){
  73. let self = this
  74. this.$api('orderConfirmAccept', {
  75. id: item.id
  76. }, res => {
  77. if (res.code == 200) {
  78. uni.showToast({
  79. title: '接单成功',
  80. icon: 'none'
  81. })
  82. self.getData()
  83. }
  84. })
  85. },
  86. // 水洗店确认破损 0确认接单 1确认正常 2破损上报
  87. orderConfirmedDamage(item, flag, args = {}, fn){
  88. let self = this
  89. this.$api('orderConfirmAccept', {
  90. id: item.id,
  91. flag,
  92. ...args
  93. }, res => {
  94. if (res.code == 200) {
  95. uni.showToast({
  96. title: '上报成功',
  97. icon: 'none'
  98. })
  99. fn && fn()
  100. self.getData()
  101. }
  102. })
  103. },
  104. // 水洗店完成水洗
  105. orderFinishedWashing(item){
  106. let self = this
  107. self.$api('orderConfirm', {
  108. id: item.id
  109. }, res => {
  110. if (res.code == 200) {
  111. self.getData()
  112. }
  113. })
  114. },
  115. }
  116. }