拓恒河湖长制全民护河平台WEB端
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.

index.js 2.7KB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // package_first/pages/ProtectionSuggestion/ProtectionSuggestion.js
  2. // import { PostProcess } from 'XrFrame/xrFrameSystem';
  3. import { api_westreamSuggest,
  4. api_getUserInfo
  5. } from '../../../api/suggestion';
  6. Page({
  7. /**
  8. * 页面的初始数据
  9. */
  10. data: {
  11. form : {
  12. content:''
  13. },
  14. dialogShow:false,
  15. userInfo:{},
  16. formRules: {
  17. content: {
  18. validator: function (value) {
  19. return value;
  20. },
  21. warning: false
  22. },
  23. },
  24. },
  25. /**
  26. * 生命周期函数--监听页面加载
  27. */
  28. onLoad(options) {
  29. },
  30. /**
  31. * 生命周期函数--监听页面初次渲染完成
  32. */
  33. onReady() {
  34. },
  35. /**
  36. * 生命周期函数--监听页面显示
  37. */
  38. onShow() {
  39. this.getUserInfo()
  40. },
  41. /**
  42. * 生命周期函数--监听页面隐藏
  43. */
  44. onHide() {
  45. },
  46. /**
  47. * 生命周期函数--监听页面卸载
  48. */
  49. onUnload() {
  50. },
  51. /**
  52. * 页面相关事件处理函数--监听用户下拉动作
  53. */
  54. onPullDownRefresh() {
  55. },
  56. /**
  57. * 页面上拉触底事件的处理函数
  58. */
  59. onReachBottom() {
  60. },
  61. /**
  62. * 用户点击右上角分享
  63. */
  64. onShareAppMessage() {
  65. },
  66. // 关闭弹窗
  67. colseDialog(){
  68. console.log(111);
  69. wx.switchTab({
  70. url: '/pages/FirstPage/index',
  71. })
  72. },
  73. remarkInputAction(options){
  74. let content= options.detail.value
  75. this.setData({
  76. form:{
  77. content,
  78. }
  79. })
  80. },
  81. getUserInfo(){
  82. const tenantObj = wx.getStorageSync('tenant')
  83. const openid = wx.getStorageSync('openid')
  84. const data = {
  85. tenantId:tenantObj.tenantId,
  86. openid,
  87. }
  88. api_getUserInfo(data).then(res=>{
  89. let userInfo = res.data
  90. this.setData({
  91. userInfo,
  92. })
  93. })
  94. },
  95. submit(e){
  96. const tenantObj = wx.getStorageSync('tenant')
  97. const openid = wx.getStorageSync('openid')
  98. if(this.data.form.content == ''){
  99. wx.showToast({
  100. title: '还没提交相关建议',
  101. icon:'none'
  102. })
  103. }else{
  104. let data = {
  105. tenantId:tenantObj.tenantId,
  106. openid : openid,
  107. nickname:this.data.userInfo.nickname,
  108. suggestName:this.data.form.content
  109. }
  110. api_westreamSuggest(data).then(res=>{
  111. let dialogShow = true
  112. this.setData({
  113. dialogShow,
  114. })
  115. })
  116. }
  117. },
  118. })