| | |
| | | onLaunch: function() { |
| | | // #ifdef APP-PLUS |
| | | //推送开始 |
| | | var info = plus.push.getClientInfo() |
| | | /* var info = plus.push.getClientInfo() |
| | | console.log(info); |
| | | // 获取当前设备的客户端id,传给后台,实现指定用户 |
| | | info && uni.setStorageSync('clientInfo', info) |
| | | info && uni.setStorageSync('clientInfo', info) */ |
| | | this.getPushCid(); |
| | | // 使用5+App的方式进行监听消息推送 |
| | | //消息点击事件 |
| | | //【APP在线】,收到透传消息通过,不会提醒至通知栏目,需要发送本地消息,再进行点击触发的点击事件。 |
| | |
| | | //收到透传消息 |
| | | //只有APP在线时,才会触发receive事件,透传消息不会触发系统消息,需要创建本地消息 |
| | | plus.push.addEventListener("receive", function(msg) { |
| | | console.log('receive', JSON.stringify(msg)) |
| | | //业务代码 |
| | | // IOS |
| | | if (uni.getSystemInfoSync().platform == 'ios') { |
| | |
| | | content: '检测到网络权限可能设置为关闭,您可以在“设置”中检查无线数据及蜂窝移动网络' |
| | | }) |
| | | }else{ |
| | | console.log("是否请求过:"+that.globalData.hasinit) |
| | | if(!that.globalData.hasinit) |
| | | { |
| | | that.getAppInfo(); |
| | |
| | | bcInit:function() |
| | | { |
| | | var that = this; |
| | | console.log(uni.getSystemInfoSync().platform); |
| | | if (uni.getSystemInfoSync().platform == 'ios') |
| | | { |
| | | const plug = uni.requireNativePlugin('xiguazhu-baichuan'); |
| | | console.log(plug) |
| | | plug.init({}, result => { |
| | | //console.log('1111111111111111111'); |
| | | console.log(result); // code等于0就是初始化成功 |
| | |
| | | else{ |
| | | that.globalData.hasbcinit=true; |
| | | } |
| | | }, |
| | | getPushCid:function() |
| | | { |
| | | // #ifdef APP-PLUS |
| | | var info = plus.push.getClientInfo() |
| | | if(info&&info.clientid!='null') |
| | | {// 获取当前设备的客户端id,传给后台,实现指定用户 |
| | | uni.setStorageSync('clientInfo', info); |
| | | this.updatePushCid(); |
| | | } |
| | | else{ |
| | | console.log('没有获取到'); |
| | | setTimeout(() => { |
| | | this.getPushCid(); |
| | | }, 1000) |
| | | } |
| | | // #endif |
| | | }, |
| | | updatePushCid:function() |
| | | { |
| | | let clientInfo = uni.getStorageSync('clientInfo'); |
| | | if(clientInfo&&clientInfo!='null'&&clientInfo.clientid) |
| | | { |
| | | console.log('开始更新'); |
| | | this.$u.api.updateCid({ |
| | | pushcid:clientInfo.clientid |
| | | }).then(e => { |
| | | }).catch(function (err) { |
| | | }) |
| | | } |
| | | else{ |
| | | this.getPushCid(); |
| | | } |
| | | |
| | | }, |
| | | getAppInfo: function() { |
| | | var that = this; |
| | |
| | | if (plus.runtime.isApplicationExist({pname:'com.tencent.mm', |
| | | action: 'weixin://' |
| | | })) { |
| | | console.log("安卓端已安装微信") |
| | | that.globalData.ifwt = 1 //是否安装微信 1代表安装 |
| | | } else { |
| | | console.log("安卓端未安装微信") |
| | |
| | | v-if="bottomGoodsList.length>0"> |
| | | <block v-for="(items,index) in bottomGoodsList" :key="index"> |
| | | <view class="goods-items" @click="goDetails(items)"> |
| | | <!-- <colGoodsImg v-if="index==0&&itembannerList&&itembannerList.length>0" :popBannerSList="itembannerList"></colGoodsImg> --> |
| | | <colGoods :items="items"></colGoods> |
| | | </view> |
| | | </block> |
| | |
| | | import slideTop from './slideTop.vue' |
| | | import colGoods from './colGoods.vue' |
| | | import empowerModel from './empowerModel.vue' |
| | | import colGoodsImg from '@/components/colGoodsImg.vue' |
| | | export default { |
| | | props: { |
| | | recomendType: { |
| | |
| | | components: { |
| | | slideTop, |
| | | colGoods, |
| | | empowerModel |
| | | empowerModel, |
| | | colGoodsImg |
| | | }, |
| | | data() { |
| | | return { |
| | | popBannerSList:[], |
| | | fallingList: [], |
| | | pageHeight: '', |
| | | headerColor: '', |
| | |
| | | swpidx: 0, |
| | | canrefresh: true, |
| | | fastenter:[], |
| | | popBannerSList:[], |
| | | itembannerList:[], |
| | | enterTop:[], |
| | | enterDown:[] |
| | | enterDown:[], |
| | | tbbanner:[], |
| | | jdbanner:[], |
| | | dybanner:[], |
| | | pddbanner:[], |
| | | wphbanner:[], |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | this.getbottomGoodsList(this.bottomType); |
| | | this.getGOODSfalling(); |
| | | this.getRQList(); |
| | | //this.getPageImg(); |
| | | }, |
| | | mounted() { |
| | | this.$emit('scrolltoTop') |
| | |
| | | }, |
| | | onRestore() { |
| | | this.swpidx = 0 |
| | | console.log('下拉被终止'); |
| | | }, |
| | | pagescroll(e) { |
| | | this.$emit('scrollNum', e.detail.scrollTop) |
| | |
| | | that.dyList = e.data.dygoods; |
| | | }).catch(function(err) {}) |
| | | }, |
| | | |
| | | getPageImg() |
| | | { |
| | | var that=this; |
| | | this.$u.api.getBanner({ |
| | | type: '11,16,17,18,19,20' |
| | | }).then(e => { |
| | | if (e.code == 1) return that.$alert(e.msg); |
| | | var res = e.data.info; |
| | | that.tbbanner=res.tmImg; |
| | | that.jdbanner=res.jdImg; |
| | | that.dybanner=res.dyImg; |
| | | that.pddbanner=res.pddImg; |
| | | that.wphbanner=res.wphImg; |
| | | that.changeBanner(that.bottomCurrent); |
| | | }).catch(function(err) { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | changeBanner(type) |
| | | { |
| | | switch(type) |
| | | { |
| | | case 2://京东 |
| | | this.itembannerList=this.jdbanner; |
| | | break; |
| | | case 6://抖音 |
| | | this.itembannerList=this.dybanner; |
| | | break; |
| | | case 3://拼多多 |
| | | this.itembannerList=this.pddbanner; |
| | | break; |
| | | case 4://唯品会 |
| | | this.itembannerList=this.wphbanner; |
| | | break; |
| | | default: |
| | | this.itembannerList=[]; |
| | | break; |
| | | } |
| | | if(this.itembannerList&&this.itembannerList>0) |
| | | { |
| | | that.bottomGoodsList.unshift(this.itembannerList[0]); |
| | | } |
| | | }, |
| | | getbottomGoodsList(type) { |
| | | var that = this; |
| | | this.$u.api.getGoodThing({ |
| | |
| | | if (this.bottomCurrent != idx) { |
| | | this.currentPage = 1; |
| | | this.bottomType = info.type; |
| | | this.changeBanner(info.type); |
| | | this.getbottomGoodsList(this.bottomType); |
| | | this.$nextTick(() => { |
| | | this.$emit('scrolltoview') |
| | |
| | | </view> |
| | | <view class="tips-container colCen"> |
| | | <view class="grey-txt"> |
| | | 该商品可能涉及比价,自购可能会无佣金 |
| | | 该商品可能涉及比价,自购可能会无佣金,建议您先收藏该商品,2个小时候再进大返官app购买 |
| | | </view> |
| | | <view class="pink-txt"> |
| | | 比价定义:您在拼多多APP/网站访问了该商品的详情,再通过本APP进行转链自购的行为 |
| | |
| | | <style lang="scss"> |
| | | .pddremind-container { |
| | | width: 600rpx; |
| | | height: 630rpx; |
| | | height: 690rpx; |
| | | background: #FFFFFF; |
| | | border-radius: 10rpx; |
| | | padding: 0 45rpx; |
| | | padding: 0 25rpx; |
| | | position: relative; |
| | | |
| | | .topbac { |
| | |
| | | |
| | | .pink-txt { |
| | | color: #FD002F; |
| | | margin-top: 20rpx; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | }, |
| | | "push" : { |
| | | "unipush" : {} |
| | | "unipush" : { |
| | | "icons" : { |
| | | "small" : { |
| | | // 左上角小图标 |
| | | "ldpi" : "unpackage/res/drawable-ldpi/push_small.png", |
| | | "mdpi" : "unpackage/res/drawable-mdpi/push_small.png", |
| | | "hdpi" : "unpackage/res/drawable-hdpi/push_small.png", |
| | | "xhdpi" : "unpackage/res/drawable-xhdpi/push_small.png", |
| | | "xxhdpi" : "unpackage/res/drawable-xxhdpi/push_small.png" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "geolocation" : { |
| | | "amap" : { |
| | |
| | | }, |
| | | |
| | | getJDsrc() { |
| | | var that = this; |
| | | var that = this; |
| | | console.log(this.frompage); |
| | | console.log(that.optionsInfo.goodsId); |
| | | if(this.frompage=='freebuy') |
| | | {//0元购的记录商品id |
| | | this.$u.api.updateFirstFreeBrowse({ |
| | | goodsid:that.optionsInfo.goodsId, |
| | | new_goodsId:that.optionsInfo.goodsId, |
| | | plateform:'jd' |
| | | }).then(e=>{ |
| | | |
| | | }); |
| | | } |
| | | |
| | | this.$u.api.getPrivilegeLink({ |
| | | goodsId: this.optionsInfo.goodsId, |
| | | type: 1 |
| | |
| | | nowcurrentid:'', |
| | | recomendType:1, |
| | | isshowtype:false, |
| | | hasshow:false, |
| | | hasshow:false |
| | | } |
| | | }, |
| | | onLoad() { |
| | | this.getCategoryList(); |
| | | this.getPopBannerInfo(); |
| | | this.updateCid(); |
| | | |
| | | }, |
| | | onShow() { |
| | | if(!this.hasshow) |
| | |
| | | this.recomendType = open_like_recommend == "" ? 1 : open_like_recommend; |
| | | }, |
| | | onReady() { |
| | | console.log("获取高低") |
| | | this.getTopheight() |
| | | this.getTopheight(); |
| | | }, |
| | | watch: {}, |
| | | methods: { |
| | | updateCid() |
| | | { |
| | | //从缓存获取cid |
| | | let clientInfo = uni.getStorageSync('clientInfo'); |
| | | console.log(clientInfo); |
| | | if(clientInfo&&clientInfo.clientid) |
| | | { |
| | | this.$u.api.updateCid({ |
| | | pushcid:clientInfo.clientid |
| | | }).then(e => { |
| | | console.log(e); |
| | | }).catch(function (err) { |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | shShow() |
| | | { |
| | | var that=this; |
| | |
| | | if(istoLogin) |
| | | { |
| | | if(!that.hasLogin){ |
| | | uni.reLaunch({ |
| | | url:"/pages/login/wxlogin" |
| | | }) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url:"/pages/login/wxlogin" |
| | | }) |
| | | }, 1000) |
| | | |
| | | } |
| | | /* var user= uni.getStorageSync('userInfo'); |
| | | if(!user.invitation_code) |
| | |
| | | getTopheight() { |
| | | // 获取顶部高度 |
| | | uni.createSelectorQuery().in(this).select('.fixed-container').boundingClientRect(data => { |
| | | console.log(data.height+":----------------"); |
| | | this.Topheight = data.height |
| | | }).exec(); |
| | | }, |
| | |
| | | this.$u.api.getBanner({ |
| | | type: '1,15' |
| | | }).then(e => { |
| | | |
| | | console.log(e) |
| | | if (e.code == 1) |
| | | {//返回失败,直接跳首页 |
| | | this.t_index(); |
| | |
| | | that.list=res.launchpic; |
| | | } |
| | | else{ |
| | | console.log("跳转") |
| | | this.t_index(); |
| | | } |
| | | }).catch(function(err) { |
| | |
| | | url: './setPass' |
| | | }) |
| | | } */else { |
| | | //更新pushcid |
| | | getApp().updatePushCid(); |
| | | uni.switchTab({ |
| | | url: '../index/index' |
| | | }) |
| | |
| | | url: './setPass' |
| | | }) |
| | | } */ else { |
| | | //更新pushcid |
| | | getApp().updatePushCid(); |
| | | uni.switchTab({ |
| | | url: '../index/index' |
| | | }) |
| | |
| | | var nowClipData = res.data |
| | | if (nowClipData.length > 6 && nowClipData!=uni.getStorageSync('clipboard')) { |
| | | getApp().globalData.hasMode = true |
| | | console.log(nowClipData); |
| | | Vue.prototype.$u.api.identifyGoods({goods_url: nowClipData}).then(e => { |
| | | console.log(e) |
| | | if(e.code != 0) return Vue.prototype.$alert(e.msg) |