Commit c82e10b7 by 赵雅纹

Merge branch 'fixbug-ZYW' into 'dev_7.1.0'

Fixbug zyw

See merge request !122
parents dd43fccb 056a36a3
......@@ -2,6 +2,7 @@
const app = getApp()
const wxService = require('../../utils/wxService')
import { Integer } from '../../utils/integerDigitalConvertion'
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
wxService.page({
......@@ -18,7 +19,18 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let memberId = options.memberId;
if (memberId) {
let tentacleInfo = {
content: '分类',
title: '分类',
tentacleId: memberId,
contentType: app.globalData.contants.SHARE_TYPE.CLASSIFY,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this.generatePointObject(tentacleInfo);
}
},
/**
......@@ -116,20 +128,15 @@ wxService.page({
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
let tentacleInfo = {
content: '分类',
title: '分类',
contentType: app.globalData.contants.SHARE_TYPE.CLASSIFY,
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/category/category?t=${tentacleId}`;
//修改为参数memberId
var path = `pages/category/category`;
if (memberId) {
let m = Integer.digit(memberId, 10, 64);
path = `pages/category/category?m=${m}`;
}
return {
path: path
}
}
});
}
})
\ No newline at end of file
......@@ -4,6 +4,7 @@ const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo
import { Integer } from '../../utils/integerDigitalConvertion'
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
wxService.page({
......@@ -31,8 +32,19 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
let memberId = options.memberId;
if (memberId){
let tentacleInfo = {
content: '推广商品',
tentacleId: memberId,
title: '推广商品',
contentType: app.globalData.contants.SHARE_TYPE.PRODUCTS_PROMOTION,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this.generatePointObject(tentacleInfo);
}
},
// 点击切换
clickTab: function (e) {
......@@ -309,12 +321,8 @@ wxService.page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
console.log('onReachBottom')
console.log(this.data.currentTab)
if (this.data.currentTab == 0){
console.log('11111')
if (this.data.pageNo < this.data.totalPages){
console.log('22222')
this.setData({
pageNo: this.data.pageNo + 1,
}, () => {
......@@ -323,7 +331,6 @@ wxService.page({
}
}else{
if (this.data.pageNum < this.data.myTotalPages) {
console.log('333')
this.setData({
pageNum: this.data.pageNum + 1,
}, () => {
......@@ -337,42 +344,27 @@ wxService.page({
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
console.log(res)
if (res.from != 'menu') {
let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'subPackage/page/pages/friendShareList/friendShareList?i=' + id + '&t=' + tentacleId;
console.log('id', this.data.currentShareContent.id)
console.log('用户点击右上角分享', this.data.currentShareContent.id)
console.log(path)
return {
path: path,
imageUrl: this.data.proData[0].productImgUrl, // 可以更换分享的图片
}
}else{
var path = ''
let tentacleInfo = {
content: '推广商品',
title: '推广商品',
contentType: app.globalData.contants.SHARE_TYPE.PRODUCTS_PROMOTION,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) {
let tentacleId = Integer.digit(res.tentacleId, 10, 64);
path = `pages/extendProduct/extendProduct?t=${tentacleId}`;
console.log('222')
console.log('-------------', path)
//修改为参数memberId
var path = `pages/extendProduct/extendProduct`;
if (memberId){
let m = Integer.digit(memberId, 10, 64);
path = `pages/extendProduct/extendProduct?m=${m}`;
}
return {
path: path,
imageUrl: this.data.extendProList[0].productImgUrl,
}
}
});
}
}
})
\ No newline at end of file
......@@ -42,8 +42,19 @@ wxService.page({
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
onLoad(options) {
let memberId = options.memberId;
if (memberId) {
let tentacleInfo = {
content: '内容列表',
title: '内容列表',
tentacleId: memberId,
contentType: app.globalData.contants.SHARE_TYPE.CONTENTS_LIST,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this.generatePointObject(tentacleInfo);
}
},
/**
* 生命周期函数--监听页面显示
......@@ -230,23 +241,17 @@ wxService.page({
path: path,
imageUrl: this.data.cardUrl, // 可以更换分享的图片
}
} else{
//修改为参数memberId
var path = `pages/myShare/myShare`;
if (memberId) {
let m = Integer.digit(memberId, 10, 64);
path = `pages/myShare/myShare?m=${m}`;
}
let tentacleInfo = {
content: '内容列表',
title: '内容列表',
contentType: app.globalData.contants.SHARE_TYPE.CONTENTS_LIST,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) {
this.data.currentShareContent.tentacleId = res.tentacleId;
let tentacleId = Integer.digit(res.tentacleId, 10, 64);
var path = `pages/myShare/myShare?t=${tentacleId}`;
return {
path : path
path: path
}
}
});
}
})
\ No newline at end of file
......@@ -3,6 +3,7 @@ const app = getApp()
const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
import { Integer } from '../../utils/integerDigitalConvertion'
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
wxService.page({
/**
......@@ -43,7 +44,23 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let tentacleInfo = {
content: '集点详情页面',
title: '集点详情页面',
tentacleId: memberId,
contentType: app.globalData.contants.SHARE_TYPE.SET_POINT_DETAILS,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
let memberId = options.memberId;
if (memberId) {
let tentacleInfo = {
content: '集点列表页面',
title: '集点列表',
contentType: app.globalData.contants.SHARE_TYPE.SET_POINT_ACTIVITY,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this.generatePointObject(tentacleInfo);
}
},
// 集点详情
getPointDetail(id) {
......@@ -310,20 +327,14 @@ wxService.page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let tentacleInfo = {
content: '集点详情页面',
title: '集点详情页面',
contentType: app.globalData.contants.SHARE_TYPE.SET_POINT_DETAILS,
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/pointList/pointList?t=${tentacleId}`;
//修改为参数memberId
var path = `pages/pointDetail/pointDetail`;
if (memberId) {
let m = Integer.digit(memberId, 10, 64);
path = `pages/pointDetail/pointDetail?m=${m}`;
}
return {
path: path
}
}
});
}
})
\ No newline at end of file
......@@ -3,7 +3,7 @@ const app = getApp()
const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
import { Integer } from '../../utils/integerDigitalConvertion'
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
wxService.page({
/**
......@@ -18,7 +18,19 @@ wxService.page({
/**
* 生命周期函数--监听页面加载
*/
onLoad() { },
onLoad(options) {
let memberId = options.memberId;
if (memberId) {
let tentacleInfo = {
content: '集点列表页面',
title: '集点列表',
tentacleId: memberId,
contentType: app.globalData.contants.SHARE_TYPE.SET_POINT_ACTIVITY,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this.generatePointObject(tentacleInfo);
}
},
/**
* 生命周期函数--监听页面初次渲染完成
......@@ -157,20 +169,14 @@ wxService.page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let tentacleInfo = {
content: '集点列表页面',
title: '集点列表',
contentType: app.globalData.contants.SHARE_TYPE.SET_POINT_ACTIVITY,
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/pointList/pointList?t=${tentacleId}`;
//修改为参数memberId
var path = `pages/pointList/pointList`;
if (memberId) {
let m = Integer.digit(memberId, 10, 64);
path = `pages/pointList/pointList?m=${m}`;
}
return {
path: path
}
}
});
}
})
\ No newline at end of file
......@@ -3,6 +3,7 @@ var app = getApp()
const wxService = require('../../utils/wxService')
import { Integer } from '../../utils/integerDigitalConvertion'
const utils = require('../../utils/util')
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
wxService.page({
/**
......
......@@ -4,6 +4,7 @@ const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo
import { Integer } from '../../utils/integerDigitalConvertion'
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
wxService.page({
/**
......@@ -30,6 +31,27 @@ wxService.page({
id: options.id
})
}
let memberId = options.memberId;
if (memberId) {
let content = {
title: this.data.contentInfo.headline,
id: this.data.contentInfo.id,
article: this.data.contentInfo.article,
url: this.data.contentInfo.shareShowPictureRESDTOList[0].url
}
let tentacleInfo = {
content: JSON.stringify(content),
contentId: this.data.contentInfo.id,
tentacleId: memberId,
contentType: app.globalData.contants.SHARE_TYPE.DETAILS_OF_THE_CONTENT, //内容类型
title: this.data.contentInfo.headline, //标题
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
this.generatePointObject(tentacleInfo);
}
},
/**
* 生命周期函数--监听页面显示
......@@ -187,33 +209,20 @@ wxService.page({
path: path,
imageUrl: this.data.cardUrl, // 可以更换分享的图片
}
}else{
//修改为参数memberId
var path = `pages/wantToBuyDetail/wantToBuyDetail`;
console.log('--------------------memberId-=---', memberId)
if (memberId) {
let m = Integer.digit(memberId, 10, 64);
let contentId = Integer.digit(this.data.contentInfo.id, 10, 64);
path = `pages/wantToBuyDetail/wantToBuyDetail?i=${contentId}&m=${m}`;
}
let content = {
title: this.data.contentInfo.headline,
id: this.data.contentInfo.id,
article: this.data.contentInfo.article,
url: this.data.contentInfo.shareShowPictureRESDTOList[0].url
}
let tentacleInfo = {
content: JSON.stringify(content),
contentId: this.data.contentInfo.id,
contentType: app.globalData.contants.SHARE_TYPE.DETAILS_OF_THE_CONTENT, //内容类型
title: this.data.contentInfo.headline, //标题
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) {
let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
this.data.currentShareContent.tentacleId = res.tentacleId;
let tentacleId = Integer.digit(res.tentacleId, 10, 64);
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
return {
path: path,
imageUrl: this.data.cardUrl, // 可以更换分享的图片
imageUrl: this.data.cardUrl
}
}
});
}
})
\ No newline at end of file
......@@ -2,7 +2,7 @@
var app = getApp()
const wxService = require('../../../../utils/wxService')
import { Integer } from '../../../../utils/integerDigitalConvertion'
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
wxService.page({
......@@ -52,6 +52,18 @@ wxService.page({
'form.mallCategoryId': options.id
})
}
let memberId = options.memberId;
if (memberId) {
let tentacleInfo = {
content: '商品列表',
title: '商品列表',
tentacleId: memberId,
contentType: app.globalData.contants.SHARE_TYPE.PRODUCT_LIST,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this.generatePointObject(tentacleInfo);
}
},
/**
......@@ -156,21 +168,15 @@ wxService.page({
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
let tentacleInfo = {
content: '商品列表',
title: '商品列表',
contentType: app.globalData.contants.SHARE_TYPE.PRODUCT_LIST,
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 = `subPackage/page/pages/categoryPro/categoryPro?t=${tentacleId}`;
console.log(path)
//修改为参数memberId
var path = `subPackage/page/pages/categoryPro/categoryPro`;
if (memberId) {
let m = Integer.digit(memberId, 10, 64);
path = `subPackage/page/pages/categoryPro/categoryPro?m=${m}`;
}
return {
path: path
}
}
});
}
})
\ No newline at end of file
......@@ -31,6 +31,18 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let memberId = options.memberId;
if (memberId) {
let tentacleInfo = {
content: '我的发布页面',
title: '我的发布',
tentacleId: memberId,
contentType: app.globalData.contants.SHARE_TYPE.CONTENTS_LIST,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this.generatePointObject(tentacleInfo);
}
},
/**
......@@ -226,21 +238,17 @@ wxService.page({
imageUrl: this.data.cardUrl // 可以更换分享的图片
}
}
let tentacleInfo = {
content: '我的发布页面',
title: '我的发布',
contentType: app.globalData.contants.SHARE_TYPE.CONTENTS_LIST,
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 = `subPackage/page/pages/myRelease/myRelease?t=${tentacleId}`;
else {
//修改为参数memberId
var path = `subPackage/page/pages/myRelease/myRelease`;
if (memberId) {
let m = Integer.digit(memberId, 10, 64);
path = `subPackage/page/pages/myRelease/myRelease?m=${m}`;
}
return {
path: path
}
}
});
}
})
\ No newline at end of file
......@@ -23,7 +23,7 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
console.log('mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm',options)
if (options && options.id) {
this.setData({
id: options.id
......@@ -31,6 +31,25 @@ wxService.page({
this.getContentDetail()
})
}
let memberId = options.memberId;
if (memberId) {
let content = {
title: this.data.contentInfo.headline,
id: this.data.contentInfo.id,
article: this.data.contentInfo.article,
url: this.data.contentInfo.sspList[0].url
}
let tentacleInfo = {
content: JSON.stringify(content),
contentId: this.data.contentInfo.id,
tentacleId: memberId,
contentType: app.globalData.contants.SHARE_TYPE.DETAILS_OF_THE_CONTENT, //内容类型
title: this.data.contentInfo.headline, //标题
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
this.generatePointObject(tentacleInfo);
}
},
handleDel() {
this.setData({
......@@ -209,29 +228,21 @@ wxService.page({
path: path,
imageUrl: this.data.contentInfo.sspList[0].url
}
}else{
//修改为参数memberId
var path = `pages/wantToBuyDetail/wantToBuyDetail`;
console.log('--------------------memberId-=---', memberId)
if (memberId) {
let m = Integer.digit(memberId, 10, 64);
let contentId = Integer.digit(this.data.contentInfo.id,10,64);
path = `pages/wantToBuyDetail/wantToBuyDetail?i=${contentId}&m=${m}`;
}
let content = {
title: this.data.contentInfo.headline,
id: this.data.contentInfo.id,
article: this.data.contentInfo.article,
url: this.data.contentInfo.sspList[0].url
}
let tentacleInfo = {
content: JSON.stringify(content),
contentId: this.data.contentInfo.id,
contentType: app.globalData.contants.SHARE_TYPE.DETAILS_OF_THE_CONTENT, //内容类型
title: this.data.contentInfo.headline, //标题
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/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
return {
path: path
path: path,
imageUrl: this.data.contentInfo.sspList[0].url
}
}
});
}
})
\ No newline at end of file
......@@ -575,6 +575,12 @@ class WXService extends Http {
item['id'] = Integer.digit(item['i'], 64, 10);
}
}
if(item['m']){
item['memberId'] = Integer.digit(item['m'], 64, 10);
if (item['i']) {
item['id'] = Integer.digit(item['i'], 64, 10);
}
}
});
//如果打开的是分享界面则进行触点对象信息请求并存储到本地 放到后续的header中
if (pageIsFromShare) {
......@@ -640,7 +646,44 @@ class WXService extends Http {
//统一处理用户授权获取用户信息回调
_getUserInfo(res) {
_self.getAuthUserInfo(res.detail)
},
//处理分享页面打开时参数为memberId时生成触点对象信息
generatePointObject(tentacleInfo){
console.log('---call 生成触点接口----')
console.log(tentacleInfo)
_self.getTentacleContent(tentacleInfo).then(res => {
console.log('-----处理分享页面打开时参数为memberId时生成触点对象信息------')
console.log('-----成功返回是------',res);
if (res && res.tentacleId) {
let data = res;
let TENTACLE_CONTENT = {
id: data.id,
tentacleType: data.type,
tentacleId: data.tentacleId,
contentType: data.contentType,
contentId: data.contentId
}
let storageObj = {
memberId: '',
obj: TENTACLE_CONTENT
}
if (data.status == 1) {
var timestamp = Date.parse(new Date())
var expiration = timestamp + 1800000
wx.setStorageSync('TENTACLE_CONTENT', storageObj)
wx.setStorageSync('TIME_EXPIRATION', expiration)
}
else {
wx.removeStorageSync('TENTACLE_CONTENT')
wx.removeStorageSync('TIME_EXPIRATION')
}
}
});
},
}
Page(Object.assign({}, config, CONFIG_PAPGE))
}
......
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