Authored by 邱骏

个人中心样式修改

... ... @@ -104,5 +104,17 @@ export default {
limitProductCode
}
});
},
getUserInfoByUnionId(name, unionId) {
return api.get({
url: '',
data: {
nickname: name,
openId: unionId,
source_type: 'wechat',
method: 'app.passport.signinByOpenID'
}
});
}
};
... ...
... ... @@ -48,8 +48,8 @@ const PRODUCT_SOURCE_TYPE = {
const ASSIST_STATUS = {
UNKNOWN: 0,
UN_ASSIST: 1,
ASSIST_FULL: 2,
UN_ASSIST: 1, // 本人不用助力
ASSIST_FULL: 2, // 人数已满
ASSIST_ACTION: 3,
ASSIST_ALREADY_ACTION: 4, // 已助力
};
... ... @@ -154,11 +154,6 @@ Page(Object.assign({
this.init();
}, app ? 0 : 1000);
},
init() {
this.productInfo().then(() => {
this.getAssistInfo();
});
},
onShareAppMessage: function(res) {
let params = {
FROM: res.from,
... ... @@ -326,7 +321,9 @@ Page(Object.assign({
assistStatus = ASSIST_STATUS.ASSIST_FULL;
} else {
// 不是发起者
if (this.data.originUid && this.data.originUnionID && this.data.originUnionID !== app.getUnionID()) {
if ((this.data.originUid && this.data.originUid !== this.data.uid) ||
(this.data.originUnionID && this.data.originUnionID !== app.getUnionID())
) {
assistStatus = ASSIST_STATUS.ASSIST_ACTION;
} else {
assistStatus = ASSIST_STATUS.UN_ASSIST;
... ... @@ -542,15 +539,18 @@ Page(Object.assign({
router.go('home');
},
reload() {
this.onLoad({
limitProductCode: this.data.limitProductCode
});
this.setData({
queueSuccess: QUEUE_SUCCESS.UNKNOWN,
assistSuccess: ASSIST_SUCCESS.UNKNOWN,
error: false
});
this.hideAlert();
this.onLoad({
limitProductCode: this.data.limitProductCode
});
this.init();
},
goQueueList() {
router.go('queueIndex', Object.assign({
... ... @@ -592,8 +592,7 @@ Page(Object.assign({
refreshText: '加载中...'
});
this.productInfo().then(() => {
this.getAssistInfo();
this.init().then(() => {
wx.stopPullDownRefresh();
this.setData({
refreshText: '下拉刷新'
... ... @@ -609,5 +608,46 @@ Page(Object.assign({
this.setData({
modal: true
});
},
init() {
return Promise.all([
this.productInfo(),
this.getUid()
]).then(() => {
return this.getAssistInfo();
});
},
_getUid() {
let userInfo = app.getUserInfo();
if (!userInfo.wechat) {
return Promise.resolve();
}
if (this.data.uid) {
return Promise.resolve();
}
let nickName = userInfo.wechat.nickName;
let unionID = app.getUnionID();
if (!nickName || !unionID) {
return Promise.resolve();
}
return detailModel.getUserInfoByUnionId(nickName, unionID).then(result => {
if (result.code === 200 && result.data.is_bind === 'Y' && result.data.uid) {
return result.data.uid;
}
});
},
getUid() {
return this._getUid().then(uid => {
if (uid) {
this.setData({
uid
});
}
});
}
}, Actionsheet));
... ...
... ... @@ -45,10 +45,10 @@
<action-bar wx:if="{{assistStatus === 1}}">
<form bindsubmit="assistShare" report-submit='true'>
<view class="bottom1-action">
<button class="action-btn" formType="submit">邀请好友助力获取限购码</button>
<view class="help" bindtap="goHelp">?</view>
</view>
<view class="bottom1-action">
<button class="action-btn" formType="submit">邀请好友助力获取限购码</button>
<view class="help" bindtap="goHelp">?</view>
</view>
</form>
</action-bar>
... ...
function init(ctx) {
let data = {};
let view = ctx.data.pickerData.view;
data.sourceType = ctx.data.pickerData.sourceType;
data.view = view;
ctx.setData({
pickerData: data
});
}
function pickerShow(ctx) {
let data = ctx.data.pickerData;
data.view.isShow = !data.view.isShow;
ctx.setData({
pickerData: data
});
}
function pickerHide(ctx) {
let data = ctx.data.pickerData;
data.view.isShow = false;
ctx.setData({
pickerData: data
});
}
module.exports = {
init: init,
pickerShow: pickerShow,
pickerHide: pickerHide
};
<template name="Picker">
<view class="picker-bg" id="picker-bg" catchtap="hidePicker" disable-scroll='true' catchtouchmove="catchtouchmove"
style="display:{{pickerData.view.isShow ? 'block':'none'}}">
<view class="picker-view">
<view class="pickerGoodsInfo">
<image class="img" src="{{pickerData.view.image}}">
</image>
<image class="placeholder"></image>
<view class="goodPrice">
<text class="realPrice">
{{pickerData.view.goodPrice==='0'?pickerData.view.price:pickerData.view.goodPrice}}
</text>
<text class="price" style="display:{{pickerData.view.goodPrice==='0'?'none':''}}">
{{pickerData.view.price}}
</text>
</view>
</view>
<view class="seperatorLine"></view>
<scroll-view scroll-y="true" style="height: 450rpx;">
<view class="goodsColor">
<text class="title">颜色</text>
<view class="list">
<block wx:for="{{pickerData.view.goodsList}}" wx:key="unique">
<view id="{{index}}" class="{{item.selected?'selectedItem':'normalItem'}}"
bindtap="chooseColor"
data-key="{{item}}">{{item.factory_goods_name}}
</view>
</block>
</view>
</view>
<view class="seperatorLine"></view>
<view class="goodsSize">
<text class="title">尺码</text>
<view class="list">
<block wx:for="{{pickerData.view.sizeList}}" wx:key="unique">
<view id="{{index}}"
class="{{ item.enable?(item.selected?'selectedItem':'normalItem'):'disableItem'}}"
bindtap="chooseSize" data-key="{{item}}">{{item.size_name}}
</view>
</block>
</view>
</view>
<view class="seperatorLine"></view>
<view wx:if='{{!pickerData.view.should_hidden_number_view}}' class="goodsCount">
<text class="title">数量</text>
<view class="stepper">
<view bindtap="bindMinus" class='reduceNumberBtn'>
<image class='reduceImage'
src='{{pickerData.view.minusButtonEnable ? "../../../static/images/jian_h@2x.png" : "../../../static/images/jian_disable@2x.png"}}'></image>
</view>
<view class='buyNumberText'>
{{pickerData.view.buyNumber}}
</view>
<view bindtap="bindPlus" class='addNumberBtn'>
<image class='addImage'
src='{{pickerData.view.plusButtonEnable ? "../../../static/images/and_normal@2x.png" : "../../../static/images/and_h@2x.png"}}'></image>
</view>
</view>
<view wx:if="{{pickerData.view.isSoldOutSoon}}" class='soldSoonOut'>
即将售罄
</view>
<view wx:if="{{pickerData.view.buy_limit_number}}" class='soldSoonOut'>
限购{{pickerData.view.buy_limit_number}}件
</view>
<view wx:if="{{pickerData.view.bundle_count}}" class='soldSoonOut'>
{{pickerData.view.bundle_count}}件起售
</view>
</view>
</scroll-view>
<view wx:if="{{pickerData.sourceType == 'goodsDetail' && pickerData.view.buyButtonEnable}}"
class="{{pickerData.view.buyButtonEnable?'buyButton':'buyButtonDisable'}}" bindtap="goPayment"
data-type='{{pickerData}}'>
<text class="title">确定</text>
</view>
<view wx:if="{{pickerData.sourceType == 'goodsDetail' && !pickerData.view.buyButtonEnable}}"
class="{{pickerData.view.buyButtonEnable?'buyButton':'buyButtonDisable'}}" data-type='{{pickerData}}'>
<text class="title">已售罄</text>
</view>
</view>
</view>
</template>
.picker-bg{
position: fixed;
z-index: 999;
left: 0;
bottom: 0;
width: 100%;
height: 100%;
margin: 0;
border-top: 1px #eee solid;
background-color: rgba(0, 0, 0, 0.2);
}
.picker-bg .picker-view{
position: fixed;
z-index: 9999;
width:100%;
height: 800rpx;
left:0;
bottom: 0;
background-color: white;
}
.picker-view .pickerGoodsInfo{
display: flex;
margin-bottom: 50rpx;
}
.picker-view .pickerGoodsInfo .img{
position: absolute;
top: -30rpx;
margin-left: 30rpx;
width: 164rpx;
height: 228rpx;
border:1rpx solid #e0e0e0;
border-radius: 5rpx;
/*background-color: red;*/
}
.picker-view .pickerGoodsInfo .placeholder{
margin-left: 30rpx;
width: 164rpx;
height: 180rpx;
}
.picker-view .pickerGoodsInfo .goodPrice{
display: flex;
width: 500 rpx;
margin-left: 20rpx;
margin-top: 20rpx;
height: 70rpx;
}
.picker-view .pickerGoodsInfo .goodPrice .realPrice{
padding-left: 25rpx;
color: #d0021b;
line-height: 70rpx;
font-size: 28rpx;
}
.picker-view .pickerGoodsInfo .goodPrice .price{
padding-left: 15rpx;
color: #b0b0b0;
text-decoration: line-through;
line-height: 70rpx;
font-size: 28rpx;
}
.picker-view .goodsColor{
margin:30rpx;
display: flex;
flex-direction: row;
}
.picker-view .goodsColor .title{
font-size: 28rpx;
color: #444444;
text-align: left;
padding: 20rpx 0;
width: 60rpx;
font-weight: bold;
white-space: nowrap;
}
.picker-view .goodsColor .list{
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding-left: 10rpx;
}
.normalItem{
font-size: 28rpx;
text-align: center;
border: 1px solid #444;
margin: 5px;
padding: 5px;
border-radius: 3px;
min-width: 40rpx;
}
.disableItem{
font-size: 28rpx;
text-align: center;
border: 1px solid #e0e0e0;
margin: 5px;
padding: 5px;
border-radius: 3px;
color: #e0e0e0;
min-width: 40rpx;
}
.selectedItem{
font-size: 28rpx;
text-align: center;
border: 1px solid #d0021b;
margin: 5px;
padding: 5px;
border-radius: 3px;
color: white;
background-color: #d0021b;
min-width: 40rpx;
}
.picker-view .goodsSize{
margin: 30rpx;
display: flex;
flex-direction: row;
}
.picker-view .goodsSize .title{
font-size: 28rpx;
color: #444444;
text-align: left;
width: 60rpx;
padding: 20rpx 0;
font-weight: bold;
white-space: nowrap;
}
.picker-view .goodsSize .list{
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin-left: 10rpx;
flex: 90%;
}
.picker-view .goodsSize .list .item{
font-size: 28rpx;
text-align: center;
border: 1px solid #444;
margin: 5px;
padding: 5px;
border-radius: 3px;
}
.picker-view .goodsCount{
display: flex;
margin: 30rpx;
flex-direction: row;
flex-wrap: wrap;
float: left;
align-items: center;
}
.picker-view .goodsCount .title{
font-size: 28rpx;
color: #444444;
text-align: left;
padding: 20rpx 0;
font-weight: bold;
width: 60rpx;
}
.stepper {
border: 2rpx solid #e0e0e0;
border-radius: 6rpx;
width: 240rpx;
height: 60rpx;
margin-left: 20rpx;
justify-content: space-between;
display: flex;
align-items: center;
flex-direction: row;
}
.buyButton{
position: absolute;
width: 100%;
height: 100rpx;
bottom: 0;
background: #d0021b;
justify-content: space-around;
}
.buyButton .title{
position: absolute;
color: white;
font-size: 34rpx;
line-height: 50rpx;
width: 100%;
text-align: center;
height: 70rpx;
bottom: 0;
}
.buyButtonDisable{
position: absolute;
width: 100%;
height: 100rpx;
bottom: 0;
background: #b0b0b0;
justify-content: space-around;
}
.buyButtonDisable .title{
position: absolute;
color: white;
font-size: 34rpx;
line-height: 50rpx;
width: 100%;
text-align: center;
height: 70rpx;
bottom: 0;
}
.seperatorLine {
/*position: absolute;*/
display: flex;
width:100%;
/*margin: 30rpx;*/
height:1rpx;
background:#e0e0e0;
}
.reduceNumberBtn {
width: 70rpx;
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
border-right: solid 2rpx #e0e0e0;
}
.addNumberBtn {
width: 70rpx;
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
border-left: solid 2rpx #e0e0e0;
}
.buyNumberText{
font-family: PingFang-SC;
font-size: 28rpx;
text-align: center;
color: #444444;
width: 94rpx;
}
.reduceImage {
width: 24rpx;
height: 4rpx;
}
.addImage {
width: 24rpx;
height: 24rpx;
}
.soldSoonOut {
font-size: 28rpx;
color: #d0021b;
margin-left: 20rpx;
}
... ... @@ -33,7 +33,7 @@
"list": []
},
"miniprogram": {
"current": -1,
"current": 0,
"list": [
{
"id": 0,
... ...