Commit 69432855 by 王志慧

init

1 parent 4139529c
Showing 131 changed files with 3832 additions and 0 deletions
> 1%
last 2 versions
# http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
NODE_ENV='development'
# must start with VUE_APP_
VUE_APP_ENV = 'development'
NODE_ENV='production'
# must start with VUE_APP_
VUE_APP_ENV = 'production'
\ No newline at end of file \ No newline at end of file
NODE_ENV='production'
# must start with VUE_APP_
VUE_APP_ENV = 'staging'
build/*.js
src/assets
src/config
public
dist
node_modules
agreement.vue
module.exports = {
root: true,
globals: {
wx: true,
TCPlayer: true,
Hls: true,
vm: true
},
env: {
node: true
},
extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/prettier'],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-unused-vars': 'off'
}
}
.DS_Store
node_modules
/dist
/docs
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
package-lock.json
yarn.lock
\ No newline at end of file \ No newline at end of file
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
plugins: {
autoprefixer: {
overrideBrowserslist: ['Android 4.1', 'iOS 7.1', 'Chrome > 31', 'ff > 31', 'ie >= 8']
},
// 'postcss-pxtorem': {
// rootValue: 37.5,
// propList: ['*'],
// selectorBlackList: ['van-','ignore','ign-','.hairlines']
// },
'postcss-px-to-viewport': {
viewportWidth: 375, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750
unitPrecision: 3, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除)
viewportUnit: 'vw', // 指定需要转换成的视窗单位,建议使用vw
selectorBlackList: [], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名
minPixelValue: 0.5, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值
mediaQuery: false, // 允许在媒体查询中转换`px`
// landscape: true,
// landscapeUnit: 'vw', // (String) 横屏时使用的单位
// landscapeWidth: 812,
// viewportHeight:812,
}
}
}
\ No newline at end of file \ No newline at end of file
{
"printWidth": 800,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"semi": false,
"wrap_line_length": 820,
"wrap_attributes": "auto",
"proseWrap": "always",
"arrowParens": "avoid",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "ignore",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"jsxBracketSameLine": true,
"files.insertFinalNewline": true,
"prettier.ignorePath": ".prettierignore",
"useTabs": false,
"eslintIntegration": false,
"overrides": [
{
"files": ".prettierrc",
"options": {
"parser": "json"
}
}
],
"endOfLine": "auto"
}
auth.token=45d2be625091494b9a0de35af25bb273c0a471650575471096d60dd61f6995e6
defaults.url = http://sentry.glsx.com.cn
defaults.org = sentry
defaults.project =zhongchou-h5
File mode changed
// 获取 VUE_APP_ENV 非 NODE_ENV,测试环境依然 console
const IS_PROD = ['production', 'prod'].includes(process.env.VUE_APP_ENV)
const plugins = [
[
'import',
{
libraryName: 'vant',
libraryDirectory: 'es',
style: true
},
'vant'
]
]
// 去除 console.log
if (IS_PROD) {
plugins.push('transform-remove-console')
}
module.exports = {
presets: [['@vue/cli-plugin-babel/preset', { useBuiltIns: 'usage', corejs: 3 }]],
plugins
}
{
"name": "zhongchou",
"version": "1.0.0",
"description": "GH Hall By Work WeChat",
"author": "limin <limin.mail@qq.com>",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --open",
"build": "vue-cli-service build",
"stage": "vue-cli-service build --mode staging",
"lint": "vue-cli-service lint --fix",
"dev": "npm run serve"
},
"dependencies": {
"@sentry/tracing": "^7.14.0",
"@sentry/vue": "^7.14.0",
"@sentry/webpack-plugin": "^1.19.0",
"build": "^0.1.4",
"core-js": "^3.6.4",
"dayjs": "^1.10.5",
"glsx-common": "^1.4.9",
"lib-flexible": "^0.3.2",
"postcss-loader": "^6.2.0",
"sha1": "^1.1.1",
"storejs": "^1.1.0",
"tim-js-sdk": "^2.23.1",
"tim-upload-plugin": "^1.0.5",
"tim-wx-sdk": "^2.23.1",
"vant": "^2.12.21",
"vconsole": "^3.7.0",
"vue": "^2.6.11",
"vue-jsonp": "^2.0.0",
"vue-router": "^3.2.0",
"vuex": "^3.4.0",
"webpack-spritesmith": "^1.1.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/eslint-config-prettier": "^6.0.0",
"autoprefixer": "^8.0.0",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^6.2.2",
"lint-staged": "^9.5.0",
"node-sass": "^4.14.1",
"postcss-px-to-viewport": "^1.1.1",
"postcss-pxtorem": "^5.1.1",
"prettier": "^2.2.1",
"sass-loader": "^8.0.2",
"script-ext-html-webpack-plugin": "^2.1.4",
"vue-loader": "^15.9.8",
"vue-template-compiler": "^2.6.11",
"webpack-bundle-analyzer": "^3.8.0"
},
"lint-staged": {
"*.{js,jsx,vue}": [
"vue-cli-service lint",
"git add"
]
}
}
<!--
* @Description:
* @Author: huyue
* @Date: 2022-09-26 11:32:00
* @LastEditors: huyue
* @LastEditTime: 2022-09-26 16:22:15
-->
<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>
<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>
<template>
<div id="app">
<template v-if="showWindow">
<transition name="fade">
<keep-alive v-if="$route.meta.keepAlive">
<router-view></router-view>
</keep-alive>
</transition>
<transition name="fade">
<router-view v-if="!$route.meta.keepAlive"></router-view>
</transition>
</template>
<action v-show="$route.meta.showAction && !$store.state.app.isLiveFull"></action>
</div>
</template>
<script>
import { bigdatautilApi } from '@/api'
export default {
name: 'App',
data() {
return {
timer: null
}
},
watch: {
watchFlag: {
immediate: true,
handler(newval) {
this.showWindow = newval
this.hideLoading()
}
},
wacthLoginStatus: {
immediate: true,
handler(newval) {
if (newval) {
console.log('触发埋点')
this.init()
}
}
}
},
computed: {
watchFlag() {
return this.$store.state.app.showWindow
},
wacthLoginStatus() {
return this.$store.state.app.loginStatus
}
},
mounted() {},
methods: {
init() {
this.openListener()
window.addEventListener('pagehide', () => {
this.leave()
this.closeListener()
// console.log('页面要关闭了')
})
},
// 心跳检测
openListener() {
this.timer = setInterval(() => {
this.heartbeat()
}, 60 * 1000)
},
closeListener() {
clearInterval(this.timer)
},
// 心跳检测
heartbeat() {
this.trackFn('heartbeat', 5)
},
//离开事件
leave() {
// console.log('离开时间')
this.trackFn('leaveReportTrack', 5)
},
trackFn(name, actionType) {
const { id } = this.getQuery()
bigdatautilApi[name](id, actionType)
}
}
}
</script>
import { util } from 'utils'
import dayjs from 'dayjs'
// 埋点上报
const commonUrl = '/rop-scrm-bigdatautil/router'
// 心跳检测
const heartbeatUrl = '/rop-scrm-shopmall/router'
// 离开埋点url
const leaveUrl = '/rop-scrm-bigdatautil/data/report'
// 第一次进入时间
let firstEnter = true
const enter_time = new Date().format('yyyy-MM-dd hh:mm:ss')
/** 埋点 */
/**
* @param {*} id 活动id
* @param {*} view 动作类型 // 1浏览 4分享 5离开页面
* @param {*} share_channel // 分享类型(1:转发,2:朋友圈)
* @param {*} url // 基础路径
* @param {*} method 方法地址
* @param {*} leave 是否离开事件 默认是false
* @returns
*/
const reportTrack = (id, view = 1, share_channel = '', url = commonUrl, method = 'entmicro.api.customercollect.reportCustomerList', leave = false) => {
const userInfo = util.getUserInfo()
const params = util.getLocalStorage('wx_scrm_link_params') || {}
const ISWXWORK = util.getLocalStorage('is_wxwork')
if (!userInfo) return
if (ISWXWORK) {
if (userInfo.loginList.length && userInfo.loginList[0].phone) userInfo.phone = userInfo.loginList[0].phone
}
// 处理分享时间格式(1.YYYY-MM-DD HH:mm:ss,2.时间戳)
let sharedTime
if (params.sharedTime) {
if (!params.sharedTime.includes('-')) {
sharedTime = dayjs(+params.sharedTime).format('YYYY-MM-DD HH:mm:ss')
} else {
sharedTime = decodeURIComponent(params.sharedTime)
}
} else {
sharedTime = ''
}
let data = {
open_id: userInfo.openid || userInfo.uuid,
staff_id: (params && params.staffId) || null,
staff_uuid: (params && params.shareStaffUuid) || null,
user_phone: (params && params.userPhone) || null,
create_time: firstEnter ? enter_time : new Date().format('yyyy-MM-dd hh:mm:ss'), // 离开时间
enter_time, // 进入时间
item_type: 3,
customer_phone: userInfo.phone || null,
action_type: view,
item_id: id,
business_type: 1,
add_way: 104,
merchant_id: (params && params.merchantId) || null,
user_open_id: (params && params.openId) || null,
share_channel: share_channel ? share_channel : null,
sharedTime: sharedTime ? sharedTime : null,
is_exclusive: (params && params.isExclusive) || null,
exclusive_uuid: (params && params.exclusiveUuid) || null,
share_staff_type: (params && params.shareStaffType) || null, //v3.1.0版本增加
}
if (view == 4) data.user_open_id = userInfo.openid || userInfo.uuid
if (ISWXWORK) {
delete data.user_open_id
if (view == 4) data.staff_uuid = userInfo.uuid
}
// 数据上报兼容
data = {
// method: 'entmicro.api.customercollect.reportCustomerList',
method: method ? method : null,
jsonList: [JSON.stringify(data)]
}
firstEnter = false
// 是否离开事件
if (leave) {
if (navigator.sendBeacon) {
const params = JSON.stringify(data)
return navigator.sendBeacon(url, params)
} else {
return window.$HTTP({
url,
data
})
}
} else {
return window.$HTTP({
url,
data
})
}
}
// 心跳检测
const heartbeat = (id, view = 5, share_channel = '', url = heartbeatUrl, method = 'scrm.api.shopmall.customer.browse.records.heart') => {
reportTrack(id, view, share_channel, url, method)
}
//离开事件数据上报
const leaveReportTrack = (id, view = 5) => {
// console.log('离开事件数据上报')
reportTrack(id, view, '', leaveUrl, '', true)
}
export default {
reportTrack,
heartbeat,
leaveReportTrack
}
const url = '/rop-scrm-carlife/router'
import { util } from 'utils'
export default {
/**获取车品牌列表 */
getCarBrandList(data = {}) {
data.method = 'scrm.api.carlife.common.getOnlyCarBrandList'
return window.$HTTP({
url,
data
})
},
/** 获取车系列表 */
getCarSeriesList(params) {
let data = {
method: 'scrm.api.carlife.common.getCarSeriesList',
...params
}
return window.$HTTP({
url,
data
})
},
/** 获取车型 */
getCarTypeList(carSeriesId) {
let data = {
method: 'scrm.api.carlife.common.getCarTypeList',
carSeriesId
}
return window.$HTTP({
url,
data
})
}
}
/*
* @Descripttion:API 统一外部调用入口
* @version: 1.0.0
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-17 18:23:27
*/
import ssoApi from './ssoApi'
import mapApi from './mapApi'
import wxConfig from './wxConfig'
import shopmallApi from './shopmallApi'
import bigdatautilApi from './bigdatautilApi'
import carLifeApi from './carLifeApi'
export { ssoApi, mapApi, wxConfig, shopmallApi, bigdatautilApi, carLifeApi }
import md5 from './utils/md5'
import qs from './utils/qs'
const key = 'F2HBZ-KH73F-7A2J2-JC4UR-WOHCO-UVFGZ'
const secret = 'YBmrM98E5pM4gYeknWiBPaWpFR4AISUl'
const domain = 'https://apis.map.qq.com'
class QQMap {
setLocaleCompare(params) {
params.key = key
let keys = []
let obj = {}
Object.keys(params).map(e => keys.push(e))
keys.sort((a, b) => a.localeCompare(b)).map(e => (obj[e] = params[e]))
return obj
}
getSign(params, methods) {
let obj = this.setLocaleCompare(params)
let sign = `${methods}?${decodeURIComponent(qs.stringify(obj))}${secret}`
return md5(sign)
}
request(method, data) {
data.output = 'jsonp'
// data.callback = 'test'
const sig = this.getSign(data, method)
let obj = {
...this.setLocaleCompare(data),
sig
},
params = []
Object.keys(obj).map(key => {
params.push(`${key}=${encodeURIComponent(obj[key])}`)
})
// window.fetch(`${domain}${method}?${params.join('&')}`, {
// method: 'GET',
// mode: 'no-cors',
// })
let script = document.createElement('script')
script.src = `${domain}${method}?${params.join('&')}`
script.type = 'text/javascript'
document.body.insertBefore(script, document.body.children[0])
return new Promise((resolve, reject) => {
window['QQmap'] = ({ status, result }) => {
console.log(result)
if (status == '0') resolve(result)
else reject()
document.body.removeChild(script)
}
})
}
/**计算距离 */
calculateDistance(from, to) {
from = from.join(',')
to = to.join(',')
return this.request('/ws/distance/v1/', {
from,
to,
mode: 'driving'
})
}
/** 批量距离计算(矩阵) */
calculateDistanceMatrix(from, toList) {
from = from.join(',')
let to = toList.join(';')
return this.request('/ws/distance/v1/matrix/', {
from,
to,
mode: 'driving'
})
}
/**地址解析(地址转坐标) */
geocoder(address) {
return this.request('/ws/geocoder/v1/', {
address
})
}
/**逆地址解析(坐标位置描述) location=lat<纬度>,lng<经度> */
detailedAdrress(location) {
location = location.join(',')
return this.request('/ws/geocoder/v1/', {
location
})
}
/**IP定位 */
getLocationByIp() {
return this.request('/ws/location/v1/ip')
}
/**坐标转换 */
translate(locations, type = 5) {
locations = locations.join(';') //格式:纬度前,经度后
return this.request('/ws/coord/v1/translate', {
locations,
type
})
}
}
export default new QQMap()
const url = '/rop-scrm-shopmall/router'
import { util } from 'utils'
export default {
/**众筹详情 */
getActivityDetail (id) {
return window.$HTTP({
url,
data: {
method: 'scrm.api.shopmall.weapp.activity.detail',
id
},
returnAll: true
})
},
/**参团人数 */
getActivityGroup (id) {
return window.$HTTP({
url,
data: {
method: 'scrm.api.shopmall.weapp.activity.group',
id
}
})
},
/** 创建订单(立即购买) */
createOrder (data) {
data.method = 'scrm.api.shopmall.weapp.order.create'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**创建支付订单(去付款) */
payOrder (data) {
data.method = `scrm.api.shopmall.weapp.order.createPay`
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**海报 */
getPoster (data) {
data.method = `scrm.api.shopmall.weapp.crowdFunding.poster`
return window.$HTTP({
url,
data
})
},
/** 订单详情 */
getOrderList (activityId) {
let data = {
activityId,
method: 'scrm.api.shopmall.weapp.crowdFunding.order.list'
}
return window.$HTTP({
url,
data
})
},
// 根据众筹id获取直播详情
getLiveDetail (id) {
let data = {
id,
method: 'scrm.api.shopmall.weapp.activity.live.broadcast.detail'
}
return window.$HTTP({
url,
data
})
},
// 直播IM用户签名
getLiveSig (data) {
data.method = 'scrm.api.shopmall.weapp.live.activity.usersig'
return window.$HTTP({
url,
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
})
}
}
const url = '/rop-scrm-sso/router'
const returnAll = true
export default {
/**OAuth2授权登陆 */
login(data) {
data.method = 'scrm.api.sso.weapp.login.by.wechat'
return window.$HTTP({
url,
data,
returnAll
})
},
/**企微 OAuth2授权登陆 */
wwLogin(data) {
data.method = 'scrm.api.sso.ww.oauth.login'
data.productCode = 'PC00025'
return window.$HTTP({
url,
data,
returnAll
})
},
/**验证码登录 */
captchaLogin(data) {
data.method = 'scrm.api.sso.sms.login'
return window.$HTTP({
url,
data,
returnAll
})
}
}
@keyframes move {
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
}
.layout {
padding-bottom: 100px;
&.no-padding {
padding: 0;
}
.empty-page {
position: absolute;
top: 0;
left: 0;
bottom: 0;
box-sizing: border-box;
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-size: 14px;
color: #ACACAC;
}
.empty-img {
width: 223px;
height: 120px;
margin-bottom: 30px;
}
.to-top {
position: fixed;
right: 10px;
bottom: 100px;
z-index: 2;
width: 30px;
height: 30px;
overflow: hidden;
background-color: #fff;
border-radius: 100%;
}
.big-img {
position: relative;
width: 100%;
overflow: hidden;
margin-bottom: 5px;
img {
object-fit: contain;
height: auto;
}
.hot {
height: 26px;
background: rgba(0, 0, 0, 0.5);
border-radius: 13px;
padding: 0 10px;
text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.4);
font-weight: 600;
font-size: 12px;
color: #ffffff;
top: 8px;
.icon-hot {
margin-right: 2px;
}
}
.music {
position: absolute;
top: 40px;
right: 20px;
border: 1px solid #fff;
border-radius: 100%;
box-sizing: border-box;
width: 34px;
height: 34px;
.icon-music {
animation: move 3s infinite ease-in-out;
}
}
.musicOff {
border: none;
}
}
.video-box {
margin: 8px 0 10px;
flex-wrap: nowrap;
overflow-x: scroll;
&::-webkit-scrollbar {
display: none;
}
.item {
flex-shrink: 0;
margin-left: 16px;
width: 148px;
height: 82px;
border-radius: 4px;
overflow: hidden;
position: relative;
&:first-of-type {
margin-left: 0 !important;
}
.mask {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 2;
background: #E9E8EC;
img {
object-fit: contain;
}
.line-box {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 13%;
background: linear-gradient(360deg, #292929 0%, #474747 100%);
.line {
width: 67%;
height: 2px;
background: #fff;
border-radius: 1px;
margin-left: 4%;
}
.duration {
font-size: 8px;
color: #FFFFFF;
margin-left: auto;
margin-right: 6px;
}
}
}
}
}
.onlyone {
.item {
width: 100%;
height: 192px;
.mask {
border-right: none !important;
.line-box {
width: 100% !important;
}
}
}
}
.onlytwo {
width: 100%;
justify-content: space-between;
.item {
width: 166px;
height: 92px;
padding-left: 0;
margin-left: 0;
}
}
.box {
background: #ffffff;
border-radius: 4px;
box-sizing: border-box;
padding: 14px 10px;
margin-bottom: 10px;
.title {
font-size: 14px;
font-weight: 600;
color: #fc5b32;
text-align: center;
position: relative;
}
}
.activity {
padding: 0 16px;
.address-box {
font-size: 12px;
color: #656566;
display: flex;
justify-content: space-between;
margin-top: 8px;
.address-info {
width: calc(100% - 64px);
.name {
color: #2c2c2c;
font-weight: 500;
font-size: 14px;
line-height: 20px;
}
.time {
margin-top: 8px;
color: #fc5b32;
}
}
.address-btn {
margin: 3px 0 0 auto;
.icon-address {
margin: 0 auto 2px;
}
.auth-text {
font-size: 8px;
}
}
}
.group-title {
font-size: 14px;
font-weight: 600;
color: #3C3939;
position: relative;
justify-content: space-between;
span {
color: #FC5B32;
font-size: 24px;
}
.view {
position: absolute;
right: 0;
bottom: 0;
font-weight: 500;
font-size: 14px;
}
}
.group-swipe {
height: 216px;
width: 100%;
margin-top: 14px;
}
.group-box {
padding: 0 9px;
display: flex;
flex-wrap: wrap;
width: 100%;
box-sizing: border-box;
gap: 12px 0;
.item {
font-size: 12px;
color: #3C3939;
text-align: center;
width: 20%;
}
img {
width: 45px;
height: 45px;
margin-bottom: 2px;
border-radius: 100%;
overflow: hidden;
}
}
.progress-box {
background: #FFFFFF linear-gradient(360deg, #FFFFFF 0%, #FFF7F7 100%);
border-radius: 4px;
border: 1px solid #FFFFFF;
box-sizing: border-box;
.progress-title {
color: #3C3939;
font-weight: 500;
font-size: 16px;
}
.progress-bar {
margin: 32px 0 9px;
position: relative;
.progress {
width: 100%;
height: 18px;
border-radius: 9px;
overflow: hidden;
background: linear-gradient(360deg, #FF4444 0%, #FD6C6C 100%);
box-shadow: inset 0px 2px 3px 0px rgba(255, 255, 255, 0.5);
position: relative;
.line {
height: 100%;
background: linear-gradient(360deg, #FFAA48 0%, #FFF454 100%);
box-shadow: 0px 1px 4px 0px #A90303, inset 0px 2px 3px 0px rgba(255, 255, 255, 0.5), inset 0px -1px 3px 0px #FE9D24;
border-radius: 9px;
transition: all 3s;
position: relative;
overflow: hidden;
@keyframes move-stripe {
from {
transform: translate(0);
}
to {
transform: translate(200vw);
}
}
.stripe {
position: absolute;
width: 300vw;
height: 100%;
right: 0;
top: 0;
background: url('https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/line.png') repeat;
background-size: 28px 18px;
animation: move-stripe 60s infinite ease-in-out;
// animation: rolling 10s linear infinite;
// &::after,
// &::before {
// display: block;
// content: '';
// width: 100%;
// height: 100%;
// border-radius: 9px;
// transition: all 3s;
// background: url('https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/line.png') repeat;
// background-size: 28px 18px;
// }
// &::after {
// transform: translateX(-18px);
// width: calc(100% + 18px);
// }
}
}
@keyframes rolling {
0% {
transform: translateY(0);
}
25% {
transform: translateY(-9px);
}
50% {
transform: translateY(-18px);
}
75% {
transform: translateY(-9px);
}
100% {
transform: translateY(0);
}
}
}
.bar {
position: absolute;
width: auto;
height: 22px;
top: -30px;
font-size: 14px;
padding: 0 4px;
font-weight: 600;
border-radius: 2px;
background: linear-gradient(360deg, #FFAA48 0%, #FFF454 100%);
box-shadow: inset 0px -1px 3px 0px #FE9D24, inset 0px 2px 3px 0px rgba(255, 255, 255, 0.5), inset 0px 1px 3px 0px rgba(255, 255, 255, 0.5);
color: #F13C3D;
transform: translateX(-50%);
transition: all 3s;
box-sizing: border-box;
.number {
margin-left: 4px;
}
.arrow {
position: absolute;
border-top: 5px solid #FFAA48;
border-left: 5.5px solid transparent;
border-right: 5.5px solid transparent;
border-bottom: 5px solid transparent;
bottom: -10px;
left: 50%;
transform: translateX(-50%);
}
.right {
left: 80%;
}
}
}
}
.group-info {
justify-content: space-between;
font-size: 14px;
font-weight: 500;
color: #FC5B32;
position: relative;
&::before,
&::after {
position: absolute;
width: 1px;
height: 34px;
background: #E3E3E6;
content: '';
top: 50%;
transform: translate(-50%, -50%);
}
&::before {
left: 92px;
}
&::after {
left: 234px;
}
.item {
.label {
font-size: 12px;
font-weight: 400;
color: #999999;
}
div {
margin-bottom: 3px;
}
}
}
}
}
@import './normalize.scss';
@import './sprite.scss';
html,
body .app {
color: #333333;
font-family: Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif;
background-color: #f7f8fa;
-webkit-overflow-scrolling: touch;
height: 100%;
--themeColor: #3975c6;
}
* {
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
}
img {
width: 100%;
height: 100%;
vertical-align: top;
}
video {
width: 100%;
height: 100%;
}
.flex {
display: flex;
align-items: center;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-two-line {
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.x-center {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.y-center {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.xy-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.btn-on-leave {
position: relative;
overflow: hidden;
&::after {
position: absolute;
top: 0;
left: 0;
content: '';
width: 100%;
height: 100%;
background-color: rgba($color: #000000, $alpha: 0.1);
display: block;
}
}
#audio {
position: fixed;
top: -10000px;
left: -10000px;
width: 10px;
height: 10px;
z-index: -1;
}
.live-line {
height: 10px;
position: relative;
@keyframes side-animation {
0%,
50%,
100% {
height: 2px;
}
25%,
75% {
height: 10px;
}
}
.side {
position: absolute;
bottom: 0;
width: 2px;
height: 6px;
border-radius: 1px;
background: linear-gradient(to bottom, #ffe385 0%, #ffc34d 100%);
animation: side-animation 2s infinite;
&:last-of-type {
left: 8px;
}
}
.center {
height: 10px;
left: 4px;
animation: side-animation 2s infinite reverse;
}
}
\ No newline at end of file \ No newline at end of file
.share-item {
padding-bottom: 14px;
border-bottom: 1px solid #e3e3e6;
}
.sub-title {
font-size: 16px;
font-weight: 500;
color: #282829;
height: 22px;
.all {
margin-left: auto;
height: 17px;
font-size: 0;
span {
font-size: 12px;
font-weight: 400;
color: #FC5B32;
}
.sprite-icon {
margin-left: 5px;
}
}
}
.hideBorder {
border-bottom: none;
padding-bottom: 0;
}
\ No newline at end of file \ No newline at end of file
.sprite-icon { background-image: url(../images/sprite.png);background-size: 453px 420px;}
.icon-address { width: 34px; height: 34px; background-position: -356px -232px;}
.icon-arrow { width: 7px; height: 11px; background-position: -444px -232px;}
.icon-avatar { width: 36px; height: 36px; background-position: -310px -232px;}
.icon-big-play { width: 40px; height: 40px; background-position: -376px -152px;}
.icon-close { width: 24px; height: 24px; background-position: -426px -152px;}
.icon-download { width: 30px; height: 30px; background-position: -352px -278px;}
.icon-faq-left { width: 18px; height: 22px; background-position: 0px -374px;}
.icon-faq-right { width: 18px; height: 22px; background-position: -28px -374px;}
.icon-flash { width: 10px; height: 14px; background-position: 0px -406px;}
.icon-hot { width: 15px; height: 18px; background-position: -436px -202px;}
.icon-kf-box { width: 300px; height: 350px; background-position: 0px 0px;}
.icon-kf-logo { width: 56px; height: 70px; background-position: -310px -152px;}
.icon-kf { width: 20px; height: 20px; background-position: -376px -202px;}
.icon-live-close { width: 18px; height: 18px; background-position: -56px -374px;}
.icon-music-off { width: 34px; height: 34px; background-position: -400px -232px;}
.icon-music { width: 32px; height: 32px; background-position: -310px -278px;}
.icon-order { width: 20px; height: 20px; background-position: -406px -202px;}
.icon-pause { width: 30px; height: 30px; background-position: -392px -278px;}
.icon-phone { width: 12px; height: 13px; background-position: -84px -374px;}
.icon-play { width: 30px; height: 30px; background-position: -310px -320px;}
.icon-poster { width: 20px; height: 20px; background-position: -432px -278px;}
.icon-qr { width: 143px; height: 142px; background-position: -310px 0px;}
.icon-scan { width: 30px; height: 30px; background-position: -350px -320px;}
.icon-success { width: 20px; height: 20px; background-position: -430px -320px;}
.icon-time { width: 12px; height: 11px; background-position: -106px -374px;}
.icon-title { width: 170px; height: 4px; background-position: 0px -360px;}
.icon-top { width: 30px; height: 30px; background-position: -390px -320px;}
\ No newline at end of file \ No newline at end of file
<template>
<div :class="['share-item', { hideBorder }]">
<div class="content">
<div class="user-info flex">
<div>
<img class="icon-head" :src="item.imageUrl" />
<!-- <div v-else class="sprite-icon icon-avatar"></div> -->
</div>
{{ item.name }}
</div>
<div :class="['text', { 'text-two-line': indexType }]" v-text="item.experience"></div>
<div :class="['img-box', { four: indexType }]">
<template v-for="(i, index) in item.activityExperienceImgs">
<div @click="jumpPreview(index)" v-if="indexType ? index < 4 : true" class="img-item" :key="index">
<img :src="i.imageUrl" />
</div>
</template>
</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'EvaluateItem',
props: {
hideBorder: Boolean,
indexType: Boolean,
item: {
type: Object,
default: () => { }
},
num: Number,
// 显示默认或真实数据头像和昵称,1-默认;2-真实数据
showAvatarNicknameFlag: Number
},
data() {
return {
}
},
mounted() {
},
methods: {
jumpPreview(index) {
let { activityExperienceImgs, experience } = this.item, item = []
activityExperienceImgs.map(e => item.push(e.imageUrl))
this.to('crowdfunding.imagePreview', { item, index, experience })
}
}
}
</script>
<style scoped lang="scss">
@import '@/assets/css/sharegoods.scss';
.user-info {
padding: 14px 0 10px;
font-size: 16px;
font-weight: 600;
color: #282829;
.sprite-icon {
margin-right: 8px;
}
}
.icon-head {
width: 36px;
height: 36px;
border-radius: 50%;
margin-right: 8px;
}
.text {
font-size: 14px;
color: #282829;
line-height: 20px;
margin-bottom: 13px;
word-break: break-all;
line-break: anywhere;
}
.img-box {
display: flex;
flex-wrap: wrap;
gap: 6px;
.img-item {
width: 110px;
height: 110px;
border-radius: 4px;
overflow: hidden;
}
}
.img-box.four {
gap: 8px;
flex-wrap: nowrap;
.img-item {
width: 75px;
height: 75px;
}
}
</style>
<template>
<div :class="['share-item', { hideBorder }, { indexType }]">
<div class="faq-item">
<div class="q flex">
<template v-if="indexType">
<div class="icon text-center">问</div>
</template>
<template v-else>
<div class="sprite-icon icon-faq-left"></div>
</template>
<div :class="['value', { 'text-hide': indexType }]">{{ item.question }}</div>
</div>
<div class="a flex">
<template v-if="indexType">
<div class="icon text-center">答</div>
</template>
<template v-else>
<div class="sprite-icon icon-faq-right"></div>
</template>
<div :class="['value', { 'text-hide': indexType }]">{{ item.answer }}</div>
</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'FAQItem',
props: {
hideBorder: Boolean,
indexType: Boolean,
item: {
type: Object,
default: () => { }
}
},
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang="scss">
@import '@/assets/css/sharegoods.scss';
.faq-item {
padding-top: 16px;
.flex {
margin-bottom: 12px;
align-items: flex-start;
.sprite-icon {
margin-right: 8px;
flex-shrink: 0;
}
}
.icon {
color: #ffffff;
font-size: 12px;
width: 14px;
height: 14px;
background: linear-gradient(108deg, #ffbe68 0%, #ff5446 60%, #f45454 100%);
border-radius: 2px;
flex-shrink: 0;
margin-right: 4px;
}
.q {
.value {
font-weight: 500;
font-size: 16px;
color: #2c2c2c;
}
}
.a {
.value {
font-size: 14px;
color: #282829;
}
.icon {
background: linear-gradient(108deg, #4f7bf6 0%, #3d6ced 60%, #3162e6 100%);
}
}
.value {
line-height: 20px;
line-break: anywhere;
word-break: break-all;
}
}
.indexType {
.faq-item {
padding-top: 0;
}
.flex {
margin-bottom: 0;
align-items: center;
}
.q {
margin-bottom: 6px;
&:last-of-type {
margin-bottom: 0;
}
.value {
color: #2c2c2c;
}
}
.value {
font-weight: 400;
font-size: 12px !important;
}
}
</style>
<template>
<van-overlay :show="show">
<div class="wrapper">
<div :class="['kf-box flex']">
<template>
<div class="qr-box">
<img src="@/assets/images/qr-bg.png" />
<img :src="detail.groupQrCode" class="qr xy-center" />
</div>
<div class="btn" @click="save">长按识别二维码加客服</div>
</template>
</div>
<div class="sprite-icon icon-close" @click.self="cancel"></div>
</div>
</van-overlay>
</template>
<script type="text/ecmascript-6">
export default {
name: 'GroupModal',
props: ['value', 'detail'],
data() {
return {
show: false,
img: null
}
},
mounted() { },
watch: {
value(n) {
this.show = n
}
},
methods: {
cancel() {
this.show = false
this.$parent.showKf = false
},
save() {
this.showToast('请长按二维码保存')
}
}
}
</script>
<style scoped lang="scss">
.van-overlay {
z-index: 3;
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
flex-direction: column;
.kf-box {
width: 273px;
height: 298px;
position: relative;
flex-direction: column;
font-size: 18px;
font-weight: 500;
background: rgba(#000000, 0.3);
border-radius: 8px;
.qr-box {
position: relative;
margin: 29px 0 19px;
width: 180px;
height: 180px;
.qr {
width: calc(100% - 38px);
height: calc(100% - 38px);
}
}
.btn {
box-shadow: inset 0px -3px 8px 0px rgba(202, 0, 0, 0.89);
background-image: linear-gradient(360deg, rgba(255, 68, 68, 1) 0, rgba(253, 108, 108, 1) 100%);
border-radius: 26px;
padding: 11px 28px 11px 29px;
font-size: 17px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #ffffff;
line-height: 24px;
}
}
.icon-close {
margin-top: 16px;
}
}
</style>
<template>
<van-overlay :show="show">
<div class="wrapper" @click.self="cancel">
<div :class="['kf-box flex', { short: !detail.customerServiceQrImg }]">
<div class="sprite-icon icon-kf-box"></div>
<div class="sprite-icon icon-kf-logo x-center"></div>
<div class="info">
<div class="name">{{ detail.customerServiceName }}</div>
<template v-if="detail.customerServicePhone">
<div class="phone flex" @click="makePhoneCall(detail.customerServicePhone)">
<div class="sprite-icon icon-phone"></div>
{{ detail.customerServicePhone }}
</div>
</template>
</div>
<template v-if="detail.customerServiceQrImg">
<div class="qr-box">
<div class="sprite-icon icon-qr"></div>
<img :src="detail.customerServiceQrImg" class="qr xy-center" />
</div>
<div class="bottom flex">
<div class="item flex">
<div class="sprite-icon icon-download"></div>
<div>
保存图片
<br />
到相册
</div>
</div>
<div class="item flex">
<div class="sprite-icon icon-scan"></div>
<div>
打开微信扫一扫
<br />
添加客服企微
</div>
</div>
</div>
</template>
</div>
</div>
</van-overlay>
</template>
<script type="text/ecmascript-6">
export default {
name: 'KfModal',
props: ['value', 'detail'],
data () {
return {
show: false,
img: null
}
},
mounted () { },
watch: {
value (n) {
this.show = n
}
},
methods: {
cancel () {
this.show = false
this.$parent.showKf = false
},
save () {
this.showToast('请长按二维码保存')
}
}
}
</script>
<style scoped lang="scss">
.van-overlay {
z-index: 3;
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
flex-direction: column;
.kf-box {
width: 300px;
height: 350px;
position: relative;
flex-direction: column;
font-size: 18px;
font-weight: 500;
color: #282829;
.icon-kf-box {
position: absolute;
}
.icon-kf-logo {
top: -15px;
}
.info {
position: relative;
z-index: 2;
text-align: center;
padding-top: 64px;
.phone {
letter-spacing: 2px;
margin-top: 1px;
}
}
.qr-box {
position: relative;
width: 143px;
height: 142px;
margin: 10px 0 16px;
.qr {
width: calc(100% - 32px);
height: calc(100% - 32px);
}
}
.bottom {
position: absolute;
left: 0;
bottom: 0;
z-index: 2;
width: 100%;
height: 70px;
background: #f7f8fa;
border-radius: 0px 0px 10px 10px;
box-sizing: border-box;
padding: 0 20px;
justify-content: space-between;
.item {
padding-left: 7px;
font-size: 12px;
color: #b1b1b3;
.sprite-icon {
margin-right: 6px;
}
}
}
}
.short {
height: 140px;
.icon-kf-box {
height: 100%;
border-radius: 12px;
}
}
}
</style>
<template>
<div>
<van-action-sheet
v-model="showBox"
@click-overlay="onCancel"
:lock-scroll="false"
>
<div class="box">
<template v-for="(i, index) in items">
<template v-if="i.name">
<div
class="item flex"
:key="index"
>
<div class="label text-hide">
<span v-if="i.key != 'plateNo'">*</span>
{{ i.name }}
</div>
<div class="value">
<template v-if="i.route">
<van-field
readonly
:placeholder="`请选择您的${i.name}`"
@click="jumpCarBrands(i.route)"
v-model="params[i.key]"
class="readonly"
right-icon="arrow"
></van-field>
</template>
<template v-else-if="i.type == 'plate'">
<van-field
readonly
:placeholder="`请填写您的${i.name}`"
@click="showPlate"
v-model="params[i.key]"
class="readonly"
></van-field>
</template>
<template v-else>
<van-field
v-model="params[i.key]"
:placeholder="`请填写您的${i.name}`"
:maxlength="i.maxlength"
:type="i.type"
clearable
/>
</template>
</div>
</div>
</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">
本人已阅读且同意<span @click="jump('agreement')">《隐私协议》</span>
</div> -->
<template v-if="ISWXWORK">
<van-button
color="#b1b1b1"
class="btn disabled"
>企微暂不支持支付</van-button>
</template>
<template v-else>
<van-button
color="#f13c3d"
class="btn"
@click="pay"
loading-text="支付中..."
:loading="payLoading"
>立即支付</van-button>
</template>
</div>
</van-action-sheet>
<license-plate
ref="plate"
@done="plateDone"
></license-plate>
</div>
</template>
<script type="text/ecmascript-6">
import { ssoApi } from '@/api'
import { Notify } from 'vant'
import store from '@/store'
export default {
name: 'PayModal',
props: {
value: Boolean,
list: {
type: Array,
default: () => []
},
payStatus: Number,
carInfo: {
type: Object,
default: () => { }
}
},
watch: {
value (n) {
let { phone } = this.getUserInfo()
this.showBox = n
if (n && !this.params) {
this.items = [
{ name: '姓名', key: 'userName', maxlength: 40 },
// { name: '电话', key: 'userPhone', maxlength: 11, type: 'tel' },
...this.list
]
console.log(this.items)
let params = {}
this.items.map(e => {
params[e.key] = ''
if (e.route) this.hasCarBrand = true
if (e.key == 'userPhone') {
this.hasPhoneSelect = true
if (phone) params[e.key] = phone
}
})
this.params = params
let { hasDefaultBrands, brandInfo, userSelectGoodsList } = this.$parent.detail
if (hasDefaultBrands && !this.params.carBrandsText) {
this.params.carBrandsText = `${brandInfo.vehicleBrandName} ${brandInfo.vehicleSubBrandName}`
}
if (userSelectGoodsList) {
this.userSelectGoodsList = userSelectGoodsList
this.bus.$on('changeUserSelectGoodsList', () => {
this.setTotalPrice()
})
this.setTotalPrice()
}
}
},
payStatus () {
this.payLoading = false
},
carInfo (n) {
console.table([JSON.parse(JSON.stringify(n))])
if (this.params) {
this.params.carBrandsText = `${n.vehicleBrandName} ${n.vehicleSubBrandName}`
this.params.carTypeText = `${n.vehicleSeriesName} ${n.vehicleShapeName}`
}
},
},
data () {
return {
showBox: false,
payLoading: false,
items: [],
params: null,
hasCarBrand: false,
hasPhoneSelect: false,
userSelectGoodsList: [],
totalPrice: {}
}
},
mounted () {
},
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 () {
this.$emit('cancel')
},
pay () {
let { params, items, hasCarBrand, carInfo, hasPhoneSelect } = this,
obj = {},
phoneRex = /^[1]([3-9])[0-9]{9}$/,
userInfo = this.getUserInfo()
console.log(params)
const onInput = ["plateNo"]
try {
items.map(e => {
Object.keys(params).map(key => {
if (!params[key] && key == e.key && e.name && !onInput.includes(key)) throw e.name
})
})
} catch (error) {
this.showToast(`请填写${error}`)
return
}
if (params.userPhone && !phoneRex.test(params.userPhone)) {
this.showToast('请填写正确的手机号')
return
}
Object.keys(params).map(key => {
if (params[key]) obj[key] = params[key]
})
if (hasCarBrand) {
delete obj.carBrandsText
delete obj.carTypeText
obj = {
...obj,
...carInfo
}
}
if (userInfo.phone) this.emit(obj)
else {
ssoApi.captchaLogin({
mobile: params.userPhone || '88888888888',
captcha: 8888,
source: 'CROWDFUNDING_H5'
}).then(({ code, data, message }) => {
if (code == '0') {
this.setUserInfo(data)
this.setSessionId(data.sessionId)
store.dispatch('registerHttp', data.sessionId)
this.emit(obj)
}
else Notify(message)
})
}
},
emit (obj) {
console.log(obj)
this.payLoading = true
this.$emit('pay', { obj, that: this.$parent })
},
jumpCarBrands (name) {
let { hasDefaultBrands, brandInfo } = this.$parent.detail,
{ carInfo } = this
let chooseItem = Object.keys(carInfo).length
if (name == 'carSeries') {
if (chooseItem || hasDefaultBrands) {
let id = chooseItem ? carInfo.vehicleSubBrandId : brandInfo.vehicleSubBrandId
let name = chooseItem ? carInfo.vehicleSubBrandName : brandInfo.vehicleSubBrandName
let list = [{
id,
name,
childs: null
}]
this.to('crowdfunding.carSeries', {
brandInfo: chooseItem ? carInfo : brandInfo,
list
})
return
}
}
this.to('crowdfunding.carBrands')
},
showPlate () {
this.$refs.plate.toggle()
},
plateDone ({ value }) {
this.params.plateNo = value
}
}
}
</script>
<style scoped lang="scss">
.box {
padding: 8px 16px 16px;
.item {
border-bottom: 1px solid #f1f1f1;
height: 49px;
color: #282829;
.label {
font-size: 12px;
width: 86px;
span {
color: #f13c3d;
}
}
.value {
width: calc(100% - 86px);
/deep/.van-field {
padding: 0;
font-size: 12px;
}
.readonly {
/deep/.van-field__control {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
.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 {
display: block;
font-size: 16px;
font-weight: 600;
color: #ffffff;
width: 100%;
height: 44px;
box-shadow: 0px 2px 6px 2px rgba(241, 60, 61, 0.1);
border-radius: 4px;
border: 1px solid #f13c3d;
margin: 16px auto 0;
}
.disabled {
box-shadow: 0px 2px 6px 2px rgba(177, 177, 177, 0.1);
border: 1px solid #b1b1b1;
}
}
</style>
<template>
<div class="serve" v-if="list.length">
<div class="box flex" @click="showModal = true">
服务
<div class="serve-text flex">
<template v-for="(i, index) in list">
<div :key="index" class="flex">
{{ i.title }}
<span v-if="index != list.length - 1">·</span>
</div>
</template>
</div>
<div class="sprite-icon icon-arrow"></div>
</div>
<serve-modal v-model="showModal" @cancel="showModal = false" :list="list" />
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'Serve',
props: {
list: {
type: Array,
default: () => []
}
},
data () {
return {
showModal: false
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang="scss">
@import '@/assets/css/crowdfunding.scss';
.box {
color: #999999;
font-size: 12px;
font-weight: 400;
border-radius: 4px;
line-height: 17px;
.serve-text {
width: 254px;
color: #2c2c2c;
margin-left: 20px;
overflow: hidden;
white-space: nowrap;
span {
margin: 0 4px;
}
}
.sprite-icon {
margin-left: auto;
}
}
</style>
<template>
<van-action-sheet v-model="showBox" @click-overlay="onCancel" @close="onCancel" title="服务说明">
<div class="content">
<template v-for="(i, index) in list">
<div :key="index" class="item">
<div class="title">{{ i.title }}</div>
<div class="value">{{ i.content }}</div>
</div>
</template>
</div>
</van-action-sheet>
</template>
<script type="text/ecmascript-6">
export default {
name: 'ServeModal',
props: {
value: Boolean,
list: {
type: Array,
default: () => []
}
},
data () {
return {
showBox: false
}
},
watch: {
value (n) {
this.showBox = n
}
},
mounted () {
},
methods: {
onCancel () {
this.$emit('cancel')
},
}
}
</script>
<style scoped lang="scss">
.van-popup--bottom.van-popup--round {
border-radius: 20px 20px 0 0;
}
/deep/.van-action-sheet__header {
line-height: 56px;
font-weight: 500;
font-size: 17px;
color: #2c2c2c;
}
.content {
margin: 0 16px;
border-top: 1px solid #e3e3e6;
height: 374px;
box-sizing: border-box;
overflow-y: scroll;
padding-bottom: 31px;
&::-webkit-scrollbar {
display: none;
}
.item {
padding: 14px 0 0 10px;
.title {
line-height: 20px;
font-size: 14px;
color: #2c2c2c;
position: relative;
&::after {
width: 4px;
height: 4px;
background: #fc5b32;
position: absolute;
top: 50%;
left: -10px;
content: '';
transform: translateY(-50%);
border-radius: 100%;
}
}
.value {
font-size: 12px;
color: #999999;
margin-top: 2px;
line-height: 17px;
}
}
}
</style>
<template>
<div class="box" v-if="evaList.length || faqList.length">
<template v-if="evaList.length">
<div class="sub-title flex" @click="to('crowdfunding.evaluate', { list: evaList, detail: detail })">
服务评价({{ evaList.length }})
<div class="all flex">
<span>全部</span>
<div class="sprite-icon icon-arrow"></div>
</div>
</div>
<evaluate-item :item="evaList[0]" :hideBorder="!faqList.length" indexType :num="1" :showAvatarNicknameFlag="detail.showAvatarNicknameFlag"></evaluate-item>
</template>
<template v-if="faqList.length">
<div class="sprite" v-if="evaList.length"></div>
<div class="sub-title flex faq-title" @click="to('crowdfunding.faq', { list: faqList })">
商品答疑({{ faqList.length }})
<div class="all flex">
<span>全部</span>
<div class="sprite-icon icon-arrow"></div>
</div>
</div>
<template v-for="(i, index) in faqList">
<FAQ-item :key="index" hideBorder indexType :item="i" v-if="index < 1"></FAQ-item>
</template>
</template>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'ShareGoods',
props: {
evaList: {
type: Array,
default: () => []
},
faqList: {
type: Array,
default: () => []
},
detail: {
type: Object,
default: () => { }
}
},
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang="scss">
@import '@/assets/css/sharegoods.scss';
.box {
border-radius: 4px;
}
.sprite {
margin-top: 14px;
}
.faq-title {
margin-bottom: 10px;
}
</style>
<template>
<div id="chat">
<div class="chatBox">
<div class="chatBox-middle">
<div class="chatInfo" id="chatInfo">
<div class="chatUser-box">
<div class="chatUser-info">
<span class="chatUser-info-text notice">
<img class="icon-notice" src="@/assets/images/icon-notice.png" />
欢迎来到直播间!
<p>{{ notifyTxt }}</p>
</span>
</div>
</div>
<div class="chatUser-box" v-for="(item, index) in messageList" :key="index">
<div class="chatUser-info">
<span class="chatUser-info-text">
<span class="chatUser-info-name">{{ item.userName }}:</span>
<span>{{ item.content }}</span>
</span>
</div>
</div>
</div>
</div>
<div class="chatBox-infoDesk" action="javascript:return true">
<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 :videoFullscreen="true" class="action" v-show="isAction && !isFocus" :isImAction="true"></action>
</div>
</div>
</div>
</template>
<script>
import { Notify } from 'vant'
import { util } from 'utils'
import { shopmallApi } from '@/api'
import IM from './im.js'
let timObj = null
const msgMaxNum = 100
export default {
name: 'Im',
data() {
return {
isFocus: false,
notifyTxt: '直播间内严禁出现违法违规、低俗、涉黄、吸烟酗酒等内容,直播期间请勿相信私下交易,诱导购买等信息,以防人身或财产损失。请大家注意财产安全,谨防网络诈骗,文明观看直播。',
messageContent: '',
messageList: []
}
},
props: {
detail: {
type: Object,
default: () => { }
},
liveDetail: {
type: Object,
default: () => {
return {
imGroupId: '',
imSdkAppId: ''
}
}
},
isAction: {
type: Boolean,
default: false
}
},
computed: {},
created() {
this.getUserSig()
this.scrollToBottom()
},
updated() {
this.scrollToBottom()
},
mounted() { },
beforeDestroy() {
timObj.quit()
},
methods: {
fixInputBeCovered({ target }) {
setTimeout(function () {
target.scrollIntoView(true)
}, 100)
},
handleInputFocus() {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.isFocus = !this.isFocus
}, 300)
},
getUserSig() {
const userInfo = util.getUserInfo()
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()
})
},
initTim() {
const userInfo = util.getUserInfo()
const imOptions = {
userID: userInfo.openid || userInfo.uuid,
userSig: this.userSig,
groupID: this.liveDetail.imGroupId,
SDKAppID: this.liveDetail.imSdkAppId,
onMessageReceived: this.onMessageReceived,
onNetStateChange: this.onNetStateChange
}
timObj = new IM(imOptions)
timObj.join(imOptions).then(res => {
// console.log('login-------')
timObj.updateMyProfile({ nick: userInfo.nickName })
})
},
// 收到消息触发
onMessageReceived(data) {
// console.log('收到消息:', data)
let msgLen = this.messageList.length
let dataLen = data.length
if (msgLen + dataLen > msgMaxNum) {
this.messageList = this.messageList.slice(msgLen - dataLen)
}
data.forEach(item => {
// 根据消息类型判断,执行不同操作
if (item.type == 'TIMTextElem') {
// 群成员发送消息
// let eleData = JSON.parse()
let eleData = {
userName: item.nick,
content: item.payload.text
}
// 获取群聊消息,消息上屏
this.updateMessageList(eleData)
}
})
},
// 网络异常处理
onNetStateChange(notify) {
Notify(notify)
},
// 更新数据push进消息列表
updateMessageList(data) {
this.messageList = [...this.messageList, data]
this.scrollToBottom()
},
// changeChatHeight(height = '230px') {
// var chatBoxDom = this.$el.querySelector('.chatBox-middle')
// chatBoxDom.style.height = height
// this.scrollToBottom()
// },
// handleFocus() {
// this.changeChatHeight('116px')
// },
//发送聊天
sendTextMessage() {
// this.changeChatHeight()
if (this.messageContent === '' || this.messageContent.trim().length === 0) {
this.messageContent = ''
return
}
// console.log(this.messageContent, '准备发咯--')
timObj.send(this.messageContent)
this.messageContent = ''
},
scrollToBottom() {
this.$nextTick(() => {
let container = this.$el.querySelector('#chatInfo')
container.scrollTop = container.scrollHeight
})
}
}
}
</script>
<style lang="scss" scoped>
html,
body {
background-color: #e8e8e8;
height: 100%;
}
#chat .chatBox {
width: 100%;
height: auto;
margin: auto 0;
border-radius: 0.625rem;
}
#chat .chatBox-middle {
width: 100%;
height: 230px;
margin: 1.25rem auto;
overflow: hidden;
}
#chat .chatBox-infoDesk {
display: flex;
margin: 0 10px 10px;
.chatBox-input {
width: 148px;
// background-color: transparent;
background-color: rgba(255, 255, 255, 0.4) !important;
border-radius: 2rem !important;
margin-right: 8px;
padding: 0 0;
color: #ffffff;
.icon-send {
width: 20px;
height: 20px;
margin-right: 10px;
}
}
.chatBox-input.focus-input {
width: 100%;
transition: width 0.5s;
.icon-send {
border-radius: 50%;
}
}
.action {
width: calc(100% - 156px);
}
}
#chat .chatInfo {
width: 100%;
height: 100%;
overflow-y: scroll;
}
#chat .chatInfo::-webkit-scrollbar {
width: 0 !important;
}
#chat .chatUser-box {
width: 100%;
margin-bottom: 3px;
display: flex;
flex-direction: row;
}
#chat .chatUser-info {
margin: 0 10px;
width: 65%;
line-height: 22px;
font-size: 12px;
}
#chat .chatUser-info-name {
color: rgb(234, 201, 36);
margin-right: 0.4rem;
font-weight: 600;
}
#chat .chatUser-info-text {
margin-top: 3px;
padding: 2px 6px;
font-size: 12px;
background: rgba(0, 0, 0, 0.3);
border-radius: 18px;
color: #ffffff;
float: left;
table-layout: fixed;
word-break: break-all;
overflow: hidden;
.icon-notice {
width: 28px;
height: 16px;
vertical-align: middle;
}
}
#chat .chatUser-info-text.notice {
padding: 2px 3px 2px 6px;
}
</style>
<style>
#chat .chatBox-infoDesk .chatBox-input .van-field__control {
/* background-color: rgba(255, 255, 255, 0.4) !important;
border-radius: 2rem !important; */
color: #ffffff;
height: 40px;
padding: 0 10px;
}
#chat .chatBox-infoDesk .van-cell::after {
border: none;
}
</style>
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2022-10-25 10:15:37
* @LastEditors: limin
* @LastEditTime: 2022-10-27 17:36:43
* @FilePath: \scrm-wx-merchant-activity\src\components\TIM\im.js
*/
// 从v2.11.2起,SDK 支持了 WebSocket,推荐接入;v2.10.2及以下版本,使用 HTTP
import TIM from 'tim-js-sdk'
import TIMUploadPlugin from 'tim-upload-plugin'
const TimOptions = {
// SDKAppID: 1400743527
}
export default class IM {
constructor(options = {}) {
this.loginResolveRejectCache = []
this.options = Object.assign({}, TimOptions, options)
this.isSDKReady = false
this.isLogin = false
this.init()
this.bindTIMEvent()
}
init() {
// 创建 SDK 实例,`TIM.create()`方法对于同一个 `SDKAppID` 只会返回同一份实例
this.tim = TIM.create({ SDKAppID: this.options.SDKAppID }) // SDK 实例通常用 tim 表示
// 设置 SDK 日志输出级别,详细分级请参见 <a href="https://web.sdk.qcloud.com/im/doc/en/SDK.html#setLogLevel">setLogLevel 接口的说明</a>
this.tim.setLogLevel(1) // 普通级别,日志量较多,接入时建议使用
// tim.setLogLevel(1); // release 级别,SDK 输出关键信息,生产环境时建议使用
// 注册腾讯云即时通信 IM 上传插件
this.tim.registerPlugin({ 'tim-upload-plugin': TIMUploadPlugin })
}
/**
* 绑定tim回调事件
*/
bindTIMEvent() {
this.tim.on(TIM.EVENT.SDK_READY, this.handleSDKReady, this)
this.tim.on(TIM.EVENT.MESSAGE_RECEIVED, this.onMessageReceived, this)
this.tim.on(TIM.EVENT.NET_STATE_CHANGE, this.onNetStateChange, this)
}
/**
* 登录
* @param {*} userID 用户唯一id
* @param {*} userSig 生成签名
* @returns
*/
login(userID, userSig) {
return new Promise((resolve, reject) => {
if (!userID) {
reject('userID is not be blank')
return null
}
if (!userSig) {
reject('userSig is not be blank')
return null
}
this.tim
.login({ userID, userSig })
.then(() => {
this.loginResolveRejectCache.push({ resolve, reject })
this.isLogin = true
return null
})
.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
*/
joinGroup(groupID, type = TIM.TYPES.GRP_AVCHATROOM) {
return new Promise((resolve, reject) => {
this.options.groupID = groupID
let promise = this.tim.joinGroup({ groupID, type })
promise
.then(function (imResponse) {
switch (imResponse.data.status) {
case TIM.TYPES.JOIN_STATUS_WAIT_APPROVAL: // Waiting to be approved by the admin
console.info('Waiting to be approved by the admin') // Profile of the group
resolve('Waiting to be approved by the admin')
break
case TIM.TYPES.JOIN_STATUS_SUCCESS: // Joined the group successfully
console.info('Joined the group successfully') // Profile of the group
resolve(imResponse.data.group)
break
case TIM.TYPES.JOIN_STATUS_ALREADY_IN_GROUP: // The user is already in the group
console.info('The user is already in the group')
resolve('The user is already in the group')
break
default:
reject(imResponse.data.status)
break
}
})
.catch(function (imError) {
console.warn('joinGroup error:', imError) // Error information
reject('joinGroup error:' + imError)
})
})
}
quitGroup(groupID) {
if (!groupID) {
throw new Error('groupID is not be blank')
}
return this.tim.quitGroup(groupID)
}
/**
* 登录并加入群聊
* @param {*} param0
* @returns
*/
join({ userID, userSig, groupID }) {
if (!userID) {
throw new Error('userID is not be blank')
}
if (!userSig) {
throw new Error('userSig is not be blank')
}
if (!groupID) {
throw new Error('groupID is not be blank')
}
return this.login(userID, userSig).then(() => this.joinGroup(groupID))
}
/**
* 退出群聊,并退出登录
*/
quit() {
return this.quitGroup(this.options.groupID).then(() => this.logout())
}
/**
* 登出
* @returns Promise
*/
logout() {
return new Promise((resolve, reject) => {
this.tim
.logout()
.then(imResponse => {
this.isSDKReady = false
this.isLogin = false
resolve(imResponse)
})
.catch(reject)
})
}
/**
* (内部)登录成功,且SDK Ready
*/
handleSDKReady() {
this.isSDKReady = true
this.loginResolveRejectCache.forEach(({ resolve }) => {
resolve({
msg: '登录成功,且SDK Ready'
})
})
}
/**
* 收到新消息回调
* @param {*} event 回调消息体
*/
onMessageReceived(event) {
this.options.onMessageReceived(event.data)
}
/**
* 网络波动回调
* @param {*} event 回调消息体
*/
onNetStateChange(event) {
// v2.5.0 起支持
// event.data.state 当前网络状态,枚举值及说明如下:
// TIM.TYPES.NET_STATE_CONNECTED - 已接入网络
// TIM.TYPES.NET_STATE_CONNECTING - 连接中。很可能遇到网络抖动,SDK 在重试。接入侧可根据此状态提示“当前网络不稳定”或“连接中”
// TIM.TYPES.NET_STATE_DISCONNECTED - 未接入网络。接入侧可根据此状态提示“当前网络不可用”。SDK 仍会继续重试,若用户网络恢复,SDK 会自动同步消息
let notify = {}
switch (event.data.state) {
case TIM.TYPES.NET_STATE_CONNECTED:
notify = { message: '已接入网络', type: 'success' }
break
case TIM.TYPES.NET_STATE_CONNECTING:
notify = { message: '连接中', type: 'warning' }
break
case TIM.TYPES.NET_STATE_DISCONNECTED:
notify = { message: '当前网络不可用', type: 'danger' }
break
default:
break
}
this.options.onNetStateChange(notify)
}
/**
* 发送一条消息
* @param {*} msg 消息内容
* @returns Promise
*/
send(msg) {
return new Promise((resolve, reject) => {
const message = this.createMessage(msg)
this.sendMessage(message)
.then(event => {
this.onMessageReceived(Object.assign({}, event, { data: [event.data.message] }))
resolve(event)
})
.catch(reject)
})
}
/**
* (内部)组装一条tim TEXT 消息体
* @param {*} msg 消息内容
* @returns 组装好的消息
*/
createMessage(msg) {
let message = this.tim.createTextAtMessage({
to: this.options.groupID,
conversationType: TIM.TYPES.CONV_GROUP,
payload: {
text: msg
}
})
return message
}
/**
* (内部)发送一条消息
* @param {*} message 组装好的tim消息内容
* @returns Promise
*/
sendMessage(message) {
return this.tim.sendMessage(message)
}
}
<template>
<canvas
:id="canvasId"
class="create"
></canvas>
</template>
<script type="text/ecmascript-6">
import Draw from '@/utils/draw'
export default {
name: 'createOrderImg',
props: {
canvasId: {
type: String,
default: 'canvas'
},
orderInfo: {
type: Object,
default: () => { }
},
},
watch: {
orderInfo (n) {
if (n) this.drawOrderImg()
}
},
data () {
return {
ctx: null,
}
},
mounted () {
},
methods: {
drawOrderImg (callBack) {
let {
plateNo,
payPrice,
userName,
goodsName,
orderNumber,
orderStatus,
createdDate,
vehicleBrandName,
vehicleShapeName,
formContentFirst,
vehicleSeriesName,
formDescribeFirst,
formContentSecond,
formDescribeSecond,
vehicleSubBrandName,
} = this.orderInfo
this.ctx = document.getElementById(this.canvasId)
let valueX = 95,
labelX = 17,
fontSize = 14,
valueEndX = 320 - fontSize / 2,
textBaseline = 'top',
canvasWidth = 337,
canvasHeight = 561,
carText = '',
labelList = ['姓名:'],
spacing = 0,
textYList = [],
labelEndX = 80,
lineNum = 2,
lineHeight = 24,
valueList = [userName]
const draw = new Draw(this, {
width: canvasWidth,
height: canvasHeight,
// pixelRatio: 1
})
if (plateNo) {
labelList.push('车牌号:')
valueList.push(plateNo)
}
if (vehicleBrandName) {
carText = `${vehicleBrandName || ''} ${vehicleSubBrandName || ''} ${vehicleSeriesName || ''} ${vehicleShapeName || ''}`
labelList.push('品牌车型:')
valueList.push(carText)
}
labelList = [...labelList, '商品名称:', '支付时间:']
valueList = [...valueList, goodsName, new Date(createdDate).format('yyyy年M月d日 hh:mm:ss')]
if (orderStatus != 10 && orderNumber) {
labelList.push('订单号:')
valueList.push(orderNumber)
}
if (formContentFirst) {
labelList.push(formDescribeFirst)
valueList.push(formContentFirst)
}
if (formContentSecond) {
labelList.push(formDescribeSecond)
valueList.push(formContentSecond)
}
labelList.push('支付定金')
valueList.push(`${payPrice}元`)
labelList.map((e, index) => {
if (e == '商品名称:' && draw.getTextWidth(carText, fontSize) > valueEndX - valueX) spacing = lineHeight
if ((e == formDescribeSecond && draw.getTextWidth(formContentFirst, fontSize) > valueEndX - valueX) || e === formDescribeSecond && (draw.getTextWidth(formDescribeFirst, fontSize) > labelEndX - labelX)) spacing = lineHeight * 2
if (index == labelList.length - 1) textYList.push(493)
else textYList.push(index * 32 + 109 + spacing)
})
const imgName = {
8: '-2',
10: '-3'
}[orderStatus]
draw.drawImages({
url: require(`@/assets/images/order-bg${imgName || ''}.png`),
x: 0,
y: 0,
width: canvasWidth,
height: canvasHeight,
}, () => {
if (orderStatus == 10) {
draw.drawText({
text: '订单号',
x: labelX - 1,
y: 24,
color: '#282829',
fontSize,
textBaseline
})
draw.drawText({
text: orderNumber || '',
x: labelX - 1,
y: 54,
color: '#282829',
fontSize,
textBaseline
})
}
labelList && labelList.length > 0 && (labelList.map((e, index) => {
let y = textYList[index] + fontSize / 2
let label = {
text: e,
x: labelX,
y,
color: '#999',
fontSize,
textBaseline
}
let value = {
text: valueList[index],
x: valueX,
y,
color: '#282829',
fontSize,
textBaseline,
width: valueEndX
}
if (e === '商品名称:') {
value.color = '#FC5B32'
// value.border = '#FEBAA8'
// value.background = '#FFF9F7'
}
if ((formDescribeFirst && e === formDescribeFirst) || (formDescribeSecond && e === formDescribeSecond) || (e === '品牌车型:')) {
value.lineNum = lineNum
value.lineHeight = lineHeight
if ((formDescribeFirst && e === formDescribeFirst) || (formDescribeSecond && e === formDescribeSecond)) {
label.lineNum = lineNum
label.lineHeight = lineHeight
label.width = labelEndX
label.lastFont = ':'
}
}
if (e === '支付定金') {
label.color = '#282829'
value.color = orderStatus == 8 ? '#3162E6' : '#F13C3D'
value.fontWeight = '600'
value.fontSize = 18
value.y = textYList[index] + 5
}
draw.drawText(label)
console.log('---------------', e, value)
draw.drawText(value)
}))
draw.drawLine({
startX: labelX,
startY: 478,
endX: 320,
endY: 478,
width: 1,
color: '#F1F1F1'
})
let url = this.ctx.toDataURL('image/png')
this.$emit('success', url)
if (callBack) callBack(url)
})
}
}
}
</script>
<style scoped lang="scss">
.create {
position: fixed;
top: -1000%;
left: -1000%;
}
</style>
<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
import Vue from 'vue'
const componentsFiles = require.context(`./`, true, /.vue$/)
componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default
Vue.component(component.name, component)
})
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-08 16:55:43
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
const environment = process.env.VUE_APP_ENV || 'production'
let config = require('./env.' + environment)
module.exports = config
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2022-09-23 16:48:50
*/
// 本地环境配置
module.exports = {
title: '加载中...',
request: {
baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
errId_logout_value: '21',
logout_function: 'reLogin',
code_message_map: {}
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
miniprogramInfo: {
username: 'gh_e983752bf563',
envVersion: 'trial',
},
// shopmall_id: "gh_e983752bf563", //嘀加
appid: 'wx1cf40dc91c28a7fd', //公众号appid 云商 wx1cf40dc91c28a7fd test02 wx56bed167ad463f70
sign: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
format: 'json',
locale: 'zh_CN',
source: 'scrm-main',
v: '1.0.0'
},
vconsole: true
}
module.exports = {
title: ' ',
request: {
// baseURL: 'http://ghwx.cgacar.com/scrm-wechat' // 生产
baseURL: 'http://cim.chinagrandauto.com/scrm-wechat' // 生产
// baseURL: 'http://cim.chinagrandauto.com' // 生产
},
APPID: 'xxx',
APPSECRET: 'xxx',
cdn: 'https://www.xxx.cn/static'
}
\ No newline at end of file \ No newline at end of file
module.exports = {
title: ' ',
request: {
baseURL: 'http://xxxxx' // 项目地址
},
APPID: 'xxx',
APPSECRET: 'xxx',
cdn: 'https://www.xxx.cn/static'
}
\ No newline at end of file \ No newline at end of file
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-01-14 17:31:13
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
let config = require('./conf.js')
let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) {
if (isEnv) {
let { request } = config
Object.assign(request, { timeout })
return Promise.resolve(config)
}
// return window.fetch('https://oss-config.glsx.com.cn/mock/618cb9331072f92988f05a23/wx/config', {}).then(res => res.json()) //生产
return window.fetch('https://oss-config.dev.glsx.com.cn/mock/618cb9331072f92988f05a23/wx/register', {}).then(res => res.json()) //测试
}
export const cfg = {
install(vue, config) {
vue.prototype.$config = config
}
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2022-09-23 14:40:32
* @LastEditors: limin
* @LastEditTime: 2022-09-23 18:49:16
* @FilePath: \scrm-wx-merchant-activity\src\env.js
*/
const SDK = {
WX: '//res.wx.qq.com/open/js/jweixin-1.2.0.js',
WXWORK: '//open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js'
}
function __load() {
const sdks = window.ENV.ISWXWORK ? Object.values(SDK) : [SDK.WX]
for (let i = 0, j = sdks.length; i < j; i++) {
const sdksrc = sdks[i]
var oScript = __creatScript()
oScript.src = sdksrc
document.head.appendChild(oScript)
}
}
function __setEnvVar() {
const ua = navigator.userAgent
const ISWXWORK = Boolean(ua.match(/MicroMessenger/i)) && Boolean(ua.match(/wxwork/i))
const ISIOS = /(iPhone|iPad|iPod|iOS)/i.test(ua)
const ISMiniprogram = window.__wxjs_environment === 'miniprogram'
const ISMOBILE = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(ua.toLowerCase()) || (!ua.toLowerCase().match('iphone') && navigator.maxTouchPoints > 1)
window.ENV = {
ISIOS,
ISWXWORK,
ISMiniprogram,
ISMOBILE
}
}
function __creatScript() {
return document.createElement('script')
}
export const loadSdk = () => {
__setEnvVar()
__load()
}
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-29 15:35:47
*/
// 兼容 IE
// https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#babelpolyfill
// import 'core-js/stable'
// import 'regenerator-runtime/runtime'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import api from './api'
import { fetchConfig, cfg } from '@/config'
import '@/assets/css/index.scss'
import { bus, tools, store as local, util } from './utils'
import './utils/util'
import 'components'
import { components } from '@/plugins/vant'
import { VueJsonp } from 'vue-jsonp'
Vue.use(VueJsonp)
// 接入sentry
import * as Sentry from '@sentry/vue'
import { BrowserTracing } from '@sentry/tracing'
// 实例化
process.env.NODE_ENV === 'production' &&
Sentry.init({
Vue,
dsn: 'https://f62fc7a4b3dc4889916e0f5dbd86db1d@sentry.glsx.com.cn/28',
integrations: [
new BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ['localhost', 'my-site-url.com', /^\//]
})
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
logErrors: true
// "send-default-pii": true
})
/* eslint-disable */
components.forEach(component => Vue.use(component))
Vue.prototype.api = api
Vue.prototype.bus = bus
Vue.prototype.tools = tools
Vue.prototype.local = local
Vue.prototype.to = function (name, params) {
if (name === -1) {
router.go(-1)
return
}
router.push({ name, params })
}
// 移动端适配 rem
// import 'lib-flexible/flexible.js'
import VConsole from 'vconsole'
const ua = navigator.userAgent.toLowerCase()
let body = document.getElementsByTagName('head')[0],
WXJDK = document.createElement('script'),
WWJDK = document.createElement('script'),
ISWXWORK = false,
IsIOS = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent),
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?${Date.now()}`
if (Boolean(ua.match(/MicroMessenger/i)) && Boolean(ua.match(/wxwork/i))) {
//是否企微
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'
ISWXWORK = true
}
body.appendChild(WXJDK)
if (WWJDK.src) body.appendChild(WWJDK)
window.$ISWXWORK = ISWXWORK
util.setLocalStorage('is_wxwork', ISWXWORK)
Vue.prototype.ISWXWORK = ISWXWORK
Vue.prototype.ISMOBILE = util.isMobileDevice()
window.$IsIOS = IsIOS
Vue.prototype.IsIOS = IsIOS
window.$ISMiniprogram = ISMiniprogram
Vue.prototype.ISMiniprogram = ISMiniprogram
const isMock = ['prod', 'production'].includes(process.env.NODE_ENV)
fetchConfig(!isMock).then(res => {
const APPID = util.getAppId()
if (APPID != res.appid) util.clearSessionId()
// 从配置服务器获取动态配置
// 设置 js中可以访问 $cdn
Vue.use(cfg)
window.$fetchConfig = res
if (res.vconsole) new VConsole()
/**登录过期 重新登录 */
window.reLogin = () => {
console.log('重新登录')
util.clearSessionId()
store.dispatch('navigation')
}
window.vm = new Vue({
el: '#app',
router,
store,
render: h => h(App)
})
})
import Vue from 'vue'
import { components } from './vant'
components.forEach(component => Vue.use(component))
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-23 11:44:59
*/
// 按需全局引入 vant组件
import { Button, List, Cell, Tabbar, TabbarItem, NavBar, Search, ActionSheet, CellGroup, Image as VanImage, Tag, Field, Stepper, Divider, Step, Steps, NoticeBar, RadioGroup, Radio, Uploader, Tab, Tabs, DropdownMenu, DropdownItem, Grid, GridItem, Popup, Calendar, Cascader, Checkbox, CheckboxGroup, Notify, Icon, Empty, PullRefresh, Picker, Dialog, ShareSheet, Overlay, loading, SwipeCell, Swipe, SwipeItem, IndexBar, IndexAnchor } from 'vant'
export const components = [Button, List, Cell, Tabbar, TabbarItem, NavBar, Search, ActionSheet, CellGroup, VanImage, Tag, Field, Stepper, Divider, Step, Steps, NoticeBar, RadioGroup, Radio, Uploader, Tab, Tabs, DropdownMenu, DropdownItem, Grid, GridItem, Popup, Calendar, Cascader, Checkbox, CheckboxGroup, Notify, Icon, Empty, PullRefresh, Picker, Dialog, ShareSheet, Overlay, loading, SwipeCell, Swipe, SwipeItem, IndexBar, IndexAnchor]
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-09 17:11:43
*/
import router from './router'
import { keeps } from './routes'
export const keepAlives = keeps
export default router
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) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router)
const router = createRouter()
function createRouter() {
return new Router({
// mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath
base: process.env.BASE_URL,
scrollBehavior: function (to, from, savedPosition) {
return savedPosition || { x: 0, y: 0 }
},
routes
})
}
// http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-attachment-activity/
router.beforeEach((to, from, next) => {
console.log(router.history.pending.fullPath)
/* 路由发生变化修改页面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)) {
store.state.app.showWindow = true
store.dispatch('registerHttp')
} else store.dispatch('navigation')
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
export function resetRouter() {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
export default router
const pages = {
login: [
{
name: 'index',
meta: {
title: '邀请注册',
keepAlive: true,
backgroundColor: '#F7F7F7'
}
},
]
}
let routes = [
{
path: '/',
redirect: '/login/index'
}
]
const keepAlives = []
Object.keys(pages).map(parent => {
pages[parent].map(val => {
let childrenPath = `${parent}/${val.name}`
let { meta } = val
const path = `/${val.name == 'index/index' ? parent : childrenPath}`
const name = val.name == 'index/index' ? parent : childrenPath.replace(/\//g, '.')
if (meta && meta.keepAlive) keepAlives.push(name)
let route = {
component: resolve => require([`views/${childrenPath}.vue`], resolve),
path,
name,
meta
}
routes.push(route)
})
})
export const keeps = keepAlives
export default routes
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!