Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
group-buy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
group-buy-ui
Commits
fd1e0d8e
Commit
fd1e0d8e
authored
Oct 09, 2021
by
beisir
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/group-buy' of git.quantgroup.cn:ui/group-buy-ui into feat/group-buy
parents
d2c8f077
cf969ed1
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
78 deletions
+71
-78
sharePic.vue
src/components/sharePic.vue
+46
-25
main.js
src/main.js
+2
-1
routes.js
src/router/routes.js
+0
-8
addressManage.vue
src/views/address/addressManage.vue
+1
-3
groupDescInfo.vue
src/views/goodsDetail/components/groupDescInfo.vue
+14
-9
index.vue
src/views/goodsDetail/index.vue
+1
-1
createOrder.vue
src/views/order/createOrder.vue
+7
-4
share-test.vue
src/views/test/share-test.vue
+0
-27
No files found.
src/components/sharePic.vue
View file @
fd1e0d8e
...
@@ -167,48 +167,69 @@ export default {
...
@@ -167,48 +167,69 @@ export default {
}
}
return
n
;
return
n
;
},
},
async
prepare
(
rawData
)
{
//
async prepare(rawData) {
this
.
sharePicData
=
rawData
;
//
this.sharePicData = rawData;
this
.
handleAvator
(
rawData
);
// this.handleAvator(rawData);
// // 将每个字符套入行内标签,用于解决canvas fillText的不换行问题
// let skuName = '';
// const originSkuName = rawData.skuName || '';
// for (let i = 0; i
<
originSkuName
.
length
;
i
++
)
{
// skuName += `
<
span
>
$
{
originSkuName
[
i
]}
<
/span>`
;
// }
// this.skuName = skuName;
// const [endTimeYMD, endTimeHMS = ''] = (rawData.endTime && rawData.endTime.split(' ')) || [];
// if (endTimeYMD) {
// const day = new Date(endTimeYMD);
// this.endTime = `${day.getMonth() + 1}月${day.getDate()}日 ${endTimeHMS}`;
// }
// const [qrcodeUrl] = await groupBuyApi.getQrcodeUrl(rawData);
// this.qrcodeUrl = qrcodeUrl;
// },
async
createAndUploadPic
(
sharePicData
)
{
this
.
$store
.
dispatch
(
'
change_loading_pic
'
,
true
);
this
.
sharePicData
=
sharePicData
;
this
.
handleAvator
(
sharePicData
);
// 将每个字符套入行内标签,用于解决canvas fillText的不换行问题
// 将每个字符套入行内标签,用于解决canvas fillText的不换行问题
let
skuName
=
''
;
let
skuName
=
''
;
const
originSkuName
=
raw
Data
.
skuName
||
''
;
const
originSkuName
=
sharePic
Data
.
skuName
||
''
;
for
(
let
i
=
0
;
i
<
originSkuName
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
originSkuName
.
length
;
i
++
)
{
skuName
+=
`<span>
${
originSkuName
[
i
]}
</span>`
;
skuName
+=
`<span>
${
originSkuName
[
i
]}
</span>`
;
}
}
this
.
skuName
=
skuName
;
this
.
skuName
=
skuName
;
const
[
endTimeYMD
,
endTimeHMS
=
''
]
=
(
rawData
.
endTime
&&
rawData
.
endTime
.
split
(
'
'
))
||
[];
const
[
endTimeYMD
,
endTimeHMS
=
''
]
=
(
sharePicData
.
endTime
&&
sharePicData
.
endTime
.
split
(
'
'
))
||
[];
if
(
endTimeYMD
)
{
if
(
endTimeYMD
)
{
const
day
=
new
Date
(
endTimeYMD
);
const
day
=
new
Date
(
endTimeYMD
);
this
.
endTime
=
`
${
day
.
getMonth
()
+
1
}
月
${
day
.
getDate
()}
日
${
endTimeHMS
}
`
;
this
.
endTime
=
`
${
day
.
getMonth
()
+
1
}
月
${
day
.
getDate
()}
日
${
endTimeHMS
}
`
;
}
}
const
[
qrcodeUrl
]
=
await
groupBuyApi
.
getQrcodeUrl
(
raw
Data
);
const
[
qrcodeUrl
]
=
await
groupBuyApi
.
getQrcodeUrl
(
sharePic
Data
);
this
.
qrcodeUrl
=
qrcodeUrl
;
this
.
qrcodeUrl
=
qrcodeUrl
;
},
async
createAndUploadPic
(
sharePicData
)
{
this
.
$store
.
dispatch
(
'
change_loading_pic
'
,
true
);
await
this
.
prepare
(
sharePicData
);
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
html2canvas
(
this
.
$refs
.
sharePic
,
{
setTimeout
(()
=>
{
width
:
1080
,
html2canvas
(
this
.
$refs
.
sharePic
,
{
height
:
1920
,
width
:
1080
,
useCORS
:
true
,
height
:
1920
,
scale
:
1
,
useCORS
:
true
,
allowTaint
:
false
scale
:
1
,
})
allowTaint
:
false
.
then
(
canvas
=>
{
canvas
.
name
=
`
${
this
.
randomString
()}
.jpeg`
;
canvas
.
toBlob
(
blob
=>
this
.
uploadPic
(
blob
),
'
image/jpeg
'
,
0.85
);
})
})
.
catch
(
error
=>
{
.
then
(
canvas
=>
{
this
.
errorHandler
(
error
);
canvas
.
name
=
`
${
this
.
randomString
()}
.jpeg`
;
});
canvas
.
toBlob
(
blob
=>
this
.
uploadPic
(
blob
),
'
image/jpeg
'
,
0.85
);
})
.
catch
(
error
=>
{
this
.
errorHandler
(
error
);
});
},
300
);
});
});
},
},
// 上传海报到七牛,成功后触发outputPicUr事件,参数是七牛文件地址
// 上传海报到七牛,成功后触发outputPicUr事件,参数是七牛文件地址
...
...
src/main.js
View file @
fd1e0d8e
...
@@ -12,7 +12,8 @@ import Raven from 'raven-js';
...
@@ -12,7 +12,8 @@ import Raven from 'raven-js';
import
RavenVue
from
'
raven-js/plugins/vue
'
;
import
RavenVue
from
'
raven-js/plugins/vue
'
;
import
{
release
}
from
'
../.sentryclirc
'
;
import
{
release
}
from
'
../.sentryclirc
'
;
import
lazyload
from
'
@qg/cherry-ui/src/lazyload/index
'
;
import
lazyload
from
'
@qg/cherry-ui/src/lazyload/index
'
;
if
(
process
.
env
.
SENTRY_ENV
!==
'
test
'
&&
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
import
'
intersection-observer
'
;
if
(
process
.
env
.
SENTRY_ENV
!==
'
test
'
&&
process
.
env
.
NODE_ENV
===
'
production
'
)
{
Raven
.
config
(
'
//8d1b2a5f74bb42ad806e52a11b1173f2@sentry.q-gp.com/80
'
,
{
Raven
.
config
(
'
//8d1b2a5f74bb42ad806e52a11b1173f2@sentry.q-gp.com/80
'
,
{
release
,
release
,
environment
:
process
.
env
.
NODE_ENV
environment
:
process
.
env
.
NODE_ENV
...
...
src/router/routes.js
View file @
fd1e0d8e
...
@@ -13,14 +13,6 @@ export default [
...
@@ -13,14 +13,6 @@ export default [
},
},
component
:
()
=>
import
(
'
../components/error
'
)
component
:
()
=>
import
(
'
../components/error
'
)
},
},
{
path
:
'
/share-test
'
,
name
:
'
share-test
'
,
meta
:
{
title
:
'
出错了
'
},
component
:
()
=>
import
(
'
../views/test/share-test.vue
'
)
},
{
{
path
:
'
*
'
,
path
:
'
*
'
,
name
:
'
notFound
'
,
name
:
'
notFound
'
,
...
...
src/views/address/addressManage.vue
View file @
fd1e0d8e
...
@@ -13,8 +13,6 @@
...
@@ -13,8 +13,6 @@
v-model=
"address.receiverPhoneNo"
v-model=
"address.receiverPhoneNo"
class=
"address-input"
class=
"address-input"
name=
"手机号码"
name=
"手机号码"
type=
"tel"
max-length=
"11"
label=
"手机号码"
label=
"手机号码"
placeholder=
"请输入收货人手机号码"
placeholder=
"请输入收货人手机号码"
/>
/>
...
@@ -99,8 +97,8 @@ export default {
...
@@ -99,8 +97,8 @@ export default {
firstGroupShare
();
firstGroupShare
();
this
.
type
=
this
.
$route
.
query
.
type
||
''
;
this
.
type
=
this
.
$route
.
query
.
type
||
''
;
this
.
order
=
this
.
$route
.
query
.
type
||
false
;
this
.
order
=
this
.
$route
.
query
.
type
||
false
;
console
.
log
(
this
.
order
);
if
(
this
.
type
===
'
edit
'
)
{
if
(
this
.
type
===
'
edit
'
)
{
console
.
log
(
JSON
.
stringify
(
this
.
$route
.
params
));
const
data
=
{
...
this
.
$route
.
params
.
editAddress
};
const
data
=
{
...
this
.
$route
.
params
.
editAddress
};
data
.
addrFullName
=
data
.
addrFullName
data
.
addrFullName
=
data
.
addrFullName
.
substring
(
0
,
data
.
addrFullName
.
length
-
data
.
detail
.
length
)
.
substring
(
0
,
data
.
addrFullName
.
length
-
data
.
detail
.
length
)
...
...
src/views/goodsDetail/components/groupDescInfo.vue
View file @
fd1e0d8e
...
@@ -104,22 +104,27 @@ export default {
...
@@ -104,22 +104,27 @@ export default {
mounted
()
{
mounted
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
if
(
this
.
$refs
.
buttonArea
)
{
if
(
this
.
$refs
.
buttonArea
)
{
this
.
observer
=
new
IntersectionObserver
(
entries
=>
{
if
(
IntersectionObserver
)
{
entries
.
forEach
(
item
=>
{
this
.
observer
&&
if
(
item
.
intersectionRatio
==
0
)
{
this
.
observer
.
unobserve
&&
this
.
$emit
(
'
changeButtonVisible
'
,
true
);
this
.
observer
.
unobserve
(
this
.
$refs
.
buttonArea
);
}
else
{
this
.
observer
=
new
IntersectionObserver
(
entries
=>
{
this
.
$emit
(
'
changeButtonVisible
'
,
false
);
entries
.
forEach
(
item
=>
{
}
if
(
item
.
intersectionRatio
==
0
)
{
this
.
$emit
(
'
changeButtonVisible
'
,
true
);
}
else
{
this
.
$emit
(
'
changeButtonVisible
'
,
false
);
}
});
});
});
}
);
}
this
.
observer
.
USE_MUTATION_OBSERVER
=
false
;
this
.
observer
.
USE_MUTATION_OBSERVER
=
false
;
this
.
observer
.
observe
(
this
.
$refs
.
buttonArea
);
this
.
observer
.
observe
(
this
.
$refs
.
buttonArea
);
}
}
});
});
},
},
beforeDestroy
()
{
beforeDestroy
()
{
if
(
this
.
$refs
.
buttonArea
)
{
if
(
this
.
$refs
.
buttonArea
&&
this
.
observer
)
{
this
.
observer
.
unobserve
(
this
.
$refs
.
buttonArea
);
this
.
observer
.
unobserve
(
this
.
$refs
.
buttonArea
);
}
}
},
},
...
...
src/views/goodsDetail/index.vue
View file @
fd1e0d8e
...
@@ -345,7 +345,7 @@ export default {
...
@@ -345,7 +345,7 @@ export default {
delete
checkParams
.
activityHundredGroupId
;
delete
checkParams
.
activityHundredGroupId
;
}
}
const
[
checkStatus
]
=
await
goods
.
checkGroupBuyCreateOrder
(
checkParams
);
const
[
checkStatus
]
=
await
goods
.
checkGroupBuyCreateOrder
(
checkParams
);
if
(
!
checkStatus
.
verifyResult
)
{
if
(
checkStatus
&&
!
checkStatus
.
verifyResult
)
{
// 校验是否允许开团或者参团
// 校验是否允许开团或者参团
this
.
$dialog
({
this
.
$dialog
({
message
:
checkStatus
.
failedReason
||
''
,
message
:
checkStatus
.
failedReason
||
''
,
...
...
src/views/order/createOrder.vue
View file @
fd1e0d8e
...
@@ -173,10 +173,13 @@ export default {
...
@@ -173,10 +173,13 @@ export default {
invalidSkuList
,
invalidSkuList
,
shopSkuList
:
[]
shopSkuList
:
[]
};
};
shopSkuList
.
forEach
(
item
=>
{
if
(
!
item
)
return
;
if
(
shopSkuList
)
{
orderInfo
.
shopSkuList
=
[...
orderInfo
.
shopSkuList
,
...
item
.
skuList
];
shopSkuList
.
forEach
(
item
=>
{
});
if
(
!
item
)
return
;
orderInfo
.
shopSkuList
=
[...
orderInfo
.
shopSkuList
,
...
item
.
skuList
];
});
}
console
.
log
(
orderInfo
);
console
.
log
(
orderInfo
);
this
.
$set
(
this
,
'
orderInfo
'
,
orderInfo
);
this
.
$set
(
this
,
'
orderInfo
'
,
orderInfo
);
this
.
isOutBuy
=
false
;
this
.
isOutBuy
=
false
;
...
...
src/views/test/share-test.vue
deleted
100644 → 0
View file @
d2c8f077
<
template
>
<button
style=
"width: 80%; height: 35px; background:#f00"
@
click=
"share"
>
分享
</button>
</
template
>
<
script
>
import
Bridge
from
'
@qg/js-bridge
'
;
export
default
{
methods
:
{
share
()
{
const
nativeBridge
=
new
Bridge
();
const
data
=
{
event
:
'
showShareView
'
,
data
:
{
platform
:
[
'
weChat
'
,
'
timeLine
'
,
'
QQ
'
,
'
QQZone
'
,
'
CopyLink
'
,
'
GeneratePoster
'
],
//依次分别是微信、朋友圈、QQ好友、QQ空间、复制链接
shareDic
:
{
title
:
'
aaaa
'
,
desc
:
'
bbbb
'
,
link
:
`https://www.baidu.com`
,
// 页面地址
imgUrl
:
'
https://kdspstatic.q-gp.com/FnPUaThQoK23qZjhXTG9C8XopI4y
'
,
// 图片地址
posterUrl
:
'
https://kdspstatic.q-gp.com/FnPUaThQoK23qZjhXTG9C8XopI4y
'
// 海报地址
}
}
};
nativeBridge
.
showShareView
(
data
);
}
}
};
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment