抖音c端
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

complaint.js 1.5 KiB

2 yıl önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. const navigationBarHeight = (getApp().statusBarHeight + 50) + "px"
  2. const Http = require("../../utils/HttpBasics");
  3. var config = require("../../config/config.js");
  4. var app = getApp();
  5. Page({
  6. data: {
  7. navigationBarHeight,
  8. },
  9. setDescrideVal(e) { //赋值标题
  10. let descrideVal = e.detail.value
  11. this.setData({
  12. descrideVal: descrideVal,
  13. titleVale: "", //标题
  14. descrideVal: "", //描述
  15. })
  16. },
  17. setTitVal(e) { //赋值描述
  18. let titleVale = e.detail.value
  19. this.setData({
  20. titleVale: titleVale
  21. })
  22. },
  23. save() { //提交
  24. if (!this.data.titleVale){
  25. tt.showToast({
  26. title: '请输入标题',
  27. icon: "none",
  28. duration: 2000
  29. })
  30. return
  31. }else if(!this.data.descrideVal){
  32. tt.showToast({
  33. title: '请输入类容',
  34. icon:"none",
  35. duration:2000
  36. })
  37. return
  38. }
  39. let parameter = {
  40. title: this.data.titleVale,
  41. explains: this.data.descrideVal
  42. }
  43. Http.post({
  44. url: config.api.suggest,
  45. data: parameter
  46. }).then(item=>{
  47. tt.showToast({
  48. title: "提交成功!",
  49. icon: 'none',
  50. duration: 2000,
  51. success: () => {
  52. setTimeout(() => {
  53. tt.reLaunch({
  54. url: '/index/index'
  55. })
  56. }, 2000)
  57. }
  58. });
  59. }).catch(err => {
  60. tt.showToast({
  61. title: err.errMsg,
  62. icon: 'none',
  63. duration: 2000,
  64. // mask: false
  65. });
  66. })
  67. },
  68. onLoad: function (options) {
  69. }
  70. })