1
0

detail.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view class="main">
  3. <view class="title">{{ item.title }}</view>
  4. <u-divider text="开始"></u-divider>
  5. <view class="item" v-for="(item, index) in item.op" :key="item.name">
  6. <view class="mtt">
  7. <text class="ifnull" v-if="item.ifnull == '必填'">*</text>
  8. <text class="index">{{ index + 1 }}、</text>
  9. <text class="tm">{{ item.name }}</text>
  10. <text class="dx">({{ item.input }})</text>
  11. </view>
  12. <view class="mts">
  13. <input v-if="item.input == '填空'" v-model="item.s_value" placeholder="请输入" />
  14. <input v-if="item.input == '数字' || item.input == '电话'" type="number" v-model="item.s_value" placeholder="请输入" :disabled="look ? true : false" />
  15. <textarea v-if="item.input == '多行文本'" v-model="item.s_value" placeholder="请输入" />
  16. <view v-if="item.input == '附件'">
  17. <images v-model="item.s_value" :read="look ? true : false"></images>
  18. <view class="fjsc" v-if="!look">最多添加5个附件,单个文件不超过20M。</view>
  19. </view>
  20. <view class="ops" v-if="item.input == '单选' || item.input == '多选' || item.input == '判断'">
  21. <view v-for="(op, i) in item.selects" :key="op.name">
  22. <view class="op" :class="{ active: op.check }" @click="check(item, op)">{{ op.name }}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <u-divider text="结束"></u-divider>
  28. <button class="btn">立即提交</button>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. look: false,
  36. item: {}
  37. };
  38. },
  39. onLoad(e) {
  40. this.http.request({
  41. url: '/app/follow/detail/115',
  42. success: (res) => {
  43. this.item = res.data.data;
  44. this.item.op = JSON.parse(this.item.op);
  45. }
  46. });
  47. },
  48. methods: {}
  49. };
  50. </script>
  51. <style lang="scss">
  52. .title {
  53. text-align: center;
  54. }
  55. .item {
  56. .mtt {
  57. text-align: left;
  58. font-size: 16px;
  59. padding: 12px 0px 12px 0px;
  60. position: relative;
  61. color: $font-c;
  62. .ifnull {
  63. color: red;
  64. font-weight: bold;
  65. }
  66. .tm {
  67. padding-left: 0px;
  68. }
  69. .dx {
  70. font-size: 12px;
  71. color: #989898;
  72. }
  73. }
  74. input {
  75. background-color: white;
  76. border-radius: 5px;
  77. padding: 12px;
  78. font-size: 14px;
  79. }
  80. textarea {
  81. background-color: white;
  82. border-radius: 5px;
  83. width: 93%;
  84. padding: 12px;
  85. font-size: 14px;
  86. height: 70px;
  87. }
  88. .ops {
  89. margin-top: -5px;
  90. overflow: hidden;
  91. .op {
  92. padding: 8px;
  93. background-color: white;
  94. margin-top: 10px;
  95. font-size: 14px;
  96. border-radius: 3px;
  97. color: #656363;
  98. float: left;
  99. margin-right: 7px;
  100. &.active {
  101. background-color: $main-color;
  102. color: white;
  103. }
  104. }
  105. }
  106. .choice {
  107. background-color: white;
  108. margin-top: 5px;
  109. padding: 12px;
  110. border-radius: 3px;
  111. font-size: 14px;
  112. color: #656363;
  113. overflow: hidden;
  114. .omit {
  115. width: 80%;
  116. float: left;
  117. }
  118. .gx {
  119. font-weight: bold;
  120. color: #4581fb;
  121. padding-left: 5px;
  122. }
  123. .icon {
  124. float: right;
  125. margin-top: 3px;
  126. }
  127. }
  128. .up {
  129. font-size: 14px;
  130. color: #989898;
  131. position: relative;
  132. .icon {
  133. padding-right: 3px;
  134. }
  135. }
  136. .fjsc {
  137. color: #989898;
  138. font-size: 14px;
  139. margin-top: 5px;
  140. }
  141. }
  142. </style>