Browse Source

no message

feature/v1.1.0
xpz2018 6 years ago
parent
commit
713f77cde2
9 changed files with 190 additions and 58 deletions
  1. 65
      app.wxss
  2. 1
      images/question.svg
  3. 105
      pages/activity_detail/activity_detail.js
  4. 25
      pages/activity_detail/activity_detail.wxml
  5. 44
      pages/activity_detail/activity_detail.wxss
  6. 1
      pages/index/index.js
  7. 2
      pages/index/index.wxml
  8. 3
      pages/login/login.js
  9. 2
      pages/mcenter/mcenter.js

65
app.wxss

@ -10,4 +10,69 @@
}
page{
background: #F3F3F3;
}
/* ================== 头像 ==================== */
.cu-avatar {
font-variant: small-caps;
margin: 0;
padding: 0;
display: inline-flex;
text-align: center;
justify-content: center;
align-items: center;
background-color: #ccc;
color: #ffffff;
white-space: nowrap;
position: relative;
width: 64rpx;
height: 64rpx;
background-size: cover;
background-position: center;
vertical-align: middle;
font-size: 1.5em;
}
.cu-avatar.sm {
width: 48rpx;
height: 48rpx;
font-size: 1em;
}
.cu-avatar.lg {
width: 96rpx;
height: 96rpx;
font-size: 2em;
}
.cu-avatar.xl {
width: 128rpx;
height: 128rpx;
font-size: 2.5em;
}
.cu-avatar .avatar-text {
font-size: 0.4em;
}
.round{
border-radius: 50%;
}
.cu-avatar-group {
direction: rtl;
unicode-bidi: bidi-override;
padding: 0 10rpx 0 40rpx;
display: inline-block;
}
.cu-avatar-group .cu-avatar {
margin-left: -30rpx;
border: 4rpx solid #f1f1f1;
vertical-align: middle;
}
.cu-avatar-group .cu-avatar.sm {
margin-left: -20rpx;
border: 1rpx solid #f1f1f1;
}

1
images/question.svg
File diff suppressed because it is too large
View File

105
pages/activity_detail/activity_detail.js

