Commit 46cce7e6 by shijiuyan

1

parent 94ec58eb
......@@ -63,10 +63,16 @@ Page({
icon: 'success',
duration: 2000
});
if (res.data.status == 'OK' && res.data.result.recommend) {
wx.redirectTo({
url: '/pages/memberChange/memberChange',
})
} else {
//跳转到首页
wx.switchTab({
url: '../index/index',
});
}
},
fail: function (res) {
......
......@@ -35,7 +35,7 @@
<view class='fufeilook' wx:if="{{fufeiPage==1}}">
<view class='con_fufeilook'>
<view class='top_con_fufeilook'>付费观看</view>
<view>
<view style="margin-top:50px;margin-left:33%;">
金额:<text>{{money}}</text>
</view>
<view class='fufeiBtn'>
......
......@@ -141,7 +141,7 @@ page{
.top_con_fufeilook{
width: 100%;
text-align: center;
font-size: 14px;
font-size: 16px;
}
.fufeiBtn{
position: absolute;
......
......@@ -32,11 +32,24 @@ Page({
var location = wx.getStorageSync('location');
var latitude = location.latitude;
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({
url: app.url + 'ajax_get_user_role.php',
data: {
unionId: config.unionId,
unionId: unionId,
latitude: latitude,
longitude: longitude
},
......@@ -45,7 +58,7 @@ Page({
dataType: 'json',
success: function (res) {
console.log(res)
if(res.statusCode==200){
if (res.statusCode == 200) {
//保存用户当前的省市区县信息
location.province = res.data.result.province
location.city = res.data.result.city
......@@ -62,7 +75,7 @@ Page({
})
//未注册用户的话。跳转到社会人士注册页面
if (res.data.status =="REGIST") {
if (res.data.status == "REGIST") {
//页面跳转
wx.redirectTo({
url: '../socialUserRegister/socialUserRegister',
......@@ -70,11 +83,11 @@ Page({
}
that.setData({
roleTitle: res.data.result.name,
role:res.data.result.role,
role: res.data.result.role,
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({
showFamily: true
})
......
......@@ -46,14 +46,24 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
//如果用户已经注册则跳转到首页
var config = wx.getStorageSync('config');
if (config.registed == true) {
if (config.registed == true && config.unionId !== undefined) {
//跳转到首页
wx.switchTab({
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
import Toast from '../../dist/toast/toast';
const app = getApp();
Page({
......@@ -24,7 +25,7 @@ Page({
},
})
// wx.request({
// url: '',
// url: '',resp.data.result.unionId
// })
},
getInfo(unionId){
......@@ -104,6 +105,25 @@ Page({
},
success:function(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({
},
cancel(){
console.log(1111)
wx.navigateBack({});
wx.redirectTo({
url: '/pages/index/index',
})
}
})
\ No newline at end of file
......@@ -14,3 +14,4 @@
</view>
</view>
</view>
<van-toast id="van-toast" />
......@@ -30,21 +30,29 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
onReady: function () {
// 生命周期函数--监听页面初次渲染完成
//如果用户已经注册则跳转到首页
var config = wx.getStorageSync('config');
setTimeout(
function(){
if (config.registed == true) {
if (config.registed == true && config.unionId !== undefined) {
//跳转到首页
wx.switchTab({
url: '../index/index',
});
}else{
setTimeout(function () {
config = wx.getStorageSync('config');
if (config.registed == true && config.unionId !== undefined) {
//跳转到首页
wx.switchTab({
url: '../index/index',
});
}
}, 1000);
}
},
200
)
},
/**
* 用户点击右上角分享
......@@ -96,11 +104,16 @@ Page({
method: 'GET',
dataType: 'json',
success: function (res) {
if (res.data.status == 'OK' && res.data.result.recommend){
wx.redirectTo({
url: '/pages/memberChange/memberChange',
})
}else{
//跳转到首页
wx.switchTab({
url: '../index/index',
});
}
},
fail: function (res) {
wx.showToast({
......
......@@ -41,14 +41,24 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
//如果用户已经注册则跳转到首页
var config = wx.getStorageSync('config');
if (config.registed == true) {
if (config.registed == true && config.unionId !== undefined) {
//跳转到首页
wx.switchTab({
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;
......@@ -360,7 +370,7 @@ Page({
//机构注册上传各种证明
upload(){
var recommend=true;
var config = wx.getStorageSync('config');
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