286 lines
7.8 KiB
Vue
286 lines
7.8 KiB
Vue
<template>
|
||
<view class="pagesContent">
|
||
<view class="navBack">
|
||
<uni-icons class="backIcon" type="left" size="24" color="#333333" @click="navBack"></uni-icons>
|
||
填写订单
|
||
</view>
|
||
|
||
<view class="content">
|
||
<!-- 地址 -->
|
||
<view class="addressbox box pt16 pb16" >
|
||
<view class="flex alcenter">
|
||
<image style="width: 40rpx; height: 40rpx;margin-left: 12rpx;" src="https://wx.yaohe.hnjrdzkj.xyz/static/wechat/shop/wechat/static/address.png"
|
||
mode="" @tap.stop="shopaddress"></image>
|
||
<text class="ft14 ftw500 cl-333" style="padding-left: 18rpx;" @tap.stop="shopaddress">{{address.accept_name}}</text>
|
||
<text class="ft14 ftw500 cl-333 pl20" @tap.stop="shopaddress">{{address.accept_mobile}}</text>
|
||
<uni-icons type="right" size="18" color="#333333" style="margin-left: auto;" @tap="navaddress"></uni-icons>
|
||
</view>
|
||
<view v-if="address.accept_province || address.accept_city || address.accept_exp_area || address.accept_address" class="ft14 ftw500 cl-999" style="margin-left: 70rpx;margin-top: 12rpx;" @tap.stop="shopaddress">
|
||
{{address.accept_province}}{{address.accept_city}}{{address.accept_exp_area}}{{address.accept_address}}
|
||
</view>
|
||
<view v-else class="ft14 ftw500 cl-999" style="margin-left: 70rpx;margin-top: 12rpx;" @tap.stop="shopaddress">
|
||
<text>请填写收货地址</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 商品信息 -->
|
||
<view class="messagebox box flex">
|
||
<image style="width: 176rpx;height: 176rpx;border-radius: 14rpx;" :src="detailsdata.cimage" mode="">
|
||
</image>
|
||
<view class="ml10 flex" style="width: 456rpx; flex-direction: column;justify-content: space-around">
|
||
<view class="text-over2 ftw500 cl-333" style="font-size: 30rpx;">{{detailsdata.name}}</view>
|
||
<view class="" style="color: #EF1857;">
|
||
<text class="ft20 ftw500">{{detailsdata.price}}</text>
|
||
<text class="ft14 ftw500" style="margin-left: 12rpx;">积分</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<!-- 商品信息选择 -->
|
||
<view class="message_select box ">
|
||
<view class="flex ml15 mr15" style="justify-content: space-between">
|
||
<view class="ft14 ftw5000 cl-333">商品总价</view>
|
||
<view class="ft14 ftw5000 cl-333">{{detailsdata.price}}积分</view>
|
||
</view>
|
||
<view class=" " style="width: 100%;height: 2rpx; background-color: #F7F8F9;margin: 36rpx 0;"></view>
|
||
<view class="flex ml15 mr15" style="justify-content: space-between">
|
||
<view class="ft14 ftw5000 cl-333">总运费</view>
|
||
<view class="ft14 ftw5000 " style="color: #EF1857;">免运费</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class=" box " style="height: 100rpx;line-height: 100rpx;">
|
||
<view class="flex ml15 mr15 alcenter" style="justify-content: space-between">
|
||
<view class="ft14 ftw5000 cl-333">使用积分</view>
|
||
<image style="width: 28rpx;height: 28rpx;" src="https://wx.yaohe.hnjrdzkj.xyz/static/wechat/shop/wechat/static/select_icon.png" mode=""></image>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="box " style="height: 100rpx;line-height: 100rpx;width: 100%;">
|
||
<view class="flex ml15 mr15 alcenter" style="justify-content: space-between">
|
||
<view class="ft14 ftw5000 cl-333" style="width: 50%;">备注</view>
|
||
<input class="uni-input" v-model="remark" placeholder="请输入内容" style="text-align: right;" />
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="bottom_button ">
|
||
<view style="height: 88rpx;display: flex;justify-content: space-between;width: 100%;align-items: baseline">
|
||
<view class="" style="height: 80rpx;">
|
||
<text class="ftw5000 ft14 cl-999" style="margin-left: 34rpx;margin-right: 20rpx;">共1件</text>
|
||
<text class="ftw5000 ft14 cl-999">合计:</text>
|
||
<text class="ftw5000 ft16 " style="color: #EF1857;">{{detailsdata.price}}</text>
|
||
<text class="ftw5000 ft14 " style="color: #EF1857;">积分</text>
|
||
</view>
|
||
<view class="exchange button" @click="clickexchange">提交订单</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- <uni-popup type="center" ref="pointsyes">
|
||
<view class="pointsyesbox">
|
||
<view class="ft24">积分扣除成功</view>
|
||
<view class="button" style="margin-top: 92rpx;padding: 20rpx 0;" @click="navorder">确定</view>
|
||
</view>
|
||
</uni-popup> -->
|
||
<addresspopup ref="addresspopup" @replacement="replacement"></addresspopup>
|
||
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import addresspopup from "@/pagesA/components/addresspopup.vue";
|
||
export default {
|
||
components: {
|
||
addresspopup
|
||
},
|
||
data() {
|
||
return {
|
||
remark: "",
|
||
detailsdata: {},
|
||
address: {}
|
||
}
|
||
},
|
||
onLoad(e) {
|
||
this.shanchu(e.id)
|
||
},
|
||
onShow(){
|
||
this.getlist()
|
||
},
|
||
methods: {
|
||
navBack() {
|
||
uni.navigateBack(1);
|
||
},
|
||
shanchu(id) {
|
||
this.$httpRequest({
|
||
url: '/api/delivery/goods/info',
|
||
methods: "POST",
|
||
data: {
|
||
goods_id: id
|
||
},
|
||
}).then(res => {
|
||
if (res.code == 1) {
|
||
this.detailsdata = res.data
|
||
console.log(this.detailsdata);
|
||
}
|
||
}).catch(err => {
|
||
|
||
})
|
||
},
|
||
//获取快递地址
|
||
getlist() {
|
||
this.$httpRequest({
|
||
url: '/api/delivery/address/list',
|
||
data: this.data,
|
||
methods: "POST",
|
||
}).then(res => {
|
||
if (res.code == 1) {
|
||
for (var i = 0; i < res.data.list.length; i++) {
|
||
res.data.list[i].is_default = 0
|
||
if (res.data.list[i].is_default == 1) {
|
||
this.address = res.data.list[i]
|
||
return
|
||
} else if (i + 1 == res.data.list.length) {
|
||
this.address = res.data.list[0]
|
||
}
|
||
}
|
||
}
|
||
}).catch(err => {
|
||
console.log('bind user err');
|
||
console.log(err);
|
||
})
|
||
},
|
||
shopaddress(){
|
||
if(!this.address.accept_province || !this.address.accept_city || !this.address.accept_exp_area || !this.address.accept_address){
|
||
this.navaddress();
|
||
return;
|
||
}
|
||
this.$refs.addresspopup.addressshop(this.address)
|
||
},
|
||
|
||
clickexchange() {
|
||
this.$httpRequest({
|
||
url: '/api/delivery/order/create',
|
||
data: {
|
||
goods_id: this.detailsdata.id,
|
||
address_id: this.address.id,
|
||
buy_num: 1,
|
||
remark: this.remark
|
||
},
|
||
methods: "POST",
|
||
}).then(res => {
|
||
uni.navigateTo({ //订单
|
||
url: '/pagesA/integral/completeorder?id=' + res.data.order_id
|
||
})
|
||
}).catch(err => {
|
||
console.log('bind user err');
|
||
console.log(err);
|
||
})
|
||
return
|
||
this.$refs.pointsyes.open()
|
||
},
|
||
|
||
navaddress() {
|
||
uni.navigateTo({ //地址
|
||
url: '/pagesA/integral/address'
|
||
})
|
||
},
|
||
replacement(data){
|
||
this.address = data
|
||
}
|
||
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped>
|
||
.pagesContent {
|
||
background: url(https://wx.yaohe.hnjrdzkj.xyz/static/wechat/shop/wechat/static/order_bg.png);
|
||
padding-top: 54rpx;
|
||
background-repeat: no-repeat;
|
||
background-size: 750rpx 356rpx;
|
||
height: 356rpx;
|
||
background-color: #F7F8F9;
|
||
|
||
}
|
||
|
||
.navBack {
|
||
font-size: 32rpx;
|
||
color: #333333;
|
||
font-weight: 600;
|
||
text-align: center;
|
||
height: 120rpx;
|
||
line-height: 120rpx;
|
||
position: relative;
|
||
z-index: 1;
|
||
}
|
||
|
||
.backIcon {
|
||
position: absolute;
|
||
left: 16rpx;
|
||
top: 0rpx;
|
||
}
|
||
|
||
.content {
|
||
margin: 0 26rpx;
|
||
}
|
||
|
||
.addressbox {
|
||
height: 160rpx;
|
||
padding-right: 28rpx;
|
||
}
|
||
|
||
.messagebox {
|
||
padding: 22rpx 24rpx;
|
||
}
|
||
|
||
.message_select {
|
||
padding: 40rpx 0;
|
||
}
|
||
|
||
.bottom_button {
|
||
position: fixed;
|
||
bottom: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
height: 160rpx;
|
||
z-index: 1;
|
||
background: #ffffff;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.exchange {
|
||
margin: 16rpx 28rpx 0 28rpx;
|
||
line-height: 80rpx;
|
||
font-weight: 500;
|
||
font-size: 32rpx;
|
||
|
||
}
|
||
|
||
.button {
|
||
height: 80rpx;
|
||
width: 312rpx;
|
||
background: linear-gradient(123deg, #00E075 0%, #09D89E 100%);
|
||
border-radius: 40rpx;
|
||
text-align: center;
|
||
color: #FFFFFF;
|
||
}
|
||
|
||
.pointsyesbox {
|
||
width: 500rpx;
|
||
height: 300rpx;
|
||
background-color: #fff;
|
||
border-radius: 24rpx;
|
||
text-align: center;
|
||
padding: 24rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
|
||
}
|
||
|
||
|
||
|
||
.box {
|
||
margin-bottom: 24rpx;
|
||
}
|
||
</style> |