Commit 728c8a60 by 张立顺

bugfix

1 parent 9f0a0a1e
/** /**
* 拓客户,看线索接口 * 拓客户,看线索接口
*/ */
import api from "~/utils/request/request"; import api from '~/utils/request/request'
const serverApi = { const serverApi = {
// 拓客户 // 拓客户
productByscene: "scrm.api.busassistant.activity.findSceneProductStatus", productByscene: 'scrm.api.busassistant.activity.findSceneProductStatus',
// 看线索 // 看线索
unread: "scrm.api.busassistant.clue.unread", //获取未读线索数量 unread: 'scrm.api.busassistant.clue.unread', //获取未读线索数量
page: "scrm.api.busassistant.clue.page", //分页查询线索列表 page: 'scrm.api.busassistant.clue.page', //分页查询线索列表
read: "scrm.api.busassistant.clue.read", //标记线索已读 read: 'scrm.api.busassistant.clue.read', //标记线索已读
tag: "scrm.api.busassistant.clue.tag", //线索标记意向客户 tag: 'scrm.api.busassistant.clue.tag', //线索标记意向客户
}; battleMessage: 'scrm.api.busassistant.message.battleMessage' //获取最新战报消息
}
// 拓客户 // 拓客户
const productBysceneApi = (data) => { const productBysceneApi = data => {
return api.post( return api.post(
{ {
method: serverApi.productByscene, method: serverApi.productByscene,
...data, ...data
}, },
true true
); )
}; }
// 看线索 // 看线索
const unreadApi = (data) => { const unreadApi = data => {
return api.post( return api.post(
{ {
method: serverApi.unread, method: serverApi.unread,
...data, ...data
}, },
true true
); )
}; }
const pageApi = (data) => { const pageApi = data => {
return api.post( return api.post(
{ {
method: serverApi.page, method: serverApi.page,
...data, ...data
}, },
true true
); )
}; }
const readApi = (data) => { const readApi = data => {
return api.post( return api.post(
{ {
method: serverApi.read, method: serverApi.read,
...data, ...data
}, },
true true
); )
}; }
const tagApi = (data) => { const tagApi = data => {
return api.post( return api.post(
{ {
method: serverApi.tag, method: serverApi.tag,
...data, ...data
}, },
true true
); )
}; }
const battleMessageApi = data => {
return api.post({
method: serverApi.battleMessage,
...data
})
}
module.exports = { module.exports = {
/** 线索埋点数据上报 /** 线索埋点数据上报
...@@ -69,15 +76,16 @@ module.exports = { ...@@ -69,15 +76,16 @@ module.exports = {
*/ */
reportData(data = {}, operationType = 0) { reportData(data = {}, operationType = 0) {
return api.post({ return api.post({
method: "scrm.api.busassistant.clue.report", method: 'scrm.api.busassistant.clue.report',
...data, ...data,
operationType, operationType,
operationDate: new Date().format("yyyy-MM-dd hh:mm:ss"), operationDate: new Date().format('yyyy-MM-dd hh:mm:ss')
}); })
}, },
productBysceneApi, productBysceneApi,
unreadApi, unreadApi,
pageApi, pageApi,
readApi, readApi,
tagApi, tagApi,
}; battleMessageApi
}
...@@ -52,7 +52,8 @@ ...@@ -52,7 +52,8 @@
"tab": "/components/Tab/Tab", "tab": "/components/Tab/Tab",
"navigation-bar": "/components/NavigationBar/NavigationBar", "navigation-bar": "/components/NavigationBar/NavigationBar",
"popup": "/components/Popup/Popup", "popup": "/components/Popup/Popup",
"nothing-tips": "/components/Nothing-tips/nothingTips" "nothing-tips": "/components/Nothing-tips/nothingTips",
"crowdfund-poster": "/components/CrowdfundPoster/CrowdfundPoster"
}, },
"style": "v2", "style": "v2",
"resolveAlias": { "resolveAlias": {
......
// packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.js
import Draw from '~/utils/Draw'
Component({
/**
* 组件的属性列表
*/
properties: {
item: {
type: Object,
observer(n) {
console.log(n, '=================')
this.init(n)
}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
async init(n) {
wx.$api.showLoading()
const drawfun = new Draw({
width: 279,
height: 554
}, this),
{
userInfo
} = wx.$storage.get(),
merchantName = userInfo.merchantName.length > 12 ? `${userInfo.merchantName.substring(0, 12)}...` : userInfo.merchantName,
res = await drawfun.begin({
imageList: [{
x: 0,
y: 0,
width: 279,
height: 66,
url: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/output/poster-bg.png'
},
{
x: 16,
y: 70,
width: 247,
height: 472,
url: n.posterUrl
}
],
textList: [{
x: 12,
y: 14,
fontSize: 14,
color: '#2D2D33',
text: merchantName,
textBaseline: 'top'
},
{
x: 12,
y: 36,
fontSize: 14,
color: '#1B233D',
text: n.activityName,
textBaseline: 'top',
fontWeight: 500
},
{
x: 14 + drawfun.getTextWidth(n.activityName, 14) + 9,
y: 37,
fontSize: 10,
color: '#4466F0',
text: '众筹',
textBaseline: 'top',
border: {
width: 1,
color: '#4466F0',
radius: 2,
padding: [2, 5],
opacity: 0.5
}
}
],
})
console.log(res)
wx.hideLoading()
this.setData({
poster: res.path,
show: true
})
},
download() {
const filePath = this.data.poster
wx.saveImageToPhotosAlbum({
filePath
})
},
hide() {
this.setData({
show: false,
poster: ''
})
},
noScroll() {}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.wxss */
.layout {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 998;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.bg {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
background: rgba(28, 27, 35, 0.60);
}
.poster {
width: 558rpx;
height: 60%;
border-radius: 8rpx;
}
.btn {
width: 320rpx;
height: 88rpx;
line-height: 88rpx;
background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%);
border-radius: 16rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
margin-top: 32rpx;
}
.tips {
margin: 16rpx 80rpx 0;
font-size: 24rpx;
color: #FFFFFF;
line-height: 36rpx;
}
}
\ No newline at end of file \ No newline at end of file
<block wx:if="{{show}}">
<view class="layout" catchtouchmove="noScroll">
<view class="bg" bindtap="hide"></view>
<image src="{{poster}}" class="poster" mode="aspectFit"></image>
<view class="btn" bindtap="download">保存至相册</view>
<view class="tips">
提示:这是您的专属活动海报,请下载转发给门店员工注册并参与活动分享。请不要将此海报转发给非相关活动参与者,避免活动数据泄漏。
</view>
</view>
</block>
\ No newline at end of file \ No newline at end of file
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {}
"crowdfund-poster":"../CrowdfundPoster/CrowdfundPoster"
}
} }
...@@ -123,6 +123,10 @@ Component({ ...@@ -123,6 +123,10 @@ Component({
.then(result => { .then(result => {
console.log(result) console.log(result)
let { pages, list, total } = result let { pages, list, total } = result
list = list.map(item => {
item.merchantName = item.merchantName || item.actualMerchantName
return item
})
this.setData({ this.setData({
customerList: pageNum == 1 ? list : [...customerList, ...list], customerList: pageNum == 1 ? list : [...customerList, ...list],
triggered: false, triggered: false,
...@@ -135,8 +139,15 @@ Component({ ...@@ -135,8 +139,15 @@ Component({
}) })
}, },
submit(data) { submit(data) {
let obj = ['merchantId', 'merchantName', 'contactName', 'phone', 'mainBrand', 'newCarSales', 'existUserNumber']
let objList = {}
obj.forEach(item => {
if (data[item]) {
objList[item] = data[item]
}
})
mineApi mineApi
.saveMerchantCustomInfo(data) .saveMerchantCustomInfo(objList)
.then(result => { .then(result => {
console.log(result) console.log(result)
this.setData({ this.setData({
...@@ -157,6 +168,7 @@ Component({ ...@@ -157,6 +168,7 @@ Component({
// 提交客户信息更新 // 提交客户信息更新
// this.checkout(customerList[index]) // this.checkout(customerList[index])
// console.log('customerList[index]', customerList[index]) // console.log('customerList[index]', customerList[index])
// let {} =
!isSuper && this.submit(customerList[index]) !isSuper && this.submit(customerList[index])
} else { } else {
customerList[index]['isEdit'] = true customerList[index]['isEdit'] = true
......
...@@ -63,15 +63,20 @@ Component({ ...@@ -63,15 +63,20 @@ Component({
current: valueurl current: valueurl
}) })
}, },
downLoad(e) {
const { item } = e.currentTarget.dataset
this.setData({
posterItem: {
activityName: item.activityName,
posterUrl: item.valueUrl
}
})
},
copyLink(e) { copyLink(e) {
console.log(e) console.log(e)
let { url } = e.currentTarget.dataset let { url } = e.currentTarget.dataset
console.log(url) console.log(url)
handleCopy(url) handleCopy(url)
// console.log(e.current.)
// wx.$api.setCopyData(url, () => {
// // wx.$spi.showToast('复制成功')
// })
}, },
// handleCopy(e) { // handleCopy(e) {
// var { idx } = e.currentTarget.dataset // var { idx } = e.currentTarget.dataset
......
...@@ -52,11 +52,13 @@ ...@@ -52,11 +52,13 @@
</view> </view>
<view class="warReportLink"> <view class="warReportLink">
<view class="label">点击了解详情:</view> <view class="label">点击了解详情:</view>
<!-- bind:tap="preView" -->
<view <view
class="link" class="link"
wx:if="{{item.valueUrl}}" wx:if="{{item.valueUrl}}"
data-valueurl="{{item.valueUrl}}" data-valueurl="{{item.valueUrl}}"
bind:tap="preView"> data-item="{{item}}"
bind:tap="downLoad">
战报详情 战报详情
</view> </view>
</view> </view>
...@@ -123,4 +125,5 @@ ...@@ -123,4 +125,5 @@
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
<crowdfund-poster item="{{posterItem}}" />
...@@ -8,7 +8,7 @@ const IMAGES = Object.freeze({ ...@@ -8,7 +8,7 @@ const IMAGES = Object.freeze({
// `${IMG_URL}index/car2.png`, // `${IMG_URL}index/car2.png`,
//本地图片路径 //本地图片路径
let IMG_URLLocal = '../../../images/' let IMG_URLLocal = '../../../images/'
import { productBysceneApi, unreadApi, pageApi, readApi, tagApi } from '~/api/index.js' import { productBysceneApi, unreadApi, pageApi, readApi, tagApi, battleMessageApi } from '~/api/index.js'
Page({ Page({
// behaviors: [kfMixin], // behaviors: [kfMixin],
...@@ -551,9 +551,12 @@ Page({ ...@@ -551,9 +551,12 @@ Page({
// console.log('itemIndx: ', itemIndx); // console.log('itemIndx: ', itemIndx);
// key: 'clueSource' // key: 'clueSource'
if (item['key'] == 'clueSource') { if (item['key'] == 'clueSource') {
itemIndx += 1 // itemIndx += 1
obj[item['key']] = itemIndx == 2 ? '' : itemIndx + 1
} else {
obj[item['key']] = itemIndx == 2 ? '' : itemIndx
} }
obj[item['key']] = itemIndx == 2 || itemIndx == 3 ? '' : itemIndx // || itemIndx == 3
} }
return obj return obj
}, {}) }, {})
...@@ -639,13 +642,30 @@ Page({ ...@@ -639,13 +642,30 @@ Page({
onReachBottom() { onReachBottom() {
console.log('滑到底部了') console.log('滑到底部了')
}, },
// 展示海报
getSharePost(merchantId) {
battleMessageApi({ serviceMerchantId: merchantId })
.then(result => {
// console.log(result)
// 为2是已经展示过了
result.status != 2 &&
this.setData({
posterItem: {
activityName: result.activityName,
// posterUrl: 'https://wx.glsx.com.cn/upload/biz/587076735934271488.png'
posterUrl: result.valueUrl
}
})
})
.catch(err => {})
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
// setTimeout(()=>{ let { userInfo } = wx.$storage.get()
// console.log('this.data.tabBarStyle',this.data.tabBarStyle,this.data.headerHeight) // console.log(userInfo)
// }) !userInfo.isSuper && this.getSharePost(userInfo.subLoginUser.merchantId)
}, },
onPageScroll: (function () { onPageScroll: (function () {
let timer = null let timer = null
......
...@@ -309,4 +309,5 @@ ...@@ -309,4 +309,5 @@
</form> </form>
</view> </view>
</view> </view>
<crowdfund-poster item="{{posterItem}}" />
...@@ -13,11 +13,12 @@ export const STORAGE_OBJECTkEY = { ...@@ -13,11 +13,12 @@ export const STORAGE_OBJECTkEY = {
auto_login_object: 'auto_login_object', auto_login_object: 'auto_login_object',
wx_user_info: 'wx_user_info', wx_user_info: 'wx_user_info',
userPhone: 'userPhone', userPhone: 'userPhone',
firstLogin:'firstLogin', firstLogin: 'firstLogin',
authphone:'authphone' authphone: 'authphone',
posterTimer: 'posterTimer'
} }
export const IMG_VERSION = () =>{ export const IMG_VERSION = () => {
const accountInfo = wx.getAccountInfoSync() const accountInfo = wx.getAccountInfoSync()
return accountInfo.miniProgram.version || '1.0.0' return accountInfo.miniProgram.version || '1.0.0'
} }
...@@ -6,7 +6,41 @@ const target = ['ip', 'dev', 'uat', 'prod'] ...@@ -6,7 +6,41 @@ const target = ['ip', 'dev', 'uat', 'prod']
2测试 2测试
3生产 3生产
*/ */
const index = 2 // const index = 1
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
// console.log(systemInfo);
// console.log(accountInfo.miniProgram.envVersion)
//手动控制体验版环境的请求 true就依据下面index false就默认为2
const manual = false
const release = false
let index = 2
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
// trial:体验版
// release:正式版
// console.log( systemInfo.platform);
// console.log(accountInfo.miniProgram.envVersion);
if (systemInfo.platform != 'devtools') {
switch (accountInfo.miniProgram.envVersion) {
case 'develop':
// this.globalData.url = 'http://192.168.0.252:3000/api'; //
break
case 'trial':
index = manual ? index : 2
break
case 'release':
index = release ? index : 3
break
default:
index = 3
break
}
}
const secretKey = { const secretKey = {
ip: {}, ip: {},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!