supetask.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view>
  3. <view class="" style="width: 100%;height: 30rpx;background-color: #f7f7f7;">
  4. </view>
  5. <taskdetails :taskshow="taskshow" :istask="istask" @tosubm="tosubm" @toinsect="toinsect" @tolist="tolist" ref="child"></taskdetails>
  6. </view>
  7. </template>
  8. <script>
  9. import taskdetails from "../../components/task-details.vue"
  10. export default {
  11. components:{
  12. taskdetails
  13. },
  14. data() {
  15. return {
  16. taskshow:false,
  17. istask:2,
  18. taskid:''
  19. }
  20. },
  21. watch: {
  22. videoData(news, old) {
  23. console.log('触发了2222222222222222222222')
  24. console.log(news)
  25. uni.switchTab({
  26. url: '../response/index'
  27. })
  28. // if (news) {
  29. // }
  30. },
  31. },
  32. computed: {
  33. // 视频消息
  34. videoData() {
  35. return this.$store.state.video
  36. },
  37. },
  38. methods: {
  39. tosubm(){
  40. uni.navigateTo({
  41. url:"./submitsupe?id="+this.taskid
  42. })
  43. },
  44. toinsect(item){
  45. uni.navigateTo({
  46. url:"../insectpest/insectpest?id="+item
  47. })
  48. },
  49. tolist(id){
  50. uni.navigateTo({
  51. url:"../insectpest/baselist?id="+id+"&taskshow="+this.taskshow
  52. })
  53. }
  54. },
  55. onNavigationBarButtonTap(e){
  56. if(this.istask==2){
  57. this.tosubm()
  58. }
  59. },
  60. onLoad(option) {
  61. this.taskid = Number(option.id)
  62. let pages = getCurrentPages();
  63. console.log(pages.length,'--------------- onload')
  64. var page = pages[pages.length - 1];
  65. var currentWebview = page.$getAppWebview();
  66. if(this.istask==1){
  67. currentWebview.setTitleNViewButtonStyle(0, {
  68. text: "提交",
  69. });
  70. }else if(this.istask == 2){
  71. currentWebview.setTitleNViewButtonStyle(0, {
  72. text: "监督",
  73. });
  74. }else{
  75. currentWebview.setTitleNViewButtonStyle(0, {
  76. text: " ",
  77. });
  78. }
  79. this.$nextTick(()=>{
  80. this.$refs.child.gettaskinfo(option.id)
  81. })
  82. // this.$refs.child.no()
  83. }
  84. }
  85. </script>
  86. <style>
  87. </style>