1.提交H5 代码

yj-dev
杨杰 4 years ago
parent 9b8964f50b
commit e2b626f3df
  1. 9
      pages/login/register.vue
  2. 6
      pages/order/confirmation.vue
  3. 1
      pages/pay/payment/payment.vue
  4. 20
      pages/tabBar/home/home.vue

@ -18,7 +18,8 @@
<!-- <view class="password">
<input placeholder="请输入密码" v-model="passwd" password=true placeholder-style="color: rgba(255,255,255,0.8);"/>
</view> -->
<view class="btn mart50" @tap="doReg">立即注册</view>
<view class="btn mart50" v-if="Typeid == 1" @tap="doReg">立即注册</view>
<view class="btn mart50" v-else @tap="doReg">绑定手机号</view>
<!-- <view class="res">
<view @tap="toLogin">已有账号立即登录</view>
</view> -->
@ -172,9 +173,9 @@
key: "token",
data: res.return_data.uniqueCode
})
uni.reLaunch({
url: '/pages/tabBar/home/home'
});
uni.navigateBack({
})
} else {
uni.showToast({
title: res.return_msg,

@ -148,8 +148,8 @@
<button class="btn" v-else @tap="toPay">实际支付</button>
<!-- #endif -->
<!-- #ifdef H5 -->
<button class="btn" v-if="user.phone == null" @getphonenumber="bindUserPhone">实际支付</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,11 +205,11 @@
},
onLoad(option) {
this.couponId = option.id;
this.user = app.globalData.userInfo;
this.getCouponById();
this.getUserNormalDiscountList();
},
onShow() {
this.user = app.globalData.userInfo;
},
onHide() {

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

@ -174,12 +174,18 @@
// #ifdef H5
var arr1 = window.location.href;
var arr2 = arr1.split('=');
console.log(arr2);
if (!app.globalData.userInfo && arr2[1] != undefined) {
this.getH5UserInfo(arr2[1]);
}
// #endif
},
onLoad() {
if (this.isWeiXinLogin()) {
//
}
// 1.wxcode
// #ifdef MP
uni.login({
@ -252,6 +258,15 @@
}
})
},
//
isWeiXinLogin() {
var ua = navigator.userAgent.toLowerCase();
if (ua.search(/MicroMessenger/i) > -1) {
return true;
} else {
return false;
}
},
//H5
getH5UserInfo(item) {
let params = {
@ -263,7 +278,6 @@
.object
.highUser;
app.globalData.token = res.return_data.uniqueCode;
that.isShowAuth = false
uni.setStorage({
key: "user",
data: res.return_data
@ -274,7 +288,9 @@
key: "token",
data: res.return_data.uniqueCode
})
app.globalData.openId = res.return_data
.object
.highUser.openIdH5;
} else {
uni.showToast({
title: res.return_msg

Loading…
Cancel
Save