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