Commit ad3acb25 by 前端

Merge branch 'chenwq_dev_2.0.0' into 'master'

修改样式

See merge request !5
2 parents 6834c7a7 5e21b1f3
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
module.exports = { module.exports = {
envVersion: 'trial', envVersion: 'trial',
request: { request: {
baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址, baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
......
const discountType = {
1: '满减',
2: '折扣',
3: '代金',
4: '兑换',
5: '购车代金',
6: '商品折扣',
7: '会员服务'
}
export default {
data() {
return {
discountType,
discountEnum: {
1: '满减券',
2: '折扣券',
3: '代金券',
4: '兑换券',
5: '购车代金券',
6: '商品折扣券',
7: '会员服务'
},
}
},
mounted() {
window.$discountType = discountType
},
methods: {
}
}
\ No newline at end of file \ No newline at end of file
import shareMixin from './shareMixin'
import pageMixin from './pageMixin'
import discountTypeMixin from './discountTypeMixin'
export { export {
shareMixin,
pageMixin,
discountTypeMixin
} }
\ No newline at end of file \ No newline at end of file
export default {
data () {
return {
tabIndex: 0,
pageNum: 1,
list: [],
total: 0,
flag: false,
updata: new Date().getTime()
}
},
mounted () {
let { tabIndex } = this.getQuery()
if (tabIndex) {
this.tabIndex = Number(tabIndex)
this.updata = new Date().getTime()
this.init()
return
}
if (this.$route.meta.isTab) this.init()
},
methods: {
init () {
this.showLoading()
this.getList(this.pageNum)
},
change (index) {
this.tabIndex = index
this.clearData()
},
clearData () {
this.flag = false
this.pageNum = 1
this.list = []
if (this.$refs.scrollView) this.$refs.scrollView.finished = false
this.init()
},
onReachBottom () {
let { total, pageNum, list } = this
this.$refs.scrollView.loading = false
if (list.length == total) {
this.$refs.scrollView.finished = true
return
}
if (Math.ceil(total / 10) > pageNum) {
this.pageNum = pageNum + 1
this.init()
} else {
this.$refs.scrollView.finished = true
}
}
}
}
\ No newline at end of file \ No newline at end of file
import { couponApi, wxConfig } from '@/api'
export default {
data () {
return {
entry: 'normal'
}
},
mounted () {
if (this.$route.meta.isTab || this.$route.meta.isIndex) this.wxInit()
},
methods: {
wxInit () {
let _this = this
wxConfig.init(['shareAppMessage', 'sendChatMessage', 'getCurExternalContact', 'getContext']).then(() => {
wxConfig.getContext().then(({ entry }) => {
_this.$parent.entry = entry
_this.entry = entry
})
})
},
showShareModel (i = {}) {
let {
tabIndex,
$route: { name }
} = this
if (name != 'merchant') {
if (tabIndex == 0 && i.remainAmount < 1) return
if (tabIndex == 1 && i.residueAmount < 1) return
}
wxConfig
.getCurExternalContact()
.then(res => {
console.log('当前外部联系人', res)
i.is_contact = res
this.sendMessage(i)
})
.catch(() => {
this.sendMessage(i)
})
},
sendMessage (i) {
const { shopmall_appid } = window.$fetchConfig
let { merchantId, merchantName, userName, sapCode } = this.getLocalStorage('dj_scrm_userInfo')
let { tabIndex, entry } = this
let { name } = this.$route
let { userId, id, couponName, activityName, packageName, goodsName, goodsImage, discountType } = i
let query = `merchantId=${merchantId}`
if (sapCode) query = `${query}&storeCode=${sapCode}`
const entryType = entry != 'normal'
this.showLoading()
if (name === 'coupon') { /**卡券 */
let desc = '您的专属服务顾问为您发来了优惠券,请点击领取~'
let imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-yh-10004.png'
if (tabIndex == 0) {
let path = 'packageMine/pages/boutique/gift/gift'
let query = `id=${id}&userId=${userId}&employName=${this.toUnicode(i.employeeName)}&${query}`
if (entryType) this.sendChatMessage({
appid: shopmall_appid,
title: couponName,
imgUrl,
page: `/${path}.html?${query}`
})
else wxConfig
.createMiniprogramUrlLink({
path,
query,
appId: shopmall_appid
})
.then(url => {
this.shareAppMessage(url, desc, couponName, imgUrl)
})
} else {
let path = 'packageMall/pages/coupon/coupon'
query = `couponId=${id}&${query}&issueName=${this.toUnicode(userName)}&issueDate=${new Date().getTime()}`
this.couponShare(i, url => {
if (entryType) this.sendChatMessage({
appid: shopmall_appid,
title: `${couponName}(${window.$discountType[discountType]}券)`,
imgUrl,
page: `/${path}.html?${query}`
})
else wxConfig
.createMiniprogramUrlLink({
path,
query,
appId: shopmall_appid
})
.then(url => {
this.shareAppMessage(url, desc, couponName, imgUrl)
})
})
}
} else if (name === 'activity') { /**活动 */
if (tabIndex == 0) {
let imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-ms-10004.png'
let path = 'packageMall/pages/detail/detail'
query = `isActivity=true&id=${id}&${query}`
if (entryType) this.sendChatMessage({
appid: shopmall_appid,
title: activityName,
imgUrl,
page: `/${path}.html?${query}`
})
else wxConfig
.createMiniprogramUrlLink({
path,
query,
appId: shopmall_appid
})
.then(url => {
this.shareAppMessage(url, '您有一个秒杀活动可参加', activityName, imgUrl)
})
} else {
/**直播 */
}
} else { /**店铺 */
if (tabIndex == 0) {
let path = 'pages/tab/index/index'
const imgUrl = 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/activity/miniprogram-cover.jpg'
if (entryType) this.sendChatMessage({
appid: shopmall_appid,
title: merchantName,
imgUrl,
page: `/${path}.html?${query}`
})
else wxConfig
.createMiniprogramUrlLink({
path,
query,
appId: shopmall_appid
})
.then(url => {
this.shareAppMessage(url, '', merchantName, imgUrl)
})
} else if (tabIndex == 1) {
let path = 'packageEquity/pages/package/package'
let imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-qy-10004.png'
query = `id=${id}&${query}`
if (entryType) this.sendChatMessage({
appid: shopmall_appid,
title: packageName,
imgUrl,
page: `/${path}.html?${query}`
})
else wxConfig
.createMiniprogramUrlLink({
path,
query,
appId: shopmall_appid
})
.then(url => {
this.shareAppMessage(url, '您的专属客服顾问为您发来了会员套餐,点击查看哦', packageName, imgUrl)
})
} else {
let path = 'packageMall/pages/detail/detail'
query = `id=${id}&${query}`
if (entryType) this.sendChatMessage({
appid: shopmall_appid,
title: goodsName,
imgUrl: goodsImage,
page: `/${path}.html?${query}`
})
else wxConfig
.createMiniprogramUrlLink({
path,
query,
appId: shopmall_appid
})
.then(url => {
this.shareAppMessage(url, '', goodsName, goodsImage)
})
}
}
},
sendChatMessage (params) {
wxConfig
.sendChatMessage({
msgtype: 'miniprogram',
miniprogram: params,
enterChat: false
})
.then(() => {
this.hideLoading()
})
.catch(err => {
console.log('当前会话', err)
this.hideLoading()
})
},
shareAppMessage (link, desc, title, imgUrl) {
wxConfig
.shareAppMessage({
title,
desc,
link,
imgUrl
})
.then(() => {
this.hideLoading()
})
.catch(() => {
this.hideLoading()
})
},
toUnicode (chineseStr = '') {
let unicodeStr = ''
for (let i = 0, iLength = chineseStr.length; i < iLength; i++) {
unicodeStr += '@' + chineseStr.charCodeAt(i).toString(16)
}
return unicodeStr
},
couponShare (item, callBack) {
let { is_contact, id } = item
let obj = {
couponId: id,
shareType: 1
}
if (is_contact) obj.userList = [
{
userId: is_contact
}
]
else obj.shareType = 0
couponApi.getCouponShared(obj).then(res => {
callBack(res.url)
})
}
}
}
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
class="sop-content" class="sop-content"
v-if="editForm.additionalType == '4'" v-if="editForm.additionalType == '4'"
> >
<div class="text">{{ editForm.wwMomentContent.text }}</div> <div class="text">{{ editForm.wwMomentContent.text || ''}}</div>
<div <div
ref="wechatMutiImg" ref="wechatMutiImg"
v-if="['1', '2'].includes(editForm.wwMomentContent.contentType)" v-if="[1,2].includes(editForm.wwMomentContent.contentType)"
class="wechat-muti-img" class="wechat-muti-img"
> >
<img <img
...@@ -35,6 +35,16 @@ ...@@ -35,6 +35,16 @@
:src="item" :src="item"
/> />
</div> </div>
<div
v-else
class="wechat-muti-video"
>
<video
:src="editForm.wwMomentContent.videoContent.videoUrl"
controls
></video>
</div>
<div></div>
</div> </div>
<!-- 短链(素材,活动,优惠券) --> <!-- 短链(素材,活动,优惠券) -->
<div <div
...@@ -192,7 +202,7 @@ export default { ...@@ -192,7 +202,7 @@ export default {
sopApi.getSopDetail(taskId).then(res => { sopApi.getSopDetail(taskId).then(res => {
console.log(res) console.log(res)
this.hideLoading() this.hideLoading()
if(!res) return if (!res) return
this.flag = true this.flag = true
this.editForm = res this.editForm = res
/// 朋友圈模板,单/多图 /// 朋友圈模板,单/多图
...@@ -241,8 +251,9 @@ export default { ...@@ -241,8 +251,9 @@ export default {
} }
}) })
}) })
this.showLoading() // this.showLoading()
wxConfig.shareToExternalMoments(obj).then(res => { wxConfig.shareToExternalMoments(obj)
.then(res => {
this.hideLoading() this.hideLoading()
this.showToast('发送成功') this.showToast('发送成功')
sopApi.successFinished(taskId) sopApi.successFinished(taskId)
...@@ -292,7 +303,7 @@ export default { ...@@ -292,7 +303,7 @@ export default {
font-size: 12px; font-size: 12px;
color: #666666; color: #666666;
padding: 16px 0; padding: 16px 0;
.text{ .text {
word-break: break-all; word-break: break-all;
} }
.wechat-muti-img { .wechat-muti-img {
...@@ -306,6 +317,15 @@ export default { ...@@ -306,6 +317,15 @@ export default {
margin-right: 0; margin-right: 0;
} }
} }
.wechat-muti-video {
width: 122px;
height: 218px;
background: #d8d8d8;
video {
width: 100%;
height: 100%;
}
}
.sop-url { .sop-url {
height: 68px; height: 68px;
line-height: 68px; line-height: 68px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!