bug处理

This commit is contained in:
wangh 2024-01-19 18:28:40 +08:00
parent 8d249e7e5e
commit 75c34d33f3
17 changed files with 336 additions and 97 deletions

View File

@ -167,7 +167,6 @@
<div>赠送<span class="amount">{{ item.giftBalance }}</span></div> <div>赠送<span class="amount">{{ item.giftBalance }}</span></div>
</div> </div>
</div> </div>
<div style="width: 30%;margin-left: 13px;margin-top: 8px;" <div style="width: 30%;margin-left: 13px;margin-top: 8px;"
:class="activeKey === cardValueList.length ? 'select' : ''" :class="activeKey === cardValueList.length ? 'select' : ''"
@click="rechargeCard(cardValueList.length,-1)"> @click="rechargeCard(cardValueList.length,-1)">
@ -421,6 +420,13 @@
</template> </template>
</el-result> </el-result>
</div> </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> <div v-else>
<el-result icon="error" title="支付失败,请重新支付"> <el-result icon="error" title="支付失败,请重新支付">
<template slot="extra"> <template slot="extra">
@ -876,6 +882,7 @@ export default {
isPay: true, isPay: true,
isPaySuccess: false, isPaySuccess: false,
isAwait: false,
isQuery: true, isQuery: true,
payList: [], payList: [],
@ -1113,7 +1120,7 @@ export default {
this.cardValueList.sort((a, b) => a.rechargeBalance - b.rechargeBalance); this.cardValueList.sort((a, b) => a.rechargeBalance - b.rechargeBalance);
// console.log("this.grade.name",this.grade) // console.log("this.grade.name",this.grade)
}) })
// console.log("this.cardValueList", this.grade) console.log("123123123123123123123t")
if (this.cardValueList.length > 0) { if (this.cardValueList.length > 0) {
// //
@ -1126,8 +1133,12 @@ export default {
this.cardValueList = this.cardValueList.filter(item => { this.cardValueList = this.cardValueList.filter(item => {
return item.groupOriented === "1"; return item.groupOriented === "1";
}); });
if (this.cardValueList.length > 0) {
this.rechargeCard(0);
}
} }
} }
this.$forceUpdate();
}, },
valueAmoutChange(data) { valueAmoutChange(data) {
@ -1264,13 +1275,13 @@ export default {
// //
// //
userRecharge() { async userRecharge() {
this.getCardFuelDieselList() await this.getCardFuelDieselList()
this.getCardValueList() await this.getCardValueList()
this.getCountOilType() await this.getCountOilType()
this.getPayList(); await this.getPayList();
this.openRecharge = true; this.openRecharge = true;
this.title = '会员充值' this.title = '会员充值'
@ -1307,9 +1318,6 @@ export default {
this.openConfirm = true; this.openConfirm = true;
this.isPay = true this.isPay = true
// console.log("11111",this.isPay)
// this.isPaySuccess=false
this.title = this.payment this.title = this.payment
}, },
// //
@ -1433,8 +1441,8 @@ export default {
}, },
//
async collection() { async collection() {
let userForm = this.form let userForm = this.form
if (this.flag === 1) { if (this.flag === 1) {
@ -1493,9 +1501,10 @@ export default {
clearInterval(timer); clearInterval(timer);
this_.loading = false; this_.loading = false;
this_.isPay = false; this_.isPay = false;
this.isPaySuccess = false; this_.isPaySuccess = false;
this_.isAwait = true;
console.log("t3") console.log("t3")
}, 10000) }, 15000)
} else if (this.flag === 2) { } else if (this.flag === 2) {
if (!this.authCode && this.cardFuelDieselForm.paymentType !== "CASH") { if (!this.authCode && this.cardFuelDieselForm.paymentType !== "CASH") {
@ -1551,9 +1560,10 @@ export default {
clearInterval(timer); clearInterval(timer);
this_.loading = false; this_.loading = false;
this_.isPay = false; this_.isPay = false;
this.isPaySuccess = false; this_.isPaySuccess = false;
this_.isAwait = true;
}, 30000) }, 15000)
let this_ = this let this_ = this
} }
@ -1600,13 +1610,26 @@ export default {
points: '', // points: '', //
growthValue: '', // growthValue: '', //
remark: '', remark: '',
paymentType: '', // paymentType: 'WECHAT', //
royaltyType: '',// royaltyType: '',//
percentageCommissions: null, percentageCommissions: null,
amountCommission: null, amountCommission: null,
rechargeType: '0' rechargeType: '0'
} }
this.cardFuelDieselForm = {
mtStaffId: '',
realName: '',
staffMobile: '',
points: '',
remark: '',
rechargeBalance: '', //
paymentType: 'WECHAT',
payType:'',
oilType: '',
type: '',
chainStorId: '',
incomeLitres: '',
},
// //
this.getUserInfo(); this.getUserInfo();
this.getInformation(); this.getInformation();
@ -1656,6 +1679,7 @@ export default {
this.cardValueForm = {} this.cardValueForm = {}
this.cardFuelDieselForm = {} this.cardFuelDieselForm = {}
this.iniz()
}, },
cancelCollection() { cancelCollection() {
this.openConfirm = false; this.openConfirm = false;

View File

@ -195,7 +195,6 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
} }
} }
} }
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
return false; return false;

