| | |
| | | ifwt: 0, |
| | | hasinit:false, |
| | | hasbcinit:false, |
| | | isLaunch:false |
| | | |
| | | }, |
| | | onShow: function() { |
| | |
| | | } |
| | | if(!that.globalData.hasbcinit) |
| | | { |
| | | console.log("åå§åç¾å·æä»¶") |
| | | that.bcInit(); |
| | | } |
| | | /* let appInfo = utils.getCacheSync('appInfo') |
| | |
| | | } |
| | | }); |
| | | } |
| | | else{ |
| | | that.globalData.hasbcinit=true; |
| | | } |
| | | }, |
| | | getAppInfo: function() { |
| | | var that = this; |
| | | that.globalData.hasinit=true; |
| | | this.$u.api.comminInt({}).then(e => { |
| | | console.log(e) |
| | | if (e.code != 0) return that.$alert(e.msg) |
| | | that.globalData.hasinit=true; |
| | | if (e.code != 0) |
| | | { |
| | | that.globalData.hasinit=false; |
| | | return that.$alert(e.msg) |
| | | } |
| | | that.globalData.appinfo = e.data.basic |
| | | utils.setCache('appInfo', e.data.basic) |
| | | utils.setCache('baseUrl', this.$u.http.config.baseUrl) |
| | |
| | | } |
| | | } |
| | | // #endif |
| | | }).catch(function(err) {}) |
| | | }).catch(function(err) {that.globalData.hasinit=false;}) |
| | | |
| | | }, |
| | | |
| | |
| | | console.log(e) |
| | | if (e.code == 1) return that.$alert(e.msg); |
| | | var res = e.data.info; |
| | | this.topBannerList = res.topBannerList; |
| | | this.headerColor = this.topBannerList[0].colour; |
| | | if(res.topBannerList&&res.topBannerList.length>0) |
| | | { |
| | | this.topBannerList = res.topBannerList; |
| | | this.headerColor = this.topBannerList[0].colour; |
| | | } |
| | | |
| | | this.singleLineList = res.singleLineList; |
| | | this.doubleLineList = res.doubleLineList; |
| | | this.bottomBannerList = res.bottomBannerList; |
| | |
| | | "nvueCompiler" : "uni-app", |
| | | "compilerVersion" : 3, |
| | | "splashscreen" : { |
| | | "alwaysShowBeforeRender" : true, |
| | | "waiting" : true, |
| | | "alwaysShowBeforeRender" : false, |
| | | "waiting" : false, |
| | | "autoclose" : true, |
| | | "delay" : 0 |
| | | }, |
| | |
| | | } |
| | | }, |
| | | "splashscreen" : { |
| | | "androidStyle" : "default", |
| | | "androidStyle" : "common", |
| | | "android" : { |
| | | "hdpi" : "E:/OPProject/åçç¨_å¿å /å¼å±/å¼å±å°.png", |
| | | "xhdpi" : "E:/OPProject/å¾ç/å¼å±/å¼å±ä¸.png", |
| | |
| | | "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" |
| | | }, |
| | | "pages": [ |
| | | { |
| | | "path": "pages/index/launchPage" |
| | | }, |
| | | //é¦é¡µ |
| | | { |
| | | "path": "pages/index/index", |
| | |
| | | pageSize: 10, |
| | | page: this.pageCurrent, |
| | | }).then(e => { |
| | | console.log(e); |
| | | if(e.code != 0)return that.$alert(e.msg) |
| | | var res = e.data; |
| | | if(res.list==null) |
| | | { |
| | | that.pageCurrent++ |
| | | that.canloadmore = false |
| | | that.loadstatus = 'nomarl' |
| | | return; |
| | | } |
| | | if (res.list < 10) { |
| | | that.pageCurrent++ |
| | | that.canloadmore = false |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view v-if="list&&list.length>0"> |
| | | <m-start-ad :list="list" v-on:pgoUrl="goUrl" :time="time" url="/pages/index/index" /> |
| | | </view> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import utils from "../../utils/utils.js" |
| | | export default { |
| | | data() { |
| | | return { |
| | | list:[], |
| | | time:5 |
| | | }; |
| | | }, |
| | | |
| | | onShow: function () { |
| | | |
| | | var first = getApp().globalData.isLaunch; |
| | | if(first){ |
| | | uni.reLaunch({ |
| | | url: "/pages/index/index" |
| | | }); |
| | | } else { |
| | | |
| | | getApp().globalData.isLaunch=true; |
| | | var that = this; |
| | | this.$u.api.getBanner({ |
| | | type: '1,15' |
| | | }).then(e => { |
| | | |
| | | console.log(e) |
| | | if (e.code == 1) |
| | | {//è¿å失败ï¼ç´æ¥è·³é¦é¡µ |
| | | this.t_index(); |
| | | return; |
| | | } |
| | | var res = e.data.info; |
| | | if(res.launchpic&&res.launchpic.length>0) |
| | | { |
| | | that.list=res.launchpic; |
| | | } |
| | | else{ |
| | | console.log("跳转") |
| | | this.t_index(); |
| | | } |
| | | }).catch(function(err) { |
| | | console.log(err); |
| | | this.t_index(); |
| | | }) |
| | | } |
| | | }, |
| | | methods: { |
| | | goUrl(info) { |
| | | if (info.url_type == 1&&info.parameter_json.url=="/pages/index/index") |
| | | { |
| | | uni.reLaunch({ |
| | | url: './index' |
| | | }) |
| | | } |
| | | else{ |
| | | utils.goUrl(info, this) |
| | | } |
| | | }, |
| | | t_index() |
| | | { |
| | | uni.reLaunch({ |
| | | url: "/pages/index/index" |
| | | }); |
| | | /* setTimeout(()=>{ |
| | | |
| | | }, 500); */ |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | ## 1.0.1ï¼2022-11-11ï¼ |
| | | ä¿®æ¹ææ¡£æè¿° |
| | | ## 1.0.0ï¼2022-11-11ï¼ |
| | | 忬¡çæ¬åå¸ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view class="start" v-if="show"> |
| | | <view class="skip" :style="skipPositionStyle" @click="onSkip">è·³è¿ {{time2}}</view> |
| | | <swiper class="swiper" :interval="interval" @change="onChangeSwiper"> |
| | | <swiper-item v-for="(item, index) in list" :key="index"> |
| | | <view class="swiper-item" :style="'background:'+ item.colour +';'" @click="goUrl(item)"> |
| | | <image class="image" :src="item.image" mode="widthFix"></image> |
| | | <view class="after" :style="afterStyle"></view> |
| | | </view> |
| | | </swiper-item> |
| | | <!-- autoplay --> |
| | | </swiper> |
| | | <view class="swiper-dot" v-if="list.length>1"> |
| | | <view class="view" :style="index === current ? currentStyle : ''" :class="{'active': index === current}" |
| | | v-for="(item, index) in list" :key="index" /> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | list: { |
| | | type: Array, |
| | | default () { |
| | | return [] |
| | | }, |
| | | required: true |
| | | }, |
| | | hasTabbar: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | hasNavbar: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | interval: { |
| | | type: Number, |
| | | default: 3000 |
| | | }, |
| | | time: { |
| | | type: Number, |
| | | default: 3 |
| | | }, |
| | | url: { |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | bgColor: { |
| | | type: String, |
| | | default: '#BB1219' |
| | | }, |
| | | afterColor: { |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | currentColor: { |
| | | type: String, |
| | | default: '#BB1219' |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | current: 0, |
| | | show: true, |
| | | timer: null, |
| | | time2: this.time |
| | | } |
| | | }, |
| | | watch: { |
| | | time2(val) { |
| | | if (val <= 0) { |
| | | this.onSkip() |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | bgStyle() { |
| | | return this.obj2strStyle({ |
| | | 'background-color': this.bgColor |
| | | }) |
| | | }, |
| | | afterStyle() { |
| | | return this.obj2strStyle({ |
| | | 'background-color': this.afterColor |
| | | }) |
| | | }, |
| | | currentStyle() { |
| | | return this.obj2strStyle({ |
| | | 'background-color': this.currentColor |
| | | }) |
| | | }, |
| | | skipPositionStyle() { |
| | | const { |
| | | statusBarHeight |
| | | } = uni.getSystemInfoSync() |
| | | if (!this.hasNavbar) { |
| | | return this.obj2strStyle({ |
| | | 'top': `${statusBarHeight*2 + 88 + 30}rpx` |
| | | }) |
| | | } |
| | | return this.obj2strStyle({ |
| | | 'top': '30rpx' |
| | | }) |
| | | } |
| | | }, |
| | | mounted() { |
| | | if (this.hasTabbar) { |
| | | uni.hideTabBar() |
| | | } |
| | | this.timer = setInterval(() => { |
| | | this.time2-- |
| | | }, 1000) |
| | | }, |
| | | methods: { |
| | | obj2strStyle(obj) { |
| | | let style = '' |
| | | for (let key in obj) { |
| | | style += `${key}:${obj[key]};` |
| | | } |
| | | return style |
| | | }, |
| | | goUrl(item) |
| | | { |
| | | this.$emit("pgoUrl",item); |
| | | }, |
| | | onSkip() { |
| | | const { |
| | | url, |
| | | hasTabbar, |
| | | timer |
| | | } = this |
| | | clearTimeout(timer) |
| | | this.show = false |
| | | if (hasTabbar) { |
| | | uni.showTabBar() |
| | | } |
| | | if (url) { |
| | | uni.reLaunch({ |
| | | url: url, |
| | | }) |
| | | } |
| | | }, |
| | | onChangeSwiper(e) { |
| | | this.current = e.detail.current |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /* $nav-height: 44px; */ |
| | | .start { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | z-index: 9999; |
| | | } |
| | | |
| | | .skip { |
| | | position: absolute; |
| | | z-index: 2; |
| | | background-color: rgba(0, 0, 0, 0.1); |
| | | color: #fff; |
| | | right: 30rpx; |
| | | font-size: 28rpx; |
| | | width: 133rpx; |
| | | height: 60rpx; |
| | | border-radius: 44rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .swiper { |
| | | height: 100vh; |
| | | width: 100vw; |
| | | } |
| | | |
| | | .swiper-item { |
| | | height: 100vh; |
| | | width: 100vw; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | overflow: hidden; |
| | | background-color: transparent; |
| | | } |
| | | |
| | | .swiper-item .after { |
| | | width: 100vw; |
| | | height: 500rpx; |
| | | position: absolute; |
| | | left: 0; |
| | | bottom: 0; |
| | | z-index: 1; |
| | | } |
| | | |
| | | .swiper-item .image { |
| | | height: 100vh; |
| | | width: 100vw; |
| | | display: block; |
| | | position: relative; |
| | | z-index: 2; |
| | | } |
| | | |
| | | .swiper-dot { |
| | | position: absolute; |
| | | width: 100vw; |
| | | left: 0; |
| | | bottom: 100rpx; |
| | | z-index: 3; |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .swiper-dot .view { |
| | | width: 16rpx; |
| | | height: 16rpx; |
| | | border-radius: 100%; |
| | | background-color: rgba(0, 0, 0, 0.2); |
| | | margin: 0 12rpx; |
| | | } |
| | | |
| | | .swiper-dot .view.active { |
| | | width: 30rpx; |
| | | border-radius: 24rpx; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "id": "m-start-ad", |
| | | "displayName": "start-adå¼å±å¹¿å", |
| | | "version": "1.0.1", |
| | | "description": "èªå®ä¹å¼å±å¹¿å", |
| | | "keywords": [ |
| | | "startãå¼å±ãå¼å±å¹¿å" |
| | | ], |
| | | "repository": "", |
| | | "engines": { |
| | | "HBuilderX": "^3.2.12" |
| | | }, |
| | | "dcloudext": { |
| | | "type": "component-vue", |
| | | "sale": { |
| | | "regular": { |
| | | "price": "0.00" |
| | | }, |
| | | "sourcecode": { |
| | | "price": "0.00" |
| | | } |
| | | }, |
| | | "contact": { |
| | | "qq": "" |
| | | }, |
| | | "declaration": { |
| | | "ads": "æ ", |
| | | "data": "æ ", |
| | | "permissions": "æ " |
| | | }, |
| | | "npmurl": "" |
| | | }, |
| | | "uni_modules": { |
| | | "dependencies": [], |
| | | "encrypt": [], |
| | | "platforms": { |
| | | "cloud": { |
| | | "tcb": "y", |
| | | "aliyun": "y" |
| | | }, |
| | | "client": { |
| | | "Vue": { |
| | | "vue2": "y", |
| | | "vue3": "y" |
| | | }, |
| | | "App": { |
| | | "app-vue": "y", |
| | | "app-nvue": "y" |
| | | }, |
| | | "H5-mobile": { |
| | | "Safari": "y", |
| | | "Android Browser": "y", |
| | | "微信æµè§å¨(Android)": "y", |
| | | "QQæµè§å¨(Android)": "y" |
| | | }, |
| | | "H5-pc": { |
| | | "Chrome": "y", |
| | | "IE": "y", |
| | | "Edge": "y", |
| | | "Firefox": "y", |
| | | "Safari": "y" |
| | | }, |
| | | "å°ç¨åº": { |
| | | "微信": "y", |
| | | "é¿é": "y", |
| | | "ç¾åº¦": "y", |
| | | "åèè·³å¨": "y", |
| | | "QQ": "y", |
| | | "éé": "y", |
| | | "å¿«æ": "y", |
| | | "é£ä¹¦": "y", |
| | | "京ä¸": "y" |
| | | }, |
| | | "å¿«åºç¨": { |
| | | "å为": "y", |
| | | "èç": "y" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | # m-start-ad |
| | | |
| | | å¿«éå¶ä½ä¸ä¸ªèªå®ä¹å¼å±å¹¿åï¼æ¯æè½®æ |
| | | |
| | | ### 屿§è¯´æ |
| | | |
| | | | 屿§å | ç±»å | é»è®¤å¼ | å¿
å¡« | 说æ | |
| | | | ------- | ------- | ------- | ------- | ------- | |
| | | | list | Array | [] | true | å¼å±å¾çå表 | |
| | | | hasTabbar | Boolean | false | false | 页é¢åå¨åçtabbarï¼ç»ä»¶ä¼èªå¨å¤æéètabbar | |
| | | | hasNavbar | Boolean | false | false | 页颿¯å¦å
å«navbar | |
| | | | interval | Number | 3000 | false | è½®æèªå¨ææ¾æ¶é´ï¼å¤å¾æ¶å¯ç¨ï¼ | |
| | | | time | Number | 3 | false | å计æ¶è·³è¿ | |
| | | | url | String | '' | false | æ¶é´å计æ¶ç»æå跳转å°å,妿æ¯tabbar页é¢ï¼å¯ä¸ºç©º | |
| | | | bgColor | String | '#BB1219' | false | 页é¢çèæ¯é¢è², å¼å±å¾ç为èªå¨åç´å±
ä¸ï¼å¨å¤§å±å¹ææºä¸ï¼æäºæ¶åé«åº¦ä¸å¤çæ
åµä¸ï¼ä¼é æä¸ä¸çç½ï¼ä½¿ç¨æ¤å±æ§å¯ä»¥å¡«å
èæ¯è² | |
| | | | afterColor | String | '' | false | 页é¢åºé¨èæ¯è²å¡«å
ï¼æäºæ¶å设置ä¼è®¾è®¡æ¸åè²å¾çï¼å¦æåªä½¿ç¨bgcoloræ æ³è§£å³éæ±ï¼æ¤æ¶å®ä¹æ¤å±æ§ï¼å¯å¨æä¸é¢å¡«å
é¢è²ï¼ä»¥è¾¾å°é¢è²è¿åº¦ææ | |
| | | | currentColor | String | '#BB1219' | false | å®ä¹dotå½åç¶æé¢è², listé¿åº¦å¤§äº1å¯è§ | |
| | | |
| | | |
| | | ### å¦ä½åèªå®ä¹å¼å±çé¢ |
| | | |
| | | #### æ¹å¼ä¸ |
| | | 1ãæ°å»ºä¸ä¸ªæ°é¡µé¢ pages/start |
| | | 2ãä¿®æ¹pages.jsé
ç½®æä»¶ï¼æstartå°åæ¾å¨æå |
| | | ``` |
| | | { |
| | | "pages": [ |
| | | { |
| | | "path" : "pages/start", //page第ä¸é¡µå°±æ¯å¼å±ç¬¬ä¸ä¸ªé¡µé¢ |
| | | "style" : |
| | | { |
| | | "navigationBarTitleText": "", |
| | | "navigationStyle": "custom" //åæ¶é»è®¤å¯¼èªåå°æ»¡å±ææ |
| | | } |
| | | |
| | | } |
| | | ] |
| | | } |
| | | ``` |
| | | 3ã页é¢å¼å
¥ç»ä»¶ï¼ä¼ å
¥list, url |
| | | |
| | | ### ä½¿ç¨æ¹å¼ |
| | | ``` |
| | | <template> |
| | | <m-start-ad :list="list" url="pages/index/index" /> |
| | | </template> |
| | | |
| | | ``` |
| | | |
| | | #### æ¹å¼äº |
| | | 1ã页é¢å
³éåçå¯¼èª |
| | | ``` |
| | | { |
| | | "pages": [ |
| | | { |
| | | "path" : "pages/index/index", |
| | | "style" : |
| | | { |
| | | "navigationBarTitleText": "", |
| | | "navigationStyle": "custom" //åæ¶é»è®¤å¯¼èªåå°æ»¡å±ææ |
| | | } |
| | | |
| | | } |
| | | ] |
| | | } |
| | | ``` |
| | | 1ã页é¢ç´æ¥ä½¿ç¨ |
| | | ``` |
| | | <m-start-ad :list="list" /> |
| | | ``` |
| | | 2ãå计æ¶ç»æåï¼èªå¨éèç»ä»¶ï¼æ éæä½ï¼ |
| | | |
| | | |
| | | ### æ¹å¼å¯¹æ¯ |
| | | |å¯¹æ¯ | ä¼ç¹ | ç¼ºç¹ | |
| | | | ------- | ------- |------- | |
| | | | æ¹å¼ä¸ | ææé¡µé¢é½å¯ä»¥å
¬ç¨ | 妿å
页éè¦tabbar,éè¦èªå®ä¹ | |
| | | | æ¹å¼äº | æéé
ç½® | æ æ³æ§å¶navbarï¼éè¦èªå®ä¹ | |
| | |
| | | url: '/pages/webView/webView?url=' + info.parameter_json.url |
| | | }) |
| | | } else if (info.url_type == 1) { |
| | | console.log("è¿æ¥äº1·11111111111") |
| | | let url = info.parameter_json.url == undefined ? '' : info.parameter_json.url; |
| | | console.log(url) |
| | | if(url == '') return false; |
| | | uni.navigateTo({ |
| | | url: url |