Commit 241bfefe by 谢中龙

优化功能

parent 2a005e2a
// components/floatNav/floatNav.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
isPopping: false,//是否已经弹出
navBars: [
{ path: '', icon: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/home.png', animationObj: {}, type: '', title: '主页' },
{ path: '', icon: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/category.png', animationObj: {}, type: '', title: '分类' },
{ path: '', icon: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/order.png', animationObj: {}, type: '', title: '我的订单' },
{ path: '', icon: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/my.png', animationObj: {}, type: '', title: '我的' },
{ path: '', icon: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/cart.png', animationObj: {}, type: '', title: '购物车' },
],
animMenu: {},
},
attached(){
console.log('attached')
},
/**
* 组件的方法列表
*/
methods: {
//点击弹出
bindShowOrCloseMenu: function () {
if (this.data.isPopping) {
//缩回动画
this.closeAnimation();
this.setData({
isPopping: false
})
} else if (!this.data.isPopping) {
//弹出动画
this.popAnimation();
this.setData({
isPopping: true
})
}
},
//点击menu
bindNav(e) {
console.log(e)
},
//弹出nav动画
popAnimation() {
let len = this.data.navBars.length;
this.data.navBars.forEach((item, index) => {
let animationContext = wx.createAnimation({
duration: 500,
timingFunction: 'ease-out'
});
this.handlerAnimation(len, index, animationContext);
item.animationObj = animationContext.export();
});
//plus顺时针旋转
var animationMenu = wx.createAnimation({
duration: 500,
timingFunction: 'ease-out'
})
animationMenu.rotateZ(360).step();
this.setData({
animMenu: animationMenu.export(),
navBars: this.data.navBars
});
},
//关闭nav动画
closeAnimation() {
//plus顺时针旋转
var animationMenu = wx.createAnimation({
duration: 500,
timingFunction: 'ease-out'
})
this.data.navBars.forEach((item, index) => {
let animationContext = wx.createAnimation({
duration: 500,
timingFunction: 'ease-out'
});
animationContext.translate(0, 0).rotateZ(0).opacity(0).step();
item.animationObj = animationContext.export();
});
animationMenu.rotateZ(0).step();
this.setData({
animMenu: animationMenu.export(),
navBars: this.data.navBars
});
},
//处理动画逻辑分4个和5个时
handlerAnimation(len, index, animationContext) {
const translateFour = [[-50, -80], [-80, -30], [-80, 30], [-50, 80]];
const translateFive = [[-50, -100], [-90, -55], [-110, 0], [-90, 55], [-50, 100]];
if (len == 4) {
animationContext.translate(translateFour[index][0], translateFour[index][1]).rotateZ(360).opacity(1).step();
}
else if (len == 5) {
animationContext.translate(translateFive[index][0], translateFive[index][1]).rotateZ(360).opacity(1).step();
}
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--components/floatNav/floatNav.wxml-->
<!--pages/menu/menu.wxml-->
<view>
<view class="img-style" data-item="{{item}}" data-index="{{idx}}" animation="{{item.animationObj}}" bindtap="bindNav"
wx:for="{{navBars}}"
wx:for-item="item"
wx:for-index="idx"
wx:key="*this">
<image src="{{item.icon}}" mode="aspectFit"></image>
</view>
<view class="img-plus-style" animation="{{animMenu}}" bindtap="bindShowOrCloseMenu">
<image src="https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/menu.png" mode="aspectFit"></image>
</view>
</view>
/* components/floatNav/floatNav.wxss */
/* pages/menu/menu.wxss */
.img-plus-style {
height: 82rpx;
width: 82rpx;
position: fixed;
bottom: 330rpx;
/* right: 30rpx; */
right: 25rpx;
z-index: 100;
background-color: rgba(0, 0, 0, 0.4);
/* background-color: rgba(192, 154, 116, 1); */
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
}
.img-plus-style image{
width: 40rpx;
height: 40rpx;
}
.img-style {
height: 82rpx;
width: 82rpx;
position: fixed;
bottom: 330rpx;
/* right: 30rpx; */
right: 25rpx;
opacity: 0;
background-color: rgba(0, 0, 0, 0.4);
/* background-color: rgba(192, 154, 116, 1); */
display: flex;
align-items: center;
border-radius: 50%;
justify-content: center;
}
.img-style image{
width: 40rpx;
height: 40rpx;
}
\ No newline at end of file
...@@ -12,7 +12,7 @@ Component({ ...@@ -12,7 +12,7 @@ Component({
value: '' value: ''
}, },
cardExplain:{ //文案 cardExplain:{ //文案
type: String, type: Array,
value: '' value: ''
}, },
productDesc: { // 产品描述 productDesc: { // 产品描述
...@@ -165,7 +165,7 @@ Component({ ...@@ -165,7 +165,7 @@ Component({
var left = rect.left; var left = rect.left;
ctx.setFillStyle('#fff'); ctx.setFillStyle('#fff');
ctx.fillRect(0, 0, rect.width, height); ctx.fillRect(0, 0, rect.width, height);
// console.log(that.data)
// 图片 // 图片
if (avaterSrc) { if (avaterSrc) {
if (imgInfo) { if (imgInfo) {
...@@ -176,10 +176,6 @@ Component({ ...@@ -176,10 +176,6 @@ Component({
ctx.setFillStyle('#d8d8d8'); ctx.setFillStyle('#d8d8d8');
ctx.setTextAlign('left'); ctx.setTextAlign('left');
} }
console.log(that.data)
// 品牌头像 // 品牌头像
if (that.data.userAvatar) { if (that.data.userAvatar) {
// ctx.drawImage(that.data.userAvatar, 12, 290, 30, 30); // ctx.drawImage(that.data.userAvatar, 12, 290, 30, 30);
...@@ -202,7 +198,6 @@ Component({ ...@@ -202,7 +198,6 @@ Component({
let newStrArr = []; let newStrArr = [];
if (that.data.productDesc){ if (that.data.productDesc){
let subTimes = Math.ceil(that.data.productDesc.length / 15); let subTimes = Math.ceil(that.data.productDesc.length / 15);
console.log(subTimes)
for (let i = 0; i < subTimes ; i ++){ for (let i = 0; i < subTimes ; i ++){
let tempSubStr = that.data.productDesc.substr(i * 15, 15); let tempSubStr = that.data.productDesc.substr(i * 15, 15);
newStrArr.push(tempSubStr) newStrArr.push(tempSubStr)
...@@ -234,25 +229,26 @@ Component({ ...@@ -234,25 +229,26 @@ Component({
ctx.fillText(newStrArr[b], 12, 332 + b * 16); ctx.fillText(newStrArr[b], 12, 332 + b * 16);
} }
}else{ }else{
console.log(that.data.cardExplain)
let explain = JSON.parse(JSON.stringify(that.data.cardExplain)) let explain = JSON.parse(JSON.stringify(that.data.cardExplain))
if (explain[0]){ if (explain[0]){
ctx.setFontSize(12); ctx.setFontSize(12);
ctx.setFillStyle('#333333'); ctx.setFillStyle('#666666');
ctx.setTextAlign('left'); ctx.setTextAlign('left');
ctx.fillText(explain[0], 61, 300); ctx.fillText(explain[0], 12, 332);
} }
if (explain[1]) { if (explain[1]) {
ctx.setFontSize(12); ctx.setFontSize(12);
ctx.setFillStyle('#333333'); ctx.setFillStyle('#666666');
ctx.setTextAlign('left');
ctx.fillText(explain[1], 61, 314);
}
if (explain[2]) {
ctx.setFontSize(12);
ctx.setFillStyle('#333333');
ctx.setTextAlign('left'); ctx.setTextAlign('left');
ctx.fillText(explain[2], 61, 326); ctx.fillText(explain[1], 12, 348);
} }
// if (explain[2]) {
// ctx.setFontSize(12);
// ctx.setFillStyle('#666666');
// ctx.setTextAlign('left');
// ctx.fillText(explain[2], 12, 364);
// }
} }
//产品金额 //产品金额
......
...@@ -8,11 +8,13 @@ ...@@ -8,11 +8,13 @@
const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 : //仅生产环境时 配置 :
//3001 3001 , //3001 3001 , wx313ec36b710125d4
//泰华 2006 , //泰华 2006 , wx40fec8944623c8b3
//多多一上 2007 , //多多一上 2007 ,
//雪岛书屋 2008 //雪岛书屋 2008
//苏州邻里 2003 //苏州邻里 2003
//2012 悦芙媞 wxfe14ebde4a6eea3d
//2010 热风 wxe6d270a3e399ade9
const BRANCH_ID = 3001 const BRANCH_ID = 3001
const isMall = true const isMall = true
...@@ -177,19 +179,34 @@ const prod_brand_config = { ...@@ -177,19 +179,34 @@ const prod_brand_config = {
logo: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/logo_head.png', logo: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/logo_head.png',
}, },
//热风 //热风
2009 : { 2010 : {
appId: 'wxe6d270a3e399ade9', appId: 'wxe6d270a3e399ade9',
tunnelToken: '', tunnelToken: '3c66e77863736a32380a5d683db3520b',
brandId: 2009, brandId: 2010,
plusIsOpen: false, plusIsOpen: false,
contactUsIsOpen: false, contactUsIsOpen: true,
contactUsPluginId: '', contactUsPluginId: '70ff0880b300a95bfb1f32877e212bde',
hasTrial: false, hasTrial: false,
isMall: isMall, isMall: isMall,
orderingMustOpenCard: false, orderingMustOpenCard: false,
isOpenSelfMention: false, // 是否开启门店自提 isOpenSelfMention: false, // 是否开启门店自提
shareTitle: '热风微商城', shareTitle: '热风微商城',
logo: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/logo_head.png', logo: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/logo_head.png',
},
//悦芙媞
2012 : {
appId: 'wxfe14ebde4a6eea3d',
tunnelToken: '6293879e905cd6504386f5bbc8c61926',
brandId: 2012,
plusIsOpen: false,
contactUsIsOpen: true,
contactUsPluginId: '50be97dcb2e4d35db051fa764b9e4a0c',
hasTrial: false,
isMall: isMall,
orderingMustOpenCard: false,
isOpenSelfMention: false, // 是否开启门店自提
shareTitle: '悦芙媞微商城',
logo: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/logo_head.png',
} }
} }
......
{ {
"navigationBarTitleText": "分类", "navigationBarTitleText": "分类",
"usingComponents": { "go-home": "/component/goHome/goHome"} "usingComponents": {
"go-home": "/component/goHome/goHome",
"floatNav": "/component/floatNav/floatNav"
}
} }
\ No newline at end of file
...@@ -59,7 +59,11 @@ ...@@ -59,7 +59,11 @@
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<!--goHome-->
<go-home/>
</view> </view>
<!--goHome-->
<go-home/>
<!-- 导航 -->
<!-- <floatNav /> -->
...@@ -357,8 +357,8 @@ ...@@ -357,8 +357,8 @@
.deliveryType .de-type-item.active{ .deliveryType .de-type-item.active{
background: #ffffff; background: #ffffff;
color: #ff2222; color: #cb3c3c;
border-top: 4rpx solid #ff2222; border-top: 4rpx solid #cb3c3c;
} }
.pick-up{ .pick-up{
...@@ -400,7 +400,7 @@ ...@@ -400,7 +400,7 @@
.pick-up .store-address .store-top .store-name .add-label{ .pick-up .store-address .store-top .store-name .add-label{
font-size: 20rpx; font-size: 20rpx;
padding: 4rpx 6rpx; padding: 4rpx 6rpx;
background: #ff2222; background: #cb3c3c;
color: #ffffff; color: #ffffff;
border-radius: 19rpx; border-radius: 19rpx;
margin-right: 10rpx; margin-right: 10rpx;
......
...@@ -28,9 +28,12 @@ wxService.page({ ...@@ -28,9 +28,12 @@ wxService.page({
noMoreFlag: false, noMoreFlag: false,
myShareCount:'', myShareCount:'',
extendProBanner: '', extendProBanner: '',
explain:[],//文案 explain: '',//文案
productDesc : '',
scene: '', //触点参数 scene: '', //触点参数
proData : [] proData : [],
shareLogo: envInfo.shareLogo,
shareTitle: envInfo.shareTitle,
}, },
/** /**
...@@ -106,9 +109,13 @@ wxService.page({ ...@@ -106,9 +109,13 @@ wxService.page({
}, },
_showMiniCard(e) { _showMiniCard(e) {
console.log(e) let parseExplain = this.data.explain ? JSON.parse(this.data.explain) : [];
let explain = parseExplain.length > 0 ? parseExplain : null;
// console.log(explain)
this.setData({ this.setData({
showCardModal: true showCardModal: true,
productDesc: explain ? '' : this.data.proData[0].productName,
cardTitle: explain,
}) })
}, },
...@@ -179,7 +186,6 @@ wxService.page({ ...@@ -179,7 +186,6 @@ wxService.page({
} }
this.data.currentShareContent = data; this.data.currentShareContent = data;
wxService.getTentacleContent(tentacleInfo).then(res => { wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.id) { if (res && res.id) {
this.data.currentShareContent.tentacleId = res.id; this.data.currentShareContent.tentacleId = res.id;
...@@ -196,8 +202,11 @@ wxService.page({ ...@@ -196,8 +202,11 @@ wxService.page({
scene: scene scene: scene
}); });
}else{ }else{
let parseExplain = this.data.explain ? JSON.parse(this.data.explain) : [];
let explain = parseExplain.length > 0 ? parseExplain : null;
this.setData({ this.setData({
cardTitle: this.data.explain ? this.data.explain : this.data.proData[0].productName, productDesc: explain ? '' : this.data.proData[0].productName,
cardTitle: explain,
cardUrl: this.data.proData[0].productImgUrl || defaultProImg, cardUrl: this.data.proData[0].productImgUrl || defaultProImg,
pagePath: path, pagePath: path,
scene: scene scene: scene
...@@ -315,6 +324,7 @@ wxService.page({ ...@@ -315,6 +324,7 @@ wxService.page({
if (res) { if (res) {
const { result, data } = res.data const { result, data } = res.data
if (result == 0 && data) { if (result == 0 && data) {
// let explain = data.explain.length > 0 ? data.explain.join('')
this.setData({ this.setData({
extendProBanner: data.backgroundImgUrl, extendProBanner: data.backgroundImgUrl,
explain: data.explain explain: data.explain
......
...@@ -188,7 +188,16 @@ ...@@ -188,7 +188,16 @@
page-path="{{pagePath}}" page-path="{{pagePath}}"
scene="{{scene}}" scene="{{scene}}"
/> />
<share-poster id="getPoster" bindmyevent="myEventListener" avater="{{cardUrl}}" cardExplain="{{cardTitle}}" userAvatar="https://xiedemo.oss-cn-shanghai.aliyuncs.com/logo_head.jpg" bind:showMiniCard="_showMiniCard" pagePath="{{pagePath}}" code-img="{{codeImg}}"></share-poster> <share-poster id="getPoster"
bindmyevent="myEventListener"
productDesc="{{productDesc}}"
shareTitle="{{shareTitle}}"
avater="{{cardUrl}}"
cardExplain="{{cardTitle}}"
userAvatar="https://xiedemo.oss-cn-shanghai.aliyuncs.com/logo_head.jpg"
bind:showMiniCard="_showMiniCard"
pagePath="{{pagePath}}"
code-img="{{codeImg}}"></share-poster>
<!--goHome--> <!--goHome-->
<go-home/> <go-home/>
...@@ -31,7 +31,6 @@ wxService.page({ ...@@ -31,7 +31,6 @@ wxService.page({
onShow: function () { onShow: function () {
const { params } = this.options const { params } = this.options
let detail = JSON.parse(params) let detail = JSON.parse(params)
// supplierCode code // supplierCode code
if(detail.id){ if(detail.id){
this.setData({ this.setData({
...@@ -66,9 +65,6 @@ wxService.page({ ...@@ -66,9 +65,6 @@ wxService.page({
title: `您已确认收货!`, title: `您已确认收货!`,
icon: 'none' icon: 'none'
}) })
setTimeout(() => {
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
}, 200)
} else { } else {
wx.showToast({ wx.showToast({
title: `确认收货失败!`, title: `确认收货失败!`,
...@@ -89,7 +85,7 @@ wxService.page({ ...@@ -89,7 +85,7 @@ wxService.page({
for (var i in data.list) { for (var i in data.list) {
if (data.list[i].datetime) { if (data.list[i].datetime) {
data.list[i].date = data.list[i].datetime.substring(0, 10) data.list[i].date = data.list[i].datetime.substring(0, 10)
data.list[i].time = data.list[i].datetime.substring(0, 10) data.list[i].time = data.list[i].datetime.substring(11, 20);
} }
} }
this.setData({ this.setData({
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
page{ page{
background: #f9f9f9; background: #f9f9f9;
padding-bottom: 95rpx; padding-bottom: 100rpx;
overflow-x: hidden; overflow-x: hidden;
} }
.header-wrap{ .header-wrap{
...@@ -56,6 +56,7 @@ page{ ...@@ -56,6 +56,7 @@ page{
border-top: 1px solid rgba(151,151,151,0.3); border-top: 1px solid rgba(151,151,151,0.3);
background-color: #ffffff; background-color: #ffffff;
flex-direction:row-reverse; flex-direction:row-reverse;
z-index: 2;
} }
.button-wrap button{ .button-wrap button{
width: 214rpx; width: 214rpx;
...@@ -65,10 +66,11 @@ page{ ...@@ -65,10 +66,11 @@ page{
.expressRecord { .expressRecord {
width: 696rpx; width: 696rpx;
padding-top: 46rpx; padding-top: 46rpx;
padding-bottom: 200rpx; /* padding-bottom: 200rpx; */
background: #fff; background: #fff;
margin: 0 auto; margin: 0 auto;
padding: 46rpx 0 200rpx 54rpx; padding: 46rpx 0 200rpx 54rpx;
padding-bottom: 0;
} }
.expressRecord-getAddress { .expressRecord-getAddress {
......
...@@ -53,6 +53,7 @@ wxService.page({ ...@@ -53,6 +53,7 @@ wxService.page({
title: '撤销退款成功', title: '撤销退款成功',
icon: 'none' icon: 'none'
}); });
setTimeout(() => { setTimeout(() => {
wx.navigateBack({ wx.navigateBack({
delta : 1 delta : 1
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
</view> </view>
</view> </view>
<view class="cancel"> <view class="cancel" wx-if="{{refundDetail.status == 'A'}}">
<button class="btn btn-primary btn-lg" bindtap="handelRevokeRefund">取消退款</button> <button class="btn btn-primary btn-lg" bindtap="handelRevokeRefund">取消退款</button>
</view> </view>
</view> </view>
......
...@@ -400,10 +400,11 @@ ...@@ -400,10 +400,11 @@
"query": "" "query": ""
}, },
{ {
"id": 54, "id": 53,
"name": "会员详情", "name": "会员详情",
"pathName": "shoppingGuid/page/pages/userInfo/userInfo", "pathName": "shoppingGuid/page/pages/userInfo/userInfo",
"query": "id=700000000013481" "query": "id= 677585630707994624",
"scene": null
}, },
{ {
"id": -1, "id": -1,
......
...@@ -300,27 +300,35 @@ wxService.page({ ...@@ -300,27 +300,35 @@ wxService.page({
) )
); );
let count = 0; let count = 0;
let orderSkuList = item.tradeVO.skuVOList;
let products = item.skuList.map(p => { let products = item.skuList.map(p => {
count = count + p.count; count = count + p.count;
let skuId = p.skuId;
let filterArr = orderSkuList.filter(o => o.skuId == skuId);
let skuImgUrl = 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/1571636466%281%29.jpg';
if (filterArr.length > 0){
skuImgUrl = filterArr[0].skuImgUrl;
}
return { return {
image: p.skuImgUrl ? p.skuImgUrl : 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/1571636466%281%29.jpg', image: skuImgUrl,
skuId: p.skuId, skuId: p.skuId,
} }
}) })
return { return {
orderNo: item.id, orderNo: item.id,
statusText: statusText, statusText: statusText,
products: products, products: products,
count: count, count: count,
payMoney: item.amount payMoney: item.previewAmount
} }
}); });
this.setData({ this.setData({
returnOrderList: arr, returnOrderList: arr,
}); });
}) });
}, },
//获取线下退单 //获取线下退单
getOfflineReturnOrderList(memberId){ getOfflineReturnOrderList(memberId){
......
...@@ -146,8 +146,8 @@ ...@@ -146,8 +146,8 @@
wx:key="returnOrder" wx:key="returnOrder"
wx:for-item="item"> wx:for-item="item">
<view class='order-status'> <view class='order-status'>
<text>退单号 {{item.orderNo}}</text> <text>退单号 {{item.orderNo}}</text>
<text>{{item.statusText}}</text> <text style="color:#333333;font-weight:550;">{{item.statusText}}</text>
</view> </view>
<view class='products-list'> <view class='products-list'>
<view class='pro-item' wx:for="{{item.products}}" wx:key="returnProduct" wx:for-item="returnPro"> <view class='pro-item' wx:for="{{item.products}}" wx:key="returnProduct" wx:for-item="returnPro">
......
...@@ -107,7 +107,7 @@ scroll-view{ ...@@ -107,7 +107,7 @@ scroll-view{
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
color: #ff2222; color: #cb3c3c;
font-size: 28rpx; font-size: 28rpx;
font-weight: 550; font-weight: 550;
} }
...@@ -62,8 +62,8 @@ view{ ...@@ -62,8 +62,8 @@ view{
min-width: 110rpx; min-width: 110rpx;
max-width: 110rpx; max-width: 110rpx;
height: 52rpx; height: 52rpx;
border: solid 1px #ff2222; border: solid 1px #cb3c3c;
color: #ff2222; color: #cb3c3c;
font-size: 24rpx; font-size: 24rpx;
border-radius: 26rpx; border-radius: 26rpx;
display: flex; display: flex;
...@@ -193,7 +193,7 @@ view{ ...@@ -193,7 +193,7 @@ view{
padding: 5rpx 6rpx; padding: 5rpx 6rpx;
font-size: 20rpx; font-size: 20rpx;
background: rgba(255,34,34,0.1); background: rgba(255,34,34,0.1);
color: #ff2222; color: #cb3c3c;
margin-right: 20rpx; margin-right: 20rpx;
border-radius: 6rpx; border-radius: 6rpx;
} }
...@@ -273,7 +273,7 @@ view{ ...@@ -273,7 +273,7 @@ view{
} }
.bottom-btns .bto-btn.primary-red{ .bottom-btns .bto-btn.primary-red{
border: solid 1px #ff2222; border: solid 1px #cb3c3c;
color: #ff2222; color: #cb3c3c;
background: #ffffff; background: #ffffff;
} }
\ No newline at end of file
...@@ -119,8 +119,8 @@ view{ ...@@ -119,8 +119,8 @@ view{
} }
.order-list .order-items .operator .order-btn.primary{ .order-list .order-items .operator .order-btn.primary{
border: solid 1px #ff2222; border: solid 1px #cb3c3c;
color: #ff2222; color: #cb3c3c;
} }
.no-more{ .no-more{
......
...@@ -37,7 +37,7 @@ wxService.page({ ...@@ -37,7 +37,7 @@ wxService.page({
title: '加载中..', title: '加载中..',
}); });
wxService.post(`/merchant/superValueCardActivity/miniProgram/getPageList`).then(res => { wxService.post(`/merchant/superValueCardActivity/miniProgram/getPageList`,{},null,true).then(res => {
if(res){ if(res){
let list = res.data.data ? res.data.data : []; let list = res.data.data ? res.data.data : [];
this.data.cardList = list; this.data.cardList = list;
......
...@@ -12,6 +12,7 @@ wxService.page({ ...@@ -12,6 +12,7 @@ wxService.page({
showModal: false, showModal: false,
valueCardInfo: {}, valueCardInfo: {},
buyType: '2',//现金支付 2 积分兑换 buyType: '2',//现金支付 2 积分兑换
userHasBaseInfo: false
}, },
/** /**
...@@ -28,9 +29,24 @@ wxService.page({ ...@@ -28,9 +29,24 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.userHasLogin();
}, },
//获取当前用户是否登录
userHasLogin() {
const baseUserInfo = wx.getStorageSync('_baseUserInfo');
if (baseUserInfo) {
this.setData({
userHasBaseInfo: true
})
}
else {
this.setData({
userHasBaseInfo: false
})
}
},
//获取活动详情 //获取活动详情
getValueCardActivityInfo() { getValueCardActivityInfo() {
wx.showLoading({ wx.showLoading({
...@@ -53,6 +69,8 @@ wxService.page({ ...@@ -53,6 +69,8 @@ wxService.page({
// let tempArr = descArr.map(item => { // let tempArr = descArr.map(item => {
// return item.value; // return item.value;
// }); // });
// console.log(obj)
obj.descArr = descArr; obj.descArr = descArr;
this.data.valueCardInfo = obj; this.data.valueCardInfo = obj;
this.setData({ this.setData({
...@@ -166,7 +184,7 @@ wxService.page({ ...@@ -166,7 +184,7 @@ wxService.page({
wx.showModal({ wx.showModal({
title: '购买成功', title: '购买成功',
content: '是否跳转到我的超值卡列表查看?', content: '是否跳转到我的超值卡列表查看?',
confirmColor: '#ff2222', confirmColor: '#cb3c3c',
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
wx.navigateTo({ wx.navigateTo({
......
<!--subPackage/page/pages/valueCardInfo/valueCardInfo.wxml--> <!--subPackage/page/pages/valueCardInfo/valueCardInfo.wxml-->
<image src='{{valueCardInfo.infoUrl}}' class='card-info' mode='widthFix'></image> <image src='{{valueCardInfo.infoUrl ? valueCardInfo.infoUrl : valueCardInfo.listUrl}}' class='card-info' mode='widthFix'></image>
<view class='card-info-body'> <view class='card-info-body'>
<view class='card-title'>{{valueCardInfo.activityName}}</view> <view class='card-title'>{{valueCardInfo.activityName}}</view>
<view class='card-desc-item' wx:if="{{valueCardInfo.hasDate}}"> <view class='card-desc-item' wx:if="{{valueCardInfo.hasDate}}">
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
wx:for-item="item" wx:for-item="item"
wx:for-index="idx" wx:for-index="idx"
wx:key="*this"> wx:key="*this">
<view class='lf'>{{item.label}}</view> <view class='lf'>{{item.label ? item.label : '说明内容'}}</view>
<view class='rg'> <view class='rg'>
<view class='list-item'> {{item.value}}</view> <view class='list-item'> {{item.value}}</view>
</view> </view>
...@@ -39,7 +39,14 @@ ...@@ -39,7 +39,14 @@
<text bindtap='onTapViewRule'>《超值卡规则》</text> <text bindtap='onTapViewRule'>《超值卡规则》</text>
</view> </view>
</view> </view>
<view class='rg-button {{checked ? "" : "disabled"}}' bindtap='onTapBuy'>{{buyType == 1 ? "立即购买" : "立即兑换"}}</view>
<view class='rg-button positionRe {{checked ? "" : "disabled"}}' wx:if="{{!userHasBaseInfo}}">
<button class="positionAbs clear-btn"
bindgetuserinfo="_getUserInfo" open-type='getUserInfo'></button>
{{buyType == 1 ? "立即购买" : "立即兑换"}}
</view>
<view class='rg-button {{checked ? "" : "disabled"}}'
wx:if="{{userHasBaseInfo}}" bindtap='onTapBuy'>{{buyType == 1 ? "立即购买" : "立即兑换"}}</view>
</view> </view>
<!-- 超值卡规则 --> <!-- 超值卡规则 -->
......
...@@ -90,7 +90,6 @@ class Http { ...@@ -90,7 +90,6 @@ class Http {
header: { header: {
'buyer-token': this.getToken(), 'buyer-token': this.getToken(),
'tentacle-content': this.getTentacle(), 'tentacle-content': this.getTentacle(),
// 'tentacle-content': '{"id":"621346354647797760","tentacleType":3,"tentacleId":"611969009872691200","contentType":1}'
}, },
data: parmas data: parmas
}) })
...@@ -99,13 +98,8 @@ class Http { ...@@ -99,13 +98,8 @@ class Http {
url, url,
method: 'GET', method: 'GET',
header: { header: {
// 'tunnel-token' : 'brand1002', // 测试
// 'tunnel-token': 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', // 测试
// 'tunnel-token' : 'd6db651f8b9c7db4176465accfc1c913843fd9ad328cd5f4fe201d918072c9e8', // 生产
'tunnel-token': envInfo.tunnelToken, // 开发 'tunnel-token': envInfo.tunnelToken, // 开发
'tentacle-content': this.getTentacle(), 'tentacle-content': this.getTentacle(),
// 'tentacle-content': '{"id":"621346354647797760","tentacleType":3,"tentacleId":"611969009872691200","contentType":1}'
}, },
data: parmas data: parmas
}) })
...@@ -113,29 +107,40 @@ class Http { ...@@ -113,29 +107,40 @@ class Http {
} }
post (url, parmas, channel) { post (url, parmas, channel,unLogin) {
let baseUserInfo = wx.getStorageSync('_baseUserInfo') if (!unLogin){
let guideUserInfo = wx.getStorageSync('guidBaseInfo'); let baseUserInfo = wx.getStorageSync('_baseUserInfo')
let guideUserInfo = wx.getStorageSync('guidBaseInfo');
if (baseUserInfo || guideUserInfo){ if (baseUserInfo || guideUserInfo) {
return this.request({ return this.request({
url, url,
method: 'POST', method: 'POST',
header: { header: {
'buyer-token': this.getToken(), 'buyer-token': this.getToken(),
'tentacle-content': this.getTentacle() 'tentacle-content': this.getTentacle()
}, },
data: parmas, data: parmas,
channel: channel channel: channel
}) })
} else { } else {
return this.request({
url,
method: 'POST',
header: {
'tunnel-token': envInfo.tunnelToken, // 开发
'tentacle-content': this.getTentacle()
},
data: parmas,
channel: channel
})
}
}
else{
return this.request({ return this.request({
url, url,
method: 'POST', method: 'POST',
header: { header: {
// 'tunnel-token' : 'brand1002', // 测试
// 'tunnel-token': 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', // 测试
// 'tunnel-token' : 'd6db651f8b9c7db4176465accfc1c913843fd9ad328cd5f4fe201d918072c9e8', // 生产
'tunnel-token': envInfo.tunnelToken, // 开发 'tunnel-token': envInfo.tunnelToken, // 开发
'tentacle-content': this.getTentacle() 'tentacle-content': this.getTentacle()
}, },
...@@ -143,6 +148,7 @@ class Http { ...@@ -143,6 +148,7 @@ class Http {
channel: channel channel: channel
}) })
} }
} }
checkStatus (resp) { checkStatus (resp) {
......
...@@ -293,6 +293,9 @@ class WXService extends Http { ...@@ -293,6 +293,9 @@ class WXService extends Http {
obj: TENTACLE_CONTENT obj: TENTACLE_CONTENT
} }
//记录触点统计
// this.markerTentacleInfo(TENTACLE_CONTENT);
if (data.status == 1) { if (data.status == 1) {
var timestamp = Date.parse(new Date()) var timestamp = Date.parse(new Date())
var expiration = timestamp + 1800000 var expiration = timestamp + 1800000
...@@ -307,10 +310,63 @@ class WXService extends Http { ...@@ -307,10 +310,63 @@ class WXService extends Http {
}) })
} }
//记录触点信息
markerTentacleInfo(tentacleContent){
//1 未登录时不调用改接口
//2 半个小时之内如果调用过该接口则忽略
// console.log('触点信息是---', tentacleContent)
let { memberId } = wx.getStorageSync('_baseUserInfo') ? wx.getStorageSync('_baseUserInfo') : {};
if (memberId){
var currentTimestamp = Date.parse(new Date())
let lastRemarkTime = wx.getStorageSync('lastRemarkTime') ? wx.getStorageSync('lastRemarkTime') : 0;
//如果当前时间大于记录时间 说明半个小时已过
if (currentTimestamp > lastRemarkTime){
//记录
this.callApiRemarkTentacle(memberId,tentacleContent);
}
else{
//小于半个小时
//看一下当前触点于之前的的是不是一个触点,如果是一个触点 则不调用接口
let lastRemarkTentacle = wx.getStorageSync('lastRemarkTentacle');
if (lastRemarkTentacle){
// 678273783177551872
if (lastRemarkTentacle.id != tentacleContent.id){
this.callApiRemarkTentacle(memberId, tentacleContent);
}
}
}
}
}
//调用接口记录触点信息
callApiRemarkTentacle(memberId, tentacleContent){
wxService.post(`/member/share/inviteFriendsLoginLog/saveBatch`, {
memberId: memberId,
tentacleContent: tentacleContent,
}), then(res => {
if (res) {
if (res.data.result == 0) {
//调用接口成功 开始保存
var currentTimestamp = Date.parse(new Date())
var expiration = currentTimestamp + 1800000;
wx.setStorageSync('lastRemarkTime', expiration);
wx.setStorageSync('lastRemarkTentacle', tentacleContent);
}
}
});
}
//根据页面类型判断content取值 //根据页面类型判断content取值
getContentByContentType(item) { getContentByContentType(item) {
//1,2,3,8,9,10,11 页面 取页面标题 //1,2,3,8,9,10,11 页面 取页面标题
if (item.contentType == 1 || item.contentType == 2 || item.contentType == 3 || item.contentType == 8 || item.contentType == 9 || item.contentType == 10 || item.contentType == 11) { if (item.contentType == 1 ||
item.contentType == 2 ||
item.contentType == 3 ||
item.contentType == 8 ||
item.contentType == 9 ||
item.contentType == 10 ||
item.contentType == 11) {
item.content = item.content item.content = item.content
} }
// 详情 // 详情
......
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