物流页面更新

This commit is contained in:
THK3121 2023-08-09 17:26:01 +08:00
parent a9f905f609
commit 4d299879b2
8 changed files with 516 additions and 431 deletions

View File

@ -1,11 +1,20 @@
<template>
<view class="card" @click="goDetil(goodsInfo.id)">
<u-button type="primary" class="custom-style" style="background-color: #34A853;"
v-if='goodsInfo.status==0'>待取货</u-button>
<u-button type="primary" class="custom-style" v-if='goodsInfo.status==1'>待送货</u-button>
<p>{{goodsInfo.shop_name}}</p>
<view class="address">地址:&nbsp;&nbsp;{{goodsInfo.shop_address}}</view>
<view class="date">日期:&nbsp;&nbsp;{{goodsInfo.create_time}}</view>
<view v-if="goodsInfo.status==0">
<p>{{goodsInfo.shop_name}}</p>
<view class="address">地址:&nbsp;&nbsp;{{goodsInfo.shop_address}}</view>
<view class="date">日期:&nbsp;&nbsp;{{goodsInfo.create_time}}</view>
</view>
<view v-if="goodsInfo.status==1">
<p>{{goodsInfo.user_name}}</p>
<view class="address">地址:&nbsp;&nbsp;{{goodsInfo.user_address}}</view>
<!-- <view class="date">日期:&nbsp;&nbsp;{{goodsInfo.create_time}}</view> -->
</view>
</view>
</template>
<script>
@ -20,13 +29,16 @@
}
},
mounted() {
console.log(this.goodsInfo)
// console.log(this.goodsInfo)
// console.log(6666)
},
methods: {
goDetil(id) {
uni.navigateTo({
url: `/pages/logistics/deliveryDetil?id=${id}`,
// url: `/pages/logistics/deliveryDetil?id=${id}`,
// deliveryDetil
url: `/pages/logistics/${this.goodsInfo.status==1?"logisticDetil":"deliveryDetil"}?id=${id}`,
})
}

View File

@ -1,16 +1,22 @@
<template>
<view class="order">
<!-- <u-notify message="成功" duration="2000" show="true"></u-notify> -->
<view v-if='goodsInfo.status !==2'>
<view class="" @click="goDetil">
<p>{{goodsInfo.shop_name}}</p>
<view class='phone'>联系方式 :{{goodsInfo.shop_phone}} </view>
<p v-if="goodsInfo.status==0">{{goodsInfo.shop_name}}</p>
<p v-else>{{goodsInfo.user_name}}</p>
<view class='phone' v-if="goodsInfo.status==0">联系方式 :{{goodsInfo.shop_phone}} </view>
<view class='phone' v-else>联系方式 :{{goodsInfo.user_phone}} </view>
<view class="content_box">
<view class="left">
<view class="">
<view v-if="goodsInfo.status==0">
商家地址
</view>
<view v-if="goodsInfo.status==1">
用户地址
</view>
<view style="margin: 20rpx 0;">
订单编号
</view>
@ -19,23 +25,26 @@
</view>
</view>
<view class="right">
<view class="goods_tit">
<view class="goods_tit" v-if="goodsInfo.status==0">
{{goodsInfo.shop_address}}
</view>
<view class="goods_tit" v-else>
{{goodsInfo.user_address}}
</view>
<view style="margin: 20rpx 0;">
{{goodsInfo.order_sn}}
</view>
<view class='product' v-for="(item,index) in list" :key="index">
<view class='product' v-for="(item,index) in goodsInfo.products" :key="index">
<text class="goods_tit">{{item.goods_name}}</text>
<text>X{{item.product_num}}{{item.goods_unit}}</text>
</view>
</view>
</view>
</view>
<view class="icon" @click='getMore' v-if="flag">
<!-- <view class="icon" @click='getMore' v-if="flag">
<image style="width: 70rpx;height: 70rpx;text-align: center;" src="@/static/img/logistics/more.png"
alt="">
</view>
</view> -->
</view>
<view v-else class='finishOrder' @click="goDetil">
@ -46,13 +55,13 @@
<text style="color:#999">联系方式</text> {{goodsInfo.user_phone}}
</view>
<view style="margin: 20rpx 0;">
<text style="color:#999">收货时间</text> {{goodsInfo.xd_time||""}}
<text style="color:#999">收货时间</text> {{goodsInfo.xd_time||"暂未收货"}}
</view>
<view style="margin: 20rpx 0;">
<text style="color:#999">送达时间</text> {{goodsInfo.pc_time||""}}
<text style="color:#999">送达时间</text> {{goodsInfo.pc_time||"暂未送达"}}
</view>
<view style="margin: 20rpx 0;">
<text style="color:#999">取货时间</text> {{goodsInfo.qh_time||""}}
<text style="color:#999">取货时间</text> {{goodsInfo.qh_time||"暂未取货"}}
</view>
</view>
@ -84,7 +93,7 @@
props: ['goodsInfo'],
data() {
return {
tost: 0,
list: [],
flag: undefined,
showPop: false,
@ -98,20 +107,28 @@
url: `/pages/logistics/${status==0?"deliveryDetil":"logisticDetil"}?id=${this.goodsInfo.id}`
})
},
//
test() {
this.showMore()
this.getMore()
},
// {}
takeGood() {
takeGoods({
user_id: this.goodsInfo.courier_id,
logistics_id: this.goodsInfo.id
}).then(res => {
this.$emit('showTost')
this.$emit('getlist')
})
},
async confirm() {
await this.goodsInfo.status == 0 ? this.takeGood() : this.doneGood()
this.showPop = false
this.tost = true
this.$emit('getlist')
this.showMore()
},
//
doneGood() {
@ -119,6 +136,9 @@
user_id: this.goodsInfo.courier_id,
// user_id: 167,
logistics_id: this.goodsInfo.id
}).then(res => {
this.$emit('showTost')
this.$emit('getlist')
})
},
showMore() {
@ -142,7 +162,10 @@
},
mounted() {
this.showMore()
// this.showMore()
console.log(this.goodsInfo)
// console.log(this.goodsInfo)
// conso
}
}
@ -170,7 +193,7 @@
.goods_tit {
width: 60vw;
color: red;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;

View File

@ -1,160 +1,160 @@
{
"name": "供销综合平台",
"appid": "__UNI__B5B1EDD",
"description": "",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
/* 5+App */
"app-plus": {
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
/* */
"modules": {
"Payment": {},
"Barcode": {},
"Camera": {},
"Maps": {}
},
/* */
"distribute": {
/* android */
"android": {
"permissions": [
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<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.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios": {
"dSYMs": false
},
/* SDK */
"sdkConfigs": {
"payment": {
"weixin": {
"__platform__": ["ios", "android"],
"appid": "wx4789d9f1b50390ba",
"UniversalLinks": ""
}
},
"ad": {},
"maps": {
"amap": {
"appkey_ios": "0799f37420c0784f1e6cba230a68bdb1",
"appkey_android": "0799f37420c0784f1e6cba230a68bdb1"
}
}
},
"splashscreen": {
"useOriginalMsgbox": true
},
"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"
}
}
}
}
},
/* */
"quickapp": {},
"h5": {
"devServer": {
"proxy": {
"baseUrlTest/adminapi": {
"target": "https://worker-task.lihaink.cn",
"changeOrigin": true,
"pathRewrite": {
"^/baseUrlTest/adminapi": "/adminapi"
}
},
"baseUrlTest/api": {
"target": "https://worker-task.lihaink.cn",
"changeOrigin": true,
"pathRewrite": {
"^/baseUrlTest/api": "/api"
}
}
}
},
"sdkConfigs": {
"maps": {
"amap": {
"key": "275cd3601b1b2d6414f6c988e7911664",
"securityJsCode": "d2d7c56801819e8bdf71b8a71846f235",
"serviceHost": ""
}
}
}
},
/* */
"mp-weixin": {
"appid": "wx6e14cb98394e36bc",
"setting": {
"urlCheck": false
},
"usingComponents": true
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"vueVersion": "2"
}
"name" : "供销综合平台",
"appid" : "__UNI__B5B1EDD",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* */
"modules" : {
"Payment" : {},
"Barcode" : {},
"Camera" : {},
"Maps" : {}
},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<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.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios" : {
"dSYMs" : false
},
/* SDK */
"sdkConfigs" : {
"payment" : {
"weixin" : {
"__platform__" : [ "ios", "android" ],
"appid" : "wx4789d9f1b50390ba",
"UniversalLinks" : ""
}
},
"ad" : {},
"maps" : {
"amap" : {
"appkey_ios" : "0799f37420c0784f1e6cba230a68bdb1",
"appkey_android" : "0799f37420c0784f1e6cba230a68bdb1"
}
}
},
"splashscreen" : {
"useOriginalMsgbox" : true
},
"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"
}
}
}
}
},
/* */
"quickapp" : {},
"h5" : {
"devServer" : {
"proxy" : {
"baseUrlTest/adminapi" : {
"target" : "https://worker-task.lihaink.cn",
"changeOrigin" : true,
"pathRewrite" : {
"^/baseUrlTest/adminapi" : "/adminapi"
}
},
"baseUrlTest/api" : {
"target" : "https://worker-task.lihaink.cn",
"changeOrigin" : true,
"pathRewrite" : {
"^/baseUrlTest/api" : "/api"
}
}
}
},
"sdkConfigs" : {
"maps" : {
"amap" : {
"key" : "275cd3601b1b2d6414f6c988e7911664",
"securityJsCode" : "d2d7c56801819e8bdf71b8a71846f235",
"serviceHost" : ""
}
}
}
},
/* */
"mp-weixin" : {
"appid" : "wx6e14cb98394e36bc",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
}

