financeoperator.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. <template>
  2. <view :class="[AppTheme]" class="all_box">
  3. <!-- #ifdef APP-PLUS || MP-WEIXIN -->
  4. <u-sticky offset-top="0" style="z-index: 10;">
  5. <!-- #endif -->
  6. <!-- #ifdef H5 -->
  7. <u-sticky offset-top="-44" style="z-index: 10;">
  8. <!-- #endif -->
  9. <view class="navbar">
  10. <u-tabs ref="uTabs" @click="tabsChange" :list="titlelist" :scrollable="false" lineWidth="30"
  11. :lineColor="primary" :current="current" :activeStyle="{
  12. color: primary,
  13. transform: 'scale(1.05)'
  14. }" :inactiveStyle="{
  15. color: '#606266',
  16. transform: 'scale(1)'
  17. }">
  18. </u-tabs>
  19. </view>
  20. </u-sticky>
  21. <swiper class="swiper_item" :current="swiperCurrent" @transition="transition"
  22. @animationfinish="animationfinish">
  23. <swiper-item v-for="(item, index) in swimglist" :key="index" @touchmove="stopTouchMove">
  24. <scroll-view class="scroll_bar" :scroll-y="true"@scrolltolower="handle"
  25. :refresher-enabled="true" :refresher-triggered="triggered"
  26. @refresherrefresh="refresh">
  27. <view class="merchant_box" v-for="(item,index2) in storelist" :key="index2">
  28. <view class="text_area">
  29. <view class="shop_name">
  30. <!-- <image :src="item.farm_logo" :lazy-load="true" class="shop_thumbnail"></image> -->
  31. <view class="right_shop_mess">
  32. <view class="shop_line">
  33. <view class="shop_line_p1">{{item.ntime}}
  34. </view>
  35. <view class="shop_line_p2">
  36. {{item.finance_name}}
  37. </view>
  38. <view class="shop_line_p3">
  39. {{item.statustitle}}
  40. </view>
  41. </view>
  42. <view v-if="item.status==1" class="shop_line_fl bg-primary" @click="gostoredetail(item)">
  43. <view >立即管理</view>
  44. </view>
  45. <view v-if="item.status==2" class="shop_line_f2">
  46. <view>{{item.statustitle}}</view>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="">
  52. <u-album singleSize="50" :urls="item.detail_img" maxCount="4" :showMore='true'
  53. rowCount="4"></u-album>
  54. </view>
  55. </view>
  56. <view v-if="storelist.length>0">
  57. <u-loadmore style="margin-top: 30rpx;" :status="loadingType" />
  58. </view>
  59. <u-empty v-if="storelist.length<=0" text="无数据" color="#c0c4cc" icon-color="#c0c4cc" margin-top="70" mode="list">
  60. </u-empty>
  61. <view style="height: 40rpx;"></view>
  62. <!-- <u-loadmore :line="true" :status="loadmore" /> -->
  63. </scroll-view>
  64. </swiper-item>
  65. </swiper>
  66. </view>
  67. </template>
  68. <script>
  69. import mineApi from "@/api/mine/index.js"
  70. export default {
  71. data() {
  72. return {
  73. _freshing: false,
  74. triggered: true,
  75. page: 1,
  76. pagesize: 5,
  77. loadingType: 'more',
  78. primary: this.$theme.primary,
  79. settingFile: getApp().globalData.siteinfo,
  80. loadmore: '',
  81. titlelist: [{
  82. name: '待处理'
  83. },
  84. {
  85. name: '已完成'
  86. }
  87. ],
  88. // 因为内部的滑动机制限制,请将tabs组件和swiper组件的current用不同变量赋值
  89. couponlist: [],
  90. // tabs组件的current值,表示当前活动的tab选项
  91. current: 0,
  92. // swiper组件的current值,表示当前那个swiper-item是活动的
  93. swiperCurrent: 0,
  94. //轮播图数组
  95. swimglist: [1, 2, 3, 4],
  96. swierheight: 0,
  97. storelist: [], //店铺列表
  98. longitude: '',
  99. latitude: '',
  100. position: false,
  101. shipping_address: '', //收货地址
  102. pages: 1, //店铺列表分页
  103. listtype: 0 //店铺列表分页的排序类型
  104. }
  105. },
  106. onLoad() {
  107. if (this.$config && this.$config.app.position == 1) {
  108. this.position = true;
  109. }
  110. this.vueinit()
  111. this.inspection()
  112. },
  113. // onPullDownRefresh() {
  114. // this.vueinit()
  115. // this.getlist(function() {
  116. // uni.stopPullDownRefresh()
  117. // })
  118. // },
  119. // onReachBottom() {
  120. // console.log("上拉加载了")
  121. // },
  122. methods: {
  123. refresh() { //自定义下拉刷新
  124. console.log('下拉刷新了')
  125. if (this._freshing) return;
  126. this._freshing = true;
  127. //调用获取数据的函数
  128. // this.getData();
  129. if (!this.triggered)
  130. //界面下拉触发,triggered可能不是true,要设为true
  131. this.triggered = true;
  132. setTimeout(() => {
  133. this.triggered = false;
  134. this._freshing = false;
  135. uni.stopPullDownRefresh()
  136. }, 2000);
  137. },
  138. preview(url, idx) { //预览图片
  139. uni.previewImage({
  140. current: idx,
  141. urls: url,
  142. success: function(res) {
  143. console.log(res, '预览')
  144. }
  145. })
  146. },
  147. getlocation() { //获取当前位置
  148. let that = this
  149. // #ifdef MP-WEIXIN || APP-PLUS
  150. that.$until.chooseLocation(function(res) {
  151. that.shipping_address = res.address
  152. that.longitude = res.longitude
  153. that.latitude = res.latitude
  154. that.storelist = []
  155. that.inspection()
  156. });
  157. // #endif
  158. },
  159. gostoredetail(farmid) { //
  160. uni.redirectTo({
  161. url: "/pagesD/pages/financeoperator/index?id=" + farmid.id
  162. })
  163. },
  164. inspection(fun) { //店铺列表
  165. let that=this
  166. let data = {
  167. type: that.listtype,
  168. p: that.page,
  169. longitude: that.longitude,
  170. latitude: that.latitude
  171. }
  172. that.loadmore = 'loading'
  173. mineApi.financeoperator(data)
  174. .then(res => {
  175. if (res.status == 1) {
  176. if (res.data.length >= that.pagesize) {
  177. that.loadingType = 'more';
  178. that.page++;
  179. } else {
  180. that.page++;
  181. that.loadingType = 'nomore';
  182. }
  183. that.storelist = that.storelist.concat(res.data);
  184. // this.storelist = res.data;
  185. }else{
  186. that.loadingType = 'more';
  187. }
  188. // this.storelist = res.data;
  189. })
  190. },
  191. //初始化方法
  192. vueinit() {
  193. let that = this
  194. uni.getSystemInfo({
  195. success: function(res) {
  196. that.swierheight = res.windowWidth * 0.9 * 0.65 * 2
  197. }
  198. })
  199. },
  200. // tabs通知swiper切换并更改数据
  201. tabsChange(e) {
  202. this.storelist = []
  203. this.pages = 1
  204. this.swiperCurrent = e.index
  205. this.listtype = e.index
  206. this.inspection()
  207. },
  208. // swiper-item左右移动,通知tabs的滑块跟随移动
  209. transition(e) {
  210. let dx = e.detail.dx
  211. // this.$refs.uTabs.setDx(dx)
  212. },
  213. // 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
  214. // swiper滑动结束,分别设置tabs和swiper的状态
  215. animationfinish(e) {
  216. let current = e.detail.current
  217. // this.$refs.uTabs.setFinishCurrent(current)
  218. this.swiperCurrent = current
  219. this.current = current
  220. },
  221. // //展开底部,可以查看全部信息
  222. expandbottom() {
  223. this.pages++
  224. this.inspection()
  225. },
  226. // //阻止用户手动滑动
  227. stopTouchMove() {
  228. return true
  229. },
  230. handle() {
  231. console.log('上拉加载了')
  232. this.loadingType = 'loading';
  233. this.p++;
  234. this.inspection(this.swiperCurrent);
  235. },
  236. }
  237. }
  238. </script>
  239. <style scoped lang="scss">
  240. .all_box {
  241. width: auto;
  242. background-color: #fcfcfc;
  243. min-height: 100vh;
  244. .navbar {
  245. background-color: #fff;
  246. width: 100%;
  247. z-index: 99;
  248. }
  249. .swiper_item {
  250. height: calc(100vh - 44px);
  251. .chooseaddress {
  252. box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.08);
  253. background-color: #ffffff;
  254. padding: 20rpx 10rpx;
  255. display: flex;
  256. justify-content: space-between;
  257. align-items: center;
  258. margin: 15rpx 20rpx;
  259. margin-top: 20rpx;
  260. border-radius: 10rpx;
  261. .chooseaddress_p1 {
  262. display: flex;
  263. align-items: center;
  264. .chdress_p1txt {
  265. color: #999;
  266. font-size: 24rpx;
  267. }
  268. }
  269. }
  270. .merchant_box {
  271. padding: 20rpx;
  272. margin: 25rpx 20rpx;
  273. border-radius: 10rpx;
  274. box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.08);
  275. background-color: #ffffff;
  276. .text_area {
  277. .shop_thumbnail {
  278. width: 135rpx;
  279. height: 120rpx;
  280. border-radius: 50%;
  281. }
  282. .right_shop_mess {
  283. // width: calc(100% - 120rpx);
  284. display: flex;
  285. justify-content: space-between;
  286. align-items: center;
  287. .shop_line {
  288. width: 70%;
  289. display: flex;
  290. flex-direction: column;
  291. padding: 10rpx;
  292. .shop_line_p1 {
  293. font-size: 28rpx;
  294. }
  295. .shop_line_p2 {
  296. font-size: 32rpx;
  297. font-weight: 600;
  298. margin-top: 1vh;
  299. -webkit-line-clamp: 1;
  300. display: -webkit-box;
  301. -webkit-box-orient: vertical;
  302. overflow: hidden;
  303. text-overflow: ellipsis;
  304. }
  305. .shop_line_p3{
  306. font-size: 28rpx;
  307. color: red;
  308. margin-top: 1vh;
  309. -webkit-line-clamp: 2;
  310. display: -webkit-box;
  311. -webkit-box-orient: vertical;
  312. overflow: hidden;
  313. text-overflow: ellipsis;
  314. }
  315. }
  316. .shop_line_fl {
  317. line-height: 65rpx;
  318. width: 180rpx;
  319. text-align: center;
  320. border-radius: 40rpx;
  321. font-size: 30rpx;
  322. color: #fff;
  323. float: right;
  324. }
  325. .shop_line_f2 {
  326. font-size: 30rpx;
  327. color: #999;
  328. }
  329. }
  330. .shop_line_p4 {
  331. margin-top: 1vh;
  332. display: flex;
  333. justify-content: space-between;
  334. font-size: 28rpx;
  335. padding: 10rpx;
  336. }
  337. }
  338. .display_diagram {
  339. width: 100%;
  340. white-space: nowrap;
  341. margin: 10rpx 0;
  342. .display_diagram_item {
  343. width: 200rpx;
  344. height: 200rpx;
  345. margin: 0 15rpx 0 0;
  346. border-radius: 7.5%;
  347. }
  348. }
  349. }
  350. .scroll_bar {
  351. height: 100%;
  352. }
  353. }
  354. }
  355. </style>