@@ -1,11 +1,12 @@ | |||
{ | |||
"pages": [ | |||
"pages/index/index", | |||
"pages/main/index", | |||
"index/index", | |||
"index/searchbar", | |||
"index/passCar", | |||
"index/user", | |||
"index/index", | |||
"pages/searchbar/searchbar", | |||
"pages/integralmall/integraHistory/index", | |||
"pages/integralmall/payIntegcouponStatus/index", | |||
@@ -10,7 +10,6 @@ Page({ | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
url:"", | |||
navigationBarHeight, | |||
bannerUrl: imgurl.banner.url, | |||
wmhome: imgurl.wmhome.url, | |||
@@ -34,46 +33,96 @@ Page({ | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function(options) { | |||
Http.get({ | |||
url: config.api.checkUserStatus, | |||
data: { | |||
token: app.globalData.token | |||
} | |||
}).then(res => { | |||
if(app.globalData.token) { | |||
Http.get({ | |||
url: config.api.checkPhoneStatus, | |||
data: {} | |||
url: config.api.checkUserStatus, | |||
data: { | |||
token: app.globalData.token | |||
} | |||
}).then(res => { | |||
let that = this; | |||
if (options.orderId || options.orderId && options.from == 'discount') { | |||
console.log(options, "options") | |||
if (options.from) { | |||
that.setData({ | |||
orderId: options.orderId, | |||
composeOrderType: options.composeOrderType, | |||
from: "discount" | |||
}) | |||
} else { | |||
that.setData({ | |||
orderId: options.orderId, | |||
composeOrderType: options.composeOrderType, | |||
}) | |||
Http.get({ | |||
url: config.api.checkPhoneStatus, | |||
data: {} | |||
}).then(res => { | |||
let that = this; | |||
if (options.orderId || options.orderId && options.from == 'discount') { | |||
console.log(options, "options") | |||
if (options.from) { | |||
that.setData({ | |||
orderId: options.orderId, | |||
composeOrderType: options.composeOrderType, | |||
from: "discount" | |||
}) | |||
} else { | |||
that.setData({ | |||
orderId: options.orderId, | |||
composeOrderType: options.composeOrderType, | |||
}) | |||
} | |||
app.globalData.wmorder = options.orderId | |||
that.pressOrderDetail(options.orderId); | |||
} | |||
app.globalData.wmorder = options.orderId | |||
that.pressOrderDetail(options.orderId); | |||
} | |||
this.getUserInfo() | |||
}).catch(res=>{ | |||
this.getUserInfo() | |||
}).catch(res => { | |||
wx.redirectTo({ | |||
url: `/pages/getphoneInfo/index` | |||
}); | |||
}) | |||
}).catch(res => { | |||
wx.redirectTo({ | |||
url: `/pages/getphoneInfo/index` | |||
}); | |||
}) | |||
}).catch(res => { | |||
wx.redirectTo({ | |||
url: `/pages/getuserinfo/index` | |||
url: `/pages/getuserinfo/index` | |||
}) | |||
}) | |||
}) | |||
}else{ | |||
app.tokenCallback = token =>{ | |||
Http.get({ | |||
url: config.api.checkUserStatus, | |||
data: { | |||
token: app.globalData.token | |||
} | |||
}).then(res => { | |||
Http.get({ | |||
url: config.api.checkPhoneStatus, | |||
data: {} | |||
}).then(res => { | |||
let that = this; | |||
if (options.orderId || options.orderId && options.from == 'discount') { | |||
console.log(options, "options") | |||
if (options.from) { | |||
that.setData({ | |||
orderId: options.orderId, | |||
composeOrderType: options.composeOrderType, | |||
from: "discount" | |||
}) | |||
} else { | |||
that.setData({ | |||
orderId: options.orderId, | |||
composeOrderType: options.composeOrderType, | |||
}) | |||
} | |||
app.globalData.wmorder = options.orderId | |||
that.pressOrderDetail(options.orderId); | |||
} | |||
this.getUserInfo() | |||
}).catch(res => { | |||
app.globalData.type = "bg" | |||
wx.redirectTo({ | |||
url: `/pages/getuserinfo/index?orderId=${options.orderId}&composeOrderType=${options.composeOrderType}` | |||
}); | |||
}) | |||
}).catch(res => { | |||
app.globalData.type = "bg" | |||
wx.redirectTo({ | |||
url: `/pages/getuserinfo/index?orderId=${options.orderId}&composeOrderType=${options.composeOrderType}` | |||
}) | |||
}) | |||
} | |||
} | |||
}, | |||
getUserInfo: function() { | |||
@@ -800,9 +849,7 @@ Page({ | |||
// var orderId = options.target.dataset.orderid; | |||
shareObj.path = `/pages/index/index?orderId=${that.data.orderId}&from=${"discount"}&composeOrderType=${that.data.composeOrderType}`; | |||
} | |||
this.setData({ | |||
url: shareObj.path | |||
}) | |||
console.log(shareObj) | |||
// 返回shareObj | |||
// return shareObj; | |||
@@ -68,8 +68,6 @@ | |||
</view> | |||
</view> | |||
</view> | |||
<view>{{url}}</view> | |||
<form bindsubmit="submit" report-submit='true'> | |||
<view class="btns clearfix" wx:if="{{data.orderStatus != 7&&discountStatus==1&&todayDate<=data.pressEndDate&&data.orderStatus!=1&&data.orderStatus != 9}}" hover-class="none" hover-stop-propagation="false"> | |||
<!-- <button class="fl" form-type="submit" bindtap='orderFunc1' data-couponChannelId="{{data.couponChannelId}}" data-price="{{data.price/100}}" data-couponId="{{data.productId}}" disabled='{{showButton}}' data-rushtobuy='rushtobuy'> | |||
@@ -57,7 +57,7 @@ Page({ | |||
scaleData: null, | |||
skewData: null, | |||
matrixData: null, | |||
opacity: 0, | |||
opacity: 0, | |||
queueData: null, | |||
zIndex: 11, | |||
display: "none", | |||
@@ -202,6 +202,9 @@ Page({ | |||
}, | |||
gohome(e){ | |||
console.log(e.currentTarget.dataset.id,"123") | |||
wx.navigateTo({ | |||
url: `/pages/fillIndent/fillIndent?id=${e.currentTarget.dataset.id}`, | |||
}) | |||
}, | |||
@@ -146,7 +146,7 @@ | |||
</button> | |||
<button form-type="submit" disabled='{{showbutton}}' hover-class='active' class='buy' wx:if="{{data.type!=11&&data.type!=8&&data.type!=50&&data.type!=51&&data.salePriceStr!=0&&data.remainInventory!=0&&endtime!='活动已结束'&&data.activityStatus!=0}}"> | |||
<text class='txt'>{{data.salePriceStr}}元</text>马上购买</button> | |||
<button wx:if="{{data.type==11}}" bindtap="gohome" data-id="{{data.id}}" class="home">配送到家 | |||
<button wx:if="{{data.type==11}}" bindtap="gohome" data-id="{{couponChannelId}}" class="home">配送到家 | |||
</button> | |||
<button wx:if="{{data.type==11}}" form-type="submit" class="arrive">到店购买 | |||
</button> | |||
@@ -11,11 +11,86 @@ Page({ | |||
data: { | |||
navigationBarHeight, | |||
num:1, | |||
showShade:true, | |||
showShade:false, | |||
coverImg:"", | |||
title:"", | |||
salePriceStr:"",//单价 | |||
freightPriceStr:"",//运费 | |||
remainInventory: "",//库存 | |||
seti:[], | |||
area:"", | |||
address:"", | |||
consignee:"", | |||
mobile:"", | |||
}, | |||
goAddStie(){ | |||
wx.navigateTo({ | |||
url: '/pages/siteAdd/siteAdd?url=/pages/fillIndent/fillIndent', | |||
}) | |||
}, | |||
setSite(e){ | |||
let id = e.currentTarget.dataset.id | |||
let arr = [] | |||
arr = this.data.seti.filter(item=>{ | |||
return item.id == id | |||
})[0] | |||
console.log(arr) | |||
this.setData({ | |||
area: arr.regionStr, | |||
address: arr.address, | |||
consignee: arr.consignee, | |||
mobile: arr.mobile, | |||
}) | |||
}, | |||
getSetiLsit(){ | |||
Http.get({ | |||
url: config.api.siteList, | |||
data:{ | |||
pageNum: 1, | |||
pageSize: 1000 | |||
} | |||
}).then(res=>{ | |||
let temp = res.data.list | |||
if(temp.length>0){ | |||
temp.map(item => { | |||
// let regionStr = "" | |||
let tempstr = "" | |||
JSON.parse(item.region).map(item2 => { | |||
tempstr += item2 | |||
}) | |||
item.regionStr = tempstr | |||
}) | |||
console.log(temp, "temp") | |||
this.setData({ | |||
seti: temp, | |||
}) | |||
let tempRegion = JSON.parse(temp[0].region) | |||
let str = "" | |||
tempRegion.map(item => { str += item }) | |||
this.setData({ | |||
area: str, | |||
address: temp[0].address, | |||
consignee: temp[0].consignee, | |||
mobile: temp[0].mobile | |||
}) | |||
} | |||
}).catch(err => { | |||
wx.showToast({ | |||
title: err.message ? err.message : err.data, | |||
icon: 'none', | |||
duration: 2000, | |||
}); | |||
}) | |||
}, | |||
addNum(){ | |||
let num = this.data.num | |||
if(this.data.num>=10){ | |||
if (this.data.num >= this.data.remainInventory){ | |||
wx.showToast({ | |||
title: '购买总数超库存', | |||
icon: 'none', | |||
@@ -46,11 +121,49 @@ Page({ | |||
}) | |||
} | |||
}, | |||
hieShade(){ | |||
this.setData({ | |||
showShade:false | |||
}) | |||
}, | |||
showTShade(){ | |||
this.setData({ | |||
showShade: true | |||
}) | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
this.setData({ | |||
id:options.id | |||
}) | |||
this.getCouponDetail() | |||
this.getSetiLsit() | |||
}, | |||
getCouponDetail(){ | |||
Http.get({ | |||
url: config.api.couponDetail, | |||
data:{ | |||
couponChannelId:this.data.id | |||
} | |||
}).then(res=>{ | |||
let temp = res.data | |||
this.setData({ | |||
coverImg: temp.coverImg, | |||
title: temp.title, | |||
salePriceStr: temp.salePriceStr, | |||
freightPriceStr: temp.freightPriceStr, | |||
remainInventory: temp.remainInventory | |||
}) | |||
}).catch(err=>{ | |||
wx.showToast({ | |||
title: err.message ? err.message : err.data, | |||
icon: 'none', | |||
duration: 2000, | |||
}); | |||
}) | |||
}, | |||
/** | |||
@@ -2,25 +2,31 @@ | |||
<view style="height:{{navigationBarHeight}} "></view> | |||
<view class="box"> | |||
<view class="siteBox"> | |||
<view class="siteTitle"> | |||
<view class="text">北京是朝阳区三环以内</view> | |||
<view class="mpren">默认</view> | |||
</view> | |||
<view class="siteTitle siteText">北京市朝阳区南磨房东里123号楼234号</view> | |||
<view class="siteTitle phoneBox"> | |||
<view class="name">圣达菲</view> | |||
<view class="phone">138****7654</view> | |||
<view wx:if="{{seti.length>0}}"> | |||
<view class="siteTitle"> | |||
<view class="text">{{area}}</view> | |||
<view class="mpren">默认</view> | |||
</view> | |||
<view class="siteTitle siteText">{{address}}</view> | |||
<view class="siteTitle phoneBox"> | |||
<view class="name">{{consignee}}</view> | |||
<view class="phone">{{mobile}}</view> | |||
</view> | |||
<view class="pudataSite" bindtap="showTShade">更换</view> | |||
</view> | |||
<view class="pudataSite">更换</view> | |||
<view class="addSeit" wx:if="{{seti.length==0}}" bindtap="goAddStie">添加收货地址</view> | |||
</view> | |||
<view class="commodityBox"> | |||
<view class="imgBox"></view> | |||
<!-- <view class="imgBox"></view> --> | |||
<image class="imgBox" src="{{coverImg}}"></image> | |||
<view class="commodityDie"> | |||
<view class="merchandiseName">商品名称商品名称商品名称商品名称 商品名称商品名称 | |||
<view class="merchandiseName">{{title}} | |||
</view> | |||
<view class="priceBox"> | |||
<view class="price">¥9.9</view> | |||
<view class="price">¥{{salePriceStr}}</view> | |||
<view class="numberBox"> | |||
<view class="add" bindtap="addNum">+</view> | |||
@@ -35,119 +41,41 @@ | |||
<view class="commodityBox"> | |||
<view class="costBox"> | |||
<view class="text">商品金额:</view> | |||
<view class="num">¥9.9</view> | |||
<view class="num">¥{{salePriceStr*num}}</view> | |||
</view> | |||
<view class="costBox"> | |||
<view class="text">运费:</view> | |||
<view class="num">¥9.9</view> | |||
<view class="num">¥{{freightPriceStr}}</view> | |||
</view> | |||
<view class="accountBox"> | |||
<view class="total">合计</view> | |||
<view class="money">¥15.9</view> | |||
<view class="money">¥{{(salePriceStr*num)+(freightPriceStr*1)}}</view> | |||
</view> | |||
</view> | |||
<view class="payBox"> | |||
<view class="moneyStr">¥15.90</view> | |||
<view class="moneyStr">¥{{(salePriceStr*num)+(freightPriceStr*1)}}</view> | |||
<view class="pay">支付</view> | |||
</view> | |||
</view> | |||
<view class="amendBox" wx:if="{{showShade}}"> | |||
<view class="amendBox" wx:if="{{showShade}}" bindtap="hieShade"> | |||
<view class="siteBox shade"> | |||
<view class="siteItem"> | |||
<view> | |||
<view class="siteTitle"> | |||
<view class="text">北京是朝阳区三环以内</view> | |||
</view> | |||
<view class="siteTitle siteText">北京市朝阳区南磨房东里123号楼234号</view> | |||
<view class="siteTitle phoneBox" style="border-bottom: 1rpx #999 solid;padding-bottom: 20rpx;"> | |||
<view class="name">圣达菲</view> | |||
<view class="phone">138****7654</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="siteItem"> | |||
<view class="siteItem" wx:for="{{seti}}" bindtap="setSite" data-id="{{item.id}}"> | |||
<view> | |||
<view class="siteTitle"> | |||
<view class="text">北京是朝阳区三环以内</view> | |||
<view class="text">{{item.regionStr}}</view> | |||
</view> | |||
<view class="siteTitle siteText">北京市朝阳区南磨房东里123号楼234号</view> | |||
<view class="siteTitle siteText">{{item.address}}</view> | |||
<view class="siteTitle phoneBox" style="border-bottom: 1rpx #999 solid;padding-bottom: 20rpx;"> | |||
<view class="name">圣达菲</view> | |||
<view class="phone">138****7654</view> | |||
<view class="name">{{item.consignee}}</view> | |||
<view class="phone">{{item.mobile}}</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="siteItem"> | |||
<view> | |||
<view class="siteTitle"> | |||
<view class="text">北京是朝阳区三环以内</view> | |||
</view> | |||
<view class="siteTitle siteText">北京市朝阳区南磨房东里123号楼234号</view> | |||
<view class="siteTitle phoneBox" style="border-bottom: 1rpx #999 solid;padding-bottom: 20rpx;"> | |||
<view class="name">圣达菲</view> | |||
<view class="phone">138****7654</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="siteItem"> | |||
<view> | |||
<view class="siteTitle"> | |||
<view class="text">北京是朝阳区三环以内</view> | |||
</view> | |||
<view class="siteTitle siteText">北京市朝阳区南磨房东里123号楼234号</view> | |||
<view class="siteTitle phoneBox" style="border-bottom: 1rpx #999 solid;padding-bottom: 20rpx;"> | |||
<view class="name">圣达菲</view> | |||
<view class="phone">138****7654</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="siteItem"> | |||
<view> | |||
<view class="siteTitle"> | |||
<view class="text">北京是朝阳区三环以内</view> | |||
</view> | |||
<view class="siteTitle siteText">北京市朝阳区南磨房东里123号楼234号</view> | |||
<view class="siteTitle phoneBox" style="border-bottom: 1rpx #999 solid;padding-bottom: 20rpx;"> | |||
<view class="name">圣达菲</view> | |||
<view class="phone">138****7654</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="siteItem"> | |||
<view> | |||
<view class="siteTitle"> | |||
<view class="text">北京是朝阳区三环以内</view> | |||
</view> | |||
<view class="siteTitle siteText">北京市朝阳区南磨房东里123号楼234号</view> | |||
<view class="siteTitle phoneBox" style="border-bottom: 1rpx #999 solid;padding-bottom: 20rpx;"> | |||
<view class="name">圣达菲</view> | |||
<view class="phone">138****7654</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="siteItem"> | |||
<view> | |||
<view class="siteTitle"> | |||
<view class="text">北京是朝阳区三环以内</view> | |||
</view> | |||
<view class="siteTitle siteText">北京市朝阳区南磨房东里123号楼234号</view> | |||
<view class="siteTitle phoneBox" style="border-bottom: 1rpx #999 solid;padding-bottom: 20rpx;"> | |||
<view class="name">圣达菲</view> | |||
<view class="phone">138****7654</view> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
</view> |
@@ -6,6 +6,11 @@ | |||
width: 96%; | |||
margin: 0 auto; | |||
} | |||
.addSeit{ | |||
text-align: center; | |||
padding: 20rpx 0; | |||
} | |||
.siteBox{ | |||
background-color: #fff; | |||
border-radius: 10rpx; | |||
@@ -172,11 +177,11 @@ | |||
top: 0; | |||
position: fixed; | |||
height: 100vh; | |||
background-color: rgba(36, 36, 36, 0.3) | |||
background-color: rgba(36, 36, 36, 0.3); | |||
} | |||
.shade{ | |||
width: 80%; | |||
height: 70vh; | |||
margin: 200rpx auto 0 auto; | |||
max-height: 70vh; | |||
overflow: scroll; | |||
margin: 300rpx auto 0 auto; | |||
} |
@@ -15,6 +15,7 @@ Page({ | |||
fromflag: '', | |||
couponChannelIdflag: '', | |||
wjId: "", | |||
composeOrderType:"", | |||
}, | |||
//是否授权手机号 | |||
judgePhonelngo() { | |||
@@ -56,7 +57,13 @@ Page({ | |||
that.setData({ | |||
fromflag: options.fromflag | |||
}) | |||
} | |||
if (options && options.composeOrderType){ | |||
that.setData({ | |||
composeOrderType: options.composeOrderType | |||
}) | |||
} | |||
// 来自优惠券列表券详情页面的 couponChannelId | |||
if (options && options.couponChannelIdflag) { | |||
that.setData({ | |||
@@ -395,6 +402,10 @@ Page({ | |||
} | |||
}).then( | |||
function(res) { | |||
// wx.showToast({ | |||
// title: "授权个人信息成功11", | |||
// icon: "none" | |||
// }); | |||
if (that.data.wjId) { | |||
app.globalData.skipUrl = `/pages/questionnaire/questionnaire?id=${that.data.wjId}` | |||
app.globalData.skip = 'redirectTo' | |||
@@ -408,7 +419,8 @@ Page({ | |||
return; | |||
} | |||
// | |||
if (that.data.optionData.orderGroupId) { | |||
if (that.data.optionData!=null && that.data.optionData.orderGroupId != null && that.data.optionData.orderGroupId !="" ) { | |||
app.globalData.skipUrl = `/pages/joinFrDpell/index?couponId=${that.data.optionData.couponId}&orderGroupId=${that.data.optionData.orderGroupId}&couponChannelId=${that.data.optionData.couponChannelId}&orderId=${that.data.optionData.orderId}&avatarUrl=${that.data.optionData.avatarUrl}&nickName=${that.data.optionData.nickName}` | |||
app.globalData.skip = 'reLaunch' | |||
that.judgePhonelngo() | |||
@@ -436,29 +448,29 @@ Page({ | |||
app.globalData.skipUrl = `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelId}` | |||
app.globalData.skip = 'redirectTo' | |||
that.judgePhonelngo() | |||
} else if (that.data.optionData.id && app.globalData.type == 'gm') { | |||
} else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'gm') { | |||
// 游戏页面 | |||
that.getGameOne(app.globalData.token, that.data.optionData.id) | |||
} else if (that.data.optionData.id && app.globalData.type == 'td') { | |||
} else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'td') { | |||
app.globalData.skipUrl = `/pages/topicDetail/index?id=${that.data.optionData.id}` | |||
app.globalData.skip = 'redirectTo' | |||
that.judgePhonelngo() | |||
} | |||
// 报名活动 | |||
else if (that.data.optionData.id && app.globalData.type == 'ra') { | |||
else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'ra') { | |||
app.globalData.skipUrl = `/pages/radetail/index?id=${that.data.optionData.id}`, | |||
app.globalData.skip = 'redirectTo' | |||
that.judgePhonelngo() | |||
} | |||
// 报名签到 | |||
else if (that.data.optionData.id && app.globalData.type == 'si') { | |||
else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'si') { | |||
app.globalData.skipUrl = `/pages/acSignIn/index?id=${that.data.optionData.id}`, | |||
app.globalData.skip = 'redirectTo' | |||
that.judgePhonelngo() | |||
} | |||
// 门店详情 | |||
else if (that.data.optionData.id && app.globalData.type == 'md') { | |||
else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'md') { | |||
app.globalData.skipUrl = `/pages/index/searchbar/detail/index?id=${that.data.optionData.id}`, | |||
app.globalData.skip = 'redirectTo' | |||
that.judgePhonelngo() | |||
@@ -468,9 +480,9 @@ Page({ | |||
app.globalData.skipUrl = `/pages/index/searchbar/detail/index?id=${that.data.id}`, | |||
app.globalData.skip = 'redirectTo' | |||
that.judgePhonelngo() | |||
} else if (that.data.optionData.bt && that.data.optionData.id && app.globalData.type == 'bd') { | |||
} else if (that.data.optionData != null && that.data.optionData.bt && that.data.optionData.id && app.globalData.type == 'bd') { | |||
// 宣传页详情 | |||
if (that.data.optionData.bt == '2') { | |||
if (that.data.optionData != null && that.data.optionData.bt == '2') { | |||
// 自由图文 | |||
app.globalData.skipUrl = `/pages/freeBannerDetail/index?id=${that.data.optionData.id}`, | |||
app.globalData.skip = 'redirectTo' | |||
@@ -483,7 +495,7 @@ Page({ | |||
} | |||
} else if (that.data.orderId || that.data.orderId && app.globalData.type == 'bg') { | |||
// 参与砍价 | |||
app.globalData.skipUrl = `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.orderId}`, | |||
app.globalData.skipUrl = `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.orderId}&composeOrderType=${that.composeOrderType}`, | |||
app.globalData.skip = 'navigateTo' | |||
that.judgePhonelngo() | |||
} else if (app.globalData.type == 'uc') { | |||
@@ -604,7 +616,7 @@ Page({ | |||
) | |||
.catch(err => { | |||
wx.showToast({ | |||
title: err.errMsg, | |||
title: err.code, | |||
icon: 'none', | |||
duration: 2000, | |||
mask: false | |||
@@ -8,7 +8,6 @@ Page({ | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
token:"" | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
@@ -84,9 +83,7 @@ Page({ | |||
wx.setStorageSync('imgurl', imgurl); | |||
if (app.globalData.token) { | |||
that.setData({ | |||
token: app.globalData.token | |||
}) | |||
this.updateUserInfo(); | |||
if (options.couponChannelId || options.orderId || options.id) { | |||
@@ -95,14 +92,9 @@ Page({ | |||
that.userStatus(); | |||
} | |||
} else { | |||
// 由于 token 是网络请求,可能会在 Page.onLoad 之后才返回 | |||
// 所以此处加入 callback 以防止这种情况 | |||
app.tokenCallback = token => { | |||
that.setData({ | |||
token: app.globalData.token | |||
}) | |||
this.updateUserInfo(); | |||
if (options.couponChannelId || options.orderId || options.id) { | |||
that.userStatus(options); | |||
@@ -117,6 +109,7 @@ Page({ | |||
* 检查用户的状态 | |||
*/ | |||
userStatus: function(options) { | |||
var that = this; | |||
if (options && (options.couponChannelId || options.orderId || options.id)) { | |||
that.checkuserstatus(options); | |||
@@ -142,6 +135,7 @@ Page({ | |||
}) | |||
}, | |||
checkuserstatus(options) { | |||
let that = this; | |||
Http.get({ | |||
@@ -151,7 +145,6 @@ Page({ | |||
} | |||
}) | |||
.then(res => { | |||
return | |||
// res = JSON.parse('{"code":11004,"message":"用户昵称未授权,请跳转到用户昵称授权页!","data":{}}') | |||
//参与拼团 | |||
@@ -388,16 +381,11 @@ Page({ | |||
} | |||
}) | |||
.catch(err => { | |||
console.log(err) | |||
this.setData({ | |||
err:err | |||
}) | |||
wx.showToast({ | |||
title: err, | |||
icon: "loading", | |||
duration: 20001 | |||
duration: 2000 | |||
}) | |||
return | |||
if (err.code == 11004) { | |||
// 用户昵称未授权 | |||
if (options && options.orderGroupId) { | |||
@@ -1,2 +0,0 @@ | |||
<view class="temp">{{token}}</view> | |||
<view class="">"w lai le "</view> |
@@ -2,10 +2,5 @@ Page{ | |||
height: 100%; | |||
width: 100%; | |||
background:#fff; | |||
/* opacity: 0; */ | |||
} | |||
.temp{ | |||
width: 100%; | |||
height: 100rpx; | |||
margin-top: 40rpx; | |||
opacity: 0; | |||
} |
@@ -25,7 +25,7 @@ Page({ | |||
url: config.api.siteList, | |||
data:{ | |||
pageNum: this.data.pageNum, | |||
pageSize:5, | |||
pageSize:1000, | |||
} | |||
}).then(res=>{ | |||
let tempLsit = res.data.list | |||
@@ -134,9 +134,9 @@ | |||
}, | |||
{ | |||
"id": 10, | |||
"name": "pages/index/index", | |||
"pathName": "pages/index/index", | |||
"query": "orderId=600924863166734336&from=discount&composeOrderType=0", | |||
"name": "123", | |||
"pathName": "pages/bargain/bargainDatail/bargainDatail", | |||
"query": "orderId=601302157553754112&from=discount&composeOrderType=0", | |||
"scene": null | |||
}, | |||
{ | |||
@@ -145,6 +145,13 @@ | |||
"pathName": "pages/fillIndent/fillIndent", | |||
"query": "", | |||
"scene": null | |||
}, | |||
{ | |||
"id": 12, | |||
"name": "授权测试", | |||
"pathName": "/pages/getuserinfo/index", | |||
"query": "", | |||
"scene": null | |||
} | |||
] | |||
} | |||