123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <template>
- <view>
- <form @submit="formSubmit">
- <view class='personal-data' :style="colorStyle">
- <view class='list'>
- <view class='item acea-row row-between-wrapper'>
- <view>{{$t(`创建时间`)}}</view>
- <view class='input'>
- {{carDateil.add_time}}
- </view>
- </view>
- <view class='item acea-row row-between-wrapper'>
- <view>{{$t(`类型`)}}</view>
- <view class='input' v-if="carDateil.car_lease==1">
- 以租代购
- </view>
- <view class='input' v-if="carDateil.car_lease==0">
- 月租
- </view>
- </view>
- <view class='item acea-row row-between-wrapper' v-if="carDateil.car_lease==1">
- <view>{{$t(`总月份`)}}</view>
- <view class='input'>
- {{carDateil.several_months}}
- </view>
- </view>
- <view class='item acea-row row-between-wrapper' v-if="carDateil.car_lease==1">
- <view>{{$t(`已付月份`)}}</view>
- <view class='input'>
- {{carDateil.months}}
- </view>
- </view>
- <view class='item acea-row row-between-wrapper'>
- <view>{{$t(`月租`)}}</view>
- <view class='input'>
- {{carDateil.pay_price}}
- </view>
- </view>
- <view class='item acea-row row-between-wrapper'>
- <view>{{$t(`绑定人`)}}</view>
- <view class='input'>
- {{carDateil.real_name}}
- </view>
- </view>
- <view class='item acea-row row-between-wrapper'>
- <view>绑定车辆编号</view>
- <view class='input acea-row row-between-wrapper' @click="carDateil.machine_no?'':bind()">
- {{carDateil.machine_no?carDateil.machine_no:'未绑定'}}
- </view>
- </view>
- </view>
- </view>
- </form>
- <view class="monthslist" v-for="(item,ind) in carDateil.info">
- <view class="item acea-row row-between-wrapper row-middle">
- <view class="title">
- <view class="info">
- 支付第{{item.months}}月租金
- </view>
- <view class="time">
- {{item.pay_time}}
- </view>
- </view>
- <view class="right">
- <view class="money">
- {{item.pay_price}}
- </view>
- <block v-if="item.paid!=0">
- <view class="peytype" v-if="item.pay_type=='yue'">
- 余额支付
- </view>
- <view class="peytype" v-if="item.pay_type=='alipay'">
- 支付宝支付
- </view>
- <view class="peytype" v-if="item.pay_type=='weixin'">
- 微信支付
- </view>
- </block>
- <view v-else class="peytype">
- 未支付
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- toLogin
- } from '@/libs/login.js';
- import {
- getRentOrderDteail,
- rentSetcar
- } from '@/api/rent.js';
- import {
- mapGetters
- } from "vuex";
- import colors from '@/mixins/color.js';
- export default {
- mixins: [colors],
- data() {
- return {
- id: '',
- carDateil: {
- machine_no: '',
- }
- };
- },
- computed: mapGetters(['isLogin']),
- watch: {
- isLogin: {
- handler: function(newV, oldV) {
- if (newV) {
- this.getRentOrderDteail();
- }
- },
- deep: true
- }
- },
- onLoad(options) {
- this.id = options.id
- if (this.isLogin) {
- this.getRentOrderDteail();
- } else {
- toLogin();
- }
- },
- methods: {
- // #ifndef APP-PLUS
- // 打开二维码
- openQr() {
- const that = this;
- uni.scanCode({
- onlyFromCamera: true,
- scanType: ['barCode', 'qrCode', 'datamatrix', 'pdf417'],
- success(res) {
- that.carDateil.machine_no = res.result;
- }
- })
- },
- // #endif
- bind() {
- const that = this;
- // #ifndef H5
- uni.showModal({
- title: '提示',
- content: '请选择绑定方式',
- showCancel: false,
- cancelText: '扫码',
- confirmText: '手填',
- success: res => {
- if (res.confirm) {
- that.bindImport(that.id)
- }
- if (res.cancel) {
- that.bindQr(that.id)
- }
- },
- fail: () => {},
- complete: () => {}
- });
- // #endif
- // #ifdef H5
- that.bindImport(that.id)
- // #endif
- },
- // 手输
- bindImport(id) {
- const that = this;
- uni.showModal({
- title: '绑定车辆',
- placeholderText: '请输入车辆编号',
- editable: true,
- cancelText: '取消',
- confirmText: '确定',
- success: res => {
- if (res.confirm) {
- if (res.content) {
- that.rentSetcar(res.content, id)
- } else {
- uni.showToast({
- title: '请输入车辆编号',
- icon: 'error'
- })
- that.bindImport(id)
- }
- }
- },
- fail: () => {},
- complete: () => {}
- });
- },
- // 扫码绑定
- bindQr(id) {
- uni.scanCode({
- onlyFromCamera: true,
- scanType: ['barCode', 'qrCode', 'datamatrix', 'pdf417'],
- success(res) {
- that.rentSetcar(res.result, id)
- }
- })
- },
- // 提交绑定
- rentSetcar(content, id) {
- rentSetcar({
- id,
- machine_no: content
- }).then((res) => {
- uni.showToast({
- title:res.msg,
- })
- }).catch((res) => {
- uni.showToast({
- title:res,
- icon:'error'
- })
- console.log(res);
- })
- },
- // 查询车辆详情
- getRentOrderDteail() {
- getRentOrderDteail(this.id).then((res) => {
- console.log(res, 'fh');
- this.carDateil = res.data;
- }).catch((res) => {
- console.log(res);
- })
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .personal-data .list {
- /* #ifndef H5 */
- margin-top: 15rpx;
- /* #endif */
- background-color: #fff;
- .item {
- padding: 30rpx 30rpx 30rpx 0;
- border-bottom: 1rpx solid #f2f2f2;
- margin-left: 30rpx;
- font-size: 28rpx;
- color: #282828;
- .input {
- max-width: 400rpx;
- text-align: right;
- color: #868686;
- .icon-suozi {
- margin-left: 10rpx;
- }
- .id {
- // width: 180rpx;
- }
- .iconfont {
- font-size: 24rpx;
- }
- }
- }
- }
- .monthslist {
- background-color: #FFF;
- border-radius: 10rpx;
- margin: 20rpx 20rpx 0rpx 20rpx;
- padding: 20rpx;
- .time,
- .peytype {
- font-size: 24rpx;
- color: #999;
- }
- .info {
- color: var(--view-theme);
- }
- .right {
- text-align: right;
- .money {
- color: var(--view-theme);
- }
- }
- }
- </style>
|