View File

@ -8,6 +8,7 @@ import com.fuint.business.convenienceSore.entity.LJGoods;
import com.fuint.business.convenienceSore.service.LJGoodsService; import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.framework.web.BaseController; import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject; import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -129,4 +130,10 @@ public class LJGoodsController extends BaseController {
return getSuccessResult(goodsService.editGoodsInventory(goods)); return getSuccessResult(goodsService.editGoodsInventory(goods));
} }
@GetMapping("determineTheInventoryOfTheProduct")
public ResponseObject determineTheInventoryOfTheProduct(@Param("id") Integer id, @Param("stock") Integer stock) {
return getSuccessResult(goodsService.determineTheInventoryOfTheProduct(id,stock));
}
} }

View File

@ -82,4 +82,6 @@ public interface LJGoodsService extends IService<LJGoods> {
boolean editGoodsInventory(LJGoodsDto goods); boolean editGoodsInventory(LJGoodsDto goods);
boolean subtractGoodesStockByLock(@Param("id") Integer id, @Param("stock") Integer stock); boolean subtractGoodesStockByLock(@Param("id") Integer id, @Param("stock") Integer stock);
boolean determineTheInventoryOfTheProduct(@Param("id") Integer id, @Param("stock") Integer stock);
} }

View File

@ -287,4 +287,15 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
return true; 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;
}
} }

View File

