|
|
@ -9,10 +9,10 @@ |
|
|
|
@click="openAddress"> |
|
|
|
<image src="../../static/address/selectIcon.png" mode=""></image> |
|
|
|
<view class=""> |
|
|
|
{{ address.name }} |
|
|
|
{{ address.userName }} |
|
|
|
</view> |
|
|
|
<view class=""> |
|
|
|
{{ address.addressDetail }} |
|
|
|
{{ address.address }} |
|
|
|
</view> |
|
|
|
<view class="icon"> |
|
|
|
<uv-icon |
|
|
@ -29,12 +29,13 @@ |
|
|
|
<view class="box"> |
|
|
|
<image |
|
|
|
class="image" |
|
|
|
src="https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg" |
|
|
|
:src="detail.waresImage && |
|
|
|
detail.waresImage.split(',')[0]" |
|
|
|
mode=""></image> |
|
|
|
|
|
|
|
<view class="info"> |
|
|
|
<view class="price"> |
|
|
|
¥<text>299</text>元 |
|
|
|
¥<text>{{ detail.waresPrice }}</text>元 |
|
|
|
</view> |
|
|
|
<view class="unit"> |
|
|
|
请选择规格 |
|
|
@ -47,35 +48,42 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 规格 --> |
|
|
|
<view class="submit-unit"> |
|
|
|
<!-- <view class="submit-unit"> |
|
|
|
<view class="title"> |
|
|
|
规格选择 |
|
|
|
</view> |
|
|
|
<view class="list"> |
|
|
|
<view :class="{act : unitIndex == index}" |
|
|
|
v-for="(item, index) in 10" |
|
|
|
v-for="(item, index) in detail.hotelGoodsSkuList" |
|
|
|
@click="selectUnit(item, index)" |
|
|
|
:key="index"> |
|
|
|
120*40*75【桌子尺寸】 |
|
|
|
{{ item.title }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 费用明细 --> |
|
|
|
<view class="expense-detail"> |
|
|
|
<!-- <view class="expense-detail"> |
|
|
|
<view class="title"> |
|
|
|
费用明细 |
|
|
|
</view> |
|
|
|
<view class="detail"> |
|
|
|
押金:¥200 |
|
|
|
押金:¥{{ unit.depositPrice }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
<!-- 提交按钮 --> |
|
|
|
<view class="submit-btn"> |
|
|
|
{{ submiitTitle }} |
|
|
|
<view class="l" |
|
|
|
@click="addCart"> |
|
|
|
加入租赁车 |
|
|
|
</view> |
|
|
|
<view class="r" |
|
|
|
@click="orderPay"> |
|
|
|
{{ submiitTitle }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
@ -94,12 +102,15 @@ |
|
|
|
import addressList from '../address/addressList.vue' |
|
|
|
export default { |
|
|
|
components : { |
|
|
|
addressList |
|
|
|
addressList, |
|
|
|
}, |
|
|
|
props : { |
|
|
|
submiitTitle : { |
|
|
|
default : '立即租赁', |
|
|
|
type : String, |
|
|
|
}, |
|
|
|
detail : { |
|
|
|
default : {} |
|
|
|
} |
|
|
|
}, |
|
|
|
data() { |
|
|
@ -111,12 +122,21 @@ |
|
|
|
}, |
|
|
|
num : 1, |
|
|
|
unit : {}, |
|
|
|
addressTotal : 0, |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 打开 |
|
|
|
open(){ |
|
|
|
this.$refs.popup.open('bottom') |
|
|
|
|
|
|
|
// 获取地址列表 |
|
|
|
this.$refs.addressList.getAddressList().then(res => { |
|
|
|
this.addressTotal = res.total |
|
|
|
if(this.addressTotal != 0){ |
|
|
|
this.address = res.records[0] |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 关闭 |
|
|
|
close(){ |
|
|
@ -124,6 +144,11 @@ |
|
|
|
}, |
|
|
|
// 打开选择地址 |
|
|
|
openAddress(){ |
|
|
|
if (this.addressTotal == 0) { |
|
|
|
return uni.navigateTo({ |
|
|
|
url: '/pages_order/mine/address' |
|
|
|
}) |
|
|
|
} |
|
|
|
this.$refs.addressPopup.open('bottom') |
|
|
|
}, |
|
|
|
// 选择地址 |
|
|
@ -136,6 +161,68 @@ |
|
|
|
this.unit = item |
|
|
|
this.unitIndex = index |
|
|
|
}, |
|
|
|
addCart(){ |
|
|
|
this.$api('addShopcar', { |
|
|
|
id : this.detail.id, |
|
|
|
skuId : this.unit.id, |
|
|
|
}, res => { |
|
|
|
if(res.code == 200){ |
|
|
|
uni.showToast({ |
|
|
|
title: '添加成功', |
|
|
|
}); |
|
|
|
this.$refs.popup.close() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
orderPay(){ |
|
|
|
|
|
|
|
let data = { |
|
|
|
id : this.detail.id,//商品id |
|
|
|
skuId : this.unit.id,//规格id |
|
|
|
addressId : this.address.id,//地址id |
|
|
|
sku : this.unit.title,//规格 |
|
|
|
num : this.num, |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(this.$utils.verificationAll(data, { |
|
|
|
skuId : '请选择规格', |
|
|
|
addressId : '请选择地址', |
|
|
|
})){ |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.$api('orderPay', data, res => { |
|
|
|
if(res.code == 200){ |
|
|
|
|
|
|
|
uni.redirectTo({ |
|
|
|
url: '/pages/index/order' |
|
|
|
}) |
|
|
|
|
|
|
|
// uni.requestPayment({ |
|
|
|
// provider: 'wxpay', // 服务提提供商 |
|
|
|
// timeStamp: res.result.timeStamp, // 时间戳 |
|
|
|
// nonceStr: res.result.nonceStr, // 随机字符串 |
|
|
|
// package: res.result.packageValue, |
|
|
|
// signType: res.result.signType, // 签名算法 |
|
|
|
// paySign: res.result.paySign, // 签名 |
|
|
|
// success: function (res) { |
|
|
|
// console.log('支付成功',res); |
|
|
|
// uni.redirectTo({ |
|
|
|
// url: '/pages/index/order' |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
// fail: function (err) { |
|
|
|
// console.log('支付失败',err); |
|
|
|
// uni.showToast({ |
|
|
|
// icon:'none', |
|
|
|
// title:"支付失败" |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
@ -246,7 +333,6 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
.submit-btn{ |
|
|
|
background: $uni-color; |
|
|
|
width: 600rpx; |
|
|
|
height: 80rpx; |
|
|
|
color: #fff; |
|
|
@ -256,6 +342,23 @@ |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
border: 1rpx solid $uni-color; |
|
|
|
overflow: hidden; |
|
|
|
.l{ |
|
|
|
flex: 1; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
color: $uni-color; |
|
|
|
} |
|
|
|
.r{ |
|
|
|
background: $uni-color; |
|
|
|
flex: 1; |
|
|
|
height: 100%; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |