1.修改H5 定位获取不了经纬度

2.新增千猪肯德基页面
yj-dev
杨杰 2 years ago
parent 02d613067c
commit a6aeb32cc7
  1. 16
      App.vue
  2. 43
      pages.json
  3. 46
      pages/goods/refuel-details/refuel-details.vue
  4. 2
      pages/goods/refuel/refuel.vue
  5. 85
      pages/tabBar/home/home.vue
  6. 139
      qianzhu-KFC/address/address.vue
  7. 89
      qianzhu-KFC/home/home.vue
  8. BIN
      qianzhu-KFC/static/imgs/add.png
  9. BIN
      qianzhu-KFC/static/imgs/kfc1.png
  10. BIN
      qianzhu-KFC/static/imgs/kfc2.png
  11. BIN
      qianzhu-KFC/static/imgs/kfchome.png
  12. BIN
      qianzhu-KFC/static/imgs/upte.png
  13. 173
      qianzhu-KFC/update-address/update-address.vue
  14. 12
      uni.scss

@ -5,15 +5,15 @@
// brestUrl: 'http://192.168.3.4:9302/brest',
// imgUrl: 'https://192.168.3.4:9301/filesystem/',
//
// url: 'https://hsg.dctpay.com/crest',
// imgUrl: 'https://hsg.dctpay.com/filesystem/',
// brestUrl : 'https://hsg.dctpay.com/brest',
// imageWxImg:'https://hsg.dctpay.com/filesystem/wxApplets/',
url: 'https://hsg.dctpay.com/crest',
imgUrl: 'https://hsg.dctpay.com/filesystem/',
brestUrl : 'https://hsg.dctpay.com/brest',
imageWxImg:'https://hsg.dctpay.com/filesystem/wxApplets/',
//
url: 'https://hsgcs.dctpay.com/crest',
brestUrl : 'https://hsgcs.dctpay.com/brest',
imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
imageWxImg:'https://hsgcs.dctpay.com/filesystem/wxApplets/',
// url: 'https://hsgcs.dctpay.com/crest',
// brestUrl : 'https://hsgcs.dctpay.com/brest',
// imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
// imageWxImg:'https://hsgcs.dctpay.com/filesystem/wxApplets/',
userInfo: "",
brestUserInfo : '',
openId: '',

