Merge remote-tracking branch 'origin/master'

This commit is contained in:
齐天大圣 2024-01-23 10:42:20 +08:00
commit 937fcee22f
13 changed files with 193 additions and 110 deletions

View File

@ -3,7 +3,7 @@
<el-card class="card">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="店铺" prop="storeId">
<el-select v-model="queryParams.storeId" placeholder="请选择店铺" style="width: 100%">
<el-select v-model="queryParams.storeId" filterable placeholder="请选择店铺" clearable style="width: 100%">
<el-option v-for="item in storeList"
:key="item.id" clearable
:label="item.name" :value="item.id"
@ -87,10 +87,10 @@
:visible.sync="dialogVisible">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="店铺" prop="storeId">
<el-select v-model="form.storeId" placeholder="请选择店铺" style="width: 100%">
<el-select v-model="form.storeId" filterable placeholder="请选择店铺" style="width: 100%">
<el-option v-for="item in storeList"
:key="item.id"
:label="item.name" :value="item.id"></el-option>
:label="item.name" :value="item.id+''"></el-option>
</el-select>
</el-form-item>
<el-form-item label="轮播图" prop="bannerUrl">
@ -235,18 +235,17 @@ export default {
if (valid) {
if (this.form.id){
updateIndexBanner(this.form).then(res => {
console.log(res)
if (res.data==1){
this.$modal.msgSuccess("修改成功")
this.dialogVisible = false
this.flag = false
this.queryParams.page = 1
this.getList()
this.getStoreList()
}
})
}else {
addIndexBanner(this.form).then(res => {
console.log(res)
if (res.data==1){
this.$modal.msgSuccess("添加成功")
this.dialogVisible = false

View File

@ -56,7 +56,7 @@ public class IndexBannerController extends BaseController {
*/
@PostMapping
public ResponseObject add(@RequestBody IndexBanner indexBanner){
return getSuccessResult(indexBannerService.insertIndexBanner(indexBanner,null));
return getSuccessResult(indexBannerService.insertIndexBanner(indexBanner,indexBanner.getStoreId()));
}
/**

View File

@ -666,93 +666,95 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
if (StringUtils.isNotEmpty(gradeId)) {
LJStore store = iljStoreService.selectStoreByStoreId(storeId);
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId());
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
if (isEnableLevel.equals("yes")) {
if (ObjectUtils.isNotEmpty(chainStoreConfig)) {
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
if (isEnableLevel.equals("yes")) {
LJUserGrade ljUserGrade = ljUserGradeMapper.selectAllByGradeId(gradeId);
if (ObjectUtils.isNotEmpty(ljUserGrade)) {
if (oilTypebyId.equals("汽油")) {
if (ljUserGrade.getGasolineDiscount().equals("无优惠")) {
LJUserGrade ljUserGrade = ljUserGradeMapper.selectAllByGradeId(gradeId);
if (ObjectUtils.isNotEmpty(ljUserGrade)) {
if (oilTypebyId.equals("汽油")) {
if (ljUserGrade.getGasolineDiscount().equals("无优惠")) {
} else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) {
String gasolineRule = ljUserGrade.getGasolineRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
BigDecimal bigDecimal = jsonObject.getBigDecimal("gasolineRule1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
//升数
BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP);
BigDecimal gasolineRule3 = jsonObject.getBigDecimal("gasolineRule3");
BigDecimal multiply = divide.multiply(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(multiply);
}
} else {
String gasolineRule = ljUserGrade.getGasolineRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
BigDecimal gasolineRule1 = jsonObject.getBigDecimal("gasolineRule1");
if (paymentActiveDTO.getAmount().compareTo(gasolineRule1) >= 0) {
//升数
Integer gasolineRule3 = jsonObject.getInteger("gasolineRule2");
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
} else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) {
String gasolineRule = ljUserGrade.getGasolineRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
BigDecimal bigDecimal = jsonObject.getBigDecimal("gasolineRule1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
//升数
BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP);
BigDecimal gasolineRule3 = jsonObject.getBigDecimal("gasolineRule3");
BigDecimal multiply = divide.multiply(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(multiply);
}
} else {
String gasolineRule = ljUserGrade.getGasolineRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
BigDecimal gasolineRule1 = jsonObject.getBigDecimal("gasolineRule1");
if (paymentActiveDTO.getAmount().compareTo(gasolineRule1) >= 0) {
//升数
Integer gasolineRule3 = jsonObject.getInteger("gasolineRule2");
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
}
}
}
}
if (oilTypebyId.equals("柴油")) {
if (ljUserGrade.getGasolineDiscount().equals("无优惠")) {
if (oilTypebyId.equals("柴油")) {
if (ljUserGrade.getGasolineDiscount().equals("无优惠")) {
} else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) {
String gasolineRule = ljUserGrade.getDieselRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
BigDecimal bigDecimal = jsonObject.getBigDecimal("dieselRule1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
//升数
BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP);
BigDecimal bigDecimal2 = jsonObject.getBigDecimal("dieselRule3");
BigDecimal multiply = divide.multiply(bigDecimal2);
paymentActiveVO.setMemberFavorableAmount(multiply);
}
} else {
String gasolineRule = ljUserGrade.getDieselRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
BigDecimal bigDecimal = jsonObject.getBigDecimal("dieselRule1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
//升数
Integer gasolineRule3 = jsonObject.getInteger("dieselRule2");
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
} else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) {
String gasolineRule = ljUserGrade.getDieselRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
BigDecimal bigDecimal = jsonObject.getBigDecimal("dieselRule1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
//升数
BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP);
BigDecimal bigDecimal2 = jsonObject.getBigDecimal("dieselRule3");
BigDecimal multiply = divide.multiply(bigDecimal2);
paymentActiveVO.setMemberFavorableAmount(multiply);
}
} else {
String gasolineRule = ljUserGrade.getDieselRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
BigDecimal bigDecimal = jsonObject.getBigDecimal("dieselRule1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
//升数
Integer gasolineRule3 = jsonObject.getInteger("dieselRule2");
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
}
}
}
if (oilTypebyId.equals("天然气")) {
if (ljUserGrade.getGasolineDiscount().equals("无优惠")) {
}
if (oilTypebyId.equals("天然气")) {
if (ljUserGrade.getGasolineDiscount().equals("无优惠")) {
} else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) {
String gasolineRule = ljUserGrade.getNaturalGasRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
//升数
BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP);
BigDecimal bigDecimal2 = jsonObject.getBigDecimal("naturalGas3");
BigDecimal multiply = divide.multiply(bigDecimal2);
paymentActiveVO.setMemberFavorableAmount(multiply);
}
} else {
String gasolineRule = ljUserGrade.getGasolineRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
//升数
Integer gasolineRule3 = jsonObject.getInteger("naturalGas2");
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
} else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) {
String gasolineRule = ljUserGrade.getNaturalGasRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
//升数
BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP);
BigDecimal bigDecimal2 = jsonObject.getBigDecimal("naturalGas3");
BigDecimal multiply = divide.multiply(bigDecimal2);
paymentActiveVO.setMemberFavorableAmount(multiply);
}
} else {
String gasolineRule = ljUserGrade.getGasolineRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
//升数
Integer gasolineRule3 = jsonObject.getInteger("naturalGas2");
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
}
}
}
}

View File

@ -95,8 +95,10 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
*/
@Override
public LJStaff selectStaffByMobile(String mobile) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("mobile",mobile);
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
LJStaff staff = baseMapper.selectOne(queryWrapper);
return staff;
}

View File

@ -96,6 +96,18 @@ public class ChainStoreConfigServiceImpl extends ServiceImpl<ChainStoreConfigMap
LJStore store = storeService.selectStoreByStoreId(storeId);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("chain_store_id",store.getChainStoreId());
return baseMapper.selectOne(queryWrapper);
ChainStoreConfig chainStoreConfig = baseMapper.selectOne(queryWrapper);
if (ObjectUtil.isEmpty(chainStoreConfig)){
ChainStoreConfig chainStoreConfig1 = new ChainStoreConfig();
chainStoreConfig1.setChainStoreId(store.getChainStoreId());
chainStoreConfig1.setIsEnableLevel("no");
chainStoreConfig1.setIsMonthClear("clear_month");
chainStoreConfig1.setGasGrowthValue("1");
chainStoreConfig1.setDieselGrowthValue("1");
chainStoreConfig1.setNaturalGrowthValue("1");
baseMapper.insert(chainStoreConfig1);
}
chainStoreConfig = baseMapper.selectOne(queryWrapper);
return chainStoreConfig;
}
}

View File

@ -115,7 +115,7 @@ export default {
getList(){
this.loading = true
// this.queryParams.mtUserId = this.userId
this.queryParams.mtUserId = this.userId
getCardFavorableList(this.queryParams).then(res=>{
if (res.code == 200) {

View File

@ -1,6 +1,6 @@
<script>
export default {
onLaunch: function() {
onLaunch: function(e) {
console.log('App Launch')
// #ifdef MP-WEIXIN
uni.setStorageSync("appltType","WECHAT")

View File

@ -5,7 +5,7 @@ module.exports = {
// baseUrl: 'http://192.168.0.196:8081/',
// baseUrl: 'http://192.168.1.4:8080/',
baseUrl: 'http://192.168.0.178:8008/',
baseUrl: 'http://192.168.0.121:8080/',

View File

@ -9,8 +9,11 @@
<swiper class="swiper" style="width: 100%;height: 300px;" circular :indicator-dots="indicatorDots"
:autoplay="autoplay" :interval="interval" :duration="duration">
<swiper-item v-for="(item,index) in list1" :key="index" @click="goPage(item.routeUrl)">
<view class="swiper-item uni-bg-red"></view>
<image style="width: 100%;" :src="item.bannerUrl"></image>
<view class="swiper-item uni-bg-red">
<image style="width: 100%;" :src="item.bannerUrl"></image>
</view>
<!-- <image style="width: 100%;" :src="getBannerUrl(item.bannerUrl)"></image> -->
</swiper-item>
</swiper>
</view>
@ -114,7 +117,7 @@
<!-- <u-picker :show="show" :columns="columns" @confirm="confirm" @cancel="cancel"></u-picker> -->
<u-picker :columns="columns" @confirm="confirm" :show="show" @cancel="show = false"
keyName="label"></u-picker>
<u-overlay :show="shows">
<u-overlay :show="shows == true">
<image src="../../static/imgs/zzxryl.png"
style="width: 280px; height: 350px; margin: 20px auto; margin-top: 200px; ">
</image>
@ -238,6 +241,16 @@ import { callWithErrorHandling } from "vue"
tabbar
},
methods: {
//
getBannerUrl(url){
let imgurl = ""
if (url.includes("http")){
imgurl = url
}else {
imgurl = this.baseUrl + url
}
return imgurl;
},
// banner
goPage(url) {
uni.navigateTo({
@ -246,12 +259,21 @@ import { callWithErrorHandling } from "vue"
},
//
getIndexBanner() {
let _this = this
if (uni.getStorageSync("storeId")) {
request({
url: 'business/indexBanner/list/' + uni.getStorageSync("storeId"),
method: 'get',
}).then(res => {
this.list1 = res.data
_this.list1 = res.data
for (let i = 0;i<res.data.length;i++){
if (res.data[i].bannerUrl.includes("http")){
_this.list1[i].bannerUrl = res.data[i].bannerUrl
}else{
_this.list1[i].bannerUrl = _this.baseUrl + res.data[i].bannerUrl
}
}
console.log(_this.list1);
})
}
},
@ -434,6 +456,8 @@ import { callWithErrorHandling } from "vue"
_this.list3.push(_this.baseUrl + item)
})
}
_this.getIndexBanner()
})
// uni.showToast({
@ -526,7 +550,7 @@ import { callWithErrorHandling } from "vue"
address,
latitude,
longitude
}) => { //
}) => { //
// this.addressName = address;
console.log(name, address, latitude, longitude);
this.longitude = longitude;
@ -838,4 +862,4 @@ import { callWithErrorHandling } from "vue"
color: white;
margin: 0 auto;
}
</style>
</style>

View File

@ -8,7 +8,7 @@
<view class="top-box">
<view class="dis" style="width: 78%;">
<view class="top-img">
<image v-if="store.logo==''||store.logo==null||store.logo==undefined" src="../../static/logo.png" mode="aspectFit"></image>
<image v-if="!store.logo" src="../../static/logo.png" mode="aspectFit"></image>
<image v-else :src="baseUrl+store.logo" mode="aspectFit"></image>
</view>
<view style="width: 80%;">

View File

@ -14,7 +14,7 @@
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<!-- <button class="dl-box" open-type="getPhoneNumber" @getphonenumber="getUserLogin">手机号快捷登录</button> -->
<button open-type="getAuthorize" scope='phoneNumber' class="dl-box" hover-class="button-active"
<button open-type="getAuthorize" scope='phoneNumber' class="dl-box" hover-class="button-active"
@getAuthorize="getUserLogin">手机号快捷登录</button>
<!-- #endif -->
<button class="kk-box" @click="goback">我再看看</button>
@ -23,9 +23,9 @@
<view class="lanquanzi" v-if="qindex == true" @click="qindex =! qindex"><u-icon name="checkbox-mark"
color="#ffffff" size="14"></u-icon></view>
<text>请仔细阅读</text>
<text class="lan">用户协议</text>
<text class="lan" @click="gopv()">用户协议</text>
<text></text>
<text class="lan">隐私政策</text>
<text class="lan" @click="gopv()">隐私政策</text>
</view>
</view>
</view>
@ -48,6 +48,12 @@
},
components: {},
methods: {
gopv() {
uni.navigateTo({
url: '/pagesLogin/login/webview'
})
},
// userid
getUserLogin(e) {
// if (this.qindex == false) {
@ -61,7 +67,7 @@
console.log(e)
let _this = this;
my.getPhoneNumber({
scopes: 'auth_base',
success: res1 => {
@ -83,15 +89,16 @@
storeId: 0,
staffId: "",
phone: "18457621459",
encryptedData:encryptedData,
encryptedData: encryptedData,
},
}).then((resp) => {
console.log(resp)
if (resp.code == 200) {
uni.setStorageSync('App-Token', resp.data.token);
uni.setStorageSync('chainStoreId', resp.data.chainStoreId);
uni.setStorageSync('chainStoreId', resp.data
.chainStoreId);
uni.navigateTo({
url: '/pages/index/index'
})
@ -104,8 +111,8 @@
console.log('my.getAuthCode 调用失败', err)
}
});
},
fail: err => {
console.log('my.getAuthCode 调用失败', err)
@ -366,4 +373,4 @@
border: 1px solid #0078FF;
color: white;
}
</style>
</style>

View File

@ -60,7 +60,7 @@
<text>评价有礼</text>
</view>
</view>
<view v-else-if="item.orderStatus=='unpaid'" class="end-box" @click="goPayment()">
<view v-else-if="item.orderStatus=='unpaid'" class="end-box" @click="goPayment(item.orderNo)">
<view class="anniu">
<text>去支付</text>
</view>
@ -403,8 +403,10 @@
// this.getBalanceOrder()
}
},
goPayment(){
goPayment(orderNo){
uni.navigateTo({
url: '/pagesRefuel/orderDetail/index?orderNo=' + orderNo,
})
},
goComment() {
uni.navigateTo({

View File

@ -7,6 +7,7 @@
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
<!-- #ifdef MP-WEIXIN -->
<button class="box-hang" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<view class="">头像</view>
<view class="touxiang">
@ -14,6 +15,16 @@
<image class="touxiang" v-else src="@/static/imgs/myx.png" mode="aspectFit"></image>
</view>
</button>
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<button class="box-hang" @click="onChooseAvatar1">
<view class="">头像</view>
<view class="touxiang">
<image class="touxiang" v-if="user.avatar!='' && user.avatar!=null && user.avatar!=undefined" :src="baseUrl + user.avatar" mode="aspectFit"></image>
<image class="touxiang" v-else src="@/static/imgs/myx.png" mode="aspectFit"></image>
</view>
</button>
<!-- #endif -->
<view class="box-hang" @click="goEdit(0)">
<view class="">昵称</view>
<view class="dis">
@ -99,6 +110,30 @@
},
})
},
//
onChooseAvatar1(e){
let _this = this;
//使
uni.chooseImage({
sourceType: ['album', 'camera'],//
success: (res) => {
console.log('图片', res)
var tempFilePath = res.tempFilePaths;
var filePath = tempFilePath[0];
console.log(filePath);//
//api
//
upload({
url: '/clientApi/file/upload',
filePath: filePath,
}).then((res) => {
console.log('images', res.data.fileName);
_this.user.avatar = res.data.fileName
_this.editUser()
})
}
});
},
//
editUser(){
request({