@ -1,8 +1,12 @@
package com.fuint.business.integral.service.impl; package com.fuint.business.integral.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.IntegralGift;
import com.fuint.business.integral.entity.IntegralGiftCategory;
import com.fuint.business.integral.mapper.IntegralGiftMapper; import com.fuint.business.integral.mapper.IntegralGiftMapper;
import com.fuint.business.integral.service.IntegralGiftService; import com.fuint.business.integral.service.IntegralGiftService;
import com.fuint.business.integral.service.IntegralOrdersService; import com.fuint.business.integral.service.IntegralOrdersService;
@ -79,6 +83,7 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
*/ */
@Override @Override
public IntegralGift insert(IntegralGift integralGift) { public IntegralGift insert(IntegralGift integralGift) {
determineTheInventoryOfTheProduct(integralGift);
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
integralGift.setStoreId(nowAccountInfo.getStoreId()); integralGift.setStoreId(nowAccountInfo.getStoreId());
integralGift.setCreateBy(nowAccountInfo.getStaffId().toString()); integralGift.setCreateBy(nowAccountInfo.getStaffId().toString());
@ -94,10 +99,31 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
*/ */
@Override @Override
public IntegralGift update(IntegralGift integralGift) { public IntegralGift update(IntegralGift integralGift) {
determineTheInventoryOfTheProduct(integralGift);
this.integralGiftDao.update(integralGift); this.integralGiftDao.update(integralGift);
return this.queryById(integralGift.getId()); 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;
}
/** /**
* 通过主键删除数据 * 通过主键删除数据
* *

View File

@ -190,6 +190,10 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
} }
// 插入订单 // 插入订单
List<IntegralOrders> integralOrdersList1 = integralOrdersList.getIntegralOrdersList(); List<IntegralOrders> integralOrdersList1 = integralOrdersList.getIntegralOrdersList();
// 当积分兑换为商品是需要判断库存是否足够
if (integralOrdersList1.size() < 0) return null; if (integralOrdersList1.size() < 0) return null;
@ -315,13 +319,13 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
@Transactional @Transactional
public IntegralOrders checkTheStatusOfYourPaymentByIntegral(String orderNo) { 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, nowAccountInfo.getStoreId());
List<IntegralOrders> listByOrderNo = integralOrdersDao.getListByOrderNo2(orderNo); List<IntegralOrders> listByOrderNo = integralOrdersDao.getListByOrderNo2(orderNo);
// 加锁 processing_status // 加锁 processing_status
String lockKey = "IntegralOrders"+nowAccountInfo.getStoreId()+orderNo; String lockKey = "IntegralOrders"+orderNo;
Boolean isLock = redisLock.tryLock(lockKey, 5000, TimeUnit.MILLISECONDS); Boolean isLock = redisLock.tryLock(lockKey, 5000, TimeUnit.MILLISECONDS);
if (isLock && "paid".equals(listByOrderNo.get(0).getStatus()) && "0".equals(listByOrderNo.get(0).getProcessingStatus()) ) { if (isLock && "paid".equals(listByOrderNo.get(0).getStatus()) && "0".equals(listByOrderNo.get(0).getProcessingStatus()) ) {
// 查询用户信息 // 查询用户信息

View File

@ -1,5 +1,6 @@
package com.fuint.business.petrolStationManagement.service.impl; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -131,6 +132,11 @@ public class OilGunServiceImpl implements OilGunService {
return oilGunList.size(); 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) { public boolean update(OilGun oilGun) {
AccountInfo accountInfo = TokenUtil.getNowAccountInfo(); AccountInfo accountInfo = TokenUtil.getNowAccountInfo();
oilGun.setStoreId(accountInfo.getStoreId()); oilGun.setStoreId(accountInfo.getStoreId());
int i = checkData(oilGun); List<OilGun> oilGuns = checkData2(oilGun);
if (i>1) { if (ObjectUtil.isNotEmpty(oilGuns)) {
return false; if (oilGuns.size()>1) {
return false;
}
if (!oilGuns.get(0).getId().equals(oilGun.getId())) {
return false;
}
} }
oilGun.setUpdateBy(accountInfo.getId().toString()); oilGun.setUpdateBy(accountInfo.getId().toString());
return this.oilGunDao.update(oilGun)>0; return this.oilGunDao.update(oilGun)>0;
} }

View File

@ -71,6 +71,7 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
// 经度 // 经度
Double lon = Double.valueOf(map.get("lon")); Double lon = Double.valueOf(map.get("lon"));
Double lat = Double.valueOf(map.get("lat")); Double lat = Double.valueOf(map.get("lat"));
String isLogin = ObjectUtil.isEmpty(map.get("isLogin"))?"1":map.get("isLogin");
String storeId = map.get("storeId"); String storeId = map.get("storeId");
LJStore ljStore = new LJStore(); LJStore ljStore = new LJStore();
Double distance = 0.0; Double distance = 0.0;
@ -131,13 +132,16 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
} }
// 判断当前店铺是否存在此用户的会员信息没有的话进行添加 // 判断当前店铺是否存在此用户的会员信息没有的话进行添加
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); if ("0".equals(isLogin)) { // 判断是否登录
LJStore store = this.selectStoreByStoreId(Integer.valueOf(storeId)); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
UserBalance balance = userBalanceService.selectUserBalance(nowAccountInfo.getId(), store.getChainStoreId()); LJStore store = this.selectStoreByStoreId(Integer.valueOf(storeId));
if (ObjectUtil.isEmpty(balance)){ UserBalance balance = userBalanceService.selectUserBalance(nowAccountInfo.getId(), store.getChainStoreId());
userBalanceService.initBalance(nowAccountInfo.getId(),store.getChainStoreId()); if (ObjectUtil.isEmpty(balance)){
userBalanceService.initBalance(nowAccountInfo.getId(),store.getChainStoreId());
}
} }
Map<String,Object> map1 = new HashMap<>(); Map<String,Object> map1 = new HashMap<>();
map1.put("distance",distance); map1.put("distance",distance);
map1.put("store",ljStore); map1.put("store",ljStore);

View File

@ -52,7 +52,27 @@ public class ShiroConfig {
filterMap.put("/backendApi/store/loginVerification","anon"); filterMap.put("/backendApi/store/loginVerification","anon");
//小程序支付回调地址 //小程序支付回调地址
filterMap.put("/api/fyPay/notify","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"); filterMap.put("/**","commonFilter");
filter.setFilterChainDefinitionMap(filterMap); filter.setFilterChainDefinitionMap(filterMap);
filter.setLoginUrl("/login"); filter.setLoginUrl("/login");
return filter; return filter;

View File

@ -34,3 +34,11 @@ export function getCheckTheStatusOfYourPaymentByIntegralApi(query) {
params: query params: query
}) })
} }
// 判断库存是否足够
export function getDetermineTheInventoryOfTheProductApi(query) {
return request({
url: 'business/convenience/goods/determineTheInventoryOfTheProduct',
method: 'get',
params: query
})
}

View File

@ -372,6 +372,13 @@
</template> </template>
</el-result> </el-result>
</div> </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> <div v-else>
<el-result icon="error" title="支付失败,请重新支付"> <el-result icon="error" title="支付失败,请重新支付">
<template slot="extra"> <template slot="extra">
@ -390,7 +397,7 @@
<script> <script>
import { import {
getCheckTheStatusOfYourPaymentByIntegralApi, getCheckTheStatusOfYourPaymentByIntegralApi, getDetermineTheInventoryOfTheProductApi,
getGiftApi, getGiftApi,
getGiftCategoryApi, getGiftCategoryApi,
getIntegralOrdersProcessingApi getIntegralOrdersProcessingApi
@ -452,6 +459,8 @@ import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/u
authCode:'', authCode:'',
isPay:true, isPay:true,
isPaySuccess:false, isPaySuccess:false,
isAwait: false,
loading:false, loading:false,
paymentType : 'ALIPAY', // paymentType : 'ALIPAY', //
payType:'支付宝支付' payType:'支付宝支付'
@ -496,8 +505,8 @@ import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/u
}, },
// //
addGift(data) { async addGift(data) {
console.log("data",data)
if (data.markPurchases) { if (data.markPurchases) {
if (data.markPurchases>=data.remainingInventory){ if (data.markPurchases>=data.remainingInventory){
this.$message.error('库存不足'); this.$message.error('库存不足');
@ -509,6 +518,18 @@ import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/u
} }
this.markPurchasesAll++ 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); this.dataChange(data);
@ -887,9 +908,11 @@ import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/u
clearInterval(timer); clearInterval(timer);
this_.loading = false; this_.loading = false;
this_.isPay = false; this_.isPay = false;
this_.isAwait = true;
this.isPaySuccess = false; this.isPaySuccess = false;
},30000) },15000)
} }
// this.paymentType = '' // this.paymentType = ''

View File

@ -422,6 +422,13 @@
</template> </template>
</el-result> </el-result>
</div> </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> <div v-else>
<el-result icon="error" title="支付失败,请重新支付"> <el-result icon="error" title="支付失败,请重新支付">
<template slot="extra"> <template slot="extra">
@ -540,9 +547,9 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 子卡管理--> <!-- 子卡管理-->
<el-dialog :title="title" :visible.sync="openSubCard" append-to-body> <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-tabs v-model="subCardActive" @tab-click="handleClick">
<el-tab-pane label="子卡管理" name="subCardManage"> <el-tab-pane label="子卡管理" name="subCardManage">
<div style="display: flex;justify-content: space-between;margin: 10px 0"> <div style="display: flex;justify-content: space-between;margin: 10px 0">
@ -720,7 +727,7 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 添加或修改子卡信息--> <!-- 添加或修改子卡信息-->
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openSubCard1" width="30%"> <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-form ref="form1" :model="form1" :rules="rules" label-width="120px">
<el-row> <el-row>
@ -871,6 +878,7 @@ export default {
isPay: true, isPay: true,
isPaySuccess: false, isPaySuccess: false,
isAwait: false,
isQuery: true, isQuery: true,
payList: [], payList: [],
@ -1131,8 +1139,12 @@ export default {
this.cardValueList = this.cardValueList.filter(item => { this.cardValueList = this.cardValueList.filter(item => {
return item.groupOriented === "1"; return item.groupOriented === "1";
}); });
if (this.cardValueList.length > 0) {
this.rechargeCard(0);
}
} }
} }
this.$forceUpdate();
}, },
valueAmoutChange(data) { valueAmoutChange(data) {
@ -1269,13 +1281,13 @@ export default {
// //
// //
userRecharge() { async userRecharge() {
this.getCardFuelDieselList() await this.getCardFuelDieselList()
this.getCardValueList() await this.getCardValueList()
this.getCountOilType() await this.getCountOilType()
this.getPayList(); await this.getPayList();
this.openRecharge = true; this.openRecharge = true;
this.title = '会员充值' this.title = '会员充值'
@ -1312,9 +1324,6 @@ export default {
this.openConfirm = true; this.openConfirm = true;
this.isPay = true this.isPay = true
// console.log("11111",this.isPay)
// this.isPaySuccess=false
this.title = this.payment this.title = this.payment
}, },
// //
@ -1499,8 +1508,10 @@ export default {
clearInterval(timer); clearInterval(timer);
this_.loading = false; this_.loading = false;
this_.isPay = false; this_.isPay = false;
this.isPaySuccess = false; this_.isPaySuccess = false;
}, 30000) this_.isAwait = true;
console.log("t3")
}, 15000)
} else if (this.flag === 2) { } else if (this.flag === 2) {
if (!this.authCode && this.cardFuelDieselForm.paymentType !== "CASH") { if (!this.authCode && this.cardFuelDieselForm.paymentType !== "CASH") {
@ -1556,9 +1567,10 @@ export default {
clearInterval(timer); clearInterval(timer);
this_.loading = false; this_.loading = false;
this_.isPay = false; this_.isPay = false;
this.isPaySuccess = false; this_.isPaySuccess = false;
this_.isAwait = true;
}, 30000) }, 15000)
let this_ = this let this_ = this
} }
@ -1580,9 +1592,9 @@ export default {
// //
handClose() { handClose() {
this.isPay = true, this.isPay = true,
this.isPaySuccess = false, this.isPaySuccess = false,
this.isQuery = true, this.isQuery = true,
this.openConfirm = false this.openConfirm = false
this.openRecharge = false this.openRecharge = false
// this.isPaySuccess = false; // this.isPaySuccess = false;
@ -1607,13 +1619,26 @@ export default {
points: '', // points: '', //
growthValue: '', // growthValue: '', //
remark: '', remark: '',
paymentType: '', // paymentType: 'WECHAT', //
royaltyType: '',// royaltyType: '',//
percentageCommissions: null, percentageCommissions: null,
amountCommission: null, amountCommission: null,
rechargeType: '0' rechargeType: '0'
} }
this.cardFuelDieselForm = {
mtStaffId: '',
realName: '',
staffMobile: '',
points: '',
remark: '',
rechargeBalance: '', //
paymentType: 'WECHAT',
payType:'',
oilType: '',
type: '',
chainStorId: '',
incomeLitres: '',
},
// //
this.getUserInfo(); this.getUserInfo();
this.getInformation(); this.getInformation();
@ -1663,6 +1688,7 @@ export default {
this.cardValueForm = {} this.cardValueForm = {}
this.cardFuelDieselForm = {} this.cardFuelDieselForm = {}
this.iniz()
}, },
cancelCollection() { cancelCollection() {
this.openConfirm = false; this.openConfirm = false;

View File

@ -154,6 +154,7 @@
oilPrice: '0', oilPrice: '0',
gbPrice: '0' gbPrice: '0'
}, },
AppToken: uni.getStorageSync("App-Token"),
list1: [], list1: [],
list3: [ list3: [
@ -255,6 +256,10 @@
}, },
// //
isJoined() { isJoined() {
//
if (!this.AppToken) {
return;
}
request({ request({
url: 'business/marketingActivity/activeNewlywedsRecords/applet', url: 'business/marketingActivity/activeNewlywedsRecords/applet',
method: 'get', method: 'get',
@ -299,6 +304,10 @@
}, },
// //
selectActiveNewlyweds() { selectActiveNewlyweds() {
//
if (!this.AppToken) {
return;
}
request({ request({
url: 'business/marketingActivity/activeNewlyweds/applet', url: 'business/marketingActivity/activeNewlyweds/applet',
method: 'get', method: 'get',
@ -385,8 +394,8 @@
// 使wgs84 使gcj02 // 使wgs84 使gcj02
type: 'gcj02', // 使 type: 'gcj02', // 使
success: function(res) { success: function(res) {
if (_this.longitude=="" && _this.latitude =="") { if (_this.longitude == "" && _this.latitude == "") {
_this.longitude = res.longitude; _this.longitude = res.longitude;
_this.latitude = res.latitude _this.latitude = res.latitude
} }
@ -398,7 +407,8 @@
data: { data: {
"lon": _this.longitude, "lon": _this.longitude,
"lat": _this.latitude, "lat": _this.latitude,
"storeId":storeId "storeId": storeId,
"isLogin": _this.AppToken ? "0" : "1", // 0
}, },
}).then((response) => { }).then((response) => {
_this.distance = (Math.ceil(response.data.distance)) _this.distance = (Math.ceil(response.data.distance))
@ -517,7 +527,7 @@
longitude longitude
}) => { // }) => { //
// this.addressName = address; // this.addressName = address;
console.log(name,address,latitude,longitude); console.log(name, address, latitude, longitude);
this.longitude = longitude; this.longitude = longitude;
this.latitude = latitude; this.latitude = latitude;
this.getAddress() this.getAddress()

View File

@ -14,9 +14,11 @@
<image v-else src="../../static/imgs/myx.png" mode=""></image> <image v-else src="../../static/imgs/myx.png" mode=""></image>
</view> </view>
<view class=""> <view class="">
<view class="user-tel" @click="goSetup">{{user.mobile}}</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" <view class="user-name" @click="gorefuel">
size="12"></uni-icons> </view> {{store.name}}{{store.description ? "("+store.description+")" : ""}}<uni-icons
type="right" color="#c1c1ff" size="12"></uni-icons>
</view>
</view> </view>
</view> </view>
<view class="vipnber" @click="govip()">会员等级 <uni-icons type="right" color="#ffffff" <view class="vipnber" @click="govip()">会员等级 <uni-icons type="right" color="#ffffff"
@ -178,6 +180,7 @@
refuelMoney: [], refuelMoney: [],
cardBalance: 0.00, cardBalance: 0.00,
title: '', title: '',
AppToken: uni.getStorageSync("App-Token"),
msg: "3", msg: "3",
// url // url
baseUrl: this.$baseUrl, baseUrl: this.$baseUrl,
@ -213,6 +216,9 @@
}, },
// //
getUser() { getUser() {
if (!this.AppToken) {
return;
}
request({ request({
url: 'business/userManager/user/getUser', url: 'business/userManager/user/getUser',
method: 'get', method: 'get',
@ -256,6 +262,12 @@
}) })
}, },
goSetup() { goSetup() {
if (!this.user.mobile) {
uni.navigateTo({
url: '/pagesLogin/login/login'
})
return;
}
uni.navigateTo({ uni.navigateTo({
url: '/pagesMy/setup/index' url: '/pagesMy/setup/index'
}) })
@ -301,6 +313,9 @@
}) })
}, },
getUserBalance() { getUserBalance() {
if (!this.AppToken) {
return;
}
request({ request({
url: '/business/userManager/user/getUserBalanceApplet', url: '/business/userManager/user/getUserBalanceApplet',
method: 'get', method: 'get',
@ -318,6 +333,9 @@
}) })
}, },
getGiftRecords() { getGiftRecords() {
if (!this.AppToken) {
return;
}
request({ request({
url: 'business/marketingActivity/cardFavorable/applet', url: 'business/marketingActivity/cardFavorable/applet',
method: 'get', method: 'get',
@ -330,6 +348,7 @@
}, },
// //
toCoupons() { toCoupons() {
uni.navigateTo({ uni.navigateTo({
url: '/pagesMy/Coupons/Coupons' url: '/pagesMy/Coupons/Coupons'
}) })
@ -502,4 +521,4 @@
.centenr-size { .centenr-size {
font-size: 14px; font-size: 14px;
} }
</style> </style>

View File

@ -145,6 +145,7 @@
addrInfo: { addrInfo: {
address: '' address: ''
}, },
appltType: uni.getStorageSync("appltType"),
shippingType: '', shippingType: '',
paymentType: '', paymentType: '',
storeId: uni.getStorageSync('storeId'), storeId: uni.getStorageSync('storeId'),
@ -183,7 +184,8 @@
}) })
uni.$emit('unChooseAddr') uni.$emit('unChooseAddr')
if (this.addrInfo.address == '' || this.addrInfo == null) { //
if (!this.addrInfo.address) {
this.getAddr() this.getAddr()
} }
@ -254,7 +256,8 @@
integralOrdersList: integralOrdersList, integralOrdersList: integralOrdersList,
// authCode:this_.authCode, // authCode:this_.authCode,
// paymentType: _this.paymentType, // paymentType: _this.paymentType,
paymentType: "WECHAT", // paymentType: "WECHAT",
paymentType: _this.appltType,
allAmout: _this.allAmout, allAmout: _this.allAmout,
allPoints: _this.allPoints, allPoints: _this.allPoints,
chainStoreId: _this.chainStoreId, chainStoreId: _this.chainStoreId,
@ -267,41 +270,71 @@
url: '/pagesRefuel/orderSuccess/index' url: '/pagesRefuel/orderSuccess/index'
}) })
} else if (res.data.code === "success") { } else if (res.data.code === "success") {
console.log(res) // let payProvider = "wxpay"
let payProvider = "wxpay" // if (_this.appltType == "WECHAT") {
_this.orderInfo = JSON.parse(res.data.data.reservedPayInfo); // payProvider = "wxpay"
uni.requestPayment({ // } else {
// provider: 'wxpay' 'alipay' // payProvider = "alipay"
provider: payProvider, // }
timeStamp: _this.orderInfo.timeStamp,
nonceStr: _this.orderInfo.nonceStr,
package: _this.orderInfo.package, if (res.data.data.reservedPayInfo) {
signType: 'MD5', _this.orderInfo = JSON.parse(res.data.data.reservedPayInfo);
paySign: _this.orderInfo.paySign, uni.requestPayment({
success: function(res) { // provider: 'wxpay' 'alipay'
console.log('success:', res); // provider: payProvider,
uni.reLaunch({ provider: 'wxpay',
url: '/pagesRefuel/orderSuccess/index' timeStamp: _this.orderInfo.timeStamp,
}) nonceStr: _this.orderInfo.nonceStr,
}, package: _this.orderInfo.package,
fail: function(err) { signType: 'MD5',
request({ paySign: _this.orderInfo.paySign,
url: "business/integral/integralOrders/editPayStatus", success: function(res) {
method: 'get', console.log('success:', res);
data: { uni.reLaunch({
"orderNo": res.data.data.orderNo, url: '/pagesRefuel/orderSuccess/index'
"status": "payFail", })
"storeId": -1 },
}, fail: function(err) {
}).then((res) => { 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({ uni.showToast({
title: "支付失败!", title: "支付失败!",
icon: "error" icon: "error"
}) })
}) }
console.log('fail:', err); });
} }
});
} else { } else {
uni.showToast({ uni.showToast({
title: "支付失败!", title: "支付失败!",
@ -309,6 +342,8 @@
}) })
} }
}) })
}, },
dataProcessing() { dataProcessing() {
@ -496,6 +531,7 @@
}, },
// //
getUserInfoList() { getUserInfoList() {
console.log("查询我的积分", this.chainStoreId)
request({ request({
url: '/business/userManager/user/getByUniApp', url: '/business/userManager/user/getByUniApp',
method: 'get', method: 'get',

View File

@ -43,9 +43,17 @@ const request = config => {
const msg = errorCode[code] || res.data.msg || errorCode['default'] const msg = errorCode[code] || res.data.msg || errorCode['default']
if (code === 401) { if (code === 401) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => { showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
uni.reLaunch({ console.log("res", res)
url: '/pagesLogin/login/login' if (res.confirm) {
}) uni.reLaunch({
url: '/pagesLogin/login/login'
})
} else {
uni.reLaunch({
url: '/pages/index/index'
})
}
// if (res.confirm) { // if (res.confirm) {
// store.dispatch('LogOut').then(res => { // store.dispatch('LogOut').then(res => {
@ -79,4 +87,4 @@ const request = config => {
}) })
} }
export default request export default request