Commit 1eaa54ca by liimin

格式化

1 parent 58c0bdf0
......@@ -3,3 +3,5 @@ src/assets
src/config
public
dist
node_modules
agreement.vue
module.exports = {
root: true,
globals: {
wx: true,
TCPlayer: true,
Hls: true,
vm: true
},
env: {
node: true
},
......@@ -9,6 +15,7 @@ module.exports = {
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-unused-vars': 'off'
}
}
{
"name": "gh-hall",
"name": "zhongchou",
"version": "1.0.0",
"description": "GH Hall By Work WeChat",
"author": "limin <limin.mail@qq.com>",
......@@ -39,6 +39,7 @@
"babel-plugin-import": "^1.13.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^6.2.2",
"lint-staged": "^9.5.0",
"node-sass": "^4.14.1",
......@@ -50,5 +51,14 @@
"vue-loader": "^15.9.8",
"vue-template-compiler": "^2.6.11",
"webpack-bundle-analyzer": "^3.8.0"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.{js,jsx,vue}": [
"vue-cli-service lint",
"git add"
]
}
}
......@@ -3,7 +3,7 @@ const url = '/rop-scrm-carlife/router'
import { util } from 'utils'
export default {
/**获取车品牌列表 */
getCarBrandList (data = {}) {
getCarBrandList(data = {}) {
data.method = 'scrm.api.carlife.common.getOnlyCarBrandList'
return window.$HTTP({
url,
......@@ -11,7 +11,7 @@ export default {
})
},
/** 获取车系列表 */
getCarSeriesList (params) {
getCarSeriesList(params) {
let data = {
method: 'scrm.api.carlife.common.getCarSeriesList',
...params
......@@ -22,7 +22,7 @@ export default {
})
},
/** 获取车型 */
getCarTypeList (carSeriesId) {
getCarTypeList(carSeriesId) {
let data = {
method: 'scrm.api.carlife.common.getCarTypeList',
carSeriesId
......@@ -31,5 +31,5 @@ export default {
url,
data
})
},
}
\ No newline at end of file
}
}
......@@ -13,11 +13,4 @@ import shopmallApi from './shopmallApi'
import bigdatautilApi from './bigdatautilApi'
import carLifeApi from './carLifeApi'
export {
ssoApi,
mapApi,
wxConfig,
shopmallApi,
bigdatautilApi,
carLifeApi
}
\ No newline at end of file
export { ssoApi, mapApi, wxConfig, shopmallApi, bigdatautilApi, carLifeApi }
......@@ -4,27 +4,28 @@ const key = 'F2HBZ-KH73F-7A2J2-JC4UR-WOHCO-UVFGZ'
const secret = 'YBmrM98E5pM4gYeknWiBPaWpFR4AISUl'
const domain = 'https://apis.map.qq.com'
class QQMap {
setLocaleCompare (params) {
setLocaleCompare(params) {
params.key = key
let keys = []
let obj = {}
Object.keys(params).map(e => keys.push(e))
keys.sort((a, b) => a.localeCompare(b)).map(e => obj[e] = params[e])
keys.sort((a, b) => a.localeCompare(b)).map(e => (obj[e] = params[e]))
return obj
}
getSign (params, methods) {
getSign(params, methods) {
let obj = this.setLocaleCompare(params)
let sign = `${methods}?${decodeURIComponent(qs.stringify(obj))}${secret}`
return md5(sign)
}
request (method, data) {
request(method, data) {
data.output = 'jsonp'
// data.callback = 'test'
const sig = this.getSign(data, method)
let obj = {
...this.setLocaleCompare(data),
sig
}, params = []
...this.setLocaleCompare(data),
sig
},
params = []
Object.keys(obj).map(key => {
params.push(`${key}=${encodeURIComponent(obj[key])}`)
})
......@@ -34,7 +35,7 @@ class QQMap {
// })
let script = document.createElement('script')
script.src = `${domain}${method}?${params.join('&')}`
script.type = "text/javascript"
script.type = 'text/javascript'
document.body.insertBefore(script, document.body.children[0])
return new Promise((resolve, reject) => {
window['QQmap'] = ({ status, result }) => {
......@@ -46,7 +47,7 @@ class QQMap {
})
}
/**计算距离 */
calculateDistance (from, to) {
calculateDistance(from, to) {
from = from.join(',')
to = to.join(',')
return this.request('/ws/distance/v1/', {
......@@ -56,7 +57,7 @@ class QQMap {
})
}
/** 批量距离计算(矩阵) */
calculateDistanceMatrix (from, toList) {
calculateDistanceMatrix(from, toList) {
from = from.join(',')
let to = toList.join(';')
return this.request('/ws/distance/v1/matrix/', {
......@@ -66,24 +67,24 @@ class QQMap {
})
}
/**地址解析(地址转坐标) */
geocoder (address) {
geocoder(address) {
return this.request('/ws/geocoder/v1/', {
address
})
}
/**逆地址解析(坐标位置描述) location=lat<纬度>,lng<经度> */
detailedAdrress (location) {
detailedAdrress(location) {
location = location.join(',')
return this.request('/ws/geocoder/v1/', {
location
})
}
/**IP定位 */
getLocationByIp () {
getLocationByIp() {
return this.request('/ws/location/v1/ip')
}
/**坐标转换 */
translate (locations, type = 5) {
translate(locations, type = 5) {
locations = locations.join(';') //格式:纬度前,经度后
return this.request('/ws/coord/v1/translate', {
locations,
......@@ -91,4 +92,4 @@ class QQMap {
})
}
}
export default new QQMap()
\ No newline at end of file
export default new QQMap()
const url = '/rop-scrm-shopmall/router'
export default {
/**众筹详情 */
getActivityDetail (id) {
getActivityDetail(id) {
return window.$HTTP({
url,
data: {
......@@ -12,26 +12,26 @@ export default {
})
},
/**参团人数 */
getActivityGroup (id) {
getActivityGroup(id) {
return window.$HTTP({
url,
data: {
method: 'scrm.api.shopmall.weapp.activity.group',
id,
id
},
returnAll: true
})
},
/** 创建订单(立即购买) */
createOrder (data) {
createOrder(data) {
data.method = 'scrm.api.shopmall.weapp.order.create'
return window.$HTTP({
url,
data,
data
})
},
/**创建支付订单(去付款) */
payOrder (data) {
payOrder(data) {
data.method = `scrm.api.shopmall.weapp.order.createPay`
return window.$HTTP({
url,
......@@ -40,7 +40,7 @@ export default {
})
},
/**海报 */
getPoster (data) {
getPoster(data) {
data.method = `scrm.api.shopmall.weapp.crowdFunding.poster`
return window.$HTTP({
url,
......@@ -48,7 +48,7 @@ export default {
})
},
/** 订单详情 */
getOrderList (activityId) {
getOrderList(activityId) {
let data = {
activityId,
method: 'scrm.api.shopmall.weapp.crowdFunding.order.list'
......
......@@ -2,7 +2,7 @@ const url = '/rop-scrm-sso/router'
const returnAll = true
export default {
/**OAuth2授权登陆 */
login (data) {
login(data) {
data.method = 'scrm.api.sso.weapp.login.by.wechat'
return window.$HTTP({
url,
......@@ -11,7 +11,7 @@ export default {
})
},
/**企微 OAuth2授权登陆 */
wwLogin (data) {
wwLogin(data) {
data.method = 'scrm.api.sso.ww.oauth.login'
data.productCode = 'PC00025'
return window.$HTTP({
......@@ -21,12 +21,12 @@ export default {
})
},
/**验证码登录 */
captchaLogin (data) {
captchaLogin(data) {
data.method = 'scrm.api.sso.sms.login'
return window.$HTTP({
url,
data,
returnAll
})
},
}
\ No newline at end of file
}
}
......@@ -5,11 +5,11 @@ html,
body .app {
color: #333333;
font-family: Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif;
background-color: #F7F8FA;
background-color: #f7f8fa;
-webkit-overflow-scrolling: touch;
height: 100%;
// overflow: hidden;
--themeColor: #3975C6;
--themeColor: #3975c6;
}
* {
......@@ -84,12 +84,11 @@ video {
content: '';
width: 100%;
height: 100%;
background-color: rgba($color: #000000, $alpha: .1);
background-color: rgba($color: #000000, $alpha: 0.1);
display: block;
}
}
#audio {
position: fixed;
top: -10000px;
......@@ -103,7 +102,6 @@ video {
position: relative;
@keyframes side-animation {
0%,
50%,
100% {
......@@ -122,7 +120,7 @@ video {
width: 2px;
height: 6px;
border-radius: 1px;
background: linear-gradient(bottom, #ffe385 0%, #ffc34d 100%);
background: linear-gradient(to bottom, #ffe385 0%, #ffc34d 100%);
animation: side-animation 2s infinite;
&:last-of-type {
......
<template>
<div
:class="['action isFullSucreen flex', { bgBlack: bgBlack }]"
v-if="show"
>
<div :class="['action isFullSucreen flex', { bgBlack: bgBlack }]" v-if="show">
<div class="btn-box flex" v-show="!bgBlack">
<div
class="item"
@click="getPoster"
>
<div class="item" @click="getPoster">
<div class="sprite-icon icon-poster"></div>
海报
</div>
</div>
<div class="price">
<span class="unit">¥</span>{{detail.price}}<span>.{{detail.decimal}}</span>
<span class="unit">¥</span>
{{ detail.price }}
<span>.{{ detail.decimal }}</span>
</div>
<div
:class="['btn text-center',{'disabled': iSMiniprogram || detail.activityStatus == 3 || detail.buyFlag == 2},{'short':detail.buyFlag == 3}]"
@click="submit"
@touchstart="touchstart"
@touchend="touchend"
>
<div :class="['btn text-center', { disabled: iSMiniprogram || detail.activityStatus == 3 || detail.buyFlag == 2 }, { short: detail.buyFlag == 3 }]" @click="submit" @touchstart="touchstart" @touchend="touchend">
<template v-if="detail.activityStatus == 1">预热下单</template>
<template v-else-if="detail.activityStatus == 3">活动已结束</template>
<template v-else>
......@@ -29,32 +20,12 @@
<template v-else>立即参团</template>
</template>
</div>
<pay-modal
v-model="showModal"
:list="formList"
@cancel="showModal = false"
@pay="checkOut"
:payStatus="payStatus"
:carInfo="carInfo"
/>
<van-overlay
:show="showPoster"
@click.self="showPoster = false"
>
<div
class="wrapper"
@click.stop
>
<van-image
:src="posterImg"
width="100%"
height="100%"
>
<pay-modal v-model="showModal" :list="formList" @cancel="showModal = false" @pay="checkOut" :payStatus="payStatus" :carInfo="carInfo" />
<van-overlay :show="showPoster" @click.self="showPoster = false">
<div class="wrapper" @click.stop>
<van-image :src="posterImg" width="100%" height="100%">
<template v-slot:loading>
<van-loading
type="spinner"
size="20"
/>
<van-loading type="spinner" size="20" />
</template>
</van-image>
</div>
......@@ -62,7 +33,7 @@
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
import { shopmallApi, wxConfig } from '@/api'
import { util } from '@/utils'
export default {
......@@ -270,7 +241,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.action {
position: fixed;
left: 0;
......
<template>
<div class="count-down">
<div class="bg">
<img src="https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/timer-bg.png">
<img src="https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/timer-bg.png" />
</div>
<div :class="['timer-title',{'timer-not-started':detail.activityStatus == 1}]">
<img :src="`https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/timer-${detail.activityStatus == 1?1:2}.png`">
<div :class="['timer-title', { 'timer-not-started': detail.activityStatus == 1 }]">
<img :src="`https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/timer-${detail.activityStatus == 1 ? 1 : 2}.png`" />
</div>
<div :class="['time-box text-center',{'not-started':detail.activityStatus == 1},{'finished':finished}]">
<div :class="['time-box text-center', { 'not-started': detail.activityStatus == 1 }, { finished: finished }]">
<template v-if="timeFlag">
<template v-if="finished">{{finished}}</template>
<template v-if="finished">{{ finished }}</template>
<template v-else>
<template v-if="detail.activityStatus == 1">
{{new Date(iosTimeFormat(detail.startTime)).format('M月d')}}日开始,还差
</template>
<template v-if="detail.activityStatus == 1">{{ new Date(iosTimeFormat(detail.startTime)).format('M月d') }}日开始,还差</template>
<template v-if="activityTime.day">
<div class="time flex">
<span class="text-center flex">{{activityTime.day}}</span>
<span class="text-center flex">{{ activityTime.day }}</span>
<div class="unit">天</div>
</div>
</template>
<template v-for="(i,index) in activityTime.dayList">
<div
class="time flex"
:key="index"
>
<span class="text-center">{{i.text}}</span>
<div class="unit">{{i.unit}}</div>
<template v-for="(i, index) in activityTime.dayList">
<div class="time flex" :key="index">
<span class="text-center">{{ i.text }}</span>
<div class="unit">{{ i.unit }}</div>
</div>
</template>
</template>
......@@ -34,7 +29,7 @@
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
export default {
name: 'CountDown',
props: {
......@@ -121,7 +116,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
@import '@/assets/css/crowdfunding.scss';
.count-down {
position: relative;
......@@ -201,4 +196,4 @@ export default {
border: 1px dashed #ffffff;
box-sizing: border-box;
}
</style>
\ No newline at end of file
</style>
<template>
<div :class="['share-item',{hideBorder}]">
<div :class="['share-item', { hideBorder }]">
<div class="content">
<div class="user-info flex">
<div>
<img v-if="showAvatarNicknameFlag == 2" class="icon-head" :src="item.imageUrl">
<img v-if="showAvatarNicknameFlag == 2" class="icon-head" :src="item.imageUrl" />
<div v-else class="sprite-icon icon-avatar"></div>
</div>
{{ showAvatarNicknameFlag == 2 ? item.name : '玩家' + num }}
</div>
<div :class="['text',{'text-two-line':indexType}]" v-text="item.experience">
</div>
<div :class="['img-box',{'four':indexType}]">
<template v-for="(i,index) in item.activityExperienceImgs">
<div @click="jumpPreview(index)" v-if="indexType?index < 4 :true" class="img-item" :key="index">
<div :class="['text', { 'text-two-line': indexType }]" v-text="item.experience"></div>
<div :class="['img-box', { four: indexType }]">
<template v-for="(i, index) in item.activityExperienceImgs">
<div @click="jumpPreview(index)" v-if="indexType ? index < 4 : true" class="img-item" :key="index">
<img :src="i.imageUrl" />
</div>
</template>
......@@ -21,7 +20,7 @@
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
export default {
name: 'EvaluateItem',
props: {
......@@ -51,7 +50,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
@import '@/assets/css/sharegoods.scss';
.user-info {
padding: 14px 0 10px;
......
<template>
<div :class="['share-item',{hideBorder},{indexType}]">
<div :class="['share-item', { hideBorder }, { indexType }]">
<div class="faq-item">
<div class="q flex">
<template v-if="indexType">
......@@ -8,7 +8,7 @@
<template v-else>
<div class="sprite-icon icon-faq-left"></div>
</template>
<div :class="['value',{'text-hide':indexType}]">{{item.question}}</div>
<div :class="['value', { 'text-hide': indexType }]">{{ item.question }}</div>
</div>
<div class="a flex">
<template v-if="indexType">
......@@ -17,13 +17,13 @@
<template v-else>
<div class="sprite-icon icon-faq-right"></div>
</template>
<div :class="['value',{'text-hide':indexType}]">{{item.answer}}</div>
<div :class="['value', { 'text-hide': indexType }]">{{ item.answer }}</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
export default {
name: 'FAQItem',
props: {
......@@ -45,7 +45,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
@import '@/assets/css/sharegoods.scss';
.faq-item {
padding-top: 16px;
......@@ -111,4 +111,4 @@ export default {
font-size: 12px !important;
}
}
</style>
\ No newline at end of file
</style>
......@@ -4,7 +4,7 @@
<div :class="['kf-box flex']">
<template>
<div class="qr-box">
<img src="@/assets/images/qr-bg.png"/>
<img src="@/assets/images/qr-bg.png" />
<img :src="detail.groupQrCode" class="qr xy-center" />
</div>
<div class="btn" @click="save">长按识别二维码加群</div>
......@@ -15,7 +15,7 @@
</van-overlay>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
export default {
name: 'KfModal',
props: ['value', 'detail'],
......@@ -43,7 +43,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.van-overlay {
z-index: 3;
}
......
......@@ -3,27 +3,32 @@
<div class="small-box">
<img class="icon-small-live" src="@/assets/images/icon-small-live.png" />
<div class="flex small-content">
<div v-if="liveStatus[liveDetail.status] == 'live'" class="live-line">
<!-- <div v-if="LiveStatus[liveDetail.status] == 'live'" class="live-line"> -->
<div v-if="LiveProps[liveDetail.status].isLive" class="live-line">
<div class="side"></div>
<div class="center side"></div>
<div class="side"></div>
</div>
<div class="text">{{ liveStatus[liveDetail.status] == 'live' ? '直播' : '回放' }}</div>
<!-- <div class="text">{{ LiveStatus[liveDetail.status] == 'live' ? '直播' : '回放' }}</div> -->
<div class="text">{{ LiveProps[liveDetail.status].status }}</div>
</div>
</div>
<div class="sprite-icon icon-live-close" @click="handleClose"></div>
<div :class="{ videoShort: detail.activityStatus != 3 && detail.buyFlag != 2 }">
<div class="mask" @click="openFullscreen">
<div class="status flex">
<div v-if="liveStatus[liveDetail.status] == 'live'" class="live-line">
<!-- <div v-if="LiveStatus[liveDetail.status] == 'live'" class="live-line"> -->
<div v-if="LiveProps[liveDetail.status].isLive" class="live-line">
<div class="side"></div>
<div class="center side"></div>
<div class="side"></div>
</div>
<div class="text">{{ liveStatus[liveDetail.status] == 'live' ? '正在直播' : '直播回放' }}</div>
<!-- <div class="text">{{ LiveStatus[liveDetail.status] == 'live' ? '正在直播' : '直播回放' }}</div> -->
<div class="text">{{ LiveProps[liveDetail.status].text }}</div>
</div>
<template v-if="isShowGif">
<img v-if="liveStatus[liveDetail.status] == 'live'" src="https://wimg.588ku.com/gif620/20/04/23/79a7882dfb0c59497976fd8b3bfe60ef.gif" alt="" />
<!-- <img v-if="LiveStatus[liveDetail.status] == 'live'" src="https://wimg.588ku.com/gif620/20/04/23/79a7882dfb0c59497976fd8b3bfe60ef.gif" alt="" /> -->
<img v-if="LiveProps[liveDetail.status].isLive" src="https://wimg.588ku.com/gif620/20/04/23/79a7882dfb0c59497976fd8b3bfe60ef.gif" alt="" />
<img v-else src="https://wimg.588ku.com/gif620/20/04/23/79a7882dfb0c59497976fd8b3bfe60ef.gif" alt="" />
</template>
</div>
......@@ -40,6 +45,35 @@
</div>
</template>
<script type="text/ecmascript-6">
const CONSTANTS = Object.freeze({
TCPlayerConfig: {
autoplay: true, // 自动播放
loop: true, // 循环播放
// muted: false, // 是否静音
controlBar: { // 控制条配置
fullscreenToggle: false // 隐藏全屏按钮
},
webrtcConfig: { // webrtcConfig 参数列表
showLog: true // 打印webrtc日志
}
},
PLAYERDOMID: 'player-container-id',
LiveStatus: {
0: 'ready',
1: 'live',
2: 'end'
},
LiveEnums:{
READY:'ready',
LIVE:'live',
END:'end'
},
LiveProps:{
'0':{},
'1':{status:'直播',text:'正在直播',isLive:true},
'2':{status:'回放',text:'直播回放',isLive:false}
}
})
import { wxConfig } from '@/api'
export default {
name: 'LiveBox',
......@@ -50,11 +84,8 @@ export default {
showKf: false,
isShowGif: false,
videoStyle: '',
liveStatus: {
0: 'ready',
1: 'live',
2: 'end'
}
LiveStatus: CONSTANTS.LiveStatus,
LiveProps:CONSTANTS.LiveProps
}
},
props: {
......@@ -76,52 +107,89 @@ export default {
}
}
},
mounted() {
console.log(this.liveDetail, '============')
const _this = this
if (!this.IsIOS) {
this.changeGifStatus()
}
wxConfig.ready(() => {
this.createPlayerCover()
this.createPlayer()
this.play()
// const _this = this
// if (!this.IsIOS) {
// this.changeGifStatus()
// }
// wxConfig.ready(() => {
// if (Hls.isSupported()) {
// _this.video = document.getElementById('player-container-id')
// _this.hls = new Hls()
// // bind them together
// _this.hls.attachMedia(_this.video)
// }
// const playParams = {
// autoplay: true, // 自动播放
// loop: true, // 循环播放
// // muted: false, // 是否静音
// controlBar: { // 控制条配置
// fullscreenToggle: false // 隐藏全屏按钮
// },
// webrtcConfig: { // webrtcConfig 参数列表
// showLog: true // 打印webrtc日志
// }
// }
// _this.player = TCPlayer('player-container-id', playParams)
// wx.getNetworkType({
// success: (result) => {
// _this.player.ready(function() { // 设置播放器初始化完成后的回调
// const src = _this.LiveStatus[_this.liveDetail.status] == 'live' ? _this.liveDetail.playPath : (_this.liveDetail.liveBroadcastRecordingFileList.length ? _this.liveDetail.liveBroadcastRecordingFileList[0].videoUrl : '')
// _this.player.src(src)
// _this.player.poster()
// _this.player.play() // 播放视频
// _this.draggable(document.getElementById('live-box'), _this.openFullscreen)
// })
// }
// })
// _this.player.on('play', () => {
// this.changeGifStatus()
// })
// _this.player.on('pause', () => {
// this.changeGifStatus()
// })
// _this.dealTcPlayerErr14(_this)
// })
},
methods: {
createPlayerCover() {
!this.IsIOS && (this.isShowGif = true)
},
createPlayer() {
this.player = TCPlayer(CONSTANTS.PLAYERDOMID, CONSTANTS.TCPlayerConfig)
},
play() {
wxConfig.ready(() => {
wx.getNetworkType({
success: (result) => {
console.log('====',{result});
this.player.ready(()=> { // 设置播放器初始化完成后的回调
this.fixHls()
const src = this.LiveProps[this.liveDetail.status].isLive ? this.liveDetail.playPath : this.liveDetail.liveBroadcastRecordingFileList[0]?.videoUrl
this.player.src(src)
this.player.poster()
this.player.play() // 播放视频
this.draggable(document.getElementById('live-box'), this.openFullscreen)
})
}
})
})
},
fixHls() {
if (Hls.isSupported()) {
_this.video = document.getElementById('player-container-id')
_this.hls = new Hls()
this.video = document.getElementById(CONSTANTS.PLAYERDOMID)
this.hls = new Hls()
// bind them together
_this.hls.attachMedia(_this.video)
}
const playParams = {
autoplay: true, // 自动播放
loop: true, // 循环播放
// muted: false, // 是否静音
controlBar: { // 控制条配置
fullscreenToggle: false // 隐藏全屏按钮
},
webrtcConfig: { // webrtcConfig 参数列表
showLog: true // 打印webrtc日志
}
this.hls.attachMedia(this.video)
this.dealTcPlayerErr14()
}
_this.player = TCPlayer('player-container-id', playParams)
wx.getNetworkType({
success: (result) => {
_this.player.ready(function() { // 设置播放器初始化完成后的回调
const src = _this.liveStatus[_this.liveDetail.status] == 'live' ? _this.liveDetail.playPath : (_this.liveDetail.liveBroadcastRecordingFileList.length ? _this.liveDetail.liveBroadcastRecordingFileList[0].videoUrl : '')
_this.player.src(src)
_this.player.poster()
_this.player.play() // 播放视频
_this.draggable(document.getElementById('live-box'), _this.openFullscreen)
})
}
})
// _this.player.on('play', () => {
// this.changeGifStatus()
// })
// _this.player.on('pause', () => {
// this.changeGifStatus()
// })
_this.dealTcPlayerErr14()
})
},
methods: {
},
// 打开关闭全屏
openFullscreen(status = true) {
const [live] = document.getElementsByClassName('live-box')
......@@ -135,22 +203,22 @@ export default {
this.$emit('handleLiveFull', { isFull: this.videoFullscreen })
},
// 处理tcplayer错误码14
dealTcPlayerErr14(_this) {
_this.hls.on(Hls.Events.ERROR, function(event, data) {
dealTcPlayerErr14() {
this.hls.on(Hls.Events.ERROR, function(event, data) {
if (data.fatal) {
switch (data.type) {
case Hls.ErrorTypes.NETWORK_ERROR:
// try to recover network error
// console.log('fatal network error encountered, try to recover')
_this.hls.startLoad()
this.hls.startLoad()
break
case Hls.ErrorTypes.MEDIA_ERROR:
// console.log('fatal media error encountered, try to recover')
_this.hls.recoverMediaError()
this.hls.recoverMediaError()
break
default:
// cannot recover
_this.hls.destroy()
this.hls.destroy()
break
}
}
......@@ -160,7 +228,7 @@ export default {
this.isShowGif = !this.isShowGif
},
handleClose(e) {
// e.stopPropagation()
e.stopPropagation()
console.log('关闭--22222222222222222')
}
}
......@@ -176,7 +244,7 @@ export default {
height: 148px;
border-radius: 4px;
overflow: hidden;
-webkit-user-select: auto;
user-select: auto;
.small-box {
position: relative;
width: 52px;
......
<template>
<div
class="group-list"
ref="groupBox"
>
<div class="group-list" ref="groupBox">
<div class="mask"></div>
<template v-if="list.length">
<div
class="move"
ref="move"
>
<template v-for="(i,index) in list">
<div
:class="['item flex',{'group-item' :index == 0}]"
:key="index"
>
<img :src="i.imageUrl">
<div class="text">{{i.name}}刚刚参加了活动</div>
<div class="move" ref="move">
<template v-for="(i, index) in list">
<div :class="['item flex', { 'group-item': index == 0 }]" :key="index">
<img :src="i.imageUrl" />
<div class="text">{{ i.name }}刚刚参加了活动</div>
</div>
</template>
</div>
......@@ -23,7 +14,7 @@
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
export default {
name: 'MoveGroup',
props: ['groupInfo'],
......@@ -63,7 +54,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.group-list {
position: absolute;
left: 8px;
......@@ -120,4 +111,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
<template>
<van-action-sheet
v-model="showBox"
@click-overlay="onCancel"
:lock-scroll="false"
>
<van-action-sheet v-model="showBox" @click-overlay="onCancel" :lock-scroll="false">
<div class="box">
<template v-for="(i,index) in items">
<template v-for="(i, index) in items">
<template v-if="i.name">
<div
class="item flex"
:key="index"
>
<div class="item flex" :key="index">
<div class="label text-hide">
<span>*</span>
{{i.name}}
{{ i.name }}
</div>
<div class="value">
<template v-if="i.route">
<van-field
readonly
:placeholder="`请选择您的${i.name}`"
@click="jumpCarBrands(i.route)"
v-model="params[i.key]"
class="readonly"
right-icon="arrow"
>
</van-field>
<van-field readonly :placeholder="`请选择您的${i.name}`" @click="jumpCarBrands(i.route)" v-model="params[i.key]" class="readonly" right-icon="arrow"></van-field>
</template>
<template v-else>
<van-field
v-model="params[i.key]"
:placeholder="`请填写您的${i.name}`"
:maxlength="i.maxlength"
:type="i.type"
clearable
/>
<van-field v-model="params[i.key]" :placeholder="`请填写您的${i.name}`" :maxlength="i.maxlength" :type="i.type" clearable />
</template>
</div>
</div>
......@@ -44,25 +23,16 @@
本人已阅读且同意<span @click="jump('agreement')">《隐私协议》</span>
</div> -->
<template v-if="ISWXWORK">
<van-button
color="#b1b1b1"
class="btn disabled"
>企微暂不支持支付</van-button>
<van-button color="#b1b1b1" class="btn disabled">企微暂不支持支付</van-button>
</template>
<template v-else>
<van-button
color="#f13c3d"
class="btn"
@click="pay"
loading-text="支付中..."
:loading="payLoading"
>立即支付</van-button>
<van-button color="#f13c3d" class="btn" @click="pay" loading-text="支付中..." :loading="payLoading">立即支付</van-button>
</template>
</div>
</van-action-sheet>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
import { ssoApi } from '@/api'
import { Notify } from 'vant'
import store from '@/store'
......@@ -214,7 +184,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.box {
padding: 8px 16px 16px;
.item {
......
<template>
<div
class="serve"
v-if="list.length"
>
<div
class="box flex"
@click="showModal = true"
>
<div class="serve" v-if="list.length">
<div class="box flex" @click="showModal = true">
服务
<div class="serve-text flex">
<template v-for="(i,index) in list">
<template v-for="(i, index) in list">
<div :key="index" class="flex">
{{i.title}}
{{ i.title }}
<span v-if="index != list.length - 1">·</span>
</div>
</template>
</div>
<div class="sprite-icon icon-arrow"></div>
</div>
<serve-modal
v-model="showModal"
@cancel="showModal = false"
:list="list"
/>
<serve-modal v-model="showModal" @cancel="showModal = false" :list="list" />
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
export default {
name: 'Serve',
props: {
......@@ -47,7 +37,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
@import '@/assets/css/crowdfunding.scss';
.box {
color: #999999;
......@@ -61,7 +51,7 @@ export default {
margin-left: 20px;
overflow: hidden;
white-space: nowrap;
span{
span {
margin: 0 4px;
}
}
......@@ -69,4 +59,4 @@ export default {
margin-left: auto;
}
}
</style>
\ No newline at end of file
</style>
<template>
<van-action-sheet
v-model="showBox"
@click-overlay="onCancel"
@close="onCancel"
title="服务说明"
>
<van-action-sheet v-model="showBox" @click-overlay="onCancel" @close="onCancel" title="服务说明">
<div class="content">
<template v-for="(i,index) in list">
<div
:key="index"
class="item"
>
<div class="title">{{i.title}}</div>
<div class="value">{{i.content}}</div>
<template v-for="(i, index) in list">
<div :key="index" class="item">
<div class="title">{{ i.title }}</div>
<div class="value">{{ i.content }}</div>
</div>
</template>
</div>
</van-action-sheet>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
export default {
name: 'ServeModal',
props: {
......@@ -49,7 +41,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.van-popup--bottom.van-popup--round {
border-radius: 20px 20px 0 0;
}
......@@ -96,4 +88,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
<template>
<div
class="box"
v-if="evaList.length || faqList.length"
>
<div class="box" v-if="evaList.length || faqList.length">
<template v-if="evaList.length">
<div
class="sub-title flex"
@click="to('crowdfunding.evaluate',{ list: evaList, detail: detail })"
>
玩家心得({{evaList.length}})
<div class="sub-title flex" @click="to('crowdfunding.evaluate', { list: evaList, detail: detail })">
玩家心得({{ evaList.length }})
<div class="all flex">
<span>全部</span>
<div class="sprite-icon icon-arrow"></div>
</div>
</div>
<evaluate-item
:item="evaList[0]"
:hideBorder="!faqList.length"
indexType
:num="1"
:showAvatarNicknameFlag="detail.showAvatarNicknameFlag"
>
</evaluate-item>
<evaluate-item :item="evaList[0]" :hideBorder="!faqList.length" indexType :num="1" :showAvatarNicknameFlag="detail.showAvatarNicknameFlag"></evaluate-item>
</template>
<template v-if="faqList.length">
<div
class="sprite"
v-if="evaList.length"
></div>
<div
class="sub-title flex faq-title"
@click="to('crowdfunding.faq',{list:faqList})"
>
商品答疑({{faqList.length}})
<div class="sprite" v-if="evaList.length"></div>
<div class="sub-title flex faq-title" @click="to('crowdfunding.faq', { list: faqList })">
商品答疑({{ faqList.length }})
<div class="all flex">
<span>全部</span>
<div class="sprite-icon icon-arrow"></div>
</div>
</div>
<template v-for="(i,index) in faqList">
<FAQ-item
:key="index"
hideBorder
indexType
:item="i"
v-if="index < 1"
>
</FAQ-item>
<template v-for="(i, index) in faqList">
<FAQ-item :key="index" hideBorder indexType :item="i" v-if="index < 1"></FAQ-item>
</template>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
export default {
name: 'ShareGoods',
props: {
......@@ -81,7 +54,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
@import '@/assets/css/sharegoods.scss';
.box {
......
<template>
<canvas
:id="canvasId"
class="create"
></canvas>
<canvas :id="canvasId" class="create"></canvas>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
import Draw from '@/utils/draw'
export default {
name: 'createOrderImg',
......@@ -99,7 +96,7 @@ export default {
labelList.push(formDescribeSecond)
valueList.push(formContentSecond)
}
labelList.push('支付定金')
valueList.push(`${payPrice}元`)
labelList.map((e, index) => {
......@@ -198,10 +195,10 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.create {
position: fixed;
top: -1000%;
left: -1000%;
}
</style>
\ No newline at end of file
</style>
......@@ -3,4 +3,4 @@ const componentsFiles = require.context(`./`, true, /.vue$/)
componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default
Vue.component(component.name, component)
})
\ No newline at end of file
})
......@@ -4,13 +4,13 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-28 10:13:38
* @LastEditTime: 2022-09-23 16:48:50
*/
// 本地环境配置
module.exports = {
title: '加载中...',
request: {
baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址,
baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间
timeout: 180000,
// 携带凭证
......@@ -27,22 +27,22 @@ module.exports = {
logout_function: 'reLogin',
code_message_map: {}
},
secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b",
miniprogramInfo:{
username:'gh_21f69fe893fc',
miniprogramName:'广汇',
logo:'gh',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
miniprogramInfo: {
username: 'gh_21f69fe893fc',
miniprogramName: '广汇',
logo: 'gh',
envVersion: 'trial',
appid:'wxfe82b8d65d07808f'
appid: 'wxfe82b8d65d07808f'
},
// shopmall_id: "gh_e983752bf563", //嘀加
appid: 'wx56bed167ad463f70', //公众号appid 云商 wx1cf40dc91c28a7fd test02 wx56bed167ad463f70
sign: {
appKey: "48e5e13229b82c1b4e6e8c96151f0637",
format: "json",
locale: "zh_CN",
source: "scrm-main",
v: "1.0.0",
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
format: 'json',
locale: 'zh_CN',
source: 'scrm-main',
v: '1.0.0'
},
vconsole: true
}
\ No newline at end of file
}
......@@ -4,7 +4,7 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-29 15:35:47
* @LastEditTime: 2022-09-24 12:55:08
*/
// 兼容 IE
// https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#babelpolyfill
......@@ -14,7 +14,7 @@ import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import api from './api'
// import api from './api'
import { fetchConfig, cfg } from '@/config'
import '@/assets/css/index.scss'
import { bus, tools, store as local, util } from './utils'
......@@ -24,7 +24,7 @@ import { components } from '@/plugins/vant'
import { VueJsonp } from 'vue-jsonp'
Vue.use(VueJsonp)
components.forEach(component => Vue.use(component))
Vue.prototype.api = api
// Vue.prototype.api = api
Vue.prototype.bus = bus
Vue.prototype.tools = tools
Vue.prototype.local = local
......@@ -47,7 +47,8 @@ let body = document.getElementsByTagName('head')[0],
IsIOS = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent),
ISMiniprogram = window.__wxjs_environment === 'miniprogram'
WXJDK.src = '//res.wx.qq.com/open/js/jweixin-1.2.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'
WWJDK.src = '//open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js'
ISWXWORK = true
......
export {
}
\ No newline at end of file
export {}
......@@ -7,97 +7,5 @@
* @LastEditTime: 2021-06-23 11:44:59
*/
// 按需全局引入 vant组件
import {
Button,
List,
Cell,
Tabbar,
TabbarItem,
NavBar,
Search,
ActionSheet,
CellGroup,
Image as VanImage,
Tag,
Field,
Stepper,
Divider,
Step,
Steps,
NoticeBar,
RadioGroup,
Radio,
Uploader,
Tab,
Tabs,
DropdownMenu,
DropdownItem,
Grid,
GridItem,
Popup,
Calendar,
Cascader,
Checkbox,
CheckboxGroup,
Notify,
Icon,
Empty,
PullRefresh,
Picker,
Dialog,
ShareSheet,
Overlay,
loading,
SwipeCell,
Swipe,
SwipeItem,
IndexBar,
IndexAnchor
} from 'vant'
export const components = [
Button,
List,
Cell,
Tabbar,
TabbarItem,
NavBar,
Search,
ActionSheet,
CellGroup,
VanImage,
Tag,
Field,
Stepper,
Divider,
Step,
Steps,
NoticeBar,
RadioGroup,
Radio,
Uploader,
Tab,
Tabs,
DropdownMenu,
DropdownItem,
Grid,
GridItem,
Popup,
Calendar,
Cascader,
Checkbox,
CheckboxGroup,
Notify,
Icon,
Empty,
PullRefresh,
Picker,
Dialog,
ShareSheet,
Overlay,
loading,
SwipeCell,
Swipe,
SwipeItem,
IndexBar,
IndexAnchor
]
\ No newline at end of file
import { Button, List, Cell, Tabbar, TabbarItem, NavBar, Search, ActionSheet, CellGroup, Image as VanImage, Tag, Field, Stepper, Divider, Step, Steps, NoticeBar, RadioGroup, Radio, Uploader, Tab, Tabs, DropdownMenu, DropdownItem, Grid, GridItem, Popup, Calendar, Cascader, Checkbox, CheckboxGroup, Notify, Icon, Empty, PullRefresh, Picker, Dialog, ShareSheet, Overlay, loading, SwipeCell, Swipe, SwipeItem, IndexBar, IndexAnchor } from 'vant'
export const components = [Button, List, Cell, Tabbar, TabbarItem, NavBar, Search, ActionSheet, CellGroup, VanImage, Tag, Field, Stepper, Divider, Step, Steps, NoticeBar, RadioGroup, Radio, Uploader, Tab, Tabs, DropdownMenu, DropdownItem, Grid, GridItem, Popup, Calendar, Cascader, Checkbox, CheckboxGroup, Notify, Icon, Empty, PullRefresh, Picker, Dialog, ShareSheet, Overlay, loading, SwipeCell, Swipe, SwipeItem, IndexBar, IndexAnchor]
......@@ -5,7 +5,7 @@ import store from '@/store'
import { util } from '@/utils'
// hack router push callback
const originalPush = Router.prototype.push
Router.prototype.push = function push (location, onResolve, onReject) {
Router.prototype.push = function push(location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch(err => err)
}
......@@ -14,7 +14,7 @@ Vue.use(Router)
const router = createRouter()
function createRouter () {
function createRouter() {
return new Router({
// mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath
base: process.env.BASE_URL,
......@@ -39,7 +39,7 @@ router.beforeEach((to, from, next) => {
})
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter () {
export function resetRouter() {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
......
......@@ -7,7 +7,7 @@ const pages = {
// noAuth: true,
backgroundColor: '#F7F7F7',
showAction: true
},
}
},
{
name: 'success',
......@@ -16,7 +16,7 @@ const pages = {
backgroundColor: '#FFF',
noAuth: true,
title: '参团成功'
},
}
},
{
name: 'agreement',
......@@ -101,4 +101,4 @@ Object.keys(pages).map(parent => {
})
})
export const keeps = keepAlives
export default routes
\ No newline at end of file
export default routes
......@@ -18,19 +18,19 @@ const state = {
updataCarInfo: Date.now()
}
const mutations = {
SET_ACTIVITY_INFO (state, value) {
SET_ACTIVITY_INFO(state, value) {
state.activityInfo = value
state.updataCarInfo = Date.now()
},
SET_PAGE_META (state, meta) {
SET_PAGE_META(state, meta) {
state.pageMeta = meta
},
PUSH_KEEP (state, name) {
PUSH_KEEP(state, name) {
if (!state.keepAlives.includes(name)) {
state.keepAlives.push(name)
}
},
REMOVE_KEEP (state, names) {
REMOVE_KEEP(state, names) {
state.keepAlives = state.keepAlives.reduce((arr, name) => {
if (!names.includes(name)) {
return arr.push(name)
......@@ -38,49 +38,51 @@ const mutations = {
return arr
}, [])
},
SET_LAST_PATH (state, path) {
SET_LAST_PATH(state, path) {
state.lastPath = path
}
}
const actions = {
setPageMeta ({ commit }, meta) {
setPageMeta({ commit }, meta) {
document.title = meta.title
commit('SET_PAGE_META', meta)
},
pushKeep ({ commit }, name) {
pushKeep({ commit }, name) {
commit('PUSH_KEEP', name)
},
removeKeep ({ commit }, names) {
removeKeep({ commit }, names) {
commit('REMOVE_KEEP', names)
},
setActivityInfo ({ commit }, value) {
setActivityInfo({ commit }, value) {
commit('SET_ACTIVITY_INFO', value)
},
wxLogin ({ dispatch }, { code, redirectUrl, appId }) {
ssoApi.login({
code,
appId: window.$fetchConfig.appid,
state: 'snsapi_userinfo'
}).then(({ code, data, message }) => {
let route = state.lastPath == 'crowdfunding' ? '' : state.lastPath || ''
route = route.replace('.', '/')
if (code == '0') {
util.setUserInfo(data)
util.setSessionId(data.sessionId)
dispatch('registerHttp', data.sessionId)
state.showWindow = true
let query = window.location.href.split('/split/')[1]
let pageQuery = query ? decodeURIComponent(query) : ''
pageQuery = pageQuery.replace(/\|/g, '&')
let url = `${redirectUrl}#/${route}`
if (pageQuery) url += `?${pageQuery}`
window.location.replace(url)
} else {
Notify(message)
}
})
wxLogin({ dispatch }, { code, redirectUrl, appId }) {
ssoApi
.login({
code,
appId: window.$fetchConfig.appid,
state: 'snsapi_userinfo'
})
.then(({ code, data, message }) => {
let route = state.lastPath == 'crowdfunding' ? '' : state.lastPath || ''
route = route.replace('.', '/')
if (code == '0') {
util.setUserInfo(data)
util.setSessionId(data.sessionId)
dispatch('registerHttp', data.sessionId)
state.showWindow = true
let query = window.location.href.split('/split/')[1]
let pageQuery = query ? decodeURIComponent(query) : ''
pageQuery = pageQuery.replace(/\|/g, '&')
let url = `${redirectUrl}#/${route}`
if (pageQuery) url += `?${pageQuery}`
window.location.replace(url)
} else {
Notify(message)
}
})
},
getWxCode ({ dispatch }) {
getWxCode({ dispatch }) {
let [redirectUrl] = window.location.href.split('?')
let params = util.getPageQuery()
let arr = []
......@@ -98,49 +100,52 @@ const actions = {
util.setAppId(appid)
window.location.href = `${wxUrl}&state=STATE#wechat_redirect`
},
login ({ dispatch }) {
login({ dispatch }) {
let [redirectUrl] = window.location.href.split('?')
const isWxWork = util.getLocalStorage('is_wxwork')
const code = util.getPageQuery('code')
let appId = util.getAppId()
util.showLoading()
if (process.env.NODE_ENV == 'development') { //本地开发
if (process.env.NODE_ENV == 'development') {
//本地开发
if (code) {
const target = isWxWork ? 'wwLogin' : 'login'
const PARAMS = isWxWork ? {
code,
corpId: appId,
getUserInfoFlag: false
} : {
code,
appId: window.$fetchConfig.appid,
state: 'snsapi_userinfo'
}
ssoApi[target](PARAMS)
.then(({ code, data, message }) => {
let route = state.lastPath == 'crowdfunding' ? '' : state.lastPath || ''
route = route.replace('.', '/')
if (code == '0') {
let sessionId = '', userInfo = {}
if (isWxWork) {
userInfo = data.loginList[0]
sessionId = userInfo.sessionId
} else {
userInfo = data
sessionId = data.sessionId
}
util.setUserInfo(userInfo)
util.setSessionId(sessionId)
dispatch('registerHttp', sessionId)
state.showWindow = true
let query = window.location.href.split('/split/')[1]
let pageQuery = query ? decodeURIComponent(query) : ''
pageQuery = pageQuery.replace(/\|/g, '&')
let url = `${redirectUrl}#/${route}`
if (pageQuery) url += `?${pageQuery}`
window.location.replace(url)
} else Notify(message)
})
const PARAMS = isWxWork
? {
code,
corpId: appId,
getUserInfoFlag: false
}
: {
code,
appId: window.$fetchConfig.appid,
state: 'snsapi_userinfo'
}
ssoApi[target](PARAMS).then(({ code, data, message }) => {
let route = state.lastPath == 'crowdfunding' ? '' : state.lastPath || ''
route = route.replace('.', '/')
if (code == '0') {
let sessionId = '',
userInfo = {}
if (isWxWork) {
userInfo = data.loginList[0]
sessionId = userInfo.sessionId
} else {
userInfo = data
sessionId = data.sessionId
}
util.setUserInfo(userInfo)
util.setSessionId(sessionId)
dispatch('registerHttp', sessionId)
state.showWindow = true
let query = window.location.href.split('/split/')[1]
let pageQuery = query ? decodeURIComponent(query) : ''
pageQuery = pageQuery.replace(/\|/g, '&')
let url = `${redirectUrl}#/${route}`
if (pageQuery) url += `?${pageQuery}`
window.location.replace(url)
} else Notify(message)
})
} else dispatch('getWxCode')
} else {
if (isWxWork) {
......@@ -154,7 +159,7 @@ const actions = {
}
}
},
navigation ({ dispatch }) {
navigation({ dispatch }) {
const isWxWork = util.getLocalStorage('is_wxwork')
let params = util.getPageQuery() //从链接获取
if (Object.keys(params).length && params.id) util.setLocalStorage('wx_scrm_link_params', params)
......@@ -176,7 +181,7 @@ const actions = {
return
} else dispatch('login')
},
registerHttp ({ }, sessionId = '') {
registerHttp({}, sessionId = '') {
window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: sessionId } })
}
}
......
export function Audio (url, callBack) {
export function Audio(url, callBack) {
// this.IsIOS = false
this.IsIOS = window.$IsIOS
this.audioContext = new (window.AudioContext || window.webkitAudioContext || window.mozAudioContext)()
......@@ -38,7 +38,7 @@ export function Audio (url, callBack) {
console.log('播放——————————————', this.sourceNode)
this.isPlayingBGM = true
}
let loadAndAutoPlay = (audioUrl) => {
let loadAndAutoPlay = audioUrl => {
let _this = this
if (!this.IsIOS) {
const audioContext = this.audioContext
......@@ -50,12 +50,13 @@ export function Audio (url, callBack) {
audioContext.decodeAudioData(xhr.response, buffer => {
this.buffer = buffer
if (buffer) {
if (wx.getNetworkType) wx.getNetworkType({
success: function (res) {
_this._playSourceNode()
callBack()
}
})
if (wx.getNetworkType)
wx.getNetworkType({
success: function (res) {
_this._playSourceNode()
callBack()
}
})
else {
_this._playSourceNode()
callBack()
......
......@@ -4,7 +4,7 @@ const _canvasObject_ = Symbol('_canvasObject_')
class Draw {
[_ctx_] = null;
[_pixelRatio_] = null;
[_canvasObject_] = null;
[_canvasObject_] = null
constructor(_this_, canvasObject) {
this[_canvasObject_] = canvasObject
this[_ctx_] = _this_.ctx.getContext('2d')
......@@ -19,17 +19,10 @@ class Draw {
this[_ctx_].save()
}
drawImages (imageParams, callback) {
drawImages(imageParams, callback) {
this[_ctx_].beginPath()
this[_ctx_].save()
let {
borderRadius,
height,
width,
url,
x,
y,
} = imageParams
let { borderRadius, height, width, url, x, y } = imageParams
height = this.toRpx(height)
width = this.toRpx(width)
x = this.toRpx(x)
......@@ -40,7 +33,7 @@ class Draw {
height,
width,
x,
y,
y
})
this[_ctx_].clip()
}
......@@ -52,15 +45,15 @@ class Draw {
callback()
}
}
toRpx (val) {
toRpx(val) {
return this[_pixelRatio_] * val
}
getTextWidth (text, fontSize) {
getTextWidth(text, fontSize) {
let font = this[_ctx_].font.split('px')[1]
if (fontSize) this[_ctx_].font = `400 ${fontSize}px${font}`
return this[_ctx_].measureText(text).width
}
drawFill (x, y, width, height, color) {
drawFill(x, y, width, height, color) {
this[_ctx_].beginPath()
this[_ctx_].fillStyle = color
this[_ctx_].fillRect(x, y, width, height)
......@@ -68,25 +61,8 @@ class Draw {
this[_ctx_].restore()
this[_ctx_].save()
}
drawText (textParams) {
let {
textDecoration,
textBaseline,
lineHeight,
fontWeight,
textAlign,
textWidth,
maxWidth,
fontSize,
lastFont,
opacity,
lineNum,
width,
color,
text,
x,
y,
} = textParams
drawText(textParams) {
let { textDecoration, textBaseline, lineHeight, fontWeight, textAlign, textWidth, maxWidth, fontSize, lastFont, opacity, lineNum, width, color, text, x, y } = textParams
let text_width = this.getTextWidth(text),
font = this[_ctx_].font.split('px')[1]
textAlign = textAlign || 'left'
......@@ -103,7 +79,7 @@ class Draw {
textAlign,
fontSize,
text,
x,
x
})
if (textParams.border) {
let boxX = this.toRpx(textParams.x - 4.5),
......@@ -147,7 +123,7 @@ class Draw {
ellipsis = error
}
if (ellipsis) newText += '…'
if(lastFont) newText += lastFont
if (lastFont) newText += lastFont
this[_ctx_].fillText(newText, x, y, maxWidth)
if (checkTextDecoration(textDecoration)) {
this.drawDecoration({
......@@ -180,7 +156,8 @@ class Draw {
textRowArr.map((e, index) => {
if (this.getTextWidth(e) > viewWidth && index == lineNum - 1) {
try {
let lastText = '', lastArr = e.split('')
let lastText = '',
lastArr = e.split('')
lastArr.map(i => {
lastText += i
if (this.getTextWidth(lastText) > width - fontX - this.getTextWidth('…')) throw lastText
......@@ -195,7 +172,7 @@ class Draw {
this[_ctx_].fillText(e, x, textHeight, maxWidth)
if (checkTextDecoration(textDecoration)) {
this.drawDecoration({
'y': textHeight,
y: textHeight,
textDecoration,
textBaseline,
textAlign,
......@@ -216,17 +193,9 @@ class Draw {
this[_ctx_].stroke()
}
drawLine (lineParams, callback) {
drawLine(lineParams, callback) {
this[_ctx_].beginPath()
let {
opacity,
startX,
startY,
width,
color,
endX,
endY,
} = lineParams
let { opacity, startX, startY, width, color, endX, endY } = lineParams
startX = this.toRpx(startX)
startY = this.toRpx(startY)
width = this.toRpx(width)
......@@ -243,40 +212,31 @@ class Draw {
if (callback) callback()
}
setLineY = params => {
let {
textDecoration,
textBaseline,
fontSize,
y
} = params
let { textDecoration, textBaseline, fontSize, y } = params
let type = {
underline: {
top: y + fontSize,
middle: y + fontSize / 2,
bottom: y,
normal: y,
normal: y
},
overline: {
top: y,
middle: y - fontSize / 2,
bottom: y - fontSize,
normal: y,
normal: y
},
'line-through': {
top: y + fontSize / 2,
middle: y - fontSize / 2,
bottom: y,
normal: y,
normal: y
}
}
return type[textDecoration][textBaseline]
}
setLineX ({
textAlign,
text,
x
}) {
setLineX({ textAlign, text, x }) {
let textWidth = this.getTextWidth(text)
let type = {
left: x,
......@@ -286,14 +246,8 @@ class Draw {
return type[textAlign]
}
drawRadiusRect ({
borderRadius,
height,
width,
x,
y,
}) {
let radius = typeof borderRadius === 'string' ? (Number(borderRadius.split('%')[0]) / 100 * width) / 2 : borderRadius / 2
drawRadiusRect({ borderRadius, height, width, x, y }) {
let radius = typeof borderRadius === 'string' ? ((Number(borderRadius.split('%')[0]) / 100) * width) / 2 : borderRadius / 2
radius = radius || 0
this[_ctx_].beginPath()
for (let i = 1; i < 5; i++) {
......@@ -302,27 +256,17 @@ class Draw {
this[_ctx_].arc(arcX, arcY, radius, 2 * Math.PI * ((i - 1) / 4), 2 * Math.PI * (i / 4))
}
}
getFontWidth ({
textAlign,
fontSize,
text,
x
}) {
getFontWidth({ textAlign, fontSize, text, x }) {
let type = {
left: x,
center: x - fontSize * text.length / 2,
center: x - (fontSize * text.length) / 2,
right: x - fontSize * text.length
}
return type[textAlign] < 0 ? 0 : type[textAlign]
}
drawDecoration (params) {
let {
newText,
opacity,
y,
x
} = params
drawDecoration(params) {
let { newText, opacity, y, x } = params
let lineX = x
let lineY = y
lineX = this.setLineX(params)
......@@ -333,6 +277,6 @@ class Draw {
}
}
const checkTextDecoration = textDecoration => {
return (textDecoration && (textDecoration === 'underline' || textDecoration === 'overline' || textDecoration === 'line-through'))
return textDecoration && (textDecoration === 'underline' || textDecoration === 'overline' || textDecoration === 'line-through')
}
export default Draw
\ No newline at end of file
export default Draw
......@@ -12,4 +12,4 @@ import * as tool from './tools'
const { debounce, throttle, ...tools } = tool
import * as constants from './constants'
import store from './store'
export { bus, tools, debounce, throttle, constants, store, util }
\ No newline at end of file
export { bus, tools, debounce, throttle, constants, store, util }
......@@ -11,10 +11,10 @@ import store from 'storejs'
export default {
...store,
exp: {
set: function(key, val, exp = 24 * 60 * 60 * 1000) {
set: function (key, val, exp = 24 * 60 * 60 * 1000) {
store.set(key, { val: val, exp: exp, time: new Date().getTime() })
},
get: function(key) {
get: function (key) {
var info = store.get(key)
if (!info) {
return null
......@@ -27,6 +27,6 @@ export default {
}
},
consts: {
USER_KEY: 'USER_KEY',
USER_KEY: 'USER_KEY'
}
}
\ No newline at end of file
}
......@@ -32,7 +32,7 @@ export function parseTime(time, cFormat) {
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
// Note: getDay() returns 0 on Sunday
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value]
}
......@@ -86,21 +86,13 @@ export function param2Obj(url) {
if (!search) {
return {}
}
return JSON.parse(
'{"' +
decodeURIComponent(search)
.replace(/"/g, '\\"')
.replace(/&/g, '","')
.replace(/=/g, '":"')
.replace(/\+/g, ' ') +
'"}'
)
return JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"').replace(/\+/g, ' ') + '"}')
}
export function debounce(fn, delay = 500) {
// timer 是在闭包中的
let timer = null
return function() {
return function () {
clearTimeout(timer)
timer = setTimeout(() => {
fn.apply(this, arguments)
......@@ -110,13 +102,13 @@ export function debounce(fn, delay = 500) {
export function throttle(fn, delay = 500) {
let timer = null
return function(e) {
return function (e) {
if (timer) {
return
}
timer = setTimeout(() => {
fn.apply(this, arguments)
// fn(e)
// fn(e)
timer = null
}, delay)
}
......@@ -128,7 +120,7 @@ export function throttle(fn, delay = 500) {
export function deepClone(target) {
// 定义一个变量
let result
// 如果当前需要深拷贝的是一个对象的话
// 如果当前需要深拷贝的是一个对象的话
if (typeof target === 'object') {
// 如果是一个数组的话
if (Array.isArray(target)) {
......@@ -140,7 +132,7 @@ export function deepClone(target) {
// 判断如果当前的值是null的话;直接赋值为null
} else if (target === null) {
result = null
// 判断如果当前的值是一个RegExp对象的话,直接赋值
// 判断如果当前的值是一个RegExp对象的话,直接赋值
} else if (target.constructor === RegExp) {
result = target
} else {
......@@ -175,18 +167,18 @@ export function fixed(num, decimal) {
*/
export function transformDecimal(number, i) {
let decimalNum = null
// 先转换为数值型
// 先转换为数值型
let num = Number(number)
// 判断是否为数值型
// 判断是否为数值型
if (!isNaN(num)) {
// 切分整数与小数
let arr = num.toString().split('.')
// 是小数且小数位大于保留个数
// 是小数且小数位大于保留个数
if (arr.length > 1 && arr[1].length > i) {
// 小数部分字符串
let decimal = arr[1].slice(i, i + 1)
// toFixed 有 bug,四舍六入五随机
// 当四舍五入的数为 5,给其 + 1
// toFixed 有 bug,四舍六入五随机
// 当四舍五入的数为 5,给其 + 1
if (decimal === '5') {
// 这里可能会存在 0.1 ** 5 = 0.000010000000000000003 但不影响四舍五入
num += Math.pow(0.1, i + 1)
......@@ -198,4 +190,4 @@ export function transformDecimal(number, i) {
decimalNum = Number(decimalNum).toFixed(i)
}
return decimalNum
}
\ No newline at end of file
}
......@@ -162,7 +162,7 @@ const jumpChildrenPage = (to, params) => {
const setClipboardData = data => {
wx.setClipboardData({
data,
success (res) {
success(res) {
Toast('复制成功')
}
})
......@@ -207,8 +207,7 @@ const setCookie = (c_name, value, expiredays = 365) => {
let exdate = new Date()
console.log(c_name, value)
exdate.setDate(exdate.getDate() + expiredays)
document.cookie = c_name + '=' + value +
((expiredays == null) ? '' : ';expires=' + exdate.toGMTString())
document.cookie = c_name + '=' + value + (expiredays == null ? '' : ';expires=' + exdate.toGMTString())
}
/**获取cookie */
const getCookie = c_name => {
......@@ -231,24 +230,23 @@ const toUnicode = (chineseStr = '') => {
}
return unicodeStr
}
const isMobileDevice = () => {//判断当前设备是否为移动端
const isMobileDevice = () => {
//判断当前设备是否为移动端
const ua = navigator.userAgent.toLowerCase()
const t1 = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(
ua
)
const t2 = !ua.match("iphone") && navigator.maxTouchPoints > 1
const t1 = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(ua)
const t2 = !ua.match('iphone') && navigator.maxTouchPoints > 1
return t1 || t2
}
/**秒数转天时分秒*/
const date_format = num => {
const addZero = i => i < 10 ? `0${i}` : `${i}`
//计算剩余的天数
const addZero = i => (i < 10 ? `0${i}` : `${i}`)
//计算剩余的天数
let days = addZero(parseInt(num / 60 / 60 / 24, 10))
//计算剩余的小时
let hours = addZero(parseInt(num / 60 / 60 % 24, 10))
//计算剩余的分钟
let minutes = addZero(parseInt(num / 60 % 60, 10))
//计算剩余的小时
let hours = addZero(parseInt((num / 60 / 60) % 24, 10))
//计算剩余的分钟
let minutes = addZero(parseInt((num / 60) % 60, 10))
//计算剩余的秒数
let second = addZero(parseInt(num % 60, 10))
if (days == 0) {
......@@ -272,7 +270,7 @@ const draggable = (drag, fun, target) => {
var disX, disY, left, top, starX, starY, oLeft, oTop
drag.addEventListener(startEvt, startFun)
function startFun (event) {
function startFun(event) {
if (!drag.id) return
// 阻止页面的滚动,缩放
event.preventDefault()
......@@ -292,7 +290,7 @@ const draggable = (drag, fun, target) => {
document.addEventListener(endEvt, endFun)
}
function moveFun (event) {
function moveFun(event) {
// 兼容IE浏览器
var e = event || window.event
left = (e.touches ? e.touches[0].clientX : e.clientX) - disX
......@@ -311,13 +309,13 @@ const draggable = (drag, fun, target) => {
}
drag.style.left = left + 'px'
drag.style.top = top + 'px'
}
function endFun (event) {
function endFun(event) {
drag.style.cursor = ''
document.removeEventListener(moveEvt, moveFun)
document.removeEventListener(endEvt, endFun)
if (oLeft == drag.offsetLeft && oTop == drag.offsetTop && fun) { // 点击
if (oLeft == drag.offsetLeft && oTop == drag.offsetTop && fun) {
// 点击
fun()
}
}
......
<template>
<div
class="car-brands"
:key="upData"
>
<van-index-bar
highlight-color="#FC5B32"
:index-list="indexList"
@change="indexNumber = $event"
ref="indexBar"
>
<template v-for="(item,index) in brandList">
<div class="car-brands" :key="upData">
<van-index-bar highlight-color="#FC5B32" :index-list="indexList" @change="indexNumber = $event" ref="indexBar">
<template v-for="(item, index) in brandList">
<div :key="index">
<van-index-anchor :index="item.letter" />
<template v-for="(i,ind) in item.list">
<van-cell
:key="ind"
@click="showCarSeries(i)"
>
<template v-for="(i, ind) in item.list">
<van-cell :key="ind" @click="showCarSeries(i)">
<template #title>
<img
:src="i.logoUrl"
v-if="i.logoUrl"
>
<span>{{i.name}}</span>
<img :src="i.logoUrl" v-if="i.logoUrl" />
<span>{{ i.name }}</span>
</template>
</van-cell>
</template>
......@@ -32,7 +18,7 @@
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
import { carLifeApi } from '@/api'
export default {
......@@ -116,7 +102,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.car-brands {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
......@@ -137,4 +123,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
<template>
<div class="layout">
<van-index-bar
highlight-color="#FC5B32"
class="list"
:index-list="indexList"
:key="updata"
>
<template v-for="(item,index) in list">
<div
class="item"
:key="index"
>
<van-index-bar highlight-color="#FC5B32" class="list" :index-list="indexList" :key="updata">
<template v-for="(item, index) in list">
<div class="item" :key="index">
<van-index-anchor :index="item.name" />
<template v-if="item.done">
<template v-if="item.childs && item.childs.length">
<template v-for="(i,ind) in item.childs">
<div
class="card flex"
:key="ind"
@click="showCarType(i,item)"
>
{{i.name}}
<template v-for="(i, ind) in item.childs">
<div class="card flex" :key="ind" @click="showCarType(i, item)">
{{ i.name }}
</div>
</template>
</template>
<template v-else>
<div class="loading text-center">
<van-icon
name="fail"
color="#282829"
size="80"
/>
<van-icon name="fail" color="#282829" size="80" />
<div>暂无该车型</div>
</div>
</template>
</template>
<template v-else>
<div class="loading text-center">
<van-loading
color="#282829"
size="80"
text-size="18"
vertical
>加载中...</van-loading>
<van-loading color="#282829" size="80" text-size="18" vertical>加载中...</van-loading>
</div>
</template>
</div>
</template>
</van-index-bar>
<van-popup
v-model="showType"
position="right"
class="popup"
>
<van-popup v-model="showType" position="right" class="popup">
<div class="car-view">
<template v-for="(i,index) in carTypeList">
<div
:key="index"
class="flex item"
@click="choose(i)"
>{{i.name}}</div>
<template v-for="(i, index) in carTypeList">
<div :key="index" class="flex item" @click="choose(i)">{{ i.name }}</div>
</template>
</div>
</van-popup>
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
import { carLifeApi } from '@/api'
export default {
name: 'carSeries',
......@@ -161,7 +130,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.list {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
......@@ -203,4 +172,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
<template>
<div class="box">
<template v-for="(i,index) in list">
<div
class="item"
:key="index"
:style="`padding-bottom:${index == list.length -1 ?'16px':''};`"
>
<evaluate-item
:item="i"
:hideBorder="index == list.length - 1"
:num="index + 1"
:showAvatarNicknameFlag="detail.showAvatarNicknameFlag"
/>
<template v-for="(i, index) in list">
<div class="item" :key="index" :style="`padding-bottom:${index == list.length - 1 ? '16px' : ''};`">
<evaluate-item :item="i" :hideBorder="index == list.length - 1" :num="index + 1" :showAvatarNicknameFlag="detail.showAvatarNicknameFlag" />
</div>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
export default {
name: 'evaluate',
data () {
......@@ -41,7 +32,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.box {
padding-bottom: 100px;
.item {
......
<template>
<div class="box">
<template v-for="(i,index) in list">
<div
class="item"
:key="index"
:style="`padding-bottom:${index == list.length -1 ?'16px':''};`"
>
<FAQ-item
:item="i"
:hideBorder="index == list.length - 1"
/>
<template v-for="(i, index) in list">
<div class="item" :key="index" :style="`padding-bottom:${index == list.length - 1 ? '16px' : ''};`">
<FAQ-item :item="i" :hideBorder="index == list.length - 1" />
</div>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
export default {
name: 'faq',
data () {
......@@ -36,7 +29,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.box {
padding-bottom: 100px;
.item {
......@@ -44,4 +37,4 @@ export default {
padding: 0 16px;
}
}
</style>
\ No newline at end of file
</style>
<template>
<div class="imagePreview">
<template v-if="item">
<van-image-preview
v-model="show"
:images="item"
@change="change"
:show-index="false"
:start-position="index"
ref="preview"
asyncClose
>
</van-image-preview>
<van-image-preview v-model="show" :images="item" @change="change" :show-index="false" :start-position="index" ref="preview" asyncClose></van-image-preview>
<template v-if="textStyle">
<div
class="text"
:style="textStyle"
>
{{experience}}
<div class="text" :style="textStyle">
{{ experience }}
</div>
</template>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
import { ImagePreview } from 'vant'
export default {
name: 'imagePreview',
......@@ -62,7 +49,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.imagePreview {
position: relative;
width: 100vw;
......@@ -79,4 +66,4 @@ export default {
z-index: 2;
}
}
</style>
\ No newline at end of file
</style>
......@@ -15,11 +15,7 @@
<!--👇 客服&订单按钮 -->
<div class="page-btn">
<template
v-if="detail.customerServiceName
|| detail.customerServicePhone
|| detail.customerServiceQrImg
|| detail.customerServerUrl">
<template v-if="detail.customerServiceName || detail.customerServicePhone || detail.customerServiceQrImg || detail.customerServerUrl">
<div class="page-item flex" @click="clickKF" @touchstart="touchstart" @touchend="touchend">
<div class="sprite-icon icon-kf"></div>
客服
......@@ -45,7 +41,7 @@ v-if="detail.customerServiceName
</template>
<!--👇 背景音乐按钮 -->
<template v-if="audioFlag">
<div :class="['music',{musicOff}]" @click="audioAutoPlay">
<div :class="['music', { musicOff }]" @click="audioAutoPlay">
<template v-if="musicOff">
<div class="sprite-icon icon-music-off" @click="userOff = 0"></div>
</template>
......@@ -67,8 +63,14 @@ v-if="detail.customerServiceName
<!--👇 活动人数预览 -->
<div class="box">
<div class="group-title flex">
<div><span>{{ groupInfo.groupQuantity }}</span>人已参团</div>
<div> <span>{{ groupInfo.viewAmount }}</span>人已浏览</div>
<div>
<span>{{ groupInfo.groupQuantity }}</span>
人已参团
</div>
<div>
<span>{{ groupInfo.viewAmount }}</span>
人已浏览
</div>
</div>
<template v-if="detail.showAvatarNicknameFlag == 2 && groupInfo.arr && groupInfo.arr.length">
<van-swipe class="group-swipe" vertical :show-indicators="false" :touchable="false" autoplay="5000">
......@@ -91,13 +93,13 @@ v-if="detail.customerServiceName
<div class="box progress-box" id="progress">
<div class="progress-title">活动进度</div>
<div class="progress-bar">
<div class="bar flex" :style="{ left: `${progress > 89 ? 89: progress < 11 ? 10 : progress}%` }">
<div class="bar flex" :style="{ left: `${progress > 89 ? 89 : progress < 11 ? 10 : progress}%` }">
<div class="sprite-icon icon-flash"></div>
<div class="number">{{ progress ? `${count}%` : '0%' }}</div>
<div :class="['arrow',{'right':count > 91}]"></div>
<div class="number">{{ progress ? `${count}%` : '0%' }}</div>
<div :class="['arrow', { right: count > 91 }]"></div>
</div>
<div class="progress">
<div class="line" :style="{ width: `${progress > 100 ? 100 : progress < 11? 10 : progress}%` }">
<div class="line" :style="{ width: `${progress > 100 ? 100 : progress < 11 ? 10 : progress}%` }">
<div class="stripe"></div>
</div>
</div>
......@@ -130,10 +132,10 @@ v-if="detail.customerServiceName
<video :src="i.activityVideo" :ref="`video-${index}`" :controls="false" preload @loadedmetadata="loadedmetadata($event)"></video>
<div class="mask">
<img :src="i.activityVideoCoverImage" />
<div :class="['sprite-icon xy-center',detail.activityVideos.length == 1 ?'icon-big-play':'icon-play']"></div>
<div :class="['sprite-icon xy-center', detail.activityVideos.length == 1 ? 'icon-big-play' : 'icon-play']"></div>
<div class="line-box flex">
<div class="line"></div>
<div v-if="i.activityVideoTime" class="duration">{{date_format(i.activityVideoTime)}}</div>
<div v-if="i.activityVideoTime" class="duration">{{ date_format(i.activityVideoTime) }}</div>
</div>
</div>
</div>
......@@ -164,9 +166,7 @@ v-if="detail.customerServiceName
<template v-if="detail.distance">{{ detail.distance }}km</template>
<template v-else>
<div class="auth-text">
获取门店距离
</div>
<div class="auth-text">获取门店距离</div>
</template>
</div>
</template>
......@@ -178,15 +178,14 @@ v-if="detail.customerServiceName
<template v-if="detail.activityDetail">
<div class="activity-info" v-html="decodeURIComponent(detail.activityDetail)"></div>
<div class="tips text-center">
<img src="https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/logo.png" alt="技术支持:广联数科">
<img src="https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/logo.png" alt="技术支持:广联数科" />
</div>
</template>
<!--👇 客服弹窗 -->
<kf-modal v-model="showKf" :detail="detail" />
<!--👇 IOS音频播放 -->
<template v-if="detail.activityMusic">
<video id="audio" style="object-fit:contain;" controls webkit-playsinline="true" playsinline="true" x5-video-player-type="h5-page" preload="auto" :autoplay="!detail.liveBroadcastRoomId" loop>
</video>
<video id="audio" style="object-fit: contain" controls webkit-playsinline="true" playsinline="true" x5-video-player-type="h5-page" preload="auto" :autoplay="!detail.liveBroadcastRoomId" loop></video>
</template>
</div>
</div>
......
<template>
<div class="layout">
<div class="title">左右滑动查看核销凭证</div>
<div
class="content"
@touchend="end"
>
<van-swipe
class="img-box"
:key="updata"
indicator-color="#FFFFFF"
:loop="false"
@change="change"
:style="swipeStyle"
:show-indicators="false"
ref="swipe"
duration="200"
>
<template v-for="(i,index) in orderList">
<div class="content" @touchend="end">
<van-swipe class="img-box" :key="updata" indicator-color="#FFFFFF" :loop="false" @change="change" :style="swipeStyle" :show-indicators="false" ref="swipe" duration="200">
<template v-for="(i, index) in orderList">
<van-swipe-item :key="index">
<create-order-img
:orderInfo="i"
:canvasId="`order-${index}`"
:ref="`order-${index}`"
/>
<van-image
:src="imgList[index]"
class="img"
>
<create-order-img :orderInfo="i" :canvasId="`order-${index}`" :ref="`order-${index}`" />
<van-image :src="imgList[index]" class="img">
<template v-slot:loading>
<van-loading
type="spinner"
size="20"
/>
<van-loading type="spinner" size="20" />
</template>
</van-image>
</van-swipe-item>
</template>
</van-swipe>
<template v-if="orderList.length > 1">
<div class="dots x-center text-center">
<template v-for="(i,index) in orderList">
<div
:class="['dots-item',{'active':itemIndex == index}]"
:key="index"
></div>
<template v-for="(i, index) in orderList">
<div :class="['dots-item', { active: itemIndex == index }]" :key="index"></div>
</template>
</div>
</template>
......@@ -53,7 +26,7 @@
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
import { shopmallApi } from '@/api'
const swipeStyle = 'padding-left: 9px;'
export default {
......@@ -114,7 +87,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.layout {
user-select: none;
.title {
......@@ -162,4 +135,4 @@ export default {
margin: 14px auto 0;
}
}
</style>
\ No newline at end of file
</style>
<template>
<div class="layout flex">
<div class="title flex">
<div class="sprite-icon icon-success"></div>恭喜您已参团成功!
<div class="sprite-icon icon-success"></div>
恭喜您已参团成功!
</div>
<div class="info">到店凭当前图片核销订单并支付尾款</div>
<van-image
:src="img"
class="img"
>
<van-image :src="img" class="img">
<template v-slot:loading>
<van-loading
type="spinner"
size="20"
/>
<van-loading type="spinner" size="20" />
</template>
</van-image>
<div class="tips text-center">长按保存图片</div>
<create-order-img
@success="img = $event"
:orderInfo="orderInfo"
/>
<create-order-img @success="img = $event" :orderInfo="orderInfo" />
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
export default {
name: 'success',
......@@ -67,7 +59,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.layout {
flex-direction: column;
font-size: 14px;
......@@ -101,4 +93,4 @@ export default {
margin: 14px auto 0;
}
}
</style>
\ No newline at end of file
</style>
......@@ -21,12 +21,7 @@ const cdn = {
// 开发环境
css: ['//web.sdk.qcloud.com/player/tcplayer/release/v4.2.1/tcplayer.min.css'],
js: [
'//web.sdk.qcloud.com/player/tcplayer/release/v4.5.1/libs/TXLivePlayer-1.2.0.min.js',
'//web.sdk.qcloud.com/player/tcplayer/release/v4.5.2/libs/hls.min.0.13.2m.js',
'https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.2/libs/flv.min.1.6.2.js',
'//web.sdk.qcloud.com/player/tcplayer/release/v4.5.2/tcplayer.v4.5.2.min.js'
]
js: ['//web.sdk.qcloud.com/player/tcplayer/release/v4.5.1/libs/TXLivePlayer-1.2.0.min.js', '//web.sdk.qcloud.com/player/tcplayer/release/v4.5.2/libs/hls.min.0.13.2m.js', 'https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.2/libs/flv.min.1.6.2.js', '//web.sdk.qcloud.com/player/tcplayer/release/v4.5.2/tcplayer.v4.5.2.min.js']
}
/**
......@@ -137,14 +132,7 @@ module.exports = {
config.plugins.delete('prefetch') // TODO: need test
// 别名 alias
config.resolve.alias
.set('@', resolve('src'))
.set('assets', resolve('src/assets'))
.set('api', resolve('src/api'))
.set('views', resolve('src/views'))
.set('components', resolve('src/components'))
.set('plugins', resolve('src/components'))
.set('utils', resolve('src/utils'))
config.resolve.alias.set('@', resolve('src')).set('assets', resolve('src/assets')).set('api', resolve('src/api')).set('views', resolve('src/views')).set('components', resolve('src/components')).set('plugins', resolve('src/components')).set('utils', resolve('src/utils'))
/**
* 添加CDN参数到htmlWebpackPlugin配置中
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!