Commit 2096caa5 by 前端

Merge branch 'v3.5.0_0227' into 'master'

V3.5.0 0227合并至主干

See merge request !27
2 parents ad304a3d a4a13bdb
...@@ -3,14 +3,15 @@ import { Notify } from 'vant' ...@@ -3,14 +3,15 @@ import { Notify } from 'vant'
let requestCount = 0 let requestCount = 0
let wwRequestCount = 0 let wwRequestCount = 0
const WxConfig = { const WxConfig = {
async init(jsApiList = []) { async init (jsApiList = []) {
const isWxWork = window.$ISWXWORK const isWxWork = window.$ISWXWORK
jsApiList.map(e => { jsApiList.map(e => {
if (e == 'chooseImage') jsApiList.push('getLocalImgData') if (e == 'chooseImage') jsApiList.push('getLocalImgData')
}) })
await this[isWxWork ? 'getWWConfig' : 'getWxConfig'](jsApiList) await this[isWxWork ? 'getWWConfig' : 'getWxConfig'](jsApiList)
}, },
getWWConfig(jsApiList) { /**企微 */
getWWConfig (jsApiList) {
wwRequestCount += 1 wwRequestCount += 1
let [redirectUrl] = window.location.href.split('#') let [redirectUrl] = window.location.href.split('#')
return new Promise(resolve => { return new Promise(resolve => {
...@@ -39,10 +40,10 @@ const WxConfig = { ...@@ -39,10 +40,10 @@ const WxConfig = {
nonceStr: data.nonceStr, // 必填,生成签名的随机串 nonceStr: data.nonceStr, // 必填,生成签名的随机串
signature: data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法, signature: data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法,
jsApiList: ['getContext', ...jsApiList], jsApiList: ['getContext', ...jsApiList],
success(res) { success (res) {
resolve() resolve()
}, },
fail(err) { fail (err) {
Notify(message) Notify(message)
// util.refreshPage(JSONStringify(err)).then(() => { // util.refreshPage(JSONStringify(err)).then(() => {
// window.location.reload() // window.location.reload()
...@@ -71,7 +72,8 @@ const WxConfig = { ...@@ -71,7 +72,8 @@ const WxConfig = {
}) })
}) })
}, },
getWxConfig(jsApiList) { /**微信 */
getWxConfig (jsApiList) {
requestCount += 1 requestCount += 1
let [redirectUrl] = window.location.href.split('#') let [redirectUrl] = window.location.href.split('#')
return new Promise(resolve => { return new Promise(resolve => {
...@@ -92,12 +94,20 @@ const WxConfig = { ...@@ -92,12 +94,20 @@ const WxConfig = {
Object.keys(data).map(key => { Object.keys(data).map(key => {
if (data[key]) obj[key] = data[key] if (data[key]) obj[key] = data[key]
}) })
wx.config({ try {
...obj, if (wx) {
jsApiList, wx.config({
openTagList: ['wx-open-launch-weapp'] ...obj,
}) jsApiList,
resolve() openTagList: ['wx-open-launch-weapp']
})
resolve()
} else throw false
} catch (error) {
util.refreshPage('加载wxconfig失败,请重试','重试').then(() => {
window.location.reload()
})
}
} else { } else {
if (requestCount < 3) this.getWxConfig(jsApiList) if (requestCount < 3) this.getWxConfig(jsApiList)
else { else {
...@@ -118,7 +128,7 @@ const WxConfig = { ...@@ -118,7 +128,7 @@ const WxConfig = {
}) })
}) })
}, },
ready(callBack) { ready (callBack) {
const isWxWork = window.$ISWXWORK const isWxWork = window.$ISWXWORK
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (isWxWork) if (isWxWork)
...@@ -152,18 +162,18 @@ const WxConfig = { ...@@ -152,18 +162,18 @@ const WxConfig = {
}) })
}, },
/**获取地理位置接口 */ /**获取地理位置接口 */
getLocation(type = 'gcj02') { getLocation (type = 'gcj02') {
return this.ready(resolve => { return this.ready(resolve => {
wx.getLocation({ wx.getLocation({
type, // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' type, // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
success(res) { success (res) {
resolve(res) resolve(res)
} }
}) })
}) })
}, },
/**打开地图导航 */ /**打开地图导航 */
openLocation(params) { openLocation (params) {
return this.ready(resolve => { return this.ready(resolve => {
let { latitude, longitude, name, address, scale = '18', infoUrl = '' } = params let { latitude, longitude, name, address, scale = '18', infoUrl = '' } = params
wx.openLocation({ wx.openLocation({
...@@ -173,7 +183,7 @@ const WxConfig = { ...@@ -173,7 +183,7 @@ const WxConfig = {
address, address,
scale, scale,
infoUrl, infoUrl,
success(res) { success (res) {
console.log(res) console.log(res)
resolve(res) resolve(res)
} }
...@@ -181,7 +191,7 @@ const WxConfig = { ...@@ -181,7 +191,7 @@ const WxConfig = {
}) })
}, },
/**支付 */ /**支付 */
chooseWXPay({ timestamp, nonceStr, packages, signType, paySign }) { chooseWXPay ({ timestamp, nonceStr, packages, signType, paySign }) {
return this.ready(resolve => { return this.ready(resolve => {
wx.chooseWXPay({ wx.chooseWXPay({
timestamp, // 支付签名时间戳,注意微信js sdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符 timestamp, // 支付签名时间戳,注意微信js sdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
...@@ -189,21 +199,21 @@ const WxConfig = { ...@@ -189,21 +199,21 @@ const WxConfig = {
package: packages, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*) package: packages, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5' signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
paySign, // 支付签名 paySign, // 支付签名
success(res) { success (res) {
window.vm.showToast('支付成功') window.vm.showToast('支付成功')
resolve(res) resolve(res)
}, },
fail() { fail () {
window.vm.showToast('已取消支付') window.vm.showToast('已取消支付')
}, },
cancel() { cancel () {
window.vm.showToast('支付失败,请重试') window.vm.showToast('支付失败,请重试')
} }
}) })
}) })
}, },
/**设置分享内容 */ /**设置分享内容 */
updateAppMessageShareData(params) { updateAppMessageShareData (params) {
// title, // 分享标题 // title, // 分享标题
// desc: '', // 分享描述 // desc: '', // 分享描述
// link: '', // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致 // link: '', // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
...@@ -219,7 +229,7 @@ const WxConfig = { ...@@ -219,7 +229,7 @@ const WxConfig = {
}) })
}, },
/**分享朋友圈内容 */ /**分享朋友圈内容 */
updateTimelineShareData(params) { updateTimelineShareData (params) {
delete params.desc delete params.desc
// title, // 分享标题 // title, // 分享标题
// link: '', // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致 // link: '', // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
...@@ -243,7 +253,7 @@ const WxConfig = { ...@@ -243,7 +253,7 @@ const WxConfig = {
* type: '', // 分享类型,music、video或link,不填默认为link * type: '', // 分享类型,music、video或link,不填默认为link
* dataUrl: '', // 如果 type 是music或video,则要提供数据链接,默认为空 * dataUrl: '', // 如果 type 是music或video,则要提供数据链接,默认为空
*/ */
onMenuShareAppMessage(params) { onMenuShareAppMessage (params) {
return new Promise(resolve => { return new Promise(resolve => {
wx.onMenuShareAppMessage({ wx.onMenuShareAppMessage({
success: function () { success: function () {
...@@ -255,7 +265,7 @@ const WxConfig = { ...@@ -255,7 +265,7 @@ const WxConfig = {
}) })
}, },
/**获取“分享到朋友圈”按钮点击状态及自定义分享内容接口(即将废弃) */ /**获取“分享到朋友圈”按钮点击状态及自定义分享内容接口(即将废弃) */
onMenuShareTimeline(params) { onMenuShareTimeline (params) {
delete params.desc delete params.desc
return new Promise(resolve => { return new Promise(resolve => {
wx.onMenuShareTimeline({ wx.onMenuShareTimeline({
...@@ -268,7 +278,7 @@ const WxConfig = { ...@@ -268,7 +278,7 @@ const WxConfig = {
}) })
}, },
/**企微自定义转发到会话 */ /**企微自定义转发到会话 */
shareAppMessage(params) { shareAppMessage (params) {
// title: '', // 分享标题 // title: '', // 分享标题
// desc: '', // 分享描述 // desc: '', // 分享描述
// link: '', // 分享链接 // link: '', // 分享链接
...@@ -287,7 +297,7 @@ const WxConfig = { ...@@ -287,7 +297,7 @@ const WxConfig = {
"path": "pages/home/index.html", // 所需跳转的小程序内页面路径及参数。非必填 "path": "pages/home/index.html", // 所需跳转的小程序内页面路径及参数。非必填
* *
*/ */
launchMiniprogram(params) { launchMiniprogram (params) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wx.invoke('launchMiniprogram', params, function (res) { wx.invoke('launchMiniprogram', params, function (res) {
if (res.err_msg == 'launchMiniprogram:ok') resolve(res) if (res.err_msg == 'launchMiniprogram:ok') resolve(res)
......
...@@ -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" :detail="detail" class="Im"></im> <im v-if="LiveProps[liveDetail.status].isLive && !mediaLive" :liveDetail="liveDetail" :isAction="isAction" :detail="detail" class="Im"></im>
<action :videoFullscreen="true" class="BgAction" v-show="isAction && !LiveProps[liveDetail.status].isLive"></action> <action :videoFullscreen="true" class="BgAction" v-show="isAction && (!LiveProps[liveDetail.status].isLive|| mediaLive)"></action>
</div> </div>
</div> </div>
</div> </div>
...@@ -118,7 +118,8 @@ export default { ...@@ -118,7 +118,8 @@ export default {
liveBroadcastRecordingFileList: [] liveBroadcastRecordingFileList: []
} }
} }
} },
mediaLive:Boolean
}, },
mounted() { mounted() {
this.createPlayerCover() this.createPlayerCover()
...@@ -140,7 +141,7 @@ export default { ...@@ -140,7 +141,7 @@ export default {
this.player.ready(() => { // 设置播放器初始化完成后的回调 this.player.ready(() => { // 设置播放器初始化完成后的回调
this.fixHls() this.fixHls()
const _this = this const _this = this
const src = this.LiveProps[this.liveDetail.status].isLive ? this.liveDetail.pullWebRtcUrl : (this.liveDetail.liveBroadcastRecordingFileList || [])[this.fileIdx]?.videoUrl const src = _this.mediaLive ? this.liveDetail.liveBroadcastMediaUrl : 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() // 播放视频
...@@ -229,7 +230,7 @@ export default { ...@@ -229,7 +230,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.small-box { .small-box {
position: fixed; position: fixed;
top: 18%; top: 10%;
right: 0; right: 0;
z-index: 7; z-index: 7;
// position: relative; // position: relative;
......
...@@ -49,6 +49,27 @@ ...@@ -49,6 +49,27 @@
</div> </div>
</template> </template>
</template> </template>
<template v-if="userSelectGoodsList.length > 1">
<div class="goods-box">
<goods-list
:list="userSelectGoodsList"
:defaultType="false"
></goods-list>
<template v-if="totalPrice.decimal">
<div class="total-price-box flex">
<div class="total-price">
合计:
<div class="price">
<span class="unit">¥</span>
{{ totalPrice.price }}
<span class="decimal">.{{ totalPrice.decimal }}</span>
</div>
</div>
</div>
</template>
</div>
</template>
<!-- <div class="tips"> <!-- <div class="tips">
本人已阅读且同意<span @click="jump('agreement')">《隐私协议》</span> 本人已阅读且同意<span @click="jump('agreement')">《隐私协议》</span>
</div> --> </div> -->
...@@ -115,10 +136,17 @@ export default { ...@@ -115,10 +136,17 @@ export default {
} }
}) })
this.params = params this.params = params
let { hasDefaultBrands, brandInfo } = this.$parent.detail let { hasDefaultBrands, brandInfo, userSelectGoodsList } = this.$parent.detail
if (hasDefaultBrands && !this.params.carBrandsText) { if (hasDefaultBrands && !this.params.carBrandsText) {
this.params.carBrandsText = `${brandInfo.vehicleBrandName} ${brandInfo.vehicleSubBrandName}` this.params.carBrandsText = `${brandInfo.vehicleBrandName} ${brandInfo.vehicleSubBrandName}`
} }
if (userSelectGoodsList) {
this.userSelectGoodsList = userSelectGoodsList
this.bus.$on('changeUserSelectGoodsList', () => {
this.setTotalPrice()
})
this.setTotalPrice()
}
} }
}, },
payStatus () { payStatus () {
...@@ -139,13 +167,33 @@ export default { ...@@ -139,13 +167,33 @@ export default {
items: [], items: [],
params: null, params: null,
hasCarBrand: false, hasCarBrand: false,
hasPhoneSelect: false hasPhoneSelect: false,
userSelectGoodsList: [],
totalPrice: {}
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
setTotalPrice () {
const {
userSelectGoodsList
} = this
let totalPrice = 0,
totalGoodsNumber = 0
userSelectGoodsList && userSelectGoodsList.map(e => {
totalPrice += (e.activityPrice * e.goodsNumber)
totalGoodsNumber += e.goodsNumber
})
let [price, dec] = this.decimal(totalPrice).toString().split('.')
if (dec) dec = dec.length == 1 ? `${dec}0` : dec
this.totalPrice = {
price,
decimal: dec || '00'
}
if (totalGoodsNumber == 0) this.onCancel()
},
onCancel () { onCancel () {
this.$emit('cancel') this.$emit('cancel')
}, },
...@@ -183,8 +231,6 @@ export default { ...@@ -183,8 +231,6 @@ export default {
} }
if (userInfo.phone) this.emit(obj) if (userInfo.phone) this.emit(obj)
else { else {
// if (!hasPhoneSelect) this.emit(obj)
// else
ssoApi.captchaLogin({ ssoApi.captchaLogin({
mobile: params.userPhone || '88888888888', mobile: params.userPhone || '88888888888',
captcha: 8888, captcha: 8888,
...@@ -266,6 +312,30 @@ export default { ...@@ -266,6 +312,30 @@ export default {
} }
} }
} }
.total-price-box {
height: 54px;
justify-content: flex-end;
padding: 0 16px;
.total-price {
display: flex;
align-items: baseline;
font-size: 14px;
color: #333333;
.price {
font-weight: 600;
font-size: 24px;
color: #f13c3d;
display: flex;
align-items: baseline;
.decimal,
.unit {
font-size: 12px;
}
}
}
}
.btn { .btn {
display: block; display: block;
font-size: 16px; font-size: 16px;
......
...@@ -39,7 +39,6 @@ export default { ...@@ -39,7 +39,6 @@ export default {
payPrice, payPrice,
userName, userName,
goodsName, goodsName,
orderCode,
orderNumber, orderNumber,
orderStatus, orderStatus,
createdDate, createdDate,
...@@ -84,9 +83,9 @@ export default { ...@@ -84,9 +83,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 && (orderNumber || orderCode)) { if (orderStatus != 10 && orderNumber) {
labelList.push('订单号:') labelList.push('订单号:')
valueList.push(orderNumber || orderCode) valueList.push(orderNumber)
} }
if (formContentFirst) { if (formContentFirst) {
labelList.push(formDescribeFirst) labelList.push(formDescribeFirst)
...@@ -126,7 +125,7 @@ export default { ...@@ -126,7 +125,7 @@ export default {
textBaseline textBaseline
}) })
draw.drawText({ draw.drawText({
text: orderNumber || orderCode || '', text: orderNumber || '',
x: labelX - 1, x: labelX - 1,
y: 54, y: 54,
color: '#282829', color: '#282829',
......
<template>
<div>
<template v-for="(item,index) in list">
<div
:class="['goods',{'false':!defaultType}]"
:key="index"
>
<img
:src="item.goodsImage"
class="icon"
>
<div class="info">
<div class="flex">
<template v-if="defaultType">
<div class="label">
商品名称:
</div>
</template>
<div class="text-hide">
{{item.goodsName}}
</div>
</div>
<template v-if="defaultType">
<div class="flex">
<div class="label">
众筹价:
</div>
<div class="price">
{{item.crowdFundingPrice}}
</div>
</div>
</template>
<div class="flex">
<div class="label">
定金:
</div>
<div class="price">
{{item.activityPrice}}
</div>
</div>
</div>
<div class="stepper flex">
<div
:class="['minus count-box',{'opacity': item.goodsNumber == 0}]"
@click="change(index)"
></div>
{{item.goodsNumber}}
<div
:class="['add count-box', {'opacity':item.goodsNumber == item.goodsStock }]"
@click="change(index,true)"
></div>
</div>
</div>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'goodsList',
props: {
list: Array,
defaultType: {
type: Boolean,
default: true
}
},
data () {
return {
}
},
mounted () {
},
methods: {
change (index, add) {
const { list } = this,
num = add ? 1 : -1
let {
goodsNumber,
goodsStock
} = list[index]
if (goodsNumber == 0 && !add) return
if (goodsNumber == goodsStock && add) return
goodsNumber += num
this.bus.$emit('changeUserSelectGoodsList', {
index,
goodsNumber
})
}
}
}
</script>
<style scoped lang='scss'>
.flex {
display: flex;
align-items: center;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.goods {
padding: 10px;
background: #ffffff;
margin-bottom: 8px;
display: flex;
position: relative;
&:last-of-type {
margin-bottom: 0;
}
.icon {
width: 72px;
height: 72px;
flex-shrink: 0;
}
.info {
margin-left: 10px;
flex: 1;
font-size: 14px;
color: #333333;
line-height: 20px;
width: calc(100% - 82px);
> .flex {
margin-bottom: 4px;
}
.text-hide {
width: calc(100% - 70px);
}
.label {
width: 70px;
flex-shrink: 0;
text-align: right;
}
.price {
font-weight: 600;
color: #f13c3d;
}
}
.stepper {
position: absolute;
top: 50%;
right: 16px;
transform: translateY(-50%);
font-size: 16px;
color: #333333;
.count-box {
width: 14px;
height: 14px;
background-color: #f4f4f4;
margin: 0 10px;
font-size: 13px;
border-radius: 2px;
position: relative;
}
.add {
margin-right: 0;
background-color: #f13c3d;
}
.opacity::after,
.opacity::before {
opacity: 0.25;
}
.minus::after,
.add::after,
.add::before {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
content: '';
background-color: #999999;
border-radius: 8px;
}
.minus::after,
.add::before {
width: 7.5px;
height: 1.5px;
}
.add::after {
width: 1.5px;
height: 7.5px;
}
.add::before,
.add::after {
background-color: #fff;
}
}
}
.goods.false {
align-items: center;
border-bottom: 2rpx solid rgba(195, 195, 195, 0.3);
margin-bottom: 0;
padding: 10px 16px;
.icon {
width: 60px;
height: 60px;
}
.info {
> .flex {
margin-bottom: 6px;
}
.text-hide {
width: 100%;
}
.label {
width: auto;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -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,
// 携带凭证 // 携带凭证
......
...@@ -69,18 +69,20 @@ let body = document.getElementsByTagName('head')[0], ...@@ -69,18 +69,20 @@ let body = document.getElementsByTagName('head')[0],
IsIOS = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent), IsIOS = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent),
ISMiniprogram = window.__wxjs_environment === 'miniprogram' ISMiniprogram = window.__wxjs_environment === 'miniprogram'
WXJDK.src = '//res.wx.qq.com/open/js/jweixin-1.6.0.js' WXJDK.src = '//res.wx.qq.com/open/js/jweixin-1.6.0.js'
// WXJDK.src = `//res.wx.qq.com/open/js/jweixin-1.6.0.js?${Date.now()}`
if (Boolean(ua.match(/MicroMessenger/i)) && Boolean(ua.match(/wxwork/i))) { if (Boolean(ua.match(/MicroMessenger/i)) && Boolean(ua.match(/wxwork/i))) {
//是否企微 //是否企微
WXJDK.src = '//res.wx.qq.com/open/js/jweixin-1.2.0.js' WXJDK.src = '//res.wx.qq.com/open/js/jweixin-1.2.0.js'
WWJDK.src = '//open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js' WWJDK.src = '//open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js'
ISWXWORK = true ISWXWORK = true
} }
body.appendChild(WXJDK)
if (WWJDK.src) body.appendChild(WWJDK)
window.$ISWXWORK = ISWXWORK window.$ISWXWORK = ISWXWORK
util.setLocalStorage('is_wxwork', ISWXWORK) util.setLocalStorage('is_wxwork', ISWXWORK)
Vue.prototype.ISWXWORK = ISWXWORK Vue.prototype.ISWXWORK = ISWXWORK
Vue.prototype.ISMOBILE = util.isMobileDevice() Vue.prototype.ISMOBILE = util.isMobileDevice()
body.appendChild(WXJDK)
if (WWJDK.src) body.appendChild(WWJDK)
window.$IsIOS = IsIOS window.$IsIOS = IsIOS
Vue.prototype.IsIOS = IsIOS Vue.prototype.IsIOS = IsIOS
window.$ISMiniprogram = ISMiniprogram window.$ISMiniprogram = ISMiniprogram
......
...@@ -26,6 +26,7 @@ function createRouter() { ...@@ -26,6 +26,7 @@ function createRouter() {
} }
// http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-attachment-activity/ // http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-attachment-activity/
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
console.log(router.history.pending.fullPath)
/* 路由发生变化修改页面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)
...@@ -39,7 +40,14 @@ router.beforeEach((to, from, next) => { ...@@ -39,7 +40,14 @@ router.beforeEach((to, from, next) => {
} else store.dispatch('navigation') } else store.dispatch('navigation')
next() next()
}) })
router.onError((error) => {
const pattern = /Loading chunk chunk-(\w)+ failed/g
const isChunkLoadFailed = error.message.match(pattern)
const targetPath = router.history.pending.fullPath
if (isChunkLoadFailed) {
router.replace(targetPath)
}
})
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() { export function resetRouter() {
const newRouter = createRouter() const newRouter = createRouter()
......
...@@ -64,7 +64,7 @@ const hideLoading = () => { ...@@ -64,7 +64,7 @@ const hideLoading = () => {
Toast.clear() Toast.clear()
} }
/**num:要转换的数值,fixed:精确几位小数 */ /**num:要转换的数值,fixed:精确几位小数 */
const decimal = (num, fixed) => { const decimal = (num, fixed = 2) => {
let pow = Math.pow(10, fixed) let pow = Math.pow(10, fixed)
return Math.round(num * pow) / pow return Math.round(num * pow) / pow
} }
...@@ -162,18 +162,18 @@ const jumpChildrenPage = (to, params) => { ...@@ -162,18 +162,18 @@ const jumpChildrenPage = (to, params) => {
const setClipboardData = data => { const setClipboardData = data => {
wx.setClipboardData({ wx.setClipboardData({
data, data,
success(res) { success (res) {
Toast('复制成功') Toast('复制成功')
} }
}) })
} }
/**接口请求时失败让用户刷新 */ /**接口请求时失败让用户刷新 */
const refreshPage = (message = '系统异常') => { const refreshPage = (message = '系统异常', confirmButtonText) => {
return Dialog.alert({ return Dialog.alert({
message, message,
theme: 'round-button', theme: 'round-button',
confirmButtonText: '点击重试', confirmButtonText: confirmButtonText || '点击重试',
confirmButtonColor: '#f13c3d' confirmButtonColor: '#f13c3d'
}) })
} }
...@@ -270,7 +270,7 @@ const draggable = (drag, fun, target) => { ...@@ -270,7 +270,7 @@ const draggable = (drag, fun, target) => {
var disX, disY, left, top, starX, starY, oLeft, oTop var disX, disY, left, top, starX, starY, oLeft, oTop
drag.addEventListener(startEvt, startFun) drag.addEventListener(startEvt, startFun)
function startFun(event) { function startFun (event) {
// console.log('event', ) // console.log('event', )
let className = event.target.className let className = event.target.className
if (!drag.id || className.includes(target)) return if (!drag.id || className.includes(target)) return
...@@ -292,7 +292,7 @@ const draggable = (drag, fun, target) => { ...@@ -292,7 +292,7 @@ const draggable = (drag, fun, target) => {
document.addEventListener(endEvt, endFun) document.addEventListener(endEvt, endFun)
} }
function moveFun(event) { function moveFun (event) {
// 兼容IE浏览器 // 兼容IE浏览器
var e = event || window.event var e = event || window.event
left = (e.touches ? e.touches[0].clientX : e.clientX) - disX left = (e.touches ? e.touches[0].clientX : e.clientX) - disX
...@@ -312,7 +312,7 @@ const draggable = (drag, fun, target) => { ...@@ -312,7 +312,7 @@ const draggable = (drag, fun, target) => {
drag.style.left = left + 'px' drag.style.left = left + 'px'
drag.style.top = top + 'px' drag.style.top = top + 'px'
} }
function endFun(event) { function endFun (event) {
drag.style.cursor = '' drag.style.cursor = ''
document.removeEventListener(moveEvt, moveFun) document.removeEventListener(moveEvt, moveFun)
document.removeEventListener(endEvt, endFun) document.removeEventListener(endEvt, endFun)
......
<template> <template>
<div v-if="detail.activityDetail"> <div v-if="detail.activityDetail">
<div class="activity-info" v-html="decodeURIComponent(detail.activityDetail)"></div> <div class="activity-info" v-html="decodeURIComponent(detail.activityDetail)"></div>
<!-- 商品列表 -->
<template v-if="detail.userSelectGoodsList.length > 1">
<div class="goods-box">
<goods-list :list="detail.userSelectGoodsList"></goods-list>
</div>
</template>
<div class="tips text-center"> <div class="tips text-center">
<img src="https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/logo.png" alt="技术支持:广联数科" /> <img src="https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/logo.png" alt="技术支持:广联数科" />
</div> </div>
...@@ -35,6 +41,10 @@ export default { ...@@ -35,6 +41,10 @@ export default {
} }
} }
.goods-box {
padding: 8px;
}
.tips { .tips {
padding-top: 47px; padding-top: 47px;
font-size: 12px; font-size: 12px;
......
...@@ -17,11 +17,12 @@ ...@@ -17,11 +17,12 @@
活动重新配置中,请稍后重试 活动重新配置中,请稍后重试
</div> </div>
<div v-else> <div v-else>
<template v-if="detail.liveBroadcastRoomId && liveDetail && liveDetail.status != 0"> <template v-if="(detail.liveBroadcastRoomId || detail.liveBroadcastMediaUrl) && liveDetail && liveDetail.status != 0">
<live-box <live-box
ref="liveBox" ref="liveBox"
:detail="detail" :detail="detail"
:liveDetail="liveDetail" :liveDetail="liveDetail"
:mediaLive="detail.liveBroadcastMediaUrl?true:false"
@handleLiveFull="handleLiveFull" @handleLiveFull="handleLiveFull"
></live-box> ></live-box>
</template> </template>
...@@ -39,7 +40,10 @@ ...@@ -39,7 +40,10 @@
<page-btns :detail="detail" /> <page-btns :detail="detail" />
</template> </template>
<!-- 👇 员工浮窗 --> <!-- 👇 员工浮窗 -->
<div class="staff" v-if="detail.id && shareInfo.shareName && detail.activityStatus != 3"> <div
class="staff"
v-if="detail.id && shareInfo.shareName && detail.activityStatus != 3"
>
<staff <staff
:shareInfo="shareInfo" :shareInfo="shareInfo"
:scrollY="scrollY" :scrollY="scrollY"
...@@ -393,7 +397,6 @@ export default { ...@@ -393,7 +397,6 @@ export default {
this.viewFlag = true this.viewFlag = true
bigdatautilApi.reportTrack(id, 1) bigdatautilApi.reportTrack(id, 1)
this.$store.dispatch('setLoginStatus', true) this.$store.dispatch('setLoginStatus', true)
console.log(JSON.parse(JSON.stringify(data)))
data.s_time = new Date(this.iosTimeFormat(data.startTime)).format('yyyy年M月d日') data.s_time = new Date(this.iosTimeFormat(data.startTime)).format('yyyy年M月d日')
data.e_time = new Date(this.iosTimeFormat(data.endTime)).format('yyyy年M月d日') data.e_time = new Date(this.iosTimeFormat(data.endTime)).format('yyyy年M月d日')
document.title = data.activityName document.title = data.activityName
...@@ -427,13 +430,51 @@ export default { ...@@ -427,13 +430,51 @@ export default {
} }
data.hasDefaultBrands = true data.hasDefaultBrands = true
} }
let userSelectGoodsList = []
if (data.goodsList) {
data.goodsList.map(e => {
let obj = {
goodsImage: e.goodsImage,
goodsName: e.goodsName,
activityPrice: this.centsToyuan(e.activityPrice),
crowdFundingPrice: this.centsToyuan(e.crowdFundingPrice),
goodsStock: e.activityGoodsStock,
goodsNumber: 1,
goodsId: e.goodsId
}
userSelectGoodsList.push(obj)
})
data.userSelectGoodsList = userSelectGoodsList
this.bus.$on('changeUserSelectGoodsList', ({
index,
goodsNumber
}) => {
this.$set(this.detail.userSelectGoodsList[index], 'goodsNumber', goodsNumber)
this.$store.dispatch('setActivityInfo', this.detail)
})
}
console.log(JSON.parse(JSON.stringify(data)))
this.detail = data this.detail = data
this.$store.dispatch('setActivityInfo', data) this.$store.dispatch('setActivityInfo', data)
this.setShareInfo(data) this.setShareInfo(data)
if (this.detail.liveBroadcastRoomId) { if (this.detail.liveBroadcastRoomId) {
this.getLiveDetail(id) this.getLiveDetail(id)
} }
// console.log(this.detail, 'detail-----------') if (data.liveBroadcastMediaUrl) {
// this.setData({
// mediaLiveObject: {
// liveBroadcastMediaUrl: data.liveBroadcastMediaUrl,
// liveBroadcastRoomCover: data.liveBroadcastRoomCover,
// liveBroadcastStateFlag: data.liveBroadcastStateFlag //1直播中,2直播回放
// }
// })
this.liveDetail = {
status: data.liveBroadcastStateFlag, //1直播中,2直播回放
liveBroadcastMediaUrl: data.liveBroadcastMediaUrl,
liveBroadcastRecordingFileList: [data.liveBroadcastMediaUrl]
}
}
}) })
}, },
getLiveDetail (id) { getLiveDetail (id) {
......
<template> <template>
<div class="layout"> <div class="layout">
<div class="title">左右滑动查看核销凭证</div> <div class="title">左右滑动查看核销凭证</div>
<div class="content" @touchend="end"> <div
<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"> 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"
>
<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
<van-image :src="imgList[index]" class="img"> :orderInfo="i"
:canvasId="`order-${index}`"
:ref="`order-${index}`"
/>
<van-image
:src="imgList[index]"
class="img"
>
<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>
</van-swipe-item> </van-swipe-item>
...@@ -17,7 +40,10 @@ ...@@ -17,7 +40,10 @@
<template v-if="orderList.length > 1"> <template v-if="orderList.length > 1">
<div class="dots x-center text-center"> <div class="dots x-center text-center">
<template v-for="(i, index) in orderList"> <template v-for="(i, index) in orderList">
<div :class="['dots-item', { active: itemIndex == index }]" :key="index"></div> <div
:class="['dots-item', { active: itemIndex == index }]"
:key="index"
></div>
</template> </template>
</div> </div>
</template> </template>
...@@ -41,7 +67,23 @@ export default { ...@@ -41,7 +67,23 @@ export default {
} }
}, },
activated () { activated () {
this.getOrderList() let { orderInfo } = this.getParams()
if (orderInfo?.goodsList) {
let orderList = []
orderInfo.goodsList.map(e => {
orderList.push({
...orderInfo.activityJoin,
orderStatus: 1,
orderNumber: e.orderCode,
goodsNumber: e.goodsNumber,
payPrice: this.centsToyuan(e.activityPrice * e.goodsNumber),
goodsName: e.goodsName
})
})
this.orderList = orderList
this.draw()
}
else this.getOrderList()
}, },
deactivated () { deactivated () {
this.imgList = [] this.imgList = []
...@@ -73,12 +115,15 @@ export default { ...@@ -73,12 +115,15 @@ export default {
e.createdDate = new Date(this.iosTimeFormat(e.payDate)) e.createdDate = new Date(this.iosTimeFormat(e.payDate))
}) })
this.orderList = data || [] this.orderList = data || []
this.$nextTick(() => { this.draw()
this.orderList.map((e, index) => { })
this.$refs[`order-${index}`][0].drawOrderImg(url => { },
this.imgList[index] = url draw () {
this.updata = Date.now() this.$nextTick(() => {
}) this.orderList.map((e, index) => {
this.$refs[`order-${index}`][0].drawOrderImg(url => {
this.imgList[index] = url
this.updata = Date.now()
}) })
}) })
}) })
......
...@@ -33,8 +33,8 @@ export default { ...@@ -33,8 +33,8 @@ export default {
activityJoin, activityJoin,
payPrice, payPrice,
orderGoods: [orderGoods], orderGoods: [orderGoods],
orderCode, orderNumber,
orderNumber goodsNumber
} = orderInfo } = orderInfo
this.orderInfo = { this.orderInfo = {
userName: activityJoin.userName, userName: activityJoin.userName,
...@@ -51,8 +51,8 @@ export default { ...@@ -51,8 +51,8 @@ export default {
formContentSecond: activityJoin.formContentSecond, formContentSecond: activityJoin.formContentSecond,
formDescribeFirst: activityJoin.formDescribeFirst, formDescribeFirst: activityJoin.formDescribeFirst,
formDescribeSecond: activityJoin.formDescribeSecond, formDescribeSecond: activityJoin.formDescribeSecond,
orderCode, orderNumber,
orderNumber goodsNumber
} }
}, },
methods: { methods: {
......
...@@ -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-yy/', // 本地调试时需登录时使用 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', // 生产环境构建文件的目录
...@@ -51,9 +51,9 @@ module.exports = { ...@@ -51,9 +51,9 @@ module.exports = {
devServer: { devServer: {
disableHostCheck: true, disableHostCheck: true,
// host: `192.168.2.222`, // host: `192.168.2.222`,
port: 9527, // 端口 port: 9528, // 端口
open: false, // 启动后打开浏览器 open: false, // 启动后打开浏览器
public: 'http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-yy/#/', public: 'http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main-lwk/#/',
overlay: { overlay: {
// 当出现编译器错误或警告时,在浏览器中显示全屏覆盖层 // 当出现编译器错误或警告时,在浏览器中显示全屏覆盖层
warnings: false, warnings: false,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!