disassemble.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. <template>
  2. <view class="app">
  3. <view id="app-top">
  4. <view class="app-body">
  5. <!--关键词搜索-->
  6. <view class="sreach fx-r fx-bc fx-ac">
  7. <image class="icon" src="/static/img/tb-seach.png"></image>
  8. <input type="text" v-model="keyword" placeholder="请输入用户昵称/用户ID"
  9. placeholder-style="color: #B3B3B3;" />
  10. <view class="fx-g1"></view>
  11. <view class="search-btn" @tap="tapSerach">搜索</view>
  12. </view>
  13. </view>
  14. <view class="app-inner">
  15. <view class="pannel">
  16. <view class="status fx-r">
  17. <view class="people fx-r fx-bc fx-ac" @tap="isShowTime = true">
  18. <image src="/static/img/gz_yy.png"></image>
  19. <view class="label">检索日期:</view>
  20. <view class="value">
  21. <uni-datetime-picker :border="false" type="daterange" start="2023-01-01" :end="endTime"
  22. rangeSeparator="至" @change="tapDateTime" v-model="datetime">
  23. {{ utils.date('m月d日',utils.strtotime(datetime[0])) }}/
  24. {{ utils.date('m月d日',utils.strtotime(datetime[1])) }}
  25. </uni-datetime-picker>
  26. </view>
  27. </view>
  28. <view class="fx-g1"></view>
  29. <view class="search-tm fx-r fx-bc fx-ac" @tap="tapCg">
  30. <view class="text">{{ gzItem.id == 0 ? '全部场馆' : gzItem.nickname }}</view>
  31. <uv-icon name="arrow-down" class="icon"></uv-icon>
  32. </view>
  33. </view>
  34. <view class="panel-info fx-r">
  35. <view class="item">
  36. <view class="count">{{ total.count || 0 }}</view>
  37. <view class="label">拆分单数</view>
  38. </view>
  39. <view class="line"></view>
  40. <view class="item">
  41. <view class="count">{{ total.price || 0 }}</view>
  42. <view class="label">拆分金额</view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <scroll-view scroll-y class="scroll" :style="'height: calc(100vh - ' + hFoot + 'px - ' + barheight + 'px);'"
  49. @scrolltolower="loadMoreData">
  50. <view class="sc-body">
  51. <view class="item" v-for="item in listAr">
  52. <view class="info fx-r">
  53. <view class="nickname">{{ item.nickname }}({{ item.auction_name }})</view>
  54. <view class="fx-r fx-bc" @tap="tapCall(item.mobile)">
  55. <view class="mobile">{{ item.mobile }}</view>
  56. <image src="/static/img/call-tel.png" style="width: 15px;height: 15px;margin-left: 5px;">
  57. </image>
  58. </view>
  59. </view>
  60. <view class="info fx-r">
  61. <view class="id">ID号:{{ item.uid }}</view>
  62. <view class="fx-g1"></view>
  63. <view class="changci">订单编号:{{ item.order_id }}</view>
  64. </view>
  65. <view class="info fx-r">
  66. <view class="id">拆分时间:{{ item.time }}</view>
  67. </view>
  68. <view class="info-list" v-for="item2 in item.orderIds">
  69. <view class="fx-r">
  70. <view class="iivi">子订单:{{ item2 }}</view>
  71. <view class="fx-g1"></view>
  72. <view class="iivi">价格:<text
  73. style="color: red;font-weight: bold;">¥{{ item.price / 2 }}</text></view>
  74. </view>
  75. </view>
  76. <view class="infos fx-r">
  77. <view class="time">订单价格:<text style="color: red;">{{ item.price }}</text></view>
  78. </view>
  79. </view>
  80. <view v-if="listAr.length > 0">
  81. <view class="loading fx-r fx-ac fx-bc" v-if="page.isFrite && !page.isFoot">
  82. <image src="/static/img/xloading.png"></image>
  83. <text>正在载入更多...</text>
  84. </view>
  85. <view class="loading complete" :hidden="!page.isFoot">已加载全部</view>
  86. </view>
  87. <view v-if="listAr.length == 0 && isFirst">
  88. <uv-empty mode="data" icon="/static/img/no-empty.png"></uv-empty>
  89. </view>
  90. </view>
  91. </scroll-view>
  92. <uv-popup ref='uvpopup' @close="closePopup">
  93. <scroll-view style="height: 40vh;background: #fff;">
  94. <view class="pop-info">
  95. <view class="item ihover" @tap="tapGzItem(item)" v-for="item in gzData">{{ item.nickname }}</view>
  96. </view>
  97. </scroll-view>
  98. </uv-popup>
  99. </view>
  100. </template>
  101. <script>
  102. import dayjs from 'dayjs';
  103. import {
  104. mapState,
  105. mapMutations
  106. } from 'vuex';
  107. export default {
  108. computed: mapState(['user']),
  109. data() {
  110. return {
  111. isFirst: false,
  112. listAr: [],
  113. keyword: "",
  114. id: 0,
  115. hFoot: 0,
  116. barheight: 0,
  117. datetime: ["", ""],
  118. total: {},
  119. isShowTime: false,
  120. endTime: "",
  121. page: {
  122. isFirst: false,
  123. isLoad: false,
  124. isFoot: false,
  125. page: 1
  126. },
  127. isPop: false,
  128. gzData: [],
  129. gzItem: {
  130. name: "",
  131. id: 0
  132. },
  133. }
  134. },
  135. onLoad(options) {
  136. this.id = options.id || 0;
  137. //基本配置
  138. this.endTime = dayjs().format("YYYY-MM-DD");
  139. this
  140. .request
  141. .get("gzAuction")
  142. .then(res => {
  143. if (res.code == 200) {
  144. this.gzData = res.data;
  145. }
  146. });
  147. //基本配置
  148. this.datetime = [
  149. dayjs().format("YYYY-MM-01"),
  150. dayjs().format("YYYY-MM-DD")
  151. ];
  152. this.initView();
  153. // #ifdef H5
  154. this.hFoot = 60;
  155. // #endif
  156. },
  157. methods: {
  158. ...mapMutations(['checkUserLogin']),
  159. /**
  160. * 加载基础配置
  161. */
  162. initView: function() {
  163. this.$nextTick(() => {
  164. uni.createSelectorQuery().select("#app-top").boundingClientRect(res => {
  165. this.barheight = res.height + 20;
  166. }).exec();
  167. });
  168. this.initData();
  169. this.getData(true);
  170. },
  171. initData: function() {
  172. this.request.post("auctionDisassembleInit", {
  173. str_time: this.datetime[0],
  174. end_time: this.datetime[1],
  175. auActionId: this.gzItem.id
  176. }).then(res => {
  177. if (res.code == 200) {
  178. this.total = res.data;
  179. }
  180. });
  181. },
  182. /**
  183. * 获取数据
  184. */
  185. getData: function(isPull = false) {
  186. if (this.page.isLoad) return;
  187. this.page.isLoad = true;
  188. if (isPull) {
  189. this.page.page = 1;
  190. this.page.isLoad = false;
  191. this.page.isFoot = false;
  192. }
  193. uni.showLoading({
  194. title: '获取数据中..'
  195. });
  196. var post = {};
  197. post.page = this.page.page;
  198. this
  199. .request
  200. .post("auctionDisassembleLog", {
  201. keyword: this.keyword,
  202. page: this.page.page,
  203. str_time: this.datetime[0],
  204. end_time: this.datetime[1],
  205. auActionId: this.gzItem.id
  206. })
  207. .then(res => {
  208. uni.hideLoading();
  209. this.page.isFirst = true;
  210. this.page.isLoad = false;
  211. this.isFirst = true;
  212. if (isPull) {
  213. this.listAr = res.data.list;
  214. } else {
  215. this.listAr = this.listAr.concat(res.data.list);
  216. }
  217. //是否到底
  218. if (res.data.list.length != res.data.pageSize) {
  219. this.page.isFoot = true;
  220. }
  221. })
  222. .catch((res) => {
  223. console.log(res);
  224. uni.hideLoading();
  225. uni.showModal({
  226. title: '系统提示',
  227. content: '加载失败,返回在尝试',
  228. showCancel: false
  229. });
  230. });
  231. },
  232. //选择场馆
  233. tapCg: function() {
  234. this.$refs.uvpopup.open()
  235. },
  236. closePopup() {
  237. this.$refs.uvpopup.close()
  238. },
  239. tapGzItem: function(item) {
  240. this.$refs.uvpopup.close()
  241. this.gzItem = item;
  242. this.initData();
  243. this.getData(true);
  244. },
  245. tapSerach: function() {
  246. this.getData(true);
  247. this.initData();
  248. },
  249. tapDateTime: function(ev) {
  250. this.initData();
  251. this.getData(true);
  252. },
  253. loadMoreData: function() {
  254. if (this.page.isFoot || this.page.isLoad) {
  255. return;
  256. }
  257. this.page.page++;
  258. this.getData();
  259. },
  260. tapCall: function(tel) {
  261. if (tel == null) {
  262. this.utils.showAlert({
  263. title: "系统提示",
  264. content: "暂无联系方式"
  265. });
  266. return;
  267. }
  268. const info = uni.getSystemInfoSync();
  269. if (info.platform == 'android') {
  270. uni.showModal({
  271. content: "确认拨打" + tel,
  272. confirmText: "确定",
  273. cancelText: "取消",
  274. success: function(res) {
  275. if (res.confirm) {
  276. this.$store.dispatch('permission/requestPermissions', 'CALL_PHONE').then(
  277. res => {
  278. if (res !== 1) return;
  279. uni.makePhoneCall({
  280. phoneNumber: tel,
  281. });
  282. });
  283. }
  284. }
  285. });
  286. } else {
  287. uni.makePhoneCall({
  288. phoneNumber: tel
  289. });
  290. }
  291. }
  292. },
  293. }
  294. </script>
  295. <style lang="scss">
  296. .app-body {
  297. padding: 0px 20rpx;
  298. }
  299. .sreach {
  300. background: #fff;
  301. margin: 20rpx 0;
  302. border-radius: 32rpx;
  303. padding: 16rpx 32rpx;
  304. .icon {
  305. width: 46rpx;
  306. height: 46rpx;
  307. }
  308. input {
  309. width: calc(100% - 46rpx - 16rpx - 50px);
  310. font-size: 16px;
  311. }
  312. .search-btn {
  313. font-size: 14px;
  314. color: #FF4C4C;
  315. }
  316. }
  317. .sc-body {
  318. padding: 20rpx;
  319. .item {
  320. background: #FFFFFF;
  321. border-radius: 16rpx;
  322. padding: 26rpx 44rpx;
  323. margin-bottom: 10px;
  324. .info {
  325. margin-bottom: 10rpx;
  326. .nickname {
  327. font-weight: bold;
  328. font-size: 32rpx;
  329. color: #303133;
  330. }
  331. .mobile {
  332. font-weight: 500;
  333. font-size: 30rpx;
  334. color: #999999;
  335. margin-left: 10px;
  336. }
  337. .id {
  338. font-weight: 500;
  339. font-size: 26rpx;
  340. color: #666666;
  341. }
  342. .changci {
  343. font-weight: 500;
  344. font-size: 26rpx;
  345. color: #666666;
  346. text {
  347. color: #333333;
  348. }
  349. }
  350. }
  351. .infos {
  352. margin-top: 10px;
  353. border-top: 1px solid #f1f1f1;
  354. padding-top: 6px;
  355. .time {
  356. font-size: 14px;
  357. color: #666;
  358. }
  359. }
  360. }
  361. }
  362. .info-list {
  363. padding: 10px 0;
  364. font-size: 12px;
  365. border-top: 1px solid #f1f1f1;
  366. }
  367. .app-inner {
  368. padding: 0px 10px;
  369. }
  370. .pannel {
  371. background: #FFFFFF;
  372. border-radius: 20px;
  373. padding: 15px;
  374. margin-top: 10px;
  375. .panel-info {
  376. .line {
  377. width: 1px;
  378. height: 50px;
  379. background: #999999;
  380. opacity: 0.38;
  381. margin-top: 10px;
  382. }
  383. .item {
  384. width: calc(50% - 1px);
  385. display: flex;
  386. flex-direction: column;
  387. justify-content: center;
  388. align-items: center;
  389. padding-top: 20px;
  390. .label {
  391. font-weight: 500;
  392. font-size: 12px;
  393. color: #787878;
  394. margin-top: 5px;
  395. }
  396. .count {
  397. font-weight: bold;
  398. font-size: 19px;
  399. color: #333333;
  400. }
  401. }
  402. }
  403. .status {
  404. padding: 10px 0;
  405. border-bottom: 1px solid #f1f1f1;
  406. .people {
  407. image {
  408. width: 24rpx;
  409. height: 22rpx;
  410. margin-right: 10rpx;
  411. }
  412. .label {
  413. color: #666666;
  414. font-size: 13px;
  415. }
  416. .value {
  417. font-size: 13px;
  418. color: #000;
  419. margin-left: 4px;
  420. }
  421. }
  422. }
  423. }
  424. .search-tm {
  425. height: 40px;
  426. color: #787878;
  427. font-size: 14px;
  428. .icon {
  429. width: 10px;
  430. height: 10px;
  431. margin-left: 5px;
  432. }
  433. }
  434. .pop-info {
  435. .item {
  436. padding: 20rpx 0;
  437. text-align: center;
  438. border-bottom: 1px solid #f1f1f1;
  439. }
  440. }
  441. </style>