controlReportAdd.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <view class="appWrapper">
  3. <form action="">
  4. <view style="height:30rpx"></view>
  5. <view class="form-item">
  6. <view class="title">
  7. <text class="necessary">*</text>
  8. 监察标题:
  9. </view>
  10. <select name="" id="">
  11. <option value="">标题一</option>
  12. <option value="">标题二</option>
  13. <option value="">标题三</option>
  14. </select>
  15. </view>
  16. <view class="form-item">
  17. <view class="title">所属站点:</view>
  18. <select name="" id="">
  19. <option value="">站点一</option>
  20. <option value="">站点二</option>
  21. <option value="">站点三</option>
  22. </select>
  23. </view>
  24. <view class="form-item">
  25. <view class="title">监察内容:</view>
  26. <textarea maxlength="-1" @input="textareaAInput" placeholder="" width="250"></textarea>
  27. </view>
  28. <view class="form-item">
  29. <view class="title">上传图片:</view>
  30. <view style="width:500rpx">
  31. <view class="cu-form-group" style="padding:0">
  32. <view class="grid col-4 grid-square flex-sub">
  33. <view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
  34. <image :src="imgList[index]" mode="aspectFill"></image>
  35. <view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
  36. <text class='cuIcon-close'></text>
  37. </view>
  38. </view>
  39. <view class="solids" @tap="ChooseImage" v-if="imgList.length<4">
  40. <text class='cuIcon-cameraadd'></text>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="btn-area submitBottomBtn padding-lr-sm">
  47. <button class="bg-blue round margin-top" @click="submit()">提 交 </button>
  48. </view>
  49. </form>
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. data() {
  55. return {
  56. imgList: [],
  57. isShow: false,
  58. formMess: {
  59. "userName": "sss",
  60. "siteName": "",
  61. "place": "",
  62. "longitude": "",
  63. "dimension": "",
  64. "contactor": "",
  65. "mobile": "",
  66. },
  67. }
  68. },
  69. onLoad: function(option) {
  70. },
  71. methods: {
  72. radioChange(e) {
  73. console.log('type:' + e.detail.value);
  74. this.radioOne = e.detail.value;
  75. },
  76. ChooseImage() {
  77. uni.chooseImage({
  78. count: 4, //默认9
  79. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  80. sourceType: ['album'], //从相册选择
  81. success: (res) => {
  82. if (this.imgList.length != 0) {
  83. this.imgList = this.imgList.concat(res.tempFilePaths)
  84. } else {
  85. this.imgList = res.tempFilePaths
  86. }
  87. }
  88. });
  89. },
  90. ViewImage(e) {
  91. uni.previewImage({
  92. urls: this.imgList,
  93. current: e.currentTarget.dataset.url
  94. });
  95. },
  96. DelImg(e) {
  97. uni.showModal({
  98. title: '删除',
  99. content: '确定要删除此图片吗?',
  100. cancelText: '取消',
  101. confirmText: '确定',
  102. success: res => {
  103. if (res.confirm) {
  104. this.imgList.splice(e.currentTarget.dataset.index, 1)
  105. }
  106. }
  107. })
  108. },
  109. submit() {
  110. uni.navigateTo({
  111. url: '/pages/accountManage/success/success',
  112. });
  113. },
  114. }
  115. }
  116. </script>
  117. <style lang="scss">
  118. select {
  119. // background: url(../../../../static/arrow.png) no-repeat scroll 98% center;
  120. background-size: 6%;
  121. }
  122. </style>