Browse Source

上传

master
前端-胡立永 4 months ago
parent
commit
3cdbee5070
5 changed files with 142 additions and 38 deletions
  1. +10
    -1
      api/api.js
  2. +3
    -0
      pages/index/cart.vue
  3. +2
    -2
      pages_order/auth/wxLogin.vue
  4. +113
    -34
      pages_order/components/product/submitUnitSelect.vue
  5. +14
    -1
      pages_order/mine/address.vue

+ 10
- 1
api/api.js View File

@ -21,7 +21,6 @@ const config = {
limit : 500, limit : 500,
showLoading : true, showLoading : true,
}, },
// 修改个人信息接口 // 修改个人信息接口
updateInfo: { updateInfo: {
url: '/info/updateInfo', url: '/info/updateInfo',
@ -30,6 +29,16 @@ const config = {
limit : 500, limit : 500,
showLoading : true, showLoading : true,
}, },
//隐私政策
getPrivacyPolicy: {
url: '/login/getPrivacyPolicy',
method: 'GET',
},
//用户协议
getUserAgreement: {
url: '/login/getUserAgreement',
method: 'GET',
},
} }


+ 3
- 0
pages/index/cart.vue View File

@ -142,6 +142,9 @@
<style scoped lang="scss"> <style scoped lang="scss">
.page { .page {
padding-bottom: 200rpx; padding-bottom: 200rpx;
/deep/ .uv-swipe-action{
width: 100%;
}
} }
.user { .user {


+ 2
- 2
pages_order/auth/wxLogin.vue View File

@ -35,10 +35,10 @@
activeColor="#FD5100" activeColor="#FD5100"
:name="1" :name="1"
></uv-checkbox> ></uv-checkbox>
阅读并同意我们的<text @click="openConfigDetail('privacyAgreement')">服务协议与隐私条款</text>
阅读并同意我们的<text @click="openConfigDetail('getPrivacyPolicy')">服务协议与隐私条款</text>
</view> </view>
<view class=""> <view class="">
以及<text @click="openConfigDetail('userAgreement')">个人信息保护指引</text>
以及<text @click="openConfigDetail('getUserAgreement')">个人信息保护指引</text>
</view> </view>
</view> </view>
</uv-checkbox-group> </uv-checkbox-group>


+ 113
- 34
pages_order/components/product/submitUnitSelect.vue View File

@ -29,12 +29,12 @@
<view class="box"> <view class="box">
<image <image
class="image" class="image"
src="https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg"
:src="unit.pic"
mode=""></image> mode=""></image>
<view class="info"> <view class="info">
<view class="price"> <view class="price">
<text>299</text>
<text>{{ unit.depositPrice }}</text>
</view> </view>
<view class="unit"> <view class="unit">
请选择规格 请选择规格
@ -53,10 +53,10 @@
</view> </view>
<view class="list"> <view class="list">
<view :class="{act : unitIndex == index}" <view :class="{act : unitIndex == index}"
v-for="(item, index) in 10"
v-for="(item, index) in detail.hotelGoodsSkuList"
@click="selectUnit(item, index)" @click="selectUnit(item, index)"
:key="index"> :key="index">
120*40*75桌子尺寸
{{ item.title }}
</view> </view>
</view> </view>
</view> </view>
@ -69,20 +69,28 @@
费用明细 费用明细
</view> </view>
<view class="detail"> <view class="detail">
押金200
押金{{ unit.depositPrice }}
</view> </view>
</view> </view>
<!-- 提交按钮 --> <!-- 提交按钮 -->
<view class="submit-btn"> <view class="submit-btn">
{{ submiitTitle }}
<view class="l"
@click="addCart">
加入租赁车
</view>
<view class="r"
@click="orderPay">
{{ submiitTitle }}
</view>
</view> </view>
</view> </view>
<uv-popup ref="addressPopup" :round="30"> <uv-popup ref="addressPopup" :round="30">
<addressList <addressList
:addressList="addressList"
ref="addressList"
height="60vh"
@select="selectAddress" @select="selectAddress"
/> />
</uv-popup> </uv-popup>
@ -93,52 +101,44 @@
import addressList from '../address/addressList.vue' import addressList from '../address/addressList.vue'
export default { export default {
components : { components : {
addressList
addressList,
}, },
props : { props : {
submiitTitle : { submiitTitle : {
default : '立即租赁', default : '立即租赁',
type : String, type : String,
},
detail : {
default : {}
} }
}, },
data() { data() {
return { return {
unitIndex : 0, unitIndex : 0,
addressList: [
{
id : 1,
name : 'xx',
phone : '1305xxxx802',
address : '广东省广州市越秀区',
addressDetail : '城南故事C3栋2802',
},
{
id : 2,
name : 'xx',
phone : '1305xxxx802',
address : '广东省广州市越秀区',
addressDetail : '城南故事C3栋2802',
},
{
id : 3,
name : 'xx',
phone : '1305xxxx802',
address : '广东省广州市越秀区',
addressDetail : '城南故事C3栋2802',
},
],
address : { address : {
name : '请选择联系人', name : '请选择联系人',
addressDetail : '', addressDetail : '',
}, },
num : 1, num : 1,
unit : {}, unit : {},
addressTotal : 0,
} }
}, },
methods: { methods: {
// //
open(){ open(){
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
if(!this.unit.id){
this.selectUnit(this.detail.hotelGoodsSkuList[0], 0)
}
//
this.$refs.addressList.getAddressList().then(res => {
this.addressTotal = res.total
if(this.addressTotal != 0){
this.address = res.records[0]
}
})
}, },
// //
close(){ close(){
@ -146,9 +146,10 @@
}, },
// //
openAddress(){ openAddress(){
if (!this.addressList.length) {
if (this.addressTotal == 0) {
this.$refs.popup.close()
return uni.navigateTo({ return uni.navigateTo({
url: '/pages_order/mine/address'
url: '/pages_order/mine/address?type=back'
}) })
} }
this.$refs.addressPopup.open('bottom') this.$refs.addressPopup.open('bottom')
@ -163,6 +164,68 @@
this.unit = item this.unit = item
this.unitIndex = index this.unitIndex = index
}, },
addCart(){
this.$api('cartAdd', {
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> </script>
@ -273,7 +336,6 @@
} }
} }
.submit-btn{ .submit-btn{
background: $uni-color;
width: 600rpx; width: 600rpx;
height: 80rpx; height: 80rpx;
color: #fff; color: #fff;
@ -283,6 +345,23 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: 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> </style>

+ 14
- 1
pages_order/mine/address.vue View File

@ -39,7 +39,15 @@
}, },
data() { data() {
return { return {
title: '新增地址'
title: '新增地址',
type : '',
}
},
onLoad(args) {
this.type = args.type
if(this.type == 'back'){
this.addBtn()
} }
}, },
onShow() { onShow() {
@ -83,6 +91,11 @@
if (res.code == 200) { if (res.code == 200) {
this.$refs.addressPopup.close() this.$refs.addressPopup.close()
this.getAddressList() this.getAddressList()
if(this.type == 'back'){
uni.navigateBack(-1)
}
uni.showToast({ uni.showToast({
title: '操作成功', title: '操作成功',
icon: 'none' icon: 'none'


Loading…
Cancel
Save