123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428 |
- <template>
- <view class="selectCar-box">
- <view class="details">
- <view class="title">
- 基础信息
- </view>
- <view class="details-item">
- <view>
- 订单编号:
- </view>
- <text>{{state.data.orderId}}</text>
- </view>
- <view class="details-item">
- <view>
- 用户名称:
- </view>
- <text>{{state.data.customerName}}</text>
- </view>
- <view class="details-item">
- <view>
- 用户证件类型:
- </view>
- <text>{{getCodeName('CERTIFICATE_TYPE',state.data.customerIdtype)}}</text>
- </view>
- <view class="details-item">
- <view>
- 用户证件号:
- </view>
- <text>{{state.data.customerIdnum}}</text>
- </view>
- <view class="details-item">
- <view>
- 订单车牌号:
- </view>
- <text style="color: #00B38B;;">{{state.data.vehiclePlate}}</text>
- </view>
- <view class="details-item">
- <view>
- 收费车型:
- </view>
- <text>{{state.data.vehicleType}}</text>
- </view>
- </view>
- <view class="title">
- 卡信息
- </view>
- <view class="card">
- <view class="card-left">
- <image :src="`${$imgUrl}card2.png`" mode=""></image>
- <view class="card-center">
- <view class="card-center-head">
- {{state.data.cardId}}
- </view>
- <view class="tips">
- <text>储蓄卡</text>
- <text class="tips-card">{{getCodeName('CARD_STATE_TYPE',state.data.cardStatus)}}</text>
- </view>
- </view>
- </view>
- <view class="choose-item" @click="choose(1)">
- <view class="active" v-if="flag.includes(1)">
-
- </view>
- </view>
- </view>
-
- <view class="title">
- OBU设备信息
- </view>
- <view class="card">
- <view class="card-left">
- <image :src="`${$imgUrl}card1.png`" mode=""></image>
- <view class="card-center">
- <view class="card-center-head">
- {{state.data.obuId}}
- </view>
- <view class="tips">
- <!-- <text>储蓄卡</text> -->
- <text class="tips-card">{{getCodeName('OBU_STATE_TYPE',state.data.obuStatus)}}</text>
- </view>
- </view>
- </view>
- <view class="choose-item" @click="choose(2)">
- <view class="active" v-if="flag.includes(2)">
-
- </view>
- </view>
- </view>
- <button class="submit" @click="nextACtion">下一步</button>
- </view>
- </template>
-
- <script lang="ts" setup>
- import {
- getCodeName
- } from "@/datas/queryKey.js";
-
- import {
- reactive,
- ref
- } from "vue"
- import {
- navTo
- } from "@/utils/utils"
- import {
- onLoad,
- onUnload
- } from "@dcloudio/uni-app";
- import {
- request
- } from "@/utils/network/request.js";
- import {
- orderDetail,
- CardlossStatus
- } from "@/utils/network/api.js";
-
- import {
- msg
- } from "@/utils/utils";
- import {
- getCredentialType
- } from "@/datas/credentialType.js";
-
- import {
- getEtcCardStatus
- } from "@/datas/etcCardStatus.js";
- import {
- getObuStatus
- } from "@/datas/obuStatus.js";
-
- import {
- stringToJson
- } from "@/utils/network/encryption";
-
- const state = reactive({
- data: {
- cardStatus: undefined,
- obuStatus: undefined,
- }
- });
- const flag = reactive([])
- const type = ref('')
-
- /*视图进入后操作*/
- onLoad((option) => {
- queryOrderDetail(option.id).then((val: any) => {
- state.data = val
- })
- /*监听手机号验证后的回调*/
- uni.$on('queryCardlossStatus', function(type) {
- queryCardlossStatusType(type.type).then((val: any) => {
- navTo(
- `/subpackage/after-sale/card-loss-reporting/card-result`
- )
- });
- })
- });
-
- onUnload(() => {
- /*移除监听*/
- uni.$off('queryCardlossStatus')
- });
- /*下一步*/
- const nextACtion = () => {
- console.log(flag.length)
-
- if (flag.length === 0) {
- uni.showToast({
- title: '请至少勾选一项',
- });
- } else if (flag.length === 1) {
- if (type.value === '1') {
- //卡正常
- if (state.data.cardStatus === 1) {
- showModelAction('卡挂失', '请确认是否执行卡挂失操作', 1)
-
- } else if (state.data.cardStatus === 6) {
- showModelAction('卡解挂', '请确认是否执行卡解挂操作', 4)
- } else {
- msg('当前的卡不支持设备挂失/解挂操作')
- }
-
- } else if (type.value === '2') {
- //obu正常
- if (state.data.obuStatus === 1) {
- showModelAction('设备挂失', '请确认是否执行设备挂失操作', 2)
-
- } else if (state.data.obuStatus === 6) {
- showModelAction('设备解挂', '请确认是否执行签解挂操作', 5)
-
- } else {
- msg('当前的卡不支持设备挂失/解挂操作')
- }
- }
- } else if (flag.length === 2) {
- console.log('两个一起')
- if ((state.data.cardStatus !== state.data.obuStatus)) {
- msg('当前的卡状态和obu状态不支持批量操作')
- return;
- }
- if (type.value === '3') {
- if (state.data.cardStatus && state.data.obuStatus === 1) {
- showModelAction('卡签挂失', '请确认是否执行卡签挂失操作', 3)
- } else {
- showModelAction('卡签解挂', '请确认是否执行卡签解挂操作', 6)
- }
- }
-
- }
- }
-
- const showModelAction = (title, content, type) => {
- wx.showModal({
- title: title,
- content: content,
- success: function(res) {
- if (res.confirm) {
- navTo(
- `/subpackage/after-sale/card-loss-reporting/cardloss?type=${type}&&mobile=${state.data.customerTel}`
- )
-
- }
- }
- });
- }
-
- const choose = (data) => {
- if (!flag.includes(data)) {
- flag.push(data)
- console.log(flag);
-
- } else {
- flag.splice(flag.indexOf(data), 1)
- console.log(flag);
- }
-
- if (flag.length == 2) {
- type.value = '3'
- } else if (flag[0] == 1) {
- type.value = '1'
- } else {
- type.value = '2'
- }
- }
-
- const queryOrderDetail = (id) => {
- return new Promise(async (resolve, reject) => {
- const res = await request(orderDetail, {
- type: 2,
- data: {
- id: id
- },
- method: "POST",
- showLoading: true,
- });
- const data = stringToJson(res.bizContent);
- resolve(data);
- }).catch((error) => {
-
- reject(error);
- });
- }
- const queryCardlossStatusType = (val: any) => {
- var data = {
- cardId: state.data.cardId,
- obuId: state.data.obuId,
- operation: val,
- orderId: state.data.orderId
- };
- const options = {
- type: 2,
- data: data,
- method: "POST",
- showLoading: true,
- };
- return new Promise(async (resolve, reject) => {
- const res = await request(CardlossStatus, options);
- const data = stringToJson(res.bizContent);
- resolve(data);
- }).catch((error) => {
- reject(error);
- });
-
- }
- </script>
-
- <style>
- page {
- width: 100%;
- height: 100%;
- background-color: #fff;
- }
- </style>
- <style lang="scss" scoped>
- .selectCar-box {
- // width: 100%;
- // height: 100%;
- padding: 30rpx;
-
- .title {
- font-size: 30rpx;
- font-family: Microsoft YaHei UI;
- font-weight: 400;
- color: #333333;
- margin-bottom: 30rpx;
- }
-
- .details {
- .title {
- font-size: 30rpx;
- font-family: Microsoft YaHei UI;
- font-weight: 400;
- color: #333333;
- margin-bottom: 30rpx;
- }
-
- .details-item {
- display: flex;
- font-size: 26rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #999999;
- margin-bottom: 30rpx;
-
- text {
- font-size: 26rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #333333;
- }
- }
-
- }
-
- .card {
- height: 150rpx;
- background: #FFFFFF;
- box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
- border-radius: 20rpx;
- padding: 30rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 60rpx;
-
- .card-left {
- display: flex;
- align-items: center;
-
- image {
- width: 100rpx;
- height: 90rpx;
- }
-
- .card-center {
- margin-left: 30rpx;
-
- .card-center-head {
- font-size: 32rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #333333;
- }
-
- .tips {
- font-size: 26rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #666666;
-
- .tips-card {
- width: 70rpx;
- height: 40rpx;
- background: #D3F2EF;
- border-radius: 6rpx;
- font-size: 20rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #0A8F8A;
- padding: 5rpx 10rpx;
- margin-left: 20rpx;
- }
- }
- }
- }
-
- .choose-item {
- margin-right: 20rpx;
- width: 50rpx;
- height: 50rpx;
- border: 1rpx solid #00B38B;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
-
- .active {
- width: 38rpx;
- height: 38rpx;
- background: #00B38B;
- border-radius: 50%;
- }
- }
- }
-
- .remark {
- font-size: 26rpx;
- font-family: Microsoft YaHei UI;
- font-weight: 400;
- color: #666666;
- text-indent: 30rpx;
- margin-bottom: 30rpx;
- }
-
- .submit {
- margin-top: 100rpx;
- width: 670rpx;
- height: 80rpx;
- background: linear-gradient(-90deg, #43A1E0 0%, #13E7C1 100%);
- border-radius: 40rpx;
- font-size: 32rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #FFFFFF;
- line-height: 80rpx;
- }
- }
- </style>
|