Commit 55f7adf6 by 张立顺

feat 功能开发

1 parent 09c52b14
import api from '~/utils/request/request'
const {
appId
} = wx.getAccountInfoSync().miniProgram
const { appId } = wx.getAccountInfoSync().miniProgram
const CODE = {
platformEntrance: 'BUSINESS_ASSISTANT',
platformEntrance: 'SALES_ASSISTANT',
productCode: 'PC00c3'
}
class UsersApi {
......@@ -11,12 +9,12 @@ class UsersApi {
async wxCodeLogin() {
const appEnter = wx.getEnterOptionsSync()
try {
if (appEnter.scene === 1154 && appEnter.mode === 'singlePage') throw 'login:fail rejected due to no permission currently'
const {
code
} = await this.getWxCode()
return await api.post({
method: 'scrm.api.sso.wechat.applets.jscode.login',
if (appEnter.scene === 1154 && appEnter.mode === 'singlePage')
throw 'login:fail rejected due to no permission currently'
const { code } = await this.getWxCode()
return await api.post(
{
method: 'dj.api.sale.login.jscode.login',
appId,
code
},
......@@ -29,8 +27,9 @@ class UsersApi {
}
/**退出登录 */
logout() {
return api.post({
method: 'scrm.api.sso.wechat.applets.logout'
return api.post(
{
method: 'dj.api.sale.login.logout'
},
true
)
......@@ -51,12 +50,14 @@ class UsersApi {
Promise.reject()
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
if (detail.iv && detail.encryptedData) {
detail.loginToken = loginToken
return api.post({
method: 'scrm.api.sso.wechat.applets.auth.phone',
return api.post(
{
method: 'dj.api.sale.login.auth.phone',
...detail,
platformEntrance: 'BUSINESS_ASSISTANT' // 平台标识:生意助手-BUSINESS_ASSISTANT,门店助手-STORE_ASSISTANT
},
......@@ -66,7 +67,8 @@ class UsersApi {
}
/**账号密码登录 */
async accountLogin(data = {}) {
return api.post({
return api.post(
{
method: 'scrm.api.sso.wechat.applets.password.login',
...data,
...CODE
......@@ -76,8 +78,9 @@ class UsersApi {
}
/** 手机号获取短信验证码 */
getSmsCode(mobile) {
return api.post({
method: 'scrm.api.sso.wechat.applets.sms.get.code',
return api.post(
{
method: 'dj.api.sale.login.get.sms.code',
mobile
},
true
......@@ -85,8 +88,9 @@ class UsersApi {
}
/** 手机号短信验证码登录 */
phoneSmsLogin(data = {}) {
return api.post({
method: 'scrm.api.sso.wechat.applets.sms.login',
return api.post(
{
method: 'dj.api.sale.login.sms.login',
...data,
source: 'MINIAPP',
platformEntrance: 'BUSINESS_ASSISTANT'
......@@ -96,7 +100,8 @@ class UsersApi {
}
/** 获取登录账号列表 */
getAccountList(sessionId) {
return api.post({
return api.post(
{
method: 'scrm.api.sso.wechat.applets.listSelectAccount',
...CODE,
sessionId
......@@ -107,7 +112,8 @@ class UsersApi {
/**
* 选择账号登录(手机绑定多个账号时) */
selectAccountLogin(data) {
return api.post({
return api.post(
{
method: 'scrm.api.sso.wechat.applets.selectAccountLogin',
...CODE,
...data
......@@ -117,15 +123,17 @@ class UsersApi {
}
/**检查sessionId 是否过期 */
checkSession() {
return api.post({
method: 'scrm.api.sso.login.status.check'
return api.post(
{
method: 'dj.api.sale.login.getLoginInfo'
},
true
)
}
/** 超级管理员切换账号 */
adminSelectLogin(data) {
return api.post({
return api.post(
{
method: 'scrm.api.sso.super.administrator.select.login',
...CODE,
...data
......@@ -150,12 +158,13 @@ class UsersApi {
return data
} else return wx_user_info
}
/** 手机号授权解析(单纯解析内容返回前端)
/** 手机号授权解析(单纯解析内容返回前端)
* 只传loginToken就返回unionId和openid
* 传加密信息就解析手机号
*/
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
if (!loginToken) {
let res = await this.wxCodeLogin()
......@@ -168,15 +177,30 @@ class UsersApi {
platformEntrance: 'BUSINESS_ASSISTANT'
})
}
// 登录自动创建服务中心
initServiceCenter(data) {
// 免密授权码登录
async noSignInLogin(data = {}) {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.init',
...data
}
method: 'dj.api.sale.login.noSignIn.login',
...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
export default UsersApi
{
"pages": [
"login/loading/loading",
"pages/tab/index/index",
"pages/tab/mine/mine",
"pages/webView/webView",
"login/index/index",
"pages/tab/customer/customer",
"pages/tab/tool/tool"
],
"requiredPrivateInfos": [
"getLocation",
"chooseLocation"
],
"lazyCodeLoading": "requiredComponents",
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
},
"tabBar": {
"color": "#999EA8",
"selectedColor": "#347BFF",
"backgroundColor": "#FFFFFF",
"borderStyle": "white",
"list": [
{
"pagePath": "pages/tab/index/index",
"text": "首页",
"iconPath": "images/home.png",
"selectedIconPath": "images/home-active.png"
},
{
"pagePath": "pages/tab/customer/customer",
"text": "客户",
"iconPath": "images/customer.png",
"selectedIconPath": "images/customer-active.png"
},
{
"pagePath": "pages/tab/tool/tool",
"text": "工具",
"iconPath": "images/tool.png",
"selectedIconPath": "images/tool-active.png"
},
{
"pagePath": "pages/tab/mine/mine",
"text": "我的",
"iconPath": "images/mine.png",
"selectedIconPath": "images/mine-active.png"
}
]
},
"subpackages": [
{
"root": "packageIndex/pages",
"name": "packageIndex",
"pages": [
"index/index"
]
},
{
"root": "packageCustomer/pages",
"name": "packageCustomer",
"pages": [
"potentialDetail/potentialDetail",
"createVisit/createVisit",
"resultFeedback/resultFeedback",
"createPotential/createPotential"
]
},
{
"root": "packageTool/pages",
"name": "packageTool",
"pages": [
"index/index"
]
},
{
"root": "packageMine/pages",
"name": "packageMine",
"pages": []
}
],
"preloadRule": {},
"usingComponents": {
"tab": "/components/Tab/Tab",
"navigation-bar": "/components/NavigationBar/NavigationBar",
"popup": "/components/Popup/Popup",
"nothing-tips": "/components/Nothing-tips/nothingTips",
"crowdfund-poster": "/components/CrowdfundPoster/CrowdfundPoster",
"glsx-image": "/components/image/index",
"no-product": "/components/NoProduct/index",
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index",
"van-popup": "@vant/weapp/popup/index"
},
"resolveAlias": {
"~/*": "/*"
},
"sitemapLocation": "sitemap.json",
"__usePrivacyCheck__": true,
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
{
"pages": [
"login/loading/loading",
"pages/tab/index/index",
"pages/tab/mine/mine",
"pages/webView/webView",
"login/index/index",
"pages/tab/customer/customer",
"pages/tab/tool/tool"
],
"requiredPrivateInfos": [
"getLocation",
"chooseLocation"
],
"lazyCodeLoading": "requiredComponents",
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
},
"tabBar": {
"color": "#999EA8",
"selectedColor": "#347BFF",
"backgroundColor": "#FFFFFF",
"borderStyle": "white",
"list": [
{
"pagePath": "pages/tab/index/index",
"text": "首页",
"iconPath": "images/home.png",
"selectedIconPath": "images/home-active.png"
},
{
"pagePath": "pages/tab/customer/customer",
"text": "客户",
"iconPath": "images/customer.png",
"selectedIconPath": "images/customer-active.png"
},
{
"pagePath": "pages/tab/tool/tool",
"text": "工具",
"iconPath": "images/tool.png",
"selectedIconPath": "images/tool-active.png"
},
{
"pagePath": "pages/tab/mine/mine",
"text": "我的",
"iconPath": "images/mine.png",
"selectedIconPath": "images/mine-active.png"
}
]
},
"subpackages": [
{
"root": "packageIndex/pages",
"name": "packageIndex",
"pages": [
"index/index"
]
},
{
"root": "packageCustomer/pages",
"name": "packageCustomer",
"pages": [
"potentialDetail/potentialDetail",
"createVisit/createVisit",
"resultFeedback/resultFeedback",
"createPotential/createPotential"
]
},
{
"root": "packageTool/pages",
"name": "packageTool",
"pages": [
"index/index",
"salesDailyReport/index",
"salesReport/index"
]
},
{
"root": "packageMine/pages",
"name": "packageMine",
"pages": [
"setting/setting"
]
}
],
"preloadRule": {},
"usingComponents": {
"tab": "/components/Tab/Tab",
"navigation-bar": "/components/NavigationBar/NavigationBar",
"popup": "/components/Popup/Popup",
"nothing-tips": "/components/Nothing-tips/nothingTips",
"crowdfund-poster": "/components/CrowdfundPoster/CrowdfundPoster",
"glsx-image": "/components/image/index",
"no-product": "/components/NoProduct/index",
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index",
"van-popup": "@vant/weapp/popup/index"
},
"resolveAlias": {
"~/*": "/*"
},
"sitemapLocation": "sitemap.json",
"__usePrivacyCheck__": true,
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
}
\ 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
/* 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
......@@ -174,21 +174,24 @@ Component({
// debugger
if (code == '0') {
const thisPage = wx.$router.getPageInstance()
if (loginType == 1) checkLoginUserInfo(data)
else {
const { autoLogin } = thisPage.data,
{ sessionId, loginUserInfoList } = data,
validTime = 3600 * 24 * 7 * 1e3,
autoLoginFailureTime = Date.now() + validTime
if (autoLogin && loginUserInfoList[0]) {
wx.$storage.set('auto_login_object', {
failureTime: autoLoginFailureTime,
userName: formData.account,
password: md5(formData.password)
})
} else wx.$storage.rm('auto_login_object')
setLoginInfo(loginUserInfoList[0], sessionId)
}
if (loginType == 1) setLoginInfo(data, data.sessionId)
wx.$storage.set('auto_login_object', {
noSignInUuid: data.noSignInUuid
})
// else {
// const { autoLogin } = thisPage.data,
// { sessionId, loginUserInfoList } = data,
// validTime = 3600 * 24 * 7 * 1e3,
// autoLoginFailureTime = Date.now() + validTime
// if (autoLogin && loginUserInfoList[0]) {
// wx.$storage.set('auto_login_object', {
// failureTime: autoLoginFailureTime,
// userName: formData.account,
// password: md5(formData.password)
// })
// } else wx.$storage.rm('auto_login_object')
// setLoginInfo(loginUserInfoList[0], sessionId)
// }
} else {
if (loginType == 1)
this.setData({
......@@ -213,8 +216,12 @@ Component({
this.setBtnLoading()
USERAPI.authUserPhone(detail, this.loginToken)
.then(({ code, data, message }) => {
if (code == '0') checkLoginUserInfo(data)
else {
if (code == '0') {
setLoginInfo(data, data.sessionId)
wx.$storage.set('auto_login_object', {
noSignInUuid: data.noSignInUuid
})
} else {
wx.$api.showToast(message || '系统异常')
this.init()
}
......
/* login/index/components/LoginBox.wxss */
.wx {
// height: 922rpx;
height: 63vh;
.title {
width: 378rpx;
// margin: 0 40rpx;
font-weight: 600;
font-size: 60rpx;
color: #323436;
// padding: 216rpx 0 24rpx;
padding: 13vh 0 24rpx;
padding: 20vh 115rpx 24rpx;
// text-align: left;
}
.subtitle {
font-size: 44rpx;
color: #323436;
margin-bottom: 120rpx;
margin-bottom: 76rpx;
color: #181a1f;
font-size: 48rpx;
text-align: center;
}
.img {
width: 378rpx;
height: 364rpx;
height: 378rpx;
display: block;
margin: 0 auto 40rpx;
}
......
<block wx:if="{{loginType == 0}}">
<view class="wx opacity-view">
<view class="title">
您好
</view>
<view class="subtitle">
欢迎登录生意助手
</view>
<image webp class="img" src="{{IMGURL}}login/login-2.webp" />
</view>
<view class="wx opacity-view">
<view class="title">
您好
</view>
<view class="subtitle">
欢迎登录销售助手
</view>
<image webp class="img" src="{{IMGURL}}login/login-2.webp" />
</view>
</block>
<block wx:else>
<view class="box">
<view class="input-box opacity-view">
<view class="title">{{loginType == 1?'手机号':'账号'}}登录</view>
<block wx:if="{{loginType == 1}}">
<view class="input">
<input
type="number"
placeholder="填写手机号"
placeholder-class="placeholder"
bindinput="input"
data-name="phone"
value="{{formData.phone}}"
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}}">{{
<view class="box">
<view class="input-box opacity-view">
<view class="title">{{loginType == 1?'手机号':'账号'}}登录</view>
<block wx:if="{{loginType == 1}}">
<view class="input">
<input type="number" placeholder="填写手机号" placeholder-class="placeholder" bindinput="input" data-name="phone" value="{{formData.phone}}" 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':'获取验证码'
}}
</button>
<block wx:if="{{smsError}}">
<view class="error">验证码错误</view>
</block>
</view>
</block>
<block wx:else>
<view class="input">
<input
type="text"
placeholder="填写账号"
placeholder-class="placeholder"
bindinput="input"
data-name="account"
value="{{formData.account}}"
maxlength="15" />
<input-icon show="{{formData.account}}" bindtap="clear" data-name="account" />
</view>
<view class="input">
<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>
</button>
<block wx:if="{{smsError}}">
<view class="error">验证码错误</view>
</block>
</view>
</block>
<block wx:else>
<view class="input">
<input type="text" placeholder="填写账号" placeholder-class="placeholder" bindinput="input" data-name="account" value="{{formData.account}}" maxlength="15" />
<input-icon show="{{formData.account}}" bindtap="clear" data-name="account" />
</view>
<view class="input">
<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 wx:if="{{loginType == 0 &&agree}}">
<button
class="button"
disabled="{{disabled}}"
hover-class="btn-hover"
open-type="getPhoneNumber"
bindgetphonenumber="wxLogin"
loading="{{loading}}">授权登录
</button>
<button class="button" disabled="{{disabled}}" hover-class="btn-hover" open-type="getPhoneNumber" bindgetphonenumber="wxLogin" loading="{{loading}}">授权登录
</button>
</block>
<block wx:else>
<button
class="button"
disabled="{{disabled}}"
hover-class="btn-hover"
bindtap="login"
loading="{{loading}}">登录
</button>
<button class="button" disabled="{{disabled}}" hover-class="btn-hover" bindtap="login" loading="{{loading}}">授权登录
</button>
</block>
<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
......@@ -13,7 +13,8 @@ Component({
* 组件的初始数据
*/
data: {
loginList: ['微信登录', '手机号', '账号密码'],
// loginList: ['微信登录', '手机号', '账号密码'],
loginList: ['授权登录', '手机号',],
},
/**
......@@ -22,7 +23,7 @@ Component({
methods: {
changLoginType(e) {
const thisPage = wx.$router.getPageInstance(),
loginType = e.currentTarget.dataset.index
loginType = e.currentTarget.dataset.index
thisPage.setData({
loginType
})
......
<view class='tips'>
<view class='choose-box' bindtap="choose">
<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>
阅读并同意以下协议
我已阅读并同意
<!-- <text catchtap="jump" data-url="agree">《服务协议》</text> -->
<text catchtap="jump" data-url="privacy">《隐私协议》</text>
<text catchtap="jump" data-url="agreement">《用户协议》</text>
......
......@@ -6,7 +6,7 @@
left: 0;
bottom: 40rpx;
font-size: 24rpx;
color: #999;
color: #8F959E;
letter-spacing: 2rpx;
padding-left: 28rpx;
box-sizing: border-box;
......@@ -16,16 +16,16 @@
}
.tips text {
color: #ff600f;
color: #5092FF;
}
.tips .icon {
position: absolute;
top: 50%;
left: 50%;
width: 24rpx;
height: 24rpx;
border-radius: 2rpx;
width: 28rpx;
height: 28rpx;
border-radius: 50%;
box-sizing: border-box;
transform: translate(-50%, -50%);
}
......@@ -37,7 +37,8 @@
}
.tips .choose-box {
width: 80rpx;
height: 80rpx;
width: 50rpx;
height: 50rpx;
position: relative;
z-index: 10;
}
\ No newline at end of file
......@@ -3,29 +3,32 @@
padding: 0 80rpx;
font-size: 24rpx;
color: #8A8C90;
&::before {
content: '';
width: 100%;
height: 264rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/bg-top.webp') no-repeat;
background-size: 100% 264rpx;
height: 800rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/sales-assistant/login/bg-top.webp') no-repeat;
background-size: 100% 800rpx;
position: fixed;
left: 0;
top: 0;
z-index: -1;
}
&::after {
content: '';
width: 100%;
height: 472rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/bg-bottom.webp') no-repeat;
background-size: 100% 472rpx;
// background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/bg-bottom.webp') no-repeat;
// background-size: 100% 472rpx;
position: fixed;
left: 0;
bottom: 0;
z-index: -1;
}
}
@keyframes opacity-view {
0% {
opacity: 0;
......@@ -37,6 +40,7 @@
transform: scale(1);
}
}
.button {
width: 100% !important;
height: 88rpx;
......@@ -48,11 +52,13 @@
line-height: 88rpx;
padding: 0;
transition: all .1s;
&[disabled]:not([type]){
&[disabled]:not([type]) {
background: #CCCED1 !important;
color: #fff !important;
}
}
.btn-hover {
opacity: .75;
}
\ No newline at end of file
......@@ -8,7 +8,7 @@ const setRouteData = targetPath => {
console.log(query, 'query');
if (query) {
var list = query.split('&') || []
console.log(list,list);
console.log(list, list);
list.forEach(item => {
const [key, val] = item.split('=')
obj[key] = val
......@@ -21,58 +21,58 @@ const setRouteData = targetPath => {
}
}
/**选择账号登录 */
const selectAccountLogin = ({ id, sessionId }) => {
USERAPI.selectAccountLogin({
id,
sessionId
}).then(({ code, data, message }) => {
console.log(code, 'selectAccountLogin');
if (code == '0') {
console.log(data)
setLoginInfo(data.loginUserInfoList[0], data.sessionId)
} else wx.$api.showToast(message || '系统异常')
})
}
// const selectAccountLogin = ({ id, sessionId }) => {
// USERAPI.selectAccountLogin({
// id,
// sessionId
// }).then(({ code, data, message }) => {
// console.log(code, 'selectAccountLogin');
// if (code == '0') {
// console.log(data)
// setLoginInfo(data.loginUserInfoList[0], data.sessionId)
// } else wx.$api.showToast(message || '系统异常')
// })
// }
/**设置登录信息 */
const setLoginInfo = (userInfo, sessionId) => {
if (!userInfo) {
wx.$api.showToast('仅支持服务商类型账户登录')
return
}
// if (!userInfo) {
// wx.$api.showToast('仅支持服务商类型账户登录')
// return
// }
console.log('wx.$router.getPageInstance()', wx.$router.getPageInstance());
const {
options: { reportDate },
options
} = wx.$router.getPageInstance()
// 跳转别的小程序
// debugger
if (reportDate) {
let params = `approvedBy=${userInfo.name}&`
// const {
// options: { reportDate },
// options
// } = wx.$router.getPageInstance()
// // 跳转别的小程序
// // debugger
// if (reportDate) {
// let params = `approvedBy=${userInfo.name}&`
for (const key in options) {
params += `${key}=${options[key]}&`
}
console.log(params);
return wx.navigateToMiniProgram({
appId: 'wx570d9331f9ace0bd',
path: options.page == 'upgradeStaffDaily' ? `tabWorkOrder/pages/upgradeStaffDaily/upgradeStaffDaily?${params}` : `tabWorkOrder/pages/staffDaily/staffDaily?${params}`,
envVersion: 'trial',
success(res) {
// 打开成功
}
})
}
// for (const key in options) {
// params += `${key}=${options[key]}&`
// }
// console.log(params);
// return wx.navigateToMiniProgram({
// appId: 'wx570d9331f9ace0bd',
// path: options.page == 'upgradeStaffDaily' ? `tabWorkOrder/pages/upgradeStaffDaily/upgradeStaffDaily?${params}` : `tabWorkOrder/pages/staffDaily/staffDaily?${params}`,
// envVersion: 'trial',
// success(res) {
// // 打开成功
// }
// })
// }
// debugger
// 自动创建服务中心
initServiceCenter()
// initServiceCenter()
setUserInfo(userInfo)
// debugger
setSessionId(sessionId)
loginSuccess()
}
const initServiceCenter = () => {
USERAPI.initServiceCenter({})
}
// const initServiceCenter = () => {
// USERAPI.initServiceCenter({})
// }
/**成功跳转 */
const loginSuccess = () => {
const {
......@@ -103,23 +103,23 @@ const loginModal = async ({ message, confirmText, cancelText }) => {
const checkLoginUserInfo = ({ loginUserInfoList, sessionId }) => {
const thisPage = wx.$router.getPageInstance()
/**多个账号 */
if (loginUserInfoList.length > 1)
wx.$router.go('login.accountItems', {
sessionId,
...thisPage.options
})
/**只有一个账号 */ else
selectAccountLogin({
id: loginUserInfoList[0].uuid,
sessionId
})
// if (loginUserInfoList.length > 1)
// wx.$router.go('login.accountItems', {
// sessionId,
// ...thisPage.options
// })
// /**只有一个账号 */ else
// selectAccountLogin({
// id: loginUserInfoList[0].uuid,
// sessionId
// })
}
module.exports = {
checkLoginUserInfo,
selectAccountLogin,
// selectAccountLogin,
loginSuccess,
setRouteData,
setLoginInfo,
loginModal,
initServiceCenter
// initServiceCenter
}
......@@ -97,25 +97,26 @@ Page({
init() {
wx.nextTick(() => {
const sessionId = getSessionId(),
{ url, targetPath = url ? decodeURIComponent(url) : '', reportDate } = this.options
const sessionId = getSessionId()
// { url, targetPath = url ? decodeURIComponent(url) : '', reportDate } = this.options
let path = 'pages.index',
obj = {}
if (targetPath) obj.targetPath = targetPath
// 如果是日报跳转进来的
if (reportDate) {
obj = {
...obj,
...this.options
}
}
// if (targetPath) obj.targetPath = targetPath
// // 如果是日报跳转进来的
// if (reportDate) {
// obj = {
// ...obj,
// ...this.options
// }
// }
console.log(sessionId, 'sessionId');
if (sessionId) {
USERAPI.checkSession().then(({ code }) => {
if (code == '0') {
if (targetPath) {
path = setRouteData(targetPath).url
obj = setRouteData(targetPath).obj
}
// if (targetPath) {
// path = setRouteData(targetPath).url
// obj = setRouteData(targetPath).obj
// }
wx.$router.reLaunch(path, obj)
} else this.autoLogin(obj)
})
......@@ -125,29 +126,34 @@ Page({
autoLogin(obj) {
const autoLoginObject = wx.$storage.get('auto_login_object')
if (autoLoginObject) {
const { failureTime, userName, password } = autoLoginObject
if (Date.now() < failureTime) {
USERAPI.accountLogin({
userName,
password
}).then(async ({ data, code, message }) => {
if (code == '0' && data.loginUserInfoList.length) {
const { sessionId, loginUserInfoList } = data
setLoginInfo(loginUserInfoList[0], sessionId)
} else {
try {
const reload = await loginModal({
message: data.loginUserInfoList.length ? message : '登录失败请重试',
cancelText: '返回'
})
if (reload) this.onShow()
} catch (error) {
const { noSignInUuid } = autoLoginObject
// if (Date.now() < failureTime) {
USERAPI.noSignInLogin({
noSignInUuid
}).then(async ({ data, code, message }) => {
// debugger
if (code == '0') {
const { sessionId, } = data
setLoginInfo(data, sessionId)
} else {
try {
const reload = await loginModal({
message: message ? message : '登录失败请重试',
cancelText: '返回',
confirmText: '确认'
})
if (reload) {
wx.$storage.rm('auto_login_object')
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)
},
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
{
"navigationBarTitleText": "设置",
"usingComponents": {}
}
\ 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
<!--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
// packageTool/pages/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageTool/pages/index/index.wxss */
\ No newline at end of file
<!--packageTool/pages/index/index.wxml-->
<text>packageTool/pages/index/index.wxml</text>
\ 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
{
"usingComponents": {}
}
\ No newline at end of file
/* packageTool/pages/index/index.wxss */
\ No newline at end of file
<!--packageTool/pages/index/index.wxml-->
<text>packageTool/pages/index/index.wxml</text>
\ No newline at end of file
// 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({
/**
* 页面的初始数据
*/
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) {
let { height, statusBarHeight } = e.detail
......@@ -12,7 +109,8 @@ Page({
tabBarStyle: height / 2 + statusBarHeight
})
console.log(e)
},mp(e) {
},
jump(e) {
console.log(e)
let { url } = e.currentTarget.dataset
const baseUrl = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/html/'
......@@ -39,7 +137,15 @@ Page({
* 生命周期函数--监听页面加载
*/
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({
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
onShow: function () { },
/**
* 生命周期函数--监听页面隐藏
......
{
"navigationStyle": "custom",
"usingComponents": {}
}
......@@ -38,9 +38,9 @@ page {
&::after {
content: '';
width: 100%;
height: 486rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/personal/bg.webp') no-repeat;
background-size: 100% 486rpx;
height: 800rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/sales-assistant/personal/bg.webp') no-repeat;
background-size: 100% 800rpx;
position: absolute;
left: 0;
top: 0;
......@@ -55,36 +55,42 @@ page {
}
.userInfoCon {
height: 360rpx;
box-sizing: border-box;
padding: 20rpx 40rpx 48rpx;
height: 160rpx;
display: flex;
flex-direction: column;
// flex-direction: column;
align-items: center;
justify-content: center;
// justify-content: center;
.headPortrait {
width: 128rpx;
height: 128rpx;
width: 80rpx;
height: 80rpx;
// border-radius: 64rpx;
// border: 2rpx solid #fff;
}
.right {
margin-left: 20rpx;
}
.name {
font-weight: 600;
font-size: 32rpx;
color: #323436;
margin: 16rpx 0;
color: #0a0d14;
// margin: 16rpx 0;
text-align-last: left;
}
.id {
font-size: 28rpx;
color: #323436;
color: #3f444d;
}
.createTime {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #8A8C90;
margin-top: 16rpx;
.setting {
width: 40rpx;
height: 40rpx;
margin-left: auto;
}
}
......@@ -96,29 +102,34 @@ page {
}
.boxItemCon {
width: 710rpx;
height: 178rpx;
border-radius: 16rpx;
// opacity: 1;
// border: 2rpx solid #979797;
background: #ffffff;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
// align-items: center;
// padding: 0 10rpx;
.item {
// margin-left: 66rpx;
// margin-top: 32rpx;
// height: 96rpx;
// width: 96rpx;
width: 25%;
margin-top: 32rpx;
margin-top: 28rpx;
display: flex;
flex-direction: column;
align-items: center;
.img {
width: 72rpx;
height: 72rpx;
}
.imgcon {
position: relative;
.img {
width: 96rpx;
height: 96rpx;
}
.redPot {
width: 12rpx;
......@@ -151,6 +162,8 @@ page {
font-size: 24rpx;
color: #323436;
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
<!-- 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
// pages/tab/tool/tool.js
Page({
/**
* 页面的初始数据
*/
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
onShareAppMessage() {}
})
{
"navigationBarTitleText": "工具",
"usingComponents": {}
}
\ No newline at end of file
/* pages/tab/tool/tool.wxss */
\ No newline at end of file
/* pages/tab/tool/tool.wxss */
// .main {
// background: #f7f8fa;
// }
page {
background: #f7f8fa;
}
\ No newline at end of file
<!--pages/tab/tool/tool.wxml-->
<text>pages/tab/tool/tool.wxml</text>
\ 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
......@@ -2,7 +2,8 @@ import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
const mockObj = {
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 = {
// test: 'https://oss-config.dev.glsx.com.cn/mock/63fd6c2034c4d918e2f4df4d/config',
......@@ -29,7 +30,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false
const release = false
let index = 2
let index = 0
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
......@@ -115,7 +116,7 @@ const djSecretKey = {
const domain = {
ip: {
// 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'
},
dev: {
......@@ -153,7 +154,8 @@ const pathEnum = {
busassistant: '/rop-scrm-busassistant/',
assistant: '/rop-scrm-stoassistant/',
smartcarlife: '/rop-dj-car-boutique/',
djsmart: '/rop-dj-smartcarlife/'
djsmart: '/rop-dj-smartcarlife/',
sale: '/rop-dj-sale/'
}
const defaultMerchantId = {
ip: '44184606',
......
......@@ -10,7 +10,7 @@ class Request {
// console.log(requestPath, '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()
if (type == 'none') return
return new Promise((resolve, reject) => {
......@@ -18,8 +18,8 @@ class Request {
let header =
RequestMethods === 'POST'
? {
'content-type': 'application/x-www-form-urlencoded'
}
'content-type': 'application/x-www-form-urlencoded'
}
: {}
let projectName = params.apiProjectName || this.getRopProject(params.method)
// 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!