land.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. <template>
  2. <view :class="[AppTheme]" class="all_box container">
  3. <!-- #ifdef APP-PLUS || MP-WEIXIN -->
  4. <u-navbar title="土地租赁" :titleStyle="{color:'#ffffff'}" :bgColor="primary" :autoBack="false" :fixed="true"
  5. :placeholder="true" :height="45">
  6. <view class="u-nav-slot" slot="left"></view>
  7. </u-navbar>
  8. <!-- #endif -->
  9. <!-- #ifdef APP-PLUS || MP-WEIXIN -->
  10. <u-sticky :offset-top="offset" style="z-index: 10;">
  11. <!-- #endif -->
  12. <!-- #ifdef H5 -->
  13. <u-sticky offset-top="-44" style="z-index: 10;">
  14. <!-- #endif -->
  15. <view class="head_fixation">
  16. <view class="stitching_background bg-primary">
  17. <view class="address_information border-primary">农场土地列表</view>
  18. <view class="floating_mark"></view>
  19. </view>
  20. <view class="data_display">
  21. <u-tabs ref="uTabs" :list="ubseclist" :activeStyle="{
  22. color: primary,
  23. transform: 'scale(1.05)'
  24. }" :inactiveStyle="{
  25. color: '#606266',
  26. transform: 'scale(1)'
  27. }" font-size="28rpx" lineWidth="60" :scrollable="false" :lineColor="primary" :current="current"
  28. @click="casesort">
  29. </u-tabs>
  30. </view>
  31. </view>
  32. </u-sticky>
  33. <view style="padding-bottom: 120rpx;padding-top: 15rpx;">
  34. <view @click="$until.toUrl('/pagesD/pages/product/product?id=' + item2.id)"
  35. open-type="navigate" hover-class="none" class="base_item" v-for="(item2, index2) in farmlist"
  36. :key="index2">
  37. <u--image :src="item2.pic || default_img" radius="8" width="100%" height="26vh"></u--image>
  38. <view class="case_titleblock">
  39. <view class="case_title">{{ item2.name }}</view>
  40. </view>
  41. <!-- <view class="case_title_sm">{{ item2.soil_desc }}</view> -->
  42. <view class="price_selection">
  43. <view class="commodity_price">
  44. 价格:
  45. <text class="commodity_price_red text-neutral">¥{{ item2.price }}</text>
  46. </view>
  47. <view class="choose_land bg-primary">选择土地</view>
  48. </view>
  49. </view>
  50. <u-loadmore :line="true" :status="status" />
  51. <admyself :opshow="true"></admyself>
  52. </view>
  53. <!-- 分享 -->
  54. <sharebox ref="sbox" v-if="sharedata" :data="sharedata"></sharebox>
  55. <tabbar :primary="primary"></tabbar>
  56. </view>
  57. </template>
  58. <script>
  59. import tabbar from '@/components/tabbar/tabbar.vue';
  60. import Landapi from '@/api/land/index.js';
  61. export default {
  62. components: {
  63. tabbar
  64. },
  65. data() {
  66. let siteinfo = getApp().globalData.siteinfo;
  67. const img = siteinfo.root_img + '/static/app/imgs/default-goods.png';
  68. return {
  69. default_img: img,
  70. offset: 45,
  71. primary: this.$theme.primary,
  72. status: 'loadmore',
  73. sortorder: 1,
  74. promptstatement: '提示语句',
  75. farmlist: [],
  76. //顶部距离
  77. scrollTop: 0,
  78. customstyle: {
  79. background: '#F4F6F8'
  80. },
  81. nowindex: 1,
  82. nomorelist: false,
  83. ubseclist: [{
  84. name: '综合排序'
  85. },
  86. {
  87. name: '销量优先'
  88. },
  89. {
  90. name: '距离优先'
  91. },
  92. {
  93. name: '人气优先'
  94. }
  95. ],
  96. current: 0,
  97. settingFile: getApp().globalData.siteinfo,
  98. sharedata: null,
  99. };
  100. },
  101. onShareAppMessage(res) {
  102. let that = this
  103. let data = {
  104. title: that.sharedata.title,
  105. imageUrl: that.sharedata.imageUrl,
  106. path: that.sharedata.path
  107. };
  108. return data;
  109. },
  110. onShareTimeline(res) {
  111. let that = this
  112. return {
  113. title: that.sharedata.title,
  114. imageUrl: that.sharedata.imageUrl,
  115. path: that.sharedata.path
  116. }
  117. },
  118. onPageScroll: function(e) {
  119. this.scrollTop = e.scrollTop;
  120. },
  121. onPullDownRefresh() {
  122. console.log("下拉刷新了")
  123. this.getlandlist(this.current + 1, 1);
  124. },
  125. onReachBottom() {
  126. console.log("上拉加载")
  127. },
  128. onLoad(options) {
  129. let that = this;
  130. that.$bindid.getbindid(options, that.$store);
  131. that.getlandlist(1, 1);
  132. that.$init_config(2, function(res) {
  133. if (that.$config) {
  134. that.sharedata = that.$config.sharedata
  135. }
  136. })
  137. },
  138. onShow: function() {
  139. let that = this;
  140. that.$init_config();
  141. if (that.primary == '' || that.primary != that.$theme.primary) {
  142. that.primary = that.$theme.primary;
  143. }
  144. this.getlandlist(1, 1);
  145. that.offset = that.offset + uni.$u.sys().statusBarHeight
  146. },
  147. methods: {
  148. // 切换排序视图
  149. casesort(item) {
  150. var that = this;
  151. var index = item.index
  152. that.current = index;
  153. if (index !== null && index !== undefined) {
  154. that.sortorder = index + 1;
  155. that.nomorelist = false
  156. this.nowindex = 1;
  157. if (that.sortorder === 1) {
  158. //根据综合进行切换数据集操作
  159. that.getlandlistcase(1, that.nowindex);
  160. } else if (that.sortorder === 2) {
  161. //根据销量进行切换数据集操作
  162. that.getlandlistcase(2, that.nowindex);
  163. } else if (that.sortorder === 3) {
  164. //根据距离进行切换数据集操作
  165. that.getlandlistcase(3, that.nowindex);
  166. } else if (that.sortorder === 4) {
  167. //根据人气进行切换数据集操作
  168. that.getlandlistcase(4, that.nowindex);
  169. }
  170. }
  171. },
  172. scrolltolower() {
  173. },
  174. // 请求land土地信息
  175. getlandlist(type, p) {
  176. let data = {
  177. type: type,
  178. p: p
  179. };
  180. if (!this.nomorelist) {
  181. this.status = 'loading'
  182. Landapi.landlist(data).then(res => {
  183. if (res.status == 1) {
  184. this.farmlist = []
  185. if (res.data !== null && res.data !== undefined && res.data.length > 0) {
  186. // 获取服务套餐详情集合
  187. res.data.forEach(item => {
  188. this.farmlist.push(item);
  189. });
  190. this.nowindex = p;
  191. if (res.data.length == 10) {
  192. this.status = "loadmore"
  193. } else {
  194. this.status = "nomore"
  195. }
  196. }
  197. } else {
  198. this.status = "nomore"
  199. this.nomorelist = true;
  200. }
  201. uni.stopPullDownRefresh()
  202. });
  203. }
  204. },
  205. // 请求land土地信息
  206. getlandlistcase(type, p) {
  207. let data = {
  208. type: type,
  209. p: p
  210. };
  211. if (!this.nomorelist) {
  212. Landapi.landlist(data).then(res => {
  213. if (res.status == 1) {
  214. if (res.data !== null && res.data !== undefined && res.data.length > 0) {
  215. // 获取服务套餐详情集合
  216. this.farmlist = res.data;
  217. this.nowindex = p;
  218. if (res.data.length == 10) {
  219. this.status = "loadmore"
  220. } else {
  221. this.status = "nomore"
  222. }
  223. }
  224. } else {
  225. this.status = "nomore"
  226. this.nomorelist = true;
  227. }
  228. });
  229. }
  230. }
  231. },
  232. // #ifndef MP-WEIXIN
  233. // 标题栏input搜索框点击
  234. onNavigationBarSearchInputClicked: async function(e) {},
  235. //点击导航栏 buttons 时触发
  236. onNavigationBarButtonTap(e) {}
  237. // #endif
  238. };
  239. </script>
  240. <style lang="scss" scoped>
  241. .all_box {
  242. min-height: calc(100vh - 50rpx);
  243. }
  244. .nomorelist {
  245. display: flex;
  246. justify-content: center;
  247. align-items: center;
  248. font-size: 30rpx;
  249. color: #333;
  250. margin-bottom: 40rpx;
  251. }
  252. .pading_bss {
  253. height: 140rpx;
  254. width: 100%;
  255. }
  256. .container {
  257. position: relative;
  258. }
  259. .head_fixation {
  260. width: 100%;
  261. z-index: 10;
  262. }
  263. .stitching_background {
  264. height: 75rpx;
  265. display: flex;
  266. align-items: center;
  267. flex-wrap: wrap;
  268. }
  269. .address_information {
  270. font-size: 32rpx;
  271. color: #ffffff;
  272. text-indent: 1em;
  273. width: 100%;
  274. }
  275. .floating_mark {
  276. background-color: #ffffff;
  277. height: 8rpx;
  278. width: 50rpx;
  279. margin-left: 85rpx;
  280. }
  281. .swiper-box {
  282. height: calc(100vh + 30px);
  283. overflow-y: auto;
  284. }
  285. .view_layer {
  286. height: 100%;
  287. overflow-y: auto;
  288. padding-top: 15rpx;
  289. }
  290. .data_display {
  291. width: 100%;
  292. background-color: #ffffff;
  293. font-variant: common-ligatures;
  294. height: 44px;
  295. }
  296. .sort_item_selt {
  297. color: #56ab2f;
  298. }
  299. .base_list {
  300. width: 100%;
  301. padding-top: 5rpx;
  302. }
  303. .base_item {
  304. padding-bottom: 30rpx;
  305. border-radius: 30rpx !important;
  306. background: #ffffff;
  307. box-shadow: 0 0 6rpx 0 rgba(0, 0, 0, 0.2);
  308. margin: 0rpx 20rpx 30rpx 20rpx;
  309. u--image{
  310. height: 26vh;
  311. }
  312. }
  313. .case_titleblock {
  314. display: flex;
  315. justify-content: flex-start;
  316. align-items: center;
  317. padding: 0 20rpx;
  318. }
  319. .case_title {
  320. font-size: 30rpx;
  321. height: 55rpx;
  322. line-height: 55rpx;
  323. color: #000;
  324. font-weight: 550;
  325. }
  326. .activity_target {
  327. color: #ffffff;
  328. font-size: 28rpx;
  329. background-color: #ff8d0a;
  330. margin-left: 10rpx;
  331. padding: 5rpx 8.5rpx;
  332. border-radius: 10rpx 0 10rpx 0;
  333. }
  334. .case_title_sm {
  335. font-size: 26rpx;
  336. color: #999;
  337. padding: 0 20rpx;
  338. margin: 10rpx 0;
  339. }
  340. .price_selection {
  341. display: flex;
  342. justify-content: space-between;
  343. align-items: center;
  344. padding: 0 20rpx;
  345. }
  346. .commodity_price {
  347. font-size: 28rpx;
  348. color: #333;
  349. }
  350. .commodity_price_red {
  351. font-weight: 800;
  352. margin: 0 10rpx;
  353. }
  354. .choose_land {
  355. font-size: 26rpx;
  356. color: #ffffff;
  357. border-radius: 30rpx;
  358. padding: 15rpx 25rpx;
  359. }
  360. .load_window {
  361. display: flex;
  362. align-items: center;
  363. justify-content: center;
  364. position: fixed;
  365. top: 50%;
  366. left: 50%;
  367. transform: translate(-50%, -50%);
  368. width: 160rpx;
  369. height: 100rpx;
  370. flex-wrap: wrap;
  371. background-color: rgba($color: #000000, $alpha: 0.7);
  372. }
  373. .promptstatement {
  374. width: 100%;
  375. font-size: 25rpx;
  376. color: #ffffff;
  377. text-align: center;
  378. }
  379. .aannajn {
  380. width: 100%;
  381. }
  382. </style>