|
|
|
@ -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; |
|
|
|
|