Commit cc320993 by 前端

Merge branch 'Saas+v4.14.0_1223' into 'develop'

Saas+v4.14.0 1223

See merge request !18
2 parents 8a10b8bf 95a6f7d3
...@@ -5,32 +5,29 @@ ...@@ -5,32 +5,29 @@
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2022-09-26 16:22:15 * @LastEditTime: 2022-09-26 16:22:15
--> -->
<head> <html>
<meta charset="utf-8"> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no,viewport-fit=cover"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no,viewport-fit=cover" />
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %> <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" /> <link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" />
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" /> <link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" />
<% } %> <% } %>
<title> <title><%= webpackConfig.name %></title>
<%= webpackConfig.name %> </head>
</title>
</head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it <strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
to continue.</strong> </noscript>
</noscript> <div id="app"></div>
<div id="app"></div> <!-- 使用CDN加速的JS文件,配置在vue.config.js下 -->
<!-- 使用CDN加速的JS文件,配置在vue.config.js下 --> <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %>
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script> <script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %> <% } %>
<!-- <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script> --> <!-- <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script> -->
<!-- built files will be auto injected -->
</body>
</html>
\ No newline at end of file \ No newline at end of file
<!-- built files will be auto injected -->
</body>
</html>
const url = '/rop-scrm-shopmall/router' const url = '/rop-scrm-shopmall/router'
import { util } from 'utils'
export default { export default {
/**众筹详情 */ /**众筹详情 */
getActivityDetail(id) { getActivityDetail (id) {
return window.$HTTP({ return window.$HTTP({
url, url,
data: { data: {
...@@ -12,7 +13,7 @@ export default { ...@@ -12,7 +13,7 @@ export default {
}) })
}, },
/**参团人数 */ /**参团人数 */
getActivityGroup(id) { getActivityGroup (id) {
return window.$HTTP({ return window.$HTTP({
url, url,
data: { data: {
...@@ -22,7 +23,7 @@ export default { ...@@ -22,7 +23,7 @@ export default {
}) })
}, },
/** 创建订单(立即购买) */ /** 创建订单(立即购买) */
createOrder(data) { createOrder (data) {
data.method = 'scrm.api.shopmall.weapp.order.create' data.method = 'scrm.api.shopmall.weapp.order.create'
return window.$HTTP({ return window.$HTTP({
url, url,
...@@ -31,7 +32,7 @@ export default { ...@@ -31,7 +32,7 @@ export default {
}) })
}, },
/**创建支付订单(去付款) */ /**创建支付订单(去付款) */
payOrder(data) { payOrder (data) {
data.method = `scrm.api.shopmall.weapp.order.createPay` data.method = `scrm.api.shopmall.weapp.order.createPay`
return window.$HTTP({ return window.$HTTP({
url, url,
...@@ -40,7 +41,7 @@ export default { ...@@ -40,7 +41,7 @@ export default {
}) })
}, },
/**海报 */ /**海报 */
getPoster(data) { getPoster (data) {
data.method = `scrm.api.shopmall.weapp.crowdFunding.poster` data.method = `scrm.api.shopmall.weapp.crowdFunding.poster`
return window.$HTTP({ return window.$HTTP({
url, url,
...@@ -48,7 +49,7 @@ export default { ...@@ -48,7 +49,7 @@ export default {
}) })
}, },
/** 订单详情 */ /** 订单详情 */
getOrderList(activityId) { getOrderList (activityId) {
let data = { let data = {
activityId, activityId,
method: 'scrm.api.shopmall.weapp.crowdFunding.order.list' method: 'scrm.api.shopmall.weapp.crowdFunding.order.list'
...@@ -59,7 +60,7 @@ export default { ...@@ -59,7 +60,7 @@ export default {
}) })
}, },
// 根据众筹id获取直播详情 // 根据众筹id获取直播详情
getLiveDetail(id) { getLiveDetail (id) {
let data = { let data = {
id, id,
method: 'scrm.api.shopmall.weapp.activity.live.broadcast.detail' method: 'scrm.api.shopmall.weapp.activity.live.broadcast.detail'
...@@ -70,7 +71,7 @@ export default { ...@@ -70,7 +71,7 @@ export default {
}) })
}, },
// 直播IM用户签名 // 直播IM用户签名
getLiveSig(data) { getLiveSig (data) {
data.method = 'scrm.api.shopmall.weapp.live.activity.usersig' data.method = 'scrm.api.shopmall.weapp.live.activity.usersig'
return window.$HTTP({ return window.$HTTP({
url, url,
...@@ -78,11 +79,47 @@ export default { ...@@ -78,11 +79,47 @@ export default {
}) })
}, },
/** 查询分享人信息 */ /** 查询分享人信息 */
getStaffInfo(data) { getStaffInfo (data) {
data.method = 'scrm.api.shopmall.activity.share.user.info' data.method = 'scrm.api.shopmall.activity.share.user.info'
return window.$HTTP({ return window.$HTTP({
url, url,
data data
}) })
}, },
/**直播间埋点*/
liveRoomReport (data) {
const userInfo = util.getUserInfo(),
params = util.getLocalStorage('wx_scrm_link_params') || {}
let obj = {
accountId: userInfo.accountId,
accountName: userInfo.nickName,
customerAvatar: userInfo.logo,
customerOpenId: userInfo.openid,
customerUnionId: '',
customerPhone: userInfo.phone || '',
merchantId: params.merchantId,
bizDataType: 1,
operationType: 3,
operationDate: new Date().format('yyyy-MM-dd hh:mm:ss'),
visitSource: 'H5-众筹'
}
data.method = 'scrm.api.shopmall.livebroadcast.report'
return window.$HTTP({
url,
data: {
...data,
...obj
},
})
},
/**支付商户收款测试创建支付订单*/
creatCollectionsTestOrder(data) {
data.method = 'entmicro.api.payment.createTrade'
return window.$HTTP({
url: '/rop-scrm-entmicro/router',
data
})
}
} }
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
position: relative; position: relative;
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
margin-bottom: 10px; margin-bottom: 5px;
img { img {
object-fit: contain; object-fit: contain;
......
...@@ -94,6 +94,7 @@ video { ...@@ -94,6 +94,7 @@ video {
left: -10000px; left: -10000px;
width: 10px; width: 10px;
height: 10px; height: 10px;
z-index: -1;
} }
.live-line { .live-line {
...@@ -101,6 +102,7 @@ video { ...@@ -101,6 +102,7 @@ video {
position: relative; position: relative;
@keyframes side-animation { @keyframes side-animation {
0%, 0%,
50%, 50%,
100% { 100% {
...@@ -132,4 +134,4 @@ video { ...@@ -132,4 +134,4 @@ video {
left: 4px; left: 4px;
animation: side-animation 2s infinite reverse; animation: side-animation 2s infinite reverse;
} }
} }
\ No newline at end of file \ No newline at end of file
<template> <template>
<div :class="['action isFullSucreen flex', { bgBlack: bgBlack }, { liveBtn: isImAction }]" v-if="show"> <div
<div class="btn-box flex" v-show="!bgBlack"> :class="['action isFullSucreen flex', { bgBlack: videoFullscreen }, { liveBtn: isImAction }]"
<div class="item" @click="getPoster"> v-if="show"
>
<div
class="btn-box flex"
v-show="!videoFullscreen"
>
<div
class="item"
@click="getPoster"
>
<div class="sprite-icon icon-poster"></div> <div class="sprite-icon icon-poster"></div>
海报 海报
</div> </div>
...@@ -11,10 +20,20 @@ ...@@ -11,10 +20,20 @@
{{ detail.price }} {{ detail.price }}
<span>.{{ detail.decimal }}</span> <span>.{{ detail.decimal }}</span>
</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"> <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"
>
<template v-if="detail.isStaffLoginLink"> <template v-if="detail.isStaffLoginLink">
员工注册 员工注册
<wx-open-launch-weapp class="mini" :path="path" :username="miniprogramInfo.username" :env-version="miniprogramInfo.envVersion"> <wx-open-launch-weapp
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>
...@@ -30,12 +49,32 @@ ...@@ -30,12 +49,32 @@
</template> </template>
</template> </template>
</div> </div>
<pay-modal v-model="showModal" :list="formList" @cancel="showModal = false" @pay="checkOut" :payStatus="payStatus" :carInfo="carInfo" /> <pay-modal
<van-overlay :show="showPoster" @click.self="showPoster = false"> v-model="showModal"
<div class="wrapper" @click.stop> :list="formList"
<van-image :src="posterImg" width="100%" height="100%"> @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> <template v-slot:loading>
<van-loading type="spinner" size="20" /> <van-loading
type="spinner"
size="20"
/>
</template> </template>
</van-image> </van-image>
</div> </div>
...@@ -51,7 +90,7 @@ export default { ...@@ -51,7 +90,7 @@ export default {
watch: { watch: {
watchUpdataCarInfo: { watchUpdataCarInfo: {
immediate: true, immediate: true,
handler(n) { handler (n) {
let { let {
activityInfo: { carInfo }, activityInfo: { carInfo },
activityInfo } activityInfo }
...@@ -62,7 +101,7 @@ export default { ...@@ -62,7 +101,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)
} }
...@@ -70,14 +109,14 @@ export default { ...@@ -70,14 +109,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,
...@@ -92,7 +131,7 @@ export default { ...@@ -92,7 +131,7 @@ export default {
} }
}, },
props: { props: {
bgBlack: { videoFullscreen: {
type: Boolean, type: Boolean,
default: false default: false
}, },
...@@ -101,11 +140,11 @@ export default { ...@@ -101,11 +140,11 @@ export default {
default: false 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'),
...@@ -117,7 +156,7 @@ export default { ...@@ -117,7 +156,7 @@ export default {
type: n.employeeRegistrationLinkFlag == 2 ? 1 : 0 type: n.employeeRegistrationLinkFlag == 2 ? 1 : 0
} }
this.miniprogramInfo = miniprogramInfo this.miniprogramInfo = miniprogramInfo
this.path = `pages/authentication/register/register.html?data=${encodeURIComponent(JSON.stringify(data))}` this.path = `packageStoreAssistant/packageAuth/pages/authentication/register/register.html?data=${encodeURIComponent(JSON.stringify(data))}`
let expressFee = n.expressFee || 0 let expressFee = n.expressFee || 0
let [price, decimal] = this.centsToyuan(n.retailPrice + expressFee).toString().split('.') let [price, decimal] = this.centsToyuan(n.retailPrice + expressFee).toString().split('.')
if (!decimal) decimal = '00' if (!decimal) decimal = '00'
...@@ -167,7 +206,7 @@ export default { ...@@ -167,7 +206,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
...@@ -208,6 +247,7 @@ export default { ...@@ -208,6 +247,7 @@ export default {
isExclusive: linkParams.isExclusive || ''//专属链接参数 isExclusive: linkParams.isExclusive || ''//专属链接参数
} }
shopmallApi.createOrder(params).then(({ data, code, message }) => { shopmallApi.createOrder(params).then(({ data, code, message }) => {
if(detail.liveBroadcastRoomId) data.liveBroadcastRoomId = detail.liveBroadcastRoomId
if (code == '0') that.pay(data) if (code == '0') that.pay(data)
else { else {
that.payStatus = Date.now() that.payStatus = Date.now()
...@@ -215,18 +255,20 @@ export default { ...@@ -215,18 +255,20 @@ export default {
} }
}) })
}, 1e3), }, 1e3),
pay(orderInfo) { pay (orderInfo) {
this.showLoading('结算中') this.showLoading('结算中')
this.payStatus = Date.now() this.payStatus = Date.now()
shopmallApi.payOrder({ shopmallApi.payOrder({
orderCode: orderInfo.orderCode orderCode: orderInfo.orderCode,
}).then(({ code, data, message }) => { paymentSource: 2 //1128版本 支付来源(1:小程序,2:公众号)
}).then(async ({ code, data, message }) => {
this.hideLoading() this.hideLoading()
let [url] = window.location.href.split('?') let [url] = window.location.href.split('?')
let redirectUrl = `${url}/success` let redirectUrl = `${url}/success`
if (code == '0') { if (code == '0') {
this.showModal = false this.showModal = false
let { needPay, payParams } = data let { needPay, payParams, order } = data,
{ videoFullscreen } = this
if (needPay) { if (needPay) {
let params = { let params = {
nonceStr: payParams.nonceStr, nonceStr: payParams.nonceStr,
...@@ -253,10 +295,18 @@ export default { ...@@ -253,10 +295,18 @@ export default {
}) })
else this.to('crowdfunding.success', { orderInfo }) else this.to('crowdfunding.success', { orderInfo })
} }
if (videoFullscreen) {
console.log('直播间下单',orderInfo)
const res = await shopmallApi.liveRoomReport({
bizDataCode: orderInfo.orderCode,
liveBroadcastRoomId: orderInfo.liveBroadcastRoomId,
})
console.log(res)
}
} 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
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<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 class="coverGif" :src="LiveProps[liveDetail.status].covergif" alt="" /> <img class="coverGif" :src="detail[LiveProps[liveDetail.status].gifAttr] || LiveProps[liveDetail.status].covergif" alt="" />
</template> </template>
</div> </div>
<div class="fullscreen-btn" @click="openFullscreen(false)"> <div class="fullscreen-btn" @click="openFullscreen(false)">
...@@ -47,8 +47,8 @@ ...@@ -47,8 +47,8 @@
<div v-show="videoFullscreen"> <div v-show="videoFullscreen">
<!-- IM --> <!-- IM -->
<im v-if="LiveProps[liveDetail.status].isLive" :liveDetail="liveDetail" :isAction="isAction" class="Im"></im> <im v-if="LiveProps[liveDetail.status].isLive" :liveDetail="liveDetail" :isAction="isAction" :detail="detail" class="Im"></im>
<action :bgBlack="true" class="BgAction" v-show="isAction && !LiveProps[liveDetail.status].isLive"></action> <action :videoFullscreen="true" class="BgAction" v-show="isAction && !LiveProps[liveDetail.status].isLive"></action>
</div> </div>
</div> </div>
</div> </div>
...@@ -65,7 +65,7 @@ const IMAGES = Object.freeze({ ...@@ -65,7 +65,7 @@ const IMAGES = Object.freeze({
}) })
const TCPlayerConfig = Object.freeze({ const TCPlayerConfig = Object.freeze({
autoplay: true, // 自动播放 autoplay: true, // 自动播放
loop: true, // 循环播放 // loop: false, // 循环播放
muted: true, // 是否静音 muted: true, // 是否静音
controlBar: { // 控制条配置 controlBar: { // 控制条配置
fullscreenToggle: false // 隐藏全屏按钮 fullscreenToggle: false // 隐藏全屏按钮
...@@ -76,8 +76,8 @@ const TCPlayerConfig = Object.freeze({ ...@@ -76,8 +76,8 @@ const TCPlayerConfig = Object.freeze({
}) })
const LiveProps = Object.freeze({ const LiveProps = Object.freeze({
'0': { isShowBox: false }, '0': { isShowBox: false },
'1': { status: '直播', text: '正在直播', isLive: true, covergif: IMAGES.COVER_LIVE, isShowBox: true }, '1': { status: '直播', text: '正在直播', isLive: true, covergif: IMAGES.COVER_LIVE, isShowBox: true, gifAttr: 'liveBroadcastRoomCover' },
'2': { status: '回放', text: '直播回放', isLive: false, covergif: IMAGES.COVER_REPLAY, isShowBox: true, icon: IMAGES.REPLAY_ICON } '2': { status: '回放', text: '直播回放', isLive: false, covergif: IMAGES.COVER_REPLAY, isShowBox: true, icon: IMAGES.REPLAY_ICON, gifAttr: 'liveBroadcastRoomEndCover' }
}) })
const PLAYERDOMID = 'player-container-id' const PLAYERDOMID = 'player-container-id'
export default { export default {
...@@ -91,7 +91,8 @@ export default { ...@@ -91,7 +91,8 @@ export default {
videoStyle: '', videoStyle: '',
isSmallBox: false, //是否显示小容器直播 isSmallBox: false, //是否显示小容器直播
LiveProps, LiveProps,
IMAGES IMAGES,
fileIdx: 0
} }
}, },
computed: { computed: {
...@@ -138,14 +139,23 @@ export default { ...@@ -138,14 +139,23 @@ export default {
// console.log('====', { result }); // console.log('====', { result });
this.player.ready(() => { // 设置播放器初始化完成后的回调 this.player.ready(() => { // 设置播放器初始化完成后的回调
this.fixHls() this.fixHls()
const src = this.LiveProps[this.liveDetail.status].isLive ? this.liveDetail.playPath : (this.liveDetail.liveBroadcastRecordingFileList || [])[0]?.videoUrl const _this = this
const src = this.LiveProps[this.liveDetail.status].isLive ? this.liveDetail.pullWebRtcUrl : (this.liveDetail.liveBroadcastRecordingFileList || [])[this.fileIdx]?.videoUrl
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) { // 录播,视频播放ended
// // 从回调参数 event 中获取事件状态码及相关数据 this.player.on('ended', function (event) {
// console.log(event, 'error-----------') let fileList = _this.liveDetail.liveBroadcastRecordingFileList
// }) if(fileList.length == 1) {
_this.player.play()
return true
}
// 从回调参数 event 中获取事件状态码及相关数据
_this.fileIdx = _this.fileIdx == (fileList.length - 1) ? 0 : _this.fileIdx + 1
_this.player.src(fileList[_this.fileIdx]?.videoUrl)
_this.player.play()
})
this.draggable(document.getElementById('live-box'), this.openFullscreen, 'icon-live-close') this.draggable(document.getElementById('live-box'), this.openFullscreen, 'icon-live-close')
}) })
} }
......
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
obj = {}, obj = {},
phoneRex = /^[1]([3-9])[0-9]{9}$/, phoneRex = /^[1]([3-9])[0-9]{9}$/,
userInfo = this.getUserInfo(), userInfo = this.getUserInfo(),
platNumberRex = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$)|([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/ platNumberRex = /^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([A-Z]([A-HJ-NP-Z0-9]){5})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/
console.log(params) console.log(params)
try { try {
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<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"> <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" /> <img class="icon-send" slot="button" @click="sendTextMessage" src="@/assets/images/send.png" />
</van-field> </van-field>
<action :bgBlack="true" class="action" v-show="isAction && !isFocus" :isImAction="true"></action> <action :videoFullscreen="true" class="action" v-show="isAction && !isFocus" :isImAction="true"></action>
</div> </div>
</div> </div>
</div> </div>
...@@ -50,6 +50,10 @@ export default { ...@@ -50,6 +50,10 @@ export default {
} }
}, },
props: { props: {
detail: {
type: Object,
default: () => { }
},
liveDetail: { liveDetail: {
type: Object, type: Object,
default: () => { default: () => {
...@@ -90,9 +94,18 @@ export default { ...@@ -90,9 +94,18 @@ export default {
}, },
getUserSig() { getUserSig() {
const userInfo = util.getUserInfo() const userInfo = util.getUserInfo()
// userId = this.userInfo.openid || this.userInfo.uuid const userId = userInfo.openid || userInfo.uuid
const userId = userInfo.nickName || userInfo.userName // const userId = userInfo.nickName || userInfo.userName
shopmallApi.getLiveSig({ userId: userId }).then(res => { const params = this.getLocalStorage('wx_scrm_link_params') || {}
// sourceShopId-来源门店;visitSource-访问来源;bizType-业务类型(0-众筹);bizCode-业务标识(众筹-活动ID)
const obj = {
userId: userId,
sourceShopId: params.merchantId || '',
visitSource: 'H5-众筹',
bizType: 0,
bizCode: this.detail.id
}
shopmallApi.getLiveSig(obj).then(res => {
this.userSig = res.userSig this.userSig = res.userSig
this.initTim() this.initTim()
}) })
...@@ -100,7 +113,7 @@ export default { ...@@ -100,7 +113,7 @@ export default {
initTim() { initTim() {
const userInfo = util.getUserInfo() const userInfo = util.getUserInfo()
const imOptions = { const imOptions = {
userID: userInfo.nickName || userInfo.userName, userID: userInfo.openid || userInfo.uuid,
userSig: this.userSig, userSig: this.userSig,
groupID: this.liveDetail.imGroupId, groupID: this.liveDetail.imGroupId,
SDKAppID: this.liveDetail.imSdkAppId, SDKAppID: this.liveDetail.imSdkAppId,
...@@ -110,6 +123,7 @@ export default { ...@@ -110,6 +123,7 @@ export default {
timObj = new IM(imOptions) timObj = new IM(imOptions)
timObj.join(imOptions).then(res => { timObj.join(imOptions).then(res => {
// console.log('login-------') // console.log('login-------')
timObj.updateMyProfile({ nick: userInfo.nickName })
}) })
}, },
// 收到消息触发 // 收到消息触发
...@@ -126,7 +140,7 @@ export default { ...@@ -126,7 +140,7 @@ export default {
// 群成员发送消息 // 群成员发送消息
// let eleData = JSON.parse() // let eleData = JSON.parse()
let eleData = { let eleData = {
userName: item.from, userName: item.nick,
content: item.payload.text content: item.payload.text
} }
// 获取群聊消息,消息上屏 // 获取群聊消息,消息上屏
......
...@@ -67,6 +67,19 @@ export default class IM { ...@@ -67,6 +67,19 @@ export default class IM {
.catch(reject) .catch(reject)
}) })
} }
/** 更新用户标配信息
* nick,avatar,gender,selfSignature,allowType
*/
updateMyProfile(obj) {
let promise = this.tim.updateMyProfile(obj)
promise
.then(function (imResponse) {
console.log(imResponse.data) // 更新资料成功
})
.catch(function (imError) {
console.warn('updateMyProfile error:', imError) // 更新资料失败的相关信息
})
}
/** /**
* 加入群聊 * 加入群聊
* @returns Promise * @returns Promise
......
...@@ -35,9 +35,8 @@ export default { ...@@ -35,9 +35,8 @@ export default {
plateNo, plateNo,
payPrice, payPrice,
userName, userName,
userPhone,
goodsName, goodsName,
outTradeNo, orderCode,
orderStatus, orderStatus,
createdDate, createdDate,
vehicleBrandName, vehicleBrandName,
...@@ -70,10 +69,6 @@ export default { ...@@ -70,10 +69,6 @@ export default {
height: canvasHeight, height: canvasHeight,
// pixelRatio: 1 // pixelRatio: 1
}) })
if (userPhone) {
labelList.push('手机:')
valueList.push(userPhone)
}
if (plateNo) { if (plateNo) {
labelList.push('车牌号:') labelList.push('车牌号:')
valueList.push(plateNo) valueList.push(plateNo)
...@@ -85,9 +80,9 @@ export default { ...@@ -85,9 +80,9 @@ export default {
} }
labelList = [...labelList, '商品名称:', '支付时间:'] labelList = [...labelList, '商品名称:', '支付时间:']
valueList = [...valueList, goodsName, new Date(createdDate).format('yyyy年M月d日 hh:mm:ss')] valueList = [...valueList, goodsName, new Date(createdDate).format('yyyy年M月d日 hh:mm:ss')]
if (orderStatus != 10 && outTradeNo) { if (orderStatus != 10 && orderCode) {
labelList.push('商户订单号:') labelList.push('订单号:')
valueList.push(outTradeNo) valueList.push(orderCode)
} }
if (formContentFirst) { if (formContentFirst) {
labelList.push(formDescribeFirst) labelList.push(formDescribeFirst)
...@@ -119,7 +114,7 @@ export default { ...@@ -119,7 +114,7 @@ export default {
}, () => { }, () => {
if (orderStatus == 10) { if (orderStatus == 10) {
draw.drawText({ draw.drawText({
text: '商户订单号', text: '订单号',
x: labelX - 1, x: labelX - 1,
y: 24, y: 24,
color: '#282829', color: '#282829',
...@@ -127,7 +122,7 @@ export default { ...@@ -127,7 +122,7 @@ export default {
textBaseline textBaseline
}) })
draw.drawText({ draw.drawText({
text: outTradeNo || '', text: orderCode || '',
x: labelX - 1, x: labelX - 1,
y: 54, y: 54,
color: '#282829', color: '#282829',
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
module.exports = { module.exports = {
title: '加载中...', title: '加载中...',
request: { request: {
baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址, baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
...@@ -29,7 +29,7 @@ module.exports = { ...@@ -29,7 +29,7 @@ module.exports = {
}, },
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b', secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
miniprogramInfo: { miniprogramInfo: {
username: 'gh_e97aea625843', username: 'gh_e983752bf563',
envVersion: 'trial', envVersion: 'trial',
}, },
// shopmall_id: "gh_e983752bf563", //嘀加 // shopmall_id: "gh_e983752bf563", //嘀加
......
...@@ -29,6 +29,8 @@ router.beforeEach((to, from, next) => { ...@@ -29,6 +29,8 @@ router.beforeEach((to, from, next) => {
/* 路由发生变化修改页面title */ /* 路由发生变化修改页面title */
if (to.meta.title) store.dispatch('setPageMeta', to.meta) if (to.meta.title) store.dispatch('setPageMeta', to.meta)
store.commit('SET_LAST_PATH', to.name) store.commit('SET_LAST_PATH', to.name)
// 收款测试页面直接进入
if (to.path && to.path.indexOf('testPayMerchant/index/split') > -1) store.commit('SET_LAST_PATH', 'testPayMerchant.index')
/* 路由发生变化修改页面背景色 */ /* 路由发生变化修改页面背景色 */
if (to.meta.backgroundColor) document.documentElement.style.backgroundColor = to.meta.backgroundColor if (to.meta.backgroundColor) document.documentElement.style.backgroundColor = to.meta.backgroundColor
if (to.matched.some(recode => recode.meta.noAuth)) { if (to.matched.some(recode => recode.meta.noAuth)) {
......
...@@ -75,6 +75,26 @@ const pages = { ...@@ -75,6 +75,26 @@ const pages = {
backgroundColor: '#101010' backgroundColor: '#101010'
} }
} }
],
common:[
{
name: 'auth',
meta: {
keepAlive: true,
backgroundColor: '#F7F7F7'
}
},
],
testPayMerchant: [
{
name: 'index',
meta: {
keepAlive: true,
// noAuth: true,
backgroundColor: '#F7F7F7',
showAction: true
}
},
] ]
} }
let routes = [ let routes = [
......
...@@ -20,19 +20,19 @@ const state = { ...@@ -20,19 +20,19 @@ const state = {
isLiveFull: false isLiveFull: false
} }
const mutations = { const mutations = {
SET_ACTIVITY_INFO(state, value) { SET_ACTIVITY_INFO (state, value) {
state.activityInfo = value state.activityInfo = value
state.updataCarInfo = Date.now() state.updataCarInfo = Date.now()
}, },
SET_PAGE_META(state, meta) { SET_PAGE_META (state, meta) {
state.pageMeta = meta state.pageMeta = meta
}, },
PUSH_KEEP(state, name) { PUSH_KEEP (state, name) {
if (!state.keepAlives.includes(name)) { if (!state.keepAlives.includes(name)) {
state.keepAlives.push(name) state.keepAlives.push(name)
} }
}, },
REMOVE_KEEP(state, names) { REMOVE_KEEP (state, names) {
state.keepAlives = state.keepAlives.reduce((arr, name) => { state.keepAlives = state.keepAlives.reduce((arr, name) => {
if (!names.includes(name)) { if (!names.includes(name)) {
return arr.push(name) return arr.push(name)
...@@ -40,37 +40,37 @@ const mutations = { ...@@ -40,37 +40,37 @@ const mutations = {
return arr return arr
}, []) }, [])
}, },
SET_LAST_PATH(state, path) { SET_LAST_PATH (state, path) {
state.lastPath = path state.lastPath = path
}, },
SET_LOGIN_STATUS(state, data) { SET_LOGIN_STATUS (state, data) {
state.loginStatus = data state.loginStatus = data
}, },
SET_LIVE_FULL(state, data) { SET_LIVE_FULL (state, data) {
state.isLiveFull = data state.isLiveFull = data
} }
} }
const actions = { const actions = {
setPageMeta({ commit }, meta) { setPageMeta ({ commit }, meta) {
document.title = meta.title document.title = meta.title
commit('SET_PAGE_META', meta) commit('SET_PAGE_META', meta)
}, },
pushKeep({ commit }, name) { pushKeep ({ commit }, name) {
commit('PUSH_KEEP', name) commit('PUSH_KEEP', name)
}, },
removeKeep({ commit }, names) { removeKeep ({ commit }, names) {
commit('REMOVE_KEEP', names) commit('REMOVE_KEEP', names)
}, },
setActivityInfo({ commit }, value) { setActivityInfo ({ commit }, value) {
commit('SET_ACTIVITY_INFO', value) commit('SET_ACTIVITY_INFO', value)
}, },
setLoginStatus({ commit }, value) { setLoginStatus ({ commit }, value) {
commit('SET_LOGIN_STATUS', value) commit('SET_LOGIN_STATUS', value)
}, },
setIsLiveFull({ commit }, value) { setIsLiveFull ({ commit }, value) {
commit('SET_LIVE_FULL', value) commit('SET_LIVE_FULL', value)
}, },
wxLogin({ dispatch }, { code, redirectUrl, appId }) { wxLogin ({ dispatch }, { code, redirectUrl, appId }) {
ssoApi ssoApi
.login({ .login({
code, code,
...@@ -96,7 +96,7 @@ const actions = { ...@@ -96,7 +96,7 @@ const actions = {
} }
}) })
}, },
getWxCode({ dispatch }) { getWxCode ({ dispatch }) {
let [redirectUrl] = window.location.href.split('?') let [redirectUrl] = window.location.href.split('?')
let params = util.getPageQuery() let params = util.getPageQuery()
let arr = [] let arr = []
...@@ -114,7 +114,7 @@ const actions = { ...@@ -114,7 +114,7 @@ const actions = {
util.setAppId(appid) util.setAppId(appid)
window.location.href = `${wxUrl}&state=STATE#wechat_redirect` window.location.href = `${wxUrl}&state=STATE#wechat_redirect`
}, },
login({ dispatch }) { login ({ dispatch }) {
let [redirectUrl] = window.location.href.split('?') let [redirectUrl] = window.location.href.split('?')
const isWxWork = util.getLocalStorage('is_wxwork') const isWxWork = util.getLocalStorage('is_wxwork')
const code = util.getPageQuery('code') const code = util.getPageQuery('code')
...@@ -126,15 +126,15 @@ const actions = { ...@@ -126,15 +126,15 @@ const actions = {
const target = isWxWork ? 'wwLogin' : 'login' const target = isWxWork ? 'wwLogin' : 'login'
const PARAMS = isWxWork const PARAMS = isWxWork
? { ? {
code, code,
corpId: appId, corpId: appId,
getUserInfoFlag: false getUserInfoFlag: false
} }
: { : {
code, code,
appId: window.$fetchConfig.appid, appId: window.$fetchConfig.appid,
state: 'snsapi_userinfo' state: 'snsapi_userinfo'
} }
ssoApi[target](PARAMS).then(({ code, data, message }) => { ssoApi[target](PARAMS).then(({ code, data, message }) => {
let route = state.lastPath == 'crowdfunding' ? '' : state.lastPath || '' let route = state.lastPath == 'crowdfunding' ? '' : state.lastPath || ''
route = route.replace('.', '/') route = route.replace('.', '/')
...@@ -157,7 +157,7 @@ const actions = { ...@@ -157,7 +157,7 @@ const actions = {
pageQuery = pageQuery.replace(/\|/g, '&') pageQuery = pageQuery.replace(/\|/g, '&')
let url = `${redirectUrl}#/${route}` let url = `${redirectUrl}#/${route}`
if (pageQuery) url += `?${pageQuery}` if (pageQuery) url += `?${pageQuery}`
window.location.replace(url) window.location.replace(url)
} else Notify(message) } else Notify(message)
}) })
} else dispatch('getWxCode') } else dispatch('getWxCode')
...@@ -173,7 +173,7 @@ const actions = { ...@@ -173,7 +173,7 @@ const actions = {
} }
} }
}, },
navigation({ dispatch }) { navigation ({ dispatch }) {
const isWxWork = util.getLocalStorage('is_wxwork') const isWxWork = util.getLocalStorage('is_wxwork')
let params = util.getPageQuery() //从链接获取 let params = util.getPageQuery() //从链接获取
if (Object.keys(params).length && params.id) util.setLocalStorage('wx_scrm_link_params', params) if (Object.keys(params).length && params.id) util.setLocalStorage('wx_scrm_link_params', params)
...@@ -195,7 +195,7 @@ const actions = { ...@@ -195,7 +195,7 @@ const actions = {
return return
} else dispatch('login') } else dispatch('login')
}, },
registerHttp({ dispatch }, 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 } })
} }
} }
......
<template>
<div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ No newline at end of file
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,7 @@ export default {
border-radius: 50%; border-radius: 50%;
} }
.name { .name {
max-width: 120px; max-width: 110px;
margin: 0 4px; margin: 0 4px;
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
......
...@@ -226,8 +226,7 @@ ...@@ -226,8 +226,7 @@
<div class="text">{{ detail.activityAddressDetailName }}</div> <div class="text">{{ detail.activityAddressDetailName }}</div>
<div class="time flex"> <div class="time flex">
<div class="sprite-icon icon-time"></div> <div class="sprite-icon icon-time"></div>
活动时间: 活动时间:{{ detail.s_time }}-{{ detail.e_time }}
{{ detail.s_time }}-{{ detail.e_time }}
</div> </div>
</div> </div>
<template v-if="detail.activityAddressLat && detail.activityAddressLng"> <template v-if="detail.activityAddressLat && detail.activityAddressLng">
......
...@@ -33,11 +33,10 @@ export default { ...@@ -33,11 +33,10 @@ export default {
activityJoin, activityJoin,
payPrice, payPrice,
orderGoods: [orderGoods], orderGoods: [orderGoods],
outTradeNo orderCode
} = orderInfo } = orderInfo
this.orderInfo = { this.orderInfo = {
userName: activityJoin.userName, userName: activityJoin.userName,
userPhone: activityJoin.userPhone,
plateNo: activityJoin.plateNo, plateNo: activityJoin.plateNo,
vehicleBrandName: activityJoin.vehicleBrandName, vehicleBrandName: activityJoin.vehicleBrandName,
vehicleSubBrandName: activityJoin.vehicleSubBrandName, vehicleSubBrandName: activityJoin.vehicleSubBrandName,
...@@ -51,7 +50,7 @@ export default { ...@@ -51,7 +50,7 @@ export default {
formContentSecond: activityJoin.formContentSecond, formContentSecond: activityJoin.formContentSecond,
formDescribeFirst: activityJoin.formDescribeFirst, formDescribeFirst: activityJoin.formDescribeFirst,
formDescribeSecond: activityJoin.formDescribeSecond, formDescribeSecond: activityJoin.formDescribeSecond,
outTradeNo orderCode
} }
}, },
methods: { methods: {
......
<template>
</template>
<script type="text/ecmascript-6">
import { wxConfig, shopmallApi } from '@/api'
import { util } from '@/utils'
export default {
name: 'testPayMerchant',
data() {
return {
testAmount: 1
}
},
created() {
this.init()
},
methods: {
async init() {
const { payMannerId, createBy } = this.getQuery()
const userInfo = util.getUserInfo()
const res = userInfo
let params = {
payMannerId: payMannerId,
totalAmount: this.testAmount,
buyerId: res.openid,
description: '账号测试',
createBy: createBy
}
if (res) {
shopmallApi.creatCollectionsTestOrder(params).then(e => {
if (e) {
const { timeStamp, nonceStr, packages, signType, paySign } = e.payParams
wxConfig.init().then(() => {
wxConfig.chooseWXPay({
timestamp: timeStamp,
nonceStr: nonceStr,
packages: packages,
signType: signType,
paySign: paySign,
}).then(() => this.to('crowdfunding.success', { orderInfo })).catch(err => console.log(err))
})
}
})
}
}
}
}
</script>
\ No newline at end of file \ No newline at end of file
...@@ -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-lm/', // 本地调试时需登录时使用 publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main-lwk/', // 本地调试时需登录时使用
// 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!