Commit 2fe6e4f1 by 张立顺

Merge branch 'develop' of 192.168.3.233:saas_plus/business-assistant into develop

2 parents 47436b83 92a02e1a
Showing 68 changed files with 742 additions and 263 deletions
...@@ -54,7 +54,7 @@ class UsersApi { ...@@ -54,7 +54,7 @@ class UsersApi {
} else Promise.reject() } else Promise.reject()
} }
/**账号密码登录 */ /**账号密码登录 */
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,
...@@ -104,5 +104,13 @@ class UsersApi { ...@@ -104,5 +104,13 @@ class UsersApi {
true true
) )
} }
/**检查sessionId 是否过期 */
checkSession() {
return api.post({
method: 'scrm.api.sso.login.status.check'
},
true
)
}
} }
export default UsersApi export default UsersApi
\ No newline at end of file \ No newline at end of file
...@@ -25,9 +25,11 @@ promisifyAll() ...@@ -25,9 +25,11 @@ promisifyAll()
import { Storage } from './utils/cache/storage' import { Storage } from './utils/cache/storage'
const $Storage = new Storage() const $Storage = new Storage()
import './utils/share'
App({ App({
onLaunch(options) { onLaunch(options) {
/**挂载到wx对象 */ /**挂载到wx对象 */
/**挂载到wx对象 */
wx.$authStatus = false wx.$authStatus = false
wx.$util = util wx.$util = util
wx.$api = wxApi wx.$api = wxApi
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
{ {
"pagePath": "pages/tab/output/output", "pagePath": "pages/tab/output/output",
"text": "看产值", "text": "看产值",
"iconPath": "images/mall.png", "iconPath": "images/output.png",
"selectedIconPath": "images/mall_active.png" "selectedIconPath": "images/output_active.png"
}, },
{ {
"pagePath": "pages/tab/mine/mine", "pagePath": "pages/tab/mine/mine",
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
}, },
"subpackages": [], "subpackages": [],
"usingComponents": { "usingComponents": {
"tab": "/components/Tab/Tab" "tab": "/components/Tab/Tab",
"navigation-bar":"/components/NavigationBar/NavigationBar"
}, },
"style": "v2", "style": "v2",
"resolveAlias": { "resolveAlias": {
......
...@@ -6,6 +6,7 @@ Component({ ...@@ -6,6 +6,7 @@ Component({
properties: { properties: {
navStyle: String, navStyle: String,
custom: Boolean, custom: Boolean,
showBack: Boolean,
pageTitle: { pageTitle: {
type: String, type: String,
value: '', value: '',
...@@ -47,8 +48,12 @@ Component({ ...@@ -47,8 +48,12 @@ Component({
width, width,
top top
} = wx.getMenuButtonBoundingClientRect(), } = wx.getMenuButtonBoundingClientRect(),
currentPages = getCurrentPages() currentPages = getCurrentPages(), {
showBack
} = this.data
if (showBack && currentPages.length > 1) this.setData({
SHOWBACK: true
})
let navigationBarHeight = height + ((top - statusBarHeight) * 2) + 4 // 4 let navigationBarHeight = height + ((top - statusBarHeight) * 2) + 4 // 4
let navigationBarPadding = screenWidth - right let navigationBarPadding = screenWidth - right
let navigationBarWidth = screenWidth - (navigationBarPadding * 2 + width) - width let navigationBarWidth = screenWidth - (navigationBarPadding * 2 + width) - width
...@@ -81,6 +86,9 @@ Component({ ...@@ -81,6 +86,9 @@ Component({
navHeight, navHeight,
statusBarHeight statusBarHeight
}) })
},
back() {
wx.$router.back()
} }
}, },
lifetimes: { lifetimes: {
......
<view class="navigation-bar" id="navigation-bar" <view class="navigation-bar" id="navigation-bar" style="padding-top:{{statusBarHeight}}px;height:{{navigationBarHeight}}px;{{navStyle}}">
style="padding-top:{{statusBarHeight}}px;height:{{navigationBarHeight}}px;{{navStyle}}">
<block wx:if="{{!custom}}"> <block wx:if="{{!custom}}">
<view class="navigation-bar-box" wx:if="{{showNavBar}}" style="{{navigationBarStyle}}"> <view class="navigation-bar-box" wx:if="{{showNavBar}}" style="{{navigationBarStyle}}">
<block wx:if="{{SHOWBACK}}">
<view class="back" bindtap="back">
<image src="./images/icon-back.png"></image>
</view>
</block>
<view class="navigation-bar-titleText" style="{{navigationBarTextWidth}}"> <view class="navigation-bar-titleText" style="{{navigationBarTextWidth}}">
<slot></slot> <slot></slot>
</view> </view>
......
...@@ -36,9 +36,9 @@ ...@@ -36,9 +36,9 @@
} }
.back{ .back{
position: absolute; position: absolute;
left: 20rpx; left: 44rpx;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
width: 36rpx; width: 16rpx;
height: 36rpx; height: 34rpx;
} }
\ No newline at end of file \ No newline at end of file
...@@ -10,6 +10,7 @@ Component({ ...@@ -10,6 +10,7 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
outClassName:String,
tab: Array, tab: Array,
openScroll: Boolean, openScroll: Boolean,
index: { index: {
......
<block wx:if="{{openScroll}}"> <block wx:if="{{openScroll}}">
<scroll-view <scroll-view
class="tab-box {{align}}" class="tab-box {{align}} {{outClassName}}"
scroll-x scroll-x
enable-flex enable-flex
scroll-with-animation scroll-with-animation
......
...@@ -71,3 +71,18 @@ ...@@ -71,3 +71,18 @@
height: 0; height: 0;
color: transparent; color: transparent;
} }
/* 外部出进来的自定义样式 */
.project-tab{
padding-left: 20px;
padding-right: 20px;
}
.project-tab .tab {
margin-right: 28px;
}
.project-tab .tab.active .text {
font-size: 28rpx;
color: var(--btnColor);
}
.project-tab .tab .line{
width:auto;
}

1.42 KB | W: | H:

2.64 KB | W: | H:

images/home.png
images/home.png
images/home.png
images/home.png
  • 2-up
  • Swipe
  • Onion skin

1.63 KB | W: | H:

2.88 KB | W: | H:

images/home_active.png
images/home_active.png
images/home_active.png
images/home_active.png
  • 2-up
  • Swipe
  • Onion skin

1.34 KB | W: | H:

2.59 KB | W: | H:

images/mine.png
images/mine.png
images/mine.png
images/mine.png
  • 2-up
  • Swipe
  • Onion skin

1.47 KB | W: | H:

2.84 KB | W: | H:

images/mine_active.png
images/mine_active.png
images/mine_active.png
images/mine_active.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -3,11 +3,14 @@ import USERAPI from '~/api/usersApi/index' ...@@ -3,11 +3,14 @@ import USERAPI from '~/api/usersApi/index'
import { import {
selectAccountLogin selectAccountLogin
} from '~/login/lib/index' } from '~/login/lib/index'
const navStyle = 'background-color: rgba(0,0,0,0)'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: {}, data: {
navStyle
},
onRoute({ onRoute({
sessionId sessionId
}) { }) {
...@@ -19,6 +22,17 @@ Page({ ...@@ -19,6 +22,17 @@ Page({
onLoad: function (options) { onLoad: function (options) {
}, },
onPageScroll({
scrollTop
}) {
let scrollTop_num = scrollTop / 100
if (scrollTop_num > 0 && scrollTop_num <= 1 && this.data.navStyle != 'background-color:#FFF;') this.setData({
navStyle: `background-color:#FFF;`
})
if (scrollTop_num == 0) this.setData({
navStyle
})
},
getListSelectAccount(sessionId) { getListSelectAccount(sessionId) {
wx.$api.showLoading('加载中...') wx.$api.showLoading('加载中...')
USERAPI.getAccountList(sessionId).then(({ USERAPI.getAccountList(sessionId).then(({
......
<view class="layout"> <view class="layout">
<navigation-bar navStyle="background-color: rgba(0,0,0,0)">选择账号</navigation-bar> <navigation-bar navStyle="{{navStyle}}">选择账号</navigation-bar>
<view class="title">请选择登录的账号</view> <view class="title">请选择登录的账号</view>
<view class="list"> <view class="list">
<block wx:if="{{flag}}"> <block wx:if="{{flag}}">
......
// login/index/components/Protocol/Protocol.js // login/index/components/Agree/Agree.js
Component({ Component({
options: { options: {
styleIsolation: 'shared' styleIsolation: 'shared'
...@@ -7,27 +7,33 @@ Component({ ...@@ -7,27 +7,33 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
agree:Boolean show: Boolean,
text: String,
value: {
type: Boolean,
value: false,
observer(n) {
this.setData({
agree: n
})
}
}
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
agree: false
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
agreeProtocol() { agree() {
const thisPage = wx.$router.getPageInstance(), let {agree} = this.data
{agree} = thisPage.data this.triggerEvent('change', !agree)
thisPage.setData({
agree: !agree
})
wx.vibrateShort()
thisPage.checkLoginBtn()
}, },
} }
}) })
\ No newline at end of file \ No newline at end of file
/* login/index/components/Protocol/Protocol.wxss */ /* login/index/components/Agree/Agree.wxss */
.protocol { .agree {
margin-top: 274rpx; margin-top: 274rpx;
text { text {
......
<block wx:if="{{show}}">
<view class="agree text-center">
<view class="icon {{agree}}" bindtap="agree">
<image src="https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/radio.png"></image>
</view>
<block wx:if="{{text}}">{{text}}</block>
<block wx:else>
<slot></slot>
</block>
</view>
</block>
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
import USERAPI from '~/api/usersApi/index' import USERAPI from '~/api/usersApi/index'
import { import {
selectAccountLogin, selectAccountLogin,
setLoginInfo setLoginInfo,
loginModal
} from '~/login/lib/index' } from '~/login/lib/index'
let thisPage let thisPage
Component({ Component({
...@@ -154,7 +155,6 @@ Component({ ...@@ -154,7 +155,6 @@ Component({
password: formData.password password: formData.password
} }
this.setBtnLoading() this.setBtnLoading()
console.log(target)
USERAPI[target](obj).then(({ USERAPI[target](obj).then(({
code, code,
data, data,
...@@ -165,8 +165,19 @@ Component({ ...@@ -165,8 +165,19 @@ Component({
if (loginType == 1) this.checkLoginUserInfo(data) if (loginType == 1) this.checkLoginUserInfo(data)
else { else {
const { const {
autoLogin
} = thisPage.data, {
sessionId sessionId
} = data } = data,
validTime = 3600 * 24 * 30 * 1e3,
autoLoginFailureTime = Date.now() + validTime
if (autoLogin) {
wx.$storage.set('auto_login_object', {
failureTime: autoLoginFailureTime,
userName: formData.account,
password: formData.password
})
} else wx.$storage.rm('auto_login_object')
setLoginInfo(data, sessionId) setLoginInfo(data, sessionId)
} }
} else { } else {
...@@ -229,7 +240,6 @@ Component({ ...@@ -229,7 +240,6 @@ Component({
/**页面初始化 */ /**页面初始化 */
async init() { async init() {
thisPage = wx.$router.getPageInstance() thisPage = wx.$router.getPageInstance()
wx.$api.showLoading()
try { try {
const { const {
data, data,
...@@ -251,16 +261,11 @@ Component({ ...@@ -251,16 +261,11 @@ Component({
} }
}, },
/**获取loginToken */ /**获取loginToken */
reLogin(message) { async reLogin(message) {
wx.showModal({ const reload = await loginModal({
content: message || '获取loginToken失败', message: message || '获取loginToken失败'
confirmText: '重试',
confirmColor: '#3666FE'
}).then(({
confirm
}) => {
if (confirm) this.init()
}) })
if (reload) this.init()
} }
}, },
lifetimes: { lifetimes: {
......
<view class="protocol text-center">
<view class="icon {{agree}}" bindtap="agreeProtocol">
<image src="https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/radio.png"></image>
</view>
我已阅读并同意<text>《隐私权政策》</text>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -5,8 +5,12 @@ Page({ ...@@ -5,8 +5,12 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
/**0:微信 1:手机号 2:账号密码 */
loginType: 0, loginType: 0,
disabled: true /**按钮disabled */
disabled: true,
/**免登 */
autoLogin: false
}, },
onRoute(options) {}, onRoute(options) {},
/** /**
...@@ -25,10 +29,10 @@ Page({ ...@@ -25,10 +29,10 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
wx.$api.showLoading()
wx.hideHomeButton({ wx.hideHomeButton({
success: res => { success: res => {
wx.hideLoading() wx.hideLoading()
this.checkLoginBtn()
} }
}) })
}, },
...@@ -56,9 +60,13 @@ Page({ ...@@ -56,9 +60,13 @@ Page({
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
// onShareAppMessage() { // onShareAppMessage() {},
/**30天免登 */
// }, changeAgree(e){
this.setData({
autoLogin:e.detail
})
},
checkLoginBtn(disabled = false) { checkLoginBtn(disabled = false) {
const { const {
loginType loginType
...@@ -76,5 +84,5 @@ Page({ ...@@ -76,5 +84,5 @@ Page({
this.setData({ this.setData({
disabled: !disabled disabled: !disabled
}) })
}, }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
"navigation-bar": "/components/NavigationBar/NavigationBar", "navigation-bar": "/components/NavigationBar/NavigationBar",
"mask": "./components/Mask/Mask", "mask": "./components/Mask/Mask",
"box": "./components/Box/Box", "box": "./components/Box/Box",
"type-list": "./components/TypeList/TypeList" "type-list": "./components/TypeList/TypeList",
"agree": "./components/Agree/Agree"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
<navigation-bar navStyle="background-color: rgba(0,0,0,0)">生意助手</navigation-bar> <navigation-bar navStyle="background-color: rgba(0,0,0,0)">生意助手</navigation-bar>
<box loginType="{{loginType}}" disabled="{{disabled}}" id="box" /> <box loginType="{{loginType}}" disabled="{{disabled}}" id="box" />
<type-list loginType="{{loginType}}" /> <type-list loginType="{{loginType}}" />
<!-- <protocol agree="{{agree}}" /> --> <agree show="{{loginType == 2}}" text="30天内免登陆" value="{{autoLogin}}" bindchange="changeAgree" />
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -56,9 +56,26 @@ const loginSuccess = () => { ...@@ -56,9 +56,26 @@ const loginSuccess = () => {
wx.$router.reLaunch(url, obj) wx.$router.reLaunch(url, obj)
} else wx.$router.go('pages.index') } else wx.$router.go('pages.index')
} }
const loginModal = async ({
message,
confirmText
}) => {
return new Promise((resolve, reject) => {
wx.showModal({
content: message || '网络异常',
confirmText: confirmText || '重试',
confirmColor: '#3666FE',
success(res) {
if (res.confirm) resolve(res.confirm)
if (res.cancel) reject(false)
}
})
})
}
module.exports = { module.exports = {
selectAccountLogin, selectAccountLogin,
loginSuccess, loginSuccess,
setRouteData, setRouteData,
setLoginInfo setLoginInfo,
loginModal
} }
\ No newline at end of file \ No newline at end of file
import { import {
setRouteData setRouteData,
setLoginInfo,
loginModal
} from '../lib/index' } from '../lib/index'
import { import {
getSessionId, getSessionId,
} from '~/utils/cache/storageApi' } from '~/utils/cache/storageApi'
import USERAPI from '~/api/usersApi/index'
Page({ Page({
/** /**
...@@ -31,27 +35,54 @@ Page({ ...@@ -31,27 +35,54 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
wx.$api.showLoading()
const sessionId = getSessionId(), const sessionId = getSessionId(),
{ {
url, url,
targetPath = url ? decodeURIComponent(url) : '' targetPath = url ? decodeURIComponent(url) : ''
} = this.options } = this.options,
autoLoginObject = wx.$storage.get('auto_login_object')
wx.nextTick(() => { wx.nextTick(() => {
if (sessionId) { let path = 'pages.index',
let url = 'pages.index',
obj = {} obj = {}
if (targetPath) obj.targetPath = targetPath
if (sessionId) {
USERAPI.checkSession().then(({
code
}) => {
if (code == '0') {
if (targetPath) { if (targetPath) {
url = setRouteData(targetPath).url path = setRouteData(targetPath).url
obj = setRouteData(targetPath).obj obj = setRouteData(targetPath).obj
} }
wx.$router.reLaunch(url, obj) wx.$router.reLaunch(path, obj)
} else { } else {
let obj = {} if (autoLoginObject) {
if (targetPath) obj.targetPath = targetPath const {
wx.$router.reLaunch('login.index', obj) failureTime,
userName,
password
} = autoLoginObject
if (Date.now() < failureTime) {
USERAPI.accountLogin({
userName,
password
}).then(async res => {
if (res.code == '0') {
const {data} = res
setLoginInfo(data, data.sessionId)
} else {
const reload = await loginModal({
message: '登录失败请重试'
})
if(reload) this.onShow()
} }
}) })
} else wx.$router.reLaunch('login.index', obj)
} else wx.$router.reLaunch('login.index', obj)
}
})
} else wx.$router.reLaunch('login.index', obj)
})
}, },
/** /**
......
{ {
"usingComponents": {} "usingComponents": {},
"navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
.layout{ .layout {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
display: grid; display: grid;
place-items: center; place-items: center;
.icon{
width: 480rpx; .loading {
height: 480rpx; height: 48rpx;
view {
width: 16rpx;
height: 100%;
display: inline-block;
background-color: #0052d9;
animation: stretchdelay 1.2s infinite ease-in-out;
margin: 0 4rpx;
&:nth-child(2) {
animation-delay: -1.1s;
}
&:nth-child(3) {
animation-delay: -1s;
}
&:nth-child(4) {
animation-delay: -.9s;
}
}
}
}
@keyframes stretchdelay {
0%,
100%,
40% {
transform: scaley(.33);
}
20% {
transform: scaley(1);
} }
} }
\ No newline at end of file \ No newline at end of file
<view class="layout"> <view class="layout">
<!-- <image class="icon" src="https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/COVER_LIVE.gif"></image> --> <view class="loading">
<block wx:for="{{4}}" wx:key="index">
<view></view>
</block>
</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
// pages/tab/discovery/components/product/product.js
// import {imgUrlMixin} from '~/mixins/index'
Component({
// behaviors: [imgUrlMixin],
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
navList:['360全景导航','AR实景导航','座椅通风','氛围灯','数字化美容'],
activeNavIdx: 0,
tab:['适用场景','营销链路','项目亮点','适用场景','转化漏斗','合作流程','适用场景','营销链路','项目亮点','适用场景','转化漏斗','合作流程'],
heightArr:[],
curTabIdx:0,
intoViewId: 'to-0',
IMGURL:'../../../../../images/index/'
},
lifetimes:{
ready: function (){
// console.log(11111)
this.getImgHeight()
},
},
/**
* 组件的方法列表
*/
methods: {
changeTab(e){
let idx = e.detail
this.setData({
intoViewId: `to-${idx}`
})
},
changeNav(event){
console.log(event,event.target.dataset.index,111)
this.setData({
activeNavIdx: event.target.dataset.index
})
},
scrolltoupper(event){
const idx = this.data.heightArr.findIndex(item => item>event.detail.scrollTop)
this.setData({
curTabIdx: idx
})
// console.log(this.data.curTabIdx1)
},
getImgHeight(){
let query = wx.createSelectorQuery().in(this)
let heightArr = []
let s = 0
query.selectAll('.img-item').boundingClientRect((react) => {
react.forEach(item => {
s += item.height
heightArr.push(s)
})
this.data.heightArr = heightArr
// console.log( this.data.heightArr)
}).exec()
}
}
})
{
"component": true,
"usingComponents": {
"tab": "../../../../../components/Tab/Tab"
}
}
\ No newline at end of file \ No newline at end of file
// 特色产品
.prod-wrap .big-title{
margin-left: 40rpx;
font-family: PingFangSC-S0pxibold;
font-weight: 600;
font-size: 36rpx;
color: #1B233D;
line-height: 56rpx;
}
.prod-wrap .nav-wrap{
white-space: nowrap;
box-sizing: border-box;
margin-top: 24rpx;
margin-bottom: 32rpx;
padding: 0 20rpx;
}
.prod-wrap .nav-wrap .nav{
display: inline-block;
width: 188rpx;
height: 64rpx;
border-radius: 12rpx;
font-weight: 600;
font-size: 24rpx;
letter-spacing: 0;
text-align: center;
font-family: PingFangSC-Regular;
line-height: 64rpx;
margin-right: 12rpx;
background: #FFFFFF;
border: 2rpx solid #DDE3F0;
}
.prod-wrap .nav-wrap .active-nav{
background-image: linear-gradient(0deg, #EBEFFF 8%, #FCFDFF 85%);
border: 2rpx solid rgba(68,97,240,0.50);
box-shadow: 0 8rpx 16rpx 0 rgba(175,187,219,0.35);
}
.prod-wrap .nav-wrap .nav:last-child{
margin-right: 0;
}
.prod-item{
background-color: #F5F7FB;
border-radius: 48rpx 48rpx 0 0;
padding: 40rpx 24rpx 32rpx;
}
.prod-card{
display: flex;
height: 208rpx;
background-image: linear-gradient(1deg, #FFFFFF 10%, #FDFCFF 100%);
border: 2rpx solid #FFFFFF;
box-shadow: 0 8rpx 20rpx 0 rgba(197,205,235,0.35);
border-radius: 20rpx;
padding: 20rpx 24rpx;
box-sizing: border-box;
position: relative;
}
.prod-card .card-img{
width: 160rpx;
height: 160rpx;
flex-shrink: 0;
border-radius: 4rpx;
}
.img-desc{
position: absolute;
width: 104rpx;
height: 40rpx;
line-height: 40rpx;
background: #D7F5EB;
border-radius: 4rpx;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 24rpx;
color: #24B38C;
letter-spacing: 0;
text-align: center;
}
.prod-info{
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 12rpx 0;
margin-left: 24rpx;
}
.prod-info>text{
display: block;
white-space: nowrap;
height: 40rpx;
line-height: 40rpx;
}
.prod-info .title{
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 28rpx;
color: #323436;
}
.prod-info .sale,.prod-info .earnings{
font-size: 26rpx;
color: #7A8299;
}
.prod-info .sale-num{
font-size: 26rpx;
color: #323436;
}
.prod-info .earnings-num{
font-size: 28rpx;
font-family: DINAlternate-Bold;
font-weight: Bold;
color: #F35251;
}
.share-btn{
height: 56rpx;
line-height: 56rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 24rpx;
background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%);
border-radius: 12rpx;
color: #fff;
padding: 0 20rpx;
display: flex;
align-items: center;
position: absolute;
right: 24rpx;
top: 50%;
transform: translateY(-50%);
}
.share-btn .icon{
width: 24rpx;
height: 24rpx;
margin-right: 8rpx;
}
.project-wrap{
background-color: #F5F7FB;
}
.project-img{
height: 500rpx;
white-space: nowrap;
.img-item{
height: 300rpx;
}
}
// .out-tab{
// .out-text {
// // color: red !important;
// }
// .out-text{
// color:red;
// }
// .out-line{
// }
// }
<!--pages/tab/discovery/components/product/product.wxml-->
<view class="prod-wrap">
<text class="big-title">特色产品</text>
<scroll-view class="nav-wrap" scroll-x="{{true}}">
<block wx:for="{{navList}}" wx:key="index">
<text class='nav {{activeNavIdx==index ? "active-nav": ""}}' bindtap="changeNav" data-index="{{index}}">{{item}}</text>
</block>
</scroll-view>
<view class="prod-item">
<view class="prod-card">
<view class="card-img">
<text class="img-desc">轻改类</text>
<image src="{{IMGURL}}discovery_prod1.png"></image>
</view>
<view class="prod-info">
<text class="title">360全景导航</text>
<text class="sale">新车销量 <text class="sale-num">100</text></text>
<text class="earnings">预估收益 <text class="earnings-num">92.4 万</text></text>
</view>
<view class="share-btn">
<image class="icon" src="{{IMGURL}}share.png"></image>
<text>分享</text>
</view>
</view>
</view>
</view>
<view class="project-wrap">
<tab outClassName="project-tab" openScroll="{{true}}" tab="{{tab}}" index="{{curTabIdx}}" bindclick="changeTab"></tab>
<scroll-view class="project-img" scroll-into-view="{{intoViewId}}" bindscroll="scrolltoupper" scroll-y="{{true}}">
<block wx:for="{{tab}}" wx:key="index">
<view id="to-{{index}}" class="img-item">
{{item}}
</view>
</block>
</scroll-view>
</view>
...@@ -7,9 +7,45 @@ Page({ ...@@ -7,9 +7,45 @@ Page({
*/ */
data: { data: {
navStyle, navStyle,
actClass:'right',
// IMG_URL // IMG_URL
dataArr:[
{
src:'../../../images/index/car1.png',
name:'新车洽谈场景',
msg:'1.0 新车权益销售'
},
{
src:'../../../images/index/car2.png',
name:'新车交付场景',
msg:'1.1 新车精品升级'
},
{
src:'../../../images/index/car3.png',
name:'0-12个月',
msg:'1.2 新车线上转化'
},
{
src:'../../../images/index/car4.png',
name:'12个月以上',
msg:'1.3 存量用户众筹'
},
]
},
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight
})
console.log(e)
},
headTabFn(e){
// console.log("name",e.currentTarget.dataset.name)
let name = e.currentTarget.dataset.name
this.setData({
actClass:name
})
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
......
{ {
"usingComponents": { "usingComponents": {
"product": "./components/product/product"
}, },
"navigationStyle": "custom", "navigationStyle": "custom",
"onReachBottomDistance": 10, "onReachBottomDistance": 10,
......
page {
height: 100vh;
width: 100vw;
background-color: #fff;
}
.reclaim{
.header-wrap{
position: relative;
width: 100%;
background-size: 100% 100%;
margin-bottom: 16px;
.header{
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 88rpx;
display: flex;
justify-content:space-between;
align-items:center;
.left{
display: flex;
align-items: center;
.clue{
position: relative;
margin-left: 24px;
margin-right: 24px;
font-weight: 400;
font-size: 14px;
color: #8A8C90;
}
.product{
position: relative;
}
.act{
font-weight: 600;
font-size: 22px;
color: #323436;
&::after {
position: absolute;
left: 50%;
bottom: -6px;
transform: translateX(-50%);
display: block;
content: "";
width: 20px;
height: 4px;
background: var(--btnColor);
border-radius: 2px;
}
}
}
.right{
display: flex;
align-items:center;
.img{
width:20px;
height:20px;
}
.apply{
margin-left: 4px;
margin-right: 16px;
font-weight: 400;
font-size: 14px;
color: var(--btnColor);
}
}
}
}
.scene{
margin: 0 10px 16px;
display: flex;
justify-content:space-between;
.item{
position: relative;
width: 86px;
height: 90px;
background: #F7F8FC;
border-radius: 6px;
}
.act{
position: absolute;
top: 0;
left: 0;
}
.img{
display:block;
margin: 10px auto 2px;
width: 28px;
height: 28px;
}
.name{
margin-bottom: 2px;
font-weight: 500;
font-size: 12px;
color: #323436;
text-align: center;
}
.msg{
font-weight: 400;
font-size: 9px;
color: #8A8C90;
text-align: center;
}
}
}
.guide{
width: 100%;
height: 100%;
.guide-img{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
\ No newline at end of file \ No newline at end of file
<navigation-bar navStyle="{{navStyle}}" page-title="首页"> <navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
<block wx:if="{{IMGURL}}"> 拓客户
<view class="logo y-center" data-skeleton-hide="{{skeletonData.logo}}">
<image
webp
src="{{IMGURL}}index/gh-logo.png?v={{img_version}}"
bindload="imgSuccess"
data-name="logo" />
</view>
<view class="merchant-switch y-center flex" bindtap="marchantSwitch">
切换门店
<view class="icon">
<image webp src="{{IMGURL}}index/merchant-switch.png?v={{img_version}}" />
</view>
</view>
</block>
</navigation-bar> </navigation-bar>
<block wx:if="{{navHeight}}"> <view class="reclaim">
<view class="layout" style="top:{{navHeight}}px"> <view class="header-wrap" style="height:{{tabBarStyle*2 + 88}}rpx; background-image: url('../../../images/index/head.png')">
<view class="bg-box" style="height:{{270 + navHeight * 2}}rpx;top:-{{navHeight}}px"> <view class="header">
<block wx:if="{{userInfo && userInfo.group == false && merchantName}}"> <view class="left">
<view class="merchant-name" style="top:{{navHeight}}px">{{merchantName}}</view> <view class="clue {{actClass == 'left'?'act':''}}" bindtap="headTabFn" data-name="left">
</block> 看线索
<view class="bg">
<image
webp
src="{{IMGURL}}index/bg.png?v={{img_version}}"
data-skeleton-hide="{{skeletonData.bg}}"
bindload="imgSuccess"
data-name="bg" />
</view>
</view> </view>
<!-- <search-box bindsearch="search"></search-box> --> <view class="product {{actClass == 'right'?'act':''}}" bindtap="headTabFn" data-name="right">
<view class="banner" data-skeleton-hide="{{skeletonData.homeConfig}}"> 看产品
<block wx:if="{{bannerList}}">
<swiper
class="swiper"
bindchange="changePage"
interval="5000"
circular
autoplay>
<block wx:for="{{bannerList}}" wx:key="index">
<swiper-item class="swiper-item">
<image
webp
src="{{item.bannerImg}}"
class="banner-img"
bindtap="jumpGoods"
data-url="{{item.url}}"
data-id="{{item.goods.id}}"
data-link="{{item.linkUrl}}"
data></image>
</swiper-item>
</block>
</swiper>
</block>
<block wx:else>
<view class="swiper border">
<view class="logo box-center">
<image webp src="{{IMGURL}}index/gh-logo.png?v={{img_version}}" />
</view> </view>
</view> </view>
</block> <view class="right">
<block wx:if="{{bannerList.length > 1}}"> <image class="img" src="../../../images/index/apply.png"></image>
<view class="banner-dots"> <view class="apply">
<block wx:for="{{bannerList}}" wx:key="index"> 申请业务
<view class="dots {{bannerIndex == index?'active':''}}" />
</block>
</view> </view>
</block>
</view> </view>
<view class="tips-box flex" data-skeleton-hide="{{skeletonData.homeConfig}}">
<block wx:for="{{tipsList}}" wx:key="index">
<view class="item flex">
<view class="sprite-icon icon-home-tips-{{index}}" />
{{item}}
</view> </view>
</block>
</view> </view>
<block wx:if="{{noticeContent}}"> <view class="scene">
<view class="marquee" data-skeleton-hide="{{skeletonData.homeConfig}}"> <view class="item item{{index}}" wx:for="{{dataArr}}" wx:key="name">
<marquee data="{{noticeContent}}" speed="7500" /> <image class="img" src="{{item.src}}"></image>
</view> <view class="name">
</block>
<view class="util-box" data-skeleton-hide="{{skeletonData.utilList}}">
<block wx:for="{{utilList}}" wx:key="index">
<view class="item" bindtap="jump" data-item="{{item}}">
<view class="sprite-icon icon-home-{{item.icon}}" />
{{item.name}} {{item.name}}
</view> </view>
</block> <view class="msg">
</view> {{item.msg}}
<view class="equity-banner" bindtap="jumpEquity" data-skeleton-hide="{{skeletonData.equity}}">
<image
webp
src="{{IMGURL}}index/equity-banner.png?v={{img_version}}"
bindload="imgSuccess"
data-name="equity" />
</view>
<block wx:if="{{goodsFlag}}">
<view wx:if="{{classifyList.length}}">
<view class="goods-box" data-skeleton-hide="{{skeletonData.goods}}">
<view class="sticky" style="top:{{navHeight}}px;">
<tab
tab="{{tab}}"
align="left"
openScroll
bindclick="changeTab"
index="{{goodsIndex}}" />
</view>
<view class="goods-content {{classifyList[goodsIndex].classifyName == '秒杀'?'activity-box':''}}">
<block wx:if="{{classifyList.length}}">
<block wx:for="{{classifyList}}" wx:key="index">
<block
wx:for="{{item.goodsList}}"
wx:for-item="i"
wx:for-index="ind"
wx:key="ind">
<block wx:if="{{index == goodsIndex}}">
<block wx:if="{{item.classifyName == '秒杀'}}">
<block wx:if="{{ind < 6}}">
<activity item="{{i}}" />
</block>
</block>
<block wx:else>
<view class="goods-item">
<block
wx:for="{{i}}"
wx:key="cind"
wx:for-item="c"
wx:for-index="cind">
<view class="goods">
<goods item="{{c.goods}}" indexStyle></goods>
</view>
</block>
</view>
</block>
</block>
</block>
</block>
</block>
</view>
<block wx:if="{{classifyList[goodsIndex].classifyName == '秒杀'}}">
<view class="btn text-center" bindtap="jump" data-url="activity.index">
查看更多
<view class="sprite-icon icon-mine-arrow" />
</view>
</block>
</view>
</view> </view>
<block wx:else>
<view class="nothing flex">
<view class="icon">
<image webp src="{{IMGURL}}index/index-nothing.png?v={{img_version}}" />
</view> </view>
当前门店暂无优惠活动
</view>
</block>
</block>
</view>
</block>
<view class="widget-box" wx:if="{{showKF}}">
<view class="widget {{widgetStatus?'open':''}}" bindtap="openKF">
<image webp src="{{IMGURL}}index/kf.png?v={{img_version}}" />
<view class="online-text">在线客服</view>
</view> </view>
<product></product>
</view> </view>
<!-- <view class="widget-box" wx:if="{{!widgetStatus&&customerlist.length>0}}">
<view class="widget {{widgetStatus?'open':''}}" bindtap="showFlex"> <view class="guide" wx:if="{{guideShow}}">
<image webp src="{{IMGURL}}index/kf.png?v={{img_version}}"></image> <image bindtap="guideFn" class="guide-img" src="../../../images/entrustCustomers/guide{{guideSrcIndex}}.png"></image>
<view class="online-text">在线客服</view>
</view>
</view> -->
<view class="model" catchtouchmove="noScroll" wx:if="{{widgetStatus}}">
<view class="close-icon" bindtap="showFlex">
<image webp src="{{IMGURL}}index/kf-close.png?v={{img_version}}" />
</view>
<view class="bgkf">
<image webp src="{{IMGURL}}index/kfbg.png?v={{img_version}}" />
<view class="qr-box">
<view class="qr-icon">
<image webp src="{{IMGURL}}index/qr-bg.png?v={{img_version}}" />
</view>
<view class="userinfo-wrap">
<view class="icon">
<image webp src="{{customerlist[0].thumbAvatar|| 'https://img02.glsx.com.cn/weapp/resource/miniprogram/cgacar/index/user.png'}}" />
</view>
<view class="name">{{customerlist[0].staffName}}</view>
<view class="qr-code">
<image webp src="{{customerlist[0].qrCode || 'https://img02.glsx.com.cn/weapp/resource/miniprogram/cgacar/index/qr.png'}}" show-menu-by-longpress="{{customerlist[0].qrCode}}" />
</view>
</view>
<view class="kf-text">
<image webp src="{{IMGURL}}index/kf-text.png?v={{img_version}}" />
</view>
</view>
</view>
</view> </view>
<!-- <coupons-dialog requestFlag="{{isLogin}}"></coupons-dialog> -->
<login show="{{showLogin}}" bindloginInfo="LOGIN" />
<!-- 选择门店 -->
<index-merchant merchantSwitch="{{showMerchant}}" init="{{isLogin}}" storeCode="{{userInfo.sapCode}}" />
...@@ -310,7 +310,6 @@ class Draw { ...@@ -310,7 +310,6 @@ class Draw {
} }
return type[textDecoration][textBaseline] return type[textDecoration][textBaseline]
} }
setLineX({ setLineX({
textAlign, textAlign,
text, text,
...@@ -324,7 +323,6 @@ class Draw { ...@@ -324,7 +323,6 @@ class Draw {
} }
return type[textAlign] return type[textAlign]
} }
drawRadiusRect({ drawRadiusRect({
borderRadius, borderRadius,
height, height,
......
...@@ -9,5 +9,6 @@ export const STORAGE_OBJECTkEY = { ...@@ -9,5 +9,6 @@ export const STORAGE_OBJECTkEY = {
sessionId: 'sessionId', sessionId: 'sessionId',
userInfo: 'userInfo', userInfo: 'userInfo',
system_info: 'systemInfo', system_info: 'systemInfo',
app_title: 'appTitle' app_title: 'appTitle',
auto_login_object: 'auto_login_object'
} }
\ No newline at end of file \ No newline at end of file
...@@ -6,7 +6,7 @@ const target = ['ip', 'dev', 'uat', 'prod'] ...@@ -6,7 +6,7 @@ const target = ['ip', 'dev', 'uat', 'prod']
2测试 2测试
3生产 3生产
*/ */
const index = 0 const index = 1
const secretKey = { const secretKey = {
ip: {}, ip: {},
dev: { dev: {
......
...@@ -46,7 +46,11 @@ class Request { ...@@ -46,7 +46,11 @@ class Request {
data data
} = response } = response
if (code == 20 || code == 21) { if (code == 20 || code == 21) {
//重新登录 const thisPage = wx.$router.getPageInstance()
if(thisPage.route == 'login/loading/loading') {
resolve(data)
return
} else wx.$router.reLaunch('login.index')
} else { } else {
if (returnAll) { if (returnAll) {
resolve(data) resolve(data)
......
/** 分享
* @param {*} shareTitle 分享标题
* @param {*} sharePath 分享页面路径 不传默认当前页
* @param {*} shareImage 分享图片 不传默认当前页面截图
* @param {*} shareQuery 分享页面参数
* @param {*} noPageAuth 分享页面是否需要登录拦截
* @returns
*/
class Share {
constructor() {
console.log('---------------- 分享初始化 ----------------')
this.initPageProxy()
}
/**全局注册事件 */
initPageProxy() {
let thisPage = Page
let _this = this
Page = function (el) {
try {
el || (el = {}), _this.pageLeaveProxy(el), thisPage.apply(this, arguments)
} catch (el) {
thisPage.apply(this, arguments)
}
}
}
/**设置全局分享 */
pageLeaveProxy(page) {
if (page.onShareAppMessage) {
page.onShareAppMessage = function () {
let {
shareTitle,
sharePath,
shareImage,
shareQuery,
noPageAuth
} = this,
path = `/${this.route}`
if (sharePath) path = `/${sharePath}`
if (shareQuery) path += `?${shareQuery}`
if (!noPageAuth) path = `/login/loading/loading?url=${encodeURIComponent(path)}`
return {
path,
title: shareTitle,
imageUrl: shareImage
}
}
}
}
}
new Share()
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!