门店信息

This commit is contained in:
cun-nan 2023-12-18 18:44:02 +08:00
parent f76021b177
commit ffeb4a4254
28 changed files with 749 additions and 105 deletions

View File

@ -36,7 +36,7 @@ export function updateStore(data) {
// 修改店铺规则信息
export function updateStoreRule(data) {
return request({
url: '/business/storeInformation/store/updateRule',
url: '/business/userManager/chainStoreConfig/updateRule',
method: 'post',
data: data
})

View File

@ -76,7 +76,7 @@ export default {
dialogImageUrl: "",
dialogVisible: false,
hideUpload: false,
baseUrl: process.env.VUE_APP_BASE_API,
baseUrl: process.env.VUE_APP_SERVER_URL,
uploadImgUrl: process.env.VUE_APP_SERVER_URL + 'backendApi/file/upload', //
headers: {
'Access-Token': getToken()
@ -123,16 +123,20 @@ export default {
if(findex > -1) {
this.fileList.splice(findex, 1);
this.$emit("input", this.listToString(this.fileList));
// this.dialogImageUrl = this.listToString(this.fileList)
// this.dialogVisible = true;
}
},
//
handleUploadSuccess(res) {
this.uploadList.push({ name: res.fileName, url: res.fileName });
this.uploadList.push({ name: res.data.fileName, url: res.data.fileName });
if (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.dialogImageUrl = this.listToString(this.fileList)
// this.dialogVisible = true;
this.$modal.closeLoading();
}
},
@ -178,6 +182,7 @@ export default {
},
//
handlePictureCardPreview(file) {
console.log(file,111)
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
@ -186,8 +191,11 @@ export default {
let strs = "";
separator = separator || ",";
for (let i in list) {
strs += list[i].url.replace(this.baseUrl, "") + separator;
// console.log(list[i].url,separator)
// strs += list[i].url.replace(this.baseUrl, "") + separator;
strs += this.baseUrl + list[i].url + separator;
}
// this.dialogImageUrl = strs
return strs != '' ? strs.substr(0, strs.length - 1) : '';
}
}

View File

@ -0,0 +1,237 @@
<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}"
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto;height: 100%"
/>
<i class="el-icon-plus"></i>
</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:""
},
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: []
};
},
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.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) {
// console.log(file,this.baseUrl , this.imgUrl)
if (this.imgUrl != "" && this.imgUrl != undefined){
this.dialogImageUrl = this.baseUrl + this.imgUrl;
}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

@ -18,7 +18,7 @@
<p>详细地址<el-input v-model="form.address"
placeholder="请输入内容"
style="width: 50%"
@blur="getLngLat"
@change="getLngLat"
></el-input></p>
</div>
</template>

View File

@ -4,6 +4,16 @@
<div slot="header" class="clearfix">
<span>{{ store.name }}{{store.description? "("+store.description+")":"" }}</span>
</div>
<!-- 上传图片-->
<div style="display: flex">
<span>店铺logo</span>
<imgUpload1 :imgUrl="store.logo" :limit="1" @input="getImgUrl"></imgUpload1>
</div>
<!-- 上传图片-->
<div style="display: flex">
<span>门头照</span>
<imgUpload1 :limit="1" @input="getDoorImgUrl"></imgUpload1>
</div>
<map-componment :pform="form" ref="mapRef" @pform="getForm"></map-componment>
<div style="display: flex;margin-bottom: 20px">
@ -51,10 +61,15 @@ import html2canvas from "html2canvas";
import {listQRCode} from "@/api/staff/qrcode";
import {ljStoreInfo, updateStore} from "@/api/staff/store";
import mapComponment from "@/components/map/mapComponent.vue";
import imgUpload from "@/components/ImageUpload/index.vue"
import { getToken } from '@/utils/auth'
import imgUpload1 from "@/components/map/imgUpload.vue"
export default {
components:{
mapComponment,
imgUpload,
imgUpload1,
},
name: "map-view",
dicts: ['store_welfare'],
@ -65,6 +80,20 @@ export default {
},
data(){
return{
testImgUrl:"",
//
imagePath: process.env.VUE_APP_SERVER_URL,
dataForm:{},
//
uploadAction: process.env.VUE_APP_SERVER_URL + 'backendApi/file/upload',
uploadHeader: { 'Access-Token' : getToken() },
//
hideUpload: false,
//
uploadFiles: [
{name:"nihao",
url:'http://192.168.1.4:8080/static/uploadImages/20231218/c4b1c4fc7cfc4dd4a4acf1e922cacc86.png'}
],
//
collectionImg:'',
//
@ -102,6 +131,23 @@ export default {
this.getForm()
},
methods: {
handleUploadSuccessCover(file) {
this.dataForm.coverImage = file.data.fileName;
},
// url
getImgUrl(val){
let list = val.split("/static")
this.store.logo = "/static"+list[list.length-1]
// this.store.logo = val
console.log(this.store.logo)
},
// url
getDoorImgUrl(val){
// console.log(val)
// let list = val.split("/")
// this.form.logo = list[list.length-1]
this.store.doorstepPhoto = val
},
getForm(data){
if (data != undefined){
this.form.lat = data.lat;
@ -113,6 +159,7 @@ export default {
getStore() {
ljStoreInfo().then(response => {
this.store = response.data
console.log(response.data)
this.form.lat = this.store.latitude;
this.form.lng = this.store.longitude;
this.form.address = this.store.address;

View File

@ -577,9 +577,13 @@ export default {
methods: {
//
getISEnableLevel(){
ljStoreInfo().then(response => {
getChainStoreConfig().then(response => {
// console.log(response)
this.isEnableLevel = response.data.isEnableLevel;
this.clear = response.data.isMonthClear;
this.gasGrowthValue = response.data.gasGrowthValue;
this.dieselGrowthValue = response.data.dieselGrowthValue;
this.naturalGrowthValue = response.data.naturalGrowthValue;
if (response.data.isEnableLevel=="no"){
this.level1 = true;
this.level2 = false;
@ -663,15 +667,6 @@ export default {
getSysConfig('growth_value_rule').then(response => {
this.growthValueRule = response.data.split(";")
});
getSysConfig('gas_growth_value').then(response => {
this.gasGrowthValue = response.data
});
getSysConfig('diesel_growth_value').then(response => {
this.dieselGrowthValue = response.data
});
getSysConfig('natural_growth_value').then(response => {
this.naturalGrowthValue = response.data
});
},
//
getClearConfig(){
@ -685,8 +680,8 @@ export default {
this.map.isMonthClear = this.clear;
updateStoreRule(this.map).then(response => {
this.$modal.msgSuccess("修改成功");
this.getISEnableLevel();
});
this.getISEnableLevel();
},
//
getList() {

View File

@ -79,4 +79,7 @@ public class MtStore extends BaseEntity implements Serializable {
@ApiModelProperty("福利信息")
private String welfare;
@ApiModelProperty("门头照")
private String doorstepPhoto;
}

View File

@ -95,13 +95,13 @@ public class LJStoreController extends BaseController {
return getSuccessResult(storeService.queryStoreByPosition(map));
}
/**
* 修改等级规则信息
* @param map
* @return
*/
@PostMapping("/updateRule")
public ResponseObject updateRule(@Validated @RequestBody Map<String,String> map){
return getSuccessResult(storeService.updateStoreRule(map));
}
// /**
// * 修改等级规则信息
// * @param map
// * @return
// */
// @PostMapping("/updateRule")
// public ResponseObject updateRule(@Validated @RequestBody Map<String,String> map){
// return getSuccessResult(storeService.updateStoreRule(map));
// }
}

View File

@ -82,15 +82,12 @@ public class LJStore extends BaseEntity implements Serializable {
@ApiModelProperty("福利信息")
private String welfare;
@ApiModelProperty("门头照")
private String doorstepPhoto;
@TableField(exist = false)
private List<String> welfareList;
@TableField(exist = false)
private List<OilNumberNameVo> oilList;
@ApiModelProperty("是否开启等级规则")
private String isEnableLevel;
@ApiModelProperty("是否按月清算")
private String isMonthClear;
}

View File

@ -56,11 +56,11 @@ public interface ILJStoreService extends IService<LJStore> {
* @return
*/
public int updateStore(LJStore store);
/**
* 修改店铺规则信息
* @param map 店铺信息
* @return
*/
public int updateStoreRule(Map<String,String> map);
//
// /**
// * 修改店铺规则信息
// * @param map 店铺信息
// * @return
// */
// public int updateStoreRule(Map<String,String> map);
}

View File

@ -7,6 +7,8 @@ import com.fuint.business.petrolStationManagement.vo.OilNumberNameVo;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.mapper.LJStoreMapper;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.ChainStoreConfig;
import com.fuint.business.userManager.service.ChainStoreConfigService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
@ -189,15 +191,4 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
int row = baseMapper.updateById(store);
return row;
}
@Override
public int updateStoreRule(Map<String, String> map) {
String isEnableLevel = map.get("isEnableLevel");
String isMonthClear = map.get("isMonthClear");
LJStore store = this.selectStoreById();
store.setIsEnableLevel(isEnableLevel);
store.setIsMonthClear(isMonthClear);
int row = baseMapper.updateById(store);
return row;
}
}

View File

@ -8,6 +8,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 连锁店配置信息 controller层
*/
@ -46,4 +48,24 @@ public class ChainStoreConfigController extends BaseController {
public ResponseObject edit(@Validated @RequestBody ChainStoreConfig chainStoreConfig){
return getSuccessResult(chainStoreConfigService.updateChainStoreConfig(chainStoreConfig));
}
/**
* 修改等级规则信息
* @param map
* @return
*/
@PostMapping("/updateRule")
public ResponseObject updateRule(@Validated @RequestBody Map<String,String> map){
return getSuccessResult(chainStoreConfigService.updateChainStoreConfigByRule(map));
}
/**
* 根据店铺id查询连锁店配置信息
* @param storeId
* @return
*/
@GetMapping("/{storeId}")
public ResponseObject queryChainStoreConfig(@PathVariable Integer storeId){
return getSuccessResult(chainStoreConfigService.selectChainStoreByStoreId(storeId));
}
}

View File

@ -91,6 +91,14 @@ public class LJUserController extends BaseController {
return getSuccessResult(user);
}
/**
* 根据用户id 店铺id查询用户余额信息
* @return
*/
@GetMapping("/userBalanceByUserId")
public ResponseObject getUserBalanceByUserId(){
return getSuccessResult(userBalanceService.selectUserBalanceByUserId());
}
/**
* 根据手机号查询会员信息

View File

@ -46,6 +46,16 @@ public class LJUserGradeController extends BaseController {
return getSuccessResult(userGradeService.selectUserGradeAll());
}
/**
* 根据店铺id查询会员等级信息
* @param storeId
* @return
*/
@GetMapping("/getGradeList/{storeId}")
public ResponseObject gradeList(@PathVariable Integer storeId){
return getSuccessResult(userGradeService.selectUserGradeAllByStoreId(storeId));
}
/**
* 根据id查询会员等级信息
* @param id

View File

@ -31,9 +31,26 @@ public class ChainStoreConfig extends BaseEntity implements Serializable {
@ApiModelProperty("连锁店id")
private Integer chainStoreId;
@ApiModelProperty("等级清算规则")
private String levelClearRule;
/**
* 是否开启等级规则
*/
private String isEnableLevel;
/**
* 是否按月清算
*/
private String isMonthClear;
/**
*汽油消费1元增加多少成长值
*/
private String gasGrowthValue;
/**
*柴油消费1元增加多少成长值
*/
private String dieselGrowthValue;
/**
*天然气消费1元增加多少成长值
*/
private String naturalGrowthValue;
/**
* 微信小程序 配置信息

View File

@ -3,6 +3,8 @@ package com.fuint.business.userManager.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.userManager.entity.ChainStoreConfig;
import java.util.Map;
/**
* 连锁店配置信息 业务层
*/
@ -21,4 +23,25 @@ public interface ChainStoreConfigService extends IService<ChainStoreConfig> {
* @return
*/
public int updateChainStoreConfig(ChainStoreConfig chainStoreConfig);
/**
* 根据id查询连锁店配置信息
* @param id
* @return
*/
public ChainStoreConfig selectChainStoreById(int id);
/**
* 修改连锁店等级规则信息
* @param map
* @return
*/
public int updateChainStoreConfigByRule(Map<String,String> map);
/**
* 根据店铺id查询连锁店配置信息
* @param storeId
* @return
*/
public ChainStoreConfig selectChainStoreByStoreId(int storeId);
}

View File

@ -25,6 +25,12 @@ public interface LJUserGradeService extends IService<LJUserGrade> {
*/
public List<LJUserGrade> selectUserGradeAll();
/**
* 根据店铺id查询所有会员等级信息
* @return
*/
public List<LJUserGrade> selectUserGradeAllByStoreId(int storeId);
/**
* 根据id查询会员等级信息
* @param id

View File

@ -37,6 +37,12 @@ public interface UserBalanceService extends IService<UserBalance> {
/**
* 根据用户id和店铺id查询用户余额信息
* @return
*/
public UserBalance selectUserBalanceByUserId();
/**
* 根据用户id和连锁店id查询用户余额信息
* @param userId
* @return
*/

View File

@ -1,5 +1,6 @@
package com.fuint.business.userManager.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -14,6 +15,8 @@ import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
@Service
public class ChainStoreConfigServiceImpl extends ServiceImpl<ChainStoreConfigMapper, ChainStoreConfig> implements ChainStoreConfigService {
@Autowired
@ -55,4 +58,40 @@ public class ChainStoreConfigServiceImpl extends ServiceImpl<ChainStoreConfigMap
int row = baseMapper.update(chainStoreConfig,queryWrapper);
return row;
}
@Override
public ChainStoreConfig selectChainStoreById(int id) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("chain_store_id",id);
return baseMapper.selectOne(queryWrapper);
}
@Override
public int updateChainStoreConfigByRule(Map<String, String> map) {
String isEnableLevel = map.get("isEnableLevel");
String isMonthClear = map.get("isMonthClear");
LJStore store = storeService.selectStoreById();
ChainStoreConfig chainStoreConfig = this.selectChainStoreById(store.getChainStoreId());
if (ObjectUtil.isEmpty(chainStoreConfig)){
ChainStoreConfig chainStoreConfig1 = new ChainStoreConfig();
chainStoreConfig1.setChainStoreId(store.getChainStoreId());
chainStoreConfig1.setIsEnableLevel("no");
chainStoreConfig1.setIsMonthClear("clear_month");
chainStoreConfig1.setGasGrowthValue("1");
chainStoreConfig1.setDieselGrowthValue("1");
chainStoreConfig1.setNaturalGrowthValue("1");
baseMapper.insert(chainStoreConfig1);
chainStoreConfig = this.selectChainStoreById(store.getChainStoreId());
}
chainStoreConfig.setIsEnableLevel(isEnableLevel);
chainStoreConfig.setIsMonthClear(isMonthClear);
int row = baseMapper.updateById(chainStoreConfig);
return row;
}
@Override
public ChainStoreConfig selectChainStoreByStoreId(int storeId) {
LJStore store = storeService.selectStoreByStoreId(storeId);
return baseMapper.selectById(store.getChainStoreId());
}
}

View File

@ -9,8 +9,10 @@ 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.ChainStoreConfig;
import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.mapper.LJUserGradeMapper;
import com.fuint.business.userManager.service.ChainStoreConfigService;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
@ -51,6 +53,15 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
return baseMapper.selectList(queryWrapper);
}
@Override
public List<LJUserGrade> selectUserGradeAllByStoreId(int storeId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status","qy");
queryWrapper.eq("store_id",storeId);
queryWrapper.orderByAsc("grade");
return baseMapper.selectList(queryWrapper);
}
@Override
public LJUserGrade selectUserGradeById(int id) {
return baseMapper.selectById(id);
@ -58,11 +69,14 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
@Autowired
private ILJStoreService storeService;
@Autowired
private ChainStoreConfigService chainStoreConfigService;
@Override
public LJUserGrade selectUserGradeByIdIsUse(int id) {
LJStore store = storeService.selectStoreById();
String isEnableLevel = store.getIsEnableLevel();
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId());
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
if (isEnableLevel.equals("yes")){
return baseMapper.selectById(id);
}

View File

@ -41,6 +41,15 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
return balance;
}
@Override
public UserBalance selectUserBalanceByUserId() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mt_user_id",nowAccountInfo.getId());
UserBalance balance = baseMapper.selectOne(queryWrapper);
return balance;
}
@Override
public UserBalance selectUserBalance(int userId, int chainStoreId) {
QueryWrapper queryWrapper = new QueryWrapper<>();

View File

@ -613,7 +613,7 @@
<span class="amountBlue">{{ form.oilPrice }}/L</span>
</div>
<div >
<el-input v-model="amount" @input="form.amount = amount" placeholder="请输入加油金额"
<el-input v-model="amount" v-focus @input="form.amount = amount" placeholder="请输入加油金额"
style="font-weight: 700;text-align: center;font-size: 20px;">
<el-select v-model="select" style="width: 70px" @change="changeSelect" slot="append" placeholder="请选择">
<el-option label="元" value="元"></el-option>

View File

@ -1,8 +1,10 @@
// 应用全局配置
module.exports = {
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
baseUrl: 'http://192.168.0.196:8081/',
// baseUrl: 'http://192.168.0.196:8081/',
baseUrl: 'http://192.168.1.4:8080/',
// baseUrl: 'http://192.168.1.5:8002/cdJdc',
imagesUrl: 'http://www.nuoyunr.com/lananRsc',
// 应用信息
appInfo: {

View File

@ -170,9 +170,9 @@
staffId = item.split("=")[1]
}
})
uni.setStorageSync("inviteStoreId", storeId)
uni.setStorageSync("storeId", storeId)
uni.setStorageSync("inviteStaffId", staffId)
this.storeId = uni.getStorageSync("inviteStoreId")
this.storeId = uni.getStorageSync("storeId")
this.staffId = uni.getStorageSync("inviteStaffId")
}
// this.isExistStoreId();
@ -188,8 +188,8 @@
},
methods: {
isExistStoreId() {
if (uni.getStorageSync("inviteStoreId") != "") {
this.getStore(uni.getStorageSync("inviteStoreId"));
if (uni.getStorageSync("storeId") != "") {
this.getStore(uni.getStorageSync("storeId"));
} else {
this.getAddress();
}

View File

@ -165,6 +165,26 @@
components: {
tabbar
},
onLoad(query) {
const q = decodeURIComponent(query.q) //
if (q == undefined) {
let str = q.split("?")[1];
let arr = str.split("&");
let storeId = "";
let staffId = "";
arr.forEach(item => {
if (item.includes("storeId")) {
storeId = item.split("=")[1]
} else {
staffId = item.split("=")[1]
}
})
uni.setStorageSync("storeId", storeId)
uni.setStorageSync("inviteStaffId", staffId)
this.storeId = uni.getStorageSync("storeId")
this.staffId = uni.getStorageSync("inviteStaffId")
}
},
onShow() {
// this.isExistStoreId();
this.getStore(uni.getStorageSync("storeId"));
@ -276,6 +296,9 @@
//
getSIndex(index,id) {
this.sindex = index
this.toPayment(id)
},
toPayment(id){
this.oilOrder.orderAmount = this.value
this.oilOrder.storeId = this.storeId
this.oilOrder.staffId = id
@ -328,7 +351,11 @@
submitAmount(){
if (this.value!="" && this.qindex!=null){
this.show = false
this.$refs.popup.open('bottom')
if (uni.getStorageSync("inviteStaffId")!=null && uni.getStorageSync("inviteStaffId")!="" && uni.getStorageSync("inviteStaffId")!=undefined){
this.toPayment(uni.getStorageSync("inviteStaffId"))
}else{
this.$refs.popup.open('bottom')
}
}else{
if (this.value=="") {
uni.showToast({
@ -345,15 +372,35 @@
},
valChange(val) {
// value+=
this.value += val;
this.liters = (this.value/this.oilPrice).toFixed(2)
console.log(this.value);
uni.vibrateShort({
success: function () {}
});
let index = this.value.indexOf(".")
if(index!=-1){
if ((this.value.length-index)>=3){
return;
}
}else{
if (this.value.length>=7 && val!="."){
return;
}
}
this.value += val;
this.liters = (this.value/this.oilPrice).toFixed(2)
// console.log(this.value);
},
// 退
backspace() {
uni.vibrateShort({
success: function () {}
});
// value
if (this.value.length) this.value = this.value.substr(0, this.value.length - 1);
console.log(this.value);
if (this.value.length) {
this.value = this.value.substr(0, this.value.length - 1);
this.liters = (this.value/this.oilPrice).toFixed(2)
}
// console.log(this.value);
}
}

View File

@ -2,7 +2,7 @@
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goback"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-icons" @click="goBack"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">会员</view>
<view class="my-icons"></view>
</view>
@ -10,14 +10,22 @@
<uni-swiper-dot class="uni-swiper-dot-box" @clickItem=clickItem :info="info" :current="current" :mode="mode"
:dots-styles="dotsStyles" field="content">
<swiper class="swiper-box" @change="change" :current="swiperDotIndex">
<swiper-item v-for="(item, index) in 20" :key="index">
<swiper-item v-for="(item, index) in userGradeList" :key="index">
<view class="top-box">
<view class="b-top">
<view style="width: 70%;">
<view class="title-size">V{{index}}会员</view>
<view class="title-size">{{item.name}}</view>
<view class="min-size" style="margin-bottom: 20px;">升级会员享更多特权</view>
<view class="min-size" style="margin-bottom: 10px;">在获得358可升级至钻石会员</view>
<!-- <view class="min-size" style="margin-bottom: 10px;" v-if="userBalance.gradeId == item.id && index < (userGradeList.length-1)">
在获得{{item.growthValue - userBalance.growthValue}}可升级至{{userGradeList[index+1].name}}
</view>
<view class="min-size" style="margin-bottom: 10px;" v-else-if="userBalance.gradeId == item.id && index == (userGradeList.length-1)">
已达到最高等级
</view> -->
<view class="min-size" style="margin-bottom: 10px;" >
达到当前等级所需成长值为{{item.growthValue}}
</view>
<u-line-progress :percentage="30" activeColor="#2F72F7"></u-line-progress>
</view>
<view class="right-img">
@ -33,9 +41,9 @@
<view class="box-ba" v-for="(item,index) in oilNameList" :key="index">
<view class="min-box">
<image src="../../static/imgs/vipxz.png" mode=""></image>
<image :src="item.imgurl" mode=""></image>
</view>
<view class="mu_">{{item}}</view>
<view class="mu_">{{item.name}}</view>
</view>
</view>
</view>
@ -45,25 +53,94 @@
<view style="height: 340px; width: 100%;"></view>
<!-- <view style="height: 300px; width: 100%;"></view> -->
<view class="bottom-box">
<view class="bottom-bai-box">
<view class="b-top-bt">
<view class="title">优惠信息</view>
<view class="times">每天04:00更新</view>
<!-- <scroll-view scroll-y="true" class="scroll-Y"> -->
<view class="bottom-bai-box">
<view class="b-top-bt">
<view class="title">汽油优惠信息</view>
<!-- <view class="times">每天04:00更新</view> -->
</view>
<view class="b-center" v-if="userGrade.preferential!='自定义优惠'">无优惠</view>
<view v-else>
<view class="b-center" v-if="userGrade.gasolineDiscount=='满减优惠'">
满减优惠:
<view class="b-center-spn" v-for="(item,index) in gasolineRule" :key="index">
消费满{{item.gasolineRule1}},立减{{item.gasolineRule2}}
</view>
</view>
<view class="b-center" v-else-if="userGrade.gasolineDiscount=='每升优惠'">
每升优惠:
<view class="b-center-spn" v-for="(item,index) in gasolineRule" :key="index">
消费满{{item.gasolineRule1}},每升优惠{{item.gasolineRule3}}
</view>
</view>
<view class="b-center" v-else>{{userGrade.gasolineDiscount}}</view>
</view>
<view class="title">成长规则每消费<text style=" margin: 0px 5px; color:#ff5c28 ;">1</text> 元加<text
style="margin: 0px 5px;color:#2c62cd ;">{{chainStoreConfig.gasGrowthValue}}</text>成长值</view>
</view>
</view>
<view class="bottom-bai-box">
<view class="title">每消费<text style=" margin: 0px 5px; color:#ff5c28 ;">200</text> 元加<text
style="margin: 0px 5px;color:#2c62cd ;">1%</text>成长值</view>
<view class="bottom-bai-box">
<view class="b-top-bt">
<view class="title">柴油优惠信息</view>
<!-- <view class="times">每天04:00更新</view> -->
</view>
<view class="b-center" v-if="userGrade.preferential!='自定义优惠'">无优惠</view>
<view v-else>
<view class="b-center" v-if="userGrade.dieselDiscount=='满减优惠'">
满减优惠:
<view class="b-center-spn" v-for="(item,index) in dieselRule" :key="index">
消费满{{item.dieselRule1}},立减{{item.dieselRule2}}
</view>
</view>
<view class="b-center" v-else-if="userGrade.dieselDiscount=='每升优惠'">
每升优惠:
<view class="b-center-spn" v-for="(item,index) in dieselRule" :key="index">
消费满{{item.dieselRule1}},每升优惠{{item.dieselRule3}}
</view>
</view>
<view class="b-center" v-else>{{userGrade.dieselDiscount}}</view>
</view>
<view class="title">成长规则每消费<text style=" margin: 0px 5px; color:#ff5c28 ;">1</text> 元加<text
style="margin: 0px 5px;color:#2c62cd ;">{{chainStoreConfig.dieselGrowthValue}}</text>成长值</view>
</view>
<view class="bottom-bai-box">
<view class="b-top-bt">
<view class="title">天然气优惠信息</view>
<!-- <view class="times">每天04:00更新</view> -->
</view>
<view class="b-center" v-if="userGrade.preferential!='自定义优惠'">无优惠</view>
<view v-else>
<view class="b-center" v-if="userGrade.naturalGasDiscount=='满减优惠'">
满减优惠:
<view class="b-center-spn" v-for="(item,index) in naturalGasRule" :key="index">
消费满{{item.naturalGas1}},立减{{item.naturalGas2}}
</view>
</view>
<view class="b-center" v-else-if="userGrade.naturalGasDiscount=='每升优惠'">
每升优惠:
<view class="b-center-spn" v-for="(item,index) in naturalGasRule" :key="index">
消费满{{item.naturalGas1}},每升优惠{{item.naturalGas3}}
</view>
</view>
<view class="b-center" v-else>{{userGrade.naturalGasDiscount}}</view>
</view>
<view class="title">成长规则每消费<text style=" margin: 0px 5px; color:#ff5c28 ;">1</text> 元加<text
style="margin: 0px 5px;color:#2c62cd ;">{{chainStoreConfig.naturalGrowthValue}}</text>成长值</view>
</view>
<!-- <view class="bottom-bai-box">
<view class="title">每消费<text style=" margin: 0px 5px; color:#ff5c28 ;">200</text> 元加<text
style="margin: 0px 5px;color:#2c62cd ;">1%</text>成长值</view>
</view>
</view> -->
<!-- </scroll-view> -->
</view>
</view>
</view>
</template>
<script>
import request from '../../utils/request'
export default {
data() {
return {
@ -85,28 +162,84 @@
}
],
oilNameList: [
"汽油",
"柴油",
"天然气"
{name:"汽油",imgurl:"../../static/imgs/gasoline.png"},
{name:"柴油",imgurl:"../../static/imgs/diesel_oil.png"},
{name:"天然气",imgurl:"../../static/imgs/natural_gas.png"},
],
modeIndex: -1,
styleIndex: -1,
current: 0,
mode: 'default',
dotsStyles: {},
swiperDotIndex: 0
swiperDotIndex: 0,
//
userGradeList:[],
storeId:"",
userId:"",
userBalance:{},
userGrade:{},
//
gasolineRule:[],
//
dieselRule:[],
//
naturalGasRule:[],
//
chainStoreConfig: {},
}
},
components: {
onLoad() {
this.storeId = uni.getStorageSync("storeId")
this.getList(this.storeId)
this.getChainConfig(this.storeId)
this.getUserBalance()
},
methods: {
getChainConfig(storeId){
let _this = this;
request({
url: "business/userManager/chainStoreConfig/" + storeId,
method: 'get',
}).then((res) => {
_this.chainStoreConfig = res.data
})
},
//
getUserBalance(){
let _this = this;
request({
url: "business/userManager/user/userBalanceByUserId",
method: 'get',
}).then((res) => {
_this.userBalance = res.data
})
},
//
getList(storeId){
let _this = this;
request({
url: "business/userManager/userGrade/getGradeList/"+storeId,
method: 'get',
}).then((res) => {
this.userGradeList = res.data
this.userGrade = res.data[0]
if (res.data[0].preferential == '自定义优惠'){
this.gasolineRule = JSON.parse(res.data[0].gasolineRule)
this.dieselRule = JSON.parse(res.data[0].dieselRule)
this.naturalGasRule = JSON.parse(res.data[0].naturalGasRule)
}
})
},
change(e) {
this.current = e.detail.current
this.userGrade = this.userGradeList[this.current]
if (this.userGradeList[this.current].preferential == '自定义优惠'){
this.gasolineRule = JSON.parse(this.userGradeList[this.current].gasolineRule)
this.dieselRule = JSON.parse(this.userGradeList[this.current].dieselRule)
this.naturalGasRule = JSON.parse(this.userGradeList[this.current].naturalGasRule)
}
},
goback() {
goBack() {
uni.navigateBack()
}
}
@ -114,6 +247,17 @@
</script>
<style scoped lang="scss">
.b-center{
line-height: 25px;
margin: 10px 0;
margin-left: 10px;
font-size: 15px;
}
.b-center-spn{
margin-left: 20px;
}
.swiper-box {
height: 500px;
}
@ -236,8 +380,8 @@
padding: 15px;
position: fixed;
bottom: 0px;
height: 340px;
height: 390px;
overflow-y: scroll;
}
.bottom-bai-box {

View File

@ -10,7 +10,7 @@
<view class="top-box">
<view class="top-input">
<u-icon name="search" size="28"></u-icon>
<input type="text" placeholder="搜索我的订单" v-model="query" />
<input type="text" placeholder="搜索我的订单" v-model="query" @confirm="queryOrder" />
</view>
<view class="" @click="queryOrder">搜索</view>
</view>

View File

@ -187,11 +187,16 @@
<view style="background-color: white;width: 94%;margin: 15px auto;">
<view style="font-weight: bold;height: 40px;line-height: 40px;margin-left: 10px;margin-top: 20px;">支付方式
</view>
<view class="desc">
<!-- <view class="desc">
<view>微信支付</view>
<u-radio-group v-model="value">
<u-radio name="wx"></u-radio>
</u-radio-group>
</view> -->
<view class="scc">
<image src="@/static/imgs/wechat.png" class="imgIcon"></image>
<span style="width: 70%;margin-top: 5px;">微信支付</span>
<radio value="r1" checked="true" />
</view>
</view>
@ -280,8 +285,8 @@
}
},
onLoad(e) {
this.orderNo = e.orderNo
// this.orderNo = "20231201114800ebe24b"
// this.orderNo = e.orderNo
this.orderNo = "20231201114800ebe24b"
},
onShow() {
this.getOilOrder();
@ -500,6 +505,14 @@
return;
}
}else {
// 使
if (this.isOilStorageCard){
this.fullRedece = 0;
this.gradeRedece = 0;
this.couponRedece = 0;
this.countOilCard();
return;
}
//
// 使
if (this.isUseBalance){
@ -511,14 +524,6 @@
this.countAmountFull()
return;
}
// 使
if (this.isOilStorageCard){
this.fullRedece = 0;
this.gradeRedece = 0;
this.couponRedece = 0;
this.countOilCard();
return;
}
this.countAmountBalance();
}
},
@ -966,6 +971,20 @@
</script>
<style scoped lang="scss">
.scc{
display: flex;
justify-content: space-around;
margin-top: 10px;
height: 40px;
font-size: 18px;
line-height: 40px;
}
.imgIcon{
width: 30px;
height: 30px;
border-radius: 50%;
margin-top: 10px;
}
.desc {
height: 35px;
line-height: 35px;