identifyPest.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. <template>
  2. <view>
  3. <!-- 拍照识别 -->
  4. <view class="photograph_box">
  5. <!-- 标题 -->
  6. <view class="photograph_div">
  7. <view class="photograph_tit"></view>
  8. <text class="photograph_txt">田间随识</text>
  9. </view>
  10. <!-- 列表 -->
  11. <view class="photograph_ul">
  12. <view
  13. @click="selectPlant(item)"
  14. class="photograph_list"
  15. v-for="(item, index) in photArr"
  16. :key="index"
  17. >
  18. <image
  19. :src="$imageHost+'/bigservers/' + item.url"
  20. mode=""
  21. class="photograph_list_img"
  22. ></image>
  23. </view>
  24. </view>
  25. </view>
  26. <!-- 拍照指南 -->
  27. <image :src="$imageHost+'/bigservers/' + 'images/home_5.png'" @click="photoGuide('/pages/identifyPest/guidance/guidance')"
  28. class="photo_img" mode=""></image>
  29. <!-- 更多操作 -->
  30. <!-- <view class="operation_box">
  31. <view class="operation_div">
  32. <view class="operation_tit"></view>
  33. <text class="operation_txt">更多操作</text>
  34. </view>
  35. <view class="operation_ul">
  36. <image @click="photoGuide('/pages/repository/repository')" :src="$imageHost+'/bigservers/' + 'images/home_6.png'"
  37. class="operation_left" mode=""></image>
  38. <view class="operation_list">
  39. <image @click="photoGuide('/pages/discernRecord/discernRecord')" :src="$imageHost+'/bigservers/' + 'images/home_7.png'"
  40. class="operation_rightTop" mode=""></image>
  41. <image @click="photoGuide('/pages/collect/collect')" :src="$imageHost+'/bigservers/' + 'images/home_8.png'"
  42. class="operation_rightBottom" mode=""></image>
  43. </view>
  44. </view>
  45. </view> -->
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. searchVal: '', //测试
  53. photArr: [
  54. {
  55. url: 'images/home_1.png',
  56. // dat: '/pages/identifyPest/economicsPlant/economicsPlant',
  57. name: '经济作物',
  58. type: 'economicsPlant'
  59. },
  60. // {
  61. // 'url': 'images/home_2.png',
  62. // 'dat': '/pages/identifyPest/fruitsPlant/fruitsPlant',
  63. // 'name': '水果作物'
  64. // },
  65. // {
  66. // 'url': 'images/home_3.png',
  67. // 'dat': '/pages/identifyPest/vegetablesPlant/vegetablesPlant',
  68. // 'name': '蔬菜作物'
  69. // },
  70. {
  71. url: 'images/home_4.png',
  72. // dat: '/pages/identifyPest/cerealPlant/cerealPlant',
  73. name: '粮食作物',
  74. type: 'cerealPlant'
  75. },
  76. ], //拍照识别图片列表
  77. };
  78. },
  79. methods: {
  80. // 拍照识别跳转
  81. selectPlant(item) {
  82. // console.log(url)
  83. uni.navigateTo({
  84. url: `/pages/identifyPest/identifyPestIndex/identifyPestIndex?type=${item.type}`,
  85. });
  86. },
  87. // 拍照指南、知识库、识别记录、我的收藏跳转
  88. photoGuide(url) {
  89. uni.navigateTo({
  90. url,
  91. });
  92. },
  93. //左侧边弹框点击事件
  94. defails(url) {
  95. uni.navigateTo({
  96. url,
  97. });
  98. },
  99. // 点击右上角进入城市列表
  100. // cityList() {
  101. // uni.navigateTo({
  102. // url: '/pages/cityList/cityList'
  103. // })
  104. // },
  105. onShow: function () {
  106. // var that = this
  107. // uni.getStorage({
  108. // key: 'location',
  109. // success: function(res) {
  110. // console.log('有')
  111. // },
  112. // fail: function(err) {
  113. // console.log('没有,去请求')
  114. // if (that.searchVal == '') {
  115. // that.getLocation() //位置信息
  116. // }
  117. // }
  118. // })
  119. // this.weatherData() //天气
  120. // this.userAxios() //个人信息数据
  121. // console.log(mphone)
  122. // that.phoneNum = mphone
  123. },
  124. onLoad() {
  125. // if (this.searchVal == '') {
  126. // this.getLocation() //位置信息
  127. // }
  128. // var that = this
  129. // uni.getStorage({
  130. // key: 'location',
  131. // success: function(res) {
  132. // console.log('有')
  133. // },
  134. // fail: function(err) {
  135. // console.log('没有,去请求')
  136. // if (that.searchVal == '') {
  137. // that.getLocation() //位置信息
  138. // }
  139. // }
  140. // })
  141. },
  142. },
  143. };
  144. </script>
  145. <style lang="scss">
  146. // 顶部导航左图标
  147. .navTopLeftIcon {
  148. width: 38rpx;
  149. height: 35rpx;
  150. margin: 0 0 0 25rpx;
  151. }
  152. // 顶部导航右
  153. .navRight {
  154. position: absolute;
  155. top: 28rpx;
  156. right: 18rpx;
  157. .navTopRigthIcon {
  158. width: 23rpx;
  159. height: 30rpx;
  160. vertical-align: top;
  161. }
  162. text {
  163. width: 95rpx;
  164. height: 50rpx;
  165. font-size: 13px;
  166. color: #fff;
  167. text-align: center;
  168. display: inline-block;
  169. white-space: nowrap;
  170. text-overflow: ellipsis;
  171. overflow: hidden;
  172. }
  173. }
  174. // 个人资料
  175. .userBox {
  176. // border: 1px solid #000;
  177. display: flex;
  178. padding: 50rpx 50rpx 50rpx 30rpx;
  179. .userBox_image {
  180. width: 120rpx;
  181. height: 120rpx;
  182. border-radius: 55px;
  183. }
  184. .userDiv {
  185. // border: 1px solid #000;
  186. padding-top: 10rpx;
  187. margin-left: 30rpx;
  188. .userDiv_name {
  189. font-weight: 550;
  190. font-size: 23px;
  191. text-align: left;
  192. }
  193. .userDiv_phone {
  194. color: #9a9a9a;
  195. text-align: left;
  196. }
  197. }
  198. }
  199. // 操作列表
  200. .operation_ulA {
  201. // border: 1px solid #000;
  202. .operation_list {
  203. display: flex;
  204. justify-content: space-between;
  205. width: 90%;
  206. margin: 65rpx auto;
  207. .operation_listDiv {
  208. .operation_listDivIcon {
  209. width: 40rpx;
  210. height: 40rpx;
  211. vertical-align: bottom;
  212. }
  213. text {
  214. color: #5a5a5a;
  215. margin: 10rpx 0 0 20rpx;
  216. text-align: left;
  217. font-size: 17px;
  218. }
  219. }
  220. .operation_listRight {
  221. width: 40rpx;
  222. height: 40rpx;
  223. vertical-align: bottom;
  224. }
  225. }
  226. }
  227. // 拍照识别
  228. .photograph_box {
  229. // 标题
  230. .photograph_div {
  231. width: 700rpx;
  232. margin: 15rpx auto;
  233. display: flex;
  234. .photograph_tit {
  235. border: 1px solid #45c785;
  236. width: 10rpx;
  237. height: 40rpx;
  238. background: #45c785;
  239. }
  240. .photograph_txt {
  241. color: #333333;
  242. margin-left: 20rpx;
  243. font-weight: 550;
  244. font-size: 17px;
  245. line-height: 35rpx;
  246. }
  247. }
  248. // 图片列表
  249. .photograph_ul {
  250. display: flex;
  251. flex-wrap: wrap;
  252. .photograph_list {
  253. width: 370rpx;
  254. margin: 10rpx auto;
  255. .photograph_list_img {
  256. width: 370rpx;
  257. height: 200rpx;
  258. }
  259. }
  260. }
  261. }
  262. // 拍照指南
  263. .photo_img {
  264. width: 720rpx;
  265. height: 190rpx;
  266. margin: 0 auto;
  267. }
  268. // 更多操作
  269. .operation_box {
  270. // 标题
  271. .operation_div {
  272. width: 700rpx;
  273. margin: 15rpx auto;
  274. display: flex;
  275. .operation_tit {
  276. border: 1px solid #45c785;
  277. width: 10rpx;
  278. height: 40rpx;
  279. background: #45c785;
  280. }
  281. .operation_txt {
  282. color: #333333;
  283. margin-left: 20rpx;
  284. font-weight: 550;
  285. font-size: 17px;
  286. line-height: 35rpx;
  287. }
  288. }
  289. // 列表
  290. .operation_ul {
  291. display: flex;
  292. justify-content: center;
  293. margin-left: -50rpx;
  294. .operation_left {
  295. width: 420rpx;
  296. height: 260rpx;
  297. // margin-top: 8rpx;
  298. // border: 1px solid #000;
  299. }
  300. .operation_list {
  301. width: 250rpx;
  302. .operation_rightTop {
  303. width: 250rpx;
  304. height: 128rpx;
  305. display: block;
  306. // border: 1px solid #000;
  307. }
  308. .operation_rightBottom {
  309. width: 250rpx;
  310. height: 128rpx;
  311. display: block;
  312. // border: 1px solid #000;
  313. }
  314. }
  315. }
  316. }
  317. // 天气
  318. .weather_box {
  319. // 标题
  320. .weather_div {
  321. width: 700rpx;
  322. margin: 15rpx auto;
  323. display: flex;
  324. .weather_tit {
  325. border: 1px solid #45c785;
  326. width: 10rpx;
  327. height: 40rpx;
  328. background: #45c785;
  329. }
  330. .weather_txt {
  331. color: #333333;
  332. margin-left: 20rpx;
  333. font-weight: 550;
  334. font-size: 17px;
  335. line-height: 35rpx;
  336. }
  337. }
  338. // 内容
  339. .weather_ul {
  340. width: 93%;
  341. margin: 0 auto;
  342. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04); // 地址
  343. border-radius: 2px;
  344. .weather_site {
  345. margin: 0 auto;
  346. padding: 10rpx 10rpx 10rpx 0;
  347. .weather_siteImg {
  348. width: 40rpx;
  349. height: 45rpx;
  350. vertical-align: middle;
  351. }
  352. text {
  353. line-height: 28rpx;
  354. color: #777777;
  355. font-size: 12px;
  356. }
  357. }
  358. // 天气数据
  359. .weather_dataBox {
  360. display: flex;
  361. .weather_dataList {
  362. background: #fbfbfb;
  363. width: 250rpx;
  364. padding: 18rpx 0 18rpx 0;
  365. image {
  366. width: 84rpx;
  367. height: 84rpx;
  368. margin: 0 auto;
  369. display: block;
  370. }
  371. .weather_temperature {
  372. text-align: center;
  373. font-size: 15px;
  374. color: #4a4a4a;
  375. }
  376. .weather_time {
  377. text-align: center;
  378. font-size: 11px;
  379. color: #838383;
  380. }
  381. }
  382. }
  383. }
  384. }
  385. </style>