Commit 771f4687 authored by nature's avatar nature

ios

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