|
|
|
|
@ -38,7 +38,7 @@
|
|
|
|
|
总计:<text style="color: #F3AF28;font-weight: bold;">¥{{totalPrice}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="end-right">
|
|
|
|
|
<view @click="commitBtn" class="end-right">
|
|
|
|
|
提交订单({{totalNum}})
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -59,6 +59,9 @@
|
|
|
|
|
import {
|
|
|
|
|
getAddressApi
|
|
|
|
|
} from '../../api/user.js'
|
|
|
|
|
import {
|
|
|
|
|
splaceOrderApi
|
|
|
|
|
} from '../../api/order.js'
|
|
|
|
|
import {
|
|
|
|
|
onLoad
|
|
|
|
|
} from '@dcloudio/uni-app';
|
|
|
|
|
@ -146,6 +149,24 @@
|
|
|
|
|
astore.address = res.data.address
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//提交订单
|
|
|
|
|
const commitBtn = async () => {
|
|
|
|
|
let commitParm = reactive({
|
|
|
|
|
openid: uni.getStorageSync('openid'),
|
|
|
|
|
userName: astore.userName,
|
|
|
|
|
phone: astore.phone,
|
|
|
|
|
address: astore.area + "," + astore.address,
|
|
|
|
|
price: totalPrice.value,
|
|
|
|
|
details: store.orderList
|
|
|
|
|
})
|
|
|
|
|
const res = await splaceOrderApi(commitParm)
|
|
|
|
|
console.log(res)
|
|
|
|
|
if (res && res.code == 200) {
|
|
|
|
|
//清空购物车
|
|
|
|
|
store.orderList = []
|
|
|
|
|
uni.navigateBack()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
onLoad(() => {
|
|
|
|
|
getAddress()
|
|
|
|
|
})
|
|
|
|
|
|