@ -670,10 +670,9 @@
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white"
}
} ,{
"path" : "recharge-pay/recharge-pay",
"style" :
{
}, {
"path": "recharge-pay/recharge-pay",
"style": {
"navigationBarTitleText": "支付",
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
@ -682,6 +681,42 @@
"navigationBarTextStyle": "white"
}
}
]
}, {
"root": "qianzhu-KFC",
"pages": [{
"path" : "home/home",
"style" :
{
"enablePullDownRefresh": false,
"navigationBarTitleText": "肯德基",
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
},{
"path" : "address/address",
"style" :
{
"enablePullDownRefresh": false,
"navigationBarTitleText": "肯德基在线点餐",
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
},{
"path" : "update-address/update-address",
"style" :
{
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
}
]
}],

@ -7,7 +7,7 @@
<view class="width100 text1 font18 fontwig6 fcor333">{{storeList.gasName}}</view>
<view class="width100 font14 fcor666 mart5">{{storeList.gasAddress}}</view>
</view>
<view class="flright reimg fotct width20" @click="seeloaction">
<view class="flright reimg fotct width20" v-if="storeList.distance" @click="seeloaction">
<image mode="widthFix" :src="imagewxUrl+imgadres"></image>
<view class="fcor089">{{storeList.distance}}km</view>
</view>
@ -521,21 +521,50 @@
});
return;
}
uni.getLocation({
type: 'wgs84',
success: function(res) {
app.globalData.latitude = res.latitude;
app.globalData.longitude = res.longitude;
// #ifdef H5
let data = {
key: "7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB" //
};
let url = "https://apis.map.qq.com/ws/location/v1/ip"; //
data.output = "jsonp";
this.$jsonp(url, data)
.then(res => {
app.globalData.latitude = res.result.location.lat;
app.globalData.longitude = res.result.location.lng;
if (app.globalData.accountType && app.globalData.accountType == '000000#/') {
that.recentGasStation();
} else {
that.getGasDetailByStoreKey();
}
setTimeout(() => {
that.toPay();
}, 500);
}).catch(error => {
if (app.globalData.accountType && app.globalData.accountType == '000000#/') {
that.recentGasStation();
} else {
that.getGasDetailByStoreKey();
}
setTimeout(() => {
that.toPay();
}, 500);
});
// #endif
// #ifdef MP
that.getGasDetailByStoreKey();
uni.getLocation({
type: 'wgs84',
success: function(res) {
app.globalData.latitude = res.latitude;
app.globalData.longitude = res.longitude;
// #ifdef H5
// if (app.globalData.accountType && app.globalData.accountType == '000000#/') {
// that.recentGasStation();
// } else {
// that.getGasDetailByStoreKey();
// }
// #endif
that.getGasDetailByStoreKey();
setTimeout(() => {
that.toPay();
}, 500);
@ -548,10 +577,11 @@
});
}
})
// #endif
},
//
toPay() {
if (this.storeList.distance > this.distance) {
if (this.storeList.distance > this.distance && this.storeList.distance != null) {
uni.showToast({
title: '请在' + this.distance + '公里内进行下单',
icon: "none",

@ -36,7 +36,7 @@
<view class="width70 flleft text1 font13 fcor999" @click="goDetails(item.store_key,item.id)">
{{item.address}}
</view>
<view class="width30 flright font13 fcor666 fotct" @click="seeloaction(item)">
<view class="width30 flright font13 fcor666 fotct" v-if="item.distance" @click="seeloaction(item)">
<image mode="widthFix" :src="imagewxUrl+imgadres1" style="width: 10px;"></image>
{{item.distance}}km
</view>

@ -239,45 +239,87 @@
})
// #endif
// #ifdef H5
// 使 $nextTic
this.$nextTick(() => {
// 使 login
//
this.$refs.muLocation.__init().then(location => {
// data
this.locationRef = location;
this.getLocation();
}, err => {
let data = {
key: "7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB" //
};
let url = "https://apis.map.qq.com/ws/location/v1/ip"; //
data.output = "jsonp";
this.$jsonp(url, data)
.then(res => {
if(res.result.location.lng){
app.globalData.latitude = res.result.location.lat;
app.globalData.longitude = res.result.location.lng;
this.findByLatAndLng(res.result.location.lng, res.result.location.lat);
return;
}
uni.showModal({
title: '获取定位权限失败,默认城市重庆市',
content: '请确定手机定位已打开,并且当前浏览器允许获取定位,都开启后请刷新页面。'
})
this.city = '重庆市';
app.globalData.cityName = '重庆市';
app.globalData.cityId = '500000';
//
if (err.code === 1) {
uni.showModal({
title: '获取定位权限失败,默认城市重庆',
content: '你拒绝了位置授权服务。请允许当前页面获取定位授权,后刷新页面。'
})
this.getCouponListArea();
this.getCouponListgold();
this.getCmsContent();
this.getCmsAactibity();
this.getCmsContentcmshome();
this.getCmsContentcmsContent();
} else {
}).catch(error => {
uni.showModal({
title: '获取定位权限失败,默认城市重庆',
title: '获取定位权限失败,默认城市重庆',
content: '请确定手机定位已打开,并且当前浏览器允许获取定位,都开启后请刷新页面。'
})
this.city = '重庆市';
app.globalData.cityName = '重庆市';
app.globalData.cityId = '500000';
this.getCouponListArea();
this.getCouponListgold();
this.getCmsContent();
this.getCmsAactibity();
this.getCmsContentcmshome();
this.getCmsContentcmsContent();
}
})
});
})
// 使 $nextTic
// this.$nextTick(() => {
// // 使 login
// //
// this.$refs.muLocation.__init().then(location => {
// // data
// this.locationRef = location;
// this.getLocation();
// }, err => {
// this.city = '';
// app.globalData.cityName = '';
// app.globalData.cityId = '500000';
// //
// if (err.code === 1) {
// uni.showModal({
// title: ',',
// content: ''
// })
// this.getCouponListArea();
// this.getCouponListgold();
// this.getCmsContent();
// this.getCmsAactibity();
// this.getCmsContentcmshome();
// this.getCmsContentcmsContent();
// } else {
// uni.showModal({
// title: ',',
// content: ''
// })
// this.getCouponListArea();
// this.getCouponListgold();
// this.getCmsContent();
// this.getCmsAactibity();
// this.getCmsContentcmshome();
// this.getCmsContentcmsContent();
// }
// })
// })
// #endif
// #ifdef MP
//
@ -312,7 +354,7 @@
methods: {
jumpcdx() {
location.href =
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect';
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsg.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect';
},
//
getCmsContentcmsContent() {
@ -649,6 +691,7 @@
} else if (item.title == '肯德基') {
uni.navigateTo({
url: '/pages/tabBar/order/order?id=1'
// url:'../../../qianzhu-KFC/home/home'
})
} else if (item.title == '电影票') {
uni.navigateTo({

@ -0,0 +1,139 @@
<template>
<view>
<view class="width100 height90 headsbg backcorfff" @click="jumpupadess('add')">
<view class="height20"></view>
<view class="width90 height40 alijus font15 fcor666 border1co6">
<image mode="widthFix" class="icon30 marRight20" src="../static/imgs/add.png"></image>添加新地址
</view>
</view>
<view class="list width90 mart15" v-for="(item, index) in addressList" :key="index"
:class="chageid == item?'afterlist':'list'" @click="changemaddress(item)">
<view class="wrapper">
<view class="address-box width90 paddtop15">
<text class="address">但是放松放松放松的方式发顺丰沙发上是方式地方但是放松方式扶 门牌号</text>
</view>
<view class="u-box width90 mart10 paddbotm15">
<text class="name">名称</text>
<text class="mobile">15583658692</text>
</view>
</view>
<image src="../static/imgs/upte.png" mode="widthFix" class="icon15 marRight20"
@click.stop="jumpupadess('edit')"></image>
</view>
<view class="height70"></view>
<view class="width100 height50 dispost font15 fotct">确认</view>
</view>
</template>
<script>
export default {
data() {
return {
addressList: [1, 2, 3, 4],
chageid: '' //
}
},
methods: {
//
jumpupadess(item) {
uni.navigateTo({
url: '../update-address/update-address?type=' + item
})
},
//
changemaddress(item) {
if (this.chageid == item) {
this.chageid = '';
return;
}
this.chageid = item;
}
}
}
</script>
<style lang="scss">
page {
background-color: #f0f0f0;
}
.headsbg {
border-radius: 0 0 30px 30px;
}
.border1co6 {
border: 1px solid #999999;
border-radius: 50rpx;
}
.icon15 {
width: 15px;
}
.icon30 {
width: 25px;
}
.list {
border-radius: 15px;
display: flex;
align-items: center;
background: #fff;
position: relative;
}
.afterlist {
border-radius: 15px;
display: flex;
align-items: center;
background: #fff;
position: relative;
border: 1px solid #c32a20;
}
.wrapper {
display: flex;
flex-direction: column;
flex: 1;
}
.address-box {
display: flex;
align-items: center;
.tag {
font-size: 24upx;
color: #999999;
margin-right: 10upx;
background: #fffafb;
border: 1px solid #ffb4c7;
border-radius: 4upx;
padding: 4upx 10upx;
line-height: 1;
}
.address {
font-size: 28upx;
color: #333333;
}
}
.u-box {
font-size: 26upx;
color: #999999;
margin-top: 16upx;
.name {
margin-right: 30upx;
}
}
.dispost {
position: fixed;
background-color: #c32a20;
bottom: 0px;
border-radius: 15px 15px 0px 0px;
color: #fff;
}
</style>

@ -0,0 +1,89 @@
<template>
<view>
<image mode="widthFix" class="width100 imgs" src="../static/imgs/kfchome.png"></image>
<view class="width94 heads alijusstart">
<view class="width48 backcorfff height260 fotct paddtop15">
<view class="fcor666 font20"><text class="fcor333 fontwig6 ">KFC</text>在线点餐</view>
<view class="c62a1e font28 mart10 fontwig6">5折起</view>
<image class="width80p mart20" mode="widthFix" src="../static/imgs/kfc1.png"></image>
<view class="mart15 width90 height30 border-15 fcorfff backcorf062 font13">
立即点餐(堂食/外带)
</view>
</view>
<view class="width48 backcorfff margitle height260 fotct paddtop15">
<view class="fcor666 font20">外卖优惠点餐</view>
<view class="c62a1e font28 mart10 fontwig6">送到家</view>
<image class="width80p mart20" mode="widthFix" src="../static/imgs/kfc2.png"></image>
<view class="mart15 width90 height30 border-15 fcorfff backcorf062 font13" @click="jumpaddress()">
立即点餐
</view>
</view>
</view>
<view class="foots fotct marb20">
<view class="width90 mart30 colorbe font14"> 本产品为第三方代点餐/代配送服务</view>
<view class="width90 mart5 colorbe font14"> 即第三方代点餐一切商业行为与肯德基无关</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
jumpaddress() {
uni.navigateTo({
url: '../address/address'
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #f0f0f0;
}
.imgs {
position: absolute;
}
.width48 {
width: 48%;
border-radius: 30rpx;
}
.margitle {
margin-left: 4%;
}
.c62a1e {
color: #c32a20;
}
.backcorf062 {
background-color: #c32a20;
}
.heads {
position: relative;
top: 500rpx;
}
.border-15 {
border-radius: 30rpx;
}
.colorbe {
color: #beac7c;
}
.foots {
position: relative;
top: 500rpx;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1,173 @@
<template>
<view class="content">
<view class="row bor-botm1">
<text class="tit">联系人</text>
<input class="input" type="text" v-model="addressData.name" placeholder="收货人姓名" placeholder-class="placeholder" />
</view>
<view class="row bor-botm1">
<text class="tit">手机号</text>
<input class="input" type="number" v-model="addressData.mobile" placeholder="收货人手机号码" placeholder-class="placeholder" />
</view>
<view class="row bor-botm1">
<text class="tit">地址</text>
<text @click="chooseLocation" class="input">
{{addressData.addressName}}
</text>
<text class="yticon icon-shouhuodizhi"></text>
</view>
<view class="row bor-botm1">
<text class="tit">门牌号</text>
<input class="input" type="text" v-model="addressData.area" placeholder="楼号、门牌" placeholder-class="placeholder" />
</view>
<view class="row default-row">
<text class="tit">设为默认</text>
<switch :checked="addressData.defaule" color="#fa436a" @change="switchChange" />
</view>
<button class="add-btn" @click="confirm">提交</button>
</view>
</template>
<script>
export default {
data() {
return {
addressData: {
name: '',
mobile: '',
addressName: '在地图选择',
address: '',
area: '',
default: false
}
}
},
onLoad(option){
console.log('===='+option.type)
let title = '新增收货地址';
if(option.type == 'edit'){
title = '编辑收货地址'
// this.addressData = JSON.parse(option.data)
}
this.manageType = option.type;
uni.setNavigationBarTitle({
title
})
},
methods: {
switchChange(e){
this.addressData.default = e.detail;
},
//
chooseLocation(){
uni.chooseLocation({
success: (data)=> {
this.addressData.addressName = data.name;
this.addressData.address = data.name;
}
})
},
//
confirm(){
let data = this.addressData;
if(!data.name){
uni.showToast({
title:'请填写收货人姓名',
duration:2000,
icon:'none'
})
return;
}
if(!/(^1[3|4|5|7|8][0-9]{9}$)/.test(data.mobile)){
uni.showToast({
title:'请输入正确的手机号码',
duration:2000,
icon:'none'
})
return;
}
if(!data.address){
uni.showToast({
title:'请在地图选择所在位置',
duration:2000,
icon:'none'
})
return;
}
if(!data.area){
uni.showToast({
title:'请填写门牌号信息',
duration:2000,
icon:'none'
})
return;
}
//this.$api.prePage()App.vue
// this.$api.prePage().refreshList(data, this.manageType);
// this.$api.msg(`${this.manageType=='edit' ? '': ''}`);
setTimeout(()=>{
uni.navigateBack()
}, 800)
},
}
}
</script>
<style lang="scss">
page{
background: #f8f8f8;
padding-top: 16upx;
}
.row{
display: flex;
align-items: center;
position: relative;
padding:0 30upx;
height: 110upx;
background: #fff;
.tit{
flex-shrink: 0;
width: 120upx;
font-size: 30upx;
color: #303133;
}
.input{
flex: 1;
font-size: 30upx;
color: #303133;
}
.icon-shouhuodizhi{
font-size: 36upx;
color: #909399;
}
}
.default-row{
margin-top: 16upx;
.tit{
flex: 1;
}
switch{
transform: translateX(16upx) scale(.9);
}
}
.add-btn{
display: flex;
align-items: center;
justify-content: center;
width: 690upx;
height: 80upx;
margin: 60upx auto;
font-size: 16px;
color: #fff;
background-color: #c32a20;
border-radius: 10upx;
box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
}
</style>

@ -167,6 +167,9 @@ $uni-font-size-paragraph:30upx;
.marglerig{
margin-right: 5px;
}
.marRight10{
margin-right: 10px;
}
.marRight20{
margin-right: 20px;
}
@ -473,6 +476,9 @@ $uni-font-size-paragraph:30upx;
height: 220px;
}
.height260{
height: 260px;
}
.height30 {
height: 30px;
line-height: 30px;
@ -645,6 +651,12 @@ $uni-font-size-paragraph:30upx;
padding-bottom: 10px;
}
.paddbotm15 {
padding-bottom: 15px;
}
.paddbotm20 {
padding-bottom: 20px;
}
/* 左悬浮 */
.flleft {
float: left;

Loading…
Cancel
Save