Commit c68080c6 by 前端

Merge branch 'v1.0.1' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.1

2 parents 6992ccde 28d87042
/node_modules /uni_modules
/unpackage /unpackage
/.idea /.idea
/.vscode /.vscode
......
import http from '../request/http' import http from '../request/http'
module.exports = { module.exports = {
getSmsCode (data) { /**获取短信 */
getSmsCode (data = {}) {
data.projectName = 'boutique' data.projectName = 'boutique'
return http.fetch('dj.api.smartcarlife.sms.get.code', data) return http.fetch('dj.api.smartcarlife.sms.get.code', data)
}, },
/**手机验证码登录 */
smsLogin (data = {}) {
data.projectName = 'boutique'
data.source = 'MINIAPP'
data.productCode = 'PC00c2'
return http.fetch('dj.api.smartcarlife.sms.login', data)
},
/**获取当前登录账号能查看的园区店列表 */
getYQList () {
return http.fetch('dj.api.smartcarlife.serviceMerchant.curYqList')
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
<image <image
:src="imagePath" :src="imagePath"
:mode="mode" :mode="mode"
:webp="webp||isWebp"
lazy-load
/> />
</template> </template>
...@@ -22,7 +20,6 @@ export default { ...@@ -22,7 +20,6 @@ export default {
type: null, type: null,
default: '' default: ''
}, },
webp: Boolean
}, },
name: 'GlsxImage', name: 'GlsxImage',
data () { data () {
...@@ -53,4 +50,9 @@ export default { ...@@ -53,4 +50,9 @@ export default {
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
image{
width: 100%;
height: 100%;
vertical-align: top;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
import Vue from 'vue' // import Vue from 'vue'
const componentsFiles = require.context(`./`, true, /.vue$/) // const componentsFiles = require.context(`./`, true, /.vue$/)
componentsFiles.keys().forEach(path => { // componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default // const component = componentsFiles(path).default
Vue.component(component.name, component) // // Vue.component(component.name, component)
}) // })
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,8 @@ import config from '@/config.js' ...@@ -4,7 +4,8 @@ import config from '@/config.js'
import store from '@/store'; import store from '@/store';
import api from './api/index' import api from './api/index'
import { Storage } from './utils/cache/index' import { Storage } from './utils/cache/index'
import 'components' import GlsxImage from './components/GlsxImage'
Vue.component('GlsxImage', GlsxImage)
uni.$api = api uni.$api = api
uni.$storage = new Storage() uni.$storage = new Storage()
Vue.config.productionTip = false Vue.config.productionTip = false
......
{ {
"easycom": { "easycom": {
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
}, },
"pages": [ "pages": [
{ {
"path": "pages/home/home",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "pages/common/login", "path": "pages/common/login",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path": "pages/order/order",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "pages/informationEntry/informationEntry",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
} }
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "生意助手", "navigationBarTitleText": "生意助手",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
} }
} }
...@@ -12,7 +12,17 @@ ...@@ -12,7 +12,17 @@
maxlength="11" maxlength="11"
/> />
<template v-if="mobile"> <template v-if="mobile">
<text class="icon" @click="mobile = ''">X</text> <view
class="icon"
@click="mobile = ''"
>
<icon
type="clear"
size="16"
color="#000"
>
</icon>
</view>
</template> </template>
</view> </view>
<view class="input"> <view class="input">
...@@ -23,15 +33,31 @@ ...@@ -23,15 +33,31 @@
maxlength="4" maxlength="4"
/> />
<template v-if="code"> <template v-if="code">
<text class="icon" @click="code = ''">X</text> <view
class="icon"
@click="code = ''"
>
<icon
type="clear"
size="16"
color="#000"
>
</icon>
</view>
</template> </template>
<!-- :class="['code-btn', { 'code-disabled': count }]" -->
<view <view
:class="['code-btn', { 'code-disabled': count }]"
@click="getSmsCode" @click="getSmsCode"
>{{ count ? `重新发送(${count}s)` : '获取验证码' }}</view >{{ count ? `重新发送(${count}s)` : '获取验证码' }}</view>
>
</view> </view>
<button class="btn" :disabled="!mobile || !code">登录</button> <button
class="btn"
:disabled="!mobile || !code"
@click="login"
>
登录
</button>
</view> </view>
</view> </view>
</template> </template>
...@@ -39,28 +65,27 @@ ...@@ -39,28 +65,27 @@
<script> <script>
const phoneRex = /^[1]([3-9])[0-9]{9}$/; const phoneRex = /^[1]([3-9])[0-9]{9}$/;
export default { export default {
data() { data () {
return { return {
mobile: '', mobile: '15626599738',
code: '', code: '8888',
count: '', count: '',
}; };
}, },
onLoad(options) { onLoad (options) {
uni.hideLoading();
}, },
methods: { methods: {
/**获取验证码 */ /**获取验证码 */
async getSmsCode() { async getSmsCode () {
const { mobile, count } = this; const { mobile, count } = this;
try { try {
if (!mobile) throw '请输入手机号'; if (!mobile) throw '请输入手机号';
if (!phoneRex.test(mobile)) throw '请输入正确的手机号'; if (!phoneRex.test(mobile)) throw '请输入正确的手机号';
if (count) throw '验证码发送过于频繁,请稍后在试'; if (count) throw '验证码发送过于频繁,请稍后在试';
this.countDown(60); this.countDown(60);
uni.showLoading() uni.showLoading();
const { code, message } = await uni.$api.userApi.getSmsCode({mobile}); const { code, message } = await uni.$api.userApi.getSmsCode({ mobile });
uni.hideLoading() uni.hideLoading();
if (code == '0') { if (code == '0') {
uni.showToast({ uni.showToast({
title: '验证码已发送', title: '验证码已发送',
...@@ -69,15 +94,15 @@ export default { ...@@ -69,15 +94,15 @@ export default {
this.countDown(60); this.countDown(60);
} else throw message || '发送验证码失败'; } else throw message || '发送验证码失败';
} catch (error) { } catch (error) {
uni.hideLoading() uni.hideLoading();
uni.showToast({ uni.showToast({
title: error, title: error,
icon: 'none', icon: 'none',
}) });
} }
}, },
/**验证码倒计时 */ /**验证码倒计时 */
countDown(countDown) { countDown (countDown) {
if (countDown) this.count = countDown; if (countDown) this.count = countDown;
setTimeout(() => { setTimeout(() => {
let { count } = this; let { count } = this;
...@@ -86,18 +111,117 @@ export default { ...@@ -86,18 +111,117 @@ export default {
else this.count = null; else this.count = null;
}, 1e3); }, 1e3);
}, },
async login () {
const { mobile, code: smsCode } = this;
try {
uni.showLoading();
const { code, data, message } = await uni.$api.userApi.smsLogin({
mobile,
code: smsCode,
noSignIn: false,
});
console.log(code, data, message);
uni.hideLoading();
if (code == 0) {
let {
loginUserInfoList,
sessionId,
noSignInUuid,
needSelectAccount,
} = data;
if (loginUserInfoList.length) {
const loginUserObj =
loginUserInfoList.filter(
(val) =>
val.subLoginUser && Object.keys(val.subLoginUser)?.length
)[0] || {};
uni.$storage.set('sessionId', sessionId);
console.log(loginUserObj)
// getYQList();
// noSignInUuid ? setNoSignInUuid(noSignInUuid) : rmNoSignInUuid();
// 记录登录信息 已选园区店、4s店和场景
if (!needSelectAccount && Object.keys(loginUserObj)?.length && loginUserObj?.shopMerchantId && !((loginUserObj?.sceneType ?? '') === '')) {
this.getYqMerchantSceneConfig(loginUserObj, 0);
} else if (!needSelectAccount && Object.keys(loginUserObj)?.length && loginUserObj?.shopMerchantId && (loginUserObj?.sceneType ?? '') === '') {
// 已选园区店、4s店
this.getYqMerchantSceneConfig(loginUserObj, 1);
} else if (!needSelectAccount) {
// 仅选择园区店
this.getYqMerchantSceneConfig(loginUserObj, 2);
} else {
// 未记录到登录信息
this.getAccountLoginList(loginUserInfoList);
}
} else wx.$router.reLaunch('pages.nothing');
} else
uni.showModal({
title: '温馨提示',
content: message,
showCancel: false,
confirmText: '知道了',
confirmColor: '#347BFF',
});
} catch (error) {
uni.hideLoading();
uni.showToast({
title: error,
icon: 'none',
});
}
},
async getYqMerchantSceneConfig (loginUserObj, num) {
// let checkAgreeClient = await this.checkAgreeClient(loginUserObj)
// if (!checkAgreeClient) return wx.$router.go('pages.accountItems')
// num 0已选园区店、4s店和场景 1已选园区店、4s店 2仅选择园区店
let pageUrl = ['pages.loading', 'pages.sceneIndex', 'pages.merchantList']
let { shopMerchantId, shopMerchantName } = loginUserObj
wx.$util.setUserInfo(loginUserObj)
if (num == 2) {
this.get4SStoreList(loginUserObj, pageUrl[num])
} else {
// 兼容除精品升级外场景 已选门店数据
wx.$util.setUserInfo({
...wx.$util.getUserInfo(),
default4SStoreInfo: {
merchantId: shopMerchantId,
merchantName: shopMerchantName
},
default4SStoreInfo_crowdFunding: {
merchantId: shopMerchantId,
merchantName: shopMerchantName
},
default4SStoreInfo_newCarConversion: {
merchantId: shopMerchantId,
merchantName: shopMerchantName
}
})
if (num == 0) wx.$router.reLaunch(pageUrl[num])
else wx.$router.go(pageUrl[num])
this.setData({ jumpPageFlag: false })
}
},
// 获取登录账号下园区店列表
getAccountLoginList (loginUserInfoList) {
if (loginUserInfoList?.length == 1) this.getYqMerchantSceneConfig(loginUserInfoList[0], 2)
else wx.$router.go('pages.accountItems')
},
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.a{
width: 500px;
height: 200px;
}
.bg { .bg {
position: fixed; position: fixed;
width: 100%; width: 100%;
height: 100%; height: 100%;
left: 0; left: 0;
top: 0; top: 0;
background-image: url('https://img02.glsx.com.cn/weapp/resource/app-tape/login/bg.png'); background-image: url("https://img02.glsx.com.cn/weapp/resource/app-tape/login/bg.png");
background-size: 100% 100%; background-size: 100% 100%;
} }
.login { .login {
...@@ -124,7 +248,7 @@ export default { ...@@ -124,7 +248,7 @@ export default {
border-radius: 56rpx; border-radius: 56rpx;
margin-bottom: 40rpx; margin-bottom: 40rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 0 40rpx; padding-left: 40rpx;
display: flex; display: flex;
align-items: center; align-items: center;
input { input {
...@@ -135,6 +259,10 @@ export default { ...@@ -135,6 +259,10 @@ export default {
.icon { .icon {
margin-left: auto; margin-left: auto;
flex-shrink: 0; flex-shrink: 0;
display: flex;
align-items: center;
padding: 0 40rpx;
height: 100%;
} }
.code-btn { .code-btn {
font-weight: 500; font-weight: 500;
...@@ -142,6 +270,7 @@ export default { ...@@ -142,6 +270,7 @@ export default {
color: #2c66f7; color: #2c66f7;
flex-shrink: 0; flex-shrink: 0;
border: none; border: none;
margin-right: 40rpx;
} }
.code-disabled { .code-disabled {
color: #9b9b9e; color: #9b9b9e;
...@@ -160,7 +289,7 @@ export default { ...@@ -160,7 +289,7 @@ export default {
color: #ffffff; color: #ffffff;
} }
.btn[disabled]:not([type]), .btn[disabled]:not([type]),
.btn[disabled][type='default'] { .btn[disabled][type="default"] {
background: #c9c9c9 !important; background: #c9c9c9 !important;
} }
} }
......
<!--
* @Description: 首页
* @Author: huyue
* @Date: 2024-04-07 14:39:40
* @LastEditors: huyue
* @LastEditTime: 2024-04-08 09:45:47
-->
<template>
<view class="container">
<view class="left-side">
<!-- 左侧内容 -->
<view class="user-info">
<image
class="user-avatar"
src="../../static/logo.png"
mode="scaleToFill"
/>
<view class="user-name">huyue</view>
<view class="user-position">延保专员</view>
</view>
<view class="left-footer">
<view class="logout">
<image class="icon-logout" src="../../static/images/home/icon-logout.png" mode="scaleToFill" />
<view>退出</view>
</view>
<view class="store-addr">
<image
class="icon-addr"
src="../../static/images/home/icon-addr.png"
mode="scaleToFill"
/>
<view class="addr-text">东莞问界交付中心</view>
</view>
</view>
</view>
<view class="right-side">
<!-- 右侧内容 -->
<text>右侧内容</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
onLoad(options) {
const text = options.text;
uni.setNavigationBarTitle({
title: text,
});
},
};
</script>
<style scoped lang="scss">
.container {
display: flex;
height: 100vh;
}
.left-side {
display: flex;
flex-direction: column;
background-color: #F8F9F9;
.user-info {
width: 220rpx;
box-sizing: border-box;
padding: 56rpx 56rpx 0 36rpx;
text-align: center;
}
.user-avatar {
width: 128rpx;
height: 128rpx;
border-radius: 50%;
box-shadow: 0 4rpx 8rpx 0 #0000001a;
}
.user-name {
font-weight: 500;
font-size: 32rpx;
color: #333333;
margin-top: 20rpx;
}
.user-position {
font-size: 20rpx;
color: #9B9B9E;
margin-top: 8rpx;
}
.left-footer {
margin-top: auto;
}
.logout {
display: flex;
align-items: center;
justify-content: center;
background-color: #FFFFFF;
border: 2rpx solid #EEEEEE;
border-radius: 16rpx;
font-size: 28rpx;
margin: 0 30rpx;
color: #6C6C70;
padding: 18rpx 32rpx;
}
.icon-logout {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
.store-addr {
display: flex;
align-items: flex-start;
padding: 0 16rpx 60rpx;
margin-top: 38rpx;
.icon-addr {
width: 32rpx;
height: 32rpx;
}
.addr-text {
width: 152rpx;
font-size: 24rpx;
color: #6C6C70;
word-wrap: break-word;
white-space: normal;
}
}
}
.right-side {
flex: 1;
background-color: #FFFFFF;
}
</style>
\ No newline at end of file \ No newline at end of file
<!--
* @Description:
* @Author: huyue
* @Date: 2024-04-07 14:54:28
* @LastEditors: huyue
* @LastEditTime: 2024-04-08 09:42:44
-->
<template>
<view>
这是信息录入
<button @tap="choose">调摄像头</button>
<view>客户付款凭证</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
onLoad(options) {
const text = options.text
uni.setNavigationBarTitle({
title: text
});
},
methods: {
choose() {
uni.chooseImage({
count: 1,
success: (res) => {
console.log(res)
},
fail: (err) => {
console.log(err)
}
})
}
}
}
</script>
<style lang="scss">
</style>
\ No newline at end of file \ No newline at end of file
<!--
* @Description:
* @Author: huyue
* @Date: 2024-04-07 14:54:28
* @LastEditors: huyue
* @LastEditTime: 2024-04-08 09:43:06
-->
<template>
<view>
这是订单列表
</view>
</template>
<script>
export default {
data() {
return {
};
},
onLoad(options) {
const text = options.text
uni.setNavigationBarTitle({
title: text
});
}
}
</script>
<style lang="scss">
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!