| | |
| | | onLaunch: function() { |
| | | // #ifdef APP-PLUS |
| | | //推送开始 |
| | | /* var info = plus.push.getClientInfo() |
| | | var info = plus.push.getClientInfo() |
| | | console.log(info); |
| | | // 获取当前设备的客户端id,传给后台,实现指定用户 |
| | | info && uni.setStorageSync('clientInfo', info) |
| | | // 使用5+App的方式进行监听消息推送 |
| | |
| | | //消息推送结束 |
| | | plus.push.addEventListener('click', res => { |
| | | console.log(res); |
| | | }); */ |
| | | }); |
| | | APPUpdate(); |
| | | // #endif |
| | | this.getAppInfo(); |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="rangeList-container rowCen"> |
| | | <view style="width: 100%;z-index: 999;"> |
| | | <view class="platvie"> |
| | | <view @click="changePlat(items.id)" class="platvie-plat" :class="currentplat==items.id?'platvie-active':''" v-for="(items,index) in platList" :key="index"> |
| | | {{items.text}} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="rangeList-container rowCen" v-if="currentplat=='tb'"> |
| | | <block v-for="(items,index) in priceRangelist" :key="index"> |
| | | <view class="rangeItem colCen" :class="nowCurrent==items.type?'rangeItem-active':''" @tap="changeRange(items.type)"> |
| | | <view class="nameBox"> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | currentplat:'tb', |
| | | nowCurrent: -1, |
| | | platList:[ |
| | | { |
| | | id:'tb', |
| | | text:'淘宝' |
| | | }, |
| | | { |
| | | id:'jd', |
| | | text:'京东' |
| | | } |
| | | ], |
| | | priceRangelist: [{ |
| | | txt: '推荐', |
| | | type: -1 |
| | |
| | | }, |
| | | onReachBottom() { |
| | | if (this.canloadmore) { |
| | | |
| | | this.getData() |
| | | } |
| | | }, |
| | | methods: { |
| | | changePlat(plat) |
| | | { |
| | | this.currentplat=plat; |
| | | this.pageCurrent = 1 |
| | | this.goodsList = [] |
| | | this.canloadmore = false |
| | | this.getData(); |
| | | }, |
| | | changeRange(type) { |
| | | this.pageCurrent = 1 |
| | | this.canloadmore = false |
| | |
| | | this.$u.api.getPineGoods( { |
| | | nineCid: this.nowCurrent, |
| | | page: this.pageCurrent, |
| | | plat:this.currentplat, |
| | | pageSize: 20 |
| | | }).then(e => { |
| | | console.log(e); |
| | | if(e.code == 1)return that.$alert(e.msg); |
| | | var res = e.data.list; |
| | | uni.stopPullDownRefresh(); |
| | |
| | | }) |
| | | }, |
| | | goDetail(info) { |
| | | console.log(info); |
| | | uni.navigateTo({ |
| | | url: '../goods/goodsDetail?info=' + encodeURIComponent(JSON.stringify(info)) |
| | | }) |
| | |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .platvie |
| | | { |
| | | width: 55%; |
| | | height: 100rpx; |
| | | z-index: 999; |
| | | display: flex; |
| | | text-align: center; |
| | | justify-content: center; |
| | | align-items: center; |
| | | margin: 0 auto; |
| | | } |
| | | .platvie-plat |
| | | { |
| | | width:33%; |
| | | font-size: 17px; |
| | | color: #dbd5d5; |
| | | } |
| | | .platvie-active |
| | | { |
| | | font-size: 19px; |
| | | color:#fff; |
| | | } |
| | | .specialOffer-wrapper { |
| | | width: 100%; |
| | | min-height: 380rpx; |
| | |
| | | z-index: 1; |
| | | width: 100%; |
| | | padding: 0 32rpx; |
| | | margin-top: 210rpx; |
| | | margin-top: 310rpx; |
| | | |
| | | .goods-content { |
| | | width: 100%; |
| | |
| | | console.log(options); |
| | | if(options.sourcefrom) |
| | | { |
| | | console.log(decodeURIComponent(options.info)); |
| | | this.optionsInfo = JSON.parse(decodeURIComponent(options.info)); |
| | | this.pageInfo = JSON.parse(decodeURIComponent(options.info)); |
| | | console.log(this.optionsInfo) |
| | |
| | | getPageInfo(e) { |
| | | var that = this; |
| | | if (this.faction == 'j') { |
| | | var loinf={ |
| | | goodsId: this.optionsInfo.goodsId, |
| | | goods: JSON.stringify(this.optionsInfo) |
| | | } |
| | | console.log(loinf) |
| | | this.$u.api.getJdsDetail({ |
| | | goodsId: this.optionsInfo.goodsId, |
| | | goods: JSON.stringify(this.optionsInfo) |
| | | }).then(e => { |
| | | console.log(e) |
| | | var res = e.data.detailPics; |
| | | this.JdDetails = that.JdDetails.concat(res) |
| | | that.$forceUpdate() |
| | |
| | | }, |
| | | backLast() |
| | | { |
| | | console.log("返回") |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }); |
| | |
| | | else{ |
| | | const value = uni.getStorageSync('userInfo'); |
| | | console.log(value); |
| | | //this.webviewUrl = encodeURI('http://appapitest.ushopvip.com/html/fengqiangbang.html?token='+value.token); |
| | | this.webviewUrl = encodeURI('http://dfgapp.ushopvip.com/html/fengqiangbang.html?token='+value.token); |
| | | } |
| | | |
| | |
| | | }, |
| | | methods: { |
| | | received(e) { |
| | | console.log(e.detail.data[0].type) |
| | | if(e.detail.data[0].type=='getToken'){ |
| | | const token = uni.getStorageSync('userInfo').token; |
| | | var currentWebview = this.$scope.$getAppWebview() |
| | | var wv = currentWebview.children()[0] |
| | | wv.evalJS('localStorage.setItem("ZZTOKEN",' + JSON.stringify(token) + ')'); |
| | | var res=e.detail.data[0]; |
| | | console.log(res); |
| | | switch(res.action) |
| | | { |
| | | case "back"://返回 |
| | | this.backLast(); |
| | | break; |
| | | } |
| | | }, |
| | | |
| | | backLast() |
| | | { |
| | | console.log("返回") |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }); |
| | | }, |
| | | // 关闭mui返回 |
| | | clearMuiBack() { |
| | | // #ifdef APP-PLUS |