12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <template>
- <view>
-
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- getstationCode:null,
- }
- },
- onShow() {
- let stationCode = this.getstationCode
- console.log("show",stationCode)
- if(stationCode){
- this.getstationCode = null
- this.getPamars(stationCode)
- }else{
- console.log("redirect home")
- uni.reLaunch({
- url:'/pages/index/index'
- })
- }
- },
- onLoad(options) {
- console.log("options",options)
- if(options.stationCode){
- this.getstationCode=options.stationCode
- }
- if((decodeURIComponent(options.q)).split("=")[1]){
- this.getstationCode = (decodeURIComponent(options.q)).split("=")[1]
- }
- },
- methods: {
- getPamars(stationCode){
- if(this.$storage.getJson("token")){
- this.$http.getStationExchange({
- stationCode: stationCode
- }).then(res => {
- if (res.code === 0 && res.data) {
- uni.navigateTo({
- url: '/pages/powerExchange/index?stationCode=' +stationCode + '&exchangeNo=' + res.data
- })
- } else {
- uni.navigateTo({
- url: '/pages/public/404?error=' + res.msg
- })
- }
- })
- }else{
- uni.navigateTo({
- url: '/pages/public/login?topage='+stationCode,
- });
- }
- }
- }
- }
- </script>
- <style>
- </style>
|