9 Commits

Author SHA1 Message Date
xiaozhiyong
607e13f266 更新 2024-01-19 13:39:47 +08:00
xiaozhiyong
fdf4935fb2 更新 2023-11-29 18:12:08 +08:00
xiaozhiyong
5c11f4644f 更新 2023-11-21 16:29:43 +08:00
xiaozhiyong
66ce529d41 Merge branch 'master' of http://121.196.213.68:3000/caoliancun/MP_XOIL_company_new 2023-11-20 13:24:33 +08:00
xiaozhiyong
74d32fa0a7 更新 2023-11-20 13:24:17 +08:00
928947bab4 Merge pull request '12' (#13) from caolc into master
Reviewed-on: #13
2023-11-19 10:42:05 +00:00
caoliancun
9d2c86a20d 12 2023-11-19 18:40:26 +08:00
xiaozhiyong
ff0986230c Merge branch 'master' of http://121.196.213.68:3000/caoliancun/MP_XOIL_company_new 2023-10-12 11:04:05 +08:00
642d6b07f8 Merge pull request 'xiaozy' (#12) from xiaozy into master
Reviewed-on: #12
2023-09-27 06:16:17 +00:00
18 changed files with 161 additions and 116 deletions

26
App.vue
View File

@@ -67,7 +67,7 @@
value: item.id
})
})
console.log(channelCodes, productCodes, siteBrands)
// console.log(channelCodes, productCodes, siteBrands)
this.menuList[0].detailList = this.menuList[0].detailList.concat(channelCodes)
this.menuList[1].detailList = this.menuList[1].detailList.concat(productCodes)
this.menuList[2].detailList = this.menuList[2].detailList.concat(siteBrands)
@@ -95,10 +95,12 @@
if(view.route === 'BagStation/pages/stationDetail/stationDetail') {
uni.removeStorageSync('refuseLogin')
}
// console.log('white.includes(view.route)',white.includes(view.route))
// // 是否跳过登陆
let isRefuseLogin = uni.getStorageSync('refuseLogin')
if(isRefuseLogin || white.includes(view.route) || view.route.includes('BagAuth')) return
this.getAmount()
// console.log('111111111111111')
this.getAmount()
})
},
// 是否token过期或ip更改
@@ -106,10 +108,14 @@
// clearTimeout(loginTimer)
accountApi.getTotalOilCardInfo().then(res => {
if (res.code == 42011) {
uni.setStorageSync('Authorization',null)
uni.setStorageSync('openid',null)
uni.showModal({
title: '需要您重新登录',
content: res.msg,
duration: '3000',
showCancel:false,
success: function(res) {
if (res.confirm) {
uni.redirectTo({
@@ -126,12 +132,16 @@
},
onUnload() {
uni.hideLoading()
},
onShow: function(option) {
const token = uni.getStorageSync('Authorization')
const openid = uni.getStorageSync('openid')
if (token && openid) {
this.getAmount()
}
// const token = uni.getStorageSync('Authorization')
// const openid = uni.getStorageSync('openid')
// if (token && openid) {
// this.getAmount()
// }
uni.getLocation({
type: 'wgs84',
success: function(res) {
@@ -142,7 +152,9 @@
}
});
},
}
</script>
<style lang="scss">

View File

@@ -280,9 +280,16 @@
submit() {
this.checkFn('name');
this.checkFn('plateNumber');
if (!this.fromStyle.nameType || !this.fromStyle.plateNumberType) {
if (!this.fromStyle.nameType) {
uni.showToast({
title: '还有信息没有填哦',
title: '请输入姓名',
icon: 'error'
});
return
};
if (!this.fromStyle.plateNumberType) {
uni.showToast({
title: '车牌号格式有误',
icon: 'error'
});
return

View File

@@ -153,7 +153,7 @@
<!-- <button class="cu-btn block lg margin-top " @tap="delOrder">删除订单</button> -->
</view>
<view class="customer-service" @click="arousePhone">
<image src="../../static/img/customer-service.png"></image>
<image src="../../BagStation/static/img/customer-service.png"></image>
联系客服
</view>
</view>
@@ -161,7 +161,7 @@
<script>
import orderApi from '@/api/oil-order.js'
import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue" //二维码生成器
import tkiQrcode from "../pages/components/tki-qrcode/tki-qrcode.vue" //二维码生成器
import oilSiteApi from '@/api/oil-site.js'
export default {

View File

@@ -164,7 +164,7 @@
<script>
import orderApi from '@/api/oil-order.js'
import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue" //二维码生成器
import tkiQrcode from "../pages/components/tki-qrcode/tki-qrcode.vue" //二维码生成器
import oilSiteApi from '@/api/oil-site.js'
import ureaFinanceApi from '../../api/urea_finance.js'
export default {

View File

@@ -135,7 +135,7 @@
import toilApi from '@/api/toil.js'
import ThirdPartyVoucher from '../components/third-party-voucher/third-party-voucher.vue'
import oilSiteApi from '@/api/oil-site.js'
import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue" //二维码生成器
import tkiQrcode from "../components/tki-qrcode/tki-qrcode.vue" //二维码生成器
export default {
components: {
ThirdPartyVoucher,

View File

@@ -91,6 +91,7 @@
},
methods: {
_makeCode() {
let that = this
if (!this._empty(this.val)) {
qrcode = new QRCode({

View File

@@ -144,7 +144,7 @@
import toilApi from '@/api/toil.js'
import ThirdPartyVoucher from '../components/third-party-voucher/third-party-voucher.vue'
import oilSiteApi from '@/api/oil-site.js'
import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue" //二维码生成器
import tkiQrcode from "../components/tki-qrcode/tki-qrcode.vue" //二维码生成器
export default {
components: {
ThirdPartyVoucher,

View File

@@ -487,7 +487,7 @@
markerList.forEach((item, index) => {
let configure = {
siteId: item.id,
id: Number(`${index}`), //2023.08.30 在此处踩坑 一作这b竟然把id重新赋值了
id: Number(`${index}`), //2023.08.30 在此处踩坑 一作这b竟然把id重新赋值了。 一作去好好查一下官网的MAP中的marker的文档 id字段的注意事项再看一下后台给的id 补补课
imgCustomCallout: this.olitype(item.siteChannel),
iconPath: '../../static/img/tt.png',
width: 5,

View File

@@ -22,7 +22,7 @@
<script>
import serve from '@/api/account.js'
import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue'
import tkiQrcode from '@/BagStation/pages/components/tki-qrcode/tki-qrcode.vue'
export default {
components: {
tkiQrcode
@@ -39,12 +39,14 @@
computed: {
phoneHandle() {
let phone = this.user.userPhone
console.log('user',this.user)
if(!phone) return ''
return `${phone.substr(0,3)}****${phone.substr(-4)}`
}
},
methods: {
getQrStr(reset = 0) {
console.log('this.user', this.user)
if (this.user.id) {
serve.getQrStr(this.user.id, reset).then(res => {
if (!res.data) return

View File

@@ -56,16 +56,16 @@
seleIndex:0,
kmData:[
{
lable:'20KM',
value:20000
lable:'5KM',
value:5000
},
{
lable:'10KM',
value:10000
},
{
lable:'30KM',
value:30000
},
{
lable:'50KM',
value:50000
}
]
}

View File

@@ -62,7 +62,7 @@
width: 40,
height: 50
},
radius: 20000,
radius: 5000,
LastCoordinate: [],
timer: null,
TXSDK: null,
@@ -212,7 +212,7 @@
// list.length = 100;
this.markers = this.locationProcessing(res.data);
this.spareMarkers = JSON.parse(JSON.stringify(this.markers));
console.log(this.spareMarkers, '////////////////////////')
// console.log(this.spareMarkers, '////////////////////////')
// markersArray.forEach((item,index)=>{
// })
@@ -363,8 +363,8 @@
},
mapUpdated(e) {
let that = this
console.log('%c 更新', 'font-size:50px;color:red');
console.log(e, '*****************************************')
// console.log('%c 更新', 'font-size:50px;color:red');
// console.log(e, '*****************************************')
// that.mapContext.getScale({
// success: function(e) {
// // that.$nextTick(function() {

View File

@@ -172,7 +172,7 @@
import accountApi from '@/api/account.js'
import priceTab from '../components/price-tab.vue'
import threeSites from '@/components/three-sites.vue'
import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue" //二维码生成器
import tkiQrcode from "../components/tki-qrcode/tki-qrcode.vue" //二维码生成器
export default {
components: {
priceTab,
@@ -215,10 +215,10 @@
if (this.activeChannelCode) {
if (this.secondChannelCode) {
this.posName = '壳牌'
return `../../BagStation/static/img/YDJY.png`
return `../../../static/img/YDJY.png`
} else {
this.posName = '星油云站'
return `../../BagStation/static/img/${this.activeChannelCode}.png`
return `../../../static/img/${this.activeChannelCode}.png`
}
}
},

View File

@@ -127,7 +127,7 @@
<script>
import orderApi from '@/api/oil-order.js'
import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue" //二维码生成器
import tkiQrcode from "../pages/components/tki-qrcode/tki-qrcode.vue" //二维码生成器
import oilSiteApi from '@/api/oil-site.js'
import ureaFinanceApi from '../../api/urea_finance.js'
export default {

View File

@@ -175,18 +175,11 @@ export default {
}
})
},
//检测在线状态
//检测在线状态
isLoginSuccess() {
return request({
url: `/oil-identity/operationUser/isLoginSuccess`,
method: 'POST',
})
},
getOilDriverQrCode(params) {
return request({
url: '/oil-site/qrCode/getOilDriverQrCode',
method:'post',
data:params
})
},
}

View File

@@ -1,19 +1,27 @@
<template>
<!-- 三个最近的油站弹窗 -->
<view>
<view class="cu-modal" :class="showThreeSites?'show':''" @touchmove.stop>
<view class="cu-modal" :class="showThreeSites?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<!-- <view class="content">选择油站</view> -->
<view class="action" @tap="hideModal">
<view class="content">选择油站</view>
<view class="action" @tap="hideModal('sites')">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="bg-white pb30">
<tki-qrcode ref="qrcode" cid="2" :val="qrcodeText" :size="400" :isHaveBg="true" pdground="#000"
foreground="#000" background="#fff" onval showLoading loadMake />
<view class="text-center padding-top text-sm margin-bottom">
提示该二维码每隔<text style="color: #ff0000;">3分钟</text>自动刷新一次
<view class="padding-xl bg-white">
<view class="" v-if="siteList.length>0">
<three-item v-for="(item,index) in siteList" :key="item.id" :site-item="item" :first="index==0"
class="cu-list menu-avatar cu-item " @tap="toDetail(item)">
</three-item>
</view>
<view class="" v-else>
<my-empty></my-empty>
</view>
<view class="btn-box padding-top">
<button @tap="toSitePage" class="cu-tn bg-red round margin-bottom lg" color="#3982F6"
size="large">前往油站列表查找
</button>
</view>
</view>
</view>
@@ -23,13 +31,11 @@
</template>
<script>
import serve from '@/api/oil-site.js'
import accountApi from '@/api/account.js'
import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue'
import oilSiteApi from '@/api/oil-site.js'
import threeItem from './three-item.vue'
export default {
components: {
tkiQrcode
threeItem
},
props: {
showThreeSites: {
@@ -39,63 +45,91 @@
},
data() {
return {
qrcodeText: '',
user: uni.getStorageSync('user'),
timerInstance: null
siteList: [],
imgURL: this.global.baseURL,
}
},
watch: {
showThreeSites: {
handler(newval) {
if (newval) {
this.initQRCode()
created() {
this.getSiteList()
},
watch:{
showThreeSites:{
handler(newval){
if(newval==true){
this.getSiteList()
}
},
immediate: true
}
}
},
methods: {
toSitePage(){
// uni.setStorageSync('activeCur','station')
uni.switchTab({
url: '/pages/tabbar/station/stationList'
});
},
refreshLocation(){
uni.getLocation({
type: 'wgs84',
success: function (res) {
uni.setStorageSync('location',res)
}
});
},
getSiteList() {
this.refreshLocation()
let data1 = {
currentPage: 1,
pageSize: 3,
params: { //类型Object 必有字段 备注:// 筛选对象
sort: "juli", //类型String 必有字段 备注:// 智能排序 ( price价格最低 juli距离最近 ) 默认距离排序
...uni.getStorageSync('location'),
...this.filterData
// siteBrand: "", // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
// channelCode: "", // 备注:// 渠道编码 ( OIL星油 WJY万金油 LV老吕找油网 TY团油 YDJY一点加油壳牌)
// oilProductCode: "" // 备注:// 油号选择 ( 0# 92# 92#)
}
async initQRCode() {
if (this.timerInstance) {
clearInterval(this.timerInstance)
this.timerInstance = null
}
let accountResult = await accountApi.getUserAccount()
if (!accountResult.data.length) return
let params = {
companyId: accountResult.data[0].companyId,
orderSource: "WECHAT_MINIAPPS",
customerId: this.user.id,
channelCode: 'XOIL',
oilCardNature: accountResult.data[0].oilCardType, //油卡性质
accountCardCode: accountResult.data[0].accountCardCode //油卡卡号
}
serve.getOilDriverQrCode(params).then(res => {
if (!res.data) return
this.qrcodeText = res.data.codeStr
// readOnlySites
oilSiteApi.getSiteList(data1).then(res => {
if (res.code == 20000) {
this.siteList = res.data.list
}
})
this.timerInstance = setInterval(() => {
serve.getOilDriverQrCode(params).then(res => {
if (!res.data) return
this.qrcodeText = res.data.codeStr
})
}, 1000 * 60 * 3)
},
hideModal() {
clearInterval(this.timerInstance)
this.timerInstance = null
this.$refs.qrcode._clearCode()
this.$emit('hideOneModal')
toDetail(item) {
let itemS = JSON.stringify(item)
console.log(itemS)
uni.navigateTo({
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
fail: (err) => {
// console.log(err)
},
success: () => {
// console.log('err')
}
})
},
callShipper() {
uni.makePhoneCall({
phoneNumber: this.waybillData.shippePhone
})
},
hideModal(name) {
this.$emit('hideOneModal', name)
},
registerContracts() {
this.$emit('registerContracts')
},
toSetLocation() {
this.$emit('toSetLocation')
},
toAuth() {
uni.navigateTo({
url: '认证路径'
})
}
}
}
</script>
@@ -120,8 +154,4 @@
left: 0.2rem;
min-width: 100%;
}
.pb30 {
padding-bottom: 30rpx;
}
</style>

View File

@@ -53,7 +53,7 @@
}
},
mounted() {
console.log('mounted')
// console.log('mounted')
},
onLoad(option) {
this.option = option;
@@ -62,7 +62,7 @@
onReady(option) {},
methods: {
versionUpdate() {
console.log('versionUpdate')
// console.log('versionUpdate')
let that = this
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function(res) {
@@ -102,7 +102,7 @@
if(res.code==20000) isOnline = true
}).catch(err=>{})
}
console.log(isOnline,'isOnline')
// console.log(isOnline,'isOnline')
if (isOnline) {
this.key = '在线'
} else {
@@ -131,7 +131,7 @@
})
}
if (this.key == '在线') {
console.log(type, 'typetypetypetype');
// console.log(type, 'typetypetypetype');
uni.switchTab({
url: `/pages/tabbar/home/home`,
@@ -148,7 +148,7 @@
},
Interceptor(id) {
let taht = this
console.log(`%c 检测到参数拦截器启动`, 'color:red;font-size:50px');
// console.log(`%c 检测到参数拦截器启动`, 'color:red;font-size:50px');
// this.tools.overallInterceptor((opentype) => {
// uni.removeInterceptor(opentype);
// wxCode.getQrCodeType({
@@ -181,7 +181,7 @@
})
},
getFilterData() {
console.log('wodefenzhi')
// console.log('wodefenzhi')
oilSiteApi.getCheckInfo().then(res => {
if (res.code == 20000) {
@@ -206,13 +206,13 @@
value: item.id
})
})
console.log(channelCodes, productCodes, siteBrands)
// console.log(channelCodes, productCodes, siteBrands)
this.menuList[0].detailList = this.menuList[0].detailList.concat(channelCodes)
this.menuList[1].detailList = this.menuList[1].detailList.concat(productCodes)
this.menuList[2].detailList = this.menuList[2].detailList.concat(siteBrands)
uni.setStorageSync('filterData', this.menuList)
uni.setStorageSync('productCodeList', res.data.productCodeList)
console.log(res, '%c 这里是启动页调用的菜单列表', 'font-size:36px;color:red;')
// console.log(res, '%c 这里是启动页调用的菜单列表', 'font-size:36px;color:red;')
// this.$refs.slFilter.resetMenuList(this.menuList)
}
})

View File

@@ -5,10 +5,10 @@ import utils from '@/utils/encode'
// const env = 'test'
const env = 'production'
// 45
const testUrl = 'http://192.168.1.83:38080'
// const productUrl = 'https://www.xingoil.com/adminapi'
const testUrl = 'http://192.168.1.132:38080'
const productUrl = 'https://www.xingoil.com/adminapi'
const productUrl = 'http://uat.xingoil.com/adminapi'
// const productUrl = 'http://uat.xingoil.com/adminapi'
// const productUrl = 'http://192.168.0.191:38080'
// const productUrl = 'http://121.196.213.68/adminapi'
const service = axios.create({