merge master

This commit is contained in:
xiaozhiyong
2023-03-20 09:47:19 +08:00
29 changed files with 656 additions and 463 deletions

39
App.vue
View File

@@ -8,6 +8,35 @@
export default {
data() {
return {
menuList: [{
title: '渠道',
isMutiple: false,
key: 'channelCode',
detailList: [{
title: "全部",
value: ""
}]
},
{
title: '0#轻柴油',
key: 'oilProductCode',
isMutiple: false,
detailList: [{
title: "全部",
value: ""
}]
},
{
title: '品牌',
key: 'siteBrand',
isSort: true,
isMutiple: false,
detailList: [{
title: "全部",
value: ""
}]
}
],
loginStatus: 'online',
msg: ''
}
@@ -70,11 +99,13 @@
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)
console.log(uni.getStorageSync('filterData'),'pppppppppppppppppppppppp')
// this.$refs.slFilter.resetMenuList(this.menuList)
}
})
},
onShareAppMessage() {
let that = this
wx.onAppRoute(() => {
let white = ['BagStation/pages/stationDetail/stationDetail']
// console.log('当前页面路由发生变化 触发该事件onShareAppMessage')
@@ -87,7 +118,7 @@
// data.isOverShare = true
view.onShareAppMessage = () => { //重写分享配置
return {
title: '百川加油',
title: '中品加油',
path: "/pages/index/startPage/startPage", //若无path 默认跳转分享页
// imageUrl:'/image/onshowMessage.png' //若无imageUrl 截图当前页面
imageUrl: 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/login-bg.png',
@@ -122,8 +153,12 @@
clearTimeout(onlineTimer)
}
})
}else{
// if(!uni.getStorageSync('filterData')){
// that.getFilterData()
// }
}
}, 1000)
}, 500)
} else {
// loginTimer = setTimeout(() => {

View File

@@ -8,7 +8,7 @@
<view class="padding-xs">
<checkbox @tap="onChange" class='round red chagesize' :class="checked?'checked':''" :checked="checked?true:false"
value="C"></checkbox> 我已阅读并同意
<text @tap="toAgree('baichuanUserAgree')" class="oil-main-color">用户协议</text><text @tap="toAgree('baichuanPrivacyAgreement')" class="oil-main-color">隐私政策</text>
<text @tap="toAgree('zhongpinUserAgree')" class="oil-main-color">用户协议</text><text @tap="toAgree('zhongpinPrivacyAgreement')" class="oil-main-color">隐私政策</text>
</view>
</view>
</view>

View File

@@ -25,7 +25,7 @@
</view>
<view class="cu-item flex-sub" :class="0==TabCur?'text-red cur':''" @tap="tabSelect(0)">
<view class="cu-item flex-sub" :class="0==TabCur?'text-blues cur':''" @tap="tabSelect(0)">

View File

@@ -7,9 +7,9 @@
:style="'background-image: url('+imgURL+'login-bg-top.png);height: 480upx;'">
<view class="padding-xl ">
<view class="image login-bg">
<image :src="imgURL+'new-logo.png'" mode="widthFix"></image>
<image :src="otherImgURL+'logo@ZP.png'" mode="widthFix"></image>
<view class="text-bold text-lg padding-top">
一路油你 百川加油
一路油你 中品加油
</view>
<view class="text-df text-grey padding-top-xs padding-bottom">
登录后加油更便捷
@@ -29,7 +29,7 @@
</view> -->
<view class="cu-item text-bold text-lg flex-sub "
:class="[0==TabCur?'text-red cur':'',(animation=='animation-fades'&&0==TabCur)?'animation-fade':'']"
:class="[0==TabCur?'text-blues cur':'',(animation=='animation-fades'&&0==TabCur)?'animation-fade':'']"
@tap="tabSelect(0)">
个人账号
</view>
@@ -144,6 +144,7 @@
verifyCodeToken: "",
accuntSource: false,
imgURL: this.global.imgURL,
otherImgURL: this.global.otherImgURL,
loadModal: false,
active: 0,
@@ -229,7 +230,7 @@
title: res.data.msg,
content: '企业账号只能由企业分配,请确认是否当前手机号,如有疑问,请联系客服处理',
showCancel: false,
confirmColor: '#FE0505',
confirmColor: '#1890FF',
success: (res) => {
if (confirm) {
@@ -270,7 +271,7 @@
uni.showModal({
title: res.data.msg,
confirmText: '立即注册',
confirmColor: '#FE0505',
confirmColor: '#1890FF',
success: (res) => {
if (res.confirm) {
uni.setStorageSync('username', that.driver.username)

View File

@@ -9,7 +9,7 @@
<view class="image login-bg">
<image :src="imgURL+'new-logo.png'" mode="widthFix"></image>
<view class="text-bold text-lg padding-top">
一路油你 百川加油
一路油你 中品加油
</view>
<view class="text-df text-grey padding-top-xs padding-bottom">
注册为个人会员

View File

@@ -75,7 +75,7 @@
</view>
<view class="cu-item arrow">
<view class="content">
关于佰川能源
关于中品能源
</view>
<view class="value">
版本{{'1.0.0'}}

View File

@@ -113,7 +113,9 @@
invoicBankNumber: '', //银行账号
remark: '', //发票备注
invoicEmail: '', //电子邮箱,
orderSerialNumber: '' //订单编号
orderSerialNumber: '' ,//订单编号,
"clientBelong":"ZHONGPIN",
}
}
},

View File

@@ -3,12 +3,12 @@
<view class="text-center padding-sm">
<view class="text-lg">
请提醒加油员使用
<text class="text-red padding-left-xs padding-right-xs">{{showtitles}}</text>
<text class="text-blues padding-left-xs padding-right-xs">{{showtitles}}</text>
进行订单核实
</view>
</view>
<scroll-view scroll-x class=" nav text-center">
<view class="cu-item" v-for="(item,index) in channelList" v-if="index==activeCur" :class="index==activeCur?'text-red cur':''" :key="item.channelId"
<view class="cu-item" v-for="(item,index) in channelList" v-if="index==activeCur" :class="index==activeCur?'text-blues cur':''" :key="item.channelId"
@tap="tabSelect" :data-id="index" :data-channel-code="item.channelCode">
<image class="site-icon margin-right-sm" :src="imgURL+'site-'+item.channelCode+'.png'" mode="widthFix">
</image>
@@ -20,12 +20,12 @@
<view class="cu-list menu text-left">
<view class="cu-item" v-for="(itemx,index) in oilSitePriceDetailsVo" :key="index" v-if="itemx.sitePrice>0">
<label class="flex justify-between align-center flex-sub">
<radio class="round red" :class="radio=='radio' + index?'checked':''" :checked= " radio ==index?true : false" :value="index"></radio>
<radio class="round blue" :class="radio=='radio' + index?'checked':''" :checked= " radio ==index?true : false" :value="index"></radio>
<text class="cu-tag my-tag line-red text-lg">
</text>
<text class="text-bold text-black text-lg">{{itemx.oilProductCode}}</text>
<text class="text-bold text-red text-lg">{{itemx.sitePrice!=0?itemx.sitePrice:'-.--'}}/L</text>
<text class="text-bold text-blues text-lg">{{itemx.sitePrice!=0?itemx.sitePrice:'-.--'}}/L</text>
<text class="text-delete">{{itemx.oilSitePrice}}/L</text>
<text class="text-sm">预计每100L节省{{(100*(itemx.oilSitePrice - itemx.sitePrice))|moneyFormat}}</text>
</label>
@@ -39,9 +39,9 @@
<view class="padding-top-sm">
<view class="grid col-5 ">
<view v-for="(item,index) in checkBar" class="padding-xs" :key="index">
<button class="cu-btn red block" :class="item.checked?'bg-blue':'line-red'" @tap="ChooseBar" :data-value="item.value">
<button class="cu-btn red block" :class="item.checked?'bg-blue':'line-blues'" @tap="ChooseBar" :data-value="item.value">
{{item.name}}
<view class="cu-tag sm round" :class="item.checked?'bg-white text-red':'bg-blue'" v-if="item.hot">HOT</view>
<view class="cu-tag sm round" :class="item.checked?'bg-white text-blues':'bg-blue'" v-if="item.hot">HOT</view>
</button>
</view>
@@ -107,9 +107,9 @@
</view>
<view class="grid col-5 padding-sm">
<view v-for="(item,index) in checkMoney" class="padding-xs" :key="index">
<button class="cu-btn red block" style=" padding: 0;" :class="item.checked?'bg-blue':'line-red'" @tap="ChooseCheckMoney(item.value)" :data-value="item.value">
<button class="cu-btn blue block" style=" padding: 0;" :class="item.checked?'bg-blue':'line-blues'" @tap="ChooseCheckMoney(item.value)" :data-value="item.value">
{{item.name}}&yen;
<view class="cu-tag sm round" :class="item.checked?'bg-white text-red':'bg-blue'" v-if="item.hot">HOT</view>
<view class="cu-tag sm round" :class="item.checked?'bg-white text-blues':'bg-blue'" v-if="item.hot">HOT</view>
</button>
</view>
</view>
@@ -137,7 +137,7 @@
<view v-for="(item,index) in checkVol" class="padding-xs" :key="index">
<button class="cu-btn red block" :class="item.checked?'bg-blue':'line-red'" @tap="ChooseCheckVol" :data-value="item.value">
{{item.name}}
<view class="cu-tag sm round" :class="item.checked?'bg-white text-red':'bg-blue'" v-if="item.hot">HOT</view>
<view class="cu-tag sm round" :class="item.checked?'bg-white text-blues':'bg-blue'" v-if="item.hot">HOT</view>
</button>
</view>
@@ -164,7 +164,7 @@
<view class="margin cu-list pay-bar menu radius solid-top solid-bottom solid-left">
<view class="cu-item ">
<view class="">
合计<text class="text-red">{{realMoney>0?realMoney:'xxx.x'|moneyFormat}}</text>
合计<text class="text-blues">{{realMoney>0?realMoney:'xxx.x'|moneyFormat}}</text>
</view>
<view class="" @tap="showOrderMsg">
明细<text class="cuIcon-unfold padding-left-xs"></text>
@@ -181,8 +181,8 @@
<view class="margin cu-list pay-bar menu radius solid-top solid-bottom solid-left">
<view class="cu-item ">
<view class="">
合计<text class="text-red fr" v-if="activeChannelCode!='TY'">{{realMoney>0?realMoney:'xxx.x'|moneyFormat}}</text>
<text class="text-red fr" v-else>{{ty.realMoney>0?ty.realMoney-tyRes.depreciateAmount:'xxx.x'|moneyFormat}}</text>
合计<text class="text-blues fr" v-if="activeChannelCode!='TY'">{{realMoney>0?realMoney:'xxx.x'|moneyFormat}}</text>
<text class="text-blues fr" v-else>{{ty.realMoney>0?ty.realMoney-tyRes.depreciateAmount:'xxx.x'|moneyFormat}}</text>
</view>
<view class="" @tap="showOrderMsg">
明细<text class="cuIcon-unfold padding-left-xs"></text>
@@ -200,7 +200,7 @@
<view class="cu-bar bg-white justify-end">
<view class="content">订单明细</view>
<view class="action" @tap="showOrder=''">
<text class="cuIcon-close text-red"></text>
<text class="cuIcon-close text-blues"></text>
</view>
</view>
<view class="bg-white dashed-top">
@@ -224,7 +224,7 @@
</view>
<view class="padding-tb-xs text-left">
星油优惠
<text class="text-red fr">{{discount>0?discount:'xxx.x'|moneyFormat}}</text>
<text class="text-blues fr">{{discount>0?discount:'xxx.x'|moneyFormat}}</text>
</view>
</view>
<view class="" v-else>
@@ -238,25 +238,25 @@
</view>
<view class="padding-tb-xs text-left">
直降金额
<text class="text-red fr">{{tyRes.depreciateAmount>0?tyRes.depreciateAmount:'xxx.x'|moneyFormat}}</text>
<text class="text-blues fr">{{tyRes.depreciateAmount>0?tyRes.depreciateAmount:'xxx.x'|moneyFormat}}</text>
</view>
</view>
<view class="padding-tb-xs text-left">
优惠券
<text class="text-red fr">{{'----'}}</text>
<text class="text-blues fr">{{'----'}}</text>
</view>
<view class="padding-tb-xs text-left">
合计
<text class="text-red fr" v-if="activeChannelCode!='TY'">{{realMoney>0?realMoney:'xxx.x'|moneyFormat}}</text>
<text class="text-red fr" v-else>{{ty.realMoney>0?ty.realMoney:'xxx.x'|moneyFormat}}</text>
<text class="text-blues fr" v-if="activeChannelCode!='TY'">{{realMoney>0?realMoney:'xxx.x'|moneyFormat}}</text>
<text class="text-blues fr" v-else>{{ty.realMoney>0?ty.realMoney:'xxx.x'|moneyFormat}}</text>
</view>
</view>
<view class="cu-list margin pay-bar menu radius solid-top solid-bottom solid-left">
<view class="cu-item ">
<view class="">
合计<text class="text-red" v-if="activeChannelCode!='TY'">{{realMoney>0?realMoney:'xxx.x'|moneyFormat}}</text>
<text class="text-red" v-else>{{ty.realMoney>0?ty.realMoney-tyRes.depreciateAmount:'xxx.x'|moneyFormat}}</text>
合计<text class="text-blues" v-if="activeChannelCode!='TY'">{{realMoney>0?realMoney:'xxx.x'|moneyFormat}}</text>
<text class="text-blues" v-else>{{ty.realMoney>0?ty.realMoney-tyRes.depreciateAmount:'xxx.x'|moneyFormat}}</text>
</view>
<view class="" @tap="showOrder=''">
明细<text class="cuIcon-fold padding-left-xs"></text>
@@ -274,7 +274,7 @@
<view class="cu-bar bg-white justify-end">
<view class="content">车牌号非必填</view>
<view class="action" @tap="showPlate=''">
<text class="cuIcon-close text-red"></text>
<text class="cuIcon-close text-blues"></text>
</view>
</view>
@@ -587,7 +587,8 @@
payType : 'CUSTOMER_ACTIVE',
userType:'0',
xoilAmountGun:e ,
priceId:this.activeSitePrice
priceId:this.activeSitePrice,
clientBelong: "ZHONGPIN"
}
this.xoilAmountGun = e
oilSiteApi.getOrderDiscountInfo(number).then( res=>{
@@ -635,7 +636,8 @@
payType : 'CUSTOMER_ACTIVE',
userType:'0',
xoilAmountGun:e.detail.value,
priceId:this.activeSitePrice
priceId:this.activeSitePrice,
clientBelong: "ZHONGPIN"
}
this.xoilAmountGun = e.detail.value
oilSiteApi.getOrderDiscountInfo(number).then( res=>{
@@ -896,6 +898,7 @@
'version':1,
'xoilAmountGun':this.vol
}
console.log(orderData,'orderDataorderDataorderDataorderDataorderDataorderDataorderDataorderData');
oilOrderApi.createOrder(orderData).then(res => {
if (res.code == 20000) {
clearTimeout(this.timer)
@@ -919,7 +922,10 @@
// 获取渠道下价格等信息
getNewSitePrice(channelId) {
this.oilSitePriceDetailsVo = []
oilSiteApi.getNewSitePrice(channelId).then(res => {
oilSiteApi.getNewSitePriceZp({
channelId:channelId,
clientBelong: "ZHONGPIN"
}).then(res => {
if (res.code == 20000) {
this.plateNumbers = res.data.plateNumbers
this.oilSitePriceDetailsVo = res.data.oilSitePriceDetailsVo;

View File

@@ -1,7 +1,7 @@
<template>
<view class="padding-top">
<scroll-view scroll-x class=" nav text-center">
<view class="cu-item" v-for="(item,index) in channelList" :class="index==TabCur?'text-red cur':''" :key="item.channelId"
<view class="cu-item" v-for="(item,index) in channelList" :class="index==TabCur?'text-blues cur':''" :key="item.channelId"
@tap="tabSelect" :data-id="index">
<image class="site-icon margin-right-sm" :src="imgURL+'site-'+item.channelCode+'.png'" mode="widthFix">
</image>
@@ -16,7 +16,7 @@
</text>
<text class="text-bold text-black text-lg">{{itemx.oilProductCode}}</text>
<text class="text-bold text-red text-lg">{{itemx.sitePrice==0?'-.--':itemx.sitePrice}}/L</text>
<text class="text-bold text-blues text-lg">{{itemx.sitePrice==0?'-.--':itemx.sitePrice}}/L</text>
<text class="text-delete">{{itemx.oilSitePrice}}/L</text>
<text class="text-xs ">预计每100L节省{{(100*(itemx.oilSitePrice - itemx.sitePrice))|moneyFormat}}</text>
<!-- <text class="text-gray text-delete">$市场价</text>
@@ -89,6 +89,10 @@
}
}
},
created() {
},
methods: {
tabSelect(e) {
this.TabCur = e.currentTarget.dataset.id;

View File

@@ -112,7 +112,8 @@
getSiteInfo(id) {
let data2 = {
...uni.getStorageSync('location'),
siteId: id
siteId: id,
clientBelong: "ZHONGPIN"
}
oilSiteApi.getSiteDetails(data2).then(res => {
if (res.code == 20000) {

View File

@@ -2,7 +2,7 @@
<view>
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
<block slot="backText">返回</block>
<block slot="content">佰川收银台</block>
<block slot="content">中品收银台</block>
</cu-custom>
<view class="">
<view class="padding-xl text-center">
@@ -146,16 +146,16 @@
<view class="padding-tb-xs text-left">
星油优惠
<text
class="text-red fr">{{order.oilDiscountAmount>0?order.oilDiscountAmount:'xxx.x'|moneyFormat}}</text>
class="text-blues fr">{{order.oilDiscountAmount>0?order.oilDiscountAmount:'xxx.x'|moneyFormat}}</text>
</view>
<view class="padding-tb-xs text-left">
优惠券
<text
class="text-red fr">{{order.couponDiscountAmount>0?order.couponDiscountAmount:'xxx.x'|moneyFormat}}</text>
class="text-blues fr">{{order.couponDiscountAmount>0?order.couponDiscountAmount:'xxx.x'|moneyFormat}}</text>
</view>
<view class="padding-tb-xs text-left">
合计
<text class="text-red text-bold text-lg fr">
<text class="text-blues text-bold text-lg fr">
{{order.realAmount>0? moneyIntercept(order.realAmount) :'xxx.x' }}</text>
</view>
</view>
@@ -316,9 +316,9 @@
orderId: this.order.orderSerialNumber,
payClient: 'XOIL_DRIVER_WECHAT_APPLET', //"支付端。安卓XOIL_DRIVER_ANDROID小程序
userIp: (this.userIp?this.userIp:"36.57.160.59") ,
merchantNo:'10088997357'
merchantNo:'10089027856'
}
console.log(payData,'payDatapayData')
oilPayApi.aggregatePay(payData).then(res => {
if (res.code == 20000) {
uni.requestPayment({
@@ -327,10 +327,6 @@
success: (res1) => {
console.log(res)
if (res.code == 20000) {
// this.getPayStatus(this.outTradeNo)
// this.getLastMoney()
// this.getCards()
// console.log('success:' + JSON.stringify(res));
uni.showToast({
title: res.msg
})
@@ -351,23 +347,9 @@
}
},
fail: function(err) {
console.log(res, err, '************')
// console.log('fail:' + JSON.stringify(err));
}
})
// uni.showToast({
// title: res.msg
// })
// uni.redirectTo({
// url: '/BagStation/pages/makeOrder/payResult?status=success',
// fail: (err) => {
// console.log(err)
// }
// })
} else {
// uni.redirectTo({
// url: '/BagStation/pages/makeOrder/payResult?status=fail'
// })
}
})
@@ -392,7 +374,8 @@
"orderSerialNumber": this.order.orderSerialNumber, //类型String 必有字段 备注:订单编号
"payChannel": "BALANCE_PAYMENT", //类型String 必有字段 备注支付渠道BALANCE_PAYMENT余额支付
"orderMethod": "CUSTOMER_ACTIVE", //类型String 必有字段 备注订单产生方式CUSTOMER_ACTIVE客户扫码支付客户扫描油站二维码完成支付
"createSource": "XOIL_DRIVER_WECHAT_APPLET"
"createSource": "XOIL_DRIVER_WECHAT_APPLET",
merchantNo: '10089027856',
}
oilOrderApi.payOrder(payData).then(res => {
if (res.code == 20000) {

View File

@@ -273,7 +273,8 @@
console.log('进入获取油站信息')
let data2 = {
...uni.getStorageSync('location'),
siteId: id
siteId: id,
clientBelong: "ZHONGPIN"
}
oilSiteApi.getSiteDetails(data2).then(res => {
console.log('进入获取油站信息getSiteDetails',res)

View File

@@ -1,6 +1,6 @@
# 星油云小程序
## 功能介绍
## 功能介绍111
### 主要功能:一键加油,扫码加油,注册登录,充值,支付,订单

View File

@@ -4,6 +4,8 @@ const group_name = "oilSiteOrderInfo"
export default {
// 下单
createOrder(data) {
// data = Object.assign(data,{'clientBelong':'ZHONGPIN',});
console.log(data,'datadatadata')
return request({
url: `/${service_name}/${group_name}/createOrder`,
method: 'post',

View File

@@ -82,6 +82,14 @@ export default {
method: 'get'
})
},
// 中品 下单 -- 获取最新油站价格、司机、加油员相关信息
getNewSitePriceZp(data) {
return request({
url: `/${service_name}/${group_name}/getSitePriceByBelong `,
method: 'post',
data:data
})
},
//根据地址获取详细地址信息
getGeoByAddress(address) {
return request({

View File

@@ -3842,7 +3842,11 @@ scroll-view.cu-steps .cu-item {
.text-right {
text-align: right;
}
.text-blues,
.line-blues,
.lines-blues {
color: #1890FF;
}
.text-red,
.line-red,
.lines-red {

View File

@@ -24,7 +24,7 @@
{{item.oilProductCode}}
</view>
<view class="oil-main-color text-xl text-bold padding-right-xs" style="padding-right: 0;">
{{item.personalPrice|moneyFormat}}
{{item.personalPriceZp|moneyFormat}}
</view>
</view>
<view v-if="!listHeight" class="text-bold yellow-oil text-xl padding-right-xs">
@@ -82,6 +82,9 @@
audioUrl:''
}
},
created() {
console.log(this.siteItem,'-----------------')
},
methods: {
},

View File

@@ -119,15 +119,17 @@
}
},
created() {
setTimeout(()=>{
console.log('%c 子组件参数↓','font-size:30px;color:red')
},
mounted() {
if(this.areaCodeList1.length == 0){
this.areaCodeList = uni.getStorageSync('areaCodeList')
}else{
this.areaCodeList = this.areaCodeList1
}
this.areaCodeList.unshift({areaName:'全部'})
},1000)
console.log('%c 子组件参数↓','font-size:30px;color:red')
this.$forceUpdate();
},
computed: {
selectedTitleObj() {

View File

@@ -73,18 +73,22 @@
currentPage: 1,
pageSize: 3,
params: { //类型Object 必有字段 备注:// 筛选对象
clientBelong:'ZHONGPIN',
sort: "juli", //类型String 必有字段 备注:// 智能排序 ( price价格最低 juli距离最近 ) 默认距离排序
...uni.getStorageSync('location'),
...this.filterData
...this.filterData,
comprehensiveSort:1,
// siteBrand: "", // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
// channelCode: "", // 备注:// 渠道编码 ( OIL星油 WJY万金油 LV老吕找油网 TY团油 YDJY一点加油壳牌)
// oilProductCode: "" // 备注:// 油号选择 ( 0# 92# 92#)
}
}
oilSiteApi.getSiteList(data1).then(res => {
oilSiteApi.getSiteLists(data1).then(res => {
if (res.code == 20000) {
this.siteList = res.data.list
this.siteList = res.data.list;
(this.siteList.length>3)&&(this.siteList.length = 3)
}
})
},

73
main.js
View File

@@ -15,7 +15,7 @@ import global from '@/api/global.js'
import Empty from '@/components/Empty.vue'
import {share} from './mixins/index.js'
import oilSiteApi from '@/api/oil-site.js'
Vue.mixin(share)
// Vue.component('home', home)
// Vue.component('user', user)
@@ -33,6 +33,77 @@ Vue.prototype.moneyIntercept = function(value){
return Number(value).toFixed(2)
}
}
Vue.prototype.SetFilterData = function(value){
return new Promise((re,rj)=>{
let menuList = [{
title: '渠道',
isMutiple: false,
key: 'channelCode',
detailList: [{
title: "全部",
value: ""
}]
},
{
title: '0#轻柴油',
key: 'oilProductCode',
isMutiple: false,
detailList: [{
title: "全部",
value: ""
}]
},
{
title: '品牌',
key: 'siteBrand',
isSort: true,
isMutiple: false,
detailList: [{
title: "全部",
value: ""
}]
}
]
if(uni.getStorageSync('filterData')){
re('ok')
}else{
oilSiteApi.getCheckInfo().then(res => {
if (res.code == 20000) {
let channelCodes = []
res.data.channelCodes.map(item => {
channelCodes.push({
title: item.name,
value: item.id
})
})
let productCodes = []
res.data.productCodes.map(item => {
productCodes.push({
title: item.name,
value: item.id
})
})
let siteBrands = []
res.data.siteBrands.map(item => {
siteBrands.push({
title: item.name,
value: item.id
})
})
console.log(channelCodes, productCodes, siteBrands)
menuList[0].detailList = menuList[0].detailList.concat(channelCodes)
menuList[1].detailList = menuList[1].detailList.concat(productCodes)
menuList[2].detailList = menuList[2].detailList.concat(siteBrands)
uni.setStorageSync('filterData', this.menuList);
re('ok')
}else{
rj('no')
}
})
}
})
}
let qqmapsdk = new QQMapWX({
// key: 'IUKBZ-5MKL3-HXB3P-3OS7U-6MHX3-MYBI3'
key:'NYEBZ-YURY3-XTU3N-YBR54-PKW6E-ROB2F'

43
package-lock.json generated
View File

@@ -1,37 +1,62 @@
{
"name": "wechat-oil",
"version": "1.0.0",
"lockfileVersion": 1,
"lockfileVersion": 3,
"requires": true,
"dependencies": {
"axios": {
"packages": {
"": {
"name": "wechat-oil",
"version": "1.0.0",
"license": "ISC",
"devDependencies": {
"axios": "^0.21.3",
"crypto-js": "^4.0.0",
"js-cookie": "^2.2.1",
"js-md5": "^0.7.3"
}
},
"node_modules/axios": {
"version": "0.21.3",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.3.tgz",
"integrity": "sha512-JtoZ3Ndke/+Iwt5n+BgSli/3idTvpt5OjKyoCmz4LX5+lPiY5l7C1colYezhlxThjNa/NhngCUWZSZFypIFuaA==",
"dev": true,
"requires": {
"dependencies": {
"follow-redirects": "^1.14.0"
}
},
"crypto-js": {
"node_modules/crypto-js": {
"version": "4.0.0",
"resolved": "https://registry.nlark.com/crypto-js/download/crypto-js-4.0.0.tgz",
"integrity": "sha1-KQSrJnep0EKFai6i74DekuSjbcw=",
"dev": true
},
"follow-redirects": {
"node_modules/follow-redirects": {
"version": "1.14.3",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.3.tgz",
"integrity": "sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==",
"dev": true
"dev": true,
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"js-cookie": {
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/js-cookie": {
"version": "2.2.1",
"resolved": "https://registry.npm.taobao.org/js-cookie/download/js-cookie-2.2.1.tgz",
"integrity": "sha1-aeEG3F1YBolFYpAqpbrsN0Tpsrg=",
"dev": true
},
"js-md5": {
"node_modules/js-md5": {
"version": "0.7.3",
"resolved": "https://registry.npm.taobao.org/js-md5/download/js-md5-0.7.3.tgz",
"integrity": "sha1-tPL7sLMnRV9ZjWcn447Ccs0Jw/I=",

View File

@@ -3,20 +3,20 @@
{
"path": "pages/index/startPage/startPage",
"style": {
"navigationBarTitleText": "佰川加油"
"navigationBarTitleText": "中品加油"
}
},
{
"path": "pages/tabbar/home/home",
"style": {
"navigationBarTitleText": "佰川加油" // "enablePullDownRefresh": true
"navigationBarTitleText": "中品加油" // "enablePullDownRefresh": true
}
},
{
"path": "pages/tabbar/order/orderList/orderList",
"style": {
"navigationBarTitleText": "佰川加油", // "enablePullDownRefresh": true
"navigationBarTitleText": "中品加油", // "enablePullDownRefresh": true
"enablePullDownRefresh": true
}
},
@@ -24,7 +24,7 @@
{
"path": "pages/tabbar/station/stationList",
"style": {
"navigationBarTitleText": "佰川加油", // "enablePullDownRefresh": true
"navigationBarTitleText": "中品加油", // "enablePullDownRefresh": true
"enablePullDownRefresh": true
}
},
@@ -32,7 +32,7 @@
{
"path": "pages/tabbar/user/user",
"style": {
"navigationBarTitleText": "佰川加油" // "enablePullDownRefresh": true
"navigationBarTitleText": "中品加油" // "enablePullDownRefresh": true
}
}
@@ -275,7 +275,7 @@
"allowsBounceVertical": "NO"
},
"navigationBarBackgroundColor": "#f33e54",
"navigationBarTitleText": "佰川加油",
"navigationBarTitleText": "中品加油",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
},

View File

@@ -6,7 +6,7 @@
<view class="cu-bar bg-white justify-end">
<!-- <view class="content">您还没有完成认证</view> -->
<view class="content text-center overflow-unset">
<image :src="imgURL+'default-avator.png'" mode="widthFix" class="ro-right "></image>
<image :src="otherImgURL+'ic-t@ZP.png'" mode="widthFix" class="ro-right "></image>
</view>
<view class="action" @tap="hideModal('auth')">
<text class="cuIcon-close text-red"></text>
@@ -83,6 +83,7 @@
},
data() {
return {
otherImgURL: this.global.otherImgURL,
imgURL: this.global.imgURL,
showPlateList: true,
showInputList: false,

View File

@@ -44,6 +44,40 @@
}
},
onLoad(option) {
let taht = this
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function(res) {
// 请求完新版本信息的回调
console.log('请求完新版本信息的回调', res.hasUpdate);
if (!res.hasUpdate) {
taht.initFn(option)
}
});
updateManager.onUpdateReady(function(res) {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
console.log(res.confirm, 'res.confirm版本信息')
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate();
} else {
taht.initFn(option)
}
},
});
});
updateManager.onUpdateFailed(function(res) {
console.log('新的版本下载失败')
// 新的版本下载失败
});
},
onReady(option) {},
methods: {
initFn(option) {
const token = uni.getStorageSync('Authorization')
const openid = uni.getStorageSync('openid')
let key = ''
@@ -52,13 +86,6 @@
} else {
key = '离线'
}
if (key == '在线') {
if (!uni.getStorageSync('filterData')) {
this.getFilterData()
} else if (uni.getStorageSync('filterData')[0].detailList.length < 2) {
this.getFilterData()
}
}
// 在页面中定义插屏广告
let interstitialAd = null
@@ -113,37 +140,11 @@
}, 2000)
})
},
onReady(option) {
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function(res) {
// 请求完新版本信息的回调
console.log('请求完新版本信息的回调', res.hasUpdate);
});
updateManager.onUpdateReady(function(res) {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate();
}
}
});
});
updateManager.onUpdateFailed(function(res) {
// 新的版本下载失败
});
},
methods: {
getFilterData() {
console.log('在线')
oilSiteApi.getCheckInfo().then(res => {
if (res.code == 20000) {
console.log('接口返回正常')
let channelCodes = []
res.data.channelCodes.map(item => {
channelCodes.push({
@@ -169,7 +170,8 @@
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('filterData', this.menuList);
console.log('存入', this.menuList)
// this.$refs.slFilter.resetMenuList(this.menuList)
}
})

View File

@@ -106,42 +106,18 @@
</view>
</view>
</view>
<!-- 宫格菜单开始 -->
<!-- <view class="bg-white padding pagestartthree">
<view class="grid col-5 text-center ">
<view class="text-xxl " v-for="(item,index) in cuIconList" @tap="shadoumeiyou(index)" :key="index"
:class="index<5?'margin-bottom':''">
! <view :class="['cuIcon-'+item.icon,'text-' +item.color]">
</view>
<view class="text-center">
<view class="my-icon-sm">
<image :src="imgURL +item.iconUrl" mode="widthFix"></image>
</view>
<view class="text-sm">
<text class="text-sm color-333">
{{item.name}}
</text>
</view>
</view>
</view>
</view>
</view> -->
<!-- 广告图片开始 -->
<view class="my-bg padding">
<view class="" >
<swiper autoplay interval='5000' style="width: 100%;height: 204rpx;" class="swiper" circular >
<!-- <swiper autoplay interval='5000' style="width: 100%;height: 204rpx;" class="swiper" circular >
<swiper-item @click="swiperClick(item,index)" v-for="(item,index) in swiperArray">
<image :src="item.src" style="width: 100%;" mode="widthFix"></image>
</swiper-item>
<swiper-item>
<ad unit-id="adunit-fae65289bc72095d" ad-intervals="30"></ad>
</swiper-item>
</swiper>
<!-- <image :src="starUrl+'banner.png'" style="width: 100%;" mode="widthFix"></image> -->
</swiper> -->
<image :src="starUrl+'banner.png'" style="width: 100%;" mode="widthFix"></image>
</view>
</view>
<!-- 筛选开始 -->
@@ -517,6 +493,7 @@
currentPage: 1,
pageSize: 10,
params: { //类型Object 必有字段 备注:// 筛选对象
clientBelong:'ZHONGPIN',
sort: "juli", //类型String 必有字段 备注:// 智能排序 ( price价格最低 juli距离最近 ) 默认距离排序
// longitude: 117.157817, // 必有字段 备注:// 当前位置经度
// latitude: 31.802472, // 必有字段 备注:// 当前位置维度

View File

@@ -98,6 +98,7 @@
data() {
return {
getSiteListTimer:null,
TabCur: 0,
search: '',
status: {
@@ -136,7 +137,7 @@
}
},
onShow() {
this.initList()
// this.initList()
},
onLoad() {
this.initList()
@@ -214,6 +215,7 @@
}
},
onRequest() {
if (this.TabCur == 0) {
this.currentPage.currentPage = 1
this.list = []
@@ -235,13 +237,19 @@
this.list3 = []
this.getOrder('3', this.currentPage.currentPage3,'onRequest')
}
},
getOrder(id, page, tip) {
clearTimeout(this.getSiteListTimer);
this.getSiteListTimer = setTimeout(()=>{
let postData = {
currentPage: page, //类型Number 必有字段 备注:无
pageSize: 10, //类型Number 必有字段 备注:无
index: (page - 1) * 10,
params: { //类型Object 必有字段 备注:无
clientBelong:'ZHONGPIN',
orderStatus: id == '全部' ? '' : (id +''), //类型String 必有字段 备注:订单状态 0待支付 1已支付 -1支付失败 2已取消3已退款
search: this.search //类型String 必有字段 备注:搜索 ( 油站名称/ 订单编号/ 油品)
},
@@ -325,6 +333,8 @@
}
}
})
},500)
}
}
}

View File

@@ -1,7 +1,7 @@
<template>
<view class="page-content">
<cu-custom class="bg-main-oil" bgColor="bg-main-oil">
<block slot="content">佰川加油</block>
<block slot="content">中品加油</block>
</cu-custom>
<view class="margin-top-lg">
<swiper class="screen-swiper text-center square-dot" :indicator-dots="true"

View File

@@ -33,12 +33,13 @@
<!-- 筛选开始 -->
<scroll-view class="screentop bg-white" style="flex: 1;">
<view class="">
<sl-filter reflexTitle ref="slFilter" :productCodeList="productCodeList" :areaCodeList="areaCodeList" @result="filterRes" :menuList="menuList"></sl-filter>
<sl-filter v-if="isFilterData" reflexTitle ref="slFilter" :productCodeList="productCodeList" :areaCodeList="areaCodeList"
@result="filterRes" :menuList="menuList"></sl-filter>
<!-- <sl-filter reflexTitle ref="slFilter" @result="filterRes" :menuList="menuList"></sl-filter> -->
</view>
<view class="bg-white min-height-50 padding-top" v-if="siteList.length>0">
<site-item v-for="(item,index) in siteList" :key="item.id" :site-item="item" :first="index==0" :listHeight="listHeight"
class="cu-list menu-avatar cu-item" @tap="toDetail(item)">
<site-item v-for="(item,index) in siteList" :key="item.id" :site-item="item" :first="index==0"
:listHeight="listHeight" class="cu-list menu-avatar cu-item" @tap="toDetail(item)">
</site-item>
<view class="placeholder-hidden">
@@ -68,21 +69,21 @@
data() {
return {
getSiteListTimer:null,
filterData: {
// oilProductCode: '0#'
},
contentTitle:'您当前位置附近没有油站,可以点击左上角-距离-选择其他省市进行查看。',
isFilterData:false,
contentTitle: '您当前位置附近没有油站,可以点击左上角-距离-选择其他省市进行查看。',
loadStatus: 'load',
listHeight:160,
areaCodeList:[],
listHeight: 160,
areaCodeList: [],
siteName: '',
menuList:[
{
menuList: [{
title: '距离',
isMutiple: false,
key: 'distance',
detailList: [
{
detailList: [{
title: "全部",
value: ''
},
@@ -131,7 +132,8 @@
{
title: "LNG",
value: "LNG"
}]
}
]
},
// {
// title: '油品',
@@ -258,6 +260,8 @@
this.refreshLocation()
if (!uni.getStorageSync('filterData')) {
this.getFilterData()
} else {
this.isFilterData=true
}
this.getSiteList()
},
@@ -288,39 +292,73 @@
this.getSiteList()
},
getFilterData() {
let menuList = [{
title: '渠道',
isMutiple: false,
key: 'channelCode',
detailList: [{
title: "全部",
value: ""
}]
},
{
title: '0#轻柴油',
key: 'oilProductCode',
isMutiple: false,
detailList: [{
title: "全部",
value: ""
}]
},
{
title: '品牌',
key: 'siteBrand',
isSort: true,
isMutiple: false,
detailList: [{
title: "全部",
value: ""
}]
}
]
oilSiteApi.getCheckInfo().then(res => {
if (res.code == 20000) {
uni.setStorageSync('productCodeList', res.data.productCodeList)
uni.setStorageSync('areaCodeList', res.data.areaCodeList)
this.areaCodeList = uni.getStorageSync('areaCodeList')
if(uni.getStorageSync('areaCodeList')){
let channelCodes = []
res.data.channelCodes.map(item => {
channelCodes.push({
title: item.name,
value: item.id
})
})
let productCodes = []
res.data.productCodes.map(item => {
productCodes.push({
title: item.name,
value: item.id
})
})
let siteBrands = []
res.data.siteBrands.map(item => {
siteBrands.push({
title: item.name,
value: item.id
})
})
menuList[0].detailList = menuList[0].detailList.concat(channelCodes)
menuList[1].detailList = menuList[1].detailList.concat(productCodes)
menuList[2].detailList = menuList[2].detailList.concat(siteBrands)
uni.setStorageSync('filterData', this.menuList);
if (uni.getStorageSync('areaCodeList')) {
this.areaCodeList = uni.getStorageSync('areaCodeList')
}else{
} else {
this.areaCodeList = res.data.areaCodeList
}
// this.productCodeList = uni.getStorageSync('productCodeList')
// res.data.channelCodes.map(item => {
// this.menuList[0].detailList.push({
// title: item.name,
// value: item.id
// })
// })
// res.data.productCodes.map(item => {
// this.menuList[1].detailList.push({
// title: item.name,
// value: item.id
// })
// })
// res.data.siteBrands.map(item => {
// this.menuList[2].detailList.push({
// title: item.name,
// value: item.id
// })
// })
// // console.log(channelCodes, productCodes, siteBrands)
// this.$refs.slFilter.resetMenuList(this.menuList)
// this.$forceUpdate();
}
this.isFilterData = true
})
},
onSelected(e) {
@@ -337,11 +375,11 @@
getSiteList() {
this.refreshLocation()
let data1 = {
currentPage: this.currentPage,
pageSize: 10,
params: { //类型Object 必有字段 备注:// 筛选对象
clientBelong:'ZHONGPIN',
sort: "juli", //类型String 必有字段 备注:// 智能排序 ( price价格最低 juli距离最近 ) 默认距离排序
siteName: this.siteName,
...uni.getStorageSync('location'),
@@ -352,11 +390,11 @@
.channelCode, // 备注:// 渠道编码 ( OIL星油 WJY万金油 LV老吕找油网 TY团油 YDJY一点加油壳牌)
oilProductCode: this.siteName ? '' : this.filterData
.oilProductCode, // 备注:// 油号选择 ( 0# 92# 92#)
provinceCode:this.filterData.provinceCode,
cityCode:this.filterData.cityCode,
areaCode:this.filterData.areaCode,
distance:this.filterData.distance,
comprehensiveSort:this.filterData.comprehensiveSort?this.filterData.comprehensiveSort:1
provinceCode: this.filterData.provinceCode,
cityCode: this.filterData.cityCode,
areaCode: this.filterData.areaCode,
distance: this.filterData.distance,
comprehensiveSort: this.filterData.comprehensiveSort ? this.filterData.comprehensiveSort : 1
}
}
@@ -401,13 +439,13 @@
})
} else {
uni.showModal({
title:'请您登录',
content:"登录小星加油才可以加油 |˛˙꒳​˙)♡",
confirmText:'去登陆',
title: '请您登录',
content: "登录小星加油才可以加油 |˛˙꒳​˙)♡",
confirmText: '去登陆',
success: (res) => {
if(res.confirm){
if (res.confirm) {
uni.reLaunch({
url:'../../../BagAuth/pages/login/login'
url: '../../../BagAuth/pages/login/login'
})
}
}
@@ -444,16 +482,28 @@
},
onInput() {
setTimeout(() => {
// setTimeout(() => {
// this.currentPage = 1
// this.siteList = []
// this.getSiteList()
// }, 100)
clearTimeout(this.getSiteListTimer);
this.getSiteListTimer = setTimeout(()=>{
this.currentPage = 1
this.siteList = []
this.getSiteList()
}, 100)
},500);
},
onSearch() {
// this.currentPage = 1
// this.siteList = []
// this.getSiteList()
clearTimeout(this.getSiteListTimer);
this.getSiteListTimer = setTimeout(()=>{
this.currentPage = 1
this.siteList = []
this.getSiteList()
},500);
}
}
}

View File

@@ -1,7 +1,7 @@
<template>
<view class="bg-white page-content">
<view class="bg-img padding-bottom-lg flex align-center"
style="background-image: url(https://xoil-public.oss-cn-beijing.aliyuncs.com/baichuan_MP/wd-sz.png);height: 600upx;">
style="background-image: url(https://xoil-public.oss-cn-beijing.aliyuncs.com/baichuan_MP/bg-wg@ZP.png);height: 600upx;">
<view class="padding-xl margin-top bg-tm text-white top-part">
<view class="padding-xs padding-top-lg text-sm padding-top">
Hi{{(user.name?user.name:wxInfo.nickName)|nameKong}}师傅愿你开心每一天!
@@ -126,7 +126,7 @@
<view class="cu-item">
<view class=" padding-tb-0">
<view class="image-self-view">
<img :src="starUrl+'wd-ic-1.png'" lazy-load class="png" mode="widthFix"></img>
<img :src="otherImgURL+'hb@ZP.png'" lazy-load class="png" mode="widthFix"></img>
</view>
</view>
<text>红包卡券</text>
@@ -134,7 +134,7 @@
<view class="cu-item">
<view class=" padding-tb-0">
<view class="image-self-view">
<img :src="starUrl+'wd-ic-2.png'" lazy-load class="png" mode="widthFix"></img>
<img :src="otherImgURL+'hd@ZP.png'" lazy-load class="png" mode="widthFix"></img>
</view>
</view>
<text>活动通知</text>
@@ -142,7 +142,7 @@
<view class="cu-item">
<view class=" padding-tb-0">
<view class="image-self-view">
<img :src="starUrl+'wd-ic-3.png'" lazy-load class="png" mode="widthFix"></img>
<img :src="otherImgURL+'tj@ZP.png'" lazy-load class="png" mode="widthFix"></img>
</view>
</view>
<text>推荐有礼</text>
@@ -150,7 +150,7 @@
<view class="cu-item" @tap="goToPage('/BagAuth/pages/agreeMent/OperationGuide')">
<view class=" padding-tb-0">
<view class="image-self-view">
<img :src="starUrl+'wd-ic-4.png'" lazy-load class="png" mode="widthFix"></img>
<img :src="otherImgURL+'sm@ZP.png'" lazy-load class="png" mode="widthFix"></img>
</view>
</view>
<text>操作说明</text>
@@ -194,6 +194,7 @@
},
data() {
return {
otherImgURL: this.global.otherImgURL,
imgURL: this.global.imgURL ,
starUrl: this.global.starUrl,
isCompany: uni.getStorageSync('accountStatus'),