Commit 25eb131e by 李伟康

修改分享

1 parent c1f73084
...@@ -81,5 +81,17 @@ export default { ...@@ -81,5 +81,17 @@ export default {
url, url,
data 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;} .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-0 { width: 32px; height: 32px; background-position: -270px -113px;}
.icon-coupon-1 { width: 32px; height: 32px; background-position: -270px -155px;} .icon-coupon-1 { width: 32px; height: 32px; background-position: -270px -155px;}
.icon-coupon-lose { width: 70px; height: 70px; background-position: -180px -90px;} .icon-coupon-lose { width: 70px; height: 70px; background-position: -180px -90px;}
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
.icon-coupon-tips { width: 49px; height: 49px; background-position: -270px 0px;} .icon-coupon-tips { width: 49px; height: 49px; background-position: -270px 0px;}
.icon-coupon { width: 80px; height: 80px; background-position: 0px 0px;} .icon-coupon { width: 80px; height: 80px; background-position: 0px 0px;}
.icon-discount { width: 80px; height: 80px; background-position: -90px 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-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-bg { width: 80px; height: 80px; background-position: -90px -90px;}
.icon-gift-create { width: 16px; height: 16px; background-position: -300px -227px;} .icon-gift-create { width: 16px; height: 16px; background-position: -300px -227px;}
.icon-gift-del { width: 18px; height: 18px; background-position: -300px -197px;} .icon-gift-del { width: 18px; height: 18px; background-position: -300px -197px;}
...@@ -19,4 +19,6 @@ ...@@ -19,4 +19,6 @@
.icon-poster-close { width: 20px; height: 20px; background-position: -270px -197px;} .icon-poster-close { width: 20px; height: 20px; background-position: -270px -197px;}
.icon-scan { width: 16px; height: 16px; background-position: -205px -180px;} .icon-scan { width: 16px; height: 16px; background-position: -205px -180px;}
.icon-share { width: 20px; height: 20px; background-position: -270px -227px;} .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 \ 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 \ 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 = { ...@@ -38,5 +38,5 @@ module.exports = {
source: "scrm-main", source: "scrm-main",
v: "1.0.0", v: "1.0.0",
}, },
vconsole: true vconsole: false
} }
\ No newline at end of file \ No newline at end of file
...@@ -13,7 +13,7 @@ export default { ...@@ -13,7 +13,7 @@ export default {
let { tabIndex } = this.getQuery() let { tabIndex } = this.getQuery()
if (tabIndex) { if (tabIndex) {
this.tabIndex = Number(tabIndex) this.tabIndex = Number(tabIndex)
this.updata = new Date().getTime() // this.updata = new Date().getTime()
this.init() this.init()
return return
} }
......
...@@ -49,11 +49,11 @@ export default { ...@@ -49,11 +49,11 @@ export default {
}) })
}, },
sendMessage (i) { 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 { merchantId, merchantName, userName, sapCode, uuid } = this.getLocalStorage('dj_scrm_userInfo')
let { tabIndex, entry } = this let { tabIndex, entry } = this
let { name } = this.$route 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()}` let query = `merchantId=${merchantId}&shareTime=${Date.now()}`
if (sapCode) query = `${query}&storeCode=${sapCode}` if (sapCode) query = `${query}&storeCode=${sapCode}`
const entryType = entry != 'normal' const entryType = entry != 'normal'
...@@ -74,12 +74,13 @@ export default { ...@@ -74,12 +74,13 @@ export default {
desc: '', desc: '',
imgUrl: 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/activity/miniprogram-cover.jpg' imgUrl: 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/activity/miniprogram-cover.jpg'
} }
}[name] }[name],
let title = { title = {
'coupon': couponName, 'coupon': couponName,
'activity': activityName, 'activity': activityName,
'merchant': merchantName 'merchant': merchantName
}[name] }[name],
h5Params = {}
if (name === 'coupon') { /**卡券 */ if (name === 'coupon') { /**卡券 */
if (tabIndex == 0) { if (tabIndex == 0) {
query = `id=${id}&userId=${userId}&employName=${this.toUnicode(i.employeeName)}&${query}` query = `id=${id}&userId=${userId}&employName=${this.toUnicode(i.employeeName)}&${query}`
...@@ -99,39 +100,77 @@ export default { ...@@ -99,39 +100,77 @@ export default {
} }
if (name === 'merchant') { /**店铺 */ if (name === 'merchant') { /**店铺 */
switch (+tabIndex) { switch (+tabIndex) {
case 2: case 1:
params.path = 'packageEquity/pages/package/package' params.path = 'packageEquity/pages/package/package'
params.imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-qy-10004.png' params.imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-qy-10004.png'
params.desc = '您的专属客服顾问为您发来了会员套餐,点击查看哦' params.desc = '您的专属客服顾问为您发来了会员套餐,点击查看哦'
query = `id=${id}&${query}&shareStaffName=${this.toUnicode(userName)}&shareStaffUuid=${uuid}` query = `id=${id}&${query}&shareStaffName=${this.toUnicode(userName)}&shareStaffUuid=${uuid}`
title = packageName title = packageName
break; break;
case 3: case 2:
params.path = 'packageMall/pages/detail/detail' params.path = 'packageMall/pages/detail/detail'
params.imgUrl = goodsImage params.imgUrl = goodsImage
params.desc = '' params.desc = ''
query = `id=${id}&${query}&shareStaffName=${this.toUnicode(userName)}&shareStaffUuid=${uuid}` query = `id=${id}&${query}&shareStaffName=${this.toUnicode(userName)}&shareStaffUuid=${uuid}`
title = goodsName title = goodsName
break 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: default:
break; break;
} }
} }
if (entryType) this.sendChatMessage({ if (shareType == 'h5') {
appid: shopmall_appid, console.log(h5Params)
title, if (entryType) this.sendH5(h5Params)
imgUrl: params.imgUrl, else wxConfig
page: `/${params.path}.html?${query}` .shareAppMessage(h5Params)
}) .then(() => {
else this.shareAppMessage({ this.hideLoading()
path: params.path, })
query, .catch(() => {
appId: shopmall_appid this.hideLoading()
}, { })
desc: params.desc, }
title, else {
imgUrl: params.imgUrl 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) { sendChatMessage (params) {
wxConfig wxConfig
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
:updata="updata" :updata="updata"
></tab> ></tab>
<div <div
v-if="tabIndex == 2&&merchantModel==2" v-if="tabIndex == 1&&merchantModel==2"
class="secondary-tab" class="secondary-tab"
> >
<div class="tab-btn"> <div class="tab-btn">
...@@ -44,18 +44,41 @@ ...@@ -44,18 +44,41 @@
@ReachBottom="onReachBottom" @ReachBottom="onReachBottom"
ref="scrollView" ref="scrollView"
> >
<div :class="[`type${tabIndex == 2 ? '-2' :''}`] "> <div :class="[`type-${tabIndex}`] ">
<template v-for="(i, index) in list"> <template v-for="(i, index) in list">
<div <div
:key="index" :key="index"
class="item" class="item"
> >
<template v-if="tabIndex == 1"> <template v-if="tabIndex == 3">
<div> <div class="top flex">
xx <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> </div>
</template> </template>
<template v-else-if="tabIndex == 2"> <template v-else-if="tabIndex == 1">
<div class="sprite-icon icon-vip"></div> <div class="sprite-icon icon-vip"></div>
<div class="info"> <div class="info">
<div> <div>
...@@ -136,7 +159,7 @@ ...@@ -136,7 +159,7 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import { shareMixin, pageMixin } from '@/mixins' import { shareMixin, pageMixin } from '@/mixins'
import { shopmallApi, equityApi } from '@/api' import { shopmallApi, equityApi } from '@/api'
const tabList = ['我的店铺', '门店活动', '会员套餐', '门店商品'] const tabList = ['我的店铺', '会员套餐', '门店商品', '门店活动']
const SEARCHTAB = ['全部', '门店', '集团'] const SEARCHTAB = ['全部', '门店', '集团']
export default { export default {
name: 'merchant', name: 'merchant',
...@@ -163,9 +186,14 @@ export default { ...@@ -163,9 +186,14 @@ export default {
this.hideLoading() this.hideLoading()
return return
} }
let API = tabIndex == 2 ? equityApi : shopmallApi let API = tabIndex == 1 ? equityApi : shopmallApi
let target = tabIndex == 2 ? 'getEquityList' : 'getGoodsList' let target = {
1: 'getEquityList',
2: 'getGoodsList',
3: 'getCrowdfundingList'
}[tabIndex]
API[target](pageNum, activeTab).then(res => { 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.flag = true
this.list = list.concat(res.list) this.list = list.concat(res.list)
this.total = res.total this.total = res.total
...@@ -182,7 +210,7 @@ export default { ...@@ -182,7 +210,7 @@ export default {
this.flag = false this.flag = false
this.list = [] this.list = []
this.getList(this.pageNum) this.getList(this.pageNum)
} },
} }
} }
</script> </script>
...@@ -236,61 +264,7 @@ export default { ...@@ -236,61 +264,7 @@ export default {
font-size: 12px; font-size: 12px;
position: relative; position: relative;
} }
.type { .type-1 {
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 {
.item { .item {
height: 100px; height: 100px;
display: flex; display: flex;
...@@ -359,6 +333,128 @@ export default { ...@@ -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 { .bg-box {
width: 347px; width: 347px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!