identifyPest.vue 8.7 KB

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