This commit is contained in:
cun-nan 2024-01-12 13:26:22 +08:00
parent 7c512e33aa
commit 654d912ef1
4 changed files with 55 additions and 26 deletions

View File

@ -126,6 +126,16 @@ public class LJUserController extends BaseController {
return getSuccessResult(map1); return getSuccessResult(map1);
} }
/**
* 根据storeId查询会员信息
* @param storeId
* @return
*/
@GetMapping("/storeUserInfo/{storeId}")
public ResponseObject userVoInfo1(@PathVariable Integer storeId){
return getSuccessResult(userService.queryUserByStoreIdAndUserId(storeId));
}
@GetMapping("/getByUniApp") @GetMapping("/getByUniApp")
public ResponseObject getByUniApp(Integer chainStoreId){ public ResponseObject getByUniApp(Integer chainStoreId){
LJUserVo user = userService.getByUniApp(chainStoreId); LJUserVo user = userService.getByUniApp(chainStoreId);

View File

@ -60,6 +60,13 @@ public interface LJUserService extends IService<LJUser> {
*/ */
public Map<String,Object> queryUserByStoreId(Integer storeId,Integer mobile); public Map<String,Object> queryUserByStoreId(Integer storeId,Integer mobile);
/**
* 根据storeId获取连锁店id 根据连锁店id查询用户信息
* @param storeId
* @return
*/
public LJUserVo queryUserByStoreIdAndUserId(Integer storeId);
/** /**
* 根据手机号和连锁店id查询会员信息 * 根据手机号和连锁店id查询会员信息
* @param mobile * @param mobile

View File

@ -151,6 +151,13 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
return map; return map;
} }
@Override
public LJUserVo queryUserByStoreIdAndUserId(Integer storeId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJStore store = storeService.selectStoreByStoreId(storeId);
return baseMapper.queryUserByChainStoreId(nowAccountInfo.getId(),store.getChainStoreId());
}
@Override @Override
public LJUserVo selectUserByMobileAndChantStoreId(String mobile) { public LJUserVo selectUserByMobileAndChantStoreId(String mobile) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();

View File

@ -572,7 +572,7 @@
</el-descriptions> </el-descriptions>
<el-descriptions title="储值余额"> <el-descriptions title="储值余额">
<template slot="extra"> <template slot="extra">
<span style="color: red;margin-right: 20px">余额充值</span> <!-- <span style="color: red;margin-right: 20px">余额充值</span>-->
<span style="font-weight: bold">{{member.cardBalance ? member.cardBalance : "--"}}</span> <span style="font-weight: bold">{{member.cardBalance ? member.cardBalance : "--"}}</span>
</template> </template>
<el-descriptions-item v-if="member.cardBalance!=0" label="账户余额">{{member.cardBalance ? member.cardBalance : "--"}}</el-descriptions-item> <el-descriptions-item v-if="member.cardBalance!=0" label="账户余额">{{member.cardBalance ? member.cardBalance : "--"}}</el-descriptions-item>
@ -2062,7 +2062,7 @@
if (this.isMember){ if (this.isMember){
if (this.balance >= (this.oilAmount - this.oilDiscount - this.fullReduction)){ if (this.balance >= (this.oilAmount - this.oilDiscount - this.fullReduction)){
this.oilActualPay = 0 this.oilActualPay = 0
this.consumeAmount = this.oilAmount - this.oilDiscount - this.fullReduction this.consumeAmount = (this.oilAmount*100 - this.oilDiscount*100 - this.fullReduction*100)/100
}else { }else {
this.oilActualPay = (this.oilAmount -this.balance - this.oilDiscount - this.fullReduction).toFixed(2) this.oilActualPay = (this.oilAmount -this.balance - this.oilDiscount - this.fullReduction).toFixed(2)
this.consumeAmount = this.balance this.consumeAmount = this.balance
@ -2241,6 +2241,7 @@
// //
delGoods(index){ delGoods(index){
this.goodsOrder.splice(index,1) this.goodsOrder.splice(index,1)
this.handleChange()
}, },
// //
changeGoods(val){ changeGoods(val){
@ -2250,11 +2251,6 @@
if (this.goodsOrder.length > 0) { if (this.goodsOrder.length > 0) {
let amount = 0; let amount = 0;
for (let i = 0; i < goods.length; i++) { for (let i = 0; i < goods.length; i++) {
if (_this.isMember) {
amount += +(goods[i].memberPrice * goods[i].num).toFixed(2)
} else {
amount += +(goods[i].retailPrice * goods[i].num).toFixed(2)
}
if (goods[i].id == val.id) { if (goods[i].id == val.id) {
if (val.stock<goods[i].num + 1){ if (val.stock<goods[i].num + 1){
this.$modal.msgError("商品库存不足,请重新选择商品") this.$modal.msgError("商品库存不足,请重新选择商品")
@ -2267,6 +2263,11 @@
} else { } else {
result = true; result = true;
} }
if (_this.isMember) {
amount += +(goods[i].memberPrice * goods[i].num).toFixed(2)
} else {
amount += +(goods[i].retailPrice * goods[i].num).toFixed(2)
}
} }
this.goodsAmount = amount; this.goodsAmount = amount;
this.goodsActualPay = this.goodsAmount - this.goodsDiscount; this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
@ -2287,16 +2288,33 @@
this.goodsActualPay = this.goodsAmount - this.goodsDiscount; this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
this.goodsOrder.push(val); this.goodsOrder.push(val);
this.goodsTotal += 1; this.goodsTotal += 1;
}else {
console.log(222)
if (val.stock==0){
this.$modal.msgError("商品库存不足,请重新选择商品")
return;
}
if (_this.isMember) {
this.goodsAmount += +val.memberPrice * val.num
} else {
this.goodsAmount += +val.retailPrice * val.num
}
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
} }
this.goods = "" this.goods = ""
}, },
// //
settlement(){ settlement(){
if (this.payType=="APPLET_CODE") {
if (this.goodsOrder.length > 0) {
this.$modal.msgError("非油商品不可使用小程序码支付")
return;
}
}
this.authCode = "" this.authCode = ""
this.seekZero = 0; this.seekZero = 0;
this.isPay = false this.isPay = false
console.log(this.isPay)
this.dialogVisiblej = true this.dialogVisiblej = true
this.getStaff() this.getStaff()
}, },
@ -2568,6 +2586,10 @@
let _this = this; let _this = this;
if (this.payType=="APPLET_CODE"){ if (this.payType=="APPLET_CODE"){
if (this.goodsOrder.length>0){
this.$modal.msgError("非油商品不可使用小程序码支付")
return;
}
scanAppletQrCode(_this.map).then( resp => { scanAppletQrCode(_this.map).then( resp => {
if (resp.data.success=='success'){ if (resp.data.success=='success'){
this.loading = true; this.loading = true;
@ -2585,8 +2607,8 @@
} }
addLJGoods(_this.map).then( response => { addLJGoods(_this.map).then( response => {
_this.orderNo = response.data.orderNo;
if (response.data.oilOrder!=null){ if (response.data.oilOrder!=null){
_this.orderNo = response.data.oilOrder.orderNo;
if (response.data.oilOrder.orderStatus == "paid"){ if (response.data.oilOrder.orderStatus == "paid"){
_this.isPaySuccess = true; _this.isPaySuccess = true;
_this.seekZero = 0 _this.seekZero = 0
@ -2709,23 +2731,6 @@
_this.timer = setInterval(function (){ _this.timer = setInterval(function (){
// "234520231228115544f073f4" // "234520231228115544f073f4"
cashierOrderByOrderNo({orderNo:_this.orderNo}).then( response => { cashierOrderByOrderNo({orderNo:_this.orderNo}).then( response => {
if (response.data!=null){
if (response.data.orderStatus == "unpaid"){
_this.isQuery = true;
}
if (response.data.orderStatus == "paid"){
_this.isPaySuccess = true;
_this.isQuery = false;
_this.amount = 0
}
if (response.data.orderStatus == "payFail"){
_this.isPaySuccess = false;
_this.isQuery = false;
}
}
_this.resetting1();
})
goodsOrder({orderNo:_this.orderNo}).then( response => {
if (response.data!=null){ if (response.data!=null){
if (response.data.status == "unpaid"){ if (response.data.status == "unpaid"){
_this.isQuery = true; _this.isQuery = true;