Commit 2e6fa454 by 李伟康

提交代码

1 parent f6aef79d
......@@ -19,6 +19,7 @@
</noscript>
<div id="app"></div>
<script src="http://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!-- <script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script> -->
<!-- 使用CDN加速的JS文件,配置在vue.config.js下 -->
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
......
......@@ -3,18 +3,18 @@ const url = '/rop-scrm-bigdatautil/router'
import { util } from 'utils'
export default {
/**埋点 */
reportTrack (id) {
reportTrack (id, view = true) {
let userInfo = util.getUserInfo()
let params = util.getLocalStorage('wx_scrm_link_params') || {}
let data = {
one_id: userInfo.openid,
open_id: userInfo.openid,
staff_id: params && params.staffId || '',
staff_uuid: params && params.staffUuid,
user_phone: params && params.userPhone || '',
create_time: new Date().format('yyyy-MM-dd hh:mm:ss'),
item_type: 3,
customer_phone: userInfo.phone,
action_type: 1,
action_type: view ? 1 : 4,
item_id: id,
business_type: 1,
add_way: 104,
......
import util from '@/utils/util'
import { Notify } from 'vant'
const WxConfig = {
init (jsApiList) {
init (jsApiList = []) {
return new Promise((resolve, reject) => {
jsApiList.map(e => {
if (e == 'chooseImage') jsApiList.push('getLocalImgData')
......@@ -52,6 +52,7 @@ const WxConfig = {
})
})
},
/**打开地图导航 */
openLocation (params) {
return this.ready(resolve => {
let { latitude, longitude, name, address, scale = '18', infoUrl = '' } = params
......@@ -91,6 +92,7 @@ const WxConfig = {
})
})
},
/**设置分享内容 */
updateAppMessageShareData (params) {
// title, // 分享标题
// desc: '', // 分享描述
......@@ -105,8 +107,27 @@ const WxConfig = {
}
})
})
},
/**获取“分享给朋友”按钮点击状态及自定义分享内容接口(即将废弃) */
/**
* title: '', // 分享标题
* desc: '', // 分享描述
* link: '', // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
* imgUrl: '', // 分享图标
* type: '', // 分享类型,music、video或link,不填默认为link
* dataUrl: '', // 如果 type 是music或video,则要提供数据链接,默认为空
*/
onMenuShareAppMessage (params) {
return this.ready(resolve => {
wx.onMenuShareAppMessage({
...params,
success: function () {
resolve()
// 用户点击了分享后执行的回调函数
}
})
})
}
}
export default WxConfig
......@@ -23,13 +23,19 @@
border-radius: 100%;
}
.kf {
.page-btn {
position: fixed;
right: 8px;
top: 402px;
z-index: 2;
background: #FFFFFF;
box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.0800);
border-radius: 28px;
padding: 3px;
}
.kf {}
.big-img {
position: relative;
width: 100%;
......@@ -95,6 +101,7 @@
background: #E9E8EC;
box-sizing: border-box;
border: 1px solid transparent;
&:last-of-type {
margin-right: 16px;
}
......@@ -124,6 +131,7 @@
.activity {
padding: 0 16px;
margin-top: 10px;
.address-box {
font-size: 12px;
color: #656566;
......@@ -219,7 +227,7 @@
overflow: hidden;
.line {
width: 0;
min-width: 40px;
height: 100%;
background: linear-gradient(270deg, #FF8802 0%, #FC5B32 100%);
transition: all .25s;
......
.sprite-icon { background-image: url(../images/sprite.png);background-size: 453px 394px;}
.icon-address { width: 34px; height: 34px; background-position: -310px -232px;}
.icon-close { width: 24px; height: 24px; background-position: -390px -316px;}
.icon-download { width: 30px; height: 30px; background-position: -310px -276px;}
.icon-flash { width: 20px; height: 20px; background-position: -430px -276px;}
.icon-hot { width: 15px; height: 18px; background-position: -30px -374px;}
.sprite-icon { background-image: url(../images/sprite.png);background-size: 453px 414px;}
.icon-address { width: 34px; height: 34px; background-position: -408px -152px;}
.icon-close { width: 24px; height: 24px; background-position: -200px -374px;}
.icon-dj-logo { width: 88px; height: 88px; background-position: -310px -152px;}
.icon-download { width: 30px; height: 30px; background-position: -310px -300px;}
.icon-flash { width: 20px; height: 20px; background-position: -432px -250px;}
.icon-gh-logo { width: 70px; height: 40px; background-position: -310px -250px;}
.icon-hot { width: 15px; height: 18px; background-position: -294px -374px;}
.icon-kf-box { width: 300px; height: 350px; background-position: 0px 0px;}
.icon-kf { width: 56px; height: 70px; background-position: -390px -152px;}
.icon-music-off { width: 34px; height: 34px; background-position: -354px -232px;}
.icon-music { width: 32px; height: 32px; background-position: -398px -232px;}
.icon-order { width: 20px; height: 20px; background-position: -424px -316px;}
.icon-pause { width: 30px; height: 30px; background-position: -350px -276px;}
.icon-phone { width: 12px; height: 13px; background-position: -440px -232px;}
.icon-play { width: 30px; height: 30px; background-position: -390px -276px;}
.icon-poster { width: 20px; height: 20px; background-position: 0px -374px;}
.icon-kf { width: 50px; height: 54px; background-position: 0px -360px;}
.icon-music-off { width: 34px; height: 34px; background-position: -408px -196px;}
.icon-music { width: 32px; height: 32px; background-position: -390px -250px;}
.icon-order { width: 20px; height: 20px; background-position: -430px -300px;}
.icon-pause { width: 30px; height: 30px; background-position: -350px -300px;}
.icon-phone { width: 12px; height: 13px; background-position: -319px -374px;}
.icon-play { width: 30px; height: 30px; background-position: -390px -300px;}
.icon-poster { width: 20px; height: 20px; background-position: -234px -374px;}
.icon-qr { width: 143px; height: 142px; background-position: -310px 0px;}
.icon-scan { width: 30px; height: 30px; background-position: -310px -316px;}
.icon-success { width: 70px; height: 70px; background-position: -310px -152px;}
.icon-time { width: 12px; height: 11px; background-position: -55px -374px;}
.icon-title { width: 170px; height: 4px; background-position: 0px -360px;}
.icon-top { width: 30px; height: 30px; background-position: -350px -316px;}
\ No newline at end of file
.icon-scan { width: 30px; height: 30px; background-position: -120px -374px;}
.icon-share { width: 50px; height: 54px; background-position: -60px -360px;}
.icon-success { width: 20px; height: 20px; background-position: -264px -374px;}
.icon-time { width: 12px; height: 11px; background-position: -341px -374px;}
.icon-title { width: 170px; height: 4px; background-position: -120px -360px;}
.icon-top { width: 30px; height: 30px; background-position: -160px -374px;}
\ No newline at end of file

99.5 KB | W: | H:

126 KB | W: | H:

src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin

15 KB | W: | H:

8.41 KB | W: | H:

src/assets/spritesmith/kf.png
src/assets/spritesmith/kf.png
src/assets/spritesmith/kf.png
src/assets/spritesmith/kf.png
  • 2-up
  • Swipe
  • Onion skin

4.78 KB | W: | H:

1.05 KB | W: | H:

src/assets/spritesmith/success.png
src/assets/spritesmith/success.png
src/assets/spritesmith/success.png
src/assets/spritesmith/success.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -29,7 +29,11 @@ module.exports = {
code_message_map: {}
},
secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b",
shopmall_appid: "gh_21f69fe893fc", //广汇
miniprogramInfo:{
username:'gh_21f69fe893fc',
miniprogramName:'广汇',
logo:'gh'
},
// shopmall_id: "gh_e983752bf563", //嘀加
appid: 'wx56bed167ad463f70', //公众号appid
sign: {
......@@ -39,5 +43,5 @@ module.exports = {
source: "scrm-main",
v: "1.0.0",
},
vconsole: false
vconsole: true
}
\ No newline at end of file
module.exports = {
title: '嘀加企微管家',
title: ' ',
request: {
// baseURL: 'http://ghwx.cgacar.com/scrm-wechat' // 生产
baseURL: 'http://cim.chinagrandauto.com/scrm-wechat' // 生产
......
module.exports = {
title: '嘀加企微管家',
title: ' ',
request: {
baseURL: 'http://xxxxx' // 项目地址
},
......
......@@ -2,9 +2,10 @@ import Vue from 'vue'
import Router from 'vue-router'
import routes from './routes'
import store from '@/store'
import { util } from '@/utils'
// hack router push callback
const originalPush = Router.prototype.push
Router.prototype.push = function push(location, onResolve, onReject) {
Router.prototype.push = function push (location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch(err => err)
}
......@@ -13,7 +14,7 @@ Vue.use(Router)
const router = createRouter()
function createRouter() {
function createRouter () {
return new Router({
// mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath
base: process.env.BASE_URL,
......@@ -26,24 +27,21 @@ function createRouter() {
// http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-attachment-activity/
router.beforeEach((to, from, next) => {
/* 路由发生变化修改页面title */
if (to.meta.title) {
store.dispatch('setPageMeta', to.meta)
} else {
store.dispatch('setPageMeta', { title: '加载中...' })
}
let title = util.getLocalStorage('wx_scrm_page_title') || ''
if (to.meta.title) store.dispatch('setPageMeta', to.meta)
else store.dispatch('setPageMeta', { title })
store.commit('SET_LAST_PATH', to.name)
/* 路由发生变化修改页面背景色 */
if (to.meta.backgroundColor) document.documentElement.style.backgroundColor = to.meta.backgroundColor
if (to.matched.some(recode => recode.meta.noAuth)) {
store.state.app.showWindow = true
} else {
store.dispatch('navigation')
}
store.dispatch('registerHttp')
} else store.dispatch('navigation')
next()
})
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
export function resetRouter () {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
......
......@@ -7,7 +7,7 @@
* @LastEditTime: 2021-07-06 12:02:21
*/
import { ssoApi } from '@/api'
import { store, util } from 'utils'
import { util } from 'utils'
import { Http } from 'glsx-common'
import { Notify } from 'vant'
const state = {
......
......@@ -10,7 +10,7 @@
<wx-open-launch-weapp
class="mini"
path="packageMine/pages/order/index/index.html"
:username="shopmall_appid"
:username="miniprogramInfo.username"
:env-version="envVersion"
>
<script type="text/wxtag-template">
......@@ -120,15 +120,15 @@ export default {
formList: [],
payStatus: Date.now(),
envVersion: 'release',
shopmall_appid: 'gh_21f69fe893fc',
miniprogramInfo: {},
posterImg: ''
}
},
mounted () {
console.log(PayModal)
const { envVersion, shopmall_appid } = window.$fetchConfig
const { envVersion, miniprogramInfo } = window.$fetchConfig
this.envVersion = envVersion
this.shopmall_appid = shopmall_appid
this.miniprogramInfo = miniprogramInfo
// shopmallApi.payOrder({
// orderCode:2207101414289656
// })
......@@ -159,7 +159,8 @@ export default {
}],
shareStaffName: linkParams.staffName || '',
shareStaffUuid: linkParams.staffUuid || '',
shareStaffType: linkParams.staffType || ''
shareStaffType: linkParams.staffType || '',
userPhone: linkParams.userPhone || ''
}
shopmallApi.createOrder(params).then(data => {
that.pay(data.orderCode)
......
......@@ -58,7 +58,6 @@ export default {
},
methods: {
cancel () {
console.log(123)
this.show = false
this.$parent.showKf = false
},
......
......@@ -7,14 +7,23 @@
>
<div class="sprite-icon icon-top"></div>
</div>
<template v-if="detail.customerServiceName">
<div
class="kf"
@click="clickKF"
>
<div class="sprite-icon icon-kf"></div>
</div>
</template>
<div class="page-btn">
<template v-if="detail.customerServiceName">
<div
class="sprite-icon icon-kf"
@click="clickKF"
@touchstart="touchstart"
@touchend="touchend"
></div>
</template>
<!-- <div
class="sprite-icon icon-share"
@touchstart="touchstart"
@touchend="touchend"
@click="share"
></div> -->
</div>
<div class="big-img">
<img :src="detail.activityBigImg">
<template v-if="detail.activityStatus != 1">
......@@ -53,7 +62,7 @@
webkit-playsinline
playsinline
loop
autoplay
:autoplay="!detail.activityMusic"
></video>
</div>
<template v-if="detail.activityVideos.length > 1">
......@@ -151,7 +160,7 @@
<div class="progress-bar">
<div
class="bar sprite-icon icon-flash"
:style="{'left':`${groupInfo.progress > 100 ? 100 : groupInfo.progress}%`}"
:style="{'left':`${groupInfo.progress > 100 ? 100 :groupInfo.progress < 11 ? 13 : groupInfo.progress}%`}"
></div>
<div class="progress">
<div
......@@ -200,11 +209,12 @@ export default {
updata: Date.now(),
distanceKey: Date.now(),
noAuthAddress: false,
showKf: false
showKf: false,
shareInfo: {}
}
},
mounted () {
wxConfig.init(['getLocation', 'openLocation', 'updateAppMessageShareData']).then(() => {
wxConfig.init(['getLocation', 'openLocation', 'updateAppMessageShareData', 'onMenuShareAppMessage']).then(() => {
wxConfig.ready(() => {
this.getActivityDetail()
})
......@@ -218,9 +228,6 @@ export default {
refresh (activityStatus) {
this.updata = Date.now()
this.detail.activityStatus = activityStatus
// if (activityStatus) {
// } else this.getActivityDetail()
},
getActivityDetail () {
let { id } = this.getQuery()
......@@ -235,6 +242,7 @@ export default {
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日')
document.title = data.activityName
this.setLocalStorage('wx_scrm_page_title', data.activityName)
this.hideLoading()
this.detail = data
this.id = id
......@@ -247,12 +255,13 @@ export default {
this.audioAutoPlay()
})
}
wxConfig.updateAppMessageShareData({
title: data.activityName,
this.shareInfo = {
title: `${userInfo.nickName}邀请您参加${data.merchantName}店的${data.activityName}众筹活动`,
desc: `限时大型众筹,活动时间${data.s_time}-${data.e_time}`,
link: `${redirectUrl}?id=${id}&staffUuid=${params.staffUuid}&userPhone=${userInfo.phone}&staffType=1`,
link: `${redirectUrl}?id=${id}&userPhone=${userInfo.phone}&staffType=1&staffUuid=${params.staffUuid || ''}`,
imgUrl: data.posterImg || data.activityImg
})
}
// wxConfig.updateAppMessageShareData(this.shareInfo)
if (data.activityAddressLat && data.activityAddressLng) {
wxConfig.getLocation().then(res => {
console.log(res)
......@@ -266,11 +275,19 @@ export default {
}
})
},
share () {
let { shareInfo, id } = this
wxConfig.onMenuShareAppMessage(shareInfo).then(() => {
bigdatautilApi.reportTrack(id, true)
})
},
getActivityGroup () {
shopmallApi.getActivityGroup(this.id).then(data => {
let arr = [], items = []
// console.log(JSON.parse(JSON.stringify(data)))
data.progress = this.decimal((data.groupQuantity / data.fictitiousLadderQuantity) * 100, 2)
data.progress = data.fictitiousLadderQuantity != 0
? this.decimal((data.groupQuantity / data.fictitiousLadderQuantity) * 100, 2)
: this.decimal(data.groupQuantity * 100, 2)
data.groupList.map(e => {
items.push(e)
if (items.length == 15) {
......@@ -317,7 +334,7 @@ export default {
})
},
clickKF () {
// 活动客服标志:1 同步在线客服;2 单独设置
// 活动客服标志:1 同步在线客服;2 单独设置 (暂时没有在线客服)
let { customerServiceFlag } = this.detail
this.showKf = true
// if (customerServiceFlag == 2) this.showKf = true
......
<template>
<div class="layout flex">
<div class="sprite-icon icon-success"></div>
<div class="title">您已参团成功!</div>
<div class="info">您可以点击下面图标进入广汇车生活小程序,到店凭核销码核销订单并支付尾款,更有会员套餐等多重福利可享!</div>
<div class="miniprogram flex">
<div class="icon text-center">
<img src="@/assets/images/logo.png" />
<div class="icon-box">
<img src="@/assets/images/success-bg.png" />
<div class="icon-logo x-center text-center">
<div :class="['sprite-icon',`icon-${miniprogramInfo.logo}-logo`]"></div>
</div>
广汇车生活小程序
</div>
<div class="title flex">
<div class="sprite-icon icon-success"></div>恭喜您已参团成功!
</div>
<div class="info">登录{{miniprogramInfo.miniprogramName}}车生活小程序,到店凭码核销订单并支付尾款</div>
<div class="miniprogram-btn flex text-center">
立即跳转小程序
<wx-open-launch-weapp
class="mini"
path="packageMine/pages/order/index/index.html"
:username="shopmall_appid"
:username="miniprogramInfo.username"
:env-version="envVersion"
>
<script type="text/wxtag-template">
......@@ -23,18 +27,20 @@
</template>
<script type='text/ecmascript-6'>
import { wxConfig } from '@/api'
export default {
name: '',
data () {
return {
envVersion: 'release',
shopmall_appid: 'gh_21f69fe893fc'
miniprogramInfo: {}
}
},
mounted () {
const { envVersion, shopmall_appid } = window.$fetchConfig
wxConfig.init()
const { envVersion, miniprogramInfo } = window.$fetchConfig
this.envVersion = envVersion
this.shopmall_appid = shopmall_appid
this.miniprogramInfo = miniprogramInfo
},
methods: {
}
......@@ -44,25 +50,49 @@ export default {
<style scoped lang='scss'>
.layout {
flex-direction: column;
padding: 56px 48px 0;
font-size: 14px;
color: #656566;
.icon-box {
width: 100%;
height: 187px;
position: relative;
.icon-logo {
width: 125px;
height: 125px;
background: #ffffff;
top: 50px;
border-radius: 100%;
overflow: hidden;
}
}
.title {
font-size: 16px;
font-size: 18px;
font-weight: 500;
color: #2d2d2e;
padding: 42px 0 10px;
color: #282829;
padding: 40px 0 7px;
.sprite-icon {
margin-right: 4px;
}
}
.info {
margin-bottom: 150px;
margin-bottom: 110px;
width: 240px;
text-align: center;
}
.miniprogram {
flex-direction: column;
.miniprogram-btn {
font-weight: 500;
font-size: 16px;
font-weight: 600;
color: #ffffff;
position: relative;
overflow: hidden;
width: 115px;
height: 100px;
width: 310px;
height: 44px;
background: #f13c3d;
box-shadow: 0px 2px 6px 2px rgba(241, 60, 61, 0.1);
border-radius: 4px;
border: 1px solid #f13c3d;
box-sizing: border-box;
.mini {
position: absolute;
left: 0;
......@@ -76,15 +106,6 @@ export default {
height: 100%;
}
}
.icon {
width: 70px;
height: 70px;
border: 1px solid #dddddd;
border-radius: 100%;
overflow: hidden;
box-sizing: border-box;
margin-bottom: 4px;
}
}
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!