Commit edb6452a authored by youjie's avatar youjie

下载签证文件

parent d6f3ca9e
<template> <template>
<view class="jz_LineDetail" v-if="dataList.Name"> <view class="jz_LineDetail" v-if="dataList.Name">
<scroll-view scroll-y="true" style="height: 1px; flex: 1; box-sizing: border-box" @scroll="scroll"> <scroll-view scroll-y="true" style="height: 1px; flex: 1; box-sizing: border-box;" @scroll="scroll">
<view class="jz_TopImg"> <view class="jz_TopImg">
<view class="media" :style="{ opacity: 100 - boxOption + '%' }"> <view class="media" :style="{ opacity: 100 - boxOption + '%' }">
<u-swiper :list="[dataList.CoverImageList[0]]" :effect3d="false" :height="535" :interval="5000" :border-radius="0" <u-swiper :list="[dataList.CoverImageList[0]]" :effect3d="false" :height="535" :interval="5000" :border-radius="0"
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<view class="row-sbas-n visaDetailNumBox"> <view class="row-sbas-n visaDetailNumBox">
<view class="visaDetailNum active3 col"> <view class="visaDetailNum active3 col">
<view>停留天数</view> <view>停留天数</view>
<view>{{ dataList.StayDays?dataList.StayDays:'-' }}天</view> <view>{{ dataList.StayDays?dataList.StayDays+'天':'-' }}</view>
</view> </view>
<view class="visaDetailNum active4 col"> <view class="visaDetailNum active4 col">
<view>签证效期</view> <view>签证效期</view>
...@@ -158,10 +158,10 @@ ...@@ -158,10 +158,10 @@
</view> </view>
<view style="display: flex; align-items: center"> <view style="display: flex; align-items: center">
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<button @click="downloadTripPlanHandler" class="jz_ConButton" v-if="d.length>3"> <button @click="showDownload=true" class="jz_ConButton" v-if="dataList.VisaProductInfo&&dataList.VisaProductInfo.DownloadMaterialsFileList.length>0">
<img style="width: 36rpx; height: 38rpx" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1695376860000_131.png" <img style="width: 36rpx; height: 38rpx" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1695376860000_131.png"
alt="" /> alt="" />
<view style="color: #111111; font-size: 22rpx">下载行程</view> <view style="color: #111111; font-size: 22rpx">下载文件</view>
</button> </button>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-ALIPAY --> <!-- #ifdef MP-ALIPAY -->
...@@ -210,6 +210,37 @@ ...@@ -210,6 +210,37 @@
}" @click="showSalePreviwe=false">确定</u-button> }" @click="showSalePreviwe=false">确定</u-button>
</view> </view>
</u-popup> </u-popup>
<u-popup v-model="showDownload" mode="bottom" border-radius="50" length="60%" :safe-area-inset-bottom="true">
<view>
<view style="font-size: 17px;text-align: center;padding: 20px 0;">
下载签证文件
</view>
<scroll-view scroll-x="true" style="width: 100%;height: 43vh;">
<view class="SaleBox">
<view v-for="(item,index) in dataList.VisaProductInfo.DownloadMaterialsFileList"
:key="index"
class="SaleText">
<view>{{ item.Name }}</view>
<view>
<button @click="downloadTripPlanHandler(item)" class="jz_ConButton" v-if="dataList.VisaProductInfo&&dataList.VisaProductInfo.DownloadMaterialsFileList.length>0">
<img style="width: 36rpx; height: 38rpx" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1695376860000_131.png"
alt="" />
<view style="color: #111111; font-size: 22rpx">下载</view>
</button>
</view>
</view>
</view>
</scroll-view>
<u-button size="80" :ripple="true" shape="circle" :custom-style="{
backgroundColor: '#333',
height: '80rpx',
color: '#fff',
fontSize: '14px',
margin: '0 auto',
width: '90vw',
}" @click="showDownload=false">确定</u-button>
</view>
</u-popup>
</view> </view>
</template> </template>
<script> <script>
...@@ -223,7 +254,8 @@ ...@@ -223,7 +254,8 @@
}, },
data() { data() {
return { return {
pageTitle: "线路详情", showDownload: false,
pageTitle: "签证详情",
showStartCities: false, showStartCities: false,
crCount: 1, crCount: 1,
etCount: 0, etCount: 0,
...@@ -396,6 +428,49 @@ ...@@ -396,6 +428,49 @@
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
}, },
methods: { methods: {
downloadTripPlanHandler(item) {
if (this.isDownloading) return;
let that = this
uni.showLoading({
title: '这可能需要30秒,请耐心等待'
})
this.isDownloading = true
let url = item.Url
let fileName = `${item.Name.replace(/\s+/g,"").replaceAll("/","")}`
let suffix = item.Url.split('.')
console.log(fileName, "fileName");
const filePath = wx.env.USER_DATA_PATH + `/${fileName}.${suffix[suffix.length-1]}`
uni.downloadFile({
url: url,
filePath,
success: (res) => {
wx.openDocument({
filePath: filePath,
showMenu: true,
success: fres => {
uni.hideLoading()
that.isDownloading = false
},
fail: fres => {
console.log('downloadTripPlanHandler_打开失败', fres)
that.downloadFailed('打开失败,请重试。如果仍然失败,请联系销售索要签证文件')
},
})
},
fail(err) {
console.log("downloadTripPlanHandler_fail", err)
that.downloadFailed('下载失败,请重试。如果仍然失败,请联系销售索要签证文件' + err)
},
});
},
downloadFailed(msg) {
uni.showToast({
icon: 'none',
title: msg
})
this.isDownloading = false;
},
calcPzCouponHandler(){ calcPzCouponHandler(){
this.couponList.forEach((x)=>{ this.couponList.forEach((x)=>{
if(x.expansionModel.denomination>0){ if(x.expansionModel.denomination>0){
...@@ -1591,6 +1666,7 @@ ...@@ -1591,6 +1666,7 @@
.visaDetailDesBox{ .visaDetailDesBox{
background: #fff; background: #fff;
margin-top: 20rpx; margin-top: 20rpx;
padding-bottom: 40rpx;
} }
.visaDetailDes{ .visaDetailDes{
padding: 0 41rpx; padding: 0 41rpx;
......
<template> <template>
<scroll-view :scroll-y="true" @scroll="scrollHandler" @scrolltoupper="scrollTopHandler" <view>
style="height: 100vh">
<!-- <view class="headStatus" v-if="scrollTop > 50" :style="[
headStyle,
{
zIndex: scrollTop < 10 ? 'unset' : 2,
opacity: scrollTop < 10 ? '100' : scrollTop,
},
]">
<view class="title" v-if="scrollTop > 50">{{ pageTitle }}</view>
</view> -->
<view class="headStatus column" v-if="scrollTop > 50&&false" style="background: #F3F1EF;">
<view class="visa_search relative"
:style="[
headStyle,
{
zIndex: scrollTop < 10 ? 'unset' : 2,
opacity: scrollTop < 10 ? '100' : scrollTop,
},
]">
<view class="search-box" style="padding: 0 30rpx;top: 0;">
<view style="width: 1px; flex: 1;">
<u-search placeholder="输入目的地" v-model="msg.Name" @search="getList(1)" input-align="left" :value="msg.Name"
text-color="#111" bg-color="rgba(0,0,0,0)" :show-action="false"></u-search>
</view>
</view>
</view>
<view style="padding: 0 30rpx 0 30rpx;">
<view class="uDropdownBox row-sbas-n items-center" style="margin-top: 0;border-bottom: 1rpx solid #F3F1EF;">
<view class="uDropdownText col row justify-center" style="text-align: center;"
v-for="(item,index) in optionsTitle" @click="clickType(index)"
:class="[showType==index?'active':'']">
<text>{{ item }}</text>
<u-icon style="margin-left: 5rpx;" :name="showType==index?'arrow-up':'arrow-down'"
:color="showType==index?'#B99846':'#444'" size="30" />
</view>
</view>
</view>
</view>
<view class="visa_Box column"> <view class="visa_Box column">
<view class="visa_search"> <view class="visa_search">
<view class="search-box" style="margin-top: 24rpx;"> <view class="search-box" style="margin-top: 24rpx;">
...@@ -147,7 +108,7 @@ ...@@ -147,7 +108,7 @@
<u-picker mode="selector" v-model="showEntryType" :default-selector="[0]" :range="EntryTypeList" @confirm='(e)=>{changeDown(e,2)}' <u-picker mode="selector" v-model="showEntryType" :default-selector="[0]" :range="EntryTypeList" @confirm='(e)=>{changeDown(e,2)}'
range-key="label" @input="showType=null"></u-picker> range-key="label" @input="showType=null"></u-picker>
<auth v-if="showAuth&&is_show_auth==1" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> <auth v-if="showAuth&&is_show_auth==1" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</scroll-view> </view>
</template> </template>
<script> <script>
import auth from "@/components/auth/index.vue"; import auth from "@/components/auth/index.vue";
......
...@@ -470,7 +470,7 @@ ...@@ -470,7 +470,7 @@
disabled disabled
placeholder="输入" /> placeholder="输入" />
</view> </view>
<view class="addPnum" @click="editNum(2)"> <view class="addPnum" @click="editNum()">
<image style="width: 27rpx;height: 27rpx;display: block;" <image style="width: 27rpx;height: 27rpx;display: block;"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638751245974558349.png" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638751245974558349.png" />
</view> </view>
...@@ -841,39 +841,10 @@ ...@@ -841,39 +841,10 @@
this.initCountry() this.initCountry()
}, },
methods: { methods: {
//计算日历里的节假日
resDate(dates) {
if (dates.length == 0) return;
for (var i = 0; i < dates.length; i++) {
for (var j = 0; j < this.festival.length; j++) {
if (
this.festival[j].year == dates[i].year &&
this.festival[j].month == dates[i].month
) {
for (var k = 0; k < this.festival[j].festival.length; k++) {
if (
dates[i].day==this.festival[j].festival[k].day
) {
dates[i].name = this.festival[j].festival[k].name;
}
}
}
}
}
console.log(dates.length,'=====');
return dates.le;
},
//获取周几
getWeek(date) {
var weekDay = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
var myDate = new Date(Date.parse(date));
return weekDay[myDate.getDay()];
},
editNum(type) { editNum(type) {
if (type == 1) { if (type == 1) {
if(this.orderMsg.AdultPeopleNum>1)this.orderMsg.AdultPeopleNum--; if(this.orderMsg.AdultPeopleNum>1)this.orderMsg.AdultPeopleNum--;
} }else {
if (type == 2) {
this.orderMsg.AdultPeopleNum++; this.orderMsg.AdultPeopleNum++;
} }
this.calcMoney() this.calcMoney()
...@@ -1084,7 +1055,6 @@ ...@@ -1084,7 +1055,6 @@
let dates = getBeforeDate(-res.data.BookAdvance, new Date()) let dates = getBeforeDate(-res.data.BookAdvance, new Date())
this.orderMsg.EnterCountryTime = dates this.orderMsg.EnterCountryTime = dates
// this.setDates()
this.calcMoney() this.calcMoney()
// this.getCouponActivityHandler(res.data) // this.getCouponActivityHandler(res.data)
} }
......
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