|
@@ -3,7 +3,7 @@
|
|
|
<ujp-navbar title="充值"></ujp-navbar>
|
|
|
|
|
|
<view class="discounts" v-if="bannerList.length">
|
|
|
- <u-swiper bg-color="#fff" :img-mode="'scaleToFill'" height="160" :list="bannerList"
|
|
|
+ <u-swiper bg-color="#fff" :img-mode="'scaleToFill'" height="160" :list="bannerList" @click="clickBanner"
|
|
|
:name="'picUrl'">
|
|
|
</u-swiper>
|
|
|
</view>
|
|
@@ -181,6 +181,47 @@
|
|
|
this.getBannerInfo("userinfo")
|
|
|
},
|
|
|
methods: {
|
|
|
+ clickBanner(index, bl, modout) {
|
|
|
+ var uurl = "";
|
|
|
+ var mod = this.bannerList[index]
|
|
|
+ var mod = {}
|
|
|
+ if (modout) {
|
|
|
+ mod = modout;
|
|
|
+ }else{
|
|
|
+ mod =this.bannerList[index]
|
|
|
+ }
|
|
|
+ mod.clickUrl = mod.linkUrl
|
|
|
+
|
|
|
+ if (mod.linkPicUrl && !bl) {
|
|
|
+
|
|
|
+ this.showOss = true;
|
|
|
+ this.showOssImg = mod.linkPicUrl;
|
|
|
+ this.showOssIndex = index;
|
|
|
+
|
|
|
+ } else if (mod.clickUrl == null) {
|
|
|
+
|
|
|
+ } else if (mod.clickUrl.indexOf('http') == 0) {
|
|
|
+
|
|
|
+ window.location = mod.clickUrl + uurl;
|
|
|
+ } else if (mod.clickUrl.slice(-5) == 'login' && this.userId) {
|
|
|
+
|
|
|
+ } else if (mod.clickUrl.indexOf('#/') == 0) {
|
|
|
+ if (mod.clickUrl.indexOf("?") == -1) {
|
|
|
+ mod.clickUrl += '?';
|
|
|
+ }
|
|
|
+ var url = mod.clickUrl.split("#")[1]
|
|
|
+ //window.location = mod.clickUrl;
|
|
|
+ uni.navigateTo({
|
|
|
+ url: url + uurl
|
|
|
+ })
|
|
|
+ } else if (mod.clickUrl == '#' || mod.clickUrl == '') {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: mod.clickUrl + uurl
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
getBannerInfo(code){
|
|
|
|
|
|
newsApi.getBannerInfo(code).then((res) => {
|