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

2.上线h5 小程序
yj-dev
杨杰 3 years ago
parent 0fe1631877
commit ddf5a75413
  1. 44
      App.vue
  2. 12
      Utils/Api.js
  3. 26
      pages/goods/refuel-confirm/refuel-confirm.vue
  4. 342
      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. 268
      pages/user/positioning/positioning.vue
  9. 32
      pages/welcome/welcome.vue

@ -11,9 +11,9 @@
// imageWxImg: 'https://hsg.dctpay.com/filesystem/wxApplets/', // imageWxImg: 'https://hsg.dctpay.com/filesystem/wxApplets/',
// //
url: 'https://hsgcs.dctpay.com/crest', url: 'https://hsgcs.dctpay.com/crest',
brestUrl : 'https://hsgcs.dctpay.com/brest', brestUrl: 'https://hsgcs.dctpay.com/brest',
imgUrl: 'https://hsgcs.dctpay.com/filesystem/', imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
imageWxImg:'https://hsgcs.dctpay.com/filesystem/wxApplets/', imageWxImg: 'https://hsgcs.dctpay.com/filesystem/wxApplets/',
userInfo: "", userInfo: "",
brestUserInfo: '', brestUserInfo: '',
bresthighAgent: '', bresthighAgent: '',
@ -51,13 +51,41 @@
//id //id
mchId: '', mchId: '',
// //
qianzhuCityName: '重庆市', qianzhuCityName: '重庆市',
// //
pelletoilList:'' pelletoilList: ''
},
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;
}
}
})
}, },
onLaunch: function() {},
onShow: function() {},
onHide: function() {} onHide: function() {}
} }
</script> </script>

