index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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.appLogo" ></image>
  14. <view class="name">{{item.appTitle}}</view>
  15. </div>
  16. </div>
  17. </view>
  18. </template>
  19. <script>
  20. import {getByQr} from '@/api/openApi.js'
  21. import applist from './app_router.js'
  22. export default {
  23. data() {
  24. return {
  25. formData:{
  26. issue:""
  27. },
  28. actionList:[]
  29. }
  30. },
  31. onLoad(options){
  32. this.init(options)
  33. },
  34. methods: {
  35. init(options){
  36. this.getData(options)
  37. },
  38. getData({ocId, code}){
  39. if(!ocId)return
  40. getByQr(ocId, code).then((res)=>{
  41. this.actionList=res.data.appList
  42. uni.setStorageSync('qrcode',{
  43. ...res.data.target,
  44. targetId:res.data.targetId,
  45. targetType:res.data.targetType,
  46. ocId,
  47. code
  48. })
  49. })
  50. },
  51. handle(item){
  52. if(item.checklistId){
  53. uni.navigateTo({
  54. url:'/pages/app_views/checkList/index/index?type=app&id='+item.checklistId
  55. })
  56. return
  57. }
  58. let url=applist[item.appCode]
  59. if(url===undefined){
  60. uni.showToast({
  61. icon:"none",
  62. title:"功能正在维护"
  63. })
  64. return
  65. }
  66. uni.navigateTo({
  67. url
  68. })
  69. },
  70. isLogin(){
  71. let isLogin=uni.getStorageSync('isLogin')
  72. if(!isLogin){
  73. // #ifdef H5
  74. uni.navigateTo({
  75. url:'/pages/login/index'
  76. })
  77. // #endif
  78. // #ifndef H5
  79. uni.navigateTo({
  80. url:'/pages/authorizedLogin/index'
  81. })
  82. // #endif
  83. }
  84. },
  85. submit(form) {
  86. }
  87. },
  88. onShareAppMessage() {
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .container {
  94. padding: 20px;
  95. font-size: 14px;
  96. line-height: 24px;
  97. .button{
  98. background-color:#3384FF;
  99. color: #fff;
  100. }
  101. .action-container{
  102. display: flex;
  103. flex-wrap: wrap;
  104. .app-item{
  105. display: flex;
  106. justify-content: center;
  107. align-items: center;
  108. flex-direction: column;
  109. width: 25%;
  110. padding: 20rpx 10rpx;
  111. box-sizing: border-box;
  112. // border: 1px solid #efe3e3;
  113. border-left: 0;
  114. &:nth-child(1){
  115. // border-left: 1rpx solid #efe3e3;
  116. border-radius: 20rpx;
  117. }
  118. .logo{
  119. display: block;
  120. width: 80rpx;
  121. height: 80rpx;
  122. border: 1px solid #efe3e3;
  123. border-radius: 10rpx;
  124. }
  125. .name{
  126. width: 100%;
  127. color: #666;
  128. font-size: 24rpx;
  129. line-height: 1;
  130. margin-top: 20rpx;
  131. text-overflow: ellipsis;
  132. word-break: break-all;
  133. overflow: hidden;
  134. white-space: nowrap;
  135. }
  136. }
  137. }
  138. }
  139. </style>