Commit 534f690a by 张立顺

提交代码

1 parent 6a49815d
import mineApi from './mine.js'
export default new mineApi()
import api from '~/utils/request/request'
const { appId } = wx.getAccountInfoSync().miniProgram
const CODE = {
platformEntrance: 'BUSINESS_ASSISTANT',
productCode: 'PC00c3'
}
class mineApi {
/**分页查询客户列表 */
merchantCustomInfo(data) {
return api.post(
{
method: 'scrm.api.boutiquecoupon.merchantCustomInfo.page',
...data
}
// true
)
}
}
export default mineApi
......@@ -31,6 +31,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow(options, refresh) {
1
if (refresh) {
this.setData({
disabled: true
......@@ -77,21 +78,16 @@ Page({
})
},
checkLoginBtn(disabled = false) {
const {
loginType
} = this.data, {
data: {
formData
},
loginToken
} = this.selectComponent('#box')
const { loginType } = this.data,
{
data: { formData },
loginToken
} = this.selectComponent('#box')
if (loginType == 0) {
disabled = loginToken
} else disabled = loginType == 1 ?
formData.phone && this.validate.methods.tel(formData.phone) && formData.code :
formData.account && formData.password
} else disabled = loginType == 1 ? formData.phone && this.validate.methods.tel(formData.phone) && formData.code : formData.account && formData.password
this.setData({
disabled: !disabled
})
}
})
\ No newline at end of file
})
// pages/mineDetail/customerManagement/customerManagement.js
import mineApi from '~/api/mineApi/index'
const listObj = Object.freeze([
{
key: 'merchantId',
......@@ -58,6 +59,9 @@ Component({
* 组件的初始数据
*/
data: {
pageNum: 1,
pageSize: 10,
pages: 1,
customerList: [
{
id: 0,
......@@ -105,8 +109,38 @@ Component({
* 组件的方法列表
*/
methods: {
refreshList() {
// this.getUserDayReport()
restPageNum() {
console.log('restPageNum')
this.setData({
pageNum: 1
})
this.getMerchantCustomInfoList()
},
scrollonReachBottom() {
console.log('scrollonReachBottom')
let { pages, pageNum } = this.data
// 判断当前页是否是末页
if (pages == pageNum) return wx.$api.showToast('列表已到底')
this.setData({
pageNum: pageNum + 1
})
this.getMerchantCustomInfoList()
},
// 分页查询客户列表
getMerchantCustomInfoList() {
wx.$api.showLoading('加载中...')
let { pageNum, pageSize, customerList } = this.data
let params = {
pageNum,
pageSize
}
mineApi
.merchantCustomInfo(params)
.then(result => {
console.log(result)
})
.catch(err => {})
},
changeStatus(e) {
console.log(e)
......
......@@ -29,7 +29,7 @@
label="{{item.isEdit?childItem.editLabel :childItem.label }}"
requiredAfter
cellHeight="{{false}}"
labelWidth="140rpx">
labelWidth="200rpx">
<input
placeholder="点击输入"
class="input"
......
// pages/tab/mine/mine.js
import { IMG_URL } from '~/utils/constantData'
import USERAPI from '~/api/usersApi/index'
const IMAGES = Object.freeze({
icon0: `${IMG_URL}/personal/icon1.png`,
icon1: `${IMG_URL}/personal/icon2.png`
......@@ -12,7 +13,24 @@ Page({
navStyle: 'background-color: rgba(0,0,0,0);',
IMAGES
},
logout() {
let _this = this
wx.showModal({
title: '温馨提示',
content: '是否退出当前账号?',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
// _this.showLoading()
wx.$api.showLoading()
USERAPI.logout().then(_res_ => {
wx.$storage.rm('sessionId')
wx.$router.go('login.index')
})
}
}
})
},
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
......
......@@ -50,6 +50,7 @@
type="default"
isabled="{{false}}"
loading="{{false}}"
bindtap="logout"
hover-class="button-hover">
退出登录
</button>
......
......@@ -75,9 +75,9 @@ Component({
wx.$api.showLoading('加载中...')
USERAPI.switchSubLoginInfo({ merchantId }).then(res => {
console.log(res)
this.setUserInfo(res)
setUserInfo(res)
this.hidePopup()
this.triggerEvent('changeAccount')
this.triggerEvent('changeAccount', 'refresh')
// }
wx.$api.hideLoading()
})
......
......@@ -9,7 +9,7 @@ Component({
* 组件的初始数据
*/
data: {
tabIndx: 1,
tabIndx: 4,
noProduct: false
},
......
......@@ -3,7 +3,8 @@ import { IMG_URL } from '~/utils/constantData'
// import { } from "module";
// ;('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/')
const IMAGES = {
arrow: `${IMG_URL}/output/arrow.png`
arrow: `${IMG_URL}/output/arrow.png`,
funnel: `${IMG_URL}/output/funnel.png`
}
Component({
// behaviors: [imgUrlMixin],
......@@ -17,7 +18,14 @@ Component({
*/
data: {
IMAGES,
isAct: true
sceneIndx: 1,
isAct: true,
background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
indicatorDots: true,
vertical: false,
autoplay: false,
interval: 2000,
duration: 500
},
/**
......
......@@ -39,4 +39,32 @@
}
}
}
}
.outputValueCon {
.title {
box-sizing: border-box;
font-weight: 600;
font-size: 32rpx;
color: #323436;
border-bottom: 2rpx dashed #CCCED1;
padding: 12rpx;
}
.full {
height: 800rpx !important;
}
.short {
height: 600rpx !important;
}
.bg-image {
width: 670rpx;
height: 550rpx;
z-index: -1;
// object-fit: cover;
}
}
\ No newline at end of file
......@@ -21,25 +21,38 @@
<view class="outputValueCon">
<view class="title">产值图</view>
<view class="swiperCon">
<view class="swiper">轮播图</view>
<!-- 统计 -->
<view class="merchantCount">
<view class="turnover">
<view class="img" />
<view class="num">200</view>
<view class="label">营业额</view>
</view>
<view class="customerUnitPrice">
<view class="img" />
<view class="num">2000</view>
<view class="label">营业额</view>
</view>
</view>
<!-- 指标诊断 -->
<view class="diagnosisCon">
<view class="img">图片</view>
<view class="tips">日均升级客单价低于1000/低于上2个月平均日升级客单价的10%,建议梳理驻店销售的技能,以及加强与流量方的互动。</view>
</view>
<swiper
indicator-dots="{{indicatorDots}}"
class="{{sceneIndx==3? 'short':'full'}}"
autoplay="{{autoplay}}"
interval="{{interval}}"
duration="{{duration}}">
<block wx:for="{{background}}" wx:key="*this">
<swiper-item>
<view class="swiper-item ">
<image class="bg-image" src="{{IMAGES.funnel}}" />
<!-- 统计 -->
<view class="merchantCount">
<view class="turnover">
<view class="img" />
<view class="num">200</view>
<view class="label">营业额</view>
</view>
<view class="customerUnitPrice">
<view class="img" />
<view class="num">2000</view>
<view class="label">营业额</view>
</view>
</view>
<!-- 指标诊断 -->
<view class="diagnosisCon">
<view class="img">图片</view>
<view class="tips">日均升级客单价低于1000/低于上2个月平均日升级客单价的10%,建议梳理驻店销售的技能,以及加强与流量方的互动。</view>
</view>
</view>
</swiper-item>
</block>
</swiper>
</view>
</view>
</view>
......
......@@ -46,33 +46,46 @@ Page({
})
},
getMerchantRange() {
getMerchantRange(e) {
// 重新刷新
let { detail } = e
let { userInfo } = wx.$storage.get()
// 有问题 先取反调试
userInfo = userInfo.loginUserInfoList[0]
console.log(userInfo.subLoginUser.merchantId)
// userInfo = userInfo.isSuper ? userInfo : userInfo.loginUserInfoList[0]
// console.log(userInfo.subLoginUser.merchantId)
console.log(userInfo)
// userInfo.isSuper &&
USERAPI.adminSelectLogin()
.then(result => {
console.log(result)
let { merchantList: merchantRange } = result
console.log(merchantRange)
let subIndex = -1
merchantRange.forEach((item, index) => {
item.show = true
if (item.merchantId == userInfo.subLoginUser.merchantId) {
subIndex = index
item.act = true
}
})
console.log(subIndex)
this.setData({
merchantRange,
subIndex
// 判断是超管才需要切换账号
if (userInfo.isSuper) {
USERAPI.adminSelectLogin()
.then(result => {
console.log(result)
let { merchantList: merchantRange } = result
console.log(merchantRange)
let subIndex = -1
merchantRange.forEach((item, index) => {
item.show = true
if (item.merchantId == userInfo.subLoginUser.merchantId) {
subIndex = index
item.act = true
}
})
console.log(subIndex)
this.setData({
merchantRange,
subIndex
})
})
.catch(err => {})
} else {
let merchantRange = [{ merchantId: userInfo.subLoginUser.merchantId, merchantName: userInfo.subLoginUser.merchantName }]
this.setData({
merchantRange,
subIndex: 0
})
.catch(err => {})
}
},
/**
* 生命周期函数--监听页面加载
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!