Commit 771f4687 authored by nature's avatar nature

ios

parent 1a5f370f
......@@ -13,7 +13,6 @@ import router from './router'
import App from './App'
import Vuex from 'vuex'
import vuexI18n from 'vuex-i18n'
import PDFJS from 'pdfjs-dist'
import flexible from './common/ydui.flexible'
import components from './components/component'
......@@ -99,7 +98,6 @@ let hlsHttp = {
get: get,
post: post,
}
Vue.prototype.PDFJS = window.PDFJS = hlsHttp
Vue.prototype.hlsHttp = window.hlsHttp = hlsHttp
Vue.prototype.PDFJS = window.PDFJS = PDFJS
......
......@@ -96,164 +96,164 @@
<script>
export default {
name: 'RepayDetail',
filters: {
lengthCheck: function (value) {
if ((value.toString()).length === 1) {
return `0${value}`
} else {
return value
}
},
export default {
name: 'RepayDetail',
filters: {
lengthCheck: function (value) {
if ((value.toString()).length === 1) {
return `0${value}`
} else {
return value
}
},
data () {
return {
lists: [],
pagenum: 1,
hidden: false,
detailInfo: {},
fileArray: [],
},
data () {
return {
lists: [],
pagenum: 1,
hidden: false,
detailInfo: {},
fileArray: [],
}
},
computed: {},
watch: {},
beforeRouteEnter (to, from, next) {
next(vm => {
if (from.name === 'ContractRecords') {
vm.pagenum = 1
vm.detailQuery()
vm.equipQuery()
}
})
},
methods: {
// val: contract_id
toRepayPlans (val) {
this.$router.push({
name: 'RepayPlans',
params: {
contract_id: val,
lease_num: this.detailInfo.lease_num,
},
})
},
computed: {},
watch: {},
beforeRouteEnter (to, from, next) {
next(vm => {
if (from.name === 'ContractRecords') {
vm.pagenum = 1
vm.detailQuery()
vm.equipQuery()
downLoad () {
let vm = this
let url = $config.basePath + 'get_download_app'
let param = {
project_id: vm.$route.params.project_id,
phone: window.localStorage.user_phone,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.fileArray = res.info
vm.fileArray.forEach(i => {
// cordova.InAppBrowser.open(i.fileUrl, '_system', 'location=yes,hideurlbar=no,toolbarposition=top')
// cordova.InAppBrowser.open(i.fileUrl, '_system', 'location=yes')
if (vum.Platform.isAndroid()) { // android终端
window.open(i.fileUrl, '_system', 'location=yes')
} else if (vum.Platform.isIOS() || vum.Platform.isIPad()) { // ios终端
cordova.InAppBrowser.open(i.fileUrl, '_system', 'location=yes,hideurlbar=no,toolbarposition=top')
} else {
window.open(i.fileUrl, '_system', 'location=yes')
}
})
// vm.pdfDownload()
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
methods: {
// val: contract_id
toRepayPlans (val) {
this.$router.push({
name: 'RepayPlans',
params: {
contract_id: val,
lease_num: this.detailInfo.lease_num,
},
})
},
downLoad () {
let vm = this
let url = $config.basePath + 'get_download_app'
let param = {
project_id: vm.$route.params.project_id,
phone: window.localStorage.user_phone,
pdfDownload () {
// 下载pdf文件
let vm = this
vm.fileArray.forEach(element => {
if (element.fileUrl) {
console.log('vm.$refs.pdf' + vm.$refs.pdf)
// debugger
vm.$refs.pdf.downloadPDF(element.fileUrl, element.fileName)
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.fileArray = res.info
vm.fileArray.forEach(i => {
//cordova.InAppBrowser.open(i.fileUrl, '_system', 'location=yes,hideurlbar=no,toolbarposition=top')
//cordova.InAppBrowser.open(i.fileUrl, '_system', 'location=yes')
if(vum.Platform.isAndroid()) { //android终端
window.open(i.fileUrl,"_system","location=yes")
}else if(vum.Platform.isIOS() || vum.Platform.isIPad()) { //ios终端
window.location.href = i.fileUrl;
}else{
window.open(i.fileUrl,"_system","location=yes")
}
})
// vm.pdfDownload()
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
pdfDownload () {
// 下载pdf文件
let vm = this
vm.fileArray.forEach(element => {
if (element.fileUrl) {
console.log('vm.$refs.pdf' + vm.$refs.pdf)
// debugger
vm.$refs.pdf.downloadPDF(element.fileUrl, element.fileName)
}
})
},
// 合同明细
detailQuery () {
let vm = this
let url = $config.basePath + 'con_contract_detial'
let param = {
project_id: vm.$route.params.project_id,
})
},
// 合同明细
detailQuery () {
let vm = this
let url = $config.basePath + 'con_contract_detial'
let param = {
project_id: vm.$route.params.project_id,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.detailInfo = res.info
} else {
hlsPopup.showLongCenter(res.message)
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.detailInfo = res.info
} else {
hlsPopup.showLongCenter(res.message)
})
},
// 设备清单
equipQuery () {
let vm = this
let url = $config.basePath + 'con_equip_list'
let param = {
pagesize: 10,
pagenum: vm.pagenum,
project_id: vm.$route.params.project_id,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.lists = res.lists
if (res.lists.length >= 0 && res.lists.length < 10) {
vm.$refs.scroll.update(true)
} else if (res.lists.length === 10) {
vm.$refs.scroll.update(false)
}
})
},
// 设备清单
equipQuery () {
let vm = this
let url = $config.basePath + 'con_equip_list'
let param = {
pagesize: 10,
pagenum: vm.pagenum,
project_id: vm.$route.params.project_id,
} else {
hlsPopup.showLongCenter(res.message)
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.lists = res.lists
if (res.lists.length >= 0 && res.lists.length < 10) {
vm.$refs.scroll.update(true)
} else if (res.lists.length === 10) {
vm.$refs.scroll.update(false)
}
} else {
hlsPopup.showLongCenter(res.message)
})
},
loadMore () {
let vm = this
let url = $config.basePath + 'con_equip_list'
vm.pagenum++
let param = {
pagesize: 10,
pagenum: vm.pagenum,
project_id: vm.$route.params.project_id,
}
vm.hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
let returnData = []
returnData = res.lists
if (returnData.length === 0) {
vm.$refs.scroll.update(true)
} else if (returnData.length > 0 && returnData.length < 10) {
vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index])
})
vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index])
})
vm.$refs.scroll.update(false)
}
})
},
loadMore () {
let vm = this
let url = $config.basePath + 'con_equip_list'
vm.pagenum++
let param = {
pagesize: 10,
pagenum: vm.pagenum,
project_id: vm.$route.params.project_id,
} else {
hlsPopup.showLongCenter(res.message)
}
vm.hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
let returnData = []
returnData = res.lists
if (returnData.length === 0) {
vm.$refs.scroll.update(true)
} else if (returnData.length > 0 && returnData.length < 10) {
vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index])
})
vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index])
})
vm.$refs.scroll.update(false)
}
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
})
},
}
},
}
</script>
<style lang='less'>
#repay-detail {
......
......@@ -12,7 +12,7 @@
</h-view>
</template>
<script>
//import PDFJS from 'pdfjs-dist'
// import PDFJS from 'pdfjs-dist'
// const Base64 = require('js-base64').Base64
export default {
......
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