Commit 25eb131e by 李伟康

修改分享

1 parent c1f73084
......@@ -81,5 +81,17 @@ export default {
url,
data
})
}
},
/**查询众筹活动 */
getCrowdfundingList (currentPage) {
let data = {
method: 'scrm.api.shopmall.wechat.crowdfunding.activity.page',
pageSize: 10,
currentPage
}
return window.$HTTP({
url,
data
})
},
}
.sprite-icon { background-image: url(../images/sprite.png);background-size: 319px 250px;}
.icon-close { width: 12px; height: 12px; background-position: -231px -180px;}
.icon-close { width: 12px; height: 12px; background-position: -80px -217px;}
.icon-coupon-0 { width: 32px; height: 32px; background-position: -270px -113px;}
.icon-coupon-1 { width: 32px; height: 32px; background-position: -270px -155px;}
.icon-coupon-lose { width: 70px; height: 70px; background-position: -180px -90px;}
......@@ -7,9 +7,9 @@
.icon-coupon-tips { width: 49px; height: 49px; background-position: -270px 0px;}
.icon-coupon { width: 80px; height: 80px; background-position: 0px 0px;}
.icon-discount { width: 80px; height: 80px; background-position: -90px 0px;}
.icon-down { width: 12px; height: 12px; background-position: -80px -217px;}
.icon-down { width: 12px; height: 12px; background-position: -102px -217px;}
.icon-exchange { width: 80px; height: 80px; background-position: 0px -90px;}
.icon-gift-add { width: 12px; height: 12px; background-position: -102px -217px;}
.icon-gift-add { width: 12px; height: 12px; background-position: -124px -217px;}
.icon-gift-bg { width: 80px; height: 80px; background-position: -90px -90px;}
.icon-gift-create { width: 16px; height: 16px; background-position: -300px -227px;}
.icon-gift-del { width: 18px; height: 18px; background-position: -300px -197px;}
......@@ -19,4 +19,6 @@
.icon-poster-close { width: 20px; height: 20px; background-position: -270px -197px;}
.icon-scan { width: 16px; height: 16px; background-position: -205px -180px;}
.icon-share { width: 20px; height: 20px; background-position: -270px -227px;}
.icon-vip { width: 80px; height: 80px; background-position: -180px 0px;}
\ No newline at end of file
.icon-vip { width: 80px; height: 80px; background-position: -180px 0px;}
.icon-activity-time { width: 12px; height: 12px; background-position: -146px -217px;}
.icon-share-white { width: 13px; height: 13px; background-position: -231px -180px;}
\ No newline at end of file

128 KB | W: | H:

