1.修改在线加油价格选择

2.上线h5 小程序
yj-dev
杨杰 2 years ago
parent 0fe1631877
commit ddf5a75413
  1. 38
      App.vue
  2. 10
      Utils/Api.js
  3. 14
      pages/goods/refuel-confirm/refuel-confirm.vue
  4. 332
      pages/goods/refuel-details/refuel-details.vue
  5. 6
      pages/login/register.vue
  6. 10
      pages/tabBar/category/category.vue
  7. 19
      pages/tabBar/home/home.vue
  8. 132
      pages/user/positioning/positioning.vue
  9. 28
      pages/welcome/welcome.vue

@ -11,9 +11,9 @@
// imageWxImg: 'https://hsg.dctpay.com/filesystem/wxApplets/',
//
url: 'https://hsgcs.dctpay.com/crest',
brestUrl : 'https://hsgcs.dctpay.com/brest',
brestUrl: 'https://hsgcs.dctpay.com/brest',
imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
imageWxImg:'https://hsgcs.dctpay.com/filesystem/wxApplets/',
imageWxImg: 'https://hsgcs.dctpay.com/filesystem/wxApplets/',
userInfo: "",
brestUserInfo: '',
bresthighAgent: '',
@ -53,11 +53,39 @@
//
qianzhuCityName: '重庆市',
//
pelletoilList:''
pelletoilList: ''
},
onLaunch: function() {},
onShow: function() {},
onLaunch: function() {
},
onShow: function() {
let that = this;
uni.getStorage({
key: 'openId',
success(e) {
if (e.data) {
that.globalData.openId = e.data;
}
}
})
uni.getStorage({
key: 'user',
success(e) {
if (e.data) {
that.globalData.userInfo = e.data;
}
}
})
uni.getStorage({
key: 'token',
success(e) {
if (e.data) {
that.globalData.token = e.data;
}
}
})
},
onHide: function() {}
}
</script>

@ -354,6 +354,11 @@ export const getTPigKFCToken = params => {
export const getAllCity = params => {
return POST('GET', `${base}/highThirdParty/getAllCity`, params).then(res => res.data);
}
//首页城市选择
export const findCompanyByCityName = params => {
return POST('GET', `${base}/common/findCompanyByCityName`, params).then(res => res.data);
}
//查询肯德基门店列表
export const getKfcStoresList = params => {
return POST('GET', `${base}/highThirdParty/getKfcStoresList`, params).then(res => res.data);
@ -437,6 +442,11 @@ export const cancelOrderByOrderNo = params => {
* H5 获取用户信息
*/
//判断是否有手机号
export const getH5AccessByOpenId = params => {
return POST('GET', `${base}/wechat/getH5AccessByOpenId`, params).then(res => res.data);
}
//h5静默登陆
export const loginBySilence = params => {
return POST('GET', `${base}/wechat/loginBySilence`, params).then(res => res.data);

@ -267,6 +267,9 @@
let that = this;
// that.paytype = '';
that.findUser();
this.priceValue[1] = 0;
this.reload();
this.calculatepayPrice();
},
methods: {
findUser() {
@ -486,13 +489,20 @@
url: '/pages/goods/refuel-succes/refuel-succes?id=' +
this.orderNo
});
} else {
return;
}
if (res.return_code == '102130') {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
})
return;
}
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
});
}
})
return;
}

