Commit a913267e by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

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