View File

@ -1,5 +1,6 @@
<template>
<view class="content">
<u-toast ref="uToast"></u-toast>
<view class="map">
<map id="map" :markers='markers' :scale="scale" :enable-zoom="true" :polyline="polyline"
style="width:100%;height: 100%;" :latitude="latitude" :enable-scroll="false" :longitude="longitude">
@ -44,7 +45,7 @@
<view class="total">
共计{{goodsDetil.product_count}}件商品
</view>
<u-button type="primary" v-if='goodsDetil.logistics.status==0' @click="showPop=true"
<u-button type="primary" v-if='goodsDetil.logistics.status==0' @click="confirm"
class="custom-style">已取货</u-button>
</view>
</view>
@ -145,9 +146,22 @@
takeGoods({
user_id: id,
logistics_id: this.goodsDetil.logistics.id
}).then(res => {
this.showToast()
setTimeout(() => {
uni.navigateBack()
}, 2000)
})
this.showPop = false
uni.navigateBack()
},
showToast() {
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
},
/*
地图相关
@ -273,7 +287,7 @@
.custom-style {
width: 100%;
background-color: red;
background-color: #3C9CFF;
border: none;
color: white;
height: 90rpx;

View File

@ -12,9 +12,11 @@
</u-empty>
</view>
<view v-else>
<logistiCard v-for='(item,index) in orderlist' @getlist="getOrderList" :goodsInfo="item" :key="index">
<logistiCard :ref="'logistiCard'+index" v-for='(item,index) in orderlist' @getlist="getOrderList"
@showTost='showToast' :goodsInfo="item" :key="index">
</logistiCard>
</view>
<u-toast ref="uToast"></u-toast>
</view>
</template>
@ -42,27 +44,37 @@
sectionChange(index) {
this.curNow = index;
this.getOrderList()
// console.log(this.curNow)
},
showToast() {
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
},
getOrderList() {
// console.log(9999)
// return
console.log("列表更新")
let id = JSON.parse(uni.getStorageSync('USER_INFO')).id
getList({
status: this.curNow,
// courier_id: id,
// courier_id: 167,
courier_id: id,
keywords: this.keywords
}).then(res => {
this.orderlist = []
this.orderlist = res.data.data
console.log(this.orderlist)
for (let i = 0; i < this.orderlist.length; i++) {
// this.logistiCard
}
})
}
},
onShow() {
// this.curNow = 1
this.getOrderList()
}

View File

@ -138,8 +138,9 @@
</view>
<view class="cil_right">
</view>
<u-modal :show="showPop" @confirm="confirm" content="56565撒大苏打撒旦" @close="showPop=false"
<u-modal :show="showPop" @confirm="confirm" content="请确认货物已送达" @close="showPop=false"
:closeOnClickOverlay="true"></u-modal>
<u-toast ref="uToast"></u-toast>
</view>
</view>
@ -172,9 +173,22 @@
user_id: id,
// user_id: id,
logistics_id: this.goodsDetil.logistics.id
}).then(res => {
this.showToast()
setTimeout(() => {
uni.navigateBack()
}, 2000)
})
this.showPop = false
uni.navigateBack()
},
showToast() {
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
},
},
onLoad(options) {

View File

@ -137,6 +137,7 @@
</template>
<script>
import logistiBriefCard from "@/components/logistiComptent/logistiCard/logistiBriefCard.vue"
import {
getList
} from "@/api/logistics.js"
@ -160,6 +161,7 @@
export default {
components: {
// tabbar
logistiBriefCard
},
data() {
return {
@ -213,6 +215,7 @@
this.initUserInfo()
this.showToask()
this.initOaHomeDada()
this.getOrderList()
},
computed: {},
methods: {
@ -230,7 +233,6 @@
// },
async getOrderList() {
let id = JSON.parse(uni.getStorageSync('USER_INFO')).id
console.log(id)
let res = await getList({
courier_id: id
// courier_id: 167

View File

@ -1,259 +1,267 @@
<template>
<view class="login">
<image class="bg-iamge" src="../../static/img/login/login_back_img.png"></image>
<!-- #ifdef APP-PLUS||H5 -->
<view style="height: var(--status-bar-height);"></view>
<!-- #endif -->
<view class="body">
<view class="title">欢迎进入里海供销平台</view>
<view class="login-card">
<view class="top">
<view class="text item">
<u-tabs :list="tabList" @click="changeTabs" lineColor="#3274F9"
itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;font-size: 32rpx;"></u-tabs>
</view>
<input v-if="current==0" class="mobile item" v-model="formData.account" placeholder="输入账号" />
<input v-if="current==0" class="mobile item" v-model="formData.password" maxlength="26" placeholder="输入密码" password
type="safe-password" />
<input v-if="current==1" class="mobile item" v-model="formData.account" placeholder="输入手机号" />
<view v-if="current==1" class="code item">
<input placeholder="输入验证码" v-model="formData.code" maxlength="6" />
<u-code :seconds="seconds" @end="end" @start="start" ref="uCode"
@change="codeChange"></u-code>
<view class="get-code" @click="getCode">{{tips}}</view>
</view>
<view class="btn">
<!-- <view>新用户注册</view> -->
<!-- <view @click="forgetPWD">忘记密码?</view> -->
</view>
</view>
<button class="submit_btn" @click="login">登录</button>
</view>
</view>
</view>
<view class="login">
<image class="bg-iamge" src="../../static/img/login/login_back_img.png"></image>
<!-- #ifdef APP-PLUS||H5 -->
<view style="height: var(--status-bar-height);"></view>
<!-- #endif -->
<view class="body">
<view class="title">欢迎进入里海供销平台</view>
<view class="login-card">
<view class="top">
<view class="text item">
<u-tabs :list="tabList" @click="changeTabs" lineColor="#3274F9"
itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;font-size: 32rpx;"></u-tabs>
</view>
<input v-if="current==0" class="mobile item" v-model="formData.account" placeholder="输入账号" />
<input v-if="current==0" class="mobile item" v-model="formData.password" maxlength="26"
placeholder="输入密码" password type="safe-password" />
<input v-if="current==1" class="mobile item" v-model="formData.account" placeholder="输入手机号" />
<view v-if="current==1" class="code item">
<input placeholder="输入验证码" v-model="formData.code" maxlength="6" />
<u-code :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-code>
<view class="get-code" @click="getCode">{{tips}}</view>
</view>
<view class="btn">
<!-- <view>新用户注册</view> -->
<!-- <view @click="forgetPWD">忘记密码?</view> -->
</view>
</view>
<button class="submit_btn" @click="login">登录</button>
</view>
</view>
</view>
</template>
<script>
import { loginAccount, userInfo, test } from "@/api/oaUser.js"
import { Toast } from "../../libs/uniApi";
export default {
data() {
return {
tabList: [
{name:'账号登录'},
// {name:''},
],
current: 0,
formData: {
account: '',
password: '',
code: '',
terminal: 6, //6APP
scene: 1
},
tips: '获取验证码',
// refCode: null,
seconds: 60,
};
},
methods: {
changeTabs(e) {
this.current = e.index;
this.formData.scene = e.index + 1;
},
async login() {
if(!this.formData.account)return Toast('账号不能为空');
if(this.formData.scene==1&&!this.formData.password)return Toast('密码不能为空');
if(this.formData.scene==2&&!this.formData.code)return Toast('验证码不能为空');
let that = this;
// let res = await test();
// console.log(res);
uni.showLoading({
title:'正在登录中'
})
let res = await loginAccount(that.formData);
this.$store.commit('SET_USERINFO', {
user: data,
token: res.data.token
})
let { data } = await userInfo();
this.$store.commit('setUserInfo', data);
uni.hideLoading()
uni.switchTab({
url: '/pages/oaHome/oaHome'
})
},
initTerminal() {
// #ifndef APP-PLUS
this.formData.terminal = 6;
// #endif
uni.getSystemInfo({
success: (res) => {
const platform = res.platform.toLowerCase();
if (platform === 'ios') {
this.formData.terminal = 5;
} else if (platform === 'windows') {
this.formData.terminal = 4;
} else if (platform === 'mac') {
this.formData.terminal = 4;
}
}
})
// #ifdef H5
this.formData.terminal = 3;
// #endif
// #ifdef MP-WEIXIN
this.formData.terminal = 1;
// #endif
},
codeChange(text) {
this.tips = text;
},
getCode() {
if(this.$refs.uCode.canGetCode) {
//
uni.showLoading({
title: '正在获取验证码'
})
setTimeout(() => {
uni.hideLoading();
// this.start()
uni.$u.toast('验证码已发送');
//
this.$refs.uCode.start();
}, 2000);
} else {
uni.$u.toast('倒计时结束后再发送');
}
},
end() {
// uni.$u.toast('');
},
start() {
// uni.$u.toast('');
},
//
forgetPWD(){
Toast('暂未开放')
}
},
mounted() {
this.initTerminal();
}
}
import {
loginAccount,
userInfo,
test
} from "@/api/oaUser.js"
import {
Toast
} from "../../libs/uniApi";
export default {
data() {
return {
tabList: [{
name: '账号登录'
},
// {name:''},
],
current: 0,
formData: {
account: '',
password: '',
code: '',
terminal: 6, //6APP
scene: 1
},
tips: '获取验证码',
// refCode: null,
seconds: 60,
};
},
methods: {
changeTabs(e) {
this.current = e.index;
this.formData.scene = e.index + 1;
},
async login() {
if (!this.formData.account) return Toast('账号不能为空');
if (this.formData.scene == 1 && !this.formData.password) return Toast('密码不能为空');
if (this.formData.scene == 2 && !this.formData.code) return Toast('验证码不能为空');
let that = this;
// let res = await test();
// console.log(res);
uni.showLoading({
title: '正在登录中'
})
let res = await loginAccount(that.formData);
this.$store.commit('SET_USERINFO', {
user: data,
token: res.data.token
})
let {
data
} = await userInfo();
this.$store.commit('setUserInfo', data);
uni.hideLoading()
uni.switchTab({
url: '/pages/oaHome/oaHome'
})
},
initTerminal() {
// #ifndef APP-PLUS
this.formData.terminal = 6;
// #endif
uni.getSystemInfo({
success: (res) => {
const platform = res.platform.toLowerCase();
if (platform === 'ios') {
this.formData.terminal = 5;
} else if (platform === 'windows') {
this.formData.terminal = 4;
} else if (platform === 'mac') {
this.formData.terminal = 4;
}
}
})
// #ifdef H5
this.formData.terminal = 3;
// #endif
// #ifdef MP-WEIXIN
this.formData.terminal = 1;
// #endif
},
codeChange(text) {
this.tips = text;
},
getCode() {
if (this.$refs.uCode.canGetCode) {
//
uni.showLoading({
title: '正在获取验证码'
})
setTimeout(() => {
uni.hideLoading();
// this.start()
uni.$u.toast('验证码已发送');
//
this.$refs.uCode.start();
}, 2000);
} else {
uni.$u.toast('倒计时结束后再发送');
}
},
end() {
// uni.$u.toast('');
},
start() {
// uni.$u.toast('');
},
//
forgetPWD() {
Toast('暂未开放')
}
},
mounted() {
this.initTerminal();
}
}
</script>
<style lang="scss">
.login {
width: 100vw;
height: 100vh;
position: relative;
/* #ifdef H5 */
background-image: url('../../static/img/login/login_back_img.png');
.login {
width: 100vw;
height: 100vh;
position: relative;
/* #ifdef H5 */
background-image: url('../../static/img/login/login_back_img.png');
/* #endif */
.bg-iamge {
width: 100vw;
height: 100vh;
position: absolute;
z-index: -99;
}
/* #endif */
.bg-iamge {
width: 100vw;
height: 100vh;
position: absolute;
z-index: -99;
}
.body {
display: flex;
flex-direction: column;
align-items: center;
.body {
display: flex;
flex-direction: column;
align-items: center;
.title {
width: 694rpx;
height: 74rpx;
margin-top: 200rpx;
margin-bottom: 51rpx;
font-size: 53rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 68rpx;
-webkit-background-clip: text;
}
.title {
width: 694rpx;
height: 74rpx;
margin-top: 200rpx;
margin-bottom: 51rpx;
font-size: 53rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 68rpx;
-webkit-background-clip: text;
}
.login-card {
width: 694rpx;
height: 643rpx;
background: #FFFFFF;
border-radius: 21rpx 21rpx 21rpx 21rpx;
opacity: 1;
box-sizing: border-box;
padding: 38.5rpx 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
.login-card {
width: 694rpx;
height: 643rpx;
background: #FFFFFF;
border-radius: 21rpx 21rpx 21rpx 21rpx;
opacity: 1;
box-sizing: border-box;
padding: 38.5rpx 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
.top {
display: flex;
justify-content: space-evenly;
flex-direction: column;
.top {
display: flex;
justify-content: space-evenly;
flex-direction: column;
.item {
margin-bottom: 35rpx;
}
.item {
margin-bottom: 35rpx;
}
.text {
font-size: 32rpx;
font-weight: 500;
color: rgba(0, 0, 0, 0.8);
line-height: 35rpx;
}
.text {
font-size: 32rpx;
font-weight: 500;
color: rgba(0, 0, 0, 0.8);
line-height: 35rpx;
}
.mobile,
.code {
width: 613rpx;
height: 112rpx;
background: #F5F5F5;
border-radius: 56rpx 56rpx 56rpx 56rpx;
opacity: 1;
padding: 0 45.56rpx;
box-sizing: border-box;
font-size: 28rpx;
font-weight: 400;
color: #333;
line-height: 35rpx;
}
.mobile,
.code {
width: 613rpx;
height: 112rpx;
background: #F5F5F5;
border-radius: 56rpx 56rpx 56rpx 56rpx;
opacity: 1;
padding: 0 45.56rpx;
box-sizing: border-box;
font-size: 28rpx;
font-weight: 400;
color: #333;
line-height: 35rpx;
}
.code {
display: flex;
justify-content: space-between;
align-items: center;
.code {
display: flex;
justify-content: space-between;
align-items: center;
input {
font-size: 28rpx;
}
input {
font-size: 28rpx;
}
.get-code {
color: $theme-oa-color;
}
}
.get-code {
color: $theme-oa-color;
}
}
.btn {
display: flex;
justify-content: space-between;
}
}
.btn {
display: flex;
justify-content: space-between;
}
}
.submit_btn {
width: 613rpx;
height: 112rpx;
background: $theme-oa-color;
border-radius: 56rpx 56rpx 56rpx 56rpx;
opacity: 1;
text-align: center;
line-height: 112rpx;
color: #FFFFFF;
font-size: 35rpx;
font-weight: 500;
}
}
}
.submit_btn {
width: 613rpx;
height: 112rpx;
background: $theme-oa-color;
border-radius: 56rpx 56rpx 56rpx 56rpx;
opacity: 1;
text-align: center;
line-height: 112rpx;
color: #FFFFFF;
font-size: 35rpx;
font-weight: 500;
}
}
}
}
}
</style>