@ -73,12 +73,13 @@
</view>
</view>
<!-- <view class="list width90">
<view class="list width90">
<view class="box" v-for="(amount,index) in amountList" :key="index" @click="select(amount)"
:class="{'on':amount.price == inputMoney}">
<view class="heTitle fcor333" :class="{'fcor089':amount.id == inputAmount}">{{amount.price}}</view>
:class="{'on':amount.codeValue == inputMoney}">
<view class="heTitle fcor333 paddtop10" :class="{'colorfe80':amount.codeValue == inputMoney}">{{amount.codeValue}}</view>
<view class="width100 font12 fcor333 mart5" :class="{'colorfe80':amount.codeValue == inputMoney}">最高优惠¥{{amount.codeName}}</view>
</view>
</view>
</view> -->
<!-- 详情描述-->
<view class="line10 mart15"></view>
@ -119,8 +120,8 @@
<button class="reBtn flright" v-else @click="postionIng">去支付</button>
<!-- #endif -->
<!-- #ifdef H5 -->
<button class="reBtn flright" v-if="user.phone == null" @click="jumpH5Bding">去支付</button>
<button class="reBtn flright" v-else @click="postionIng">去支付</button>
<!-- <button class="reBtn flright" v-if="user.phone == null" @click="jumpH5Bding">去支付</button> -->
<button class="reBtn flright" @click="postionIng">去支付</button>
<!-- #endif -->
</view>
<!-- 底部弹窗 -->
@ -144,6 +145,25 @@
</view>
</wybPopup>
<view class="height30"></view>
<wybPopup ref="popups" type="center" height="850" width="600" bgColor="" radius="20" :showCloseIcon="false">
<!-- <image class="popImg" :src="imagewxUrl+imgadres3" @click="jumpWeb"></image> -->
<!-- <view class="width100 backcorfff" style="height: 400px;"> -->
<view class="form re">
<view class="username">
<view class="get-code" style="color: #676767;" @click.stop="getCode()">{{getCodeText}}</view>
<input placeholder="请输入手机号" v-model="phoneNumber" placeholder-style="color: #676767;" />
</view>
<view class="code">
<input placeholder="请输入验证码" v-model="code" placeholder-style="color: #676767;" />
</view>
<view class="width90 fcoreb5 font14 fotct" v-if="showtoastdes">提示: {{showtoastdes}}</view>
<view class="btn" style="margin-top: 10px;" @tap="doReg">立即登录</view>
</view>
<!-- </view> -->
</wybPopup>
</view>
</template>
@ -153,7 +173,10 @@
addOrder,
getDictionaryByCodeTypeOl,
oilPriceDiscountCompute,
recentGasStation
recentGasStation,
sendSmsCodeByHw,
H5login,
getDictionaryByCodeType
} from '../../../Utils/Api.js';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
let app = getApp();
@ -171,24 +194,24 @@
detailList: [],
gunnumber: [],
user: '',
amountList: [{
id: '1',
price: '200'
},
{
id: '2',
price: '300'
},
{
id: '3',
price: '400'
},
{
id: '4',
price: '500'
}
amountList: [
// {
// id: '1',
// price: '200'
// },
// {
// id: '2',
// price: '300'
// },
// {
// id: '3',
// price: '400'
// },
// {
// id: '4',
// price: '500'
// }
],
inputAmount: '',
store_key: '',
storeList: '',
oilNo: '',
@ -215,6 +238,14 @@
pricePreferences: '0', //
totalPreferences: '0', //
locationRef: null, //
//
phoneNumber: "",
code: '',
getCodeText: '获取验证码',
getCodeBtnColor: "#ffffff",
getCodeisWaiting: false,
showtoastdes:'' //
}
},
onLoad(options) {
@ -242,6 +273,7 @@
// #endif
this.getDictionaryByCodeTypeOl();
this.getDictionaryByCodeTypeMoney();
this.getDictionaryByCodeType();
},
onShow() {
this.user = app.globalData.userInfo;
@ -255,6 +287,141 @@
}
},
methods: {
//
//
getDictionaryByCodeType() {
let datas = {
codeType: 'REFUEL_PRICE'
}
getDictionaryByCodeType(datas).then(res => {
if (res.return_code == '000000') {
this.amountList = res.return_data;
}
})
},
//
//
getDocument(item) {
uni.navigateTo({
url: '../userLogin/agreement/agreement?id=' + item
})
},
Timer() {},
getCode() {
uni.hideKeyboard()
if (this.getCodeisWaiting) {
return;
}
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) {
uni.showToast({
title: '请填写正确手机号码',
icon: "none"
});
return false;
}
uni.showLoading({
title: '发送中...'
})
let params = {
phone: this.phoneNumber,
HWMSG: 3
}
sendSmsCodeByHw(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.getCodeisWaiting = true;
this.getCodeBtnColor = "rgba(255,255,255,0.5)"
uni.showToast({
title: '验证码已发送',
icon: "none"
});
this.setTimer();
}
})
},
setTimer() {
let holdTime = 60;
this.getCodeText = "重新获取(60)"
this.Timer = setInterval(() => {
if (holdTime <= 0) {
this.getCodeisWaiting = false;
this.getCodeBtnColor = "#ffffff";
this.getCodeText = "获取验证码"
clearInterval(this.Timer);
return;
}
this.getCodeText = "重新获取(" + holdTime + ")"
holdTime--;
}, 1000)
},
doReg() {
uni.hideKeyboard();
//
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) {
uni.showToast({
title: '请填写正确手机号码',
icon: "none"
});
return false;
}
if (!this.code) {
uni.showToast({
title: '请填写验证码',
icon: "none"
});
return false;
}
uni.showLoading({
title: '提交中...'
})
let userid = '';
if (app.globalData.accountId == '000009&key' || app.globalData.accountId == '0000010&key') {
userid = app.globalData.staffCode;
}
let params = {
phone: this.phoneNumber,
code: this.code,
openId: app.globalData.openId,
popularizeUserId: userid,
regionId: app.globalData.cityId
}
H5login(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data
.object
.highUser;
app.globalData.token = res.return_data.uniqueCode;
this.user = res.return_data
.object
.highUser;
uni.setStorage({
key: "user",
data: res.return_data
.object
.highUser
})
uni.setStorage({
key: "token",
data: res.return_data.uniqueCode
})
this.$refs.popups.hide();
this.postionIng();
} else {
this.showtoastdes = res.return_msg;
uni.showToast({
title: res.return_msg,
icon: "none",
duration:2000
});
}
})
},
//
//
seeloaction() {
// #ifdef MP
@ -271,8 +438,12 @@
this.typeId = item;
this.$refs.popup.show();
},
showPopuplogin() {
this.$refs.popups.show();
},
//
recentGasStation() {
this.gunnumber = [];
uni.showLoading({
title: '加载中...'
})
@ -313,6 +484,7 @@
},
//
getGasDetailByStoreKey() {
this.gunnumber = [];
uni.showLoading({
title: '加载中...'
})
@ -422,19 +594,10 @@
//
changeValue2(item) {
this.gunNo = item.gunNo;
// this.totalPrice = '0.00';
// this.discountPrice = '0.00';
// this.inputMoney = '';
// this.oilLiters = '0';
// this.discount = '0';
// this.oilSubsidy = '0';
// this.litersPreferences = '0';
// this.pricePreferences = '0';
// this.totalPreferences = '0';
this.$refs.popup.hide();
},
select(amount) {
this.inputMoney = amount.price;
this.inputMoney = amount.codeValue;
this.oilPriceDiscountCompute();
},
// H5
@ -537,6 +700,14 @@
*/
postionIng() {
let that = this;
// #ifdef H5
if (app.globalData.accountType && app.globalData.accountType == '000000#/' && !that.user.phone) {
that.showPopuplogin();
return;
}
// #endif
var c = /^([1-9][0-9]*)+(\.[0-9]{1,2})?$/;
if (that.inputMoney == '' || that.inputMoney < 10 || !(c.test(this.inputMoney))) {
uni.showToast({
@ -732,7 +903,91 @@
}
</script>
<style lang="less">
<style lang="scss">
.form {
width: 100%;
border-radius: 8px;
font-size: 30upx;
position: absolute;
background-color: #FFFFFF;
top: 50px;
.username,
.password,
.code {
width: calc(100% - 90upx);
height: 90upx;
display: flex;
align-items: center;
background-color: rgba($color: #ffffff, $alpha: 0.1);
border-bottom: 1px solid #f6f6f6;
padding: 0 45upx;
margin-bottom: 80upx;
margin-top: 40px;
input {
width: 60%;
height: 50upx;
font-size: 16px;
color: #333333;
font-weight: blod;
padding-left: 10px;
}
}
.btn {
color: #FFFFFF;
background-color: #0083f5;
width: 80%;
margin-left: 10%;
margin-top: 80rpx;
margin-bottom: 50rpx;
height: 90rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 45rpx;
font-size: 28rpx;
}
}
.re {
.username {
position: relative;
.get-code {
position: absolute;
height: 90upx;
display: flex;
align-items: center;
justify-content: center;
right: 0;
padding: 0 40upx;
z-index: 3;
&:after {
content: " ";
width: 1upx;
height: 50upx;
// background-color: #333333;
position: absolute;
z-index: 3;
margin-right: 100%;
left: 0;
top: 20upx;
}
}
}
.res {
display: flex;
justify-content: center;
align-items: center;
height: 100upx;
color: rgba($color: #ffffff, $alpha: 0.8);
}
}
.titlecon {
border-radius: 10px 10px 0 0;
position: relative;
@ -813,8 +1068,7 @@
margin-right: 2%;
margin-top: 20upx;
float: left;
height: 120upx;
line-height: 120upx;
height: 130upx;
// display: flex;
justify-content: center;
align-items: center;
@ -842,7 +1096,9 @@
font-size: 12px;
}
}
.colorfe80{
color: #089bf5;
}
.footer {
position: fixed;
bottom: 0upx;

@ -33,10 +33,8 @@
</template>
<script>
import md5 from "@/common/SDK/md5.min.js";
import {
sendSmsCodeByHw,
bindUserPhone,
H5login
} from "../../Utils/Api.js";
let app = getApp();
@ -44,10 +42,7 @@
data() {
return {
phoneNumber: "",
imagewxUrl: app.globalData.imageWxImg,
imgadres: 'wx.png',
code: '',
passwd: "",
getCodeText: '获取验证码',
getCodeBtnColor: "#ffffff",
getCodeisWaiting: false,
@ -153,6 +148,7 @@
let params = {
phone: this.phoneNumber,
code: this.code,
openId: app.globalData.openId,
popularizeUserId: userid,
regionId: app.globalData.cityId
}

@ -121,7 +121,7 @@
this.categoryList = [];
this.MerchantList = [];
if (app.globalData.cityName != '') {
this.city = app.globalData.cityName;
this.city = app.globalData.qianzhuCityName;
this.getMerchantList();
} else {
this.postionIng();
@ -168,10 +168,10 @@
}
findByLatAndLng(datas).then(res => {
if (res.return_code == '000000') {
this.city = res.return_data.result.addressComponent.province;
app.globalData.cityName = res.return_data.result.addressComponent
.province;
app.globalData.cityId = res.return_data.result.addressComponent.adcode;
this.city = res.return_data.provinceName;
app.globalData.cityName = res.return_data.provinceName;
app.globalData.qianzhuCityName = res.return_data.cityName;
app.globalData.cityId = res.return_data.regionId;
// app.globalData.cityId = '500100';
if (res.return_data.result.addressComponent.adcode) {
this.getMerchantList();

@ -190,7 +190,7 @@
onShow() {
if (app.globalData.cityName != '') {
this.city = app.globalData.cityName;
this.city = app.globalData.qianzhuCityName;
this.getCouponListArea();
this.getCouponListgold();
this.getunioncardCouponListgold();
@ -462,13 +462,12 @@
}
findByLatAndLng(datas).then(res => {
if (res.return_code == '000000') {
that.city = res.return_data.result.addressComponent.province;
app.globalData.cityName = res.return_data.result.addressComponent
.province;
app.globalData.qianzhuCityName = res.return_data.result.addressComponent.city;
app.globalData.cityId = res.return_data.result.addressComponent.adcode;
that.city = res.return_data.provinceName;
app.globalData.cityName = res.return_data.provinceName;
app.globalData.qianzhuCityName = res.return_data.cityName;
app.globalData.cityId = res.return_data.regionId;
// app.globalData.cityId = '500103';
if (res.return_data.result.addressComponent.adcode) {
if (res.return_data.regionId) {
that.getCouponListArea();
that.getCouponListgold();
that.getunioncardCouponListgold();
@ -554,6 +553,12 @@
}
}
})
}else{
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
});
},

@ -1,8 +1,6 @@
<template>
<view>
<view class="width100 backcorfff">
<!-- <uSearchBar @confirm="search" @input="input"></uSearchBar>
<view class="line1 mart10"></view> -->
<!-- <view class="width100 backcorfff">
<view class="width90 mart20 font15 fcor333">当前定位</view>
<view class="posacname actives mart20">{{posName}}</view>
<view class="width90 mart20 font14 fcor333">其他地区</view>
@ -10,52 +8,137 @@
v-for="(item,index) in posList" :key="index" @click="change(item)">
{{item.regionName}}
</view>
</view>
</view> -->
<city-select @cityClick="cityClick" :formatName="formatName" :activeCity="activeCity" :hotCity="hotCity"
:obtainCitys="obtainCitys" :isSearch="true" ref="citys"></city-select>
</view>
</template>
<script>
import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue';
// import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue';
// import {
// getDredgeProvince
// } from '../../../Utils/Api.js';
import {
getDredgeProvince
getAllCity,
findCompanyByCityName
} from '../../../Utils/Api.js';
import citySelect from '@/components/city-select/city-select.vue';
let app = getApp();
export default {
components: {
uSearchBar
// uSearchBar,
citySelect
},
data() {
return {
posList: [],
posId: '',
posName: ''
// posList: [],
// posId: '',
// posName: ''
//
formatName: 'cityName',
//
activeCity: {},
//
hotCity: [{
id: 0,
cityName: '南京市'
},
{
id: 1,
cityName: '南京市'
}
],
//
obtainCitys: []
}
},
onLoad() {
this.getDredgeProvince();
this.posName = app.globalData.cityName;
// this.getDredgeProvince();
// this.posName = app.globalData.cityName;
this.getAllCity();
this.activeCity = {
id: 1,
cityName: app.globalData.qianzhuCityName
}
//
this.hotCity = [{
id: 0,
cityName: '南京市',
cityCode: 110100
},
{
id: 1,
cityName: '北京市',
cityCode: 110102
}
]
},
methods: {
//
cityClick(item) {
// app.globalData.qianzhuCityName = item.cityName;
getDredgeProvince() {
this.findCompanyByCityName(item);
},
//
getAllCity() {
uni.showLoading({
title: '加载中'
title: '加载中...'
})
getDredgeProvince().then(res => {
uni.hideLoading()
getAllCity().then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.posList = res.return_data;
this.obtainCitys = res.return_data;
}
});
})
},
change(item) {
this.posId = item.regionId;
this.posName = item.regionName;
app.globalData.cityId = item.regionId;
app.globalData.cityName = item.regionName;
uni.navigateBack({
//
findCompanyByCityName(item) {
uni.showLoading({
title: '加载中...'
})
let datas = {
cityName: item.cityName
}
findCompanyByCityName(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
app.globalData.cityName = res.return_data.provinceName;
app.globalData.qianzhuCityName = res.return_data.cityName;
app.globalData.cityId = res.return_data.regionId;
uni.navigateBack({})
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
}
// getDredgeProvince() {
// uni.showLoading({
// title: ''
// })
// getDredgeProvince().then(res => {
// uni.hideLoading()
// if (res.return_code == '000000') {
// this.posList = res.return_data;
// }
// });
// },
// change(item) {
// this.posId = item.regionId;
// this.posName = item.regionName;
// app.globalData.cityId = item.regionId;
// app.globalData.cityName = item.regionName;
// uni.navigateBack({
// })
// }
}
}
</script>
@ -72,6 +155,7 @@
text-align: center;
border-radius: 5px;
}
.posacname {
background-color: #f5f5f5;
color: #666666;

@ -7,7 +7,8 @@
<script>
import {
loginBySilence,
getH5AccessToken
getH5AccessToken,
getH5AccessByOpenId
} from '../../Utils/Api.js';
let app = getApp();
export default {
@ -106,14 +107,37 @@
key: "openId",
data: res.return_data.openid
})
this.getH5AccessByOpenId();
} else {
this.jumpcdx();
}
});
},
//
getH5AccessByOpenId() {
let datas = {
openId: app.globalData.openId
}
getH5AccessByOpenId(datas).then(res => {
app.globalData.userInfo = res.return_data
.object
.highUser;
app.globalData.token = res.return_data.uniqueCode;
uni.setStorage({
key: "user",
data: res.return_data
.object
.highUser
})
uni.setStorage({
key: "token",
data: res.return_data.uniqueCode
})
})
},
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';
},
}
}

Loading…
Cancel
Save