Commit 7daa8b05 by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

parents 75843b24 99c3f92e
...@@ -118,7 +118,7 @@ App({ ...@@ -118,7 +118,7 @@ App({
cityJson: cityJson, cityJson: cityJson,
// brandId: 2711, // brandId: 2711,
// brandId: 2005, // brandId: 2005,
brandId: 1001, // brandId: 1001,
// brandId: 1002, brandId: 1002,
} }
}) })
...@@ -55,27 +55,15 @@ Component({ ...@@ -55,27 +55,15 @@ Component({
const ev = event.currentTarget.dataset; const ev = event.currentTarget.dataset;
let curItemType = ev.item let curItemType = ev.item
// 获取当前帐号信息 // 获取当前帐号信息
const userInfo = wx.getStorageSync('_baseUserInfo') const userInfo = wx.getStorageSync('_baseUserInfo')
console.log('curItemType', curItemType)
// link row // link row
if (curItemType.link) { if (curItemType.link) {
let currentClickType = app.globalData.commonFunc.getLink(curItemType.link.type, curItemType) let currentClickType = app.globalData.commonFunc.getLink(curItemType.link.type, curItemType)
if (curItemType.link.type == 1) { if (curItemType.link.type == 1) {
// 触发父组件更新页面 外部小程序
this.setData({
isAuthorization: false
})
return false
} else if (!userInfo) {
this.setData({
isAuthorization: true
})
return false
} else if (userInfo && userInfo.member && !userInfo.member.mobile) {
wxService.openCard()
return false
}
if (curItemType.link.type == 2) { } else if (curItemType.link.type == 2) {
// 触发父组件更新页面 // 触发父组件更新页面
wxService.nextTick(() => { wxService.nextTick(() => {
this.triggerEvent('updatePage', { pageId: currentClickType.url }) this.triggerEvent('updatePage', { pageId: currentClickType.url })
......
const PROJECT_ENV = 'dev' // 生产 prod, 开发 dev, 测试 test, 预生产 pre const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test, 预生产 pre
const needMock = '' // const needMock = '' //
// appid_dev_wx wxc3b64b09b1d3dfc2 // appid_dev_wx wxc3b64b09b1d3dfc2
......
...@@ -35,8 +35,8 @@ wxService.page({ ...@@ -35,8 +35,8 @@ wxService.page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad() {
console.log('触点-----------',options) console.log('onlod', this.options)
this.setData( this.setData(
{ {
pages: [], pages: [],
...@@ -77,7 +77,7 @@ wxService.page({ ...@@ -77,7 +77,7 @@ wxService.page({
let tentacleInfo = wx.getStorageSync('TENTACLE_CONTENT'); let tentacleInfo = wx.getStorageSync('TENTACLE_CONTENT');
// 取会员卡号 // 取会员卡号
const baseUserInfo = wx.getStorageSync('tentacleInfo') const baseUserInfo = wx.getStorageSync('_baseUserInfo')
console.log('会员信息------------', baseUserInfo) console.log('会员信息------------', baseUserInfo)
const cardMember = wx.getStorageSync('_cardMember') const cardMember = wx.getStorageSync('_cardMember')
// 登录接口返回err // 登录接口返回err
...@@ -273,12 +273,10 @@ wxService.page({ ...@@ -273,12 +273,10 @@ wxService.page({
wxService.getTentacleContent(tentacleInfo).then(res => { wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) { if (res && res.tentacleId) {
let tentacleId = Integer.digit(res.tentacleId, 10, 64); let tentacleId = Integer.digit(res.tentacleId, 10, 64);
// var path = `pages/userCenter/userCenter?t=${tentacleId}`; var path = `pages/userCenter/userCenter?t=${tentacleId}`;
var path = `pages/userCenter/userCenter?t=1`; console.log('path', path)
console.log(path)
return { return {
path: path path: `pages/userCenter/userCenter?t=${tentacleId}`
} }
} }
}); });
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<person-center base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/> <person-center base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
</view> </view>
<view class="" wx:if="{{pItem.type == 3}}"> <view class="" wx:if="{{pItem.type == 3}}">
<pic-nav pic-nav="{{pItem.navigation.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"/> <pic-nav pic-nav="{{pItem.navigation.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
</view> </view>
<view class="" wx:if="{{pItem.type == 4}}"> <view class="" wx:if="{{pItem.type == 4}}">
<bottom bottom="{{pItem.bottom}}" /> <bottom bottom="{{pItem.bottom}}" />
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.8.2", "libVersion": "2.8.2",
"appid": "wxc3b64b09b1d3dfc2", "appid": "wxac09792264c49b5c",
"projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E", "projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []
......
...@@ -6,6 +6,8 @@ const envInfo = require('../../../../config/index').envInfo ...@@ -6,6 +6,8 @@ const envInfo = require('../../../../config/index').envInfo
let renderPage = null // 渲染页面数据对象(安全渲染) let renderPage = null // 渲染页面数据对象(安全渲染)
let handlerDataOnPage = null let handlerDataOnPage = null
let config = require('../../../../configScreen/configScreen'); let config = require('../../../../configScreen/configScreen');
import { Integer } from '../../../../utils/integerDigitalConvertion'
const logger = utils.logger const logger = utils.logger
wxService.page({ wxService.page({
...@@ -13,24 +15,28 @@ wxService.page({ ...@@ -13,24 +15,28 @@ wxService.page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
pages:[], pages: [],
render: null, // 渲染页面数据对象(安全渲染) render: null, // 渲染页面数据对象(安全渲染)
renderPageOver: false, // 渲染页面结束 renderPageOver: false, // 渲染页面结束
integralNum: 0, integralNum: 0,
couponNum: 0, couponNum: 0,
// isAllScreen: fullSucreen.isAllScreen // isAllScreen: fullSucreen.isAllScreen
isAllScreen: config.isAllScreen, isAllScreen: config.isAllScreen,
token:'', token: '',
isAuthorization: false, isAuthorization: false,
pageId: 3, pageId: 3,
baseUserInfo: null,
// cardMember: null,
pageBackgroundColor: 0,
guidePageModalShow: false,
currHomePageId: '', currHomePageId: '',
goHome: false // 默认隐藏回到首页 不存在 5 tabBar 显示 skuVOList:[]
}, },
/**
/**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad () { onLoad() {
console.log('onlod', this.options)
this.setData( this.setData(
{ {
pages: [], pages: [],
...@@ -39,7 +45,8 @@ wxService.page({ ...@@ -39,7 +45,8 @@ wxService.page({
render: null, // 渲染页面数据对象(安全渲染) render: null, // 渲染页面数据对象(安全渲染)
isLastPage: false, // 页面段落加载完成 isLastPage: false, // 页面段落加载完成
renderPageOver: false, // 渲染页面结束 renderPageOver: false, // 渲染页面结束
// isAuthorization: true // isAuthorization: true,
outoHeigth: 500,
}, },
() => { () => {
// this.loadMore() // this.loadMore()
...@@ -48,47 +55,94 @@ wxService.page({ ...@@ -48,47 +55,94 @@ wxService.page({
handlerDataOnPage = new utils.HandlerDataOnPage() handlerDataOnPage = new utils.HandlerDataOnPage()
renderPage = require('../../../../utils/renderPage').getRenderPage() renderPage = require('../../../../utils/renderPage').getRenderPage()
handlerDataOnPage.init(this, 'pages') handlerDataOnPage.init(this, 'pages')
this.initPage(this.data.pageId)
}, },
/** /**
* 监听子组件事件 * 监听子组件事件
* */ * */
updatePage(ev) { updatePage(ev) {
const {pageId} = ev.detail const { pageId } = ev.detail
this.setData({ // this.setData({
pages: [], // pages: [],
pageId // pageId
},()=>{ // },()=>{
this.initPage(pageId) // this.initPage(pageId)
}) // })
wxService.router(`/subPackage/page/pages/subPage/subPage`).search({ pageId })
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow () { onShow() {
console.log('subbbbbbbbb', this.data.currentHasUserInfo) console.log('user=============', this.options)
const { pageId } = this.options // 取会员卡号
this.setData({ const baseUserInfo = wx.getStorageSync('_baseUserInfo')
token: wx.getStorageSync('token'), const cardMember = wx.getStorageSync('_cardMember')
pages: [], // 清空当前页 // 登录接口返回err
pageId, const reLoginErrFlag = wx.getStorageSync('reLoginErr')
},()=>{ if (baseUserInfo && !reLoginErrFlag) {
let currentPageId = pageId? pageId : this.data.pageId this.setData({
this.initPage(currentPageId) token: wx.getStorageSync('token'),
baseUserInfo,
cardMember,
isAuthorization: false
}, () => {
// 积分数量
this.getMemberPointInfo()
// 优惠券数量
this.getMemberCouponInfo()
})
}
else if (!baseUserInfo && reLoginErrFlag) {
this.setData({
isAuthorization: true
})
}
else {
this.setData({
isAuthorization: true
})
}
// if (baseUserInfo){
// this.setData({
// token: wx.getStorageSync('token'),
// baseUserInfo,
// // cardMember,
// isAuthorization: false
// })
// // 积分数量
// this.getMemberPointInfo()
// // 优惠券数量
// this.getMemberCouponInfo()
// } else {
// this.setData({
// isAuthorization: true
// })
// }
// 获取plus购买信息
// this.getPlusPurchase()
// 获取手机信息
wxService.getSystemInfo().then(res => {
this.setData({
outoHeigth: res.windowHeight
})
}) })
if (wx.getStorageSync('_baseUserInfo')){ // 设置当前选中 Tab
// 积分数量 if (typeof this.getTabBar === 'function' &&
// this.getMemberPointInfo() this.getTabBar()) {
// 优惠券数量 this.getTabBar().setData({
// this.getMemberCouponInfo() selected: 0
})
} }
}, },
// 查询积分信息 // 查询积分信息
getMemberPointInfo(){ getMemberPointInfo() {
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.get(`/member/memberPoint/getMyPointInfo`).then(res => { wxService.get(`/member/memberPoint/getMyPointInfo`).then(res => {
if(res) { if (res) {
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
wx.hideLoading() wx.hideLoading()
...@@ -96,16 +150,16 @@ wxService.page({ ...@@ -96,16 +150,16 @@ wxService.page({
integralNum: data && data.point || 0 integralNum: data && data.point || 0
}) })
} }
} }
}) })
}, },
// 查询优惠券数量 // 查询优惠券数量
getMemberCouponInfo(){ getMemberCouponInfo() {
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.post(`/coupon/coupon/memberCouponCount`).then(res => { wxService.post(`/coupon/coupon/memberCouponCount`).then(res => {
if(res){ if (res) {
const { result, data } = res && res.data const { result, data } = res && res.data
if (result == 0) { if (result == 0) {
wx.hideLoading() wx.hideLoading()
...@@ -113,26 +167,25 @@ wxService.page({ ...@@ -113,26 +167,25 @@ wxService.page({
couponNum: data && data[1] || 0 couponNum: data && data[1] || 0
}) })
} }
} else {
wx.showToast({
title: '请求失败',
icon: 'none'
})
} }
}) })
}, },
// page 信息 // page 信息
initPage(pageId){ initPage(pageId) {
this.setData({ this.setData({
products: [] products: []
}) })
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.post(`/merchant/modelPage/getDetailById?pageId=${pageId}&brandId=${app.globalData.brandId}`).then(res => { // wxService.post(`/merchant/modelPage/getDetailById?pageId=${pageId}&brandId=${app.globalData.brandId}`).then(res => {
if(!res) return false wxService.post(`/merchant/modelPage/mainSetting/mall?brandId=${app.globalData.brandId}`).then(res => {
const {result,data} = res.data if (!res) return false
if(result == 0){ const { result, data } = res.data
if (result == 0) {
this.setData({
pageBackgroundColor: data.page.backgroundColor || 0
})
// 动态设置title // 动态设置title
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: data.page.title title: data.page.title
...@@ -142,13 +195,14 @@ wxService.page({ ...@@ -142,13 +195,14 @@ wxService.page({
this.setData({ this.setData({
currHomePageId: data.page.pageId currHomePageId: data.page.pageId
}) })
// 段落 // 段落
const products = data.paragraphs const products = data.paragraphs
const filterResult = products.map((res,index)=>{ const filterResult = products.map((res, index) => {
return { return {
...res,index ...res, index
} }
}).filter(item=> { }).filter(item => {
// wx.hideLoading() // wx.hideLoading()
}) })
...@@ -178,15 +232,6 @@ wxService.page({ ...@@ -178,15 +232,6 @@ wxService.page({
newProducts.forEach((item, index) => { newProducts.forEach((item, index) => {
if (item.type == 5) { newProducts.splice(index, 1) } if (item.type == 5) { newProducts.splice(index, 1) }
}) })
} else {
// 默认隐藏回到首页 不存在 5 tabBar 显示
newProducts.forEach(item => {
if (item.type != 5) {
this.setData({
goHome: true
})
}
})
} }
// let productData = handlerDataOnPage.handlerArray(products) // let productData = handlerDataOnPage.handlerArray(products)
...@@ -198,5 +243,40 @@ wxService.page({ ...@@ -198,5 +243,40 @@ wxService.page({
}, () => { }, () => {
wx.hideLoading() wx.hideLoading()
}) })
},
// 获取plus购买信息
// getPlusPurchase() {
// wxService.get(`/sale/premium/query`).then(res => {
// if(!res) return false
// const { result, data } = res.data
// if (result == 0) {
// this.setData({
// skuVOList: data
// })
// }
// }).finally(() => {
// })
// },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
let tentacleInfo = {
content: '首页',
title: '首页',
contentType: app.globalData.contants.SHARE_TYPE.HOME,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) {
let tentacleId = Integer.digit(res.tentacleId, 10, 64);
var path = `pages/userCenter/userCenter?t=${tentacleId}`;
console.log('path', path)
return {
path: `pages/userCenter/userCenter?t=${tentacleId}`
}
}
});
} }
}) })
\ No newline at end of file
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
"attention": "/component/attention/attention", "attention": "/component/attention/attention",
"guide-page-modal": "/component/guidePageModal/guidePageModal", "guide-page-modal": "/component/guidePageModal/guidePageModal",
"bottom-tabs": "/component/bottomTabs/bottomTabs", "bottom-tabs": "/component/bottomTabs/bottomTabs",
"go-home": "/component/goHome/goHome" "authorization-modal": "/component/authorization-modal/authorization-modal",
"plus": "/component/plus/plus"
} }
} }
\ No newline at end of file
...@@ -6,31 +6,29 @@ ...@@ -6,31 +6,29 @@
<image-swiper image-data="{{pItem.rotationchart.images}}" /> <image-swiper image-data="{{pItem.rotationchart.images}}" />
</view> </view>
<view class="" wx:if="{{pItem.type == 2}}"> <view class="" wx:if="{{pItem.type == 2}}">
<person-center person-data="{{pItem.customer}}" /> <person-center base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
</view> </view>
<view class="" wx:if="{{pItem.type == 3}}"> <view class="" wx:if="{{pItem.type == 3}}">
<pic-nav pic-nav="{{pItem.navigation.images}}" /> <pic-nav pic-nav="{{pItem.navigation.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
</view> </view>
<view class="" wx:if="{{pItem.type == 4}}"> <view class="" wx:if="{{pItem.type == 4}}">
<bottom bottom="{{pItem.bottom}}" /> <bottom bottom="{{pItem.bottom}}" />
</view> </view>
<view class="" wx:if="{{pItem.type == 5}}"> <view class="" wx:if="{{pItem.type == 5}}">
<bottom-tabs currHomePageId="{{currHomePageId}}" currentHasUserInfo="{{currentHasUserInfo}}" tab-bar="{{pItem.tabBar}}" bind:updatePage="updatePage"/> <bottom-tabs currHomePageId="{{currHomePageId}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" tab-bar="{{pItem.tabBar}}" bind:updatePage="updatePage"/>
</view> </view>
<view class="" wx:if="{{pItem.type == 6}}"> <view class="" wx:if="{{pItem.type == 6}}">
<announcement notice="{{pItem.notice}}" /> <announcement notice="{{pItem.notice}}"/>
</view> </view>
<view class="" wx:if="{{pItem.type == 7}}"> <view class="" wx:if="{{pItem.type == 7}}">
<tab-sort category-type="{{pItem.categoryType}}" /> <tab-sort category-type="{{pItem.categoryType}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" />
</view> </view>
<view class="" wx:if="{{pItem.type == 8}}"> <view class="" wx:if="{{pItem.type == 8}}">
<attention focus-wx="{{pItem.focusWx}}" /> <attention focus-wx="{{pItem.focusWx}}" />
</view> </view>
<view class="" wx:if="{{pItem.type == 9}}"> <view class="" wx:if="{{pItem.type == 9}}">
<plus sku-list="{{pItem.plus}}" plus-bgi="{{pItem.plus}}" currentHasUserInfo="{{currentHasUserInfo}}"/> <plus sku-list="{{skuVOList}}" plus-bgi="{{pItem.plus}}" currentHasUserInfo="{{currentHasUserInfo}}"/>
</view> </view>
</block> </block>
<!--goHome-->
<go-home wx:if="{{goHome}}"/>
</view> </view>
<guide-page-modal show="{{guidePageModalShow}}" /> <guide-page-modal show="{{guidePageModalShow}}" />
/* subPackage/page/pages/subPage/subPage.wxss */ /* subPackage/page/pages/subPage/subPage.wxss */
@import './../../../../base/base.wxss'; @import './../../../../base/base.wxss';
page { page{
background: #fff!important; padding-bottom: 320rpx;
} }
.user-center{ .user-center{
/* margin-bottom: 120rpx; */ box-sizing: border-box;
background: #fff; padding-bottom: 200rpx;
box-sizing:border-box; height: 100%;
padding-bottom:120rpx;
} }
.main-content{ .main-content{
margin-top: 18rpx; margin-top: 18rpx;
} }
.top-content,.bottom-content{ .top-content,.bottom-content{
display: flex; display: flex;
flex-direction: row; flex-direction: row;
...@@ -39,3 +37,27 @@ page { ...@@ -39,3 +37,27 @@ page {
height: 32rpx; height: 32rpx;
vertical-align: middle; vertical-align: middle;
} }
.page-bgc {
background-color: rgba(255, 255, 255, 1);
}
.person-hot {
text-align: center;
padding: 17rpx 0;
}
.person-text {
height: 32rpx;
color: rgba(51, 51, 48, 1);
font-size: 23rpx;
text-align: left;
font-family: PingFangSC-Regular;
}
.hot {
height: 32rpx;
color: rgba(192, 154, 116, 1);
font-size: 23rpx;
text-align: left;
font-family: PingFangSC-Regular;
padding-left: 10rpx;
}
...@@ -257,6 +257,7 @@ class WXService extends Http { ...@@ -257,6 +257,7 @@ class WXService extends Http {
//生成触点对象Id //生成触点对象Id
getTentacleContent(tentacleInfo) { getTentacleContent(tentacleInfo) {
console.log('生成触点对象Id', tentacleInfo)
return this.post('/marketing/tentacleContent/getTentacleContent', tentacleInfo).then((res) => { return this.post('/marketing/tentacleContent/getTentacleContent', tentacleInfo).then((res) => {
let data = res.data.data let data = res.data.data
return Promise.resolve(data); return Promise.resolve(data);
......
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