12.01前端 index
This commit is contained in:
parent
2da1c46915
commit
74efa27e2a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user