NurseStationApp/pages/confirmOrder/confirmOrder.vue

168 lines
3.9 KiB
Vue
Raw Normal View History

2022-10-24 15:37:38 +08:00
<template>
<view class="app">
<view class="bodys">
<view class="addressinfo">
2022-10-31 09:04:45 +08:00
<view class="namephone">
{{updata.receiver}},{{updata.phone}}
2022-10-24 15:37:38 +08:00
</view>
<view class="picture">
2022-11-01 16:26:34 +08:00
<span @tap='upaddress'>修改地址</span>
2022-10-31 09:04:45 +08:00
<u-icon name="arrow-right" color="#ffffff" size="32"></u-icon>
2022-10-24 15:37:38 +08:00
</view>
2022-10-31 09:04:45 +08:00
<view class="address">
{{updata.receiveAddress}}
2022-10-24 15:37:38 +08:00
</view>
</view>
</view>
<view class="commodity">
<view class="commodityInfo">
2022-11-01 16:26:34 +08:00
<image :src="updata.img" mode=""></image>
2022-10-24 15:37:38 +08:00
<view class="infos">
<view class="detail">
2022-10-31 09:04:45 +08:00
<view class="spangoodsName">
{{updata.goodsName}}
</view>
<view class="spanprice"> {{updata.goodsPrice}}</view>
2022-10-24 15:37:38 +08:00
</view>
<view class="model">
2022-10-31 09:04:45 +08:00
型号:<span>{{updata.goodsAttributeName}}</span>
2022-10-24 15:37:38 +08:00
</view>
</view>
</view>
<view class="quantity">
<view class="header">
数量
</view>
<view class="number">
2022-10-31 09:04:45 +08:00
<u-number-box :min="1" :max="updata.goodsStock" v-model="updata.goodsCount" @minus='delnumber'
@plus='addnumber'>
</u-number-box>
2022-10-24 15:37:38 +08:00
</view>
</view>
</view>
2022-11-10 16:40:00 +08:00
<!-- <view class="integral">
2022-10-24 15:37:38 +08:00
<view class="header">
积分抵扣
</view>
<view class="number">
共5积分满100可用
</view>
2022-11-10 16:40:00 +08:00
</view> -->
2022-10-24 15:37:38 +08:00
<view class="price">
<view class="priceinfo">
<view class="header money">
商品金额
</view>
<view class="number money">
2022-10-31 09:04:45 +08:00
{{updata.totalPrice}}
2022-10-24 15:37:38 +08:00
</view>
</view>
<view class="priceinfo">
<view class="header money">
运费
</view>
<view class="number money">
+0.0
</view>
</view>
<view class="freight">
<view class="number total">
2022-10-31 09:04:45 +08:00
{{updata.totalPrice}}
2022-10-24 15:37:38 +08:00
</view>
</view>
</view>
<view class="bottom">
<view class="moneys">
2022-10-31 09:04:45 +08:00
{{updata.totalPrice}}
2022-10-24 15:37:38 +08:00
</view>
<view class="submit" @tap='show=true'>
提交订单
</view>
</view>
<!-- 弹框 -->
<view class="frame">
<u-popup v-model="show" mode="bottom" length="45%" border-radius="30">
<view class="payment">
<span>请选择支付方式</span>
<view class="cencel" @tap="show = false">
<image src="../../static/gb.png" mode=""></image>
</view>
</view>
<view class="chat">
<image src="/static/chat.png" mode=""></image>
<span>微信支付</span>
</view>
2022-10-31 09:04:45 +08:00
<view class="submits" @tap='buy'>
<span>确认支付</span><span>{{updata.totalPrice}}</span>
2022-10-24 15:37:38 +08:00
</view>
</u-popup>
</view>
2022-10-31 09:04:45 +08:00
<u-toast ref="uToast" />
2022-10-24 15:37:38 +08:00
</view>
</template>
<script>
2022-10-31 09:04:45 +08:00
import baseurl from '@/api/baseurl.js'
import {
addStationGoodsOrder
} from '@/api/confirmOrder/index.js'
import {
goodPatientInfo
} from '@/api/modifyAddress/modifyAddress.js';
2022-10-24 15:37:38 +08:00
export default {
data() {
return {
2022-10-31 09:04:45 +08:00
show: false,
updata: {},
Patient: {},
2022-10-24 15:37:38 +08:00
}
},
methods: {
2022-10-31 09:04:45 +08:00
buy() {
2022-11-15 15:36:29 +08:00
// addStationGoodsOrder(this.updata).then(res => {
// if (res.code == 500) {
// this.$refs.uToast.show({
// title: res.msg,
// type: 'error'
// })
// } else {
// uni.navigateTo({
// url: `/pages/paysuccess/paysuccess`
// })
// }
// })
2022-10-31 09:04:45 +08:00
},
delnumber(e) {
this.updata.totalPrice = (e.value * this.updata.goodsPrice).toFixed(2)
},
addnumber(e) {
this.updata.totalPrice = (e.value * this.updata.goodsPrice).toFixed(2)
},
2022-10-24 15:37:38 +08:00
upaddress() {
uni.navigateTo({
2022-10-31 09:04:45 +08:00
url: `/pages/modifyAddress/modifyAddress?updata=${JSON.stringify(this.updata)}`
})
},
},
onLoad(options) {
this.updata = JSON.parse(options.updata)
2022-11-09 16:38:05 +08:00
},
onShow() {
var that = this
let useritem = null
uni.$on('updata', function(data) {
that.updata = JSON.parse(data.updata)
if (data.useritem) {
useritem = JSON.parse(data.useritem)
that.updata.receiver = useritem.receiveName
that.updata.phone = useritem.receivePhone
that.updata.receiveAddress = useritem.address
}
})
},
2022-10-24 15:37:38 +08:00
}
</script>
<style lang="scss">
@import './confirmOrder.scss'
</style>