| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542 |
- <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">{{item.pass}}%</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="info-data" v-if="item.touser && (currentIndex == 1)">
- <view class="info-tit">卖家:</view>
- <view class="info-val">{{item.touser.real_name}}</view>
- </view>
- <view class="info-data" @click="call(item.touser.phone)" v-if="item.touser && (currentIndex == 1)">
- <view class="info-tit">联系卖家:</view>
- <view class="info-val">{{item.touser.phone}}</view>
- </view>
- <!-- <view class="upimg" v-if="item.status >= 1">
- <view class="up-tit">
- 打款凭证:
- </view>
- <view class="img-wrap" v-if="item.pay_evaluation" @click="lookimg(item.pay_evaluation)">
- <image :src="item.pay_evaluation" mode=""></image>
- </view>
- <view class="" style="color: #0F253A;font-weight: bold;font-size: 26rpx;" v-else>
- 上传支付凭证
- </view>
- </view> -->
- <view class="btn-wrap flex" v-if="item.status == 1">
- <!-- <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="lookimg" type="center">
- <view class="pop-wrap" style="position: relative;" >
- <movable-area class="popup-box">
- <movable-view class="popup-item" :scale="true" direction="all">
- <image :src="chooseImg" mode=""></image>
- </movable-view>
- </movable-area>
- <image src="../../static/icon/close.png" mode="" class="close" style="width: 80rpx;height: 80rpx;" @click="closePup"></image>
- </view>
- </uni-popup>
- </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 {
- chooseImg: '',
- 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: 3,
- tit: '释放中',
- list: [],
- page: 1,
- limit: 10,
- loadingType: 'more',
- loaded: false,
- },
- {
- status: 4,
- 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: {
- call(phone) {
- uni.makePhoneCall({
- phoneNumber: phone,
- fail() {
- this.$api.msg('请稍后再试')
- }
- })
- },
- refresh() {
- this.navList[1].list = []
- this.navList[1].page = 1
- this.navList[1].loaded = false
- this.navList[1].loadingType = 'more'
- this.loadData()
- },
- lookimg(src) {
- console.log(src,'chooseImg++++++')
- this.chooseImg = src
- this.$refs.lookimg.open()
- },
- closePup() {
- this.chooseImg = ''
- this.$refs.lookimg.close()
- },
- 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 != '') {
- packageMyReserveList({
- page: navItem.page,
- limit: navItem.limit,
- status: 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)
- })
- }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;
- }
- }
- .upimg {
- padding-top: 10rpx;
- display: flex;
-
- .up-tit {
- display: inline-block;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #6D7C88;
- }
-
- .img-wrap {
- width: 153rpx;
- height: 152rpx;
-
- border-radius: 20rpx;
-
- image {
- border-radius: 20rpx;
- width: 153rpx;
- height: 152rpx;
- // background-color: red;
- }
- }
- }
- .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;
- }
- }
- }
- }
-
- .pop-wrap {
- width: 522rpx;
- height: 800rpx;
- // background-color: red;
- }
- .popup-box {
- width: 522rpx;
- height: 800rpx;
- border-radius: 20rpx;
- position: relative;
- overflow: hidden;
- background-color: #fff;
- .popup-item {
- width: 100%;
- height: 100%;
-
-
- image {
- width: 100%;
- // height: 100%;
- }
- }
-
- }
- .close {
- display: block;
- width: 40rpx;
- height: 40rpx;
- border: 50%;
- position: absolute;
- // background-color: red;
- bottom: -100rpx;
- left: 0;
- right: 0;
- margin: 0 auto;
- }
- </style>
|