1
zhaoxiaoqiang
2022-08-05 2345e1e46ae69713931c47a941ee153d0cb0ea88
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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
<!--
 * @Author: 小明丶
 * @Date: 2020-05-21 17:31:49
 * @LastEditors: zxq
 * @LastEditTime: 2022-07-08 16:12:18
 * @Description: 订单详情
-->
<template>
  <div class="order-detail-page">
    <v-navbar
      title="订单详情"
      titleColor="#fff"
      background="linear-gradient(60deg,rgba(75,137,250,1),rgba(105,167,255,1))"
    >
      <template slot="left-back">
        <div>
          <i
            class="iconfont iconzuojiantou"
            style="font-size:22px;font-weight:blod;color:#fff"
            @click="$router.push('/order/my-order')"
          ></i>
        </div>
      </template>
    </v-navbar>
    <div class="business-info-box">
      <div class="business-top">
        <div class="box">
          <img src="../../../static/img/pic.png" alt />
          <span>商品信息</span>
        </div>
      </div>
      <div class="business-mation">
        <h-cell label="商品名称" v-model="orderInfo.goodsName" readonly></h-cell>
        <h-cell label="规格" v-model="orderInfo.goodsModel" readonly></h-cell>
        <h-cell label="成交价格" v-model="orderInfo.goodsAmt" readonly></h-cell>
      </div>
    </div>
    <div class="fenqi-info-box">
      <div class="fenqi-top">
        <div class="box">
          <img src="../../../static/img/pic.png" alt />
          <span>分期信息</span>
        </div>
      </div>
      <div class="fenqi-mation">
        <h-cell label="分期金额" v-model="orderInfo.insAmt" readonly></h-cell>
        <h-cell label="期数" v-model="insTerm" readonly></h-cell>
        <h-cell label="应还总额" v-model="orderInfo.repayTotalAmt" readonly></h-cell>
        <h-cell label="交易日期" v-model="orderInfo.payTime" readonly></h-cell>
        <h-cell label="订单状态" v-model="orderInfo.statusName" readonly></h-cell>
        <h-cell label="还款状态" v-model="orderInfo.overStatusName" readonly></h-cell>
        <h-cell v-if="orderInfo.repayPlans" label="还款计划表" isLink readonly @click="goRepaymentPlan"></h-cell>
      </div>
    </div>
    <div style="margin-top:10px;padding:0 26px;background:#fff" v-if="orderInfo.contract2Urls || orderInfo.contract3Urls || orderInfo.contract4Urls || orderInfo.contract5Urls  || orderInfo.contract6Urls  || orderInfo.contract7Urls">
        <!-- <div style="margin-top:10px;padding:0 26px;background:#fff" v-if="orderInfo.contract2Urls || orderInfo.contract3Urls || orderInfo.contract4Urls"> -->
      <!-- orderInfo.contract1Urls || 合同一保理合同暂时不要 -->
      <h-cell label="相关合同" @click="goContract" isLink readonly></h-cell>
    </div>
    <div class="btn-box">
      <button class="btn-jxsq" v-if="orderInfo.applyBtn==1" @click="doItNext">继续申请</button>
      <button class="btn-qx" v-if="orderInfo.cancelBtn==1" @click="show=!show">取消订单</button>
      <button class="btn-jq" v-if="orderInfo.preCloseBtn==1" @click="goSettle">提前结清</button>
      <button class="btn-hk" v-if="orderInfo.repayBtn==1" @click="goRepayment">主动还款</button>
    </div>
    <van-dialog
      @confirm="onConfirm"
      v-model="show"
      show-cancel-button
      confirmButtonColor="#333333"
      cancelButtonColor="#666666"
    >
      <div class="title-box">
        <p>确定取消此订单吗?</p>
      </div>
    </van-dialog>
  </div>
</template>
<script>
import Vue from "vue";
import { Dialog } from "vant";
 
