Commit 6c8d519e by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

parents b26877ef 0bb3098e
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
padding: 200rpx 0; padding: 200rpx 0;
box-sizing: border-box; box-sizing: border-box;
} }
.wpl {
white-space:pre-line;
}
/* 主题色 */ /* 主题色 */
.theme-color { .theme-color {
......
...@@ -26,6 +26,37 @@ Component({ ...@@ -26,6 +26,37 @@ Component({
this.setData({ this.setData({
baseImgUrl: app.globalData.imageUrl baseImgUrl: app.globalData.imageUrl
}) })
const { tabBar } = this.data
tabBar.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
console.log('currentPath', currentPath.route,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'
} else {
newRow.newPath = ''
}
// item.row = JSON.stringify(newRow)
item.row = newRow
}
})
this.setData({ tabBar }, () => {
})
}, },
ready() { ready() {
this.setData({ this.setData({
...@@ -86,7 +117,8 @@ Component({ ...@@ -86,7 +117,8 @@ Component({
wxService.router(`${currentClickType}`) wxService.router(`${currentClickType}`)
} }
} else if (curItemType.row) { } else if (curItemType.row) {
let rowObj = JSON.parse(curItemType.row) // let rowObj = JSON.parse(curItemType.row)
let rowObj = curItemType.row
let currentClickRow = app.globalData.commonFunc.getLinkRow(rowObj.type, rowObj) let currentClickRow = app.globalData.commonFunc.getLinkRow(rowObj.type, rowObj)
if (rowObj.type == 1) { } if (rowObj.type == 1) { }
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<block wx:for="{{tabBar.images}}" wx:key="{{index}}" wx:for-item="tab"> <block wx:for="{{tabBar.images}}" wx:key="{{index}}" wx:for-item="tab">
<view class="tab"> <view class="tab">
<!--当前页面需要授权 且未授权--> <!--当前页面需要授权 且未授权-->
<view wx:if="{{utils.hanlerLinkNeedAuth(tab.link.url)}}" class="btn-tab"> <!--<view wx:if="{{utils.hanlerLinkNeedAuth(tab.link.url)}}" class="btn-tab">-->
<view wx:if="{{tab.link ? utils.hanlerLinkNeedAuth(typeOf(tab.link.newPath) != undefined ? tab.link.newPath : tab.link.url) : utils.hanlerLinkNeedAuth(tab.row.newPath ? tab.row.newPath : tab.row.url)}}" class="btn-tab">
<view wx:if="{{!currentHasUserInfo}}" class="btn-tab"> <view wx:if="{{!currentHasUserInfo}}" class="btn-tab">
<button <button
bindgetuserinfo="_getUserInfo" bindgetuserinfo="_getUserInfo"
......
...@@ -10,7 +10,7 @@ Component({ ...@@ -10,7 +10,7 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
currentHasUserInfo:{ currentHasUserInfo: {
type: Boolean, type: Boolean,
type: false type: false
}, },
...@@ -23,6 +23,37 @@ Component({ ...@@ -23,6 +23,37 @@ Component({
this.setData({ this.setData({
baseImgUrl: app.globalData.imageUrl baseImgUrl: app.globalData.imageUrl
}) })
const { picNav } = this.data
picNav.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
console.log('currentPath', currentPath.route,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'
} else {
newRow.newPath = ''
}
// item.row = JSON.stringify(newRow)
item.row = newRow
}
})
this.setData({ picNav }, () => {
})
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
...@@ -88,7 +119,8 @@ Component({ ...@@ -88,7 +119,8 @@ Component({
wxService.router(`${currentClickType}`) wxService.router(`${currentClickType}`)
} }
} else if (curItemType.row) { } else if (curItemType.row) {
let rowObj = JSON.parse(curItemType.row) // let rowObj = JSON.parse(curItemType.row)
let rowObj = curItemType.row
let currentClickRow = app.globalData.commonFunc.getLinkRow(rowObj.type, rowObj) let currentClickRow = app.globalData.commonFunc.getLinkRow(rowObj.type, rowObj)
if (rowObj.type == 1) { } if (rowObj.type == 1) { }
......
...@@ -7,8 +7,18 @@ ...@@ -7,8 +7,18 @@
wx:for-item="item" wx:for-item="item"
class="nav-block" class="nav-block"
> >
<!--当前页面需要授权 且未授权-->
<view wx:if="{{item.link ? utils.hanlerLinkNeedAuth(typeOf(item.link.newPath) != undefined ? item.link.newPath : item.link.url) : utils.hanlerLinkNeedAuth(item.row.newPath ? item.row.newPath : item.row.url)}}">
<button
wx:if="{{!currentHasUserInfo}}"
bindgetuserinfo="_getUserInfo"
data-jflag="false"
open-type='getUserInfo'
class='btn btn-primary btn-vip-code'
hover-class="btn-hover"
style="height:100%"
>
<image <image
wx:if="{{currentHasUserInfo}}"
class="pic-img" class="pic-img"
style="width: {{100}}%;height: {{100}}px;" style="width: {{100}}%;height: {{100}}px;"
src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}" src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}"
...@@ -19,17 +29,10 @@ ...@@ -19,17 +29,10 @@
bindload="imageLoad" bindload="imageLoad"
bindtap='preview' bindtap='preview'
/> />
</button>
<button
wx:if="{{!currentHasUserInfo}}"
bindgetuserinfo="_getUserInfo"
data-jflag="false"
open-type='getUserInfo'
class='btn btn-primary df'
hover-class="btn-hover"
style="height:100%"
>
<image <image
wx:if="{{currentHasUserInfo}}"
class="pic-img" class="pic-img"
style="width: {{100}}%;height: {{100}}px;" style="width: {{100}}%;height: {{100}}px;"
src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}" src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}"
...@@ -40,8 +43,20 @@ ...@@ -40,8 +43,20 @@
bindload="imageLoad" bindload="imageLoad"
bindtap='preview' bindtap='preview'
/> />
</button> </view>
<view wx:else>
<image
class="pic-img"
style="width: {{100}}%;height: {{100}}px;"
src="{{utils.formateUrl(item.imageUrl,baseImgUrl)}}"
data-appid="{{item.link.appid}}"
data-path="{{item.link.url}}"
data-link="{{item.link}}"
data-item="{{item}}"
bindload="imageLoad"
bindtap='preview'
/>
</view>
</view> </view>
</view> </view>
...@@ -14,8 +14,11 @@ ...@@ -14,8 +14,11 @@
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
flex-direction: row; flex-direction: row;
align-items: center; /* align-items: center; */
} }
.nav-block { .nav-block {
flex: 1 flex: 1
} }
.btn-vip-code {
display: flex;
}
\ No newline at end of file
// component/selectCoupon/selectCoupon.js // component/selectCoupon/selectCoupon.js
const wxService = require('../../utils/wxService')
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -7,13 +9,18 @@ Component({ ...@@ -7,13 +9,18 @@ Component({
show: { // 显示标识 show: { // 显示标识
type: Boolean, type: Boolean,
value: false value: false
},
couponList: {
type: Array,
value: [],
observer: '_couponList'
} }
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
checkedColor: 'rgb(203, 60, 60)',
isSelect:false isSelect:false
}, },
...@@ -21,21 +28,51 @@ Component({ ...@@ -21,21 +28,51 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
selectCoupon() { _couponList(newV, oldV) {
console.log('2222') console.log('newV, oldV', newV)
// 当前优惠券价格 if (newV !== oldV) {
this.setData({ newV.map(item => {
isSelect: !this.data.isSelect item.couponSettingDTO.notice = JSON.parse(item.couponSettingDTO.notice)
for (let i in item.couponSettingDTO.notice) {
if (item.couponSettingDTO.notice[i].type == 1) {
item.couponSettingDTO.notice[i].value = item.couponSettingDTO.startTime.substring(0, 10) + ' 至 ' + item.couponSettingDTO.endTime.substring(0, 10)
}
}
}) })
this._updateData({
couponList: newV
})
}
},
_updateData(data) {
if (data) {
this.setData(data)
}
},
selectCoupon(e) {
// 1 抵用券 2 折扣券
const { id,index,type } = e.currentTarget.dataset
const { couponList } = this.data
console.log('2222', id,index, type)
couponList.forEach(item=>{
item.checked = false
})
couponList[index].checked = true
wxService.nextTick(() => {
this.triggerEvent('updateCoupon', couponList[index].couponDiscount)
})
this.setData({
couponList
},()=>{
this.hidePopup()})
}, },
hidePopup: function () { // 隐藏弹出框 hidePopup: function () { // 隐藏弹出框
this.setData({ this.setData({
show: false show: false
}) })
}, },
}
},
}) })
<view class="modal-container{{show ? ' active' : ''}}" bindtap="hidePopup" />
<view class="modal-container{{show ? ' active' : ''}}" bindtap="hidePopup"></view>
<view class="modal-content{{show ? ' active' : ''}}"> <view class="modal-content{{show ? ' active' : ''}}">
<!--{{couponList}}-->
<view class="modal-header"> <view class="modal-header">
<image src="/assets/imgs/7_1_0/arrow-right.png" class="modal-to-back" mode="widthFix"></image> <image src="/assets/imgs/7_1_0/arrow-right.png" class="modal-to-back" mode="widthFix" />
<text class="modal-title">选择优惠券</text> <text class="modal-title">选择优惠券</text>
<image class="modal-close" mode="widthFix" src="/assets/imgs/7_1_0/close.png" bindtap="hidePopup"></image> <image
</view> class="modal-close"
mode="widthFix"
<view class="modal-info"> src="/assets/imgs/7_1_0/close.png"
<view class="coupon-list" bindtap="selectCoupon"> bindtap="hidePopup"
<image wx:if="{{false}}" class="coupon-bg" src="/assets/imgs/7_1_0/coupon-bg.png" mode="widthFix"></image> />
<image class="coupon-bg" src="/assets/imgs/7_1_0/disabled-coupon.png" mode="widthFix"></image> </view>
<view class="modal-info" wx:if="{{couponList.length}}">
<block wx:for="{{couponList}}" wx:key="{{index}}" wx:for-item="item">
<view class="coupon-list" data-id="{{item.couponSettingDTO.couponSettingId}}" data-index="{{index}}" data-type="{{item.couponSettingDTO.type}}" bindtap="selectCoupon">
<image
wx:if="{{false}}"
class="coupon-bg"
src="/assets/imgs/7_1_0/coupon-bg.png"
mode="widthFix"
/>
<image class="coupon-bg" src="/assets/imgs/7_1_0/disabled-coupon.png" mode="widthFix" />
<view class="coupon-info"> <view class="coupon-info">
<view class="left-price"> <view class="left-price">
<view class="top-price"> <image class="left-price-coupon-bg" src="{{item.couponSettingDetailDTO.style.takeCouponBgimg}}" />
<text>¥</text>
<text class="amount">50</text>
</view> </view>
<view class="bottom-desc">
满99可用
</view>
</view>
<view class="right-info"> <view class="right-info">
<view class="coupon-title">新人礼包劵</view> <view class="coupon-title">{{item.couponSettingDTO.title}}</view>
<view class="coupon-time">有效期</view> <view wx:for="{{item.couponSettingDTO.notice}}" wx:key="{{index}}">
<view class="coupon-desc">拼团及特殊商品不可用</view> <text class='coupon-time'>{{item.label}}</text>
<text class='coupon-desc wpl'>{{item.value}}</text>
</view>
</view> </view>
<view class="select-radio"> <view class="select-radio">
<view class="{{isSelect ? 'theme-color' : ''}} coupon-radio" > <icon size="16" type="{{item.checked ? 'success' : 'circle'}}" color="{{checkedColor}}"></icon>
<image wx:if="{{isSelect}}" class="tick-success" src="/assets/imgs/7_1_0/tick-success.png" mode="widthFix"></image>
</view>
</view> </view>
<!-- <view class="select-radio">
<view class="{{isSelect ? 'theme-color' : ''}} coupon-radio">
<image
wx:if="{{isSelect}}"
class="tick-success"
src="/assets/imgs/7_1_0/tick-success.png"
mode="widthFix"
/>
</view> </view>
</view>-->
</view> </view>
<view class="empty-coupon">
暂无可用优惠券
</view> </view>
</block>
</view> </view>
<view wx:else class="empty-coupon">
暂无可用优惠券
</view>
</view> </view>
...@@ -61,11 +61,18 @@ ...@@ -61,11 +61,18 @@
} }
.coupon-bg{ .coupon-bg{
width: 100%; width: 100%;
height: 174rpx;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: -1; z-index: -1;
} }
.left-price-coupon-bg {
height: 174rpx;
width: 174rpx;
position: absolute;
overflow: hidden;
}
.modal-info{ .modal-info{
padding: 0 24rpx; padding: 0 24rpx;
margin-top: 95rpx; margin-top: 95rpx;
...@@ -77,8 +84,10 @@ ...@@ -77,8 +84,10 @@
font-size: 18rpx; font-size: 18rpx;
color:#CB3C3C; color:#CB3C3C;
position: absolute; position: absolute;
top: 36rpx; /* top: 36rpx;
left: 48rpx; left: 48rpx; */
width: 174rpx;
height: 174rpx;
} }
.amount{ .amount{
font-size: 54rpx; font-size: 54rpx;
...@@ -130,3 +139,26 @@ ...@@ -130,3 +139,26 @@
.theme-color{ .theme-color{
border: none; border: none;
} }
/* .integral-detail{
margin-top: 90rpx;
}
.integral-list{
margin-bottom: 60rpx;
font-size: 27rpx;
}
.integral-title,.integral-desc{
display: inline-block;
}
.integral-title{
color: #999999;
vertical-align: top;
margin-right: 50rpx;
text-align: right;
width: 120rpx;
}
.integral-desc{
width: 500rpx;
color: #666666;
} */
\ No newline at end of file
...@@ -19,7 +19,8 @@ wxService.page({ ...@@ -19,7 +19,8 @@ wxService.page({
citys: null, citys: null,
cityView: '', cityView: '',
multiIndex: [0, 0, 0], multiIndex: [0, 0, 0],
selectCityName: ['', ''] selectCityName: ['', ''],
currentCoupon: '无可用优惠券'
}, },
/** /**
...@@ -62,7 +63,15 @@ wxService.page({ ...@@ -62,7 +63,15 @@ wxService.page({
// 地址列表 // 地址列表
this.getAddressList() this.getAddressList()
}, },
updateCoupon(e){
console.log('e', e.detail)
if(e.detail){
this.setData({
haveCoupon: true,
currentCoupon: e.detail
})
}
},
formSubmit(e) { formSubmit(e) {
const { goodsAddress } = this.data const { goodsAddress } = this.data
// 保存地址 && 支付 // 保存地址 && 支付
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
<view> <view>
<text class="price-label">优惠券</text> <text class="price-label">优惠券</text>
<view class="select-coupon" bindtap="selectCoupon"> <view class="select-coupon" bindtap="selectCoupon">
<text class="{{haveCoupon ? 'coupon-price' : 'no-coupon'}}">{{haveCoupon ? '-¥100' : '无可用优惠券'}}</text> <text class="{{haveCoupon ? 'coupon-price' : 'no-coupon'}}">{{currentCoupon}}</text>
<image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right.png" /> <image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right.png" />
</view> </view>
</view> </view>
...@@ -160,5 +160,5 @@ ...@@ -160,5 +160,5 @@
</view> </view>
<!--goHome--> <!--goHome-->
<go-home/> <go-home/>
<select-coupon show="{{showSelectCoupon}}" /> <select-coupon show="{{showSelectCoupon}}" bind:updateCoupon="updateCoupon" coupon-list="{{currentOrderList.couponDiscountPreviews}}"/>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 44, "current": 17,
"list": [ "list": [
{ {
"id": -1, "id": -1,
......
...@@ -30,16 +30,17 @@ function formateUrl(url, BASE_IMG_URL){ ...@@ -30,16 +30,17 @@ function formateUrl(url, BASE_IMG_URL){
// 授权路径 我的/购物车/我的奖励/邀请好友/推广商品/我的地址/我的订单 // 授权路径 我的/购物车/我的奖励/邀请好友/推广商品/我的地址/我的订单
function hanlerLinkNeedAuth(link){ function hanlerLinkNeedAuth(link){
var flag = false var flag = false
if(typeof(link) != undefined && link) {
if(link.indexOf('pages/my/my') > -1 || if(link.indexOf('pages/my/my') > -1 ||
link.indexOf('pages/cart/cart') > -1 || link.indexOf('pages/cart/cart') > -1 ||
link.indexOf('subPackage/page/pages/orderBenefit/orderBenefit') > -1 || link.indexOf('subPackage/page/pages/orderBenefit/orderBenefit') > -1 ||
link.indexOf('subPackage/page/pages/myInvite/myInvite') > -1 || link.indexOf('subPackage/page/pages/myInvite/myInvite') > -1 ||
link.indexOf('pages/extendProduct/extendProduct') > -1 || link.indexOf('pages/extendProduct/extendProduct') > -1 ||
link.indexOf('pages/myAddress/myAddress') > -1 || link.indexOf('pages/myAddress/myAddress') > -1 ||
link.indexOf('pages/order/order') > -1) link.indexOf('pages/order/order') > -1) {
{
flag = true flag = true
} }
}
return flag return flag
} }
......
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