slimming.vue 10.0 KB

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