Commit d68d3ea7 by 陈婉清

Merge branch 'v3.1.0_1114' into 'develop'

V3.1.0 1114上线后,代码合并。

See merge request !12
2 parents 642895dd b117a83b
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
"postcss-loader": "^6.2.0", "postcss-loader": "^6.2.0",
"sha1": "^1.1.1", "sha1": "^1.1.1",
"storejs": "^1.1.0", "storejs": "^1.1.0",
"tim-js-sdk": "^2.23.1",
"tim-upload-plugin": "^1.0.5",
"tim-wx-sdk": "^2.23.1",
"vant": "^2.12.21", "vant": "^2.12.21",
"vconsole": "^3.7.0", "vconsole": "^3.7.0",
"vue": "^2.6.11", "vue": "^2.6.11",
......
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
<router-view v-if="!$route.meta.keepAlive"></router-view> <router-view v-if="!$route.meta.keepAlive"></router-view>
</transition> </transition>
</template> </template>
<action v-show="$route.meta.showAction"></action> <action v-show="$route.meta.showAction && !$store.state.app.isLiveFull"></action>
</div> </div>
</template> </template>
<script> <script>
import { bigdatautilApi } from '@/api' import { bigdatautilApi } from '@/api'
export default { export default {
name: 'App', name: 'App',
data () { data() {
return { return {
timer: null timer: null
} }
...@@ -25,14 +25,14 @@ export default { ...@@ -25,14 +25,14 @@ export default {
watch: { watch: {
watchFlag: { watchFlag: {
immediate: true, immediate: true,
handler (newval) { handler(newval) {
this.showWindow = newval this.showWindow = newval
this.hideLoading() this.hideLoading()
} }
}, },
wacthLoginStatus: { wacthLoginStatus: {
immediate: true, immediate: true,
handler (newval) { handler(newval) {
if (newval) { if (newval) {
console.log('触发埋点') console.log('触发埋点')
this.init() this.init()
...@@ -41,19 +41,17 @@ export default { ...@@ -41,19 +41,17 @@ export default {
} }
}, },
computed: { computed: {
watchFlag () { watchFlag() {
return this.$store.state.app.showWindow return this.$store.state.app.showWindow
}, },
wacthLoginStatus () { wacthLoginStatus() {
return this.$store.state.app.loginStatus return this.$store.state.app.loginStatus
} }
}, },
mounted () { mounted() {},
},
methods: { methods: {
init () { init() {
this.openListener() this.openListener()
window.addEventListener('pagehide', () => { window.addEventListener('pagehide', () => {
this.leave() this.leave()
...@@ -62,24 +60,24 @@ export default { ...@@ -62,24 +60,24 @@ export default {
}) })
}, },
// 心跳检测 // 心跳检测
openListener () { openListener() {
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.heartbeat() this.heartbeat()
}, 60 * 1000) }, 60 * 1000)
}, },
closeListener () { closeListener() {
clearInterval(this.timer) clearInterval(this.timer)
}, },
// 心跳检测 // 心跳检测
heartbeat () { heartbeat() {
this.trackFn('heartbeat', 5) this.trackFn('heartbeat', 5)
}, },
//离开事件 //离开事件
leave () { leave() {
// console.log('离开时间') // console.log('离开时间')
this.trackFn('leaveReportTrack', 5) this.trackFn('leaveReportTrack', 5)
}, },
trackFn (name, actionType) { trackFn(name, actionType) {
const { id } = this.getQuery() const { id } = this.getQuery()
bigdatautilApi[name](id, actionType) bigdatautilApi[name](id, actionType)
} }
......
...@@ -58,7 +58,8 @@ const reportTrack = (id, view = 1, share_channel = '', url = commonUrl, method = ...@@ -58,7 +58,8 @@ const reportTrack = (id, view = 1, share_channel = '', url = commonUrl, method =
share_channel: share_channel ? share_channel : null, share_channel: share_channel ? share_channel : null,
sharedTime: sharedTime ? sharedTime : null, sharedTime: sharedTime ? sharedTime : null,
is_exclusive: (params && params.isExclusive) || null, is_exclusive: (params && params.isExclusive) || null,
exclusive_uuid: (params && params.exclusiveUuid) || null exclusive_uuid: (params && params.exclusiveUuid) || null,
share_staff_type: (params && params.shareStaffType) || null, //v3.1.0版本增加
} }
if (view == 4) data.user_open_id = userInfo.openid || userInfo.uuid if (view == 4) data.user_open_id = userInfo.openid || userInfo.uuid
if (ISWXWORK) { if (ISWXWORK) {
......
...@@ -68,5 +68,21 @@ export default { ...@@ -68,5 +68,21 @@ export default {
url, url,
data data
}) })
} },
// 直播IM用户签名
getLiveSig(data) {
data.method = 'scrm.api.shopmall.weapp.live.activity.usersig'
return window.$HTTP({
url,
data
})
},
/** 查询分享人信息 */
getStaffInfo(data) {
data.method = 'scrm.api.shopmall.activity.share.user.info'
return window.$HTTP({
url,
data
})
},
} }
...@@ -8,11 +8,13 @@ ...@@ -8,11 +8,13 @@
} }
} }
.layout { .layout {
padding-bottom: 100px; padding-bottom: 100px;
&.no-padding {
padding: 0;
}
.empty-page { .empty-page {
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -47,7 +49,7 @@ ...@@ -47,7 +49,7 @@
border-radius: 100%; border-radius: 100%;
} }
.big-img { .big-img {
...@@ -470,5 +472,5 @@ ...@@ -470,5 +472,5 @@
} }
} }
} }
...@@ -8,7 +8,6 @@ body .app { ...@@ -8,7 +8,6 @@ body .app {
background-color: #f7f8fa; background-color: #f7f8fa;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
height: 100%; height: 100%;
// overflow: hidden;
--themeColor: #3975c6; --themeColor: #3975c6;
} }
......
<template> <template>
<div <div :class="['action isFullSucreen flex', { bgBlack: bgBlack }, { liveBtn: isImAction }]" v-if="show">
:class="['action isFullSucreen flex', { bgBlack: bgBlack }]" <div class="btn-box flex" v-show="!bgBlack">
v-if="show" <div class="item" @click="getPoster">
>
<div
class="btn-box flex"
v-show="!bgBlack"
>
<div
class="item"
@click="getPoster"
>
<div class="sprite-icon icon-poster"></div> <div class="sprite-icon icon-poster"></div>
海报 海报
</div> </div>
...@@ -20,20 +11,10 @@ ...@@ -20,20 +11,10 @@
{{ detail.price }} {{ detail.price }}
<span>.{{ detail.decimal }}</span> <span>.{{ detail.decimal }}</span>
</div> </div>
<div <div :class="['btn text-center', { disabled: !detail.isStaffLoginLink && (iSMiniprogram || detail.activityStatus == 3 || detail.buyFlag == 2) }, { short: detail.buyFlag == 3 }]" @click="submit" @touchstart="touchstart" @touchend="touchend">
:class="['btn text-center', { disabled:!detail.isStaffLoginLink && (iSMiniprogram || detail.activityStatus == 3 || detail.buyFlag == 2) }, { short: detail.buyFlag == 3 }]"
@click="submit"
@touchstart="touchstart"
@touchend="touchend"
>
<template v-if="detail.isStaffLoginLink"> <template v-if="detail.isStaffLoginLink">
员工注册 员工注册
<wx-open-launch-weapp <wx-open-launch-weapp class="mini" :path="path" :username="miniprogramInfo.username" :env-version="miniprogramInfo.envVersion">
class="mini"
:path="path"
:username="miniprogramInfo.username"
:env-version="miniprogramInfo.envVersion"
>
<script type="text/wxtag-template"> <script type="text/wxtag-template">
<div class="mini-btn">点击跳转</div> <div class="mini-btn">点击跳转</div>
</script> </script>
...@@ -49,32 +30,12 @@ ...@@ -49,32 +30,12 @@
</template> </template>
</template> </template>
</div> </div>
<pay-modal <pay-modal v-model="showModal" :list="formList" @cancel="showModal = false" @pay="checkOut" :payStatus="payStatus" :carInfo="carInfo" />
v-model="showModal" <van-overlay :show="showPoster" @click.self="showPoster = false">
:list="formList" <div class="wrapper" @click.stop>
@cancel="showModal = false" <van-image :src="posterImg" width="100%" height="100%">
@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> <template v-slot:loading>
<van-loading <van-loading type="spinner" size="20" />
type="spinner"
size="20"
/>
</template> </template>
</van-image> </van-image>
</div> </div>
...@@ -90,7 +51,7 @@ export default { ...@@ -90,7 +51,7 @@ export default {
watch: { watch: {
watchUpdataCarInfo: { watchUpdataCarInfo: {
immediate: true, immediate: true,
handler (n) { handler(n) {
let { let {
activityInfo: { carInfo }, activityInfo: { carInfo },
activityInfo } activityInfo }
...@@ -101,7 +62,7 @@ export default { ...@@ -101,7 +62,7 @@ export default {
}, },
watchInfo: { watchInfo: {
immediate: true, immediate: true,
handler (n) { handler(n) {
if (n.id) { if (n.id) {
this.init(n) this.init(n)
} }
...@@ -109,14 +70,14 @@ export default { ...@@ -109,14 +70,14 @@ export default {
} }
}, },
computed: { computed: {
watchInfo () { watchInfo() {
return this.$store.state.app.activityInfo return this.$store.state.app.activityInfo
}, },
watchUpdataCarInfo () { watchUpdataCarInfo() {
return this.$store.state.app.updataCarInfo return this.$store.state.app.updataCarInfo
} }
}, },
data () { data() {
return { return {
show: false, show: false,
showModal: false, showModal: false,
...@@ -134,13 +95,17 @@ export default { ...@@ -134,13 +95,17 @@ export default {
bgBlack: { bgBlack: {
type: Boolean, type: Boolean,
default: false default: false
},
isImAction: {
type: Boolean,
default: false
} }
}, },
mounted () { mounted() {
this.iSMiniprogram = window.__wxjs_environment === 'miniprogram' this.iSMiniprogram = window.__wxjs_environment === 'miniprogram'
}, },
methods: { methods: {
init (n) { init(n) {
const { isStaffLoginLink } = this.getQuery(), const { isStaffLoginLink } = this.getQuery(),
{ miniprogramInfo } = window.$fetchConfig, { miniprogramInfo } = window.$fetchConfig,
params = this.getLocalStorage('wx_scrm_link_params'), params = this.getLocalStorage('wx_scrm_link_params'),
...@@ -202,7 +167,7 @@ export default { ...@@ -202,7 +167,7 @@ export default {
this.formList = [...formList, ...list] this.formList = [...formList, ...list]
this.show = true this.show = true
}, },
submit () { submit() {
let { detail, iSMiniprogram } = this let { detail, iSMiniprogram } = this
if (detail.isStaffLoginLink) { if (detail.isStaffLoginLink) {
return return
...@@ -250,7 +215,7 @@ export default { ...@@ -250,7 +215,7 @@ export default {
} }
}) })
}, 1e3), }, 1e3),
pay (orderInfo) { pay(orderInfo) {
this.showLoading('结算中') this.showLoading('结算中')
this.payStatus = Date.now() this.payStatus = Date.now()
shopmallApi.payOrder({ shopmallApi.payOrder({
...@@ -291,7 +256,7 @@ export default { ...@@ -291,7 +256,7 @@ export default {
} else this.showToast(message) } else this.showToast(message)
}) })
}, },
getPoster () { getPoster() {
let { id } = this.detail let { id } = this.detail
let userInfo = this.getUserInfo() let userInfo = this.getUserInfo()
let { phone, nickName, logo } = userInfo let { phone, nickName, logo } = userInfo
...@@ -400,6 +365,24 @@ export default { ...@@ -400,6 +365,24 @@ export default {
background: rgba(#000000, 0.6); background: rgba(#000000, 0.6);
z-index: 9; z-index: 9;
} }
.action.liveBtn {
position: relative;
padding: 0 0 !important;
width: 100%;
height: 40px;
background: url('../assets/images/live-btn.png') no-repeat;
background-size: 100% 40px;
.price {
color: #ffffff;
width: calc(100% - 96px);
}
.btn {
background: transparent;
width: 96px;
text-align: center;
border-width: 0;
}
}
@keyframes show-goods-action { @keyframes show-goods-action {
0% { 0% {
bottom: -100%; bottom: -100%;
......
<template> <template>
<van-overlay :show="show"> <van-overlay :show="show">
<div <div class="wrapper" @click.self="cancel">
class="wrapper" <div :class="['kf-box flex', { short: !detail.customerServiceQrImg }]">
@click.self="cancel"
>
<div :class="['kf-box flex',{short:!detail.customerServiceQrImg}]">
<div class="sprite-icon icon-kf-box"></div> <div class="sprite-icon icon-kf-box"></div>
<div class="sprite-icon icon-kf-logo x-center"></div> <div class="sprite-icon icon-kf-logo x-center"></div>
<div class="info"> <div class="info">
<div class="name">{{detail.customerServiceName}}</div> <div class="name">{{ detail.customerServiceName }}</div>
<template v-if="detail.customerServicePhone"> <template v-if="detail.customerServicePhone">
<div <div class="phone flex" @click="makePhoneCall(detail.customerServicePhone)">
class="phone flex" <div class="sprite-icon icon-phone"></div>
@click="makePhoneCall(detail.customerServicePhone)" {{ detail.customerServicePhone }}
>
<div class="sprite-icon icon-phone"></div>{{detail.customerServicePhone}}
</div> </div>
</template> </template>
</div> </div>
<template v-if="detail.customerServiceQrImg"> <template v-if="detail.customerServiceQrImg">
<div class="qr-box"> <div class="qr-box">
<div class="sprite-icon icon-qr"></div> <div class="sprite-icon icon-qr"></div>
<img <img :src="detail.customerServiceQrImg" class="qr xy-center" />
:src="detail.customerServiceQrImg"
class="qr xy-center"
/>
</div> </div>
<div class="bottom flex"> <div class="bottom flex">
<div class="item flex"> <div class="item flex">
<div class="sprite-icon icon-download"></div> <div class="sprite-icon icon-download"></div>
<div>保存图片<br>到相册</div> <div>
保存图片
<br />
到相册
</div>
</div> </div>
<div class="item flex"> <div class="item flex">
<div class="sprite-icon icon-scan"></div> <div class="sprite-icon icon-scan"></div>
<div>打开微信扫一扫<br>添加客服企微</div> <div>
打开微信扫一扫
<br />
添加客服企微
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</div> </div>
</van-overlay> </van-overlay>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
export default { export default {
name: 'KfModal', name: 'KfModal',
props: ['value', 'detail'], props: ['value', 'detail'],
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
} }
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
.van-overlay { .van-overlay {
z-index: 3; z-index: 3;
} }
...@@ -142,4 +142,4 @@ export default { ...@@ -142,4 +142,4 @@ export default {
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template> <template>
<!-- v-if="LiveProps[liveDetail.status].isLive" --> <!-- v-if="LiveProps[liveDetail.status].isLive" -->
<div class="videoContainer"> <div class="videoContainer">
<div <div class="small-box" @click="isSmallBox = false" v-show="isSmallBox">
class="small-box" <img class="icon-small-live" src="@/assets/images/icon-small-live.jpg" />
@click="isSmallBox = false"
v-show="isSmallBox"
>
<img
class="icon-small-live"
src="@/assets/images/icon-small-live.jpg"
/>
<div class="flex small-content"> <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 <div class="live-line" v-if="LiveProps[liveDetail.status].isLive">
class="live-line"
v-if="LiveProps[liveDetail.status].isLive"
>
<div class="side"></div> <div class="side"></div>
<div class="center side"></div> <div class="center side"></div>
<div class="side"></div> <div class="side"></div>
</div> </div>
<img <img v-if="!LiveProps[liveDetail.status].isLive" :src="IMAGES.REPLAY_ICON" class="live-replayIcon" />
v-if="!LiveProps[liveDetail.status].isLive"
:src="IMAGES.REPLAY_ICON"
class="live-replayIcon"
/>
<div class="text">{{ LiveProps[liveDetail.status].status }}</div> <div class="text">{{ LiveProps[liveDetail.status].status }}</div>
</div> </div>
</div> </div>
<!-- @click="openFullscreen" --> <!-- @click="openFullscreen" -->
<!-- @touchmove.stop.prevent 禁止使用滚动 --> <!-- @touchmove.stop.prevent 禁止使用滚动 -->
<div <div :style="videoStyle" id="live-box" :class="['live-box', { videoFullscreen: videoFullscreen }]" v-show="!isSmallBox">
:style="videoStyle" <div class="sprite-icon icon-live-close" v-show="!videoFullscreen && !isSmallBox" @click="isSmallBox = true"></div>
id="live-box"
:class="['live-box', { videoFullscreen: videoFullscreen }]"
v-show="!isSmallBox"
>
<div
class="sprite-icon icon-live-close"
v-show="!videoFullscreen && !isSmallBox"
@click="isSmallBox = true"
></div>
<div :class="{ videoShort: isAction }"> <div :class="{ videoShort: isAction }">
<div class="mask"> <div class="mask">
<div class="status flex"> <div class="status flex">
<div <div v-if="LiveProps[liveDetail.status].isLive" class="live-line">
v-if="LiveProps[liveDetail.status].isLive"
class="live-line"
>
<div class="side"></div> <div class="side"></div>
<div class="center side"></div> <div class="center side"></div>
<div class="side"></div> <div class="side"></div>
</div> </div>
<!-- 回放图标 --> <!-- 回放图标 -->
<img <img v-if="!LiveProps[liveDetail.status].isLive" :src="IMAGES.REPLAY_ICON" class="live-replayIcon" />
v-if="!LiveProps[liveDetail.status].isLive"
:src="IMAGES.REPLAY_ICON"
class="live-replayIcon"
/>
<div class="text">{{ LiveProps[liveDetail.status].text }}</div> <div class="text">{{ LiveProps[liveDetail.status].text }}</div>
</div> </div>
<template v-if="isShowGif"> <template v-if="isShowGif">
<img <img class="coverGif" :src="LiveProps[liveDetail.status].covergif" alt="" />
class="coverGif"
:src="LiveProps[liveDetail.status].covergif"
alt=""
/>
</template> </template>
</div> </div>
<div <div class="fullscreen-btn" @click="openFullscreen(false)">
class="fullscreen-btn"
@click="openFullscreen(false)"
>
<img :src="IMAGES.FULL_SCREEN" /> <img :src="IMAGES.FULL_SCREEN" />
</div> </div>
<div <div class="poster-btn" @click="showKf = true">
class="poster-btn"
@click="showKf = true"
>
<img :src="detail.floatingMaskDiagram" /> <img :src="detail.floatingMaskDiagram" />
</div> </div>
<video <video id="player-container-id" preload="auto" playsinline webkit-playsinline></video>
id="player-container-id" <group-modal v-model="showKf" :detail="detail" />
preload="auto" </div>
playsinline
webkit-playsinline <div v-show="videoFullscreen">
></video> <!-- IM -->
<group-modal <im v-if="LiveProps[liveDetail.status].isLive" :liveDetail="liveDetail" :isAction="isAction" class="Im"></im>
v-model="showKf" <action :bgBlack="true" class="BgAction" v-show="isAction && !LiveProps[liveDetail.status].isLive"></action>
:detail="detail"
/>
</div> </div>
<action
:bgBlack="true"
class="BgAction"
v-show="videoFullscreen && isAction"
></action>
</div> </div>
</div> </div>
</template> </template>
...@@ -129,7 +82,7 @@ const LiveProps = Object.freeze({ ...@@ -129,7 +82,7 @@ const LiveProps = Object.freeze({
const PLAYERDOMID = 'player-container-id' const PLAYERDOMID = 'player-container-id'
export default { export default {
name: 'LiveBox', name: 'LiveBox',
data () { data() {
return { return {
player: null, player: null,
videoFullscreen: false, videoFullscreen: false,
...@@ -142,7 +95,7 @@ export default { ...@@ -142,7 +95,7 @@ export default {
} }
}, },
computed: { computed: {
isAction () { isAction() {
const { activityStatus, buyFlag } = this.detail const { activityStatus, buyFlag } = this.detail
return activityStatus != 3 && buyFlag != 2 //TODO CONSTANT return activityStatus != 3 && buyFlag != 2 //TODO CONSTANT
} }
...@@ -166,64 +119,19 @@ export default { ...@@ -166,64 +119,19 @@ export default {
} }
} }
}, },
mounted() {
mounted () {
this.createPlayerCover() this.createPlayerCover()
this.createPlayer() this.createPlayer()
this.play() this.play()
// console.log('2222222222', this.liveDetail);
// 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: { methods: {
createPlayerCover () { createPlayerCover() {
!this.IsIOS && (this.isShowGif = true) !this.IsIOS && (this.isShowGif = true)
}, },
createPlayer () { createPlayer() {
this.player = TCPlayer(PLAYERDOMID, TCPlayerConfig) this.player = TCPlayer(PLAYERDOMID, TCPlayerConfig)
}, },
play () { play() {
wxConfig.ready(() => { wxConfig.ready(() => {
wx.getNetworkType({ wx.getNetworkType({
success: (result) => { success: (result) => {
...@@ -234,6 +142,10 @@ export default { ...@@ -234,6 +142,10 @@ export default {
this.player.src(src) this.player.src(src)
this.player.poster() this.player.poster()
this.player.play() // 播放视频 this.player.play() // 播放视频
// this.player.on('error', function (event) {
// // 从回调参数 event 中获取事件状态码及相关数据
// console.log(event, 'error-----------')
// })
this.draggable(document.getElementById('live-box'), this.openFullscreen, 'icon-live-close') this.draggable(document.getElementById('live-box'), this.openFullscreen, 'icon-live-close')
}) })
} }
...@@ -241,12 +153,13 @@ export default { ...@@ -241,12 +153,13 @@ export default {
}) })
}, },
controlBarStyle () { controlBarStyle() {
var [controlBar] = document.getElementsByClassName('vjs-control-bar') var [controlBar] = document.getElementsByClassName('vjs-control-bar')
controlBar.style.bottom = this.isAction ? '10vh' : '0' controlBar.style.bottom = this.isAction ? '10vh' : '0'
controlBar.style.display = this.LiveProps[this.liveDetail.status].isLive ? 'none' : 'auto'
}, },
fixHls () { fixHls() {
if (Hls.isSupported()) { if (Hls.isSupported()) {
this.video = document.getElementById(PLAYERDOMID) this.video = document.getElementById(PLAYERDOMID)
this.hls = new Hls() this.hls = new Hls()
...@@ -256,7 +169,7 @@ export default { ...@@ -256,7 +169,7 @@ export default {
} }
}, },
// 打开关闭全屏 // 打开关闭全屏
openFullscreen (status = true) { openFullscreen(status = true) {
// console.log('openFullscreen') // console.log('openFullscreen')
this.isShowGif = false this.isShowGif = false
const [live] = document.getElementsByClassName('live-box') const [live] = document.getElementsByClassName('live-box')
...@@ -273,7 +186,7 @@ export default { ...@@ -273,7 +186,7 @@ export default {
this.$emit('handleLiveFull', { isFull: this.videoFullscreen }) this.$emit('handleLiveFull', { isFull: this.videoFullscreen })
}, },
// 处理tcplayer错误码14 // 处理tcplayer错误码14
dealTcPlayerErr14 () { dealTcPlayerErr14() {
this.hls.on(Hls.Events.ERROR, function (event, data) { this.hls.on(Hls.Events.ERROR, function (event, data) {
if (data.fatal) { if (data.fatal) {
switch (data.type) { switch (data.type) {
...@@ -294,10 +207,10 @@ export default { ...@@ -294,10 +207,10 @@ export default {
} }
}) })
}, },
changeGifStatus () { changeGifStatus() {
this.isShowGif = !this.isShowGif this.isShowGif = !this.isShowGif
}, },
continueVideo () { continueVideo() {
this.player.play() this.player.play()
} }
} }
...@@ -365,7 +278,7 @@ export default { ...@@ -365,7 +278,7 @@ export default {
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
user-select: auto; user-select: auto;
transition: width,height 0.2s ease; // transition: width 0.1s ease, height 0.1s ease;
.icon-live-close { .icon-live-close {
position: absolute; position: absolute;
top: 2px; top: 2px;
...@@ -420,10 +333,10 @@ export default { ...@@ -420,10 +333,10 @@ export default {
.fullscreen-btn { .fullscreen-btn {
display: none; display: none;
position: absolute; position: absolute;
right: 10px; right: 14px;
top: 14px; top: 28px;
width: 84px; width: 54px;
height: 75px; height: 48px;
z-index: 2; z-index: 2;
} }
.poster-btn { .poster-btn {
...@@ -440,6 +353,7 @@ export default { ...@@ -440,6 +353,7 @@ export default {
} }
} }
.videoFullscreen { .videoFullscreen {
position: relative;
width: 100vw !important; width: 100vw !important;
height: 100vh !important; height: 100vh !important;
left: 0 !important; left: 0 !important;
...@@ -472,4 +386,10 @@ export default { ...@@ -472,4 +386,10 @@ export default {
background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), rgba(225, 225, 225, 0)); /* 标准的语法(必须放在最后) */ background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), rgba(225, 225, 225, 0)); /* 标准的语法(必须放在最后) */
} }
} }
.Im {
position: absolute;
bottom: 10px;
left: 0;
width: 100%;
}
</style> </style>
<template> <template>
<van-action-sheet <van-action-sheet v-model="showBox" @click-overlay="onCancel" :lock-scroll="false">
v-model="showBox"
@click-overlay="onCancel"
:lock-scroll="false"
>
<div class="box"> <div class="box">
<template v-for="(i, index) in items"> <template v-for="(i, index) in items">
<template v-if="i.name"> <template v-if="i.name">
<div <div class="item flex" :key="index">
class="item flex"
:key="index"
>
<div class="label text-hide"> <div class="label text-hide">
<span>*</span> <span>*</span>
{{ i.name }} {{ i.name }}
</div> </div>
<div class="value"> <div class="value">
<template v-if="i.route"> <template v-if="i.route">
<van-field <van-field readonly :placeholder="`请选择您的${i.name}`" @click="jumpCarBrands(i.route)" v-model="params[i.key]" class="readonly" right-icon="arrow"></van-field>
readonly
:placeholder="`请选择您的${i.name}`"
@click="jumpCarBrands(i.route)"
v-model="params[i.key]"
class="readonly"
right-icon="arrow"
></van-field>
</template> </template>
<template v-else> <template v-else>
<van-field <van-field v-model="params[i.key]" :placeholder="`请填写您的${i.name}`" :maxlength="i.maxlength" :type="i.type" clearable />
v-model="params[i.key]"
:placeholder="`请填写您的${i.name}`"
:maxlength="i.maxlength"
:type="i.type"
clearable
/>
</template> </template>
</div> </div>
</div> </div>
...@@ -43,19 +23,10 @@ ...@@ -43,19 +23,10 @@
本人已阅读且同意<span @click="jump('agreement')">《隐私协议》</span> 本人已阅读且同意<span @click="jump('agreement')">《隐私协议》</span>
</div> --> </div> -->
<template v-if="ISWXWORK"> <template v-if="ISWXWORK">
<van-button <van-button color="#b1b1b1" class="btn disabled">企微暂不支持支付</van-button>
color="#b1b1b1"
class="btn disabled"
>企微暂不支持支付</van-button>
</template> </template>
<template v-else> <template v-else>
<van-button <van-button color="#f13c3d" class="btn" @click="pay" loading-text="支付中..." :loading="payLoading">立即支付</van-button>
color="#f13c3d"
class="btn"
@click="pay"
loading-text="支付中..."
:loading="payLoading"
>立即支付</van-button>
</template> </template>
</div> </div>
</van-action-sheet> </van-action-sheet>
...@@ -177,7 +148,7 @@ export default { ...@@ -177,7 +148,7 @@ export default {
if (userInfo.phone) this.emit(obj) if (userInfo.phone) this.emit(obj)
else { else {
// if (!hasPhoneSelect) this.emit(obj) // if (!hasPhoneSelect) this.emit(obj)
// else // else
ssoApi.captchaLogin({ ssoApi.captchaLogin({
mobile: params.userPhone || '88888888888', mobile: params.userPhone || '88888888888',
captcha: 8888, captcha: 8888,
......
<template>
<div id="chat">
<div class="chatBox">
<div class="chatBox-middle">
<div class="chatInfo" id="chatInfo">
<div class="chatUser-box">
<div class="chatUser-info">
<span class="chatUser-info-text notice">
<img class="icon-notice" src="@/assets/images/icon-notice.png" />
欢迎来到直播间!
<p>{{ notifyTxt }}</p>
</span>
</div>
</div>
<div class="chatUser-box" v-for="(item, index) in messageList" :key="index">
<div class="chatUser-info">
<span class="chatUser-info-text">
<span class="chatUser-info-name">{{ item.userName }}:</span>
<span>{{ item.content }}</span>
</span>
</div>
</div>
</div>
</div>
<div class="chatBox-infoDesk" action="javascript:return true">
<van-field :class="['chatBox-input', isFocus ? 'focus-input' : '']" v-model="messageContent" maxlength="200" center placeholder="聊一聊..." use-button-slot @click="fixInputBeCovered($event)" @focus="handleInputFocus" @blur="handleInputFocus">
<img class="icon-send" slot="button" @click="sendTextMessage" src="@/assets/images/send.png" />
</van-field>
<action :bgBlack="true" class="action" v-show="isAction && !isFocus" :isImAction="true"></action>
</div>
</div>
</div>
</template>
<script>
import { Notify } from 'vant'
import { util } from 'utils'
import { shopmallApi } from '@/api'
import IM from './im.js'
let timObj = null
const msgMaxNum = 100
export default {
name: 'Im',
data() {
return {
isFocus: false,
notifyTxt: '直播间内严禁出现违法违规、低俗、涉黄、吸烟酗酒等内容,直播期间请勿相信私下交易,诱导购买等信息,以防人身或财产损失。请大家注意财产安全,谨防网络诈骗,文明观看直播。',
messageContent: '',
messageList: []
}
},
props: {
liveDetail: {
type: Object,
default: () => {
return {
imGroupId: '',
imSdkAppId: ''
}
}
},
isAction: {
type: Boolean,
default: false
}
},
computed: {},
created() {
this.getUserSig()
this.scrollToBottom()
},
updated() {
this.scrollToBottom()
},
mounted() { },
beforeDestroy() {
timObj.quit()
},
methods: {
fixInputBeCovered({ target }) {
setTimeout(function () {
target.scrollIntoView(true)
}, 100)
},
handleInputFocus() {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.isFocus = !this.isFocus
}, 300)
},
getUserSig() {
const userInfo = util.getUserInfo()
// userId = this.userInfo.openid || this.userInfo.uuid
const userId = userInfo.nickName || userInfo.userName
shopmallApi.getLiveSig({ userId: userId }).then(res => {
this.userSig = res.userSig
this.initTim()
})
},
initTim() {
const userInfo = util.getUserInfo()
const imOptions = {
userID: userInfo.nickName || userInfo.userName,
userSig: this.userSig,
groupID: this.liveDetail.imGroupId,
SDKAppID: this.liveDetail.imSdkAppId,
onMessageReceived: this.onMessageReceived,
onNetStateChange: this.onNetStateChange
}
timObj = new IM(imOptions)
timObj.join(imOptions).then(res => {
// console.log('login-------')
})
},
// 收到消息触发
onMessageReceived(data) {
// console.log('收到消息:', data)
let msgLen = this.messageList.length
let dataLen = data.length
if (msgLen + dataLen > msgMaxNum) {
this.messageList = this.messageList.slice(msgLen - dataLen)
}
data.forEach(item => {
// 根据消息类型判断,执行不同操作
if (item.type == 'TIMTextElem') {
// 群成员发送消息
// let eleData = JSON.parse()
let eleData = {
userName: item.from,
content: item.payload.text
}
// 获取群聊消息,消息上屏
this.updateMessageList(eleData)
}
})
},
// 网络异常处理
onNetStateChange(notify) {
Notify(notify)
},
// 更新数据push进消息列表
updateMessageList(data) {
this.messageList = [...this.messageList, data]
this.scrollToBottom()
},
// changeChatHeight(height = '230px') {
// var chatBoxDom = this.$el.querySelector('.chatBox-middle')
// chatBoxDom.style.height = height
// this.scrollToBottom()
// },
// handleFocus() {
// this.changeChatHeight('116px')
// },
//发送聊天
sendTextMessage() {
// this.changeChatHeight()
if (this.messageContent === '' || this.messageContent.trim().length === 0) {
this.messageContent = ''
return
}
// console.log(this.messageContent, '准备发咯--')
timObj.send(this.messageContent)
this.messageContent = ''
},
scrollToBottom() {
this.$nextTick(() => {
let container = this.$el.querySelector('#chatInfo')
container.scrollTop = container.scrollHeight
})
}
}
}
</script>
<style lang="scss" scoped>
html,
body {
background-color: #e8e8e8;
height: 100%;
}
#chat .chatBox {
width: 100%;
height: auto;
margin: auto 0;
border-radius: 0.625rem;
}
#chat .chatBox-middle {
width: 100%;
height: 230px;
margin: 1.25rem auto;
overflow: hidden;
}
#chat .chatBox-infoDesk {
display: flex;
margin: 0 10px 10px;
.chatBox-input {
width: 148px;
// background-color: transparent;
background-color: rgba(255, 255, 255, 0.4) !important;
border-radius: 2rem !important;
margin-right: 8px;
padding: 0 0;
color: #ffffff;
.icon-send {
width: 20px;
height: 20px;
margin-right: 10px;
}
}
.chatBox-input.focus-input {
width: 100%;
transition: width 0.5s;
.icon-send {
border-radius: 50%;
}
}
.action {
width: calc(100% - 156px);
}
}
#chat .chatInfo {
width: 100%;
height: 100%;
overflow-y: scroll;
}
#chat .chatInfo::-webkit-scrollbar {
width: 0 !important;
}
#chat .chatUser-box {
width: 100%;
margin-bottom: 3px;
display: flex;
flex-direction: row;
}
#chat .chatUser-info {
margin: 0 10px;
width: 65%;
line-height: 22px;
font-size: 12px;
}
#chat .chatUser-info-name {
color: rgb(234, 201, 36);
margin-right: 0.4rem;
font-weight: 600;
}
#chat .chatUser-info-text {
margin-top: 3px;
padding: 2px 6px;
font-size: 12px;
background: rgba(0, 0, 0, 0.3);
border-radius: 18px;
color: #ffffff;
float: left;
table-layout: fixed;
word-break: break-all;
overflow: hidden;
.icon-notice {
width: 28px;
height: 16px;
vertical-align: middle;
}
}
#chat .chatUser-info-text.notice {
padding: 2px 3px 2px 6px;
}
</style>
<style>
#chat .chatBox-infoDesk .chatBox-input .van-field__control {
/* background-color: rgba(255, 255, 255, 0.4) !important;
border-radius: 2rem !important; */
color: #ffffff;
height: 40px;
padding: 0 10px;
}
#chat .chatBox-infoDesk .van-cell::after {
border: none;
}
</style>
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2022-10-25 10:15:37
* @LastEditors: limin
* @LastEditTime: 2022-10-27 17:36:43
* @FilePath: \scrm-wx-merchant-activity\src\components\TIM\im.js
*/
// 从v2.11.2起,SDK 支持了 WebSocket,推荐接入;v2.10.2及以下版本,使用 HTTP
import TIM from 'tim-js-sdk'
import TIMUploadPlugin from 'tim-upload-plugin'
const TimOptions = {
// SDKAppID: 1400743527
}
export default class IM {
constructor(options = {}) {
this.loginResolveRejectCache = []
this.options = Object.assign({}, TimOptions, options)
this.isSDKReady = false
this.isLogin = false
this.init()
this.bindTIMEvent()
}
init() {
// 创建 SDK 实例,`TIM.create()`方法对于同一个 `SDKAppID` 只会返回同一份实例
this.tim = TIM.create({ SDKAppID: this.options.SDKAppID }) // SDK 实例通常用 tim 表示
// 设置 SDK 日志输出级别,详细分级请参见 <a href="https://web.sdk.qcloud.com/im/doc/en/SDK.html#setLogLevel">setLogLevel 接口的说明</a>
this.tim.setLogLevel(1) // 普通级别,日志量较多,接入时建议使用
// tim.setLogLevel(1); // release 级别,SDK 输出关键信息,生产环境时建议使用
// 注册腾讯云即时通信 IM 上传插件
this.tim.registerPlugin({ 'tim-upload-plugin': TIMUploadPlugin })
}
/**
* 绑定tim回调事件
*/
bindTIMEvent() {
this.tim.on(TIM.EVENT.SDK_READY, this.handleSDKReady, this)
this.tim.on(TIM.EVENT.MESSAGE_RECEIVED, this.onMessageReceived, this)
this.tim.on(TIM.EVENT.NET_STATE_CHANGE, this.onNetStateChange, this)
}
/**
* 登录
* @param {*} userID 用户唯一id
* @param {*} userSig 生成签名
* @returns
*/
login(userID, userSig) {
return new Promise((resolve, reject) => {
if (!userID) {
reject('userID is not be blank')
return null
}
if (!userSig) {
reject('userSig is not be blank')
return null
}
this.tim
.login({ userID, userSig })
.then(() => {
this.loginResolveRejectCache.push({ resolve, reject })
this.isLogin = true
return null
})
.catch(reject)
})
}
/**
* 加入群聊
* @returns Promise
*/
joinGroup(groupID, type = TIM.TYPES.GRP_AVCHATROOM) {
return new Promise((resolve, reject) => {
this.options.groupID = groupID
let promise = this.tim.joinGroup({ groupID, type })
promise
.then(function (imResponse) {
switch (imResponse.data.status) {
case TIM.TYPES.JOIN_STATUS_WAIT_APPROVAL: // Waiting to be approved by the admin
console.info('Waiting to be approved by the admin') // Profile of the group
resolve('Waiting to be approved by the admin')
break
case TIM.TYPES.JOIN_STATUS_SUCCESS: // Joined the group successfully
console.info('Joined the group successfully') // Profile of the group
resolve(imResponse.data.group)
break
case TIM.TYPES.JOIN_STATUS_ALREADY_IN_GROUP: // The user is already in the group
console.info('The user is already in the group')
resolve('The user is already in the group')
break
default:
reject(imResponse.data.status)
break
}
})
.catch(function (imError) {
console.warn('joinGroup error:', imError) // Error information
reject('joinGroup error:' + imError)
})
})
}
quitGroup(groupID) {
if (!groupID) {
throw new Error('groupID is not be blank')
}
return this.tim.quitGroup(groupID)
}
/**
* 登录并加入群聊
* @param {*} param0
* @returns
*/
join({ userID, userSig, groupID }) {
if (!userID) {
throw new Error('userID is not be blank')
}
if (!userSig) {
throw new Error('userSig is not be blank')
}
if (!groupID) {
throw new Error('groupID is not be blank')
}
return this.login(userID, userSig).then(() => this.joinGroup(groupID))
}
/**
* 退出群聊,并退出登录
*/
quit() {
return this.quitGroup(this.options.groupID).then(() => this.logout())
}
/**
* 登出
* @returns Promise
*/
logout() {
return new Promise((resolve, reject) => {
this.tim
.logout()
.then(imResponse => {
this.isSDKReady = false
this.isLogin = false
resolve(imResponse)
})
.catch(reject)
})
}
/**
* (内部)登录成功,且SDK Ready
*/
handleSDKReady() {
this.isSDKReady = true
this.loginResolveRejectCache.forEach(({ resolve }) => {
resolve({
msg: '登录成功,且SDK Ready'
})
})
}
/**
* 收到新消息回调
* @param {*} event 回调消息体
*/
onMessageReceived(event) {
this.options.onMessageReceived(event.data)
}
/**
* 网络波动回调
* @param {*} event 回调消息体
*/
onNetStateChange(event) {
// v2.5.0 起支持
// event.data.state 当前网络状态,枚举值及说明如下:
// TIM.TYPES.NET_STATE_CONNECTED - 已接入网络
// TIM.TYPES.NET_STATE_CONNECTING - 连接中。很可能遇到网络抖动,SDK 在重试。接入侧可根据此状态提示“当前网络不稳定”或“连接中”
// TIM.TYPES.NET_STATE_DISCONNECTED - 未接入网络。接入侧可根据此状态提示“当前网络不可用”。SDK 仍会继续重试,若用户网络恢复,SDK 会自动同步消息
let notify = {}
switch (event.data.state) {
case TIM.TYPES.NET_STATE_CONNECTED:
notify = { message: '已接入网络', type: 'success' }
break
case TIM.TYPES.NET_STATE_CONNECTING:
notify = { message: '连接中', type: 'warning' }
break
case TIM.TYPES.NET_STATE_DISCONNECTED:
notify = { message: '当前网络不可用', type: 'danger' }
break
default:
break
}
this.options.onNetStateChange(notify)
}
/**
* 发送一条消息
* @param {*} msg 消息内容
* @returns Promise
*/
send(msg) {
return new Promise((resolve, reject) => {
const message = this.createMessage(msg)
this.sendMessage(message)
.then(event => {
this.onMessageReceived(Object.assign({}, event, { data: [event.data.message] }))
resolve(event)
})
.catch(reject)
})
}
/**
* (内部)组装一条tim TEXT 消息体
* @param {*} msg 消息内容
* @returns 组装好的消息
*/
createMessage(msg) {
let message = this.tim.createTextAtMessage({
to: this.options.groupID,
conversationType: TIM.TYPES.CONV_GROUP,
payload: {
text: msg
}
})
return message
}
/**
* (内部)发送一条消息
* @param {*} message 组装好的tim消息内容
* @returns Promise
*/
sendMessage(message) {
return this.tim.sendMessage(message)
}
}
<template> <template>
<canvas <canvas :id="canvasId" class="create"></canvas>
:id="canvasId"
class="create"
></canvas>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
......
...@@ -33,7 +33,7 @@ module.exports = { ...@@ -33,7 +33,7 @@ module.exports = {
envVersion: 'trial', envVersion: 'trial',
}, },
// shopmall_id: "gh_e983752bf563", //嘀加 // shopmall_id: "gh_e983752bf563", //嘀加
appid: 'wx56bed167ad463f70', //公众号appid 云商 wx1cf40dc91c28a7fd test02 wx56bed167ad463f70 appid: 'wx1cf40dc91c28a7fd', //公众号appid 云商 wx1cf40dc91c28a7fd test02 wx56bed167ad463f70
sign: { sign: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637', appKey: '48e5e13229b82c1b4e6e8c96151f0637',
format: 'json', format: 'json',
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
* @Author: limin * @Author: limin
* @Date: 2021-06-07 14:12:32 * @Date: 2021-06-07 14:12:32
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2021-06-30 11:23:25 * @LastEditTime: 2022-10-25 18:38:57
*/ */
// 根据环境引入不同配置 process.env.VUE_APP_ENV // 根据环境引入不同配置 process.env.VUE_APP_ENV
let config = require('./conf.js') let config = require('./conf.js')
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) { export const fetchConfig = function (isEnv = true) {
if (isEnv) { if (isEnv) {
let { request } = config let { request } = config
Object.assign(request, { timeout }) Object.assign(request, { timeout })
...@@ -24,4 +24,3 @@ export const cfg = { ...@@ -24,4 +24,3 @@ export const cfg = {
vue.prototype.$config = config vue.prototype.$config = config
} }
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: limin * @Author: limin
* @Date: 2021-06-07 14:12:32 * @Date: 2021-06-07 14:12:32
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2021-07-06 12:02:21 * @LastEditTime: 2022-10-25 09:31:24
*/ */
import { ssoApi } from '@/api' import { ssoApi } from '@/api'
import { util } from 'utils' import { util } from 'utils'
...@@ -16,7 +16,8 @@ const state = { ...@@ -16,7 +16,8 @@ const state = {
lastPath: '', lastPath: '',
activityInfo: {}, activityInfo: {},
updataCarInfo: Date.now(), updataCarInfo: Date.now(),
loginStatus:false loginStatus: false,
isLiveFull: false
} }
const mutations = { const mutations = {
SET_ACTIVITY_INFO(state, value) { SET_ACTIVITY_INFO(state, value) {
...@@ -45,6 +46,9 @@ const mutations = { ...@@ -45,6 +46,9 @@ const mutations = {
SET_LOGIN_STATUS(state, data) { SET_LOGIN_STATUS(state, data) {
state.loginStatus = data state.loginStatus = data
}, },
SET_LIVE_FULL(state, data) {
state.isLiveFull = data
}
} }
const actions = { const actions = {
setPageMeta({ commit }, meta) { setPageMeta({ commit }, meta) {
...@@ -63,6 +67,9 @@ const actions = { ...@@ -63,6 +67,9 @@ const actions = {
setLoginStatus({ commit }, value) { setLoginStatus({ commit }, value) {
commit('SET_LOGIN_STATUS', value) commit('SET_LOGIN_STATUS', value)
}, },
setIsLiveFull({ commit }, value) {
commit('SET_LIVE_FULL', value)
},
wxLogin({ dispatch }, { code, redirectUrl, appId }) { wxLogin({ dispatch }, { code, redirectUrl, appId }) {
ssoApi ssoApi
.login({ .login({
...@@ -188,7 +195,7 @@ const actions = { ...@@ -188,7 +195,7 @@ const actions = {
return return
} else dispatch('login') } else dispatch('login')
}, },
registerHttp({}, sessionId = '') { registerHttp({ dispatch }, sessionId = '') {
window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: 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 = false
this.IsIOS = window.$IsIOS this.IsIOS = window.$IsIOS
this.audioContext = new (window.AudioContext || window.webkitAudioContext || window.mozAudioContext)() this.audioContext = new (window.AudioContext || window.webkitAudioContext || window.mozAudioContext)()
......
...@@ -26,7 +26,7 @@ Date.prototype.format = function (fmt) { ...@@ -26,7 +26,7 @@ Date.prototype.format = function (fmt) {
return fmt return fmt
} }
const iosTimeFormat = time => { const iosTimeFormat = time => {
return time.replace(/\-/g, '/') return time.replace(/-/g, '/')
} }
const throttle = (fn, gapTime) => { const throttle = (fn, gapTime) => {
if (gapTime == null || gapTime == undefined) { if (gapTime == null || gapTime == undefined) {
......
<template> <template>
<div v-if="detail.activityDetail"> <div v-if="detail.activityDetail">
<div <div class="activity-info" v-html="decodeURIComponent(detail.activityDetail)"></div>
class="activity-info"
v-html="decodeURIComponent(detail.activityDetail)"
></div>
<div class="tips text-center"> <div class="tips text-center">
<img <img src="https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/logo.png" alt="技术支持:广联数科" />
src="https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/logo.png"
alt="技术支持:广联数科"
/>
</div> </div>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
export default { export default {
name: 'ActivityDetails', name: 'ActivityDetails',
props: { props: {
...@@ -33,21 +27,21 @@ export default { ...@@ -33,21 +27,21 @@ export default {
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
.activity-info { .activity-info {
/deep/img { /deep/img {
object-fit: contain; object-fit: contain;
height: auto; height: auto;
}
} }
}
.tips { .tips {
padding-top: 47px; padding-top: 47px;
font-size: 12px; font-size: 12px;
img { img {
width: 143px; width: 143px;
height: 21px; height: 21px;
}
} }
</style>
\ No newline at end of file \ No newline at end of file
}
</style>
<template> <template>
<div <div class="guide-page" v-if="show">
class="guide-page" <img :src="img" @click="tap" />
v-if="show"
>
<img
:src="img"
@click="tap"
>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
const imgUrl = 'https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/guide-' const imgUrl = 'https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/guide-'
export default { export default {
name: 'GuidePage', name: 'GuidePage',
...@@ -48,7 +42,7 @@ export default { ...@@ -48,7 +42,7 @@ export default {
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
.guide-page { .guide-page {
position: fixed; position: fixed;
top: 0; top: 0;
...@@ -58,4 +52,4 @@ export default { ...@@ -58,4 +52,4 @@ export default {
z-index: 10086; z-index: 10086;
background-color: #000; background-color: #000;
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template> <template>
<div <div class="group-list" ref="groupBox">
class="group-list"
ref="groupBox"
>
<div class="mask"></div> <div class="mask"></div>
<template v-if="list.length"> <template v-if="list.length">
<div <div class="move" ref="move">
class="move"
ref="move"
>
<template v-for="(i, index) in list"> <template v-for="(i, index) in list">
<div <div :class="['item flex', { 'group-item': index == 0 }]" :key="index">
:class="['item flex', { 'group-item': index == 0 }]"
:key="index"
>
<img :src="i.imageUrl" /> <img :src="i.imageUrl" />
<div class="text">{{ i.name }}刚刚参加了活动</div> <div class="text">{{ i.name }}刚刚参加了活动</div>
</div> </div>
......
<template> <template>
<div class="page-btn"> <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 <div class="page-item flex" @click="clickKF" @touchstart="touchstart" @touchend="touchend">
class="page-item flex"
@click="clickKF"
@touchstart="touchstart"
@touchend="touchend"
>
<div class="sprite-icon icon-kf"></div> <div class="sprite-icon icon-kf"></div>
客服 客服
</div> </div>
</template> </template>
<template v-if="showOrderBtn"> <template v-if="showOrderBtn">
<div <div class="page-item flex order-move" @click="to('crowdfunding.orderList')" @touchstart="touchstart" @touchend="touchend">
class="page-item flex order-move"
@click="to('crowdfunding.orderList')"
@touchstart="touchstart"
@touchend="touchend"
>
<div class="sprite-icon icon-order"></div> <div class="sprite-icon icon-order"></div>
订单 订单
</div> </div>
...@@ -25,7 +15,7 @@ ...@@ -25,7 +15,7 @@
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
import { shopmallApi } from '@/api' import { shopmallApi } from '@/api'
export default { export default {
name: 'PageBtns', name: 'PageBtns',
...@@ -58,7 +48,7 @@ export default { ...@@ -58,7 +48,7 @@ export default {
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
@keyframes move-btn { @keyframes move-btn {
10%, 10%,
90% { 90% {
...@@ -105,4 +95,4 @@ export default { ...@@ -105,4 +95,4 @@ export default {
animation: move-btn 1.5s infinite cubic-bezier(0.36, 0.07, 0.19, 0.97) both; animation: move-btn 1.5s infinite cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template>
<div id="staff" class="staff">
<img class="icon-head" :src="shareInfo.shareImageUrl || require('@/assets/images/default-head.png')" />
<div class="name text-hide">{{ shareInfo.shareName || ''}}</div>
邀请您参加本次团购
</div>
</template>
<script>
var dom = ''
var wth = 0
export default {
name: 'Staff',
data() {
return {}
},
props: {
shareInfo: {
type: Object,
default: () => { }
},
scrollY: {
type: Number,
default: 0
}
},
watch: {
scrollY(newVal, val) {
dom.style.left = newVal > 40 ? '-' + wth + 'px' : ''
}
},
mounted() {
dom = document.getElementById('staff')
wth = dom.offsetWidth + 10
},
methods: {}
}
</script>
<style lang="scss" scoped>
.staff {
position: fixed;
left: 0;
bottom: 100px;
z-index: 2;
display: flex;
box-sizing: border-box;
max-width: 80%;
height: 48px;
line-height: 28px;
opacity: 0.9;
background: #ffffff;
box-shadow: 0 4px 12px 0 rgba(159, 166, 209, 0.25);
border-radius: 0 100px 100px 0;
padding: 12px 10px;
font-size: 14px;
color: #1b233d;
transition: left 0.3s;
.icon-head {
width: 24px;
height: 24px;
border-radius: 50%;
}
.name {
max-width: 120px;
margin: 0 4px;
font-size: 16px;
font-weight: 600;
}
}
</style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="layout"> <div class="layout">
<div class="title">左右滑动查看核销凭证</div> <div class="title">左右滑动查看核销凭证</div>
<div class="content" @touchend="end"> <div class="content" @touchend="end">
<van-swipe :class="['img-box',{ 'one':orderList.length == 1}]" :key="updata" indicator-color="#FFFFFF" :loop="false" @change="change" :style="swipeStyle" :show-indicators="false" ref="swipe" duration="200"> <van-swipe :class="['img-box', { one: orderList.length == 1 }]" :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"> <template v-for="(i, index) in orderList">
<van-swipe-item :key="index"> <van-swipe-item :key="index">
<create-order-img :orderInfo="i" :canvasId="`order-${index}`" :ref="`order-${index}`" /> <create-order-img :orderInfo="i" :canvasId="`order-${index}`" :ref="`order-${index}`" />
...@@ -125,7 +125,7 @@ export default { ...@@ -125,7 +125,7 @@ export default {
margin-left: 10px; margin-left: 10px;
} }
} }
.one{ .one {
box-sizing: border-box; box-sizing: border-box;
} }
.tips { .tips {
......
...@@ -41,7 +41,7 @@ const spritesmithFunction = data => { ...@@ -41,7 +41,7 @@ const spritesmithFunction = data => {
return `${shared}\n${perSprite}` return `${shared}\n${perSprite}`
} }
module.exports = { module.exports = {
publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main-lwk/', // 本地调试时需登录时使用 publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main-lm/', // 本地调试时需登录时使用
// publicPath: './', // publicPath: './',
// publicPath: '/dj-scrm-wx-work-attachment-activity/', // 署应用包时的基本 URL。 vue-router history模式使用 // publicPath: '/dj-scrm-wx-work-attachment-activity/', // 署应用包时的基本 URL。 vue-router history模式使用
outputDir: 'dist', // 生产环境构建文件的目录 outputDir: 'dist', // 生产环境构建文件的目录
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!