Commit e41311c0 by 赵雅纹

Merge branch 'dev_7.1.0' into fixbug-ZYW

# Conflicts:
#	src/pages/confirmOrder/confirmOrder.js
parents b803f356 09da528c
...@@ -1320,8 +1320,8 @@ button { ...@@ -1320,8 +1320,8 @@ button {
button::after{ button::after{
border:none; border:none;
} }
.button-hover{ .button-hover, .button-active{
background-color:none; background-color:transparent;
} }
input{ input{
outline:none; outline:none;
......
...@@ -27,7 +27,9 @@ Component({ ...@@ -27,7 +27,9 @@ Component({
baseImgUrl: app.globalData.imageUrl baseImgUrl: app.globalData.imageUrl
}) })
const { tabBar } = this.data const { tabBar } = this.data
tabBar.forEach(item => {
let currentTab = tabBar.images
currentTab.forEach(item => {
// 存在 row 处理数据 8 商品 9 分类 // 存在 row 处理数据 8 商品 9 分类
let newRow = null let newRow = null
if (item.link) { if (item.link) {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
bindgetuserinfo="_getUserInfo" bindgetuserinfo="_getUserInfo"
data-jflag="false" data-jflag="false"
open-type='getUserInfo' open-type='getUserInfo'
class='btn btn-primary' class='btn'
hover-class="btn-hover" hover-class="btn-hover"
style="height: 100%;" style="height: 100%;"
> >
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
data-item="{{tab}}" data-item="{{tab}}"
bindtap="handelToPage" bindtap="handelToPage"
> >
<button class='btn btn-primary' style="height: 100%;"> <button class='btn' style="height: 100%;">
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" /> <image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button> </button>
</view> </view>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
data-item="{{tab}}" data-item="{{tab}}"
bindtap="handelToPage" bindtap="handelToPage"
> >
<button class='btn btn-primary' style="height: 100%"> <button class='btn' style="height: 100%">
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" /> <image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button> </button>
</view> </view>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
bindgetuserinfo="_getUserInfo" bindgetuserinfo="_getUserInfo"
data-jflag="false" data-jflag="false"
open-type='getUserInfo' open-type='getUserInfo'
class='btn btn-primary' class='btn'
hover-class="btn-hover" hover-class="btn-hover"
style="height: 100%;" style="height: 100%;"
> >
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
data-item="{{tab}}" data-item="{{tab}}"
bindtap="handelToPage" bindtap="handelToPage"
> >
<button class='btn btn-primary' style="height: 100%;"> <button class='btn' style="height: 100%;">
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" /> <image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button> </button>
</view> </view>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
data-item="{{tab}}" data-item="{{tab}}"
bindtap="handelToPage" bindtap="handelToPage"
> >
<button class='btn btn-primary' style="height: 100%"> <button class='btn' style="height: 100%">
<image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" /> <image class='tab-img' src="{{utils.formateUrl(currHomePageId == tab.redirectId ? tab.activeImageUrl: tab.imageUrl,baseImgUrl)}}" />
</button> </button>
</view> </view>
......
...@@ -7,8 +7,10 @@ ...@@ -7,8 +7,10 @@
justify-content: center; justify-content: center;
} }
.tab-img { .tab-img {
width: 70rpx; /* width: 70rpx;
height: 70rpx; height: 70rpx; */
width: 90rpx;
height: 90rpx;
} }
.tab { .tab {
flex: 1; flex: 1;
...@@ -19,6 +21,7 @@ ...@@ -19,6 +21,7 @@
.bgc { .bgc {
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
background-color: #fff;
height: 114rpx; height: 114rpx;
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -54,16 +54,31 @@ Component({ ...@@ -54,16 +54,31 @@ Component({
// 1 抵用券 2 折扣券 // 1 抵用券 2 折扣券
const { id,index,type } = e.currentTarget.dataset const { id,index,type } = e.currentTarget.dataset
const { couponList } = this.data const { couponList } = this.data
console.log('type---1 抵用券 2 折扣券 ', id,index, type)
couponList.forEach(item=>{ couponList.forEach(item=>{
item.checked = false item.checked = false
}) })
couponList[index].checked = true couponList[index].checked = true
let params = {
type,
id,
faceAmount: ''
}
if(type == 1){
params.faceAmount = couponList[index].couponSettingDTO.faceAmount
} else if(type == 2){
params.faceAmount = couponList[index].couponSettingDTO.faceAmount
}
wxService.nextTick(() => { wxService.nextTick(() => {
this.triggerEvent('updateCoupon', couponList[index].couponDiscount) this.triggerEvent('updateCoupon', params)
}) })
// wxService.nextTick(() => {
// this.triggerEvent('updateCoupon', couponList[index].couponDiscount)
// })
this.setData({ this.setData({
couponList couponList
},()=>{ },()=>{
......
/* component/waterFlowLayout/waterFlowLayout.wxss */ /* component/waterFlowLayout/waterFlowLayout.wxss */
page{
background-color: rgba(0,0,0,0.05)
}
.water-wrap{ .water-wrap{
margin: 50rpx 20rpx; margin: 50rpx 20rpx;
text-align: justify; text-align: justify;
} }
.item{ .item {
margin-bottom: 10rpx; margin-bottom: 10rpx;
display: inline-block; display: inline-block;
width: 349.86rpx; width: 349.86rpx;
......
...@@ -21,7 +21,9 @@ wxService.page({ ...@@ -21,7 +21,9 @@ wxService.page({
multiIndex: [0, 0, 0], multiIndex: [0, 0, 0],
selectCityName: ['', ''], selectCityName: ['', ''],
currentCoupon: '无可用优惠券', currentCoupon: '无可用优惠券',
wxAddress: false wxAddress: false,
currentCoupon: '',
orderPrice: null, // 订单金额
}, },
/** /**
...@@ -66,14 +68,36 @@ wxService.page({ ...@@ -66,14 +68,36 @@ wxService.page({
this.getAddressList() this.getAddressList()
} }
}, },
updateCoupon(e){ updateCoupon(e) {
console.log('e', e.detail) // faceAmount 抵用多少钱(分) 1 抵用券 2 折扣券
if(e.detail){ const { faceAmount, type, id } = e.detail
const { orderPrice } = this.data
console.log('id', id)
if (type == 1) {
this.setData({ this.setData({
couponId: id,
haveCoupon: true, haveCoupon: true,
currentCoupon: `- ${e.detail}` currentCoupon: `${faceAmount / 100} 元`
})
} else if (type == 2) {
let discounPrice = (faceAmount / 100) * (orderPrice)
let spread = Math.round(orderPrice - discounPrice)
this.setData({
couponId: id,
haveCoupon: true,
currentCoupon: `${spread} 折`
}) })
} }
// 实付款
this.setPayPrice()
},
setPayPrice() {
const { currentCoupon, orderPrice } = this.data
let orderCoupon = parseFloat(currentCoupon)
console.log('orderPrice - orderCoupon', orderPrice - orderCoupon)
this.setData({
orderPrice: Math.round(orderPrice - orderCoupon)
})
}, },
formSubmit(e) { formSubmit(e) {
const { goodsAddress } = this.data const { goodsAddress } = this.data
...@@ -233,7 +257,10 @@ wxService.page({ ...@@ -233,7 +257,10 @@ wxService.page({
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
wx.hideLoading() wx.hideLoading()
this.setData({ currentOrderList: data }) this.setData({
currentOrderList: data,
orderPrice: data.amount
})
} }
} }
}) })
......
<!--pages/confirmOrder/confirmOrder.wxml--> <!--pages/confirmOrder/confirmOrder.wxml-->
<wxs src="../..//wxs/utils.wxs" module="utils" />
<view class="page-confirm-order"> <view class="page-confirm-order">
<form bindsubmit="formSubmit"> <form bindsubmit="formSubmit">
<view class="address-wrap"> <view class="address-wrap">
...@@ -122,7 +124,7 @@ ...@@ -122,7 +124,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'}}">{{currentCoupon}}</text> <text class="{{haveCoupon ? 'coupon-price' : 'no-coupon'}}"> {{currentCoupon ? '-' : '无可用优惠券'}} {{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>
...@@ -147,7 +149,7 @@ ...@@ -147,7 +149,7 @@
<view class="pro-footer"> <view class="pro-footer">
<view class="cost"> <view class="cost">
<text class="cost-label">实付款:</text> <text class="cost-label">实付款:</text>
<text class="cost-price">¥{{currentOrderList.amount}}</text> <text class="cost-price">¥{{utils.numberFormat(orderPrice)}}</text>
</view> </view>
<!-- <button form-type="submit" class="theme-color buy-btn">立即购买</button>--> <!-- <button form-type="submit" class="theme-color buy-btn">立即购买</button>-->
<!-- <view class="theme-color buy-btn" bindtap="handelGobuy">立即购买</view> --> <!-- <view class="theme-color buy-btn" bindtap="handelGobuy">立即购买</view> -->
......
...@@ -50,7 +50,7 @@ wxService.page({ ...@@ -50,7 +50,7 @@ wxService.page({
*/ */
onShow() { onShow() {
let time = Date.parse(new Date()) let time = Date.parse(new Date())
if (member.premiumExpireTime && member.premiumExpireTime > time) { if (member && member.premiumExpireTime && member.premiumExpireTime > time) {
this.setData({ this.setData({
plus: 1 plus: 1
}) })
......
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