Browse Source

细节修改

feature/v1.1.0
lfs3 7 years ago
parent
commit
f20797a0b3
4 changed files with 37 additions and 22 deletions
  1. 47
      pages/activity_detail/activity_detail.js
  2. 7
      pages/activity_detail/activity_detail.wxml
  3. 3
      pages/activity_detail/activity_detail.wxss
  4. 2
      pages/activity_list/activity_list.js

47
pages/activity_detail/activity_detail.js

@ -22,6 +22,7 @@ Page({
countDownHour: 0, countDownHour: 0,
countDownMinute: 0, countDownMinute: 0,
countDownSecond: 0, countDownSecond: 0,
countdownSec: 0,
//根据状态切换样式 //根据状态切换样式
grounpInfo: "block", grounpInfo: "block",
grounpInfo2: "none", grounpInfo2: "none",
@ -79,7 +80,6 @@ Page({
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
//this.countActivityTime(1527609600);
}, },
/** /**
@ -109,7 +109,8 @@ Page({
groupNo: that.data.groupNo, groupNo: that.data.groupNo,
}, },
header: { header: {
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Type': 'application/x-www-form-urlencoded',
'sessionId': wx.getStorageSync('sessionId')
}, },
success: function (res) { success: function (res) {
var data = res.data; var data = res.data;
@ -120,27 +121,29 @@ Page({
that.setData({ that.setData({
activityDetail: data.response, activityDetail: data.response,
activityNo: data.response.activityNo, activityNo: data.response.activityNo,
groupNo: data.response.groupNo == undefined ? "" : data.response.groupNo,
groupNo: data.response.groupNo == undefined ? that.data.groupNo : data.response.groupNo,
memberList: data.response.memberList, memberList: data.response.memberList,
groupStatus: data.response.status, groupStatus: data.response.status,
currentMemberType: data.response.currentMemberType == undefined ? -1 : data.response.currentMemberType, currentMemberType: data.response.currentMemberType == undefined ? -1 : data.response.currentMemberType,
countdownSec: data.response.countdownSec,
}); });
let activityContent = data.response.activityContent; let activityContent = data.response.activityContent;
WxParse.wxParse('activityContent', 'html', activityContent, that); WxParse.wxParse('activityContent', 'html', activityContent, that);
console.log("currentMemberType:" + that.data.groupNo + "status:" + that.data.groupStatus);
//根据状态切换样式 //根据状态切换样式
if (that.data.groupNo !=""){ if (that.data.groupNo !=""){
//开团后页面变化 //开团后页面变化
if (that.data.status == 10){
if (that.data.groupStatus == 10){
//团倒计时时 //团倒计时时
countActivityTime()
that.countActivityTime(data.response.countdownSec);
//正在拼团 //正在拼团
that.setData({ that.setData({
grounpInfo: "block", grounpInfo: "block",
grounpInfo2: "none", grounpInfo2: "none",
remark: "block",
tagColor: "#F8B551", tagColor: "#F8B551",
}); });
if (that.data.currentMemberTyp == -1){
if (that.data.currentMemberType == -1){
//游客 //游客
that.setData({ that.setData({
one_content: "none", one_content: "none",
@ -156,9 +159,9 @@ Page({
buttomText: '邀请好友拼团', buttomText: '邀请好友拼团',
}); });
} }
} else if (that.data.status == 20){
} else if (that.data.groupStatus == 20){
//拼团成功 //拼团成功
if (that.data.currentMemberTyp == -1) {
if (that.data.currentMemberType == -1) {
//游客 //游客
that.setData({ that.setData({
one_content: "block", one_content: "block",
@ -182,9 +185,9 @@ Page({
remarkText: "", remarkText: "",
}); });
} }
} else if (that.data.status == 90){
} else if (that.data.groupStatus == 90){
//拼团失败 //拼团失败
if (that.data.currentMemberTyp == -1) {
if (that.data.currentMemberType == -1) {
//游客 //游客
that.setData({ that.setData({
one_content: "block", one_content: "block",
@ -242,7 +245,7 @@ Page({
*活动倒计时方法 *活动倒计时方法
*/ */
countActivityTime: function (timeStamp) { countActivityTime: function (timeStamp) {
var totalSecond = timeStamp - Date.parse(new Date()) / 1000;
var totalSecond = timeStamp - 1;
var interval = setInterval(function () { var interval = setInterval(function () {
// 秒数 // 秒数
var second = totalSecond; var second = totalSecond;
@ -308,15 +311,17 @@ Page({
//点击团按钮操作 //点击团按钮操作
groupTap: function (e) { groupTap: function (e) {
let that = this;
var url = ""; var url = "";
console.log("groupNo:" + that.data.groupNo + "&currentMemberType:" + that.data.currentMemberType + "&groupStatus:" + that.data.groupStatus);
if (that.data.groupNo == ""){ if (that.data.groupNo == ""){
url = '/mall/wxa/activity/group/group';
url = '/mall/wxa/activity/group/open';
//首次开团 //首次开团
this.groupOpenOrJoin(url); this.groupOpenOrJoin(url);
}else{ }else{
if (that.data.status == 10) {
if (that.data.groupStatus == 10) {
//正在拼团 //正在拼团
if (that.data.currentMemberTyp == -1) {
if (that.data.currentMemberType == -1) {
//游客 //游客
url = '/mall/wxa/activity/group/join'; url = '/mall/wxa/activity/group/join';
this.groupOpenOrJoin(url); this.groupOpenOrJoin(url);
@ -324,11 +329,11 @@ Page({
//团长与参与人点击分享 //团长与参与人点击分享
this.openActionsheet(); this.openActionsheet();
} }
} else if (that.data.status == 20) {
} else if (that.data.groupStatus == 20) {
//拼团成功 //拼团成功
if (that.data.currentMemberTyp == -1) { if (that.data.currentMemberTyp == -1) {
//游客 //游客
url = '/mall/wxa/activity/group/group';
url = '/mall/wxa/activity/group/open';
this.groupOpenOrJoin(url); this.groupOpenOrJoin(url);
} else { } else {
//团长与参与人立即预约 //团长与参与人立即预约
@ -336,9 +341,9 @@ Page({
url: '../order/order', url: '../order/order',
}) })
} }
} else if (that.data.status == 90){
} else if (that.data.groupStatus == 90){
//拼团失败 //拼团失败
url = '/mall/wxa/activity/group/group';
url = '/mall/wxa/activity/group/open';
this.groupOpenOrJoin(url); this.groupOpenOrJoin(url);
} }
} }
@ -376,6 +381,9 @@ Page({
}) })
return; return;
} }
that.setData({
groupNo: data.response.orderNo == undefined ? that.data.groupNo : data.response.orderNo,
});
console.log(data.response); console.log(data.response);
let dr = data.response.weixinTransParameters; let dr = data.response.weixinTransParameters;
console.log(dr); console.log(dr);
@ -457,6 +465,7 @@ Page({
//打败Actionsheet,进行分享 //打败Actionsheet,进行分享
openActionsheet: function () { openActionsheet: function () {
console.log("qrImageUrl:" + this.data.qrImageUrl)
if (this.data.qrImageUrl.length == 0) { if (this.data.qrImageUrl.length == 0) {
wx.showLoading({ wx.showLoading({
title: '正在获取', title: '正在获取',

7
pages/activity_detail/activity_detail.wxml

@ -3,7 +3,10 @@
<scroll-view scroll-x="{{false}}" scroll-y="{{true}}"> <scroll-view scroll-x="{{false}}" scroll-y="{{true}}">
<image src="{{activityDetail.showUrl}}" class="slide-image" mode='widthFix' /> <image src="{{activityDetail.showUrl}}" class="slide-image" mode='widthFix' />
<view class='activity_info'> <view class='activity_info'>
<text class='title'>{{activityDetail.activityName}}</text>
<view class='row0'>
<text class='title'>{{activityDetail.activityName}}</text>
</view>
<view class="row"> <view class="row">
<text class="num">{{activityDetail.limitNum}}人团</text> <text class="num">{{activityDetail.limitNum}}人团</text>
<text class="limit_type">{{activityDetail.limitTypeDesc}}</text> <text class="limit_type">{{activityDetail.limitTypeDesc}}</text>
@ -67,7 +70,7 @@
</view> </view>
</scroll-view> </scroll-view>
<view class='bottom_view'> <view class='bottom_view'>
<view class='one_content' id='one_button' style='display: {{one_content}};background-color:{{bottomBGColor}};' bindtap='groupTap;'>{{buttomText}}</view>
<view class='one_content' id='one_button' style='display: {{one_content}};background-color:{{bottomBGColor}};' bindtap='groupTap'>{{buttomText}}</view>
<view class='two_content' id='two_content' style='display: {{one_content}};'> <view class='two_content' id='two_content' style='display: {{one_content}};'>
<view class='left'>¥{{activityDetail.participantPrice / 100}}</view> <view class='left'>¥{{activityDetail.participantPrice / 100}}</view>
<view class='right' bindtap='groupTap'>{{buttomText}}</view> <view class='right' bindtap='groupTap'>{{buttomText}}</view>

3
pages/activity_detail/activity_detail.wxss

@ -13,7 +13,7 @@ image{
margin: -10rpx auto; margin: -10rpx auto;
} }
.activity_info .title{ .activity_info .title{
width: 80%;
width: 50%;
padding-top: 29rpx; padding-top: 29rpx;
padding-left: 36rpx; padding-left: 36rpx;
font-weight: bold; font-weight: bold;
@ -204,6 +204,7 @@ image{
width: 86rpx; width: 86rpx;
border-radius:43rpx; border-radius:43rpx;
margin: 7rpx auto; margin: 7rpx auto;
background-color: #999;
} }
.grounp_info .list .view .memberList .markBlock{ .grounp_info .list .view .memberList .markBlock{

2
pages/activity_list/activity_list.js

@ -106,8 +106,10 @@ Page({
}, },
itemClick: function (event) { itemClick: function (event) {
var activityNo = event.currentTarget.dataset.activityno; var activityNo = event.currentTarget.dataset.activityno;
var groupNo = event.currentTarget.dataset.groupno; var groupNo = event.currentTarget.dataset.groupno;
console.log("groupNo:" + groupNo);
wx.navigateTo({ wx.navigateTo({
url: '../activity_detail/activity_detail?activityNo=' + activityNo + '&groupNo=' + groupNo url: '../activity_detail/activity_detail?activityNo=' + activityNo + '&groupNo=' + groupNo
}) })

Loading…
Cancel
Save