129 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
......@@ -38,5 +38,5 @@ module.exports = {
source: "scrm-main",
v: "1.0.0",
},
vconsole: true
vconsole: false
}
\ No newline at end of file
......@@ -13,7 +13,7 @@ export default {
let { tabIndex } = this.getQuery()
if (tabIndex) {
this.tabIndex = Number(tabIndex)
this.updata = new Date().getTime()
// this.updata = new Date().getTime()
this.init()
return
}
......
......@@ -49,11 +49,11 @@ export default {
})
},
sendMessage (i) {
const { shopmall_appid } = window.$fetchConfig
const { shopmall_appid, request: { baseURL } } = window.$fetchConfig
let { merchantId, merchantName, userName, sapCode, uuid } = this.getLocalStorage('dj_scrm_userInfo')
let { tabIndex, entry } = this
let { name } = this.$route
let { userId, id, couponName, activityName, packageName, goodsName, goodsImage, discountType } = i
let { userId, id, couponName, activityName, packageName, goodsName, goodsImage, discountType, shareType } = i
let query = `merchantId=${merchantId}&shareTime=${Date.now()}`
if (sapCode) query = `${query}&storeCode=${sapCode}`
const entryType = entry != 'normal'
......@@ -74,12 +74,13 @@ export default {
desc: '',
imgUrl: 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/activity/miniprogram-cover.jpg'
}
}[name]
let title = {
'coupon': couponName,
'activity': activityName,
'merchant': merchantName
}[name]
}[name],
title = {
'coupon': couponName,
'activity': activityName,
'merchant': merchantName
}[name],
h5Params = {}
if (name === 'coupon') { /**卡券 */
if (tabIndex == 0) {
query = `id=${id}&userId=${userId}&employName=${this.toUnicode(i.employeeName)}&${query}`
......@@ -99,39 +100,77 @@ export default {
}
if (name === 'merchant') { /**店铺 */
switch (+tabIndex) {
case 2:
case 1:
params.path = 'packageEquity/pages/package/package'
params.imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-qy-10004.png'
params.desc = '您的专属客服顾问为您发来了会员套餐,点击查看哦'
query = `id=${id}&${query}&shareStaffName=${this.toUnicode(userName)}&shareStaffUuid=${uuid}`
title = packageName
break;
case 3:
case 2:
params.path = 'packageMall/pages/detail/detail'
params.imgUrl = goodsImage
params.desc = ''
query = `id=${id}&${query}&shareStaffName=${this.toUnicode(userName)}&shareStaffUuid=${uuid}`
title = goodsName
break
case 3:
h5Params = {
imgUrl: i.activityImg,
desc: '',
title: i.activityName,
link: `${baseURL}/dj-scrm-wx-work-main-lwk/#/?id=123`
// link: `${baseURL}/scrm-wx-merchant-activity/`
}
break
default:
break;
}
}
if (entryType) this.sendChatMessage({
appid: shopmall_appid,
title,
imgUrl: params.imgUrl,
page: `/${params.path}.html?${query}`
})
else this.shareAppMessage({
path: params.path,
query,
appId: shopmall_appid
}, {
desc: params.desc,
title,
imgUrl: params.imgUrl
})
if (shareType == 'h5') {
console.log(h5Params)
if (entryType) this.sendH5(h5Params)
else wxConfig
.shareAppMessage(h5Params)
.then(() => {
this.hideLoading()
})
.catch(() => {
this.hideLoading()
})
}
else {
if (entryType) this.sendChatMessage({
appid: shopmall_appid,
title,
imgUrl: params.imgUrl,
page: `/${params.path}.html?${query}`
})
else this.shareAppMessage({
path: params.path,
query,
appId: shopmall_appid
}, {
desc: params.desc,
title,
imgUrl: params.imgUrl
})
}
},
sendH5 (params) {
wxConfig
.sendChatMessage({
msgtype: 'news',
news: params,
enterChat: false
})
.then(() => {
this.hideLoading()
})
.catch(err => {
console.log('当前会话', err)
this.hideLoading()
})
},
sendChatMessage (params) {
wxConfig
......
......@@ -9,7 +9,7 @@
:updata="updata"
></tab>
<div
v-if="tabIndex == 2&&merchantModel==2"
v-if="tabIndex == 1&&merchantModel==2"
class="secondary-tab"
>
<div class="tab-btn">
......@@ -44,18 +44,41 @@
@ReachBottom="onReachBottom"
ref="scrollView"
>
<div :class="[`type${tabIndex == 2 ? '-2' :''}`] ">
<div :class="[`type-${tabIndex}`] ">
<template v-for="(i, index) in list">
<div
:key="index"
class="item"
>
<template v-if="tabIndex == 1">
<div>
xx
<template v-if="tabIndex == 3">
<div class="top flex">
<img
:src="i.activityImg"
class="icon"
/>
<div class="text">
<div class="name">{{i.activityName}}</div>
<div class="time flex">
<div class="sprite-icon icon-activity-time"></div>
{{new Date(i.startTime).format('yyyy/M/d')}}-{{new Date(i.endTime).format('yyyy/M/d')}}
</div>
<div class="price">
¥{{i.activityPrice}}
<div class="old">活动前¥{{i.price}}</div>
</div>
</div>
</div>
<div class="bottom flex">
库存:{{i.goodsStock}}
<div
class="share text-center"
@click="showShareModel(i)"
>
<div class="sprite-icon icon-share-white"></div>
</div>
</div>
</template>
<template v-else-if="tabIndex == 2">
<template v-else-if="tabIndex == 1">
<div class="sprite-icon icon-vip"></div>
<div class="info">
<div>
......@@ -136,7 +159,7 @@
<script type="text/ecmascript-6">
import { shareMixin, pageMixin } from '@/mixins'
import { shopmallApi, equityApi } from '@/api'
const tabList = ['我的店铺', '门店活动', '会员套餐', '门店商品']
const tabList = ['我的店铺', '会员套餐', '门店商品', '门店活动']
const SEARCHTAB = ['全部', '门店', '集团']
export default {
name: 'merchant',
......@@ -163,9 +186,14 @@ export default {
this.hideLoading()
return
}
let API = tabIndex == 2 ? equityApi : shopmallApi
let target = tabIndex == 2 ? 'getEquityList' : 'getGoodsList'
let API = tabIndex == 1 ? equityApi : shopmallApi
let target = {
1: 'getEquityList',
2: 'getGoodsList',
3: 'getCrowdfundingList'
}[tabIndex]
API[target](pageNum, activeTab).then(res => {
if (tabIndex == 3) res.list && res.list.length && (res.list.map(e => e.shareType = 'h5'))
this.flag = true
this.list = list.concat(res.list)
this.total = res.total
......@@ -182,7 +210,7 @@ export default {
this.flag = false
this.list = []
this.getList(this.pageNum)
}
},
}
}
</script>
......@@ -236,61 +264,7 @@ export default {
font-size: 12px;
position: relative;
}
.type {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.item {
width: 164px;
height: 229px;
box-shadow: 0px 4px 8px 0px rgba(224, 224, 224, 0.5);
position: relative;
.icon {
height: 120px;
}
.info {
height: calc(100% - 120px);
box-sizing: border-box;
padding: 12px 8px 10px;
display: flex;
justify-content: space-between;
flex-direction: column;
position: relative;
.name {
color: #3a3a3a;
line-height: 20px;
height: 40px;
}
.stock {
font-size: 12px;
color: #a9a9a9;
}
.price {
color: var(--themeColor);
font-size: 0;
align-items: baseline;
letter-spacing: -0.5px;
.activity {
font-size: 8px;
}
.unit {
font-size: 10px;
}
.num {
font-size: 16px;
font-weight: 500;
// font-family:;
}
}
.icon-goods-share {
position: absolute;
bottom: 10px;
right: 12px;
}
}
}
}
.type-2 {
.type-1 {
.item {
height: 100px;
display: flex;
......@@ -359,6 +333,128 @@ export default {
}
}
}
.type-2 {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.item {
width: 164px;
height: 229px;
box-shadow: 0px 4px 8px 0px rgba(224, 224, 224, 0.5);
position: relative;
.icon {
height: 120px;
}
.info {
height: calc(100% - 120px);
box-sizing: border-box;
padding: 12px 8px 10px;
display: flex;
justify-content: space-between;
flex-direction: column;
position: relative;
.name {
color: #3a3a3a;
line-height: 20px;
height: 40px;
}
.stock {
font-size: 12px;
color: #a9a9a9;
}
.price {
color: var(--themeColor);
font-size: 0;
align-items: baseline;
letter-spacing: -0.5px;
.activity {
font-size: 8px;
}
.unit {
font-size: 10px;
}
.num {
font-size: 16px;
font-weight: 500;
// font-family:;
}
}
.icon-goods-share {
position: absolute;
bottom: 10px;
right: 12px;
}
}
}
}
.type-3 {
.item {
height: 175px;
background: #ffffff;
border-radius: 4px;
box-sizing: border-box;
padding: 8px 8px 0;
display: flex;
flex-direction: column;
.top {
height: 120px;
.icon {
width: 120px;
margin-right: 8px;
}
.text {
width: calc(100% - 128px);
height: 100%;
position: relative;
.name {
font-size: 14px;
font-weight: 500;
color: #282829;
line-height: 20px;
}
.time {
display: inline-flex;
height: 16px;
background: #fff4f4;
border-radius: 2px;
border: 1px solid #ffe8e6;
margin-top: 3px;
font-size: 10px;
font-weight: 500;
color: #fc5b32;
padding: 0 3px;
}
.price {
position: absolute;
left: 0;
bottom: 0;
font-size: 16px;
font-weight: 500;
color: #3975c6;
.old {
font-size: 12px;
font-weight: 400;
color: #3a3a3a;
}
}
}
}
.bottom {
height: 40px;
font-size: 12px;
color: #a9a9a9;
margin-top: auto;
.share {
margin-left: auto;
width: 33px;
height: 24px;
background: #3975c6;
box-shadow: 0px 2px 6px 2px rgba(57, 117, 198, 0.11);
border-radius: 12px;
}
}
}
}
}
.bg-box {
width: 347px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!