From 61766ded95f964179948a77e91632310cbce8681 Mon Sep 17 00:00:00 2001
From: xpz2018 <107107461@qq.com>
Date: Fri, 8 Jun 2018 17:12:56 +0800
Subject: [PATCH] no message
---
app.js | 4 --
pages/activity_detail/activity_detail.js | 18 +++-----
pages/activity_detail/activity_detail.wxss | 4 +-
pages/activity_list/activity_list.js | 13 +++---
pages/login/login.wxml | 2 +-
pages/login/login.wxss | 5 ++-
pages/mcenter/mcenter.js | 49 +++++++++++-----------
pages/pay_result/pay_result.js | 23 ++++++----
wxParse/html2json.js | 2 -
9 files changed, 59 insertions(+), 61 deletions(-)
diff --git a/app.js b/app.js
index 5c55ee5..f67bdfc 100644
--- a/app.js
+++ b/app.js
@@ -59,13 +59,9 @@ App({
success: res => {
// 可以将 res 发送给后台解码出 unionId
that.globalData.userInfo = res.userInfo;
-
-
// this.onLoginUser();
// 发送 res.code 到后台换取 openId, sessionKey, unionId
that.commitUserInfo(that.globalData.openid, res.encryptedData, res.iv);
-
-
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (that.userInfoReadyCallback) {
diff --git a/pages/activity_detail/activity_detail.js b/pages/activity_detail/activity_detail.js
index a15b976..86fbc79 100644
--- a/pages/activity_detail/activity_detail.js
+++ b/pages/activity_detail/activity_detail.js
@@ -55,12 +55,6 @@ Page({
activityNo: options.activityNo == undefined ? "" : options.activityNo,
groupNo: options.groupNo == undefined ? "" : options.groupNo,
});
-
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
},
/**
@@ -81,7 +75,7 @@ Page({
} else {
url = "/mall/wxa/activity/detail";
}
-
+ console.log('msg>>>' + that.data.activityNo + ',' + that.data.groupNo);
wx.request({
url: app.gw.hostUrl + url,
method: 'get',
@@ -94,11 +88,11 @@ Page({
'sessionId': wx.getStorageSync('sessionId')
},
success: function (res) {
+ console.log(res);
var data = res.data;
var status = data.code;
console.log(res);
if (status == 0) {
-
that.setData({
activityDetail: data.response,
activityNo: data.response.activityNo,
@@ -110,7 +104,6 @@ Page({
});
let activityContent = data.response.activityContent;
WxParse.wxParse('activityContent', 'html', activityContent, that);
- console.log("currentMemberType:" + data.response.currentMemberType + "&&status:" + that.data.groupStatus + "&&groupNo" + that.data.groupNo);
//根据状态切换样式
if (that.data.groupNo !=""){
//开团后页面变化
@@ -292,7 +285,6 @@ Page({
groupTap: function (e) {
let that = this;
var url = "";
- console.log("groupNo:" + that.data.groupNo + "¤tMemberType:" + that.data.currentMemberType + "&groupStatus:" + that.data.groupStatus);
if (that.data.groupNo == ""){
url = '/mall/wxa/activity/group/open';
//首次开团
@@ -387,9 +379,9 @@ Page({
icon: 'success',
duration: 2000
})
- var json = JSON.stringify(that.data.activityDetail);
+ console.log(that.data.activityDetail)
wx.navigateTo({
- url: '../pay_result/pay_result?json=' + json
+ url: '../pay_result/pay_result?activityNo=' + that.data.activityNo + '&groupNo=' + that.data.groupNo + '&shareTitle=' + that.data.activityDetail.shareTitle + '&sharePhoto=' + that.data.activityDetail.sharePhoto
})
},
"fail": function (res) {
@@ -412,7 +404,7 @@ Page({
},
fail: function (e) {
wx.showToast({
- title: '网络异常!err:authlogin',
+ title: '网络异常!',
icon: 'none',
duration: 2000
})
diff --git a/pages/activity_detail/activity_detail.wxss b/pages/activity_detail/activity_detail.wxss
index 633bdef..4a6598f 100644
--- a/pages/activity_detail/activity_detail.wxss
+++ b/pages/activity_detail/activity_detail.wxss
@@ -122,7 +122,7 @@ image{
}
.grounp_info .status .tag{
- padding: 5rpx 20rpx;
+ padding: 5rpx 12rpx;
font-size: 24rpx;
width:110px;
height:36px;
@@ -156,7 +156,7 @@ image{
.grounp_info .status .countDownTimeView{
width: 300rpx;
height: 24rpx;
- margin: -6rpx 150rpx auto;
+ margin: -6rpx 162rpx auto;
}
.grounp_info .status .countDownTimeView .countDownTimeText{
diff --git a/pages/activity_list/activity_list.js b/pages/activity_list/activity_list.js
index 124db42..bea9d0c 100644
--- a/pages/activity_list/activity_list.js
+++ b/pages/activity_list/activity_list.js
@@ -65,13 +65,14 @@ Page({
pageNum: that.data.pageNum + 1
});
}
- console.log(that.data.repos);
} else {
- wx.showToast({
- title: res.data.msg,
- icon: 'none',
- duration: 1000
- });
+ if (res.data.code != 0){
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 1000
+ });
+ }
that.setData({
loading: false,
});
diff --git a/pages/login/login.wxml b/pages/login/login.wxml
index 7d5a010..e284248 100644
--- a/pages/login/login.wxml
+++ b/pages/login/login.wxml
@@ -19,5 +19,5 @@
-
+
\ No newline at end of file
diff --git a/pages/login/login.wxss b/pages/login/login.wxss
index ad3b51b..c477bb8 100644
--- a/pages/login/login.wxss
+++ b/pages/login/login.wxss
@@ -28,7 +28,7 @@ button::after{
z-index:3;
}
.detailBox{
- margin-top: 58rpx;
+ margin-top: 60rpx;
background:#fff;
}
.box{
@@ -82,7 +82,8 @@ button::after{
}
.subBtn{
width: 90%;
- margin: 40rpx auto;
+ height: 90rpx;
+ margin: 60rpx auto;
text-align: center;
color: #fff;
background: #1eba84;
diff --git a/pages/mcenter/mcenter.js b/pages/mcenter/mcenter.js
index 597479d..50e90c0 100644
--- a/pages/mcenter/mcenter.js
+++ b/pages/mcenter/mcenter.js
@@ -4,45 +4,46 @@ const app = getApp()
Page({
data: {
- items:[
- { top: 20, title: '我的订单', img:'../../images/order.png',page:'Order'},
- { top: 1, title: '我的活动', img: '../../images/addr.png', page:'Activity'},
- { top: 1, title: '联系客服', img: '../../images/service.png', page:'Transition'}
+ items: [
+ { top: 20, title: '我的订单', img: '../../images/order.png', page: 'Order' },
+ { top: 1, title: '我的活动', img: '../../images/addr.png', page: 'Activity' },
+ { top: 1, title: '联系客服', img: '../../images/service.png', page: 'Transition' }
],
sessionId: ''
},
- //事件处理函数
- bindViewTap: function () {
- wx.navigateTo({
- url: '../logs/logs'
- })
- },
- bindFocus: function () {
- wx.navigateTo({
- title: "goback",
- url: '../jz/jz'
- })
- },
+
goActivity: function (e) {
- wx.navigateTo({
- url: '../activity_list/activity_list'
- })
+ if (this.data.sessionId == undefined || this.data.sessionId.length == 0) {
+ this.goLogin(e);
+ } else {
+ wx.navigateTo({
+ url: '../activity_list/activity_list'
+ })
+ }
},
+
goLogin: function (e) {
wx.navigateTo({
- url: '../login/login'
+ url: '../login/login'
})
},
+
goOrder: function (e) {
- wx.navigateTo({
- url: '../order/order'
- })
+ if (this.data.sessionId == undefined || this.data.sessionId.length == 0) {
+ this.goLogin(e);
+ } else {
+ wx.navigateTo({
+ url: '../order/order'
+ })
+ }
},
+
goTransition: function (e) {
wx.makePhoneCall({
- phoneNumber: '400-6080100'
+ phoneNumber: '400-6080100'
})
},
+
onLoad: function () {
this.setData({
sessionId: wx.getStorageSync('sessionId')
diff --git a/pages/pay_result/pay_result.js b/pages/pay_result/pay_result.js
index d92e16b..552f6e3 100644
--- a/pages/pay_result/pay_result.js
+++ b/pages/pay_result/pay_result.js
@@ -1,6 +1,9 @@
Page({
data: {
- activityDetail: {},
+ activityNo: '',
+ groupNo: "",
+ shareTitle: '',
+ sharePhoto: '',
windowWidth: 0,
windowHeight: 0,
scaleW: 0.85,
@@ -23,7 +26,13 @@ Page({
},
onLoad: function (options) {
- this.data.activityDetail = JSON.parse(options.json);
+ this.setData({
+ activityNo: options.activityNo == undefined ? "" : options.activityNo,
+ groupNo: options.groupNo == undefined ? "" : options.groupNo,
+ shareTitle: options.shareTitle == undefined ? "" : options.shareTitle,
+ sharePhoto: options.sharePhoto == undefined ? "" : options.sharePhoto,
+ });
+ console.log("options>>" + this.data.activityNo + "," + this.data.groupNo + "," + this.data.shareTitle + "," + this.data.sharePhoto);
wx.getSystemInfo({
success: (res) => {
this.setData({
@@ -37,7 +46,7 @@ Page({
url: getApp().gw.hostUrl + '/mall/wxa/activity/group/wxa_code',
method: 'get',
data: {
- groupNo: that.data.activityDetail.groupNo,
+ groupNo: that.data.groupNo,
width: 80,
page: 'index/index'
},
@@ -70,9 +79,9 @@ Page({
*/
onShareAppMessage: function () {
return {
- title: this.data.activityDetail.shareTitle,
- imageUrl: this.data.activityDetail.sharePhoto,
- path: '/pages/activity_detail/activity_detail?activityNo=' + this.data.activityDetail.activityNo + '&groupNo=' + this.data.activityDetail.groupNo,
+ title: this.data.shareTitle,
+ imageUrl: this.data.sharePhoto,
+ path: '/pages/activity_detail/activity_detail?activityNo=' + this.data.activityNo + '&groupNo=' + this.data.groupNo,
};
},
@@ -96,7 +105,7 @@ Page({
},
goActivityInfo: function () {
-
+ wx.navigateBack()
},
togglePopup: function () {
diff --git a/wxParse/html2json.js b/wxParse/html2json.js
index 6909559..b3066fd 100644
--- a/wxParse/html2json.js
+++ b/wxParse/html2json.js
@@ -109,14 +109,12 @@ function html2json(html, bindName) {
var name = attr.name;
var value = attr.value;
if (name == 'class') {
- console.dir(value);
// value = value.join("")
node.classStr = value;
}
// has multi attibutes
// make it array of attribute
if (name == 'style') {
- console.dir(value);
// value = value.join("")
node.styleStr = value;
}