|
|
|
@ -2,13 +2,13 @@
|
|
|
|
|
* @Author: ch
|
|
|
|
|
* @Date: 2022-03-20 14:14:53
|
|
|
|
|
* @LastEditors: ch
|
|
|
|
|
* @LastEditTime: 2022-05-26 14:31:36
|
|
|
|
|
* @LastEditTime: 2022-05-26 16:33:14
|
|
|
|
|
* @Description: file content
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
|
<view>
|
|
|
|
|
|
|
|
|
|
<UiWhiteBox v-if="productType == 1">
|
|
|
|
|
<UiWhiteBox v-if="productType == GOODS_TYPE.ENTITY">
|
|
|
|
|
<u-cell class="address" :border="false" isLink @click="selectAddress">
|
|
|
|
|
<view slot="title" class="address--title">
|
|
|
|
|
{{address.province ? address.province + address.city + address.area : '请选择收货地址'}}
|
|
|
|
@ -68,6 +68,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {GOODS_TYPE} from '@/common/dicts/goods';
|
|
|
|
|
import UiCell from '@/components/UiCell';
|
|
|
|
|
import {ApiPostSubmitOrder, ApiGetBeforeOrder, ApiGetBeforeCartOrder} from '@/common/api/order';
|
|
|
|
|
import {ApiGetAddress } from '@/common/api/base';
|
|
|
|
@ -79,6 +80,7 @@ export default {
|
|
|
|
|
components : {UiCell, UiButton, UiWhiteBox, UiGoodsInfo },
|
|
|
|
|
data(){
|
|
|
|
|
return {
|
|
|
|
|
GOODS_TYPE,
|
|
|
|
|
address : {},
|
|
|
|
|
userMessage : '',
|
|
|
|
|
orderInfo : {},
|
|
|
|
@ -94,7 +96,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
onShow(){
|
|
|
|
|
// 默认选择设为默认的地址
|
|
|
|
|
if(!this.address.id && this.productType == 1){
|
|
|
|
|
if(!this.address.id && this.productType == GOODS_TYPE.ENTITY){
|
|
|
|
|
this.getAddressList()
|
|
|
|
|
}else{
|
|
|
|
|
this.getBeforeOrder();
|
|
|
|
@ -123,7 +125,7 @@ export default {
|
|
|
|
|
if(query.mode === 'cart'){
|
|
|
|
|
res = await ApiGetBeforeCartOrder({
|
|
|
|
|
cartIds: query.ids,
|
|
|
|
|
isVirtual :this.productType == 2 && true,
|
|
|
|
|
isVirtual :this.productType == GOODS_TYPE.VIRTUAL && true,
|
|
|
|
|
recipientAddressId : this.address.id
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -133,7 +135,7 @@ export default {
|
|
|
|
|
productSkuId : query.skuId,
|
|
|
|
|
quantity : query.num,
|
|
|
|
|
activityId : query.activityId,
|
|
|
|
|
isVirtual : this.productType == 2 && true,
|
|
|
|
|
isVirtual : this.productType == GOODS_TYPE.VIRTUAL && true,
|
|
|
|
|
activityTimeId : query.activityTimeId,
|
|
|
|
|
// 1正常购买 2活动购买
|
|
|
|
|
activityType : query.activityType,
|
|
|
|
@ -158,7 +160,7 @@ export default {
|
|
|
|
|
*/
|
|
|
|
|
async submit(){
|
|
|
|
|
const {query} = this.$Route;
|
|
|
|
|
if(!this.address.id && this.productType === 1){
|
|
|
|
|
if(!this.address.id && this.productType === GOODS_TYPE.ENTITY){
|
|
|
|
|
uni.$u.toast('请选择收货地址');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -171,7 +173,7 @@ export default {
|
|
|
|
|
orderSource : this.$store.state.openId ? 5 : 4,
|
|
|
|
|
// #endif
|
|
|
|
|
recipientAddressId : this.address.id,
|
|
|
|
|
isVirtual :this.productType == 2 && true,
|
|
|
|
|
isVirtual :this.productType == GOODS_TYPE.VIRTUAL && true,
|
|
|
|
|
shoppingCartIds : query.ids ? query.ids.split(',') : [],
|
|
|
|
|
products : this.orderInfo.products.map(i => ({
|
|
|
|
|
activityId : query.activityId,
|
|
|
|
|