|
@@ -29,9 +29,9 @@
|
|
|
<view class="item" v-for="(i,index) in data" :key="index">
|
|
|
<text class="type" :class="i.remark=='book'?'t1':'t2'">{{i.remark=='book'?'预订单':'现场单'}}</text>
|
|
|
<view class="personInfo">
|
|
|
- <view class="name">{{i.touristName}}</view>
|
|
|
+ <view class="name">{{i.touristName|handle(1)}}</view>
|
|
|
<view class="code">
|
|
|
- 身份证 {{i.touristCode}}
|
|
|
+ 身份证 {{i.touristCode|handle(3)}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<u-icon name="minus-circle" size="36" color="#FEA400" @tap="jian(item)"
|
|
@@ -42,10 +42,11 @@
|
|
|
<view class="tit">选择渔船</view>
|
|
|
<view class="typeItem">
|
|
|
<view class="txt" v-for="(t,i) in types" :key="i" @click="typeIndex=i" :class="typeIndex==i?'on':''">
|
|
|
- {{t.boatNo}}
|
|
|
- <image v-if="typeIndex==i" src="https://i.ringzle.com/file/20240320/b458b03f8f654a51a921656b8aa955de.png"></image>
|
|
|
+ {{t.boatNo}}
|
|
|
+ <image v-if="typeIndex==i"
|
|
|
+ src="https://i.ringzle.com/file/20240320/b458b03f8f654a51a921656b8aa955de.png"></image>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="btn">
|
|
@@ -55,13 +56,17 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import {
|
|
|
+ encrypt,
|
|
|
+ decrypt,
|
|
|
+ tuomin
|
|
|
+ } from '../../utils/aes.js'
|
|
|
var that;
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- typeIndex:null,
|
|
|
- types: [
|
|
|
- ],
|
|
|
+ typeIndex: null,
|
|
|
+ types: [],
|
|
|
date: new Date().Format('yyyy-MM-dd'),
|
|
|
show: false,
|
|
|
data: [],
|
|
@@ -79,16 +84,22 @@
|
|
|
this.boatNo = opt.boatNo || '';
|
|
|
this.getOrderInfo();
|
|
|
this.getTypes();
|
|
|
+ console.log(tuomin())
|
|
|
//获取上次核销缓存
|
|
|
|
|
|
},
|
|
|
+ filters: {
|
|
|
+ handle(val, type) {
|
|
|
+ return tuomin(decrypt(val), type)
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
- getTypes(){
|
|
|
- this.$api.get('/scenic/api/boat/page',{
|
|
|
- page:-1
|
|
|
- }).then(res=>{
|
|
|
- if(res.data.code==0){
|
|
|
- this.types=res.data.data.list;
|
|
|
+ getTypes() {
|
|
|
+ this.$api.get('/scenic/api/boat/page', {
|
|
|
+ page: -1
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.types = res.data.data.list;
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -98,20 +109,17 @@
|
|
|
//decodeURIComponent
|
|
|
},
|
|
|
getOrderInfo() {
|
|
|
- this.$api.post('/scenic/order/queryStartOrderInfo', {
|
|
|
+ this.$api.post('/scenic/api/order/queryStartOrderInfo', {
|
|
|
merchantId: this.merchantId,
|
|
|
boatNo: this.boatNo
|
|
|
}).then(res => {
|
|
|
console.log(res.data)
|
|
|
if (res.data.code == 0) {
|
|
|
- console.log(res)
|
|
|
this.orderInfo = res.data.data;
|
|
|
this.keyName = this.orderInfo.playDate + this.orderInfo.playTime + this.boatNo;
|
|
|
- console.log(uni.getStorageSync(this.keyName))
|
|
|
- if(uni.getStorageSync(this.keyName)){
|
|
|
+ if (uni.getStorageSync(this.keyName)) {
|
|
|
this.data = JSON.parse(uni.getStorageSync(this.keyName)) || [];
|
|
|
}
|
|
|
- console.log(this.data)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -141,18 +149,30 @@
|
|
|
sendData.writeOffCode = result;
|
|
|
console.log(sendData)
|
|
|
|
|
|
- this.$api.post('/scenic/order/scanCode', sendData).then(res => {
|
|
|
+ this.$api.post('/scenic/api/order/scanCode', sendData).then(res => {
|
|
|
console.log(res.data)
|
|
|
if (res.data.code == 0) {
|
|
|
- console.log(this.data.findIndex(item => {
|
|
|
- item.touristCode == res.data.data.touristCode
|
|
|
- }))
|
|
|
if (this.data.findIndex((item) => {
|
|
|
return item.touristCode == res.data.data.touristCode
|
|
|
}) > -1) {
|
|
|
this.$showToast('该核验码已扫')
|
|
|
} else {
|
|
|
- this.data.push(res.data.data)
|
|
|
+ // "id": 0,
|
|
|
+ // "orderCode": "",
|
|
|
+ // "remark": "",
|
|
|
+ // "touristCode": "",
|
|
|
+ // "touristName": ""
|
|
|
+
|
|
|
+ res.data.data.touristCode = encrypt(res.data.data.touristCode);
|
|
|
+ res.data.data.touristName = encrypt(res.data.data.touristName)
|
|
|
+ let json = {
|
|
|
+ id: res.data.data.id,
|
|
|
+ orderCode:res.data.data.orderCode,
|
|
|
+ remark:res.data.data.remark,
|
|
|
+ touristCode:res.data.data.touristCode,
|
|
|
+ touristName: res.data.data.touristName
|
|
|
+ }
|
|
|
+ this.data.push(json)
|
|
|
}
|
|
|
} else {
|
|
|
this.$showToast(res.data.msg)
|
|
@@ -168,14 +188,17 @@
|
|
|
if (this.data.length == 0) {
|
|
|
return this.$showToast('请选择核销人')
|
|
|
}
|
|
|
- if (this.typeIndex==null) {
|
|
|
+ if (this.typeIndex == null) {
|
|
|
return this.$showToast('请选择渔船')
|
|
|
}
|
|
|
- let boatCode=this.types[this.typeIndex];
|
|
|
- this.$api.post('/scenic/order/sailWriteOff', {
|
|
|
+ let boatCode = this.types[this.typeIndex].boatNo;
|
|
|
+ this.$api.post('/scenic/api/order/sailWriteOff', {
|
|
|
+ playDate:this.orderInfo.playDate,
|
|
|
+ playTime:this.orderInfo.playTime,
|
|
|
+ playLength:this.orderInfo.playLength,
|
|
|
orderType: this.orderInfo.orderType,
|
|
|
touristList: this.data,
|
|
|
- boatCode:boatCode
|
|
|
+ boatCode: boatCode
|
|
|
}).then(res => {
|
|
|
if (res.data.code == 0) {
|
|
|
uni.redirectTo({
|
|
@@ -232,7 +255,7 @@
|
|
|
display: flex;
|
|
|
gap: 36rpx;
|
|
|
justify-content: space-between;
|
|
|
-
|
|
|
+
|
|
|
|
|
|
.n {
|
|
|
margin-bottom: 20rpx;
|
|
@@ -323,13 +346,15 @@
|
|
|
color: #111;
|
|
|
padding: 36rpx 0 17rpx;
|
|
|
}
|
|
|
- .typeItem{
|
|
|
+
|
|
|
+ .typeItem {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
flex-wrap: wrap;
|
|
|
- gap:20rpx 0;
|
|
|
+ gap: 20rpx 0;
|
|
|
padding-bottom: 50rpx;
|
|
|
- .txt{
|
|
|
+
|
|
|
+ .txt {
|
|
|
display: inline-block;
|
|
|
width: 316rpx;
|
|
|
height: 80rpx;
|
|
@@ -338,13 +363,15 @@
|
|
|
text-align: center;
|
|
|
line-height: 80rpx;
|
|
|
border: 2rpx solid #EFEFEF;
|
|
|
- color:#333;
|
|
|
+ color: #333;
|
|
|
position: relative;
|
|
|
- &.on{
|
|
|
- color:#007A69 ;
|
|
|
- background: rgba(0,122,105,0.06);
|
|
|
+
|
|
|
+ &.on {
|
|
|
+ color: #007A69;
|
|
|
+ background: rgba(0, 122, 105, 0.06);
|
|
|
border: 2rpx solid #007A69;
|
|
|
- image{
|
|
|
+
|
|
|
+ image {
|
|
|
position: absolute;
|
|
|
bottom: 0;
|
|
|
right: 0;
|
|
@@ -353,9 +380,10 @@
|
|
|
z-index: 11;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.item {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|