index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="container">
  3. <uni-forms :label-width="80">
  4. <uni-forms-item label="问题反馈" name="issue" required>
  5. <uni-easyinput v-model="formData.issue"
  6. type="textarea"
  7. placeholder="请输入问题反馈"
  8. :maxlength='-1' autoHeight />
  9. </uni-forms-item>
  10. </uni-forms>
  11. <div class="action-container">
  12. <div class="app-item" v-for="(item,index) in actionList" :key="index" @click="handle(item)">
  13. <image class="logo" :src="item.miniLogo" ></image>
  14. <view class="name">{{item.miniTitle}}</view>
  15. </div>
  16. </div>
  17. </view>
  18. </template>
  19. <script>
  20. import {getByQr} from '@/api/openApi.js'
  21. export default {
  22. data() {
  23. return {
  24. formData:{
  25. issue:""
  26. },
  27. actionList:[]
  28. }
  29. },
  30. onLoad(options){
  31. this.init(options)
  32. },
  33. methods: {
  34. init(options){
  35. this.getData(options)
  36. },
  37. getData({ocId, code}){
  38. if(!ocId){
  39. let qrcode=uni.getStorageSync('qrcode')
  40. if(!qrcode){
  41. return
  42. }
  43. ocId=qrcode.ocId
  44. code=qrcode.code
  45. }
  46. getByQr(ocId, code).then((res)=>{
  47. this.actionList=res.data.miniList
  48. uni.setStorageSync('qrcode',{
  49. ...res.data.target,
  50. targetId:res.data.targetId,
  51. targetType:res.data.targetType,
  52. ocId,
  53. code
  54. })
  55. })
  56. },
  57. handle(item){
  58. if(item.miniCode==='app-snapshot'){ //隐患登记
  59. uni.navigateTo({url:'/pages/app_views/danger/submit/submit'})
  60. }
  61. if(item.miniCode==='app-checklist'){// 清单
  62. uni.navigateTo({url:'/pages/app_views/checkList/index/index?type=app&id='+item.checklistId})
  63. }
  64. if(item.miniCode==='app-checklist-satisfaction'){// 满意度
  65. uni.navigateTo({url:'/pages/app_views/satisfaction_evaluation/satisfaction_evaluation?type=app&id='+item.checklistId})
  66. }
  67. },
  68. isLogin(){
  69. let isLogin=uni.getStorageSync('isLogin')
  70. if(!isLogin){
  71. // #ifdef H5
  72. uni.navigateTo({
  73. url:'/pages/login/index'
  74. })
  75. // #endif
  76. // #ifndef H5
  77. uni.navigateTo({
  78. url:'/pages/authorizedLogin/index'
  79. })
  80. // #endif
  81. }
  82. },
  83. submit(form) {
  84. },
  85. isNull(val){
  86. if(val===undefined||val==="undefined"||val===""||val===null){
  87. return true
  88. }
  89. return false
  90. }
  91. },
  92. onShareAppMessage() {
  93. }
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .container {
  98. padding: 20px;
  99. font-size: 14px;
  100. line-height: 24px;
  101. .button{
  102. background-color:#3384FF;
  103. color: #fff;
  104. }
  105. .action-container{
  106. display: flex;
  107. flex-wrap: wrap;
  108. .app-item{
  109. display: flex;
  110. justify-content: center;
  111. align-items: center;
  112. flex-direction: column;
  113. width: 25%;
  114. padding: 20rpx 10rpx;
  115. box-sizing: border-box;
  116. // border: 1px solid #efe3e3;
  117. border-left: 0;
  118. &:nth-child(1){
  119. // border-left: 1rpx solid #efe3e3;
  120. border-radius: 20rpx;
  121. }
  122. .logo{
  123. display: block;
  124. width: 80rpx;
  125. height: 80rpx;
  126. border: 1px solid #efe3e3;
  127. border-radius: 10rpx;
  128. }
  129. .name{
  130. width: 100%;
  131. color: #666;
  132. font-size: 24rpx;
  133. line-height: 1;
  134. margin-top: 20rpx;
  135. text-overflow: ellipsis;
  136. word-break: break-all;
  137. overflow: hidden;
  138. white-space: nowrap;
  139. text-align: center;
  140. }
  141. }
  142. }
  143. }
  144. </style>