Commit 55f7adf6 by 张立顺

feat 功能开发

1 parent 09c52b14
import api from '~/utils/request/request' import api from '~/utils/request/request'
const { const { appId } = wx.getAccountInfoSync().miniProgram
appId
} = wx.getAccountInfoSync().miniProgram
const CODE = { const CODE = {
platformEntrance: 'BUSINESS_ASSISTANT', platformEntrance: 'SALES_ASSISTANT',
productCode: 'PC00c3' productCode: 'PC00c3'
} }
class UsersApi { class UsersApi {
...@@ -11,12 +9,12 @@ class UsersApi { ...@@ -11,12 +9,12 @@ class UsersApi {
async wxCodeLogin() { async wxCodeLogin() {
const appEnter = wx.getEnterOptionsSync() const appEnter = wx.getEnterOptionsSync()
try { try {
if (appEnter.scene === 1154 && appEnter.mode === 'singlePage') throw 'login:fail rejected due to no permission currently' if (appEnter.scene === 1154 && appEnter.mode === 'singlePage')
const { throw 'login:fail rejected due to no permission currently'
code const { code } = await this.getWxCode()
} = await this.getWxCode() return await api.post(
return await api.post({ {
method: 'scrm.api.sso.wechat.applets.jscode.login', method: 'dj.api.sale.login.jscode.login',
appId, appId,
code code
}, },
...@@ -29,8 +27,9 @@ class UsersApi { ...@@ -29,8 +27,9 @@ class UsersApi {
} }
/**退出登录 */ /**退出登录 */
logout() { logout() {
return api.post({ return api.post(
method: 'scrm.api.sso.wechat.applets.logout' {
method: 'dj.api.sale.login.logout'
}, },
true true
) )
...@@ -51,12 +50,14 @@ class UsersApi { ...@@ -51,12 +50,14 @@ class UsersApi {
Promise.reject() Promise.reject()
return return
} }
if (detail.errMsg && detail.errMsg == 'getPhoneNumber:fail user deny') Promise.reject() if (detail.errMsg && detail.errMsg == 'getPhoneNumber:fail user deny')
Promise.reject()
delete detail.errMsg delete detail.errMsg
if (detail.iv && detail.encryptedData) { if (detail.iv && detail.encryptedData) {
detail.loginToken = loginToken detail.loginToken = loginToken
return api.post({ return api.post(
method: 'scrm.api.sso.wechat.applets.auth.phone', {
method: 'dj.api.sale.login.auth.phone',
...detail, ...detail,
platformEntrance: 'BUSINESS_ASSISTANT' // 平台标识:生意助手-BUSINESS_ASSISTANT,门店助手-STORE_ASSISTANT platformEntrance: 'BUSINESS_ASSISTANT' // 平台标识:生意助手-BUSINESS_ASSISTANT,门店助手-STORE_ASSISTANT
}, },
...@@ -66,7 +67,8 @@ class UsersApi { ...@@ -66,7 +67,8 @@ class UsersApi {
} }
/**账号密码登录 */ /**账号密码登录 */
async accountLogin(data = {}) { async accountLogin(data = {}) {
return api.post({ return api.post(
{
method: 'scrm.api.sso.wechat.applets.password.login', method: 'scrm.api.sso.wechat.applets.password.login',
...data, ...data,
...CODE ...CODE
...@@ -76,8 +78,9 @@ class UsersApi { ...@@ -76,8 +78,9 @@ class UsersApi {
} }
/** 手机号获取短信验证码 */ /** 手机号获取短信验证码 */
getSmsCode(mobile) { getSmsCode(mobile) {
return api.post({ return api.post(
method: 'scrm.api.sso.wechat.applets.sms.get.code', {
method: 'dj.api.sale.login.get.sms.code',
mobile mobile
}, },
true true
...@@ -85,8 +88,9 @@ class UsersApi { ...@@ -85,8 +88,9 @@ class UsersApi {
} }
/** 手机号短信验证码登录 */ /** 手机号短信验证码登录 */
phoneSmsLogin(data = {}) { phoneSmsLogin(data = {}) {
return api.post({ return api.post(
method: 'scrm.api.sso.wechat.applets.sms.login', {
method: 'dj.api.sale.login.sms.login',
...data, ...data,
source: 'MINIAPP', source: 'MINIAPP',
platformEntrance: 'BUSINESS_ASSISTANT' platformEntrance: 'BUSINESS_ASSISTANT'
...@@ -96,7 +100,8 @@ class UsersApi { ...@@ -96,7 +100,8 @@ class UsersApi {
} }
/** 获取登录账号列表 */ /** 获取登录账号列表 */
getAccountList(sessionId) { getAccountList(sessionId) {
return api.post({ return api.post(
{
method: 'scrm.api.sso.wechat.applets.listSelectAccount', method: 'scrm.api.sso.wechat.applets.listSelectAccount',
...CODE, ...CODE,
sessionId sessionId
...@@ -107,7 +112,8 @@ class UsersApi { ...@@ -107,7 +112,8 @@ class UsersApi {
/** /**
* 选择账号登录(手机绑定多个账号时) */ * 选择账号登录(手机绑定多个账号时) */
selectAccountLogin(data) { selectAccountLogin(data) {
return api.post({ return api.post(
{
method: 'scrm.api.sso.wechat.applets.selectAccountLogin', method: 'scrm.api.sso.wechat.applets.selectAccountLogin',
...CODE, ...CODE,
...data ...data
...@@ -117,15 +123,17 @@ class UsersApi { ...@@ -117,15 +123,17 @@ class UsersApi {
} }
/**检查sessionId 是否过期 */ /**检查sessionId 是否过期 */
checkSession() { checkSession() {
return api.post({ return api.post(
method: 'scrm.api.sso.login.status.check' {
method: 'dj.api.sale.login.getLoginInfo'
}, },
true true
) )
} }
/** 超级管理员切换账号 */ /** 超级管理员切换账号 */
adminSelectLogin(data) { adminSelectLogin(data) {
return api.post({ return api.post(
{
method: 'scrm.api.sso.super.administrator.select.login', method: 'scrm.api.sso.super.administrator.select.login',
...CODE, ...CODE,
...data ...data
...@@ -150,12 +158,13 @@ class UsersApi { ...@@ -150,12 +158,13 @@ class UsersApi {
return data return data
} else return wx_user_info } else return wx_user_info
} }
/** 手机号授权解析(单纯解析内容返回前端) /** 手机号授权解析(单纯解析内容返回前端)
* 只传loginToken就返回unionId和openid * 只传loginToken就返回unionId和openid
* 传加密信息就解析手机号 * 传加密信息就解析手机号
*/ */
async getUserProfile(loginToken, detail = {}) { async getUserProfile(loginToken, detail = {}) {
if (detail.errMsg && detail.errMsg == 'getPhoneNumber:fail user deny') Promise.reject() if (detail.errMsg && detail.errMsg == 'getPhoneNumber:fail user deny')
Promise.reject()
delete detail.errMsg delete detail.errMsg
if (!loginToken) { if (!loginToken) {
let res = await this.wxCodeLogin() let res = await this.wxCodeLogin()
...@@ -168,15 +177,30 @@ class UsersApi { ...@@ -168,15 +177,30 @@ class UsersApi {
platformEntrance: 'BUSINESS_ASSISTANT' platformEntrance: 'BUSINESS_ASSISTANT'
}) })
} }
// 免密授权码登录
// 登录自动创建服务中心 async noSignInLogin(data = {}) {
initServiceCenter(data) {
return api.post( return api.post(
{ {
method: 'scrm.api.busassistant.serviceCenter.init', method: 'dj.api.sale.login.noSignIn.login',
...data ...data,
} platformEntrance: 'BUSINESS_ASSISTANT'
},
true
) )
} }
// 登录自动创建服务中心
initServiceCenter(data) {
return api.post({
method: 'scrm.api.busassistant.serviceCenter.init',
...data
})
}
// 能否打开智能名片
canOpenBusinessCard(data) {
return api.post({
method: 'dj.api.sale.login.openBusinessCard',
...data
})
}
} }
export default UsersApi
\ No newline at end of file \ No newline at end of file
export default UsersApi
{ {
"pages": [ "pages": [
"login/loading/loading", "login/loading/loading",
"pages/tab/index/index", "pages/tab/index/index",
"pages/tab/mine/mine", "pages/tab/mine/mine",
"pages/webView/webView", "pages/webView/webView",
"login/index/index", "login/index/index",
"pages/tab/customer/customer", "pages/tab/customer/customer",
"pages/tab/tool/tool" "pages/tab/tool/tool"
], ],
"requiredPrivateInfos": [ "requiredPrivateInfos": [
"getLocation", "getLocation",
"chooseLocation" "chooseLocation"
], ],
"lazyCodeLoading": "requiredComponents", "lazyCodeLoading": "requiredComponents",
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
}, },
"tabBar": { "tabBar": {
"color": "#999EA8", "color": "#999EA8",
"selectedColor": "#347BFF", "selectedColor": "#347BFF",
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"borderStyle": "white", "borderStyle": "white",
"list": [ "list": [
{ {
"pagePath": "pages/tab/index/index", "pagePath": "pages/tab/index/index",
"text": "首页", "text": "首页",
"iconPath": "images/home.png", "iconPath": "images/home.png",
"selectedIconPath": "images/home-active.png" "selectedIconPath": "images/home-active.png"
}, },
{ {
"pagePath": "pages/tab/customer/customer", "pagePath": "pages/tab/customer/customer",
"text": "客户", "text": "客户",
"iconPath": "images/customer.png", "iconPath": "images/customer.png",
"selectedIconPath": "images/customer-active.png" "selectedIconPath": "images/customer-active.png"
}, },
{ {
"pagePath": "pages/tab/tool/tool", "pagePath": "pages/tab/tool/tool",
"text": "工具", "text": "工具",
"iconPath": "images/tool.png", "iconPath": "images/tool.png",
"selectedIconPath": "images/tool-active.png" "selectedIconPath": "images/tool-active.png"
}, },
{ {
"pagePath": "pages/tab/mine/mine", "pagePath": "pages/tab/mine/mine",
"text": "我的", "text": "我的",
"iconPath": "images/mine.png", "iconPath": "images/mine.png",
"selectedIconPath": "images/mine-active.png" "selectedIconPath": "images/mine-active.png"
} }
] ]
}, },
"subpackages": [ "subpackages": [
{ {
"root": "packageIndex/pages", "root": "packageIndex/pages",
"name": "packageIndex", "name": "packageIndex",
"pages": [ "pages": [
"index/index" "index/index"
] ]
}, },
{ {
"root": "packageCustomer/pages", "root": "packageCustomer/pages",
"name": "packageCustomer", "name": "packageCustomer",
"pages": [ "pages": [
"potentialDetail/potentialDetail", "potentialDetail/potentialDetail",
"createVisit/createVisit", "createVisit/createVisit",
"resultFeedback/resultFeedback", "resultFeedback/resultFeedback",
"createPotential/createPotential" "createPotential/createPotential"
] ]
}, },
{ {
"root": "packageTool/pages", "root": "packageTool/pages",
"name": "packageTool", "name": "packageTool",
"pages": [ "pages": [
"index/index" "index/index",
] "salesDailyReport/index",
}, "salesReport/index"
{ ]
"root": "packageMine/pages", },
"name": "packageMine", {
"pages": [] "root": "packageMine/pages",
} "name": "packageMine",
], "pages": [
"preloadRule": {}, "setting/setting"
"usingComponents": { ]
"tab": "/components/Tab/Tab", }
"navigation-bar": "/components/NavigationBar/NavigationBar", ],
"popup": "/components/Popup/Popup", "preloadRule": {},
"nothing-tips": "/components/Nothing-tips/nothingTips", "usingComponents": {
"crowdfund-poster": "/components/CrowdfundPoster/CrowdfundPoster", "tab": "/components/Tab/Tab",
"glsx-image": "/components/image/index", "navigation-bar": "/components/NavigationBar/NavigationBar",
"no-product": "/components/NoProduct/index", "popup": "/components/Popup/Popup",
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index", "nothing-tips": "/components/Nothing-tips/nothingTips",
"van-popup": "@vant/weapp/popup/index" "crowdfund-poster": "/components/CrowdfundPoster/CrowdfundPoster",
}, "glsx-image": "/components/image/index",
"resolveAlias": { "no-product": "/components/NoProduct/index",
"~/*": "/*" "glsx-privacy": "glsx-applet-component/GlsxPrivacy/index",
}, "van-popup": "@vant/weapp/popup/index"
"sitemapLocation": "sitemap.json", },
"__usePrivacyCheck__": true, "resolveAlias": {
"permission": { "~/*": "/*"
"scope.userLocation": { },
"desc": "你的位置信息将用于小程序位置接口的效果展示" "sitemapLocation": "sitemap.json",
} "__usePrivacyCheck__": true,
} "permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
} }
\ No newline at end of file \ No newline at end of file
// pages/tab/output/components/sceneBox/sceneBox.js
import { IMG_URL } from '~/utils/constantData'
import { scenceList } from '~/pages/tab/index/constant/data'
Component({
/**
* 组件的属性列表
*/
properties: {
options: {
addGlobalClass: true
},
sceneActive: {
type: Number,
value: -1
},
sceneCodeActive: {
type: String,
value: ''
},
hasOpenIcon: {
type: Boolean,
value: true
},
hasLockIcon: {
type: Boolean,
value: true
},
listIdx: {
type: Number,
value: -1
},
sceneInfo: {
type: Object,
value: () => { },
observer(n) {
if (n.hasOwnProperty('sceneList')) {
this.findIsOpen()
}
}
},
scenePriceList: {
type: Array,
value: () => []
}
},
/**
* 组件的初始数据
*/
data: {
IMGURL: IMG_URL,
openedIcon: `${IMG_URL}/output/openedIcon.png`,
scenceList
},
lifetimes: {
attached() { }
},
/**
* 组件的方法列表
*/
methods: {
findIsOpen() {
let list = JSON.parse(JSON.stringify(this.data.scenceList))
list.forEach(item => {
let obj = this.data.sceneInfo?.sceneList.find(k => k.sceneCode == item.sceneCode) || {}
item.isOpen = obj.flag || false
})
this.setData({
scenceList: list
})
},
handleClick(e) {
let { idx, scenecode } = e.currentTarget.dataset
let { listIdx } = this.data
this.triggerEvent('handleSceneChange', { sceneIdx: idx, sceneCode: scenecode, listIdx: listIdx })
}
}
})
<!-- pages/tab/output/components/sceneBox/sceneBox.wxml -->
<wxs src="/pages/tab/output/index.wxs" module="filter" />
<view class="flex scene">
<view class="scene-item {{ (item.isOpen && hasOpenIcon) ? 'open' : ''}} {{sceneCodeActive && (sceneCodeActive == item.sceneCode) ? 'active' : ''}}" wx:for="{{scenceList}}" wx:key="index" bindtap="handleClick" data-idx="{{index + 1}}" data-scenecode="{{item.sceneCode}}">
<view wx:if="{{hasOpenIcon && item.isOpen}}" class="open-icon">
<image src="{{openedIcon}}" webp></image>
</view>
<image webp wx:if="{{item.isOpen}}" class="scene-img" src="{{IMGURL}}output/caracticon0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
<view wx:else class="no-open-img">
<image webp wx:if="{{hasLockIcon}}" class="lock-img" src="{{IMGURL}}output/carlock0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
<image webp wx:else="" class="scene-img" src="{{IMGURL}}output/icon-car0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
</view>
<view class="title-box">
<view class="scene-title {{item.isOpen ? '' : 'on-open'}}">{{item.name}}</view>
</view>
<!-- <view>{{item.subTitle}}</view> -->
<view class="total-price" wx:if="{{scenePriceList.length}}">
¥ {{filter.money_three_for_two_thousands(item.isOpen ? (scenePriceList[index].total || 0.00) : 0.00)}}
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/tab/output/components/sceneBox/sceneBox.wxss */
.flex {
display: flex;
}
.scene {
text-align: center;
width: 100%;
}
.scene-item {
box-sizing: border-box;
position: relative;
width: 25%;
/* flex: 1; */
background: #F7F8FC;
margin-right: 4rpx;
font-size: 18rpx;
color: #8A8C90;
/* padding: 32rpx 0 28rpx; */
padding: 24rpx 0 18rpx;
border-radius: 12rpx;
font-weight: 500;
border: 2rpx solid #F7F8FC;
/* margin-bottom: 20rpx; */
}
.scene-item:last-child {
margin-right: 0;
}
.scene-title {
width: 100rpx;
font-size: 24rpx;
font-weight: 600;
text-align: center;
color: #323436;
}
.scene-item:nth-child(2) .scene-title {
width: 120rpx;
}
/* 已开通 - start */
.open.scene-item {
background: #F0F7FF;
}
.open-icon {
box-sizing: border-box;
position: absolute;
top: 0;
right: 0;
width: 78rpx;
height: 78rpx;
/* left: 0.5rpx;
top: 0.5rpx;
width: 56rpx;
height: 32rpx;
line-height: 24rpx;
background: #FEEBD6;
border-radius: 6rpx 0 8rpx 0;
font-size: 18rpx;
font-weight: 600;
color: #EF971E;
padding: 4rpx; */
}
.open-icon image {
height: 100%;
}
/* 已开通 - end */
/* 选中 - start */
.active.scene-item {
background-image: linear-gradient(145deg, #F0F7FF 0%, #FFFFFF 73%);
border: 2rpx solid #3666FE;
/* box-shadow: 0 4rpx 8rpx 0 rgba(180, 186, 204, 0.32), 0 8rpx 20rpx 0 rgba(180, 186, 204, 0.40); */
filter: drop-shadow(0 12rpx 12rpx rgba(180, 186, 204, 0.40));
}
.active::after {
position: absolute;
left: 50%;
bottom: -17rpx;
display: block;
content: "";
width: 16rpx;
height: 16rpx;
/* border-radius: 4rpx; */
border-bottom: 1px solid var(--btnColor);
border-right: 1px solid var(--btnColor);
transform: rotate(45deg) translateX(-50%);
background-color: #fff;
}
/* 选中 - end */
.title-box {
height: 68rpx;
display: flex;
justify-content: center;
align-items: center;
margin: 10rpx 0 4rpx;
}
.scene-title.on-open {
color: #8A8C90;
}
.no-open-img {
position: relative;
}
.scene-img {
width: 92rpx;
height: 64rpx;
}
.lock-img {
width: 92rpx;
height: 64rpx;
}
.total-price {
height: 40rpx;
line-height: 40rpx;
margin-top: 22rpx;
font-size: 20rpx;
color: #3666FE;
/* font-weight: 600; */
font-family: 'number';
}
/* .notOpened {
color: #8A8C90;
} */
\ No newline at end of file \ No newline at end of file
...@@ -174,21 +174,24 @@ Component({ ...@@ -174,21 +174,24 @@ Component({
// debugger // debugger
if (code == '0') { if (code == '0') {
const thisPage = wx.$router.getPageInstance() const thisPage = wx.$router.getPageInstance()
if (loginType == 1) checkLoginUserInfo(data) if (loginType == 1) setLoginInfo(data, data.sessionId)
else { wx.$storage.set('auto_login_object', {
const { autoLogin } = thisPage.data, noSignInUuid: data.noSignInUuid
{ sessionId, loginUserInfoList } = data, })
validTime = 3600 * 24 * 7 * 1e3, // else {
autoLoginFailureTime = Date.now() + validTime // const { autoLogin } = thisPage.data,
if (autoLogin && loginUserInfoList[0]) { // { sessionId, loginUserInfoList } = data,
wx.$storage.set('auto_login_object', { // validTime = 3600 * 24 * 7 * 1e3,
failureTime: autoLoginFailureTime, // autoLoginFailureTime = Date.now() + validTime
userName: formData.account, // if (autoLogin && loginUserInfoList[0]) {
password: md5(formData.password) // wx.$storage.set('auto_login_object', {
}) // failureTime: autoLoginFailureTime,
} else wx.$storage.rm('auto_login_object') // userName: formData.account,
setLoginInfo(loginUserInfoList[0], sessionId) // password: md5(formData.password)
} // })
// } else wx.$storage.rm('auto_login_object')
// setLoginInfo(loginUserInfoList[0], sessionId)
// }
} else { } else {
if (loginType == 1) if (loginType == 1)
this.setData({ this.setData({
...@@ -213,8 +216,12 @@ Component({ ...@@ -213,8 +216,12 @@ Component({
this.setBtnLoading() this.setBtnLoading()
USERAPI.authUserPhone(detail, this.loginToken) USERAPI.authUserPhone(detail, this.loginToken)
.then(({ code, data, message }) => { .then(({ code, data, message }) => {
if (code == '0') checkLoginUserInfo(data) if (code == '0') {
else { setLoginInfo(data, data.sessionId)
wx.$storage.set('auto_login_object', {
noSignInUuid: data.noSignInUuid
})
} else {
wx.$api.showToast(message || '系统异常') wx.$api.showToast(message || '系统异常')
this.init() this.init()
} }
......
/* login/index/components/LoginBox.wxss */ /* login/index/components/LoginBox.wxss */
.wx { .wx {
// height: 922rpx; // height: 922rpx;
height: 63vh; height: 63vh;
.title { .title {
width: 378rpx;
// margin: 0 40rpx;
font-weight: 600; font-weight: 600;
font-size: 60rpx; font-size: 60rpx;
color: #323436; color: #323436;
// padding: 216rpx 0 24rpx; // padding: 216rpx 0 24rpx;
padding: 13vh 0 24rpx; padding: 20vh 115rpx 24rpx;
// text-align: left;
} }
.subtitle { .subtitle {
font-size: 44rpx; margin-bottom: 76rpx;
color: #323436; color: #181a1f;
margin-bottom: 120rpx; font-size: 48rpx;
text-align: center;
} }
.img { .img {
width: 378rpx; width: 378rpx;
height: 364rpx; height: 378rpx;
display: block; display: block;
margin: 0 auto 40rpx; margin: 0 auto 40rpx;
} }
......
<block wx:if="{{loginType == 0}}"> <block wx:if="{{loginType == 0}}">
<view class="wx opacity-view"> <view class="wx opacity-view">
<view class="title"> <view class="title">
您好 您好
</view> </view>
<view class="subtitle"> <view class="subtitle">
欢迎登录生意助手 欢迎登录销售助手
</view> </view>
<image webp class="img" src="{{IMGURL}}login/login-2.webp" /> <image webp class="img" src="{{IMGURL}}login/login-2.webp" />
</view> </view>
</block> </block>
<block wx:else> <block wx:else>
<view class="box"> <view class="box">
<view class="input-box opacity-view"> <view class="input-box opacity-view">
<view class="title">{{loginType == 1?'手机号':'账号'}}登录</view> <view class="title">{{loginType == 1?'手机号':'账号'}}登录</view>
<block wx:if="{{loginType == 1}}"> <block wx:if="{{loginType == 1}}">
<view class="input"> <view class="input">
<input <input type="number" placeholder="填写手机号" placeholder-class="placeholder" bindinput="input" data-name="phone" value="{{formData.phone}}" maxlength="11" />
type="number" <input-icon show="{{formData.phone}}" bindtap="clear" data-name="phone" />
placeholder="填写手机号" </view>
placeholder-class="placeholder" <view class="input">
bindinput="input" <input type="number" placeholder="填写验证码" placeholder-class="placeholder" bindinput="input" data-name="code" value="{{formData.code}}" maxlength="4" />
data-name="phone" <input-icon show="{{formData.code}}" bindtap="clear" data-name="code" />
value="{{formData.phone}}" <button class="sms text-center " bindtap="getSmsCode" disabled="{{count || !phoneReady}}" loading="{{smsLoading}}">{{
maxlength="11" />
<input-icon show="{{formData.phone}}" bindtap="clear" data-name="phone" />
</view>
<view class="input">
<input
type="number"
placeholder="填写验证码"
placeholder-class="placeholder"
bindinput="input"
data-name="code"
value="{{formData.code}}"
maxlength="4" />
<input-icon show="{{formData.code}}" bindtap="clear" data-name="code" />
<button
class="sms text-center "
bindtap="getSmsCode"
disabled="{{count || !phoneReady}}"
loading="{{smsLoading}}">{{
count? count + 's':'获取验证码' count? count + 's':'获取验证码'
}} }}
</button> </button>
<block wx:if="{{smsError}}"> <block wx:if="{{smsError}}">
<view class="error">验证码错误</view> <view class="error">验证码错误</view>
</block> </block>
</view> </view>
</block> </block>
<block wx:else> <block wx:else>
<view class="input"> <view class="input">
<input <input type="text" placeholder="填写账号" placeholder-class="placeholder" bindinput="input" data-name="account" value="{{formData.account}}" maxlength="15" />
type="text" <input-icon show="{{formData.account}}" bindtap="clear" data-name="account" />
placeholder="填写账号" </view>
placeholder-class="placeholder" <view class="input">
bindinput="input" <input type="text" placeholder="填写密码" placeholder-class="placeholder" bindinput="input" data-name="password" value="{{formData.password}}" maxlength="20" password='{{!showPwd}}' />
data-name="account" <input-icon show bindtap="pwdSwitch" type="{{showPwd?'showPwd':'hidePwd'}}" />
value="{{formData.account}}" <input-icon show="{{formData.password}}" bindtap="clear" data-name="password" />
maxlength="15" /> </view>
<input-icon show="{{formData.account}}" bindtap="clear" data-name="account" /> </block>
</view> </view>
<view class="input"> </view>
<input
type="text"
placeholder="填写密码"
placeholder-class="placeholder"
bindinput="input"
data-name="password"
value="{{formData.password}}"
maxlength="20"
password='{{!showPwd}}' />
<input-icon show bindtap="pwdSwitch" type="{{showPwd?'showPwd':'hidePwd'}}" />
<input-icon show="{{formData.password}}" bindtap="clear" data-name="password" />
</view>
</block>
</view>
</view>
</block> </block>
<block wx:if="{{loginType == 0 &&agree}}"> <block wx:if="{{loginType == 0 &&agree}}">
<button <button class="button" disabled="{{disabled}}" hover-class="btn-hover" open-type="getPhoneNumber" bindgetphonenumber="wxLogin" loading="{{loading}}">授权登录
class="button" </button>
disabled="{{disabled}}"
hover-class="btn-hover"
open-type="getPhoneNumber"
bindgetphonenumber="wxLogin"
loading="{{loading}}">授权登录
</button>
</block> </block>
<block wx:else> <block wx:else>
<button <button class="button" disabled="{{disabled}}" hover-class="btn-hover" bindtap="login" loading="{{loading}}">授权登录
class="button" </button>
disabled="{{disabled}}"
hover-class="btn-hover"
bindtap="login"
loading="{{loading}}">登录
</button>
</block> </block>
<auth-setting bind:choose="authChoose" /> <auth-setting bind:choose="authChoose" />
<glsx-privacy appletName="生意助手" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy> <!-- 协议 -->
<!-- <auth-setting bind:choose="authChoose" agree="{{ agree }}" /> -->
<glsx-privacy appletName="生意助手" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
...@@ -13,7 +13,8 @@ Component({ ...@@ -13,7 +13,8 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
loginList: ['微信登录', '手机号', '账号密码'], // loginList: ['微信登录', '手机号', '账号密码'],
loginList: ['授权登录', '手机号',],
}, },
/** /**
...@@ -22,7 +23,7 @@ Component({ ...@@ -22,7 +23,7 @@ Component({
methods: { methods: {
changLoginType(e) { changLoginType(e) {
const thisPage = wx.$router.getPageInstance(), const thisPage = wx.$router.getPageInstance(),
loginType = e.currentTarget.dataset.index loginType = e.currentTarget.dataset.index
thisPage.setData({ thisPage.setData({
loginType loginType
}) })
......
<view class='tips'> <view class='tips'>
<view class='choose-box' bindtap="choose"> <view class='choose-box' bindtap="choose">
<view class='icon'> <view class='icon'>
<image src="{{agree?'./images/ok.png':'./images/box.png'}}" class='check-img' /> <image src="{{agree?'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/login_checked.png':'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/login_check.png'}}" class='check-img' />
</view> </view>
</view> </view>
阅读并同意以下协议 我已阅读并同意
<!-- <text catchtap="jump" data-url="agree">《服务协议》</text> --> <!-- <text catchtap="jump" data-url="agree">《服务协议》</text> -->
<text catchtap="jump" data-url="privacy">《隐私协议》</text> <text catchtap="jump" data-url="privacy">《隐私协议》</text>
<text catchtap="jump" data-url="agreement">《用户协议》</text> <text catchtap="jump" data-url="agreement">《用户协议》</text>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
left: 0; left: 0;
bottom: 40rpx; bottom: 40rpx;
font-size: 24rpx; font-size: 24rpx;
color: #999; color: #8F959E;
letter-spacing: 2rpx; letter-spacing: 2rpx;
padding-left: 28rpx; padding-left: 28rpx;
box-sizing: border-box; box-sizing: border-box;
...@@ -16,16 +16,16 @@ ...@@ -16,16 +16,16 @@
} }
.tips text { .tips text {
color: #ff600f; color: #5092FF;
} }
.tips .icon { .tips .icon {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
width: 24rpx; width: 28rpx;
height: 24rpx; height: 28rpx;
border-radius: 2rpx; border-radius: 50%;
box-sizing: border-box; box-sizing: border-box;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
} }
.tips .choose-box { .tips .choose-box {
width: 80rpx; width: 50rpx;
height: 80rpx; height: 50rpx;
position: relative; position: relative;
z-index: 10;
} }
\ No newline at end of file \ No newline at end of file
...@@ -3,29 +3,32 @@ ...@@ -3,29 +3,32 @@
padding: 0 80rpx; padding: 0 80rpx;
font-size: 24rpx; font-size: 24rpx;
color: #8A8C90; color: #8A8C90;
&::before { &::before {
content: ''; content: '';
width: 100%; width: 100%;
height: 264rpx; height: 800rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/bg-top.webp') no-repeat; background: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/sales-assistant/login/bg-top.webp') no-repeat;
background-size: 100% 264rpx; background-size: 100% 800rpx;
position: fixed; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
z-index: -1; z-index: -1;
} }
&::after { &::after {
content: ''; content: '';
width: 100%; width: 100%;
height: 472rpx; height: 472rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/bg-bottom.webp') no-repeat; // background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/bg-bottom.webp') no-repeat;
background-size: 100% 472rpx; // background-size: 100% 472rpx;
position: fixed; position: fixed;
left: 0; left: 0;
bottom: 0; bottom: 0;
z-index: -1; z-index: -1;
} }
} }
@keyframes opacity-view { @keyframes opacity-view {
0% { 0% {
opacity: 0; opacity: 0;
...@@ -37,6 +40,7 @@ ...@@ -37,6 +40,7 @@
transform: scale(1); transform: scale(1);
} }
} }
.button { .button {
width: 100% !important; width: 100% !important;
height: 88rpx; height: 88rpx;
...@@ -48,11 +52,13 @@ ...@@ -48,11 +52,13 @@
line-height: 88rpx; line-height: 88rpx;
padding: 0; padding: 0;
transition: all .1s; transition: all .1s;
&[disabled]:not([type]){
&[disabled]:not([type]) {
background: #CCCED1 !important; background: #CCCED1 !important;
color: #fff !important; color: #fff !important;
} }
} }
.btn-hover { .btn-hover {
opacity: .75; opacity: .75;
} }
\ No newline at end of file \ No newline at end of file
...@@ -8,7 +8,7 @@ const setRouteData = targetPath => { ...@@ -8,7 +8,7 @@ const setRouteData = targetPath => {
console.log(query, 'query'); console.log(query, 'query');
if (query) { if (query) {
var list = query.split('&') || [] var list = query.split('&') || []
console.log(list,list); console.log(list, list);
list.forEach(item => { list.forEach(item => {
const [key, val] = item.split('=') const [key, val] = item.split('=')
obj[key] = val obj[key] = val
...@@ -21,58 +21,58 @@ const setRouteData = targetPath => { ...@@ -21,58 +21,58 @@ const setRouteData = targetPath => {
} }
} }
/**选择账号登录 */ /**选择账号登录 */
const selectAccountLogin = ({ id, sessionId }) => { // const selectAccountLogin = ({ id, sessionId }) => {
USERAPI.selectAccountLogin({ // USERAPI.selectAccountLogin({
id, // id,
sessionId // sessionId
}).then(({ code, data, message }) => { // }).then(({ code, data, message }) => {
console.log(code, 'selectAccountLogin'); // console.log(code, 'selectAccountLogin');
if (code == '0') { // if (code == '0') {
console.log(data) // console.log(data)
setLoginInfo(data.loginUserInfoList[0], data.sessionId) // setLoginInfo(data.loginUserInfoList[0], data.sessionId)
} else wx.$api.showToast(message || '系统异常') // } else wx.$api.showToast(message || '系统异常')
}) // })
} // }
/**设置登录信息 */ /**设置登录信息 */
const setLoginInfo = (userInfo, sessionId) => { const setLoginInfo = (userInfo, sessionId) => {
if (!userInfo) { // if (!userInfo) {
wx.$api.showToast('仅支持服务商类型账户登录') // wx.$api.showToast('仅支持服务商类型账户登录')
return // return
} // }
console.log('wx.$router.getPageInstance()', wx.$router.getPageInstance()); console.log('wx.$router.getPageInstance()', wx.$router.getPageInstance());
const { // const {
options: { reportDate }, // options: { reportDate },
options // options
} = wx.$router.getPageInstance() // } = wx.$router.getPageInstance()
// 跳转别的小程序 // // 跳转别的小程序
// debugger // // debugger
if (reportDate) { // if (reportDate) {
let params = `approvedBy=${userInfo.name}&` // let params = `approvedBy=${userInfo.name}&`
for (const key in options) { // for (const key in options) {
params += `${key}=${options[key]}&` // params += `${key}=${options[key]}&`
} // }
console.log(params); // console.log(params);
return wx.navigateToMiniProgram({ // return wx.navigateToMiniProgram({
appId: 'wx570d9331f9ace0bd', // appId: 'wx570d9331f9ace0bd',
path: options.page == 'upgradeStaffDaily' ? `tabWorkOrder/pages/upgradeStaffDaily/upgradeStaffDaily?${params}` : `tabWorkOrder/pages/staffDaily/staffDaily?${params}`, // path: options.page == 'upgradeStaffDaily' ? `tabWorkOrder/pages/upgradeStaffDaily/upgradeStaffDaily?${params}` : `tabWorkOrder/pages/staffDaily/staffDaily?${params}`,
envVersion: 'trial', // envVersion: 'trial',
success(res) { // success(res) {
// 打开成功 // // 打开成功
} // }
}) // })
} // }
// debugger // debugger
// 自动创建服务中心 // 自动创建服务中心
initServiceCenter() // initServiceCenter()
setUserInfo(userInfo) setUserInfo(userInfo)
// debugger // debugger
setSessionId(sessionId) setSessionId(sessionId)
loginSuccess() loginSuccess()
} }
const initServiceCenter = () => { // const initServiceCenter = () => {
USERAPI.initServiceCenter({}) // USERAPI.initServiceCenter({})
} // }
/**成功跳转 */ /**成功跳转 */
const loginSuccess = () => { const loginSuccess = () => {
const { const {
...@@ -103,23 +103,23 @@ const loginModal = async ({ message, confirmText, cancelText }) => { ...@@ -103,23 +103,23 @@ const loginModal = async ({ message, confirmText, cancelText }) => {
const checkLoginUserInfo = ({ loginUserInfoList, sessionId }) => { const checkLoginUserInfo = ({ loginUserInfoList, sessionId }) => {
const thisPage = wx.$router.getPageInstance() const thisPage = wx.$router.getPageInstance()
/**多个账号 */ /**多个账号 */
if (loginUserInfoList.length > 1) // if (loginUserInfoList.length > 1)
wx.$router.go('login.accountItems', { // wx.$router.go('login.accountItems', {
sessionId, // sessionId,
...thisPage.options // ...thisPage.options
}) // })
/**只有一个账号 */ else // /**只有一个账号 */ else
selectAccountLogin({ // selectAccountLogin({
id: loginUserInfoList[0].uuid, // id: loginUserInfoList[0].uuid,
sessionId // sessionId
}) // })
} }
module.exports = { module.exports = {
checkLoginUserInfo, checkLoginUserInfo,
selectAccountLogin, // selectAccountLogin,
loginSuccess, loginSuccess,
setRouteData, setRouteData,
setLoginInfo, setLoginInfo,
loginModal, loginModal,
initServiceCenter // initServiceCenter
} }
...@@ -97,25 +97,26 @@ Page({ ...@@ -97,25 +97,26 @@ Page({
init() { init() {
wx.nextTick(() => { wx.nextTick(() => {
const sessionId = getSessionId(), const sessionId = getSessionId()
{ url, targetPath = url ? decodeURIComponent(url) : '', reportDate } = this.options // { url, targetPath = url ? decodeURIComponent(url) : '', reportDate } = this.options
let path = 'pages.index', let path = 'pages.index',
obj = {} obj = {}
if (targetPath) obj.targetPath = targetPath // if (targetPath) obj.targetPath = targetPath
// 如果是日报跳转进来的 // // 如果是日报跳转进来的
if (reportDate) { // if (reportDate) {
obj = { // obj = {
...obj, // ...obj,
...this.options // ...this.options
} // }
} // }
console.log(sessionId, 'sessionId');
if (sessionId) { if (sessionId) {
USERAPI.checkSession().then(({ code }) => { USERAPI.checkSession().then(({ code }) => {
if (code == '0') { if (code == '0') {
if (targetPath) { // if (targetPath) {
path = setRouteData(targetPath).url // path = setRouteData(targetPath).url
obj = setRouteData(targetPath).obj // obj = setRouteData(targetPath).obj
} // }
wx.$router.reLaunch(path, obj) wx.$router.reLaunch(path, obj)
} else this.autoLogin(obj) } else this.autoLogin(obj)
}) })
...@@ -125,29 +126,34 @@ Page({ ...@@ -125,29 +126,34 @@ Page({
autoLogin(obj) { autoLogin(obj) {
const autoLoginObject = wx.$storage.get('auto_login_object') const autoLoginObject = wx.$storage.get('auto_login_object')
if (autoLoginObject) { if (autoLoginObject) {
const { failureTime, userName, password } = autoLoginObject const { noSignInUuid } = autoLoginObject
if (Date.now() < failureTime) { // if (Date.now() < failureTime) {
USERAPI.accountLogin({ USERAPI.noSignInLogin({
userName, noSignInUuid
password }).then(async ({ data, code, message }) => {
}).then(async ({ data, code, message }) => { // debugger
if (code == '0' && data.loginUserInfoList.length) { if (code == '0') {
const { sessionId, loginUserInfoList } = data const { sessionId, } = data
setLoginInfo(loginUserInfoList[0], sessionId) setLoginInfo(data, sessionId)
} else { } else {
try { try {
const reload = await loginModal({ const reload = await loginModal({
message: data.loginUserInfoList.length ? message : '登录失败请重试', message: message ? message : '登录失败请重试',
cancelText: '返回' cancelText: '返回',
}) confirmText: '确认'
if (reload) this.onShow() })
} catch (error) { if (reload) {
wx.$storage.rm('auto_login_object') wx.$storage.rm('auto_login_object')
wx.$router.reLaunch('login.index', obj) wx.$router.reLaunch('login.index', obj)
} }
} catch (error) {
console.log(`error`, error);
wx.$storage.rm('auto_login_object')
wx.$router.reLaunch('login.index', obj)
} }
}) }
} else wx.$router.reLaunch('login.index', obj) })
// } else wx.$router.reLaunch('login.index', obj)
} else wx.$router.reLaunch('login.index', obj) } else wx.$router.reLaunch('login.index', obj)
}, },
phoneSmsLogin(extraData) { phoneSmsLogin(extraData) {
......
// packageMine/pages/setting/setting.js
import USERAPI from '~/api/usersApi/index'
Page({
/**
* 页面的初始数据
*/
data: {
},
jump(e) {
console.log(e)
let { url } = e.currentTarget.dataset
const baseUrl = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/html/'
const path = `${baseUrl}${url}.html`
// private user
wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(path)}`
})
},
logout() {
let _this = this
wx.showModal({
title: '退出登录确认',
content: '您确定要退出销售助手小程序?',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
// _this.showLoading()
wx.$api.showLoading()
USERAPI.logout().then(_res_ => {
// wx.$storage.rm('fileList')
wx.$storage.rm('sessionId')
wx.$storage.rm('userInfo')
wx.$storage.rm('auto_login_object')
wx.$router.reLaunch('login.index')
})
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "设置",
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/setting/setting.wxss */
page {
background: #f7f8fa;
}
.item.flex {
display: flex;
}
.set_box {
// margin: 20rpx;
// margin-top: 48rpx;
// background: #FFFFFF;
// border-radius: 16rpx;
display: flex;
flex-direction: column;
}
.set_box .set_item {
box-sizing: border-box;
/* width: 344rpx;
height: 168rpx; */
width: 100%;
height: 104rpx;
padding: 24rpx 32rpx;
display: flex;
align-items: center;
margin-top: 8rpx;
background: #FFFFFF;
color: #292d33;
font-size: 28rpx;
}
.set_box .icon_image {
width: 32rpx;
height: 32rpx;
margin-left: auto;
/* position: absolute;
right: 0;
bottom: 0; */
}
.logoutBtn {
position: fixed;
bottom: 176rpx;
left: 50%;
transform: translateX(-50%);
// font-size: 28rpx !important;
// color: #8A8C90 !important;
color: #ffffff !important;
font-size: 32rpx !important;
font-weight: 400 !important;
// border: 2rpx solid #EEEEEE !important;
// background-color: #fff !important;
width: 686rpx;
height: 88rpx;
border-radius: 12rpx;
line-height: 88rpx;
background: #347bff !important;
}
\ No newline at end of file \ No newline at end of file
<!--packageMine/pages/setting/setting.wxml-->
<!-- <text>packageMine/pages/setting/setting.wxml</text> -->
<view class="set_box">
<view class="set_item " catchtap="jump" data-url="privacy">
<view class="title">隐私协议
</view>
<image class="icon_image" src="../../images/right.png" mode="" />
</view>
<view class="set_item " catchtap="jump" data-url="agreement">
<view class="title">用户协议
</view>
<image class="icon_image" src="../../images/right.png" mode="" />
</view>
</view>
<button class="logoutBtn" size="default" type="default" isabled="{{false}}" loading="{{false}}" bindtap="logout" hover-class="button-hover">
退出登录
</button>
\ No newline at end of file \ No newline at end of file
// packageTool/pages/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{ {
"component": true,
"usingComponents": {} "usingComponents": {}
} }
\ No newline at end of file \ No newline at end of file
/* packageTool/pages/index/index.wxss */
\ No newline at end of file \ No newline at end of file
<!--packageTool/pages/index/index.wxml-->
<text>packageTool/pages/index/index.wxml</text>
\ No newline at end of file \ No newline at end of file
// packageTool/pages/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageTool/pages/index/index.wxss */
\ No newline at end of file \ No newline at end of file
<!--packageTool/pages/index/index.wxml-->
<text>packageTool/pages/index/index.wxml</text>
\ No newline at end of file \ No newline at end of file
// pages/tab/mine/mine.js // pages/tab/mine/mine.js
// import { IMG_URL } from '~/utils/constantData'
import USERAPI from '~/api/usersApi/index'
import mineApi from '~/api/mineApi/index'
const IMAGES = Object.freeze({
icon0: `personal/icon1.png`,
icon1: `personal/icon2.png`,
icon2: `personal/icon3.png`,
icon3: `personal/icon4.png`,
icon4: `personal/icon5.png`,
icon5: `personal/icon6.png`,
userAvatarUrl: `/personal/userAvatarUrl.png`
})
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
navStyle: 'background-color: rgba(0,0,0,0);',
IMAGES,
// isRead: false,
test: `/personal/icon2.png`,
boxItemList: [
{
name: '消息盒子',
path: 'packageMine.messageBox',
hasRedPot: true,
isRead: false
}
],
isShowService: false
},
navSetting() {
wx.$router.go('packageMine.setting')
},
navGOMiniProgram() {
let { userInfo } = this.data
wx.$api.showLoading()
USERAPI.canOpenBusinessCard().then(_res_ => {
wx.hideLoading()
let { merchantId, cardId } = _res_
// let params = `merchantId=${userInfo.merchantIdList[0]}&cardId=976`
if (merchantId && cardId) {
let params = `merchantId=${merchantId}&cardId=${cardId}`
return wx.navigateToMiniProgram({
appId: 'wx1bd947039419e6ce',
path: `pages/tab/index/index?${params}`,
envVersion: 'trial',
success(res) {
// 打开成功
}
})
} else {
wx.showModal({
title: '',
content: '您当前暂未配置智能名片请联系总部业务督导帮您开通此功能',
showCancel: false,
confirmText: '我知道了',
confirmColor: '#292D33',
success(res) { }
})
}
})
},
navGO(e) {
let { path, item } = e.currentTarget.dataset
console.log(item)
wx.$router.go(path)
},
logout() {
let _this = this
wx.showModal({
title: '温馨提示',
content: '是否退出当前账号?',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
// _this.showLoading()
wx.$api.showLoading()
USERAPI.logout().then(_res_ => {
const fn = wx.getFileSystemManager()
fn.readdir({
dirPath: wx.env.USER_DATA_PATH,
success({ files }) {
files.length &&
files.map(e => {
fn.unlink({
filePath: `${wx.env.USER_DATA_PATH}/${e}`
})
})
}
})
// wx.$storage.rm('fileList')
wx.$storage.rm('sessionId')
wx.$storage.rm('userInfo')
wx.$storage.rm('auto_login_object')
wx.$storage.rm('posterId')
wx.$storage.rm('mock_data')
wx.$router.reLaunch('login.index')
})
}
}
})
}, },
navbarReady(e) { navbarReady(e) {
let { height, statusBarHeight } = e.detail let { height, statusBarHeight } = e.detail
...@@ -12,7 +109,8 @@ Page({ ...@@ -12,7 +109,8 @@ Page({
tabBarStyle: height / 2 + statusBarHeight tabBarStyle: height / 2 + statusBarHeight
}) })
console.log(e) console.log(e)
},mp(e) { },
jump(e) {
console.log(e) console.log(e)
let { url } = e.currentTarget.dataset let { url } = e.currentTarget.dataset
const baseUrl = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/html/' const baseUrl = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/html/'
...@@ -39,7 +137,15 @@ Page({ ...@@ -39,7 +137,15 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: async function (options) { onLoad: async function (options) {
let { userInfo } = wx.$storage.get()
let serviceMerchantId = userInfo.subLoginUser?.merchantId
//解决因为使用await 异步导致数据没同步已经开始调用onshow方法
this.setData({
serviceMerchantId,
// userInfo: userInfo.subLoginUser
userInfo
})
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
...@@ -49,9 +155,7 @@ Page({ ...@@ -49,9 +155,7 @@ Page({
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () { },
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
......
{ {
"navigationStyle": "custom",
"usingComponents": {} "usingComponents": {}
} }
...@@ -38,9 +38,9 @@ page { ...@@ -38,9 +38,9 @@ page {
&::after { &::after {
content: ''; content: '';
width: 100%; width: 100%;
height: 486rpx; height: 800rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/personal/bg.webp') no-repeat; background: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/sales-assistant/personal/bg.webp') no-repeat;
background-size: 100% 486rpx; background-size: 100% 800rpx;
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
...@@ -55,36 +55,42 @@ page { ...@@ -55,36 +55,42 @@ page {
} }
.userInfoCon { .userInfoCon {
height: 360rpx; box-sizing: border-box;
padding: 20rpx 40rpx 48rpx;
height: 160rpx;
display: flex; display: flex;
flex-direction: column; // flex-direction: column;
align-items: center; align-items: center;
justify-content: center; // justify-content: center;
.headPortrait { .headPortrait {
width: 128rpx; width: 80rpx;
height: 128rpx; height: 80rpx;
// border-radius: 64rpx; // border-radius: 64rpx;
// border: 2rpx solid #fff; // border: 2rpx solid #fff;
} }
.right {
margin-left: 20rpx;
}
.name { .name {
font-weight: 600; font-weight: 600;
font-size: 32rpx; font-size: 32rpx;
color: #323436; color: #0a0d14;
margin: 16rpx 0; // margin: 16rpx 0;
text-align-last: left;
} }
.id { .id {
font-size: 28rpx; font-size: 28rpx;
color: #323436; color: #3f444d;
} }
.createTime { .setting {
font-family: PingFangSC-Regular; width: 40rpx;
font-size: 24rpx; height: 40rpx;
color: #8A8C90; margin-left: auto;
margin-top: 16rpx;
} }
} }
...@@ -96,29 +102,34 @@ page { ...@@ -96,29 +102,34 @@ page {
} }
.boxItemCon { .boxItemCon {
width: 710rpx;
height: 178rpx;
border-radius: 16rpx;
// opacity: 1;
// border: 2rpx solid #979797;
background: #ffffff;
margin: 0 auto;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
// align-items: center;
// padding: 0 10rpx; // padding: 0 10rpx;
.item { .item {
// margin-left: 66rpx;
// margin-top: 32rpx;
// height: 96rpx;
// width: 96rpx;
width: 25%; width: 25%;
margin-top: 32rpx; margin-top: 28rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
.img {
width: 72rpx;
height: 72rpx;
}
.imgcon { .imgcon {
position: relative; position: relative;
.img {
width: 96rpx;
height: 96rpx;
}
.redPot { .redPot {
width: 12rpx; width: 12rpx;
...@@ -151,6 +162,8 @@ page { ...@@ -151,6 +162,8 @@ page {
font-size: 24rpx; font-size: 24rpx;
color: #323436; color: #323436;
margin-top: 8rpx; margin-top: 8rpx;
color: #0a0d14;
font-size: 24rpx;
} }
} }
} }
......
<!--pages/tab/mine/mine.wxml-->
<text>pages/tab/mine/mine.wxml</text>
\ No newline at end of file \ No newline at end of file
<!-- pages/tab/output/output.wxml -->
<navigation-bar navStyle="{{ navStyle }}" bindnavbarReady="navbarReady">我的账号</navigation-bar>
<view class="layout" style="padding-top:{{ tabBarStyle }}px;">
<view class="userInfoCon">
<glsx-image class="headPortrait" src="{{ userInfo.userAvatarUrl||IMAGES.userAvatarUrl }}" webp>头像</glsx-image>
<view class="right">
<view class="name">{{userInfo.name}}</view>
<view class="id phone">{{userInfo.phone}}</view>
</view>
<glsx-image class="setting" src="{{ '/personal/setting.png' }}" webp bind:tap="navSetting"></glsx-image>
</view>
<!-- <view class="utilBoxTitle">常用工具</view> -->
<view class="boxItemCon">
<!-- wx:for="{{boxItemList}}" wx:key="index" class="{{item.isHide ? '': 'item'}}" data-path="{{item.path}}" data-item="{{item}}"-->
<view bind:tap="navGOMiniProgram" class="item">
<glsx-image class="img" src="{{ '/personal/posterCard.png' }}" />
<view class="name">我的名片</view>
</view>
<!-- <view class="update" bindtap="jump">
<view class="icon">
<glsx-image class="logo" webp src="store-assistant/menu/log.png"></glsx-image>
</view>
更新日志
<block wx:if="{{versionData.isNew}}">
<view class="new">NEW</view>
</block>
<view class="arrow">
<glsx-image class="logo" webp src="store-assistant/menu/log-arrow.png"></glsx-image>
</view>
</view> -->
</view>
<!-- <button class="logoutBtn" size="default" type="default" isabled="{{false}}" loading="{{false}}" bindtap="logout" hover-class="button-hover">
退出登录
</button> -->
<!-- <view class="message-box">
<text catchtap="jump" data-url="privacy">《隐私协议》</text>
和
<text catchtap="jump" data-url="agreement">《用户协议》</text>
</view> -->
</view>
<!-- 加微 -->
<service wx:if="{{ isShowService }}"></service>
\ No newline at end of file \ No newline at end of file
// pages/tab/tool/tool.js // pages/tab/tool/tool.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
toolsList: [{ name: '销售日报', url: '/pages/tool/qrcode/qrcode' }]
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {},
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {},
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {},
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {},
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {},
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh() {},
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { onReachBottom() {},
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
onShareAppMessage() {}
})
{ {
"navigationBarTitleText": "工具",
"usingComponents": {} "usingComponents": {}
} }
\ No newline at end of file \ No newline at end of file
/* pages/tab/tool/tool.wxss */
\ No newline at end of file \ No newline at end of file
/* pages/tab/tool/tool.wxss */
// .main {
// background: #f7f8fa;
// }
page {
background: #f7f8fa;
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/tool/tool.wxml--> <!--pages/tab/tool/tool.wxml-->
<text>pages/tab/tool/tool.wxml</text>
\ No newline at end of file \ No newline at end of file
<view class="main">
<view class="title">我的工具</view>
<view class="tools">
<view class="list" wx:for="{{ toolsList }}" wx:key="index">
<!-- <view class="icon">{{item}}</view> -->
<img src="{{ item.imgurl }}" alt="" />
<view class="label">{{item.name}}</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,8 @@ import { preReleaseAppId } from '~/config' ...@@ -2,7 +2,8 @@ import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease'] const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
const mockObj = { const mockObj = {
test: 'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=business-assistant-config&env=test', test: 'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=business-assistant-config&env=test',
product: 'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=business-assistant-config&env=production' product:
'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=business-assistant-config&env=production'
} }
// const mockObj = { // const mockObj = {
// test: 'https://oss-config.dev.glsx.com.cn/mock/63fd6c2034c4d918e2f4df4d/config', // test: 'https://oss-config.dev.glsx.com.cn/mock/63fd6c2034c4d918e2f4df4d/config',
...@@ -29,7 +30,7 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -29,7 +30,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false const manual = false
const release = false const release = false
let index = 2 let index = 0
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
...@@ -115,7 +116,7 @@ const djSecretKey = { ...@@ -115,7 +116,7 @@ const djSecretKey = {
const domain = { const domain = {
ip: { ip: {
// dj: 'http://192.168.1.165:8292', // dj: 'http://192.168.1.165:8292',
dj: 'http://192.168.1.170:8292', dj: 'http://192.168.3.189:8385',
scrm: 'http://192.168.1.165:8292' scrm: 'http://192.168.1.165:8292'
}, },
dev: { dev: {
...@@ -153,7 +154,8 @@ const pathEnum = { ...@@ -153,7 +154,8 @@ const pathEnum = {
busassistant: '/rop-scrm-busassistant/', busassistant: '/rop-scrm-busassistant/',
assistant: '/rop-scrm-stoassistant/', assistant: '/rop-scrm-stoassistant/',
smartcarlife: '/rop-dj-car-boutique/', smartcarlife: '/rop-dj-car-boutique/',
djsmart: '/rop-dj-smartcarlife/' djsmart: '/rop-dj-smartcarlife/',
sale: '/rop-dj-sale/'
} }
const defaultMerchantId = { const defaultMerchantId = {
ip: '44184606', ip: '44184606',
......
...@@ -10,7 +10,7 @@ class Request { ...@@ -10,7 +10,7 @@ class Request {
// console.log(requestPath, 'requestPath') // console.log(requestPath, 'requestPath')
return this.request('POST', params, returnAll, requestPath) return this.request('POST', params, returnAll, requestPath)
} }
async request(RequestMethods, params, returnAll, requestPath = 'scrm') { async request(RequestMethods, params, returnAll, requestPath = 'dj') {
const type = await network.getNetworkType() const type = await network.getNetworkType()
if (type == 'none') return if (type == 'none') return
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -18,8 +18,8 @@ class Request { ...@@ -18,8 +18,8 @@ class Request {
let header = let header =
RequestMethods === 'POST' RequestMethods === 'POST'
? { ? {
'content-type': 'application/x-www-form-urlencoded' 'content-type': 'application/x-www-form-urlencoded'
} }
: {} : {}
let projectName = params.apiProjectName || this.getRopProject(params.method) let projectName = params.apiProjectName || this.getRopProject(params.method)
// console.log(projectName, 'projectName') // console.log(projectName, 'projectName')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!