diff --git a/fuintAdmin/package.json b/fuintAdmin/package.json index 39f90529d..89a7a1a48 100644 --- a/fuintAdmin/package.json +++ b/fuintAdmin/package.json @@ -6,6 +6,7 @@ "license": "MIT", "scripts": { "dev": "vue-cli-service serve", + "后台": "vue-cli-service serve", "build:prod": "vue-cli-service build", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", diff --git a/fuintAdmin_zt/package.json b/fuintAdmin_zt/package.json index c3bf655c5..76f6631bd 100644 --- a/fuintAdmin_zt/package.json +++ b/fuintAdmin_zt/package.json @@ -6,6 +6,7 @@ "license": "MIT", "scripts": { "dev": "vue-cli-service serve", + "中台": "vue-cli-service serve", "build:prod": "vue-cli-service build", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java index 4d63dc875..81c471624 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java @@ -229,7 +229,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl idList) { return getSuccessResult(this.chainStoreInfoService.removeByIds(idList)); } + + + /** + * 判断token是否与当前连锁店id相同 + * @param idList + * @return + */ + @GetMapping("theJudgmentIsTheSame") + public ResponseObject theJudgmentIsTheSame(Integer chainStoreId) { + return getSuccessResult(this.chainStoreInfoService.theJudgmentIsTheSame(chainStoreId)); + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/ChainStoreInfoService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/ChainStoreInfoService.java index fc5de1221..5adf54b3c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/ChainStoreInfoService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/ChainStoreInfoService.java @@ -13,5 +13,7 @@ import com.fuint.business.store.entity.ChainStoreInfo; */ public interface ChainStoreInfoService extends IService { IPage listVo(Page page, ChainStoreInfo chainStoreInfo); + + boolean theJudgmentIsTheSame(Integer chainStoreId); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/impl/ChainStoreInfoServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/impl/ChainStoreInfoServiceImpl.java index f1f25ac86..94a15e636 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/impl/ChainStoreInfoServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/impl/ChainStoreInfoServiceImpl.java @@ -75,5 +75,17 @@ public class ChainStoreInfoServiceImpl extends ServiceImpl - + @@ -136,7 +136,9 @@ import tabbar from "../../components/tabbar/tabbar.vue" import config from '@/config' import request from '../../utils/request' -import { callWithErrorHandling } from "vue" + import { + callWithErrorHandling + } from "vue" export default { data() { return { @@ -182,7 +184,7 @@ import { callWithErrorHandling } from "vue" baseUrl: this.$baseUrl, } }, - onLoad(query) { + async onLoad(query) { if (query.storeId) { // uni.setStorageSync("y_storeId", query.storeId) uni.setStorageSync("storeId", query.storeId) @@ -217,8 +219,8 @@ import { callWithErrorHandling } from "vue" uni.setStorageSync("inviteStaffId", staffId) this.storeId = uni.getStorageSync("storeId") this.staffId = uni.getStorageSync("inviteStaffId") - this.getUserAuthority(); - this.getOilType(); + await this.getUserAuthority(); + await this.getOilType(); } else { if (uni.getStorageSync("storeId")) { this.storeId = uni.getStorageSync("storeId") @@ -228,8 +230,9 @@ import { callWithErrorHandling } from "vue" uni.setStorageSync("storeId", storeId) } } - this.getUserAuthority(); - this.getOilType(); + await this.getUserAuthority(); + await this.getOilType(); + await this.getTheJudgmentIsTheSame(); }, onShow() { this.isJoined() @@ -240,11 +243,11 @@ import { callWithErrorHandling } from "vue" }, methods: { // 返回图片路径 - getBannerUrl(url){ + getBannerUrl(url) { let imgurl = "" - if (url.includes("http")){ + if (url.includes("http")) { imgurl = url - }else { + } else { imgurl = this.baseUrl + url } return imgurl; @@ -264,10 +267,10 @@ import { callWithErrorHandling } from "vue" method: 'get', }).then(res => { _this.list1 = res.data - for (let i = 0;i { + if (!res.data) { + uni.removeStorageSync("App-Token"); + } + }) + }, + // 获取门店信息 getStore(id) { let _this = this; @@ -402,7 +424,7 @@ import { callWithErrorHandling } from "vue" }) } }).catch((res) => { - + }) }, // 获取当前位置 @@ -435,7 +457,7 @@ import { callWithErrorHandling } from "vue" _this.store = response.data.store uni.setStorageSync("storeId", response.data.store.id) uni.setStorageSync("chainStoreId", response.data.store.chainStoreId) - // console.log(uni.getStorageSync("chainStoreId")); + // console.log(uni.getStorageSync("chainStoreId")); let welfare = response.data.store.welfare if (welfare) { if (welfare.includes(",")) { @@ -858,4 +880,4 @@ import { callWithErrorHandling } from "vue" color: white; margin: 0 auto; } - + \ No newline at end of file diff --git a/gasStation-uni/pages/refuel/refuel.vue b/gasStation-uni/pages/refuel/refuel.vue index c4027f805..1468c40e4 100644 --- a/gasStation-uni/pages/refuel/refuel.vue +++ b/gasStation-uni/pages/refuel/refuel.vue @@ -8,8 +8,8 @@ - - + + {{store.name}}{{store.description ? "("+store.description+")" : ""}} @@ -48,9 +48,8 @@ v-for="(item,index) in 8" :key="index"> {{index}}号枪 --> - + {{item.gunName}} @@ -96,9 +95,8 @@ v-for="(item,index) in 19" :key="index"> {{index}}员工 --> - + {{item.realName}} @@ -119,9 +117,9 @@ export default { data() { return { - appltType:uni.getStorageSync("appltType"), + appltType: uni.getStorageSync("appltType"), value: '', - liters:0, + liters: 0, show: false, pic: 0, hindex: 0, @@ -129,45 +127,47 @@ aindex: null, sindex: null, // 店铺信息 - store:{ - name:"测试油站", - description:"济南分店", - address:"济南槐荫区" + store: { + name: "测试油站", + description: "济南分店", + address: "济南槐荫区" }, // 店铺福利信息 - welfare:[], + welfare: [], // 距离信息 distance: "", // 当前店铺id - storeId:"", + storeId: "", // 油号列表信息 - oilNumberList:[], + oilNumberList: [], // 油枪列表信息 - oilGunList:[], + oilGunList: [], // 员工列表信息 staffList: [], // 加油金额列表 - amountList:[100,200,300], + amountList: [100, 200, 300], // url信息 baseUrl: this.$baseUrl, // 油价 - oilPrice:0, + oilPrice: 0, // 油品单位 - oilUnit:"", + oilUnit: "", + AppToken: uni.getStorageSync("App-Token"), + // 油品订单信息 - oilOrder:{ - storeId:"", - couponId:"", - commissionAmount:0, - staffId:"", - terminal:"applet", - oils:"", - oilGunNum:"", - oilNum:"", - orderAmount:0, - discountAmount:0, - payAmount:0, - payType:uni.getStorageSync("appltType"), + oilOrder: { + storeId: "", + couponId: "", + commissionAmount: 0, + staffId: "", + terminal: "applet", + oils: "", + oilGunNum: "", + oilNum: "", + orderAmount: 0, + discountAmount: 0, + payAmount: 0, + payType: uni.getStorageSync("appltType"), }, } }, @@ -175,14 +175,14 @@ tabbar }, onLoad(query) { - if (uni.getStorageSync("appltType") == "WECHAT"){ + if (uni.getStorageSync("appltType") == "WECHAT") { const q = decodeURIComponent(query.q) // 获取到二维码原始链接内容 if (query.q) { let str = q.split("?")[1]; let storeId = "19"; - + let staffId = ""; - if (str.includes("&")){ + if (str.includes("&")) { let arr = str.split("&"); arr.forEach(item => { if (item.includes("storeId")) { @@ -191,7 +191,7 @@ staffId = item.split("=")[1] } }) - }else{ + } else { storeId = str.split("=")[1] } uni.setStorageSync("storeId", storeId) @@ -200,20 +200,21 @@ this.staffId = uni.getStorageSync("inviteStaffId") this.getStore(uni.getStorageSync("storeId")); } - }else{ - if (uni.getStorageSync("storeId")){ + } else { + if (uni.getStorageSync("storeId")) { this.getStore(uni.getStorageSync("storeId")); } } - - - - + + + }, onShow() { // this.isExistStoreId(); this.getStore(uni.getStorageSync("storeId")); // this.getStore(0); + this.getTheJudgmentIsTheSame() + }, methods: { // 打开数字键盘 @@ -221,15 +222,15 @@ this.show = true this.$refs.popup1.open('bottom') }, - isExistStoreId(){ - if (uni.getStorageSync("storeId") != ""){ + isExistStoreId() { + if (uni.getStorageSync("storeId") != "") { this.getStore(uni.getStorageSync("storeId")); - }else{ + } else { this.getAddress(); } }, // 获取门店信息 - getStore(id){ + getStore(id) { // uni.showToast({ // title:333 // }) @@ -237,8 +238,10 @@ request({ url: "business/storeInformation/store/queryStoreById", method: 'post', - data:{"storeId":id}, - }).then((res)=>{ + data: { + "storeId": id + }, + }).then((res) => { _this.getOilNumber(id); _this.getStaffList(id) _this.store = res.data @@ -255,16 +258,16 @@ } }).catch(err => { uni.showLoading({ - title:JSON.stringify(err)+222 + title: JSON.stringify(err) + 222 }) }) }, // 获取当前位置 - getAddress(){ + getAddress() { let _this = this; uni.getLocation({ // 谷歌使用wgs84 其他使用gcj02 - type: 'gcj02', // 使用国测局坐标系 + type: 'gcj02', // 使用国测局坐标系 success: function(res) { // console.log('经度: ' + res.longitude); // console.log('纬度: ' + res.latitude); @@ -275,19 +278,19 @@ "lon": res.longitude, "lat": res.latitude }, - }).then((response)=>{ + }).then((response) => { _this.distance = (response.data.distance).toFixed(1); _this.store = response.data.store; _this.storeId = response.data.store.id; _this.getOilNumber(_this.storeId); _this.getStaffList(_this.storeId) let welfare = response.data.store.welfare; - if (welfare != undefined && welfare!=null && welfare!=""){ - if (welfare.includes(",")){ - _this.welfare = response.data.store.welfare.split(","); - }else { - _this.welfare.push(response.data.store.welfare); - } + if (welfare != undefined && welfare != null && welfare != "") { + if (welfare.includes(",")) { + _this.welfare = response.data.store.welfare.split(","); + } else { + _this.welfare.push(response.data.store.welfare); + } } }) }, @@ -297,73 +300,73 @@ }); }, // 获取当前店铺油号信息 - getOilNumber(storeId){ + getOilNumber(storeId) { let _this = this; request({ // url: "business/petrolStationManagement/oilNumber/getOilNumberName/" + storeId, url: "business/petrolStationManagement/oilGun/selectByNumber/" + storeId, method: 'get', - }).then((res)=>{ + }).then((res) => { _this.oilNumberList = res.data; - if (res.data){ + if (res.data) { // _this.getOilGun(res.data[0].numberId); _this.oilPrice = res.data[0].oilPrice _this.oilUnit = res.data[0].unit _this.oilOrder.oils = res.data[0].oilNameId - if (res.data[0].oilGunList){ + if (res.data[0].oilGunList) { _this.oilGunList = res.data[0].oilGunList _this.oilOrder.oilGunNum = res.data[0].oilGunList[0].id - uni.setStorageSync("tankId",res.data[0].oilGunList[0].tankId) + uni.setStorageSync("tankId", res.data[0].oilGunList[0].tankId) } } }) }, // 获取当前店铺油号对应的油枪信息 - getOilGun(numberId){ + getOilGun(numberId) { let _this = this; request({ url: "business/petrolStationManagement/oilGun/queryGunList/" + numberId, method: 'get', - }).then((res)=>{ + }).then((res) => { _this.oilGunList = res.data _this.oilOrder.oilGunNum = res.data[0].id }) }, // 获取当前店铺员工信息列表 - getStaffList(storeId){ + getStaffList(storeId) { let _this = this; request({ url: "business/member/staff/queryStaffList/" + storeId, method: 'get', - }).then((res)=>{ + }).then((res) => { _this.staffList = res.data }) }, // 跳转订单详情页,并支付 - getSIndex(index,id) { + getSIndex(index, id) { this.sindex = index // 校验油罐内油量是否足够 request({ url: "business/petrolStationManagement/oilTank/" + uni.getStorageSync('tankId'), method: 'get', - }).then((res)=>{ - if (res.data.storedQuantity-this.liters<0){ + }).then((res) => { + if (res.data.storedQuantity - this.liters < 0) { uni.showToast({ - title:"所加油的升数大于油罐内的升数,请重新选择加油升数", - icon:"none" + title: "所加油的升数大于油罐内的升数,请重新选择加油升数", + icon: "none" }) return; - }else { + } else { this.toPayment(id) } - + }) }, - toPayment(id){ + toPayment(id) { this.oilOrder.orderAmount = this.value this.oilOrder.storeId = this.storeId this.oilOrder.staffId = id - this.oilOrder.oilNum = (this.value/this.oilPrice).toFixed(2) + this.oilOrder.oilNum = (this.value / this.oilPrice).toFixed(2) this.oilOrder.tankId = uni.getStorageSync("tankId") let _this = this; // 添加油品订单信息 @@ -371,20 +374,20 @@ url: "business/oilOrder/addOilOrder", method: 'post', data: _this.oilOrder, - }).then((res)=>{ + }).then((res) => { uni.navigateTo({ url: '/pagesRefuel/orderDetail/index?orderNo=' + res.data, }) }) }, // 选择加油金额 - getAIndex(index,amount) { - this.value = amount+"" + getAIndex(index, amount) { + this.value = amount + "" this.aindex = index - this.liters = (amount/this.oilPrice).toFixed(2) + this.liters = (amount / this.oilPrice).toFixed(2) }, // 选择油品信息 - getHIndex(index,data) { + getHIndex(index, data) { this.hindex = index // console.log(data) // this.getOilGun(data.numberId) @@ -393,68 +396,68 @@ this.oilPrice = data.oilPrice this.oilUnit = data.unit this.oilOrder.oils = data.oilNameId - uni.setStorageSync("tankId",data.oilGunList[0].tankId) + uni.setStorageSync("tankId", data.oilGunList[0].tankId) }, // 选择油枪信息 - getQIndex(index,data) { + getQIndex(index, data) { this.qindex = index this.oilOrder.oilGunNum = data.id - uni.setStorageSync("tankId",data.tankId) + uni.setStorageSync("tankId", data.tankId) }, goRefuel() { uni.navigateTo({ url: '/pagesRefuel/pagesRefuel/index' }) }, - change(){ + change() { }, // 关闭弹窗 - closeStaff(){ + closeStaff() { this.$refs.popup.close() }, // 数字键盘确定按钮 - submitAmount(){ + submitAmount() { // 校验油罐内油量是否足够 request({ url: "business/petrolStationManagement/oilTank/" + uni.getStorageSync('tankId'), method: 'get', - }).then((res)=>{ - if (res.data.storedQuantity-this.liters<0){ + }).then((res) => { + if (res.data.storedQuantity - this.liters < 0) { uni.showToast({ - title:"所加油的升数大于油罐内的升数,请重新选择加油升数", - icon:"none" + title: "所加油的升数大于油罐内的升数,请重新选择加油升数", + icon: "none" }) return; - }else { - if (this.value!="" && this.qindex!=null){ + } else { + if (this.value != "" && this.qindex != null) { this.show = false - if (uni.getStorageSync("inviteStaffId")){ + if (uni.getStorageSync("inviteStaffId")) { this.toPayment(uni.getStorageSync("inviteStaffId")) - }else{ + } else { this.$refs.popup.open('bottom') } - }else{ - if (this.value=="") { + } else { + if (this.value == "") { uni.showToast({ - title:"请输入加油金额", - icon:"error" + title: "请输入加油金额", + icon: "error" }) - }else{ + } else { uni.showToast({ - title:"请选择油枪号", - icon:"error" + title: "请选择油枪号", + icon: "error" }) } } } }) - - + + }, changeVal(val) { this.value = val; - this.liters = (this.value/this.oilPrice).toFixed(2) + this.liters = (this.value / this.oilPrice).toFixed(2) }, backspaceVal(val) { this.value = val; @@ -463,38 +466,56 @@ this.liters = 0 } else { this.amount = val; - this.liters = (this.value/this.oilPrice).toFixed(2) + this.liters = (this.value / this.oilPrice).toFixed(2) } }, valChange(val) { // 将每次按键的值拼接到value变量中,注意+=写法 uni.vibrateShort({ - success: function () {} + success: function() {} }); let index = this.value.indexOf(".") - if(index!=-1){ - if ((this.value.length-index)>=3){ + if (index != -1) { + if ((this.value.length - index) >= 3) { return; } - - }else{ - if (this.value.length>=7 && val!="."){ + + } else { + if (this.value.length >= 7 && val != ".") { return; } } this.value += val; - this.liters = (this.value/this.oilPrice).toFixed(2) + this.liters = (this.value / this.oilPrice).toFixed(2) // console.log(this.value); }, + // 判断token是否与当前连锁店id相同 + getTheJudgmentIsTheSame() { + // 判断是否登录 + if (!this.AppToken) { + return; + } + request({ + url: 'chainStoreInfo/theJudgmentIsTheSame', + method: 'get', + data: { + "chainStoreId": uni.getStorageSync("chainStoreId") + } + }).then(res => { + if (!res.data) { + uni.removeStorageSync("App-Token"); + } + }) + }, // 退格键被点击 backspace() { uni.vibrateShort({ - success: function () {} + success: function() {} }); // 删除value的最后一个字符 if (this.value.length) { this.value = this.value.substr(0, this.value.length - 1); - this.liters = (this.value/this.oilPrice).toFixed(2) + this.liters = (this.value / this.oilPrice).toFixed(2) } // console.log(this.value); } @@ -616,6 +637,7 @@ display: flex; flex-wrap: wrap; } + .wrap-box1 { width: 100%; display: flex; @@ -636,6 +658,7 @@ padding: 12px 0px; border-radius: 6px; } + .box-oil1 { width: 29%; display: flex; @@ -648,6 +671,7 @@ padding: 12px 0px; border-radius: 6px; } + .box-oil2 { width: 28%; height: 25px; @@ -712,4 +736,4 @@ text-align: right; color: #999999; } - + \ No newline at end of file diff --git a/gasStation-uni/pagesLogin/login/login.vue b/gasStation-uni/pagesLogin/login/login.vue index 5ba0aa001..26b87d9cc 100644 --- a/gasStation-uni/pagesLogin/login/login.vue +++ b/gasStation-uni/pagesLogin/login/login.vue @@ -152,9 +152,9 @@ encryptedIv: e.detail.iv, encryptedData: e.detail.encryptedData, userInfo: { - storeId: 12, + storeId: uni.getStorageSync("storeId"), staffId: "", - phone: '16548796325' + // phone: '16548796325' }, type: 'phone',