@ -353,7 +353,12 @@ export const getTPigKFCToken = params => {
//查询城市列表 //查询城市列表
export const getAllCity = params => { export const getAllCity = params => {
return POST('GET', `${base}/highThirdParty/getAllCity`, params).then(res => res.data); 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 => { export const getKfcStoresList = params => {
return POST('GET', `${base}/highThirdParty/getKfcStoresList`, params).then(res => res.data); return POST('GET', `${base}/highThirdParty/getKfcStoresList`, params).then(res => res.data);
@ -437,6 +442,11 @@ export const cancelOrderByOrderNo = params => {
* H5 获取用户信息 * H5 获取用户信息
*/ */
//判断是否有手机号
export const getH5AccessByOpenId = params => {
return POST('GET', `${base}/wechat/getH5AccessByOpenId`, params).then(res => res.data);
}
//h5静默登陆 //h5静默登陆
export const loginBySilence = params => { export const loginBySilence = params => {
return POST('GET', `${base}/wechat/loginBySilence`, params).then(res => res.data); return POST('GET', `${base}/wechat/loginBySilence`, params).then(res => res.data);

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

@ -73,12 +73,13 @@
</view> </view>
</view> </view>
<!-- <view class="list width90"> <view class="list width90">
<view class="box" v-for="(amount,index) in amountList" :key="index" @click="select(amount)" <view class="box" v-for="(amount,index) in amountList" :key="index" @click="select(amount)"
:class="{'on':amount.price == inputMoney}"> :class="{'on':amount.codeValue == inputMoney}">
<view class="heTitle fcor333" :class="{'fcor089':amount.id == inputAmount}">{{amount.price}}</view> <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>
<!-- 详情描述--> <!-- 详情描述-->
<view class="line10 mart15"></view> <view class="line10 mart15"></view>
@ -119,8 +120,8 @@
<button class="reBtn flright" v-else @click="postionIng">去支付</button> <button class="reBtn flright" v-else @click="postionIng">去支付</button>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<button class="reBtn flright" v-if="user.phone == null" @click="jumpH5Bding">去支付</button> <!-- <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" @click="postionIng">去支付</button>
<!-- #endif --> <!-- #endif -->
</view> </view>
<!-- 底部弹窗 --> <!-- 底部弹窗 -->
@ -144,6 +145,25 @@
</view> </view>
</wybPopup> </wybPopup>
<view class="height30"></view> <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> </view>
</template> </template>
@ -153,7 +173,10 @@
addOrder, addOrder,
getDictionaryByCodeTypeOl, getDictionaryByCodeTypeOl,
oilPriceDiscountCompute, oilPriceDiscountCompute,
recentGasStation recentGasStation,
sendSmsCodeByHw,
H5login,
getDictionaryByCodeType
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
let app = getApp(); let app = getApp();
@ -171,24 +194,24 @@
detailList: [], detailList: [],
gunnumber: [], gunnumber: [],
user: '', user: '',
amountList: [{ amountList: [
id: '1', // {
price: '200' // id: '1',
}, // price: '200'
{ // },
id: '2', // {
price: '300' // id: '2',
}, // price: '300'
{ // },
id: '3', // {
price: '400' // id: '3',
}, // price: '400'
{ // },
id: '4', // {
price: '500' // id: '4',
} // price: '500'
// }
], ],
inputAmount: '',
store_key: '', store_key: '',
storeList: '', storeList: '',
oilNo: '', oilNo: '',
@ -215,6 +238,14 @@
pricePreferences: '0', // pricePreferences: '0', //
totalPreferences: '0', // totalPreferences: '0', //
locationRef: null, // locationRef: null, //
//
phoneNumber: "",
code: '',
getCodeText: '获取验证码',
getCodeBtnColor: "#ffffff",
getCodeisWaiting: false,
showtoastdes:'' //
} }
}, },
onLoad(options) { onLoad(options) {
@ -241,10 +272,11 @@
this.getGasDetailByStoreKey(); this.getGasDetailByStoreKey();
// #endif // #endif
this.getDictionaryByCodeTypeOl(); this.getDictionaryByCodeTypeOl();
this.getDictionaryByCodeTypeMoney(); this.getDictionaryByCodeTypeMoney();
this.getDictionaryByCodeType();
}, },
onShow() { onShow() {
this.user = app.globalData.userInfo; this.user = app.globalData.userInfo;
}, },
onUnload() { onUnload() {
if (app.globalData.accountType && app.globalData.accountType == '000000#/') { if (app.globalData.accountType && app.globalData.accountType == '000000#/') {
@ -254,7 +286,142 @@
app.globalData.accountType = ''; app.globalData.accountType = '';
} }
}, },
methods: { 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() { seeloaction() {
// #ifdef MP // #ifdef MP
@ -271,8 +438,12 @@
this.typeId = item; this.typeId = item;
this.$refs.popup.show(); this.$refs.popup.show();
}, },
showPopuplogin() {
this.$refs.popups.show();
},
// //
recentGasStation() { recentGasStation() {
this.gunnumber = [];
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}) })
@ -312,7 +483,8 @@
}) })
}, },
// //
getGasDetailByStoreKey() { getGasDetailByStoreKey() {
this.gunnumber = [];
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}) })
@ -422,19 +594,10 @@
// //
changeValue2(item) { changeValue2(item) {
this.gunNo = item.gunNo; 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(); this.$refs.popup.hide();
}, },
select(amount) { select(amount) {
this.inputMoney = amount.price; this.inputMoney = amount.codeValue;
this.oilPriceDiscountCompute(); this.oilPriceDiscountCompute();
}, },
// H5 // H5
@ -537,6 +700,14 @@
*/ */
postionIng() { postionIng() {
let that = this; 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})?$/; var c = /^([1-9][0-9]*)+(\.[0-9]{1,2})?$/;
if (that.inputMoney == '' || that.inputMoney < 10 || !(c.test(this.inputMoney))) { if (that.inputMoney == '' || that.inputMoney < 10 || !(c.test(this.inputMoney))) {
uni.showToast({ uni.showToast({
@ -732,7 +903,91 @@
} }
</script> </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 { .titlecon {
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
position: relative; position: relative;
@ -813,8 +1068,7 @@
margin-right: 2%; margin-right: 2%;
margin-top: 20upx; margin-top: 20upx;
float: left; float: left;
height: 120upx; height: 130upx;
line-height: 120upx;
// display: flex; // display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -842,7 +1096,9 @@
font-size: 12px; font-size: 12px;
} }
} }
.colorfe80{
color: #089bf5;
}
.footer { .footer {
position: fixed; position: fixed;
bottom: 0upx; bottom: 0upx;

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

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

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

@ -1,93 +1,177 @@
<template> <template>
<view> <view>
<view class="width100 backcorfff"> <!-- <view class="width100 backcorfff">
<!-- <uSearchBar @confirm="search" @input="input"></uSearchBar> <view class="width90 mart20 font15 fcor333">当前定位</view>
<view class="line1 mart10"></view> --> <view class="posacname actives mart20">{{posName}}</view>
<view class="width90 mart20 font15 fcor333">当前定位</view> <view class="width90 mart20 font14 fcor333">其他地区</view>
<view class="posacname actives mart20">{{posName}}</view> <view class="posheadname mart20 flleft font14" :class="{'actives':posId===item.regionId}"
<view class="width90 mart20 font14 fcor333">其他地区</view> v-for="(item,index) in posList" :key="index" @click="change(item)">
<view class="posheadname mart20 flleft font14" :class="{'actives':posId===item.regionId}" {{item.regionName}}
v-for="(item,index) in posList" :key="index" @click="change(item)"> </view>
{{item.regionName}} </view> -->
</view>
</view> <city-select @cityClick="cityClick" :formatName="formatName" :activeCity="activeCity" :hotCity="hotCity"
</view> :obtainCitys="obtainCitys" :isSearch="true" ref="citys"></city-select>
</template> </view>
</template>
<script>
import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue'; <script>
import { // import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue';
getDredgeProvince // import {
} from '../../../Utils/Api.js'; // getDredgeProvince
let app = getApp(); // } from '../../../Utils/Api.js';
export default { import {
components: { getAllCity,
uSearchBar findCompanyByCityName
}, } from '../../../Utils/Api.js';
data() { import citySelect from '@/components/city-select/city-select.vue';
return { let app = getApp();
posList: [], export default {
posId: '', components: {
posName: '' // uSearchBar,
} citySelect
}, },
onLoad() { data() {
this.getDredgeProvince(); return {
this.posName = app.globalData.cityName; // posList: [],
}, // posId: '',
methods: { // posName: ''
getDredgeProvince() { //
uni.showLoading({ formatName: 'cityName',
title: '加载中' //
}) activeCity: {},
getDredgeProvince().then(res => { //
uni.hideLoading() hotCity: [{
if (res.return_code == '000000') { id: 0,
this.posList = res.return_data; cityName: '南京市'
} },
}); {
}, id: 1,
change(item) { cityName: '南京市'
this.posId = item.regionId; }
this.posName = item.regionName; ],
app.globalData.cityId = item.regionId; //
app.globalData.cityName = item.regionName; obtainCitys: []
uni.navigateBack({ }
}) },
} onLoad() {
} // this.getDredgeProvince();
} // this.posName = app.globalData.cityName;
</script> this.getAllCity();
this.activeCity = {
<style lang="less"> id: 1,
.posheadname { cityName: app.globalData.qianzhuCityName
background-color: #f5f5f5; }
color: #666666; //
padding-left: 10px; this.hotCity = [{
padding-right: 10px; id: 0,
height: 30px; cityName: '南京市',
margin-left: 4%; cityCode: 110100
line-height: 30px; },
text-align: center; {
border-radius: 5px; id: 1,
} cityName: '北京市',
.posacname { cityCode: 110102
background-color: #f5f5f5; }
color: #666666; ]
display: inline-block; },
padding-left: 10px; methods: {
padding-right: 10px; //
height: 30px; cityClick(item) {
margin-left: 4%; // app.globalData.qianzhuCityName = item.cityName;
line-height: 30px;
text-align: center; this.findCompanyByCityName(item);
border-radius: 5px; },
} //
getAllCity() {
.actives { uni.showLoading({
color: #089bf5; title: '加载中...'
background-color: #f4faff; })
border: 1px solid #089bf5;
} getAllCity().then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.obtainCitys = res.return_data;
}
})
},
//
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>
<style lang="less">
.posheadname {
background-color: #f5f5f5;
color: #666666;
padding-left: 10px;
padding-right: 10px;
height: 30px;
margin-left: 4%;
line-height: 30px;
text-align: center;
border-radius: 5px;
}
.posacname {
background-color: #f5f5f5;
color: #666666;
display: inline-block;
padding-left: 10px;
padding-right: 10px;
height: 30px;
margin-left: 4%;
line-height: 30px;
text-align: center;
border-radius: 5px;
}
.actives {
color: #089bf5;
background-color: #f4faff;
border: 1px solid #089bf5;
}
</style> </style>

@ -6,8 +6,9 @@
<script> <script>
import { import {
loginBySilence, loginBySilence,
getH5AccessToken getH5AccessToken,
getH5AccessByOpenId
} from '../../Utils/Api.js'; } from '../../Utils/Api.js';
let app = getApp(); let app = getApp();
export default { export default {
@ -16,7 +17,7 @@
} }
}, },
onLoad(options) { onLoad(options) {
let that = this; let that = this;
// #ifdef MP // #ifdef MP
app.globalData.accountId = options.accountId; app.globalData.accountId = options.accountId;
@ -106,14 +107,37 @@
key: "openId", key: "openId",
data: res.return_data.openid data: res.return_data.openid
}) })
this.getH5AccessByOpenId();
} else { } else {
this.jumpcdx(); 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() { jumpcdx() {
location.href = 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