1.调试用户注册

yj-dev
杨杰 3 years ago
parent e2b626f3df
commit 417eb0e7d8
  1. 3
      Utils/Api.js
  2. 17
      pages/login/register.vue
  3. 5
      pages/order/confirmation.vue
  4. 3
      pages/pay/payment/payment.vue
  5. 42
      pages/tabBar/home/home.vue

@ -151,6 +151,9 @@ export const bindUserPhone = params => {
export const H5login = params => {
return POST('GET', `${base}/user/login`, params).then(res => res.data);
}
export const getH5AccessToken = params => {
return POSTBREST('GET', `${base}/wechat/getH5AccessToken`, params).then(res => res.data);
}
//**门店//
export const userLogin = params => {

@ -24,7 +24,7 @@
<view @tap="toLogin">已有账号立即登录</view>
</view> -->
<image v-if="Typeid == 1" @click="openWx" src='../../static/img/share/wx.png' class="wximg"></image>
<image v-if="Typeid == 1" @click="openWx" src='../../static/img/share/wx.png' class="wximg"></image>
</view>
</view>
@ -145,9 +145,9 @@
key: "token",
data: res.return_data.uniqueCode
})
uni.reLaunch({
url: '/pages/tabBar/home/home'
});
location.href =
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2FH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect'
} else {
uni.showToast({
title: res.return_msg,
@ -173,9 +173,7 @@
key: "token",
data: res.return_data.uniqueCode
})
uni.navigateBack({
})
uni.navigateBack({})
} else {
uni.showToast({
title: res.return_msg,
@ -189,7 +187,7 @@
//
openWx() {
location.href =
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2FH5%2Findex.html%23%2F&response_type=code&scope=snsapi_userinfo#wechat_redirect';
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2FH5%2Findex.html%23%2F&response_type=code&scope=snsapi_userinfo&state=2#wechat_redirect';
},
toLogin() {
uni.hideKeyboard()
@ -204,7 +202,8 @@
<style lang="scss">
@import "../../static/css/login.scss";
.wximg{
.wximg {
width: 50px;
height: 50px;
margin-left: 40%;

@ -148,8 +148,8 @@
<button class="btn" v-else @tap="toPay">实际支付</button>
<!-- #endif -->
<!-- #ifdef H5 -->
<button class="btn" v-if="user.phone == null" @click="jumpH5Bding">实际..支付</button>
<button class="btn" v-else @tap="toPay">实际++支付</button>
<button class="btn" v-if="user.phone == null" @click="jumpH5Bding">实际支付</button>
<button class="btn" v-else @tap="toPay">实际支付</button>
<!-- #endif -->
</view>
@ -205,6 +205,7 @@
},
onLoad(option) {
this.couponId = option.id;
this.user = app.globalData.userInfo;
this.getCouponById();
this.getUserNormalDiscountList();
},

@ -120,8 +120,7 @@
}
orderToPay(params).then(res => {
if (res.return_code == '000000') {
uni.pay
alert('=============================')
uni.requestPayment({
"appId": res.return_data.appId,
"nonceStr": res.return_data.nonceStr,

@ -114,7 +114,8 @@
HandleCode,
WXlogin,
getCouponList,
getH5UserInfo
getH5UserInfo,
getH5AccessToken
} from "../../../Utils/Api.js"; //api
let app = getApp();
export default {
@ -174,17 +175,19 @@
// #ifdef H5
var arr1 = window.location.href;
var arr2 = arr1.split('=');
console.log(arr2);
if (!app.globalData.userInfo && arr2[1] != undefined) {
if (!app.globalData.userInfo && arr2[1] != undefined && arr2[2] == '2#/') {
this.getH5UserInfo(arr2[1]);
}
if (app.globalData.userInfo && arr2[1] != undefined && arr2[2] == '1#/') {
this.getH5AccessToken(arr2[1]);
}
// #endif
},
onLoad() {
if (this.isWeiXinLogin()) {
//
}
// 1.wxcode
// #ifdef MP
@ -219,6 +222,15 @@
},
fail: res => {}
})
// #ifdef H5
uni.getStorage({
key: "openId",
success(e) {
app.globalData.openId = e.data
},
fail: res => {}
})
// #endif
},
methods: {
@ -258,6 +270,22 @@
}
})
},
//H5 openId
getH5AccessToken(item) {
let params = {
code: item
}
getH5AccessToken(params).then(res => {
if (res.return_code == '000000') {
app.globalData.openId = res.return_data.openid;
uni.setStorage({
key: "openId",
data: res.return_data.openid
})
}
});
},
//
isWeiXinLogin() {
var ua = navigator.userAgent.toLowerCase();
@ -288,6 +316,12 @@
key: "token",
data: res.return_data.uniqueCode
})
uni.setStorage({
key: "openId",
data: res.return_data
.object
.highUser.openIdH5
})
app.globalData.openId = res.return_data
.object
.highUser.openIdH5;

Loading…
Cancel
Save