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;}
...@@ -20,3 +20,5 @@ ...@@ -20,3 +20,5 @@
.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;} .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,24 +100,46 @@ export default { ...@@ -99,24 +100,46 @@ 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 (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({ if (entryType) this.sendChatMessage({
appid: shopmall_appid, appid: shopmall_appid,
title, title,
...@@ -132,6 +155,22 @@ export default { ...@@ -132,6 +155,22 @@ export default {
title, title,
imgUrl: params.imgUrl 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,7 +264,76 @@ export default { ...@@ -236,7 +264,76 @@ export default {
font-size: 12px; font-size: 12px;
position: relative; position: relative;
} }
.type { .type-1 {
.item {
height: 100px;
display: flex;
box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.08);
padding: 10px;
.sprite-icon {
border-radius: 4px;
overflow: hidden;
margin-right: 11px;
}
.info {
display: flex;
justify-content: space-between;
flex-direction: column;
max-width: 70%;
.title {
font-weight: 500;
font-size: 14px;
color: #282829;
}
.decoration {
color: #b9babb;
width: 160px;
}
.btn {
color: #b1b1b3;
margin-left: 0;
margin-right: auto;
font-size: 12px;
padding: 0 10px;
height: 24px;
border-radius: 39px;
border: 1px solid #b3b3b3;
box-sizing: border-box;
background-color: #fff;
}
}
.btn {
right: 10px;
z-index: 2;
}
.sign-icon-class {
position: absolute;
right: 0;
top: 0;
width: 68px;
height: 22px;
background: #e2ebf7;
border-radius: 0px 4px 0px 4px;
font-size: 12px;
font-weight: 400;
color: #3975c6;
}
.icon_wrap {
position: absolute;
right: 10px;
bottom: 12px;
width: 33px;
height: 24px;
background: #3975c6;
border-radius: 12px;
.icon {
width: 13px;
height: 13px;
}
}
}
}
.type-2 {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
...@@ -290,71 +387,70 @@ export default { ...@@ -290,71 +387,70 @@ export default {
} }
} }
} }
.type-2 { .type-3 {
.item { .item {
height: 100px; height: 175px;
display: flex; background: #ffffff;
box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.08);
padding: 10px;
.sprite-icon {
border-radius: 4px; border-radius: 4px;
overflow: hidden; box-sizing: border-box;
margin-right: 11px; padding: 8px 8px 0;
}
.info {
display: flex; display: flex;
justify-content: space-between;
flex-direction: column; flex-direction: column;
max-width: 70%; .top {
.title { height: 120px;
font-weight: 500; .icon {
width: 120px;
margin-right: 8px;
}
.text {
width: calc(100% - 128px);
height: 100%;
position: relative;
.name {
font-size: 14px; font-size: 14px;
font-weight: 500;
color: #282829; color: #282829;
line-height: 20px;
} }
.decoration { .time {
color: #b9babb; display: inline-flex;
width: 160px; 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;
} }
.btn { .price {
color: #b1b1b3; position: absolute;
margin-left: 0; left: 0;
margin-right: auto; bottom: 0;
font-size: 16px;
font-weight: 500;
color: #3975c6;
.old {
font-size: 12px; font-size: 12px;
padding: 0 10px; font-weight: 400;
height: 24px; color: #3a3a3a;
border-radius: 39px;
border: 1px solid #b3b3b3;
box-sizing: border-box;
background-color: #fff;
} }
} }
.btn {
right: 10px;
z-index: 2;
} }
.sign-icon-class {
position: absolute;
right: 0;
top: 0;
width: 68px;
height: 22px;
background: #e2ebf7;
border-radius: 0px 4px 0px 4px;
font-size: 12px;
font-weight: 400;
color: #3975c6;
} }
.icon_wrap { .bottom {
position: absolute; height: 40px;
right: 10px; font-size: 12px;
bottom: 12px; color: #a9a9a9;
margin-top: auto;
.share {
margin-left: auto;
width: 33px; width: 33px;
height: 24px; height: 24px;
background: #3975c6; background: #3975c6;
box-shadow: 0px 2px 6px 2px rgba(57, 117, 198, 0.11);
border-radius: 12px; border-radius: 12px;
.icon {
width: 13px;
height: 13px;
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!