Commit 46cce7e6 by shijiuyan

1

parent 94ec58eb
...@@ -63,10 +63,16 @@ Page({ ...@@ -63,10 +63,16 @@ Page({
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}); });
//跳转到首页 if (res.data.status == 'OK' && res.data.result.recommend) {
wx.switchTab({ wx.redirectTo({
url: '../index/index', url: '/pages/memberChange/memberChange',
}); })
} else {
//跳转到首页
wx.switchTab({
url: '../index/index',
});
}
}, },
fail: function (res) { fail: function (res) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<view class='fufeilook' wx:if="{{fufeiPage==1}}"> <view class='fufeilook' wx:if="{{fufeiPage==1}}">
<view class='con_fufeilook'> <view class='con_fufeilook'>
<view class='top_con_fufeilook'>付费观看</view> <view class='top_con_fufeilook'>付费观看</view>
<view> <view style="margin-top:50px;margin-left:33%;">
金额:<text>{{money}}</text> 金额:<text>{{money}}</text>
</view> </view>
<view class='fufeiBtn'> <view class='fufeiBtn'>
......
...@@ -141,7 +141,7 @@ page{ ...@@ -141,7 +141,7 @@ page{
.top_con_fufeilook{ .top_con_fufeilook{
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 14px; font-size: 16px;
} }
.fufeiBtn{ .fufeiBtn{
position: absolute; position: absolute;
......
...@@ -32,11 +32,24 @@ Page({ ...@@ -32,11 +32,24 @@ Page({
var location = wx.getStorageSync('location'); var location = wx.getStorageSync('location');
var latitude = location.latitude; var latitude = location.latitude;
var longitude = location.longitude; var longitude = location.longitude;
if(config.unionId!==undefined){
that.getUserRole(config.unionId, latitude, longitude);
}else{
setTimeout(function(){
config = wx.getStorageSync('config');
that.getUserRole(config.unionId, latitude, longitude);
},1000);
}
},
getUserRole(unionId, latitude, longitude){
var that = this;
var location = wx.getStorageSync('location');
var config = wx.getStorageSync('config');
wx.request({ wx.request({
url: app.url + 'ajax_get_user_role.php', url: app.url + 'ajax_get_user_role.php',
data: { data: {
unionId: config.unionId, unionId: unionId,
latitude: latitude, latitude: latitude,
longitude: longitude longitude: longitude
}, },
...@@ -45,7 +58,7 @@ Page({ ...@@ -45,7 +58,7 @@ Page({
dataType: 'json', dataType: 'json',
success: function (res) { success: function (res) {
console.log(res) console.log(res)
if(res.statusCode==200){ if (res.statusCode == 200) {
//保存用户当前的省市区县信息 //保存用户当前的省市区县信息
location.province = res.data.result.province location.province = res.data.result.province
location.city = res.data.result.city location.city = res.data.result.city
...@@ -62,7 +75,7 @@ Page({ ...@@ -62,7 +75,7 @@ Page({
}) })
//未注册用户的话。跳转到社会人士注册页面 //未注册用户的话。跳转到社会人士注册页面
if (res.data.status =="REGIST") { if (res.data.status == "REGIST") {
//页面跳转 //页面跳转
wx.redirectTo({ wx.redirectTo({
url: '../socialUserRegister/socialUserRegister', url: '../socialUserRegister/socialUserRegister',
...@@ -70,11 +83,11 @@ Page({ ...@@ -70,11 +83,11 @@ Page({
} }
that.setData({ that.setData({
roleTitle: res.data.result.name, roleTitle: res.data.result.name,
role:res.data.result.role, role: res.data.result.role,
childAge: res.data.result.childAge childAge: res.data.result.childAge
}) })
//菜单控制[亲子活动] //菜单控制[亲子活动]
if (res.data.result.role == 1 || res.data.result.childAge==1) { if (res.data.result.role == 1 || res.data.result.childAge == 1) {
that.setData({ that.setData({
showFamily: true showFamily: true
}) })
...@@ -98,7 +111,7 @@ Page({ ...@@ -98,7 +111,7 @@ Page({
wx.showToast({ wx.showToast({
title: '数据获取异常', title: '数据获取异常',
}) })
}, },
complete: function (res) { }, complete: function (res) { },
}) })
}, },
......
...@@ -46,14 +46,24 @@ Page({ ...@@ -46,14 +46,24 @@ Page({
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
//如果用户已经注册则跳转到首页
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
if (config.registed == true) { if (config.registed == true && config.unionId !== undefined) {
//跳转到首页 //跳转到首页
wx.switchTab({ wx.switchTab({
url: '../index/index', url: '../index/index',
}); });
} else {
setTimeout(function () {
config = wx.getStorageSync('config');
if (config.registed == true && config.unionId !== undefined) {
//跳转到首页
wx.switchTab({
url: '../index/index',
});
}
}, 1000);
} }
}, },
/** /**
......
// pages/memberChange/memberChange.js // pages/memberChange/memberChange.js
import Toast from '../../dist/toast/toast';
const app = getApp(); const app = getApp();
Page({ Page({
...@@ -24,7 +25,7 @@ Page({ ...@@ -24,7 +25,7 @@ Page({
}, },
}) })
// wx.request({ // wx.request({
// url: '', // url: '',resp.data.result.unionId
// }) // })
}, },
getInfo(unionId){ getInfo(unionId){
...@@ -104,6 +105,25 @@ Page({ ...@@ -104,6 +105,25 @@ Page({
}, },
success:function(resp){ success:function(resp){
console.log(resp) console.log(resp)
if(resp.data.status=='OK'){
var result = JSON.parse(resp.data.result);
wx.requestPayment({
timeStamp: result.timeStamp,
nonceStr: result.nonceStr,
package: result.package,
signType: 'MD5',
paySign: result.paySign,
success(res) {
Toast.success('支付成功');
wx.redirectTo({
url: '/pages/index/index',
})
},
fail(res) {
Toast.fail('支付失败');
}
})
}
} }
}) })
} }
...@@ -112,6 +132,8 @@ Page({ ...@@ -112,6 +132,8 @@ Page({
}, },
cancel(){ cancel(){
console.log(1111) console.log(1111)
wx.navigateBack({}); wx.redirectTo({
url: '/pages/index/index',
})
} }
}) })
\ No newline at end of file
...@@ -14,3 +14,4 @@ ...@@ -14,3 +14,4 @@
</view> </view>
</view> </view>
</view> </view>
<van-toast id="van-toast" />
...@@ -30,21 +30,29 @@ Page({ ...@@ -30,21 +30,29 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
},
onReady: function () {
// 生命周期函数--监听页面初次渲染完成
//如果用户已经注册则跳转到首页 //如果用户已经注册则跳转到首页
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
setTimeout( if (config.registed == true && config.unionId !== undefined) {
function(){ //跳转到首页
if (config.registed == true) { wx.switchTab({
url: '../index/index',
});
}else{
setTimeout(function () {
config = wx.getStorageSync('config');
if (config.registed == true && config.unionId !== undefined) {
//跳转到首页 //跳转到首页
wx.switchTab({ wx.switchTab({
url: '../index/index', url: '../index/index',
}); });
} }
}, }, 1000);
200 }
)
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
...@@ -96,11 +104,16 @@ Page({ ...@@ -96,11 +104,16 @@ Page({
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
success: function (res) { success: function (res) {
//跳转到首页 if (res.data.status == 'OK' && res.data.result.recommend){
wx.switchTab({ wx.redirectTo({
url: '../index/index', url: '/pages/memberChange/memberChange',
}); })
}else{
//跳转到首页
wx.switchTab({
url: '../index/index',
});
}
}, },
fail: function (res) { fail: function (res) {
wx.showToast({ wx.showToast({
......
...@@ -41,14 +41,24 @@ Page({ ...@@ -41,14 +41,24 @@ Page({
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
//如果用户已经注册则跳转到首页
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
if (config.registed == true) { if (config.registed == true && config.unionId !== undefined) {
//跳转到首页 //跳转到首页
wx.switchTab({ wx.switchTab({
url: '../index/index', url: '../index/index',
}); });
} else {
setTimeout(function () {
config = wx.getStorageSync('config');
if (config.registed == true && config.unionId !== undefined) {
//跳转到首页
wx.switchTab({
url: '../index/index',
});
}
}, 1000);
} }
//获取机构注册说明文本 //获取机构注册说明文本
var x=this; var x=this;
...@@ -360,7 +370,7 @@ Page({ ...@@ -360,7 +370,7 @@ Page({
//机构注册上传各种证明 //机构注册上传各种证明
upload(){ upload(){
var recommend=true;
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
var that = this; var that = this;
//循环上传图片 //循环上传图片
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment