discern.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <!-- 病虫害识别技术 -->
  3. <view>
  4. <view class="page-panel">
  5. <!-- 识别列表 -->
  6. <view class="media-item">
  7. <view class="media-hd">
  8. <image src="@/static/demo/demo1.png" mode="aspectFill"></image>
  9. </view>
  10. <view class="media-bd">
  11. <view class="title">虫害识别技术</view>
  12. <view class=" flex-1 text">
  13. 介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字
  14. </view>
  15. <button class="btn" @click="uploadFile()">我要识别</button>
  16. </view>
  17. </view>
  18. <view class="media-item">
  19. <view class="media-hd">
  20. <image src="@/static/demo/demo1.png" mode="aspectFill"></image>
  21. </view>
  22. <view class="media-bd">
  23. <view class="title">虫害识别技术</view>
  24. <view class=" flex-1 text">
  25. 介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍文字
  26. </view>
  27. <button class="btn" @click="uploadFile()">我要识别</button>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="btn-box">
  32. <button class="btn">专家指导</button>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. data() {
  39. return {
  40. };
  41. },
  42. methods: {
  43. // 上传图片
  44. async uploadFile(e) {
  45. let res = await this.uploadImageSync();
  46. if (res.success) {
  47. }
  48. },
  49. uploadImageSync() {
  50. return new Promise((resolve, reject) => {
  51. uni.chooseImage({
  52. count: 1, // 默认9
  53. sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
  54. sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
  55. success(res) {
  56. const tempFilePaths = res.tempFilePaths;
  57. }
  58. })
  59. })
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss">
  65. .media-item {
  66. position: relative;
  67. display: flex;
  68. padding-top: 24rpx;
  69. padding-bottom: 24rpx;
  70. background-color: #fff;
  71. border-bottom: 1rpx solid #F5F5F5;
  72. &:first-child {
  73. padding-top: 0;
  74. }
  75. &:last-child {
  76. padding-bottom: 0;
  77. border: none;
  78. }
  79. }
  80. .media-hd {
  81. overflow: hidden;
  82. width: 336rpx;
  83. height: 255rpx;
  84. margin-right: 32rpx;
  85. border-radius: 6rpx;
  86. }
  87. .media-bd {
  88. display: flex;
  89. flex: 1;
  90. flex-direction: column;
  91. align-items: flex-start;
  92. .title {
  93. margin-bottom: 5rpx;
  94. font-size: 32rpx;
  95. color: #333333;
  96. line-height: 45rpx;
  97. }
  98. .text {
  99. display: -webkit-box;
  100. -webkit-line-clamp: 4;
  101. -webkit-box-orient: vertical;
  102. overflow: hidden;
  103. text-overflow: ellipsis;
  104. font-size: 24rpx;
  105. color: #999999;
  106. line-height: 34rpx;
  107. }
  108. .btn {
  109. height: 60rpx;
  110. margin-top: 16rpx;
  111. margin-right: 0;
  112. font-size: 24rpx;
  113. }
  114. }
  115. .btn-box {
  116. padding: 180rpx 24rpx 100rpx;
  117. overflow: hidden;
  118. }
  119. </style>