Vue.use(Dialog);
export default {
  data() {
    return {
      show: false,
      orderInfo: {},
      step:'',//步骤
      insTerm:'',//期数
    };
  },
  created() {
    this.init();
  },
  methods: {
    /**初始化**/
    init() {
      this.$api.orderUserDetail({orderId: this.$route.query.id }).then(res => {
          this.orderInfo = res.body;
          this.insTerm = res.body.insTerm+'期'
      });
    },
    /**订单取消**/
    onConfirm() {
      this.$api
        .orderUserCancel({
          orderId: this.orderInfo.orderId
        })
        .then(res => {
          this.$tool.toast("订单取消成功");
          this.init()
        });
    },
    /**跳转还款计划表**/
    goRepaymentPlan() {
      this.$router.push({
        path: "/order/repayment-plan",
        query: {
          id: this.orderInfo.orderId
        }
      });
    },
    /**跳转提前结清**/
    goSettle() {
      this.$api.initPreClose({ orderId: this.$route.query.id }).then(({ body }) => {
            this.$router.push({
              path: "/order/settlementEarly",
              query: {
                id: this.orderInfo.orderId
              }
            });
      })
    },
    /**跳转主动还款**/
    goRepayment() {
      this.$router.push({
        path: "/order/active-repayment",
        query: {
          id: this.orderInfo.orderId
        }
      });
    },
    /**继续申请**/
    doItNext(){
      this.$api.orderCreateStep().then(res=>{
        let createStep = res.body.createStep;
        localStorage.setItem('projId',res.body.projId);
        this.step = createStep
        if (res.body.createStep == 0) {
          this.$router.push('/home/index')
        }
        if (res.body.createStep == 1) {
          this.$router.push("/order-handling/upload-IDcard");
        }
        if (res.body.createStep == 2) {
            //重新人脸识别,先去协议页面;
            this.$router.push({
              path: "/order-handling/face-recognition",
              query: {isFaceBack:'1'}
            });
          // let str = location.host
          // this.$api.getFaceUrl({callbackUrl:`https://${str}/aic_cus/#/order-handling/face-recognition`}).then(res => {
          //     window.location.href = res.body.faceUrl;
          // });
        }
        if (res.body.createStep == 3) {
          this.$router.push("/order-handling/upload-userInfo");
        }
        if (res.body.createStep == 4) {
          this.$router.push("/order-handling/contract-signing");
        }
        if (res.body.createStep == 5) {
          this.$router.push(res.body.projId=='100000'?"/order-handling/approval-results":"/order-handling/image-upload");
        }
        if (res.body.createStep == 6) {
          this.$router.push("/order-handling/approval-results");
        }
      })
    },
    /**跳转相关合同页**/
    goContract(){
      sessionStorage.contract1Urls = JSON.stringify(this.orderInfo.contract1Urls)
      sessionStorage.contract2Urls = JSON.stringify(this.orderInfo.contract2Urls)
      sessionStorage.contract3Urls = JSON.stringify(this.orderInfo.contract3Urls)
      sessionStorage.contract4Urls = JSON.stringify(this.orderInfo.contract4Urls)
      sessionStorage.contract5Urls = JSON.stringify(this.orderInfo.contract5Urls)
      sessionStorage.contract6Urls = JSON.stringify(this.orderInfo.contract6Urls)
      sessionStorage.contract7Urls = JSON.stringify(this.orderInfo.contract7Urls)
      this.$router.push({
        path:'/order/contract',
        query:{
           orderId: this.$route.query.id
        }
      })
    },
    goToSettle(){
 
    }
  }
};
</script>
<style lang="less" scoped>
.order-detail-page {
  & {
    min-height: 100vh;
    background: @c-back;
    padding-bottom: 29px;
  }
  /deep/.v-cell-box .input[disabled] {
    opacity: 1;
    -webkit-opacity: 1;
    color: #333;
    -webkit-text-fill-color: #333;
}
  .business-info-box {
    & {
      width: 100%;
      background: #fff;
    }
    .business-top {
      font-size: 15px;
      font-family: PingFang SC;
      font-weight: bold;
      color: rgba(51, 51, 51, 1);
      padding: 0 10px;
      .box {
        border-bottom: 1px solid #e6e6e6;
        padding: 17px 6px;
      }
      img {
        width: 6px;
        height: 13px;
      }
    }
    .business-mation {
      padding: 0 26px;
    }
    div:last-of-type {
      border: 0;
    }
  }
  .fenqi-info-box {
    & {
      width: 100%;
      background: #fff;
      margin-top: 10px;
    }
    .fenqi-top {
      font-size: 15px;
      font-family: PingFang SC;
      font-weight: bold;
      color: rgba(51, 51, 51, 1);
      padding: 0 10px;
      .box {
        border-bottom: 1px solid #e6e6e6;
        padding: 17px 6px;
      }
      img {
        width: 6px;
        height: 13px;
      }
    }
    .fenqi-mation {
      padding: 0 26px;
    }
    div:last-of-type {
      border: 0;
    }
  }
  .btn-box {
    & {
      text-align: center;
      margin-top: 32px;
    }
    .btn-jxsq {
      width: 155px;
      height: 44px;
      background: rgba(231, 240, 255, 1);
      border: 1px solid rgba(81, 148, 254, 1);
      border-radius: 22px;
      outline: none;
      color: #5194fe;
      margin-right: 13px;
    }
    .btn-jq {
      width: 155px;
      height: 44px;
      background: rgba(231, 240, 255, 1);
      border: 1px solid rgba(81, 148, 254, 1);
      border-radius: 22px;
      outline: none;
      color: #5194fe;
      margin-right: 13px;
    }
    .btn-hk {
      outline: none;
      border: 0;
      color: #fff;
      width: 155px;
      height: 44px;
      background: rgba(81, 148, 254, 1);
      border-radius: 22px;
    }
    .btn-qx {
      outline: none;
      border: 0;
      color: #fff;
      width: 155px;
      height: 44px;
      background: rgba(81, 148, 254, 1);
      border-radius: 22px;
    }
  }
  .title-box {
    & {
      height: 100px;
      line-height: 100px;
      text-align: center;
    }
    p {
      font-size: 16px;
      font-family: PingFang SC;
      font-weight: 500;
      color: rgba(51, 51, 51, 1);
    }
  }
}
</style>