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 @@
* @LastEditors: huyue
* @LastEditTime: 2022-09-26 16:22:15
-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no,viewport-fit=cover">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no,viewport-fit=cover" />
<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="stylesheet" />
<% } %>
<title>
<%= webpackConfig.name %>
</title>
</head>
<title><%= webpackConfig.name %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it
to continue.</strong>
</noscript>
<div id="app"></div>
<!-- 使用CDN加速的JS文件,配置在vue.config.js下 -->
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %>
<body>
<noscript>
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- 使用CDN加速的JS文件,配置在vue.config.js下 -->
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></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
<!-- built files will be auto injected -->
</body>
</html>
const url = '/rop-scrm-shopmall/router'
import { util } from 'utils'
export default {
/**众筹详情 */
getActivityDetail(id) {
getActivityDetail (id) {
return window.$HTTP({
url,
data: {
......@@ -12,7 +13,7 @@ export default {
})
},
/**参团人数 */
getActivityGroup(id) {
getActivityGroup (id) {
return window.$HTTP({
url,
data: {
......@@ -22,7 +23,7 @@ export default {
})
},
/** 创建订单(立即购买) */
createOrder(data) {
createOrder (data) {
data.method = 'scrm.api.shopmall.weapp.order.create'
return window.$HTTP({
url,
......@@ -31,7 +32,7 @@ export default {
})
},
/**创建支付订单(去付款) */
payOrder(data) {
payOrder (data) {
data.method = `scrm.api.shopmall.weapp.order.createPay`
return window.$HTTP({
url,
......@@ -40,7 +41,7 @@ export default {
})
},
/**海报 */
getPoster(data) {
getPoster (data) {
data.method = `scrm.api.shopmall.weapp.crowdFunding.poster`
return window.$HTTP({
url,
......@@ -48,7 +49,7 @@ export default {
})
},
/** 订单详情 */
getOrderList(activityId) {
getOrderList (activityId) {
let data = {
activityId,
method: 'scrm.api.shopmall.weapp.crowdFunding.order.list'
......@@ -59,7 +60,7 @@ export default {
})
},
// 根据众筹id获取直播详情
getLiveDetail(id) {
getLiveDetail (id) {
let data = {
id,
method: 'scrm.api.shopmall.weapp.activity.live.broadcast.detail'
......@@ -70,7 +71,7 @@ export default {
})
},
// 直播IM用户签名
getLiveSig(data) {
getLiveSig (data) {
data.method = 'scrm.api.shopmall.weapp.live.activity.usersig'
return window.$HTTP({
url,
......@@ -78,11 +79,47 @@ export default {
})
},
/** 查询分享人信息 */
getStaffInfo(data) {
getStaffInfo (data) {
data.method = 'scrm.api.shopmall.activity.share.user.info'
return window.$HTTP({
url,
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 @@
position: relative;
width: 100%;
overflow: hidden;
margin-bottom: 10px;
margin-bottom: 5px;
img {
object-fit: contain;
......
......@@ -94,6 +94,7 @@ video {
left: -10000px;
width: 10px;
height: 10px;
z-index: -1;
}
.live-line {
......@@ -101,6 +102,7 @@ video {
position: relative;
@keyframes side-animation {
0%,
50%,
100% {
......@@ -132,4 +134,4 @@ video {
left: 4px;
animation: side-animation 2s infinite reverse;
}
}
}
\ No newline at end of file
<template>
<div :class="['action isFullSucreen flex', { bgBlack: bgBlack }, { liveBtn: isImAction }]" v-if="show">
<div class="btn-box flex" v-show="!bgBlack">
<div class="item" @click="getPoster">
<div
:class="['action isFullSucreen flex', { bgBlack: videoFullscreen }, { liveBtn: isImAction }]"
v-if="show"
>
<div
class="btn-box flex"
v-show="!videoFullscreen"
>
<div
class="item"
@click="getPoster"
>
<div class="sprite-icon icon-poster"></div>
海报
</div>
......@@ -11,10 +20,20 @@
{{ detail.price }}
<span>.{{ detail.decimal }}</span>
</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">
员工注册
<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">
<div class="mini-btn">点击跳转</div>
</script>
......@@ -30,12 +49,32 @@
</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>
......@@ -51,7 +90,7 @@ export default {
watch: {
watchUpdataCarInfo: {
immediate: true,
handler(n) {
handler (n) {
let {
activityInfo: { carInfo },
activityInfo }
......@@ -62,7 +101,7 @@ export default {
},
watchInfo: {
immediate: true,
handler(n) {
handler (n) {
if (n.id) {
this.init(n)
}
......@@ -70,14 +109,14 @@ export default {
}
},
computed: {
watchInfo() {
watchInfo () {
return this.$store.state.app.activityInfo
},
watchUpdataCarInfo() {
watchUpdataCarInfo () {
return this.$store.state.app.updataCarInfo
}
},
data() {
data () {
return {
show: false,
showModal: false,
......@@ -92,7 +131,7 @@ export default {
}
},
props: {
bgBlack: {
videoFullscreen: {
type: Boolean,
default: false
},
......@@ -101,11 +140,11 @@ export default {
default: false
}
},
mounted() {
mounted () {
this.iSMiniprogram = window.__wxjs_environment === 'miniprogram'
},
methods: {
init(n) {
init (n) {
const { isStaffLoginLink } = this.getQuery(),
{ miniprogramInfo } = window.$fetchConfig,
params = this.getLocalStorage('wx_scrm_link_params'),
......@@ -117,7 +156,7 @@ export default {
type: n.employeeRegistrationLinkFlag == 2 ? 1 : 0
}
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 [price, decimal] = this.centsToyuan(n.retailPrice + expressFee).toString().split('.')
if (!decimal) decimal = '00'
......@@ -167,7 +206,7 @@ export default {
this.formList = [...formList, ...list]
this.show = true
},
submit() {
submit () {
let { detail, iSMiniprogram } = this
if (detail.isStaffLoginLink) {
return
......@@ -208,6 +247,7 @@ export default {
isExclusive: linkParams.isExclusive || ''//专属链接参数
}
shopmallApi.createOrder(params).then(({ data, code, message }) => {
if(detail.liveBroadcastRoomId) data.liveBroadcastRoomId = detail.liveBroadcastRoomId
if (code == '0') that.pay(data)
else {
that.payStatus = Date.now()
......@@ -215,18 +255,20 @@ export default {
}
})
}, 1e3),
pay(orderInfo) {
pay (orderInfo) {
this.showLoading('结算中')
this.payStatus = Date.now()
shopmallApi.payOrder({
orderCode: orderInfo.orderCode
}).then(({ code, data, message }) => {
orderCode: orderInfo.orderCode,
paymentSource: 2 //1128版本 支付来源(1:小程序,2:公众号)
}).then(async ({ code, data, message }) => {
this.hideLoading()
let [url] = window.location.href.split('?')
let redirectUrl = `${url}/success`
if (code == '0') {
this.showModal = false
let { needPay, payParams } = data
let { needPay, payParams, order } = data,
{ videoFullscreen } = this
if (needPay) {
let params = {
nonceStr: payParams.nonceStr,
......@@ -253,10 +295,18 @@ export default {
})
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)
})
},
getPoster() {
getPoster () {
let { id } = this.detail
let userInfo = this.getUserInfo()
let { phone, nickName, logo } = userInfo
......
......@@ -32,7 +32,7 @@
<div class="text">{{ LiveProps[liveDetail.status].text }}</div>
</div>
<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>
</div>
<div class="fullscreen-btn" @click="openFullscreen(false)">
......@@ -47,8 +47,8 @@
<div v-show="videoFullscreen">
<!-- IM -->
<im v-if="LiveProps[liveDetail.status].isLive" :liveDetail="liveDetail" :isAction="isAction" class="Im"></im>
<action :bgBlack="true" class="BgAction" v-show="isAction && !LiveProps[liveDetail.status].isLive"></action>
<im v-if="LiveProps[liveDetail.status].isLive" :liveDetail="liveDetail" :isAction="isAction" :detail="detail" class="Im"></im>
<action :videoFullscreen="true" class="BgAction" v-show="isAction && !LiveProps[liveDetail.status].isLive"></action>
</div>
</div>
</div>
......@@ -65,7 +65,7 @@ const IMAGES = Object.freeze({
})
const TCPlayerConfig = Object.freeze({
autoplay: true, // 自动播放
loop: true, // 循环播放
// loop: false, // 循环播放
muted: true, // 是否静音
controlBar: { // 控制条配置
fullscreenToggle: false // 隐藏全屏按钮
......@@ -76,8 +76,8 @@ const TCPlayerConfig = Object.freeze({
})
const LiveProps = Object.freeze({
'0': { isShowBox: false },
'1': { status: '直播', text: '正在直播', isLive: true, covergif: IMAGES.COVER_LIVE, isShowBox: true },
'2': { status: '回放', text: '直播回放', isLive: false, covergif: IMAGES.COVER_REPLAY, isShowBox: true, icon: IMAGES.REPLAY_ICON }
'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, gifAttr: 'liveBroadcastRoomEndCover' }
})
const PLAYERDOMID = 'player-container-id'
export default {
......@@ -91,7 +91,8 @@ export default {
videoStyle: '',
isSmallBox: false, //是否显示小容器直播
LiveProps,
IMAGES
IMAGES,
fileIdx: 0
}
},
computed: {
......@@ -138,14 +139,23 @@ export default {
// console.log('====', { result });
this.player.ready(() => { // 设置播放器初始化完成后的回调
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.poster()
this.player.play() // 播放视频
// this.player.on('error', function (event) {
// // 从回调参数 event 中获取事件状态码及相关数据
// console.log(event, 'error-----------')
// })
// 录播,视频播放ended
this.player.on('ended', function (event) {
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')
})
}
......
......@@ -110,7 +110,7 @@ export default {
obj = {},
phoneRex = /^[1]([3-9])[0-9]{9}$/,
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)
try {
......
......@@ -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">
<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>
<action :videoFullscreen="true" class="action" v-show="isAction && !isFocus" :isImAction="true"></action>
</div>
</div>
</div>
......@@ -50,6 +50,10 @@ export default {
}
},
props: {
detail: {
type: Object,
default: () => { }
},
liveDetail: {
type: Object,
default: () => {
......@@ -90,9 +94,18 @@ export default {
},
getUserSig() {
const userInfo = util.getUserInfo()
// userId = this.userInfo.openid || this.userInfo.uuid
const userId = userInfo.nickName || userInfo.userName
shopmallApi.getLiveSig({ userId: userId }).then(res => {
const userId = userInfo.openid || userInfo.uuid
// const userId = userInfo.nickName || userInfo.userName
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.initTim()
})
......@@ -100,7 +113,7 @@ export default {
initTim() {
const userInfo = util.getUserInfo()
const imOptions = {
userID: userInfo.nickName || userInfo.userName,
userID: userInfo.openid || userInfo.uuid,
userSig: this.userSig,
groupID: this.liveDetail.imGroupId,
SDKAppID: this.liveDetail.imSdkAppId,
......@@ -110,6 +123,7 @@ export default {
timObj = new IM(imOptions)
timObj.join(imOptions).then(res => {
// console.log('login-------')
timObj.updateMyProfile({ nick: userInfo.nickName })
})
},
// 收到消息触发
......@@ -126,7 +140,7 @@ export default {
// 群成员发送消息
// let eleData = JSON.parse()
let eleData = {
userName: item.from,
userName: item.nick,
content: item.payload.text
}
// 获取群聊消息,消息上屏
......
......@@ -67,6 +67,19 @@ export default class IM {
.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
......
......@@ -35,9 +35,8 @@ export default {
plateNo,
payPrice,
userName,
userPhone,
goodsName,
outTradeNo,
orderCode,
orderStatus,
createdDate,
vehicleBrandName,
......@@ -70,10 +69,6 @@ export default {
height: canvasHeight,
// pixelRatio: 1
})
if (userPhone) {
labelList.push('手机:')
valueList.push(userPhone)
}
if (plateNo) {
labelList.push('车牌号:')
valueList.push(plateNo)
......@@ -85,9 +80,9 @@ export default {
}
labelList = [...labelList, '商品名称:', '支付时间:']
valueList = [...valueList, goodsName, new Date(createdDate).format('yyyy年M月d日 hh:mm:ss')]
if (orderStatus != 10 && outTradeNo) {
labelList.push('商户订单号:')
valueList.push(outTradeNo)
if (orderStatus != 10 && orderCode) {
labelList.push('订单号:')
valueList.push(orderCode)
}
if (formContentFirst) {
labelList.push(formDescribeFirst)
......@@ -119,7 +114,7 @@ export default {
}, () => {
if (orderStatus == 10) {
draw.drawText({
text: '商户订单号',
text: '订单号',
x: labelX - 1,
y: 24,
color: '#282829',
......@@ -127,7 +122,7 @@ export default {
textBaseline
})
draw.drawText({
text: outTradeNo || '',
text: orderCode || '',
x: labelX - 1,
y: 54,
color: '#282829',
......
......@@ -10,7 +10,7 @@
module.exports = {
title: '加载中...',
request: {
baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址,
baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间
timeout: 180000,
// 携带凭证
......@@ -29,7 +29,7 @@ module.exports = {
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
miniprogramInfo: {
username: 'gh_e97aea625843',
username: 'gh_e983752bf563',
envVersion: 'trial',
},
// shopmall_id: "gh_e983752bf563", //嘀加
......
......@@ -29,6 +29,8 @@ router.beforeEach((to, from, next) => {
/* 路由发生变化修改页面title */
if (to.meta.title) store.dispatch('setPageMeta', to.meta)
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.matched.some(recode => recode.meta.noAuth)) {
......
......@@ -75,6 +75,26 @@ const pages = {
backgroundColor: '#101010'
}
}
],
common:[
{
name: 'auth',
meta: {
keepAlive: true,
backgroundColor: '#F7F7F7'
}
},
],
testPayMerchant: [
{
name: 'index',
meta: {
keepAlive: true,
// noAuth: true,
backgroundColor: '#F7F7F7',
showAction: true
}
},
]
}
let routes = [
......
......@@ -20,19 +20,19 @@ const state = {
isLiveFull: false
}
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)
......@@ -40,37 +40,37 @@ const mutations = {
return arr
}, [])
},
SET_LAST_PATH(state, path) {
SET_LAST_PATH (state, path) {
state.lastPath = path
},
SET_LOGIN_STATUS(state, data) {
SET_LOGIN_STATUS (state, data) {
state.loginStatus = data
},
SET_LIVE_FULL(state, data) {
SET_LIVE_FULL (state, data) {
state.isLiveFull = data
}
}
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)
},
setLoginStatus({ commit }, value) {
setLoginStatus ({ commit }, value) {
commit('SET_LOGIN_STATUS', value)
},
setIsLiveFull({ commit }, value) {
setIsLiveFull ({ commit }, value) {
commit('SET_LIVE_FULL', value)
},
wxLogin({ dispatch }, { code, redirectUrl, appId }) {
wxLogin ({ dispatch }, { code, redirectUrl, appId }) {
ssoApi
.login({
code,
......@@ -96,7 +96,7 @@ const actions = {
}
})
},
getWxCode({ dispatch }) {
getWxCode ({ dispatch }) {
let [redirectUrl] = window.location.href.split('?')
let params = util.getPageQuery()
let arr = []
......@@ -114,7 +114,7 @@ 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')
......@@ -126,15 +126,15 @@ const actions = {
const target = isWxWork ? 'wwLogin' : 'login'
const PARAMS = isWxWork
? {
code,
corpId: appId,
getUserInfoFlag: false
}
code,
corpId: appId,
getUserInfoFlag: false
}
: {
code,
appId: window.$fetchConfig.appid,
state: 'snsapi_userinfo'
}
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('.', '/')
......@@ -157,7 +157,7 @@ const actions = {
pageQuery = pageQuery.replace(/\|/g, '&')
let url = `${redirectUrl}#/${route}`
if (pageQuery) url += `?${pageQuery}`
window.location.replace(url)
window.location.replace(url)
} else Notify(message)
})
} else dispatch('getWxCode')
......@@ -173,7 +173,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)
......@@ -195,7 +195,7 @@ const actions = {
return
} else dispatch('login')
},
registerHttp({ dispatch }, sessionId = '') {
registerHttp ({ dispatch }, 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
......@@ -67,7 +67,7 @@ export default {
border-radius: 50%;
}
.name {
max-width: 120px;
max-width: 110px;
margin: 0 4px;
font-size: 16px;
font-weight: 600;
......
......@@ -226,8 +226,7 @@
<div class="text">{{ detail.activityAddressDetailName }}</div>
<div class="time flex">
<div class="sprite-icon icon-time"></div>
活动时间:
{{ detail.s_time }}-{{ detail.e_time }}
活动时间:{{ detail.s_time }}-{{ detail.e_time }}
</div>
</div>
<template v-if="detail.activityAddressLat && detail.activityAddressLng">
......
......@@ -33,11 +33,10 @@ export default {
activityJoin,
payPrice,
orderGoods: [orderGoods],
outTradeNo
orderCode
} = orderInfo
this.orderInfo = {
userName: activityJoin.userName,
userPhone: activityJoin.userPhone,
plateNo: activityJoin.plateNo,
vehicleBrandName: activityJoin.vehicleBrandName,
vehicleSubBrandName: activityJoin.vehicleSubBrandName,
......@@ -51,7 +50,7 @@ export default {
formContentSecond: activityJoin.formContentSecond,
formDescribeFirst: activityJoin.formDescribeFirst,
formDescribeSecond: activityJoin.formDescribeSecond,
outTradeNo
orderCode
}
},
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
......@@ -41,7 +41,7 @@ const spritesmithFunction = data => {
return `${shared}\n${perSprite}`
}
module.exports = {
publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main-lm/', // 本地调试时需登录时使用
publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main-lwk/', // 本地调试时需登录时使用
// publicPath: './',
// publicPath: '/dj-scrm-wx-work-attachment-activity/', // 署应用包时的基本 URL。 vue-router history模式使用
outputDir: 'dist', // 生产环境构建文件的目录
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!