record.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. <template>
  2. <view>
  3. <mescroll-body ref="mescrollRef" @init="mescrollInit" top="20" @down="downCallback" :up="upOption"
  4. @up="upCallback" @emptyclick="emptyClick">
  5. <!-- 数据列表 -->
  6. <view class="list" v-if="goods.length!=0">
  7. <view class="list-item" v-for="(item,index) in goods">
  8. <view class="row1 flex jcsb alc">
  9. <view class="left flex alc">
  10. <view class="bottom" style="margin-top: 6rpx;">
  11. <text class="color1">采购</text>
  12. <text class="color2">销售</text>
  13. <text class="color3">2022.09.01 08:28</text>
  14. </view>
  15. </view>
  16. <view class="right" style="color: #FE6430;">审核中</view>
  17. <view class="right" style="color: #FB2323;">已驳回</view>
  18. <view class="right" style="color: #22C572;">已通过</view>
  19. </view>
  20. <view class="row2">
  21. <mote-lines-divide :dt="content" :line="3" expandText="展开" foldHint="收起" />
  22. </view>
  23. <view class="row3">
  24. <image src="../../static/img/splash3.png" mode="aspectFill" v-for="(item,index) in 9"
  25. class="img"></image>
  26. </view>
  27. <view class="row4">
  28. <u-icon name="map-fill" color="#AFB3BF" size="28" bold></u-icon>
  29. <text class="text">辽宁省营口市鲅鱼圈区xx路108号</text>
  30. </view>
  31. <view class="row5">
  32. <view class="del btn" @click="del(item)">
  33. 删除
  34. </view>
  35. <view class="edit btn" @click="edit(item)">
  36. 编辑
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </mescroll-body>
  42. <view class="add" @click="release">
  43. <u-icon name="plus" color="#fff" size="34" bold></u-icon>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  49. import MoteLinesDivide from "@/components/text-over-flow"
  50. import selectAddress from "@/components/selectAddress.vue"
  51. import {
  52. apiGoods
  53. } from "@/api/mock.js"
  54. export default {
  55. components: {
  56. MoteLinesDivide,
  57. selectAddress
  58. },
  59. mixins: [MescrollMixin], // 使用mixin
  60. data() {
  61. return {
  62. keyword: '',
  63. inputStyle: {
  64. // "padding-left": '30rpx'
  65. },
  66. content: '上半年,普陀区开展“绿剑”系列执法行动二次,共计出动执法人员120余人次,检有关经营主体87余家次,发放宣传资料等200余份;加强农产品和农业…上半年,普陀区开展“绿剑”系列执法行动二次,共计出动执法人员120余人次,检有关经营主体87余家次,发放宣传资料等200余份;加强农产品和农业…',
  67. upOption: {
  68. // page: {
  69. // num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  70. // size: 10 // 每页数据的数量
  71. // },
  72. noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
  73. empty: {
  74. tip: '~ 搜索无数据 ~', // 提示
  75. btnText: '去看看'
  76. }
  77. },
  78. goods: [], //列表数据
  79. tabs: [{
  80. name: '全部',
  81. type: 'xx'
  82. }, {
  83. name: '采购',
  84. type: 'xx'
  85. }, {
  86. name: '销售',
  87. type: 'xx'
  88. }, {
  89. name: '关注',
  90. type: 'xx'
  91. }],
  92. tabIndex: 0 // tab下标
  93. }
  94. },
  95. onShow() {
  96. uni.showTabBar()
  97. uni.hideKeyboard()
  98. var userInfo = uni.getStorageSync("userInfo")
  99. var that = this
  100. console.log("userInfo", userInfo)
  101. // setTimeout(function() {
  102. // that.$api.doRequest('get', '/appVersion/test', {
  103. // userId: "7e83070d05fc4d50aaa46e00a3ee03d8"
  104. // }).then(res => {
  105. // })
  106. // }, 500);
  107. uni.removeTabBarBadge({
  108. index: 4
  109. })
  110. this.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
  111. if (res.data.data) {
  112. let name = 'myTip';
  113. let value = res.data.data.total;
  114. that.$store.commit('$uStore', {
  115. name,
  116. value
  117. });
  118. if (value != 0 && value) {
  119. uni.setTabBarBadge({
  120. index: 4,
  121. text: value + ""
  122. })
  123. }
  124. name = 'taskTip';
  125. value = res.data.data.total;
  126. that.$store.commit('$uStore', {
  127. name,
  128. value
  129. });
  130. }
  131. })
  132. },
  133. onLoad(options) {},
  134. methods: {
  135. edit() {},
  136. del() {},
  137. selectAddress(val) {
  138. console.log(val)
  139. },
  140. release() {
  141. uni.navigateTo({
  142. url: 'release'
  143. })
  144. },
  145. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  146. upCallback(page) {
  147. //联网加载数据
  148. let curTab = this.tabs[this.tabIndex]
  149. let keyword = curTab.name // 具体项目中,您可能取的是tab中的type,status等字段
  150. apiGoods(page.num, page.size, keyword).then(res => {
  151. //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
  152. this.mescroll.endSuccess(res.list.length);
  153. //设置列表数据
  154. if (page.num == 1) this.goods = []; //如果是第一页需手动制空列表
  155. this.goods = this.goods.concat(res.list); //追加新数据
  156. this.co
  157. }).catch(() => {
  158. //联网失败, 结束加载
  159. this.mescroll.endErr();
  160. })
  161. },
  162. //点击空布局按钮的回调
  163. emptyClick() {
  164. uni.showToast({
  165. title: '点击了按钮,具体逻辑自行实现'
  166. })
  167. },
  168. // 切换菜单
  169. tabChange() {
  170. this.goods = [] // 先置空列表,显示加载进度
  171. this.mescroll.resetUpScroll() // 再刷新列表数据
  172. }
  173. }
  174. }
  175. </script>
  176. <style lang='scss'>
  177. page,
  178. .content {
  179. background: #F5F6FA;
  180. }
  181. .flex {
  182. display: flex;
  183. }
  184. .alc {
  185. align-items: center;
  186. }
  187. .jcse {
  188. justify-content: space-evenly;
  189. }
  190. .jcsb {
  191. justify-content: space-between;
  192. }
  193. .top-warp {
  194. z-index: 998;
  195. position: fixed;
  196. top: --window-top;
  197. /* css变量 */
  198. left: 0;
  199. width: 100%;
  200. /* height: 120upx; */
  201. background-color: white;
  202. }
  203. .top-warp .tip {
  204. font-size: 28upx;
  205. height: 60upx;
  206. line-height: 60upx;
  207. text-align: center;
  208. }
  209. .slot-wrap {
  210. margin-right: 45rpx;
  211. font-size: 32rpx;
  212. }
  213. .list {
  214. margin: 0 20rpx;
  215. .list-item {
  216. padding: 20rpx;
  217. background: #fff;
  218. margin-bottom: 20rpx;
  219. border-radius: 20rpx;
  220. .row1 {
  221. .head-img {
  222. width: 72rpx;
  223. background-color: red;
  224. border-radius: 8rpx;
  225. margin-right: 22rpx;
  226. }
  227. .left {
  228. .title {
  229. font-weight: 700;
  230. color: #333333;
  231. }
  232. .bottom {
  233. .color1 {
  234. font-size: 24rpx;
  235. padding: 4rpx 10rpx;
  236. color: #fff;
  237. display: inline-block;
  238. background: linear-gradient(180deg, #607AE0 0%, #516CDC 100%);
  239. border-radius: 4rpx;
  240. }
  241. .color2 {
  242. font-size: 24rpx;
  243. padding: 4rpx 10rpx;
  244. color: #fff;
  245. display: inline-block;
  246. background: linear-gradient(180deg, #FD714F 0%, #FD613C 100%);
  247. border-radius: 4rpx;
  248. }
  249. .color3 {
  250. font-size: 28rpx;
  251. /* color: #AFB3BF; */
  252. margin-left: 14rpx;
  253. }
  254. }
  255. }
  256. .right {
  257. /* padding: 10rpx 20rpx; */
  258. }
  259. }
  260. .row2 {
  261. margin-top: 20rpx;
  262. /* overflow: hidden;
  263. text-overflow: ellipsis;
  264. width: 100%;
  265. display: -webkit-box;
  266. -webkit-box-orient: vertical;
  267. -webkit-line-clamp: 3;
  268. word-break: break-all; */
  269. }
  270. .row3 {
  271. /* padding: 30rpx 30rpx 0 30rpx; */
  272. margin-top: 18rpx;
  273. display: flex;
  274. align-items: center;
  275. justify-content: space-between;
  276. flex-wrap: wrap;
  277. /* background: #bbb; */
  278. .img {
  279. display: flex;
  280. align-items: center;
  281. justify-content: center;
  282. width: 32%;
  283. height: 210rpx;
  284. margin-bottom: 20rpx;
  285. background: lightblue;
  286. list-style: none;
  287. border-radius: 10rpx;
  288. }
  289. }
  290. .row4 {
  291. margin-top: 4rpx;
  292. .text {
  293. color: #878C9C;
  294. font-size: 24rpx;
  295. }
  296. }
  297. }
  298. .case {
  299. font-weight: 700;
  300. margin-left: 6rpx;
  301. }
  302. }
  303. .add {
  304. position: fixed;
  305. bottom: 250rpx;
  306. right: 32rpx;
  307. background: #22C572;
  308. z-index: 999;
  309. width: 84rpx;
  310. height: 84rpx;
  311. border-radius: 50%;
  312. display: flex;
  313. align-items: center;
  314. justify-content: center;
  315. }
  316. .search {
  317. display: flex;
  318. align-items: center;
  319. position: relative;
  320. margin: 20rpx 28rpx 20rpx 28rpx;
  321. .text {
  322. width: 90rpx;
  323. overflow: hidden;
  324. white-space: nowrap;
  325. text-overflow: ellipsis;
  326. }
  327. }
  328. /deep/.u-content {
  329. padding-left: 170rpx;
  330. }
  331. .place {
  332. display: flex;
  333. align-items: center;
  334. left: 28rpx;
  335. position: absolute;
  336. font-weight: 700;
  337. }
  338. .row5 {
  339. display: flex;
  340. justify-content: flex-end;
  341. margin-top: 20rpx;
  342. .btn {
  343. width: 120rpx;
  344. height: 66rpx;
  345. background: #FFFFFF;
  346. border-radius: 33px;
  347. border: 1px solid #CDCDCD;
  348. font-size: 28rpx;
  349. font-weight: 400;
  350. color: #333333;
  351. line-height: 66rpx;
  352. text-align: center;
  353. margin-left: 24rpx;
  354. }
  355. }
  356. </style>