| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- <template>
- <v-page>
- <v-header :title="$t('otc.a4')">
- <template #right>
- <v-picker :list="list" v-model="status" @input="changeStatus">
- <template #default="{ label }">
- <view class="color-light">
- {{ label || $t('otc.c1') }}
- <van-icon name="arrow-down" />
- </view>
- </template>
- </v-picker>
- </template>
- </v-header>
- <van-tabs
- :ellipsis="false"
- :border="false"
- class="border-b"
- :active="tab"
- @change="tabChange($event.detail.name)"
- >
- <van-tab :title="$t('otc.a5')" :name="1"></van-tab>
- <van-tab :title="$t('otc.a6')" :name="2"></van-tab>
- </van-tabs>
- <v-paging
- :ajax="myEntrusts"
- :data="{ side: tab, status }"
- ref="scroll"
- class="layout-main"
- >
- <template #box="list">
- <van-empty v-if="!$list(list).length" description="" />
- <view class="list">
- <view
- class="item bg-panel-3 box-shadow rounded-sm p-md m-md"
- v-for="item in $list(list)"
- :key="item.id"
- >
- <view class="row m-t-sm d-flex align-center">
- <view class="label"> {{$t('otc.c2')}} </view>
- <view class="flex-fill fn-right color-light">
- {{ item.order_sn }}
- </view>
- </view>
- <view class="row m-t-sm d-flex align-center">
- <view class="label"> {{$t('otc.c1')}} </view>
- <view class="flex-fill fn-right color-light">
- {{ item.status_text }}
- </view>
- </view>
- <view class="row m-t-sm d-flex align-center">
- <view class="label"> {{$t('otc.c3')}} </view>
- <view class="flex-fill fn-right color-light">
- {{ item.money }}
- </view>
- </view>
- <view class="row m-t-sm d-flex align-center">
- <view class="label"> {{$t('otc.b0')}} </view>
- <view class="flex-fill fn-right color-light">
- {{ item.price }}
- </view>
- </view>
- <view class="row m-t-sm d-flex align-center">
- <view class="label"> {{$t('otc.c4')}} </view>
- <view class="flex-fill fn-right color-light">
- {{ item.amount }}
- </view>
- </view>
- <view class="row m-t-sm d-flex align-center">
- <view class="label"> {{$t('otc.a8')}} </view>
- <view class="flex-fill fn-right color-light">
- {{ item.cur_amount }}
- </view>
- </view>
- <view class="row m-t-sm d-flex align-center">
- <view class="label"> {{$t('otc.b1')}} </view>
- <view class="flex-fill fn-right color-light">
- <template v-for="minItem in item.pay_type">
- {{ payTypeMap[minItem] }},
- </template>
- </view>
- </view>
- <view class="row m-t-sm d-flex align-center">
- <view class="label"> {{$t('otc.c5')}} </view>
- <view class="flex-fill fn-right color-light">
- {{ item.created_at }}
- </view>
- </view>
- <view class="row m-t-sm d-flex align-center">
- <view class="label"> {{$t('otc.b2')}} </view>
- <view class="flex-fill fn-right color-light">
- <v-button
- type="red"
- size="mini"
- class="rounded-xs"
- v-if="item.status == 1"
- @click="ifCancelEntrust(item)"
- >
- {{$t('otc.c6')}}
- </v-button>
- </view>
- </view>
- </view>
- </view>
- </template>
- </v-paging>
- </v-page>
- </template>
- <script>
- import Otc from "@/api/otc";
- import vPaging from "../../layout/vPaging.vue";
- export default {
- components: { vPaging },
- name: "order",
- data() {
- return {
- tab: 1,
- status: 1,
- };
- },
- computed: {
- payTypeMap() {
- return {
- alipay: this.$t('otc.b7'),
- wechat: this.$t('otc.b8'),
- bank_card: this.$t('otc.b9'),
- };
- },
- list(){
- return [
- {
- label: this.$t('otc.c7'),
- value: 0,
- },
- {
- label: this.$t('otc.c8'),
- value: 1,
- },
- {
- label: this.$t('otc.c9'),
- value: 2,
- },
- ]
- }
- },
- methods: {
- myEntrusts: Otc.myEntrusts,
- tabChange(idx) {
- this.tab = idx;
- this.$nextTick(() => {
- this.$refs.scroll.ref();
- });
- },
- changeStatus() {
- this.$nextTick(() => {
- this.$refs.scroll.ref();
- });
- },
- // 下架
- ifCancelEntrust(item) {
- this.$dialog
- .confirm({
- title: this.$t('otc.d0'),
- message: this.$t('otc.d1')+"?",
- confirmButtonText: this.$t('common.confirm'),
- cancelButtonText: this.$t('common.cancel')
- })
- .then(() => {
- this.cancelEntrust(item);
- });
- },
- cancelEntrust(item) {
- let data = {
- entrust_id: item.id,
- };
- Otc.cancelEntrust(data).then((res) => {
- this.$toast.success(this.$t('otc.d4'));
- this.$nextTick(() => {
- this.$refs.scroll.ref();
- });
- });
- },
- },
- };
- </script>
|