|
|
@@ -133,6 +133,7 @@
|
|
|
|
|
|
<script>
|
|
|
import Tabbar from '@/components/CusTabbar/index.vue'
|
|
|
+ import { resolveHomeBannerAction } from '@/utils/homeBannerAction.js'
|
|
|
export default {
|
|
|
components:{ Tabbar },
|
|
|
data(){
|
|
|
@@ -216,18 +217,15 @@
|
|
|
})
|
|
|
},
|
|
|
bannerClick(e){
|
|
|
- let banner = this.bannerOrigin[e];
|
|
|
- if(banner&&banner?.redirect){
|
|
|
- if(banner?.redirectType==1){//微信公众号
|
|
|
- uni.navigateTo({
|
|
|
- url:'/pages/webView?src='+banner?.redirect
|
|
|
- })
|
|
|
- }else if(banner?.redirectType==2){//微信小程序
|
|
|
- uni.navigateToMiniProgram({
|
|
|
- appId:banner?.redirect
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ const action = resolveHomeBannerAction(this.bannerOrigin[e])
|
|
|
+ if(!action) return
|
|
|
+ if(action.type==='html') return this.openHtml(action.filename)
|
|
|
+ if(action.type==='web') return uni.navigateTo({
|
|
|
+ url:'/pages/webView?src='+action.url
|
|
|
+ })
|
|
|
+ if(action.type==='miniProgram') return uni.navigateToMiniProgram({
|
|
|
+ appId:action.appId
|
|
|
+ })
|
|
|
},
|
|
|
toTurn(url){
|
|
|
if(!url) return
|