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,
showLoading : true,
},
// 修改个人信息接口
updateInfo: {
url: '/info/updateInfo',
@ -30,6 +29,16 @@ const config = {
limit : 500,
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">
.page {
padding-bottom: 200rpx;
/deep/ .uv-swipe-action{
width: 100%;
}
}
.user {


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

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


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

@ -29,12 +29,12 @@
<view class="box">
<image
class="image"
src="https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg"
:src="unit.pic"
mode=""></image>
<view class="info">
<view class="price">
<text>299</text>
<text>{{ unit.depositPrice }}</text>
</view>
<view class="unit">
请选择规格
@ -53,10 +53,10 @@
</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>
@ -69,20 +69,28 @@
费用明细
</view>
<view class="detail">
押金200
押金{{ unit.depositPrice }}
</view>
</view>
<!-- 提交按钮 -->
<view class="submit-btn">
{{ submiitTitle }}
<view class="l"
@click="addCart">
加入租赁车
</view>
<view class="r"
@click="orderPay">
{{ submiitTitle }}
</view>
</view>
</view>
<uv-popup ref="addressPopup" :round="30">
<addressList
:addressList="addressList"
ref="addressList"
height="60vh"
@select="selectAddress"
/>
</uv-popup>
@ -93,52 +101,44 @@
import addressList from '../address/addressList.vue'
export default {
components : {
addressList
addressList,
},
props : {
submiitTitle : {
default : '立即租赁',
type : String,
},
detail : {
default : {}
}
},
data() {
return {
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 : {
name : '请选择联系人',
addressDetail : '',
},
num : 1,
unit : {},
addressTotal : 0,
}
},
methods: {
//
open(){
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(){
@ -146,9 +146,10 @@
},
//
openAddress(){
if (!this.addressList.length) {
if (this.addressTotal == 0) {
this.$refs.popup.close()
return uni.navigateTo({
url: '/pages_order/mine/address'
url: '/pages_order/mine/address?type=back'
})
}
this.$refs.addressPopup.open('bottom')
@ -163,6 +164,68 @@
this.unit = item
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>
@ -273,7 +336,6 @@
}
}
.submit-btn{
background: $uni-color;
width: 600rpx;
height: 80rpx;
color: #fff;
@ -283,6 +345,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>

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

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


Loading…
Cancel
Save