| | |
| | | ifwt: 0, |
| | | hasinit:false, |
| | | hasbcinit:false, |
| | | isLaunch:false |
| | | isLaunch: false, |
| | | argumentStr: '' |
| | | |
| | | }, |
| | | onShow: function() { |
| | | |
| | | var that = this; |
| | | uni.getNetworkType({ |
| | | success:function(res){ |
| | |
| | | content: '检测到网络权限可能设置为关闭,您可以在“设置”中检查无线数据及蜂窝移动网络' |
| | | }) |
| | | }else{ |
| | | if(!that.globalData.hasinit) |
| | | { |
| | | if (!that.globalData.hasinit) { |
| | | that.getAppInfo(); |
| | | } |
| | | if(!that.globalData.hasbcinit) |
| | | { |
| | | if (!that.globalData.hasbcinit) { |
| | | console.log("初始化百川插件") |
| | | that.bcInit(); |
| | | } |
| | |
| | | var route = routes[routes.length - 1].route |
| | | } |
| | | // #ifdef APP-PLUS |
| | | if (this.globalData.canlisten && route != 'pages/mine/tools/turnChain'&&route!='pages/rankinglist/compareprice') { |
| | | if (this.globalData.canlisten && route != 'pages/mine/tools/turnChain' && route != |
| | | 'pages/rankinglist/compareprice') { |
| | | getClipboard() |
| | | } |
| | | |
| | | this.getArgument(); |
| | | // #endif |
| | | }, |
| | | onHide: function() {}, |
| | | methods: { |
| | | ...mapMutations(['login']), |
| | | bcInit:function() |
| | | { |
| | | bcInit: function() { |
| | | var that = this; |
| | | if (uni.getSystemInfoSync().platform == 'ios') |
| | | { |
| | | if (uni.getSystemInfoSync().platform == 'ios') { |
| | | const plug = uni.requireNativePlugin('xiguazhu-baichuan'); |
| | | plug.init({}, result => { |
| | | //console.log('1111111111111111111'); |
| | | console.log(result); // code等于0就是初始化成功 |
| | | if(result.code==0) |
| | | { |
| | | if (result.code == 0) { |
| | | that.globalData.hasbcinit=true; |
| | | } |
| | | }); |
| | | } |
| | | else{ |
| | | } else { |
| | | that.globalData.hasbcinit=true; |
| | | } |
| | | }, |
| | | getPushCid:function() |
| | | getArgument() { |
| | | try { |
| | | var args = plus.runtime.arguments; |
| | | if (args) { |
| | | /* if (this.globalData.argumentStr == args) { |
| | | return; |
| | | } |
| | | this.globalData.argumentStr = args; */ |
| | | plus.runtime.arguments = ""; |
| | | plus.runtime.arguments = null; |
| | | var toarg = args.replace('dafanguan://', ''); |
| | | var argObj = JSON.parse(decodeURIComponent(toarg)); |
| | | switch (argObj.totype) { |
| | | case "0": //内链 |
| | | if(argObj.url) |
| | | { |
| | | uni.navigateTo({ |
| | | url: argObj.url |
| | | }); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } catch (es) { |
| | | console.log(es) |
| | | } |
| | | |
| | | }, |
| | | getPushCid: function() { |
| | | // #ifdef APP-PLUS |
| | | var info = plus.push.getClientInfo() |
| | | if(info&&info.clientid!='null') |
| | | {// 获取当前设备的客户端id,传给后台,实现指定用户 |
| | | if (info && info.clientid != 'null') { // 获取当前设备的客户端id,传给后台,实现指定用户 |
| | | uni.setStorageSync('clientInfo', info); |
| | | this.updatePushCid(); |
| | | } |
| | | else{ |
| | | } else { |
| | | console.log('没有获取到'); |
| | | setTimeout(() => { |
| | | this.getPushCid(); |
| | |
| | | } |
| | | // #endif |
| | | }, |
| | | updatePushCid:function() |
| | | { |
| | | updatePushCid: function() { |
| | | let clientInfo = uni.getStorageSync('clientInfo'); |
| | | if(clientInfo&&clientInfo!='null'&&clientInfo.clientid) |
| | | { |
| | | if (clientInfo && clientInfo != 'null' && clientInfo.clientid) { |
| | | console.log('开始更新'); |
| | | this.$u.api.updateCid({ |
| | | pushcid:clientInfo.clientid |
| | | }).then(e => { |
| | | }).catch(function (err) { |
| | | }) |
| | | } |
| | | else{ |
| | | }).then(e => {}).catch(function(err) {}) |
| | | } else { |
| | | this.getPushCid(); |
| | | } |
| | | |
| | |
| | | var that = this; |
| | | that.globalData.hasinit=true; |
| | | this.$u.api.comminInt({}).then(e => { |
| | | if (e.code != 0) |
| | | { |
| | | if (e.code != 0) { |
| | | that.globalData.hasinit=false; |
| | | return that.$alert(e.msg) |
| | | } |
| | |
| | | utils.setCache('baseUrl', this.$u.http.config.baseUrl) |
| | | // #ifdef APP-PLUS |
| | | if (plus.os.name == 'iOS') { |
| | | if (that.globalData.appinfo.iosExamine && plus.runtime.version == e.data.basic.IosExamineV) { |
| | | if (that.globalData.appinfo.iosExamine && plus.runtime.version == e.data.basic |
| | | .IosExamineV) { |
| | | that.globalData.ifwt = 0 |
| | | } else { |
| | | if (plus.runtime.isApplicationExist({ |
| | |
| | | } |
| | | } |
| | | } else { |
| | | if (plus.runtime.isApplicationExist({pname:'com.tencent.mm', |
| | | if (plus.runtime.isApplicationExist({ |
| | | pname: 'com.tencent.mm', |
| | | action: 'weixin://' |
| | | })) { |
| | | that.globalData.ifwt = 1 //是否安装微信 1代表安装 |
| | |
| | | } |
| | | } |
| | | // #endif |
| | | }).catch(function(err) {that.globalData.hasinit=false;}) |
| | | }).catch(function(err) { |
| | | that.globalData.hasinit = false; |
| | | }) |
| | | |
| | | }, |
| | | |
| | |
| | | "name" : "大返官", |
| | | "appid" : "__UNI__FC8858A", |
| | | "description" : "大返官app", |
| | | "versionName" : "1.2.5", |
| | | "versionCode" : 125, |
| | | "versionName" : "1.1.5", |
| | | "versionCode" : 115, |
| | | "transformPx" : false, |
| | | /* 5+App特有相关 */ |
| | | "app-plus" : { |
| | |
| | | "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" |
| | | ], |
| | | "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ], |
| | | "schemes" : "" |
| | | "schemes" : "dafanguan" |
| | | }, |
| | | /* ios打包配置 */ |
| | | "ios" : { |
| | | "idfa" : true, |
| | | "urltypes" : [ |
| | | { |
| | | "urlschemes" : [ "tbopen34348719" ] //tbopen+您应用的AppKey |
| | | "urlschemes" : [ "tbopen34348719", "dafanguan" ] //tbopen+您应用的AppKey |
| | | } |
| | | ], |
| | | "urlschemewhitelist" : "tbopen,tmall,snssdk1128", |
| | |
| | | <view class="colCen borderBox goodsList-container"> |
| | | <view class="listbox colCen borderBox"> |
| | | <block v-for="(items,index) in goodsList" :key="index"> |
| | | <view class="goods-items" @click="goDetail(items)"> |
| | | <view class="goods-items" @click="godetails(items)"> |
| | | <rowGoods :items="items"></rowGoods> |
| | | </view> |
| | | </block> |
| | |
| | | this.getGoodsList(); |
| | | }) |
| | | }, |
| | | |
| | | |
| | | godetails(info){ |
| | | console.log(1111); |
| | | uni.navigateTo({ |
| | | url: '../goods/goodsDetail?info=' + encodeURIComponent(JSON.stringify(info)) |
| | | }) |
| | |
| | | <template> |
| | | <view v-if="isshowtype"> |
| | | <indexnewPage :Topheight="Topheight" :recomendType="recomendType" :canrefush='canrefush' :fixedClass='fixedClass'></indexnewPage> |
| | | <indexnewPage :Topheight="Topheight" :recomendType="recomendType" :canrefush='canrefush' |
| | | :fixedClass='fixedClass'></indexnewPage> |
| | | </view> |
| | | <view v-else class="index-wrapper wrapperLayer borderBox"> |
| | | <view class="fixed-container colCen borderBox" :style="'background:'+ (categoryCurrent>0?'#EE1B14':(scrollTop>30?'#EE1B14;':bannerColor) +';')"> |
| | | <view class="fixed-container colCen borderBox" |
| | | :style="'background:'+ (categoryCurrent>0?'#EE1B14':(scrollTop>30?'#EE1B14;':bannerColor) +';')"> |
| | | <view class="topbarbox"></view> |
| | | <view class="headerSearch-container rowCenBet borderBox"> |
| | | <view class="leftgoSearchbox rowCen borderBox" @click="goPath('search')"> |
| | |
| | | </view> |
| | | |
| | | <view class="categoryNavbar-container rowCenBet"> |
| | | <scroll-view class="categoryScroll" scroll-x scroll-with-animation @scroll="rowscroll" :scroll-into-view="nowcurrentid" :scroll-left="scrollleftnum"> |
| | | <scroll-view class="categoryScroll" scroll-x scroll-with-animation @scroll="rowscroll" |
| | | :scroll-into-view="nowcurrentid" :scroll-left="scrollleftnum"> |
| | | <block v-for="(items,index) in categoryList" :key='index'> |
| | | <view class="category-container"> |
| | | <view class="category-items colCenCen" @click="cateChange(index)" :id="categoryCurrent==index?'category-items-active':''" :class="categoryCurrent==index?'category-items-active':''"> |
| | | <view class="category-items colCenCen" @click="cateChange(index)" |
| | | :id="categoryCurrent==index?'category-items-active':''" |
| | | :class="categoryCurrent==index?'category-items-active':''"> |
| | | <view class="categoryname"> |
| | | {{items.cname}} |
| | | </view> |
| | |
| | | </view> |
| | | |
| | | <view class="body-container colCen borderBox"> |
| | | <swiper class="pageSwiper" :disable-touch='canswiper' duration="200" :current='categoryCurrent' @change='changeCatepage' @transition='swipering' @animationfinish='stopswiper'> |
| | | <swiper class="pageSwiper" :disable-touch='canswiper' duration="200" :current='categoryCurrent' |
| | | @change='changeCatepage' @transition='swipering' @animationfinish='stopswiper'> |
| | | <swiper-item v-for="(items,index) in categoryList" :key='index' :current-item-id='items.cid'> |
| | | <view v-if='index==0'> |
| | | <indexPage ref='indexPage' :recomendType="recomendType" :canrefush='canrefush' :fixedClass='fixedClass' @scrolltoTop='scrolltoTop' @scrolltoview='scrolltoview' |
| | | @pushfixed='getfixed' @scrollNum='getScroll' :Topheight='Topheight' @passColor='getColor'></indexPage> |
| | | <indexPage ref='indexPage' :recomendType="recomendType" :canrefush='canrefush' |
| | | :fixedClass='fixedClass' @scrolltoTop='scrolltoTop' @scrolltoview='scrolltoview' |
| | | @pushfixed='getfixed' @scrollNum='getScroll' :Topheight='Topheight' @passColor='getColor'> |
| | | </indexPage> |
| | | </view> |
| | | <view v-else> |
| | | <categoryPage v-if="index==categoryCurrent+1 || index==categoryCurrent-1 || index==categoryCurrent" :parentId='items.cid' |
| | | :Topheight='Topheight' :canrefush='canrefush' :canload='index==categoryCurrent'> |
| | | <categoryPage |
| | | v-if="index==categoryCurrent+1 || index==categoryCurrent-1 || index==categoryCurrent" |
| | | :parentId='items.cid' :Topheight='Topheight' :canrefush='canrefush' |
| | | :canload='index==categoryCurrent'> |
| | | </categoryPage> |
| | | </view> |
| | | </swiper-item> |
| | |
| | | <u-mask :show="showBulletFrame"> |
| | | <view class="warp"> |
| | | <!-- <view @tap.stop> --> |
| | | <image class="pic" :src="BulletFrameData.image" mode="aspectFit" @tap.stop="goToShowBulletFrame(BulletFrameData)"/> |
| | | <image class="pic" :src="BulletFrameData.image" mode="aspectFit" |
| | | @tap.stop="goToShowBulletFrame(BulletFrameData)" /> |
| | | <!-- </view> --> |
| | | <view class="clone" @click="showBulletFrame = false"> |
| | | <image class="image" width="64rpx" height="64rpx" src="/static/images/app/close.png"></image> |
| | |
| | | }, |
| | | onLoad() { |
| | | this.getCategoryList(); |
| | | this.getPopBannerInfo(); |
| | | this.getCusPopupInfo(); |
| | | |
| | | }, |
| | | onShow() { |
| | | if(!this.hasshow) |
| | | { |
| | | if (!this.hasshow) { |
| | | this.shShow(); |
| | | } |
| | | if(this.categoryList){ |
| | |
| | | watch: {}, |
| | | methods: { |
| | | |
| | | shShow() |
| | | { |
| | | shShow() { |
| | | var that=this; |
| | | var istoLogin=true; |
| | | this.$u.api.comminInt({}).then(e => { |
| | |
| | | that.isshowtype=false; |
| | | } |
| | | } |
| | | if(istoLogin) |
| | | { |
| | | if (istoLogin) { |
| | | if(!that.hasLogin){ |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | |
| | | this.showBulletFrame = false |
| | | utils.goUrl(info, this) |
| | | }, |
| | | |
| | | getCusPopupInfo() { //获取自定义弹窗数据 |
| | | var that = this; |
| | | this.$u.api.getCustomizePopup({}).then(e => { |
| | | if (e.code == 0) { |
| | | var res = e.data; |
| | | if (res.haspop) { //有自定义弹窗 |
| | | this.showBulletFrame = true; |
| | | this.BulletFrameData = res.info; |
| | | } else { |
| | | this.getPopBannerInfo(); |
| | | } |
| | | } |
| | | }).catch(function(err) { |
| | | this.getPopBannerInfo(); |
| | | }) |
| | | }, |
| | | getPopBannerInfo() { |
| | | // banner数据 |
| | | var that = this; |
| | |
| | | this.showBulletFrame = true; |
| | | this.BulletFrameData = res[0] |
| | | } |
| | | }).catch(function(err) { |
| | | }) |
| | | }).catch(function(err) {}) |
| | | }, |
| | | getNewMessage(){ |
| | | var that = this; |
| | |
| | | let oldId = uni.getStorageSync('topMessageId'); |
| | | if(oldId != e.data.id)that.isNewMessage = true; |
| | | } |
| | | }).catch(function (err) { |
| | | }) |
| | | }).catch(function(err) {}) |
| | | }, |
| | | rowscroll(e){ |
| | | this.rowLeft = e.scrollLeft |
| | |
| | | }, |
| | | getCategoryList() { |
| | | var that = this; |
| | | this.$u.api.getTopCalss({ctype:1,parentId:0}).then(e => { |
| | | this.$u.api.getTopCalss({ |
| | | ctype: 1, |
| | | parentId: 0 |
| | | }).then(e => { |
| | | if(e.code != 0)return that.$alert(e.msg) |
| | | var obj = {} |
| | | obj.cname = '推荐'; |
| | |
| | | obj.ctype = 0; |
| | | that.categoryList = e.data.list; |
| | | that.categoryList.unshift(obj); |
| | | }).catch(function (err) { |
| | | }) |
| | | }).catch(function(err) {}) |
| | | }, |
| | | |
| | | // 页面样式处理 |
| | |
| | | uni.navigateTo({ |
| | | url: './officialNotice' |
| | | }) |
| | | } |
| | | else if(url=='turnChain') |
| | | { |
| | | } else if (url == 'turnChain') { |
| | | uni.navigateTo({ |
| | | url: '../mine/tools/turnChain' |
| | | }) |
| | |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | uni-image |
| | | { |
| | | uni-image { |
| | | width:30rem; |
| | | height:25rem |
| | | } |
| | | |
| | | .index-wrapper { |
| | | height: 100vh; |
| | | overflow: hidden; |
| | |
| | | color: #FFFFFF; |
| | | } |
| | | } |
| | | |
| | | .searchImg{ |
| | | image{ |
| | | width: 40rpx; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .warp{ |
| | | position: relative; |
| | | top:50%; |
| | |
| | | align-items: center; |
| | | justify-content: center; |
| | | width: 100%; |
| | | |
| | | .pic{ |
| | | // width: 86.6%; |
| | | // height: 100vw; |
| | |
| | | position:absolute; |
| | | bottom: -30rpx; |
| | | transform: translate(calc(50% - 32rpx)); |
| | | |
| | | .image { |
| | | width: 64rpx; |
| | | margin: 0 auto; |
| | |
| | | jumpMini() { |
| | | var isAppletJump = getApp().globalData.appinfo.isAppletJump; |
| | | if(isAppletJump){ |
| | | console.log('isAppletJump') |
| | | var appId = this.pageInfo.app_id; |
| | | var appPath = this.pageInfo.wx_miniprogram_path; |
| | | plus.share.getServices(function(res) { |
| | |
| | | sweixin = t; |
| | | } |
| | | } |
| | | console.log(sweixin) |
| | | if (sweixin) { |
| | | sweixin.launchMiniProgram({ |
| | | id: appId, |
| | |
| | | pname: 'com.taobao.taobao', |
| | | action: 'taobao://' |
| | | })) { |
| | | console.log('tb') |
| | | const plug = uni.requireNativePlugin('xiguazhu-baichuan') |
| | | plug.detailPage({ |
| | | url: this.pageInfo.click_url, |
| | |
| | | // console.log(result); |
| | | }); |
| | | } else { |
| | | console.log('webview') |
| | | uni.navigateTo({ |
| | | url: '../webView/webView?url=' +this.pageInfo.click_url, |
| | | }) |
| | |
| | | //const httpUrl = ""; // 接口域名 |
| | | //const httpUrl = "http://appapitest.ushopvip.com"; // 测试环境接口域名 |
| | | const httpUrl = "http://dfgapp.ushopvip.com"; // 生产环境接口域名 |
| | | const httpUrl = "http://appapitest.ushopvip.com"; // 测试环境接口域名 |
| | | //const httpUrl = "http://dfgapp.ushopvip.com"; // 生产环境接口域名 |
| | | const salt = ""; |
| | | export default { |
| | | httpUrl:httpUrl, |
| | |
| | | let updateCidUrl="/api/user/UpdateClientId"; |
| | | let checkPreferenceGoodsUrl="/api/user/check_preference_goods"; |
| | | let gussessLikeGoodsUrl="/api/taoke/gussess_like_goods"; |
| | | |
| | | let getCustomizePopupUrl="/api/activity/getCustomizePopup"; |
| | | |
| | | // 此处第二个参数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 updateCid=(params={})=>vm.$u.post(updateCidUrl,params);//更新pushcid |
| | | let checkPreferenceGoods=(params={})=>vm.$u.post(checkPreferenceGoodsUrl,params);//检测是否有偏好商品 |
| | | let gussessLikeGoods=(params={})=>vm.$u.post(gussessLikeGoodsUrl,params);//首页猜你喜欢 |
| | | let getCustomizePopup=(params={})=>vm.$u.post(getCustomizePopupUrl,params);//首页自定义弹窗 |
| | | |
| | | // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下 |
| | | 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}; |
| | | vm.$u.api = {getCustomizePopup,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 { |