Commit 62c7e9fc by chenwq

看线索换入口,guide图片改

1 parent 7746aebc
...@@ -62,7 +62,8 @@ ...@@ -62,7 +62,8 @@
"name": "mineDetail", "name": "mineDetail",
"pages": [ "pages": [
"pages/messageBox", "pages/messageBox",
"pages/customerManagement" "pages/customerManagement",
"pages/clue"
] ]
}, },
{ {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<view class="text text-center" style="{{tabHeight ? 'height: 60rpx;' : ''}}">{{item}}</view> <view class="text text-center" style="{{tabHeight ? 'height: 60rpx;' : ''}}">{{item}}</view>
<view class="line" style="{{tabHeight ? 'margin-top: 6rpx;' : ''}}" /> <view class="line" style="{{tabHeight ? 'margin-top: 6rpx;' : ''}}" />
<!-- --> <!-- -->
<view wx:if="{{filterUtils.hasRedpoint(unreadClueCount)}}" class="redpoint" /> <!-- <view wx:if="{{filterUtils.hasRedpoint(unreadClueCount)}}" class="redpoint" /> -->
</view> </view>
</block> </block>
</view> </view>
......
// packagesList/mineDetail/pages/clue.js
import { IMG_URL } from '~/utils/constantData.js'
import { unreadApi, pageApi, tagApi } from '~/api/index.js'
const IMAGES = Object.freeze({
arrow: `${IMG_URL}/index/point.png`,
actArrow: `${IMG_URL}/index/actArrow.png`
})
Page({
/**
* 页面的初始数据
*/
data: {
IMAGES,
IMG_URL,
disLikeRecordFlag: true,
typeList: [
{
0: '无电话',
1: '有电话',
2: '联系电话',
selectIndex: 2,
key: 'hasPhone'
},
{
0: '非意向客户',
1: '是意向客户',
2: '意向客户',
selectIndex: 2,
key: 'starTag'
},
{
0: '来自访客',
1: '来自门店',
2: '线索来源',
selectIndex: 2,
key: 'clueSource'
},
{
2: '重置',
selectIndex: 2
}
],
clueList: [],
// 看线索部分
unreadClueCount: 0,
cluePageSize: 1000,
clueCurrentPage: 1,
disLikeFlag: true,
clueParams: {} //看线索参数
},
//点击收藏
showToast: function (e) {
wx.$storage.set('disLikeRecordFlag', false)
let disLikeRecordFlag = wx.$storage.get('disLikeRecordFlag')
this.setData({
disLikeFlag: false,
disLikeRecordFlag
})
let { type, item } = e.currentTarget.dataset
// console.log('type,item: ', type, item)
let tipObj = {}
if (item.starTag == 1) {
tipObj = {
type: 'fail',
title: '取消标记为意向客户'
}
} else {
tipObj = {
type: 'success',
title: '成功标记为意向客户'
}
}
this.data.prompt.showToast({
type: tipObj.type,
title: tipObj.title,
duration: 1000,
compelete: function () {
// console.log("toast框隐藏之后,会调用该函数");
//例如:跳转页面wx.navigateTo({ url: 'xxx' });
}
})
//切换收藏标记
let index = e.currentTarget.dataset.outidx
let completeStatus = `clueList[${index}].like`
this.setData({
[completeStatus]: !this.data.clueList[index].like
})
//发请求
let { sessionId } = wx.$storage.get()
let params = {
clueId: item.clueId,
sessionId
}
this.getTagApi(params)
},
//看线索重置
resetCluelist() {
let { typeList } = this.data
typeList.forEach(item => {
item.selectIndex = 2
})
this.setData({
typeList,
clueParams: {}
})
//重置数据
this.clearclueData()
this.getPageApi()
},
filterTypeFn(e) {
let { typeList } = this.data
let index = e.currentTarget.dataset.index
// 重置筛选
if (index == 3) {
return this.resetCluelist()
}
let itemList = Object.values(typeList[index]).slice(0, 2)
itemList.push('全部')
let _this = this
wx.pro.showActionSheet({
itemList,
success(res) {
//重置数据
_this.clearclueData()
// 选中全部
let selectIndex = res.tapIndex
// console.log('selectIndex: ', selectIndex);
typeList[index].selectIndex = selectIndex
let params = typeList.reduce((obj, item, index) => {
// console.log(' item: ', item)
if (item['key']) {
let itemIndx = item.selectIndex
// key: 'clueSource'
if (item['key'] == 'clueSource') {
// itemIndx += 1
obj[item['key']] = itemIndx == 2 ? '' : itemIndx + 1
} else {
obj[item['key']] = itemIndx == 2 ? '' : itemIndx
}
}
return obj
}, {})
// console.log(params)
// 清空数据
_this.setData({ typeList, clueParams: params })
_this.getPageApi(params)
},
fail(res) {
// console.log(res.errMsg)
}
})
},
//重置数据
clearclueData() {
this.setData({
clueList: [],
clueCurrentPage: 1
// hasPhone: '',
// starTag: '',
// clueSource: '',
})
},
// 打电话
phoneCallFn(e) {
let { phone } = e.currentTarget.dataset
wx.$api.phoneCall(phone)
},
// 复制号码
setCopyDataFn(e) {
let { phone } = e.currentTarget.dataset
wx.$api.setCopyData(phone)
},
getClueInit(param) {
this.getUnreadApi(param)
this.getPageApi(param)
},
//未读消息
async getUnreadApi(param) {
let { code, data } = await unreadApi(param)
if (code == 0) {
this.setData({
unreadClueCount: data.unreadClueCount
})
}
},
//获取浏览线索数据列表
async getPageApi(param) {
let { cluePageSize, clueCurrentPage, clueList } = this.data
let params = {
pageSize: cluePageSize,
currentPage: clueCurrentPage,
...param
}
let { code, data } = await pageApi(params)
if (code == 0) {
let arr = data.list.map(item => {
if (item.visitList && item.visitList.length > 5) {
item.getMoreFlag = true
}
return item
})
//添加分页数据
// let concatArr = []
// if(arr.length > 0) {
// concatArr = clueList.concat(arr)
// }
this.setData({
clueList: arr
})
let arrinx = arr.findIndex(e => e.clueType == 1 && e.starTag == 0)
this.setData({
disLikeFlagIdx: arrinx,
triggered: false
})
}
},
//喜欢收藏功能
async getTagApi(param) {
let { clueParams } = this.data
let res = await tagApi(param)
if (res.code == 0) {
let clueListPamas = {
...param,
...clueParams
}
this.getPageApi(clueListPamas)
}
},
// 上拉刷新
scrolltolowerFn() {
let { clueCurrentPage, clueParams } = this.data
let params = {
...clueParams,
clueCurrentPage: clueCurrentPage++
}
this.setData({
clueCurrentPage
})
this.getPageApi(params)
},
// 下拉刷新
refreshList() {
// console.log('onPullDownRefresh: ');
let { clueParams } = this.data
this.getClueInit(clueParams)
// this.resetCluelist()
// this.onLoad()
wx.pro.showToast({
title: '刷新成功',
icon: 'success',
duration: 1500
})
},
gotoApply(e) {
let { type, item } = e.currentTarget.dataset
// let { } = e.currentTarget.dataset
// console.log(item)
// return
if (type == 'active') {
let { userInfo } = wx.$storage.get()
let pMerchantName = userInfo.subLoginUser.merchantName
let pMerchantId = userInfo.subLoginUser.merchantId
let sceneActive
switch (this.data.actNum) {
case 0:
sceneActive = 1
break
case 1:
sceneActive = 2
break
case 2:
sceneActive = 3
break
case 3:
sceneActive = 4
break
}
// let pMerchantId = userInfo.subLoginUser.merchantId
// console.log("type,item: ", type, item);
const params = {
merchantInfo: {
pMerchantId,
pMerchantName,
merchantId: item.visitList[0].merchantId,
merchantName: item.visitList[0].merchantName
},
sceneActive,
clueId: item.clueId
// sceneCodeList: ['SC001', 'SC002','SC003','SC004']
}
//申请活动
// wx.$router.go("packageOutput.openBusiness", params);
wx.$router.go('packagesList.openBusiness', params)
} else {
//申请门店
// let { type, item } = e.currentTarget.dataset
wx.$router.go('packagesList.apply', item?.clueId || '')
}
// wx.$router.go('apply',1235)
},
getMore(e) {
// console.log("显示更多数据");
let index = e.currentTarget.dataset.outidx
// console.log("index: ", index);
let completeStatus = `clueList[${index}].getMoreFlag`
this.setData({
[completeStatus]: !this.data.clueList[index].getMoreFlag
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 看线索
this.getClueInit()
this.data.prompt = this.selectComponent('#toast')
let disLikeRecordFlag = wx.$storage.get('disLikeRecordFlag')
this.setData({
disLikeRecordFlag
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"vas-toast": "/pages/tab/index/components/likeToast/likeToast"
}
}
\ No newline at end of file \ No newline at end of file
/* packagesList/mineDetail/pages/clue.wxss */
.clue-wrap {
padding: 0px 10px 0;
background-color: #f2f3f7;
height: 100vh;
// margin-top: -16rpx;
// overflow: scroll;
.types {
// margin-bottom: 8px;
box-sizing: border-box;
padding: 16rpx 0;
display: flex;
align-items: center;
// position: sticky;
// top: 280rpx;
z-index: 2;
background-color: #f2f3f7;
// margin-top: -32rpx;
.type {
margin-left: 8px;
display: flex;
justify-content: center;
align-items: center;
padding: 0 16rpx;
height: 24px;
line-height: 24px;
background: #ffffff;
border-radius: 14px;
font-size: 12px;
color: #8a8c90;
.point {
margin-left: 2px;
width: 12px;
height: 12px;
}
}
.active {
color: #3964fe;
}
}
.list-wrap {
height: calc(100% - 80rpx);
}
.list {
// overflow: scroll;
box-sizing: border-box;
// padding-bottom: 8rpx;
.msg {
padding: 10px 16px 16px;
margin-bottom: 8px;
position: relative;
background-color: #fff;
border-radius: 4px;
}
.like {
position: absolute;
right: 12px;
top: 0;
width: 23px;
height: 23px;
}
.disLike-tit {
width: 172rpx;
background: rgba(0, 0, 0, 0.60);
padding: 8rpx 0rpx;
font-family: PingFangSC-Regular;
font-size: 20rpx;
color: #FFFFFF;
line-height: 36rpx;
text-align: center;
border-radius: 8rpx;
position: absolute;
right: 0rpx;
top: 61rpx;
}
.disLike-titsan {
width: 0;
height: 0;
border: 18rpx solid;
border-color: transparent transparent #686868;
position: absolute;
right: 27rpx;
top: 30rpx;
}
.name {
display: flex;
align-items: center;
// font-weight: 400;
font-size: 28rpx;
color: #323436;
.avatar {
margin-left: 2px;
width: 20px;
height: 20px;
}
}
.line {
margin-top: 10px;
margin-bottom: 10px;
height: 0;
border-bottom: #eeeeee 1px dashed;
}
.want-more {
box-sizing: border-box;
// overflow: hidden;
transition: all 3s ease;
}
// .height {
// height: 200rpx;
// }
// .auto {
// height: auto;
// }
.hiddenMore {
display: none !important;
}
.showMore {
display: flex !important;
}
.want-btn {
margin-top: 10px;
font-size: 12px;
color: var(--btnColor);
}
.record {
// margin-top: 4px;
// margin-bottom: 4px;
box-sizing: border-box;
// height: 40rpx;
display: flex;
justify-content: space-between;
align-items: center;
.action-wrap {
display: flex;
align-items: center;
font-size: 24rpx;
color: #393b3e;
}
// .action{
// }
// .detail{
// }
.time {
font-size: 12px;
color: #8a8c90;
}
}
.info {
margin-top: 10px;
display: flex;
justify-content: space-between;
.phone-wrap {
display: flex;
align-items: center;
}
.phone {
font-size: 24rpx;
color: #3666fe;
}
.phone-img {
margin-left: 12px;
margin-right: 8px;
width: 20px;
height: 20px;
border-radius: 50%;
}
.copy {
width: 20px;
height: 20px;
border-radius: 50%;
}
.btn {
width: 85px;
height: 24px;
background: var(--btnColor);
border-radius: 12px;
font-size: 12px;
color: #ffffff;
text-align: center;
line-height: 24px;
}
}
.noDataImg {
width: 512rpx;
height: 512rpx;
margin-left: 100rpx;
position: relative;
.noDataTxt {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #CCCED1;
position: absolute;
bottom: 32rpx;
left: 50%;
transform: translateX(-50%);
}
}
.shop {
.name-wrap {
display: flex;
justify-content: space-between;
align-items: center;
}
.source {
font-size: 10px;
color: #8a8c90;
}
.btn {
border: 1px solid var(--btnColor);
border-radius: 12px;
background-color: #fff;
font-size: 12px;
color: var(--btnColor);
}
.shop-action-wrap {
display: flex;
justify-content: space-between;
align-items: center;
}
.shop-record {
width: 100%;
}
.shop-source {
margin-top: 4px;
width: 100%;
font-size: 24rpx;
color: #393b3e;
}
}
.bottomTips {
text-align: center;
color: #393b3e;
font-size: 26rpx;
height: 60rpx;
line-height: 40rpx;
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packagesList/mineDetail/pages/clue.wxml-->
<view class="clue-wrap" hover-class="none" hover-stop-propagation="false">
<view class="types">
<view class="type {{item['selectIndex']!=2&&index != 3?'active':'' }}" wx:for="{{typeList}}" wx:key="index" data-index="{{index}}" style="{{index == 0 ? 'margin-left: 0px;' : ''}}" bindtap="filterTypeFn">
{{item[item['selectIndex']] }}
<image webp class="point" wx:if="{{index != 3}}" src="{{item['selectIndex']!=2&&index != 3? IMAGES.actArrow : IMAGES.arrow}}" />
</view>
</view>
<!-- bindscrolltolower="scrolltolowerFn" -->
<scroll-view scroll-y="true" class="list-wrap" enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="refreshList" refresher-threshold="104" refresher-triggered="{{triggered}}">
<view class="list" hover-class="none" hover-stop-propagation="false">
<view class="msg" wx:for="{{clueList}}" wx:key="index">
<!-- 门店助手 -->
<view class="shop" wx:if="{{item.clueType == 2}}">
<view class="name-wrap">
<view class="name" hover-class="none" hover-stop-propagation="false">
{{item.nickName}}
<image webp class="avatar" src="{{IMG_URL}}index/man.png" wx:if="{{item.clueType != 3}}" />
</view>
<view class="source" hover-class="none" hover-stop-propagation="false">通过门店助手申请</view>
</view>
<view class="line" hover-class="none" hover-stop-propagation="false" />
<view class="record" wx:for="{{item.visitList}}" wx:key="id" wx:for-index="idx" wx:for-item="itemName">
<view class="shop-record">
<view class="shop-action-wrap">
<view class="action-wrap">
<view class="action" selectable="false" space="false" decode="false">
访问页面:
</view>
<view class="detail" selectable="false" space="false" decode="false">
{{itemName.productDesc}}
</view>
</view>
<view class="time" selectable="false" space="false" decode="false">
{{itemName.clueDate}}
</view>
</view>
<view class="shop-source" hover-class="none" hover-stop-propagation="false">
所属门店:{{itemName.merchantName}}
</view>
</view>
</view>
<view class="info" hover-class="none" hover-stop-propagation="false">
<view>
<view class="phone-wrap" wx:if="{{item.phone}}">
<view class="phone">{{item.phone}}</view>
<image webp class="phone-img" data-phone="{{item.phone}}" bindtap="phoneCallFn" src="{{IMG_URL}}index/phone.png" />
<image webp class="copy" data-phone="{{item.phone}}" bindtap="setCopyDataFn" src="{{IMG_URL}}index/copy.png" />
</view>
</view>
<view class="btn" hover-class="none" hover-stop-propagation="false" data-type="active" data-item="{{item}}" wx:if="{{item.applyStatus == 0}}" bindtap="gotoApply">
开通活动
</view>
</view>
</view>
<!-- 生意助手 -->
<view wx:else>
<image webp class="like" wx:if="{{item.clueType == 1 && item.starTag == 1}}" src="{{IMG_URL}}index/like.png" data-type="like" data-outidx="{{index}}" data-item="{{item}}" bindtap="showToast" />
<image webp class="like" wx:if="{{item.clueType == 1 && item.starTag == 0}}" src="{{IMG_URL}}index/dislike.png" data-type="dislike" data-outidx="{{index}}" data-item="{{item}}" bindtap="showToast" />
<view class="disLike-tit" wx:if="{{item.clueType == 1 && item.starTag == 0 && disLikeFlag && disLikeRecordFlag}}" hidden="{{index != disLikeFlagIdx}}">
标记为意向客户
</view>
<view class="disLike-titsan" wx:if="{{item.clueType == 1 && item.starTag == 0 && disLikeFlag && disLikeRecordFlag}}" hidden="{{index != disLikeFlagIdx}}" />
<view class="name" hover-class="none" hover-stop-propagation="false">
{{item.nickName}}
<image webp class="avatar" src="{{IMG_URL}}index/avatar.png" wx:if="{{item.clueType != 3}}" />
</view>
<view class="line" hover-class="none" hover-stop-propagation="false" />
<!-- {{item.getMoreFlag?'height':'auto'}} -->
<view class="want-more ">
<view class="record {{idx>4&&item.getMoreFlag?'hiddenMore':''}} {{idx>4&&!item.getMoreFlag?'showMore':''}}" wx:for="{{item.visitList}}" wx:key="id" wx:for-index="idx" wx:for-item="itemName">
<view class="action-wrap">
<view class="action" selectable="false" space="false" decode="false">访问页面:
</view>
<view class="detail" selectable="false" space="false" decode="false">
{{itemName.productDesc}}
</view>
</view>
<view class="time" selectable="false" space="false" decode="false">
{{itemName.clueDate}}
</view>
</view>
</view>
<view class="want-btn" wx:if="{{item.visitList.length > 5}}" hover-class="none" hover-stop-propagation="false" data-outidx="{{index}}" bindtap="getMore">
{{ item.getMoreFlag ?'更多数据':'收起数据'}}
</view>
<view class="info" hover-class="none" hover-stop-propagation="false" wx:if="{{item.phone}}">
<view class="phone-wrap">
<view class="phone">{{item.phone}}</view>
<image webp class="phone-img" data-phone="{{item.phone}}" bindtap="phoneCallFn" src="{{IMG_URL}}index/phone.png" />
<image webp class="copy" data-phone="{{item.phone}}" bindtap="setCopyDataFn" src="{{IMG_URL}}index/copy.png" />
</view>
<view class="btn" hover-class="none" hover-stop-propagation="false" data-type="shop" bindtap="gotoApply" data-item="{{item}}" wx:if="{{item.applyStatus == 0}}">
+开店面
</view>
</view>
</view>
</view>
<view class="bottomTips" wx:if="{{clueList.length>10}}">到底啦!</view>
<view class="noDataImg" wx:if="{{!clueList.length}}">
<image webp src="{{IMG_URL}}index/trEmpty.png " />
<text class="noDataTxt">没有符合条件的线索~</text>
</view>
</view>
</scroll-view>
</view>
<!-- 收藏、取消提示框 -->
<vas-toast id='toast' />
\ No newline at end of file \ No newline at end of file
...@@ -10,7 +10,7 @@ const IMAGES = Object.freeze({ ...@@ -10,7 +10,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, battleMessageApi } from '~/api/index.js' import { productBysceneApi, pageApi, tagApi, battleMessageApi } from '~/api/index.js'
Page({ Page({
// behaviors: [kfMixin], // behaviors: [kfMixin],
...@@ -28,8 +28,9 @@ Page({ ...@@ -28,8 +28,9 @@ Page({
dataArr: [], dataArr: [],
apiData: [], apiData: [],
actNum: 3, //car 场景选择 actNum: 3, //car 场景选择
tabIndx: 1, tabIndx: 0,
navList: ['看线索', '看产品'], // navList: ['看线索', '看产品'],
navList: ['看产品', '系统订阅'],
// 预估弹框 // 预估弹框
visible: false, visible: false,
...@@ -56,7 +57,7 @@ Page({ ...@@ -56,7 +57,7 @@ Page({
}, },
//引导图 //引导图
guideFn() { guideFn() {
if (this.data.guideSrcIndex === 5) { if (this.data.guideSrcIndex === 4) {
this.setData({ this.setData({
guideShow: false guideShow: false
}) })
...@@ -99,21 +100,15 @@ Page({ ...@@ -99,21 +100,15 @@ Page({
this.setData({ this.setData({
tabIndx: e.detail tabIndx: e.detail
}) })
//标记线索已读
if (e.detail == 0 && first) {
first = false
readApi(param)
}
}, },
//看产品下拉刷新 //看产品下拉刷新
refresherrefresh() { refresherrefresh() {
let { tabIndx } = this.data let { tabIndx } = this.data
if (tabIndx == 1) { if (tabIndx == 0) {
// 看产品 // 看产品
this.getProductByscene() this.getProductByscene()
// // 看线索 // // 看线索
// this.getClueInit() // this.getClueInit()
this.getUnreadApi()
wx.pro.showToast({ wx.pro.showToast({
title: '刷新成功', title: '刷新成功',
icon: 'loading', icon: 'loading',
...@@ -313,7 +308,6 @@ Page({ ...@@ -313,7 +308,6 @@ Page({
this.getProductByscene() this.getProductByscene()
// // 看线索 // // 看线索
// this.getClueInit() // this.getClueInit()
this.getUnreadApi()
// //第一次进来储缓存,以后不再用引导图 // //第一次进来储缓存,以后不再用引导图
let firstLogin = wx.$storage.get('firstLogin') let firstLogin = wx.$storage.get('firstLogin')
...@@ -414,16 +408,6 @@ Page({ ...@@ -414,16 +408,6 @@ Page({
} }
}) })
}, },
//未读消息
async getUnreadApi(param) {
let { code, data } = await unreadApi(param)
if (code == 0) {
this.setData({
unreadClueCount: data.unreadClueCount
})
}
},
onReachBottom() { onReachBottom() {
console.log('滑到底部了') console.log('滑到底部了')
}, },
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
bindclick="changeTabIndx" bindclick="changeTabIndx"
class="tabContainer" /> class="tabContainer" />
</navigation-bar> </navigation-bar>
<view class="reclaim" style="{{tabIndx == 1 ? 'background: #fff;' : ''}}"> <view class="reclaim" style="{{tabIndx == 0 ? 'background: #fff;' : ''}}">
<!-- 头部 --> <!-- 头部 -->
<view class="header-wrap" style="height:{{headerHeight}}px; background-image: url('{{IMG_URL}}index/head.png')"> <view class="header-wrap" style="height:{{headerHeight}}px; background-image: url('{{IMG_URL}}index/head.png')">
<!-- <view class="header"> --> <!-- <view class="header"> -->
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</view> </view>
<!-- 托客户内容 --> <!-- 托客户内容 -->
<indexProduct <indexProduct
wx:if="{{tabIndx == 1 }}" wx:if="{{tabIndx == 0 }}"
bindselectCar="selectCar" bindselectCar="selectCar"
senceData="{{senceData}}" senceData="{{senceData}}"
actNum="{{actNum}}" actNum="{{actNum}}"
...@@ -31,12 +31,13 @@ ...@@ -31,12 +31,13 @@
headerHeight="{{headerHeight}}" headerHeight="{{headerHeight}}"
bindrefresherrefresh="refresherrefresh" /> bindrefresherrefresh="refresherrefresh" />
<!-- 看线索内容 --> <!-- 看线索内容 -->
<indexClue <!-- <indexClue
id="indexclue" id="indexclue"
wx:if="{{tabIndx == 0 }}" wx:if="{{tabIndx == 1 }}"
headerHeight="{{headerHeight}}" headerHeight="{{headerHeight}}"
disLikeRecordFlag="{{disLikeRecordFlag}}" disLikeRecordFlag="{{disLikeRecordFlag}}"
bindshowToggleToast="showToggleToast" /> bindshowToggleToast="showToggleToast" /> -->
<view wx:if="{{tabIndx == 1}}">系统订阅</view>
</view> </view>
<!-- 收藏、取消提示框 --> <!-- 收藏、取消提示框 -->
<vas-toast id='toast' /> <vas-toast id='toast' />
...@@ -46,7 +47,7 @@ ...@@ -46,7 +47,7 @@
webp webp
bindtap="guideFn" bindtap="guideFn"
class="guide-img" class="guide-img"
src="{{IMG_URL}}index/guide{{guideSrcIndex}}.webp?v={{img_version}}" /> src="{{IMG_URL}}index/guide{{guideSrcIndex}}.png?v={{img_version}}" />
</view> </view>
<!-- 在线客服 --> <!-- 在线客服 -->
<image <image
...@@ -66,7 +67,7 @@ ...@@ -66,7 +67,7 @@
class="output-value" class="output-value"
bindtap="showCalculate" bindtap="showCalculate"
src="{{IMG_URL}}index/valuation.png" src="{{IMG_URL}}index/valuation.png"
wx:if="{{tabIndx == 1}}" /> wx:if="{{tabIndx == 0}}" />
<!-- 预估产值弹框 --> <!-- 预估产值弹框 -->
<view class="dialog-wrapper" bindtap="clickDialog" hidden="{{!visible}}"> <view class="dialog-wrapper" bindtap="clickDialog" hidden="{{!visible}}">
<view class="dialog-box"> <view class="dialog-box">
......
...@@ -5,8 +5,10 @@ import mineApi from '~/api/mineApi/index' ...@@ -5,8 +5,10 @@ import mineApi from '~/api/mineApi/index'
const IMAGES = Object.freeze({ const IMAGES = Object.freeze({
icon0: `/personal/icon1.png`, icon0: `/personal/icon1.png`,
icon1: `/personal/icon2.png`, icon1: `/personal/icon2.png`,
icon2: `/personal/icon3.png`,
userAvatarUrl: `/personal/userAvatarUrl.png` userAvatarUrl: `/personal/userAvatarUrl.png`
}) })
import { unreadApi, readApi } from '~/api/index.js'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -14,12 +16,29 @@ Page({ ...@@ -14,12 +16,29 @@ Page({
data: { data: {
navStyle: 'background-color: rgba(0,0,0,0);', navStyle: 'background-color: rgba(0,0,0,0);',
IMAGES, IMAGES,
isRead: false, // isRead: false,
test: `/personal/icon2.png` test: `/personal/icon2.png`,
boxItemList: [{
name: '客户管理',
path: 'packagesList.customerManagement'
}, {
name: '消息盒子',
path: 'packagesList.messageBox',
hasRedPot: true,
isRead: false
}, {
name: '看线索',
path: 'packagesList.clue',
hasRedPot: true,
isRead: false
}]
}, },
navGO(e) { navGO(e) {
let { path } = e.currentTarget.dataset let { path, item } = e.currentTarget.dataset
// console.log(path) console.log(item)
if(item.name == "看线索") {
this.clueRead()
}
wx.$router.go(path) wx.$router.go(path)
}, },
logout() { logout() {
...@@ -65,21 +84,51 @@ Page({ ...@@ -65,21 +84,51 @@ Page({
}, },
messageBoxPageIsRead() { messageBoxPageIsRead() {
let { serviceMerchantId } = this.data let { serviceMerchantId } = this.data
const idx = this.data.boxItemList.findIndex(item => item.name == '消息盒子')
mineApi mineApi
.messageBoxPageIsRead({ .messageBoxPageIsRead({
serviceMerchantId serviceMerchantId
}) })
.then(result => { .then(result => {
console.log(result) console.log(result, 'result')
this.setData({ this.setData({
isRead: result, ['boxItemList[' + idx + ']isRead']: result
test: `/personal/icon2.png`
}) })
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err)
}) })
}, },
//看线索-未读消息
async getUnreadApi(param) {
let { code, data } = await unreadApi(param)
const idx = this.data.boxItemList.findIndex(item => item.name == '看线索')
if (code == 0) {
this.setData({
['boxItemList[' + idx + ']isRead']: !!data.unreadClueCount
})
}
},
// 看线索-标记已读
clueRead() {
let { sessionId } = wx.$storage.get()
const idx = this.data.boxItemList.findIndex(item => item.name == '看线索')
// console.log("sessionId: ", sessionId);
let param = {
sessionId
}
readApi(param).then(res => {
let { code } = res
if (code == 0) {
this.setData({
['boxItemList[' + idx + ']isRead']: !data.unreadClueCount
})
}
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -95,37 +144,38 @@ Page({ ...@@ -95,37 +144,38 @@ Page({
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () {}, onReady: function () { },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.messageBoxPageIsRead() this.messageBoxPageIsRead()
this.getUnreadApi()
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () {}, onHide: function () { },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () {}, onUnload: function () { },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () {}, onPullDownRefresh: function () { },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () {}, onReachBottom: function () { },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () {} onShareAppMessage: function () { }
}) })
<!-- pages/tab/output/output.wxml --> <!-- pages/tab/output/output.wxml -->
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady">我的账号</navigation-bar> <navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady">我的账号</navigation-bar>
<view class="layout" style="padding-top:{{tabBarStyle}}px;"> <view class="layout" style="padding-top:{{tabBarStyle}}px;">
<view class="userInfoCon"> <view class="userInfoCon">
<glsx-image class="headPortrait" src="{{userInfo.userAvatarUrl||IMAGES.userAvatarUrl }}" webp> <glsx-image class="headPortrait" src="{{userInfo.userAvatarUrl||IMAGES.userAvatarUrl }}" webp>
头像 头像
</glsx-image> </glsx-image>
<!-- <view class=" test">123456789.0</view> <!-- <view class=" test">123456789.0</view>
<view class=" test2">123456789.0</view> <view class=" test2">123456789.0</view>
<view class=" test3">123456789.0</view> --> <view class=" test3">123456789.0</view> -->
<view class="name">{{userInfo.merchantName}}</view> <view class="name">{{userInfo.merchantName}}</view>
<view class="id">账号:{{userInfo.merchantId}}</view> <view class="id">账号:{{userInfo.merchantId}}</view>
<view class="createTime">创建时间:{{userInfo.createdDate}}</view> <view class="createTime">创建时间:{{userInfo.createdDate}}</view>
</view> </view>
<view class="utilBoxTitle">常用工具</view> <view class="utilBoxTitle">常用工具</view>
<view class="boxItemCon"> <view class="boxItemCon">
<view class="item" data-path="packagesList.customerManagement" bind:tap="navGO"> <view wx:for="{{boxItemList}}" wx:key="index" class="item" data-path="{{item.path}}" data-item="{{item}}" bind:tap="navGO">
<view class="imgcon">
<view wx:if="{{item.hasRedPot}}" class="redPot" hidden="{{!item.isRead}}" />
<glsx-image class="img" src="{{IMAGES['icon' + index]}}" />
</view>
<view class="name">{{item.name}}</view>
</view>
<!-- <view class="item" data-path="packagesList.customerManagement" bind:tap="navGO">
<view class="imgcon"> <view class="imgcon">
<glsx-image class="img" src="{{IMAGES.icon0}}" /> <glsx-image class="img" src="{{IMAGES.icon0}}" />
</view> </view>
...@@ -23,22 +30,12 @@ ...@@ -23,22 +30,12 @@
<view class="item" data-path="packagesList.messageBox" bind:tap="navGO"> <view class="item" data-path="packagesList.messageBox" bind:tap="navGO">
<view class="imgcon"> <view class="imgcon">
<view class="redPot" hidden="{{!isRead}}" /> <view class="redPot" hidden="{{!isRead}}" />
<!-- <image class="img" src="{{IMAGES.icon1}}" /> -->
<glsx-image class="img" src="{{test}}" /> <glsx-image class="img" src="{{test}}" />
<!-- <image class="img" src="{{IMAGES.icon1}}" /> -->
</view> </view>
<view class="name">消息盒子</view> <view class="name">消息盒子</view>
</view> </view> -->
</view> </view>
<button <button class="logoutBtn" size="default" type="default" isabled="{{false}}" loading="{{false}}" bindtap="logout" hover-class="button-hover">
class="logoutBtn" 退出登录
size="default" </button>
type="default" </view>
isabled="{{false}}"
loading="{{false}}"
bindtap="logout"
hover-class="button-hover">
退出登录
</button>
</view>
\ No newline at end of file \ No newline at end of file
{ {
"appid": "wx24ebae5768e74138", "appid": "wx2c28337db96364d2",
"projectname": "business-assistant", "projectname": "business-assistant",
"compileType": "miniprogram", "compileType": "miniprogram",
"packOptions": { "packOptions": {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!