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

100 lines
2.1 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
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. confirmReceiveGoods(item) {
  37. let self = this
  38. uni.showModal({
  39. title: '您收到货了吗?',
  40. success(res) {
  41. if (res.confirm) {
  42. self.$api('orderConfirm', {
  43. id: item.id
  44. }, res => {
  45. if (res.code == 200) {
  46. self.getData()
  47. }
  48. })
  49. }
  50. }
  51. })
  52. },
  53. // 水洗店确认接单
  54. orderConfirmAccept(item){
  55. let self = this
  56. this.$api('orderConfirmAccept', {
  57. id: item.id
  58. }, res => {
  59. if (res.code == 200) {
  60. uni.showToast({
  61. title: '接单成功',
  62. icon: 'none'
  63. })
  64. self.getData()
  65. }
  66. })
  67. },
  68. // 水洗店确认破损 0确认接单 1确认正常 2破损上报
  69. orderConfirmedDamage(item, flag, args = {}, fn){
  70. let self = this
  71. this.$api('orderConfirmAccept', {
  72. id: item.id,
  73. flag,
  74. ...args
  75. }, res => {
  76. if (res.code == 200) {
  77. uni.showToast({
  78. title: '上报成功',
  79. icon: 'none'
  80. })
  81. fn && fn()
  82. self.getData()
  83. }
  84. })
  85. },
  86. // 水洗店完成水洗
  87. orderFinishedWashing(item){
  88. let self = this
  89. self.$api('orderConfirm', {
  90. id: item.id
  91. }, res => {
  92. if (res.code == 200) {
  93. self.getData()
  94. }
  95. })
  96. },
  97. }
  98. }