@ -46,6 +46,9 @@ Page({
icon: '../../images/moments_ico.png'
}],
qrImageUrl: "",
groupList:[],
group: null,
showM: true
},
/**
* 生命周期函数--监听页面加载
@ -65,6 +68,33 @@ Page({
this.getActivityDetail();
},
//获取活动拼团列表信息
fetchActivityGroupList: function(){
let that = this;
// /mall/wxa/activity/group/recommend 推荐正在拼的团
wx.request({
url: app.gw.hostUrl + '/mall/wxa/activity/group/recommend',
method: 'get',
data: { activityNo: that.data.activityNo, pageNum: 1, pageSize: 3 },
header: {
'Content-Type': 'application/x-www-form-urlencoded',
'sessionId': wx.getStorageSync('sessionId')
},
success: function (res) {
if(res.data.code == 0){
that.setData({
groupList: res.data.response
})
}
}
})
},
getMemberNickname: function(index){
console.log('index>>' + index)
return 'Index'
},
getActivityDetail: function () {
let that = this;
that.stopInterval();
@ -88,7 +118,6 @@ Page({
'sessionId': wx.getStorageSync('sessionId')
},
success: function (res) {
console.log(res);
var data = res.data;
var status = data.code;
if (status == 0) {
@ -116,14 +145,7 @@ Page({
remark: "block",
tagColor: "#F8B551",
});
if (that.data.currentMemberType == -1) {
//游客
that.setData({
one_content: "none",
two_content: "block",
buttomText: '参与拼团',
});
} else if (that.data.currentMemberType == 0 || that.data.currentMemberType == 10) {
if (that.data.currentMemberType == 0 || that.data.currentMemberType == 10) {
//发起人和邀请人
that.setData({
one_content: "block",
@ -134,18 +156,7 @@ Page({
}
} else if (that.data.groupStatus == 20) {
//拼团成功
if (that.data.currentMemberType == -1) {
//游客
that.setData({
one_content: "block",
two_content: "none",
bottomBGColor: '#F36619',
buttomText: '我要拼团',
grounpInfo: "none",
grounpInfo2: "block",
});
} else if (that.data.currentMemberType == 0 || that.data.currentMemberType == 10) {
if (that.data.currentMemberType == 0 || that.data.currentMemberType == 10) {
//发起人和邀请人
that.setData({
tagColor: "#21BE8D",
@ -160,6 +171,7 @@ Page({
}
} else if (that.data.groupStatus == 90) {
//拼团失败
that.fetchActivityGroupList()
if (that.data.currentMemberType == -1) {
//游客
that.setData({
@ -169,7 +181,6 @@ Page({
buttomText: '我要拼团',
grounpInfo: "none",
grounpInfo2: "block",
});
} else if (that.data.currentMemberType == 0 || that.data.currentMemberType == 10) {
//发起人和邀请人
@ -186,7 +197,6 @@ Page({
});
}
}
} else {
that.countActivityTime(data.response.countdownSec);
that.setData({
@ -194,6 +204,7 @@ Page({
grounpInfo: "none",
grounpInfo2: "none",
});
that.fetchActivityGroupList()
}
} else {
wx.showToast({
@ -300,14 +311,14 @@ Page({
if (that.data.groupNo == "") {
url = '/mall/wxa/activity/group/open';
//首次开团
this.groupOpenOrJoin(url);
this.groupOpenOrJoin(url, that.data.groupNo);
} else {
if (that.data.groupStatus == 10) {
//正在拼团
if (that.data.currentMemberType == -1) {
//游客
url = '/mall/wxa/activity/group/join';
this.groupOpenOrJoin(url);
this.groupOpenOrJoin(url, that.data.groupNo);
} else {
//团长与参与人点击分享
this.openActionsheet();
@ -317,7 +328,7 @@ Page({
if (that.data.currentMemberType == -1) {
//游客
url = '/mall/wxa/activity/group/open';
this.groupOpenOrJoin(url);
this.groupOpenOrJoin(url, that.data.groupNo);
} else {
//团长与参与人立即预约
wx.showModal({
@ -335,13 +346,13 @@ Page({
} else if (that.data.groupStatus == 90) {
//拼团失败
url = '/mall/wxa/activity/group/open';
this.groupOpenOrJoin(url);
this.groupOpenOrJoin(url, that.data.groupNo);
}
}
},
//开团与参团
groupOpenOrJoin: function (url) {
groupOpenOrJoin: function (url, groupNo) {
let that = this;
wx.showToast({
title: '正在调起支付',
@ -353,7 +364,7 @@ Page({
data: {
openid: app.globalData.openid,
activityNo: that.data.activityNo,
groupNo: that.data.groupNo,
groupNo: groupNo,
},
header: {
'Content-Type': 'application/x-www-form-urlencoded',
@ -375,7 +386,6 @@ Page({
groupNo: data.response.orderNo == undefined ? that.data.groupNo : data.response.orderNo,
});
let dr = data.response.weixinTransParameters;
console.log(dr);
wx.requestPayment({//微信支付
"timeStamp": dr.timeStamp,//时间戳
"nonceStr": dr.nonceStr,//随机字符串
@ -383,7 +393,6 @@ Page({
"signType": dr.signType,//签名算法
"paySign": dr.paySign,//签名
"success": function (res) {//成功时回调
console.log(res);
wx.showToast({
title: '支付成功',
icon: 'success',
@ -395,7 +404,6 @@ Page({
})
},
"fail": function (res) {//接口调用失败的回调
console.log(res);
if (res.errMsg == 'requestPayment:fail cancel') {
wx.showToast({
title: '取消支付',
@ -422,13 +430,15 @@ Page({
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
showDialog: function (e) {
if (wx.getStorageSync('sessionId') == '') {
wx.navigateTo({ url: '../login/login' })
return;
}
this.setData({
showM: false,
group: this.data.groupList[e.currentTarget.dataset.index]
})
},
/**
@ -438,18 +448,13 @@ Page({
this.stopInterval();
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
cancelR: function () {
this.setData({ showM: true })
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
confirmR: function () {
this.setData({ showM: true })
this.groupOpenOrJoin('/mall/wxa/activity/group/join', this.data.group.groupNo);
},
//打败Actionsheet,进行分享

25
pages/activity_detail/activity_detail.wxml

@ -38,6 +38,19 @@
</view>
</view>
</view>
<view style="background-color:white;border-top:1rpx solid #f3f3f3" wx:if="{{groupList.length>0}}">
<view style="margin:16rpx 0rpx;font-size:15px;text-algin:center;padding-left:24rpx">推荐拼团,可直接参与</view>
<view class="group_list" wx:for="{{groupList}}" wx:for-item="group" wx:key="{{index}}">
<view style="display:flex;align-items: center">
<view class="cu-avatar-group">
<view class="cu-avatar round lg" wx:for="{{group.members}}" wx:key style="background-image:url({{item.headUrl}});"></view>
</view>
<view style="font-size:28rpx;margin-left:12rpx">{{group.members[0].nickName}}</view>
</view>
<text class="group-btn" data-index="{{index}}" bindtap="showDialog">去拼团</text>
</view>
</view>
<view class='grounp_info' style='display: {{grounpInfo}};'>
<view class='status'>
<text class="tag" style='border-color: {{tagColor}};color: {{tagColor}};'>{{activityDetail.statusDesc}}</text>
@ -62,7 +75,6 @@
<text class="{{item.memberType == 0 ? 'markBlock' : 'markNone'}}">团长</text>
</view>
</view>
</scroll-view>
</view>
</view>
@ -98,4 +110,13 @@
</view>
</view>
<!--底部弹出框-->
<zan-actionsheet show="{{ show }}" actions="{{ actions }}" cancel-with-mask="{{ cancelWithMask }}" bind:cancel="closeActionSheet" bind:actionclick="clickAction" mask-class="tiny" />0
<zan-actionsheet show="{{ show }}" actions="{{ actions }}" cancel-with-mask="{{ cancelWithMask }}" bind:cancel="closeActionSheet" bind:actionclick="clickAction" mask-class="tiny" />
<modal hidden="{{showM}}" title="参与{{group.members[0].nickName}}的拼团" confirm-text="参与拼团" cancel-text="取消" bindcancel="cancelR" bindconfirm="confirmR">
<view class="model_list" style="padding-top:48rpx">
<view class="cu-avatar round lg" style="background-image:url({{group.members[0].headUrl}});margin-right:48rpx">
<view class="cu-tag badge bg-blue">团主</view>
</view>
<view class="cu-avatar round lg" style="background-image:url(/images/question.svg);margin-left:48rpx"></view>
</view>
</modal>

44
pages/activity_detail/activity_detail.wxss

@ -18,7 +18,7 @@ image{
display: flex;
flex-direction: row;
flex-wrap: nowrap;
margin-top: 39rpx;
padding-top: 5px;
}
.activity_info .row0 .sec{
@ -332,4 +332,46 @@ float:right;
background:#F36619;
text-align: center;
float: left;
}
.group_list{
width:100%;
display:flex;
justify-content: space-between;
align-items: center;
padding: 12rpx 6rpx;
border-top:1rpx solid #f3f3f3;
}
.group-btn{
font-size: 28rpx;
width:150rpx;
line-height:32px;
background:rgba(255,160,67,1);
border-radius:18px;
margin-left: 26rpx;
text-align: center;
color: white;
margin-right: 28rpx;
}
.cu-tag.badge {
border-radius: 10rpx;
position: absolute;
top: -10rpx;
right: -10rpx;
font-size: 20rpx;
padding: 0rpx 10rpx;
line-height: 30rpx;
text-align: center;
background-color: #F36619;
color: white;
}
.model_list{
width:100%;
display:flex;
justify-content: center;
align-items: center;
padding: 12rpx 6rpx;
}

1
pages/index/index.js

@ -184,7 +184,6 @@ Page({
* 点击去开团
*/
openGroup: function(e) {
console.log('activityNo:' + e.currentTarget.dataset.item);
wx.navigateTo({
url: '../activity_detail/activity_detail?activityNo=' + e.currentTarget.dataset.item,
})

2
pages/index/index.wxml

@ -32,7 +32,7 @@
<view class='p2'>¥</view>{{item.participantPrice / 100}}
<text class="del">原价:{{item.originalPrice / 100}}</text>
</view>
<button class='openBtn' bindtap='openGroup' form-type="submit" data-item='{{item.activityNo}}' >去拼团</button>
<button class='openBtn' catchtap='openGroup' form-type="submit" data-item='{{item.activityNo}}' >去拼团</button>
</view>
</view>
</view>

3
pages/login/login.js

@ -16,7 +16,6 @@ Page({
this.setData({
mobile: e.detail.value
})
console.log(e.detail.value);
},
inputCode: function (e) {//输入短信动态码事件监听
this.setData({
@ -113,6 +112,7 @@ Page({
}
},
bindFormSubmit: function (e) {//点击登录事件监听
console.log(e.detail)
let that = this;
let mobile = this.data.mobile;
let code = this.data.code;
@ -120,7 +120,6 @@ Page({
var pages = getCurrentPages();
var currPage = pages[pages.length - 1]; //当前页面
var prevPage = pages[pages.length - 2]; //上一个页面
console.log(mobile);
let checkMobile = that.checkForm(mobile,'手机号','mobile');
if(checkMobile!=false){
let checkCode = that.checkForm(code,'验证码','code');

2
pages/mcenter/mcenter.js

@ -67,7 +67,7 @@ Page({
var status = data.code;
if (status == 666){
wx.removeStorageSync('sessionId')
this.setData({ sessionId: null })
that.setData({ sessionId: null })
return
} else if (status != 0) {
wx.showToast({

Loading…
Cancel
Save