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

98 lines
2.1 KiB

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