已对接6个接口
准备回复订单详情页面
This commit is contained in:
140
common/temp.vue
140
common/temp.vue
@@ -1,51 +1,137 @@
|
||||
<template>
|
||||
<view class="content my-bg">
|
||||
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">油站信息</block>
|
||||
<view class="page-content my-bg">
|
||||
<cu-custom class="main-topbar bg-main-oil" bgColor="bg-white">
|
||||
<block slot="content">绑定星油云站</block>
|
||||
</cu-custom>
|
||||
<view class="main-money">
|
||||
<view class="padding-xs flex align-center">
|
||||
<view class="flex-sub text-center padding-top-lg">
|
||||
<view class="txet-xxs">
|
||||
<text class="text-white">今日收款(元)</text>
|
||||
</view>
|
||||
<view class=" text-sl padding padding-top-xs"><text class="text-white">8450.50</text></view>
|
||||
<view class="pannel">
|
||||
<view class="logo margin-top">
|
||||
<img :src="baseURL+'/static/img/order-xy.png'" mode="" />
|
||||
</view>
|
||||
<view class="bg-white margin padding radius shadow-warp">
|
||||
<view class="text-bold padding-bottom text-center">
|
||||
油站工作人员绑定油站
|
||||
</view>
|
||||
<view class="text-grey padding-bottom text-center">
|
||||
请确认您的手机号码已注册星油云站
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="title">云站号</view>
|
||||
<input placeholder="请输入云站编号" name="input"></input>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin">
|
||||
<button class="bg-main-oil" @tap="loginWeixin">
|
||||
登录
|
||||
</button>
|
||||
<button class="bg-main-oil" open-type="getUserInfo" @getuserinfo="getUserInfo">
|
||||
登录测试getuserinfo
|
||||
</button>
|
||||
<button class="bg-main-oil" @tap="getMsg">
|
||||
订阅消息
|
||||
</button>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import loginApi from '@/api/login.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
baseURL: this.global.baseURL,
|
||||
forcedLogin: true
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.loginWeixin()
|
||||
},
|
||||
methods: {
|
||||
|
||||
getMsg() {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: ['W5XD3NQVa6knC5jXHeWT8GS7q5CHrDUMY_sF79kLkKk'],
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserInfo({
|
||||
detail
|
||||
}) {
|
||||
console.log('三方登录只演示登录api能力,暂未关联云端数据');
|
||||
console.log('detail', detail)
|
||||
if (detail.userInfo) {
|
||||
this.loginLocal(detail.userInfo.nickName);
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '登陆失败'
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
loginLocal(nickName) {
|
||||
uni.setStorageSync('login_type', 'local')
|
||||
uni.setStorageSync('username', nickName)
|
||||
this.toMain(nickName);
|
||||
},
|
||||
toMain(userName) {
|
||||
// this.login(userName)
|
||||
console.log(userName)
|
||||
/**
|
||||
* 强制登录时使用reLaunch方式跳转过来
|
||||
* 返回首页也使用reLaunch方式
|
||||
*/
|
||||
if (this.forcedLogin) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
success: () => {
|
||||
console.log('success')
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
|
||||
},
|
||||
loginWeixin() {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: loginRes => {
|
||||
const code = loginRes.code
|
||||
console.log(code)
|
||||
loginApi.loginWeixin(code).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content{
|
||||
min-height: 100%;
|
||||
}
|
||||
.main-topbar>>>.cu-bar {
|
||||
height: 380rpx !important;
|
||||
z-index: 0 !important;
|
||||
.page-content {
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.main-topbar>>>.cu-bar .content {
|
||||
padding-bottom: 300rpx;
|
||||
.logo {
|
||||
min-width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.main-money {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
|
||||
.logo img {
|
||||
width: 200upx;
|
||||
height: 200rpx;
|
||||
background-size: contain;
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user