Commit 675da014 by zhangxw

预发布

bug
1 parent 9dffd164
...@@ -80,6 +80,13 @@ class ActivityApi { ...@@ -80,6 +80,13 @@ class ActivityApi {
...data ...data
}) })
} }
// 获取活动短链接
getActivityUrl(data) {
return api.post({
method: `scrm.api.assistant.activity.poster`,
...data
})
}
} }
export default ActivityApi export default ActivityApi
\ No newline at end of file \ No newline at end of file
// components/sharePopup/sharePopup.js // components/sharePopup/sharePopup.js
import {imgUrlMixin} from '~/mixins/index' import {imgUrlMixin} from '~/mixins/index'
import index_const from "~/pages/tab/index/index_const" import index_const from "~/pages/tab/index/index_const"
import { IMG_URL } from '~/utils/constantData'
import Draw from '~/utils/Draw' import Draw from '~/utils/Draw'
Component({ Component({
/** /**
...@@ -46,13 +45,19 @@ Component({ ...@@ -46,13 +45,19 @@ Component({
*/ */
data: { data: {
USERINFO: wx.$storage.get('userInfo'), USERINFO: wx.$storage.get('userInfo'),
activityTypList: index_const.data.activityTypList activityTypList: index_const.data.activityTypList,
imageLoaded: false
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
imageLoaded(event) {
if (event.detail.width) {
this.setData({imageLoaded: true})
}
},
async init(n) { async init(n) {
wx.$api.showLoading() wx.$api.showLoading()
const drawfun = new Draw({ const drawfun = new Draw({
...@@ -77,8 +82,8 @@ Component({ ...@@ -77,8 +82,8 @@ Component({
width: 20, width: 20,
height: 20, height: 20,
borderRadius: 40, borderRadius: 40,
// url: `${userInfo.sta_avatarUrl && userInfo.sta_avatarUrl.indexOf('https://thirdwx.qlogo.cn') > -1 ? userInfo.sta_avatarUrl : userInfo.weChatAvatarUrl && userInfo.weChatAvatarUrl.indexOf('https://thirdwx.qlogo.cn') > -1 ? userInfo.weChatAvatarUrl : this.data.IMGURL}default_avatar.png` url: userInfo.sta_avatarUrl && userInfo.sta_avatarUrl.indexOf('https://thirdwx.qlogo.cn') > -1 ? userInfo.sta_avatarUrl : userInfo.weChatAvatarUrl && userInfo.weChatAvatarUrl.indexOf('https://thirdwx.qlogo.cn') > -1 ? userInfo.weChatAvatarUrl : `${this.data.IMGURL}default_avatar.png`
url: `${this.data.IMGURL}default_avatar.png` // url: `${this.data.IMGURL}default_avatar.png`
}, },
{ {
x: 16, x: 16,
...@@ -128,6 +133,7 @@ Component({ ...@@ -128,6 +133,7 @@ Component({
}, },
], ],
}) })
console.log(res)
wx.hideLoading() wx.hideLoading()
this.setData({ this.setData({
poster: res.path poster: res.path
...@@ -135,6 +141,10 @@ Component({ ...@@ -135,6 +141,10 @@ Component({
}, },
close() { close() {
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
this.setData({
imageLoaded: false,
poster: ""
})
thisPage.setData({ thisPage.setData({
sharePopupData: { sharePopupData: {
showSharePopup: false showSharePopup: false
......
<!--components/sharePopup/sharePopup.wxml--> <!--components/sharePopup/sharePopup.wxml-->
<view class="share-popup" wx:if="{{data.showSharePopup}}"> <wxs module="fn">
<view class="share-popup-bg" /> var time = function(e, num) {
return getDate().getTime()
}
module.exports.time = time
</wxs>
<view class="share-popup" wx:if="{{poster}}">
<view class="share-popup-bg" wx:if="{{imageLoaded}}"/>
<view class="share-box" style="transform: translate(-50%, calc(-50% + {{navHeight / 2}}px));"> <view class="share-box" style="transform: translate(-50%, calc(-50% + {{navHeight / 2}}px));">
<view class="close-box"> <view class="close-box" wx:if="{{imageLoaded}}">
<view class="close_btn" bindtap="close"> <view class="close_btn" bindtap="close">
<image webp src="{{IMGURL}}popup_close_btn.png"></image> <image webp src="{{IMGURL}}popup_close_btn.png"></image>
</view> </view>
</view> </view>
<view class="share-popup-content" style="max-height: {{postersBoxHeight}}px;"> <view class="share-popup-content" style="max-height: {{postersBoxHeight}}px;">
<image style="height: {{postersImageHeight + 76}}px;" src="{{poster}}"></image> <image style="height: {{postersImageHeight + 76}}px;" src="{{poster}}" bindload="imageLoaded"></image>
</view> </view>
<view class="btn-box"> <view class="btn-box" wx:if="{{imageLoaded}}">
<view class="btn" bind:tap="saveImage">保存至相册</view> <view class="btn" bind:tap="saveImage">保存至相册</view>
<view class="tip">提示:这是您的专属活动海报,请保存至手机相册后转发给客户微信,系统将自动记录成交订单归属,并发放积分奖励!</view> <view class="tip">提示:这是您的专属活动海报,请保存至手机相册后转发给客户微信,系统将自动记录成交订单归属,并发放积分奖励!</view>
</view> </view>
......
...@@ -77,7 +77,15 @@ Page({ ...@@ -77,7 +77,15 @@ Page({
}) })
} }
if (val.materialType == 4) { // 链接 if (val.materialType == 4) { // 链接
res.linkUrl = this.filterJumpUrl(res.activityId) // res.linkUrl = this.filterJumpUrl(res.activityId)
// 获取活动专属短链接
ActivityApi.getActivityUrl({activityId: res.activityId}).then(e => {
res.linkUrl = e.activityUrl
this.setData({
detailInfo: res,
materialTypeArr: typeArr
})
})
} }
}) })
this.setData({ this.setData({
...@@ -147,12 +155,12 @@ Page({ ...@@ -147,12 +155,12 @@ Page({
} }
}, },
// 复制文案 // 复制文案及专属链接
copyText() { copyText() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let { textContent } = this.data.detailInfo let { textContent, linkUrl } = this.data.detailInfo
wx.setClipboardData({ wx.setClipboardData({
data: textContent, data: linkUrl ? `${textContent}\n活动链接:${linkUrl}` : textContent,
success () { success () {
wx.hideLoading() wx.hideLoading()
resolve() resolve()
......
...@@ -449,7 +449,7 @@ class Draw { ...@@ -449,7 +449,7 @@ class Draw {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const [a, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64data) || [] const [a, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64data) || []
if (!format) reject(new Error('ERROR_BASE64SRC_PARSE')) if (!format) reject(new Error('ERROR_BASE64SRC_PARSE'))
const filePath = `${wx.env.USER_DATA_PATH}/tmp_base64src.${format}` const filePath = `${wx.env.USER_DATA_PATH}/tmp_base64src${new Date().getTime()}.${format}`
const buffer = wx.base64ToArrayBuffer(bodyData) const buffer = wx.base64ToArrayBuffer(bodyData)
wx.getFileSystemManager().writeFile({ wx.getFileSystemManager().writeFile({
filePath, filePath,
......
const target = ['ip', 'dev', 'uat', 'prod'] const target = ['ip', 'dev', 'uat', 'prod']
/** /**
* *
0本地 0本地
...@@ -16,6 +17,7 @@ const secretKey = { ...@@ -16,6 +17,7 @@ const secretKey = {
} }
}, },
uat: { uat: {
sso: { sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89', appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b' secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
...@@ -36,7 +38,8 @@ const domain = { ...@@ -36,7 +38,8 @@ const domain = {
/**登录: 192.168.2.3:8315 /**登录: 192.168.2.3:8315
商城: 192.168.2.3:8558 */ 商城: 192.168.2.3:8558 */
dev: 'https://scrm.dev.glsx.com.cn', dev: 'https://scrm.dev.glsx.com.cn',
uat: 'https://scrm.test.glsx.com.cn', // uat: 'https://scrm.test.glsx.com.cn',
uat: 'https://scrm.beta.glsx.com.cn',
prod: 'https://scrm.cgacar.com' prod: 'https://scrm.cgacar.com'
}[target[index]] }[target[index]]
...@@ -65,6 +68,7 @@ const defaultMerchantId = { ...@@ -65,6 +68,7 @@ const defaultMerchantId = {
ip: '44184606', ip: '44184606',
dev: '44184606', dev: '44184606',
uat: '44184606', uat: '44184606',
prod: '44189923' prod: '44189923'
}[target[index]] }[target[index]]
module.exports = { module.exports = {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!