bug处理
This commit is contained in:
parent
8d249e7e5e
commit
75c34d33f3
@ -167,7 +167,6 @@
|
||||
<div>赠送<span class="amount">{{ item.giftBalance }}</span>元</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="width: 30%;margin-left: 13px;margin-top: 8px;"
|
||||
:class="activeKey === cardValueList.length ? 'select' : ''"
|
||||
@click="rechargeCard(cardValueList.length,-1)">
|
||||
@ -421,6 +420,13 @@
|
||||
</template>
|
||||
</el-result>
|
||||
</div>
|
||||
<div v-else-if="isAwait">
|
||||
<el-result icon="warning" title="支付等待超时,请前往订单列表查看是否支付成功!">
|
||||
<template slot="extra">
|
||||
<el-button type="primary" @click="handClose">关 闭</el-button>
|
||||
</template>
|
||||
</el-result>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-result icon="error" title="支付失败,请重新支付">
|
||||
<template slot="extra">
|
||||
@ -876,6 +882,7 @@ export default {
|
||||
|
||||
isPay: true,
|
||||
isPaySuccess: false,
|
||||
isAwait: false,
|
||||
isQuery: true,
|
||||
|
||||
payList: [],
|
||||
@ -1113,7 +1120,7 @@ export default {
|
||||
this.cardValueList.sort((a, b) => a.rechargeBalance - b.rechargeBalance);
|
||||
// console.log("this.grade.name",this.grade)
|
||||
})
|
||||
// console.log("this.cardValueList", this.grade)
|
||||
console.log("123123123123123123123t")
|
||||
|
||||
if (this.cardValueList.length > 0) {
|
||||
// 过滤
|
||||
@ -1126,8 +1133,12 @@ export default {
|
||||
this.cardValueList = this.cardValueList.filter(item => {
|
||||
return item.groupOriented === "1";
|
||||
});
|
||||
if (this.cardValueList.length > 0) {
|
||||
this.rechargeCard(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$forceUpdate();
|
||||
},
|
||||
|
||||
valueAmoutChange(data) {
|
||||
@ -1264,13 +1275,13 @@ export default {
|
||||
// 查询员工
|
||||
|
||||
// 会员充值
|
||||
userRecharge() {
|
||||
async userRecharge() {
|
||||
|
||||
this.getCardFuelDieselList()
|
||||
this.getCardValueList()
|
||||
this.getCountOilType()
|
||||
await this.getCardFuelDieselList()
|
||||
await this.getCardValueList()
|
||||
await this.getCountOilType()
|
||||
|
||||
this.getPayList();
|
||||
await this.getPayList();
|
||||
this.openRecharge = true;
|
||||
this.title = '会员充值'
|
||||
|
||||
@ -1307,9 +1318,6 @@ export default {
|
||||
this.openConfirm = true;
|
||||
this.isPay = true
|
||||
|
||||
// console.log("11111",this.isPay)
|
||||
// this.isPaySuccess=false
|
||||
|
||||
this.title = this.payment
|
||||
},
|
||||
// 支付方式
|
||||
@ -1433,8 +1441,8 @@ export default {
|
||||
|
||||
},
|
||||
|
||||
// 最终支付
|
||||
async collection() {
|
||||
|
||||
let userForm = this.form
|
||||
|
||||
if (this.flag === 1) {
|
||||
@ -1493,9 +1501,10 @@ export default {
|
||||
clearInterval(timer);
|
||||
this_.loading = false;
|
||||
this_.isPay = false;
|
||||
this.isPaySuccess = false;
|
||||
this_.isPaySuccess = false;
|
||||
this_.isAwait = true;
|
||||
console.log("t3")
|
||||
}, 10000)
|
||||
}, 15000)
|
||||
|
||||
} else if (this.flag === 2) {
|
||||
if (!this.authCode && this.cardFuelDieselForm.paymentType !== "CASH") {
|
||||
@ -1551,9 +1560,10 @@ export default {
|
||||
clearInterval(timer);
|
||||
this_.loading = false;
|
||||
this_.isPay = false;
|
||||
this.isPaySuccess = false;
|
||||
this_.isPaySuccess = false;
|
||||
this_.isAwait = true;
|
||||
|
||||
}, 30000)
|
||||
}, 15000)
|
||||
|
||||
let this_ = this
|
||||
}
|
||||
@ -1600,13 +1610,26 @@ export default {
|
||||
points: '', //赠送积分
|
||||
growthValue: '', // 赠送成长值
|
||||
remark: '',
|
||||
paymentType: '', // 支付方式
|
||||
paymentType: 'WECHAT', // 支付方式
|
||||
royaltyType: '',// 提成类型
|
||||
percentageCommissions: null,
|
||||
amountCommission: null,
|
||||
rechargeType: '0'
|
||||
}
|
||||
|
||||
this.cardFuelDieselForm = {
|
||||
mtStaffId: '',
|
||||
realName: '',
|
||||
staffMobile: '',
|
||||
points: '',
|
||||
remark: '',
|
||||
rechargeBalance: '', //实际支付
|
||||
paymentType: 'WECHAT',
|
||||
payType:'',
|
||||
oilType: '',
|
||||
type: '',
|
||||
chainStorId: '',
|
||||
incomeLitres: '',
|
||||
},
|
||||
// 刷新页面
|
||||
this.getUserInfo();
|
||||
this.getInformation();
|
||||
@ -1656,6 +1679,7 @@ export default {
|
||||
|
||||
this.cardValueForm = {}
|
||||
this.cardFuelDieselForm = {}
|
||||
this.iniz()
|
||||
},
|
||||
cancelCollection() {
|
||||
this.openConfirm = false;
|
||||
|
@ -195,7 +195,6 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
|
@ -8,6 +8,7 @@ import com.fuint.business.convenienceSore.entity.LJGoods;
|
||||
import com.fuint.business.convenienceSore.service.LJGoodsService;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -129,4 +130,10 @@ public class LJGoodsController extends BaseController {
|
||||
return getSuccessResult(goodsService.editGoodsInventory(goods));
|
||||
}
|
||||
|
||||
@GetMapping("determineTheInventoryOfTheProduct")
|
||||
public ResponseObject determineTheInventoryOfTheProduct(@Param("id") Integer id, @Param("stock") Integer stock) {
|
||||
return getSuccessResult(goodsService.determineTheInventoryOfTheProduct(id,stock));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -82,4 +82,6 @@ public interface LJGoodsService extends IService<LJGoods> {
|
||||
boolean editGoodsInventory(LJGoodsDto goods);
|
||||
|
||||
boolean subtractGoodesStockByLock(@Param("id") Integer id, @Param("stock") Integer stock);
|
||||
|
||||
boolean determineTheInventoryOfTheProduct(@Param("id") Integer id, @Param("stock") Integer stock);
|
||||
}
|
||||
|
@ -287,4 +287,15 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 判断商品库存是否足够
|
||||
@Override
|
||||
public boolean determineTheInventoryOfTheProduct(@Param("id") Integer id, @Param("stock") Integer stock) {
|
||||
LJGoods ljGoods = baseMapper.selectById(id);
|
||||
if (stock.compareTo(ljGoods.getStock())>0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,12 @@
|
||||
package com.fuint.business.integral.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.entity.LJGoods;
|
||||
import com.fuint.business.convenienceSore.service.LJGoodsService;
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.entity.IntegralGiftCategory;
|
||||
import com.fuint.business.integral.mapper.IntegralGiftMapper;
|
||||
import com.fuint.business.integral.service.IntegralGiftService;
|
||||
import com.fuint.business.integral.service.IntegralOrdersService;
|
||||
@ -79,6 +83,7 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
|
||||
*/
|
||||
@Override
|
||||
public IntegralGift insert(IntegralGift integralGift) {
|
||||
determineTheInventoryOfTheProduct(integralGift);
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
integralGift.setStoreId(nowAccountInfo.getStoreId());
|
||||
integralGift.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||
@ -94,10 +99,31 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
|
||||
*/
|
||||
@Override
|
||||
public IntegralGift update(IntegralGift integralGift) {
|
||||
determineTheInventoryOfTheProduct(integralGift);
|
||||
|
||||
this.integralGiftDao.update(integralGift);
|
||||
return this.queryById(integralGift.getId());
|
||||
}
|
||||
|
||||
@Resource
|
||||
LJGoodsService ljGoodsService;
|
||||
/**
|
||||
* 判断商品库存是否足够
|
||||
*/
|
||||
public boolean determineTheInventoryOfTheProduct(IntegralGift integralGift) {
|
||||
if ("实物商品".equals(integralGift.getGiftType())) {
|
||||
if (ObjectUtil.isNotEmpty(integralGift.getGoodsId())) {
|
||||
LJGoods byId = ljGoodsService.getById(integralGift.getGoodsId());
|
||||
|
||||
if (integralGift.getTotalInventory().compareTo(byId.getStock())>0){
|
||||
throw new RuntimeException("该商品库存不足,可用库存“"+byId.getStock()+"”");
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
|
@ -190,6 +190,10 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
}
|
||||
// 插入订单
|
||||
List<IntegralOrders> integralOrdersList1 = integralOrdersList.getIntegralOrdersList();
|
||||
|
||||
|
||||
// 当积分兑换为商品是需要判断库存是否足够
|
||||
|
||||
if (integralOrdersList1.size() < 0) return null;
|
||||
|
||||
|
||||
@ -315,13 +319,13 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
@Transactional
|
||||
public IntegralOrders checkTheStatusOfYourPaymentByIntegral(String orderNo) {
|
||||
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
// 查询订单信息
|
||||
// List<IntegralOrders> listByOrderNo = integralOrdersDao.getListByOrderNo2(orderNo, nowAccountInfo.getStoreId());
|
||||
List<IntegralOrders> listByOrderNo = integralOrdersDao.getListByOrderNo2(orderNo);
|
||||
|
||||
// 加锁 processing_status
|
||||
String lockKey = "IntegralOrders"+nowAccountInfo.getStoreId()+orderNo;
|
||||
String lockKey = "IntegralOrders"+orderNo;
|
||||
Boolean isLock = redisLock.tryLock(lockKey, 5000, TimeUnit.MILLISECONDS);
|
||||
if (isLock && "paid".equals(listByOrderNo.get(0).getStatus()) && "0".equals(listByOrderNo.get(0).getProcessingStatus()) ) {
|
||||
// 查询用户信息
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.petrolStationManagement.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -131,6 +132,11 @@ public class OilGunServiceImpl implements OilGunService {
|
||||
return oilGunList.size();
|
||||
}
|
||||
|
||||
public List<OilGun> checkData2(OilGun oilGun) {
|
||||
List<OilGun> oilGunList = oilGunDao.checkData(oilGun);
|
||||
return oilGunList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
@ -141,10 +147,16 @@ public class OilGunServiceImpl implements OilGunService {
|
||||
public boolean update(OilGun oilGun) {
|
||||
AccountInfo accountInfo = TokenUtil.getNowAccountInfo();
|
||||
oilGun.setStoreId(accountInfo.getStoreId());
|
||||
int i = checkData(oilGun);
|
||||
if (i>1) {
|
||||
return false;
|
||||
List<OilGun> oilGuns = checkData2(oilGun);
|
||||
if (ObjectUtil.isNotEmpty(oilGuns)) {
|
||||
if (oilGuns.size()>1) {
|
||||
return false;
|
||||
}
|
||||
if (!oilGuns.get(0).getId().equals(oilGun.getId())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
oilGun.setUpdateBy(accountInfo.getId().toString());
|
||||
return this.oilGunDao.update(oilGun)>0;
|
||||
}
|
||||
|
@ -71,6 +71,7 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
|
||||
// 经度
|
||||
Double lon = Double.valueOf(map.get("lon"));
|
||||
Double lat = Double.valueOf(map.get("lat"));
|
||||
String isLogin = ObjectUtil.isEmpty(map.get("isLogin"))?"1":map.get("isLogin");
|
||||
String storeId = map.get("storeId");
|
||||
LJStore ljStore = new LJStore();
|
||||
Double distance = 0.0;
|
||||
@ -131,13 +132,16 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
|
||||
}
|
||||
|
||||
// 判断当前店铺是否存在此用户的会员信息,没有的话进行添加
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LJStore store = this.selectStoreByStoreId(Integer.valueOf(storeId));
|
||||
UserBalance balance = userBalanceService.selectUserBalance(nowAccountInfo.getId(), store.getChainStoreId());
|
||||
if (ObjectUtil.isEmpty(balance)){
|
||||
userBalanceService.initBalance(nowAccountInfo.getId(),store.getChainStoreId());
|
||||
if ("0".equals(isLogin)) { // 判断是否登录
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LJStore store = this.selectStoreByStoreId(Integer.valueOf(storeId));
|
||||
UserBalance balance = userBalanceService.selectUserBalance(nowAccountInfo.getId(), store.getChainStoreId());
|
||||
if (ObjectUtil.isEmpty(balance)){
|
||||
userBalanceService.initBalance(nowAccountInfo.getId(),store.getChainStoreId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Map<String,Object> map1 = new HashMap<>();
|
||||
map1.put("distance",distance);
|
||||
map1.put("store",ljStore);
|
||||
|
@ -52,7 +52,27 @@ public class ShiroConfig {
|
||||
filterMap.put("/backendApi/store/loginVerification","anon");
|
||||
//小程序支付回调地址
|
||||
filterMap.put("/api/fyPay/notify","anon");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 小程序主页免登录配置
|
||||
filterMap.put("/business/petrolStationManagement/oilNumber/getList2","anon"); // 主页油号获取
|
||||
filterMap.put("/business/petrolStationManagement/oilGun/selectByNumber/**","anon"); // 获取油站的油号
|
||||
filterMap.put("/business/member/staff/queryStaffList/**","anon"); // 获取员工信息
|
||||
filterMap.put("/business/indexBanner/list/**","anon"); // 获取员工信息
|
||||
filterMap.put("/business/storeInformation/store/queryStores","anon"); // 切换站点
|
||||
|
||||
|
||||
|
||||
filterMap.put("/**","commonFilter");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
filter.setFilterChainDefinitionMap(filterMap);
|
||||
filter.setLoginUrl("/login");
|
||||
return filter;
|
||||
|
@ -34,3 +34,11 @@ export function getCheckTheStatusOfYourPaymentByIntegralApi(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 判断库存是否足够
|
||||
export function getDetermineTheInventoryOfTheProductApi(query) {
|
||||
return request({
|
||||
url: 'business/convenience/goods/determineTheInventoryOfTheProduct',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
@ -372,6 +372,13 @@
|
||||
</template>
|
||||
</el-result>
|
||||
</div>
|
||||
<div v-else-if="isAwait">
|
||||
<el-result icon="warning" title="支付等待超时,请前往订单列表查看是否支付成功!">
|
||||
<template slot="extra">
|
||||
<el-button type="primary" @click="handClose">关 闭</el-button>
|
||||
</template>
|
||||
</el-result>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-result icon="error" title="支付失败,请重新支付">
|
||||
<template slot="extra">
|
||||
@ -390,7 +397,7 @@
|
||||
|
||||
<script>
|
||||
import {
|
||||
getCheckTheStatusOfYourPaymentByIntegralApi,
|
||||
getCheckTheStatusOfYourPaymentByIntegralApi, getDetermineTheInventoryOfTheProductApi,
|
||||
getGiftApi,
|
||||
getGiftCategoryApi,
|
||||
getIntegralOrdersProcessingApi
|
||||
@ -452,6 +459,8 @@ import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/u
|
||||
authCode:'',
|
||||
isPay:true,
|
||||
isPaySuccess:false,
|
||||
isAwait: false,
|
||||
|
||||
loading:false,
|
||||
paymentType : 'ALIPAY', // 默认支付宝
|
||||
payType:'支付宝支付'
|
||||
@ -496,8 +505,8 @@ import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/u
|
||||
},
|
||||
|
||||
// 点击商品增加库存
|
||||
addGift(data) {
|
||||
console.log("data",data)
|
||||
async addGift(data) {
|
||||
|
||||
if (data.markPurchases) {
|
||||
if (data.markPurchases>=data.remainingInventory){
|
||||
this.$message.error('库存不足');
|
||||
@ -509,6 +518,18 @@ import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/u
|
||||
}
|
||||
this.markPurchasesAll++
|
||||
|
||||
//判断商品库存是否足够
|
||||
await getDetermineTheInventoryOfTheProductApi({id:data.goodsId,
|
||||
stock:data.markPurchases}).then(res=> {
|
||||
if (!res.data) {
|
||||
data.markPurchases = data.markPurchases-1
|
||||
this.$message.error('该商品库存不足');
|
||||
return;
|
||||
}
|
||||
})
|
||||
console.log("addGift",data)
|
||||
|
||||
|
||||
// 计算总额
|
||||
this.dataChange(data);
|
||||
|
||||
@ -887,9 +908,11 @@ import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/u
|
||||
clearInterval(timer);
|
||||
this_.loading = false;
|
||||
this_.isPay = false;
|
||||
this_.isAwait = true;
|
||||
|
||||
this.isPaySuccess = false;
|
||||
|
||||
},30000)
|
||||
},15000)
|
||||
|
||||
}
|
||||
// this.paymentType = ''
|
||||
|
@ -422,6 +422,13 @@
|
||||
</template>
|
||||
</el-result>
|
||||
</div>
|
||||
<div v-else-if="isAwait">
|
||||
<el-result icon="warning" title="支付等待超时,请前往订单列表查看是否支付成功!">
|
||||
<template slot="extra">
|
||||
<el-button type="primary" @click="handClose">关 闭</el-button>
|
||||
</template>
|
||||
</el-result>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-result icon="error" title="支付失败,请重新支付">
|
||||
<template slot="extra">
|
||||
@ -540,9 +547,9 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 子卡管理-->
|
||||
<!-- 子卡管理-->
|
||||
<el-dialog :title="title" :visible.sync="openSubCard" append-to-body>
|
||||
<!-- <cardValueChild :pUserId="form.id" :handleUpdate="handleUpdate1" :handleAdd="handleAdd1"></cardValueChild>-->
|
||||
<!-- <cardValueChild :pUserId="form.id" :handleUpdate="handleUpdate1" :handleAdd="handleAdd1"></cardValueChild>-->
|
||||
<el-tabs v-model="subCardActive" @tab-click="handleClick">
|
||||
<el-tab-pane label="子卡管理" name="subCardManage">
|
||||
<div style="display: flex;justify-content: space-between;margin: 10px 0">
|
||||
@ -720,7 +727,7 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 添加或修改子卡信息-->
|
||||
<!-- 添加或修改子卡信息-->
|
||||
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openSubCard1" width="30%">
|
||||
<el-form ref="form1" :model="form1" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
@ -871,6 +878,7 @@ export default {
|
||||
|
||||
isPay: true,
|
||||
isPaySuccess: false,
|
||||
isAwait: false,
|
||||
isQuery: true,
|
||||
|
||||
payList: [],
|
||||
@ -1131,8 +1139,12 @@ export default {
|
||||
this.cardValueList = this.cardValueList.filter(item => {
|
||||
return item.groupOriented === "1";
|
||||
});
|
||||
if (this.cardValueList.length > 0) {
|
||||
this.rechargeCard(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$forceUpdate();
|
||||
},
|
||||
|
||||
valueAmoutChange(data) {
|
||||
@ -1269,13 +1281,13 @@ export default {
|
||||
// 查询员工
|
||||
|
||||
// 会员充值
|
||||
userRecharge() {
|
||||
async userRecharge() {
|
||||
|
||||
this.getCardFuelDieselList()
|
||||
this.getCardValueList()
|
||||
this.getCountOilType()
|
||||
await this.getCardFuelDieselList()
|
||||
await this.getCardValueList()
|
||||
await this.getCountOilType()
|
||||
|
||||
this.getPayList();
|
||||
await this.getPayList();
|
||||
this.openRecharge = true;
|
||||
this.title = '会员充值'
|
||||
|
||||
@ -1312,9 +1324,6 @@ export default {
|
||||
this.openConfirm = true;
|
||||
this.isPay = true
|
||||
|
||||
// console.log("11111",this.isPay)
|
||||
// this.isPaySuccess=false
|
||||
|
||||
this.title = this.payment
|
||||
},
|
||||
// 支付方式
|
||||
@ -1499,8 +1508,10 @@ export default {
|
||||
clearInterval(timer);
|
||||
this_.loading = false;
|
||||
this_.isPay = false;
|
||||
this.isPaySuccess = false;
|
||||
}, 30000)
|
||||
this_.isPaySuccess = false;
|
||||
this_.isAwait = true;
|
||||
console.log("t3")
|
||||
}, 15000)
|
||||
|
||||
} else if (this.flag === 2) {
|
||||
if (!this.authCode && this.cardFuelDieselForm.paymentType !== "CASH") {
|
||||
@ -1556,9 +1567,10 @@ export default {
|
||||
clearInterval(timer);
|
||||
this_.loading = false;
|
||||
this_.isPay = false;
|
||||
this.isPaySuccess = false;
|
||||
this_.isPaySuccess = false;
|
||||
this_.isAwait = true;
|
||||
|
||||
}, 30000)
|
||||
}, 15000)
|
||||
|
||||
let this_ = this
|
||||
}
|
||||
@ -1580,9 +1592,9 @@ export default {
|
||||
// 关闭支付窗口
|
||||
handClose() {
|
||||
this.isPay = true,
|
||||
this.isPaySuccess = false,
|
||||
this.isQuery = true,
|
||||
this.openConfirm = false
|
||||
this.isPaySuccess = false,
|
||||
this.isQuery = true,
|
||||
this.openConfirm = false
|
||||
this.openRecharge = false
|
||||
|
||||
// this.isPaySuccess = false;
|
||||
@ -1607,13 +1619,26 @@ export default {
|
||||
points: '', //赠送积分
|
||||
growthValue: '', // 赠送成长值
|
||||
remark: '',
|
||||
paymentType: '', // 支付方式
|
||||
paymentType: 'WECHAT', // 支付方式
|
||||
royaltyType: '',// 提成类型
|
||||
percentageCommissions: null,
|
||||
amountCommission: null,
|
||||
rechargeType: '0'
|
||||
}
|
||||
|
||||
this.cardFuelDieselForm = {
|
||||
mtStaffId: '',
|
||||
realName: '',
|
||||
staffMobile: '',
|
||||
points: '',
|
||||
remark: '',
|
||||
rechargeBalance: '', //实际支付
|
||||
paymentType: 'WECHAT',
|
||||
payType:'',
|
||||
oilType: '',
|
||||
type: '',
|
||||
chainStorId: '',
|
||||
incomeLitres: '',
|
||||
},
|
||||
// 刷新页面
|
||||
this.getUserInfo();
|
||||
this.getInformation();
|
||||
@ -1663,6 +1688,7 @@ export default {
|
||||
|
||||
this.cardValueForm = {}
|
||||
this.cardFuelDieselForm = {}
|
||||
this.iniz()
|
||||
},
|
||||
cancelCollection() {
|
||||
this.openConfirm = false;
|
||||
|
@ -154,6 +154,7 @@
|
||||
oilPrice: '0',
|
||||
gbPrice: '0'
|
||||
},
|
||||
AppToken: uni.getStorageSync("App-Token"),
|
||||
|
||||
list1: [],
|
||||
list3: [
|
||||
@ -255,6 +256,10 @@
|
||||
},
|
||||
//判断是否是新人
|
||||
isJoined() {
|
||||
// 判断是否登录
|
||||
if (!this.AppToken) {
|
||||
return;
|
||||
}
|
||||
request({
|
||||
url: 'business/marketingActivity/activeNewlywedsRecords/applet',
|
||||
method: 'get',
|
||||
@ -299,6 +304,10 @@
|
||||
},
|
||||
//查询新人有礼礼品
|
||||
selectActiveNewlyweds() {
|
||||
// 判断是否登录
|
||||
if (!this.AppToken) {
|
||||
return;
|
||||
}
|
||||
request({
|
||||
url: 'business/marketingActivity/activeNewlyweds/applet',
|
||||
method: 'get',
|
||||
@ -385,8 +394,8 @@
|
||||
// 谷歌使用wgs84 其他使用gcj02
|
||||
type: 'gcj02', // 使用国测局坐标系
|
||||
success: function(res) {
|
||||
if (_this.longitude=="" && _this.latitude =="") {
|
||||
|
||||
if (_this.longitude == "" && _this.latitude == "") {
|
||||
|
||||
_this.longitude = res.longitude;
|
||||
_this.latitude = res.latitude
|
||||
}
|
||||
@ -398,7 +407,8 @@
|
||||
data: {
|
||||
"lon": _this.longitude,
|
||||
"lat": _this.latitude,
|
||||
"storeId":storeId
|
||||
"storeId": storeId,
|
||||
"isLogin": _this.AppToken ? "0" : "1", // 0为登录
|
||||
},
|
||||
}).then((response) => {
|
||||
_this.distance = (Math.ceil(response.data.distance))
|
||||
@ -517,7 +527,7 @@
|
||||
longitude
|
||||
}) => { // 选择位置完成后的处理
|
||||
// this.addressName = address;
|
||||
console.log(name,address,latitude,longitude);
|
||||
console.log(name, address, latitude, longitude);
|
||||
this.longitude = longitude;
|
||||
this.latitude = latitude;
|
||||
this.getAddress()
|
||||
|
@ -14,9 +14,11 @@
|
||||
<image v-else src="../../static/imgs/myx.png" mode=""></image>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="user-tel" @click="goSetup">{{user.mobile}}</view>
|
||||
<view class="user-name" @click="gorefuel">{{store.name}}{{store.description ? "("+store.description+")" : ""}}<uni-icons type="right" color="#c1c1ff"
|
||||
size="12"></uni-icons> </view>
|
||||
<view class="user-tel" @click="goSetup">{{user.mobile?user.mobile:"点击登录"}}</view>
|
||||
<view class="user-name" @click="gorefuel">
|
||||
{{store.name}}{{store.description ? "("+store.description+")" : ""}}<uni-icons
|
||||
type="right" color="#c1c1ff" size="12"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="vipnber" @click="govip()">会员等级 <uni-icons type="right" color="#ffffff"
|
||||
@ -178,6 +180,7 @@
|
||||
refuelMoney: [],
|
||||
cardBalance: 0.00,
|
||||
title: '',
|
||||
AppToken: uni.getStorageSync("App-Token"),
|
||||
msg: "3",
|
||||
// url信息
|
||||
baseUrl: this.$baseUrl,
|
||||
@ -213,6 +216,9 @@
|
||||
},
|
||||
// 查询当前登录用户信息
|
||||
getUser() {
|
||||
if (!this.AppToken) {
|
||||
return;
|
||||
}
|
||||
request({
|
||||
url: 'business/userManager/user/getUser',
|
||||
method: 'get',
|
||||
@ -256,6 +262,12 @@
|
||||
})
|
||||
},
|
||||
goSetup() {
|
||||
if (!this.user.mobile) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesLogin/login/login'
|
||||
})
|
||||
return;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pagesMy/setup/index'
|
||||
})
|
||||
@ -301,6 +313,9 @@
|
||||
})
|
||||
},
|
||||
getUserBalance() {
|
||||
if (!this.AppToken) {
|
||||
return;
|
||||
}
|
||||
request({
|
||||
url: '/business/userManager/user/getUserBalanceApplet',
|
||||
method: 'get',
|
||||
@ -318,6 +333,9 @@
|
||||
})
|
||||
},
|
||||
getGiftRecords() {
|
||||
if (!this.AppToken) {
|
||||
return;
|
||||
}
|
||||
request({
|
||||
url: 'business/marketingActivity/cardFavorable/applet',
|
||||
method: 'get',
|
||||
@ -330,6 +348,7 @@
|
||||
},
|
||||
// 查询我的积分
|
||||
toCoupons() {
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pagesMy/Coupons/Coupons'
|
||||
})
|
||||
@ -502,4 +521,4 @@
|
||||
.centenr-size {
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
@ -145,6 +145,7 @@
|
||||
addrInfo: {
|
||||
address: ''
|
||||
},
|
||||
appltType: uni.getStorageSync("appltType"),
|
||||
shippingType: '',
|
||||
paymentType: '',
|
||||
storeId: uni.getStorageSync('storeId'),
|
||||
@ -183,7 +184,8 @@
|
||||
})
|
||||
uni.$emit('unChooseAddr')
|
||||
|
||||
if (this.addrInfo.address == '' || this.addrInfo == null) {
|
||||
// 当地址信息为空是查询地址
|
||||
if (!this.addrInfo.address) {
|
||||
this.getAddr()
|
||||
}
|
||||
|
||||
@ -254,7 +256,8 @@
|
||||
integralOrdersList: integralOrdersList,
|
||||
// authCode:this_.authCode,
|
||||
// paymentType: _this.paymentType,
|
||||
paymentType: "WECHAT",
|
||||
// paymentType: "WECHAT",
|
||||
paymentType: _this.appltType,
|
||||
allAmout: _this.allAmout,
|
||||
allPoints: _this.allPoints,
|
||||
chainStoreId: _this.chainStoreId,
|
||||
@ -267,41 +270,71 @@
|
||||
url: '/pagesRefuel/orderSuccess/index'
|
||||
})
|
||||
} else if (res.data.code === "success") {
|
||||
console.log(res)
|
||||
let payProvider = "wxpay"
|
||||
_this.orderInfo = JSON.parse(res.data.data.reservedPayInfo);
|
||||
uni.requestPayment({
|
||||
// 微信支付provider: 'wxpay' 支付宝支付 'alipay'
|
||||
provider: payProvider,
|
||||
timeStamp: _this.orderInfo.timeStamp,
|
||||
nonceStr: _this.orderInfo.nonceStr,
|
||||
package: _this.orderInfo.package,
|
||||
signType: 'MD5',
|
||||
paySign: _this.orderInfo.paySign,
|
||||
success: function(res) {
|
||||
console.log('success:', res);
|
||||
uni.reLaunch({
|
||||
url: '/pagesRefuel/orderSuccess/index'
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
request({
|
||||
url: "business/integral/integralOrders/editPayStatus",
|
||||
method: 'get',
|
||||
data: {
|
||||
"orderNo": res.data.data.orderNo,
|
||||
"status": "payFail",
|
||||
"storeId": -1
|
||||
},
|
||||
}).then((res) => {
|
||||
// let payProvider = "wxpay"
|
||||
// if (_this.appltType == "WECHAT") {
|
||||
// payProvider = "wxpay"
|
||||
// } else {
|
||||
// payProvider = "alipay"
|
||||
// }
|
||||
|
||||
|
||||
if (res.data.data.reservedPayInfo) {
|
||||
_this.orderInfo = JSON.parse(res.data.data.reservedPayInfo);
|
||||
uni.requestPayment({
|
||||
// 微信支付provider: 'wxpay' 支付宝支付 'alipay'
|
||||
// provider: payProvider,
|
||||
provider: 'wxpay',
|
||||
timeStamp: _this.orderInfo.timeStamp,
|
||||
nonceStr: _this.orderInfo.nonceStr,
|
||||
package: _this.orderInfo.package,
|
||||
signType: 'MD5',
|
||||
paySign: _this.orderInfo.paySign,
|
||||
success: function(res) {
|
||||
console.log('success:', res);
|
||||
uni.reLaunch({
|
||||
url: '/pagesRefuel/orderSuccess/index'
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
request({
|
||||
url: "business/integral/integralOrders/editPayStatus",
|
||||
method: 'get',
|
||||
data: {
|
||||
"orderNo": res.data.data.orderNo,
|
||||
"status": "payFail",
|
||||
"storeId": -1
|
||||
},
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: "支付失败!",
|
||||
icon: "error"
|
||||
})
|
||||
})
|
||||
console.log('fail:', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (_this.appltType == "ALIPAY") {
|
||||
my.tradePay({
|
||||
tradeNO: res.data.data.reservedTransactionId
|
||||
}, function(resp) {
|
||||
console.log("resp", resp)
|
||||
if (resp.resultCode == '9000') {
|
||||
console.log("支付成功")
|
||||
uni.reLaunch({
|
||||
url: '/pagesRefuel/orderSuccess/index'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "支付失败!",
|
||||
icon: "error"
|
||||
})
|
||||
})
|
||||
console.log('fail:', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "支付失败!",
|
||||
@ -309,6 +342,8 @@
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
dataProcessing() {
|
||||
@ -496,6 +531,7 @@
|
||||
},
|
||||
// 查询我的积分
|
||||
getUserInfoList() {
|
||||
console.log("查询我的积分", this.chainStoreId)
|
||||
request({
|
||||
url: '/business/userManager/user/getByUniApp',
|
||||
method: 'get',
|
||||
|
@ -43,9 +43,17 @@ const request = config => {
|
||||
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
||||
if (code === 401) {
|
||||
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
||||
uni.reLaunch({
|
||||
url: '/pagesLogin/login/login'
|
||||
})
|
||||
console.log("res", res)
|
||||
if (res.confirm) {
|
||||
uni.reLaunch({
|
||||
url: '/pagesLogin/login/login'
|
||||
})
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}
|
||||
|
||||
// if (res.confirm) {
|
||||
// store.dispatch('LogOut').then(res => {
|
||||
|
||||
@ -79,4 +87,4 @@ const request = config => {
|
||||
})
|
||||
}
|
||||
|
||||
export default request
|
||||
export default request
|
Loading…
Reference in New Issue
Block a user