# Conflicts:
#	gasStation-uni/config.js
#	gasStation-uni/pages/index/index.vue
This commit is contained in:
wangh 2024-01-05 14:30:27 +08:00
commit 0ffa106329
90 changed files with 3649 additions and 1059 deletions

View File

@ -42,6 +42,14 @@ export function getUserMobile(data) {
data: data
})
}
// 根据手机号查询会员详细
export function getUserPhone(data) {
return request({
url: '/business/userManager/user/phone' ,
method: 'post',
data: data
})
}
// 新增会员
export function addUser(data) {

View File

@ -49,7 +49,6 @@ Vue.prototype.addDateRange = addDateRange
Vue.prototype.getName = getName
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
// 全局组件挂载
Vue.component('DictTag', DictTag)
Vue.component('Pagination', Pagination)

View File

@ -35,6 +35,7 @@ export default {
created() {
// this.getHomeData();
this.getChartsData();
},
methods: {
//

View File

@ -38,18 +38,18 @@
/>
</el-select>
</el-form-item>
<el-form-item>
<el-date-picker
v-model="dateRange"
style="width: 240px"
size="medium"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<!-- <el-form-item>-->
<!-- <el-date-picker-->
<!-- v-model="dateRange"-->
<!-- style="width: 240px"-->
<!-- size="medium"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="daterange"-->
<!-- range-separator="-"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- ></el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQueryMember">搜索</el-button>
@ -73,18 +73,18 @@
/>
</el-select>
</el-form-item>
<el-form-item>
<el-date-picker
v-model="dateRange"
style="width: 240px"
size="medium"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<!-- <el-form-item>-->
<!-- <el-date-picker-->
<!-- v-model="dateRange"-->
<!-- style="width: 240px"-->
<!-- size="medium"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="daterange"-->
<!-- range-separator="-"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- ></el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>

View File

@ -2,11 +2,11 @@
<div class="app-container">
<el-card >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="来源油站" prop="storeIds">
<el-select v-model="queryParams.storeId" filterable clearable placeholder="来源油站" style="width: 100%;">
<el-option v-for="item in storeList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<!-- <el-form-item label="来源油站" prop="storeIds">-->
<!-- <el-select v-model="queryParams.storeId" filterable clearable placeholder="来源油站" style="width: 100%;">-->
<!-- <el-option v-for="item in storeList" :key="item.id" :label="item.name" :value="item.id"/>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="会员号" prop="userNo">
<el-input
v-model="queryParams.userNo"
@ -448,7 +448,7 @@ import {
delUser,
exportUsers,
getUser,
getUserMobile,
getUserMobile, getUserPhone,
listStatistic,
listUser, listUserStatistic,
updateUser
@ -732,8 +732,8 @@ export default {
this.getList();
});
} else {
getUserMobile({mobile:this.form.mobile}).then( response => {
if(response.data!=null){
getUserPhone({mobile:this.form.mobile}).then( response => {
if(response.data){
this.$modal.msgError("手机号已存在");
}else {
addUser(this.form).then(response => {

View File

@ -14,7 +14,7 @@
<div style="display: flex;margin-top: 20px">
<div class="left">
<div>
<img v-if="form.avatar" :src="form.avatar" style="width: 80px;height: 80px">
<img v-if="form.avatar" :src="baseUrl+form.avatar" style="width: 80px;height: 80px;border-radius: 50%">
<img v-else src="@/assets/images/avatar.png" style="width: 80px;height: 80px">
</div>
<el-button type="warning" plain round size="mini" style="margin: 10px" @click="bindIdCard">绑定实体卡</el-button><br>
@ -29,7 +29,7 @@
<span style="color: #00afff" @click="changeName">{{form.name ? form.name : "--"}}</span>
</el-descriptions-item>
<el-descriptions-item label="实体卡号">{{form.idcard ? form.idcard : "--"}}</el-descriptions-item>
<el-descriptions-item label="绑定信息">--</el-descriptions-item>
<!-- <el-descriptions-item label="绑定信息">&#45;&#45;</el-descriptions-item>-->
<el-descriptions-item label="会员状态">
<dict-tag :options="dict.type.zhzt" :value="form.status"/>
</el-descriptions-item>
@ -43,10 +43,10 @@
<el-descriptions-item label="会员等级">
{{ grade.name }}
</el-descriptions-item>
<el-descriptions-item label="储值优惠">--</el-descriptions-item>
<el-descriptions-item label="每日笔数">
<span style="color: #00afff" @click="configuration">跟随全局总配置</span>
</el-descriptions-item>
<!-- <el-descriptions-item label="储值优惠">&#45;&#45;</el-descriptions-item>-->
<!-- <el-descriptions-item label="每日笔数">-->
<!-- <span style="color: #00afff" @click="configuration">跟随全局总配置</span>-->
<!-- </el-descriptions-item>-->
<el-descriptions-item label="固定等级">
<span style="color: #00afff" @click="level">
{{form.fixingLevel ? fixingLevelinfo(fixingLevelList,form.fixingLevel) : "--"}}
@ -716,6 +716,7 @@ export default {
dicts: ['official','zhzt','zcrzdj','payment_type'],
data(){
return{
baseUrl:process.env.VUE_APP_BASE_API,
flag:null,
fixingLevelList:[],
//

View File

@ -166,18 +166,18 @@
<el-col :span="8">
<el-form-item label="角色组" prop="roleId">
<el-select v-model="form.roleId" placeholder="请选择角色">
<!-- <el-option-->
<!-- v-for="item in roleList"-->
<!-- :key="item.dutyId"-->
<!-- :label="item.dutyName"-->
<!-- :value="item.dutyId"-->
<!-- ></el-option>-->
<el-option
v-for="dict in dict.type.staff_role"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
v-for="item in roleList"
:key="item.dutyId"
:label="item.dutyName"
:value="item.dutyId"
></el-option>
<!-- <el-option-->
<!-- v-for="dict in dict.type.staff_role"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- <el-option value="普通员工">普通员工</el-option>-->
<!-- <el-option value="收银员">收银员</el-option>-->
</el-select>
@ -569,7 +569,7 @@
:title="title"
:visible.sync="dialogVisible"
style="margin-top: 100px"
width="20%">
width="23%">
<div style="text-align: center">
<img id="qrCodeImg" class="qrcode" :src="baseUrl+imgUrl" />
</div>
@ -987,8 +987,8 @@ export default {
margin-bottom: 20px;
}
.qrcode{
width: 200px;
height: 300px;
width: 80%;
margin: 0 auto;
margin-top: 15px;
}
</style>

View File

@ -29,7 +29,7 @@ export function addIndexBanner(data) {
// 修改首页轮播图信息
export function updateIndexBanner(data) {
return request({
url: '/business/indexBanner/lists',
url: '/business/indexBanner',
method: 'put',
data: data
})

View File

@ -0,0 +1,270 @@
<template>
<div class="component-upload-image">
<el-upload
multiple
:action="uploadImgUrl"
list-type="picture-card"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
:limit="limit"
:on-error="handleUploadError"
:on-exceed="handleExceed"
ref="imageUpload"
:on-remove="handleDelete"
:show-file-list="true"
:headers="headers"
:file-list="fileList"
:on-preview="handlePictureCardPreview"
:class="{hide: this.fileList.length >= this.limit}"
>
<!-- <div style="display: flex;height: 100%;">-->
<!-- <img v-if="doorList!=[]"-->
<!-- v-for="(item,index) in doorList"-->
<!-- :src="item"-->
<!-- style="display: block; max-width: 100%; margin: 0 auto;margin-right: 20px"-->
<!-- />-->
<!-- </div>-->
<!-- <div v-else>-->
<img
v-if="dialogImageUrl"
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto;height: 100%"
/>
<i v-else class="el-icon-plus"></i>
<!-- </div>-->
</el-upload>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip">
请上传
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
的文件
</div>
<!-- <el-dialog-->
<!-- :visible.sync="dialogVisible"-->
<!-- title="预览"-->
<!-- width="800"-->
<!-- append-to-body-->
<!-- >-->
<!-- <img-->
<!-- :src="dialogImageUrl"-->
<!-- style="display: block; max-width: 100%; margin: 0 auto"-->
<!-- />-->
<!-- </el-dialog>-->
</div>
</template>
<script>
import { getToken } from "@/utils/auth";
export default {
props: {
value: [String, Object, Array],
//
limit: {
type: Number,
default: 5,
},
// (MB)
fileSize: {
type: Number,
default: 5,
},
// , ['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["png", "jpg", "jpeg"],
},
//
isShowTip: {
type: Boolean,
default: true
},
imgUrl:"",
doorUrl:"",
},
data() {
return {
number: 0,
uploadList: [],
dialogImageUrl: "",
dialogVisible: false,
hideUpload: false,
baseUrl:process.env.VUE_APP_BASE_API,
uploadImgUrl: process.env.VUE_APP_BASE_API + "/backendApi/file/upload", //
headers: {
"Access-Token" : getToken(),
},
fileList: [],
doorList:[],
};
},
watch: {
value: {
handler(val) {
if (val) {
//
const list = Array.isArray(val) ? val : this.value.split(',');
//
this.fileList = list.map(item => {
if (typeof item === "string") {
item = { name: item, url: item };
}
return item;
});
} else {
this.fileList = [];
return [];
}
},
deep: true,
immediate: true
}
},
computed: {
//
showTip() {
return this.isShowTip && (this.fileType || this.fileSize);
},
},
created() {
// this.dialogImageUrl = this.baseUrl + this.imgUrl;
this.handlePictureCardPreview();
},
methods: {
// loading
handleBeforeUpload(file) {
let isImg = false;
if (this.fileType.length) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
isImg = this.fileType.some(type => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
} else {
isImg = file.type.indexOf("image") > -1;
}
if (!isImg) {
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
return false;
}
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
return false;
}
}
this.$modal.loading("正在上传图片,请稍候...");
this.number++;
},
//
handleExceed() {
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
},
//
handleUploadSuccess(res, file) {
if (res.code === 200) {
this.uploadList.push({ name: res.data.url, url: res.data.url });
this.uploadedSuccessfully();
} else {
this.number--;
this.$modal.closeLoading();
this.$modal.msgError(res.msg);
this.$refs.imageUpload.handleRemove(file);
this.uploadedSuccessfully();
}
},
//
handleDelete(file) {
const findex = this.fileList.map(f => f.name).indexOf(file.name);
if (findex > -1) {
this.fileList.splice(findex, 1);
this.$emit("input", this.listToString(this.fileList));
}
},
//
handleUploadError() {
this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading();
},
//
uploadedSuccessfully() {
if (this.number > 0 && this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList);
this.uploadList = [];
this.number = 0;
this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading();
}
},
//
handlePictureCardPreview(file) {
if (this.imgUrl){
if (this.imgUrl.includes("http")){
this.dialogImageUrl = this.imgUrl;
}else {
this.dialogImageUrl = this.baseUrl + this.imgUrl;
}
}else {
if (file!=undefined){
this.dialogImageUrl = file.url;
}else {
this.dialogImageUrl = ""
}
}
if (this.doorUrl != "" && this.doorUrl != undefined && this.doorUrl != []){
let list = JSON.parse(this.doorUrl)
list.forEach(item => {
let data = {name:"",url:""}
data.name = item.split("/")[item.split("/").length-1]
data.url = this.baseUrl + item
this.fileList.push(data)
// this.dialogImageUrl = this.baseUrl + item;
// this.doorList.push(this.baseUrl + item);
})
}else {
if (file!=undefined){
this.dialogImageUrl = file.url;
}
}
// this.dialogVisible = true;
},
//
listToString(list, separator) {
let strs = "";
separator = separator || ",";
for (let i in list) {
if (list[i].url) {
strs += list[i].url.replace(this.baseUrl, "") + separator;
}
}
return strs != '' ? strs.substr(0, strs.length - 1) : '';
}
}
};
</script>
<style scoped lang="scss">
// .el-upload--picture-card
::v-deep.hide .el-upload--picture-card {
display: none;
}
//
::v-deep .el-list-enter-active,
::v-deep .el-list-leave-active {
transition: all 0s;
}
::v-deep .el-list-enter, .el-list-leave-active {
opacity: 0;
transform: translateY(0);
}
</style>

View File

@ -2,19 +2,18 @@
<div>
<el-card class="card">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="店铺" prop="name">
<el-input
v-model="queryParams.realName"
placeholder="请输入姓名"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
/>
<el-form-item label="店铺" prop="storeId">
<el-select v-model="queryParams.storeId" placeholder="请选择店铺" style="width: 100%">
<el-option v-for="item in storeList"
:key="item.id" clearable
:label="item.name" :value="item.id"
@keyup.enter.native="handleQuery"></el-option>
</el-select>
</el-form-item>
<el-form-item label="路由" prop="mobile">
<el-form-item label="路由" prop="routeUrl">
<el-input
v-model="queryParams.mobile"
placeholder="请输入手机号"
v-model="queryParams.routeUrl"
placeholder="请输入路由地址"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
@ -44,7 +43,12 @@
<span>{{scope.row.storeId ? storeName(storeList,scope.row.storeId) : "--"}}</span>
</template>
</el-table-column>
<el-table-column label="轮播图" align="center" prop="bannerUrl" />
<el-table-column label="轮播图" align="center" prop="bannerUrl" >
<template slot-scope="scope">
<span v-if="!scope.row.bannerUrl">--</span>
<img class="imgBanner" v-else :src="getBannerUrl(scope.row.bannerUrl)">
</template>
</el-table-column>
<el-table-column label="路由地址" align="center" prop="routeUrl" />
<el-table-column label="备注" align="center" prop="remark" >
<template slot-scope="scope">
@ -57,7 +61,7 @@
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
@click="handleUpdate(scope.row.id)"
>修改</el-button>
<el-button
size="mini"
@ -79,12 +83,29 @@
</el-card>
<el-dialog
:title="title"
:title="title" width="35%"
:visible.sync="dialogVisible">
<span>这是一段信息</span>
<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-option v-for="item in storeList"
:key="item.id"
:label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="轮播图" prop="bannerUrl">
<imgUpload v-if="flag" :imgUrl="form.bannerUrl" :limit="1" @input="getImgUrl"></imgUpload>
</el-form-item>
<el-form-item label="路由地址" prop="routeUrl">
<el-input v-model="form.routeUrl" placeholder="请填写路由地址"></el-input>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.remark" type="textarea"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="dialogVisible = false"> </el-button>
<el-button @click="clear"> </el-button>
<el-button type="primary" @click="submitForm"> </el-button>
</span>
</el-dialog>
@ -92,10 +113,18 @@
</template>
<script>
import {listIndexBanner} from "@/api/indexBanner/indexBanner";
import {
addIndexBanner,
deleteIndexBanner,
indexBannerInfo,
listIndexBanner,
updateIndexBanner
} from "@/api/indexBanner/indexBanner";
import {ljStoreList} from "@/api/indexBanner/ljstore";
import imgUpload from "@/views/indexBanner/imgUpload/imgUpload.vue"
export default {
components: {imgUpload},
data(){
return{
queryParams:{
@ -108,6 +137,20 @@ export default {
title:'',
total:0,
storeList:[],
baseUrl:process.env.VUE_APP_BASE_API,
form:{},
flag: false,
rules:{
storeId: [
{ required: true, message: '请选择店铺', trigger: 'change' }
],
bannerUrl: [
{ required: true, message: '请插入活动图片', trigger: 'change' }
],
routeUrl: [
{ required: true, message: '请填写路由地址', trigger: 'change' }
],
},
}
},
created() {
@ -115,6 +158,22 @@ export default {
this.getStoreList()
},
methods:{
// url
getImgUrl(val){
let list = val.split("/static")
this.form.bannerUrl = "/static"+list[list.length-1]
},
//
getBannerUrl(url){
let imgurl = ""
if (url.includes("http")){
imgurl = url
}else {
imgurl = this.baseUrl + url
}
return imgurl;
},
//
storeName(list,id){
let name = ""
list.forEach(item => {
@ -135,7 +194,6 @@ export default {
//
getList(){
listIndexBanner(this.queryParams).then(res => {
console.log(res)
if (res.data){
this.list = res.data.records;
this.total = res.data.total;
@ -144,16 +202,69 @@ export default {
},
//
handleAdd(){
this.form = {}
this.title = "新增配置"
this.dialogVisible = true;
this.flag = true
},
//
handleUpdate(id){
indexBannerInfo(id).then(res => {
if (res.data){
this.form = res.data
this.title = "修改配置"
this.dialogVisible = true;
this.flag = true
}
})
},
//
handleDelete(id){
handleDelete(row){
const name = this.storeName(this.storeList,row.storeId) || this.id;
this.$modal.confirm('是否确认删除"' + name + '"的路由配置信息?').then(function() {
return deleteIndexBanner(row.id);
}).then(() => {
this.queryParams.page = 1
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
//
submitForm(){
this.$refs["form"].validate(valid => {
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.getList()
this.getStoreList()
}
})
}else {
addIndexBanner(this.form).then(res => {
console.log(res)
if (res.data==1){
this.$modal.msgSuccess("添加成功")
this.dialogVisible = false
this.flag = false
this.getList()
this.getStoreList()
}else {
this.$modal.msgError("当前店铺已存在跳转此页面的路由信息")
}
})
}
}
})
},
//
clear(){
this.dialogVisible = false
this.flag = false
},
//
handleQuery() {
@ -165,5 +276,8 @@ export default {
</script>
<style lang="scss" scoped>
.imgBanner{
width: 150px;
height: 100px;
}
</style>

View File

@ -131,7 +131,12 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
}
merchantConfig.setAppid(FuYouPublicMerchant.appid);
merchantConfig.setAlipayAppid(FuYouPublicMerchant.alipayAppid);
merchantConfig.setIsUse("0");
MerchantConfig merchantConfig1 = this.selectMeChByIdIsUse(nowAccountInfo.getStoreId());
if (ObjectUtil.isEmpty(merchantConfig1)){
merchantConfig.setIsUse("1");
}else {
merchantConfig.setIsUse("0");
}
merchantConfig.setIsOpenRule("0");
merchantConfig.setAmount(0.0);
row = baseMapper.insert(merchantConfig);

View File

@ -64,7 +64,7 @@ public class IndexBannerServiceImpl extends ServiceImpl<IndexBannerMapper, Index
@Override
public int updateIndexBanner(IndexBanner indexBanner) {
return 0;
return baseMapper.updateById(indexBanner);
}
@Override

View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
@ -17,6 +18,7 @@ import java.io.Serializable;
* @since 2023-11-10 10:44:58
*/
@SuppressWarnings("serial")
@Data
@TableName("active_consumption")
public class ActiveConsumption extends Model<ActiveConsumption> {
//主键id
@ -29,7 +31,7 @@ public class ActiveConsumption extends Model<ActiveConsumption> {
//活动名称
private String name;
//满足金额
private String participationConditionMoney;
private Double participationConditionMoney;
//活动开始时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date activeStartTime;
@ -74,215 +76,5 @@ public class ActiveConsumption extends Model<ActiveConsumption> {
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
public String getParticipationConditionMoney() {
return participationConditionMoney;
}
public void setParticipationConditionMoney(String participationConditionMoney) {
this.participationConditionMoney = participationConditionMoney;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getChainStorId() {
return chainStorId;
}
public void setChainStorId(Integer chainStorId) {
this.chainStorId = chainStorId;
}
public Integer getStoreId() {
return storeId;
}
public void setStoreId(Integer storeId) {
this.storeId = storeId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getActiveStartTime() {
return activeStartTime;
}
public void setActiveStartTime(Date activeStartTime) {
this.activeStartTime = activeStartTime;
}
public Date getActiveEndTime() {
return activeEndTime;
}
public void setActiveEndTime(Date activeEndTime) {
this.activeEndTime = activeEndTime;
}
public String getAdaptOil() {
return adaptOil;
}
public void setAdaptOil(String adaptOil) {
this.adaptOil = adaptOil;
}
public String getMember_type() {
return member_type;
}
public void setMember_type(String member_type) {
this.member_type = member_type;
}
public String getAdaptUserType() {
return adaptUserType;
}
public void setAdaptUserType(String adaptUserType) {
this.adaptUserType = adaptUserType;
}
public String getDieselUserLevel() {
return dieselUserLevel;
}
public void setDieselUserLevel(String dieselUserLevel) {
this.dieselUserLevel = dieselUserLevel;
}
public String getGasolineUserLevel() {
return gasolineUserLevel;
}
public void setGasolineUserLevel(String gasolineUserLevel) {
this.gasolineUserLevel = gasolineUserLevel;
}
public String getNaturalUserLevel() {
return naturalUserLevel;
}
public void setNaturalUserLevel(String naturalUserLevel) {
this.naturalUserLevel = naturalUserLevel;
}
public String getPaymentType() {
return paymentType;
}
public void setPaymentType(String paymentType) {
this.paymentType = paymentType;
}
public String getParticipationCondition() {
return participationCondition;
}
public void setParticipationCondition(String participationCondition) {
this.participationCondition = participationCondition;
}
public String getParticipationAcount() {
return participationAcount;
}
public void setParticipationAcount(String participationAcount) {
this.participationAcount = participationAcount;
}
public Integer getLimitAcount() {
return limitAcount;
}
public void setLimitAcount(Integer limitAcount) {
this.limitAcount = limitAcount;
}
public String getActiveGift() {
return activeGift;
}
public void setActiveGift(String activeGift) {
this.activeGift = activeGift;
}
public Integer getPoints() {
return points;
}
public void setPoints(Integer points) {
this.points = points;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getIsonline() {
return isonline;
}
public void setIsonline(String isonline) {
this.isonline = isonline;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.id;
}
}

View File

@ -0,0 +1,26 @@
package com.fuint.business.marketingActivity.activeDiscount.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class ActiveConsumptionVO implements Serializable {
//活动id
private Integer activeId;
//活动名称
private String activeName;
//适用会员
private String adaptUser;
//可用油品
private String oilId;
//积分
private Integer points;
//满足金额
private double amount;
//折扣
private String activeGift;
//券id
private Integer vouchersId;
}

View File

@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.activeDiscount.vo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class ActiveDiscountPayVO implements Serializable {
@ -11,9 +12,9 @@ public class ActiveDiscountPayVO implements Serializable {
//活动名称
private String activeName;
//满足金额
private double amount;
private BigDecimal amount;
//折扣
private double discount;
private BigDecimal discount;
//可用油品
private String oilId;
//适用会员

View File

@ -3,13 +3,14 @@ package com.fuint.business.marketingActivity.activeExchange.dto;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class PaymentActiveDTO implements Serializable {
//支付类型 0储值卡 1囤油卡 2现金
private String type;
//支付金额
private double amount;
private BigDecimal amount;
//可用油品Id
private Integer oilId;
//店铺id

View File

@ -11,6 +11,7 @@ import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount
import com.fuint.business.marketingActivity.activeDiscount.mapper.ActiveDiscountMapper;
import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscountChildService;
import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscountService;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveConsumptionVO;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountAppletVO;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountPayVO;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO;
@ -38,15 +39,24 @@ import com.fuint.business.marketingActivity.cardValue.vo.CardValueAppletVO;
import com.fuint.business.order.mapper.OilOrderMapper;
import com.fuint.business.petrolStationManagement.entity.OilName;
import com.fuint.business.petrolStationManagement.service.OilNameService;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.LJUser;
import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -79,9 +89,15 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
@Resource
private CardValueService cardValueService;
@Resource
private ActiveDiscountMapper activeDiscountMapper;
@Resource
private OilOrderMapper oilOrderMapper;
@Resource
private LJUserMapper ljUserMapper;
@Resource
private UserBalanceService userBalanceService;
@Resource
private ILJStoreService iljStoreService;
@Autowired
private LJUserService userService;
/**
* 分页查询所有
* @param
@ -394,19 +410,21 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
public PaymentActiveVO paymentActive(PaymentActiveDTO paymentActiveDTO) {
PaymentActiveVO paymentActiveVO = new PaymentActiveVO();
Integer storeId = paymentActiveDTO.getStoreId();
double amount = 0.0;
double fullAmount = 0.0;
BigDecimal amount = new BigDecimal(0.00);
BigDecimal fullAmount = new BigDecimal(0.00);
BigDecimal a = new BigDecimal(0.1);
BigDecimal b = new BigDecimal(10);
//折扣
List<ActiveDiscountPayVO> activeDiscountVOList = oilOrderMapper.selectActiveDiscount(storeId,paymentActiveDTO.getAmount());
if (CollectionUtils.isNotEmpty(activeDiscountVOList)){
for (ActiveDiscountPayVO activeDiscountPayVO : activeDiscountVOList) {
if (activeDiscountPayVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) &&
activeDiscountPayVO.getAdaptUser().contains(paymentActiveDTO.getMtUserLevel().toString())){
if (activeDiscountPayVO.getDiscount() * activeDiscountPayVO.getAmount() > amount){
amount = paymentActiveDTO.getAmount() - ((10-activeDiscountPayVO.getDiscount()) * activeDiscountPayVO.getAmount() * 0.1);
if (activeDiscountPayVO.getAmount().multiply(activeDiscountPayVO.getDiscount()).compareTo(amount) > 0){
amount = paymentActiveDTO.getAmount().subtract(((b.subtract(activeDiscountPayVO.getDiscount())).multiply(activeDiscountPayVO.getAmount()).multiply(a)));
paymentActiveVO.setActiveId(activeDiscountPayVO.getActiveId());
paymentActiveVO.setAmount(amount);
paymentActiveVO.setFavorableAmount((10-activeDiscountPayVO.getDiscount()) * activeDiscountPayVO.getAmount() * 0.1);
paymentActiveVO.setFavorableAmount((b.subtract(activeDiscountPayVO.getDiscount())).multiply(activeDiscountPayVO.getAmount()).multiply(a));
}
}
}
@ -418,18 +436,76 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
if (activeDiscountPayVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) &&
activeDiscountPayVO.getAdaptUser().contains(paymentActiveDTO.getMtUserLevel().toString())){
//如果满足条件
if (paymentActiveDTO.getAmount() >= activeDiscountPayVO.getAmount()){
fullAmount = paymentActiveDTO.getAmount() - activeDiscountPayVO.getDiscount();
if (amount > fullAmount){
amount = paymentActiveDTO.getAmount() - fullAmount;
if ((paymentActiveDTO.getAmount()).compareTo(activeDiscountPayVO.getAmount()) >= 0){
fullAmount = paymentActiveDTO.getAmount().subtract(activeDiscountPayVO.getDiscount());
if (amount.compareTo(fullAmount) > 0){
amount = paymentActiveDTO.getAmount().subtract(fullAmount);
paymentActiveVO.setActiveId(activeDiscountPayVO.getActiveId());
paymentActiveVO.setAmount(amount);
paymentActiveVO.setFavorableAmount(paymentActiveDTO.getAmount() - activeDiscountPayVO.getDiscount());
paymentActiveVO.setFavorableAmount(paymentActiveDTO.getAmount().subtract(activeDiscountPayVO.getDiscount()));
}
}
}
}
}
//消费有礼
List<ActiveConsumptionVO> activeConsumptionVOS = oilOrderMapper.selectActiveConsumption(storeId, paymentActiveDTO.getAmount());
//连锁店信息
LJUser ljUserVo = userService.queryUserByUserId(TokenUtil.getNowAccountInfo().getId());
String accountName = TokenUtil.getNowAccountInfo().getAccountName();
Integer storeId1 = paymentActiveDTO.getStoreId();
Integer chainStoreId = iljStoreService.selectStoreByStoreId(storeId1).getChainStoreId();
//用户余额
UserBalance userBalance = userBalanceService.selectUserBalance(TokenUtil.getNowAccountInfo().getId(),chainStoreId);
UserBalance userBalance1 = new UserBalance();
if (CollectionUtils.isNotEmpty(activeConsumptionVOS)){
for (ActiveConsumptionVO activeConsumptionVO : activeConsumptionVOS) {
if (activeConsumptionVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) &&
activeConsumptionVO.getAdaptUser().contains(paymentActiveDTO.getMtUserLevel().toString())){
//如果满足条件/给当前用户加积分
//用户 (新用户新建 老用户叠加)
if (ObjectUtils.isNotEmpty(userBalance)){
//积分
if (ObjectUtils.isNotEmpty(userBalance.getPoints()) && ObjectUtils.isNotEmpty(activeConsumptionVO.getPoints())){
userBalance.setPoints(userBalance.getPoints() + activeConsumptionVO.getPoints());
}
userBalanceService.updateUserBalance(userBalance);
}else {
userBalance1.setMtUserId(TokenUtil.getNowAccountInfo().getId());
userBalance1.setChainStoreId(chainStoreId);
//积分
if (ObjectUtils.isNotEmpty(activeConsumptionVO.getPoints())){
userBalance1.setPoints(activeConsumptionVO.getPoints());
}
userBalanceService.save(userBalance1);
}
//优惠券
if (activeConsumptionVO.getActiveGift().equals("1")){
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setCardFavorableId(activeConsumptionVO.getVouchersId());
cardFavorableRecord.setStoreId(storeId1);
cardFavorableRecord.setMtUserId(TokenUtil.getNowAccountInfo().getId());
cardFavorableRecord.setName(ljUserVo.getName());
cardFavorableRecord.setMobile(ljUserVo.getMobile());
cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("充值送券");
cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord);
//兑换券
}else if (activeConsumptionVO.getActiveGift().equals("2")){
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
cardExchangeRecord.setCardExchangeId(activeConsumptionVO.getVouchersId());
cardExchangeRecord.setStoreId(storeId1);
cardExchangeRecord.setMtUserId(ljUserVo.getId());
cardExchangeRecord.setName(ljUserVo.getName());
cardExchangeRecord.setMobile(ljUserVo.getMobile());
cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
cardExchangeRecord.setStatus("0");
cardExchangeRecord.setExchangeFrom("充值送券");
cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
}
}
}
}
return paymentActiveVO;
}
}

View File

@ -3,13 +3,14 @@ package com.fuint.business.marketingActivity.activeExchange.vo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class PaymentActiveVO implements Serializable {
//活动id
private Integer activeId;
//应付金额
private double amount;
private BigDecimal amount;
//优惠金额
private double favorableAmount;
private BigDecimal favorableAmount;
}

View File

@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.activeRecommend.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendRecordsDTO;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendRecords;
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendRecordsService;
import com.fuint.framework.web.BaseController;
@ -49,8 +50,8 @@ public class ActiveRecommendRecordsController extends BaseController {
* @return
*/
@GetMapping("selectAllAmount")
public ResponseObject selectAllAmount() {
return getSuccessResult(this.activeRecommendRecordsService.selectAllAmount());
public ResponseObject selectAllAmount(@Param("activeRecommendRecords") ActiveRecommendRecords activeRecommendRecords) {
return getSuccessResult(this.activeRecommendRecordsService.selectAllAmount(activeRecommendRecords));
}
/**
@ -66,12 +67,12 @@ public class ActiveRecommendRecordsController extends BaseController {
/**
* 新增邀请记录接口
* @param activeRecommendRecords 实体对象
* @param activeRecommendRecordsDTO 实体对象
* @return 新增结果
*/
@PostMapping
public ResponseObject insert(@RequestBody ActiveRecommendRecords activeRecommendRecords) {
return getSuccessResult(this.activeRecommendRecordsService.add(activeRecommendRecords));
public ResponseObject insert(@RequestBody ActiveRecommendRecordsDTO activeRecommendRecordsDTO) {
return getSuccessResult(this.activeRecommendRecordsService.add(activeRecommendRecordsDTO));
}
/**

View File

@ -0,0 +1,12 @@
package com.fuint.business.marketingActivity.activeRecommend.dto;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendRecords;
import lombok.Data;
import java.io.Serializable;
@Data
public class ActiveRecommendRecordsDTO extends ActiveRecommendRecords implements Serializable {
private Integer storeId;
private String type;
}

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
@ -16,6 +17,7 @@ import java.io.Serializable;
* @since 2023-11-13 15:09:50
*/
@SuppressWarnings("serial")
@Data
public class ActiveRecommend extends Model<ActiveRecommend> {
//主键id
@TableId(type = IdType.AUTO)
@ -58,167 +60,5 @@ public class ActiveRecommend extends Model<ActiveRecommend> {
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
public String getTitleUrl() {
return titleUrl;
}
public void setTitleUrl(String titleUrl) {
this.titleUrl = titleUrl;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getChainStoreId() {
return chainStoreId;
}
public void setChainStoreId(Integer chainStoreId) {
this.chainStoreId = chainStoreId;
}
public Integer getStoreId() {
return storeId;
}
public void setStoreId(Integer storeId) {
this.storeId = storeId;
}
public String getActivePictureUrl() {
return activePictureUrl;
}
public void setActivePictureUrl(String activePictureUrl) {
this.activePictureUrl = activePictureUrl;
}
public String getInviterGiftType() {
return inviterGiftType;
}
public void setInviterGiftType(String inviterGiftType) {
this.inviterGiftType = inviterGiftType;
}
public Integer getPoints() {
return points;
}
public void setPoints(Integer points) {
this.points = points;
}
public Integer getGrowthValue() {
return growthValue;
}
public void setGrowthValue(Integer growthValue) {
this.growthValue = growthValue;
}
public String getNewuserGiftType() {
return newuserGiftType;
}
public void setNewuserGiftType(String newuserGiftType) {
this.newuserGiftType = newuserGiftType;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getInvitationCodeType() {
return invitationCodeType;
}
public void setInvitationCodeType(String invitationCodeType) {
this.invitationCodeType = invitationCodeType;
}
public String getRewardDisplay() {
return rewardDisplay;
}
public void setRewardDisplay(String rewardDisplay) {
this.rewardDisplay = rewardDisplay;
}
public String getActiveRule() {
return activeRule;
}
public void setActiveRule(String activeRule) {
this.activeRule = activeRule;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getIsonline() {
return isonline;
}
public void setIsonline(String isonline) {
this.isonline = isonline;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.id;
}
}

View File

@ -28,7 +28,7 @@ public class ActiveRecommendRecords extends Model<ActiveRecommendRecords> {
private Integer chainStoreId;
//所属店铺id
private Integer storeId;
//用户id
//邀请人id
private String userId;
//被邀请人id
private String inviteeUserId;

View File

@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.activeRecommend.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendRecordsDTO;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendRecords;
/**
@ -25,13 +26,13 @@ public interface ActiveRecommendRecordsService extends IService<ActiveRecommendR
* 小程序端查询券总额
* @return
*/
double selectAllAmount();
double selectAllAmount(ActiveRecommendRecords activeRecommendRecords);
/**
* 新增邀请记录接口
* @param activeRecommendRecords
* @param activeRecommendRecordsDTO
* @return
*/
boolean add(ActiveRecommendRecords activeRecommendRecords);
boolean add(ActiveRecommendRecordsDTO activeRecommendRecordsDTO);
}

View File

@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendRecordsDTO;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommend;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild;
import com.fuint.business.marketingActivity.activeRecommend.mapper.ActiveRecommendRecordsMapper;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendRecords;
@ -12,11 +15,23 @@ import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecomm
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendService;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendRecordsVO;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.LJUser;
import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.mapper.UserBalanceMapper;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@ -35,6 +50,16 @@ public class ActiveRecommendRecordsServiceImpl extends ServiceImpl<ActiveRecomme
private ActiveRecommendService activeRecommendService;
@Resource
private CardFavorableService cardFavorableService;
@Resource
private LJUserService ljUserService;
@Resource
private UserBalanceService userBalanceService;
@Resource
private CardFavorableRecordService cardFavorableRecordService;
@Resource
private CardExchangeRecordService cardExchangeRecordService;
@Resource
private ILJStoreService iljStoreService;
/**
* 小程序端查询邀请记录
* @param page
@ -45,7 +70,7 @@ public class ActiveRecommendRecordsServiceImpl extends ServiceImpl<ActiveRecomme
public IPage select(Page page, ActiveRecommendRecords activeRecommendRecords) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = nowAccountInfo.getId();
Integer storeId = nowAccountInfo.getStoreId();
Integer storeId = activeRecommendRecords.getStoreId();
LambdaQueryWrapper<ActiveRecommendRecords> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveRecommendRecords::getUserId,userId);
queryWrapper.eq(ActiveRecommendRecords::getStoreId,storeId);
@ -83,12 +108,12 @@ public class ActiveRecommendRecordsServiceImpl extends ServiceImpl<ActiveRecomme
}
@Override
public double selectAllAmount() {
public double selectAllAmount(ActiveRecommendRecords activeRecommendRecords) {
//券总额
double discountAmount = 0.0;
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = nowAccountInfo.getId();
Integer storeId = nowAccountInfo.getStoreId();
Integer storeId = activeRecommendRecords.getStoreId();
LambdaQueryWrapper<ActiveRecommendRecords> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveRecommendRecords::getUserId,userId);
queryWrapper.eq(ActiveRecommendRecords::getStoreId,storeId);
@ -97,7 +122,9 @@ public class ActiveRecommendRecordsServiceImpl extends ServiceImpl<ActiveRecomme
//邀请人数
int size = list.size();
//推荐有礼活动
ActiveRecommendVO activeRecommendVO = activeRecommendService.getOneById(1);
ActiveConsumption activeConsumption = new ActiveConsumption();
activeConsumption.setStoreId(storeId);
ActiveRecommendVO activeRecommendVO = activeRecommendService.getOneByIdApplet(activeConsumption);
//活动所送推荐人的优惠券
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendVO.getActiveRecommendChildList();
if(CollectionUtils.isNotEmpty(activeRecommendChildList)){
@ -118,21 +145,83 @@ public class ActiveRecommendRecordsServiceImpl extends ServiceImpl<ActiveRecomme
/**
* 新增邀请记录接口
* @param activeRecommendRecords
* @param activeRecommendRecordsDTO
* @return
*/
@Override
public boolean add(ActiveRecommendRecords activeRecommendRecords) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = nowAccountInfo.getId();
Integer storeId = nowAccountInfo.getStoreId();
//邀请人id TODO
activeRecommendRecords.setUserId(userId.toString());
activeRecommendRecords.setStoreId(storeId);
//被邀请人id
activeRecommendRecords.setInviteeUserId(userId.toString());
activeRecommendRecords.setInviteeUserName(nowAccountInfo.getRealName());
return save(activeRecommendRecords);
@Transactional
public boolean add(ActiveRecommendRecordsDTO activeRecommendRecordsDTO) {
if (ObjectUtils.isNotEmpty(activeRecommendRecordsDTO) && activeRecommendRecordsDTO.getType().equals("yaoqingyouli")){
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = nowAccountInfo.getId();
ActiveRecommendRecords activeRecommendRecords = new ActiveRecommendRecords();
BeanUtils.copyProperties(activeRecommendRecordsDTO,activeRecommendRecords);
//邀请人
LJUser ljUser1 = ljUserService.queryUserByUserId(Integer.parseInt(activeRecommendRecordsDTO.getUserId()));
//被邀请人
LJUser ljUser = ljUserService.queryUserByUserId(userId);
ActiveConsumption activeConsumption = new ActiveConsumption();
activeConsumption.setStoreId(activeRecommendRecordsDTO.getStoreId());
ActiveRecommendVO activeRecommendVO = activeRecommendService.getOneByIdApplet(activeConsumption);
UserBalance userBalance = userBalanceService.selectUserBalance(Integer.parseInt(activeRecommendRecordsDTO.getUserId()),iljStoreService.selectStoreByStoreId(activeRecommendRecordsDTO.getStoreId()).getChainStoreId());
//积分
if (ObjectUtils.isNotEmpty(activeRecommendVO.getPoints())){
userBalance.setPoints(userBalance.getPoints() + activeRecommendVO.getPoints());
}
//成长值
if (ObjectUtils.isNotEmpty(activeRecommendVO.getGrowthValue())){
userBalance.setGrowthValue(userBalance.getGrowthValue() + activeRecommendVO.getGrowthValue());
}
//卡券
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendVO.getActiveRecommendChildList();
if(CollectionUtils.isNotEmpty(activeRecommendChildList)){
for (ActiveRecommendChild activeRecommendChild : activeRecommendChildList) {
//优惠券
if (activeRecommendChild.getGiftUserType().equals("0") && activeRecommendChild.getActiveGift().equals("1")){
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setCardFavorableId(activeRecommendChild.getVouchersId());
cardFavorableRecord.setStoreId(activeRecommendRecordsDTO.getStoreId());
cardFavorableRecord.setMtUserId(ljUser1.getId());
cardFavorableRecord.setName(ljUser1.getName());
cardFavorableRecord.setMobile(ljUser1.getMobile());
cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("邀请新人送券");
cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord);
}
//兑换券
if (activeRecommendChild.getGiftUserType().equals("0") && activeRecommendChild.getActiveGift().equals("2")){
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
cardExchangeRecord.setCardExchangeId(activeRecommendChild.getVouchersId());
cardExchangeRecord.setStoreId(activeRecommendRecordsDTO.getStoreId());
cardExchangeRecord.setMtUserId(ljUser1.getId());
cardExchangeRecord.setName(ljUser1.getName());
cardExchangeRecord.setMobile(ljUser1.getMobile());
cardExchangeRecord.setPhoto(ljUser1.getAvatar());
cardExchangeRecord.setStatus("0");
cardExchangeRecord.setExchangeFrom("邀请新人送券");
cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
}
//被邀请人优惠券
if (activeRecommendChild.getGiftUserType().equals("1") && activeRecommendChild.getActiveGift().equals("1")){
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setCardFavorableId(activeRecommendChild.getVouchersId());
cardFavorableRecord.setStoreId(activeRecommendRecordsDTO.getStoreId());
cardFavorableRecord.setMtUserId(ljUser.getId());
cardFavorableRecord.setName(ljUser.getName());
cardFavorableRecord.setMobile(ljUser.getMobile());
cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("新人送券");
cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord);
}
}
}
userBalanceService.updateById(userBalance);
//被邀请人
activeRecommendRecords.setInviteeUserId(userId.toString());
activeRecommendRecords.setInviteeUserName(ljUser.getName());
return save(activeRecommendRecords);
}
return false;
}
}

View File

@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.activeRecommend.vo;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@ -15,6 +16,7 @@ import java.util.List;
* @since 2023-11-13 15:09:50
*/
@SuppressWarnings("serial")
@Data
public class ActiveRecommendVO extends Model<ActiveRecommendVO> {
//主键id
private Integer id;
@ -58,175 +60,5 @@ public class ActiveRecommendVO extends Model<ActiveRecommendVO> {
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
public String getTitleUrl() {
return titleUrl;
}
public void setTitleUrl(String titleUrl) {
this.titleUrl = titleUrl;
}
public String[] getInviterGiftType() {
return inviterGiftType;
}
public void setInviterGiftType(String[] inviterGiftType) {
this.inviterGiftType = inviterGiftType;
}
public List<ActiveRecommendChild> getActiveRecommendChildList() {
return activeRecommendChildList;
}
public void setActiveRecommendChildList(List<ActiveRecommendChild> activeRecommendChildList) {
this.activeRecommendChildList = activeRecommendChildList;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getChainStoreId() {
return chainStoreId;
}
public void setChainStoreId(Integer chainStoreId) {
this.chainStoreId = chainStoreId;
}
public Integer getStoreId() {
return storeId;
}
public void setStoreId(Integer storeId) {
this.storeId = storeId;
}
public String getActivePictureUrl() {
return activePictureUrl;
}
public void setActivePictureUrl(String activePictureUrl) {
this.activePictureUrl = activePictureUrl;
}
public Integer getPoints() {
return points;
}
public void setPoints(Integer points) {
this.points = points;
}
public Integer getGrowthValue() {
return growthValue;
}
public void setGrowthValue(Integer growthValue) {
this.growthValue = growthValue;
}
public String getNewuserGiftType() {
return newuserGiftType;
}
public void setNewuserGiftType(String newuserGiftType) {
this.newuserGiftType = newuserGiftType;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getInvitationCodeType() {
return invitationCodeType;
}
public void setInvitationCodeType(String invitationCodeType) {
this.invitationCodeType = invitationCodeType;
}
public String getRewardDisplay() {
return rewardDisplay;
}
public void setRewardDisplay(String rewardDisplay) {
this.rewardDisplay = rewardDisplay;
}
public String getActiveRule() {
return activeRule;
}
public void setActiveRule(String activeRule) {
this.activeRule = activeRule;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getIsonline() {
return isonline;
}
public void setIsonline(String isonline) {
this.isonline = isonline;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.id;
}
}

View File

@ -177,10 +177,10 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
//订单金额
cardValueOrders.setAmount(cardValue.getRechargeBalance());
//支付金额
//cardValueOrders.setPayAmount(cardValue.getRechargeBalance() - cardValue.getGiftBalance() - cardFavorableValue);
cardValueOrders.setPayAmount(cardValue.getRechargeBalance() - cardValue.getGiftBalance() - cardFavorableValue);
}
//支付金额
cardValueOrders.setPayAmount(0.01);
//cardValueOrders.setPayAmount(0.01);
//优惠券id
if (ObjectUtils.isNotEmpty(cardValueRecordDTO.getCardFavorableId())){
cardValueOrders.setCardFavorableId(cardValueRecordDTO.getCardFavorableId());

View File

@ -1,5 +1,6 @@
package com.fuint.business.member.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.member.mapper.LJDutyMapper;
import com.fuint.business.member.service.ILJDutyService;
@ -16,7 +17,9 @@ public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, TDuty> implemen
*/
@Override
public List<TDuty> selectDutyList() {
return baseMapper.selectList(null);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("duty_type","4");
return baseMapper.selectList(queryWrapper);
}
/**

View File

@ -108,7 +108,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
@Override
public void deleteStaffByIds(Integer[] ids) {
for (int id : ids){
baseMapper.deleteById(id);
this.deleteStaffById(id);
}
}
@ -118,6 +118,8 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
*/
@Override
public void deleteStaffById(Integer id) {
LJStaff staff = this.selectStaffById(id);
accountService.deleteAccountByUserName(staff.getMobile());
baseMapper.deleteById(id);
}
@ -152,7 +154,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
account.setAccountName(staff.getMobile());
account.setAccountStatus(1);
account.setRealName(staff.getRealName());
account.setRoleIds("0");
account.setRoleIds(staff.getRoleId());
account.setStaffId(staff1.getId());
account.setCreateTime(new Date());
account.setUpdateTime(new Date());

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.largeSscreen.vo.OilOrderVO;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveConsumptionVO;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountPayVO;
import com.fuint.business.order.entity.OilOrder;
import com.fuint.business.order.vo.Excel.OilOrderExcel;
@ -11,6 +12,7 @@ import com.fuint.business.order.vo.OilOrderVo;
import com.fuint.business.petrolStationManagement.entity.OilNumber;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@ -81,7 +83,7 @@ public interface OilOrderMapper extends BaseMapper<OilOrder> {
* @param amount
* @return
*/
List<ActiveDiscountPayVO> selectActiveDiscount(@Param("storeId") Integer storeId, @Param("amount")double amount);
List<ActiveDiscountPayVO> selectActiveDiscount(@Param("storeId") Integer storeId, @Param("amount") BigDecimal amount);
/**
* 满减
@ -89,5 +91,13 @@ public interface OilOrderMapper extends BaseMapper<OilOrder> {
* @param amount
* @return
*/
List<ActiveDiscountPayVO> selectActiveFule(@Param("storeId") Integer storeId, @Param("amount")double amount);
List<ActiveDiscountPayVO> selectActiveFule(@Param("storeId") Integer storeId, @Param("amount")BigDecimal amount);
/**
* 消费有礼
* @param storeId
* @param amount
* @return
*/
List<ActiveConsumptionVO> selectActiveConsumption(@Param("storeId") Integer storeId, @Param("amount")BigDecimal amount);
}

View File

@ -371,4 +371,21 @@
and adc.amount &lt;= #{amount}
</select>
<select id="selectActiveConsumption" resultType="com.fuint.business.marketingActivity.activeDiscount.vo.ActiveConsumptionVO">
SELECT
ac.id activeId,
ac.NAME activeName,
ac.diesel_user_level adaptUser,
ac.adapt_oil oilId,
ac.points points,
ac.participation_condition_money amount,
acc.active_gift activeGift,
acc.vouchers_id vouchersId
FROM
active_consumption ac
LEFT JOIN active_consumption_child acc ON ac.id = acc.active_consumption_id
where ac.store_id = #{storeId}
and ac.participation_condition_money &lt;= #{amount}
</select>
</mapper>

View File

@ -743,8 +743,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
oilOrder.setTankId(tankId);
Map<String, Object> applet = null;
Map<String, Object> applet = new HashMap<>();
applet.put("success","");
if (!map.get("payAmount").equals("0")) {
// 调用支付接口
// 判断是否开启支付规则
@ -777,6 +777,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
oilOrder.setPayTime(new Date());
oilOrder.setOrderStatus("paid");
baseMapper.updateById(oilOrder);
applet.put("success","ok");
}
return applet;
}
@ -885,7 +886,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Integer dieselGrowthValue = null;
Integer naturalGrowthValue = null;
LJStore store = storeService.selectStoreByStoreId(storeId);
UserBalance balance = userBalanceService.selectUserBalanceByStorId(userid,storeId);
UserBalance balance = userBalanceService.selectUserBalance(userid,store.getChainStoreId());
int growth = balance.getGrowthValue();
balance.setRefuelMoney(refuelMoney);
// 查询会员等级列表信息
@ -944,15 +945,18 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// 根据用户id查询用户余额信息
LJStore store = storeService.selectStoreByStoreId(storeId);
UserBalance balance = userBalanceService.selectUserBalanceByStorId(userId,storeId);
// 修改余额信息
Double beforeBalance = balance.getCardBalance();
Double afterBalance = beforeBalance - amount;
balance.setCardBalance(afterBalance);
UserBalance balance = userBalanceService.selectUserBalance(userId,store.getChainStoreId());
if (ObjectUtil.isNotEmpty(balance)){
// 修改余额信息
Double beforeBalance = balance.getCardBalance();
Double afterBalance = beforeBalance - amount;
balance.setCardBalance(afterBalance);
// 修改加油次数
Integer consumeNum = balance.getConsumeNum();
balance.setConsumeNum(consumeNum+1);
userBalanceService.updateUserBalance(balance);
Integer consumeNum = balance.getConsumeNum();
balance.setConsumeNum(consumeNum+1);
userBalanceService.updateUserBalance(balance);
}
// 添加余额记录信息
CardBalanceChange cardBalanceChange = new CardBalanceChange();
cardBalanceChange.setUserId(userId);

View File

@ -57,7 +57,7 @@ public class ExportController extends BaseController{
if (list.size() >= 1) {
for (int i = 0; i < list.size(); i++) {
LJUserVo user = (LJUserVo) list.get(i);
LJUser user1 = service.selectUserByMobile(user.getMobile());
LJUserVo user1 = service.selectUserByMobileAndChantStoreId(user.getMobile());
if (user1!=null){
repeat += 1;
}else {

View File

@ -113,6 +113,17 @@ public class LJUserController extends BaseController {
return getSuccessResult(user);
}
/**
* 根据storeId查询会员信息
* @param storeId
* @return
*/
@GetMapping("/storeUser/{storeId}")
public ResponseObject userVoInfo(@PathVariable Integer storeId){
LJUserVo user = userService.queryUserByStoreId(storeId);
return getSuccessResult(user);
}
@GetMapping("/getByUniApp")
public ResponseObject getByUniApp(Integer chainStoreId){
LJUserVo user = userService.getByUniApp(chainStoreId);
@ -128,6 +139,18 @@ public class LJUserController extends BaseController {
return getSuccessResult(userBalanceService.getUserBalance());
}
/**
* 根据手机号查询会员信息
* @param map
* @return
*/
@PostMapping("/phone")
public ResponseObject userInfoByPhone(@Validated @RequestBody Map<String ,String > map){
String mobile = map.get("mobile");
LJUserVo user = userService.selectUserByMobileAndChantStoreId(mobile);
return getSuccessResult(user);
}
/**
* 根据手机号查询会员信息
* @param map

View File

@ -6,16 +6,19 @@ import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;
/**
* 会员等级信息 controller层
*/
@RestController
@Slf4j
@RequestMapping("/business/userManager/userGrade")
public class LJUserGradeController extends BaseController {
@Autowired
@ -72,13 +75,21 @@ public class LJUserGradeController extends BaseController {
/**
* 根据id查询会员等级信息
* @param id
* @param map
* @return
*/
@GetMapping("/isUse/{id}")
public ResponseObject userGrade(@PathVariable Integer id){
LJUserGrade userGrade = userGradeService.selectUserGradeByIdIsUse(id);
return getSuccessResult(userGrade);
@PostMapping("/isUse")
public ResponseObject userGrade(@RequestBody Map<String,String> map){
Map<String, Object> map1 =new HashMap<>();
try {
Integer userId = Integer.valueOf(map.get("userId"));
String storeId = map.get("storeId");
String gradeId = map.get("gradeId");
map1 = userGradeService.selectUserGradeByIdIsUse(userId, storeId, gradeId);
}catch (Exception e){
log.error(e.getMessage());
}
return getSuccessResult(map1);
}
/**

View File

@ -28,6 +28,13 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
*/
public List<LJUserVo> queryUserList(@Param("storeId") int storeId);
/**
* 根据手机号和连锁店id查询会员信息
* @param mobile
* @return
*/
public LJUserVo selectUserByMobileAndChantStoreId(@Param("mobile") String mobile,@Param("chainStoreId") int chainStoreId);
/**
* 根据id查询用户信息
* @param id
@ -35,6 +42,13 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
*/
public LJUserVo selectUserById(@Param("id") Integer id);
/**
* 根据连锁店id查询用户信息
* @param chainStoreId
* @return
*/
public LJUserVo queryUserByChainStoreId(@Param("userId") int userId,@Param("chainStoreId") int chainStoreId);
/**
* uniapp使用
* @param id

View File

@ -4,22 +4,25 @@
<sql id="selectUser">
select mu.*,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money,
mub.second_card,mub.fixing_level,
mi.storeId,mi.staffId,mi.inviterId,mi.chain_store_id from mt_user mu
left join mt_user_balance mub on mu.id = mub.mt_user_id
left join mt_invitation mi on mu.id = mi.userId
mi.storeId,mi.staffId,mi.inviterId,mub.chain_store_id from mt_user mu
inner join mt_user_balance mub on mu.id = mub.mt_user_id
inner join mt_invitation mi on mu.id = mi.userId
</sql>
<sql id="selectUserAndBalance">
select mu.*,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money,
mub.second_card,mub.fixing_level
FROM mt_user mu
LEFT JOIN mt_user_balance mub ON mu.id = mub.mt_user_id
</sql>
<select id="selectUserList" resultType="com.fuint.business.userManager.vo.LJUserVo">
<include refid="selectUser"></include>
<include refid="selectUserAndBalance"></include>
<where>
<if test="user.chainStoreId != null and user.chainStoreId != ''">
and mi.chain_store_id = #{user.chainStoreId}
and mub.chain_store_id = #{user.chainStoreId}
</if>
<if test="user.storeId != null and user.storeId != ''">
and mi.storeId = #{user.storeId}
</if>
<if test="user.storeId == 0">
and mi.storeId = #{user.storeId}
and mub.store_id = #{user.storeId}
</if>
<if test="user.mobile != null and user.mobile != ''">
and mu.mobile like concat('%', #{user.mobile}, '%')
@ -57,7 +60,7 @@
<!-- 根据手机号查询会员信息-->
<select id="selectUserByMobile" resultType="com.fuint.business.userManager.vo.LJUserVo"
parameterType="java.lang.String">
<include refid="selectUser"></include>
<include refid="selectUserAndBalance"></include>
<where>
mu.mobile = #{mobile}
</where>
@ -70,6 +73,24 @@
</where>
</select>
<select id="selectUserByMobileAndChantStoreId" resultType="com.fuint.business.userManager.vo.LJUserVo">
select mu.*,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money,
mub.second_card,mub.fixing_level,mub.chain_store_id from mt_user mu
inner join mt_user_balance mub on mu.id = mub.mt_user_id
<where>
mu.mobile = #{mobile} and
mub.chain_store_id = #{chainStoreId}
</where>
</select>
<select id="queryUserByChainStoreId" resultType="com.fuint.business.userManager.vo.LJUserVo">
<include refid="selectUserAndBalance"></include>
<where>
mu.id = #{userId} and
mub.chain_store_id = #{chainStoreId}
</where>
</select>
<select id="selectAllInfoById" resultType="com.fuint.business.userManager.vo.LJUserVo">
select mu.*,
mub.id balanceId,

View File

@ -24,12 +24,20 @@ public interface CertifiedMemberService extends IService<CertifiedMember> {
public CertifiedMember selectCertifiedMemberById(int id);
/**
* 根据会员id查询认证会员信息
* 根据会员id和店铺id查询认证会员信息
* @param userId
* @return
*/
public CertifiedMember selectCertifiedMemberByUserId(int userId);
/**
* 根据会员id和店铺id查询认证会员信息
* @param userId
* @param storeId
* @return
*/
public CertifiedMember selectCertifiedMemberByUserIdAndStoreId(int userId,String storeId);
/**
* 根据固定等级id删除认证会员信息
* @param fixingLevelId

View File

@ -7,6 +7,7 @@ import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.repository.model.MtUserGrade;
import java.util.List;
import java.util.Map;
/**
* 会员等级信息 业务层
@ -47,10 +48,12 @@ public interface LJUserGradeService extends IService<LJUserGrade> {
/**
* 根据id查询会员等级信息是否可使用
* @param id
* @param userId
* @param storeId
* @param gradeId
* @return
*/
public LJUserGrade selectUserGradeByIdIsUse(int id);
public Map<String,Object> selectUserGradeByIdIsUse(Integer userId, String storeId, String gradeId);
/**
* 根据会员等级名称查询会员等级信息

View File

@ -28,6 +28,12 @@ public interface LJUserService extends IService<LJUser> {
*/
LJUser selectUserByUserId();
/**
* 根据id查询用户信息
* @return
*/
LJUser queryUserByUserId(int userId);
/**
*
* @return
@ -53,6 +59,20 @@ public interface LJUserService extends IService<LJUser> {
*/
public LJUserVo selectUserById(int id);
/**
* 根据storeId获取连锁店id 根据连锁店id查询用户信息
* @param storeId
* @return
*/
public LJUserVo queryUserByStoreId(int storeId);
/**
* 根据手机号和连锁店id查询会员信息
* @param mobile
* @return
*/
public LJUserVo selectUserByMobileAndChantStoreId(String mobile);
public LJUserVo getByUniApp(Integer chainStoreId);

View File

@ -1,5 +1,6 @@
package com.fuint.business.userManager.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -10,6 +11,7 @@ import com.fuint.business.userManager.entity.LJUser;
import com.fuint.business.userManager.mapper.CertifiedMemberMapper;
import com.fuint.business.userManager.service.CertifiedMemberService;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
@ -57,14 +59,30 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
}
/**
* 根据会员id查询认证会员信息
* 根据会员id和店铺id查询认证会员信息
* @param userId
* @return
*/
@Override
public CertifiedMember selectCertifiedMemberByUserId(int userId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id",userId);
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
CertifiedMember certifiedMember = baseMapper.selectOne(queryWrapper);
return certifiedMember;
}
@Override
public CertifiedMember selectCertifiedMemberByUserIdAndStoreId(int userId, String storeId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id",userId);
if (StringUtils.isNotEmpty(storeId)){
queryWrapper.eq("store_id",storeId);
}else {
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
}
CertifiedMember certifiedMember = baseMapper.selectOne(queryWrapper);
return certifiedMember;
}
@ -113,8 +131,8 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
if (certifiedMember.getMobile()==null || certifiedMember.getMobile().equals("")){
return 2;
}
LJUser user = userService.selectUserByMobile(certifiedMember.getMobile());
if (user==null){
LJUserVo user = userService.selectUserByMobileAndChantStoreId(certifiedMember.getMobile());
if (ObjectUtil.isEmpty(user)){
return 3;
}
QueryWrapper queryWrapper = new QueryWrapper<>();

View File

@ -1,5 +1,6 @@
package com.fuint.business.userManager.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -9,10 +10,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.CertifiedMember;
import com.fuint.business.userManager.entity.ChainStoreConfig;
import com.fuint.business.userManager.entity.FixingLevel;
import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.mapper.LJUserGradeMapper;
import com.fuint.business.userManager.service.CertifiedMemberService;
import com.fuint.business.userManager.service.ChainStoreConfigService;
import com.fuint.business.userManager.service.FixingLevelService;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
@ -20,9 +25,12 @@ import com.fuint.common.util.TokenUtil;
import com.fuint.repository.model.MtUserGrade;
import com.fuint.system.config.service.SysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUserGrade> implements LJUserGradeService {
@ -79,21 +87,40 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
private ILJStoreService storeService;
@Autowired
private ChainStoreConfigService chainStoreConfigService;
@Autowired
@Lazy
private CertifiedMemberService certifiedMemberService;
@Autowired
@Lazy
private FixingLevelService fixingLevelService;
@Override
public LJUserGrade selectUserGradeByIdIsUse(int id) {
LJStore store = storeService.selectStoreById();
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId());
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
if (isEnableLevel.equals("yes")){
LJUserGrade ljUserGrade = baseMapper.selectById(id);
if (ljUserGrade.getStatus().equals("qy")){
return baseMapper.selectById(id);
}else {
return null;
public Map<String,Object> selectUserGradeByIdIsUse(Integer userId, String storeId, String gradeId) {
Map<String,Object> res = new HashMap<>();
// 查询此会员是否认证固定等级信息
CertifiedMember certifiedMember = certifiedMemberService.selectCertifiedMemberByUserIdAndStoreId(userId, storeId);
if (ObjectUtil.isNotEmpty(certifiedMember)){
FixingLevel fixingLevel = fixingLevelService.selectFixingLevelById(certifiedMember.getFixingLevelId());
if (fixingLevel.getStatus().equals("qy")){
res.put("fixingLevel",fixingLevel);
}
}else {
LJStore store = storeService.selectStoreById();
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId());
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
if (isEnableLevel.equals("yes")){
if (StringUtils.isNotEmpty(gradeId)){
LJUserGrade ljUserGrade = baseMapper.selectById(Integer.valueOf(gradeId));
if (ljUserGrade.getStatus().equals("qy")){
res.put("userGrade",baseMapper.selectById(Integer.valueOf(gradeId)));
return res;
}else {
return null;
}
}
}
}
return null;
return res;
}
@Override

View File

@ -69,6 +69,11 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
return baseMapper.selectById(nowAccountInfo.getId());
}
@Override
public LJUser queryUserByUserId(int userId) {
return baseMapper.selectById(userId);
}
@Override
public LJUser queryUserByUserId() {
return null;
@ -130,6 +135,24 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
return baseMapper.selectUserById(id);
}
@Override
public LJUserVo queryUserByStoreId(int storeId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJStore store = storeService.selectStoreByStoreId(storeId);
return baseMapper.queryUserByChainStoreId(nowAccountInfo.getId(),store.getChainStoreId());
}
@Override
public LJUserVo selectUserByMobileAndChantStoreId(String mobile) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
LJUserVo ljUserVo = new LJUserVo();
if (ObjectUtil.isNotEmpty(store)){
ljUserVo = baseMapper.selectUserByMobileAndChantStoreId(mobile,store.getChainStoreId());
}
return ljUserVo;
}
@Resource
UserBalanceService userBalanceService;
@ -249,16 +272,24 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
user1.setStatus(user.getStatus());
user1.setDescription(user.getDescription());
user1.setOfficial(user.getOfficial());
int row = baseMapper.insert(user1);
// 查询添加后的用户id
// 查询添加后的用户id
LJUser ljUser = this.selectUserByMobile(user.getMobile());
int row = 0;
if (ObjectUtil.isEmpty(ljUser)){
row = baseMapper.insert(user1);
ljUser = this.selectUserByMobile(user.getMobile());
}
// 根据店铺id查询店铺所对应的连锁店id
LJStore store = storeService.selectStoreByStoreId(storeId);
// 添加用户储值卡信息
UserBalance balance = new UserBalance();
balance.setMtUserId(ljUser.getId());
balance.setCardBalance(user.getCardBalance());
balance.setPoints(user.getPoints());
balance.setStoreId(storeId);
balance.setChainStoreId(store.getChainStoreId());
if (user.getGradeId()!=null){
balance.setGradeId(user.getGradeId());
}else {
@ -270,17 +301,15 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
balance.setFixingLevel(user.getFixingLevel());
balanceService.insertUserBalance(balance);
Integer chainStoreId = null;
// 根据店铺id查询店铺所对应的连锁店id
LJStore store = storeService.selectStoreByStoreId(storeId);
if (!ObjectUtil.isEmpty(store)){
chainStoreId = store.getChainStoreId();
}
// 添加邀请注册信息
MtInvitation invitation = new MtInvitation();
if (ObjectUtil.isNotEmpty(store)){
chainStoreId = store.getChainStoreId();
invitation.setChainStoreId(chainStoreId);
}
invitation.setUserId(ljUser.getId());
invitation.setStoreId(storeId);
invitation.setStaffId(nowAccountInfo.getStaffId());
invitation.setChainStoreId(chainStoreId);
invitation.setStatus("qy");
invitationMapper.insert(invitation);
return row;

View File

@ -61,6 +61,12 @@ public interface AccountService extends IService<TAccount> {
*/
TAccount selectAccountByUserName(String accountName);
/**
* 根据用户名删除账户信息
* @param accountName
*/
void deleteAccountByUserName(String accountName);
/**
* 获取账号角色ID
*

View File

@ -208,6 +208,7 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
account.setStoreId(tAccount.getStoreId());
account.setDeptId(tAccount.getDeptId());
account.setPassword(tAccount.getPassword());
account.setStaffId(tAccount.getStaffId());
this.entryptPassword(account);
int id = tAccountMapper.insert(account);
@ -234,6 +235,14 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
return baseMapper.selectOne(queryWrapper);
}
@Override
public void deleteAccountByUserName(String accountName) {
TAccount tAccount = this.selectAccountByUserName(accountName);
if (ObjectUtil.isNotEmpty(tAccount)){
baseMapper.deleteById(tAccount.getAcctId());
}
}
/**
* 获取账号角色ID
*

View File

@ -1,8 +1,8 @@
# \u57FA\u672C\u914D\u7F6E
server.port=8008
server.port=8080
env.profile=dev
#env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
env.properties.path=D:/code/oilSystem/fuintBackend/configure/
env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/

View File

@ -26,6 +26,15 @@ export function getUserVoMobile(data) {
})
}
// 根据手机号查询会员详细
export function getUserInfoMobile(data) {
return request({
url: '/business/userManager/user/phone',
method: 'post',
data: data
})
}
// 根据手机号查询会员详细
export function getUserVoName(data) {
return request({

View File

@ -18,10 +18,11 @@ export function getUserGrade(id) {
}
// 查询会员等级详细是否能使用
export function userGradeInfo(id) {
export function userGradeInfo(data) {
return request({
url: '/business/userManager/userGrade/isUse/' + id,
method: 'get'
url: '/business/userManager/userGrade/isUse',
method: 'post',
data:data,
})
}

View File

@ -786,7 +786,7 @@
import {getDicts} from "@/api/dict/data";
import {getOilNameList, getOilNumGun, listOilNumGun} from "@/api/cashier/oilnumgun";
import {listgoods} from "@/api/cashier/ljgoods";
import {getUserVoMobile, getUserVoName} from "@/api/cashier/user";
import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/user";
import {queryStaffs, staffInfo} from "@/api/cashier/staff";
import {addLJGoods, goodsOrder, oilOrder, scanAppletQrCode} from "@/api/cashier/oilorder";
import {getUserGrade, listUserGrade, userGradeInfo} from "@/api/cashier/usergrade";
@ -1451,228 +1451,456 @@
this.handleChange();
},
//
getGrade(id){
getGrade(userId,gradeId){
let _this = this;
this.oilDiscount = 0;
this.gradeDiscount = [];
userGradeInfo(id).then(response => {
userGradeInfo({userId:userId,gradeId:gradeId,storeId:""}).then(response => {
let gasolineDiscount = 0;
let dieselDiscount = 0;
let naturalGasDiscount = 0;
_this.gradeDiscount = [];
if (response.data!=null) {
if (response.data) {
_this.oilOrder.forEach(item => {
let discount = {type: "", full: 0, reduce: 0, liters: 0}
if (item.type == "汽油") {
let gasolineRule = JSON.parse(response.data.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
if (response.data.gasolineDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= gasolineRule.length; i++) {
//
if (gasolineRule.length > 1) {
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
break;
}
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = gasolineRule[i - 1].gasolineRule2
discount.reduce = gasolineRule[i - 1].gasolineRule2
}
} else {
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = gasolineRule[i - 1].gasolineRule2
discount.reduce = gasolineRule[i - 1].gasolineRule2
if (response.data.fixingLevel){
let gasolineRule = JSON.parse(response.data.fixingLevel.gasolineRule).sort((a, b) => a.gasolineRule1 - b.gasolineRule1);
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
if (response.data.fixingLevel.gasolineDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= gasolineRule.length; i++) {
//
if (gasolineRule.length > 1) {
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
break;
}
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = gasolineRule[i - 1].gasolineRule2
discount.reduce = gasolineRule[i - 1].gasolineRule2
}
} else {
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = gasolineRule[i - 1].gasolineRule2
discount.reduce = gasolineRule[i - 1].gasolineRule2
}
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
gasolineDiscount += +oilDiscount
} else if (response.data.gasolineDiscount == "每升优惠") {
discount.type = "每升优惠"
let oilDiscount = 0;
for (let i = 1; i <= gasolineRule.length; i++) {
//
if (gasolineRule.length > 1) {
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
discount.liters = gasolineRule[i - 1].gasolineRule3
break;
}
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.liters = gasolineRule[i - 1].gasolineRule3
}
} else {
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.liters = gasolineRule[i - 1].gasolineRule3
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
gasolineDiscount += +oilDiscount
} else if (response.data.fixingLevel.gasolineDiscount == "每升优惠") {
discount.type = "每升优惠"
let oilDiscount = 0;
for (let i = 1; i <= gasolineRule.length; i++) {
//
if (gasolineRule.length > 1) {
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
discount.liters = gasolineRule[i - 1].gasolineRule3
break;
}
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.liters = gasolineRule[i - 1].gasolineRule3
}
} else {
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.liters = gasolineRule[i - 1].gasolineRule3
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每升优惠')
}
gasolineDiscount += +oilDiscount
} else {
gasolineDiscount = 0;
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每升优惠')
}
}else {
if (response.data.userGrade) {
let gasolineRule = JSON.parse(response.data.userGrade.gasolineRule).sort((a, b) => a.gasolineRule1 - b.gasolineRule1);
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
if (response.data.userGrade.gasolineDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= gasolineRule.length; i++) {
//
if (gasolineRule.length > 1) {
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
break;
}
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = gasolineRule[i - 1].gasolineRule2
discount.reduce = gasolineRule[i - 1].gasolineRule2
}
} else {
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = gasolineRule[i - 1].gasolineRule2
discount.reduce = gasolineRule[i - 1].gasolineRule2
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
gasolineDiscount += +oilDiscount
} else if (response.data.userGrade.gasolineDiscount == "每升优惠") {
discount.type = "每升优惠"
let oilDiscount = 0;
for (let i = 1; i <= gasolineRule.length; i++) {
//
if (gasolineRule.length > 1) {
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
discount.liters = gasolineRule[i - 1].gasolineRule3
break;
}
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.liters = gasolineRule[i - 1].gasolineRule3
}
} else {
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.liters = gasolineRule[i - 1].gasolineRule3
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每升优惠')
}
gasolineDiscount += +oilDiscount
} else {
gasolineDiscount = 0;
}
}
gasolineDiscount += +oilDiscount
} else {
gasolineDiscount = 0;
}
}
}
if (item.type == "柴油") {
let dieselRule = JSON.parse(response.data.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
if (response.data.dieselDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= dieselRule.length; i++) {
//
if (dieselRule.length > 1) {
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
break;
}
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
if (response.data.fixingLevel){
let dieselRule = JSON.parse(response.data.fixingLevel.dieselRule).sort((a, b) => a.dieselRule1 - b.dieselRule1);
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
if (response.data.fixingLevel.dieselDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= dieselRule.length; i++) {
//
if (dieselRule.length > 1) {
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
break;
}
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
discount.full = dieselRule[i - 1].dieselRule1
oilDiscount = dieselRule[i - 1].dieselRule2
discount.reduce = dieselRule[i - 1].dieselRule2
}
} else {
discount.full = dieselRule[i - 1].dieselRule1
oilDiscount = dieselRule[i - 1].dieselRule2
discount.reduce = dieselRule[i - 1].dieselRule2
}
} else {
discount.full = dieselRule[i - 1].dieselRule1
if (item.amount >= dieselRule[i - 1].dieselRule1) {
oilDiscount = dieselRule[i - 1].dieselRule2
discount.reduce = dieselRule[i - 1].dieselRule2
if (item.amount >= dieselRule[i - 1].dieselRule1) {
oilDiscount = dieselRule[i - 1].dieselRule2
discount.reduce = dieselRule[i - 1].dieselRule2
}
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
dieselDiscount += +oilDiscount
} else if (response.data.dieselDiscount == "每升优惠") {
let oilDiscount = 0;
for (let i = 1; i <= dieselRule.length; i++) {
discount.type = "每升优惠"
//
if (dieselRule.length > 1) {
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
break;
}
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
dieselDiscount += +oilDiscount
} else if (response.data.fixingLevel.dieselDiscount == "每升优惠") {
let oilDiscount = 0;
for (let i = 1; i <= dieselRule.length; i++) {
discount.type = "每升优惠"
//
if (dieselRule.length > 1) {
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
break;
}
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
discount.full = dieselRule[i - 1].dieselRule1
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.liters = dieselRule[i - 1].dieselRule3
}
} else {
discount.full = dieselRule[i - 1].dieselRule1
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.liters = dieselRule[i - 1].dieselRule3
}
} else {
discount.full = dieselRule[i - 1].dieselRule1
if (item.amount >= dieselRule[i - 1].dieselRule1) {
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.liters = dieselRule[i - 1].dieselRule3
if (item.amount >= dieselRule[i - 1].dieselRule1) {
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.liters = dieselRule[i - 1].dieselRule3
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每升优惠')
}
dieselDiscount += +oilDiscount
} else {
dieselDiscount = 0;
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每升优惠')
}
}else {
if (response.data.userGrade) {
let dieselRule = JSON.parse(response.data.userGrade.dieselRule).sort((a, b) => a.dieselRule1 - b.dieselRule1);
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
if (response.data.userGrade.dieselDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= dieselRule.length; i++) {
//
if (dieselRule.length > 1) {
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
break;
}
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
discount.full = dieselRule[i - 1].dieselRule1
oilDiscount = dieselRule[i - 1].dieselRule2
discount.reduce = dieselRule[i - 1].dieselRule2
}
} else {
discount.full = dieselRule[i - 1].dieselRule1
if (item.amount >= dieselRule[i - 1].dieselRule1) {
oilDiscount = dieselRule[i - 1].dieselRule2
discount.reduce = dieselRule[i - 1].dieselRule2
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
dieselDiscount += +oilDiscount
} else if (response.data.userGrade.dieselDiscount == "每升优惠") {
let oilDiscount = 0;
for (let i = 1; i <= dieselRule.length; i++) {
discount.type = "每升优惠"
//
if (dieselRule.length > 1) {
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
break;
}
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
discount.full = dieselRule[i - 1].dieselRule1
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.liters = dieselRule[i - 1].dieselRule3
}
} else {
discount.full = dieselRule[i - 1].dieselRule1
if (item.amount >= dieselRule[i - 1].dieselRule1) {
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.liters = dieselRule[i - 1].dieselRule3
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每升优惠')
}
dieselDiscount += +oilDiscount
} else {
dieselDiscount = 0;
}
}
dieselDiscount += +oilDiscount
} else {
dieselDiscount = 0;
}
}
}
if (item.type == "天然气") {
let naturalGasRule = JSON.parse(response.data.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
if (response.data.naturalGasDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= naturalGasRule.length; i++) {
//
if (naturalGasRule.length > 1) {
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
break;
}
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
}
} else {
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
if (response.data.fixingLevel){
let naturalGasRule = JSON.parse(response.data.fixingLevel.naturalGasRule).sort((a, b) => a.naturalGasRule1 - b.naturalGasRule1);
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
if (response.data.fixingLevel.naturalGasDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= naturalGasRule.length; i++) {
//
if (naturalGasRule.length > 1) {
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
break;
}
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
}
} else {
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
}
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
naturalGasDiscount += +oilDiscount
} else if (response.data.naturalGasDiscount == "每单位优惠") {
let oilDiscount = 0;
discount.type = "每单位优惠"
for (let i = 1; i <= naturalGasRule.length; i++) {
//
if (naturalGasRule.length > 1) {
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
break;
}
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[i - 1].naturalGasRule3
}
} else {
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[i - 1].naturalGasRule3
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
naturalGasDiscount += +oilDiscount
} else if (response.data.fixingLevel.naturalGasDiscount == "每单位优惠") {
let oilDiscount = 0;
discount.type = "每单位优惠"
for (let i = 1; i <= naturalGasRule.length; i++) {
//
if (naturalGasRule.length > 1) {
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
break;
}
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[i - 1].naturalGasRule3
}
} else {
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[i - 1].naturalGasRule3
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每单位优惠')
}
naturalGasDiscount += +oilDiscount
} else {
naturalGasDiscount = 0;
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每单位优惠')
}
}else {
if (response.data.userGrade.userGrade) {
let naturalGasRule = JSON.parse(response.data.userGrade.naturalGasRule).sort((a, b) => a.naturalGasRule1 - b.naturalGasRule1);
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
if (response.data.userGrade.naturalGasDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= naturalGasRule.length; i++) {
//
if (naturalGasRule.length > 1) {
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
break;
}
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
}
} else {
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
naturalGasDiscount += +oilDiscount
} else if (response.data.userGrade.naturalGasDiscount == "每单位优惠") {
let oilDiscount = 0;
discount.type = "每单位优惠"
for (let i = 1; i <= naturalGasRule.length; i++) {
//
if (naturalGasRule.length > 1) {
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
break;
}
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[i - 1].naturalGasRule3
}
} else {
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[i - 1].naturalGasRule3
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每单位优惠')
}
naturalGasDiscount += +oilDiscount
} else {
naturalGasDiscount = 0;
}
}
naturalGasDiscount += +oilDiscount
} else {
naturalGasDiscount = 0;
}
}
}
@ -1690,7 +1918,7 @@
this.map.payUser = data.mobile;
this.map.userId = data.id;
this.balance = this.member.cardBalance;
this.getGrade(data.gradeId)
this.getGrade(data.id,data.gradeId)
this.changeRefuelMoney();
this.handleChange();
this.preferentialData.storeId = data.storeId;
@ -2114,7 +2342,7 @@
this.oilTotal = this.oilOrder.length;
this.select = "元";
if (this.isMember){
this.getGrade(this.member.gradeId)
this.getGrade(this.member.id,this.member.gradeId)
this.changeRefuelMoney();
if (this.oilOrder.length>0){
this.preferential();
@ -2211,7 +2439,7 @@
//
getUser(){
if(this.select1=="会员手机号"){
getUserVoMobile({mobile:this.userNo}).then( response => {
getUserInfoMobile({mobile:this.userNo}).then( response => {
if (response.data!=null){
this.member = response.data
}else {

View File

@ -1,5 +1,6 @@
// 应用全局配置
module.exports = {
<<<<<<< HEAD
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
// baseUrl: 'http://192.168.0.196:8081/',
// baseUrl: 'http://192.168.1.4:8080/',
@ -7,6 +8,9 @@ module.exports = {
// baseUrl: 'http://192.168.1.5:8002/cdJdc',
=======
baseUrl: 'https://8q4f124343.yicp.fun/',
>>>>>>> c67165057421d2de2634fc09136279ec27ed8bb2
imagesUrl: 'http://www.nuoyunr.com/lananRsc',
// 应用信息
appInfo: {

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,8 @@
"@dcloudio/uni-ui": "^1.4.28",
"bignumber.js": "^9.1.2",
"crypto-js": "^4.2.0",
"uview-ui": "^2.0.36"
"uview-ui": "^2.0.36",
"weixin-js-sdk": "^1.6.5"
},
"devDependencies": {
"sass": "^1.69.5",

View File

@ -196,7 +196,7 @@
let str = q.split("?")[1];
let arr = str.split("&");
let storeId = "21";
let storeId = "19";
let staffId = "";
arr.forEach(item => {
@ -219,8 +219,6 @@
uni.setStorageSync("storeId", storeId)
}
}
// this.isExistStoreId();
this.getUserAuthority();
this.getOilType();
},

View File

@ -189,12 +189,13 @@
tabbar
},
onShow() {
this.getUser()
this.query.storeId = uni.getStorageSync("storeId")
this.query.chainStoreId = uni.getStorageSync('chainStoreId')
this.getUserBalance();
this.getGiftRecords();
this.getUserInfoList();
this.getUser()
},
methods: {
//

View File

@ -117,7 +117,7 @@
show: false,
pic: 0,
hindex: 0,
qindex: null,
qindex: 0,
aindex: null,
sindex: null,
//
@ -168,7 +168,7 @@
},
onLoad(query) {
const q = decodeURIComponent(query.q) //
if (q == undefined) {
if (query.q) {
let str = q.split("?")[1];
let arr = str.split("&");
let storeId = "";
@ -184,6 +184,9 @@
uni.setStorageSync("inviteStaffId", staffId)
this.storeId = uni.getStorageSync("storeId")
this.staffId = uni.getStorageSync("inviteStaffId")
uni.showLoading({
title:storeId +"++"+staffId
})
}
},
onShow() {

View File

@ -71,10 +71,14 @@
</template>
<script>
import wx from 'weixin-js-sdk' // js-sdk
import request from "../../utils/request";
export default {
data() {
return {
query: {
storeId: ''
},
allAmount: 0.0,
activeRecommendRecordsList: [],
title: '',
@ -82,8 +86,8 @@
storeId: '',
show: false,
options: {
code: 'https://www.tuofeng.cc/oilStation?storeId=' + uni.getStorageSync('storeId') + '&staffId=' + uni
.getStorageSync('storeId'),
code: 'https://www.tuofeng.cc/oily?storeId=' + uni.getStorageSync('storeId') + '&userId=' + uni
.getStorageSync('userId') + '&type=yaoqingyouli',
// code: 'https://www.tuofeng.cc/oily?storeId=' + uni.getStorageSync('storeId') + ' &userId=' + uni
// .getStorageSync('userId'), //
size: 460, // 460460rpx
@ -92,28 +96,50 @@
}
},
onLoad() {
console.log(uni.getStorageSync('userId'));
console.log(uni.getStorageSync('storeId'));
let codes = 'https://www.tuofeng.cc/oily?storeId=' + uni.getStorageSync('storeId') +
'&userId=' + uni.getStorageSync('userId') + '&type=yaoqingyouli'
console.log(codes);
this.query.storeId = uni.getStorageSync("storeId");
},
components: {
},
onShare() {
wx.showShareMenu({
withShareTicket: true,
success: function() {
console.log('成功开启分享菜单')
},
fail: function(res) {
console.log('开启分享菜单失败', res)
}
})
onShareAppMessage() {
wx.onShareAppMessage(function() {
return {
title: '来个油惠',
path: '/pages/index/index',
imageUrl: 'https://example.com/share.jpg',
success: function(res) {
console.log('分享成功', res)
},
fail: function(res) {
console.log('分享失败', res)
}
}
})
},
onShareAppMessage(res) {
if (res.from === 'button') { //
console.log(res.target)
}
return {
title: '来个油惠',
path: '/pages/index/index?userId=' + uni.getStorageSync('userId') + '&storeId=' + uni.getStorageSync(
'storeId') + '&type=yaoqingyouli',
success() {
console.log('分享成功');
},
fail(err) {
console.error('分享失败', err);
}
};
path: '/pages/index/index'
}
},
onShow() {
this.getAllAmount();
this.getActiveRecommendRecords();
@ -130,6 +156,7 @@
request({
url: 'business/marketingActivity/activeRecommendRecords/selectAllAmount',
method: 'get',
params: this.query
}).then(res => {
console.log(res)
if (res.code == 200) {
@ -141,6 +168,7 @@
request({
url: 'business/marketingActivity/activeRecommendRecords',
method: 'get',
params: this.query
}).then(res => {
console.log(res)
if (res.code == 200) {
@ -374,4 +402,4 @@
padding: 0px !important;
background-color: transparent;
}
</style>
</style>

View File

@ -137,7 +137,7 @@
map: {
page: 1,
pageSize: 10,
storeId: "",
storeId: uni.getStorageSync("storeId"),
orderStatus: "",
remark: "",
},

View File

@ -58,7 +58,7 @@
</view>
</view>
<view class="desc" >
<view class="desc" v-if="isFullPreferential">
<view style="display: flex;">
活动优惠
<!-- <span style="display: flex;">(满减活动)</span> -->
@ -81,12 +81,13 @@
<view class="desc" v-if="isGradePreferential">
<view style="display: flex;">
会员等级优惠
<span style="display: flex;">({{userGrade.name}})</span>
<!-- <span style="display: flex;">({{userGrade.name}})</span> -->
</view>
<view style="display: flex;">
<span style="margin-right: 10px;">-{{gradeRedece}}</span>
</view>
</view>
<view class="desc" v-if="!isFullPreferential && !isGradePreferential && !isOilStorageCard && !isStoreValueCard">无优惠</view>
<view style="margin: 10px 20px 0;color: red;font-size: 12px;">囤油卡不参与任何优惠活动</view>
</view>
@ -184,17 +185,21 @@
isStoreValueCard:false,
// 使
isGradePreferential:false,
// 使
isFullPreferential:false,
transferDTO:{
type:0,
amount:0,
oilId:"",
mtUserLevel:"",
}
storeId:uni.getStorageSync("storeId")
},
fixingLevel:{},
}
},
onLoad(e) {
this.orderNo = e.orderNo
// this.orderNo = "234520231229140854e4c4ca"
// this.orderNo = "234520240104104141863b59"
},
onShow() {
this.getOilOrder();
@ -225,13 +230,19 @@
method: 'post',
data: map,
}).then(res => {
console.log(res,_this.appltType)
// console.log(res,_this.appltType)
let payProvider = "wxpay"
if (_this.appltType== "WECHAT"){
payProvider = "wxpay"
}else{
payProvider = "alipay"
}
if(res.data.success == "ok"){
uni.reLaunch({
url: '/pagesRefuel/orderSuccess/index'
})
return;
}
if (res.data.data.reservedPayInfo){
_this.orderInfo = JSON.parse(res.data.data.reservedPayInfo);
uni.requestPayment({
@ -310,7 +321,7 @@
})
if (falg == false) {
this.chooseCardBalance(0)
this.chooseGrade(this.user.gradeId)
this.chooseGrade(this.user.id,this.user.gradeId)
}
},
// 使
@ -326,7 +337,6 @@
this.deductAmount = this.oilOrder.orderAmount - this.balanceRedece
this.payAmount = this.oilOrder.orderAmount - this.balanceRedece
}
this.preferential.amount = this.deductAmount
}else{
// 使
//
@ -344,152 +354,297 @@
}
},
// 使
chooseGrade(id){
chooseGrade(userId,gradeId){
let that = this;
request({
url: "business/userManager/userGrade/isUse/" + id,
method: 'get',
url: "business/userManager/userGrade/isUse",
method: 'post',
data:{userId:userId,gradeId:gradeId,storeId:that.oilOrder.storeId}
}).then((res) => {
if (res.data != null && res.data != ""){
that.userGrade = res.data
that.chooseFullOrCoupon();
if (res.data.preferential== "自定义优惠"){
if (that.oilType == "汽油"){
//
let gasolineRule = JSON.parse(res.data.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
if (res.data.gasolineDiscount == "满减优惠"){
if (gasolineRule.length > 1){
for (let i = 1; i<gasolineRule.length; i++){
if (res.data){
if (res.data.fixingLevel){
if (res.data.fixingLevel.discountType== "自定义优惠"){
if (that.oilType == "汽油"){
//
let gasolineRule = JSON.parse(res.data.fixingLevel.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
if (res.data.fixingLevel.gasolineDiscount == "满减优惠"){
if (gasolineRule.length > 1){
for (let i = 1; i<gasolineRule.length; i++){
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
that.gradeRedece = gasolineRule[i - 1].gasolineRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
that.gradeRedece = gasolineRule[i - 1].gasolineRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
that.isGradePreferential = true
}
}
}
if (res.data.gasolineDiscount == "每升优惠"){
if (gasolineRule.length > 1){
for (let i = 1; i<gasolineRule.length; i++){
if (res.data.fixingLevel.gasolineDiscount == "每升优惠"){
if (gasolineRule.length > 1){
for (let i = 1; i<gasolineRule.length; i++){
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[i - 1].gasolineRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[i - 1].gasolineRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
that.isGradePreferential = true
}
}
}
}
if (that.oilType == "柴油"){
//
let dieselRule = JSON.parse(res.data.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
if (res.data.dieselDiscount == "满减优惠"){
if (dieselRule.length > 1){
for (let i = 1; i<dieselRule.length; i++){
if (that.oilType == "柴油"){
//
let dieselRule = JSON.parse(res.data.fixingLevel.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
if (res.data.fixingLevel.dieselDiscount == "满减优惠"){
if (dieselRule.length > 1){
for (let i = 1; i<dieselRule.length; i++){
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
that.gradeRedece = dieselRule[i - 1].dieselRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
that.gradeRedece = dieselRule[i - 1].dieselRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
that.isGradePreferential = true
}
}
}
if (res.data.dieselDiscount == "每升优惠"){
if (dieselRule.length > 1){
for (let i = 1; i<dieselRule.length; i++){
if (res.data.fixingLevel.dieselDiscount == "每升优惠"){
if (dieselRule.length > 1){
for (let i = 1; i<dieselRule.length; i++){
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[i - 1].dieselRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[i - 1].dieselRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
that.isGradePreferential = true
}
}
}
}
if (that.oilType == "天然气"){
//
let naturalGasRule = JSON.parse(res.data.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
if (res.data.naturalGasDiscount == "满减优惠"){
if (naturalGasRule.length > 1){
for (let i = 1; i<naturalGasRule.length; i++){
if (that.oilType == "天然气"){
//
let naturalGasRule = JSON.parse(res.data.fixingLevel.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
if (res.data.fixingLevel.naturalGasDiscount == "满减优惠"){
if (naturalGasRule.length > 1){
for (let i = 1; i<naturalGasRule.length; i++){
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
that.gradeRedece = naturalGasRule[i - 1].naturalGasRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
that.gradeRedece = naturalGasRule[i - 1].naturalGasRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
that.isGradePreferential = true
}
}
}
if (res.data.naturalGasDiscount == "每升优惠"){
if (naturalGasRule.length > 1){
for (let i = 1; i<naturalGasRule.length; i++){
if (res.data.fixingLevel.naturalGasDiscount == "每升优惠"){
if (naturalGasRule.length > 1){
for (let i = 1; i<naturalGasRule.length; i++){
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
that.isGradePreferential = true
}
}
}
}
}else{
if(res.data.userGrade){
that.userGrade = res.data.userGrade
that.chooseFullOrCoupon();
if (res.data.userGrade.preferential== "自定义优惠"){
if (that.oilType == "汽油"){
//
let gasolineRule = JSON.parse(res.data.userGrade.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
if (res.data.userGrade.gasolineDiscount == "满减优惠"){
if (gasolineRule.length > 1){
for (let i = 1; i<gasolineRule.length; i++){
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
that.gradeRedece = gasolineRule[i - 1].gasolineRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
that.isGradePreferential = true
}
}
}
if (res.data.userGrade.gasolineDiscount == "每升优惠"){
if (gasolineRule.length > 1){
for (let i = 1; i<gasolineRule.length; i++){
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[i - 1].gasolineRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
that.isGradePreferential = true
}
}
}
}
if (that.oilType == "柴油"){
//
let dieselRule = JSON.parse(res.data.userGrade.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
if (res.data.userGrade.dieselDiscount == "满减优惠"){
if (dieselRule.length > 1){
for (let i = 1; i<dieselRule.length; i++){
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
that.gradeRedece = dieselRule[i - 1].dieselRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
that.isGradePreferential = true
}
}
}
if (res.data.userGrade.dieselDiscount == "每升优惠"){
if (dieselRule.length > 1){
for (let i = 1; i<dieselRule.length; i++){
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[i - 1].dieselRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
that.isGradePreferential = true
}
}
}
}
if (that.oilType == "天然气"){
//
let naturalGasRule = JSON.parse(res.data.userGrade.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
if (res.data.userGrade.naturalGasDiscount == "满减优惠"){
if (naturalGasRule.length > 1){
for (let i = 1; i<naturalGasRule.length; i++){
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
that.gradeRedece = naturalGasRule[i - 1].naturalGasRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
that.isGradePreferential = true
}
}
}
if (res.data.userGrade.naturalGasDiscount == "每升优惠"){
if (naturalGasRule.length > 1){
for (let i = 1; i<naturalGasRule.length; i++){
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
that.isGradePreferential = true
}
}
}
}
}
}
}
that.countPayMent()
}
})
@ -499,17 +654,17 @@
this.transferDTO.amount = this.deductAmount
this.transferDTO.mtUserLevel = this.userGrade.id
this.transferDTO.oilId = this.oilId
console.log(this.transferDTO)
let _this = this;
request({
url: "business/marketingActivity/activeExchange/test",
method: 'post',
data:_this.transferDTO,
}).then((res) => {
console.log(res)
if (res.data.amount!=0){
// console.log(res)
if (res.data.amount>0){
_this.payAmount = res.data.amount - _this.gradeRedece
_this.fullRedece = res.data.favorableAmount
_this.isFullPreferential = true
}
})
},
@ -523,7 +678,7 @@
getUser(id){
let _this = this;
request({
url: "business/userManager/user/" + id,
url: "business/userManager/user/storeUser/" + _this.oilOrder.storeId,
method: 'get',
}).then((res) => {
_this.user = res.data;

View File

@ -27,7 +27,7 @@
export default {
data() {
return {
timestamp:5,
timestamp:3,
}
},
onLoad() {
@ -44,7 +44,7 @@
if(_this.timestamp === 0) {
_this.goBack()
clearInterval(timer)
_this.timestamp = 5
_this.timestamp = 3
}
}, 1000);
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 B

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 973 B

After

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 730 B

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 777 B

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 613 B

After

Width:  |  Height:  |  Size: 519 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 845 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 800 B

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 22 KiB