Commit 200dfa4f by 赵雅纹

首页

parent 5a749ff2
{
"pages": [
"pages/userCenter/userCenter",
"pages/welcome/welcome",
"pages/mySpend/mySpend",
"pages/memberOfOwn/memberOfOwn",
"pages/memberRules/memberRules",
......
......@@ -24,7 +24,8 @@ Component({
indicatorDots: true,
autoplay: true,
interval: 5000,
duration: 1000
duration: 1000,
isAuthorization: false
},
/**
* 组件的方法列表
......@@ -34,7 +35,8 @@ Component({
const {appid, path} = e.currentTarget.dataset
// 获取当前帐号信息
const accountInfo = utils.getAccountInfo()
const userInfo = wx.getStorageSync('_baseUserInfo')
if (userInfo){
// 是当前小程序 直接跳转
if(accountInfo.miniProgram.appId == appid){
wxService.router(`${path}`)
......@@ -54,6 +56,13 @@ Component({
},
})
}
}else{
console.log('1111')
this.setData({
isAuthorization: true
})
}
}
}
})
{
"component": true,
"usingComponents": {}
"usingComponents": {
"authorization-modal": "./../../component/authorization-modal/authorization-modal"
}
}
\ No newline at end of file
......@@ -11,3 +11,5 @@
</swiper-item>
</block>
</swiper>
<authorization-modal isAuthorization='{{isAuthorization}}'/>
......@@ -27,7 +27,8 @@ Component({
memberActivateStatus: false,
integralNum: 0,
couponNum: 0,
baseUrl:'/assets/imgs/user-bg.png'
baseUrl:'/assets/imgs/user-bg.png',
isAuthorization: false
},
attached () {
this.setData({
......@@ -53,12 +54,17 @@ Component({
toCouponList() {
wxService.router(`/pages/coupons/coupons`)
},
// 点击编辑
handelPersonCenter() {
console.log('点击编辑')
},
handleTtoActiveMemebr() {
if (wx.getStorageSync('_baseUserInfo')){
if (!this.data.memberCardNo){
wxService.openCard()
}
}else{
this.setData({
isAuthorization:true
})
}
},
handleGoWxCard() {
console.log('kabao')
......
{
"usingComponents": {}
"usingComponents": {
"authorization-modal": "./../../component/authorization-modal/authorization-modal"
}
}
\ No newline at end of file
......@@ -9,7 +9,7 @@
<view class='user-name'>
<open-data type="userNickName" class="userinfo-nickname" lang="zh_CN"></open-data>
<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>
</view>
<view class='user-id'>{{memberCardNo}}</view>
......@@ -29,6 +29,8 @@
<view class='point-desc' style="color:{{personCenter.fontColor}};">优惠券</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='user-info'>
......
......@@ -22,6 +22,7 @@ Component({
data: {
imagewidth: 0,//缩放后的宽
imageheight: 0,//缩放后的高
isAuthorization: false
},
/**
* 组件的方法列表
......@@ -38,7 +39,8 @@ Component({
const {appid, path} = e.currentTarget.dataset
// 获取当前帐号信息
const accountInfo = utils.getAccountInfo()
const userInfo = wx.getStorageSync('_baseUserInfo')
if (userInfo){
// 是当前小程序 直接跳转
if(accountInfo.miniProgram.appId == appid){
wxService.router(`${path}`)
......@@ -58,6 +60,12 @@ Component({
},
})
}
}else{
console.log('222')
this.setData({
isAuthorization: true
})
}
}
}
})
{
"component": true,
"usingComponents": {}
"usingComponents": {
"authorization-modal": "./../../component/authorization-modal/authorization-modal"
}
}
\ No newline at end of file
......@@ -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>
</block>
</view>
<authorization-modal isAuthorization='{{isAuthorization}}'/>
<!--<view class="pic-nav">
<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 = '' //
// appid_dev_wx wxc3b64b09b1d3dfc2
......
......@@ -36,7 +36,8 @@ wxService.page({
homeApiLoading: true,
render: null, // 渲染页面数据对象(安全渲染)
isLastPage: false, // 页面段落加载完成
renderPageOver: false // 渲染页面结束
renderPageOver: false, // 渲染页面结束
// isAuthorization: true
},
() => {
// this.loadMore()
......@@ -50,20 +51,15 @@ wxService.page({
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
if (wx.getStorageSync('_baseUserInfo')){
// 积分数量
this.getMemberPointInfo()
// 优惠券数量
this.getMemberCouponInfo()
}
},
// 查询积分信息
getMemberPointInfo(){
......@@ -141,7 +137,7 @@ wxService.page({
wx.showLoading({
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
if(result == 0){
// 动态设置title
......@@ -185,39 +181,5 @@ wxService.page({
wx.hideLoading()
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
......@@ -3,6 +3,7 @@
"usingComponents": {
"image-swiper": "/component/imageSwiper/imageSwiper",
"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 @@
},
"compileType": "miniprogram",
"libVersion": "2.6.6",
"appid": "wx358b56af62edbde1",
"appid": "wxc3b64b09b1d3dfc2",
"tempappid_wx": "wxc3b64b09b1d3dfc2",
"tempappid_711": "wx358b56af62edbde1",
"projectname": "7-Eleven",
......
......@@ -263,8 +263,8 @@ function getUserInfoByBtn(userInfo) {
return wxService.post(`/member/minaLogin`, {
code: res[1].code,
wechatInfo: res[0],
brandId: 2005,
// brandId: 1001,
// brandId: 2005,
brandId: 1001,
})
}, (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