disassemble.vue 10 KB

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