| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345 |
- <template>
- <view class="">
- <!-- <view class="">
- 买入
- </view> -->
- <view class="jg" style="height: 20rpx;"></view>
- <empty v-if="loaded === true && list.length === 0"></empty>
- <view class="buy-item" v-for="item in list" v-if="item.status !== -1">
- <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">1.0%</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.order_id)">
- 提交凭证
- </view>
- </view>
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- <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 uniPopup from '@/components/uni-popup/uni-popup.vue';
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- import empty from '@/components/empty';
-
- import { packageMyReserveList, evaluationUpload } from '@/api/package.js'
- import { upload } from '@/api/user.js';
-
- import {
- tabbar,tabbar1
- } from "@/utils/tabbar.js";
- export default {
- components: {
- uniLoadMore,
- empty,
- uniPopup
- },
- 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 {
- tabbar: tabbar,
- tabbar1: tabbar1,
- current: 1,
- list: [],
- loadingType: 'more',
- page: 1,
- limit: 20,
- loaded: false,
- choose_order: '',
- upimg: '',
- }
- },
- onLoad() {
- console.log('买入')
- // this.$refs.upload.open()
- this.loadData()
- // this.$refs.popup1.open()
- },
- //上拉加载更多
- onReachBottom() {
- this.loadData()
- },
- methods: {
- qx() {
- this.upimg = ''
- this.choose_order = ''
- this.$refs.popup1.close()
- },
- imgsub(text) {
- console.log('imgsub');
- upload({
- filename: ''
- }).then(data => {
- // this.upimg = data[0].url;
- this.$set(this,text,data[0].url)
- });
- },
- open(orderId) {
- this.choose_order = orderId
- this.$refs.popup1.open()
-
- },
- navto(url) {
- uni.navigateTo({
- url: url
- })
- },
- loadData() {
- let obj = this
- if(obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
- return
- }
- obj.loadingType = 'loading'
- packageMyReserveList({
- page: obj.page,
- limit: obj.limit,
- status: 3
- }).then( ({data}) => {
- obj.list = obj.list.concat(data.data)
- this.page++
- if (data.data.length == obj.limit) {
- obj.loadingType = 'more'
- } else {
- obj.loadingType = 'noMore'
- }
- obj.$set(obj, 'loaded', true)
- })
- },
- //提交审核
- 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,'上传凭证+++++')
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .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>
|