| | |
| | | var route = routes[routes.length - 1].route |
| | | } |
| | | // #ifdef APP-PLUS |
| | | if (this.globalData.canlisten && route != 'pages/mine/tools/turnChain') { |
| | | if (this.globalData.canlisten && route != 'pages/mine/tools/turnChain'&&route!='pages/rankinglist/compareprice') { |
| | | getClipboard() |
| | | } |
| | | |
| | |
| | | dybanner:[], |
| | | pddbanner:[], |
| | | wphbanner:[], |
| | | haspreference:false, |
| | | preferData:{}, |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | }, |
| | | created() { |
| | | this._freshing = false; |
| | | this.changeRecommend(); |
| | | //this.changeRecommend(); |
| | | this.checkPreferenceGoods(); |
| | | uni.$emit('initpage') |
| | | this.getBannerInfo(); |
| | | this.getHomeMenuList(); |
| | | this.getrecommendGoods(); |
| | | this.getbottomGoodsList(this.bottomType); |
| | | //this.getbottomGoodsList(this.bottomType); |
| | | this.getGOODSfalling(); |
| | | this.getRQList(); |
| | | //this.getPageImg(); |
| | |
| | | }, 1500) |
| | | }, |
| | | methods: { |
| | | checkPreferenceGoods() |
| | | {//æ¯å¦ææ¨è |
| | | var that = this; |
| | | var tmp_1 = { |
| | | mainTitle: '天ç«', |
| | | subTitle: '天ç«çé', |
| | | type: 5 |
| | | }; |
| | | var tmp_2 = { |
| | | mainTitle: '天ç«', |
| | | subTitle: 'ä¸ºä½ æ¨è', |
| | | type: 1 |
| | | }; |
| | | var tmp_3= { |
| | | mainTitle: 'æ¨è', |
| | | subTitle: 'çä½ åæ¬¢', |
| | | type: 7 |
| | | }; |
| | | var open_like_recommend = uni.getStorageSync('open_like_recommend'); |
| | | if(this.typedataList.length == 5)this.typedataList.shift() |
| | | if(open_like_recommend == 1){ |
| | | this.typedataList.unshift(tmp_2); |
| | | this.bottomType = tmp_2.type; |
| | | }else{ |
| | | this.typedataList.unshift(tmp_1); |
| | | this.bottomType = tmp_1.type; |
| | | } |
| | | this.$u.api.checkPreferenceGoods({ |
| | | }).then(e => { |
| | | if(e.code != 0) |
| | | { |
| | | that.currentPage = 1; |
| | | that.getbottomGoodsList(that.bottomType); |
| | | return; |
| | | }; |
| | | if(e.data&&e.data.p_cids) |
| | | {//æå好 |
| | | that.preferData=e.data; |
| | | that.typedataList.unshift(tmp_3); |
| | | that.bottomType = tmp_3.type; |
| | | //å»é¤å¯åä¼ |
| | | that.typedataList = that.typedataList.filter(function(item) {return item.type !== 4}); |
| | | } |
| | | that.currentPage = 1; |
| | | that.getbottomGoodsList(that.bottomType); |
| | | }).catch(function (err) { |
| | | this.changeRecommend(); |
| | | }) |
| | | }, |
| | | changeRecommend(){ |
| | | var tmp_1 = { |
| | | mainTitle: '天ç«', |
| | |
| | | type: 5 |
| | | }; |
| | | var tmp_2 = { |
| | | mainTitle: 'æ¨è', |
| | | mainTitle: '天ç«', |
| | | subTitle: 'ä¸ºä½ æ¨è', |
| | | type: 1 |
| | | }; |
| | |
| | | }, |
| | | getbottomGoodsList(type) { |
| | | var that = this; |
| | | this.$u.api.getGoodThing({ |
| | | deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < 10 ? |
| | | 'IMEI' : 'OAID') : 'IDFA', |
| | | deviceValue: getApp().globalData.equipmentNumber, |
| | | pageId: 1, |
| | | pageSize: 10, |
| | | type: type |
| | | }).then(e => { |
| | | if (e.code != 0) return that.$alert(e.msg) |
| | | var res = e.data.list; |
| | | if (res.length < 10) { |
| | | that.loadingState = false |
| | | that.loadstatus = 'normal' |
| | | } else { |
| | | that.currentPage++ |
| | | that.loadstatus = 'loading' |
| | | that.loadingState = true |
| | | } |
| | | that.bottomGoodsList = res |
| | | }).catch(function(err) {}) |
| | | }, |
| | | |
| | | getNextPage() { |
| | | if (this.loadingState) { |
| | | this.loadingState = false |
| | | var that = this; |
| | | if(type==7&&that.preferData) |
| | | {//çä½ åæ¬¢ |
| | | this.$u.api.gussessLikeGoods({ |
| | | platefrom:that.preferData.p_platefrom, |
| | | cids:that.preferData.p_cids, |
| | | pageId:1, |
| | | pageSize:10 |
| | | }).then(e=>{ |
| | | console.log(e); |
| | | var res = e.data.list; |
| | | if (res.length < 10) { |
| | | that.loadingState = false |
| | | that.loadstatus = 'normal' |
| | | } else { |
| | | that.currentPage++ |
| | | that.loadstatus = 'loading' |
| | | that.loadingState = true |
| | | } |
| | | that.bottomGoodsList = res |
| | | }) |
| | | } |
| | | else |
| | | { |
| | | this.$u.api.getGoodThing({ |
| | | deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < |
| | | 10 ? 'IMEI' : 'OAID') : 'IDFA', |
| | | deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < 10 ? |
| | | 'IMEI' : 'OAID') : 'IDFA', |
| | | deviceValue: getApp().globalData.equipmentNumber, |
| | | pageId: this.currentPage, |
| | | pageId: 1, |
| | | pageSize: 10, |
| | | type: this.bottomType |
| | | type: type |
| | | }).then(e => { |
| | | if (e.code != 0) return that.$alert(e.msg) |
| | | var res = e.data.list; |
| | |
| | | that.loadstatus = 'loading' |
| | | that.loadingState = true |
| | | } |
| | | that.bottomGoodsList = that.bottomGoodsList.concat(res) |
| | | that.bottomGoodsList = res |
| | | }).catch(function(err) {}) |
| | | } |
| | | }, |
| | | |
| | | getNextPage() { |
| | | if (this.loadingState) { |
| | | this.loadingState = false |
| | | var that = this; |
| | | |
| | | if(that.currentPage==7&&that.preferData) |
| | | {//çä½ åæ¬¢ |
| | | this.$u.api.gussessLikeGoods({ |
| | | platefrom:that.preferData.p_platefrom, |
| | | cids:that.preferData.p_cids, |
| | | pageId:this.currentPage, |
| | | pageSize:10 |
| | | }).then(e=>{ |
| | | console.log(e) |
| | | }) |
| | | } |
| | | else{ |
| | | this.$u.api.getGoodThing({ |
| | | deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < |
| | | 10 ? 'IMEI' : 'OAID') : 'IDFA', |
| | | deviceValue: getApp().globalData.equipmentNumber, |
| | | pageId: this.currentPage, |
| | | pageSize: 10, |
| | | type: this.bottomType |
| | | }).then(e => { |
| | | if (e.code != 0) return that.$alert(e.msg) |
| | | var res = e.data.list; |
| | | if (res.length < 10) { |
| | | that.loadingState = false |
| | | that.loadstatus = 'normal' |
| | | } else { |
| | | that.currentPage++ |
| | | that.loadstatus = 'loading' |
| | | that.loadingState = true |
| | | } |
| | | that.bottomGoodsList = that.bottomGoodsList.concat(res) |
| | | }).catch(function(err) {}) |
| | | } |
| | | } |
| | | }, |
| | | |
| | | switchtype(info, idx) { |
| | | if (this.bottomCurrent != idx) { |
| | | this.currentPage = 1; |
| | |
| | | } |
| | | } |
| | | }, |
| | | // æ¯ä»· |
| | | { |
| | | "path": "pages/rankinglist/compareprice", |
| | | "style": { |
| | | "navigationStyle": "custom", |
| | | "app-plus": { |
| | | "titleNView": false |
| | | } |
| | | } |
| | | }, |
| | | // çº¿æ¥ |
| | | { |
| | | "path": "pages/rankinglist/xianbao", |
| | |
| | | "text": "ç¯æ¢æ¦" |
| | | }, |
| | | { |
| | | "pagePath": "pages/rankinglist/compareprice", |
| | | "iconPath": "static/images/tabBar/ne_bend.png", |
| | | "selectedIconPath": "static/images/tabBar/ne_bend_act.png", |
| | | "text": "æ¯ä»·" |
| | | }, |
| | | { |
| | | "pagePath": "pages/rankinglist/xianbao", |
| | | "iconPath": "static/images/tabBar/ne_xb.png", |
| | | "selectedIconPath": "static/images/tabBar/ne_xb_act.png", |
| | | "text": "线æ¥" |
| | | }, |
| | | { |
| | | /* { |
| | | "pagePath": "pages/community/community", |
| | | "iconPath": "static/images/tabBar/ne_bend.png", |
| | | "selectedIconPath": "static/images/tabBar/ne_bend_act.png", |
| | | "text": "æ¬å°çæ´»" |
| | | }, |
| | | }, */ |
| | | |
| | | { |
| | | "pagePath": "pages/mine/mine", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view> |
| | | <web-view v-if="webshow" :webview-styles="webviewStyles" :src="webviewUrl" @message='received'></web-view> |
| | | <!-- taobao --> |
| | | <u-popup v-model="empowerModel" mode="center" border-radius="12"> |
| | | <empowerModel @closemodel='closeMdl' @updataInfo='updataUser'></empowerModel> |
| | | </u-popup> |
| | | </view> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import empowerModel from '../../components/empowerModel.vue' |
| | | var wv; |
| | | export default { |
| | | components: { |
| | | empowerModel |
| | | }, |
| | | data() { |
| | | return { |
| | | webshow:true, |
| | | empowerModel: false, |
| | | webviewUrl: '', |
| | | user:'', |
| | | webviewStyles: { |
| | | progress: { |
| | | color: '#EE1B14' |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | | if(!this.hasLogin){ |
| | | uni.reLaunch({ |
| | | url:"/pages/login/wxlogin" |
| | | }) |
| | | } |
| | | else{ |
| | | const value = uni.getStorageSync('userInfo'); |
| | | console.log(value) |
| | | this.webviewUrl = encodeURI('https://appapitest.ushopvip.com/html/compareprice.html?token='+value.token); |
| | | } |
| | | |
| | | }, |
| | | onReady() { |
| | | this.clearMuiBack(); |
| | | }, |
| | | methods: { |
| | | |
| | | received(e) { |
| | | var res=e.detail.data[0]; |
| | | console.log(res); |
| | | switch(res.action) |
| | | { |
| | | case "back"://è¿å |
| | | this.backLast(); |
| | | break; |
| | | case "tbauth"://æ·å®ææ |
| | | this.openTbMd(); |
| | | break; |
| | | case "totb": |
| | | this.targetTb(res.tburl); |
| | | break; |
| | | case "copy": |
| | | this.getCopyTxt(); |
| | | break; |
| | | case "getlike": |
| | | this.getLike(); |
| | | break; |
| | | } |
| | | }, |
| | | getLike() |
| | | { |
| | | console.log('è¿æ¥äº'); |
| | | var postData={ |
| | | deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < 10 ? 'IMEI' : 'OAID') : |
| | | 'IDFA', |
| | | deviceValue: getApp().globalData.equipmentNumber |
| | | }; |
| | | console.log(postData); |
| | | var currentWebview = this.$scope.$getAppWebview().children()[0]; |
| | | currentWebview.evalJS(`likeDataGet(${JSON.stringify(postData)})`); |
| | | }, |
| | | getCopyTxt() |
| | | { |
| | | uni.getClipboardData({ |
| | | success: res => { |
| | | //è°ç¨é¡µé¢éçæ¹æ³ |
| | | console.log(res, '======================================================'); |
| | | var currentWebview = this.$scope.$getAppWebview().children()[0]; |
| | | currentWebview.evalJS(`scanCode(${JSON.stringify(res)})`); |
| | | } |
| | | }) |
| | | }, |
| | | targetTb(tburl) |
| | | { |
| | | // #ifdef APP-PLUS |
| | | if (plus.runtime.isApplicationExist({ |
| | | pname: 'com.taobao.taobao', |
| | | action: 'taobao://' |
| | | })) { |
| | | const plug = uni.requireNativePlugin('xiguazhu-baichuan') |
| | | plug.detailPage({ |
| | | url: tburl, |
| | | "openType": 0 |
| | | }, result => { |
| | | }); |
| | | } else { |
| | | uni.navigateTo({ |
| | | url:'@/webView/webView?url=' + tburl |
| | | }) |
| | | } |
| | | // #endif |
| | | }, |
| | | backLast() |
| | | { |
| | | console.log("è¿å") |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }); |
| | | }, |
| | | closeMdl() { |
| | | this.empowerModel = false; |
| | | this.webshow=true; |
| | | }, |
| | | openTbMd() |
| | | { |
| | | this.webshow=false; |
| | | this.empowerModel = true |
| | | }, |
| | | updataUser() { |
| | | var that = this; |
| | | this.$u.api.getUserInfo({}).then(e => { |
| | | utils.setCache('userInfo', e.data.userinfo) |
| | | that.user = e.data.userinfo; |
| | | }).catch(function(err) {}) |
| | | }, |
| | | // å
³émuiè¿å |
| | | clearMuiBack() { |
| | | // #ifdef APP-PLUS |
| | | /* var currentWebview = this.$scope.$getAppWebview().children()[0]; |
| | | //ç嬿³¨å
¥çjs |
| | | currentWebview.addEventListener("loaded", function() { |
| | | currentWebview.evalJS("mui.init({keyEventBind: {backbutton: false }});"); |
| | | }); */ |
| | | // #endif |
| | | }, |
| | | |
| | | }, |
| | | onNavigationBarButtonTap(e) { |
| | | // #ifdef APP-PLUS |
| | | const currentWebview = this.$scope.$getAppWebview(); //æ¤å¯¹è±¡ç¸å½äºhtml5pluséçplus.webview.currentWebview()ãå¨uni-appévue页é¢ç´æ¥ä½¿ç¨plus.webview.currentWebview()æ æï¼év3ç¼è¯æ¨¡å¼ä½¿ç¨this.$mp.page.$getAppWebview() |
| | | var wv = currentWebview.children()[0] |
| | | wv.reload(); |
| | | // #endif |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | |
| | | </style> |
| | |
| | | sort: this.sortType, |
| | | selectCoupon: this.selectCoupon == true ? 1 : 0 |
| | | }).then(e => { |
| | | console.log(e); |
| | | if (e.code != 0) return that.$alert(e.msg) |
| | | var res = e.data; |
| | | uni.stopPullDownRefresh(); |
| | |
| | | var res = e.data; |
| | | callback(res) |
| | | }).catch(function (err) { |
| | | console.log(err) |
| | | }) |
| | | }else{ |
| | | getApp().globalData.hasMode = false |
| | |
| | | const viewContentWidth = parseInt(popupViewWidth - viewContentPadding * 2); |
| | | // æ¾ç¤ºå¼¹çª |
| | | maskLayers.show(); |
| | | |
| | | try{ |
| | | if (data.goodsId) { |
| | | let sLeft = 0; |
| | | let popupViewHeight = popupViewWidth + uni.upx2px(390); |
| | |
| | | getApp().globalData.hasMode = false |
| | | } |
| | | }); |
| | | } |
| | | catch(e) |
| | | { |
| | | console.log(e); |
| | | maskLayers.hide(); |
| | | } |
| | | } |
| | | |
| | | export default () => { |
| | |
| | | let getRecomInviterUrl="/api/user/getRecomInviter"; |
| | | let updateFirstFreeBrowseUrl="/api/user/update_first_free_browse"; |
| | | let updateCidUrl="/api/user/UpdateClientId"; |
| | | let checkPreferenceGoodsUrl="/api/user/check_preference_goods"; |
| | | let gussessLikeGoodsUrl="/api/taoke/gussess_like_goods"; |
| | | |
| | | |
| | | // æ¤å¤ç¬¬äºä¸ªåæ°vmï¼å°±æ¯æä»¬å¨é¡µé¢ä½¿ç¨çthisï¼ä½ å¯ä»¥éè¿vmè·åvuexçæä½ï¼æ´å¤å
容详è§uViewå¯¹æ¦æªå¨çä»ç»é¨åï¼ |
| | | // https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F |
| | |
| | | let getRecomInviter=(params = {}) => vm.$u.post(getRecomInviterUrl, params); //è·åæ¨èé请人 |
| | | let updateFirstFreeBrowse=(params = {}) => vm.$u.post(updateFirstFreeBrowseUrl, params); //è®°å½0å
è´ |
| | | let updateCid=(params={})=>vm.$u.post(updateCidUrl,params);//æ´æ°pushcid |
| | | let checkPreferenceGoods=(params={})=>vm.$u.post(checkPreferenceGoodsUrl,params);//æ£æµæ¯å¦æå好åå |
| | | let gussessLikeGoods=(params={})=>vm.$u.post(gussessLikeGoodsUrl,params);//é¦é¡µçä½ åæ¬¢ |
| | | |
| | | // å°å个å®ä¹çæ¥å£åç§°ï¼ç»ä¸æ¾è¿å¯¹è±¡æè½½å°vm.$u.api(å 为vmå°±æ¯thisï¼ä¹å³this.$u.api)ä¸ |
| | | vm.$u.api = {updateCid,updateFirstFreeBrowse,getRecomInviter,changeCode,getHdkCategoryList,eleStoreList,getPrivilegeShareLink,getDyGoodsDetail,bindMobileLogin,getTopMessId,changePwd,comminInt,wxapplogin,getTopCalss,getBanner,getHomeMenu,getSuperClass,getMQD,getGoodThing,login,sendSms,mobileLogin,setPwd,getUserInfo,getTalentInfo,getMessageList,getGoodsDetail,getPrivilegeLink,getSimilerGoods,getJdsDetail,getPddDetail,getM,getWphGoodsDetail,addCollect,delCollect,hotKey,suggestion,goodsSearch,activityLink,unionAct,singlePageLink,checkPddAuth,getPddAuth,getPineGoods,jdGoodsList,optimusMaterial,pddGoodsList,brandList,brandInfo,wphGoodsList,meituanAct,eleAct,eleShangjin,userHomemenu,getAppVersion,userBrowse,delBrowse,activitySingle,userCollect,bdHomemenu,getCity,coordinate,cityCate,searchDeals,getCityId,seckillShowinfo,seckillList,identifyGoods,changeMobile,bindInvitation,getInviteInfo,getEstimateAmount,fansList,getFansCount,getHelpType,getHelpList,getHelpDetail,getWpanurl,getChainTurning,superDiscountGoods,getHistory,getTbGoodsList,cateRankList,getUpgradeInfo,getEquityCard,levelApply,orderList,userProfit,bindZfb,withdraw,getBalanceLog,getPublisher,getAlbum,likeAlbum,albumDetail,anchorFollow,myFollowAlbum,feedback,userCancel,profile,bindWechat,unboundWechat}; |
| | | vm.$u.api = {gussessLikeGoods,checkPreferenceGoods,updateCid,updateFirstFreeBrowse,getRecomInviter,changeCode,getHdkCategoryList,eleStoreList,getPrivilegeShareLink,getDyGoodsDetail,bindMobileLogin,getTopMessId,changePwd,comminInt,wxapplogin,getTopCalss,getBanner,getHomeMenu,getSuperClass,getMQD,getGoodThing,login,sendSms,mobileLogin,setPwd,getUserInfo,getTalentInfo,getMessageList,getGoodsDetail,getPrivilegeLink,getSimilerGoods,getJdsDetail,getPddDetail,getM,getWphGoodsDetail,addCollect,delCollect,hotKey,suggestion,goodsSearch,activityLink,unionAct,singlePageLink,checkPddAuth,getPddAuth,getPineGoods,jdGoodsList,optimusMaterial,pddGoodsList,brandList,brandInfo,wphGoodsList,meituanAct,eleAct,eleShangjin,userHomemenu,getAppVersion,userBrowse,delBrowse,activitySingle,userCollect,bdHomemenu,getCity,coordinate,cityCate,searchDeals,getCityId,seckillShowinfo,seckillList,identifyGoods,changeMobile,bindInvitation,getInviteInfo,getEstimateAmount,fansList,getFansCount,getHelpType,getHelpList,getHelpDetail,getWpanurl,getChainTurning,superDiscountGoods,getHistory,getTbGoodsList,cateRankList,getUpgradeInfo,getEquityCard,levelApply,orderList,userProfit,bindZfb,withdraw,getBalanceLog,getPublisher,getAlbum,likeAlbum,albumDetail,anchorFollow,myFollowAlbum,feedback,userCancel,profile,bindWechat,unboundWechat}; |
| | | } |
| | | |
| | | export default { |