Commit f8e7d449 authored by Morson's avatar Morson

feat(login,order):登录和派单页面搭建

parent 50d411b4
......@@ -82,7 +82,7 @@ export default {
<style lang="scss">
.page-content {
padding: 30rpx;
padding: 40rpx 30rpx 68rpx 30rpx;
font-size: 32rpx;
height: 100vh;
overflow-y: auto;
......
<template>
<view class="wrap">
<u-navbar back-text="登录" :border-bottom="false"
:back-text-style = "{
'color': '#333333',
'font-size': '36rpx',
'margin-left': '20rpx',
}"></u-navbar>
<u-gap height="80"></u-gap>
<u-navbar :border-bottom="false" back-text="登录" :back-text-style="backText"/>
<view class="u-flex-col u-col-center top">
<u-image :src="qnFile('logo.png')" width="200" height="200">
<view class="u-font-24" slot="error">加载失败</view>
</u-image>
<u-image :src="qnFile('logo-2.png')" class="u-m-t-28" width="214" height="60">
<view class="u-font-24" slot="error">加载失败</view>
</u-image>
</view>
<view class="content">
<view class="u-flex-col u-col-center">
<u-image class="logo" :src="qnFile('logo.png')" width="200" height="200">
<view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image>
<u-image class="logo2" :src="qnFile('logo-2.png')" width="214" height="60">
<view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image>
</view>
<u-gap height="48"></u-gap>
<button class="login-btn" v-if="oauth" :open-type="canOauth"
@getphonenumber="signupLogin" @click="verifyCheck">
<text class="u-font-32 white">微信一键登录</text>
</button>
<u-form v-show="!oauth" :model="model" :rules="rules" ref="uForm" :errorType="errorType">
<u-form-item :label-position="labelPosition" label="账号"
prop="username" label-width="150" v-show="type==='account'">
<u-input :border="border" placeholder="请输入账号" v-model="model.username" type="text"></u-input>
<u-form-item label="账号" prop="username" label-width="150" v-show="type==='account'">
<u-input placeholder="请输入账号" v-model="model.username" type="text"></u-input>
</u-form-item>
<u-form-item :label-position="labelPosition" label="密码"
prop="password" label-width="150" v-if="type==='account'">
<u-input :password-icon="true" :border="border" type="password" v-model="model.password" placeholder="请输入密码"></u-input>
<u-form-item label="密码" prop="password" label-width="150" v-if="type==='account'">
<u-input type="password" v-model="model.password" placeholder="请输入密码"></u-input>
</u-form-item>
<u-form-item :label-position="labelPosition" label="手机号"
prop="phone" label-width="150" v-if="type==='code'">
<u-form-item label="手机号" prop="phone" label-width="150" v-if="type==='code'">
<u-input :border="border" placeholder="请输入手机号" v-model="model.phone" type="number"></u-input>
</u-form-item>
<u-form-item :label-position="labelPosition" label="验证码"
prop="code" label-width="150" v-if="type==='code'">
<u-form-item label="验证码" prop="code" label-width="150" v-if="type==='code'">
<u-input :border="border" placeholder="请输入验证码" v-model="model.code" type="text"></u-input>
<u-button slot="right" type="success" size="mini" @tap="getCode">{{codeTips}}</u-button>
</u-form-item>
<u-gap height="40"></u-gap>
</u-form>
<button class="login-btn" v-if="!oauth" @click="submitForm">
<text class="u-font-32 white">登录</text>
</button>
<u-toast ref="uToast"></u-toast>
<u-verification-code ref="uCode" @change="codeChange"/>
<button class="u-reset-button submit" :open-type="openType"
@getphonenumber="signupLogin" @click="submitForm">{{buttonText}}</button>
<view class="agreement">
<u-checkbox v-model="check" @change="checkboxChange"
:label-disabled="true" shape="circle">
......@@ -55,9 +36,7 @@
<text class="agree-text" @click="seePolicy">《隐私政策》</text>
</view>
</u-checkbox>
</view>
</view>
<view class="bottom u-flex-col u-col-center">
<view style="width: 690rpx;">
......@@ -65,8 +44,8 @@
half-width="100%" margin-bottom="50">其他登录方式</u-divider>
</view>
<view class="other-content u-flex u-row-between">
<button class="item-btn" :open-type="canOauth" hover-class="none"
@getphonenumber="signupLogin" @click="verifyCheck" v-show="!oauth">
<button class="u-reset-button item-btn" :open-type="openType"
@getphonenumber="signupLogin" @click="submitForm" v-show="!oauth">
<u-icon size="60" color="#2272FF" name="weixin-circle-fill"
label="微信登录" label-pos="bottom" label-color="#999999"
label-size="24" margin-top="30"></u-icon>
......@@ -79,6 +58,8 @@
</view>
<u-gap height="68"></u-gap>
</view>
<u-toast ref="uToast"></u-toast>
<u-verification-code ref="uCode" @change="codeChange"/>
</view>
</template>
......@@ -93,11 +74,13 @@ export default {
oauth: true,
type: 'wechat',
codeTips: '',
showModal: false,
model: {
username: '',
password: '',
phone: '',
code: '',
agreement: false
},
rules: {
username: [
......@@ -170,6 +153,11 @@ export default {
label: '密码登录',
show: true,
}],
backText: {
'color': '#333333',
'font-size': '36rpx',
'margin-left': '20rpx',
}
}
},
computed: {
......@@ -187,8 +175,12 @@ export default {
return '#999999'
}
},
canOauth() {
return this.check && 'getPhoneNumber'
openType() {
return this.oauth && this.check && 'getPhoneNumber'
},
buttonText() {
if(this.oauth) return '微信一键登录'
else return '登录'
}
},
onLoad(e) {
......@@ -209,12 +201,6 @@ export default {
qnFile(src) {
return process.uniEnv.qn_base_url + src
},
verifyCheck() {
if(this.check) {
return true
}
this.$u.toast('请先阅读并勾选协议');
},
codeChange(text) {
this.codeTips = text;
},
......@@ -236,13 +222,20 @@ export default {
checkboxChange(check) {
this.check = check
},
checkboxChange(e) {
this.model.agreement = e.value;
},
// async getCode() {
// login.appLogin().then(res => {
// this.code = res.code
// })
// },
submitForm() {
if(this.check) {
return true
} else {
this.$u.toast('请先阅读并勾选协议');
}
},
agreeProtocol() {
if(this.agree) {
......@@ -469,31 +462,21 @@ export default {
width: 750rpx;
height: 100vh;
background-color: #FFFFFF;
.top {
margin-top: 80rpx;
}
.content {
margin-top: 48rpx;
padding: 0 30rpx;
.code-input {
display: flex;
align-items: center;
justify-content: space-between;
.line {
margin: 8rpx 30rpx;
width: 2rpx;
height: 80rpx;
background-color: #F4F5F7;
}
}
.login-btn {
background-color: #2272FF;
font-size: 32rpx;
font-weight: 600;
color: #FFFFFF;
line-height: 104px;
height: 104rpx;
border-radius: 52rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
.submit {
background-color: #2272FF;
color: #FFFFFF;
font-size: 32rpx;
font-weight: 600;
line-height: 104rpx;
border-radius: 52rpx;
text-align: center;
}
.bottom {
position: absolute;
......@@ -545,9 +528,6 @@ export default {
}
}
}
.logo2 {
margin-top: 28rpx;
}
.noticeView {
background-color: #FFFFFF;
......
......@@ -58,7 +58,7 @@
<style lang="scss">
.page-content {
padding: 30rpx;
padding: 40rpx 30rpx 68rpx 30rpx;
font-size: 32rpx;
height: 100vh;
overflow-y: auto;
......
<template>
<view>
<view class="wrap">
<w-navbar title="派单"></w-navbar>
<view class="toolbar">
<u-row>
<u-col span="3">
<u-icon class="w-select" name="tags-fill" label-size="24"
size="32" :label="typeLabel" @click="showType=true"/>
</u-col>
<u-col span="6">
<u-icon class="w-select" name="map-fill" :color="areaColor"
size="32" :label="areaLabel" :label-color="areaColor"
label-size="24" @click="showArea=true"/>
</u-col>
<u-col span="3" text-align="right">
<u-tag text="清空" shape="circle" @click="clearSearch" />
</u-col>
</u-row>
</view>
<scroll-view :style="{ height: contentHeight }" class="content" scroll-y="true">
<u-radio-group :wrap="true" v-model="allocateId" @change="radioGroupChange">
<u-radio @change="radioChange" v-for="(item, index) in list" :key="index" :name="radioName(item)">
<view class="item">{{ item.workerName }} {{ item.mobile }}</view>
</u-radio>
</u-radio-group>
</scroll-view>
<view class="bottom"><button class="allcation-btn">派单</button></view>
<u-select v-model="showType" mode="single-column" :list="typeList"
@confirm="confirmType"></u-select>
<u-picker mode="region" v-model="showArea" @confirm="confirmArea"
:area-code="areaCode"></u-picker>
</view>
</template>
<script>
export default {
data() {
return {
const app = getApp();
const global = app.globalData;
export default {
data() {
return {
// 派单类型: 0--网点,1--师傅
type: 0,
list: [],
orderId: 6099132,
remark: '',
allocateId: '',
search: {
keyword: '',
province: '',
city: '',
community: ''
},
typeList: [
{value: '', label: '全部类型'},
{ value: '1', label: '企业网点'},
{value: '2', label: '个人网点'}
],
showType: false,
showArea: false,
typeName: '',
areaName: '',
areaCode: ['44','4403','440306'],
};
},
onLoad() {
getApp().trackPage('师傅/网点派单页');
this.loadWorkerList();
},
computed: {
contentHeight() {
let height = global.rpxScreenHeight - global.navHeight;
return height - 80 - 200 + 'rpx';
},
typeLabel() {
return this.typeName ? this.typeName : '类型'
},
areaLabel() {
return this.areaName ? this.areaName : '网点地址'
},
typeColor() {
return this.typeName && '#2272FF' || '#333333'
},
areaColor() {
return this.areaName && '#2272FF' || '#333333'
},
},
methods: {
loadWorkerList() {
this.list = [
{ workerId: 1, workerName: '张三', mobile: '18888888881' },
{ workerId: 2, workerName: '李四', mobile: '18888888882' },
{ workerId: 3, workerName: '王五', mobile: '18888888883' },
{ workerId: 4, workerName: '赵六', mobile: '18888888884' },
{ workerId: 5, workerName: '孙七', mobile: '18888888885' },
{ workerId: 6, workerName: '钱八', mobile: '18888888886' },
{ workerId: 7, workerName: '钱九', mobile: '18888888887' },
{ workerId: 8, workerName: '钱十', mobile: '18888888888' },
{ workerId: 9, workerName: '钱十一', mobile: '18888888889' },
{ workerId: 10, workerName: '钱十二', mobile: '18888888810' },
{ workerId: 11, workerName: '钱十三', mobile: '18888888811' },
{ workerId: 12, workerName: '钱十四', mobile: '18888888812' },
{ workerId: 13, workerName: '红红火火恍恍惚惚', mobile: '18888888813' },
{ workerId: 14, workerName: '反福福福福福福福福福发发发发发发发发发发', mobile: '18888888814' },
{ workerId: 15, workerName: '钱十五', mobile: '18888888815' }
];
},
radioName(item) {
if (this.$u.test.isEmpty(item)) {
return null;
}
return this.type ? item.maintainWorkerId : item.maintainSiteId;
},
maintainName(item) {
if (this.$u.test.isEmpty(item)) {
return null;
}
return item.maintainWorkerName || item.maintainSiteName;
},
maintainPhone(item) {
if (this.$u.test.isEmpty(item)) {
return null;
}
return item.maintainWorkerPhone || item.maintainSiteMobile;
},
radioChange(e) {
console.log('radioChange', e);
},
methods: {
radioGroupChange(e) {
console.log('radioGroupChange', e);
},
confirmType(e) {
console.log('confirmType', e);
if(this.$u.test.isEmpty(e)) return
let type = Object.values(e)[0]
if (type.value) this.typeName = type.label
else this.typeName = '类型'
},
confirmArea(e) {
console.log('confirmArea', e);
if(this.$u.test.isEmpty(e)) return
let codes = [], names = []
Object.values(e).map(item => {
names.push(item.label.toString())
codes.push(item.value.toString())
})
this.areaName = names.join('-')
this.areaCode = codes
},
clearSearch() {
this.areaName = ''
this.typeName = '类型'
this.search.keyword = ''
this.search.city = ''
this.search.community = ''
}
}
};
</script>
<style lang="scss">
.u-radio-group {
border-top: 2rpx solid #f4f5f7;
.u-radio {
border-bottom: 2rpx solid #f4f5f7;
padding: 0 30rpx;
line-height: normal;
display: flex;
align-items: center;
min-height: 80rpx;
}
}
</style>
<style scoped lang="scss">
.wrap {
height: 100vh;
background-color: #ffffff;
.toolbar {
height: 80rpx;
padding:12rpx 30rpx;
.w-select {
line-height: 56rpx;
height: 56rpx;
}
.active {
background-color: #2272FF;
}
}
.content {
// height: 100%;
}
.bottom {
background-color: #ffffff;
position: absolute;
bottom: 0;
width: 750rpx;
padding-bottom: 68rpx;
display: flex;
justify-content: center;
}
}
<style>
.allcation-btn {
margin-top: 40rpx;
background-color: #2272ff;
color: #ffffff;
border-radius: 52rpx;
width: 690rpx;
}
</style>
<template>
<view class="wrap">
<u-navbar back-icon-name="" back-text="退出" title="工单池" :title-bold="true" @custom-back="logout" :border-bottom="false"></u-navbar>
<view class="tabs-box">
<u-navbar :is-back="false" title="工单池" :titleBold="true" :border-bottom="false">
<view class="slot-wrap u-flex u-col-center">
<u-icon name="" label="退出" @click="logout"></u-icon>
</view>
</u-navbar>
<view class="tabs-box" :style="{height: tabsHeight+'rpx' }">
<u-tabs ref="tabs" :list="list" active-color="#2979ff" inactive-color="#606266" font-size="30" :current="current" @change="tabsChange"></u-tabs>
</view>
<view class="content">
<view class="content" :style="{height: contentHeight }">
<NoOrder v-if="noMore" type="black" :customStyle="noOrderCustomStyle" />
<template v-else>
<view v-for="(item, index) in orderList" :key="item.orderId">
<OrderCell :orderData="item" :type="orderType" :location="dataValue" @click="handleClick" @action="handleClick"></OrderCell>
<scroll-view v-else scroll-y="true" style="height: 100%;">
<view class="order-item" v-for="(item, index) in orderList" :key="item.orderId">
<view class="order-title">
<view>{{item.contactName}} {{item.contactPhone}}</view>
<view>{{item.createDatetime | datefmt('MM/DD hh:mm')}}</view>
</view>
<view class="order-address">
<view>{{formatAddress(item)}}</view>
</view>
<view class="order-bottom">
<view>{{item.brandName}} {{item.categoryName}}</view>
<view>{{item.orderServiceType}} {{warranty(item)}}</view>
</view>
</view>
<u-loadmore v-show="(pageNumber == 1 && loaded) || pageNumber > 2" :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</template>
<u-gap height="68"></u-gap>
</scroll-view>
</view>
</view>
</template>
......@@ -19,6 +34,8 @@
<script>
import OrderCell from '@/components/order/index.vue';
import NoOrder from '@/components/order/noOrder.vue';
const app = getApp();
const global = app.globalData;
export default {
components: {
OrderCell,
......@@ -51,7 +68,8 @@ export default {
current: 0,
pageNumber: 0,
pageSize: 100,
orderList: []
orderList: [],
tabsHeight: 80
};
},
onShow() {
......@@ -60,6 +78,10 @@ export default {
this.getOrderList(this.currentIndex);
},
computed: {
contentHeight() {
let height = global.rpxScreenHeight - global.navHeight;
return height - this.tabsHeight + 'rpx';
},
noMore() {
return this.orderList.length == 0 && this.loaded;
},
......@@ -76,208 +98,51 @@ export default {
onreachBottom() {},
getOrderCount() {},
getOrderList() {
this.orderList = [
{
orderBusinessTypeText: '订单池',
auditResults: [
{
fieldName: 'minim nisi ex',
isPass: 'officia occaecat ullamco',
remark: 'nulla quis sit incididunt'
},
{
fieldName: 'in dolore consequat',
isPass: 'proident eu sit consequat ut',
remark: 'officia ut enim ut deserunt'
},
{
fieldName: 'Lorem in',
isPass: 'sint eiusmod aliqua',
remark: 'nostrud labore'
},
{
fieldName: 'sed dolor ut quis voluptate',
isPass: 'enim tempor dolor nisi',
remark: 'sunt'
},
{
fieldName: 'ea do in ut officia',
isPass: 'deserunt do',
remark: 'non'
}
],
currentWillOverTime: 43229753.27153155,
currentOverTime: 1619341311,
appointmentDatetime: null,
auditDatetime: 1991,
isFirstOrder: false,
partnerCompanyId: '79550af260555cc20afb34156c94b32c',
maintainStep: 'enim veniam',
contactCityText: null,
contactStreetText: null,
contactAddressLongitud: '39.91917',
categoryName: '充电桩',
contactCommunityText: null,
brandName: ' 沃尔沃',
orderServiceType: '安装',
contactProvince: null,
contactId: null,
orderNumber: 'OR2021041809827',
contactAddressLatitud: '116.3896',
contactStreet: null,
lianbaoBrandId: '28ee4e3e6063f2880d8956a013293a7f',
contactAddress: '湾街道荔枝花园D座125号',
contactName: '郭小清',
contactPhone: '13631612077',
orderBusinessType: null,
serviceContent: '服务描述',
contactCity: null,
categoryId: '79550af260555cc20afb34146966a2c4',
orderStatus: 51,
orderProductCount: '10',
contactCommunity: null,
orderId: '123456',
contactProvinceText: null
},
{
orderBusinessTypeText: '订单池',
auditResults: [
{
fieldName: 'aliquip est ex cillum id',
isPass: 'aute deserunt',
remark: 'tempor ut qui dolor eu'
},
{
fieldName: 'velit voluptate aliquip in',
isPass: 'ad',
remark: 'aliqua esse exercitation'
}
],
currentWillOverTime: -53540257.09187935,
currentOverTime: 1619341311,
appointmentDatetime: null,
auditDatetime: 1975,
isFirstOrder: false,
partnerCompanyId: '79550af260555cc20afb34156c94b32c',
maintainStep: 'reprehenderit labore officia sit',
contactId: null,
contactName: '郭小清',
contactAddress: '湾街道荔枝花园D座125号',
brandName: ' 沃尔沃',
orderNumber: 'OR2021041809827',
contactStreetText: null,
orderId: '123456',
orderBusinessType: null,
categoryId: '79550af260555cc20afb34146966a2c4',
orderProductCount: '10',
categoryName: '充电桩',
serviceContent: '服务描述',
contactCommunity: null,
lianbaoBrandId: '28ee4e3e6063f2880d8956a013293a7f',
contactPhone: '13631612077',
contactCommunityText: null,
contactAddressLongitud: '39.91917',
contactCityText: null,
contactStreet: null,
contactProvinceText: null,
contactAddressLatitud: '116.3896',
orderServiceType: '安装',
contactProvince: null,
orderStatus: 51,
contactCity: null
},
{
orderBusinessTypeText: '订单池',
auditResults: [
{
fieldName: 'dolore veniam est officia',
isPass: 'dolore elit aute',
remark: 'enim consectetur nulla culpa deserunt'
},
{
fieldName: 'commodo non cupidatat sit',
isPass: 'in in minim',
remark: 'do in'
}
],
currentWillOverTime: 60554344.05873975,
currentOverTime: 1619341311,
appointmentDatetime: null,
auditDatetime: 2009,
isFirstOrder: false,
partnerCompanyId: '79550af260555cc20afb34156c94b32c',
maintainStep: 'laborum dolore',
contactCityText: null,
contactPhone: '13631612077',
contactCity: null,
orderNumber: 'OR2021041809827',
orderProductCount: '10',
contactAddressLongitud: '39.91917',
orderId: '123456',
brandName: ' 沃尔沃',
contactProvince: null,
contactStreet: null,
contactCommunityText: null,
categoryId: '79550af260555cc20afb34146966a2c4',
categoryName: '充电桩',
contactAddress: '湾街道荔枝花园D座125号',
contactId: null,
orderServiceType: '安装',
contactStreetText: null,
orderStatus: 51,
lianbaoBrandId: '28ee4e3e6063f2880d8956a013293a7f',
orderBusinessType: null,
serviceContent: '服务描述',
contactProvinceText: null,
contactName: '郭小清',
contactAddressLatitud: '116.3896',
contactCommunity: null
let order = {
orderId: '123456',
orderNumber: 'OR2021041809827',
brandName: ' 沃尔沃',
categoryName: '充电桩',
orderServiceType: '安装',
inGuaranteePeriod: false,
contactId: 1,
contactName: '郭小清',
contactPhone: '13631612077',
contactProvinceText: '广东省',
contactCityText: '深圳市',
contactCommunityText: '宝安区',
contactStreetText: '新安街道',
contactAddress: '庭威产业园3栋10C',
serviceContent: '服务描述',
createDatetime: 1619341311
}
this.orderList = [order, order, order, order, order, order, order, order, order, order]
},
formatAddress(order) {
if(this.$u.test.isEmpty(order)) {
return '--'
} else {
let regoin = [
order.contactProvinceText || '',
order.contactCityText || '',
order.contactCommunityText || '',
order.contactStreetText || ''
]
let regoinText = regoin.join('')
let address = order.contactAddress
if(order.contactAddress && this.$u.test.contains(address, regoinText)) {
return address
} else {
return regoin.join(' ') + address
}
];
}
},
warranty(order) {
if(this.$u.test.isEmpty(order) || !order.inGuaranteePeriod) {
return '(保外)'
} else {
return '(保内)'
}
},
// 退出登录
......@@ -293,18 +158,44 @@ export default {
.wrap {
width: 750rpx;
height: 100vh;
display: flex;
flex-direction: column;
background-color: #ffffff;
.tabs-box {
width: 750rpx;
}
.content {
padding: 30rpx;
display: flex;
flex-direction: column;
height: 100%;
overflow-y: auto;
background-color: #f4f5f7;
.item {
height: 400rpx;
}
padding: 0 30rpx;
}
}
.order-item {
background-color: #FFFFFF;
margin-top: 30rpx;
padding: 30rpx;
border-radius: 25rpx;
.order-title {
color: #333333;
font-size: 32rpx;
font-weight: bold;
display: flex;
align-items: center;
justify-content: space-between;
line-height: 64rpx;
}
.order-address {
color: #999999;
font-size: 28rpx;
}
.order-bottom {
color: #999999;
font-size: 28rpx;
display: flex;
justify-content: space-between;
line-height: 64rpx;
}
}
</style>
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