|
@@ -96,9 +96,10 @@
|
|
|
<script>
|
|
<script>
|
|
|
import { goodsDetail, cartAdd, getJfDetail, getBl } from '@/api/product.js';
|
|
import { goodsDetail, cartAdd, getJfDetail, getBl } from '@/api/product.js';
|
|
|
import { jfOrderCreate } from '@/api/order.js'
|
|
import { jfOrderCreate } from '@/api/order.js'
|
|
|
-import { mapState } from 'vuex';
|
|
|
|
|
|
|
+import { mapState,mapMutations } from 'vuex';
|
|
|
import store from '@/store/index.js';
|
|
import store from '@/store/index.js';
|
|
|
import { saveUrl } from '@/utils/loginUtils.js';
|
|
import { saveUrl } from '@/utils/loginUtils.js';
|
|
|
|
|
+import { getUserInfo } from '@/api/user.js'
|
|
|
import uniNumberBox from '@/components/uni-number-box.vue';
|
|
import uniNumberBox from '@/components/uni-number-box.vue';
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
|
import { weixindata } from '@/utils/wxAuthorized';
|
|
import { weixindata } from '@/utils/wxAuthorized';
|
|
@@ -256,6 +257,7 @@ export default {
|
|
|
return shareObj;
|
|
return shareObj;
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ ...mapMutations('user',['setUserInfo']),
|
|
|
getBl(){
|
|
getBl(){
|
|
|
let obj = this
|
|
let obj = this
|
|
|
getBl().then(res => {
|
|
getBl().then(res => {
|
|
@@ -471,11 +473,11 @@ export default {
|
|
|
console.log(obj.addressData,'addressData')
|
|
console.log(obj.addressData,'addressData')
|
|
|
|
|
|
|
|
// 判断用户积分是否足够
|
|
// 判断用户积分是否足够
|
|
|
- // if(obj.userInfo){
|
|
|
|
|
- // if(obj.userInfo.integral*1 < (obj.goodsObjact.express_fee*1 + (obj.goodsObjact.price*1)*(obj.goodsNumber*1))){
|
|
|
|
|
- // return obj.$api.msg('您的积分不足!')
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if(obj.userInfo){
|
|
|
|
|
+ if(obj.userInfo.integral*1 < ((((obj.actionPrice*1)*(obj.goodsNumber*1))*(obj.three_integral*1)).toFixed(2) + obj.goodsObjact.express_fee*1)){
|
|
|
|
|
+ return obj.$api.msg('您的积分不足!')
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
let senddata = {
|
|
let senddata = {
|
|
|
real_name: obj.addressData.real_name,
|
|
real_name: obj.addressData.real_name,
|
|
|
user_phone: obj.addressData.phone,
|
|
user_phone: obj.addressData.phone,
|
|
@@ -495,6 +497,10 @@ export default {
|
|
|
jfOrderCreate(senddata).then(res => {
|
|
jfOrderCreate(senddata).then(res => {
|
|
|
console.log(res,'res+++++++++++++++++++++')
|
|
console.log(res,'res+++++++++++++++++++++')
|
|
|
this.$api.msg('您已购买成功!')
|
|
this.$api.msg('您已购买成功!')
|
|
|
|
|
+ getUserInfo({}).then((e) => {
|
|
|
|
|
+ // 保存返回用户数据
|
|
|
|
|
+ obj.setUserInfo(e.data);
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|