Commit 744f7665 by wangyalan-git

修改登录/邀请背景图片

parent 01eeb0b7
...@@ -9,6 +9,7 @@ App({ ...@@ -9,6 +9,7 @@ App({
if (token) { if (token) {
let user = wx.getStorageSync('user') let user = wx.getStorageSync('user')
this.globalData.userInfo = JSON.parse(user) this.globalData.userInfo = JSON.parse(user)
this.globalData.shareCode = wx.getStorageSync('shareCode')
} }
}, },
goLogin: function () { goLogin: function () {
......
...@@ -25,6 +25,6 @@ ...@@ -25,6 +25,6 @@
<checkbox color="#eb2444" data-couponid="{{item.couponId}}" checked="{{item.choose}}" bindtap="checkCoupon"></checkbox> <checkbox color="#eb2444" data-couponid="{{item.couponId}}" checked="{{item.choose}}" bindtap="checkCoupon"></checkbox>
</view> </view>
</view> </view>
<image class="tag-img" src="../../images/icon/coupon-used.png" wx:if="{{type==1}}"></image> <!-- <image class="tag-img" src="../../images/icon/coupon-used.png" wx:if="{{type==1}}"></image>
<image class="tag-img" src="../../images/icon/coupon-ot.png" wx:if="{{type==2}}"></image> <image class="tag-img" src="../../images/icon/coupon-used.png" wx:if="{{type==2}}"></image> -->
</view> </view>
\ No newline at end of file
images/icon/poster1@2x.png

116 KB | W: | H:

images/icon/poster1@2x.png

326 KB | W: | H:

images/icon/poster1@2x.png
images/icon/poster1@2x.png
images/icon/poster1@2x.png
images/icon/poster1@2x.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -27,18 +27,23 @@ Page({ ...@@ -27,18 +27,23 @@ Page({
}, },
onLoad: function (options) { onLoad: function (options) {
let token = wx.getStorageSync('token') let token = wx.getStorageSync('token')
let shareCode = wx.getStorageSync('shareCode')
this.getAllData(); this.getAllData();
// 登录返回
shareCode && token && this.boundParentByShareCode(app.globalData.shareCode);
// 如果是点击转发跳转进来,分析参数page // 如果是点击转发跳转进来,分析参数page
if (options.shareCode) { if (options.shareCode) {
app.globalData.shareCode = options.shareCode app.globalData.shareCode = options.shareCode
wx.setStorageSync('shareCode', options.shareCode)
token && this.boundParentByShareCode(options.shareCode); // 绑定内容获取 token && this.boundParentByShareCode(options.shareCode); // 绑定内容获取
} }
// 登录返回 console.log('邀请码',shareCode)
app.globalData.shareCode && token && this.boundParentByShareCode(app.globalData.shareCode);
// 扫码页面渲染完成 // 扫码页面渲染完成
if (options.scene) { if (options.scene) {
let scene = decodeURIComponent(options.scene); let scene = decodeURIComponent(options.scene);
app.globalData.shareCode = scene.split("=")[1]; app.globalData.shareCode = scene.split("=")[1];
wx.setStorageSync('shareCode', scene.split("=")[1])
token && this.boundParentByShareCode(app.globalData.shareCode) token && this.boundParentByShareCode(app.globalData.shareCode)
} }
...@@ -80,9 +85,11 @@ Page({ ...@@ -80,9 +85,11 @@ Page({
}, },
callBack: (res) => { callBack: (res) => {
app.globalData.shareCode = '' app.globalData.shareCode = ''
wx.setStorageSync('shareCode', '')
console.log("绑定成功", res) console.log("绑定成功", res)
}, },
errCallBack: (res) => { errCallBack: (res) => {
console.log("res",res)
} }
}; };
......
...@@ -11,7 +11,7 @@ Page({ ...@@ -11,7 +11,7 @@ Page({
onGotUserInfo: function (data) { onGotUserInfo: function (data) {
const that = this, userInfo = data.detail.userInfo const that = this, userInfo = data.detail.userInfo
this.data.wxUserInfo = data.detail.userInfo this.data.wxUserInfo = data.detail.userInfo
console.log('info', data.detail.userInfo) console.log('info',data, data.detail.userInfo)
if (userInfo) { if (userInfo) {
this.getToken() this.getToken()
} }
...@@ -31,10 +31,10 @@ Page({ ...@@ -31,10 +31,10 @@ Page({
principal: res.code principal: res.code
}, },
callBack: result => { callBack: result => {
console.log('token2', result) console.log('result-login', result)
// 没有获取到用户昵称,说明服务器没有保存用户的昵称,也就是用户授权的信息并没有传到服务器 // 没有获取到用户昵称,说明服务器没有保存用户的昵称,也就是用户授权的信息并没有传到服务器
if (!result.nickName) { if (!result.nickName) {
updateUserInfo(); this.updateUserInfo();
} }
if (result.userStutas == 0) { if (result.userStutas == 0) {
wx.showModal({ wx.showModal({
...@@ -45,6 +45,7 @@ Page({ ...@@ -45,6 +45,7 @@ Page({
wx.setStorageSync('token', ''); wx.setStorageSync('token', '');
} else { } else {
wx.setStorageSync('token', 'bearer' + result.access_token); //把token存入缓存,请求接口数据时要用 wx.setStorageSync('token', 'bearer' + result.access_token); //把token存入缓存,请求接口数据时要用
console.log("拿去用户新", wx.getStorageSync('token'))
this.getUserInfo() this.getUserInfo()
} }
var globalData = getApp().globalData; var globalData = getApp().globalData;
...@@ -80,6 +81,7 @@ Page({ ...@@ -80,6 +81,7 @@ Page({
updateUserInfo: function () { updateUserInfo: function () {
wx.getUserInfo({ wx.getUserInfo({
success: (res) => { success: (res) => {
console.log('111111更新用户信息',res)
var userInfo = JSON.parse(res.rawData) var userInfo = JSON.parse(res.rawData)
http.request({ http.request({
url: "/p/user/setUserInfo", url: "/p/user/setUserInfo",
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<!-- 用户信息 --> <!-- 用户信息 -->
<view class='userinfo'> <view class='userinfo'>
<view class='userinfo-avatar'> <view class='userinfo-avatar'>
<!-- <open-data type="userAvatarUrl"></open-data> --> <open-data type="userAvatarUrl"></open-data>
<image class="user-icon" src="{{userInfo.pic}}"></image> <!-- <image class="user-icon" src="{{userInfo.pic}}"></image> -->
</view> </view>
<view class='userinfo-name'> <view class='userinfo-name'>
<!-- <open-data type="userNickName"></open-data> --> <open-data type="userNickName"></open-data>
<view>{{userInfo.nickName || '未登录'}}</view> <!-- <view>{{userInfo.nickName || '未登录'}}</view> -->
</view> </view>
</view> </view>
<view class="prod-col" style="margin-top: 0;padding-top: 0;"> <view class="prod-col" style="margin-top: 0;padding-top: 0;">
......
...@@ -21,6 +21,7 @@ function request(params, isGetTonken) { ...@@ -21,6 +21,7 @@ function request(params, isGetTonken) {
dataType: 'json', dataType: 'json',
responseType: params.responseType == undefined ? 'text' : params.responseType, responseType: params.responseType == undefined ? 'text' : params.responseType,
success: function (res) { success: function (res) {
console.log('res',res)
if (res.statusCode == 200) { if (res.statusCode == 200) {
console.log(res.data.code) console.log(res.data.code)
//如果有定义了params.callBack,则调用 params.callBack(res.data) //如果有定义了params.callBack,则调用 params.callBack(res.data)
...@@ -29,11 +30,14 @@ function request(params, isGetTonken) { ...@@ -29,11 +30,14 @@ function request(params, isGetTonken) {
params.callBack(res.data); params.callBack(res.data);
} }
} else { } else {
if (params.errCallBack) {
params.errCallBack(res);
}else {
wx.showToast({ wx.showToast({
title: res.data.note, title: res.data.note,
icon: "none" icon: "none"
}); });
}
} }
} else if (res.statusCode == 500) { } else if (res.statusCode == 500) {
wx.showToast({ wx.showToast({
...@@ -66,6 +70,7 @@ function request(params, isGetTonken) { ...@@ -66,6 +70,7 @@ function request(params, isGetTonken) {
} }
}, },
fail: function (err) { fail: function (err) {
console.log('err',err)
wx.hideLoading(); wx.hideLoading();
wx.showToast({ wx.showToast({
title: "服务器出了点小差", title: "服务器出了点小差",
......
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