10.10综合交易所原始源码_移动端
1
admin
2026-02-10 c547081aa61be5c7b6d4c12853c675954c2156eb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
<template>
  <div id="AppealPage">
    <div id="full" class="w-full h-full">
      <order-nav>
        <template #title>
          {{ $t('申诉') }}
        </template>
      </order-nav>
      <div class="pt-5 px-8 mainBackground pb-12">
        <div class="payment-input-wrapper">
          <div class="label text-28 mb-4 textColor2">
            {{ $t('申诉理由 (必选)') }}
          </div>
          <div class="payment-input w-full">
            <van-field v-model="info.reason" :placeholder="$t('我已付款,但订单已取消')" />
          </div>
        </div>
        <div class="payment-input-wrapper">
          <div class="label text-28 mb-4 textColor2">
            {{ $t('申诉描述') }}
          </div>
          <div class="payment-input w-full">
            <van-field class="textarea" type="textarea" rows="5" v-model="info.description"
              :placeholder="$t('请尽可能完整的描述信息')" />
          </div>
        </div>
 
        <div class="mt-16">
          <div class="text-28 mb-3 c2cColor">{{ $t('添加凭证 (必填)') }}</div>
          <p class="text-22 text-grey">{{ $t('付款及沟通记录的截图或音视频,最多5个文件,总大小不超过50MB。') }}</p>
          <div class="mt-8">
            <van-uploader v-model="fileList" :afterRead="afterRead" :max-count="1" :max-size="50000 * 1024"
              accept="image/*,video/*" @oversize="oversize">
              <div class="uploader">
                <van-icon name="plus" />
              </div>
            </van-uploader>
          </div>
        </div>
      </div>
      <div class="px-8 mt-4 pt-7 pb-6 mainBackground connect">
        <van-cell-group>
          <van-cell>
            <template #title>
              <span class="text-28">{{ $t('联系人') }}</span>
            </template>
            <template #default>
              <input class="w-60" type="text" :placeholder="$t('联系人')" v-model="info.name">
            </template>
          </van-cell>
          <van-cell class="mt-5">
            <template #title>
              <span class="text-28">{{ $t('联系电话') }}</span>
            </template>
            <template #default>
              <div class="flex items-center justify-end">
                <input class="w-60" type="text" :placeholder="$t('请输入联系方式')" v-model="info.phone">
                <img class="w-6 h-6 ml-4" src="~@/assets/image/c2c/Group1222.png" alt="">
              </div>
            </template>
          </van-cell>
        </van-cell-group>
      </div>
      <div class="px-8 mt-16 mainBackground pt-9 pb-10">
        <van-button :disabled="!fullDisabled" color="#1D91FF" class="w-full h-100 rounded-xl" type="info"
          @click="onAppeal">{{ $t('我要申述') }}
        </van-button>
      </div>
      <!--  弹窗  -->
      <van-popup position="right" class="w-full h-full" v-model:show="show">
        <appeal-waiting @back="back" />
      </van-popup>
    </div>
  </div>
</template>
 
<script>
import {
  Uploader,
  Icon,
  CellGroup,
  Cell,
  Popup,
  showLoadingToast,
  closeToast,
  showToast
} from "vant";
import OrderNav from "@/components/Transform/order-nav/OrderNav.vue";
import OtcCircle from "@/components/Transform/otcCircle/index.vue";
import AppealWaiting from "@/views/cryptos/c2cOrder/components/appeal/AppealWaiting.vue";
import AppealSuccess from "@/views/cryptos/c2cOrder/components/appeal/AppealSuccess.vue";
import {
  mapGetters,
  mapMutations,
} from "vuex";
import {
  REASON_FOR_CANCELLATION
} from "@/store/const.store";
import { _uploadImage } from "@/service/upload.api.js";
import otcApi from "@/service/otc.api";
 
export default {
  name: "Appeal",
  data() {
    return {
      show: false,
      disable: false,
      info: {
        reason: '', // 理由
        description: '', // 描述
        name: '',
        phone: '',
      },
      fileList: [],
    }
  },
  computed: {
    ...mapGetters('c2c', ['getReasonForCancellation', 'orderNo']),
    fullDisabled() {
      return this.disable && this.fileList.length > 0
    }
  },
  created() {
    this.info.reason = this.getReasonForCancellation
  },
  beforeUnmount() {
    this[REASON_FOR_CANCELLATION]('');
  },
  methods: {
    ...mapMutations('c2c', [REASON_FOR_CANCELLATION]),
    afterRead(file) {
      file.status = 'uploading'
      file.message = this.$t('上传中...')
      // 上传图片到服务器
      _uploadImage(file).then(res => {
        file.status = 'success';
        file.message = this.$t('上传成功');
        file.resURL = res
      }).catch(err => {
        file.status = 'failed';
        file.message = this.$t('图片上传失败');
      })
    },
    // 超出大小
    oversize() {
      showToast(this.$t('超出50MB!'))
    },
    back() {
      this.show = false;
      this.$router.push('/cryptos/wantBuy')
    },
    // 申诉
    async onAppeal() {
      showLoadingToast({
        duration: 0,
        forbidClick: true,
        message: this.$t('加载中')
      })
      const params = {
        order_no: this.orderNo,
        ...this.info,
        img: this.fileList[0].resURL
      }
 
      console.log(params);
 
      const res = await otcApi.c2cAppeal(params);
      closeToast();
      this.show = true;
    }
  },
  watch: {
    info: {
      deep: true,
      handler() {
        const res = Object.keys(this.info).filter(key => {
          return this.info[key] === "" || this.info[key] === undefined
        })
        console.log(res);
        this.disable = res.length === 0;
      },
      immediate: true
    }
  },
  components: {
    [Uploader.name]: Uploader,
    [Icon.name]: Icon,
    [CellGroup.name]: CellGroup,
    [Cell.name]: Cell,
    [Popup.name]: Popup,
    OrderNav,
    OtcCircle,
    AppealWaiting,
    AppealSuccess,
  }
}
</script>
 
<style lang="scss" scoped>
#AppealPage {
  font-size: 30px;
 
  :deep(.payment-input) {
    input {
      height: 90px;
    }
  }
 
  textarea {
    &::placeholder {
      color: #B8BCC5;
    }
  }
 
  .uploader {
    position: relative;
    width: 180px;
    height: 180px;
    border: 2px dashed #EAEBEE;
    background: $tab_background;
 
    .van-icon {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-weight: 700;
      font-size: 50px;
      color: #9399A4;
    }
 
  }
 
  .connect {
    input {
      margin: 0;
      font-size: 28px;
      box-sizing: border-box;
      border: none;
      background: $main_background;
    }
  }
 
  #full {
    :deep(.van-cell-group) {
      color: $text_color1;
      background: $main_background;
    }
 
    :deep(.van-cell) {
      color: $text_color1;
      background: $main_background;
    }
 
    :deep(.van-cell__value) {
      color: $text_color;
    }
 
    :deep(.van-button--info) {
      background: $btn_main;
      border-color: $btn_main;
      color: $main-btn-color;
    }
 
  }
 
  :deep(.van-field) {
    background: $input_background !important;
    padding-left: 20px;
    border-radius: 10px;
 
    .van-field__control {
      color: $c2c_color;
    }
  }
 
  .textarea {
    padding: 30px !important;
  }
 
 
}
</style>