12.01前端 index

This commit is contained in:
@QQNZX 2023-12-01 16:20:02 +08:00
parent 2da1c46915
commit 74efa27e2a

View File

@ -83,9 +83,9 @@
<view class="hui1">{{ store.address }}</view>
<view class="hui2" v-if="distance!=''">{{ distance }}km</view>
</view>
<view class="lananniu" @click="goGoGo" v-if="distance!=''">
<uni-icons type="paperplane-filled" color="#195ADA"
size="16"></uni-icons> {{ distance*1000 }}
<view class="lananniu" @click="goGoGo" v-if="distance!=''">
<uni-icons type="paperplane-filled" color="#195ADA" size="16"></uni-icons>
{{ distance || "0" }}KM
</view>
</view>
<!-- <scroll-view scroll-x="true">
@ -106,7 +106,8 @@
</view>
<!-- 加油站卡片结束-->
<!-- <u-picker :show="show" :columns="columns" @confirm="confirm" @cancel="cancel"></u-picker> -->
<u-picker :columns="columns" @confirm="confirm" :show="show" @cancel="show = false" keyName="label"></u-picker>
<u-picker :columns="columns" @confirm="confirm" :show="show" @cancel="show = false"
keyName="label"></u-picker>
<!--外层结束 -->
<tabbar :msg="msg"></tabbar>
@ -127,14 +128,14 @@
title: '',
oilTypeList: '',
columns: [
],
oilInfo: {
oilName:'未添加',
oilPrice:'0',
gbPrice:'0'
oilName: '未添加',
oilPrice: '0',
gbPrice: '0'
},
list3: [
'http://47.95.206.185:83/topbj.png',
'http://47.95.206.185:83/centerbj.png',
@ -156,20 +157,20 @@
},
onLoad(query) {
const q = decodeURIComponent(query.q) //
if (q == undefined){
if (q == undefined) {
let str = q.split("?")[1];
let arr = str.split("&");
let storeId = "";
let staffId = "";
arr.forEach(item => {
if (item.includes("storeId")){
if (item.includes("storeId")) {
storeId = item.split("=")[1]
}else{
} else {
staffId = item.split("=")[1]
}
})
uni.setStorageSync("inviteStoreId",storeId)
uni.setStorageSync("inviteStaffId",staffId)
uni.setStorageSync("inviteStoreId", storeId)
uni.setStorageSync("inviteStaffId", staffId)
this.storeId = uni.getStorageSync("inviteStoreId")
this.staffId = uni.getStorageSync("inviteStaffId")
}
@ -184,22 +185,22 @@
tabbar
},
methods: {
isExistStoreId(){
if (uni.getStorageSync("inviteStoreId") != ""){
isExistStoreId() {
if (uni.getStorageSync("inviteStoreId") != "") {
this.getStore(uni.getStorageSync("inviteStoreId"));
}else{
} else {
this.getAddress();
}
},
//
getUserAuthority(){
getUserAuthority() {
let _this = this;
wx.getSetting({
success(res){
if (!res.authSetting['scope.userLocation']){
success(res) {
if (!res.authSetting['scope.userLocation']) {
wx.authorize({
scope:'scope.userLocation',
success(){
scope: 'scope.userLocation',
success() {
//
_this.isExistStoreId()
},
@ -207,7 +208,7 @@
//
}
})
}else{
} else {
//
_this.isExistStoreId()
}
@ -215,13 +216,15 @@
})
},
//
getStore(id){
getStore(id) {
let _this = this;
request({
url: "business/storeInformation/store/queryStoreById",
method: 'post',
data:{"storeId":id},
}).then((response)=>{
data: {
"storeId": id
},
}).then((response) => {
_this.store = response.data
let welfare = response.data.welfare
if (welfare != undefined && welfare != null && welfare != "") {
@ -251,10 +254,10 @@
"lon": res.longitude,
"lat": res.latitude
},
}).then((response)=>{
}).then((response) => {
_this.distance = (Math.ceil(response.data.distance)).toFixed(1)
_this.store = response.data.store
uni.setStorageSync("storeId",response.data.store.id)
uni.setStorageSync("storeId", response.data.store.id)
let welfare = response.data.store.welfare
if (welfare != undefined && welfare != null && welfare != "") {
if (welfare.includes(",")) {
@ -271,44 +274,44 @@
}
});
},
//
getOilType() {
request({
url: 'business/petrolStationManagement/oilNumber/getList2',
method: 'get',
// params:{}
}).then((res)=>{
if(res.code == 200){
}).then((res) => {
if (res.code == 200) {
this.oilTypeList = res.data.records
console.log("aaabbb",this.oilTypeList)
console.log("aaabbb", this.oilTypeList)
if (this.oilTypeList.length > 0) {
this.oilInfo.oilName = this.oilTypeList[0].oilName,
this.oilInfo.oilPrice = this.oilTypeList[0].oilPrice,
this.oilInfo.gbPrice = this.oilTypeList[0].gbPrice
this.oilInfo.oilPrice = this.oilTypeList[0].oilPrice,
this.oilInfo.gbPrice = this.oilTypeList[0].gbPrice
}
let oilData = []
this.oilTypeList.forEach(res => {
let data = {
id:res.numberId,
label:res.oilName,
oilPrice:res.oilPrice,
gbPrice:res.gbPrice
id: res.numberId,
label: res.oilName,
oilPrice: res.oilPrice,
gbPrice: res.gbPrice
}
oilData.push(data)
})
this.columns = [oilData]
console.log("aaa",this.columns)
console.log("aaa", this.columns)
}
})
},
confirm(e) {
console.log('选中的油号', e);
this.oilInfo.oilName = e.value[0].label,
this.oilInfo.oilPrice = e.value[0].oilPrice,
this.oilInfo.gbPrice = e.value[0].gbPrice
this.oilInfo.oilPrice = e.value[0].oilPrice,
this.oilInfo.gbPrice = e.value[0].gbPrice
this.show = false
},
cancel() {
@ -571,8 +574,8 @@
}
.lananniu {
width: 78px;
height: 24px;
box-sizing: border-box;
padding: 3px 10px;
background: #DBE9FF;
border-radius: 12px;
display: flex;