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. 24
      pages/tabBar/home/home.vue

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

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

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

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

Loading…
Cancel
Save