Commit 01a87f75 authored by Morson's avatar Morson

登录功能及入驻页面开发

parent 4a2dc545
...@@ -11,13 +11,18 @@ ...@@ -11,13 +11,18 @@
authUserInfo: '', authUserInfo: '',
}, },
onLaunch: function() { onLaunch: function() {
// console.log('App Launch') // 应用初始化(全局只触发一次)
let that = this
that.globalData.token = util.getToken()
}, },
onShow: function() { onShow: function() {
// console.log('App Show--') // 应用启动,或从后台进入前台显示
if (!this.globalData.token) {
this.autoLogin()
}
}, },
onHide: function() { onHide: function() {
// console.log('App Hide') // 应用从前台进入后台
}, },
methods: { methods: {
async getBaseInfo(vm, callBack) { async getBaseInfo(vm, callBack) {
...@@ -33,15 +38,7 @@ ...@@ -33,15 +38,7 @@
}); });
return false; return false;
} }
// if (!res || !res.code) {
// if (res && res.message) {
// uni.showToast({
// title: res && res.message || '获取基本信息错误',
// icon: 'none'
// });
// }
// return false;
// }
this.globalData.settledInfo = res.data this.globalData.settledInfo = res.data
if (!res.data) { if (!res.data) {
return return
...@@ -60,7 +57,11 @@ ...@@ -60,7 +57,11 @@
uni.login({ uni.login({
async success(res) { async success(res) {
if (res.code) { if (res.code) {
let result = await that.$u.api.loginWechatAuth({code: res.code}) let params = {
code: res.code,
wxAppNo: 1, // 自营平台小程序
}
let result = await that.$u.api.loginWechatAuth(params)
if (result) { if (result) {
if (result.code == 200 && result.data) { if (result.code == 200 && result.data) {
that.setUserData(result.data) that.setUserData(result.data)
......
<template>
<view class="process-wrap">
<view class="process-title">
<text>{{ title }}</text>
</view>
<view class="process-steps">
<u-steps :list="numList" :current="process" mode="number"></u-steps>
</view>
</view>
</template>
<script>
export default {
// import {u-steps} from ''
name: 'process',
props:{
process: {
type: Number,
default: 0
},
title: {
type: String,
default: '业务流程'
},
type: {
type: Number,
default: 0
}
},
data() {
return {
stepsNums: [],
numList: [
{
name: '业务介绍'
},
{
name: '申请入驻'
},
{
name: '在线考试'
},
{
name: '在线签约'
},
{
name: '开始接单'
}
]
};
},
onLoad() {
let that = this
// 兼容后期配置,有需要可以加载数据显示
that.stepsNums = that.numList
},
computed: {},
methods: {},
};
</script>
<style lang="scss" scoped>
.process-wrap {
border: 4rpx solid #2272ff;
border-radius: 10rpx;
background-color: #ebebeb;
margin: 20rpx;
padding: 10rpx;
}
.process-title {
font-size: 40rpx;
font-weight: bold;
text-align: center;
}
.process-steps {
margin-top: 40rpx;
}
</style>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
/* 快应用特有相关 */ /* 快应用特有相关 */
"mp-weixin" : { "mp-weixin" : {
/* 微信小程序特有相关 */ /* 微信小程序特有相关 */
"appid" : "wxd1d6eede324b0465", "appid" : "wx402a711597dddbaf",
"setting" : { "setting" : {
"urlCheck" : false, "urlCheck" : false,
"es6" : true, "es6" : true,
......
...@@ -36,13 +36,13 @@ ...@@ -36,13 +36,13 @@
{ {
"path": "pages/settle/index", "path": "pages/settle/index",
"style": { "style": {
"navigationBarTitleText": "uni-app" "navigationBarTitleText": "入驻"
} }
}, },
{ {
"path": "pages/settle/base", "path": "pages/settle/base",
"style": { "style": {
"navigationBarTitleText": "uni-app" "navigationBarTitleText": "入驻"
} }
}, },
{ {
...@@ -139,6 +139,15 @@ ...@@ -139,6 +139,15 @@
"navigationBarTitleText": "入驻考试" "navigationBarTitleText": "入驻考试"
} }
}
,{
"path" : "components/business-card/business-card",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
} }
], ],
"globalStyle": { "globalStyle": {
......
<template> <template>
<view class="backView"> <view class="backView">
<process :process="2" :type="0" title="业务流程"></process>
<template v-if="isStart==false"> <template v-if="isStart==false">
<view class="noticeView"> <view class="noticeView">
<text class="noticeText">规则:系统随机出现20道考试题目,每道题5分,每题答题时间100秒,在规定时间内答对题目的记分。 <text class="noticeText">规则:系统随机出现20道考试题目,每道题5分,每题答题时间100秒,在规定时间内答对题目的记分。
......
...@@ -10,12 +10,14 @@ ...@@ -10,12 +10,14 @@
<view> <view>
<text class="title">最新消息</text> <text class="title">最新消息</text>
<view v-for="(item, index) in messageList" :key="index"> <view v-for="(item, index) in messageList" :key="index">
<text class="title">{{item.body}}</text> <text class="title">{{ item.body }}</text>
</view> </view>
<view class="order-view"> <view class="order-view">
<!-- 订单推荐吸顶 --> <!-- 订单推荐吸顶 -->
<u-sticky> <u-sticky>
<view class="sticky"><text>订单推荐</text></view> <view class="sticky">
<text>订单推荐</text>
</view>
</u-sticky> </u-sticky>
<!-- 入驻成功之后显示订单列表 --> <!-- 入驻成功之后显示订单列表 -->
<view v-if="status > 0 && orderList.length > 0"> <view v-if="status > 0 && orderList.length > 0">
...@@ -30,10 +32,11 @@ ...@@ -30,10 +32,11 @@
</view> </view>
<!-- 入驻前--> <!-- 入驻前-->
<view v-else> <view v-else>
<text class="title">当前订单{{count}}笔\n入驻通过后,平台将向您推荐订单</text> <text class="title">当前订单{{ count }}笔\n入驻通过后,平台将向您推荐订单</text>
<u-button class="settle-button" type="primary" shape="circle" @click="immediatelyIn" <u-button class="settle-button" type="primary" shape="circle" @click="immediatelyIn"
:custom-style="buttonStyle"> :custom-style="buttonStyle">
立即入驻</u-button> 立即入驻
</u-button>
</view> </view>
</view> </view>
</view> </view>
...@@ -42,13 +45,18 @@ ...@@ -42,13 +45,18 @@
</template> </template>
<script> <script>
import OrderCell from '@/components/order/index.vue' import util from '@/utils/util.js';
export default {
const app = getApp();
import OrderCell from '@/components/order/index.vue'
export default {
components: { components: {
OrderCell OrderCell
}, },
data() { data() {
return { return {
settled: false,
triggered: false, triggered: false,
list: [{ list: [{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg', image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
...@@ -105,7 +113,24 @@ ...@@ -105,7 +113,24 @@
this._freshing = false; this._freshing = false;
this.triggered = true; this.triggered = true;
}, },
onShow() {
// 每次进入页面都刷新入驻状态
if (app.globalData.token) {
this.initSettleInfo()
}
},
methods: { methods: {
async initSettleInfo() {
const callBack = (vm, result) => {
// 后台自动判断入驻流程是否完成,前台通过settled确定状态
if (result && result.settled) {
vm.settled = result.settled
} else {
vm.settled = false
}
}
await app.getBaseInfo(this, callBack)
},
onRefresh() { onRefresh() {
if (this._freshing) return; if (this._freshing) return;
this._freshing = true; this._freshing = true;
...@@ -137,7 +162,7 @@ ...@@ -137,7 +162,7 @@
// 加载完成 // 加载完成
this.currentLoadStatus = this.loadStatus[2] this.currentLoadStatus = this.loadStatus[2]
this.$nextTick(function() { this.$nextTick(function () {
this.bottomLoading = false this.bottomLoading = false
}) })
}, 1000); }, 1000);
...@@ -149,50 +174,51 @@ ...@@ -149,50 +174,51 @@
console.log('-----scroll-------') console.log('-----scroll-------')
}, },
immediatelyIn() { immediatelyIn() {
if (getApp().globalData.token) { if (util.getToken()) {
uni.navigateTo({ uni.navigateTo({
url: "pages/settle/index" url: 'pages/settle/index'
}) });
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: "pages/login/index" url: 'pages/login/index'
}) });
}
} }
} }
} }
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
height: 100vh; height: 100vh;
} }
.logo { .logo {
height: 200rpx; height: 200 rpx;
width: 100%; width: 100%;
margin: 0rpx auto 50rpx auto; margin: 0 rpx auto 50 rpx auto;
} }
.text-area { .text-area {
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.title { .title {
font-size: 36rpx; font-size: 36 rpx;
color: #8f8f94; color: #8f8f94;
} }
.sticky { .sticky {
height: 120rpx; height: 120 rpx;
background-color: #2979ff; background-color: #2979ff;
color: #fff; color: #fff;
padding: 24rpx; padding: 24 rpx;
text-align: left; text-align: left;
} }
.order-view { .order-view {
text-align: center; text-align: center;
} }
</style> </style>
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
let params = { let params = {
nickname: app.globalData.authUserInfo.nickName, nickname: app.globalData.authUserInfo.nickName,
avatar: app.globalData.authUserInfo.avatarUrl, avatar: app.globalData.authUserInfo.avatarUrl,
// wxAppNo: 1, wxAppNo: 1,
} }
login.appLogin().then(res => { login.appLogin().then(res => {
params.code = res.code params.code = res.code
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
avatar: app.globalData.authUserInfo.avatarUrl, avatar: app.globalData.authUserInfo.avatarUrl,
encryptedData: e.detail.encryptedData, encryptedData: e.detail.encryptedData,
iv: e.detail.iv, iv: e.detail.iv,
// wxAppNo: 1, wxAppNo: 1,
} }
login.appLogin().then(res => { login.appLogin().then(res => {
params.code = res.code params.code = res.code
......
<template> <template>
<view class="content"> <view class="content">
<view class="title">入驻基本信息</view> <process :process="1" :type="0" title="业务流程"></process>
<view class="base-list"> <view class="base-list">
<!--view class="item item-input flex-yc"> <view class="item item-select u-row-between">
<label class="label">姓名</label> <view class="label">实名认证</view>
<span class="required">*</span> <p class="u-flex-1 u-text-right txt">{{ areaTxts.slice(0,2).join(',') || "" }}</p>
<input placeholder="请输入您的姓名" v-model.trim="baseInfo.name" class="input flex1" /> <u-icon name="arrow-right" color="#999" size="28"></u-icon>
</view--> </view>
<!--view class="item item-input flex u-row-between"> <view class="newAddressView">
<label class="label">电话</label> <view class="newAddressTitleView" @click="locationClick()">
<span class="required">*</span> <view class="address">
<input placeholder="请输入您的电话" v-model="baseInfo.mobile" class="input flex1" /> <text class="itemTitle">收货地址</text>
</view--> </view>
<view class="right-margin-40">
<u-icon name="map" color="#999" size="34"></u-icon>
<text class="blueColor">定位</text>
</view>
</view>
<view class="addressBackView">
<textarea
class="addressTextAreaView"
maxlength="100"
v-model="baseInfo.address"
auto-height="true"
value=""
placeholder="请输入详细服务地址"
placeholder-style='color:#CCCCCC;font-size:28rpx;'/>
</view>
<view class="tips">(必填项)填写可接收物料的地址</view>
</view>
<view class="item item-select u-row-between" @click="gopage('/pages/settle/select?selectType=area')"> <view class="item item-select u-row-between" @click="gopage('/pages/settle/select?selectType=area')">
<view class="label">接单城市:</view> <view class="label">接单城市:</view>
<p class="u-flex-1 u-text-right txt">{{ areaTxts.slice(0,2).join(',') || "" }}</p> <p class="u-flex-1 u-text-right txt">{{ areaTxts.slice(0,2).join(',') || "" }}</p>
<u-icon name="arrow-right" color="#999" size="28"></u-icon> <u-icon name="arrow-right" color="#999" size="28"></u-icon>
</view> </view>
<view class="tips">(必选项)选择你可以服务的城市,可选多个</view> <view class="tips">(必选项)选择你可以服务的城市,可选多个</view>
<view class="item item-select u-row-between">
<view class="label">电工证</view>
<p class="u-flex-1 u-text-right txt">{{ areaTxts.slice(0,2).join(',') || "" }}</p>
<u-icon name="arrow-right" color="#999" size="28"></u-icon>
</view>
<view class="item item-select flex-yc" @click="gopage('/pages/settle/select?selectType=working_age')"> <view class="item item-select flex-yc" @click="gopage('/pages/settle/select?selectType=working_age')">
<view class="label">电工工龄(年):</view> <view class="label">电工工龄(年):</view>
<p class="u-flex-1 u-text-right area" v-show="baseInfo.working_age !== ''"> <p class="u-flex-1 u-text-right area" v-show="baseInfo.working_age !== ''">
...@@ -27,11 +49,12 @@ ...@@ -27,11 +49,12 @@
<!-- <i class="iconfont icon-xiangyou"></i> --> <!-- <i class="iconfont icon-xiangyou"></i> -->
</view> </view>
<view class="tips">(必选项)选择你从事电工工作的工龄</view> <view class="tips">(必选项)选择你从事电工工作的工龄</view>
<!--view class="item item-input flex u-row-between"> <view class="item item-select u-row-between">
<label class="label">详细地址:</label> <view class="label">个人车辆信息</view>
<u-icon name="map" color="#999" size="34"></u-icon> <p class="u-flex-1 u-text-right txt">{{ areaTxts.slice(0,2).join(',') || "" }}</p>
</view--> <u-icon name="arrow-right" color="#999" size="28"></u-icon>
<!--view class="tips">{{baseInfo.address}}</view--> </view>
<view class="tips">(选填项)填写你的车辆信息</view>
<view class="itemView"> <view class="itemView">
<view class="itemTitleView"> <view class="itemTitleView">
...@@ -49,43 +72,11 @@ ...@@ -49,43 +72,11 @@
</view> </view>
<view class="tips bottom_padding_80">(选填项)输入可投入交付服务的人员数量</view> <view class="tips bottom_padding_80">(选填项)输入可投入交付服务的人员数量</view>
<view class="newAddressView">
<view class="newAddressTitleView" @click="locationClick()">
<view class="address">
<text class="itemTitle">详细地址</text>
<!--text class="itemRedStar">*</text-->
</view>
<view class="right-margin-40">
<u-icon name="map" color="#999" size="34"></u-icon>
<text class="blueColor">定位</text>
</view>
</view>
<view class="addressBackView">
<textarea
class="addressTextAreaView"
maxlength="100"
v-model="baseInfo.address"
auto-height="true"
value=""
placeholder="请输入详细服务地址"
placeholder-style='color:#CCCCCC;font-size:28rpx;'/>
</view>
<view class="tips">(必填项)填写可接收物料的地址</view>
</view>
</view> </view>
<view class="seat"></view> <view class="seat"></view>
<view class="btn-wrap flex-xc"> <view class="btn-wrap flex-xc">
<button class="btn-submit" :disabled="!submitStatus" @click="$u.debounce(submitBaseInfo, 500)"> <button class="btn-submit" :disabled="!submitStatus" @click="$u.debounce(submitBaseInfo, 500)">
<!--view class="">submitBaseInfo</view-->
<!--button class="btn-submit" :disabled="!submitStatus" @click="submitBaseInfo()"-->
确定 确定
</button> </button>
</view> </view>
...@@ -368,6 +359,7 @@ ...@@ -368,6 +359,7 @@
.label { .label {
color: #333; color: #333;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold;
} }
.txt { .txt {
......
<template> <template>
<view class="back_view"> <view class="wrap">
<image class="theme_image" :src="theme_url" mode="widthFix"></image> <process :process="0" :type="0" title="业务流程"></process>
<view class="introduction">
<view class="item">
<view class="label">
<text>招募要求</text>
</view>
<view class="content">
<text>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Aenean euismod bibendum laoreet. Proin gravida dolor sit
amet lacus accumsan et viverra justo commodo. Proin sodales
pulvinar sic tempor. Sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus. Nam fermentum,
nulla luctus pharetra vulputate, felis tellus 。
</text>
</view>
</view>
<view class="item">
<view class="label">
<text>结算价格</text>
</view>
<view class="content">
<text>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Aenean euismod bibendum laoreet. Proin gravida dolor sit
amet lacus accumsan et viverra justo commodo. Proin sodales
pulvinar sic tempor. Sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus. Nam fermentum,
nulla luctus pharetra vulputate, felis tellus 。
</text>
</view>
</view>
<view class="item">
<view class="label">
<text>入驻资料</text>
</view>
<view class="content">
<text>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Aenean euismod bibendum laoreet. Proin gravida dolor sit
amet lacus accumsan et viverra justo commodo. Proin sodales
pulvinar sic tempor. Sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus. Nam fermentum,
nulla luctus pharetra vulputate, felis tellus 。
</text>
</view>
</view>
<view class="item careful-color">
<view class="careful-content">
<text>注意事项:</text>
<text>
身份证、银行卡、签约人均为同一人,否则无法入驻;
</text>
<text>
充电桩材料按要求自行准备
</text>
</view>
</view>
</view>
<view class="bottom_view"> <view class="bottom_view">
<button :class="isStop ? 'bottom_btn apply_color' : 'bottom_btn default_color' " @click="$u.debounce(applyClick, 500)"> <button :class="isStop ? 'bottom_btn apply_color' : 'bottom_btn default_color' " @click="$u.debounce(applyClick, 500)">
<text class="bottom_title" v-if="!isStop">浏览 {{count}} 秒后可申请入驻</text> <text class="bottom_title" v-if="!isStop">浏览 {{count}} 秒后可申请入驻</text>
<text class="bottom_title" v-if="isStop">申请入驻</text> <text class="bottom_title" v-if="isStop">申请入驻</text>
</button> </button>
<!-- <view :class="isStop ? 'bottom_btn apply_color' : 'bottom_btn default_color' "
@click="$u.deapplyClick">
<text class="bottom_title" v-if="!isStop">浏览 {{count}} 秒后可申请入驻</text>
<text class="bottom_title" v-if="isStop">申请入驻</text>
</view> -->
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { process } from '@/components/process/process'
export default { export default {
components: {
process
},
data() { data() {
return { return {
theme_url:'https://qn-static.banshouhui.com/settle_theme.png?v=' + new Date().getTime(), theme_url:'https://qn-static.banshouhui.com/settle_theme.png?v=' + new Date().getTime(),
count:9, count:9,
...@@ -128,7 +184,18 @@ ...@@ -128,7 +184,18 @@
} }
</script> </script>
<style lang="scss"> <style>
/* page {
background-color: rgb(240, 242, 244);
} */
</style>
<style lang="scss" scoped>
.u-cell-icon {
width: 36rpx;
height: 36rpx;
margin-right: 8rpx;
}
.back_view{ .back_view{
background-color: #FFFFFF; background-color: #FFFFFF;
...@@ -190,4 +257,30 @@ ...@@ -190,4 +257,30 @@
background-color: #2272FF; background-color: #2272FF;
} }
.introduction {
border: 4rpx solid #2272FF;
border-radius: 10rpx;
background-color: #FFFFFF;
margin: 20rpx;
margin-bottom: 200rpx;
}
.introduction .item {
padding: 20rpx;
}
.introduction .item .label {
font-size: 32rpx;
padding: 10rpx;
}
.introduction .item .content {
font-size: 28rpx;
padding: 20rpx 40rpx 20rpx 40rpx;
}
.careful-color{
color: red;
}
.careful-content {
padding: 10rpx;
font-size: 32rpx;
}
</style> </style>
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
promptList:[{ promptList:[{
status:1, status:1,
statusName:'待审核', statusName:'待审核',
txtArr:['您已成功提交资料','正在审核中'], txtArr:['已提交,等待审核','正在审核中'],
btnTxt:'去接单广场逛逛', btnTxt:'去接单广场逛逛',
url:'/pages/take/index' url:'/pages/take/index'
},{ },{
status:2, status:2,
statusName:'已通过', statusName:'已通过',
txtArr:['您已通过','“充电桩安装入驻审核”'], txtArr:['恭喜,审核通过','“充电桩安装入驻审核”'],
btnTxt:'去考试', btnTxt:'去考试',
url:'/pages/exam/start' url:'/pages/exam/start'
},{ },{
......
<template> <template>
<view class="content"> <view class="content">
<process :process="3" :type="0" title="业务流程"></process>
<view class="content-txt"> <view class="content-txt">
<view class="title">入驻协议内容</view> <view class="title">入驻协议内容</view>
......
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