Commit 943afd83 by 张立顺

新增sentry配置

1 parent 117b3a22
...@@ -3,9 +3,14 @@ import util from './utils/util' ...@@ -3,9 +3,14 @@ import util from './utils/util'
import wxApi from './utils/utils_wx' import wxApi from './utils/utils_wx'
import '~/router/routerBefore' import '~/router/routerBefore'
import router from './router/index' import router from './router/index'
import * as Sentry from './utils/lib/sentry-miniapp'
// 有问题 前后顺序不能随意调整 // 有问题 前后顺序不能随意调整
// accountInfo.miniProgram.envVersion == 'release' &&
Sentry.init({
// dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5'
dsn: 'https://59c3cfc3ffb84ed68fc0dda26fb09e12@sentry.glsx.com.cn/30'
})
console.log(test)
import { setSystem_info } from '~/utils/cache/storageApi' import { setSystem_info } from '~/utils/cache/storageApi'
// console.log(setSystem_info) // console.log(setSystem_info)
// 判断小程序是否需要更新 // 判断小程序是否需要更新
...@@ -21,7 +26,6 @@ import { promisifyAll } from './utils/lib/wx-promise-pro' ...@@ -21,7 +26,6 @@ import { promisifyAll } from './utils/lib/wx-promise-pro'
promisifyAll() promisifyAll()
// promisify(wx.getSystemInfo)().then(console.log) // promisify(wx.getSystemInfo)().then(console.log)
// 实例化对象存储 // 实例化对象存储
import { Storage } from './utils/cache/storage' import { Storage } from './utils/cache/storage'
const $Storage = new Storage() const $Storage = new Storage()
...@@ -34,7 +38,7 @@ import './utils/network' ...@@ -34,7 +38,7 @@ import './utils/network'
App({ App({
onLaunch(options) { onLaunch(options) {
/**挂载到wx对象 */ /**挂载到wx对象 */
/**挂载到wx对象 */ /**挂载到wx对象 */
wx.$authStatus = false wx.$authStatus = false
wx.$util = util wx.$util = util
......
...@@ -10,7 +10,7 @@ Component({ ...@@ -10,7 +10,7 @@ Component({
type: Object, type: Object,
observer(n) { observer(n) {
console.log(n, '=================') console.log(n, '=================')
this.getImageInfo(n) n.posterUrl && this.getImageInfo(n)
} }
} }
}, },
...@@ -25,10 +25,10 @@ Component({ ...@@ -25,10 +25,10 @@ Component({
*/ */
methods: { methods: {
getImageInfo(n, width, height) { getImageInfo(n, width, height) {
wx.$api.showLoading('战报生成中') wx.$api.showLoading('处理中')
let that = this let that = this
wx.getImageInfo({ wx.getImageInfo({
src: `${n.posterUrl}?v=${Date.now()}`, src: `${n.posterUrl}?v=${Date.now()}`,
success: function (res) { success: function (res) {
console.log(res) console.log(res)
// w = res.width // w = res.width
...@@ -36,7 +36,7 @@ Component({ ...@@ -36,7 +36,7 @@ Component({
that.init(n, res.width, res.height) that.init(n, res.width, res.height)
}, },
fail: function (res) { fail: function (res) {
console.log(res); console.log(res)
wx.$api.showToast('生成失败') wx.$api.showToast('生成失败')
} }
}) })
......
<!-- packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml --> <!-- packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml -->
<view class="layout"> <view class="layout">
<view class="box order"> <view class="box order">
<view class="order-block" wx:for="{{orderFormList}}" wx:key="index"> <view class="order-block" wx:for="{{orderFormList}}" wx:key="index">
<view class="order-txt"> <view class="order-txt">
<text wx:if="{{item.prefix}}">{{item.prefix}}</text> <text wx:if="{{item.prefix}}">{{item.prefix}}</text>
{{orderObj[item.name] || 0}} {{orderObj[item.name] || 0}}
</view> </view>
<view class="order-label">{{item.label}}</view> <view class="order-label">{{item.label}}</view>
</view> </view>
</view> </view>
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index"> <view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head"> <view class="head">
<!-- text-hide --> <!-- text-hide -->
<view class=" head-title" bindtap="handleJumpH5" data-item="{{item}}">{{item.activityName}}</view> <view class=" head-title" bindtap="handleJumpH5" data-item="{{item}}">
<view class="head-link" bindtap="download" data-item="{{item}}"> {{item.activityName}}
<image src="{{IMAGES.download}}" class="downloadIcon" webp></image> </view>
下载海报 <view class="head-link" bindtap="download" data-item="{{item}}">
</view> <image src="{{IMAGES.download}}" class="downloadIcon" webp></image>
<view class="down-tips" wx:if="{{index == 0 && isShowTip}}">下载活动海报分享给门店开展活动</view> 母链海报
</view> </view>
<view class="content"> <view class="down-tips" wx:if="{{index == 0 && isShowTip}}">下载活动海报分享给门店开展活动</view>
<view class="content-row" wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx"> </view>
<view class="content-label">{{subItem.label}}</view> <view class="content">
<view class="content-txt {{subItem.className}}"> <view
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text> class="content-row"
{{item[subItem.name]}} wx:for="{{merchantFormList}}"
</view> wx:for-item="subItem"
</view> wx:for-index="idx"
<!-- 排名 --> wx:key="idx">
<view class="content-rank"> <view class="content-label">{{subItem.label}}</view>
<view class="rank-head"> <view class="content-txt {{subItem.className}}">
<view>员工转发数据排名</view> <text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
<view class="activity-status" wx:if="{{item.activityStatus == 1}}"> {{item[subItem.name]}}
距离开始{{item.interDays}}天 </view>
</view> </view>
<view class="activity-status" wx:if="{{item.activityStatus == 2}}"> <!-- 排名 -->
已开始{{item.interDays}}天 <view class="content-rank">
</view> <view class="rank-head">
<view class="activity-status" wx:if="{{item.activityStatus == 3 && item.interDays < 8}}"> <view>员工转发数据排名</view>
已结束{{item.interDays}}天 <view class="activity-status" wx:if="{{item.activityStatus == 1}}">
</view> 距离开始{{item.interDays}}天
</view> </view>
<view class="rank-table"> <view class="activity-status" wx:if="{{item.activityStatus == 2}}">
<view class="tr"> 已开始{{item.interDays}}天
<view class="th" style="width: {{subItem.width || ''}};" wx:for="{{tableHeadList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx"> </view>
{{subItem.label}} <view class="activity-status" wx:if="{{item.activityStatus == 3 && item.interDays < 8}}">
</view> 已结束{{item.interDays}}天
</view> </view>
<view wx:if="{{item.showStaffList.length}}"> </view>
<block wx:for="{{item.showStaffList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx"> <view class="rank-table">
<view class="tr"> <view class="tr">
<view class="td text-hide" style="width: {{i.width || ''}};" wx:for="{{tableHeadList}}" wx:for-item="i" wx:for-index="j" wx:key="j"> <view
<view wx:if="{{j == 0 && idx < 3}}"> class="th"
<image class="icon-rank" src="{{IMGURL}}output/rank0{{idx + 1}}.png?v={{img_version}}" /> style="width: {{subItem.width || ''}};"
</view> wx:for="{{tableHeadList}}"
<text wx:if="{{i.prefix}}">{{i.prefix}}</text> wx:for-item="subItem"
{{subItem[i.name]}} wx:for-index="idx"
</view> wx:key="idx">
</view> {{subItem.label}}
</block> </view>
<view wx:if="{{item.staffList.length}}" class="btn-more" bindtap="handleMore" data-idx="{{index}}"> </view>
查看更多 <view wx:if="{{item.showStaffList.length}}">
</view> <block
</view> wx:for="{{item.showStaffList}}"
<view class="tr-no-data" wx:else>暂无数据</view> wx:for-item="subItem"
</view> wx:for-index="idx"
</view> wx:key="idx">
<!-- 诊断 --> <view class="tr">
<view class="content-suggest" wx:if="{{item.activityStatus == 2 && item.suggestTxtList.length}}"> <view
<view class="suggest-title"># 活动诊断</view> class="td text-hide"
<view class="suggest-txt"> style="width: {{i.width || ''}};"
<!-- <text wx:if="{{item.toEndDays < 8}}">距离活动结束剩余{{item.interDays}}天,</text> --> wx:for="{{tableHeadList}}"
{{item.suggestTxt}}推荐以下建议: wx:for-item="i"
</view> wx:for-index="j"
<view class="suggest-block"> wx:key="j">
<view class="suggest-step" wx:for="{{item.suggestList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx"> <view wx:if="{{j == 0 && idx < 3}}">
<view class="step-label">建议{{idx + 1}}</view> <image class="icon-rank" src="{{IMGURL}}output/rank0{{idx + 1}}.png?v={{img_version}}" />
<view class="step-txt">{{subItem}}</view> </view>
</view> <text wx:if="{{i.prefix}}">{{i.prefix}}</text>
</view> {{subItem[i.name]}}
</view> </view>
</view> </view>
</view> </block>
<view
wx:if="{{item.staffList.length}}"
class="btn-more"
bindtap="handleMore"
data-idx="{{index}}">
查看更多
</view>
</view>
<view class="tr-no-data" wx:else>暂无数据</view>
</view>
</view>
<!-- 诊断 -->
<view class="content-suggest" wx:if="{{item.activityStatus == 2 && item.suggestTxtList.length}}">
<view class="suggest-title"># 活动诊断</view>
<view class="suggest-txt">
<!-- <text wx:if="{{item.toEndDays < 8}}">距离活动结束剩余{{item.interDays}}天,</text> -->
{{item.suggestTxt}}推荐以下建议:
</view>
<view class="suggest-block">
<view
class="suggest-step"
wx:for="{{item.suggestList}}"
wx:for-item="subItem"
wx:for-index="idx"
wx:key="idx">
<view class="step-label">建议{{idx + 1}}</view>
<view class="step-txt">{{subItem}}</view>
</view>
</view>
</view>
</view>
</view>
</view> </view>
<crowdfund-poster item="{{posterItem}}" />
\ No newline at end of file \ No newline at end of file
<crowdfund-poster item="{{posterItem}}" />
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
wx:if="{{item.activityUrl}}" wx:if="{{item.activityUrl}}"
bind:tap="copyLink" bind:tap="copyLink"
data-url="{{item.activityUrl}}"> data-url="{{item.activityUrl}}">
下载活动二维码 下载海报
</view> </view>
</view> </view>
</view> </view>
......
...@@ -27,7 +27,7 @@ Component({ ...@@ -27,7 +27,7 @@ Component({
getImageInfo(n) { getImageInfo(n) {
let that = this let that = this
wx.getImageInfo({ wx.getImageInfo({
src: n.posterUrl, src: `${n.posterUrl}?v=${Date.now()}`,
success: function (res) { success: function (res) {
console.log(res) console.log(res)
// w = res.width // w = res.width
......
...@@ -7,7 +7,8 @@ const IMAGES = { ...@@ -7,7 +7,8 @@ const IMAGES = {
funnel: `${IMG_URL}/output/funnel.png`, funnel: `${IMG_URL}/output/funnel.png`,
money: `${IMG_URL}/output/money.png`, money: `${IMG_URL}/output/money.png`,
paper: `${IMG_URL}/output/paper.png`, paper: `${IMG_URL}/output/paper.png`,
link: `${IMG_URL}/output/link.webp` link: `${IMG_URL}/output/link.webp`,
empty: `${IMG_URL}/output/empty.png`
} }
Component({ Component({
/** /**
...@@ -21,18 +22,19 @@ Component({ ...@@ -21,18 +22,19 @@ Component({
data: { data: {
noProduct: false, noProduct: false,
IMAGES, IMAGES,
sceneIndx: 3, sceneIndx: 0,
startInd: 0,
isAct: false, isAct: false,
indicatorDots: true, indicatorDots: true,
vertical: false, vertical: false,
autoplay: false, autoplay: false,
interval: 2000, interval: 2000,
duration: 500, duration: 500,
swiperHeight: 570,
// tabIndx: 4, // tabIndx: 4,
current: 0, current: 0,
totalMoney: 0, totalMoney: 0,
totalOrder: 0, totalOrder: 0,
startInd: 0,
list: [], list: [],
nowList: [], nowList: [],
todayList: [], todayList: [],
...@@ -193,11 +195,31 @@ Component({ ...@@ -193,11 +195,31 @@ Component({
// this. // this.
// this // this
// totalMoney = list[current].totalMoney // totalMoney = list[current].totalMoney
// let sceneIndx = list[current].startInd
let swiperHeight
let index = list[current].startInd
// console.log(index)
// 动态计算swiper 高度
if ([0, -1].includes(index)) {
swiperHeight = 483
} else if ([1, 2].includes(index)) {
console.log(list[current])
if (list[current]['showList'][index]['diagnoseList']) {
swiperHeight = 735
} else {
swiperHeight = 686
}
} else {
swiperHeight = 570
}
// console.log('swiperHeight', swiperHeight)
this.setData({ this.setData({
list, list,
yqMerchantIds, yqMerchantIds,
totalMoney: list[current].totalMoney, totalMoney: list[current].totalMoney,
totalOrder: list[current].totalOrder totalOrder: list[current].totalOrder,
sceneIndx: list[current].startInd,
swiperHeight
}) })
}) })
.catch(err => { .catch(err => {
...@@ -210,17 +232,40 @@ Component({ ...@@ -210,17 +232,40 @@ Component({
handleSceneChange(e) { handleSceneChange(e) {
console.log(e) console.log(e)
let { list } = this.data let { list } = this.data
let { index } = e.currentTarget.dataset let { index, item } = e.currentTarget.dataset
console.log(item)
let { sceneIdx } = e.detail let { sceneIdx } = e.detail
sceneIdx = sceneIdx - 1
console.log(sceneIdx) console.log(sceneIdx)
console.log(index)
let swiperHeight
// 动态计算swiper 高度
console.log(item.startInd)
// 最后要判断 sceneIdx 为空也能切换的兼容问题
if (sceneIdx == 0 || item.startInd == -1 || item['showList'][sceneIdx] == null) {
swiperHeight = 483
} else if ([1, 2].includes(sceneIdx)) {
// console.log(item['diagnoseList'])
// item['showList'][index]['diagnoseList']
if (item['showList'][sceneIdx]['diagnoseList']) {
swiperHeight = 735
} else {
swiperHeight = 686
}
} else {
swiperHeight = 590
}
// let value = list[index][sceneIdx] // let value = list[index][sceneIdx]
// console.log(list[index]['showList'][sceneIdx - 1]) // console.log(list[index]['showList'][sceneIdx - 1])
// 没开通场景不给切换过去 // 没开通场景不给切换过去
if (!list[index]['showList'][sceneIdx - 1]) return // if (!list[index]['showList'][sceneIdx - 1]) return
list[index].startInd = sceneIdx - 1 list[index].startInd = sceneIdx
this.setData({ this.setData({
list, list,
startInd: sceneIdx startInd: sceneIdx + 1,
sceneIndx: sceneIdx,
swiperHeight
// sceneIndx: sceneIdx - 1
}) })
}, },
getMerchantById(params) { getMerchantById(params) {
...@@ -247,7 +292,7 @@ Component({ ...@@ -247,7 +292,7 @@ Component({
obj.merchantName = item?.merchantName obj.merchantName = item?.merchantName
// obj.merchantId = item // obj.merchantId = item
obj.startInd = obj.startInd =
oldItem.startInd || oldItem?.startInd ||
item?.sceneList.findIndex(item => { item?.sceneList.findIndex(item => {
return item != null return item != null
}) || }) ||
...@@ -262,6 +307,7 @@ Component({ ...@@ -262,6 +307,7 @@ Component({
// console.log('listObj', listObj) // console.log('listObj', listObj)
console.log(obj.selectName) console.log(obj.selectName)
let listObj = `list[${index}]` let listObj = `list[${index}]`
console.log('sceneIndx', obj.startInd)
this.setData({ this.setData({
[listObj]: Object.assign(list[index], obj) [listObj]: Object.assign(list[index], obj)
}) })
...@@ -270,11 +316,33 @@ Component({ ...@@ -270,11 +316,33 @@ Component({
console.log(e) console.log(e)
let { list, userInfo } = this.data let { list, userInfo } = this.data
let { current } = e.detail let { current } = e.detail
console.log(list[current].startInd)
let swiperHeight
// 动态计算swiper 高度
if (list[current].startInd == 0 || list[current].startInd == -1) {
swiperHeight = 483
} else if ([1, 2].includes(list[current].startInd)) {
let subscript = list[current]['startInd']
let item = list[current]['showList']
if (item[subscript]['diagnoseList']) {
swiperHeight = 735
} else {
swiperHeight = 686
}
} else if (condition) {
swiperHeight = 570
}
// console.log(swiperHeight)
this.setData({ this.setData({
totalMoney: list[current].totalMoney, totalMoney: list[current].totalMoney || 0,
totalOrder: list[current].totalOrder, totalOrder: list[current].totalOrder || 0,
startInd: 0 sceneIndx: list[current].startInd,
swiperHeight
}) })
// list[current].startInd == 0? ''
// 692
console.log('swiper', list[current].startInd)
// list // list
if (current >= 1 && list[current + 1] && list[current + 1].startInd == -1) { if (current >= 1 && list[current + 1] && list[current + 1].startInd == -1) {
// 请求 // 请求
...@@ -296,6 +364,14 @@ Component({ ...@@ -296,6 +364,14 @@ Component({
console.log(err) console.log(err)
}) })
} }
// else {
// this.setData({
// totalMoney: list[current].totalMoney || 0,
// totalOrder: list[current].totalOrder || 0,
// sceneIndx: list[current].startInd
// })
// }
} }
} }
}) })
...@@ -267,6 +267,19 @@ ...@@ -267,6 +267,19 @@
} }
} }
.emptyCon {
width: 100%;
height: 500rpx;
display: flex;
align-items: center;
justify-content: center;
.img {
width: 500rpx;
height: 500rpx;
}
}
// .swiper .wx-swiper-dot { // .swiper .wx-swiper-dot {
// width: 40rpx !important; // width: 40rpx !important;
// height: 10rpx !important; // height: 10rpx !important;
...@@ -275,11 +288,11 @@ ...@@ -275,11 +288,11 @@
// // display: inline-flex; // // display: inline-flex;
// // justify-content: space-between; // // justify-content: space-between;
// } // }
swiper .wx-swiper-dot {
width: 35rpx;
height: 7rpx;
border-radius: 50%;
display: inline-flex;
margin-left: 19rpx;
justify-content: space-between;
}
\ No newline at end of file \ No newline at end of file
// swiper .wx-swiper-dot {
// width: 35rpx;
// height: 7rpx;
// border-radius: 50%;
// display: inline-flex;
// margin-left: 19rpx;
// justify-content: space-between;
// }
\ No newline at end of file \ No newline at end of file
...@@ -15,9 +15,11 @@ ...@@ -15,9 +15,11 @@
<!-- 无门店 --> <!-- 无门店 -->
<!-- <merchantDataStatistics bind:swiperChange="swiperChange" /> --> <!-- <merchantDataStatistics bind:swiperChange="swiperChange" /> -->
<!-- sceneIndx==3? 'short': --> <!-- sceneIndx==3? 'short': -->
<!-- {{startInd ==4?'short':'full'}} -->
<swiper <swiper
indicator-dots="{{indicatorDots}}" indicator-dots="{{list.length>1? indicatorDots:false}}"
class="swiper {{startInd ==4?'short':'full'}}" class="swiper "
style="height:{{swiperHeight*2}}rpx"
autoplay="{{autoplay}}" autoplay="{{autoplay}}"
bindchange="swiperChange" bindchange="swiperChange"
interval="{{interval}}" interval="{{interval}}"
...@@ -46,10 +48,11 @@ ...@@ -46,10 +48,11 @@
<scene-box <scene-box
formData="{{item}}" formData="{{item}}"
data-index="{{index}}" data-index="{{index}}"
data-item="{{item}}"
bind:handleSceneChange="handleSceneChange" bind:handleSceneChange="handleSceneChange"
sceneActive="{{(item.startInd + 1)}}" /> sceneActive="{{(item.startInd + 1)}}" />
</view> </view>
<view class="outputValueCon" wx:if="{{!showNothingSceneCon}}"> <view class="outputValueCon " wx:if="{{!item.showNothingSceneCon && item.showList[item.startInd] }}">
<view class="title">产值图</view> <view class="title">产值图</view>
<view class="swiperCon" wx:if="{{item['showList']}}"> <view class="swiperCon" wx:if="{{item['showList']}}">
<view class="swiper-item "> <view class="swiper-item ">
...@@ -82,7 +85,7 @@ ...@@ -82,7 +85,7 @@
</view> </view>
</view> </view>
<!-- 指标诊断 --> <!-- 指标诊断 -->
<view class="diagnosisCon"> <view class="diagnosisCon" wx:if="{{item.showList[item.startInd]['diagnoseList'].length}}">
<view class="tipsIcon">指标诊断</view> <view class="tipsIcon">指标诊断</view>
<swiper <swiper
class="tips" class="tips"
...@@ -107,13 +110,15 @@ ...@@ -107,13 +110,15 @@
</view> </view>
<!-- <view wx:else>test</view> --> <!-- <view wx:else>test</view> -->
</view> </view>
<view wx:if="{{showNothingSceneCon}}" /> <view wx:else class="emptyCon">
<image class="img" src="{{IMAGES.empty}}" />
</view>
</view> </view>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
<navigator <navigator
wx:if="{{swiperHeight>590}}"
class="navOhterApp" class="navOhterApp"
target="miniProgram" target="miniProgram"
open-type="navigate" open-type="navigate"
......
账号登录: 10988866666(超管)xiong110 账号登录: 10988866666(超管)xiong110
测试环境 bb123456 密码 bb123456 测试环境 bb123456 密码 bb123456
csysfws a123456 csysfws a123456
预发布服务商:csyfbfws01/a123456
ssfwsa a123456
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!