Commit 6c4aac46 authored by 黄奎's avatar 黄奎

11

parent 72f18976
<style lang="scss" scoped> <style lang="scss" scoped>
@import url("@/asset/css/flex.css"); @import url("@/asset/css/flex.css");
.orcodeBox{
background: #fff; .orcodeBox {
border-radius: 8rpx; background: #fff;
border-radius: 8rpx;
position: relative; position: relative;
z-index: 2; z-index: 2;
} }
.Title{
.Title {}
}
.orcodeImg image{ .orcodeImg image {
width: 500rpx; width: 500rpx;
height: 500rpx; height: 500rpx;
} }
.SureBox{
font-size: 28rpx; .SureBox {
border-top: 1px solid #F2F2F2; font-size: 28rpx;
} border-top: 1px solid #F2F2F2;
.SureBox view:last-child{ }
color: #295EEB;
} .SureBox view:last-child {
.SureBox view:first-child{ color: #295EEB;
border-right: 1px solid #ddd; }
color: #8C8C8C;
} .SureBox view:first-child {
border-right: 1px solid #ddd;
color: #8C8C8C;
}
.swiper { .swiper {
height: 500rpx; height: 500rpx;
} }
.swiper-item { .swiper-item {
display: block; display: block;
height: 500rpx; height: 500rpx;
} }
.swiper-list { .swiper-list {
margin-top: 40rpx; margin-top: 40rpx;
margin-bottom: 0; margin-bottom: 0;
} }
.sty-box { .sty-box {
width: 500rpx; width: 500rpx;
height: 500rpx; height: 500rpx;
} }
</style> </style>
<template> <template>
<view> <view>
<u-popup mode="center" border-radius="20" <u-popup mode="center" border-radius="20" :popup="false" v-model="currencyVisible" :maskCloseAble="true"
:popup="false" length="80%" :safeAreaInsetBottom="true" @close="close" :z-index="9999">
v-model="currencyVisible" :maskCloseAble="true"
length="80%" :safeAreaInsetBottom="true"
@close="close" :z-index="9999">
<view class="orcodeBox"> <view class="orcodeBox">
<view class="Title PY30 color000 column justify-center items-center"> <view class="Title PY30 color000 column justify-center items-center">
<text class="fz28">领队小程序码({{current+1}}/{{list.length}}</text> <text class="fz28">领队小程序码({{current+1}}/{{list.length}}</text>
<text class="fz24">{{ list[current].TCNUMS }}</text> <text class="fz24">{{ list[current].TCNUMS }}</text>
</view> </view>
<view class="orcodeImg row items-center justify-center PX40"> <view class="orcodeImg row items-center justify-center PX40">
<swiper :indicator-dots="false" circular style="height:500rpx;width:500rpx" <swiper :indicator-dots="false" circular style="height:500rpx;width:500rpx" :current="current"
:current="current" @change="changeHandler"> @change="changeHandler">
<swiper-item v-for="(item, index) in list" :key="index"> <swiper-item v-for="(item, index) in list" :key="index">
<canvas :canvas-id="`firstCanvas_${index}`" class="sty-box" <canvas :canvas-id="`firstCanvas_${index}`" class="sty-box"
@error="(e)=>canvasIdErrorCallback(e,index)"></canvas> @error="(e)=>canvasIdErrorCallback(e,index)"></canvas>
<!-- <image mode="aspectFit" :src="item.Url" /> -->
</swiper-item> </swiper-item>
</swiper> </swiper>
<!-- <img :src="list[0].Url"/> -->
<!-- <image :src="list[0].Url" style="width: 500rpx;height: 500rpx;"/> -->
</view> </view>
<view class="SureBox row MT40"> <view class="SureBox row MT40">
<view class="flex1 PY20 text-center" @click="close">取消</view> <view class="flex1 PY20 text-center" @click="close">取消</view>
<view class="flex1 PY20 text-center" @click="preservation">保存</view> <view class="flex1 PY20 text-center" @click="preservation">保存</view>
</view> </view>
</view> </view>
</u-popup> </u-popup>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props:['TCIDs'], props: ['TCIDs'],
data() { data() {
return { return {
currencyVisible: false, currencyVisible: false,
list: [], list: [],
current: 0, current: 0,
indicatorDots: true, indicatorDots: true,
autoplay: true, autoplay: true,
interval: 2000, interval: 2000,
duration: 500, duration: 500,
BaseInfo: [], BaseInfo: [],
TCIDsList: [] TCIDsList: []
} }
},
watch: {
TCIDs:{
handler(newVal,oldVal){
this.list = []
this.getTem(newVal)
},
deep: false,
immediate:true,
}
},
mounted() {
},
methods: {
changeHandler(i) {
this.current = i.detail.current;
},
getTem(TCIDs){
uni.showLoading({
title: "正在生成",
});
this.apipost("dmcstatistics_post_GetExtendLeaderAllStatics",{
TCIDs: TCIDs,
NewCombinationNum: ''
}, (res) => {
if (res.resultCode == 1) {
this.BaseInfo = res.data.BaseInfo
this.TCIDsList = this.TCIDs.split(',')
this.TCIDsList.forEach((x,index) => {
this.init(x)
});
}
})
}, },
async init(x){ watch: {
await this.apipostQrCode("", { TCIDs: {
TCID: x handler(newVal, oldVal) {
}, (res) => { this.list = []
if (res.resultCode == 1) { this.getTem(newVal)
let findIndex = this.BaseInfo.findIndex(item => item.TCIDS == x) },
this.list.push({ deep: false,
Url:'data:image/png;base64,' + res.data, immediate: true,
TCID:x, }
TCNUMS:this.BaseInfo[findIndex].TCNUMS
})
if(this.list.length==this.TCIDsList.length) {
this.currencyVisible = true
this.list.forEach((x,i)=>{
this.drawCtx(i)
})
}
// uni.hideLoading()
}
})
}, },
close(){ mounted() {
this.currencyVisible = false
this.$emit('close')
},
drawCtx(i) {
let ctx = uni.createCanvasContext(`firstCanvas_${i}`, this);
let that = this;
ctx.drawImage(that.list[i].Url, 0, 0, 250, 250); //绘制图
that.drawQrCode(ctx)
}, },
drawQrCode(ctx) { methods: {
let that = this; changeHandler(i) {
setTimeout(() => { this.current = i.detail.current;
ctx.draw(false, () => { },
uni.canvasToTempFilePath({ getTem(TCIDs) {
x: 0, uni.showLoading({
y: 0, title: "正在生成",
width: 750,
height: 1344,
destWidth: 750.0,
destHeight: 1344.0,
canvasId: "firstCanvas",
success: (res) => {
uni.hideLoading();
// that.tempPic = res.tempFilePath;
},
fail(e) {
uni.hideLoading();
console.log(e);
},
},
that
);
}); });
}, 200) this.apipost("dmcstatistics_post_GetExtendLeaderAllStatics", {
}, TCIDs: TCIDs,
preservation(){ NewCombinationNum: ''
let that = this; }, (res) => {
uni.canvasToTempFilePath({ if (res.resultCode == 1) {
canvasId: `firstCanvas_${that.current}`, this.BaseInfo = res.data.BaseInfo
success: (res) => { this.TCIDsList = this.TCIDs.split(',')
uni.showLoading({ this.TCIDsList.forEach((x, index) => {
title: "正在保存", this.init(x)
}); });
uni.saveImageToPhotosAlbum({ }
filePath: res.tempFilePath, })
success: function() { },
uni.showToast({ async init(x) {
title: "保存成功", await this.apipostQrCode("", {
}); TCID: x
}, (res) => {
if (res.resultCode == 1) {
let findIndex = this.BaseInfo.findIndex(item => item.TCIDS == x)
this.list.push({
Url: 'data:image/png;base64,' + res.data,
TCID: x,
TCNUMS: this.BaseInfo[findIndex].TCNUMS
})
if (this.list.length == this.TCIDsList.length) {
this.currencyVisible = true
this.list.forEach((x, i) => {
this.drawCtx(i)
})
}
}
})
},
close() {
this.currencyVisible = false
this.$emit('close')
},
drawCtx(i) {
let ctx = uni.createCanvasContext(`firstCanvas_${i}`, this);
let that = this;
ctx.drawImage(that.list[i].Url, 0, 0, 250, 250); //绘制图
that.drawQrCode(ctx)
},
drawQrCode(ctx) {
let that = this;
setTimeout(() => {
ctx.draw(false, () => {
uni.canvasToTempFilePath({
x: 0,
y: 0,
width: 750,
height: 1344,
destWidth: 750.0,
destHeight: 1344.0,
canvasId: "firstCanvas",
success: (res) => {
uni.hideLoading();
// that.tempPic = res.tempFilePath;
},
fail(e) {
uni.hideLoading();
console.log(e);
},
}, },
fail: function(err) { that
if (err.errMsg === "saveImageToPhotosAlbum:fail auth deny") { );
uni.authorize({ });
scope: 'scope.writePhotosAlbum', }, 200)
success: (res) => { },
preservation() {
}, let that = this;
fail: (res) => { uni.canvasToTempFilePath({
uni.showModal({ canvasId: `firstCanvas_${that.current}`,
content: '检测到您没打开保存到相册权限,是否去设置打开?', success: (res) => {
confirmText: "确认", uni.showLoading({
cancelText: '取消', title: "正在保存",
success: (res) => { });
if (res.confirm) { uni.saveImageToPhotosAlbum({
uni.openSetting({ filePath: res.tempFilePath,
success: (res) => { success: function() {
console.log(res); uni.showToast({
if (res.authSetting['scope.writePhotosAlbum']) { title: "保存成功",
that.preservation() });
},
fail: function(err) {
if (err.errMsg === "saveImageToPhotosAlbum:fail auth deny") {
uni.authorize({
scope: 'scope.writePhotosAlbum',
success: (res) => {
},
fail: (res) => {
uni.showModal({
content: '检测到您没打开保存到相册权限,是否去设置打开?',
confirmText: "确认",
cancelText: '取消',
success: (res) => {
if (res.confirm) {
uni.openSetting({
success: (
res
) => {
console
.log(
res
);
if (res
.authSetting[
'scope.writePhotosAlbum'
]
) {
that.preservation()
}
} }
} })
}) } else {
} else { console.log('取消');
console.log('取消'); }
} }
} })
}) }
} })
}) } else {
} else { uni.showToast({
uni.showToast({ title: '保存失败,请稍后重试',
title: '保存失败,请稍后重试', icon: 'none',
icon: 'none', duration: 2000
duration: 2000 })
}) }
} },
}, complete: function() {
complete: function() { uni.hideLoading();
uni.hideLoading(); },
}, });
}); },
}, fail: function(e) {
fail: function(e) { console.log(e);
console.log(e); uni.showToast({
uni.showToast({ title: '生成失败,请稍后重试',
title: '生成失败,请稍后重试', icon: 'none',
icon: 'none', duration: 2000
duration: 2000 })
}) },
}, },
}, this
this );
);
},
}, canvasIdErrorCallback: function(e, index) {
canvasIdErrorCallback: function(e,index) { console.error(e.detail.errMsg, '---index', index);
console.error(e.detail.errMsg,'---index',index); }
} }
} }
}
</script> </script>
\ No newline at end of file
...@@ -143,12 +143,6 @@ ...@@ -143,12 +143,6 @@
<u-icon class="backIcon" name="arrow-left" size="32" color="#FFF"></u-icon> <u-icon class="backIcon" name="arrow-left" size="32" color="#FFF"></u-icon>
</view> </view>
</view> </view>
<!-- <view @click="goback" :style="[titleStyle, { opacity: '100% !important' }]"
style="position: fixed; top: 0; right: 200rpx; padding-right: 6rpx">
<view class="backBox text-center">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638762515984923148.png" />
</view>
</view> -->
<view class="detailsType fz24">{{ dataList.teamType==0?'跟团游':dataList.teamType==1?'小包团':'一日游' }}</view> <view class="detailsType fz24">{{ dataList.teamType==0?'跟团游':dataList.teamType==1?'小包团':'一日游' }}</view>
</view> </view>
<view class="itiner-title" :style="[titleStyle]"> <view class="itiner-title" :style="[titleStyle]">
...@@ -655,6 +649,7 @@ ...@@ -655,6 +649,7 @@
this.priceList = res.data.priceList this.priceList = res.data.priceList
this.formatDay() this.formatDay()
} }
uni.hideLoading();
}, (failed) => { }, (failed) => {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
......
...@@ -341,30 +341,38 @@ ...@@ -341,30 +341,38 @@
VerificationBusList() { VerificationBusList() {
let msg = '' let msg = ''
for (let i = 0; i < this.params.BusList.length; i++) { for (let i = 0; i < this.params.BusList.length; i++) {
let obj = this.params.BusList[i] let obj = this.params.BusList[i];
console.log("bus_obj", obj);
for (let j = 0; j < obj.ReimburseList.ReimburseDetailsList.length; j++) { for (let j = 0; j < obj.ReimburseList.ReimburseDetailsList.length; j++) {
let child = obj.ReimburseList.ReimburseDetailsList[j] let child = obj.ReimburseList.ReimburseDetailsList[j];
if (!this.$utils.checkIsNum(child.UserNum)) {
child.UserNum = 0;
}
if (!this.$utils.checkIsNum(child.UnitPrice)) {
child.UnitPrice = 0;
}
if (msg == '' && if (msg == '' &&
(obj.ReimburseList.CurrencyId == 0 || obj.ReimburseList.CurrencyId == null) && (obj.ReimburseList.CurrencyId == 0 || obj.ReimburseList.CurrencyId == null) &&
(obj.ReimburseList.SettlementType > 0 || obj.ReimburseList.Remarks != '' || (obj.ReimburseList.SettlementType > 0 || obj.ReimburseList.Remarks != '' ||
obj.ReimburseList.VoucherPicList.length > 0 || child.StartPlace != '' || obj.ReimburseList.VoucherPicList.length > 0 || child.StartPlace != '' ||
child.EndPlace != '' || child.UserNum > 0 || child.UnitPrice > 0 || child.UserType) child.EndPlace != '' || child.UserNum > 0 || child.UnitPrice > 0 || child.UserType)
) { ) {
msg = `请选择车辆币种` msg = `请选择[` + obj.UseTime + `]车辆币种`;
} }
if (msg == '' && child.StartPlace == '' && if (msg == '' && child.StartPlace == '' &&
(obj.ReimburseList.SettlementType > 0 || obj.ReimburseList.Remarks != '' || (obj.ReimburseList.SettlementType > 0 || obj.ReimburseList.Remarks != '' ||
obj.ReimburseList.VoucherPicList.length > 0 || obj.ReimburseList.CurrencyId || obj.ReimburseList.VoucherPicList.length > 0 || obj.ReimburseList.CurrencyId ||
child.EndPlace != '' || child.UserNum > 0 || child.UnitPrice > 0 || child.UserType) child.EndPlace != '' || child.UserNum > 0 || child.UnitPrice > 0 || child.UserType)
) { ) {
msg = `请输入车辆出发地` msg = `请输入[` + obj.UseTime + `]车辆出发地`
} }
if (msg == '' && child.EndPlace == '' && if (msg == '' && child.EndPlace == '' &&
(obj.ReimburseList.SettlementType > 0 || obj.ReimburseList.Remarks != '' || (obj.ReimburseList.SettlementType > 0 || obj.ReimburseList.Remarks != '' ||
obj.ReimburseList.VoucherPicList.length > 0 || child.StartPlace != '' || obj.ReimburseList.VoucherPicList.length > 0 || child.StartPlace != '' ||
obj.ReimburseList.CurrencyId || child.UserNum > 0 || child.UnitPrice > 0 || child.UserType) obj.ReimburseList.CurrencyId || child.UserNum > 0 || child.UnitPrice > 0 || child.UserType)
) { ) {
msg = `请输入车辆目的地` msg = `请输入[` + obj.UseTime + `]车辆目的地`
} }
} }
} }
......
...@@ -274,6 +274,17 @@ function checkInteger(value, isMinus) { ...@@ -274,6 +274,17 @@ function checkInteger(value, isMinus) {
return newValue; return newValue;
} }
//判断是否为整数,小数,支持负数
function checkIsNum(str) {
var flag = false;
if (!str) {
str = '';
}
flag = /^-?(\d*.)?\d+$/.test(str);
console.log("checkIsNum", str + '_' + flag);
return flag;
}
export default { export default {
calcContentHeight, calcContentHeight,
SystemInfo, SystemInfo,
...@@ -289,4 +300,5 @@ export default { ...@@ -289,4 +300,5 @@ export default {
goZanYangUrl, goZanYangUrl,
checkInteger, checkInteger,
checkPrice, checkPrice,
checkIsNum,
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment