appointment.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <template>
  2. <view class="">
  3. <!-- <view class="">
  4. 我的预约
  5. </view> -->
  6. <view class="navbar flex">
  7. <view class="nav-item" v-for="(navitem,index) in navList" :class="{'action': index == currentIndex}"
  8. @click="navClick(index)">
  9. {{navitem.tit}}
  10. </view>
  11. </view>
  12. <swiper :interval="3000" :duration="1000" :style="{'height': height}" class="swiper-box" @scrolltolower="loadData()">
  13. <swiper-item>
  14. <scroll-view scroll-y="true" :style="{'height': height}">
  15. <empty v-if="navList[currentIndex].loaded === true && navList[currentIndex].list.length === 0">
  16. </empty>
  17. <view class="buy-item" v-for="item in navList[currentIndex].list">
  18. <view class="item-top">
  19. <view class="top-left">
  20. <image src="../../static/icon/mrlogo.png" mode=""></image><text
  21. class="top-name clamp">{{item.order_id}}</text>
  22. </view>
  23. <view class="top-right">
  24. {{item.status | status}}
  25. </view>
  26. </view>
  27. <view class="item-info">
  28. <view class="info-data">
  29. <view class="info-tit">收益:</view>
  30. <view class="info-val">{{item.day}}天/{{item.proportion}}%</view>
  31. </view>
  32. <view class="info-data">
  33. <view class="info-tit">可获通证:</view>
  34. <view class="info-val">{{item.pass}}%</view>
  35. </view>
  36. <view class="info-data" v-if="item.status == 1 || item.status == -1">
  37. <view class="info-tit">是否中奖:</view>
  38. <view class="info-val">{{item.status == 1?'中奖':item.status == -1 ? '未中奖': ''}}</view>
  39. </view>
  40. <view class="info-data">
  41. <view class="info-tit">价值:</view>
  42. <view class="info-val">{{item.price}}</view>
  43. </view>
  44. <!-- <view class="upimg" v-if="item.status >= 1">
  45. <view class="up-tit">
  46. 打款凭证:
  47. </view>
  48. <view class="img-wrap" v-if="item.pay_evaluation" @click="lookimg(item.pay_evaluation)">
  49. <image :src="item.pay_evaluation" mode=""></image>
  50. </view>
  51. <view class="" style="color: #0F253A;font-weight: bold;font-size: 26rpx;" v-else>
  52. 上传支付凭证
  53. </view>
  54. </view> -->
  55. <view class="btn-wrap flex" v-if="item.status == 1">
  56. <!-- <view class="btn" @click="open(item.id)"> -->
  57. <view class="btn" @click="navto('/pages/purchase/upload?id=' + item.id + '&paytype=' + JSON.stringify(item.touser) )">
  58. 提交凭证
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <uni-load-more :status="navList[currentIndex].loadingType"></uni-load-more>
  64. </scroll-view>
  65. </swiper-item>
  66. </swiper>
  67. <uni-popup ref="lookimg" type="center">
  68. <view class="pop-wrap" style="position: relative;" >
  69. <movable-area class="popup-box">
  70. <movable-view class="popup-item" :scale="true" direction="all">
  71. <image :src="chooseImg" mode=""></image>
  72. </movable-view>
  73. </movable-area>
  74. <image src="../../static/icon/close.png" mode="" class="close" style="width: 80rpx;height: 80rpx;" @click="closePup"></image>
  75. </view>
  76. </uni-popup>
  77. </view>
  78. </template>
  79. <script>
  80. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  81. import empty from '@/components/empty';
  82. import {
  83. packageMyReserveList, evaluationUpload
  84. } from '@/api/package.js'
  85. import {
  86. tabbar,
  87. tabbar1
  88. } from "@/utils/tabbar.js";
  89. import { upload } from '@/api/user.js';
  90. export default {
  91. components: {
  92. uniLoadMore,
  93. empty
  94. },
  95. filters: {
  96. status(val) {
  97. let str = ''
  98. // 状态:0-预约,1-待支付,2-待审核,3-释放中,4-释放完成,5-重新发放,6-完成,-1-没抢到,-2-审核无效
  99. switch (val) {
  100. case 0:
  101. str = '预约'
  102. break;
  103. case 1:
  104. str = '待支付'
  105. break;
  106. case 2:
  107. str = '待审核'
  108. break;
  109. case 3:
  110. str = '释放中'
  111. break;
  112. case 4:
  113. str = '释放完成'
  114. break;
  115. case 5:
  116. str = '重新发放'
  117. break;
  118. case 6:
  119. str = '完成'
  120. break;
  121. case -1:
  122. str = '没抢到'
  123. break;
  124. case -2:
  125. str = '审核无效'
  126. break;
  127. default:
  128. str = ''
  129. }
  130. return str
  131. }
  132. },
  133. data() {
  134. return {
  135. chooseImg: '',
  136. height: '',
  137. currentIndex: 0,
  138. navList: [{
  139. status: 'today',
  140. tit: '当天预约',
  141. list: [],
  142. page: 1,
  143. limit: 10,
  144. loadingType: 'more',
  145. loaded: false,
  146. },
  147. {
  148. status: 1,
  149. tit: '待支付',
  150. list: [],
  151. page: 1,
  152. limit: 10,
  153. loadingType: 'more',
  154. loaded: false,
  155. },
  156. {
  157. status: '',
  158. tit: '所有预约',
  159. list: [],
  160. page: 1,
  161. limit: 10,
  162. loadingType: 'more',
  163. loaded: false,
  164. }
  165. ],
  166. tabbar: tabbar,
  167. tabbar1: tabbar1,
  168. current: 3,
  169. choose_order: '',
  170. upimg: '',
  171. }
  172. },
  173. onLoad() {
  174. console.log('我的预约')
  175. this.loadData()
  176. },
  177. onReady(res) {
  178. var obj = this;
  179. uni.getSystemInfo({
  180. success: resu => {
  181. const query = uni.createSelectorQuery();
  182. query.select('.swiper-box').boundingClientRect();
  183. query.exec(function(res) {
  184. console.log(res, 'ddddddddddddd');
  185. obj.height = resu.windowHeight - res[0].top + 'px';
  186. console.log('打印页面的剩余高度', obj.height);
  187. });
  188. },
  189. fail: res => {}
  190. });
  191. },
  192. methods: {
  193. refresh() {
  194. this.navList[1].list = []
  195. this.navList[1].page = 1
  196. this.navList[1].loaded = false
  197. this.navList[1].loadingType = 'more'
  198. this.loadData()
  199. },
  200. lookimg(src) {
  201. console.log(src,'chooseImg++++++')
  202. this.chooseImg = src
  203. this.$refs.lookimg.open()
  204. },
  205. closePup() {
  206. this.chooseImg = ''
  207. this.$refs.lookimg.close()
  208. },
  209. navto(url) {
  210. uni.navigateTo({
  211. url: url
  212. })
  213. },
  214. qx() {
  215. this.upimg = ''
  216. this.choose_order = ''
  217. this.$refs.popup1.close()
  218. },
  219. open(orderId) {
  220. this.choose_order = orderId
  221. this.$refs.popup1.open()
  222. },
  223. imgsub(text) {
  224. console.log('imgsub');
  225. upload({
  226. filename: ''
  227. }).then(data => {
  228. // this.upimg = data[0].url;
  229. this.$set(this,text,data[0].url)
  230. });
  231. },
  232. //提交审核
  233. evaluationUpload() {
  234. let obj = this
  235. evaluationUpload({
  236. pay_evaluation: obj.upimg,
  237. id: obj.choose_order
  238. }).then( res => {
  239. this.qx()
  240. uni.showToast({
  241. title:'提交成功',
  242. duration:2000
  243. });
  244. this.page = 1
  245. this.list = []
  246. this.loadingType = 'more'
  247. this.loadData()
  248. console.log(res,'上传凭证+++++')
  249. })
  250. },
  251. navClick(index) {
  252. this.currentIndex = index
  253. this.loadData('swiper')
  254. },
  255. loadData(text) {
  256. let obj = this
  257. let index = obj.currentIndex
  258. let navItem = obj.navList[index]
  259. if (text == 'swiper' && navItem.loaded) {
  260. return
  261. }
  262. if (navItem.loadingType == 'loading' || navItem.loadingType == 'noMore') {
  263. return
  264. }
  265. navItem.loadingType = 'loading'
  266. if(navItem.status == 1) {
  267. packageMyReserveList({
  268. page: navItem.page,
  269. limit: navItem.limit,
  270. status: 1
  271. }).then(({
  272. data
  273. }) => {
  274. // console.log(res)
  275. navItem.list = navItem.list.concat(data.data)
  276. this.page++
  277. if (data.data.length == navItem.limit) {
  278. navItem.loadingType = 'more'
  279. } else {
  280. navItem.loadingType = 'noMore'
  281. }
  282. obj.$set(navItem, 'loaded', true)
  283. })
  284. }else {
  285. packageMyReserveList({
  286. page: navItem.page,
  287. limit: navItem.limit,
  288. data: navItem.status
  289. }).then(({
  290. data
  291. }) => {
  292. // console.log(res)
  293. navItem.list = navItem.list.concat(data.data)
  294. this.page++
  295. if (data.data.length == navItem.limit) {
  296. navItem.loadingType = 'more'
  297. } else {
  298. navItem.loadingType = 'noMore'
  299. }
  300. obj.$set(navItem, 'loaded', true)
  301. })
  302. }
  303. }
  304. }
  305. }
  306. </script>
  307. <style lang="scss" scoped>
  308. .navbar {
  309. background-color: #fff;
  310. height: 80rpx;
  311. .nav-item {
  312. width: 50%;
  313. text-align: center;
  314. font-size: 30rpx;
  315. font-family: PingFang SC;
  316. font-weight: 500;
  317. color: #333333;
  318. }
  319. .action {
  320. font-weight: bold;
  321. position: relative;
  322. &::after {
  323. content: '';
  324. width: 84rpx;
  325. height: 4rpx;
  326. background: #FF4C4C;
  327. border-radius: 2px;
  328. position: absolute;
  329. bottom: -20rpx;
  330. left: 0;
  331. right: 0;
  332. margin: auto;
  333. }
  334. }
  335. }
  336. .swiper-box {
  337. // background-color: red;
  338. padding-top: 20rpx;
  339. // padding-bottom: 20rpx;
  340. }
  341. .buy-item {
  342. width: 690rpx;
  343. // height: 235rpx;
  344. margin: 0 auto 20rpx;
  345. background: #FFFFFF;
  346. box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
  347. border-radius: 20rpx;
  348. padding: 26rpx 30rpx;
  349. .item-top {
  350. display: flex;
  351. justify-content: space-between;
  352. height: 50rpx;
  353. .top-left {
  354. font-size: 34rpx;
  355. font-family: PingFang SC;
  356. font-weight: bold;
  357. color: #0F253A;
  358. line-height: 50rpx;
  359. display: flex;
  360. align-items: center;
  361. image {
  362. width: 48rpx;
  363. height: 46rpx;
  364. }
  365. .top-name {
  366. width: 450rpx;
  367. padding-left: 11rpx;
  368. }
  369. }
  370. .top-right {
  371. line-height: 50rpx;
  372. width: 100rpx;
  373. text-align: right;
  374. font-size: 26rpx;
  375. font-family: PingFang SC;
  376. font-weight: 500;
  377. color: #6D7C88;
  378. }
  379. }
  380. .item-info {
  381. width: 100%;
  382. margin-top: 28rpx;
  383. line-height: 50rpx;
  384. font-size: 26rpx;
  385. font-family: PingFang SC;
  386. display: flex;
  387. flex-wrap: wrap;
  388. .info-data {
  389. width: 50%;
  390. display: flex;
  391. .info-tit {
  392. font-weight: 500;
  393. color: #6D7C88;
  394. }
  395. .info-val {
  396. color: #0F253A;
  397. font-weight: bold;
  398. }
  399. }
  400. .upimg {
  401. padding-top: 10rpx;
  402. display: flex;
  403. .up-tit {
  404. display: inline-block;
  405. font-size: 26rpx;
  406. font-family: PingFang SC;
  407. font-weight: 500;
  408. color: #6D7C88;
  409. }
  410. .img-wrap {
  411. width: 153rpx;
  412. height: 152rpx;
  413. border-radius: 20rpx;
  414. image {
  415. border-radius: 20rpx;
  416. width: 153rpx;
  417. height: 152rpx;
  418. // background-color: red;
  419. }
  420. }
  421. }
  422. .btn-wrap {
  423. padding-top: 20rpx;
  424. width: 100%;
  425. justify-content: flex-end;
  426. .btn {
  427. text-align: center;
  428. width: 144rpx;
  429. line-height: 50rpx;
  430. background: #FFFFFF;
  431. border: 2rpx solid #FF4C4C;
  432. border-radius: 25rpx;
  433. font-size: 26rpx;
  434. font-family: PingFang SC;
  435. font-weight: 500;
  436. color: #FF4C4C;
  437. }
  438. }
  439. }
  440. }
  441. .pop-wrap {
  442. width: 522rpx;
  443. height: 800rpx;
  444. // background-color: red;
  445. }
  446. .popup-box {
  447. width: 522rpx;
  448. height: 800rpx;
  449. border-radius: 20rpx;
  450. position: relative;
  451. overflow: hidden;
  452. background-color: #fff;
  453. .popup-item {
  454. width: 100%;
  455. height: 100%;
  456. image {
  457. width: 100%;
  458. // height: 100%;
  459. }
  460. }
  461. }
  462. .close {
  463. display: block;
  464. width: 40rpx;
  465. height: 40rpx;
  466. border: 50%;
  467. position: absolute;
  468. // background-color: red;
  469. bottom: -100rpx;
  470. left: 0;
  471. right: 0;
  472. margin: 0 auto;
  473. }
  474. </style>