Commit 7daa8b05 by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

parents 75843b24 99c3f92e
......@@ -118,7 +118,7 @@ App({
cityJson: cityJson,
// brandId: 2711,
// brandId: 2005,
brandId: 1001,
// brandId: 1002,
// brandId: 1001,
brandId: 1002,
}
})
......@@ -55,27 +55,15 @@ Component({
const ev = event.currentTarget.dataset;
let curItemType = ev.item
// 获取当前帐号信息
const userInfo = wx.getStorageSync('_baseUserInfo')
const userInfo = wx.getStorageSync('_baseUserInfo')
console.log('curItemType', curItemType)
// link row
if (curItemType.link) {
let currentClickType = app.globalData.commonFunc.getLink(curItemType.link.type, curItemType)
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(() => {
this.triggerEvent('updatePage', { pageId: currentClickType.url })
......
const PROJECT_ENV = 'dev' // 生产 prod, 开发 dev, 测试 test, 预生产 pre
const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test, 预生产 pre
const needMock = '' //
// appid_dev_wx wxc3b64b09b1d3dfc2
......
......@@ -35,8 +35,8 @@ wxService.page({
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log('触点-----------',options)
onLoad() {
console.log('onlod', this.options)
this.setData(
{
pages: [],
......@@ -77,7 +77,7 @@ wxService.page({
let tentacleInfo = wx.getStorageSync('TENTACLE_CONTENT');
// 取会员卡号
const baseUserInfo = wx.getStorageSync('tentacleInfo')
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
console.log('会员信息------------', baseUserInfo)
const cardMember = wx.getStorageSync('_cardMember')
// 登录接口返回err
......@@ -273,12 +273,10 @@ wxService.page({
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) {
let tentacleId = Integer.digit(res.tentacleId, 10, 64);
// var path = `pages/userCenter/userCenter?t=${tentacleId}`;
var path = `pages/userCenter/userCenter?t=1`;
console.log(path)
var path = `pages/userCenter/userCenter?t=${tentacleId}`;
console.log('path', path)
return {
path: path
path: `pages/userCenter/userCenter?t=${tentacleId}`
}
}
});
......
......@@ -9,7 +9,7 @@
<person-center base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
</view>
<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 class="" wx:if="{{pItem.type == 4}}">
<bottom bottom="{{pItem.bottom}}" />
......
......@@ -13,7 +13,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.8.2",
"appid": "wxc3b64b09b1d3dfc2",
"appid": "wxac09792264c49b5c",
"projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E",
"debugOptions": {
"hidedInDevtools": []
......
......@@ -6,6 +6,8 @@ const envInfo = require('../../../../config/index').envInfo
let renderPage = null // 渲染页面数据对象(安全渲染)
let handlerDataOnPage = null
let config = require('../../../../configScreen/configScreen');
import { Integer } from '../../../../utils/integerDigitalConvertion'
const logger = utils.logger
wxService.page({
......@@ -13,24 +15,28 @@ wxService.page({
* 页面的初始数据
*/
data: {
pages:[],
pages: [],
render: null, // 渲染页面数据对象(安全渲染)
renderPageOver: false, // 渲染页面结束
integralNum: 0,
couponNum: 0,
// isAllScreen: fullSucreen.isAllScreen
isAllScreen: config.isAllScreen,
token:'',
token: '',
isAuthorization: false,
pageId: 3,
baseUserInfo: null,
// cardMember: null,
pageBackgroundColor: 0,
guidePageModalShow: false,
currHomePageId: '',
goHome: false // 默认隐藏回到首页 不存在 5 tabBar 显示
skuVOList:[]
},
/**
/**
* 生命周期函数--监听页面加载
*/
onLoad () {
onLoad() {
console.log('onlod', this.options)
this.setData(
{
pages: [],
......@@ -39,7 +45,8 @@ wxService.page({
render: null, // 渲染页面数据对象(安全渲染)
isLastPage: false, // 页面段落加载完成
renderPageOver: false, // 渲染页面结束
// isAuthorization: true
// isAuthorization: true,
outoHeigth: 500,
},
() => {
// this.loadMore()
......@@ -48,47 +55,94 @@ wxService.page({
handlerDataOnPage = new utils.HandlerDataOnPage()
renderPage = require('../../../../utils/renderPage').getRenderPage()
handlerDataOnPage.init(this, 'pages')
this.initPage(this.data.pageId)
},
/**
* 监听子组件事件
* */
* */
updatePage(ev) {
const {pageId} = ev.detail
this.setData({
pages: [],
pageId
},()=>{
this.initPage(pageId)
})
const { pageId } = ev.detail
// this.setData({
// pages: [],
// pageId
// },()=>{
// this.initPage(pageId)
// })
wxService.router(`/subPackage/page/pages/subPage/subPage`).search({ pageId })
},
/**
* 生命周期函数--监听页面显示
*/
onShow () {
console.log('subbbbbbbbb', this.data.currentHasUserInfo)
const { pageId } = this.options
this.setData({
token: wx.getStorageSync('token'),
pages: [], // 清空当前页
pageId,
},()=>{
let currentPageId = pageId? pageId : this.data.pageId
this.initPage(currentPageId)
onShow() {
console.log('user=============', this.options)
// 取会员卡号
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const cardMember = wx.getStorageSync('_cardMember')
// 登录接口返回err
const reLoginErrFlag = wx.getStorageSync('reLoginErr')
if (baseUserInfo && !reLoginErrFlag) {
this.setData({
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')){
// 积分数量
// this.getMemberPointInfo()
// 优惠券数量
// this.getMemberCouponInfo()
// 设置当前选中 Tab
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 0
})
}
},
// 查询积分信息
getMemberPointInfo(){
getMemberPointInfo() {
wx.showLoading({
title: '加载中'
})
wxService.get(`/member/memberPoint/getMyPointInfo`).then(res => {
if(res) {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
......@@ -96,16 +150,16 @@ wxService.page({
integralNum: data && data.point || 0
})
}
}
}
})
},
// 查询优惠券数量
getMemberCouponInfo(){
// 查询优惠券数量
getMemberCouponInfo() {
wx.showLoading({
title: '加载中'
})
wxService.post(`/coupon/coupon/memberCouponCount`).then(res => {
if(res){
if (res) {
const { result, data } = res && res.data
if (result == 0) {
wx.hideLoading()
......@@ -113,26 +167,25 @@ wxService.page({
couponNum: data && data[1] || 0
})
}
} else {
wx.showToast({
title: '请求失败',
icon: 'none'
})
}
})
},
// page 信息
initPage(pageId){
initPage(pageId) {
this.setData({
products: []
})
wx.showLoading({
title: '加载中'
})
wxService.post(`/merchant/modelPage/getDetailById?pageId=${pageId}&brandId=${app.globalData.brandId}`).then(res => {
if(!res) return false
const {result,data} = res.data
if(result == 0){
// wxService.post(`/merchant/modelPage/getDetailById?pageId=${pageId}&brandId=${app.globalData.brandId}`).then(res => {
wxService.post(`/merchant/modelPage/mainSetting/mall?brandId=${app.globalData.brandId}`).then(res => {
if (!res) return false
const { result, data } = res.data
if (result == 0) {
this.setData({
pageBackgroundColor: data.page.backgroundColor || 0
})
// 动态设置title
wx.setNavigationBarTitle({
title: data.page.title
......@@ -142,13 +195,14 @@ wxService.page({
this.setData({
currHomePageId: data.page.pageId
})
// 段落
const products = data.paragraphs
const filterResult = products.map((res,index)=>{
const filterResult = products.map((res, index) => {
return {
...res,index
...res, index
}
}).filter(item=> {
}).filter(item => {
// wx.hideLoading()
})
......@@ -178,15 +232,6 @@ wxService.page({
newProducts.forEach((item, index) => {
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)
......@@ -198,5 +243,40 @@ wxService.page({
}, () => {
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 @@
"attention": "/component/attention/attention",
"guide-page-modal": "/component/guidePageModal/guidePageModal",
"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 @@
<image-swiper image-data="{{pItem.rotationchart.images}}" />
</view>
<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 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 class="" wx:if="{{pItem.type == 4}}">
<bottom bottom="{{pItem.bottom}}" />
</view>
<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 class="" wx:if="{{pItem.type == 6}}">
<announcement notice="{{pItem.notice}}" />
<announcement notice="{{pItem.notice}}"/>
</view>
<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 class="" wx:if="{{pItem.type == 8}}">
<attention focus-wx="{{pItem.focusWx}}" />
</view>
<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>
</block>
<!--goHome-->
<go-home wx:if="{{goHome}}"/>
</view>
<guide-page-modal show="{{guidePageModalShow}}" />
/* subPackage/page/pages/subPage/subPage.wxss */
@import './../../../../base/base.wxss';
page {
background: #fff!important;
page{
padding-bottom: 320rpx;
}
.user-center{
/* margin-bottom: 120rpx; */
background: #fff;
box-sizing:border-box;
padding-bottom:120rpx;
box-sizing: border-box;
padding-bottom: 200rpx;
height: 100%;
}
.main-content{
margin-top: 18rpx;
}
.top-content,.bottom-content{
display: flex;
flex-direction: row;
......@@ -39,3 +37,27 @@ page {
height: 32rpx;
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 {
//生成触点对象Id
getTentacleContent(tentacleInfo) {
console.log('生成触点对象Id', tentacleInfo)
return this.post('/marketing/tentacleContent/getTentacleContent', tentacleInfo).then((res) => {
let data = res.data.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