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

97 lines
1.9 KiB

8 months ago
  1. export default {
  2. methods: {
  3. // 酒店支付订单
  4. payOrder(id){
  5. let self = this
  6. this.$api('orderPay', {
  7. id
  8. }, res => {
  9. if (res.code == 200) {
  10. uni.requestPayment({
  11. provider: 'wxpay', // 服务提提供商
  12. timeStamp: res.result.timeStamp, // 时间戳
  13. nonceStr: res.result.nonceStr, // 随机字符串
  14. package: res.result.packageValue,
  15. signType: res.result.signType, // 签名算法
  16. paySign: res.result.paySign, // 签名
  17. success: function(res) {
  18. self.getData()
  19. },
  20. fail: function(err) {
  21. console.log('支付失败', err);
  22. // self.$refs.confirmationPopup.close()
  23. uni.showToast({
  24. icon: 'none',
  25. title: "支付失败"
  26. })
  27. }
  28. });
  29. }
  30. })
  31. },
  32. // 确认收货
  33. confirmReceiveGoods(item) {
  34. let self = this
  35. uni.showModal({
  36. title: '您收到货了吗?',
  37. success(res) {
  38. if (res.confirm) {
  39. self.$api('orderConfirm', {
  40. id: item.id
  41. }, res => {
  42. if (res.code == 200) {
  43. self.getData()
  44. }
  45. })
  46. }
  47. }
  48. })
  49. },
  50. // 水洗店确认接单
  51. orderConfirmAccept(item){
  52. let self = this
  53. this.$api('orderConfirmAccept', {
  54. id: item.id
  55. }, res => {
  56. if (res.code == 200) {
  57. uni.showToast({
  58. title: '接单成功',
  59. icon: 'none'
  60. })
  61. self.getData()
  62. }
  63. })
  64. },
  65. // 水洗店确认破损0无破损,1破损
  66. orderConfirmedDamage(item, flag){
  67. let self = this
  68. this.$api('orderConfirmAccept', {
  69. id: item.id,
  70. flag,
  71. }, res => {
  72. if (res.code == 200) {
  73. uni.showToast({
  74. title: '上报成功',
  75. icon: 'none'
  76. })
  77. self.getData()
  78. }
  79. })
  80. },
  81. // 水洗店完成水洗
  82. orderFinishedWashing(item){
  83. let self = this
  84. self.$api('orderConfirm', {
  85. id: item.id
  86. }, res => {
  87. if (res.code == 200) {
  88. self.getData()
  89. }
  90. })
  91. },
  92. }
  93. }