| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483 |
- <template>
- <view class="">
- <!-- <view class="">
- 我的预约
- </view> -->
- <view class="navbar flex">
- <view class="nav-item" v-for="(navitem,index) in navList" :class="{'action': index == currentIndex}"
- @click="navClick(index)">
- {{navitem.tit}}
- </view>
- </view>
- <swiper :interval="3000" :duration="1000" :style="{'height': height}" class="swiper-box" @scrolltolower="loadData()">
- <swiper-item>
- <scroll-view scroll-y="true" :style="{'height': height}">
- <empty v-if="navList[currentIndex].loaded === true && navList[currentIndex].list.length === 0">
- </empty>
- <view class="buy-item" v-for="item in navList[currentIndex].list">
- <view class="item-top">
- <view class="top-left">
- <image src="../../static/icon/mrlogo.png" mode=""></image><text
- class="top-name clamp">{{item.order_id}}</text>
- </view>
- <view class="top-right">
- {{item.status | status}}
- </view>
- </view>
- <view class="item-info">
- <view class="info-data">
- <view class="info-tit">收益:</view>
- <view class="info-val">{{item.day}}天/{{item.proportion}}%</view>
- </view>
- <!-- <view class="info-data">
- <view class="info-tit">开始时间:</view>
- <view class="info-val">10:20</view>
- </view> -->
- <view class="info-data">
- <view class="info-tit">可获通证:</view>
- <view class="info-val">{{item.pass}}%</view>
- </view>
- <!-- <view class="info-data">
- <view class="info-tit">终止释放时间:</view>
- <view class="info-val">10:20</view>
- </view> -->
- <view class="info-data" v-if="item.status == 1 || item.status == -1">
- <view class="info-tit">是否中奖:</view>
- <view class="info-val">{{item.status == 1?'中奖':item.status == -1 ? '未中奖': ''}}</view>
- </view>
- <view class="info-data">
- <view class="info-tit">价值:</view>
- <view class="info-val">{{item.price}}</view>
- </view>
- <view class="btn-wrap flex" v-if="item.status == 1 || item.status == 2">
- <!-- <view class="btn" @click="open(item.id)"> -->
- <view class="btn" @click="navto('/pages/purchase/upload?id=' + item.id + '&paytype=' + JSON.stringify(item.touser) )">
- 提交凭证
- </view>
- </view>
- </view>
- </view>
- <uni-load-more :status="navList[currentIndex].loadingType"></uni-load-more>
- </scroll-view>
- </swiper-item>
- </swiper>
- <uni-popup ref="popup1" type="center" :maskClick="false">
- <view class="upload-wrap">
- <view class="tit">
- 上传支付凭证
- </view>
- <view class="up-wrap" @click="imgsub('upimg')">
- <image :src="upimg" mode="" v-if="upimg"></image>
- <image v-else src="../../static/img/upimg.png" mode=""></image>
- </view>
- <view class="btn-wrap">
- <view class="btn qx" @click="qx">
- 取消
- </view>
- <view class="btn" @click="evaluationUpload">提交</view>
- </view>
-
- </view>
- </uni-popup>
- <!-- <u-tabbar v-model="current" :list="tabbar" active-color="#FF0000" inactive-color="#f19c99"></u-tabbar> -->
- </view>
- </template>
- <script>
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- import empty from '@/components/empty';
- import {
- packageMyReserveList, evaluationUpload
- } from '@/api/package.js'
- import {
- tabbar,
- tabbar1
- } from "@/utils/tabbar.js";
- import { upload } from '@/api/user.js';
- export default {
- components: {
- uniLoadMore,
- empty
- },
- filters: {
- status(val) {
- let str = ''
- // 状态:0-预约,1-待支付,2-待审核,3-释放中,4-释放完成,5-重新发放,6-完成,-1-没抢到,-2-审核无效
- switch (val) {
- case 0:
- str = '预约'
- break;
- case 1:
- str = '待支付'
- break;
- case 2:
- str = '待审核'
- break;
- case 3:
- str = '释放中'
- break;
- case 4:
- str = '释放完成'
- break;
- case 5:
- str = '重新发放'
- break;
- case 6:
- str = '完成'
- break;
- case -1:
- str = '没抢到'
- break;
- case -2:
- str = '审核无效'
- break;
- default:
- str = ''
- }
- return str
- }
- },
- data() {
- return {
- height: '',
- currentIndex: 0,
- navList: [{
- status: 'today',
- tit: '当天预约',
- list: [],
- page: 1,
- limit: 10,
- loadingType: 'more',
- loaded: false,
- },
- {
- status: 1,
- tit: '待支付',
- list: [],
- page: 1,
- limit: 10,
- loadingType: 'more',
- loaded: false,
- },
- {
- status: '',
- tit: '所有预约',
- list: [],
- page: 1,
- limit: 10,
- loadingType: 'more',
- loaded: false,
- }
- ],
- tabbar: tabbar,
- tabbar1: tabbar1,
- current: 3,
- choose_order: '',
- upimg: '',
- }
- },
- onLoad() {
- console.log('我的预约')
- this.loadData()
- },
- onReady(res) {
- var obj = this;
- uni.getSystemInfo({
- success: resu => {
- const query = uni.createSelectorQuery();
- query.select('.swiper-box').boundingClientRect();
- query.exec(function(res) {
- console.log(res, 'ddddddddddddd');
- obj.height = resu.windowHeight - res[0].top + 'px';
- console.log('打印页面的剩余高度', obj.height);
- });
- },
- fail: res => {}
- });
- },
- methods: {
- navto(url) {
- uni.navigateTo({
- url: url
- })
- },
- qx() {
- this.upimg = ''
- this.choose_order = ''
- this.$refs.popup1.close()
- },
- open(orderId) {
- this.choose_order = orderId
- this.$refs.popup1.open()
-
- },
- imgsub(text) {
- console.log('imgsub');
- upload({
- filename: ''
- }).then(data => {
- // this.upimg = data[0].url;
- this.$set(this,text,data[0].url)
- });
- },
- //提交审核
- evaluationUpload() {
- let obj = this
- evaluationUpload({
- pay_evaluation: obj.upimg,
- id: obj.choose_order
- }).then( res => {
- this.qx()
- uni.showToast({
- title:'提交成功',
- duration:2000
- });
- this.page = 1
- this.list = []
- this.loadingType = 'more'
- this.loadData()
- console.log(res,'上传凭证+++++')
- })
- },
- navClick(index) {
- this.currentIndex = index
- this.loadData('swiper')
- },
- loadData(text) {
- let obj = this
- let index = obj.currentIndex
- let navItem = obj.navList[index]
- if (text == 'swiper' && navItem.loaded) {
- return
- }
- if (navItem.loadingType == 'loading' || navItem.loadingType == 'noMore') {
- return
- }
- navItem.loadingType = 'loading'
- if(navItem.status == 1) {
- packageMyReserveList({
- page: navItem.page,
- limit: navItem.limit,
- status: 1
- }).then(({
- data
- }) => {
- // console.log(res)
- navItem.list = navItem.list.concat(data.data)
- this.page++
- if (data.data.length == navItem.limit) {
- navItem.loadingType = 'more'
- } else {
- navItem.loadingType = 'noMore'
- }
- obj.$set(navItem, 'loaded', true)
- })
- }else {
- packageMyReserveList({
- page: navItem.page,
- limit: navItem.limit,
- data: navItem.status
- }).then(({
- data
- }) => {
- // console.log(res)
- navItem.list = navItem.list.concat(data.data)
- this.page++
- if (data.data.length == navItem.limit) {
- navItem.loadingType = 'more'
- } else {
- navItem.loadingType = 'noMore'
- }
- obj.$set(navItem, 'loaded', true)
- })
- }
-
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .navbar {
- background-color: #fff;
- height: 80rpx;
- .nav-item {
- width: 50%;
- text-align: center;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .action {
- font-weight: bold;
- position: relative;
- &::after {
- content: '';
- width: 84rpx;
- height: 4rpx;
- background: #FF4C4C;
- border-radius: 2px;
- position: absolute;
- bottom: -20rpx;
- left: 0;
- right: 0;
- margin: auto;
- }
- }
- }
- .swiper-box {
- // background-color: red;
- padding-top: 20rpx;
- // padding-bottom: 20rpx;
- }
- .buy-item {
- width: 690rpx;
- // height: 235rpx;
- margin: 0 auto 20rpx;
- background: #FFFFFF;
- box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
- border-radius: 20rpx;
- padding: 26rpx 30rpx;
- .item-top {
- display: flex;
- justify-content: space-between;
- height: 50rpx;
- .top-left {
- font-size: 34rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #0F253A;
- line-height: 50rpx;
- display: flex;
- align-items: center;
- image {
- width: 48rpx;
- height: 46rpx;
- }
- .top-name {
- width: 450rpx;
- padding-left: 11rpx;
- }
- }
- .top-right {
- line-height: 50rpx;
- width: 100rpx;
- text-align: right;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #6D7C88;
- }
- }
- .item-info {
- width: 100%;
- margin-top: 28rpx;
- line-height: 50rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- display: flex;
- flex-wrap: wrap;
- .info-data {
- width: 50%;
- display: flex;
- .info-tit {
- font-weight: 500;
- color: #6D7C88;
- }
- .info-val {
- color: #0F253A;
- font-weight: bold;
- }
- }
- .btn-wrap {
- padding-top: 20rpx;
- width: 100%;
- justify-content: flex-end;
- .btn {
- text-align: center;
- width: 144rpx;
- line-height: 50rpx;
- background: #FFFFFF;
- border: 2rpx solid #FF4C4C;
- border-radius: 25rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FF4C4C;
- }
- }
- }
- }
- .upload-wrap {
- width: 500rpx;
- height: 500rpx;
- background-color: #fff;
- border-radius: 20rpx;
- .tit {
- padding: 30rpx 25rpx;
- text-align: center;
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #101010;
- }
-
- .up-wrap {
- margin:auto;
- width: 225rpx;
- height: 225rpx;
- background: #FFFFFF;
- border-radius: 10rpx;
-
- image {
- width: 225rpx;
- height: 225rpx;
- border-radius: 10rpx;
- }
- }
- .btn-wrap {
- display: flex;
- .btn {
- margin: 50rpx auto 0;
- width: 150rpx;
- line-height: 84rpx;
- background: linear-gradient(30deg, #FF4C4C, #FE6238);
- border-radius: 10rpx;
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- text-align: center;
- }
- .qx {
- background: #fff;
- border: 1px solid #999;
- color: #999;
- }
- }
-
- }
- </style>
|