Commit a913267e by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

parents e31c4590 fb15f2b0
......@@ -44,9 +44,11 @@ App({
// ios 兼容 是不是plus vip
let currentEndTime = (new Date(registerTime.replace(/-/g, '/'))).getTime(); // 过期时间
let currentTime = (new Date()).getTime(); // 现在时间
this.globalData.isPlusVip = currentTime >= currentEndTime ? true : false
let currentTime = (new Date()).getTime();
this.globalData.isPlusVip = currentTime <= currentEndTime ? true : false // 当前时间 < 注册时间为vip
console.log('this.globalData.isPlusVip',this.globalData.isPlusVip)
if (options.referrerInfo && options.referrerInfo.extraData!=null){
const { activate_ticket, card_id, code, errCode, wx_activate_after_submit_url } = options.referrerInfo.extraData
let urlData = wx_activate_after_submit_url.split("?");
......
......@@ -48,15 +48,13 @@ Component({
newRow.newPath = '/pages/productDetail/productDetail'
} else if (newRow.type == 9) {
newRow.newPath = '/subPackage/page/pages/categoryPro/categoryPro'
} else {
newRow.newPath = ''
}
}
item.row = newRow
}
})
// 当前匹配路径是否需要授权 true 需要 false 不需要
tabBar.images.forEach(item => {
currentTab.forEach(item => {
let checkUrl = ''
if (item.link) {
checkUrl = item.link.newPath ? item.link.newPath : item.link.url
......@@ -64,8 +62,8 @@ Component({
checkUrl = item.row.newPath ? item.row.newPath : item.row.url
}
wxService.NoLoginPage(checkUrl).then(res => {
item.needAuth = res.needAuth
this.setData({ tabBarList: tabBar.images })
if(checkUrl) item.needAuth = res.needAuth
this.setData({ tabBarList: currentTab })
})
})
},
......
......@@ -11,6 +11,10 @@ Component({
* 组件的属性列表
*/
properties: {
currentHasUserInfo: {
type: Boolean,
type: false
},
imageData: {
type: Array,
value: [],
......@@ -20,6 +24,46 @@ Component({
this.setData({
baseImgUrl: app.globalData.imageUrl
})
const { imageData } = this.data
let currentTab = imageData
currentTab.forEach(item => {
// 存在 row 处理数据 8 商品 9 分类
let newRow = null
if (item.link) {
if (item.link.type == 2) {
// 父组件 更新
const urls = getCurrentPages()
const currentPath = urls[0]
const pageId = item.link.url
item.link.newPath = `/${currentPath.route}`
}
return
} else if (item.row) {
newRow = JSON.parse(item.row)
if (newRow.type == 8) {
newRow.newPath = '/pages/productDetail/productDetail'
} else if (newRow.type == 9) {
newRow.newPath = '/subPackage/page/pages/categoryPro/categoryPro'
}
item.row = newRow
}
})
// 当前匹配路径是否需要授权 true 需要 false 不需要
currentTab.forEach(item => {
let checkUrl = ''
if (item.link) {
checkUrl = item.link.newPath ? item.link.newPath : item.link.url
} else if (item.row) {
checkUrl = item.row.newPath ? item.row.newPath : item.row.url
}
wxService.NoLoginPage(checkUrl).then(res => {
if(checkUrl) item.needAuth = res.needAuth
this.setData({ imageList: currentTab })
})
})
},
/**
* 组件的初始数据
......@@ -36,6 +80,7 @@ Component({
padding: 0,
heights: [],
imageHeights: {}, // 记录所有图片的实际高度
imageList: []
},
observers: {
heights: function (heights) {
......@@ -59,6 +104,9 @@ Component({
* 组件的方法列表
*/
methods: {
_getUserInfo(res = {}) {
this.triggerEvent('getAuth', res);
},
imageLoad: function (e) {
// 图片加载完成回调
let heights = this.data.heights
......
<!--component/imageSwiper/imageSwiper.wxml-->
<wxs src="../../wxs/utils.wxs" module="utils" />
<swiper
class="image-swiper"
indicator-dots="{{indicatorDots}}"
......@@ -9,17 +10,54 @@
duration="{{duration}}"
style="height: {{maxHeight}}px;"
>
<block wx:for="{{imageData}}" wx:key="{{index}}" wx:for-item="item">
<block wx:for="{{imageList}}" wx:key="{{index}}" wx:for-item="item">
<swiper-item class="swiper-item">
<view
wx:if="{{baseImgUrl}}"
data-appid="{{item.link.appid}}"
data-path="{{item.link.url}}"
data-link="{{item.link}}"
data-item="{{item}}"
bindtap='preview'
>
<image bindload="imageLoad" src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}" id="swiperImg{{index}}" mode="widthFix" class="slide-image" />
<view wx:if="{{item.needAuth}}">
<view wx:if="{{!currentHasUserInfo}}">
<image
bindload="imageLoad"
src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}"
id="swiperImg{{index}}"
mode="widthFix"
class="slide-image"
/>
</view>
<view wx:else>
<view
data-appid="{{item.link.appid}}"
data-path="{{item.link.url}}"
data-link="{{item.link}}"
data-item="{{item}}"
bindtap='preview'
>
<image
bindload="imageLoad"
src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}"
id="swiperImg{{index}}"
mode="widthFix"
class="slide-image"
/>
</view>
</view>
</view>
<view wx:else>
<view
data-appid="{{item.link.appid}}"
data-path="{{item.link.url}}"
data-link="{{item.link}}"
data-item="{{item}}"
bindtap='preview'
>
<image
bindload="imageLoad"
src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}"
id="swiperImg{{index}}"
mode="widthFix"
class="slide-image"
/>
</view>
</view>
</swiper-item>
</block>
......
......@@ -47,8 +47,6 @@ Component({
newRow.newPath = '/pages/productDetail/productDetail'
} else if (newRow.type == 9) {
newRow.newPath = '/subPackage/page/pages/categoryPro/categoryPro'
} else {
newRow.newPath = ''
}
item.row = newRow
}
......@@ -63,7 +61,7 @@ Component({
checkUrl = item.row.newPath ? item.row.newPath : item.row.url
}
wxService.NoLoginPage(checkUrl).then(res=>{
item.needAuth = res.needAuth
if(checkUrl) item.needAuth = res.needAuth
this.setData({ newPicNav: picNav })
})
})
......
......@@ -99,7 +99,6 @@ wxService.page({
let cartList = this.data.cartList
// let proNum = cartList[e.currentTarget.dataset.index].count
let proNum = cartList[e].count
console.log('减少数量', proNum)
if (proNum > 1) {
proNum--
} else {
......@@ -115,7 +114,9 @@ wxService.page({
cartList: cartList
}, function () {
this.setTotalFee()
this.editOk(cartList[e]) //调用完成
console.log('减少', cartList[e])
this.inputProNumber(cartList[e]) // update
// this.editOk(cartList[e]) //调用完成
})
},
addNumChange(e) {
......@@ -125,7 +126,6 @@ wxService.page({
var cartList = this.data.cartList
// var proNum = cartList[e.currentTarget.dataset.index].count
var proNum = cartList[e].count
console.log('增加数量',proNum)
// 判断库存
if (proNum < 100) {
proNum++
......@@ -142,7 +142,10 @@ wxService.page({
cartList: cartList
}, function () {
this.setTotalFee()
this.editOk(cartList[e]) //调用完成
console.log('add', cartList[e])
this.inputProNumber(cartList[e]) // update
// this.editOk(cartList[e]) // add调用完成
})
},
blurNumChange(e) {
......@@ -161,6 +164,7 @@ wxService.page({
cartList: cartList
}, function () {
this.setTotalFee()
console.log('blur', cartList[e.index])
this.inputProNumber(cartList[e.index]) //调用完成
})
......@@ -183,6 +187,7 @@ wxService.page({
cartList: cartList
}, function () {
this.setTotalFee()
console.log('input', cartList[e.index])
this.inputProNumber(cartList[e.index]) //调用完成
})
}
......@@ -251,8 +256,6 @@ wxService.page({
.router('/pages/confirmOrder/confirmOrder')
.search(parmas)
// let tradeDto = {
// couponId: '',
// trolleySku2Buy:JSON.stringify(trolleySku2Buy)
......
......@@ -90,11 +90,11 @@
<view class="vip-left">
<view class="left-top">
<image class="top-image" src="/assets/imgs/7_1_0/plus-icon.png" />
<text>现在勾选成为vip,立领200元礼包,文案文案 </text>
<text>现在勾选成为vip,立领200元礼包</text>
</view>
<view class="left-bottom">
<text>vip可尊享N大权益</text>
<image class="bottom-image" src="/assets/imgs/7_1_0/explain.png" />
<text>vip可尊享9大权益</text>
<!-- <image class="bottom-image" src="/assets/imgs/7_1_0/explain.png" /> -->
</view>
</view>
<view class="vip-right">
......
......@@ -3,7 +3,7 @@
<!-- 1 轮播 2 个人中心 3 图片导航 4 底部左划 5 底部 Tab 6 公告 7 分类 8 关注公众号 9 plus(9/5-权重高)-->
<block wx:for="{{pages}}" wx:key="{{index}}" wx:for-item="pItem">
<view wx:if="{{pItem.type == 1}}">
<image-swiper image-data="{{pItem.rotationchart.images}}" />
<image-swiper image-data="{{pItem.rotationchart.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"/>
</view>
<view class="" wx:if="{{pItem.type == 2}}">
<person-center bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
......
......@@ -17,10 +17,11 @@
<view class="btn-go-on" bindtap="goPayAgain" wx:if="{{status == 'F'}}">重新支付</view>
</view>
</view>
<view class="status-look df">
<view class="look-store">关注店铺公众号(自定义页面)</view>
<view class="look-btn">关注</view>
<official-account style="width:100%;height:168rpx;"></official-account>
</view>
<view class="status-vip df">
<view class="vip-tips">
<view class="tips-desc">
......@@ -32,9 +33,9 @@
binderror=""
bindload=""
/>
现在勾选成为vip,立领200元礼包,文案文案
现在勾选成为vip,立领200元礼包
</view>
<view class="tips-notice">vip 可尊享n大权益</view>
<view class="tips-notice">vip 可尊享9大权益</view>
</view>
<view class="vip-go-to">去开卡</view>
</view>
......
......@@ -3,7 +3,7 @@
<!-- 1 轮播 2 个人中心 3 图片导航 4 底部左划 5 底部 Tab 6 公告 7 分类 8 关注公众号 9 plus(9/5-权重高)-->
<block wx:for="{{pages}}" wx:key="{{index}}" wx:for-item="pItem">
<view wx:if="{{pItem.type == 1}}">
<image-swiper image-data="{{pItem.rotationchart.images}}" />
<image-swiper image-data="{{pItem.rotationchart.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"/>
</view>
<view class="" wx:if="{{pItem.type == 2}}">
<person-center bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
......@@ -21,13 +21,13 @@
<announcement notice="{{pItem.notice}}"/>
</view>
<view class="" wx:if="{{pItem.type == 7}}">
<tab-sort category-type="{{pItem.categoryType}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" />
<tab-sort category-type="{{pItem.categoryType}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
</view>
<view class="" wx:if="{{pItem.type == 8}}">
<attention focus-wx="{{pItem.focusWx}}" />
</view>
<view class="" wx:if="{{pItem.type == 9}}">
<plus sku-list="{{skuVOList}}" plus-bgi="{{pItem.plus}}" currentHasUserInfo="{{currentHasUserInfo}}"/>
<plus sku-list="{{skuVOList}}" plus-bgi="{{pItem.plus}}" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
</view>
</block>
</view>
......
......@@ -79,13 +79,10 @@ class Http {
.catch(this.fail)
}
// header: {
// 'tunnel-token' : 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD'
// },
get (url, parmas) {
let baseUserInfo = wx.getStorageSync('_baseUserInfo')
console.log('baseUserInfo', baseUserInfo ? 'buyer-token' : 'tunnel-token')
if(baseUserInfo){
return this.request({
url,
......@@ -101,7 +98,7 @@ class Http {
url,
method: 'GET',
header: {
'tunnel-token': this.getToken(),
'tunnel-token': 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD',
'TENTACLE_CONTENT': this.getTentacle()
},
data: parmas
......@@ -129,7 +126,7 @@ class Http {
url,
method: 'POST',
header: {
'tunnel-token': this.getToken(),
'tunnel-token': 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD',
'TENTACLE_CONTENT': this.getTentacle()
},
data: parmas,
......
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