Commit c82931ab by 李伟康

提交代码

1 parent 8594e447
...@@ -16,9 +16,9 @@ module.exports = { ...@@ -16,9 +16,9 @@ module.exports = {
selectorBlackList: [], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名 selectorBlackList: [], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名
minPixelValue: 0.5, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值 minPixelValue: 0.5, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值
mediaQuery: false, // 允许在媒体查询中转换`px` mediaQuery: false, // 允许在媒体查询中转换`px`
landscape: true, // landscape: true,
landscapeUnit: 'vw', // (String) 横屏时使用的单位 // landscapeUnit: 'vw', // (String) 横屏时使用的单位
landscapeWidth: 812, // landscapeWidth: 812,
// viewportHeight:812, // viewportHeight:812,
} }
} }
......
...@@ -26,6 +26,20 @@ ...@@ -26,6 +26,20 @@
@touchstart="touchstart" @touchstart="touchstart"
@touchend="touchend" @touchend="touchend"
> >
<template v-if="detail.isStaffLoginLink">
员工注册
<wx-open-launch-weapp
class="mini"
:path="path"
:username="miniprogramInfo.username"
:env-version="envVersion"
>
<script type="text/wxtag-template">
<div class="mini-btn">点击跳转</div>
</script>
</wx-open-launch-weapp>
</template>
<template v-else>
<template v-if="detail.activityStatus == 1 && detail.buyFlag != 2">预热下单</template> <template v-if="detail.activityStatus == 1 && detail.buyFlag != 2">预热下单</template>
<template v-else-if="detail.activityStatus == 3">活动已结束</template> <template v-else-if="detail.activityStatus == 3">活动已结束</template>
<template v-else> <template v-else>
...@@ -33,6 +47,7 @@ ...@@ -33,6 +47,7 @@
<template v-else-if="detail.buyFlag == 2">已参团</template> <template v-else-if="detail.buyFlag == 2">已参团</template>
<template v-else>立即参团</template> <template v-else>立即参团</template>
</template> </template>
</template>
</div> </div>
<pay-modal <pay-modal
v-model="showModal" v-model="showModal"
...@@ -88,11 +103,13 @@ export default { ...@@ -88,11 +103,13 @@ export default {
immediate: true, immediate: true,
handler (n) { handler (n) {
if (n.id) { if (n.id) {
const { isStaffLoginLink } = this.getQuery()
let expressFee = n.expressFee || 0 let expressFee = n.expressFee || 0
let [price, decimal] = this.centsToyuan(n.retailPrice + expressFee).toString().split('.') let [price, decimal] = this.centsToyuan(n.retailPrice + expressFee).toString().split('.')
if (!decimal) decimal = '00' if (!decimal) decimal = '00'
n.price = price n.price = price
n.decimal = decimal n.decimal = decimal
n.isStaffLoginLink = isStaffLoginLink
// limitPurchaseFlag 是否限购标志:1 否;2 是; // limitPurchaseFlag 是否限购标志:1 否;2 是;
//buyFlag 1是未购买或者未限购,2是已购买且达到购买上限,3是已购买且未达到购买上限 //buyFlag 1是未购买或者未限购,2是已购买且达到购买上限,3是已购买且未达到购买上限
let formList = [] let formList = []
...@@ -156,7 +173,10 @@ export default { ...@@ -156,7 +173,10 @@ export default {
payStatus: Date.now(), payStatus: Date.now(),
posterImg: '', posterImg: '',
carInfo: {}, carInfo: {},
iSMiniprogram: true iSMiniprogram: true,
envVersion: 'release',
miniprogramInfo: {},
path: ''
} }
}, },
props: { props: {
...@@ -166,11 +186,25 @@ export default { ...@@ -166,11 +186,25 @@ export default {
} }
}, },
mounted () { mounted () {
const { envVersion, miniprogramInfo } = window.$fetchConfig,
params = this.getLocalStorage('wx_scrm_link_params'),
userInfo = this.getUserInfo(),
data = {
staffName: userInfo.nickName,
fileUrl: userInfo.logo,
merchantId: params.merchantId
}
this.envVersion = envVersion
this.miniprogramInfo = miniprogramInfo
this.iSMiniprogram = window.__wxjs_environment === 'miniprogram' this.iSMiniprogram = window.__wxjs_environment === 'miniprogram'
this.path = `pages/tab/index/index.html?data=${encodeURIComponent(JSON.stringify(data))}`
}, },
methods: { methods: {
submit () { submit () {
let { detail, iSMiniprogram } = this let { detail, iSMiniprogram } = this
if (detail.isStaffLoginLink) {
return
}
if (iSMiniprogram) { if (iSMiniprogram) {
this.showToast('参团请拨打短信中咨询热线') this.showToast('参团请拨打短信中咨询热线')
return return
...@@ -301,22 +335,6 @@ export default { ...@@ -301,22 +335,6 @@ export default {
height: 35px; height: 35px;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
.mini {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 2;
opacity: 0;
&-btn {
width: 100%;
height: 100%;
}
}
.sprite-icon {
margin: 0 auto;
}
} }
} }
.price { .price {
...@@ -346,6 +364,23 @@ export default { ...@@ -346,6 +364,23 @@ export default {
color: #ffffff; color: #ffffff;
box-sizing: border-box; box-sizing: border-box;
line-height: 40px; line-height: 40px;
position: relative;
.mini {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 2;
opacity: 0;
&-btn {
width: 100%;
height: 100%;
}
}
.sprite-icon {
margin: 0 auto;
}
} }
.disabled { .disabled {
background: #b1b1b1; background: #b1b1b1;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
module.exports = { module.exports = {
title: '加载中...', title: '加载中...',
request: { request: {
baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址, baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
......
...@@ -68,10 +68,10 @@ let body = document.getElementsByTagName('head')[0], ...@@ -68,10 +68,10 @@ let body = document.getElementsByTagName('head')[0],
ISWXWORK = false, ISWXWORK = false,
IsIOS = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent), IsIOS = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent),
ISMiniprogram = window.__wxjs_environment === 'miniprogram' ISMiniprogram = window.__wxjs_environment === 'miniprogram'
WXJDK.src = '//res.wx.qq.com/open/js/jweixin-1.2.0.js' WXJDK.src = '//res.wx.qq.com/open/js/jweixin-1.6.0.js'
if (Boolean(ua.match(/MicroMessenger/i)) && Boolean(ua.match(/wxwork/i))) { if (Boolean(ua.match(/MicroMessenger/i)) && Boolean(ua.match(/wxwork/i))) {
//是否企微 //是否企微
// WXJDK.src = '//res.wx.qq.com/open/js/jweixin-1.2.0.js' WXJDK.src = '//res.wx.qq.com/open/js/jweixin-1.2.0.js'
WWJDK.src = '//open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js' WWJDK.src = '//open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js'
ISWXWORK = true ISWXWORK = true
} }
......
const pages = { const pages = {
crowdfunding: [ crowdfunding: [
{ {
name: 'index', name: 'index/index',
meta: { meta: {
keepAlive: true, keepAlive: true,
// noAuth: true, // noAuth: true,
...@@ -88,8 +88,8 @@ Object.keys(pages).map(parent => { ...@@ -88,8 +88,8 @@ Object.keys(pages).map(parent => {
pages[parent].map(val => { pages[parent].map(val => {
let childrenPath = `${parent}/${val.name}` let childrenPath = `${parent}/${val.name}`
let { meta } = val let { meta } = val
const path = `/${val.name == 'index' ? parent : childrenPath}` const path = `/${val.name == 'index/index' ? parent : childrenPath}`
const name = val.name == 'index' ? parent : childrenPath.replace('/', '.') const name = val.name == 'index/index' ? parent : childrenPath.replace(/\//g, '.')
if (meta && meta.keepAlive) keepAlives.push(name) if (meta && meta.keepAlive) keepAlives.push(name)
let route = { let route = {
component: resolve => require([`views/${childrenPath}.vue`], resolve), component: resolve => require([`views/${childrenPath}.vue`], resolve),
......
<template>
<div class="guide-page" v-if="show">
<img
:src="img"
@click="tap"
>
</div>
</template>
<script type='text/ecmascript-6'>
const imgUrl = 'https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/guide-'
export default {
name: 'GuidePage',
data () {
return {
img: '',
index: 0,
show: true
}
},
mounted () {
this.img = `${imgUrl}${this.index}.webp`
},
methods: {
tap () {
let { index } = this
if (index == 2) {
this.$parent.showGuidePage = false
this.show = false
return
}
++this.index
this.img = `${imgUrl}${this.index}.webp?v=${Date.now()}`
}
}
}
</script>
<style scoped lang='scss'>
.guide-page {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 10086;
background-color: #000;
}
</style>
\ No newline at end of file \ No newline at end of file
const componentsFiles = require.context(`./`, true, /.vue$/)
let components = {}
componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default
components = {
...components,
[component.name]: component
}
})
export default components
<template> <template>
<div class="layout"> <div class="layout">
<!-- 👇 引导页 -->
<template v-if="isStaffLoginLink && showGuidePage && !ISWXWORK">
<guide-page />
</template>
<template v-else>
<div <div
class="empty-page" class="empty-page"
v-if="noPro" v-if="noPro"
...@@ -289,6 +294,7 @@ ...@@ -289,6 +294,7 @@
loop loop
></video> ></video>
</div> </div>
</template>
</div> </div>
</template> </template>
...@@ -296,7 +302,9 @@ ...@@ -296,7 +302,9 @@
import { shopmallApi, wxConfig, mapApi, bigdatautilApi } from '@/api' import { shopmallApi, wxConfig, mapApi, bigdatautilApi } from '@/api'
import { Audio } from '@/utils/audio' import { Audio } from '@/utils/audio'
import { Notify } from 'vant' import { Notify } from 'vant'
import components from './components'
export default { export default {
components,
name: 'Index', name: 'Index',
data () { data () {
return { return {
...@@ -317,7 +325,9 @@ export default { ...@@ -317,7 +325,9 @@ export default {
step: 1, step: 1,
isLiveFull: false, isLiveFull: false,
liveDetail: null, liveDetail: null,
noPro: false noPro: false,
isStaffLoginLink: false, //是否母链
showGuidePage: true
} }
}, },
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
...@@ -337,8 +347,8 @@ export default { ...@@ -337,8 +347,8 @@ export default {
}) })
}, },
created () { created () {
const _this = this const _this = this,
const jsApiList = [ jsApiList = [
'getLocation', 'getLocation',
'openLocation', 'openLocation',
'getNetworkType', 'getNetworkType',
...@@ -346,7 +356,9 @@ export default { ...@@ -346,7 +356,9 @@ export default {
'onMenuShareTimeline', 'onMenuShareTimeline',
'showMenuItems', 'showMenuItems',
'hideAllNonBaseMenuItem' 'hideAllNonBaseMenuItem'
] ],
{ isStaffLoginLink } = this.getQuery()
if (isStaffLoginLink) this.isStaffLoginLink = isStaffLoginLink
wxConfig.init(jsApiList).then(() => { wxConfig.init(jsApiList).then(() => {
wxConfig.ready(() => { wxConfig.ready(() => {
wx.hideAllNonBaseMenuItem() wx.hideAllNonBaseMenuItem()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!