Commit b8f1df88 by 李伟康

提交代码

1 parent de6d710f
......@@ -10,7 +10,7 @@
module.exports = {
title: '加载中...',
request: {
baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址,
baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间
timeout: 180000,
// 携带凭证
......
......@@ -40,14 +40,11 @@ export default {
},
mounted () {
let data = this.getLocalStorage('wx_scrm_car_brand_list')
if (data) {
this.formatData(data)
} else {
carLifeApi.getCarBrandList().then(data => {
this.setLocalStorage('wx_scrm_car_brand_list', data)
this.formatData(data)
})
}
if (data) this.formatData(data)
else carLifeApi.getCarBrandList().then(carInfo => {
this.setLocalStorage('wx_scrm_car_brand_list', carInfo)
this.formatData(carInfo)
})
},
methods: {
formatData (data) {
......
......@@ -82,6 +82,10 @@ export default {
this.showType = false
this.indexList = []
let { list, brandInfo } = this.getParams()
if (!list || !list.length) {
this.$router.back()
return
}
this.list = list
this.brandInfo = brandInfo
list.map((e, index) => {
......
<template>
<div
class="action isFullSucreen flex"
:class="['action isFullSucreen flex']"
v-if="show"
>
<div class="btn-box flex">
......@@ -155,14 +155,16 @@ export default {
shareStaffImageUrl: linkParams.shareStaffImageUrl || ''
}
shopmallApi.createOrder(params).then(data => {
that.pay(data.orderCode)
that.pay(data)
})
}, 1e3),
pay (orderCode) {
pay (orderInfo) {
this.to('crowdfunding.success', { orderInfo })
return
this.showLoading('结算中')
this.payStatus = Date.now()
shopmallApi.payOrder({
orderCode
orderCode: orderInfo.orderCode
}).then(({ code, data, message }) => {
this.hideLoading()
if (code == '0') {
......@@ -176,8 +178,8 @@ export default {
timestamp: payParams.timeStamp,
packages: payParams.packages
}
wxConfig.chooseWXPay(params).then(() => this.$router.push({ name: 'crowdfunding.success' }))
} else this.$router.push({ name: 'crowdfunding.success' })
wxConfig.chooseWXPay(params).then(() => this.to('crowdfunding.success', { orderInfo }))
} else this.to('crowdfunding.success', { orderInfo })
} else this.showToast(message)
})
},
......@@ -205,23 +207,12 @@ export default {
this.posterImg = res
this.showPoster = true
})
},
jump () {
console.log(123)
}
}
}
</script>
<style scoped lang='scss'>
@keyframes showAction {
form {
bottom: -100%;
}
to {
bottom: 0;
}
}
.action {
position: fixed;
left: 0;
......@@ -230,7 +221,7 @@ export default {
background: #ffffff;
z-index: 3;
padding: 0 16px;
animation: showAction 0.5s forwards;
animation: show-goods-action 0.5s forwards;
.btn-box {
font-size: 13px;
font-weight: bold;
......@@ -294,6 +285,14 @@ export default {
width: 150px;
}
}
@keyframes show-goods-action {
0% {
bottom: -100%;
}
100% {
bottom: 0;
}
}
.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
......
......@@ -30,26 +30,64 @@ export default {
img: null
}
},
activated () {
let { orderInfo } = this.getParams()
if (orderInfo) this.setLocalStorage('wx_scrm_test', orderInfo)
else orderInfo = this.getLocalStorage('wx_scrm_test')
this.drawOrderImg(orderInfo)
return
if (!orderInfo || !Object.keys(orderInfo).length) {
this.$router.back()
return
}
},
mounted () {
this.drawOrderImg()
//
// this.drawOrderImg()
},
methods: {
drawOrderImg () {
let labelList = ['姓名:', '手机:', '车牌号:', '品牌车型:', '商品名称:', '支付时间:', '支付定金']
let valueList = ['恒河猴',
'18888888888',
'粤B12345',
'奥迪奥迪Q5L Sportback2022款 40 TFSI RS套件燃速型',
'氛围灯', '2022年8月3日 17:43:48', '199元']
let textYList = [109, 141, 173, 205, 261, 293, 352]
drawOrderImg (orderInfo) {
this.ctx = document.getElementById('canvas')
let {
activityJoin,
payPrice,
orderGoods: [orderGoods]
} = orderInfo,
valueX = 98,
labelX = 20,
valueWidth = 303,
fontSize = 14,
textBaseline = 'top',
canvasWidth = 343,
canvasHeight = 422,
carText = '',
labelList = ['姓名:', '手机:'],
spacing = 0,
textYList = []
const draw = new Draw(this, {
width: 343,
height: 422,
width: canvasWidth,
height: canvasHeight
})
console.log(activityJoin)
let valueList = [
activityJoin.userName,
activityJoin.userPhone,
]
if (activityJoin.plateNo) {
labelList.push('车牌号:')
valueList.push(activityJoin.plateNo)
}
if (activityJoin.vehicleBrandName) {
carText = `${activityJoin.vehicleBrandName || ''} ${activityJoin.vehicleSubBrandName || ''} ${activityJoin.vehicleSeriesName || ''} ${activityJoin.vehicleShapeName || ''}`
labelList.push('品牌车型:')
valueList.push(carText)
}
labelList = [...labelList, '商品名称:', '支付时间:', '支付定金']
valueList = [...valueList, orderGoods.goodsName, new Date().format('yyyy年M月d日 hh:mm:ss'), `${payPrice}元`]
labelList.map((e, index) => {
if (e == '商品名称:' && draw.getTextWidth(carText) + valueX > valueWidth) spacing = 24
if (index == labelList.length - 1) textYList.push(352)
else textYList.push(index * 32 + 109 + spacing)
})
draw.drawImages({
url: require('@/assets/images/order-bg.png'),
x: 0,
......@@ -58,12 +96,10 @@ export default {
height: 422,
}, () => {
labelList && labelList.length > 0 && (labelList.map((e, index) => {
let y = textYList[index] + 7,
fontSize = 14,
textBaseline = 'top'
let y = textYList[index] + 7
let label = {
text: e,
x: 20,
x: labelX,
y,
color: '#999',
fontSize,
......@@ -71,12 +107,12 @@ export default {
}
let value = {
text: valueList[index],
x: 98,
x: valueX,
y,
color: '#282829',
fontSize,
textBaseline,
width: 303
width: valueWidth
}
if (e === '品牌车型:') {
value.lineNum = 2
......@@ -100,7 +136,6 @@ export default {
width: 1,
color: '#F1F1F1'
})
this.ctx.getContext('2d').fillText('newText', 20, 109)
this.img = this.ctx.toDataURL('image/png')
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!