master
xy 1 year ago
parent 4c56f0b755
commit 680b9b7007

@ -2,10 +2,10 @@ const mode = 'devOnline'; //devLocal本地测试、devOnline线上测试
let ROOTPATH = ''; //域名
switch (mode) {
case 'devLocal':
ROOTPATH = "http://192.168.2.5:61111"
ROOTPATH = "http://yikangyang.ali251.langye.net"
break;
case 'devOnline':
ROOTPATH = "https://xxxxx.cn"
ROOTPATH = "http://yikangyang.ali251.langye.net"
break;
case 'production':
ROOTPATH = "https://xxxxx.cn"

@ -1,21 +1,18 @@
//api集合
let apiApp = {
login: '/api/login',
getInfo: '/777/777/index',
}
let apiHome = {
hotSearchUrl: '/777/77/hot_search'
login: '/api/mobile/user/applet-login',
}
// 此处第二个参数vm就是我们在页面使用的this你可以通过vm获取vuex等操作
const install = (Vue, vm) => {
//api方法
let getSearch = (params = {}) => vm.$u.get(apiHome.hotSearchUrl, params);
let getInfo = (params={}) => vm.$u.post(apiApp.getInfo, params);
const login = (params = {}) => vm.$u.get(apiApp.login, params)
// 将各个定义的接口名称统一放进对象挂载到vm.$u.api(因为vm就是this也即this.$u.api)下
vm.$u.api = {getSearch, getInfo};
vm.$u.api = {
login,
};
}
export default {

@ -1,6 +1,6 @@
{
"name" : "uni",
"appid" : "__UNI__3136F4B",
"appid" : "__UNI__94DEB94",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",

@ -18,8 +18,7 @@
{
"path": "pages/me/me",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true
"navigationBarTitleText": "个人中心"
}
},
{

@ -31,7 +31,7 @@
<image class="bottom" src="~@/static/login/bottom.png" mode="aspectFit"></image>
<u-top-tips :navbar-height="navbarHeight" ref="uTips"></u-top-tips>
<u-toast ref="uToast" />
</view>
</template>
@ -69,8 +69,8 @@ export default {
methods: {
authLogin() {
if (!this.isAuth) {
this.$refs.uTips.show({
title: '请阅读《用户协议》和《隐私协议》',
this.$refs.uToast.show({
title: '请阅读协议',
type: 'warning',
duration: '2000'
})
@ -80,17 +80,22 @@ export default {
provider: 'weixin', //使
success: (loginRes) => {
console.log(loginRes);
this.$u.route({
type: 'switchTab',
url: '/pages/index/index'
this.$u.api.login({
code: loginRes.code
}).then(res => {
console.log(res)
})
// this.$u.route({
// type: 'switchTab',
// url: '/pages/index/index'
// })
}
});
},
mobileLogin(e) {
if (!this.isAuth) {
this.$refs.uTips.show({
title: '请阅读《用户协议》和《隐私协议》',
this.$refs.uToast.show({
title: '请阅读协议',
type: 'warning',
duration: '2000'
})

@ -1,6 +1,15 @@
<template>
<view>
me
<view class="container">
<image class="bkg" mode="aspectFill" src="~@/static/me/bkg.png"></image>
<view class="top">
<image class="avatar" mode="aspectFit" src="http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg"></image>
<view class="info">
<view class="info-name">我的</view>
<view class="info-mobile">手机号18888888888</view>
</view>
</view>
<tabbar />
</view>
</template>
@ -19,5 +28,24 @@ export default {
</script>
<style lang="scss">
.container {
position: relative;
.bkg {
width: 100vw;
z-index: 0;
height: 550rpx;
position: absolute;
top: 0;
left: 0;
}
.top {
padding: 0 25rpx;
.avatar {
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Loading…
Cancel
Save