parent
fe955e9fb1
commit
1a8c321ca7
|
@ -3,13 +3,13 @@
|
||||||
<view class='order-submission'>
|
<view class='order-submission'>
|
||||||
<view class="allAddress" :style="store_self_mention ? '':'padding-top:10rpx;'">
|
<view class="allAddress" :style="store_self_mention ? '':'padding-top:10rpx;'">
|
||||||
<view class="nav acea-row">
|
<view class="nav acea-row">
|
||||||
<view class="item font-color" :class="shippingType === 1 ? 'on' : 'on2'"
|
<view class="item font-color" :class="deliveryType === 1 ? 'on' : 'on2'"
|
||||||
@tap="addressType(0)" v-if='store_self_mention' />
|
|
||||||
<view class="item font-color" :class="shippingType === 2 ? 'on' : 'on2'"
|
|
||||||
@tap="addressType(1)" v-if='store_self_mention' />
|
@tap="addressType(1)" v-if='store_self_mention' />
|
||||||
|
<view class="item font-color" :class="deliveryType === 2 ? 'on' : 'on2'"
|
||||||
|
@tap="addressType(2)" v-if='store_self_mention' />
|
||||||
</view>
|
</view>
|
||||||
<!-- 收货地址的选择 -->
|
<!-- 收货地址的选择 -->
|
||||||
<view class='address acea-row row-between-wrapper' @tap='onAddress' v-if='shippingType === 1'
|
<view class='address acea-row row-between-wrapper' @tap='onAddress' v-if='deliveryType === 1'
|
||||||
:style="store_self_mention ? '':'border-top-left-radius: 14rpx;border-top-right-radius: 14rpx;'">
|
:style="store_self_mention ? '':'border-top-left-radius: 14rpx;border-top-right-radius: 14rpx;'">
|
||||||
<view class='addressCon' v-if="addressInfo.name">
|
<view class='addressCon' v-if="addressInfo.name">
|
||||||
<view class='name'>{{ addressInfo.name }}
|
<view class='name'>{{ addressInfo.name }}
|
||||||
|
@ -47,6 +47,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="pad30">
|
<view class="pad30">
|
||||||
<orderGoods :cartInfo="cartInfo" />
|
<orderGoods :cartInfo="cartInfo" />
|
||||||
|
<!-- 优惠劵展示 -->
|
||||||
<view class='wrapper borRadius14'>
|
<view class='wrapper borRadius14'>
|
||||||
<view class='item acea-row row-between-wrapper' @tap='couponTap'
|
<view class='item acea-row row-between-wrapper' @tap='couponTap'
|
||||||
v-if="orderInfoVo.type === 1 && productType==='normal'">
|
v-if="orderInfoVo.type === 1 && productType==='normal'">
|
||||||
|
@ -55,29 +56,31 @@
|
||||||
<text class='iconfont icon-jiantou'></text>
|
<text class='iconfont icon-jiantou'></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 积分展示 TODO -->
|
||||||
<view class='item acea-row row-between-wrapper'
|
<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.type === 1 && productType==='normal'">
|
||||||
v-if="orderInfoVo.type === 1 && productType==='normal'">
|
|
||||||
<view>积分抵扣</view>
|
<view>积分抵扣</view>
|
||||||
<!-- -->
|
|
||||||
<view class='discount acea-row row-middle'>
|
<view class='discount acea-row row-middle'>
|
||||||
<view> {{useIntegral ? "剩余积分":"当前积分"}}
|
<view> {{pointStatus ? "剩余积分":"当前积分"}}
|
||||||
<text class='num font-color'>{{useIntegral ? orderInfoVo.surplusIntegral : orderInfoVo.userIntegral || 0}}</text>
|
<text class='num font-color'>
|
||||||
|
{{pointStatus ? orderInfoVo.totalPoint - orderInfoVo.usedPoint : (orderInfoVo.totalPoint || 0) }}
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<checkbox-group @change="ChangeIntegral">
|
<checkbox-group @change="ChangeIntegral">
|
||||||
<checkbox :checked='useIntegral ? true : false' :disabled="orderInfoVo.userIntegral==0 && !useIntegral"/>
|
<checkbox :checked='pointStatus' :disabled="orderInfoVo.totalPoint === 0 && !pointStatus"/>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- VIP 展示 TODO -->
|
||||||
<!-- <view class='item acea-row row-between-wrapper'
|
<!-- <view class='item acea-row row-between-wrapper'
|
||||||
v-if="priceGroup.vipPrice > 0 && userInfo.vip && !pinkId && !BargainId && !combinationId && !seckillId">
|
v-if="priceGroup.vipPrice > 0 && userInfo.vip && !pinkId && !BargainId && !combinationId && !seckillId">
|
||||||
<view>会员优惠</view>
|
<view>会员优惠</view>
|
||||||
<view class='discount'>-¥{{priceGroup.vipPrice}}</view>
|
<view class='discount'>-¥{{priceGroup.vipPrice}}</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class='item acea-row row-between-wrapper' v-if='shippingType === 1'>
|
<!-- 配送展示 TODO -->
|
||||||
|
<view class='item acea-row row-between-wrapper' v-if='deliveryType === 1'>
|
||||||
<view>快递费用</view>
|
<view>快递费用</view>
|
||||||
<view class='discount' v-if='parseFloat(orderInfoVo.freightFee) > 0'>
|
<view class='discount' v-if='orderInfoVo.price.deliveryPrice > 0'>
|
||||||
+¥{{orderInfoVo.freightFee}}
|
+¥{{ fen2yuan(orderInfoVo.price.deliveryPrice) }}
|
||||||
</view>
|
</view>
|
||||||
<view class='discount' v-else>免运费</view>
|
<view class='discount' v-else>免运费</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -85,24 +88,26 @@
|
||||||
<view class="item acea-row row-between-wrapper">
|
<view class="item acea-row row-between-wrapper">
|
||||||
<view>联系人</view>
|
<view>联系人</view>
|
||||||
<view class="discount textR">
|
<view class="discount textR">
|
||||||
<input type="text" placeholder="请填写您的联系姓名" placeholder-style="color:#ccc;" placeholder-class="placeholder"
|
<input type="text" placeholder="请填写您的联系姓名" placeholder-style="color:#ccc;"
|
||||||
@blur='realName' />
|
placeholder-class="placeholder" @blur='realName' />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper">
|
<view class="item acea-row row-between-wrapper">
|
||||||
<view>联系电话</view>
|
<view>联系电话</view>
|
||||||
<view class="discount textR">
|
<view class="discount textR">
|
||||||
<input type="text" placeholder="请填写您的联系电话" placeholder-style="color:#ccc;" placeholder-class="placeholder"
|
<input type="text" placeholder="请填写您的联系电话" placeholder-style="color:#ccc;"
|
||||||
@blur='phone'></input>
|
placeholder-class="placeholder" @blur='phone' />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='item' v-if="textareaStatus">
|
<view class='item' v-if="textareaStatus">
|
||||||
<view>备注信息</view>
|
<view>备注信息</view>
|
||||||
<textarea v-if="coupon.coupon===false" placeholder-class='placeholder' @input='bindHideKeyboard'
|
<textarea v-if="coupon.coupon === false" placeholder-class='placeholder'
|
||||||
value="" name="mark" placeholder='请添加备注(150字以内)'></textarea>
|
@input='bindHideKeyboard' value="" name="mark" placeholder='请添加备注(150字以内)' />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- TODO 芋艿:支付方式 -->
|
||||||
<view class='wrapper borRadius14'>
|
<view class='wrapper borRadius14'>
|
||||||
<view class='item'>
|
<view class='item'>
|
||||||
<view>支付方式</view>
|
<view>支付方式</view>
|
||||||
|
@ -121,29 +126,30 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 各种价格 -->
|
||||||
<view class='moneyList borRadius14'>
|
<view class='moneyList borRadius14'>
|
||||||
<view class='item acea-row row-between-wrapper'>
|
<view class='item acea-row row-between-wrapper'>
|
||||||
<view>商品总价:</view>
|
<view>商品总价:</view>
|
||||||
<view class='money'>¥{{orderInfoVo.proTotalFee || 0}}</view>
|
<view class='money'>¥{{ fen2yuan(orderInfoVo.price.totalPrice || 0 ) }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.couponFee > 0">
|
<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.price.couponPrice > 0">
|
||||||
<view>优惠券抵扣:</view>
|
<view>优惠券抵扣:</view>
|
||||||
<view class='money'>-¥{{orderInfoVo.couponFee}}</view>
|
<view class='money'>-¥{{ fen2yuan(orderInfoVo.price.couponPrice) }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.deductionPrice > 0">
|
<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.price.pointPrice > 0">
|
||||||
<view>积分抵扣:</view>
|
<view>积分抵扣:</view>
|
||||||
<view class='money'>-¥{{orderInfoVo.deductionPrice}}</view>
|
<view class='money'>-¥{{ fen2yuan(orderInfoVo.price.pointPrice) }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.freightFee > 0">
|
<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.price.deliveryPrice > 0">
|
||||||
<view>运费:</view>
|
<view>运费:</view>
|
||||||
<view class='money'>+¥{{orderInfoVo.freightFee}}</view>
|
<view class='money'>+¥{{ fen2yuan(orderInfoVo.price.deliveryPrice) }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style='height:120rpx;'></view>
|
<view style='height:120rpx;'></view>
|
||||||
</view>
|
</view>
|
||||||
<view class='footer acea-row row-between-wrapper'>
|
<view class='footer acea-row row-between-wrapper'>
|
||||||
<view>合计:
|
<view>合计:
|
||||||
<text class='font-color'>¥{{orderInfoVo.payFee || 0}}</text>
|
<text class='font-color'>¥{{ fen2yuan(orderInfoVo.price.payPrice || 0) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class='settlement' style='z-index:100' @tap="SubOrder">立即结算</view>
|
<view class='settlement' style='z-index:100' @tap="SubOrder">立即结算</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -201,7 +207,10 @@
|
||||||
return {
|
return {
|
||||||
items: [], // 前端传递的购物项
|
items: [], // 前端传递的购物项
|
||||||
cartInfo: [], // 后端返回的购物项
|
cartInfo: [], // 后端返回的购物项
|
||||||
orderInfoVo: {}, // 订单信息
|
orderInfoVo: { // 订单信息
|
||||||
|
type: 1, // 交易类型
|
||||||
|
price: {} // 价格信息
|
||||||
|
},
|
||||||
|
|
||||||
// TODO 芋艿:未整理
|
// TODO 芋艿:未整理
|
||||||
textareaStatus: true,
|
textareaStatus: true,
|
||||||
|
@ -226,17 +235,10 @@
|
||||||
|
|
||||||
userInfo: {}, //用户信息
|
userInfo: {}, //用户信息
|
||||||
mark: '', //备注信息
|
mark: '', //备注信息
|
||||||
coupon_price: 0, //优惠券抵扣金额
|
|
||||||
useIntegral: false, //是否使用积分
|
|
||||||
integral_price: 0, //积分抵扣金额
|
|
||||||
integral: 0,
|
|
||||||
status: 0,
|
status: 0,
|
||||||
toPay: false, //修复进入支付时页面隐藏从新刷新页面
|
toPay: false, //修复进入支付时页面隐藏从新刷新页面
|
||||||
contacts: '',
|
|
||||||
contactsTel: '',
|
|
||||||
priceGroup: {},
|
priceGroup: {},
|
||||||
animated: false,
|
animated: false,
|
||||||
totalPrice: 0,
|
|
||||||
pagesUrl: "",
|
pagesUrl: "",
|
||||||
payChannel: '',
|
payChannel: '',
|
||||||
bargain: false, // 是否是砍价
|
bargain: false, // 是否是砍价
|
||||||
|
@ -244,6 +246,12 @@
|
||||||
secKill: false, // 是否是秒杀
|
secKill: false, // 是否是秒杀
|
||||||
preOrderNo: '', //预下单订单号
|
preOrderNo: '', //预下单订单号
|
||||||
|
|
||||||
|
// TODO 芋艿:可删除字段
|
||||||
|
totalPrice: 0,
|
||||||
|
|
||||||
|
// ========== 积分 ==========
|
||||||
|
pointStatus: false, //是否使用积分
|
||||||
|
|
||||||
// ========== 优惠劵 ==========
|
// ========== 优惠劵 ==========
|
||||||
couponId: 0, // 选中的优惠券 id
|
couponId: 0, // 选中的优惠券 id
|
||||||
couponTitle: '请选择', // 优惠券的标题
|
couponTitle: '请选择', // 优惠券的标题
|
||||||
|
@ -254,7 +262,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
// ========== 收货地址 ==========
|
// ========== 收货地址 ==========
|
||||||
shippingType: 1, // 1 - 快递配送;2 - 门店自提
|
deliveryType: 1, // 1 - 快递配送;2 - 门店自提
|
||||||
addressId: 0, // 页面传递的 param 对应的地址 id
|
addressId: 0, // 页面传递的 param 对应的地址 id
|
||||||
addressInfo: {}, // 选中的地址信息
|
addressInfo: {}, // 选中的地址信息
|
||||||
address: { // 地址组件
|
address: { // 地址组件
|
||||||
|
@ -268,6 +276,8 @@
|
||||||
store_self_mention: false, // 门店自提是否开启
|
store_self_mention: false, // 门店自提是否开启
|
||||||
storeList: [], // 门店列表
|
storeList: [], // 门店列表
|
||||||
system_store: {}, // 选中的门店
|
system_store: {}, // 选中的门店
|
||||||
|
contacts: '', // 联系人名
|
||||||
|
contactsTel: '', // 联系人手机
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: mapGetters(['isLogin', 'systemPlatform', 'productType']),
|
computed: mapGetters(['isLogin', 'systemPlatform', 'productType']),
|
||||||
|
@ -276,7 +286,6 @@
|
||||||
handler: function(newV, oldV) {
|
handler: function(newV, oldV) {
|
||||||
if (newV) {
|
if (newV) {
|
||||||
this.getloadPreOrder();
|
this.getloadPreOrder();
|
||||||
this.getaddressInfo();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
|
@ -310,7 +319,6 @@
|
||||||
|
|
||||||
// 处理 address 地址
|
// 处理 address 地址
|
||||||
this.addressId = options.addressId || 0;
|
this.addressId = options.addressId || 0;
|
||||||
this.getaddressInfo();
|
|
||||||
// 获得门店自提是否开启
|
// 获得门店自提是否开启
|
||||||
DeliveryApi.getDeliveryConfig().then(res => {
|
DeliveryApi.getDeliveryConfig().then(res => {
|
||||||
this.store_self_mention = res.data.pickUpEnable && this.productType === 'normal';
|
this.store_self_mention = res.data.pickUpEnable && this.productType === 'normal';
|
||||||
|
@ -322,10 +330,6 @@
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
let _this = this
|
let _this = this
|
||||||
this.textareaStatus = true;
|
this.textareaStatus = true;
|
||||||
// 获得默认的收货地址
|
|
||||||
if (this.isLogin && !this.toPay) {
|
|
||||||
this.getaddressInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 来自 goods_details_store/index.vue 的门店选择
|
// 来自 goods_details_store/index.vue 的门店选择
|
||||||
uni.$on("handClick", res => {
|
uni.$on("handClick", res => {
|
||||||
|
@ -343,15 +347,18 @@
|
||||||
getloadPreOrder: function() {
|
getloadPreOrder: function() {
|
||||||
OrderApi.settlementOrder({
|
OrderApi.settlementOrder({
|
||||||
items: this.items,
|
items: this.items,
|
||||||
addressId: this.address.addressId > 0 && this.shippingType === 1 ? this.address.addressId : undefined,
|
deliveryType: this.deliveryType,
|
||||||
shippingType: parseInt() + 1,
|
addressId: this.address.addressId > 0 && this.deliveryType === 1 ? this.address.addressId : undefined,
|
||||||
|
receiverName: this.deliveryType === 2 ? this.contacts : undefined,
|
||||||
|
receiverMobile: this.deliveryType === 2 ? this.contactsTel : undefined,
|
||||||
couponId: this.couponId > 0 ? this.couponId : undefined,
|
couponId: this.couponId > 0 ? this.couponId : undefined,
|
||||||
|
pointStatus: this.pointStatus,
|
||||||
// TODO 芋艿:秒杀等等
|
// TODO 芋艿:秒杀等等
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const orderInfoVo = res.data
|
const orderInfoVo = res.data
|
||||||
this.orderInfoVo = orderInfoVo;
|
this.orderInfoVo = orderInfoVo;
|
||||||
this.cartInfo = orderInfoVo.items;
|
this.cartInfo = orderInfoVo.items;
|
||||||
this.address.addressId = this.addressId ? this.addressId :orderInfoVo.addressId;
|
this.changeAddress(orderInfoVo.address);
|
||||||
|
|
||||||
// TODO 芋艿:可以搞走
|
// TODO 芋艿:可以搞走
|
||||||
this.cartArr[1].title = '可用余额:' + orderInfoVo.userBalance;
|
this.cartArr[1].title = '可用余额:' + orderInfoVo.userBalance;
|
||||||
|
@ -374,18 +381,18 @@
|
||||||
// 计算订单价格
|
// 计算订单价格
|
||||||
computedPrice: function() {
|
computedPrice: function() {
|
||||||
postOrderComputed({
|
postOrderComputed({
|
||||||
useIntegral: this.useIntegral,
|
pointStatus: this.pointStatus,
|
||||||
preOrderNo: this.preOrderNo
|
preOrderNo: this.preOrderNo
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
this.orderInfoVo.couponFee = data.couponFee;
|
this.orderInfoVo.couponFee = data.couponFee;
|
||||||
//赋值操作,userIntegral 当前积分,surplusIntegral 剩余积分
|
// 赋值操作,userIntegral 当前积分,surplusIntegral 剩余积分
|
||||||
this.orderInfoVo.userIntegral = data.surplusIntegral;
|
this.orderInfoVo.userIntegral = data.surplusIntegral;
|
||||||
this.orderInfoVo.deductionPrice = data.deductionPrice;
|
this.orderInfoVo.deductionPrice = data.deductionPrice;
|
||||||
this.orderInfoVo.freightFee = data.freightFee;
|
this.orderInfoVo.freightFee = data.freightFee;
|
||||||
this.orderInfoVo.payFee = data.payFee;
|
this.orderInfoVo.payFee = data.payFee;
|
||||||
this.orderInfoVo.proTotalFee = data.proTotalFee;
|
this.orderInfoVo.proTotalFee = data.proTotalFee;
|
||||||
this.orderInfoVo.useIntegral = data.useIntegral;
|
this.orderInfoVo.pointStatus = data.pointStatus;
|
||||||
this.orderInfoVo.usedIntegral = data.usedIntegral;
|
this.orderInfoVo.usedIntegral = data.usedIntegral;
|
||||||
this.orderInfoVo.surplusIntegral = data.surplusIntegral;
|
this.orderInfoVo.surplusIntegral = data.surplusIntegral;
|
||||||
//this.orderInfoVo.userIntegral = data.userIntegral;
|
//this.orderInfoVo.userIntegral = data.userIntegral;
|
||||||
|
@ -405,13 +412,6 @@
|
||||||
this.status = 0;
|
this.status = 0;
|
||||||
this.$set(this.coupon, 'list', this.coupon.list);
|
this.$set(this.coupon, 'list', this.coupon.list);
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* 使用积分抵扣
|
|
||||||
*/
|
|
||||||
ChangeIntegral: function() {
|
|
||||||
this.useIntegral = !this.useIntegral;
|
|
||||||
this.computedPrice();
|
|
||||||
},
|
|
||||||
bindHideKeyboard: function(e) {
|
bindHideKeyboard: function(e) {
|
||||||
this.mark = e.detail.value;
|
this.mark = e.detail.value;
|
||||||
},
|
},
|
||||||
|
@ -431,12 +431,6 @@
|
||||||
let that = this;
|
let that = this;
|
||||||
that.animated = false;
|
that.animated = false;
|
||||||
},
|
},
|
||||||
realName: function(e) {
|
|
||||||
this.contacts = e.detail.value;
|
|
||||||
},
|
|
||||||
phone: function(e) {
|
|
||||||
this.contactsTel = e.detail.value;
|
|
||||||
},
|
|
||||||
payment: function(data) {
|
payment: function(data) {
|
||||||
let that = this;
|
let that = this;
|
||||||
orderCreate(data).then(res => {
|
orderCreate(data).then(res => {
|
||||||
|
@ -732,52 +726,56 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
SubOrder: function(e) {
|
SubOrder: function(e) {
|
||||||
|
let that = this;
|
||||||
|
|
||||||
let that = this,
|
if (!this.payType) {
|
||||||
data = {};
|
return this.$util.Tips({
|
||||||
|
title: '请选择支付方式'
|
||||||
if (!that.payType) return that.$util.Tips({
|
});
|
||||||
title: '请选择支付方式'
|
}
|
||||||
});
|
// 校验参数
|
||||||
if (!that.address.addressId && that.shippingType === 1) return that.$util.Tips({
|
if (!this.address.addressId && this.deliveryType === 1) {
|
||||||
title: '请选择收货地址'
|
return this.$util.Tips({
|
||||||
});
|
title: '请选择收货地址'
|
||||||
if (that.shippingType == 2) {
|
});
|
||||||
if (that.contacts == "" || that.contactsTel == "") {
|
}
|
||||||
return that.$util.Tips({
|
if (this.deliveryType === 2) {
|
||||||
|
if (this.contacts === "" || this.contactsTel === "") {
|
||||||
|
return this.$util.Tips({
|
||||||
title: '请填写联系人或联系人电话'
|
title: '请填写联系人或联系人电话'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!/^1(3|4|5|7|8|9|6)\d{9}$/.test(that.contactsTel)) {
|
if (!/^1(3|4|5|7|8|9|6)\d{9}$/.test(this.contactsTel)) {
|
||||||
return that.$util.Tips({
|
return this.$util.Tips({
|
||||||
title: '请填写正确的手机号'
|
title: '请填写正确的手机号'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!/^[\u4e00-\u9fa5\w]{2,16}$/.test(that.contacts)) {
|
if (!/^[\u4e00-\u9fa5\w]{2,16}$/.test(this.contacts)) {
|
||||||
return that.$util.Tips({
|
return this.$util.Tips({
|
||||||
title: '请填写您的真实姓名'
|
title: '请填写您的真实姓名'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (that.storeList.length == 0) return that.$util.Tips({
|
if (this.storeList.length === 0) {
|
||||||
title: '暂无门店,请选择其他方式'
|
return this.$util.Tips({
|
||||||
});
|
title: '暂无门店,请选择其他方式'
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
data = {
|
const data = {
|
||||||
realName: that.contacts,
|
realName: this.contacts,
|
||||||
phone: that.contactsTel,
|
phone: this.contactsTel,
|
||||||
addressId: that.address.addressId,
|
addressId: this.address.addressId,
|
||||||
couponId: that.couponId,
|
couponId: this.couponId,
|
||||||
payType: that.payType,
|
payType: this.payType,
|
||||||
useIntegral: that.useIntegral,
|
pointStatus: this.pointStatus,
|
||||||
preOrderNo: that.preOrderNo,
|
preOrderNo: this.preOrderNo,
|
||||||
mark: that.mark,
|
mark: this.mark,
|
||||||
storeId: that.system_store.id || 0,
|
storeId: this.system_store.id > 0 ? this.system_store.id : undefined,
|
||||||
shippingType: that.$util.$h.Add(that.shippingType, 1),
|
deliveryType: this.deliveryType,
|
||||||
payChannel: that.payChannel
|
payChannel: this.payChannel
|
||||||
|
|
||||||
};
|
};
|
||||||
if (data.payType == 'yue' && parseFloat(that.userInfo.nowMoney) < parseFloat(that.totalPrice))
|
if (data.payType == 'yue' && parseFloat(this.userInfo.nowMoney) < parseFloat(this.totalPrice))
|
||||||
return that.$util
|
return this.$util
|
||||||
.Tips({
|
.Tips({
|
||||||
title: '余额不足!'
|
title: '余额不足!'
|
||||||
});
|
});
|
||||||
|
@ -786,14 +784,23 @@
|
||||||
});
|
});
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
openPaySubscribe().then(() => {
|
openPaySubscribe().then(() => {
|
||||||
that.payment(data);
|
this.payment(data);
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
// #ifndef MP
|
// #ifndef MP
|
||||||
that.payment(data);
|
this.payment(data);
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// ========== 积分 ==========
|
||||||
|
/**
|
||||||
|
* 使用积分抵扣
|
||||||
|
*/
|
||||||
|
ChangeIntegral: function() {
|
||||||
|
this.pointStatus = !this.pointStatus;
|
||||||
|
this.getloadPreOrder();
|
||||||
|
},
|
||||||
|
|
||||||
// ========== 优惠劵 ==========
|
// ========== 优惠劵 ==========
|
||||||
/**
|
/**
|
||||||
* 获取当前金额可用优惠券
|
* 获取当前金额可用优惠券
|
||||||
|
@ -867,35 +874,21 @@
|
||||||
/**
|
/**
|
||||||
* 选择地址后改变事件
|
* 选择地址后改变事件
|
||||||
*/
|
*/
|
||||||
OnChangeAddress: function(e) {
|
OnChangeAddress: function(address) {
|
||||||
this.addressInfo = e;
|
this.changeAddress(address);
|
||||||
this.address.addressId = e.id;
|
|
||||||
this.textareaStatus = true;
|
this.textareaStatus = true;
|
||||||
this.address.address = false;
|
this.address.address = false;
|
||||||
this.getaddressInfo();
|
this.getloadPreOrder();
|
||||||
this.computedPrice();
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 获取默认收货地址或者获取某条地址信息
|
* 选择地址
|
||||||
*/
|
*/
|
||||||
getaddressInfo: function() {
|
changeAddress: function (address) {
|
||||||
if (this.addressId) {
|
if (!address) {
|
||||||
AddressApi.getAddress(this.addressId).then(res => {
|
return;
|
||||||
if (res.data) {
|
|
||||||
this.addressInfo = res.data || {};
|
|
||||||
this.addressId = res.data.id || 0;
|
|
||||||
this.address.addressId = res.data.id || 0;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
AddressApi.getDefaultUserAddress().then(res => {
|
|
||||||
if (res.data) {
|
|
||||||
this.addressInfo = res.data || {};
|
|
||||||
this.addressId = res.data.id || 0;
|
|
||||||
this.address.addressId = res.data.id || 0;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
this.addressInfo = address;
|
||||||
|
this.address.addressId = address.id;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 关闭地址弹窗
|
* 关闭地址弹窗
|
||||||
|
@ -909,10 +902,10 @@
|
||||||
/**
|
/**
|
||||||
* 切换物流方式
|
* 切换物流方式
|
||||||
*/
|
*/
|
||||||
addressType: function(shippingType) {
|
addressType: function(deliveryType) {
|
||||||
this.shippingType = shippingType;
|
this.deliveryType = deliveryType;
|
||||||
this.computedPrice();
|
this.getloadPreOrder();
|
||||||
if (shippingType === 2) {
|
if (deliveryType === 2) {
|
||||||
this.getList();
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -945,6 +938,12 @@
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
realName: function(e) {
|
||||||
|
this.contacts = e.detail.value;
|
||||||
|
},
|
||||||
|
phone: function(e) {
|
||||||
|
this.contactsTel = e.detail.value;
|
||||||
|
},
|
||||||
|
|
||||||
fen2yuan(price) {
|
fen2yuan(price) {
|
||||||
return Util.fen2yuan(price)
|
return Util.fen2yuan(price)
|
||||||
|
|
Loading…
Reference in New Issue