Commit 200dfa4f by 赵雅纹

首页

parent 5a749ff2
{ {
"pages": [ "pages": [
"pages/userCenter/userCenter", "pages/userCenter/userCenter",
"pages/welcome/welcome",
"pages/mySpend/mySpend", "pages/mySpend/mySpend",
"pages/memberOfOwn/memberOfOwn", "pages/memberOfOwn/memberOfOwn",
"pages/memberRules/memberRules", "pages/memberRules/memberRules",
......
...@@ -24,7 +24,8 @@ Component({ ...@@ -24,7 +24,8 @@ Component({
indicatorDots: true, indicatorDots: true,
autoplay: true, autoplay: true,
interval: 5000, interval: 5000,
duration: 1000 duration: 1000,
isAuthorization: false
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
...@@ -34,26 +35,34 @@ Component({ ...@@ -34,26 +35,34 @@ Component({
const {appid, path} = e.currentTarget.dataset const {appid, path} = e.currentTarget.dataset
// 获取当前帐号信息 // 获取当前帐号信息
const accountInfo = utils.getAccountInfo() const accountInfo = utils.getAccountInfo()
const userInfo = wx.getStorageSync('_baseUserInfo')
if (userInfo){
// 是当前小程序 直接跳转
if(accountInfo.miniProgram.appId == appid){
wxService.router(`${path}`)
} else {
// 跳转其他小程序
wx.navigateToMiniProgram({
appId: appid,
path: `${path}`,
success: e => {
console.log(e)
},
fail: e => {
console.log(e)
},
complete: e => {
console.log(e)
},
})
}
}else{
console.log('1111')
this.setData({
isAuthorization: true
})
}
// 是当前小程序 直接跳转
if(accountInfo.miniProgram.appId == appid){
wxService.router(`${path}`)
} else {
// 跳转其他小程序
wx.navigateToMiniProgram({
appId: appid,
path: `${path}`,
success: e => {
console.log(e)
},
fail: e => {
console.log(e)
},
complete: e => {
console.log(e)
},
})
}
} }
} }
}) })
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {
"authorization-modal": "./../../component/authorization-modal/authorization-modal"
}
} }
\ No newline at end of file
...@@ -11,3 +11,5 @@ ...@@ -11,3 +11,5 @@
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
<authorization-modal isAuthorization='{{isAuthorization}}'/>
...@@ -27,7 +27,8 @@ Component({ ...@@ -27,7 +27,8 @@ Component({
memberActivateStatus: false, memberActivateStatus: false,
integralNum: 0, integralNum: 0,
couponNum: 0, couponNum: 0,
baseUrl:'/assets/imgs/user-bg.png' baseUrl:'/assets/imgs/user-bg.png',
isAuthorization: false
}, },
attached () { attached () {
this.setData({ this.setData({
...@@ -53,12 +54,17 @@ Component({ ...@@ -53,12 +54,17 @@ Component({
toCouponList() { toCouponList() {
wxService.router(`/pages/coupons/coupons`) wxService.router(`/pages/coupons/coupons`)
}, },
// 点击编辑
handelPersonCenter() {
console.log('点击编辑')
},
handleTtoActiveMemebr() { handleTtoActiveMemebr() {
wxService.openCard() if (wx.getStorageSync('_baseUserInfo')){
if (!this.data.memberCardNo){
wxService.openCard()
}
}else{
this.setData({
isAuthorization:true
})
}
}, },
handleGoWxCard() { handleGoWxCard() {
console.log('kabao') console.log('kabao')
......
{ {
"usingComponents": {} "usingComponents": {
"authorization-modal": "./../../component/authorization-modal/authorization-modal"
}
} }
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<view class='user-name'> <view class='user-name'>
<open-data type="userNickName" class="userinfo-nickname" lang="zh_CN"></open-data> <open-data type="userNickName" class="userinfo-nickname" lang="zh_CN"></open-data>
<navigator url='/pages/memberOfOwn/memberOfOwn' style='display:inline-block' hover-class="none"> <navigator url='/pages/memberOfOwn/memberOfOwn' style='display:inline-block' hover-class="none">
<image class='icon-edit' src='/assets/imgs/icon-edit.png' bindtap="handelPersonCenter"></image> <image class='icon-edit' src='/assets/imgs/icon-edit.png'></image>
</navigator> </navigator>
</view> </view>
<view class='user-id'>{{memberCardNo}}</view> <view class='user-id'>{{memberCardNo}}</view>
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
<view class='point-desc' style="color:{{personCenter.fontColor}};">优惠券</view> <view class='point-desc' style="color:{{personCenter.fontColor}};">优惠券</view>
</view> </view>
</view> </view>
<authorization-modal isAuthorization='{{isAuthorization}}'/>
<!-- <view class="activation-content activation-bg {{true ? 'user-content' : ''}}" style="{{personData.backgroundImageUrl ? 'background-image: url('+ personData.backgroundImageUrl +');' : 'background-image: url(../../assets/imgs/user-bg.png);'}}"> <!-- <view class="activation-content activation-bg {{true ? 'user-content' : ''}}" style="{{personData.backgroundImageUrl ? 'background-image: url('+ personData.backgroundImageUrl +');' : 'background-image: url(../../assets/imgs/user-bg.png);'}}">
<view class='user-info'> <view class='user-info'>
......
...@@ -21,7 +21,8 @@ Component({ ...@@ -21,7 +21,8 @@ Component({
*/ */
data: { data: {
imagewidth: 0,//缩放后的宽 imagewidth: 0,//缩放后的宽
imageheight: 0,//缩放后的高 imageheight: 0,//缩放后的高
isAuthorization: false
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
...@@ -38,26 +39,33 @@ Component({ ...@@ -38,26 +39,33 @@ Component({
const {appid, path} = e.currentTarget.dataset const {appid, path} = e.currentTarget.dataset
// 获取当前帐号信息 // 获取当前帐号信息
const accountInfo = utils.getAccountInfo() const accountInfo = utils.getAccountInfo()
const userInfo = wx.getStorageSync('_baseUserInfo')
// 是当前小程序 直接跳转 if (userInfo){
if(accountInfo.miniProgram.appId == appid){ // 是当前小程序 直接跳转
wxService.router(`${path}`) if(accountInfo.miniProgram.appId == appid){
} else { wxService.router(`${path}`)
// 跳转其他小程序 } else {
wx.navigateToMiniProgram({ // 跳转其他小程序
appId: appid, wx.navigateToMiniProgram({
path: `${path}`, appId: appid,
success: e => { path: `${path}`,
console.log(e) success: e => {
}, console.log(e)
fail: e => { },
console.log(e) fail: e => {
}, console.log(e)
complete: e => { },
console.log(e) complete: e => {
}, console.log(e)
}) },
} })
}
}else{
console.log('222')
this.setData({
isAuthorization: true
})
}
} }
} }
}) })
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {
"authorization-modal": "./../../component/authorization-modal/authorization-modal"
}
} }
\ No newline at end of file
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
<view class="pic-item"><image class="pic-img" src="http://testimg3.bigaka.com{{item.imageUrl}}" data-appid="{{item.link.appid}}" data-path="{{item.link.url}}" bindload="imageLoad" bindtap='preview' mode="widthFix"/></view> <view class="pic-item"><image class="pic-img" src="http://testimg3.bigaka.com{{item.imageUrl}}" data-appid="{{item.link.appid}}" data-path="{{item.link.url}}" bindload="imageLoad" bindtap='preview' mode="widthFix"/></view>
</block> </block>
</view> </view>
<authorization-modal isAuthorization='{{isAuthorization}}'/>
<!--<view class="pic-nav"> <!--<view class="pic-nav">
<block wx:for="{{picNav}}" wx:key="{{index}}" wx:for-item="item"> <block wx:for="{{picNav}}" wx:key="{{index}}" wx:for-item="item">
......
const PROJECT_ENV = 'pre' // 生产 prod, 测试 dev, 预生产 pre const PROJECT_ENV = 'dev' // 生产 prod, 测试 dev, 预生产 pre
const needMock = '' // const needMock = '' //
// appid_dev_wx wxc3b64b09b1d3dfc2 // appid_dev_wx wxc3b64b09b1d3dfc2
......
...@@ -36,7 +36,8 @@ wxService.page({ ...@@ -36,7 +36,8 @@ wxService.page({
homeApiLoading: true, homeApiLoading: true,
render: null, // 渲染页面数据对象(安全渲染) render: null, // 渲染页面数据对象(安全渲染)
isLastPage: false, // 页面段落加载完成 isLastPage: false, // 页面段落加载完成
renderPageOver: false // 渲染页面结束 renderPageOver: false, // 渲染页面结束
// isAuthorization: true
}, },
() => { () => {
// this.loadMore() // this.loadMore()
...@@ -50,20 +51,15 @@ wxService.page({ ...@@ -50,20 +51,15 @@ wxService.page({
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
// 积分数量 if (wx.getStorageSync('_baseUserInfo')){
this.getMemberPointInfo() // 积分数量
// 优惠券数量 this.getMemberPointInfo()
this.getMemberCouponInfo() // 优惠券数量
this.getMemberCouponInfo()
}
}, },
// 查询积分信息 // 查询积分信息
getMemberPointInfo(){ getMemberPointInfo(){
...@@ -141,7 +137,7 @@ wxService.page({ ...@@ -141,7 +137,7 @@ wxService.page({
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.post(`/merchant/modelPage/getDetailById?pageId=3`).then(res => { wxService.post(`/merchant/modelPage/getDetailById?pageId=3&brandId=1001`).then(res => {
const {result,data} = res.data const {result,data} = res.data
if(result == 0){ if(result == 0){
// 动态设置title // 动态设置title
...@@ -185,39 +181,5 @@ wxService.page({ ...@@ -185,39 +181,5 @@ wxService.page({
wx.hideLoading() wx.hideLoading()
}) })
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
} }
}) })
\ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"usingComponents": { "usingComponents": {
"image-swiper": "/component/imageSwiper/imageSwiper", "image-swiper": "/component/imageSwiper/imageSwiper",
"person-center": "/component/personCenter/personCenter", "person-center": "/component/personCenter/personCenter",
"pic-nav": "/component/picNav/picNav" "pic-nav": "/component/picNav/picNav",
"authorization-modal": "./../../component/authorization-modal/authorization-modal"
} }
} }
\ No newline at end of file
//index.js
//获取应用实例
const app = getApp()
const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo
wxService.page({
data: {
motto: '开启广东7-Eleven会员专区',
userInfo: {},
hasUserInfo: false,
env: envInfo.env,
isAuthorization: false
},
//事件处理函数
bindViewTap: function() {
wx.navigateTo({
url: '../logs/logs'
})
},
onShow(){},
onLoad: function () {
// if (app.globalData.userInfo) {
// this.setData({
// userInfo: app.globalData.userInfo,
// hasUserInfo: true
// })
// } else if (this.data.canIUse){
// // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// // 所以此处加入 callback 以防止这种情况
// app.userInfoReadyCallback = res => {
// this.setData({
// userInfo: res.userInfo,
// hasUserInfo: true
// })
// }
// } else {
// // 在没有 open-type=getUserInfo 版本的兼容处理
// wx.getUserInfo({
// success: res => {
// app.globalData.userInfo = res.userInfo
// this.setData({
// userInfo: res.userInfo,
// hasUserInfo: true
// })
// }
// })
// }
},
getAuth(){
this.setData({
isAuthorization : true
})
}
})
{
"usingComponents": {
"authorization-modal": "./../../component/authorization-modal/authorization-modal"
}
}
\ No newline at end of file
<view class="container">
<view class="userinfo">
<view class="userinfo-avatar">
<open-data type="userAvatarUrl"></open-data>
</view>
<open-data type="userNickName" class="userinfo-nickname" lang="zh_CN"></open-data>
</view>
<view class="usermotto">
<button class="user-motto" bindtap='getAuth'>{{motto}}</button>
</view>
</view>
<authorization-modal isAuthorization='{{isAuthorization}}'/>
\ No newline at end of file
/**index.wxss**/
page {
height: 100%; }
.userinfo {
display: flex;
flex-direction: column;
align-items: center; }
.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 20rpx;
overflow:hidden;
border-radius: 50%; }
.userinfo-nickname {
color: #aaa; }
.user-motto {
margin-top: 200px;
padding: 0 28rpx;
color: #00843e;
font-size: 32rpx; }
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.6.6", "libVersion": "2.6.6",
"appid": "wx358b56af62edbde1", "appid": "wxc3b64b09b1d3dfc2",
"tempappid_wx": "wxc3b64b09b1d3dfc2", "tempappid_wx": "wxc3b64b09b1d3dfc2",
"tempappid_711": "wx358b56af62edbde1", "tempappid_711": "wx358b56af62edbde1",
"projectname": "7-Eleven", "projectname": "7-Eleven",
......
...@@ -263,8 +263,8 @@ function getUserInfoByBtn(userInfo) { ...@@ -263,8 +263,8 @@ function getUserInfoByBtn(userInfo) {
return wxService.post(`/member/minaLogin`, { return wxService.post(`/member/minaLogin`, {
code: res[1].code, code: res[1].code,
wechatInfo: res[0], wechatInfo: res[0],
brandId: 2005, // brandId: 2005,
// brandId: 1001, brandId: 1001,
}) })
}, (err) => { }, (err) => {
return Promise.reject(err) return Promise.reject(err)
......
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