Commit 8836f8d5 authored by 刘文虎's avatar 刘文虎

安卓登录/支付

parent 12f90e11
Pipeline #3283 canceled with stages
;(function() {
let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境
let NODE_ENV = 'test' // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null
let VERSION = 'v1.0.11'
if (process.env.NODE_ENV === 'development') {
......
......@@ -2,6 +2,10 @@
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"app-plus" :
{
"launchtype" : "local"
},
"default" :
{
"launchtype" : "local"
......
<script>
// import{setToken,setRefreshToken} from "@/utils/common.js"
export default {
onLaunch: function() {
// setToken("eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ1bmlvbklkIjoib1gtVEs2VmVTWmNVbUx0cWhodk15NU1mYk9IMCIsIm9wZW5JZCI6Im9aZk5VNUVhSEF3bGdrbm8yQno3Y1Q0X0JRVUUiLCJuYW1lIjoi6Ze7562gIiwibW9iaWxlIjoiMTM0MjM4MzExOTEiLCJ0b2tlbl90eXBlIjoidG9rZW4iLCJ1c2VyaWQiOiIxNTUyNDg2NzEyMzY4NjkzMjQ4IiwiYWNjb3VudCI6IjEzNDIzODMxMTkxIiwiaWF0IjoxNjYwNzA4MzYyLCJuYmYiOjE2NjA3MDgzNjIsImV4cCI6MTY2MjAwNDM2Mn0.9hBVwqmYDxL4Q0S05JXQqteOWI9kda_UXxX5-eNO1LY")
// setRefreshToken("eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ1bmlvbklkIjoib1gtVEs2VmVTWmNVbUx0cWhodk15NU1mYk9IMCIsIm9wZW5JZCI6Im9aZk5VNUVhSEF3bGdrbm8yQno3Y1Q0X0JRVUUiLCJ0b2tlbl90eXBlIjoicmVmcmVzaF90b2tlbiIsInVzZXJpZCI6IjE1NTI0ODY3MTIzNjg2OTMyNDgiLCJpYXQiOjE2NjA3MDgzNjIsIm5iZiI6MTY2MDcwODM2MiwiZXhwIjoxNzE5MDI4MzYyfQ.rKsc9uKkNwKMFXxZ--MxHAvXdtH6iWlR_gWD_vdQHT4")
// 版本更新
this.updateApp();
console.log('App Launch')
......
......@@ -11,8 +11,18 @@ export function userAuthLogin(data) {
export function sendCode(data) {
return request({
url: `/anno/moblie/sendCode`,
url: `/anno/mobile/sendCode`,
method: 'GET',
data
})
}
export function mobileLogin(data) {
return request({
url: `/anno/mobileLogin`,
method: 'GET',
data,
noLoading:true
})
}
\ No newline at end of file
......@@ -131,7 +131,9 @@ export default {
...mapGetters(['billType']),
},
mounted() {
this.init();
this.$nextTick(()=>{
this.init();
})
},
onUnload() {
uni.$off(this.notification);
......@@ -144,7 +146,10 @@ export default {
this.getBillTypeOptions();
this.getQiniuToken();
}
this.$refs['ab-calculator'].clearAll()
// this.$nextTick(()=>{
// this.$refs['calendar-popup'].open();
// this.$refs['ab-calculator'].clearAll()
// })
},
async getBillTypeOptions() {
......@@ -192,7 +197,6 @@ export default {
open(id) {
this.getQiniuToken();
// this.getBillTypeOptions();
this.$refs['ab-calculator'].clearAll()
if (id) {
this.id = id;
this.getDetail();
......@@ -214,6 +218,9 @@ export default {
this.form.classificationId = this.billingCategoryList[0]&&this.billingCategoryList[0][0].id||'';
}
this.show = true;
this.$nextTick(()=>{
this.$refs['ab-calculator'].clearAll()
})
}
},
async getDetail() {
......@@ -225,6 +232,9 @@ export default {
this.form = data;
await this.getBillTypeOptions();
this.show = true;
this.$nextTick(()=>{
this.$refs['ab-calculator'].clearAll()
})
} catch (e) {
console.log(e);
//TODO handle the exception
......
......@@ -9,7 +9,10 @@
<view class="item-title">{{item.title}}</view>
</view>
<view class="right-view">
<image v-if="item.select" class="select-image" :src="selectImage"></image>
<!-- <image v-if="item.select" class="select-image" :src="selectImage"></image> -->
<view v-if="item.select" class="selected select-view">
<u-icon name="checkbox-mark"></u-icon>
</view>
<view v-else class="select-view"></view>
</view>
</view>
......@@ -32,9 +35,8 @@
data() {
return {
show: false,
selectImage: '/static/images/mine/xuanze1@3x.png',
list: [{
image: '/static/images/mine/weixinzhifu@3x.png',
image: '/static/image/mine/weixinzhifu@3x.png',
title: '微信支付',
select: true,
provider: 'wxpay'
......@@ -132,6 +134,16 @@
border-radius: 50%;
border: 2rpx solid #8D8D8D;
}
.selected{
border-color:$default-color;
background-color: $default-color;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
font-weight: bold;
}
}
}
}
......@@ -140,8 +152,8 @@
margin-top: 220rpx;
.buy-button {
background-color: #3383fe;
border-radius: 52rpx;
background-color: $default-color;
border-radius: 16rpx;
color: #fff;
text-align: center;
height: 104rpx;
......
<template>
<view class="">
<u-popup v-model="show" border-radius="24" safe-area-inset-bottom mode="bottom" :duration='100'>
<u-popup v-model="show" border-radius="24" safe-area-inset-bottom mode="bottom" :duration="100">
<view class="mid-popup">
<u-row gutter="16">
<u-col span="4" v-for="(item, index) in list" :key="index">
<view class="button-view" @click="clickItem(item)">
<view class="button-view-icon"><image :src="item.icon" mode=""></image></view>
<view class="button-view-icon"><image :src="indexBaseUrl+item.icon" mode="" v-if="item.icon"></image></view>
<view class="button-view-content">{{ item.label }}</view>
</view>
</u-col>
......@@ -14,20 +14,16 @@
</view>
</u-popup>
<billing-daily ref="billing-daily" :type="type" @afterSave="afterSave"></billing-daily>
<PopNormal
:visible.sync="visible"
type="renew"
confirmText="续费会员"
cancelText="取消"
/>
<PopNormal :visible.sync="visible" type="renew" confirmText="续费会员" cancelText="取消" />
</view>
</template>
<script>
import BillingDetails from '@/components/billing-daily/billing-daily.vue';
import { minPopupOptions } from '@/utils/options/index/index.js';
import { checkLoginAndVip} from '@/utils/common.js';
import PopNormal from '@/components/pop-normal'
import { checkLoginAndVip } from '@/utils/common.js';
import { indexBaseUrl } from '@/utils/config.js';
import PopNormal from '@/components/pop-normal';
export default {
name: 'mid-popup',
......@@ -37,6 +33,7 @@ export default {
},
data() {
return {
indexBaseUrl,
show: false,
type: '',
list: minPopupOptions,
......@@ -50,20 +47,20 @@ export default {
close() {
this.show = false;
},
clickItem(item){
checkLoginAndVip((res)=>{
clickItem(item) {
checkLoginAndVip(res => {
if (res) {
this.visible = true
this.visible = true;
} else {
this.openBill(item)
this.openBill(item);
}
})
});
},
openBill(item) {
this.type = item.type;
this.close();
if (this.type === '3') {
this.openBillingDaily()
this.openBillingDaily();
} else {
if (item.path) {
uni.navigateTo({
......@@ -72,11 +69,11 @@ export default {
}
}
},
openBillingDaily(){
openBillingDaily() {
this.$refs['billing-daily'].open();
},
afterSave(){
this.$emit("afterSave")
afterSave() {
this.$emit('afterSave');
}
}
};
......@@ -100,7 +97,7 @@ export default {
&-icon {
width: 144upx;
height: 144upx;
display: flex;
// display: flex;
}
&-content {
margin-top: 32upx;
......
......@@ -5,9 +5,11 @@ import '.env.js'
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
//// #ifndef APP-PLUS
import {router,RouterMount} from './router' //路径换成自己的
Vue.use(router)
//// #endif
import uView from "uview-ui";
Vue.use(uView);
......
......@@ -2,8 +2,8 @@
"name" : "account-book",
"appid" : "__UNI__C731E8B",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"versionName" : "1.0.1",
"versionCode" : 101,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
......@@ -19,37 +19,92 @@
/* 模块配置 */
"modules" : {
"OAuth" : {},
"Payment" : {}
"Payment" : {},
"Share" : {}
},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"autoSdkPermissions" : false
},
/* ios打包配置 */
"ios" : {},
"ios" : {
"dSYMs" : false
},
/* SDK配置 */
"sdkConfigs" : {
"ad" : {},
"oauth" : {},
"payment" : {}
"oauth" : {
"weixin" : {
"appid" : "wxe12043817d088b68",
"UniversalLinks" : ""
}
},
"payment" : {
"weixin" : {
"__platform__" : [ "ios", "android" ],
"appid" : "wxe12043817d088b68",
"UniversalLinks" : ""
}
},
"share" : {
"weixin" : {
"appid" : "wxe12043817d088b68",
"UniversalLinks" : ""
}
}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
}
}
},
......
......@@ -116,7 +116,7 @@ import MidPopup from '@/components/mid-popup/mid-popup.vue';
import BillList from '@/components/bill-list';
import PopNormal from '@/components/pop-normal';
import { tabbar } from '@/utils/settings.js';
import { indexBaseUrl ,baseUrl} from '@/utils/config.js';
import { indexBaseUrl,mineBaseUrl ,baseUrl} from '@/utils/config.js';
import { getWeather, bookRecord, monthRecord } from '@/api/maintain/index.js';
import { checkVip, checkToken, getSetting, formatCount } from '@/utils/common.js';
import { mapGetters } from 'vuex';
......@@ -155,7 +155,7 @@ export default {
};
},
computed: {
...mapGetters(['userInfo','eyeClose']),
...mapGetters(['userInfo','eyeClose','platform']),
baseUrl() {
return process.uniEnv.qn_base_url;
},
......@@ -278,7 +278,11 @@ export default {
}
this.shareSuccessTip();
},
onReady() {},
onReady() {
console.log(this.eyeFillImage)
console.log(baseUrl,indexBaseUrl,
mineBaseUrl)
},
onUnload() {
uni.$off('bill-list-reload');
},
......@@ -311,22 +315,24 @@ export default {
}
},
getWeather() {
getSetting('scope.userLocation', '检测到您没打开获取位置权限,该信息将用于小程序获取所在城市和天气状况,是否去设置打开?', res => {
uni.getLocation({
type: 'wgs84',
success: res => {
console.log(res);
getWeather({
latitude: res.latitude,
longitude: res.longitude
}).then(res => {
if (res.data) {
this.weather = res.data;
}
});
}
if(this.platform!=='4'){
getSetting('scope.userLocation', '检测到您没打开获取位置权限,该信息将用于小程序获取所在城市和天气状况,是否去设置打开?', res => {
uni.getLocation({
type: 'wgs84',
success: res => {
console.log(res);
getWeather({
latitude: res.latitude,
longitude: res.longitude
}).then(res => {
if (res.data) {
this.weather = res.data;
}
});
}
});
});
});
}
},
beforeSwitch(index) {
if (index === 2) {
......
......@@ -16,16 +16,14 @@
<text :class="{ active: canGetCode }" @tap="$u.throttle(handleClick, 500)">{{ tips }}</text>
</view>
</view>
<view class="bottom-vew">
<u-button :disabled="disabled" type="primary" :customStyle="buttonStyle" :loading="loading" @click="handleClickSave">
<view class="button-text">立即绑定</view>
</u-button>
<view class="bottom-vew" hover-class="u-hover-class">
<u-button :disabled="disabled" :customStyle="buttonStyle" :loading="loading" @click="handleClickSave"><view class="button-text">立即绑定</view></u-button>
</view>
</view>
</template>
<script>
import {sendCode} from "@/api/login/index.js"
import { sendCode } from '@/api/login/index.js';
export default {
data() {
return {
......@@ -40,11 +38,11 @@ export default {
weixinAuthService: null,
params: {},
tips: '',
buttonStyle:{
buttonStyle: {
height: '104rpx',
backgroundColor: '#3383FE',
backgroundColor: '#02A074',
color: 'transparent'
},
}
};
},
computed: {
......@@ -57,10 +55,10 @@ export default {
},
onLoad(options) {
console.log('-----options----', options);
if (options) {
let { unionid } = options;
if (unionid) {
let { unionId } = options;
if (unionId) {
this.params = options;
}
}
......@@ -114,12 +112,12 @@ export default {
}
},
async getCode() {
try{
let res=await sendCode({moblie: this.phone})
try {
let res = await sendCode({ mobile: this.phone });
if (uni.$u.platform !== '3') {
uni.hideLoading();
}
if (res.status && res.data) {
if (res.data) {
this.$u.toast('验证码已发送');
this.$refs.uCode.start();
console.log('--------发送成功----------');
......@@ -129,11 +127,18 @@ export default {
icon: 'none'
});
}
}catch(e){
} catch (e) {
console.log(e);
if (e.msg) {
uni.showToast({
title: e.msg,
icon: 'none'
});
}
//TODO handle the exception
if (uni.$u.platform !== '3') {
uni.hideLoading();
}
}
}
},
handleClickSave() {
......@@ -150,18 +155,14 @@ export default {
this.loading = false;
return false;
}
const app = getApp();
let userInfo = (app.globalData.tmp && app.globalData.tmp.wxUserInfo) || {
nickName: '',
avatarUrl: ''
};
if (uni.$u.platform === '4') {
this.onAppLogin();
} else {
this.onWxLogin(userInfo);
}
this.onAppLogin();
// if (uni.$u.platform === '4') {
// this.onAppLogin();
// } else {
// this.onWxLogin();
// }
},
async onWxLogin(userInfo) {
async onWxLogin() {
try {
let res = await login.wxLogin();
let params = {
......@@ -186,16 +187,33 @@ export default {
async onAppLogin() {
let params = {
...this.params,
verify: this.code,
mobile: this.phone
password: this.code,
account: this.phone,
authType: this.params.authType?this.params.authType:'AC'
};
console.log(params);
await this.$store.dispatch('On_signup', {
params,
callback: () => {
this.toPhoneLogin();
try {
let res = await this.$store.dispatch('Auto_login', params);
if (res.code === 0) {
this.showToast('登录成功',true);
setTimeout(() => {
if (this.returnUrl) {
// 需要跳转到特定页面
var isSwitchTab = this.returnUrl.indexOf('pages/index/') != -1;
this.$u.route({
url: this.returnUrl,
type: isSwitchTab ? 'switchTab' : 'redirectTo'
});
} else {
uni.switchTab({
url: '/pages/index/index'
});
}
}, 1000);
}
});
} catch (e) {
console.log('onAppLogin', e);
//TODO handle the exception
}
this.loading = false;
},
async onSignup(params) {
......
......@@ -20,7 +20,7 @@
<text>{{ platform == '2' || platform == '3' ? '授权登录' : '微信登录' }}</text>
</view>
</view>
<!-- <view class="cancel-button"><text @click.stop="toPhoneLogin">手机验证码登录</text></view> -->
<view class="cancel-button"><text @click.stop="toPhoneLogin">手机验证码登录</text></view>
<!-- <view class="other-login">
<u-divider>其他登录方式</u-divider>
<view class="other-login-item">
......@@ -42,13 +42,13 @@
</template>
<script>
import { baseUrl } from '@/utils/config.js';
import { baseUrl } from '@/utils/config.js';
import { mapGetters } from 'vuex';
export default {
components: {},
data() {
return {
logoImage:baseUrl+'login-logo@3x.png',
logoImage: baseUrl + 'login-logo@3x.png',
agree: false,
statusBarHeight: 20,
loading: false,
......@@ -65,14 +65,14 @@ export default {
this.statusBarHeight = statusBarHeight;
if (options && options.path) {
this.returnUrl = decodeURIComponent(decodeURIComponent(options.path))
}
this.returnUrl = decodeURIComponent(decodeURIComponent(options.path));
}
},
onShow() {
if (this.loading) {
this.loading = false;
}
uni.hideLoading();
},
methods: {
handleClick(type) {
......@@ -106,65 +106,50 @@ export default {
}
}
},
appWxLogin() {
async appWxLogin() {
uni.showLoading({
title: '授权中'
});
uni.getProvider({
service: 'oauth',
success: async res => {
console.log('getProvider', res);
//支持微信、qq和微博等
if (res.provider.findIndex(e => e === 'weixin') !== -1) {
this.loading = true;
try {
let res = await this.$store.dispatch('Wx_login');
let params = {
code: res.code,
type: uni.$u.platform,
grantType: '1' // APP微信登录
};
this.loading = false;
// uni.hideLoading();
await this.$store.dispatch('On_signup', {
params,
callback: back => {
this.toPhoneLogin(back);
}
});
} catch (e) {
this.loading = false;
console.log('Wx_login:||On_signup:', e);
uni.hideLoading();
}
try {
await this.$store.dispatch('App_get_provider');
let res = await this.$store.dispatch('Auto_login', {});
this.showToast('登录成功', true);
setTimeout(() => {
if (this.returnUrl) {
// 需要跳转到特定页面
var isSwitchTab = this.returnUrl.indexOf('pages/index/') != -1;
this.$u.route({
url: this.returnUrl,
type: isSwitchTab ? 'switchTab' : 'redirectTo'
});
} else {
uni.hideLoading();
uni.showToast({
icon: 'none',
title: '不支持微信登录'
uni.switchTab({
url: '/pages/index/index'
});
}
},
fail() {
uni.hideLoading();
}, 1000);
} catch (e) {
let { code } = e;
if (code === 40011) {
this.toPhoneLogin(e);
}
});
//TODO handle the exception
}
uni.hideLoading();
},
toPhoneLogin(res) {
if (!this.checkAgree()) {
return;
}
console.log('toPhoneLogin');
let { openid, unionid, session_key, nickname, avatar } = res;
console.log('toPhoneLogin', res);
let { openId, unionId, loginChannel, authType } = res.data;
let params = {};
if (unionid) {
if (unionId) {
params = {
openid,
unionid,
session_key,
nickname,
avatar,
grantType: '1' // APP微信登录
openId,
unionId,
loginChannel: loginChannel.code,
authType: authType.code
};
}
this.$u.route({ url: 'pages/login/binding-phone/binding-phone', params });
......@@ -179,7 +164,7 @@ export default {
return false;
}
return true;
},
}
}
};
</script>
......@@ -193,7 +178,7 @@ export default {
&-color {
width: 100%;
height: 30%;
background: linear-gradient(180deg, #F4FFFC 0%, #ffffff 100%);
background: linear-gradient(180deg, #f4fffc 0%, #ffffff 100%);
overflow: hidden;
&-cancel {
width: 60upx;
......
......@@ -272,7 +272,7 @@ export default {
this.$store
.dispatch('Get_UserInfo')
.then(() => {
showToast('登录成功');
this.showToast('登录成功',true);
setTimeout(() => {
if (this.returnUrl) { // 需要跳转到特定页面
var isSwitchTab = this.returnUrl.indexOf('pages/index/') != -1
......
......@@ -88,7 +88,7 @@
</view>
</view>
<view v-if="!hidePay" class="bottom-view"><button class="buy-button" @tap="$u.throttle(handleClickBuy, 500)">立即购买</button></view>
<!-- <BottomPay :visible.sync="showPayBottom" @click="$u.throttle(getPaymentInfo, 500)" /> -->
<BottomPay :visible.sync="showPayBottom" @click="$u.throttle(getPaymentInfo, 500)" />
</view>
</template>
......@@ -197,12 +197,10 @@ export default {
item.text = parseInt((Number(item.price) / moths[index]) * 10) / 10 + '元/月';
item.price = parseInt(Number(item.price) * 10) / 10;
});
for (var i = 0; i < data.length; i++) {
if (i > 0) {
}
}
this.priceList = data;
} catch (e) {
console.log(e)
//TODO handle the exception
}
},
......@@ -243,6 +241,7 @@ export default {
uni.showLoading({
title: '支付中'
});
console.log("charge==========",charge)
uni.requestPayment({
// #ifdef MP-WEIXIN
timeStamp: '' + charge.timeStamp,
......@@ -256,12 +255,12 @@ export default {
// #ifdef MP-TOUTIAO
service: 5,
// _debug: 1,
orderInfo: charge,
orderInfo: charge.orderInfo,
// #endif
// #ifdef APP-PLUS
provider: this.isIOS ? 'appleiap' : 'wxpay',
manualFinishTransaction: this.isIOS ? true : false,
orderInfo: charge,
orderInfo: charge.orderInfo,
// #endif
success: res => {
......@@ -453,6 +452,7 @@ export default {
try {
//拉取新用户信息,更新到storage
let res = await this.$store.dispatch('Get_UserInfo');
this.showToast("支付成功",true)
setTimeout(() => {
uni.navigateBack({
delta: 1
......
......@@ -19,6 +19,7 @@ import {
} from "@/utils/config.js"
import {
userAuthLogin,
mobileLogin
} from "@/api/login/index.js";
import {
getUserInfo,
......@@ -111,15 +112,12 @@ const actions = {
}, data) {
commit("SET_AUTO_LOGIN", data)
},
App_WX_login({
App_get_provider({
state,
commit,
dispatch
}) {
return new Promise((resolve, reject) => {
uni.showLoading({
title: '授权中'
});
uni.getProvider({
service: 'oauth',
success: res => {
......@@ -166,7 +164,10 @@ const actions = {
break;
}
try {
let code = await wxLogin()
let code=""
if(!params.account){
code = await wxLogin()
}
let info = {
...loginInfo,
authType: authType,
......@@ -180,6 +181,7 @@ const actions = {
...params,
}
}
console.log("info",info)
let res = await userAuthLogin(info)
commit("SET_CHANNEL", {
loginChannel: info.loginChannel,
......
......@@ -10,6 +10,7 @@ export const temperature = 'TEMPERATURE';
export const appid = "wx55e75ad85611191f"
// export const API_HOST = ''; // 正式服
export const API_HOST = ''; // 测试服
export const baseUrl = process.uniEnv.qn_base_url; // 七牛云对象存储图片地址
export const indexBaseUrl = process.uniEnv.qn_base_url + 'index/'; // 七牛云对象存储图片地址-首页
export const mineBaseUrl = process.uniEnv.qn_base_url + 'mine/'; // 七牛云对象存储图片地址-我的
......@@ -17,6 +18,7 @@ export const billBaseUrl = process.uniEnv.qn_base_url + 'bill/'; // 七牛云对
export const planBaseUrl = process.uniEnv.qn_base_url + 'plan/'; // 七牛云对象存储图片地址-行程
export const UPLOAD_FILE_HOST = process.uniEnv.qn_asset_url; // 服务器用户上传文件地址
export const billStaticBaseUrl = '/static/image/bill/'; // 七牛云对象存储图片地址-账单
export const maintain_share_url = 'https://system.banshouhui.com/maintainqrcode' // pages/maintain-bill/show二维码地址
......
......@@ -4,19 +4,19 @@ import {
export const minPopupOptions = [{
label: '记行程',
path: '/pages/schedule/create-schedule/create-schedule',
icon: indexBaseUrl + 'jixingcheng@3x.png',
icon: 'jixingcheng@3x.png',
type: '1',
},
{
label: '维修帐',
path: '/pages/maintain-bill/create',
icon: indexBaseUrl + 'weixiuzhangfapiao@3x.png',
icon: 'weixiuzhangfapiao@3x.png',
type: '2',
},
{
label: '日常帐',
path: '',
icon: indexBaseUrl + 'richangzhang@3x.png',
icon: 'richangzhang@3x.png',
type: '3',
}
]
......
......@@ -37,6 +37,7 @@ platform = 'h5'
// #ifdef MP-WEIXIN
platform = '1'
channel = 'WX'
// channel = isIOS ? 'IOS' : 'ANDROID'
// #endif
// #ifdef MP-ALIPAY
......
......@@ -127,8 +127,8 @@ function request({
requestUrl = apiUrl + url
// #endif
console.log("requestUrl=" + requestUrl)
// console.log("请求参数===")
// console.log(data)
console.log("请求参数===")
console.log(data)
// header["Authorization"] ='Basic '+ token
header["token"] = 'Bearer ' + token
if (!noLoading) {
......@@ -158,6 +158,7 @@ function request({
header,
responseType,
success: res => {
console.log(res)
if (res.data.code === 0) {
if (!noLoading) {
uni.hideLoading()
......
......@@ -14,4 +14,4 @@ module.exports = {
})
]
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment