Commit be4d77b4 by 前端

fixed

1 parent 32d969da
Showing 165 changed files with 9982 additions and 217 deletions
## 正式版appid wx2c28337db96364d2 ## 正式版appid wx2c28337db96364d2
## 体验版appid wx24ebae5768e74138 ## 体验版appid wxc50d04ae5aa9984a
......
import api from "~/utils/request/request";
const path = "scrm.api.stoassistant";
class ActivityApi {
// 获取活动列表数据
getActivityList(data) {
return api.post({
// method: `scrm.api.assistant.activity.page`,
method: `scrm.api.assistant.activity.staff.page`,
...data,
},
false
);
}
// 获取活动中任务内容
getActiveTaskList(data, params) {
return api.post({
method: `stoassistant.api.mission.findStaffMissionList`,
...data,
},
false,
);
}
// 获取单个任务详情内容
getActiveTaskDetail(data) {
return api.post({
method: "stoassistant.api.mission.getMissionById",
...data,
});
}
// 获取被分享者打开分享内容数据
getTaskShareDetail(data) {
return api.post({
method: "stoassistant.api.mission.getMissionByIdAndNoSession",
...data,
});
}
// 获取申请活动已开通场景
getOpenSceneList(data) {
return api.post({
method: "scrm.api.busassistant.activity.SceneOpenStatus.stoAss",
...data,
}, true);
}
// 获取申请活动可开通的产品
getNotOpenProductsList(data) {
return api.post({
method: "scrm.api.busassistant.activity.productOpenStatus.stoAss",
...data,
});
}
// 获取我的订单数据
getActivityOrderList(data) {
return api.post({
method: `${path}.user.activity.order.list`,
...data,
});
}
// 获取活动诊断待预约安装订单数据
getActivityEndInstallOrderList(data, params) {
return api.post({
method: `${path}.user.activity.to.be.installed.list`,
...data,
},
false
);
}
// 获取我的访客数据
getActivityVisitorList(data) {
return api.post({
method: `${path}.user.activity.visitor.list`,
...data,
});
}
// 救援码扫码信息分页查询
rescuePage(data) {
return api.post({
method: `entmicro.api.drac.rescue.card.scan.record.page`,
projectName: "entmicro",
...data,
});
}
// 获取当前活动的海报
getActivityPosters(data) {
return api.post({
method: `scrm.api.assistant.crowdFunding.poster`,
...data,
});
}
// 获取活动短链接
getActivityUrl(data) {
return api.post({
method: `scrm.api.assistant.activity.poster`,
...data,
});
}
// 任务分享埋点
taskShareReport(data) {
return api.post({
method: "entmicro.api.customercollect.reportCustomerList",
...data,
});
}
/** 线索埋点数据上报
* operationType 操作类型(0:分享 1:浏览 2:申请活动)
*/
reportData(data = {}, operationType = 0) {
return api.post({
method: "scrm.api.busassistant.clue.report",
...data,
operationType,
operationDate: new Date().format("yyyy-MM-dd hh:mm:ss"),
});
}
// 确认安装
comfirmInstall(data) {
return api.post({
method: `scrm.api.stoassistant.user.activity.confirm.install`,
...data,
});
}
// 获取膨胀金活动
getPengZApi(data) {
return api.post({
method: `scrm.api.assistant.bulge.staff.page`,
...data,
});
}
// 获取订阅配置
getSubscribeConfigApi(data) {
return api.post({
method: `entmicro.api.system.subscribe.findActivityIdList`,
...data
})
}
// 获取定保/救援车活动列表
getSubscribeListByIdsApi(data) {
return api.post({
method: `scrm.api.assistant.activity.bulge.staff.page.byIds`,
...data
})
}
// 查询福利官
getWelfareInfo(data) {
return api.post({
method: `entmicro.api.system.subscribe.findMerchantWelfareInfo`,
...data
})
}
// 查询订阅服务
checkSubcribe(data) {
return api.post({
method: `entmicro.api.system.subscribe.getOpenedMerchant`,
...data
})
}
// 私域客户看板
praviteBoradData(data) {
return api.post({
method: `scrm.api.stoassistant.wechat.cloud.welfare.statics`,
...data
})
}
// 私域客户群里列表
praviteGroups(data) {
return api.post({
method: `scrm.api.stoassistant.wechat.cloud.welfare.group`,
...data
})
}
// 私域访客列表
praviteVistitor(data) {
return api.post({
method: `scrm.api.stoassistant.wechat.cloud.welfare.customerVisit`,
...data
})
}
/**
* 活动中-订单列表-上传支付凭证
*/
uploadPaymentVoucher(data) {
return api.post({
method: 'scrm.api.stoassistant.user.activity.uploadPaymentVoucher',
...data
}, true)
}
/**
* 根据活动id查询任务详情 */
getFindMissionByActiviyId(activityId) {
const {
merchantId
} = wx.$storage.get('userInfo')
return api.post({
method: 'stoassistant.api.mission.findMissionByActiviyId',
bussinessType: 3,
merchantNo: merchantId,
activityId
})
}
/** 根据订阅类型查询膨胀金活动列表(包含当前员工统计数据*/
getActivityPageBySubscribe(data) {
return api.post({
method: `scrm.api.assistant.activity.bulge.staff.page.bySubscribe`,
...data
})
}
/**获取跟进分页列表 */
getFollowData(data) {
return api.post({
method: `stoassistant.api.follow.page`,
...data
})
}
/**完成跟进 */
finishFollow(data) {
return api.post({
method: `stoassistant.api.follow.finish`,
...data
})
}
/**创建广汇续保权益登记订单 */
sendEquity(data) {
return api.post({
method: `scrm.api.stoassistant.gh.expanded.gold.activity.order.create`,
...data
})
}
/**看产值-车损权益升级-产值总览 */
merchantsOutput(data) {
return api.post({
method: `scrm.api.boutiquecoupon.store.assistant.merchants.total.output.value.statistics`,
...data
})
}
/**看产值-车损权益升级-产值报表 */
merchantsOutputReport(data) {
return api.post({
method: `scrm.api.boutiquecoupon.store.assistant.merchants.total.output.value.report.forms`,
...data
})
}
/**看产值-车损权益升级-柱状图 */
merchantsHistogram(data) {
return api.post({
method: `scrm.api.boutiquecoupon.store.assistant.merchants.total.output.value.histogram.chart`,
...data
})
}
/**看产值-车损权益升级-趋势图 */
merchantsTrend(data) {
return api.post({
method: `scrm.api.boutiquecoupon.store.assistant.merchants.total.output.value.trend.chart`,
...data
})
}
/**看产值-车损权益升级-员工排行分页列表 */
merchantsStaffOutput(data) {
return api.post({
method: `scrm.api.boutiquecoupon.store.assistant.merchants.total.staff.output.value.statistics.page`,
...data
})
}
/**查询4s店商户产值总览、当日新增产值 --精品升级 */
boutiquecouponOutputValue(data) {
return api.post({
method: `scrm.api.boutiquecoupon.outputValue.overview`,
...data
})
}
/**查询4s店商户查询员工产值排行信息--精品升级 */
boutiquecouponQueryEmployeeRankList(data) {
return api.post({
method: `scrm.api.boutiquecoupon.outputValue.queryEmployeeRankList`,
...data
})
}
/**查询4s店商户查询发券量营业额统计数据--精品升级 */
boutiquecouponQueryCouponCountAndOrderMoney(data) {
return api.post({
method: `scrm.api.boutiquecoupon.outputValue.queryCouponCountAndOrderMoney`,
...data
})
}
/**查询4s店商户查询营业额到店量统计数据--精品升级 */
boutiquecouponQueryOrderMoneyTotalAndToShopCount(data) {
return api.post({
method: `scrm.api.boutiquecoupon.outputValue.queryOrderMoneyTotalAndToShopCount`,
...data
})
}
/**查询4s店商户日报表--精品升级 */
boutiquecouponQueryByDayReport(data) {
return api.post({
method: `scrm.api.boutiquecoupon.outputValue.queryByDayReport`,
...data
})
}
/**查询4s店商户月报表--精品升级 */
boutiquecouponQueryByMonthReport(data) {
return api.post({
method: `scrm.api.boutiquecoupon.outputValue.queryByMonthReport`,
...data
})
}
}
export default ActivityApi;
\ No newline at end of file \ No newline at end of file
import ActivityApi from './ActivityApi.js'
export default new ActivityApi()
\ No newline at end of file \ No newline at end of file
import api from '~/utils/request/request'
module.exports = {
/**分页查询核销用户券 */
getBoutiquecouponList(data) {
return api.post({
method: `scrm.api.boutiquecoupon.customer.coupon.search`,
...data
})
},
/**获取商户券详情 */
getMerchantCoupon(id) {
return api.post({
method: `scrm.api.boutiquecoupon.merchantCoupon.getById`,
id
})
},
/** 获取精品礼券详情 */
getCouponDetail(id) {
return api.post({
method: 'scrm.api.boutiquecoupon.customer.coupon.detail',
id
})
},
/** 领取礼券 生成待核销码 */
getCoupon(data) {
return api.post({
method: `scrm.api.boutiquecoupon.customer.coupon.add`,
...data
})
},
/**获取园区店信息 */
getYqInfo(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.serviceMerchant.getByMerchantId',
...data
})
},
/** 精品交付单列表 */
getUserBoutiqueList(data) {
data.pageSize = 10
return api.post({
method: 'scrm.api.boutiquecoupon.goodsOrder.listMyOrder',
...data
},
true
)
},
/**扫码后根据订单号获取订单详情 */
scanGetDetailByOrderCode(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.order.detailScan',
...data
})
},
/**根据订单号获取订单详情 */
getDetailByOrderCode(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.order.detail',
...data
})
},
/**评价 */
addComment(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.orderComment.add',
...data
})
},
/**
* 门店助手精品礼券
*/
getMerchantCouponList(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.merchant.coupon.list',
...data
}, true)
},
/**
* 门店助手精品礼券 核销记录
*/
getMerchantCustomerCouponList(data) {
data.pageSize = 10
return api.post({
method: 'scrm.api.boutiquecoupon.customer.coupon.search',
...data
}, true)
},
/**
* 根据门店ID获取4S店员工
*/
getMerchantEmployee(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.employee.getByMerchantId',
...data
}, true)
},
}
\ No newline at end of file \ No newline at end of file
...@@ -46,5 +46,52 @@ class mineApi { ...@@ -46,5 +46,52 @@ class mineApi {
// true // true
) )
} }
// 获取服务中心下拉筛选 所有服务商数据
getServiceCenterListAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.listByServiceMerchantId',
...data
}
)
}
// 获取员工列表
getStaffListAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.staff.searchStaffPage',
...data
}
)
}
// 创建员工
createStaffAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.staff.createStaff',
...data
}
)
}
// 更新员工
updateStaffAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.staff.updateStaff',
...data
}
)
}
// 获取当前服务中心下的客户列表
getConnectionListByServiceAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.listByServiceCenterMerchantId',
...data
}
)
}
} }
export default mineApi export default mineApi
import api from '~/utils/request/request'
// 分页查询客户管理列表
const getCustomerList = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.page',
...data
}
)
}
// 保存客户管理信息
const saveCustomer = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.save',
...data
},
true
)
}
// 修改客户管理信息
const updateCustomer = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.update',
...data
},
true
)
}
// 查询客户销售顾问列表
const getEmployeeList = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.employee.list',
...data
}
)
}
// 创建邀请销售顾问二维码
const getInviteCode = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.inviteCode',
...data
}
)
}
export default {
getCustomerList,
saveCustomer,
updateCustomer,
getEmployeeList,
getInviteCode
}
\ No newline at end of file \ No newline at end of file
import api from '~/utils/request/request'
// 查询服务中心列表-不分页
const getAllServiceList = data => {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.listByServiceMerchantId',
...data
}
)
}
// 分页查询服务中心列表
const getServiceList = data => {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.page',
...data
}
)
}
// 保存服务中心信息
const saveService = data => {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.save',
...data
},
true
)
}
// 修改服务中心信息
const updateService = data => {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.update',
...data
},
true
)
}
// 分页查询技师列表
const getTechnicianList = data => {
return api.post(
{
method: 'scrm.api.busassistant.technicianConfig.page',
...data
}
)
}
// 新增技师信息
const addTechnician = data => {
return api.post(
{
method: 'scrm.api.busassistant.technicianConfig.add',
...data
},
true
)
}
// 修改技师信息
const updateTechnician = data => {
return api.post(
{
method: 'scrm.api.busassistant.technicianConfig.update',
...data
},
true
)
}
// 删除技师
const deleteTechnician = data => {
return api.post(
{
method: 'scrm.api.busassistant.technicianConfig.delete',
...data
},
true
)
}
export default {
getAllServiceList,
getServiceList,
saveService,
updateService,
getTechnicianList,
addTechnician,
updateTechnician,
deleteTechnician
}
\ No newline at end of file \ No newline at end of file
...@@ -5,21 +5,21 @@ const CODE = { ...@@ -5,21 +5,21 @@ const CODE = {
productCode: 'PC00c3' productCode: 'PC00c3'
} }
class outputApi { class outputApi {
/** 获取服务商(门店助手看产值)我的客户页总收益 */ /** 获取服务商(生意助手看产值)我的客户页总收益 */
getMerchantTotal(data) { getMerchantTotal(data) {
return api.post({ return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchant.getMerchantTotal', method: 'scrm.api.boutiquecoupon.partnermerchant.getMerchantTotal',
...data ...data
}) })
} }
/** 分页获取服务商(门店助手看产值)我的客户页数据 */ /** 分页获取服务商(生意助手看产值)我的客户页数据 */
getCustomerPageList(data) { getCustomerPageList(data) {
return api.post({ return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchant.customerPageList', method: 'scrm.api.boutiquecoupon.partnermerchant.customerPageList',
...data ...data
}) })
} }
/** 服务商(门店助手看产值)我的客户详情数据 */ /** 服务商(生意助手看产值)我的客户详情数据 */
getCustomerDetail(data) { getCustomerDetail(data) {
return api.post({ return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchant.getCustomerDetail', method: 'scrm.api.boutiquecoupon.partnermerchant.getCustomerDetail',
...@@ -37,7 +37,7 @@ class outputApi { ...@@ -37,7 +37,7 @@ class outputApi {
// true // true
) )
} }
/**获取服务商(门店助手看产值)我的门店页数据 */ /**获取服务商(生意助手看产值)我的门店页数据 */
partnerMerchantTotal(data) { partnerMerchantTotal(data) {
return api.post( return api.post(
{ {
...@@ -80,9 +80,10 @@ class outputApi { ...@@ -80,9 +80,10 @@ class outputApi {
/** 查询门店权益订单数据统计-车险升级活动产值 */ /** 查询门店权益订单数据统计-车险升级活动产值 */
getEquityRevenue(data) { getEquityRevenue(data) {
return api.post({ return api.post({
method: 'scrm.api.busassistant.merchant.equity.statistics', // method: 'scrm.api.busassistant.merchant.equity.statistics',
method: 'dj.api.smartcarlife.vd.quotation.merchant.statistics',
...data ...data
}) }, false, 'dj')
} }
/** 店面汇总-下载海报 */ /** 店面汇总-下载海报 */
...@@ -115,5 +116,31 @@ class outputApi { ...@@ -115,5 +116,31 @@ class outputApi {
...data ...data
}) })
} }
/** 根据场景查询产品 */
findProByScene(data) {
return api.post({
method: 'scrm.api.busassistant.activity.productByscene',
...data
})
}
/** 业务经营汇总列表查询 */
getBusiStatistics(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.store.assistant.merchants.total.statistics',
...data
})
}
// 我的员工
/** 服务商查询园区店员工产值统计 */
getStaffList(data) {
data.routerMethod = 'dj.api.smarcarlife.yquser.stat.byPartnerMerchant'
return api.post({
method: 'scrm.api.boutiquecoupon.rop.boutique.router.withoutLogin',
...data
})
}
} }
export default outputApi export default outputApi
...@@ -3,8 +3,8 @@ const { ...@@ -3,8 +3,8 @@ const {
appId appId
} = wx.getAccountInfoSync().miniProgram } = wx.getAccountInfoSync().miniProgram
const CODE = { const CODE = {
platformEntrance: 'BUSINESS_ASSISTANT', platformEntrance: 'STORE_ASSISTANT_TOTAL',
productCode: 'PC00c3' productCode: 'PC00c5'
} }
class UsersApi { class UsersApi {
/**调用后台接口获取用户信息js_code换取sessionId */ /**调用后台接口获取用户信息js_code换取sessionId */
...@@ -58,7 +58,7 @@ class UsersApi { ...@@ -58,7 +58,7 @@ class UsersApi {
return api.post({ return api.post({
method: 'scrm.api.sso.wechat.applets.auth.phone', method: 'scrm.api.sso.wechat.applets.auth.phone',
...detail, ...detail,
platformEntrance: 'BUSINESS_ASSISTANT' // 平台标识:门店助手-BUSINESS_ASSISTANT,门店助手-STORE_ASSISTANT platformEntrance: 'STORE_ASSISTANT_TOTAL' // 平台标识:生意助手-STORE_ASSISTANT_TOTAL,门店助手-STORE_ASSISTANT,门店助手-店总版-STORE_ASSISTANT_TOTAL
}, },
true true
) )
...@@ -89,7 +89,7 @@ class UsersApi { ...@@ -89,7 +89,7 @@ class UsersApi {
method: 'scrm.api.sso.wechat.applets.sms.login', method: 'scrm.api.sso.wechat.applets.sms.login',
...data, ...data,
source: 'MINIAPP', source: 'MINIAPP',
platformEntrance: 'BUSINESS_ASSISTANT' platformEntrance: 'STORE_ASSISTANT_TOTAL'
}, },
true true
) )
...@@ -165,7 +165,7 @@ class UsersApi { ...@@ -165,7 +165,7 @@ class UsersApi {
return api.post({ return api.post({
method: 'scrm.api.sso.wechat.applets.phone.grant.analysis', method: 'scrm.api.sso.wechat.applets.phone.grant.analysis',
...detail, ...detail,
platformEntrance: 'BUSINESS_ASSISTANT' platformEntrance: 'STORE_ASSISTANT_TOTAL'
}) })
} }
// 登录自动创建服务中心 // 登录自动创建服务中心
......
...@@ -36,7 +36,6 @@ import './utils/share' ...@@ -36,7 +36,6 @@ import './utils/share'
//监听网络状态 //监听网络状态
import './utils/network' import './utils/network'
App({ App({
onLaunch(options) { onLaunch(options) {
/**挂载到wx对象 */ /**挂载到wx对象 */
......
...@@ -13,7 +13,11 @@ ...@@ -13,7 +13,11 @@
"pages/measure/measure/measure", "pages/measure/measure/measure",
"pages/measure/measureResult/measureResult", "pages/measure/measureResult/measureResult",
"packagesList/activityDetail/activityDetail", "packagesList/activityDetail/activityDetail",
"packageOutput/pages/boutique/poutique" "packageOutput/pages/boutique/poutique",
"packagesList/outDetail/index",
"packageOutput/pages/monthReport/monthReport",
"pages/tab/logout/logout",
"packageOutput/pages/crowdDetail/crowdDetail"
], ],
"requiredPrivateInfos": [ "requiredPrivateInfos": [
"getLocation" "getLocation"
...@@ -114,6 +118,7 @@ ...@@ -114,6 +118,7 @@
"nothing-tips": "/components/Nothing-tips/nothingTips", "nothing-tips": "/components/Nothing-tips/nothingTips",
"crowdfund-poster": "/components/CrowdfundPoster/CrowdfundPoster", "crowdfund-poster": "/components/CrowdfundPoster/CrowdfundPoster",
"glsx-image": "/components/image/index", "glsx-image": "/components/image/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"f2": "@antv/wx-f2", "f2": "@antv/wx-f2",
"ff-canvas": "@antv/f2-canvas" "ff-canvas": "@antv/f2-canvas"
}, },
......
// components/image/index.js // components/image/index.js
import { IMG_URL, IMG_VERSION } from '~/utils/constantData' import { IMG_URL, IMG_VERSION ,IMG_URL_STORE} from '~/utils/constantData'
Component({ Component({
externalClasses: ['custom-class', 'class'], externalClasses: ['custom-class', 'class'],
/** /**
...@@ -12,9 +12,10 @@ Component({ ...@@ -12,9 +12,10 @@ Component({
observer: function (url, o) { observer: function (url, o) {
if (url) { if (url) {
let isWebp = url.includes('webp') let isWebp = url.includes('webp')
const isStore = url.startsWith('store-assistant')
this.setData({ this.setData({
isWebp, isWebp,
imagePath: `${IMG_URL}${url}?v=` + IMG_VERSION() imagePath: `${isStore?IMG_URL_STORE:IMG_URL}${url}?v=` + IMG_VERSION()
}) })
} }
} }
......
images/ok.png

905 Bytes

...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
{{item.merchantName}}{{item.isSuper?'(超管)':item.userType==1?'(商户号)':'(员工号)'}} {{item.merchantName}}{{item.isSuper?'(超管)':item.userType==1?'(商户号)':'(员工号)'}}
</view> </view>
<view class="icon"> <view class="icon">
<image src="{{IMG_URL}}login/radio.png" /> <image src="../../images/ok.png" class="icon"/>
</view> </view>
<view class='radio' /> <view class='radio' />
</view> </view>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view class="subtitle"> <view class="subtitle">
欢迎登录门店助手 欢迎登录门店助手
</view> </view>
<image webp class="img" src="{{IMG_URL_STORE}}/login/login-logo.png" /> <image webp class="img" src="{{IMG_URL_STORE}}store-assistant-assemble/login/login-logo.png" />
</view> </view>
</block> </block>
<block wx:else> <block wx:else>
......
...@@ -44,7 +44,7 @@ const setLoginInfo = (userInfo, sessionId) => { ...@@ -44,7 +44,7 @@ const setLoginInfo = (userInfo, sessionId) => {
return return
} }
// 自动创建服务中心 // 自动创建服务中心
initServiceCenter() // initServiceCenter()
setUserInfo(userInfo) setUserInfo(userInfo)
setSessionId(sessionId) setSessionId(sessionId)
loginSuccess() loginSuccess()
......
Component({
properties: {
data: {
type: Object,
value: {},
observer(v) {
if(!v)return
let s = v.statics
if (s) {
v.numList = [
{title: '浏览量', num: s.browseCount},
{title: '访客量', num: s.fansCount},
{title: '订单量', num: s.orderCount}
]
v.sortList = [
{title: '访客率', sort: s.fansRate},
{title: '转化率', sort: s.conversionRate}
]
}
this.setData({data: v})
}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/components/invertAnalyse/invertAnalyse.wxss */
.title {
font-weight: 600;
font-size: 32rpx;
color: #1B233D;
line-height: 48rpx;
}
.funnel-box {
padding: 40rpx 0;
position: relative;
.funnel-bg {
position: absolute;
top: 40rpx;
left: 50%;
transform: translate(-50%);
width: 458.18rpx;
height: 298rpx;
image {
width: 458.18rpx;
height: 298rpx;
}
}
.funnel-content {
display: flex;
justify-content: center;
height: 248rpx;
width: 100%;
padding-top: 40rpx;
.left,
.right {
display: flex;
}
.left {
flex: 0 0 406rpx;
flex-flow: column;
justify-content: space-around;
align-items: flex-end;
// align-items: center;
z-index: 1;
font-size: 22rpx;
color: #2D2D33;
box-sizing: border-box;
padding-right: 20rpx;
view {
display: flex;
align-items: center;
margin-right: 28rpx;
text {
font-size: 28rpx;
font-weight: bold;
margin-left: 4rpx;
}
}
}
.right {
flex: 1;
flex-flow: column;
align-items: flex-start;
margin-left: 130rpx;
color: #4466F0;
padding-top: 20rpx;
font-size: 24rpx;
position: relative;
.sort-box:last-child {
position: absolute;
left: -46rpx;
top: 50%;
}
.sort {
font-size: 40rpx;
font-weight: bold;
margin-top: 4rpx;
}
}
}
}
\ No newline at end of file \ No newline at end of file
<view class="funnel-box">
<view class="funnel-bg">
<glsx-image webp src="store-assistant/activity_funnel.webp"></glsx-image>
</view>
<view class="funnel-content">
<view class="left">
<view wx:for="{{data.numList}}" wx:key="index">{{item.title}}<text>{{item.num}}</text></view>
</view>
<view class="right">
<view class="sort-box" wx:for="{{data.sortList}}" wx:key="index">
<view>{{item.title}}</view>
<view class="sort">{{item.sort}}%</view>
</view>
</view>
</view>
</view>
// packageOutput/components/staff/staff.js
Component({
/**
* 组件的属性列表
*/
properties: {
sfaffList: {
type: Object,
observer(val) {
}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
page {
background: #f3f3f3;
font-size: 30rpx;
}
.table {
display: flex;
}
.table_left_column {
min-width: 150rpx;
height: auto;
display: flex;
flex-direction: column;
}
.left_col_item {
width: 100%;
height: 63rpx;
font-size: 20rpx;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
color: #1B233D;
background: #F9F9F9;
&:first-child {
font-weight: 600;
font-size: 24rpx;
color: #1B233D;
}
&:nth-child(2n) {
background: #ffffff;
}
}
.table_right_scroll_box {
display: flex;
white-space: nowrap;
overflow-x: scroll;
}
.flex_direction_column_item {
min-width: 200rpx;
display: inline-block;
/* border: 1px solid #000; */
}
.item_name {
min-width: 200rpx;
height: 63rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 20rpx;
color: #1B233D;
background: #F9F9F9;
&:first-child {
font-weight: 600;
font-size: 24rpx;
color: #1B233D;
}
&:nth-child(2n) {
background: #ffffff;
}
}
\ No newline at end of file \ No newline at end of file
<!--packageOutput/components/staff/staff.wxml-->
<view class='table'>
<!-- 左侧固定 -->
<view class='table_left_column'>
<view class='left_col_item'>排名</view>
<view class='left_col_item' wx:for="{{sfaffList[0].list}}" wx:for-index="index" wx:key="index">{{index+1}}</view>
</view>
<!-- 右侧表格滚动 -->
<view class="table_right_scroll_box">
<view class="flex_direction_column_item" wx:for="{{sfaffList}}" wx:for-index="index" wx:key="index">
<view class='item_name'>{{item.name}}</view>
<view wx:for="{{item.list}}" wx:for-item="litem" wx:for-index="lindex" wx:key="lindex" class='item_name item_desc'>
<block wx:if="{{litem.price !='缺货'}}">¥{{litem.price}}/斤</block>
<block wx:else>缺货</block>
</view>
</view>
</view>
</view>
import F2 from '@antv/wx-f2'
Page({ Page({
data: { data: {
onInitChart(F2, config) { onInitChart() {
const chart = new F2.Chart(config); const chart = new F2.Chart({
id:'chart',
width: 400,
height: 250
});
const data = [ const data = [
{ year: '1951 年', sales: 38 }, { year: '1951 年', sales: 38 },
{ year: '1952 年', sales: 52 }, { year: '1952 年', sales: 52 },
...@@ -31,9 +36,35 @@ Page({ ...@@ -31,9 +36,35 @@ Page({
} }
}); });
chart.interval().position('year*sales'); chart.interval().position('year*sales');
chart.render(); chart.render().node();
return chart; // return chart;
} }
}, },
onLoad() {
const chart = new G2.Chart({
id: 'c1',
width: 1000,
height: 500
});
chart.source(data, {
sales: {
tickCount: 5,
},
style: {
stroke: 'linear-gradient(0deg, blue, green 40%, red)'
}
});
chart.tooltip({
showItemMarker: false,
onShow(ev) {
const { items } = ev;
items[0].name = null;
items[0].name = items[0].title;
items[0].value = '¥ ' + items[0].value;
}
});
chart.interval().position('year*sales');
chart.render();
}
}); });
<view class="container" style="height: 300px;"> <view class="container" style="height: 300px;">
<f2 class="f2-chart" onInit="{{onInitChart}}" /> <canvas class="f2-chart" id="c1" />
</view> </view>
......
// packageOutput/pages/crowdDetail/crowdDetail.js
Page({
/**
* 页面的初始数据
*/
data: {
navStyle: 'background-color: rgba(0,0,0,0);',
analyseValue: {
statics: {
browseCount: 1,
}
},
outputValue: [{
label:'今日产值/元',
name: 'avgQuotationPrice',
unit:''
},{
label:'今日订单/单',
name: 'avgQuotationPrice',
unit:''
},{
label:'今日访客/个',
name: 'avgQuotationPrice',
unit:''
},{
label:'累计产值/元',
name: 'avgQuotationPrice',
unit:''
},{
label:'累计订单/单',
name: 'avgQuotationPrice',
unit:''
},{
label:'累计访客/个',
name: 'avgQuotationPrice',
unit:''
}],
sfaffList: [{
"name": "果唯伊水果",
"list": [{
"pkId": 1,
"price": "5.8",
"typeName": "苹果"
},
{
"pkId": 2,
"price": "2.08",
"typeName": "香蕉"
},
{
"pkId": 3,
"price": "6.00",
"typeName": "橙子"
},
{
"pkId": 4,
"price": "8.40",
"typeName": "山竹"
},
{
"pkId": 5,
"price": "15",
"typeName": "荔枝"
},
{
"pkId": 6,
"price": "5.8",
"typeName": "芒果"
},
{
"pkId": 7,
"price": "2.10",
"typeName": "西瓜"
},
{
"pkId": 8,
"price": "6.00",
"typeName": "草莓"
},
{
"pkId": 9,
"price": "8.00",
"typeName": "水蜜桃"
},
{
"pkId": 10,
"price": "7.80",
"typeName": "李子"
},
{
"pkId": 11,
"price": "缺货",
"typeName": "榴莲"
},
{
"pkId": 12,
"price": "4.08",
"typeName": "蓝莓"
},
{
"pkId": 13,
"price": "2.80",
"typeName": "柚子"
},
{
"pkId": 14,
"price": "8.00",
"typeName": "木瓜"
},
]
},
{
"name": "恋果",
"list": [{
"pkId": 1,
"price": "5.40",
"typeName": "苹果"
},
{
"pkId": 2,
"price": "2.20",
"typeName": "香蕉"
},
{
"pkId": 3,
"price": "缺货",
"typeName": "橙子"
},
{
"pkId": 4,
"price": "9.00",
"typeName": "山竹"
},
{
"pkId": 5,
"price": "14.00",
"typeName": "荔枝"
},
{
"pkId": 6,
"price": "5.50",
"typeName": "芒果"
},
{
"pkId": 7,
"price": "1.89",
"typeName": "西瓜"
},
{
"pkId": 8,
"price": "6.35",
"typeName": "草莓"
},
{
"pkId": 9,
"price": "8.20",
"typeName": "水蜜桃"
},
{
"pkId": 10,
"price": "8.60",
"typeName": "李子"
},
{
"pkId": 11,
"price": "24.60",
"typeName": "榴莲"
},
{
"pkId": 12,
"price": "4.56",
"typeName": "蓝莓"
},
{
"pkId": 13,
"price": "3.60",
"typeName": "柚子"
},
{
"pkId": 14,
"price": "7.20",
"typeName": "木瓜"
},
],
},
{
"name": "百果园",
"list": [{
"pkId": 1,
"price": "6.10",
"typeName": "苹果"
},
{
"pkId": 2,
"price": "2.30",
"typeName": "香蕉"
},
{
"pkId": 3,
"price": "缺货",
"typeName": "橙子"
},
{
"pkId": 4,
"price": "9.00",
"typeName": "山竹"
},
{
"pkId": 5,
"price": "14.30",
"typeName": "荔枝"
},
{
"pkId": 6,
"price": "5.65",
"typeName": "芒果"
},
{
"pkId": 7,
"price": "2.08",
"typeName": "西瓜"
},
{
"pkId": 8,
"price": "6.60",
"typeName": "草莓"
},
{
"pkId": 9,
"price": "7.80",
"typeName": "水蜜桃"
},
{
"pkId": 10,
"price": "8.2",
"typeName": "李子"
},
{
"pkId": 11,
"price": "23.8",
"typeName": "榴莲"
},
{
"pkId": 12,
"price": "4.36",
"typeName": "蓝莓"
},
{
"pkId": 13,
"price": "3.20",
"typeName": "柚子"
},
{
"pkId": 14,
"price": "8.00",
"typeName": "木瓜"
},
]
},
{
"name": "鲜丰水果",
"list": [{
"pkId": 1,
"price": "4.80",
"typeName": "苹果"
},
{
"pkId": 2,
"price": "1.98",
"typeName": "香蕉"
},
{
"pkId": 3,
"price": "5.20",
"typeName": "橙子"
},
{
"pkId": 4,
"price": "8.25",
"typeName": "山竹"
},
{
"pkId": 5,
"price": "缺货",
"typeName": "荔枝"
},
{
"pkId": 6,
"price": "5.8",
"typeName": "芒果"
},
{
"pkId": 7,
"price": "2.28",
"typeName": "西瓜"
},
{
"pkId": 8,
"price": "6.40",
"typeName": "草莓"
},
{
"pkId": 9,
"price": "8.60",
"typeName": "水蜜桃"
},
{
"pkId": 10,
"price": "15",
"typeName": "李子"
},
{
"pkId": 11,
"price": "29.6",
"typeName": "榴莲"
},
{
"pkId": 12,
"price": "缺货",
"typeName": "蓝莓"
},
{
"pkId": 13,
"price": "4.10",
"typeName": "柚子"
},
{
"pkId": 14,
"price": "6.80",
"typeName": "木瓜"
},
]
}
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"staff": "../../components/staff/staff",
"invert-analyse": "../../components/invertAnalyse/invertAnalyse"
},
"navigationStyle": "custom"
}
\ No newline at end of file \ No newline at end of file
.layout {
position: relative;
.bg-box {
width: 100%;
overflow: hidden;
position: absolute;
left: 0;
z-index: -1;
.bg {
width: 100%;
height: 100%;
position: absolute;
z-index: -1;
top: 0;
left: 0;
}
}
}
.output-box {
background: #F4F8FE;
border-radius: 32rpx;
margin: 0 16rpx;
padding: 24rpx;
.output-title {
font-weight: 600;
font-size: 32rpx;
color: #1B233D;
line-height: 48rpx;
margin-bottom: 22rpx;
}
.output-value {
display: grid;
grid-template-columns: repeat(3, 33.33%);
row-gap: 24rpx;
padding: 32rpx;
background-image: linear-gradient(180deg, #FFFFFF 72%, #EBF1FF 100%);
border-radius: 16rpx;
.output-item {
text-align: center;
.output-num {
font-weight: 600;
font-size: 44rpx;
color: #1B233D;
line-height: 64rpx;
}
.output-label {
font-size: 24rpx;
color: #6E6E7A;
line-height: 36rpx;
margin-top: 12rpx;
}
}
}
}
.box {
margin: 20rpx;
background: #FFFFFF;
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
border-radius: 20rpx;
padding: 32rpx 40rpx;
.box-title {
font-weight: 600;
font-size: 32rpx;
color: #1B233D;
line-height: 48rpx;
}
.staff-input {
width: 638rpx;
height: 64rpx;
background: #ffffff7d;
border: 2rpx solid #EEEEEE;
border-radius: 12rpx;
margin: 20rpx auto;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0rpx 20rpx;
box-sizing: border-box;
input {
height: 64rpx;
line-height: 64rpx;
color: #999999;
flex: 1;
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packageOutput/pages/crowdDetail/crowdDetail.wxml-->
<view class="container">
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady">产值详情</navigation-bar>
<view class="layout" id="layout" style="top:{{navHeight}}px; height: calc(100vh - 150rpx)">
<!-- 背景图 -->
<view class="bg-box" style="height:{{368 + navHeight * 2}}rpx;top:-{{navHeight}}px">
<view class="bg">
<glsx-image webp src="store-assistant/index_bg.webp"></glsx-image>
</view>
</view>
<scroll-view scroll-y class="content" class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" style="{{'height: calc(100% - 22rpx);'}}">
<view class="output-box">
<view class="output-title">
产值总览
</view>
<view class="output-value">
<view class="output-item" wx:for="{{outputValue}}">
<view class="output-num">444</view>
<view class="output-label">{{item.label}}</view>
</view>
</view>
</view>
<view class="box measure-box">
<view class="box-title">转化漏斗</view>
<invert-analyse data="{{analyseValue}}"></invert-analyse>
</view>
<view class="box staff-box">
<view class="box-title">员工排行榜</view>
<view class="staff-input">
<input placeholder="输入员工名称" />
<icon class="icon-small" type="search" size="14"></icon>
</view>
<staff sfaffList="{{sfaffList}}" />
</view>
</scroll-view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// packageOutput/pages/monthReport/monthReport.js
Page({
/**
* 页面的初始数据
*/
data: {
show: false,
date: '2023年4月10日',
navStyle: 'background-color: rgba(0,0,0,0);',
outputValue: [{
label:'发券量(总)/张',
name: 'avgQuotationPrice',
unit:''
},{
label:'升级订单/单',
name: 'avgQuotationPrice',
unit:''
},{
label:'营业额(总)/元',
name: 'avgQuotationPrice',
unit:''
},{
label:'客单价/元',
name: 'avgQuotationPrice',
unit:''
},{
label:'转化率',
name: 'avgQuotationPrice',
unit:''
}],
billboard: [{
sort:1,
name: 11,
value: 625000
},{
sort:2,
name: 11,
value: 625000
},{
sort:3,
name: 11,
value: 625000
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const {time,type} = options
this.setData({timeType:time,type})
},
onDisplay() {
this.setData({ show: true });
},
onClose() {
this.setData({ show: false });
},
formatDate(date) {
date = new Date(date);
return `${date.getFullYear()}年${date.getMonth() + 1}}月`;
},
onInput(event) {
this.setData({
currentDate: event.detail,
});
},
confirm(e) {
this.setData({ show: false });
},
onConfirm(event) {
this.setData({
show: false,
date: this.formatDate(event.detail),
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationStyle": "custom"
}
\ No newline at end of file \ No newline at end of file
/* packageOutput/pages/monthReport/monthReport.wxss */
.layout {
position: relative;
.bg-box {
width: 100%;
overflow: hidden;
position: absolute;
left: 0;
z-index: -1;
.bg {
width: 100%;
height: 100%;
position: absolute;
z-index: -1;
top: 0;
left: 0;
}
}
.store-box {
margin: 32rpx;
.store-item {
display: flex;
.store-logo {
width: 32rpx;
height: 32rpx;
}
.store-content {
margin-left: 12rpx;
margin-bottom: 24rpx;
.store-name {
font-weight: 600;
font-size: 28rpx;
color: #1B233D;
line-height: 32rpx;
}
.store-desc {
font-size: 24rpx;
color: #1b233da8;
line-height: 32rpx;
}
}
}
.date-input {
width: 686rpx;
height: 64rpx;
background: #ffffff7d;
border: 2rpx solid #EEEEEE;
border-radius: 12rpx;
display: flex;
align-items: center;
padding: 0rpx 24rpx;
box-sizing: border-box;
justify-content: space-between;
.date-value {
font-size: 24rpx;
color: #666666;
}
.date-icon {
width: 32rpx;
height: 31rpx;
}
}
}
.output-box {
background: #F4F8FE;
border-radius: 32rpx;
margin: 0 16rpx;
padding: 24rpx;
.output-title {
font-weight: 600;
font-size: 32rpx;
color: #1B233D;
line-height: 48rpx;
margin-bottom: 22rpx;
}
.output-value {
display: grid;
grid-template-columns: repeat(3, 33.33%);
row-gap: 24rpx;
padding: 32rpx;
background-image: linear-gradient(180deg, #FFFFFF 72%, #EBF1FF 100%);
border-radius: 16rpx;
.output-item {
text-align: center;
.output-num {
font-weight: 600;
font-size: 44rpx;
color: #1B233D;
line-height: 64rpx;
}
.output-label {
font-size: 24rpx;
color: #6E6E7A;
line-height: 36rpx;
margin-top: 12rpx;
}
}
}
}
.billboard-box {
background: #F4F8FE;
border-radius: 32rpx;
margin: 16rpx;
padding: 24rpx;
.billboard-title {
font-weight: 600;
font-size: 32rpx;
color: #1B233D;
line-height: 48rpx;
margin-bottom: 22rpx;
}
}
.billboard-border {
width: 670rpx;
height: 512rpx;
background-image: linear-gradient(180deg, #FFFFFF 72%, #EBF1FF 100%);
border-radius: 16rpx;
position: relative;
.billboard-item {
width: 209.54rpx;
height: 321.3rpx;
position: absolute;
&:first-child {
top: 97rpx;
left:207rpx;
z-index: 10;
.bill-bg {
width: 233.52rpx!important;
height: 358.06rpx!important;
}
}
&:nth-child(2) {
left: 37rpx;
top: 167rpx;
width: 233.52rpx;
height: 358.06rpx;
}
&:nth-child(3) {
z-index: 20;
top: 220rpx;
right: 37rpx;
}
.billboard-item-bar {
position: relative;
.bill-bg {
width: 209.54rpx;
height: 321.3rpx;
position: absolute;
top: 0;
left: 0;
}
.bill-num {
position: absolute;
top: -40rpx;
width: 100%;
text-align: center;
font-weight: 600;
font-size: 32rpx;
color: #FE5662;
}
.bill-name {
position: absolute;
top: 10rpx;
width: 100%;
text-align: center;
z-index: 100;
font-weight: 400;
font-size: 28rpx;
color: #1B233D;
}
}
}
}
}
.van-picker__toolbar {
display: none!important;
}
\ No newline at end of file \ No newline at end of file
<!--packageOutput/pages/monthReport/monthReport.wxml-->
<view class="container">
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady">产值{{timeType=='day'?'日':'月'}}报表</navigation-bar>
<view class="layout" id="layout" style="top:{{navHeight}}px; height: calc(100vh - 150rpx)">
<!-- 背景图 -->
<view class="bg-box" style="height:{{368 + navHeight * 2}}rpx;top:-{{navHeight}}px">
<view class="bg">
<glsx-image webp src="store-assistant/index_bg.webp"></glsx-image>
</view>
</view>
<scroll-view scroll-y class="content" class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" style="{{'height: calc(100% - 22rpx);'}}">
<view class="store-box">
<view class="store-item">
<view class="store-logo">
<glsx-image class="store-logo" webp src="store-assistant-assemble/output/store-icon.png"></glsx-image>
</view>
<view class="store-content">
<view class="store-name">嘀加奥迪4s店</view>
<view class="store-desc">欢迎查看{{timeType=='day'?'日':'月'}}报表数据</view>
</view>
</view>
<view class="date-input" bindtap="onDisplay">
<view class="date-value">{{date}}</view>
<view class="date-icon">
<glsx-image class="date-icon" webp src="store-assistant-assemble/output/date-icon.png"></glsx-image>
</view>
</view>
</view>
<view class="output-box">
<view class="output-title">
当{{timeType=='day'?'日':'月'}}产值
</view>
<view class="output-value">
<view class="output-item" wx:for="{{outputValue}}">
<view class="output-num">444</view>
<view class="output-label">{{item.label}}</view>
</view>
</view>
</view>
<view class="billboard-box">
<view class="billboard-title">当{{timeType=='day'?'日':'月'}}员工龙虎榜</view>
<view class="billboard-border">
<view class="billboard-item" wx:for="{{billboard}}">
<view class="billboard-item-bar">
<view class="bill-border">
<view class="bill-num" style="transform:translate({{index==1?-20:0}}rpx,0rpx)">¥{{item.value}}</view>
<view class="bill-name" style="transform:translate({{index==1?-20:0}}rpx,0rpx)">{{item.name}}</view>
</view>
<glsx-image webp custom-class="bill-bg" src="store-assistant-assemble/output/bill_{{item.sort}}.png"></glsx-image>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
<popup bind:hidePopup="confirm" bind:confirm="confirm" show="{{show}}" height="50vh">
<van-datetime-picker type="{{timeType=='day'?'date':'year-month'}}" bind:input="onInput" />
</popup>
</view>
\ No newline at end of file \ No newline at end of file
import { IMG_URL } from "~/utils/constantData";
import ActivityApi from '~/api/activityApi/index'
import index_const from "~/pages/tab/storeAssistant/pages/index/index_const"
import { commentTime } from '~/utils/format'
import {imgUrlMixin} from '~/mixins/index'
Page({
/**
* 页面的初始数据
*/
data: {
list: [],
allNum: 0,
todayNum: 0,
activityTypList: index_const.data.activityTypList,
IMG_URL:IMG_URL,
isPravite:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
onRoute(options) {
if(options.isPravite)return this.getVistiors(options)
let activityId = options.id
ActivityApi.getActivityVisitorList({
activityId
}).then(res => {
res.visitorList && res.visitorList.forEach(val => {
val.lastVisitFormatTime = commentTime(val.lastVisitDate)
if(!val.customerPhone&&val.guestId){
val.gId = (val.guestId.split('_')).pop() || ''
}
})
this.setData({
allNum: res.visitorTotal,
todayNum: res.todayTotal,
list: res.visitorList
})
})
},
toCopyName(e){
const {name} = e.currentTarget.dataset
if(name){
wx.setClipboardData({
data: name
})
}
},
// 私域待运营客户
getVistiors(options){
const userStorage = wx.$storage.get("userInfo");
let para = {
merchantId:userStorage.merchantId
}
ActivityApi.praviteVistitor(para).then(res=>{
res&&res.forEach(val=>{
val.lastVisitFormatTime = commentTime(val.lastVisitDate)
// console.log(val.lastVisitFormatTime);
// if(!val.customerPhone&&val.guestId){
// val.gId = (val.guestId.split('_')).pop() || ''
// }
})
let temp = JSON.parse(options.content)
this.setData({
isPravite:true,
list: res,
todayNum:temp[1].openNum,
allNum:temp[0].openNum,
})
})
},
// 打电话
callPhone(e) {
let { mobile } = e.currentTarget.dataset
wx.makePhoneCall({
phoneNumber: mobile.toString()
})
},
// 复制微信号
copyWechart(e) {
let { wechartno } = e.currentTarget.dataset
wx.setClipboardData({
data: wechartno.toString(),
success (res) {
wx.showToast({
title: '微信号已复制',
icon: "none"
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "我的访客"
}
\ No newline at end of file \ No newline at end of file
/* packageActivity/pages/visitor/visitor.wxss */
.visitor-box{
min-height: 100vh;
background-image: linear-gradient(180deg, #F0F5FF 0%, #EDF3FF 100%);
overflow: hidden;
.img-bg{
width: 100%;
height: 400rpx;
float: left;
}
.content{
width: 100%;
float: left;
margin-top: -400rpx;
.title{
padding: 32rpx 34rpx 0 34rpx;
font-size: 36rpx;
font-weight: 600;
color: #1B233D;
display: flex;
view:last-child{
margin-left: 48rpx;
}
text{
font-size: 28rpx;
font-weight: 400;
}
}
.list-box{
margin: 32rpx 24rpx;
right: 0;
left: 0;
.list-item{
margin-bottom: 24rpx;
background-image: linear-gradient(90deg, #FCF4F0 0%, #FCFDFF 77%);
border-radius: 24rpx;
padding: 24rpx 40rpx;
box-shadow: 0 10rpx 20rpx 0 rgba(129,146,214,0.24), inset 0 -2rpx 6rpx 0 rgba(255,255,255,0.40);
position: relative;
.top{
display: flex;
justify-content: space-between;
align-items: center;
.top-left{
display: flex;
image{
width: 80rpx;
height: 80rpx;
margin-right: 24rpx;
border-radius: 50%;
}
.name{
font-size: 30rpx;
color: #1B233D;
display: flex;
align-items: center;
.copy{
width: 28rpx;
height: 28rpx;
margin-left: 8rpx;
}
}
.mobile{
margin-top: 10rpx;
font-size: 26rpx;
color: #7A8299;
.order-statue{
margin-left: 16rpx;
font-size: 24rpx;
color: #EB9109;
}
.green{
color: #3FCF77;
}
}
}
.top-right{
.btn_icon{
width: 56rpx;
height: 56rpx;
margin-left: 32rpx;
}
}
}
.bottom{
margin-top: 24rpx;
background: #FFFFFF;
border-radius: 8px;
padding: 24rpx 32rpx;
.activity{
font-size: 30rpx;
font-weight: 600;
line-height: 48rpx;
color: #1B233D;
text{
display: inline-block;
padding: 2rpx 16rpx;
height: 40rpx;
border-radius: 22rpx;
font-weight: 400;
font-size: 24rpx;
color: #673F00;
text-align: center;
line-height: 40rpx;
margin-left: 16rpx;
background-image: linear-gradient(90deg, #FFF3A2 7%, #FFDA85 95%);
}
}
.footprint{
display: flex;
justify-content: space-between;
color: #7A8299;
font-size: 26rpx;
margin-top: 16rpx;
}
.pravite-text{
font-weight: 500;
font-size: 30rpx;
color: #6E6E7A;
line-height: 44rpx;
text{
margin-left: 0;
}
}
}
.status{
position: absolute;
right: 0;
top: 0;
width: 172rpx;
height: 52rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 400;
font-size: 26rpx;
color: #EB9109;
}
.status-2{
color: #3FCF77;
}
}
.orderde{
background-image: linear-gradient(90deg, #F2F6FF 9%, #FCFDFF 100%);
box-shadow: 0 10rpx 20rpx 0 rgba(129,146,214,0.24), inset 0 -2rpx 6rpx 0 rgba(255,255,255,0.40);
}
}
.no-data{
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
margin-top: 240rpx;
.no_data_image{
width: 400rpx;
height: 400rpx;
}
.text{
margin-top: 32rpx;
font-size: 28rpx;
color: #7A8299;
}
}
}
}
<!--packageActivity/pages/visitor/visitor.wxml-->
<view class="visitor-box">
<view class="img-bg">
<glsx-image class="bg_image" webp src="store-assistant/visitor_bg.png"></glsx-image>
</view>
<view class="content">
<view class="title">
<view>总访客<text> · {{allNum}}</text></view>
<view>今日访客<text> · {{todayNum}}</text></view>
</view>
<view class="list-box">
<block wx:if="{{!isPravite}}">
<block wx:for="{{list}}" wx:key="index">
<view class="list-item {{item.orderStatus == 0 ? '' : 'orderde'}}">
<view class="top">
<view class="top-left">
<glsx-image webp src="{{item.customerImageUrl ? item.customerImageUrl : 'store-assistant/default_avatar.png'}}"></glsx-image>
<view class="name-mobile">
<view class="name">
{{item.customerNickName || ""}}
<glsx-image wx:if="{{item.customerNickName&&item.customerNickName!='未知访客'}}" data-name="{{item.customerNickName}}" bind:tap="toCopyName" class="copy" src="store-assistant/copy_name.png"></glsx-image>
<!-- <text class="order-statue {{item.orderStatus == 0 ? '' : 'green'}}">{{item.orderStatus == 0 ? '未下单' : '已下单'}}</text> -->
</view>
<view class="mobile" wx:if="{{item.customerPhone}}">
{{item.customerPhone}}
<text class="order-statue {{item.orderStatus == 0 ? '' : 'green'}}">{{item.orderStatus == 0 ? '未下单' : '已下单'}}</text>
</view>
<view class="mobile" wx:else>
ID:{{item.gId}}
<text class="order-statue {{item.orderStatus == 0 ? '' : 'green'}}">{{item.orderStatus == 0 ? '未下单' : '已下单'}}</text>
</view>
</view>
</view>
<view class="top-right">
<glsx-image class="btn_icon" wx:if="{{item.customerPhone}}" webp src="store-assistant/activity_order_phone_icon.png" bind:tap="callPhone" data-mobile="{{item.customerPhone}}"></glsx-image>
<glsx-image class="btn_icon" wx:if="{{item.userWechartNo}}" webp src="store-assistant/activity_order_wechart_icon.png" bind:tap="copyWechart" data-wechartno="{{item.userWechartNo}}"></glsx-image>
</view>
</view>
<view class="bottom">
<view class="activity">
{{item.activityName}}
<!-- <text>{{activityTypList[0]}}</text> -->
</view>
<view class="footprint">
<text>浏览 {{item.visitCount}} 次</text>
<text>{{item.lastVisitFormatTime}} 访问过</text>
</view>
</view>
</view>
</block>
</block>
<block wx:else>
<block wx:for="{{list}}" wx:key="index">
<view class="list-item {{item.visitStatus==1?'orderde':''}}">
<view class="top">
<view class="top-left">
<glsx-image webp src="{{item.customerImageUrl ? item.customerImageUrl : 'store-assistant/default_avatar.png'}}"></glsx-image>
<view class="name-mobile">
<view style="padding-top:8rpx" class="name">
{{item.customerNickName || "未知访客"}}
<glsx-image wx:if="{{item.customerNickName&&item.customerNickName!='未知访客'}}" bind:tap="toCopyName" class="copy" src="store-assistant/copy_name.png"></glsx-image>
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="activity pravite-text">
<text>活动</text>
{{item.taskName || ''}}
</view>
<view class="footprint">
<text>浏览 {{item.visitCount}}次</text>
<text>{{item.lastVisitFormatTime}} 访问过</text>
</view>
</view>
<view class="status {{item.visitStatus==1?'status-2':''}}" style="background: url({{IMG_URL}}store-assistant/{{item.visitStatus==1?'order_status_11':'order_status_1'}}.png);background-size: 100% 100%;">{{item.visitStatus==1?'已':'未'}}领取奖励</view>
</view>
</block>
</block>
</view>
<view class="no-data" wx:if="{{!list.length}}">
<glsx-image class="no_data_image" webp src="store-assistant/no_visitor_data.png"></glsx-image>
<view class="text">暂无访客</view>
</view>
</view>
</view>
import USERAPI from '~/api/usersApi/index'
import environment from '~/utils/request/environment'
import ActivityApi from '~/api/activityApi/index'
const taskLoginAndRegister = (query, callBack) => {
if (!query) return callBack && callBack()
const options = { ...query, ...query.options }
delete options.options
console.log(options);
if (options.merchantId) {
const sessionId = wx.$storage.get('sessionId')
if (!sessionId) {
let para = {
merchantId: options.merchantId,
type: 1,
pages: options.pages
}
let temp = encodeURIComponent(JSON.stringify(para))
wx.navigateTo({
url: '/packageStoreAssistant/packageAuth/pages/authentication/register/register?data=' + temp,
});
} else {
const USERINFO = wx.$storage.get('userInfo')
if (USERINFO.merchantId == options.merchantId) {
USERAPI.checkSession().then(({
code
}) => {
if (code == '0') {
callBack && callBack()
} else {
wx.$router.reLaunch('/packageStoreAssistant/packageAuth/pages/authentication/login/login', options)
}
})
} else {
let para = {
merchantId: options.merchantId,
type: 1,
pages: options.pages
}
let temp = encodeURIComponent(JSON.stringify(para))
wx.navigateTo({
url: '/packageStoreAssistant/packageAuth/pages/authentication/register/register?data=' + temp,
});
}
}
} else {
callBack && callBack()
}
}
const authAvatarAndNickName = () => {
const {
domain,
index
} = environment,
redirectUrl = `${domain}/wx-oauth`,
// redirectUrl = 'http://scrm.dev.glsx.com.cn/wx-oauth',
// 云商 wx1cf40dc91c28a7fd ,glsxtest02 wx56bed167ad463f70
appid = index == 1 || index == 2 ? 'wx1cf40dc91c28a7fd' : 'wx56bed167ad463f70',
wxUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
console.log(redirectUrl, appid)
wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(wxUrl)}`,
})
}
const handlerMiss = (data, query, callBack) => {
if (!data) return
if (!query) return
let { pageNum, orginList, serviceType, listName } = query
data.list && data.list.forEach((val, index) => {
val.tabType = serviceType
val.isCollapse = true
val.startTime = val.startTime.split(' ')[0]
val.endTime = val.endTime.split(' ')[0]
// 活动中/活动未开始默认展开第一条 数据处理
// 处理不同模块的判断条件
let condition = false
let zc = val.activityStatus != 3 && index == 0 && pageNum == 1
let zc_3 = val.activityStatus == 3 && index == 0 && pageNum == 1
let pzj = val.activityStatus != 3 && index == 0
let bussinessScene = 3
if (serviceType == 0) {
condition = zc
} else {
condition = pzj
bussinessScene = 2
}
if (condition) {
val.isloading = true
ActivityApi.getActiveTaskList({ activityId: val.id, bussinessScene }, { isShowLoading: true }).then(res => {
res.forEach(a => {
a.platformMerchantMissionResponseList &&
a.platformMerchantMissionResponseList.forEach(k => {
k.detailInfo = { activityId: val.id, imgUrlList: [] }
k.platformMerchantMissionMaterialResponseList &&
k.platformMerchantMissionMaterialResponseList.forEach(i => {
// materialType 素材类型1文案 2图片 3视频 4专属链接
if (i.materialType == 1) {
// 文案
k.detailInfo.textContent = i.materialContent
}
if (i.materialType == 2 || i.materialType == 3) {
// 图片视频
k.detailInfo.imgUrlList.push({
url: i.materialContent,
type: i.materialType == 2 ? 'image' : 'video'
})
}
if (i.materialType == 4) {
// 链接
k.detailInfo.linkUrl = val.activityUrl
}
})
})
})
val.isloading = false
val.missionList = res
val.newtaskCalenderList = calenderFilter(JSON.parse(JSON.stringify(val.missionList)) || [], 7)
let d = new Date()
let nowDate = (d.getMonth() + 1).toString().padStart(2, '0') + '月' + d.getDate().toString().padStart(2, '0') + '日'
let ind = 0
val.calenderActiveIndex = 0
val.newtaskCalenderList.forEach((v, index) => {
v.forEach(k => {
k.time = (new Date(k.activityTime).getMonth() + 1).toString().padStart(2, '0') + '月' + new Date(k.activityTime).getDate().toString().padStart(2, '0') + '日'
k.ind = ind
let completeStatusNum = 0
k.platformMerchantMissionResponseList.forEach(i => {
if (i.completeStatus == 2) completeStatusNum++
})
if (nowDate == k.time) {
val.calenderActiveIndex = index
callBack && callBack({ activeDateIndex: ind })
}
// status 1过去日期任务全部完成 2过去日期任务有未完成的 3当前日期或未来日期
if (completeStatusNum == v.length && d.getTime() > new Date(`${k.activityTime.replace(/-/g, '/')} 23:59:59`).getTime()) {
k.status = 1
} else if (d.getTime() > new Date(`${k.activityTime.replace(/-/g, '/')} 23:59:59`).getTime()) {
k.status = 2
} else {
k.status = 3
}
ind++
})
})
val.isCollapse = false
let itemVal = `${listName}[${index}]`
callBack && callBack({ [itemVal]: val })
}).catch(err => {
console.log(err);
val.isloading = false
})
} else if (zc_3 && serviceType == 0) {
ActivityApi.getActivityEndInstallOrderList({ activityId: val.id }, { isShowLoading: true })
.then(res => {
val.isCollapse = false
res.orderList &&
res.orderList.forEach(it => {
it.time = it.createdDate ? new Date(it.createdDate).format('yyyy-MM-dd hh:mm') : ''
})
val.orderList = res.orderList
val.orderTotal = res.orderTotal
val.reInstallContactsName = res.reInstallContactsName
val.reInstallContactsPhone = res.reInstallContactsPhone
let itemVal = `${listName}[${index}]`
callBack && callBack({ [itemVal]: val })
})
.catch(err => {
val.isloading = false
})
}
})
const RESULT = {
[listName]: pageNum == 1 ? data.list : [...orginList, ...data.list],
activeTrigger: false,
total: data.total,
noResult: pageNum == 1 ? (data.list.length ? false : true) : false
}
callBack && callBack(RESULT)
}
const calenderFilter = (arr, length) => {
var _arr = []
while (arr.length) {
_arr.push(arr.splice(0, length))
}
return _arr
}
module.exports = {
taskLoginAndRegister,
authAvatarAndNickName,
handlerMiss
}
\ No newline at end of file \ No newline at end of file
var arrInclues = function(num,arr){
var flag = false
for(var i = 0;i<arr.length;i++){
if(num==arr[i]){
flag = true
}
}
return flag
}
module.exports = {
arrInclues: arrInclues
}
\ No newline at end of file \ No newline at end of file
// packageStoreAssistant/components/BoutiqueCoupon/index.js
import boutiquecouponApi from '~/api/boutiquecouponApi'
Component({
/**
* 组件的属性列表
*/
properties: {
},
lifetimes: {
ready() {
const {
boutiqueCoupon_myself_status
} = wx.$storage.get('userInfo')
this.setData({
myself: boutiqueCoupon_myself_status
})
this.refresherrefresh(false)
wx.$eventbus.on('REFRESHBOUTIQUECOUPON', () => {
this.refresherrefresh(false)
})
}
},
/**
* 组件的初始数据
*/
data: {
couponIndex: 0,
usedFlag: 'N',
useCouponList: [],
pageNum: 1,
total: 0,
totalY: 0,
totalN: 0
},
/**
* 组件的方法列表
*/
methods: {
changeMyself() {
const userInfo = wx.$storage.get('userInfo')
let {
myself
} = this.data
myself = !myself
this.setData({
myself
})
userInfo.boutiqueCoupon_myself_status = myself
wx.$storage.set('userInfo', userInfo)
let {
usedFlag
} = this.data
this.getTotal()
this.clearData(usedFlag)
},
async getMerchantCouponList() {
let couponList = []
try {
const {
merchantId
} = wx.$storage.get('userInfo'), {
code,
data,
message
} = await boutiquecouponApi.getMerchantCouponList({
merchantId
// merchantId: '44209390'
})
if (code == 0) {
console.log(data)
data.map(e => {
if (e.enabledFlag == 'Y') {
e.num = e.amount - e.getAmount
if (e.num < 0) e.num = 0
e.couponName = e.couponInfo.couponName
couponList.push(e)
}
})
this.setData({
couponList
})
} else throw message
} catch (error) {
wx.$api.showToast(error)
}
this.setData({
couponFlag: true
})
},
async getMerchantCustomerCouponList(flag) {
wx.$api.showLoading()
let {
usedFlag,
pageNum,
myself
} = this.data
try {
const {
merchantId,
uuid
} = wx.$storage.get('userInfo')
let params = {
merchantId,
// merchantId: '44209390',
pageNum,
usedFlag: flag ? flag : usedFlag
}
if (myself) params.userId = uuid
const {
code,
data,
message
} = await boutiquecouponApi.getMerchantCustomerCouponList(params)
if (code == 0) {
const {
list,
total
} = data
if (flag) {
if (flag == 'Y') this.setData({
totalY: total
})
else this.setData({
totalN: total
})
return
}
if (list.length) {
const usedBool = usedFlag === 'Y'
list.map(e => {
const time = usedBool ? e.usedTime : e.createdDate
e.time = (usedBool ? '核销' : '领券') + '时间:' + new Date(time).format('yyyy-MM-dd hh:mm')
if (!usedBool) {
if (e.customerInviteRecordDTOList?.length) {
let {
inviteStatus,
inviteDate,
} = e.customerInviteRecordDTOList.at(-1)
//inviteStatus 1待预约 2已预约 3取消预约 4已施工 5过期到店
e.appointmentTime = {
1: '待预约',
2: new Date(inviteDate).format('yyyy-MM-dd hh:mm'),
3: '取消预约',
4: '已施工',
5: '过期到店',
} [inviteStatus]
e.appointmentStatus = inviteStatus
}
}
})
this.setData({
[`useCouponList[${pageNum - 1}]`]: list
})
}
this.setData({
total
})
wx.hideLoading()
} else throw message
} catch (error) {
if (pageNum != 1) this.setData({
pageNum: pageNum - 1
})
wx.$api.showToast(String(error))
}
this.setData({
useCouponFlag: true,
refresherrefreshFlag: false
})
},
getTotal() {
this.getMerchantCustomerCouponList('N')
this.getMerchantCustomerCouponList('Y')
},
couponChange(e) {
let {
current
} = e.detail
this.setData({
couponIndex: current
})
},
jump(e) {
const {
url,
item
} = e.currentTarget.dataset, {
userType
} = wx.$storage.get('userInfo')
if (url == 'createCoupon') {
if (item.num == 0) return
if (userType != 2) {
wx.$api.showToast('请使用员工账号生成礼券')
return
}
}
wx.$router.go(`/packageStoreAssistant/packageBoutiqueCoupon/pages/${url}/${url}`, item)
},
clearData(usedFlag) {
this.setData({
usedFlag,
useCouponList: [],
pageNum: 1,
useCouponFlag: false,
nothing: false,
})
this.getMerchantCustomerCouponList()
},
changeTab(e) {
let {
type
} = e.currentTarget.dataset, {
pageNum,
usedFlag
} = this.data
const result = type ? 'Y' : 'N'
if (pageNum == 1 && usedFlag == result) return
this.clearData(result)
},
refresherrefresh(val = true) {
this.setData({
refresherrefreshFlag: val
})
let {
usedFlag
} = this.data
this.getTotal()
this.getMerchantCouponList()
this.clearData(usedFlag)
},
scrollonReachBottom() {
let {
total,
pageNum
} = this.data
if (Math.ceil(total / 10) > pageNum) {
this.setData({
pageNum: pageNum + 1
})
this.getMerchantCustomerCouponList()
} else this.setData({
nothing: true
})
}
}
})
\ 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
/* packageStoreAssistant/components/BoutiqueCoupon/index.wxss */
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.coupon-layout {
height: calc(100% - 112rpx);
.coupon-box {
height: 342rpx;
box-sizing: border-box;
padding-top: 40rpx;
position: relative;
border-bottom: 8rpx solid #F7F8FA;
.coupon-bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.coupon-swiper {
height: 100%;
.coupon {
height: 204rpx;
position: absolute;
box-shadow: 0 10rpx 20rpx 0 rgba(129, 146, 214, .24);
border-radius: 34rpx;
left: 24rpx;
width: calc(100% - 48rpx);
top: 0;
&-info {
position: absolute;
width: 100%;
height: calc(100% - 54rpx);
display: flex;
left: 0;
top: 0;
z-index: 1;
font-size: 20rpx;
color: #997256;
overflow: hidden;
}
&-type {
position: absolute;
z-index: 2;
top: 76rpx;
left: 0;
width: 176rpx;
height: 46rpx;
display: flex;
align-items: center;
justify-content: center;
transform-origin: left bottom;
transform: rotate(-45deg);
white-space: nowrap;
font-weight: 500;
font-size: 20rpx;
color: #4466F0;
// clip-path: polygon(26% 0, 74% 0, 100% 100%, 0% 100%);
}
&-bottom {
position: absolute;
width: 100%;
height: 54rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 50rpx;
font-size: 20rpx;
color: #999999;
left: 0;
bottom: 0;
z-index: 2;
}
&-text {
box-sizing: border-box;
padding: 20rpx 0 0 100rpx;
width: calc(100% - 206rpx);
color: #fff;
.coupon-title {
font-weight: 600;
font-size: 44rpx;
line-height: 60rpx;
}
.num {
font-size: 20rpx;
.val {
font-weight: 500;
color: #FFFB39;
margin: 0 6rpx;
}
}
}
.coupon-add {
position: relative;
font-weight: 600;
font-size: 24rpx;
color: #fff;
display: flex;
align-items: center;
width: 206rpx;
padding-right: 50rpx;
justify-content: flex-end;
&-btn {
box-sizing: border-box;
width: 120rpx;
height: 52rpx;
border: 2rpx solid #FFFFFF;
border-radius: 34rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
.coupon-add.disabled {
opacity: .5;
}
}
}
.dots {
position: absolute;
bottom: 28rpx;
left: 0;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
flex-wrap: wrap;
box-sizing: border-box;
padding: 0 24rpx;
.dot {
width: 12rpx;
height: 12rpx;
background: #D8D8D8;
margin: 4.5rpx;
border-radius: 100%;
flex-shrink: 0;
}
.active {
background: #4466F0;
}
}
}
.coupon-nothing {
width: 100%;
height: 100%;
display: grid;
place-items: center;
color: #000;
font-size: 28rpx;
}
.coupon-list {
background: #FFFFFF;
box-shadow: 0 0 0 0 #E9E9E9;
border-radius: 20rpx;
.tab {
height: 88rpx;
display: flex;
position: sticky;
align-items: center;
top: 0;
z-index: 2;
background: #fff;
padding: 0 20rpx;
.item {
font-size: 24rpx;
color: rgba(27, 35, 61, .9);
text-align: center;
flex-shrink: 0;
padding: 0 40rpx;
position: relative;
height: 100%;
display: flex;
align-items: center;
background: linear-gradient(to right, #708CFF, #708CFF) no-repeat;
background-size: 0;
background-position: bottom;
}
.true {
font-weight: 600;
font-size: 28rpx;
color: #1B233D;
animation: show-line .25s forwards;
}
@keyframes show-line {
0% {
background-size: 0 4rpx;
}
100% {
background-size: calc(100% - 80rpx) 4rpx;
}
}
&-btn {
display: flex;
align-items: center;
margin-left: auto;
font-size: 24rpx;
color: #1B233D;
padding-right: 8rpx;
.icon {
width: 28rpx;
height: 28rpx;
border: 2rpx solid #4466F0;
box-sizing: border-box;
margin-right: 7rpx;
border-radius: 4rpx;
}
.false {
background-color: #4466F0;
}
}
}
.list-box {
padding: 20rpx 20rpx 170rpx;
.nothing-text {
padding: 20rpx 0 !important;
}
.item {
min-height: 278rpx;
background: #FFFFFF;
box-shadow: 0 10rpx 20rpx 0 rgba(129, 146, 214, .24);
border-radius: 12rpx;
margin-bottom: 20rpx;
box-sizing: border-box;
padding: 0 40rpx 28rpx;
position: relative;
&-top {
height: 106rpx;
border-bottom: 2rpx solid #F0F1F5;
display: flex;
align-items: center;
justify-content: space-between;
&-time {
font-size: 24rpx;
color: #6E6E7A;
flex-shrink: 0;
text-align: right;
}
&-customer {
font-weight: 500;
font-size: 32rpx;
color: #1B233D;
display: grid;
grid-template-columns: 46rpx 1fr;
align-items: center;
&-icon {
width: 46rpx;
height: 46rpx;
}
&-text {
margin-left: 26rpx;
}
}
}
&-center {
box-sizing: border-box;
font-size: 24rpx;
width: calc(100% - 104rpx);
&-person {
display: grid;
grid-template-columns: 116rpx 1fr;
gap: 0 20rpx;
color: #1B233D;
align-items: center;
padding-bottom: 12rpx;
line-height: 34rpx;
&-value {
color: #6E6E7A;
}
.have {
color: #F24724;
}
.nothing {
color: #EB9109;
}
}
&-title {
font-size: 28rpx;
color: #4466F0;
font-weight: 500;
font-weight: bold;
padding: 24rpx 0;
}
}
&-coupon-icon {
position: absolute;
right: 48rpx;
bottom: 48rpx;
width: 84rpx;
height: 84rpx;
}
}
}
}
}
.nothing-text {
text-align: center;
font-size: 28rpx;
color: #333;
padding: 60rpx 0;
}
\ No newline at end of file \ No newline at end of file
<scroll-view scroll-y class="coupon-layout" refresher-enabled bindrefresherrefresh="refresherrefresh" bindscrolltolower="scrollonReachBottom" refresher-triggered="{{refresherrefreshFlag}}">
<view class="coupon-box">
<block wx:if="{{couponFlag}}">
<block wx:if="{{couponList.length}}">
<swiper class="coupon-swiper" bindchange="couponChange">
<block wx:for="{{couponList}}" wx:key="index">
<swiper-item>
<view class="coupon">
<view class="coupon-info">
<view class="coupon-type">{{item.couponInfo.couponTypeName}}</view>
<view class="coupon-text">
<view class="coupon-title text-hide">{{item.couponName}}</view>
<view class="num text-hide">剩余<text class="val">{{item.num}}</text>张</view>
</view>
<view class="coupon-add {{item.num == 0 ? 'disabled':''}}" bindtap="jump" data-url="createCoupon" data-item="{{item}}">
<view class="coupon-add-btn">发放</view>
</view>
</view>
<view class="coupon-bottom">
<view class="coupon-time">
有效期:永久
</view>
</view>
<glsx-image src="store-assistant/boutiqueCoupon/coupon.png" class="coupon-bg"></glsx-image>
</view>
</swiper-item>
</block>
</swiper>
<view class="dots" wx:if="{{couponList.length > 1}}">
<block wx:for="{{couponList}}" wx:key="index">
<view class="dot {{couponIndex == index ? 'active':''}}"></view>
</block>
</view>
</block>
<block wx:else>
<view class="coupon-nothing">
暂无礼券
</view>
</block>
</block>
</view>
<view class="coupon-list">
<view class="tab">
<view class="item {{usedFlag == 'N'}}" bindtap="changeTab">
待核销({{totalN}})
</view>
<view class="item {{usedFlag == 'Y'}}" data-type bindtap="changeTab">
已核销({{totalY}})
</view>
<view class="tab-btn" bindtap="changeMyself">
<view class="icon" hidden="{{myself}}"></view>
<view class="icon {{!myself}}" hidden="{{!myself}}">
<glsx-image class="img" src="store-assistant/boutiqueCoupon/checkbox.png"></glsx-image>
</view>
仅看自己
</view>
</view>
<block wx:if="{{useCouponFlag}}">
<block wx:if="{{useCouponList.length}}">
<view class="list-box">
<block wx:for="{{useCouponList}}" wx:key="ind" wx:for-item="i" wx:for-index="ind">
<block wx:for="{{i}}" wx:key="index">
<view class="item" bindtap="jump" data-url="couponDetail" data-item="{{item}}">
<view class="item-top">
<view class="item-top-customer">
<view class="item-top-customer-icon sprite-icon icon-customer-icon">
<glsx-image src="store-assistant/boutiqueCoupon/customer-icon.png"></glsx-image>
</view>
<view class="item-top-customer-text text-hide">{{item.customerName}}</view>
</view>
<view class="item-top-time">{{item.time}}</view>
</view>
<view class="item-center">
<view class="item-center-title">
{{item.couponName}}
</view>
<view class="item-center-person">
<view class="item-center-person-label">推荐人</view>
<view class="item-center-person-value text-hide">{{item.merchantName}}-{{item.employeeName}}</view>
</view>
<block wx:if="{{usedFlag == 'N'}}">
<view class="item-center-person">
<view class="item-center-person-label">预约时间</view>
<view class="item-center-person-value {{item.appointmentStatus != 1?'have':'nothing'}}">{{item.appointmentTime}}</view>
</view>
</block>
</view>
<view wx:if="{{usedFlag === 'Y'}}" class="item-coupon-icon">
<glsx-image src="{{item.upgradeFlag === 'Y'?'store-assistant/boutiqueCoupon/coupon-sucess.png':'store-assistant/boutiqueCoupon/coupon-fail.png'}}"></glsx-image>
</view>
</view>
</block>
</block>
<block wx:if="{{nothing}}">
<view class="nothing-text">到底了~</view>
</block>
</view>
</block>
<block wx:else>
<view class="nothing-text">暂无数据</view>
</block>
</block>
</view>
</scroll-view>
\ No newline at end of file \ No newline at end of file
import ActivityApi from '~/api/activityApi/index'
Component({
/**
* 组件的属性列表
*/
properties: {
entranceType: {
type: Number,
observer: function (val) {
this.initLocal(val)
}
}
},
/**
* 组件的初始数据
*/
data: {
outputView: {
outputValue: [{
label: '总报价量',
name: 'totalQuotationCount',
unit: ''
}, {
label: '总成交量',
name: 'totalSuccessCount',
unit: ''
}, {
label: '总产值',
name: 'totalOutputValue',
unit: ''
}, {
label: '当月报价量',
name: 'monthQuotationCount',
unit: ''
}, {
label: '当月成交量',
name: 'monthSuccessCount',
unit: ''
}, {
label: '当月产值',
name: 'monthOutputValue',
unit: ''
}, {
label: '单价',
name: 'avgPrice',
unit: ''
}, {
label: '升级率',
name: 'conversionRate',
unit: ''
}, {
label: '平均车险报价',
name: 'avgQuotationPrice',
unit: ''
}],
boutiqueOutputValue: [{
label: '发券量(总)/张',
name: 'sendCouponCountTotal',
unit: ''
}, {
label: '升级订单/单',
name: 'upgradeCountTotal',
unit: ''
}, {
label: '营业额(总)/元',
name: 'orderMoneyTotal',
unit: ''
}, {
label: '客单价/元',
name: 'averagePrice',
unit: ''
}, {
label: '转化率',
name: 'upgradeRatio',
unit: ''
}],
todayOutiqueOutputValue: [{
label: '发券量/张',
name: 'sendCouponCountToday',
unit: ''
}, {
label: '升级订单/单',
name: 'upgradeCountToday',
unit: ''
}, {
label: '营业额(总)/元',
name: 'orderMoneyTotalToday',
unit: ''
}],
todayOutputValue: [{
label: '发券量/张',
name: 'avgQuotationPrice',
unit: ''
}, {
label: '升级订单/单',
name: 'avgQuotationPrice',
unit: ''
}, {
label: '营业额(总)/元',
name: 'avgQuotationPrice',
unit: ''
}],
},
listData: [],
activeTrigger: false,
activePageNum: 1,
activeTotal: 0,
pageNum: 1,
total: 0,
pageSize: 10,
noResult: false
},
/**
* 组件的方法列表
*/
methods: {
// 初始化
initLocal(val) {
this.setData({
type: val,
listData: [],
activeTrigger: false,
activePageNum: 1,
activeTotal: 0,
pageNum: 1,
total: 0,
pageSize: 10,
noResult: false
}, () => {
this.getActivityInfo()
})
},
getActivityInfo() {
this.getOutput()
this.getStaffOutput()
this.getHistogram()
this.getTrend()
},
// 看产值-产值总览
getOutput() {
const { type } = this.data
let apiName = 'boutiquecouponOutputValue'
let params = {
merchantId: 44211765
}
if ([2].includes(type)) {
apiName = 'merchantsOutput'
params = {
merchantIds: [44211765]
}
}
ActivityApi[apiName](params).then(res => {
this.setData({
outputData: res
})
})
},
/**柱状图 */
getHistogram() {
const params = {
merchantId: 44211765,
dataType: 1, //数据类型:1报价量/ 2成交量 /3产值
timePeriod: 1, //时间类型 1本周 / 2本月 /3全年
startTime: '',
endTime: ''
}
ActivityApi.merchantsHistogram(params).then(res => {
console.log(res)
})
},
/**折线图 */
getTrend() {
const params = {
merchantId: 44211765,
dataType: 1, //数据类型:1报价量/ 2成交量 /3产值
timePeriod: 1, //时间类型 1本周 / 2本月 /3全年
startTime: '',
endTime: ''
}
ActivityApi.merchantsTrend(params).then(res => {
console.log(res)
})
},
getOutputReport() {
ActivityApi.merchantsOutputReport
},
/**员工排行 */
getStaffOutput() {
const params = {
merchantIds: [44211765],
transferName: '',
orderBy: 1, //排序:1-产值,2-成交量,3-报价量,4-转化率
}
ActivityApi.merchantsStaffOutput(params).then(res => {
console.log(res)
})
},
// 下拉刷新
activityRefresh(e) {
this.getActivityInfo()
},
jumpReport(e) {
const {time} = e.target.dataset
const {entranceType} = this.data
wx.redirectTo({
url: `/packageOutput/pages/monthReport/monthReport?time=${time}&type=${entranceType}`,
})
}
},
// lifetimes: {
// attached() {
// if(this.control)return
// this.control = true
// this.initLocal(this.data.entranceType)
// }
// },
})
{
"component": true,
"usingComponents": {
"nothing-data":"../nothingData/nothingData",
"activity-ing":"../activitying/index",
"activity-end":"../activityend/index"
}
}
\ No newline at end of file \ No newline at end of file
.output-box {
padding: 24rpx;
margin: 0rpx 16rpx;
border-radius: 32rpx;
.output-title {
font-weight: 600;
font-size: 32rpx;
color: #1B233D;
line-height: 48rpx;
margin: 20rpx 0rpx;
}
}
.output-value {
display: grid;
grid-template-columns: repeat(3, 33.33%);
row-gap: 24rpx;
padding: 32rpx;
background-image: linear-gradient(180deg, #FFFFFF 72%, #EBF1FF 100%);
border-radius: 16rpx;
&.today {
background-image: linear-gradient(180deg, #FFFFFF 64%, #FFF8E6 100%);
border-radius: 16rpx;
}
.output-item {
text-align: center;
.output-num {
font-size: 40rpx;
color: #1B233D;
line-height: 48rpx;
}
.output-label {
font-size: 24rpx;
color: #6E6E7A;
line-height: 36rpx;
margin-top: 12rpx;
}
}
}
.line-box {
width: 710rpx;
height: 584rpx;
background: #FFFFFF;
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
border-radius: 20rpx;
margin: 24rpx auto 0rpx;
}
.bar-box {
width: 710rpx;
height: 516rpx;
background: #FFFFFF;
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
border-radius: 20rpx;
margin: 24rpx auto 0rpx;
}
.staf-box {
width: 710rpx;
background: #FFFFFF;
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
border-radius: 20rpx;
margin: 24rpx auto 0rpx;
}
.table-box {
display: flex;
justify-content: center;
margin: 48rpx 0;
.btn-box {
width: 316rpx;
height: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 32rpx;
border-radius: 20rpx;
background: #FFFFFF;
color: #1B233D;
border: 2rpx solid #DCDFE6;
&.month-btn {
background-image: linear-gradient(-81deg, #556AF5 0%, #7197FF 100%);
margin-left: 22rpx;
color: #FFFFFF;
}
}
}
\ No newline at end of file \ No newline at end of file
<scroll-view scroll-y class="content" class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscroll="scrollIng" refresher-triggered="{{activeTrigger}}" style="{{'height: calc(100% - 22rpx);'}}">
<view class="output-box">
<view class="output-title">产值总览</view>
<view class="output-value">
<view class="output-item" wx:for="{{outputView[entranceType == 2?'outputValue':'boutiqueOutputValue']}}">
<view class="output-num">{{outputData[item.name]||0}}</view>
<view class="output-label">{{item.label}}</view>
</view>
</view>
<view class="output-title">当日日新增</view>
<view class="output-value today">
<view class="output-item" wx:for="{{outputView[entranceType ==2 ?'todayOutputValue':'todayOutiqueOutputValue']}}">
<view class="output-num">{{outputData[item.name]|| 0}} </view>
<view class="output-label">{{item.label}}</view>
</view>
</view>
</view>
<view class="line-box">
</view>
<view class="bar-box">
</view>
<view class="staf-box">
555
</view>
<view class="table-box">
<view class="btn-box day-btn" bindtap="jumpReport" data-time="day">查看日报表</view>
<view class="btn-box month-btn" bindtap="jumpReport" data-time="month">查看月报表</view>
</view>
</scroll-view>
\ No newline at end of file \ No newline at end of file
import ActivityApi from '~/api/activityApi/index'
import {handlerMiss} from '~/packagesList/common/common'
Component({
/**
* 组件的属性列表
*/
properties: {
isHaveSubcribe:Boolean,
ids:Array,
entranceType:{
type:Number,
observer:function(val){
if(val>-1&&this.control){
this.initLocal(val)
}
}
},
fresh:{
type:Boolean,
observer: function (val) {
if(val){
this.setData({
pageNum: 1
}, () => {
this.initLocal(this.data.entranceType)
})
}
}
}
},
/**
* 组件的初始数据
*/
data: {
listData: [],
activeTrigger: false,
activePageNum: 1,
activeTotal: 0,
pageNum: 1,
total: 0,
pageSize: 10,
noResult:false
},
/**
* 组件的方法列表
*/
methods: {
// 初始化
initLocal(val){
this.setData({
listData: [],
activeTrigger: false,
activePageNum: 1,
activeTotal: 0,
pageNum: 1,
total: 0,
pageSize: 10,
noResult:false
},()=>{
this.getActivity(val)
})
},
// 获取数据
getActivity(type){
let { pageSize, pageNum,listData,ids } = this.data
let paraList = [],apiName = 'getActivityList',para = {pageNum,pageSize}
if(type==1){
ids.forEach(el=>{
if((el.serviceType==1&&type==1) || (el.serviceType==2&&type==2)){
if(el.activityId){
paraList.push(el.activityId)
}
}
})
para.ids = paraList
apiName = 'getSubscribeListByIdsApi'
if(!paraList.length)return this.setData({noResult:true})
}else if([2,5,6].includes(type)){
para.subscribe = type
apiName = 'getActivityPageBySubscribe'
}
ActivityApi[apiName](para).then(res=>{
if(res&&res.list){
handlerMiss(res,{serviceType:type,pageNum,listName:'listData',orginList:listData},(result)=>{
if(result&&result.total&&type==0){
this.triggerEvent('total',{type:0,total:result.total || 0})
}
this.setData(result)
})
}
})
},
toFresh(e) {
if (e.detail) {
this.setData({
listData: e.detail
})
}
},
// 下拉刷新
activityRefresh(e) {
this.setData({
pageNum: 1
},()=>{
this.getActivity(this.data.entranceType)
// 刷新获取订阅配置
if(!this.data.isHaveSubcribe){
wx.$eventbus.emit("RESFRESH_SUBCRIBE",{type:this.data.entranceType,fresh:true})
}
})
},
// 上拉触底加载
scrollonReachBottom(e) {
let { pageNum, total, pageSize } = this.data
// 判断当前页是否是末页
if (Math.floor(total / pageSize) == pageNum - 1) return
this.setData({
pageNum: pageNum + 1
},()=>{
this.getActivity(this.data.entranceType)
})
},
// 滚动中
scrollIng(e) {},
},
lifetimes: {
attached() {
if(this.control)return
this.control = true
this.initLocal(this.data.entranceType)
}
},
})
{
"component": true,
"usingComponents": {
"nothing-data":"../nothingData/nothingData",
"activity-ing":"../activitying/index",
"activity-end":"../activityend/index"
}
}
\ No newline at end of file \ No newline at end of file
.content-box{
padding: 0 22rpx 150rpx 24rpx;
}
\ No newline at end of file \ No newline at end of file
<scroll-view scroll-y class="content" class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" refresher-triggered="{{activeTrigger}}" style="{{!listData.length ? 'padding-top: 16rpx;' : ''}}{{'height: calc(100% - 112rpx);'}}">
<block wx:if="{{!noResult}}">
<view class="content-box">
<block wx:for="{{listData}}" wx:key="index">
<block wx:if="{{item.activityStatus!=3}}">
<activity-ing tabType="{{entranceType}}" bind:refreshList="toFresh" index="{{index}}" activeList="{{listData}}" item="{{item}}" activeDateIndex="{{activeDateIndex}}"></activity-ing>
</block>
<block wx:else>
<activity-end tabType="{{entranceType}}" bind:refreshList="toFresh" index="{{index}}" activeList="{{listData}}" item="{{item}}"></activity-end>
</block>
</block>
</view>
</block>
<block wx:else>
<nothing-data description="请前往嘀加企微管家后台创建"></nothing-data>
</block>
</scroll-view>
\ No newline at end of file \ No newline at end of file
// pages/tab/index/components/activityCalender/activityCalender.js
import {
imgUrlMixin
} from '~/mixins/index'
import ActivityApi from '~/api/activityApi/index'
Component({
/**
* 组件的属性列表
*/
behaviors: [imgUrlMixin],
properties: {
data: {
type: Object,
value: {},
observer(newVal) {}
},
// 展开收起
isCollapse: {
type: Boolean,
value: false
},
// 默认选中日期(今天)
activeDateIndex: {
type: Number
},
tabType: Number
},
/**
* 组件的初始数据
*/
data: {
today: new Date().format('MM月dd日')
},
/**
* 组件的方法列表
*/
methods: {
// 任务时间大于7天切换
changeTaskCalender(e) {
let data = this.properties.data
if (data) data.calenderActiveIndex = e.detail.current
this.setData({
data
})
},
myevent(e) {
this.setData({
finishFlag: e.detail.flag,
finishKey: e.detail.index
})
},
finish(e) {
let {
item,
index
} = e.currentTarget.dataset
let {
finishFlag
} = this.data
// wx.$router.go('packageActivity.taskDetail', {...item})
if (finishFlag) {
return wx.showToast({
title: '正在下载中',
icon: 'none'
})
}
if (!item.platformMerchantMissionMaterialResponseList) return // 数据为空处理 未下载完
let taskDetailBox = this.selectComponent("#taskDetailBox")
taskDetailBox.finishTask(item, index)
},
// 切换日期查看任务
changeDate(e) {
let {
dateindex
} = e.currentTarget.dataset
this.setData({
activeDateIndex: dateindex
})
},
toTaskDetail(e) {
let {
missionid,
type
} = e.currentTarget.dataset
if (type == 1) return
if (type == 6) {
wx.navigateTo({
url: '/packageStoreAssistant/packageActivity/pages/myFollow/index?activityId='+this.data.data.id,
});
// wx.$router.go('/packageStoreAssistant/packageActivity/pages/myFollow/index', {
// activityId: this.data.data.id,
// })
return
}
wx.$router.go('/packageStoreAssistant/packageActivity/pages/taskDetail/taskDetail', {
missionId: missionid,
tabType: this.data.tabType
})
},
toHandler(e) {
const {
index,
item
} = e.currentTarget.dataset
console.log(item);
let isHaveLink = false
let arr = []
if (item.platformMerchantMissionMaterialResponseList) {
item.platformMerchantMissionMaterialResponseList.forEach(el => {
if (el.materialType == 4) {
isHaveLink = true
}
arr.push(el.materialType)
})
}
if (isHaveLink) {
this.finishTask(item.detailInfo)
this.jumpZC(item.detailInfo.activityId)
return
}
if (arr.indexOf(2) != -1 || arr.indexOf(3) != -1) {
let {
missionId
} = item
wx.$router.go('/packageStoreAssistant/packageActivity/pages/taskDetail/taskDetail', {
missionId,
tabType: this.data.tabType
})
return
}
this.tracker(item.detailInfo.activityId)
this.finishTask(item.detailInfo, index)
},
jumpZC(activityId) {
const userStorage = wx.$storage.get('userInfo')
let query = {
id: activityId,
exclusiveUuid: userStorage.uuid,
merchantId: userStorage.merchantId,
isExclusive: 1,
shareStaffUuid: userStorage.uuid,
form: 'task'
}
if (this.data.tabType == 0 || !this.data.tabType) {
wx.$router.go('/pages/crowdfunding/index/index', query)
} else {
query.notIntercept = true
wx.$router.go('/packageShopmall/packageExpandedGold/pages/activity/index/index', query)
}
},
finishTask(item, index) {
Promise.all([this.copyText(item)])
.then(() => {
wx.showToast({
title: index == 0 ? '文案已复制到剪切板,纯文案内容请直接通过微信发送给客户' : '文案已复制到剪切板,纯文案内容请前往朋友圈发送',
icon: 'none'
})
})
.catch(err => {
wx.showToast({
title: err,
icon: 'none'
})
})
},
copyText(item) {
return new Promise((resolve, reject) => {
let {
textContent
} = item
let copyData = ''
if (textContent) {
copyData = textContent
}
let _this = this
if (!copyData.length) {
// 复制内容为空 不做处理
return resolve()
}
wx.setClipboardData({
data: copyData,
success() {
resolve()
},
fail() {
reject('文案复制失败')
}
})
})
},
tracker(id) {
const USERINFO = wx.$storage.get('userInfo')
let data = {
action_type: 4, // 事件类型固定为4-分享
item_type: 3, // 商品类型,固定为3-众筹活动
merchant_id: USERINFO.merchantId, // 门店号
staff_uuid: USERINFO.uuid,
business_type: 1, // 业务类型,固定为1
add_way: 104, // 来源,固定为104
create_time: new Date().format('yyyy-MM-dd hh:mm:ss'), // 分享时间
item_id: id,
share_staff_type: 3
}
let jsonList = [JSON.stringify(data)]
ActivityApi.taskShareReport({
jsonList
}).then(res => {})
},
}
})
\ 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
/* pages/tab/index/components/activityCalender/activityCalender.wxss */
.title{
padding-left: 8rpx;
font-size: 32rpx;
color: #1B233D;
font-weight: 600;
text{
font-size: 28rpx;
color: #2D2D33;
font-weight: 400;
}
}
.calender-box{
padding: 32rpx 0;
position: relative;
.swiper{
height: 112rpx;
.swiper_item{
display: flex;
.time-box{
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
background: #F7F8FA;
border-radius: 6px;
margin: 0 4rpx;
image{
width: 48rpx;
height: 48rpx;
margin-bottom: 10rpx;
}
.task-time{
font-size: 18rpx;
color: #1B233D;
}
}
.completed{
background-image: linear-gradient(180deg, #FFD84B 28%, #FFB33E 76%);
.task-time{
color: #FFFFFF;
}
}
.active{
background-image: linear-gradient(180deg, #FFF7DB 15%, #FFF1E0 87%);
.task-time{
color: #1B233D;
}
}
}
}
.swiper-dots{
display: flex;
align-items: center;
justify-content: center;
position: absolute;
width: 100%;
bottom: 24rpx;
left: 0;
.dots {
width: 16rpx;
height: 6rpx;
margin: 0 4rpx;
border-radius: 3rpx;
background: #E1E4EB;
transition: all .5s;
}
.dots.active{
width: 24rpx;
background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%);
}
}
}
.calender-box.p-b-54{
padding-bottom: 54rpx;
}
.task-show-box{
.item-box{
border-bottom: 1px solid #F0F1F5;
.task-item{
padding: 24rpx 0;
// padding: 24rpx 0 0 0;
display: flex;
align-items: center;
// justify-content: space-between;
margin-bottom: 7rpx;
position: relative;
.left{
display: flex;
position: relative;
image{
width: 80rpx;
height: 80rpx;
margin-right: 16rpx;
flex-shrink: 0;
}
.task-message{
display: flex;
flex-flow: column;
justify-content: space-around;
.task-title{
font-family: PingFangSC-Medium;
display: flex;
align-items: center;
flex-wrap: nowrap;
font-size: 28rpx;
font-weight: 500;
color: #1B233D;
word-break: break-all;
image{
width: 28rpx;
height: 28rpx;
margin: 0;
flex-shrink: 0;
}
.integral-num{
font-family: PingFangSC-Medium;
flex-shrink: 0;
font-size: 24rpx;
font-weight: 500;
color: #FE5662;
}
}
.task-content{
font-size: 22rpx;
word-break: break-all;
color: #9299AD;
}
}
.unstart{
position: absolute;
left: 0;
bottom: 0;
width: 80rpx;
height: 32rpx;
background: rgba(0, 0, 0, 0.5);
border-radius: 8rpx 8rpx 12rpx 12rpx;
font-weight: 400;
font-size: 20rpx;
color: #FFFFFF;
}
}
.right{
width: calc(100% - 120rpx);
.title-wrap{
display: flex;
align-items: center;
.text-title{
font-family: PingFangSC-Medium;
flex-wrap: nowrap;
font-size: 28rpx;
font-weight: 500;
color: #1B233D;
word-break: break-all;
}
.icon{
width: 28rpx;
height: 28rpx;
margin: 0;
flex-shrink: 0;
}
.integral-num{
font-family: PingFangSC-Medium;
flex-shrink: 0;
font-size: 24rpx;
font-weight: 500;
color: #FE5662;
}
}
.task-content{
font-size: 22rpx;
word-break: break-all;
color: #9299AD;
}
}
.task-btn{
margin-left: 32rpx;
display: flex;
align-items: center;
text-align: center;
.btn{
width: 84rpx;
height: 84rpx;
// line-height: 48rpx;
// display: flex;
// justify-content: center;
// align-items: center;
// width: 116rpx;
// height: 48rpx;
// background: #FEF1F4;
// border: 2rpx solid rgba(254,86,98,0.40);
// border-radius: 12rpx;
// font-size: 24rpx;
// color: #FE5662;
}
.primary{
border: none;
width: 120rpx;
height: 56rpx;
line-height: 56rpx;
background-image: linear-gradient(270deg, #FF3E7F 0%, #FE624B 100%);
border-radius: 6px;
color: #FFFFFF;
}
.grey-btn{
color: #9299AD;
border: 2rpx solid #CACDD5;
background: #F5F6F7;
}
.btn_title{
margin-top: 8rpx;
font-size: 11px;
color: #FE5662;
}
}
.right-compelete-icon{
position: absolute;
right: 40rpx;
top: 50%;
transform: translateY(-50%);
width: 84rpx;
height: 84rpx;
}
.right-arrow-icon{
position: absolute;
right: 0;
top: 50%;
transform: translate(0,-50%);
width: 24rpx;
height: 24rpx;
}
}
}
.item-box:last-child{
border: none;
margin: 0;
}
}
.task-share{
padding: 0 0 16rpx 0;
.btn{
font-weight: 400;
font-size: 24rpx;
color: #1B233D;
.icon{
width: 28rpx;
height: 28rpx;
margin-right: 8rpx;
}
}
}
.flex_cc{
display: flex;
align-items: center;
justify-content: center;
}
.flex_scb{
display: flex;
align-items: center;
justify-content: space-between;
}
.flex_sac{
display: flex;
align-items: center;
justify-content: space-around;
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/index/components/activityCalender/activityCalender.wxml-->
<wxs src="../index.wxs" module="fn"></wxs>
<block wx:if="{{!isCollapse}}">
<view class="title">任务日历<text> · {{data.missionList[activeDateIndex].platformMerchantMissionResponseList.length}}</text></view>
<view wx:if="{{data.newtaskCalenderList.length}}" class="calender-box {{data.newtaskCalenderList.length > 1 ? 'p-b-54' : ''}}">
<swiper class="swiper" current="{{data.calenderActiveIndex}}" bindchange="changeTaskCalender" data-index="{{index}}">
<block wx:for="{{data.newtaskCalenderList}}" wx:for-item="val" wx:for-index="k" wx:key="k">
<swiper-item class='swiper_item'>
<block wx:for="{{val}}" wx:for-item="v" wx:for-index="j" wx:key="j">
<view class="time-box {{v.status == 1 ? 'completed' : v.status == 2 ? 'past' : ''}} {{activeDateIndex == v.ind ? 'active' : ''}}" bind:tap="changeDate" data-dateindex="{{v.ind}}">
<!-- <image webp src="{{IMGURL}}store-assistant/{{v.status == 1 ? 'task_completed.png' : v.status == 2 ? 'calender_past_integral_icon.png' : 'calender_integral_icon.png'}}"></image> -->
<glsx-image webp src="store-assistant/{{v.status == 1 ? 'task_completed.png' : v.status == 2 ? 'calender_past_integral_icon.png' : 'calender_integral_icon.png'}}"></glsx-image>
<view class="task-time">{{v.time==today?'今天':v.time}}</view>
</view>
</block>
</swiper-item>
</block>
</swiper>
<block wx:if="{{data.newtaskCalenderList.length > 1}}">
<view class="swiper-dots">
<block wx:for="{{data.newtaskCalenderList}}" wx:for-item="value" wx:for-index="inde" wx:key="inde">
<view class="dots {{data.calenderActiveIndex == inde ?'active':''}}"></view>
</block>
</view>
</block>
</view>
<view class="task-show-box">
<block wx:for="{{data.missionList[activeDateIndex].platformMerchantMissionResponseList}}" wx:for-item="val" wx:for-index="ky" wx:key="ky">
<view catch:tap="toTaskDetail" data-type="{{val.missonType}}" data-missionid="{{val.missionId}}" class="item-box">
<view class="task-item">
<view class="left">
<glsx-image webp src="store-assistant/task_icon_{{val.missonType}}.png"></glsx-image>
<block wx:if="{{fn.timeFilter(data.missionList[activeDateIndex].activityTime, 2)}}">
<view wx:if="{{val.completeStatus != 2}}" class="unstart flex_cc">未开始</view>
</block>
</view>
<view class="right">
<view class="title-wrap">
<view class="text-title">{{fn.getString(val.missionName,12)}}</view>
<!-- <view wx:else class="text-title">您有{{totalNum || 0}}名意向用户待跟进</view> -->
<block wx:if="{{val.gainScore}}">
<glsx-image class="icon" webp src="store-assistant/integral_icon.png"></glsx-image>
<view class="integral-num">+{{val.gainScore}}积分</view>
</block>
</view>
<view class="task-content">{{val.missonDesc}}</view>
</view>
<block wx:if="{{fn.timeFilter(data.missionList[activeDateIndex].activityTime, 1) || val.completeStatus == 2}}">
<glsx-image wx:if="{{val.completeStatus == 2}}" class="right-compelete-icon" src="store-assistant/complete.png"></glsx-image>
</block>
<glsx-image class="right-arrow-icon" src="store-assistant/right_arrow_grey_icon.png?v={{img_version}}" />
<!-- <view class="left">
<glsx-image webp src="store-assistant/task_icon_{{val.missonType}}.png"></glsx-image>
<view class="task-message" wx:if="{{val.missonType!=6}}">
<view class="task-title">
<view class="text">{{val.missionName}}</view>
<block wx:if="{{val.gainScore}}">
<glsx-image webp src="store-assistant/integral_icon.png"></glsx-image>
<view class="integral-num">+{{val.gainScore}}积分</view>
</block>
</view>
<view class="task-content">{{val.missonDesc}}</view>
</view>
<view class="task-message" wx:else>
<view class="task-title">
<view class="text">您有{{totalNum?totalNum:0}}名意向用户待跟进</view>
<block wx:if="{{val.gainScore}}">
<glsx-image webp src="store-assistant/integral_icon.png"></glsx-image>
<view class="integral-num">+{{val.gainScore}}积分</view>
</block>
</view>
<view class="task-content">{{val.missonDesc}}</view>
</view>
<block wx:if="{{fn.timeFilter(data.missionList[activeDateIndex].activityTime, 2)}}">
<view wx:if="{{val.completeStatus != 2}}" class="unstart flex_cc">未开始</view>
</block>
</view>
<view class="task-btn">
<block wx:if="{{fn.timeFilter(data.missionList[activeDateIndex].activityTime, 1) || val.completeStatus == 2}}">
<glsx-image wx:if="{{val.completeStatus == 2}}" class="btn" src="store-assistant/complete.png"></glsx-image>
</block>
<glsx-image style="width:24rpx;height:24rpx;margin-left: 12rpx;" src="store-assistant/right_arrow_grey_icon.png?v={{img_version}}" />
</view> -->
</view>
<!-- 分享类任务 显示物料 -->
<view wx:if="{{val.missonType!=1&&val.missonType!=6}}" class="task-share flex_sac">
<view data-index="{{0}}" data-item="{{val}}" catch:tap="toHandler" class="btn flex_cc">
<glsx-image class="icon" webp src="store-assistant/share/index_share_hy.png" />
<text>分享好友</text>
</view>
<view data-index="{{1}}" data-item="{{val}}" catch:tap="toHandler" class="btn flex_cc">
<glsx-image class="icon" webp src="store-assistant/share/index_share_pyq.png" />
<text>发朋友圈</text>
</view>
</view>
</view>
</block>
</view>
</block>
import { imgUrlMixin } from '~/mixins/index'
Component({
/**
* 组件的属性列表
*/
behaviors: [imgUrlMixin],
properties: {
data: {
type: Object,
value: {},
observer(v) {
if (v) {
// 活动概览数据处理
let s = v.statics
if (s && v.activityStatus != 3) {
v.overviewData = { // 活动中
browseData: {
all: { title: '总浏览', num: s.browseCount, sort: s.browseCountRank },
today: { title: '今日浏览', num: s.todayBrowseCount, sort: s.todayBrowseCountRank }
},
shareData: {
all: { title: '总产值', num: this.priceFormat(s.totalAmount || 0), sort: 0 },
today: { title: '今日产值', num: this.priceFormat(s.todayAmount || 0), sort: 0 }
},
visitorData: {
all: { title: '总访客', num: s.fansCount, sort: s.fansCountRank },
today: { title: '今日访客', num: s.todayFansCount, sort: s.todayFansCountRank }
},
orderData: {
all: { title: '总订单', num: s.orderCount, sort: s.orderCountRank },
today: { title: '今日订单', num: s.todayOrderCount, sort: s.todayOrderCountRank }
}
}
// if(v.tabType&&v.tabType==2){
// v.overviewData.shareData.all = { title: '门店客户群', num: s.merchantCustomGroupCount, sort: 0 }
// v.overviewData.shareData.today = { title: '个人客户群', num: s.personCustomGroupCount, sort: 0 }
// }
} else if (s) {
v.overviewData = [ // 活动诊断
{ title: '浏览', num: s.browseCount, sort: s.browseCountRank },
// {title: '产值', num: s.shareCount, sort: s.totalAmount},
{ title: '访客', num: s.fansCount, sort: s.fansCountRank },
{ title: '订单', num: s.orderCount, sort: s.orderCountRank }
]
}
this.setData({ data: v })
}
}
},
activityOverviewList: {
type: Array,
value: []
},
backStyle: {
type: Array,
value: []
},
textType: {
type: Number,
value: 0
}
},
/**
* 组件的初始数据
*/
data: {
textTypeList: ['', '当前排名:', '最终排名:']
},
/**
* 组件的方法列表
*/
methods: {
// 跳转
jump(e) {
let { index } = e.currentTarget.dataset
let itemData = this.data.data
console.log(itemData)
if (index < 2) return // 分享和浏览数据不作跳转
switch (index) {
case 2: // 访客
wx.$router.go("/packageStoreAssistant/packageActivity/pages/visitor/visitor", { ...itemData })
break
case 3: // 订单
wx.$router.go("/packageStoreAssistant/packageActivity/pages/order/order", { ...itemData })
break
}
},
// 价格格式化
priceFormat(num, point = 2) {
let numStr = num.toString().split('.')[0]
if (numStr.length < 6) { // 判断数字有多长,如果小于6,,表示10万以内的数字,让其直接显示
return numStr;
} else if (numStr.length >= 6 && numStr.length <= 8) { // 如果数字大于6位,小于8位,让其数字后面加单位万
point = 0
let decimal = numStr.substring(numStr.length - 4, numStr.length - 4 + point)
console.log(decimal);
// 由千位,百位组成的一个数字
return parseFloat(parseInt(num / 10000) + '.' + decimal) + '万'
} else if (numStr.length > 8) { // 如果数字大于8位,让其数字后面加单位亿
let decimal = numStr.substring(numStr.length - 8, numStr.length - 8 + point);
return parseFloat(parseInt(num / 100000000) + '.' + decimal) + '亿'
}
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/components/activityOverview/activityOverview.wxss */
.active-overview{
display: flex;
flex-wrap: wrap;
.wrapper{
flex: 1;
display: flex;
flex-direction: column;
// height: 188rpx;
border-radius: 8px;
padding: 24rpx 12rpx;
box-sizing: border-box;
min-width: calc((100% - 32rpx) / 2);
}
.overview-item-box{
width: 100%;
height: 100%;
// flex: 1;
display: flex;
// height: 188rpx;
// border-radius: 8px;
// padding: 24rpx 12rpx;
// box-sizing: border-box;
// min-width: calc((100% - 32rpx) / 2);
.all, .today{
flex: 1;
display: flex;
flex-flow: column;
align-items: center;
justify-content: space-between;
.title{
color: #6E6E7A;
font-size: 24rpx;
}
.primary-title{
color: #4466F0;
display: flex;
align-items: center;
}
.number{
color: #2D2D33;
font-size: 44rpx;
font-weight: 600;
}
.sort{
font-size: 20rpx;
color: #2D2D33;
line-height: 28rpx;
.up{
color: #EB4E4E;
}
.down{
color: #2FB87A;
}
}
}
}
.btn-box{
padding: 32rpx 60rpx 0 60rpx;
display: flex;
justify-content: space-between;
}
.checkDetail{
width: 160rpx;
height: 48rpx;
background: rgba(255,255,255,0.20);
border: 1rpx solid #4466F0;
border-radius: 36rpx;
font-weight: 400;
font-size: 24rpx;
color: #4466F0;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
margin: 0 auto;
margin-top: 24rpx;
}
.godetail{
width: 236rpx;
margin: 0;
}
.flex_sac{
display: flex;
justify-content: space-around;
}
}
\ No newline at end of file \ No newline at end of file
<!-- pages/tab/index/components/activityOverview/activityOverview.wxml -->
<view>
<wxs src="../index.wxs" module="fn"></wxs>
<!-- 活动中 -->
<view wx:if="{{textType == 1}}" class="active-overview">
<block wx:for="{{activityOverviewList}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="wrapper" style="{{backStyle[ind]}}">
<view class="overview-item-box">
<view class="all">
<view class="title">{{data.overviewData[i].all.title}}</view>
<view class="number">{{data.overviewData[i].all.num || 0}}</view>
<view class="sort" wx:if="{{ind > 1}}">
<text>当前排名:</text>
{{data.overviewData[i].all.sort || '-'}}
</view>
<!-- <view wx:if="{{ind != 1}}" class="sort"><text>当前排名:</text>{{data.overviewData[i].all.sort || '-'}}</view>
<view wx:else class="sort"><text>排名 </text><text class="{{!data.overviewData[i].all.sort ? '' : (data.overviewData[i].all.sort > 0 ? 'up' : 'down')}}">{{fn.mathABS(data.overviewData[i].all.sort) || '-'}}<text wx:if="{{data.overviewData[i].all.sort}}">{{data.overviewData[i].all.sort > 0 ? ' ⬆ ' : ' ⬇ '}}</text></text></view> -->
</view>
<view class="today">
<view class="title">{{data.overviewData[i].today.title}}</view>
<view class="number">{{data.overviewData[i].today.num || 0}}</view>
<view class="sort" wx:if="{{ind > 1}}">
<text>当前排名:</text>
{{data.overviewData[i].today.sort || '-'}}
</view>
<!-- <view wx:if="{{ind != 1}}" class="sort"><text>当前排名:</text>{{data.overviewData[i].today.sort || '-'}}</view>
<view wx:else class="sort"><text>排名 </text><text class="{{!data.overviewData[i].today.sort ? '' : (data.overviewData[i].today.sort > 0 ? 'up' : 'down')}}">{{fn.mathABS(data.overviewData[i].today.sort) || '-'}}<text wx:if="{{data.overviewData[i].today.sort}}">{{data.overviewData[i].today.sort > 0 ? ' ⬆ ' : ' ⬇ '}}</text></text></view> -->
</view>
</view>
<view wx:if="{{ind > 1}}" bind:tap="jump" data-index="{{ind}}" class="checkDetail">查看详情</view>
</view>
</block>
</view>
<!-- 活动诊断 -->
<view wx:else class="active-overview">
<view class=" wrapper" style="{{backStyle[0]}}">
<view class="overview-item-box">
<view class="all" wx:for="{{data.overviewData}}" wx:for-item="val" wx:for-index="key" wx:key="key" data-index="{{key}}">
<view class="title">{{val.title}}</view>
<view class="number">{{val.num || 0}}</view>
<view class="sort">
<text>最终排名:</text>
{{val.sort || '-'}}
</view>
</view>
</view>
<view class="btn-box flex_sac">
<view bind:tap="jump" data-index="{{2}}" class="checkDetail godetail">访客详情</view>
<view bind:tap="jump" data-index="{{3}}" class="checkDetail godetail">订单详情</view>
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// pages/tab/index/components/activityTop/activityTop.js
import index_const from "../../index_const"
Component({
/**
* 组件的属性列表
*/
properties: {
data: {
type: Object,
value: {}
},
widthStyle: {
type: String
},
tabType:Number
},
/**
* 组件的初始数据
*/
data: {
activityTypList: index_const.data.activityTypList,
activityTypeStyle: 'margin-top: 8rpx;height: 44rpx;line-height: 44rpx;',
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/components/activityTop/activityTop.wxss */
.active-top{
display: flex;
.active-img{
flex-shrink: 0;
position: relative;
width: 160rpx;
height: 160rpx;
margin-right: 24rpx;
.thum-icon{
width: 100%;
height: 100%;
position: absolute;
border-radius: 16rpx;
overflow: hidden;
top: 0;
left: 0;
}
.active-type{
position: absolute;
top: 0;
left: 0;
width: 72rpx;
height: 40rpx;
background-image: linear-gradient(90deg, #FFF3A2 7%, #FFDA85 95%);
border-radius: 16rpx 0 24rpx 0;
color: #673F00;
font-size: 24rpx;
text-align: center;
}
}
.active-title{
flex: 1;
display: flex;
flex-flow: column;
justify-content: space-between;
padding: 8rpx 0;
.name{
// display: flex;
// align-items: center;
.name-left{
font-weight: 600;
font-size: 36rpx;
color: #1B233D;
line-height: 48rpx;
word-break: break-all;
.activity-type{
float: right;
line-height: 44rpx;
font-size: 28rpx;
font-weight: 400;
color: #FE5662;
margin-top: 4rpx;
image{
margin-top: 4rpx;
width: 32rpx;
height: 32rpx;
}
}
}
.right{
display: flex;
flex-flow: 1;
font-size: 28rpx;
align-items: center;
image{
width: 32rpx;
height: 32rpx;
}
}
}
.time{
color: #7A8299;
font-size: 28rpx;
text{
color: #1B233D;
}
}
}
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/index/components/activityTop/activityTop.wxml-->
<view>
<view class="active-top">
<view class="active-img">
<view class="thum-icon">
<image webp src="{{!tabType?data.activityImg:data.activityBigImg}}"></image>
</view>
<view wx:if="{{!tabType}}" class="active-type">{{activityTypList[0]}}</view>
</view>
<view class="active-title">
<view class="name">
<!-- <view class="left" style="{{widthStyle}}">{{data.activityName}}</view> -->
<view class="name-left" style="{{activityNameStyle}}">{{data.activityName}}<view wx:if="{{data.titleIsWarp}}" class="activity-type"><slot></slot></view></view>
<view wx:if="{{!data.titleIsWarp}}" class="right" style="{{activityTypeStyle}}">
<slot></slot>
</view>
</view>
<view class="time">
<text>{{data.startTime}}</text> 至 <text>{{data.endTime}}</text>
</view>
</view>
</view>
</view>
import ActivityApi from '~/api/activityApi/index'
import { domain } from '~/utils/request/environment'
import { toUnicode } from '~/utils/format'
Component({
/**
* 组件的属性列表
*/
properties: {
item: Object,
activeList:Array,
index:Number,
tabType:Number,// 0众筹 1膨胀金
},
/**
* 组件的初始数据
*/
data: {
activityOverviewList: ['overviewData'],
backStyle: ['background-image: linear-gradient(180deg, #FFFFFF 72%, #EBF1FF 100%);margin: 0 0 16rpx 0;']
},
/**
* 组件的方法列表
*/
methods: {
toPengzhangjin(e){
let { item } = e.currentTarget.dataset
const userStorage = wx.$storage.get('userInfo')
let query = {
id: item.id,
exclusiveUuid: userStorage.uuid,
merchantId: userStorage.merchantId,
isExclusive: 1,
shareStaffUuid: userStorage.uuid,
form: 'task',
shareStaffType: 3,
notIntercept:true
}
wx.$router.go('/packageShopmall/packageExpandedGold/pages/activity/index/index', query)
},
// 活动详情
goToDetail(e) {
let { item } = e.currentTarget.dataset
let h5Url = this.filterJumpUrl(item)
console.log(h5Url)
wx.$router.jumpH5(h5Url)
},
// 活动战报
jump(e) {
let { item } = e.currentTarget.dataset
wx.$router.go('/packageStoreAssistant/packageActivity/pages/warReport/warReport', item)
},
// 刷新预约订单数据
toFresh(e) {
this.collapseClick(e, true)
},
// 点击事件
collapseClick(e, fresh) {
let { key, flag } = e.currentTarget.dataset
let { activeList } = this.data
activeList.forEach((val, ind) => {
if (key == ind) {
if ((flag && !val.orderList) || (flag && fresh)) {
val.isloading = true
ActivityApi.getActivityEndInstallOrderList({ activityId: val.id })
.then(res => {
res.orderList &&
res.orderList.forEach(it => {
it.time = it.createdDate ? new Date(it.createdDate).format('yyyy-MM-dd hh:mm') : ''
})
val.isloading = false
val.isCollapse = false
val.orderList = res.orderList
val.orderTotal = res.orderTotal
val.reInstallContactsName = res.reInstallContactsName
val.reInstallContactsPhone = res.reInstallContactsPhone
this.setData({
item: val
})
})
.catch(err => {
val.isloading = false
this.setData({
item: val
})
})
} else {
val.isCollapse = !flag
}
} else {
val.isCollapse = true
val.isloading = false
}
})
this.triggerEvent('refreshList',activeList)
this.setData({
activeList,
item:activeList[key]
})
},
filterJumpUrl(item) {
const userStorage = wx.$storage.get('userInfo')
return `${domain}/scrm-wx-merchant-activity/#/?id=${item.id}&merchantId=${userStorage.merchantId}&shareStaffUuid=${userStorage.uuid}&shareStaffName=${toUnicode(userStorage.name)}&isExclusive=1&exclusiveUuid=${userStorage.uuid}&shareStaffType=2&sharedTime=${Date.now()}`
},
}
})
{
"component": true,
"usingComponents": {
"activity-top": "../activityTop/activityTop",
"activity-overview": "../activityOverview/activityOverview",
"invert-analyse": "../invertAnalyse/invertAnalyse",
"booking-order": "../bookingOrder/bookingOrder"
}
}
\ No newline at end of file \ No newline at end of file
.content-item {
font-size: 28rpx;
width: 100%;
box-sizing: border-box;
position: relative;
display: inline-block;
margin: 32rpx 0 8rpx 0;
overflow: hidden;
box-shadow: 0 10rpx 20rpx 0 rgba(116, 132, 194, 0.16), inset 0 -2rpx 6rpx 0 rgba(255, 255, 255, 0.40);
border-radius: 32rpx;
.item-bg {
width: 100%;
height: 100%;
border-radius: 24rpx;
overflow: hidden;
position: absolute;
box-shadow: 0 10rpx 20rpx 0 rgba(116, 132, 194, 0.16), inset 0 -2rpx 6rpx 0 rgba(255, 255, 255, 0.40);
z-index: -1;
left: 0;
top: 0;
right: 0;
image {
object-fit: cover;
background-size: 100% auto;
}
}
.item-box {
box-sizing: border-box;
padding: 24rpx;
width: 100%;
height: 100%;
.end {
color: #6E6E7A;
margin-left: 10rpx;
}
.active-btn {
display: flex;
margin: 24rpx 0 32rpx 0;
justify-content: center;
.btn {
color: #4466F0;
flex: 1;
height: 64rpx;
text-align: center;
line-height: 64rpx;
border-radius: 14rpx;
background: rgba(255, 255, 255, 0.20);
border: 2rpx solid #4466F0;
margin-right: 16rpx;
}
.btn:last-child {
margin-right: 0;
}
.primary {
color: #ffffff;
height: 68rpx;
background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%);
line-height: 68rpx;
border: none;
}
.max{
flex: 0.75;
}
}
.earnings-box {
width: 100%;
height: 144rpx;
background-image: linear-gradient(180deg, #FFFFFF 72%, #EBF1FF 100%);
border-radius: 20rpx;
display: flex;
align-items: center;
padding: 32rpx;
box-sizing: border-box;
.left {
flex: 0 0 30%;
display: flex;
flex-flow: column;
justify-content: space-between;
.title {
font-weight: 400;
font-size: 24rpx;
color: #6E6E7A;
}
.sort {
margin-top: 8rpx;
font-size: 20rpx;
color: #1B233D;
}
}
.integral-num {
font-size: 68rpx;
font-weight: 700;
text {
background: linear-gradient(#FFC233, #FF9124);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.unit {
font-size: 28rpx;
font-weight: 500;
margin-left: 12rpx;
}
}
}
.invert-box {
margin-top: 24rpx;
padding: 32rpx 24rpx;
border-radius: 24rpx;
background: #ffffff;
// transition: all 0.1s linear;
will-change: height;
margin-top: 24rpx;
.box-content {
display: block;
padding-bottom: 40rpx;
}
}
.hidden {
height: 64rpx;
padding: 0;
background: transparent;
margin-top: 0;
transition: height .3;
.box-content {
display: none;
}
}
.collapse {
text-align: center;
color: #4466F0;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
.btn {
display: flex;
flex-flow: row;
}
.gg-chevron-down {
box-sizing: border-box;
position: relative;
display: block;
transform: scale(var(--ggs, 1));
width: 24rpx;
height: 24rpx;
border: 2rpx solid transparent;
border-radius: 100rpx
}
.gg-chevron-down::after {
content: "";
display: block;
box-sizing: border-box;
position: absolute;
width: 12rpx;
height: 12rpx;
border-bottom: 2rpx solid;
border-right: 2rpx solid;
transform: rotate(45deg);
left: 8rpx;
top: 0;
}
.gg-chevron-up {
box-sizing: border-box;
position: relative;
display: block;
transform: scale(var(--ggs, 1));
width: 24rpx;
height: 24rpx;
border: 2rpx solid transparent;
border-radius: 100rpx
}
.gg-chevron-up::after {
content: "";
display: block;
box-sizing: border-box;
position: absolute;
width: 12rpx;
height: 12rpx;
border-top: 2rpx solid;
border-right: 2rpx solid;
transform: rotate(-45deg);
left: 8rpx;
bottom: 0
}
}
}
}
.content-item:first-child {
margin: 16rpx 0 8rpx 0;
}
\ No newline at end of file \ No newline at end of file
<wxs src="../index.wxs" module="fn"></wxs>
<view class="content-item">
<view class="item-bg">
<glsx-image webp src="store-assistant/{{tabType>1?'index_active_bg_2':'activity_diagnosis_bg'}}.png"></glsx-image>
</view>
<view class="item-box">
<!-- 活动top信息 -->
<activity-top tabType="{{tabType}}" data="{{item}}" widthStyle="flex: 0 0 72%;" isShow="{{isShow}}">
<glsx-image webp src="store-assistant/activity_end_icon.png"></glsx-image>
<text class="end">已结束</text>
</activity-top>
<!-- 活动操作按钮 -->
<view class="active-btn">
<block wx:if="{{tabType==0}}">
<view class="btn" bind:tap="jump" data-item="{{item}}">活动战报</view>
<view class="btn primary" bind:tap="goToDetail" data-item="{{item}}">查看详情</view>
</block>
<block wx:else>
<view class="btn primary max" bind:tap="toPengzhangjin" data-item="{{item}}">查看详情</view>
</block>
<!-- <block wx:if="{{tabType==2}}">
<view class="btn primary max" data-item="{{item}}">查看详情</view>
</block>
<block wx:if="{{tabType==3}}">
<view class="btn primary max" data-item="{{item}}">查看详情</view>
</block> -->
</view>
<!-- 活动概览 -->
<activity-overview data="{{item}}" backStyle="{{backStyle}}" textType="{{2}}"></activity-overview>
<!-- 累计收益 -->
<view class="earnings-box">
<view class="left">
<view class="title">累计收益</view>
<view class="sort">最终排名:{{item.statics.incomeRank || "-"}}</view>
</view>
<view class="integral-num">
<text>{{fn.filterIntegral(item.statics.income || 0)}}</text>
<text class="unit">积分</text>
</view>
</view>
<!-- 转化分析 -->
<view class="invert-box">
<view class="box-content">
<invert-analyse data="{{item}}"></invert-analyse>
<!-- 预约订单 -->
<block wx:if="{{tabType==0}}">
<booking-order data-flag="{{true}}" data-key="{{index}}" bind:refreshList="toFresh" data="{{item}}"></booking-order>
</block>
</view>
</view>
<!-- 展开/收起 -->
<block wx:if="{{tabType==0}}">
<view class="collapse" bindtap="collapseClick" data-flag="{{item.isCollapse}}" style="bottom: {{item.isCollapse ? 24 : 48}}rpx;" data-key="{{index}}">
<text>{{item.isCollapse ? '展开' : '收起'}}</text>
<text class="{{item.isCollapse ? 'gg-chevron-down' : 'gg-chevron-up'}}"></text>
<van-loading wx:if="{{item.isloading}}" size="30rpx" style="margin-left: 20rpx;" type="spinner" />
</view>
</block>
</view>
</view>
\ No newline at end of file \ No newline at end of file
import ActivityApi from '~/api/activityApi/index'
// import intentionApi from '~/api/intentionApi/index'
Component({
/**
* 组件的属性列表
*/
properties: {
item: {
type:Object,
observer:function(newVal,oldVal){
// if(!newVal.isCollapse){
// if(this.control)return
// this.control = true
// this.getList(newVal)
// }
}
},
activeList:Array,
index:Number,
activeDateIndex: {
type: Number
},
tabType:Number,// 0众筹 1膨胀金
},
/**
* 组件的初始数据
*/
data: {
activityOverviewList: ['browseData', 'shareData', 'visitorData', 'orderData'],
backStyle: ['background-image: linear-gradient(179deg, #FFFFFF 76%, #FFF8E6 100%);margin: 0 16rpx 16rpx 0;', 'background-image: linear-gradient(180deg, #FFFFFF 72%, #F4EDFF 100%);margin: 0 0 16rpx 0;', 'background-image: linear-gradient(180deg, #FFFFFF 72%, #EBF1FF 100%);margin: 0 16rpx 0 0;height: 252rpx;', 'background-image: linear-gradient(180deg, #FFFFFF 72%, #EBFEFF 100%);height: 252rpx;'],
shadow:['boxshowdown1','','boxshowdown2','boxshowdown2'],
totalNum:0
},
/**
* 组件的方法列表
*/
methods: {
// 获取意向人数
// getList(activity) {
// if (activity && [0,2,5,6].includes(this.data.tabType)) {
// return new Promise(resolve => {
// intentionApi.getNotPayUser({
// orderByType: '',
// activityId: activity.id,
// pageNum: 1,
// pageSize: 10,
// }).then(res => {
// this.setData({
// totalNum: res.total
// })
// })
// })
// }
// },
// 实时战报
jump(e) {
let { item } = e.currentTarget.dataset
if (item.activityStatus == 1) return wx.$api.showToast('当前活动尚未开始')
wx.navigateTo({
url: `/packageStoreAssistant/packageActivity/pages/shareWebview/shareWebview?url=${encodeURIComponent(item.reportUrl)}`,
});
},
// 分享活动
copyActivityUrl(e) {
let { item } = e.currentTarget.dataset
this.jumpZC(item.id,0)
},
toPengzhangjinPage(e){
let { item } = e.currentTarget.dataset
this.jumpZC(item.id,1)
},
jumpZC(activityId,type) {
const userStorage = wx.$storage.get('userInfo')
let query = {
id: activityId,
exclusiveUuid: userStorage.uuid,
merchantId: userStorage.merchantId,
isExclusive: 1,
shareStaffUuid: userStorage.uuid,
form: 'task',
shareStaffType: 3
}
if(type==0){
wx.$router.go('/pages/crowdfunding/index/index', query)
}else{
query.notIntercept = true
wx.$router.go('/packageShopmall/packageExpandedGold/pages/activity/index/index', query)
}
},
/**点击展开收起 */
collapseClick(e) {
let { key, flag } = e.currentTarget.dataset
let { activeList,tabType } = this.data
this.setData({
activeDateIndex: 0
})
activeList.forEach((val, idx) => {
if (key == idx) {
if (flag && !val.missionList) {
val.isloading = true
let para = {
activityId: val.id
}
if(tabType){
para.bussinessScene = 2
}else{
para.bussinessScene = 3
}
ActivityApi.getActiveTaskList(para)
.then(res => {
val.isloading = false
res.forEach(a => {
a.platformMerchantMissionResponseList &&
a.platformMerchantMissionResponseList.forEach(k => {
k.detailInfo = { activityId: val.id, imgUrlList: [] }
k.platformMerchantMissionMaterialResponseList &&
k.platformMerchantMissionMaterialResponseList.forEach(i => {
// materialType 素材类型1文案 2图片 3视频 4专属链接
if (i.materialType == 1) {
// 文案
k.detailInfo.textContent = i.materialContent
}
if (i.materialType == 2 || i.materialType == 3) {
// 图片视频
k.detailInfo.imgUrlList.push({
url: i.materialContent,
type: i.materialType == 2 ? 'image' : 'video'
})
}
if (i.materialType == 4) {
// 链接
k.detailInfo.linkUrl = val.activityUrl
}
})
})
})
val.missionList = res
val.newtaskCalenderList = this.calenderFilter(JSON.parse(JSON.stringify(val.missionList)) || [], 7)
let d = new Date()
let nowDate = (d.getMonth() + 1).toString().padStart(2, '0') + '月' + d.getDate().toString().padStart(2, '0') + '日'
let ind = 0 // 下标值
val.calenderActiveIndex = 0
val.newtaskCalenderList.forEach((v, index) => {
v.forEach(k => {
k.time = (new Date(k.activityTime).getMonth() + 1).toString().padStart(2, '0') + '月' + new Date(k.activityTime).getDate().toString().padStart(2, '0') + '日'
k.ind = ind
let completeStatusNum = 0
k.platformMerchantMissionResponseList.forEach(val => {
if (val.completeStatus == 2) completeStatusNum++
})
if (d.getTime() > new Date(`${k.activityTime.replace(/-/g, '/')} 23:59:59`).getTime()) k.status = 2
if (nowDate == k.time) {
val.calenderActiveIndex = index
this.setData({ activeDateIndex: ind })
}
// status 1过去日期任务全部完成 2过去日期任务有未完成的 3当前日期或未来日期
if (completeStatusNum == v.length && d.getTime() > new Date(`${k.activityTime.replace(/-/g, '/')} 23:59:59`).getTime()) {
k.status = 1
} else if (d.getTime() > new Date(`${k.activityTime.replace(/-/g, '/')} 23:59:59`).getTime()) {
k.status = 2
} else {
k.status = 3
}
ind++
})
})
val.isCollapse = false
this.setData({
item: val
})
})
.catch(err => {
val.isloading = false
this.setData({
item: val
})
})
} else if (flag && val.missionList) {
// 已请求数据 展开默认选中当天
val.newtaskCalenderList = this.calenderFilter(JSON.parse(JSON.stringify(val.missionList)) || [], 7)
let d = new Date()
let nowDate = (d.getMonth() + 1).toString().padStart(2, '0') + '月' + d.getDate().toString().padStart(2, '0') + '日'
let ind = 0 // 下标值
val.calenderActiveIndex = 0
val.newtaskCalenderList.forEach((v, index) => {
v.forEach(k => {
k.time = (new Date(k.activityTime).getMonth() + 1).toString().padStart(2, '0') + '月' + new Date(k.activityTime).getDate().toString().padStart(2, '0') + '日'
k.ind = ind
let completeStatusNum = 0
k.platformMerchantMissionResponseList.forEach(i => {
if (i.completeStatus == 2) completeStatusNum++
})
if (d.getTime() > new Date(`${k.activityTime.replace(/-/g, '/')} 23:59:59`).getTime()) k.status = 2
if (nowDate == k.time) {
val.calenderActiveIndex = index
this.setData({ activeDateIndex: ind })
}
// status 1过去日期任务全部完成 2过去日期任务有未完成的 3当前日期或未来日期
if (completeStatusNum == v.length && d.getTime() > new Date(`${k.activityTime.replace(/-/g, '/')} 23:59:59`).getTime()) {
k.status = 1
} else if (d.getTime() > new Date(`${k.activityTime.replace(/-/g, '/')} 23:59:59`).getTime()) {
k.status = 2
} else {
k.status = 3
}
ind++
})
})
val.isCollapse = false
} else {
val.isCollapse = !flag
}
} else {
val.isCollapse = true
val.isloading = false
}
})
this.triggerEvent('refreshList',activeList)
this.setData({
activeList,
item:activeList[key]
},()=>{
// 展开获取意向人数
// this.getList(this.data.item)
})
},
// 任务日历数据处理
calenderFilter(arr, length) {
var _arr = []
while (arr.length) {
_arr.push(arr.splice(0, length))
}
return _arr
},
}
})
{
"component": true,
"usingComponents": {
"activity-top": "../activityTop/activityTop",
"activity-overview": "../activityOverview/activityOverview",
"activity-calender": "../activityCalender/activityCalender"
}
}
\ No newline at end of file \ No newline at end of file
.content-item {
font-size: 28rpx;
width: 100%;
box-sizing: border-box;
position: relative;
display: inline-block;
margin: 32rpx 0 8rpx 0;
overflow: hidden;
// box-shadow: 0 10rpx 20rpx 0 rgba(204, 133, 122, 0.16);
border-radius: 32rpx;
.item-bg {
width: 100%;
height: 100%;
position: absolute;
// box-shadow: 0 10rpx 20rpx 0 rgba(204, 133, 122, 0.16);
z-index: -1;
left: 0;
top: 0;
right: 0;
image {
object-fit: cover;
background-size: 100% auto;
}
}
.item-box {
box-sizing: border-box;
padding: 24rpx;
width: 100%;
height: 100%;
position: relative;
z-index:99;
.hot {
color: #FE5662;
}
.un-start-class {
width: 32rpx;
height: 32rpx;
}
.active-btn {
display: flex;
margin: 24rpx 0 32rpx 0;
justify-content: center;
position: relative;
.btn {
color: #EB4E4E;
flex: 1;
height: 64rpx;
text-align: center;
line-height: 64rpx;
border-radius: 14rpx;
background: rgba(255, 255, 255, 0.16);
border: 2rpx solid #EB4E4E;
margin-right: 16rpx;
}
.btn:last-child {
margin-right: 0;
background-image: linear-gradient(270deg, #FF3E7F 0%, #FE624B 100%);
color: #FFFFFF;
}
.primary {
color: #ffffff;
height: 68rpx;
background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%) !important;
line-height: 68rpx;
border: none;
margin-right: 0;
}
.max{
flex: 0.75;
}
.tips{
font-weight: 400;
font-size: 20rpx;
color: #6E6E7A;
position: absolute;
left: 50%;
bottom: -44rpx;
transform: translate(-50%,0);
padding: 8rpx 0;
}
}
.task-box {
margin-top: 24rpx;
padding: 32rpx 24rpx;
border-radius: 24rpx;
background: #ffffff;
// transition: all 0.1s linear;
will-change: height;
}
.box-content {
display: block;
padding-bottom: 40rpx;
}
.hidden {
height: 64rpx;
padding: 0;
background: transparent;
margin-top: 0;
transition: height .3;
.box-content {
display: none;
}
}
.collapse {
text-align: center;
color: #4466F0;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
.btn {
display: flex;
flex-flow: row;
}
.gg-chevron-down {
box-sizing: border-box;
position: relative;
display: block;
transform: scale(var(--ggs, 1));
width: 24rpx;
height: 24rpx;
border: 2rpx solid transparent;
border-radius: 100rpx
}
.gg-chevron-down::after {
content: "";
display: block;
box-sizing: border-box;
position: absolute;
width: 12rpx;
height: 12rpx;
border-bottom: 2rpx solid;
border-right: 2rpx solid;
transform: rotate(45deg);
left: 8rpx;
top: 0;
}
.gg-chevron-up {
box-sizing: border-box;
position: relative;
display: block;
transform: scale(var(--ggs, 1));
width: 24rpx;
height: 24rpx;
border: 2rpx solid transparent;
border-radius: 100rpx
}
.gg-chevron-up::after {
content: "";
display: block;
box-sizing: border-box;
position: absolute;
width: 12rpx;
height: 12rpx;
border-top: 2rpx solid;
border-right: 2rpx solid;
transform: rotate(-45deg);
left: 8rpx;
bottom: 0
}
}
}
}
.content-item:first-child {
margin: 16rpx 0 8rpx 0;
}
.boxshowdown1{
box-shadow: 0 10rpx 20rpx 0 rgba(204, 133, 122, 0.16);
}
.boxshowdown2{
box-shadow: 0 10rpx 20rpx 0 rgba(116, 132, 194, 0.16), inset 0 -2rpx 6rpx 0 rgba(255, 255, 255, 0.40);
}
\ No newline at end of file \ No newline at end of file
<view class="content-item {{shadow[tabType]}}">
<view class="item-bg {{shadow[tabType]}}">
<glsx-image webp src="store-assistant/{{tabType>0?'index_active_bg_2':'index_active_bg'}}.png"></glsx-image>
</view>
<view class="item-box">
<!-- 活动top信息 -->
<activity-top tabType="{{tabType}}" data="{{item}}" widthStyle="flex: 0 0 62%;">
<block wx:if="{{item.activityStatus==2}}">
<glsx-image webp src="store-assistant/hot-icon.png"></glsx-image>
<text class="hot">火爆进行中</text>
</block>
<block wx:else>
<glsx-image class="un-start-class" webp src="store-assistant/un-start-icon.png"></glsx-image>
<text class="hot">活动尚未开始</text>
</block>
</activity-top>
<!-- 活动操作按钮 -->
<view class="active-btn">
<block wx:if="{{tabType==0}}">
<view class="btn" bind:tap="jump" data-item="{{item}}">实时战报</view>
<view class="btn" bind:tap="copyActivityUrl" data-item="{{item}}">分享活动</view>
</block>
<block wx:else>
<view class="btn max {{tabType>0?'primary':''}}" bind:tap="toPengzhangjinPage" data-item="{{item}}">分享活动</view>
<view wx:if="{{tabType==2}}" class="tips">你还可以转发企业微信哦!</view>
</block>
</view>
<view wx:if="{{tabType==2}}" style="height:16rpx"></view>
<!-- 活动概览 -->
<activity-overview data="{{item}}" activityOverviewList="{{activityOverviewList}}" backStyle="{{backStyle}}" textType="{{1}}"></activity-overview>
<!-- 任务日历 -->
<view class="task-box {{item.isCollapse ? 'hidden' : ''}}">
<view class="box-content">
<activity-calender tabType="{{tabType}}" data="{{item}}" activeDateIndex="{{activeDateIndex}}" isCollapse="{{item.isCollapse}}"></activity-calender>
</view>
</view>
<!-- 展开/收起 -->
<view class="collapse" bindtap="collapseClick" data-flag="{{item.isCollapse}}" data-key="{{index}}" style="bottom: {{item.isCollapse ? 24 : 48}}rpx;">
<text>{{item.isCollapse ? '展开' : '收起'}}</text>
<text class="{{item.isCollapse ? 'gg-chevron-down' : 'gg-chevron-up'}}"></text>
<van-loading wx:if="{{item.isloading}}" size="30rpx" style="margin-left: 20rpx;" type="spinner" />
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// pages/tab/index/components/bookingOrder/bookingOrder.js
import {imgUrlMixin} from '~/mixins/index'
import ActivityApi from '~/api/activityApi/index'
Component({
/**
* 组件的属性列表
*/
behaviors: [imgUrlMixin],
properties: {
data: {
type: Object,
value: {},
observer(newVal) {
}
},
showPopup: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
// 打电话
callPhone(e) {
let { mobile } = e.currentTarget.dataset
wx.makePhoneCall({
phoneNumber: mobile.toString()
})
},
// 复制微信号
copyWechart(e) {
let { wechartno } = e.currentTarget.dataset
wx.setClipboardData({
data: wechartno.toString(),
success (res) {
wx.showToast({
title: '微信号已复制',
icon: "none"
})
}
})
},
// 查看预约安装信息
showPopup(e) {
let { item } = e.currentTarget.dataset
if (!item.reInstallContactsName && !item.reInstallContactsPhone) {
return wx.showToast({
title: '暂无安装联系人信息',
icon: 'none'
})
}
let thisPage = wx.$router.getPageInstance()
let components = thisPage.selectComponent(`#page-0`)
components.setData({
installItem: item,
showPopup: true
})
},
toComfirmInstall(e){
const {item} = e.currentTarget.dataset
ActivityApi.comfirmInstall({subOrderCode:item.subOrderCode}).then(res=>{
this.triggerEvent('refreshList',true)
wx.showToast({
title: '提交成功',
icon: 'none'
})
})
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/components/bookingOrder/bookingOrder.wxss */
.title{
font-weight: 600;
font-size: 32rpx;
color: #1B233D;
display: flex;
justify-content: space-between;
text{
font-weight: 400;
font-size: 28rpx;
color: #2D2D33;
}
.text-btn{
font-size: 28rpx;
color: #4466F0;
font-weight: 400;
}
}
.item-content{
display: flex;
flex-flow: column;
padding: 32rpx 0;
font-size: 26rpx;
color: #7A8299;
border-bottom: 1px solid #F0F1F5;
.top{
display: flex;
justify-content: space-between;
.top-left{
display: flex;
image{
width: 96rpx;
height: 96rpx;
border-radius: 50%;
margin-right: 20rpx;
}
.user-message{
display: flex;
flex-flow: column;
justify-content: space-between;
.name{
color: #1B233D;
font-size: 30rpx;
}
.mobile{
display: flex;
align-items: center;
image{
width: 48rpx;
height: 48rpx;
border-radius: 50%;
margin-left: 16rpx;
}
}
}
}
.btn-img{
width: 128rpx;
height: 56rpx;
background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%);
border-radius: 12rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 400;
font-size: 24rpx;
color: #FFFFFF;
}
.check-img{
width: 168rpx;
height: 48rpx;
background-image: linear-gradient(90deg, #FFF7EB 0%, #FFF3E0 100%);
color: #EB9109;
}
}
.bottom{
padding: 10rpx 0 0 116rpx;
text{
color: #1B233D;
margin-left: 16rpx;
}
}
}
.item-content:last-child{
border: none;
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/index/components/bookingOrder/bookingOrder.wxml-->
<view class="title">
<view>
待预约安装订单<text> · {{data.orderTotal}}</text>
</view>
<view class="text-btn" bind:tap="showPopup" data-item="{{data}}">预约安装信息</view>
</view>
<block wx:for="{{data.orderList}}" wx:key="index">
<view class="item-content">
<view class="top">
<view class="top-left">
<image webp src="{{item.customerImageUrl ? item.customerImageUrl : IMGURL+'store-assistant/default_avatar.png'}}"></image>
<view class="user-message">
<view class="name">{{item.customerNickName || ""}}</view>
<view class="mobile">
<text>{{item.customerPhone || ""}}</text>
<glsx-image wx:if="{{item.customerPhone}}" webp src="store-assistant/activity_order_phone_icon.png" bind:tap="callPhone" data-mobile="{{item.customerPhone}}"></glsx-image>
<glsx-image wx:if="{{item.wechartNo}}" webp src="store-assistant/activity_order_wechart_icon.png" bind:tap="copyWechart" data-wechartno="{{item.wechartNo}}"></glsx-image>
</view>
</view>
</view>
<view wx:if="{{item.orderStatus==7}}" class="btn-img" data-item="{{item}}" bind:tap="toComfirmInstall">
确认安装
</view>
<view wx:if="{{item.orderStatus==11}}" class="btn-img check-img">
已安装待审核
</view>
</view>
<view class="bottom">
下单时间
<text>{{item.time}}</text>
</view>
</view>
</block>
// import ActivityApi from '~/api/activityApi/index'
// import {handlerMiss} from '~/packagesList/common/common'
// Component({
// /**
// * 组件的属性列表
// */
// properties: {
// ids:Array,
// fresh:{
// type:Boolean,
// observer: function (val) {
// if(val){
// this.setData({
// pageNum: 1
// }, () => {
// this.getData()
// })
// }
// }
// }
// },
// /**
// * 组件的初始数据
// */
// data: {
// dbzlList: [],
// activeTrigger: false,
// pageNum: 1,
// total: 0,
// pageSize: 10,
// noResult: false
// },
// lifetimes: {
// attached() {
// this.getData()
// }
// },
// methods: {
// // 获取数据
// getData() {
// let { pageSize, pageNum,ids,dbzlList } = this.data
// let paraList = []
// ids.forEach(el=>{
// if(el.serviceType==2){
// paraList.push(el.activityId)
// }
// })
// ActivityApi.getSubscribeListByIdsApi({ pageNum, pageSize,ids:paraList }).then(res => {
// if (res && res.list) {
// handlerMiss(res,{serviceType:2,pageNum,listName:'dbzlList',orginList:dbzlList},(first)=>{
// this.setData(first)
// })
// }
// })
// },
// toFresh(e) {
// if (e.detail) {
// this.setData({
// dbzlList: e.detail
// })
// }
// },
// activityRefresh() {
// this.setData({
// pageNum: 1
// }, () => {
// // this.getData()
// wx.$eventbus.emit("RESFRESH_SUBCRIBE",{type:2,fresh:true})
// })
// },
// scrollonReachBottom() {
// let { pageNum, total, pageSize } = this.data
// // 判断当前页是否是末页
// if (Math.floor(total / pageSize) == pageNum - 1) return
// this.setData({
// pageNum: pageNum + 1
// }, () => {
// this.getData()
// })
// },
// scrollIng() { },
// }
// })
{
"component": true,
"usingComponents": {
"activity-ing":"../activitying/index",
"nothing-data":"../nothingData/nothingData",
"activity-end":"../activityend/index"
}
}
\ No newline at end of file \ No newline at end of file
// .content-box{
// padding: 0 22rpx 150rpx 24rpx;
// }
\ No newline at end of file \ No newline at end of file
<!-- <scroll-view scroll-y class="content" class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" refresher-triggered="{{activeTrigger}}" style="{{!dbzlList.length ? 'padding-top: 16rpx;' : ''}}{{'height: calc(100% - 112rpx);'}}">
<block wx:if="{{dbzlList.length}}">
<view class="content-box">
<block wx:for="{{dbzlList}}" wx:key="index">
<block wx:if="{{item.activityStatus!=3}}">
<activity-ing tabType="{{3}}" bind:refreshList="toFresh" index="{{index}}" activeList="{{dbzlList}}" item="{{item}}" activeDateIndex="{{activeDateIndex}}"></activity-ing>
</block>
<block wx:else>
<activity-end tabType="{{3}}" item="{{item}}"></activity-end>
</block>
</block>
</view>
</block>
<block wx:else>
<nothing-data></nothing-data>
</block>
</scroll-view> -->
\ No newline at end of file \ No newline at end of file
var filterIntegral = function (e) {
return e && e.toLocaleString('en-US')
}
var mathABS = function (e) {
return Math.abs(e);
}
var formatNumber = function (e) {
return e / 1000 >= 1
? (e / 1000).toFixed(1) + "k"
: e;
}
var timeFilter = function(e, num) {
// num=1 活动已开始 num=2 活动未开始(当前时间小于活动开始时间显示去完成按钮)
var reg = getRegExp("-", "g");
e = e.replace(reg, '/')
return num == 1 ? getDate(e).getTime() == getDate().setHours(8, 0, 0, 0) : getDate(e).getTime() > getDate().getTime()
}
var getString = function(str,len=8){
if(!str)return ''
if(str.length<len+1)return str
var newStr = str.substring(0,len)+'...'
return newStr
}
module.exports = {
filterIntegral: filterIntegral,
mathABS: mathABS,
formatNumber: formatNumber,
timeFilter: timeFilter,
getString:getString
}
\ No newline at end of file \ No newline at end of file
Component({
properties: {
data: {
type: Object,
value: {},
observer(v) {
if(!v)return
let s = v.statics
if (s) {
v.numList = [
{title: '浏览量', num: s.browseCount},
{title: '访客量', num: s.fansCount},
{title: '订单量', num: s.orderCount}
]
v.sortList = [
{title: '访客率', sort: s.fansRate},
{title: '转化率', sort: s.conversionRate}
]
}
this.setData({data: v})
}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/components/invertAnalyse/invertAnalyse.wxss */
.title{
font-weight: 600;
font-size: 32rpx;
color: #1B233D;
line-height: 48rpx;
}
.funnel-box{
padding: 40rpx 0;
position: relative;
.funnel-bg{
position: absolute;
top: 40rpx;
left: 50%;
transform: translate(-50%);
width: 406rpx;
height: 288rpx;
}
.funnel-content{
display: flex;
justify-content: center;
height: 248rpx;
width: 100%;
padding-top: 40rpx;
.left,.right{
display: flex;
}
.left{
flex: 0 0 406rpx;
flex-flow: column;
justify-content: space-around;
align-items: flex-end;
// align-items: center;
z-index: 1;
font-size: 22rpx;
color: #2D2D33;
box-sizing: border-box;
padding-right: 20rpx;
view{
display: flex;
align-items: center;
margin-right: 28rpx;
text{
font-size: 28rpx;
font-weight: bold;
margin-left: 4rpx;
}
}
}
.right{
flex: 1;
flex-flow: column;
align-items: flex-start;
margin-left: 130rpx;
color: #4466F0;
padding-top: 20rpx;
font-size: 24rpx;
position: relative;
.sort-box:last-child{
position: absolute;
left: -46rpx;
top: 50%;
}
.sort{
font-size: 40rpx;
font-weight: bold;
margin-top: 4rpx;
}
}
}
}
<!--pages/tab/index/components/invertAnalyse/invertAnalyse.wxml-->
<wxs src="../index.wxs" module="fn"></wxs>
<view class="title">转化分析</view>
<view class="funnel-box">
<view class="funnel-bg">
<glsx-image webp src="store-assistant/activity_funnel.webp"></glsx-image>
</view>
<view class="funnel-content">
<view class="left">
<view wx:for="{{data.numList}}" wx:key="index">{{item.title}}<text>{{fn.formatNumber(item.num)}}</text></view>
</view>
<view class="right">
<view class="sort-box" wx:for="{{data.sortList}}" wx:key="index">
<view>{{item.title}}</view>
<view class="sort">{{item.sort}}%</view>
</view>
</view>
</view>
</view>
// pages/tab/storeAssistant/pages/index/components/menu/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
show:Boolean,
totals:Number,
tabIndex:{
type:Number,
value:0,
observer(newVal){
this.setData({
current:newVal || 0
})
}
},
tabs:{
type:Array,
observer(newVal){
this.getMenuData(newVal)
}
}
},
data: {
current:0,
menus:[]
},
methods: {
closeMenu(){
this.setData({
show:false
})
},
selectMenu(e){
const {index} = e.currentTarget.dataset
this.setData({
current:index,
show:false
})
this.triggerEvent('currentMenu',index)
},
getMenuData(tabs){
let res = []
let data = [{
logo:'zc_icon',
active:'zc_icon_active',
title:'售后众筹',
count:0,
serviceType:0
},{
logo:'syyhdyy_icon',
active:'syyhdyy_icon_active',
title:'私域用户代运营',
count:1,
serviceType:3
},{
logo:'pzj_icon',
active:'pzj_icon_active',
title:'膨胀金活动',
count:0,
serviceType:-1
},{
logo:'sgjy_icon',
active:'sgjy_icon_active',
title:'续保膨胀金',
count:0,
serviceType:1
},{
logo:'db_icon',
active:'db_icon_active',
title:'定保招揽',
count:0,
serviceType:2
},{
logo:'jplq_icon',
active:'jplq_icon_active',
title:'精品礼券',
count:0,
serviceType:4
},{
logo:'xubao_icon',
active:'xubao_icon_active',
title:'续保招揽',
count:0,
serviceType:5
},{
logo:'holiday_icon',
active:'holiday_icon_active',
title:'节假日关怀',
count:0,
serviceType:6
},]
tabs.forEach(item=>{
data.forEach(el=>{
if(item.serviceType==el.serviceType){
el.title = item.serviceTypeName
res.push(el)
}
})
})
this.setData({
menus:res
})
}
},
lifetimes: {
// attached() {
// this.getMenuData()
// }
},
})
{
"component": true,
"usingComponents": {
"van-popup": "@vant/weapp/popup/index"
}
}
\ No newline at end of file \ No newline at end of file
.popclass{
background: #2C3255 !important;
border-radius: 0 40rpx 40rpx 0;
z-index: 999;
box-sizing: border-box;
padding: 88rpx 16rpx;
}
.wrapper{
.title{
height: 88rpx;
line-height: 88rpx;
padding-left: 16rpx;
font-weight: 600;
font-size: 34rpx;
color: #FFFFFF;
}
.element{
position: relative;
padding: 24rpx 0;
padding-left: 16rpx;
display: flex;
align-items: center;
.logo{
width: 64rpx;
height: 64rpx;
margin-right: 20rpx;
}
.label{
font-weight: 500;
font-size: 30rpx;
color: #FFFFFF;
}
.num_pannel{
position: absolute;
right: 24rpx;
top: 50%;
transform: translateY(-50%);
min-width: 44rpx;
padding: 0 6rpx;
height: 32rpx;
background-image: linear-gradient(141deg, #FFD35C 0%, #FFA033 91%);
border-radius: 19rpx;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
}
.active{
background: rgba($color: #FFF, $alpha: 0.15);
border-radius: 16rpx;
}
}
\ No newline at end of file \ No newline at end of file
<van-popup custom-style="height: 100%;width:70%;" custom-class="popclass" bind:click-overlay="closeMenu" position="left" show="{{ show }}">
<view class="wrapper">
<view class="title">工作台</view>
<block wx:for="{{menus}}" wx:key="index">
<view catch:tap="selectMenu" data-index="{{index}}" class="element {{index==current?'active':''}}">
<glsx-image class="logo" webp src="store-assistant/menu/{{current==index?item.active:item.logo}}.png"></glsx-image>
<view class="label">{{item.title}}</view>
<view wx:if="{{totals&&item.serviceType==0}}" class="num_pannel">{{totals}}</view>
</view>
</block>
</view>
</van-popup>
\ No newline at end of file \ No newline at end of file
// pages/tab/index/components/nothingData/nothingData.js
import {imgUrlMixin} from '~/mixins/index'
Component({
/**
* 组件的属性列表
*/
behaviors: [imgUrlMixin],
properties: {
description:String
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/components/nothingData/nothingData.wxss */
.nothing-box{
width: calc(100% - 48rpx);
height: calc(100% - 16rpx);
margin: 0 24rpx;
background: #FFFFFF;
border-radius: 32rpx;
display: flex;
align-items: center;
flex-flow: column;
image{
margin-top: 192rpx;
width: 400rpx;
height: 400rpx;
}
.tips{
text-align: center;
font-size: 28rpx;
color: #7A8299;
line-height: 44rpx;
}
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/index/components/nothingData/nothingData.wxml-->
<view class="nothing-box">
<glsx-image webp src="store-assistant/activity_list_nothing.webp"></glsx-image>
<view class="tips">暂无活动</view>
<view wx:if="{{description}}" class="tips desc">{{description}}</view>
</view>
// import ActivityApi from '~/api/activityApi/index'
// Component({
// /**
// * 组件的属性列表
// */
// properties: {
// ids:Array
// },
// /**
// * 组件的初始数据
// */
// data: {
// pzjList: [],
// activeTrigger: false,
// pageNum: 1,
// total: 0,
// pageSize: 10,
// noResult: false
// },
// lifetimes: {
// attached() {
// this.getData()
// }
// },
// methods: {
// // 获取数据
// getData() {
// let { pageSize, pageNum,ids } = this.data
// let ignoreIds = []
// ids.forEach(el=>{
// ignoreIds.push(el.activityId)
// })
// ActivityApi.getPengZApi({ pageNum, pageSize,ignoreIds }).then(res => {
// if (res && res.list) {
// this.handlerMiss(res)
// }
// })
// },
// toFresh(e) {
// if (e.detail) {
// this.setData({
// pzjList: e.detail
// })
// }
// },
// handlerMiss(res) {
// let { pageNum, pzjList } = this.data
// res.list &&
// res.list.forEach((val, index) => {
// val.isCollapse = true
// val.startTime = val.startTime.split(' ')[0]
// val.endTime = val.endTime.split(' ')[0]
// // 活动中/活动未开始默认展开第一条 数据处理
// if (val.activityStatus != 3 && index == 0) {
// val.isloading = true
// ActivityApi.getActiveTaskList({ activityId: val.id,bussinessScene:2 }, { isShowLoading: true })
// .then(res => {
// res.forEach(a => {
// a.platformMerchantMissionResponseList &&
// a.platformMerchantMissionResponseList.forEach(k => {
// k.detailInfo = { activityId: val.id, imgUrlList: [] }
// k.platformMerchantMissionMaterialResponseList &&
// k.platformMerchantMissionMaterialResponseList.forEach(i => {
// // materialType 素材类型1文案 2图片 3视频 4专属链接
// if (i.materialType == 1) {
// // 文案
// k.detailInfo.textContent = i.materialContent
// }
// if (i.materialType == 2 || i.materialType == 3) {
// // 图片视频
// k.detailInfo.imgUrlList.push({
// url: i.materialContent,
// type: i.materialType == 2 ? 'image' : 'video'
// })
// }
// if (i.materialType == 4) {
// // 链接
// k.detailInfo.linkUrl = val.activityUrl
// }
// })
// })
// })
// val.isloading = false
// val.missionList = res
// val.newtaskCalenderList = this.calenderFilter(JSON.parse(JSON.stringify(val.missionList)) || [], 7)
// let d = new Date()
// let nowDate = (d.getMonth() + 1).toString().padStart(2, '0') + '月' + d.getDate().toString().padStart(2, '0') + '日'
// let ind = 0
// val.calenderActiveIndex = 0
// val.newtaskCalenderList.forEach((v, index) => {
// v.forEach(k => {
// k.time = (new Date(k.activityTime).getMonth() + 1).toString().padStart(2, '0') + '月' + new Date(k.activityTime).getDate().toString().padStart(2, '0') + '日'
// k.ind = ind
// let completeStatusNum = 0
// k.platformMerchantMissionResponseList.forEach(i => {
// if (i.completeStatus == 2) completeStatusNum++
// })
// if (nowDate == k.time) {
// val.calenderActiveIndex = index
// this.setData({ activeDateIndex: ind })
// }
// // status 1过去日期任务全部完成 2过去日期任务有未完成的 3当前日期或未来日期
// if (completeStatusNum == v.length && d.getTime() > new Date(`${k.activityTime.replace(/-/g, '/')} 23:59:59`).getTime()) {
// k.status = 1
// } else if (d.getTime() > new Date(`${k.activityTime.replace(/-/g, '/')} 23:59:59`).getTime()) {
// k.status = 2
// } else {
// k.status = 3
// }
// ind++
// })
// })
// val.isCollapse = false
// let itemVal = 'pzjList[' + index + ']'
// this.setData({
// [itemVal]: val
// })
// })
// .catch(err => {
// val.isloading = false
// })
// } else if (val.activityStatus == 3 && index == 0) {
// // ActivityApi.getActivityEndInstallOrderList({ activityId: val.id }, { isShowLoading: true })
// // .then(res => {
// // val.isCollapse = false
// // res.orderList &&
// // res.orderList.forEach(it => {
// // it.time = it.createdDate ? new Date(it.createdDate).format('yyyy-MM-dd hh:mm') : ''
// // })
// // val.orderList = res.orderList
// // val.orderTotal = res.orderTotal
// // val.reInstallContactsName = res.reInstallContactsName
// // val.reInstallContactsPhone = res.reInstallContactsPhone
// // let itemVal = 'pzjList[' + index + ']'
// // this.setData({
// // [itemVal]: val
// // })
// // })
// // .catch(err => {
// // val.isloading = false
// // })
// }
// })
// this.triggerEvent('total', { type: 1, total: res.total || 0 })
// this.setData({
// pzjList: pageNum == 1 ? res.list : [...pzjList, ...res.list],
// activeTrigger: false,
// total: res.total,
// noResult: pageNum == 1 ? (res.list.length ? false : true) : false
// })
// },
// calenderFilter(arr, length) {
// var _arr = []
// while (arr.length) {
// _arr.push(arr.splice(0, length))
// }
// return _arr
// },
// activityRefresh() {
// this.setData({
// pageNum: 1
// }, () => {
// this.getData()
// })
// },
// scrollonReachBottom() {
// let { pageNum, total, pageSize } = this.data
// // 判断当前页是否是末页
// if (Math.floor(total / pageSize) == pageNum - 1) return
// this.setData({
// pageNum: pageNum + 1
// }, () => {
// this.getData()
// })
// },
// scrollIng() { },
// }
// })
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
// .content-box{
// padding: 0 22rpx 150rpx 24rpx;
// }
\ No newline at end of file \ No newline at end of file
<!-- <scroll-view scroll-y class="content" class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" refresher-triggered="{{activeTrigger}}" style="{{!pzjList.length ? 'padding-top: 16rpx;' : ''}}{{'height: calc(100% - 112rpx);'}}">
<block wx:if="{{pzjList.length}}">
<view class="content-box">
<block wx:for="{{pzjList}}" wx:key="index">
<block wx:if="{{item.activityStatus!=3}}">
<activity-ing tabType="{{1}}" bind:refreshList="toFresh" index="{{index}}" activeList="{{pzjList}}" item="{{item}}" activeDateIndex="{{activeDateIndex}}"></activity-ing>
</block>
<block wx:else>
<activity-end tabType="{{1}}" item="{{item}}"></activity-end>
</block>
</block>
</view>
</block>
<block wx:else>
<nothing-data></nothing-data>
</block>
</scroll-view> -->
\ No newline at end of file \ No newline at end of file
import ActivityApi from "~/api/activityApi/index"
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
noResult:true,
dataList:[],
query:{
open:false,
borad:{},
missionList:[]
},
activeTrigger:false
},
/**
* 组件的方法列表
*/
methods: {
checkSubcribeInfo(){
const userStorage = wx.$storage.get("userInfo");
let para = {
merchantIds:[userStorage.merchantId]
}
ActivityApi.checkSubcribe(para).then(res=>{
let flag = false
if(res&&res.length){
res.forEach(item=>{
if(item.serviceType==3){
flag = true
}
})
}
this.triggerEvent('open',flag)
if(flag){
this.getMissTions()
this.getBoradData()
}
this.setData({
'query.open':flag,
activeTrigger:false
})
})
},
getMissTions(){
let para = {
bussinessScene:4
}
ActivityApi.getActiveTaskList(para).then(res=>{
let missionList = []
if(res&&res.length){
const {platformMerchantMissionResponseList} = res[0]
if(platformMerchantMissionResponseList&&platformMerchantMissionResponseList.length){
platformMerchantMissionResponseList.forEach(item=>{
let temp = {
title:item.missionName,
tip:item.missonDesc,
count:item.gainScore,
status:item.completeStatus,
id:item.id,
missonType:item.missonType,
icon:item.missonType==7?'add_store_flg_icon':'add_group_icon'
}
if(item.missonType==7 || item.missonType==8){
missionList.push(temp)
}
})
}
}
this.setData({
'query.missionList':missionList,
activeTrigger:false
})
})
},
getBoradData(){
const userStorage = wx.$storage.get("userInfo");
let para = {
merchantId:userStorage.merchantId,
uuid:userStorage.uuid,
}
ActivityApi.praviteBoradData(para).then(res=>{
this.setData({
'query.borad':res,
activeTrigger:false
})
})
},
activityRefresh(){
this.checkSubcribeInfo()
}
},
lifetimes: {
attached() {
this.checkSubcribeInfo()
}
},
})
{
"component": true,
"usingComponents": {
"pravitePage":"../../../../../../../packageStoreAssistant/components/praviteNotOpen/index"
}
}
\ No newline at end of file \ No newline at end of file
.content-box{
padding: 0 22rpx 150rpx 24rpx;
}
\ No newline at end of file \ No newline at end of file
<scroll-view scroll-y class="content" class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" refresher-triggered="{{activeTrigger}}" style="{{noResult ? 'padding-top: 16rpx;' : ''}}{{'height: calc(100% - 112rpx);'}}">
<pravitePage query="{{query}}"></pravitePage>
</scroll-view>
\ No newline at end of file \ No newline at end of file
// import ActivityApi from '~/api/activityApi/index'
// import {handlerMiss} from '~/packagesList/common/common'
// Component({
// properties: {
// ids:Array,
// fresh:{
// type:Boolean,
// observer: function (val) {
// if(val){
// this.setData({
// pageNum: 1
// }, () => {
// this.getData()
// })
// }
// }
// }
// },
// data: {
// sgjyList: [],
// activeTrigger: false,
// pageNum: 1,
// total: 0,
// pageSize: 10,
// noResult: false
// },
// lifetimes: {
// attached() {
// this.getData()
// }
// },
// methods: {
// // 获取数据
// getData() {
// let { pageSize, pageNum,ids,sgjyList } = this.data
// let paraList = []
// ids.forEach(el=>{
// if(el.serviceType==1){
// if(el.activityId){
// paraList.push(el.activityId)
// }
// }
// })
// if(!paraList.length)return
// ActivityApi.getSubscribeListByIdsApi({ pageNum, pageSize,ids:paraList }).then(res => {
// if (res && res.list) {
// handlerMiss(res,{serviceType:1,pageNum,listName:'sgjyList',orginList:sgjyList},(first)=>{
// this.setData(first)
// })
// }
// })
// },
// toFresh(e) {
// if (e.detail) {
// this.setData({
// sgjyList: e.detail
// })
// }
// },
// activityRefresh() {
// this.setData({
// pageNum: 1
// }, () => {
// // this.getData()
// wx.$eventbus.emit("RESFRESH_SUBCRIBE",{type:1,fresh:true})
// })
// },
// scrollonReachBottom() {
// let { pageNum, total, pageSize } = this.data
// // 判断当前页是否是末页
// if (Math.floor(total / pageSize) == pageNum - 1) return
// this.setData({
// pageNum: pageNum + 1
// }, () => {
// this.getData()
// })
// },
// scrollIng() { },
// }
// })
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
// .content-box{
// padding: 0 22rpx 150rpx 24rpx;
// }
\ No newline at end of file \ No newline at end of file
<!-- <scroll-view scroll-y class="content" class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" refresher-triggered="{{activeTrigger}}" style="{{!sgjyList.length ? 'padding-top: 16rpx;' : ''}}{{'height: calc(100% - 112rpx);'}}">
<block wx:if="{{sgjyList.length}}">
<view class="content-box">
<block wx:for="{{sgjyList}}" wx:key="index">
<block wx:if="{{item.activityStatus!=3}}">
<activity-ing tabType="{{2}}" bind:refreshList="toFresh" index="{{index}}" activeList="{{sgjyList}}" item="{{item}}" activeDateIndex="{{activeDateIndex}}"></activity-ing>
</block>
<block wx:else>
<activity-end tabType="{{2}}" item="{{item}}"></activity-end>
</block>
</block>
</view>
</block>
<block wx:else>
<nothing-data></nothing-data>
</block>
</scroll-view> -->
\ No newline at end of file \ No newline at end of file
// import ActivityApi from '~/api/activityApi/index'
// import {handlerMiss} from '~/packagesList/common/common'
// Component({
// /**
// * 组件的属性列表
// */
// properties: {
// isHaveSubcribe:Boolean
// },
// /**
// * 组件的初始数据
// */
// data: {
// zcList: [],
// activeTrigger: false,
// activePageNum: 1,
// activeTotal: 0,
// pageNum: 1,
// total: 0,
// pageSize: 10,
// noResult:false
// },
// /**
// * 组件的方法列表
// */
// methods: {
// // 获取数据
// getActivity(){
// let { pageSize, pageNum,zcList } = this.data
// ActivityApi.getActivityList({pageNum,pageSize}).then(res=>{
// if(res&&res.list){
// handlerMiss(res,{serviceType:0,pageNum,listName:'zcList',orginList:zcList},(result)=>{
// if(result&&result.total){
// this.triggerEvent('total',{type:0,total:result.total || 0})
// }
// this.setData(result)
// })
// }
// })
// },
// toFresh(e) {
// if (e.detail) {
// this.setData({
// zcList: e.detail
// })
// }
// },
// // 下拉刷新
// activityRefresh(e) {
// this.setData({
// pageNum: 1
// },()=>{
// this.getActivity()
// // 刷新获取订阅配置
// if(!this.data.isHaveSubcribe){
// wx.$eventbus.emit("RESFRESH_SUBCRIBE",{type:0,fresh:true})
// }
// })
// },
// // 上拉触底加载
// scrollonReachBottom(e) {
// let { pageNum, total, pageSize } = this.data
// // 判断当前页是否是末页
// if (Math.floor(total / pageSize) == pageNum - 1) return
// this.setData({
// pageNum: pageNum + 1
// },()=>{
// this.getActivity()
// })
// },
// // 滚动中
// scrollIng(e) {},
// },
// lifetimes: {
// attached() {
// this.getActivity()
// }
// },
// })
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
// .content-box{
// padding: 0 22rpx 150rpx 24rpx;
// }
\ No newline at end of file \ No newline at end of file
<!-- <scroll-view scroll-y class="content" class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" refresher-triggered="{{activeTrigger}}" style="{{!zcList.length ? 'padding-top: 16rpx;' : ''}}{{'height: calc(100% - 112rpx);'}}">
<block wx:if="{{!noResult}}">
<view class="content-box">
<block wx:for="{{zcList}}" wx:key="index">
<block wx:if="{{item.activityStatus!=3}}">
<activity-ing tabType="{{0}}" bind:refreshList="toFresh" index="{{index}}" activeList="{{zcList}}" item="{{item}}" activeDateIndex="{{activeDateIndex}}"></activity-ing>
</block>
<block wx:else>
<activity-end tabType="{{0}}" bind:refreshList="toFresh" index="{{index}}" activeList="{{zcList}}" item="{{item}}"></activity-end>
</block>
</block>
</view>
</block>
<block wx:else>
<nothing-data></nothing-data>
</block>
</scroll-view> -->
\ No newline at end of file \ No newline at end of file
import { imgUrlMixin } from '~/mixins/index'
const navStyle = 'background-color: transparent;'
import ActivityApi from '~/api/activityApi/index'
Component({
behaviors: [imgUrlMixin],
properties: {},
data: {
navStyle,
tab: [],
roadTodayNum: 0,
roadCountNum: 0,
tabIndex: 0,
to: '',
showMenu: false,
totals_zc: 0,
ids: [],
currentServiceType: 1,
},
methods: {
// 获取众筹总数
getTotal(e) {
const { type, total } = e.detail
if (e && e.detail && type == 0) {
this.setData({
totals_zc: total
})
}
},
// 点击菜单按钮切换到对应的tab
getCurrentMenu(e) {
let { tab } = this.data
const TEMP = tab[e.detail]
this.setData({
tabIndex: e.detail,
to: `to-${e.detail}`,
currentServiceType: TEMP.serviceType || 0,
})
},
// 展示菜单列表
showMenuList() {
this.setData({
showMenu: true
})
},
navbarReady(e) {
let { height } = e.detail
this.setData({
navHeight: height
})
},
// 切换tab
async click(e) {
let { index } = e.currentTarget.dataset
let { tab } = this.data
const TEMP = tab[index]
this.setData({
tabIndex: index,
to: `to-${index}`,
currentServiceType: TEMP.serviceType || 0,
})
},
onLoad(options) {
options.type = Number(options.tab)
this.getSubscribeConfig(options)
this.addEvent()
},
// 获取活动订阅配置
getSubscribeConfig(obj) {
let tab = [
{ serviceTypeName: '精品升级', serviceType: 1 },
{ serviceTypeName: '售后众筹', serviceType: 0 },
{ serviceTypeName: '会员权益/升级', serviceType: 2 }]
let currentServiceType = 1
this.setData({
tab,
fresh: obj && obj.fresh,
currentServiceType
})
setTimeout(() => {
this.configHttpCount = false
this.setData({
fresh: false,
})
}, 3000)
},
// 添加evevtbus通知刷新订阅
addEvent() {
wx.$eventbus.on("RESFRESH_SUBCRIBE", (obj) => {
this.getSubscribeConfig(obj)
});
},
// 跳转发现页面
toDoscoverPage() {
wx.$router.getPageInstance().changeTabBar({
detail: 1,
myTabIdx: 1
})
},
// 检查是否开通福利官
checkOpenPrivate(e) {
this.setData({
openPravite: e.detail
})
}
}
})
{
"usingComponents": {
"menu":"./components/menu/index",
"boutique-coupon":"./components/BoutiqueCoupon/index",
"workertableEntrance":"./components/WorktableEntrance/index",
"OutputWork":"./components/OutputWork/index"
},
"navigationStyle": "custom",
"onReachBottomDistance": 100
}
\ No newline at end of file \ No newline at end of file
.navigation-bar {
position: fixed;
top: 0;
left: 0;
z-index: 2;
.bar-text {
font-size: 34rpx;
font-weight: 600;
}
.nav-func-icon{
width: 88rpx;
height: 88rpx;
position: absolute;
left: 0rpx;
top: 50%;
transform: translateY(-50%);
}
}
.layout {
position: relative;
.bg-box {
width: 100%;
overflow: hidden;
position: absolute;
left: 0;
.bg {
width: 100%;
height: 100%;
position: absolute;
z-index: -1;
top: 0;
left: 0;
}
}
.tab-box {
position: sticky;
top: 0;
left: 0;
z-index: 2;
display: flex;
height: 96rpx;
// margin-bottom: 16rpx;
overflow: hidden;
white-space: nowrap;
box-sizing: border-box;
padding: 0 32rpx;
.tab-scroll{
height: 100%;
}
.tab_element{
display: inline-block;
width: 50%;
position: relative;
line-height: 96rpx;
.inner{
width: 100%;
display: flex;
flex-flow: column;
align-items: center;
font-size: 32rpx;
font-weight: 400;
color: #2D2D33;
opacity: 0.9;
}
.active {
font-size: 36rpx;
font-weight: 600;
}
.line{
width: 48rpx;
height: 8rpx;
background: #708CFF;
border-radius: 3px 3px 0 0;
transform: scale(1);
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 0;
}
}
}
.add-activity{
position: fixed;
top: 75%;
right: 16rpx;
width: 160rpx;
height: 160rpx;
}
}
.wrappper{
height: 80rpx;
display: flex;
justify-content: center;
padding-top: 16rpx;
.topMessag{
width: 686rpx;
height: 72rpx;
background-image: linear-gradient(85deg, #FAFBFF 0%, #F5F6FF 100%);
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 20rpx;
position: relative;
z-index: 99;
.left{
display: flex;
align-items: center;
.sign_icon{
width: 48rpx;
height: 48rpx;
margin-right: 16rpx;
}
.text1{
color: rgba(27, 35, 61, 1);
font-size: 26rpx;
font-weight: 400;
}
.text2{
color: rgba(27, 35, 61, 1);
font-size: 26rpx;
font-weight: 600;
margin-left: 4rpx;
}
}
.right{
display: flex;
align-items: center;
.text3{
font-weight: 400;
font-size: 24rpx;
color: #4466F0;
}
.arrow_icon{
width: 24rpx;
height: 24rpx;
margin-left: 4rpx;
}
}
}
.title1{
font-weight: 400;
font-size: 28rpx;
color: #1B233D;
}
}
.messageBg1{
width: 100%;
background: #FFFFFF;
background-image: linear-gradient(270deg, rgba(255,170,62,0.10) 0%, rgba(254,109,75,0.10) 100%);
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding-left: 32rpx;
padding-right: 40rpx;
.btn{
width: 160rpx;
height: 56rpx;
background-image: linear-gradient(270deg, #FF3E7F 0%, #FE624B 100%);
border-radius: 12rpx;
display: flex;
justify-content: center;
align-items: center;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
position: relative;
z-index: 20;
}
}
<wxs src="./index.wxs" module="fn"></wxs>
<view class="navigation-bar">
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady" page-title="工作台">
<view class="bar-nav">
<glsx-image class="nav-func-icon" bind:tap="showMenuList" webp src="store-assistant/menu/menu_logo.png"></glsx-image>
<view class="bar-text">工作台</view>
</view>
</navigation-bar>
</view>
<block wx:if="{{navHeight}}">
<view class="layout" id="layout" style="top:{{navHeight}}px; height: calc(100vh - {{navHeight*2}}rpx - 60rpx)">
<!-- 背景图 -->
<view class="bg-box" style="height:{{368 + navHeight * 2}}rpx;top:-{{navHeight}}px">
<view class="bg">
<glsx-image webp src="store-assistant/index_bg.webp"></glsx-image>
</view>
</view>
<!-- tab切换 -->
<view class="tab-box" style="top: {{navHeight}}px">
<scroll-view class="tab-scroll" scroll-into-view="{{to}}" enhanced="{{true}}" show-scrollbar="{{false}}" scroll-x="{{true}}" scroll-with-animation>
<block wx:for="{{tab}}" wx:key="index">
<view id="{{tab.length<3?'':'to-'+index}}" class="tab_element" bindtap="click" data-index="{{index}}">
<view class="inner {{index == tabIndex? 'active' : '' }}">
{{item.serviceTypeName}}
<block wx:if="{{item.serviceType == 0&&totals_zc}}">({{totals_zc|| 0}})</block>
</view>
<view wx:if="{{index == tabIndex}}" class="line"></view>
</view>
</block>
</scroll-view>
</view>
<!-- currentServiceType 0售后众筹 1续保膨胀金 2定保招揽 3私域运营 4精品礼券 5续保招揽 6节假日关怀 -->
<view class="pannel" style="height:calc(100% - 30rpx)">
<!-- 售后众筹 -->
<view wx:if="{{fn.arrInclues(currentServiceType,[0])}}" style="height: calc(100% - 30rpx);">
<workertableEntrance entranceType="{{currentServiceType}}" ids="{{ids}}" fresh="{{fresh}}" isHaveSubcribe="{{isHaveSubcribe}}" bind:total="getTotal" />
</view>
<!-- 精品升级 会员权益 -->
<view wx:if="{{fn.arrInclues(currentServiceType,[1,2,3,4])}}" style="height: calc(100% - 30rpx);">
<OutputWork entranceType="{{currentServiceType}}"/>
</view>
</view>
</view>
</block>
<!-- 安装信息 -->
<install-popup show="{{showPopup}}" data="{{installItem}}" bind:hidePopup="hidePopup"></install-popup>
<!-- 菜单信息 -->
<menu bind:currentMenu="getCurrentMenu" tabs="{{tab}}" totals="{{totals_zc}}" tabIndex="{{tabIndex}}" show="{{showMenu}}"></menu>
\ No newline at end of file \ No newline at end of file
var arrInclues = function(num,arr){
var flag = false
for(var i = 0;i<arr.length;i++){
if(num==arr[i]){
flag = true
}
}
return flag
}
module.exports = {
arrInclues: arrInclues
}
\ No newline at end of file \ No newline at end of file
export default {
data: {
activityTypList: ['众筹']
}
}
\ No newline at end of file \ No newline at end of file
import USERAPI from '~/api/usersApi/index'
Page({
/**
* 页面的初始数据
*/
data: {
navStyle: 'background-color: rgba(0,0,0,0);',
},
jumpLogout() {
wx.navigateTo({
url: '/pages/tab/logout/logout',
})
},
logout() {
let _this = this
wx.showModal({
title: '温馨提示',
content: '是否退出当前账号?',
confirmColor: '#4466F0',
success(res) {
if (res.confirm) {
// _this.showLoading()
wx.$api.showLoading()
USERAPI.logout().then(_res_ => {
const fn = wx.getFileSystemManager()
fn.readdir({
dirPath: wx.env.USER_DATA_PATH,
success({ files }) {
files.length &&
files.map(e => {
fn.unlink({
filePath: `${wx.env.USER_DATA_PATH}/${e}`
})
})
}
})
// wx.$storage.rm('fileList')
wx.$storage.rm('sessionId')
wx.$storage.rm('userInfo')
wx.$storage.rm('auto_login_object')
wx.$storage.rm('posterId')
wx.$storage.rm("mock_data")
wx.$router.reLaunch('login.index')
})
}
}
})
},
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () { },
/**
* 生命周期函数--监听页面显示
*/
onShow: function (){
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () { },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () { },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () { }
})
{
"navigationStyle": "custom"
}
\ No newline at end of file \ No newline at end of file
page {
background-color: #fff;
}
.layout {
box-sizing: border-box;
position: relative;
// padding: 400rpx 16rpx 0;
padding-top: 400rpx;
font-size: 24rpx;
color: #8A8C90;
&::after {
content: '';
width: 100%;
height: 864rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant-assemble/login/bg-top.webp') no-repeat;
background-size: 100% 100%;
position: absolute;
left: 0;
top: 0;
z-index: -1;
}
.tabContainer {
height: 100rpx;
}
}
.logout-panel {
width: 686rpx;
height: 156rpx;
background-image: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
border-radius: 16rpx;
margin: 32rpx auto;
display: flex;
align-items: center;
justify-content: space-between;
padding: 36rpx;
box-sizing: border-box;
text {
font-size: 32rpx;
color: #282829;
font-weight: 600;
}
}
\ No newline at end of file \ No newline at end of file
<!-- pages/tab/output/output.wxml -->
<navigation-bar showBack="{{true}}" navStyle="{{navStyle}}" bindnavbarReady="navbarReady">我的</navigation-bar>
<view class="layout" style="padding-top:{{tabBarStyle}}px;">
<view class="logout-panel" bindtap="logout">
<text>退出登录</text>
<view>1</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// pages/tab/mine/mine.js
// import { IMG_URL } from '~/utils/constantData'
import USERAPI from '~/api/usersApi/index'
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`, icon2: `/personal/icon3.png`,
userAvatarUrl: `/personal/userAvatarUrl.png` userAvatarUrl: `/personal/userAvatarUrl.png`
}) })
import { unreadApi, readApi } from '~/api/index.js'
import { getMockData } from '~/api/api' import { getMockData } from '~/api/api'
Page({ Page({
/** /**
...@@ -17,43 +12,10 @@ Page({ ...@@ -17,43 +12,10 @@ Page({
data: { data: {
navStyle: 'background-color: rgba(0,0,0,0);', navStyle: 'background-color: rgba(0,0,0,0);',
IMAGES, IMAGES,
// isRead: false,
test: `/personal/icon2.png`,
isShowService: false,
}, },
logout() { jumpLogout() {
let _this = this wx.navigateTo({
wx.showModal({ url: '/pages/tab/logout/logout',
title: '温馨提示',
content: '是否退出当前账号?',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
// _this.showLoading()
wx.$api.showLoading()
USERAPI.logout().then(_res_ => {
const fn = wx.getFileSystemManager()
fn.readdir({
dirPath: wx.env.USER_DATA_PATH,
success({ files }) {
files.length &&
files.map(e => {
fn.unlink({
filePath: `${wx.env.USER_DATA_PATH}/${e}`
})
})
}
})
// wx.$storage.rm('fileList')
wx.$storage.rm('sessionId')
wx.$storage.rm('userInfo')
wx.$storage.rm('auto_login_object')
wx.$storage.rm('posterId')
wx.$storage.rm("mock_data")
wx.$router.reLaunch('login.index')
})
}
}
}) })
}, },
navbarReady(e) { navbarReady(e) {
...@@ -61,26 +23,15 @@ Page({ ...@@ -61,26 +23,15 @@ Page({
this.setData({ this.setData({
tabBarStyle: height / 2 + statusBarHeight tabBarStyle: height / 2 + statusBarHeight
}) })
console.log(e)
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: async function (options) { onLoad: async function (options) {
let { userInfo } = wx.$storage.get() let { userInfo } = wx.$storage.get()
let serviceMerchantId = userInfo.subLoginUser?.merchantId
//解决因为使用await 异步导致数据没同步已经开始调用onshow方法
this.setData({ this.setData({
serviceMerchantId,
userInfo: userInfo.subLoginUser userInfo: userInfo.subLoginUser
}) })
let { serviceMerchatList } = await getMockData() || { serviceMerchatList: [] }
this.setData({
isShowService: serviceMerchatList.includes(userInfo.merchantId + '')
})
console.log(serviceMerchantId)
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
......
...@@ -57,10 +57,13 @@ page { ...@@ -57,10 +57,13 @@ page {
.userInfoCon { .userInfoCon {
height: 360rpx; height: 360rpx;
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: space-around;
padding: 0rpx 44rpx;
.info {
flex: 1;
margin-left: 24rpx;
}
.headPortrait { .headPortrait {
width: 128rpx; width: 128rpx;
height: 128rpx; height: 128rpx;
...@@ -70,14 +73,14 @@ page { ...@@ -70,14 +73,14 @@ page {
.name { .name {
font-weight: 600; font-weight: 600;
font-size: 32rpx; font-size: 34rpx;
color: #323436; color: #282829;
margin: 16rpx 0; margin: 16rpx 0;
} }
.id { .id {
font-size: 28rpx; font-size: 28rpx;
color: #323436; color: #282829;
} }
.createTime { .createTime {
......
...@@ -5,15 +5,12 @@ ...@@ -5,15 +5,12 @@
<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="info">
<view class=" test2">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> </view>
<button class="logoutBtn" size="default" type="default" isabled="{{false}}" loading="{{false}}" bindtap="logout" hover-class="button-hover"> <view class="logot" bindtap="jumpLogout">
退出登录 >
</button> </view>
</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
<!-- 加微 -->
<service wx:if="{{isShowService}}"></service>
\ No newline at end of file \ No newline at end of file
// pages/tab/output/components/BusiCard/BusiCard.js
import constantData from './constant/data'
Component({
/**
* 组件的属性列表
*/
properties: {
info: {
type: Object,
value: {}
},
sceneCode: {
type: String,
value: '-1'
},
fromPage: {
type: String,
value: 'client'
},
formData: {
type: Object,
value: () => { }
}
},
lifetimes: {
attached() {
let { fromPage, clientFormObj, staffFormObj } = this.data
let _obj = {}
switch (fromPage) {
case 'staff':
_obj = JSON.parse(JSON.stringify(staffFormObj))
break
default:
_obj = JSON.parse(JSON.stringify(clientFormObj))
break
}
this.setData({
formObj: _obj
})
}
},
/**
* 组件的初始数据
*/
data: {
formObj: {},
timeTabObj: constantData.timeTabObj,
clientFormObj: constantData.clientFormObj,
staffFormObj: constantData.staffFormObj
},
/**
* 组件的方法列表
*/
methods: {
jumpDetail(e) {
const {item} = e.currentTarget.dataset
wx.switchTab({
url: '/packagesList/outDetail/index'
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/output/components/BusiCard/BusiCard.wxss */
.busi-card {
background: #FFFFFF;
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
border-radius: 8rpx;
margin-bottom: 20rpx;
padding: 20rpx 0;
.title-box {
display: flex;
align-items: center;
padding: 0 20rpx;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 8rpx;
padding-bottom: 14rpx;
border-radius: 50%;
}
.title {
display: flex;
justify-content: space-between;
width: calc(100% - 40rpx);
border-bottom: 2rpx dotted #E0E0E0;
padding-bottom: 14rpx;
}
.title-tap {
height: 36rpx;
line-height: 36rpx;
background: #3e71fe1f;
border-radius: 4rpx;
font-size: 20rpx;
color: #3E71FE;
padding: 0 8rpx;
}
}
.bf-blue {
padding: 0;
}
.bf-blue::before {
display: inline-block;
content: '';
width: 6rpx;
height: 28rpx;
background: #3666FE;
border-radius: 0 4rpx 4rpx 0;
margin: -12rpx 16rpx 0 0;
}
.content {
display: flex;
flex-wrap: wrap;
padding: 0 20rpx;
}
.content-item {
width: 33.33%;
text-align: center;
font-size: 20rpx;
color: #999999;
margin: 10rpx 0;
.price {
font-weight: 500;
font-size: 28rpx;
color: #323436;
font-weight: 600;
margin-bottom: 16rpx;
}
}
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/output/components/BusiCard/BusiCard.wxml-->
<wxs src="../index.wxs" module="filter" />
<view class="busi-card">
<view class="title-box" wx:if="{{fromPage == 'staff'}}">
<image wx:if="{{formObj.userAvatar}}" src="{{formObj.userAvatar}}" class="icon" />
<glsx-image wx:else src="personal/staff_defalut_avatar.png" class="icon" />
<view class="title">
{{info.userName}}
<view class="title-tap">{{timeTabObj[formData.timeIdx || '0']}}</view>
</view>
</view>
<view class="title-box bf-blue" wx:else>
<view class="title">{{info.merchantName || info.merchantName4s || ''}}</view>
</view>
<view class="content">
<view wx:for="{{formObj[sceneCode]}}" wx:key="index" class="content-item" data-item="{{item}}" bindtap="jumpDetail">
<view wx:if="{{info[item.name] == '未开通'}}" class="price">{{info[item.name]}}</view>
<view wx:else="" class="price">
{{item.prefix || ''}}
{{item.isNum ? filter.money_three_for_two_thousands(info[item.name] || 0.00) : (info[item.name] || 0)}}
{{item.suffix || ''}}
</view>
<view>{{item.label}}</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
const timeTabObj = {
0: '今日指标',
1: '本月指标',
2: '累计指标'
}
// -1:全部;SC002:精品升级;SC001:会员权益/升级
const clientFormObj = {
'-1': [{
label: '精品升级',
name: 'boutiqueUpgrade',
prefix: '¥',
isNum: true
}, {
label: '售后众筹',
name: 'afterSalesCrowdfunding',
prefix: '¥',
isNum: true
}, {
label: '会员权益/升级',
name: 'vdUpgrade',
prefix: '¥',
isNum: true
}],
'SC002': [{
label: '营业额',
name: 'totalSubOrderOrderMoney',
prefix: '¥',
isNum: true
}, {
label: '到店贴膜量',
name: 'toShopCount'
}, {
label: '升级订单',
name: 'upgradeCount'
}, {
label: '战败订单',
name: 'noUpgradeCount'
}, {
label: '升级客单价',
name: 'calUpPrice',
prefix: '¥',
isNum: true
}, {
label: '升级转化率',
name: 'calTransform',
suffix: '%'
}],
'SC001': [{
label: '营业额',
name: 'turnover',
prefix: '¥',
isNum: true
}, {
label: '推荐客户量',
name: 'customerNum'
}, {
label: '成交客户量',
name: 'successNum'
}, {
label: '融合客单价',
name: 'fuseCustomerPrice',
prefix: '¥',
isNum: true
}, {
label: '权益客单价',
name: 'equityCustomerPrice',
prefix: '¥',
isNum: true
}, {
label: '转化率',
name: 'conversionRate',
suffix: '%'
}]
}
// -1:全部;SC002:精品升级;SC001:会员权益/升级
const staffFormObj = {
'-1': [{
label: '全部',
name: 'totalAmount',
prefix: '¥',
isNum: true
}, {
label: '精品升级',
name: 'totalBoutiqueAmount',
prefix: '¥',
isNum: true
}, {
label: '会员权益/升级',
name: 'totalVdAmount',
prefix: '¥',
isNum: true
}],
'SC002': [{
label: '营业额',
name: 'orderMoneyTotal',
prefix: '¥',
isNum: true
}, {
label: '升级客单价',
name: 'upgradeUnitPrice',
prefix: '¥',
isNum: true
}, {
label: '到店贴膜量',
name: 'toShopTotal'
}, {
label: '升级订单',
name: 'upgradeTotal'
}, {
label: '战败订单',
name: 'notUpgradeTotal'
}, {
label: '升级转化率',
name: 'upgradeRate',
suffix: '%'
}],
'SC001': [{
label: '营业额',
name: 'orderMoneyTotal',
prefix: '¥',
isNum: true
}, {
label: '推荐客户量',
name: 'recommendTotal'
}, {
label: '成交客户量',
name: 'dealTotal'
}, {
label: '融合客单价',
name: 'fusionUnitPrice',
prefix: '¥',
isNum: true
}, {
label: '权益客单价',
name: 'vdUnitPrice',
prefix: '¥',
isNum: true
}, {
label: '转化率',
name: 'convertRate',
suffix: '%'
}]
}
export default {
timeTabObj,
clientFormObj,
staffFormObj
}
\ No newline at end of file \ No newline at end of file
// pages/tab/output/components/StaffSort/StaffSort.js
import { scenceList } from '~/pages/tab/index/constant/data'
const busiOptSceneCode = ['-1', 'SC001', 'SC002']
import mineApi from '~/api/mineApi/index'
import { getNowMonth } from '~/utils/format'
import { IMG_URL } from '~/utils/constantData'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
busiOptSceneCode,
formData: {
// 0:全部-1;2:精品升级SC002;1:会员权益/升级SC001
busiIdx: 0,
sceneCode: '-1',
yqMerchantName: '服务中心',
timeIdx: 0
},
// 服务中心
popupShow: false,
serviceList: [],
// 筛选项折叠
isFold: false,
isInputClear: false,
baseData: {
busiList: [],
timeList: [{
label: '今日指标',
name: 'todayTime'
}, {
label: '本月指标',
name: 'monthTime'
}, {
label: '累计指标',
name: 'defaultTime'
}]
}
},
lifetimes: {
created() {
this.initTime()
},
attached() {
this.dealBusiList()
this.getSeviceCenter()
}
},
/**
* 组件的方法列表
*/
methods: {
dealSearchTime() {
let { dataObj, formData, baseData: { timeList } } = this.data
var params = dataObj[timeList[formData.timeIdx || 0]?.name || 'todayTime']
return params
},
dealParams() {
let { formData } = this.data
let params = {
sceneType: formData.busiIdx || '',
yqMerchantIds: formData.yqMerchantId || '',
userName: formData.userName || '',
...this.dealSearchTime()
}
return params
},
// handleInputeClear(e) {
// this.setData({
// isInputClear: true,
// ['formData.userName']: ''
// })
// console.log(this.data.isInputClear, 'isInputClear---')
// },
handleInput(e) {
let { attr } = e.currentTarget.dataset
let { value } = e.detail
this.setData({
['formData.' + attr]: value
})
},
changeFold() {
// let { isInputClear } = this.data
// if (isInputClear) {
// this.setData({
// isInputClear: false
// })
// return true
// }
this.setData({
isFold: !this.data.isFold
})
},
handleInputFocus() {
this.changeFold()
},
handleInputBlur() {
this.changeFold()
this.triggerEvent('staffSearch')
},
// 获取服务中心数据
getSeviceCenter() {
mineApi.getServiceCenterListAPI({}).then(res => {
let data = res || []
let serviceIds = data.map(val => { return val.yqMerchantId })
this.setData({
serviceList: res || [],
allServiceIds: serviceIds
})
})
},
// 筛选服务中心
filterTypeFn() {
this.setData({
popupShow: !this.data.popupShow
})
},
// 获取员工列表
handleServiceChange(e) {
wx.$api.hideLoading()
let { formData } = this.data
this.setData({
formData: {
...formData,
yqMerchantId: e.detail.yqMerchantId,
yqMerchantName: e.detail.yqMerchantName
}
})
this.triggerEvent('staffSearch')
},
// 格式化时间
initTime() {
let date = new Date()
let today = date.getDate()
let month = getNowMonth()
const todayTime = {
dataBeginDate: `${month}-${today} 00:00:00`,
dataEndDate: `${month}-${today} 23:59:59`
}
const monthTime = {
dataBeginDate: `${month}-01 00:00:00`,
dataEndDate: `${month}-${today} 23:59:59`
}
const defaultTime = {
dataBeginDate: '',
dataEndDate: `${month}-${today} 23:59:59`
}
this.setData({
dataObj: {
todayTime,
monthTime,
defaultTime
}
})
},
handleTimeChange() {
let { baseData: { timeList } } = this.data
wx.showActionSheet({
itemList: timeList.map(item => item.label),
success: res => {
this.setData({
['formData.timeIdx']: res.tapIndex
})
this.triggerEvent('staffSearch')
}
})
},
dealBusiList() {
let list = [{
name: '全部业务',
sceneCode: '-1'
}]
busiOptSceneCode.forEach(item => {
let _target = scenceList.find(k => k.sceneCode == item)
if (_target) {
list.push({
name: _target.name,
sceneCode: _target.sceneCode
})
}
})
this.setData({
['baseData.busiList']: list
})
},
handleClickTab(e) {
let { baseData: { busiList } } = this.data
// 筛选
wx.showActionSheet({
itemList: busiList.map(item => item.name),
success: res => {
this.setData({
['formData.busiIdx']: res.tapIndex,
['formData.sceneCode']: busiOptSceneCode[res.tapIndex]
})
this.triggerEvent('staffSearch')
}
})
},
}
})
{
"component": true,
"usingComponents": {
"select-service-popup": "../selectServicePopup/selectServicePopup"
}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/output/components/StaffSort/StaffSort.wxss */
.total-tab {
box-sizing: border-box;
background: #FFFFFF;
display: flex;
justify-content: space-between;
height: 92rpx;
padding: 16rpx;
.tabs-box {
display: flex;
width: calc(100% - 138rpx);
}
.tab {
box-sizing: border-box;
display: inline-block;
width: auto;
height: 60rpx;
background: #F2F3F7;
border-radius: 32rpx;
padding: 13rpx 18rpx;
font-size: 24rpx;
color: #8A8C90;
margin-right: 16rpx;
flex-shrink: 0;
}
.tab.active {
background: #3666fe1a;
color: #3666FE;
}
.tab:last-child {
margin-right: 0;
}
.icon {
width: 32rpx;
height: 32rpx;
}
.right-box {
display: flex;
box-sizing: border-box;
height: 60rpx;
color: #8A8C90;
}
.input {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
width: 136rpx;
height: 60rpx;
background: #F8F9FC;
border-radius: 38rpx;
padding: 0 20rpx;
margin-left: 10rpx;
transition: width 0.2s ease-out;
}
.input-flex {
display: flex;
align-items: center;
}
.icon-delete {
box-sizing: border-box;
width: 50rpx;
height: 60rpx;
text-align: center;
flex-shrink: 0;
.icon {
margin-top: 16rpx;
}
}
.long-input {
width: calc(100vw - 180rpx);
}
.input-placeholder {
font-size: 24rpx;
color: #858A94;
}
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/output/components/StaffSort/StaffSort.wxml-->
<view class="total-tab">
<view wx:if="{{isFold}}" class="tab {{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? 'active' : ''}}">
{{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? '已选' : '筛选'}}
<glsx-image src="{{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? 'output/sort.png' : 'output/sort-default.png'}}" class="icon" />
</view>
<scroll-view wx:else scroll-x="{{true}}">
<view class="tabs-box">
<view class="tab {{formData.busiIdx != '0' ? 'active' : ''}}" bindtap="handleClickTab">
{{baseData.busiList[formData.busiIdx || 0].name}}
<glsx-image src="{{formData.busiIdx != '0' ? 'output/icon-arrow-act.png' : 'output/icon-arrow.png'}}" class="icon" />
</view>
<view class="tab {{formData.yqMerchantId ? 'active' : ''}}" data-attr="tabActive" data-val="store" bindtap="filterTypeFn">
{{ formData.yqMerchantName }}
<glsx-image src="{{formData.yqMerchantId ? 'output/icon-arrow-act.png' : 'output/icon-arrow.png'}}" class="icon" />
</view>
<view class="tab {{formData.timeIdx != '0' ? 'active' : ''}}" bindtap="handleTimeChange">
{{baseData.timeList[formData.timeIdx || 0].label}}
<glsx-image src="{{formData.timeIdx != '0' ? 'output/icon-arrow-act.png' : 'output/icon-arrow.png'}}" class="icon" />
</view>
</view>
</scroll-view>
<view class="right-box input {{ isFold ? 'long-input' : '' }}">
<!-- <view class="right-box input long-input"> -->
<view class="input-flex">
<glsx-image src="output/searchIcon.png" class="icon" />
<input type="text" placeholder="{{isFold ? '请输入员工姓名搜索' : '搜索'}}" maxlength="30" value="{{formData.userName}}" placeholder-class="input-placeholder" data-attr="userName" confirm-type="search" bindinput="handleInput" bindfocus="handleInputFocus" bindblur="handleInputBlur" />
</view>
<!-- <view wx:if="{{isFold}}" class="icon-delete" bindtap="handleInputeClear" data-attr="userName">
<glsx-image src="output/icon-delete.png" class="icon" />
</view> -->
</view>
</view>
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="handleServiceChange" selectInfo="{{formData}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" />
\ No newline at end of file \ No newline at end of file
// pages/tab/output/components/TotalTab/TotalTab.js
import { scenceList } from '~/pages/tab/index/constant/data'
const busiOptSceneCode = ['-1', 'SC002', 'SC004', 'SC001']
import outputApi from '~/api/outputApi/index'
import { getNowMonth } from '~/utils/format'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
busiOptSceneCode,
tabActive: 'store',
// tabActive: 'business',
formData: {
// 0:全部-1;1:精品升级SC002;2:售后众筹SC004;3:会员权益/升级SC001
busiIdx: 0,
sceneCode: '-1',
// 时间筛选Idx(全部,精品升级,会员权益)
timeIdx: 0,
// 产品/状态筛选Idx(售后众筹)
proIdx: 0,
statusIdx: 0
},
// 众筹-筛选
isCrowdPopupShow: false,
crowdFormData: {
proIdx: 0,
statusIdx: 0
},
baseData: {
busiList: [],
proList: [],
timeList: ['全部', '本月', '本日'],
actStatusList: ['全部', '申请中', '活动中', '已结束']
}
},
lifetimes: {
attached() {
this.initTime()
this.dealBusiList()
this.getProList('SC004')
}
},
/**
* 组件的方法列表
*/
methods: {
resetBusiSearch() {
this.setData({
['formData.timeIdx']: 0,
['formData.proIdx']: 0,
['formData.statusIdx']: 0
})
},
getProList(sceneCode) {
var params = {
sceneCode: sceneCode
}
outputApi.findProByScene(params).then(res => {
let list = res[0]?.productList || []
list.unshift({
productCode: '',
productName: '全部'
})
this.setData({
['baseData.proList']: list
})
})
},
dealBusiList() {
let list = [{
name: '全部',
sceneCode: '-1'
}]
busiOptSceneCode.forEach(item => {
let _target = scenceList.find(k => k.sceneCode == item)
if (_target) {
list.push({
name: _target.name,
sceneCode: _target.sceneCode
})
}
})
this.setData({
['baseData.busiList']: list
})
},
handleSet(e) {
let { attr, val } = e.currentTarget.dataset
this.setData({
[attr]: val
})
this.triggerEvent('tabChange', { tabActive: val })
},
handleClickTab(e) {
let { tabActive, baseData: { busiList } } = this.data
// 切换tab
if (tabActive != 'business') {
this.handleSet(e)
// this.handleSearch()
return true
}
// 筛选
wx.showActionSheet({
itemList: busiList.map(item => item.name),
success: res => {
this.resetBusiSearch()
this.setData({
['formData.busiIdx']: res.tapIndex,
['formData.sceneCode']: busiOptSceneCode[res.tapIndex]
})
this.handleBusiSearch()
}
})
},
handleTimeChange() {
let { baseData: { timeList } } = this.data
wx.showActionSheet({
itemList: timeList,
success: res => {
this.setData({
['formData.timeIdx']: res.tapIndex
})
this.handleBusiSearch()
}
})
},
// 众筹-筛选
handlePopupConChange(e) {
let { idx, attr } = e.currentTarget.dataset
this.setData({
[`crowdFormData.${attr}`]: idx
})
},
handleCrowdPopup() {
let { formData: { proIdx, statusIdx } } = this.data
this.setData({
['crowdFormData.proIdx']: proIdx,
['crowdFormData.statusIdx']: statusIdx,
isCrowdPopupShow: !this.data.isCrowdPopupShow
})
},
handleCrowdConfirm() {
let { crowdFormData: { proIdx, statusIdx } } = this.data
this.setData({
['formData.proIdx']: proIdx,
['formData.statusIdx']: statusIdx,
isCrowdPopupShow: !this.data.isCrowdPopupShow
})
this.handleBusiSearch()
},
// 格式化时间
initTime() {
let date = new Date()
let today = date.getDate()
let month = getNowMonth()
const todayTime = {
startTime: `${month}-${today} 00:00:00`,
endTime: `${month}-${today} 23:59:59`
}
const monthTime = {
startTime: `${month}-01 00:00:00`,
endTime: `${month}-${today} 23:59:59`
}
const defaultTime = {
startTime: '',
endTime: `${month}-${today} 23:59:59`
}
this.setData({
dataObj: {
todayTime,
monthTime,
defaultTime
}
})
},
dealSearchTime() {
let { dataObj, formData } = this.data
var params = {}
switch (formData.timeIdx) {
// 本月
case 1:
params = dataObj.monthTime
break
// 本日
case 2:
params = dataObj.todayTime
break
}
return params
},
dealSearchStatus() {
let { formData } = this.data
var activityStatuList = []
switch (formData.statusIdx) {
case 0:
activityStatuList = [1, 2, 3]
break
// 申请中
case 1:
activityStatuList = [1]
break
// 活动中
case 2:
activityStatuList = [2]
break
// 已结束
case 3:
activityStatuList = [3]
break
}
return activityStatuList
},
dealSearchCrowd() {
let params = []
let { formData, baseData: { proList } } = this.data
let attrToNum = {
'PC005': 1,
'PC006': 2,
'PC007': 3,
'PC008': 4,
'PC009': 5
}
if (formData.busiIdx == 2 && formData?.proIdx) {
params.categoryList = [attrToNum[proList[formData?.proIdx].productCode] || '-1']
params.activityStatusList = this.dealSearchStatus()
}
return params
},
dealParams() {
let { formData } = this.data
let params = {
type: formData.busiIdx || '',
...this.dealSearchTime(),
...this.dealSearchCrowd()
}
return params
},
handleBusiSearch() {
this.triggerEvent('busiSearch')
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/output/components/TotalTab/TotalTab.wxss */
.total-tab {
box-sizing: border-box;
background: #FFFFFF;
display: flex;
justify-content: space-between;
height: 92rpx;
padding: 16rpx;
.flex {
display: flex;
flex-shrink: 0;
}
.tab {
box-sizing: border-box;
height: 60rpx;
background: #F2F3F7;
border-radius: 32rpx;
padding: 13rpx 18rpx;
font-size: 24rpx;
color: #8A8C90;
}
.tab.active {
background: #3666fe1a;
color: #3666FE;
}
.tab:first-child {
margin-right: 16rpx;
}
.icon {
width: 32rpx;
height: 32rpx;
}
.right-box {
display: flex;
box-sizing: border-box;
height: 60rpx;
color: #8A8C90;
padding: 13rpx 0;
}
}
.popup-fix {
bottom: 110rpx !important;
}
.popup {
padding: 32rpx;
.title {
font-weight: 600;
font-size: 28rpx;
color: #000000;
margin-bottom: 16rpx;
}
.content {
display: flex;
flex-wrap: wrap;
}
.popup-tab {
box-sizing: border-box;
height: 60rpx;
background: #F5F3F3;
color: #8A8C90;
border-radius: 32rpx;
padding: 12rpx 20rpx;
margin: 0 16rpx 16rpx 0;
}
.popup-tab.active {
background: #3666fe1a;
color: #3666FE;
}
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/output/components/TotalTab/TotalTab.wxml-->
<view class="total-tab">
<view class="flex">
<view class="tab {{tabActive =='store' ? 'active' : ''}}" data-attr="tabActive" data-val="store" bindtap="handleSet">门店经营汇总</view>
<view class="tab {{tabActive =='business' ? 'active' : ''}}" data-attr="tabActive" data-val="business" bindtap="handleClickTab">
业务经营汇总 | {{baseData.busiList[formData.busiIdx || 0].name}}
<glsx-image src="{{tabActive =='business' ? 'output/icon-arrow-act.png' : 'output/icon-arrow.png'}}" class="icon" />
</view>
</view>
<view class="right-box" wx:if="{{tabActive =='business'}}">
<view wx:if="{{busiOptSceneCode[formData.busiIdx] == 'SC004'}}" bindtap="handleCrowdPopup">{{baseData.proList[formData.proIdx].productName}}</view>
<view wx:else bindtap="handleTimeChange">{{baseData.timeList[formData.timeIdx]}}</view>
<glsx-image src="output/icon-arrow.png" class="icon" bindtap="{{busiOptSceneCode[formData.busiIdx] == 'SC004' ? 'handleCrowdPopup' : 'handleTimeChange'}}"/>
</view>
</view>
<!-- 众筹-筛选 -->
<popup show="{{isCrowdPopupShow}}" title="筛选" height="784rpx" bindconfirm="handleCrowdConfirm" bindhidePopup="handleCrowdPopup" custom-class="popup-fix">
<view class="popup">
<view class="title">产品筛选</view>
<view class="content">
<view class="popup-tab {{crowdFormData.proIdx == index ? 'active' : ''}}" wx:for="{{baseData.proList}}" wx:key="index" bindtap="handlePopupConChange" data-attr="proIdx" data-idx="{{index}}">{{item.productName}}</view>
</view>
<view class="title">活动状态</view>
<view class="content">
<view class="popup-tab {{crowdFormData.statusIdx == index ? 'active' : ''}}" wx:for="{{baseData.actStatusList}}" wx:key="index" bindtap="handlePopupConChange" data-attr="statusIdx" data-idx="{{index}}">{{item}}</view>
</view>
</view>
</popup>
\ No newline at end of file \ No newline at end of file
...@@ -26,15 +26,32 @@ Component({ ...@@ -26,15 +26,32 @@ Component({
pageSize: 10 pageSize: 10
}, },
totalPages: -1, totalPages: -1,
list: [] list: [],
sceneCodeList: ['SC002', 'SC003', 'SC004', 'SC001'],
tabActive: 'store',
// 业务经营汇总
stickyScrollTop: 0,
stickyOffsetTop: 0,
formData: {
// 0:全部-1;1:精品升级SC002;2:售后众筹SC004;3:会员权益/升级SC001
busiIdx: 0,
sceneCode: '-1',
// 时间筛选Idx(全部,精品升级,会员权益)
timeIdx: 0,
// 产品/状态筛选Idx(售后众筹)
proIdx: 0,
statusIdx: 0
},
busiObj: {},
busiTotalList: [],
crowdOrderObj: {}
}, },
lifetimes: { lifetimes: {
attached() { attached() {
wx.$eventbus.on('clientRefresh', res => { wx.$eventbus.on('clientRefresh', res => {
this.clientRefresh() this.getBusinessData()
}) })
this.getPMerchantInfo() this.getBusinessData()
this.getClientApi()
} }
}, },
...@@ -42,6 +59,118 @@ Component({ ...@@ -42,6 +59,118 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
getBusinessData() {
this.getBusiStatistics()
},
// 升降序
handleSort() {
this.getBusiStatistics(true)
},
// 吸顶
handleBusiScroll: wx.$util.debounce(function (e) {
this.setData({
stickyScrollTop: e?.detail?.scrollTop
})
}, 50),
resetBusiData() {
this.setData({
busiObj: {},
busiTotalList: [],
crowdOrderObj: {}
})
},
// 众筹数据处理
dealCrowdObj(data) {
let _obj = {
totalNum: data.activityTotal,
totalOrderCount: data.orderTotal,
totalAmount: data.totalAmount,
activityList: data.activityList || []
}
_obj.activityList.forEach(k => {
// 时间
k.time = k.startTime.slice(0, 16).replace(/-/g, '.') + ' - ' + k.endTime.slice(0, 16).replace(/-/g, '.')
let startTimeFormat = k.startTime.slice(0, 10).replace(/-/g, '/') + ' 00:00:00'
let nowDateFormat = new Date().toLocaleDateString().replace(/-/g, '/') + ' 23:59:59'
// activityStatus 1:未开始 2:进行中 3:已结束
switch (k.activityStatus) {
case 1:
k.interDays = parseInt((new Date(startTimeFormat).getTime() - new Date().getTime()) / (1000 * 60 * 60 * 24)) + 1
k.realTime = '-'
break
case 2:
let endTimeFormat = k.endTime.slice(0, 10).replace(/-/g, '/') + ' 23:59:59'
k.interDays = parseInt((new Date().getTime() - new Date(startTimeFormat).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.toEndDays = parseInt((new Date(endTimeFormat).getTime() - new Date(nowDateFormat).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.realTime = k.realStartTime?.slice(0, 16).replace(/-/g, '.') + ' - ' + '已开始' + k.interDays + '天'
break
case 3:
k.interDays = parseInt((new Date(nowDateFormat).getTime() - new Date(k.endTime.replace(/-/g, '/')).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.realTime = (k.realStartTime?.slice(0, 16).replace(/-/g, '.') || '') + ' - ' + (k.realEndTime?.slice(0, 16).replace(/-/g, '.') || '')
break
}
})
this.setData({
crowdOrderObj: _obj
})
},
getBusiStatistics(isReset = false, isBusiTab = false) {
let sortTabModule = this.selectComponent('#sortTab')
if (sortTabModule && isBusiTab) {
sortTabModule.resetAllAsc()
}
let sortSearchData = sortTabModule ? sortTabModule.dealParams() : {}
let { userInfo } = wx.$storage.get()
let params = {
...sortSearchData,
merchantIds: [userInfo.subLoginUser.merchantId]
}
outputApi.getBusiStatistics(params).then(res => {
this.resetBusiData()
if (isReset) {
this.setData({
busiScrollTop: 0
})
}
this.setData({
triggered: false
})
let _list = []
_list = res.merchantList || []
// 0:全部-1;1:精品升级SC002;2:售后众筹SC004;3:会员权益/升级SC001
let _openList = [{
code: 'SC002',
name: 'boutiqueUpgrade'
}, {
code: 'SC004',
name: 'afterSalesCrowdfunding'
}, {
code: 'SC001',
name: 'vdUpgrade'
}]
_list.forEach(item => {
_openList.forEach(k => {
if (!item.sceneCodes) {
item[k.name] = '未开通'
} else if (item.sceneCodes && !item.sceneCodes.includes(k.code)) {
item[k.name] = '未开通'
}
})
})
this.setData({
busiObj: res,
totalProfit: res.activityTotal,
busiTotalList: _list
})
})
},
// 门店经营汇总-start
getPMerchantInfo() { getPMerchantInfo() {
let { userInfo } = wx.$storage.get() let { userInfo } = wx.$storage.get()
this.setData({ this.setData({
...@@ -54,7 +183,6 @@ Component({ ...@@ -54,7 +183,6 @@ Component({
}, },
clientRefresh(isPull = false) { clientRefresh(isPull = false) {
this.getPMerchantInfo() this.getPMerchantInfo()
console.log('clientRefresh');
this.setData({ this.setData({
['pageObj.currentPage']: 1, ['pageObj.currentPage']: 1,
list: [] list: []
...@@ -62,8 +190,8 @@ Component({ ...@@ -62,8 +190,8 @@ Component({
this.getClientApi(isPull) this.getClientApi(isPull)
}, },
getClientApi(isPull = false) { getClientApi(isPull = false) {
this.getProfit() // this.getProfit()
this.getList() // this.getList()
isPull && isPull &&
wx.$api.showToast({ wx.$api.showToast({
title: '刷新成功', title: '刷新成功',
...@@ -76,20 +204,19 @@ Component({ ...@@ -76,20 +204,19 @@ Component({
}) })
} }
}, },
getProfit() {
outputApi.getMerchantTotal({ merchantId: this.data.pMerchantId }).then(res => {
this.setData({
totalProfit: res
})
})
},
getList() { getList() {
let { sceneCodeList } = this.data
outputApi.getCustomerPageList({ merchantId: this.data.pMerchantId, ...this.data.pageObj }).then(res => { outputApi.getCustomerPageList({ merchantId: this.data.pMerchantId, ...this.data.pageObj }).then(res => {
var list = this.data.list var list = this.data.list
list = list.concat(res.list) list = list.concat(res.list)
list.forEach((item, index) => { list.forEach((item, index) => {
item.scenePriceList = []
item.sceneList.forEach((k, idx) => { item.sceneList.forEach((k, idx) => {
item['scene' + (idx + 1)] = item.sceneList[idx].flag item['scene' + (idx + 1)] = item.sceneList[idx].flag
let i = sceneCodeList.findIndex(m => m == k.sceneCode)
item.scenePriceList[i] = {
total: item.sceneList[idx].totalMoney || 0
}
}) })
item.isOpenScene = item.sceneList.map(item => item.flag).some(item => item == true) item.isOpenScene = item.sceneList.map(item => item.flag).some(item => item == true)
}) })
...@@ -136,7 +263,6 @@ Component({ ...@@ -136,7 +263,6 @@ Component({
}, },
/**长按海报 */ /**长按海报 */
async longtouch(e) { async longtouch(e) {
console.log('长按海报', e)
this.clientRefresh() this.clientRefresh()
let { activityId } = e.detail let { activityId } = e.detail
const res = await outputApi.reportPosterTrack({ const res = await outputApi.reportPosterTrack({
...@@ -149,17 +275,12 @@ Component({ ...@@ -149,17 +275,12 @@ Component({
var params = { var params = {
merchantId: currentItem.merchantId, merchantId: currentItem.merchantId,
merchantName: currentItem.merchantName, merchantName: currentItem.merchantName,
// scene1: currentItem.scene1,
// scene2: currentItem.scene2,
// scene3: currentItem.scene3,
// scene4: currentItem.scene4,
// sceneList: currentItem.sceneList,
// sceneCodeList: currentItem.sceneList.map(item => item.sceneCode),
pMerchantId: this.data.pMerchantId, pMerchantId: this.data.pMerchantId,
pMerchantName: this.data.pMerchantInfo.subLoginUser.merchantName, pMerchantName: this.data.pMerchantInfo.subLoginUser.merchantName,
isSuper: this.data.pMerchantInfo.isSuper isSuper: this.data.pMerchantInfo.isSuper
} }
wx.$router.go('/packagesList/packageOutput/pages/summary', params) wx.$router.go('/packagesList/packageOutput/pages/summary', params)
} }
// 门店经营汇总-end
} }
}) })
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"scene-box": "../../../../../components/SceneBox/SceneBox" "scene-box": "../../../../../components/SceneBox/SceneBox",
"total-tab": "../TotalTab/TotalTab",
"busi-card": "../BusiCard/BusiCard",
"output-crowdfund": "../outputCrowdfund/outputCrowdfund",
"sort-tab": "../sortTab/sortTab"
} }
} }
\ No newline at end of file \ No newline at end of file
/* pages/tab/output/components/client/client.wxss */ /* pages/tab/output/components/client/client.wxss */
.client { .client {
box-sizing: border-box; box-sizing: border-box;
height: 100%; height: calc(100% - 92rpx);
color: #323436; color: #323436;
// padding-top: 16rpx; // padding-top: 16rpx;
background-color: #F2F3F7; // background-color: #F2F3F7;
background-color: #FFFFFF;
} }
.client-box { .client-box {
margin: 0 16rpx; margin: 0 16rpx;
} }
.shadow {
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
// box-shadow: 0 2rpx 20rpx 0 red;
}
.output-box {
margin: 16rpx 0;
}
.flex { .flex {
display: flex; display: flex;
} }
...@@ -35,13 +45,21 @@ ...@@ -35,13 +45,21 @@
.price-txt { .price-txt {
// font-family: 'test'; // font-family: 'test';
font-size: 28rpx; font-size: 40rpx;
margin-left: 16rpx;
// font-weight: Bold; // font-weight: Bold;
// font-family: 'number'; // font-family: 'number';
// font-size: 26rpx; // font-size: 26rpx;
} }
} }
.sort-fix {
box-sizing: border-box;
position: absolute;
top: 0;
left: 16rpx;
}
.price-txt { .price-txt {
// font-family: 'test'; // font-family: 'test';
font-weight: Bold; font-weight: Bold;
......
<!-- pages/tab/output/components/client/client.wxml --> <!-- pages/tab/output/components/client/client.wxml -->
<wxs src="../../index.wxs" module="filter" /> <wxs src="../../index.wxs" module="filter" />
<scroll-view class="client" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindscrolltolower="onReachBottom" bindrefresherrefresh="onBindRefresh" lower-threshold='50' scroll-top="{{scrollTop}}"> <!-- <total-tab id="totalTab" bindbusiSearch="handleBusiSearch" bindtabChange="handleTabChange"></total-tab> -->
<!-- <view class="test">1234567890</view> --> <scroll-view class="client" id="scroller" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="handleSort" lower-threshold='50' bind:scroll="handleBusiScroll" scroll-top="{{busiScrollTop}}">
<view class="client-box"> <view class="client-box">
<view class="profit-box flex-between"> <!-- 总收益 -->
<text>总收益</text> <view>
<view class="profit-box flex">
<text>总产值</text>
<text class="price-txt">¥{{filter.money_three_for_two_thousands(totalProfit || 0.00)}}</text> <text class="price-txt">¥{{filter.money_three_for_two_thousands(totalProfit || 0.00)}}</text>
</view> </view>
<view wx:for="{{list}}" wx:key="index" bindtap="handleJump" data-idx="{{index}}"> <view><input type="text" placeholder="输入门店"/></view>
<view class="box {{item.activityLastUnSharedInfo ? 'share' : ''}}">
<view class="head flex-between">
<view class="name ">{{item.merchantName}}</view>
<view class="price-txt ">¥{{filter.money_three_for_two_thousands(item.totalMoney || 0.00)}}</view>
</view>
<!-- 场景内容 -->
<view class="box-content">
<scene-box sceneInfo="{{item}}" hasLockIcon="{{false}}" />
<!-- 通知 -->
<view class="box-bottom">
<view wx:if="{{item.msgList.length}}" class="flex">
<view class="tip-blue">最新</view>
<view class="bottom-content">
<view class="flex-between tip-row" wx:for="{{item.msgList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view>{{subItem.msg}}</view>
<view class="time">{{subItem.createTime}}</view>
</view>
</view>
</view>
<view wx:if="{{!item.msgList.length && !item.isOpenScene}}" class="flex">
<view class="tip-blue">通知</view>
<view class="bottom-content">
<view class="tip-row">
<view> <view>
运营建议:您的门店尚未开展活动,暂无产值。建议 <sort-tab id="sortTab" class="{{stickyScrollTop > 74 ? 'sort-fix' : ''}}" style="top: {{stickyScrollTop - 16 + 'px'}}" sceneCode="{{formData.sceneCode}}" bindhandleSort="handleSort"></sort-tab>
<text class="tip-link" catchtap="handleJumpIdx">开通新产品</text>
拓展营收范围。
</view>
</view> </view>
</view> </view>
<!-- 0:全部;1:精品升级;3:会员权益/升级 -->
<view>
<view wx:for="{{busiTotalList}}" wx:key="index">
<busi-card info="{{item}}" sceneCode="{{formData.sceneCode}}"></busi-card>
</view> </view>
<view class="end-txt">
{{busiTotalList.length ? '到底啦!' : '暂无数据'}}
</view> </view>
</view> </view>
</view> </view>
<!-- 分享海报 -->
<view wx:if="{{item.activityLastUnSharedInfo}}" class="box-share">
<view>{{item.activityLastUnSharedInfo.activityName}}正在进行,分享母链海报开展业务</view>
<view class="btn-share" catchtap="handleShare" data-idx="{{index}}">去分享</view>
</view>
</view>
<view wx:if="{{totalPages != -1 && pageObj.currentPage == totalPages}}" class="end-txt">
到底啦!
</view>
</view>
</scroll-view> </scroll-view>
<crowdfund-poster item="{{posterItem}}" id="poster" scrollImg="{{false}}" bindlongtouch="longtouch" /> <crowdfund-poster item="{{posterItem}}" id="poster" scrollImg="{{false}}" bindlongtouch="longtouch" />
\ No newline at end of file \ No newline at end of file
/**设置千分位 */
var setPrice = function (n = 0.0) {
if ((typeof n == 'string' || typeof n == 'number') && !isNaN(n)) {
n = parseFloat(n).toFixed(2)
var r = getRegExp('(d{1,3})(?=(d{3})+(?:.))', 'g')
var p = n.replace(r, ',')
return p
// var r = getRegExp('/./', 'g')
// var p = n.replace(r, 'test')
// return n
} else {
console.log(n, '不是一个数字', !isNaN(n))
}
}
var threeNumForTwo = {
money_three_for_two_thousands: function (num) {
//num = parseInt(num);
// return num
var num = num + ''
var d = ''
if (num.slice(0, 1) == '-') {
d = num.slice(0, 1)
num = num.slice(1)
}
var len = num.length
var index = num.indexOf('.')
if (index == -1) {
num = num + '.00'
} else if (index + 2 == len) {
num = num + '0'
}
var index = num.indexOf('.') // 字符出现的位置
var num2 = num.slice(-3)
num = num.slice(0, index)
var result = ''
while (num.length > 3) {
result = ',' + num.slice(-3) + result
num = num.slice(0, num.length - 3)
}
if (num) {
result = num + result
}
// return result
return d + (result + num2)
}
}
/*
* 导出
*/
module.exports = {
setPrice: setPrice,
money_three_for_two_thousands: threeNumForTwo.money_three_for_two_thousands //暴露接口调用
}
// packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js
import { IMG_URL } from '~/utils/constantData'
const IMAGES = Object.freeze({
download: `${IMG_URL}/output/download.webp`
})
Component({
/**
* 组件的属性列表
*/
properties: {
orderObj: {
type: Object,
value: () => { }
},
hasReport: {
type: Boolean,
value: true
},
proIdx: {
type: String,
value: '0'
}
},
options: {
styleIsolation: 'shared'
},
/**
* 组件的初始数据
*/
data: {
IMGURL: IMG_URL,
IMAGES,
isShowTip: true,
isShowPoster: false,
orderFormList: [
{
label: '总场次',
name: 'totalNum'
},
{
label: '总订单',
name: 'totalOrderCount'
},
{
label: '成交金额',
name: 'totalAmount',
prefix: '¥'
}
],
merchantFormList: [
{
label: '预计活动时间',
name: 'time'
},
{
label: '实际活动时间',
name: 'realTime'
},
{
label: '订单数',
name: 'orderCount',
className: 'font-number'
},
{
label: '产值',
name: 'realAmount',
className: 'red font-number',
prefix: '¥',
isNumber: true
},
{
label: '预估产值',
name: 'predictAmount',
className: 'font-number',
prefix: '¥',
isNumber: true
}
]
},
/**
* 组件的方法列表
*/
methods: {}
})
{
"component": true,
"usingComponents": {}
}
/* packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxss */
.crowdfund-layout {
padding-bottom: 136rpx;
.crowdfund-box {
background: #FFFFFF;
border-radius: 8rpx;
margin-bottom: 20rpx;
padding: 0;
}
.flex {
display: flex;
}
.order {
background: #FFFAFA;
display: flex;
justify-content: space-between;
align-items: center;
&-block {
width: 33.3%;
text-align: center;
font-weight: 500;
font-size: 28rpx;
color: #393B3E;
padding: 20rpx 0;
}
&-txt {
height: 40rpx;
line-height: 40rpx;
margin-bottom: 14rpx;
font-weight: 700;
// font-family: 'number';
}
&-label {
font-size: 20rpx;
color: #8A8C90;
}
}
.merchant {
padding: 0 32rpx 32rpx;
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
.head {
box-sizing: border-box;
position: relative;
display: flex;
align-items: center;
// height: 70rpx;
// line-height: 70rpx;
padding: 16rpx 0;
line-height: 40rpx;
font-size: 28rpx;
font-weight: 600;
border-bottom: 1rpx dashed #CCCED1;
margin-bottom: 16rpx;
.icon {
width: 40rpx;
height: 40rpx;
}
&-title {
font-size: 24rpx;
color: #323436;
margin-left: 8rpx;
}
&-link {
font-size: 24rpx;
color: #3666FE;
line-height: 37rpx;
}
.icon-download {
width: 36rpx;
height: 36rpx;
vertical-align: middle;
}
.down-tips {
position: absolute;
right: -40rpx;
top: -50rpx;
height: 52rpx;
line-height: 52rpx;
font-size: 20rpx;
color: #FFFFFF;
background: rgba(0, 0, 0, 0.60);
padding: 0 16rpx;
border-radius: 12rpx;
font-weight: 500;
&::after {
display: inline-block;
content: '';
position: absolute;
bottom: -28rpx;
right: 40rpx;
width: 0;
height: 0;
border: 18rpx solid;
border-color: #686868 transparent transparent;
}
}
}
.content {
&-title {
font-size: 28rpx;
color: #323436;
font-weight: 600;
padding-bottom: 28rpx;
}
// 表单
&-row {
display: flex;
height: 40rpx;
line-height: 40rpx;
font-size: 26rpx;
color: #8A8C90;
margin-bottom: 16rpx;
}
&-label {
width: 156rpx;
flex-shrink: 0;
margin-right: 16rpx;
}
&-txt {
color: #323436;
}
&-txt.red {
color: #F35251;
}
// 排名
&-rank {
background: #F7F8FC;
border-radius: 20rpx;
margin-top: 16rpx;
padding: 0 12rpx;
.rank-title {
position: relative;
height: 72rpx;
line-height: 72rpx;
text-align: center;
font-size: 26rpx;
color: #5A6066;
font-weight: 600;
border-bottom: 1rpx solid rgba(204, 206, 209, 0.50);
// .activity-status {
// position: absolute;
// top: 0;
// right: 22rpx;
// font-size: 24rpx;
// }
}
.rank-table {
color: #5A6066;
font-size: 20rpx;
.rank {
display: flex;
justify-content: space-between;
height: 64rpx;
padding: 20rpx 16rpx;
border-bottom: 1rpx dotted rgba(204, 206, 209, 0.50);
.rank-left {
display: flex;
}
&-num {
width: 40rpx;
line-height: 64rpx;
text-align: center;
}
.rank-head {
position: relative;
width: 64rpx;
height: 64rpx;
margin-right: 12rpx;
.icon-wechat {
position: absolute;
bottom: -4rpx;
right: -4rpx;
width: 40rpx;
height: 40rpx;
}
image {
width: 100%;
height: 100%;
border-radius: 50%;
}
}
.rank-content {
font-size: 20rpx;
.rank-row {
position: relative;
display: flex;
height: 32rpx;
line-height: 32rpx;
margin-bottom: 8rpx;
.down-tips {
position: absolute;
left: -116rpx;
top: -60rpx;
height: 52rpx;
line-height: 52rpx;
font-size: 20rpx;
color: #FFFFFF;
background: rgba(0, 0, 0, 0.60);
padding: 0 16rpx;
border-radius: 12rpx;
font-weight: 500;
&::after {
display: inline-block;
content: '';
position: absolute;
bottom: -27rpx;
right: 67rpx;
width: 0;
height: 0;
border: 18rpx solid;
border-color: #686868 transparent transparent;
}
}
.rank-row-name {
max-width: 200rpx;
font-size: 24rpx;
color: #3666FE;
margin-right: 12rpx;
}
.name-disabled {
max-width: 200rpx;
font-size: 24rpx;
color: #5A6066;
margin-right: 12rpx;
}
&-dept {
color: #8A8C90;
}
&-txt {
color: rgba(90, 96, 102, 1);
padding: 0 10rpx 0 0;
}
&-txt::after {
display: inline-block;
content: '';
background-color: #CCCED1;
width: 1.2rpx;
height: 54%;
margin-left: 10rpx;
}
&-txt:last-child::after {
background-color: transparent;
}
}
.rank-row:last-child {
margin-bottom: 0;
}
}
.rank-price {
text-align: right;
font-size: 26rpx;
color: #8A8C90;
height: 64rpx;
line-height: 64rpx;
}
.txt-red {
color: #F35251;
}
// .th,
// .td {
// width: calc((100% - 116rpx) / 4);
// .icon-rank {
// width: 24rpx;
// height: 24rpx;
// vertical-align: middle;
// padding-right: 4rpx;
// }
// }
}
.rank:last-child {
border: none;
}
.tr-no-data {
text-align: center;
height: 32rpx;
line-height: 32rpx;
padding-bottom: 16rpx;
}
.btn-more {
height: 56rpx;
line-height: 56rpx;
// color: #5A6066;
// border: 2rpx solid #EEEEEE;
// border-radius: 28rpx;
text-align: center;
margin: 0 20rpx;
.icon-more {
width: 92rpx;
height: 36rpx;
}
}
}
}
// 建议
&-suggest {
margin-top: 32rpx;
.suggest-title {
width: 116rpx;
height: 36rpx;
line-height: 36rpx;
font-weight: 600;
font-size: 20rpx;
color: #3E71FE;
background: rgba(62, 113, 254, 0.12);
border-radius: 4rpx;
}
.suggest-txt {
font-size: 24rpx;
color: #323436;
line-height: 40rpx;
margin: 12rpx 0 16rpx;
}
.suggest-block {
line-height: 40rpx;
background: #FFF9F2;
border-radius: 20rpx;
padding: 16rpx;
.suggest-step {
display: flex;
.step-label {
width: 54rpx;
font-size: 20rpx;
color: #323436;
margin-right: 18rpx;
}
.step-txt {
width: calc(100% - 72rpx);
font-size: 22rpx;
color: #8A8C90;
}
}
}
}
// 战报
.new-report {
display: flex;
margin-top: 20rpx;
height: 52rpx;
line-height: 52rpx;
font-size: 20rpx;
color: #5A6066;
.report-left {
box-sizing: border-box;
display: flex;
font-size: 20rpx;
color: #3666FE;
padding: 0 20rpx;
height: 100%;
background: rgba(54, 102, 254, 0.06);
border: 2rpx solid rgba(62, 113, 254, 0.70);
border-radius: 30rpx;
margin-right: 4rpx;
.icon-report {
width: 32rpx;
height: 32rpx;
vertical-align: middle;
margin-top: -2rpx;
}
}
}
}
}
}
.downloadIcon {
width: 40rpx;
height: 40rpx;
}
// .totalAmount{
// font-family: 'number';
// }
\ No newline at end of file \ No newline at end of file
<!-- packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml -->
<wxs src="../index.wxs" module="filter" />
<view class="crowdfund-layout">
<view wx:if="{{proIdx == '0'}}" class="profit-box flex-between">
<text>总收益</text>
<text class="price-txt">¥{{filter.money_three_for_two_thousands(orderObj.totalAmount || 0.00)}}</text>
</view>
<view wx:else class="crowdfund-box order">
<view class="order-block" wx:for="{{orderFormList}}" wx:key="index">
<view class="order-txt font-number">
<text wx:if="{{item.prefix}}">{{item.prefix}}</text>
<text wx:if="{{item.name == 'totalAmount'}}">{{filter.money_three_for_two_thousands(orderObj[item.name] || 0.00)}}</text>
<text wx:else>{{orderObj[item.name]}}</text>
</view>
<view class="order-label">{{item.label}}</view>
</view>
</view>
<view class="crowdfund-box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head">
<!-- text-hide -->
<glsx-image src="output/icon-head.png" class="icon" />
<view class="head-title">{{item.merchantName}}</view>
</view>
<view class="content">
<view class="content-title" data-item="{{item}}">
{{item.activityName}}
</view>
<view class="content-row" wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="content-label">{{subItem.label}}</view>
<view class="content-txt {{subItem.className}}">
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
{{subItem.isNumber ? filter.money_three_for_two_thousands(item[subItem.name]) : item[subItem.name]}}
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// pages/tab/output/components/accountSwitchingPop/accountSwitchingPop.js
import { IMG_URL } from '~/utils/constantData.js'
Component({
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {
popShow: {
type: Boolean,
value: false,
observer: function (n) {
if (n) {
let { serviceRange, selectInfo } = this.data
let activeIndex = serviceRange.findIndex(v => v.yqMerchantId == selectInfo.yqMerchantId)
if (serviceRange.length) serviceRange.unshift({yqMerchantId: '', yqMerchantName: '全部'})
serviceRange.forEach((item, ind) => {
item.show = true
if (activeIndex == (ind - 1)) {
item.act = true
} else {
item.act = false
}
this.setData({
serviceRange
})
})
this.setData({
searchKeyword: ''
})
}
}
},
serviceRange: Object,
selectInfo: Object
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
serviceList: [],
searchKeyword: ''
},
observers: {
serviceRange: function (e) {
this.setData({
serviceList: e || []
})
}
},
/**
* 组件的方法列表
*/
methods: {
hidePopup() {
this.triggerEvent('hidePopup')
},
confirm() {
let { serviceRange, subIndex } = this.data
let actObj = serviceRange.find((item, index) => {
if (item.act) {
subIndex = index
}
return item.act
})
if (!actObj) {
return wx.$api.showToast({
title: '请选择服务中心',
icon: 'error'
})
} else {
if (actObj.yqMerchantId == '' && actObj.yqMerchantName == '全部') actObj.yqMerchantName = '全部服务中心'
this.changePicker(actObj)
}
},
changePicker(actObj) {
// 修改对应下标显示
wx.$api.showLoading('加载中...')
this.triggerEvent('getStaffList', {...actObj})
this.hidePopup()
},
select(e) {
let { index } = e.currentTarget.dataset
let { serviceRange } = this.data
serviceRange.forEach((item, ind) => {
if (index == ind) {
item.act = true
} else {
item.act = false
}
this.setData({
serviceRange
})
})
},
search(e) {
let { serviceRange } = this.data
let { value } = e.currentTarget.dataset && Object.keys(e.currentTarget.dataset).length ? e.currentTarget.dataset : e.detail
serviceRange.forEach(item => {
item.act = false
item.show = item.yqMerchantName?.includes(value)
})
this.setData({
serviceRange
})
},
input(e) {
let { value } = e.detail
this.setData({
searchKeyword: value
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packagesList/mineDetail/components/selectService/selectService.wxss */
.search-box {
width: 100%;
height: 104rpx;
padding-left: 32rpx;
display: flex;
align-items: center;
background-color: #fff;
position: sticky;
top: 0;
left: 0;
z-index: 9;
box-sizing: border-box;
.search {
width: 144rpx;
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 24rpx;
.text-center {
font-size: 24rpx;
border-radius: 12rpx;
width: 100%;
font-size: 32rpx;
color: #858A94;
.search-filter {
margin-left: 6rpx;
width: 24rpx;
height: 24rpx;
}
}
}
.search-input {
background: #F7F8FA;
border-radius: 38rpx;
width: 606rpx;
height: 72rpx;
display: flex;
align-items: center;
padding-left: 26rpx;
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
.search-icon {
width: 28rpx;
height: 28rpx;
}
.search-clear {
width: 36rpx;
height: 36rpx;
margin: 0 26rpx 0 10rpx;
}
.input {
font-size: 28rpx;
width: calc(100% - 136rpx);
margin-left: 10rpx;
}
}
}
.list {
height: calc(100% - 100rpx) !important;
}
.itemCon {
box-sizing: border-box;
width: 100%;
height: 80rpx;
color: #323436;
line-height: 80rpx;
padding: 0 32rpx;
}
.active {
background: #F0F7FF;
font-size: 28rpx;
color: #3666FE;
}
\ No newline at end of file \ No newline at end of file
<!--packagesList/mineDetail/components/selectService/selectService.wxml-->
<popup
show="{{popShow}}"
bind:hidePopup="hidePopup"
bindconfirm="confirm"
height="60%">
<view class="search-box">
<view class="search-input">
<glsx-image src="output/searchIcon.png" class="search-icon" />
<input
type="text"
placeholder="请搜索服务中心"
class="input"
value="{{keyword}}"
placeholder-class="input-placeholder"
bindinput="input"
bindconfirm="search" />
<block wx:if="{{keyword}}">
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view>
<view class="search text-center" bindtap="search" data-value="{{searchKeyword}}">
<view class="text-center">搜索</view>
</view>
</view>
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
refresher-threshold="104"
scroll-top="{{scrollTop}}"
class="list"
style="height:100%;"
data-type="message"
refresher-triggered="{{triggered}}">
<block wx:for="{{serviceList}}" wx:key="index">
<view
class="itemCon text-hide {{item.act?'active':''}}"
data-index="{{index}}"
hidden="{{!item.show}}"
bindtap="select">
{{item.yqMerchantName}}
</view>
</block>
</scroll-view>
</popup>
// pages/tab/output/components/sortTab/sortTab.js
Component({
/**
* 组件的属性列表
*/
properties: {
title: {
type: String,
value: '合作门店'
},
sceneCode: {
type: String,
value: '-1'
}
},
/**
* 组件的初始数据
*/
data: {
actIdx: '-1',
imgObj: {
'': 'default',
1: 'up',
2: 'down',
},
// 全部-1;精品升级SC002;会员权益/升级SC001
// asc:''-无, 1-升序,2-降序
formObj: {
'-1': [{
label: '精品升级',
asc: '',
value: 1
}, {
label: '售后众筹',
asc: '',
value: 2
}, {
label: '会员权益/升级',
asc: '',
value: 3
}],
'SC002': [{
label: '营业额',
asc: '',
value: 4
}, {
label: '升级客单价',
asc: '',
value: 5
}, {
label: '到店贴膜量',
asc: '',
value: 6
}, {
label: '升级订单',
asc: '',
value: 7
}, {
label: '战败订单',
asc: '',
value: 8
}, {
label: '升级转化率',
asc: '',
value: 9
}],
'SC001': [{
label: '营业额',
asc: '',
value: 4
}, {
label: '推荐客户量',
asc: '',
value: 5
}, {
label: '成交客户量',
asc: '',
value: 6
}, {
label: '融合客单价',
asc: '',
value: 7
}, {
label: '权益客单价',
asc: '',
value: 8
}, {
label: '转化率',
asc: '',
value: 9
}]
}
},
lifetimes: {
attached() {
console.log(this.data.formObj[this.data.sceneCode])
}
},
/**
* 组件的方法列表
*/
methods: {
// 处理升降序排序参数
dealParams() {
let { actIdx, formObj, sceneCode } = this.data
let _params = {}
if (actIdx != -1) {
let _item = formObj[sceneCode][actIdx]
_params = {
orderBy: _item.value,
asc: _item.asc
}
}
return _params
},
resetAllAsc() {
let { actIdx, sceneCode, formObj } = this.data
if (actIdx == '-1') {
return true
}
let _list = Object.keys(formObj)
_list.forEach(item => {
formObj[item].forEach(k => {
k.asc = ''
})
})
this.setData({
formObj,
actIdx: '-1'
})
},
resetAsc() {
let { actIdx, sceneCode } = this.data
if (actIdx == '-1') {
return true
}
// let _list = Object.keys(formObj)
// _list.forEach(item => {
// formObj[item].forEach(k => {
// k.asc = ''
// })
// })
this.setData({
[`formObj.${sceneCode}[${actIdx}].asc`]: ''
})
},
handleSort(e) {
let { idx } = e.currentTarget.dataset
let { formObj, sceneCode, actIdx } = this.data
if (idx != actIdx) {
this.resetAsc()
}
let _actIdx = idx
let _asc = ''
switch (formObj[sceneCode][idx]?.asc) {
case '1':
_asc = ''
_actIdx = '-1'
break
case '2':
_asc = '1'
break
case '':
_asc = '2'
break
}
this.setData({
[`formObj.${sceneCode}[${idx}].asc`]: _asc,
actIdx: _actIdx
})
this.triggerEvent('handleSort')
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/output/components/sortTab/sortTab.wxss */
.sort-tab {
display: flex;
box-sizing: border-box;
width: calc(100vw - 32rpx);
height: 86rpx;
line-height: 86rpx;
background-color: #FFFFFF;
padding: 0 20rpx;
margin-bottom: 4rpx;
.title {
width: 196rpx;
flex-shrink: 0;
}
.flex {
display: flex;
}
.sort-scroll {
display: flex;
width: calc(100% - 196rpx);
.item {
display: flex;
flex-shrink: 0;
justify-content: center;
align-items: center;
margin-right: 20rpx;
}
.icon {
width: 32rpx;
height: 32rpx;
}
}
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/output/components/sortTab/sortTab.wxml-->
<view class="sort-tab">
<ciew class="title">{{title}}</ciew>
<scroll-view class="sort-scroll" scroll-x="true">
<view class="flex">
<view wx:for="{{formObj[sceneCode]}}" wx:key="index" class="item" bindtap="handleSort" data-idx="{{index}}">
<view>{{item.label}}</view>
<glsx-image src="output/sort-{{imgObj[item.asc]}}.png" class="icon" />
</view>
</view>
</scroll-view>
</view>
\ No newline at end of file \ No newline at end of file
// pages/tab/output/components/staff/staff.js // pages/tab/output/components/staff/staff.js
import { IMG_URL } from '~/utils/constantData' import { IMG_URL } from '~/utils/constantData'
import outputApi from '~/api/outputApi/index'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -10,11 +11,64 @@ Component({ ...@@ -10,11 +11,64 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
expectImg: `${IMG_URL}/output/expect.png` IMG_URL,
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
formData: {
// 0:全部-1;2:精品升级SC002;1:会员权益/升级SC001
busiIdx: 0,
sceneCode: '-1',
yqMerchantName: '服务中心',
timeIdx: 0
},
},
lifetimes: {
attached() {
this.getStaff()
}
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: {} methods: {
// tab-业务经营切换
handleSearch(e) {
this.getStaff(true, true)
},
getStaff(isReset = false) {
let staffSortModule = this.selectComponent('#staffSort')
let staffSearchData = staffSortModule ? staffSortModule.dealParams() : {}
this.setData({
formData: JSON.parse(JSON.stringify(staffSortModule.data.formData))
})
let { userInfo } = wx.$storage.get()
let params = {
...staffSearchData,
partnerMerchantId: userInfo.subLoginUser.merchantId
// partnerMerchantId: 44209468
}
outputApi.getStaffList(params).then(res => {
if (isReset) {
this.setData({
busiScrollTop: 0
})
}
this.setData({
triggered: false
})
let _list = []
// 1-会员权益/升级;2-精品升级
let attrToNum = {
'': 'totalStat',
'1': 'vdStat',
'2': 'boutiqueStat'
}
_list = res[attrToNum[staffSearchData.sceneType || '']] || []
this.setData({
staffList: _list
})
})
},
}
}) })
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {
"staff-sort": "../StaffSort/StaffSort",
"busi-card": "../BusiCard/BusiCard"
}
} }
\ No newline at end of file \ No newline at end of file
/* pages/tab/output/components/staff/staff.wxss */ /* pages/tab/output/components/staff/staff.wxss */
.staffCon { .staffCon {
box-sizing: border-box; box-sizing: border-box;
display: flex;
flex-direction: column;
// justify-content: center;
align-items: center;
padding-top: 88rpx;
background-color: #fff; background-color: #fff;
height: 100%; height: 100%;
}
.staff {
box-sizing: border-box;
height: calc(100% - 92rpx);
color: #323436;
// padding-top: 16rpx;
// background-color: #F2F3F7;
background-color: #FFFFFF;
.img { .title {
width: 512rpx; height: 80rpx;
height: 512rpx; line-height: 80rpx;
font-size: 28rpx;
color: #323436;
} }
.label { .title::before {
margin-top: -50rpx; display: inline-block;
content: '';
width: 6rpx;
height: 28rpx;
background: #3666FE;
border-radius: 0 4rpx 4rpx 0;
margin-right: 16rpx;
} }
} }
.staff-content {
margin: 0 16rpx;
}
.end-txt {
font-size: 24rpx;
text-align: center;
color: #CCCED1;
padding-bottom: 60rpx;
}
\ No newline at end of file \ No newline at end of file
<!-- pages/tab/output/components/staff/staff.wxml --> <!-- pages/tab/output/components/staff/staff.wxml -->
<view class="staffCon"> <view class="staffCon">
<image class="img" src="{{expectImg}}" /> <staff-sort id="staffSort" bindstaffSearch="handleSearch"></staff-sort>
<view class="label">程序员在通宵建设中…</view> <scroll-view class="staff" id="scroller" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="handleSearch" lower-threshold='50' scroll-top="{{busiScrollTop}}">
<view wx:for="{{staffList}}" wx:key="index" class="staff-content">
<view class="title">{{item.yqMerchantName || ''}}</view>
<view wx:for="{{item.list}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<busi-card info="{{subItem}}" fromPage="staff" sceneCode="{{formData.sceneCode}}" formData="{{formData}}"></busi-card>
</view>
</view>
<view wx:if="{{!staffList.length}}" class="end-txt">
<nothing-tips tips="暂无数据~" bgColor="{{'#FFFFFF'}}" bg="{{bgUrl}}" />
</view>
<view wx:else class="end-txt">
<view wx:if="{{formData.sceneCode == 'SC002'}}">数据统计精品升级全品类产品</view>
<view wx:else>到底啦~</view>
</view>
</scroll-view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -59,7 +59,7 @@ Page({ ...@@ -59,7 +59,7 @@ Page({
}, },
setUserInfo() { setUserInfo() {
let { userInfo } = wx.$storage.get() let { userInfo } = wx.$storage.get()
console.log(userInfo) // console.log(userInfo)
this.setData({ this.setData({
userInfo, userInfo,
isSuper: userInfo.isSuper isSuper: userInfo.isSuper
...@@ -79,11 +79,10 @@ Page({ ...@@ -79,11 +79,10 @@ Page({
if (e) { if (e) {
this.setUserInfo() this.setUserInfo()
let clientModule = this.selectComponent('#client') let clientModule = this.selectComponent('#client')
let merchantModule = this.selectComponent('#merchant') // let merchantModule = this.selectComponent('#merchant')
// console.log('clientModule', clientModule)
// console.log()
clientModule.getClientApi && clientModule.clientRefresh() clientModule.getClientApi && clientModule.clientRefresh()
merchantModule.init && merchantModule.init() clientModule.getBusinessData && clientModule.getBusinessData()
// merchantModule.init && merchantModule.init()
} }
let { isSuper, userInfo } = this.data let { isSuper, userInfo } = this.data
console.log(isSuper) console.log(isSuper)
...@@ -91,9 +90,9 @@ Page({ ...@@ -91,9 +90,9 @@ Page({
if (isSuper) { if (isSuper) {
USERAPI.adminSelectLogin() USERAPI.adminSelectLogin()
.then(result => { .then(result => {
console.log(result) // console.log(result)
let { merchantList: merchantRange } = result let { merchantList: merchantRange } = result
console.log(merchantRange) // console.log(merchantRange)
let subIndex = -1 let subIndex = -1
merchantRange.forEach((item, index) => { merchantRange.forEach((item, index) => {
item.show = true item.show = true
...@@ -125,6 +124,7 @@ Page({ ...@@ -125,6 +124,7 @@ Page({
if (page == 'client' && refresh) { if (page == 'client' && refresh) {
let clientModule = this.selectComponent('#client') let clientModule = this.selectComponent('#client')
clientModule.getClientApi && clientModule.clientRefresh() clientModule.getClientApi && clientModule.clientRefresh()
clientModule.getBusinessData && clientModule.getBusinessData()
} }
}, },
/** /**
......
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
flex-direction: column; flex-direction: column;
height: 100vh; height: 100vh;
overflow: hidden; overflow: hidden;
#client {
height: 100%;
}
&::after { &::after {
content: ''; content: '';
...@@ -70,11 +73,16 @@ ...@@ -70,11 +73,16 @@
} }
.navigation-title .arrow { .navigation-title .arrow {
width: 20rpx; width: 26rpx;
height: 16rpx; height: 26rpx;
margin-left: 4rpx; margin-left: 4rpx;
transform: translateY(25%); transform: translateY(25%);
transition: all 0.5s; transition: all 0.5s;
image {
width: 26rpx;
height: 26rpx;
}
} }
.navigation-title .move { .navigation-title .move {
......
...@@ -19,20 +19,11 @@ ...@@ -19,20 +19,11 @@
<!-- </picker> height:calc(100vh - {{tabBarStyle}}px) --> <!-- </picker> height:calc(100vh - {{tabBarStyle}}px) -->
</navigation-bar> </navigation-bar>
<view class="layout" style="padding-top:{{tabBarStyle}}px;"> <view class="layout" style="padding-top:{{tabBarStyle}}px;">
<tab tab="{{tabList}}" itemWidth="{{'27%'}}" index="{{tabIndx}}" bindclick="changeTabIndx" class="tabContainer" />
<!-- <view class="">{{IMG_URL}}</view> -->
<!-- 我的客户 -->
<view class="comCom" hidden="{{tabIndx != 0}}">
<client id="client" /> <client id="client" />
</view>
<!-- 我的门店 --> <!-- 我的门店 -->
<!-- <view class="comCom" hidden="{{tabIndx != 1}}"> <!-- <view class="comCom" hidden="{{tabIndx != 1}}">
<merchant id="merchant" /> <merchant id="merchant" />
</view> --> </view> -->
<!-- 我的员工 -->
<view class="comCom" hidden="{{tabIndx != 1}}">
<staff id="staff" />
</view>
</view> </view>
<accountSwitchingPop wx:if="{{popupShow}}" bind:hidePopup="tapPicker" bind:changeAccount="getMerchantRange" popShow="{{popupShow}}" merchantRange="{{merchantRange}}" /> <accountSwitchingPop wx:if="{{popupShow}}" bind:hidePopup="tapPicker" bind:changeAccount="getMerchantRange" popShow="{{popupShow}}" merchantRange="{{merchantRange}}" />
......
...@@ -94,6 +94,27 @@ ...@@ -94,6 +94,27 @@
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
},
{
"name": "",
"pathName": "packagesList/outDetail/index",
"query": "merchantIds=4&type=1",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "packageOutput/pages/monthReport/monthReport",
"query": "merchantIds=4",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "packageOutput/pages/crowdDetail/crowdDetail",
"query": "",
"launchMode": "default",
"scene": null
} }
] ]
} }
......
export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/' export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/'
export const IMG_URL_STORE = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant-assemble/' export const IMG_URL_STORE = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/'
// 缓存get方法为空的默认指定值 // 缓存get方法为空的默认指定值
export const DEFAULT_GET_STORAGEKEY = ['sessionId', 'merchantId', 'userInfo'] export const DEFAULT_GET_STORAGEKEY = ['sessionId', 'merchantId', 'userInfo']
...@@ -26,3 +25,15 @@ export const IMG_VERSION = () => { ...@@ -26,3 +25,15 @@ 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'
} }
export const sceneCodeList= ['SC002', 'SC003', 'SC004', 'SC001']
export const sceneInfo= {
sceneList: [{
sceneCode: "SC002", flag: false
}, {
sceneCode: "SC003", flag: false
}, {
sceneCode: "SC004", flag: false
}, {
sceneCode: "SC001", flag: false
}]
}
\ No newline at end of file \ No newline at end of file
import { preReleaseAppId } from '~/config' import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease'] const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
const mockObj = { const mockObj = {
test: 'https://oss-config.test.glsx.com.cn/mock/63fd6c2034c4d918e2f4df4d/config', test: 'https://oss-config.dev.glsx.com.cn/mock/63fd6c2034c4d918e2f4df4d/config',
product: 'https://oss-config.test.glsx.com.cn/mock/63ff0b507dc47c4edc786e82/config' product: 'https://oss-config.test.glsx.com.cn/mock/63ff0b507dc47c4edc786e82/config'
} }
...@@ -21,7 +21,7 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -21,7 +21,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false const manual = false
const release = false const release = false
let index = 2 let index = 1
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
...@@ -81,16 +81,51 @@ const secretKey = { ...@@ -81,16 +81,51 @@ const secretKey = {
} }
}[target[index]] }[target[index]]
const djSecretKey = {
ip: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
dev: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
uat: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
prod: {
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
},
preRelease: {
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
}
}[target[index]]
const domain = { const domain = {
// ip: 'http://192.168.2.94:8558', ip: {
// ip: 'http://192.168.2.3:8315', // dj: 'http://192.168.1.165:8292',
ip: 'http://192.168.1.170:8315', dj: 'http://192.168.1.170:8292',
/**登录: 192.168.2.3:8315 scrm: 'http://192.168.1.165:8292'
商城: 192.168.2.3:8558 */ },
dev: 'https://scrm.dev.glsx.com.cn', dev: {
uat: 'https://scrm.test.glsx.com.cn', dj: 'https://dj.dev.glsx.com.cn',
preRelease: 'https://scrm.beta.glsx.com.cn', scrm: 'https://scrm.dev.glsx.com.cn'
prod: 'https://scrm.glsx.com.cn' },
uat: {
dj: 'https://dj.test.glsx.com.cn',
scrm: 'https://scrm.test.glsx.com.cn'
},
prod: {
dj: 'https://dj.glsx.com.cn',
scrm: 'https://scrm.glsx.com.cn'
},
preRelease: {
dj: 'https://dj.beta.glsx.com.cn',
scrm: 'https://scrm.beta.glsx.com.cn'
}
}[target[index]] }[target[index]]
const pathEnum = { const pathEnum = {
...@@ -107,6 +142,9 @@ const pathEnum = { ...@@ -107,6 +142,9 @@ const pathEnum = {
sop: '/rop-scrm-sop/', sop: '/rop-scrm-sop/',
customercollect: '/rop-scrm-bigdatautil/', customercollect: '/rop-scrm-bigdatautil/',
drac: '/rop-scrm-entmicro/', drac: '/rop-scrm-entmicro/',
system: '/rop-scrm-entmicro/',
stoassistant: '/rop-scrm-stoassistant/',
assistant: '/rop-scrm-stoassistant/',
busassistant: '/rop-scrm-busassistant/' busassistant: '/rop-scrm-busassistant/'
} }
const defaultMerchantId = { const defaultMerchantId = {
...@@ -129,6 +167,7 @@ module.exports = { ...@@ -129,6 +167,7 @@ module.exports = {
domain, domain,
pathEnum, pathEnum,
secretKey, secretKey,
djSecretKey,
defaultMerchantId, defaultMerchantId,
mockUrl mockUrl
} }
import { secretKey, pathEnum, domain, sign } from './http.js' import { secretKey, djSecretKey, pathEnum, domain, sign } from './http.js'
import { getSessionId } from '~/utils/cache/storageApi' import { getSessionId } from '~/utils/cache/storageApi'
import network from '~/utils/network' import network from '~/utils/network'
/**接口 */ /**接口 */
class Request { class Request {
get(params, returnAll = false) { get(params, returnAll = false, requestPath) {
return this.request('GET', params, returnAll) return this.request('GET', params, returnAll, requestPath)
} }
post(params, returnAll = false) { post(params, returnAll = false, requestPath) {
return this.request('POST', params, returnAll) return this.request('POST', params, returnAll, requestPath)
} }
async request(RequestMethods, params, returnAll) { async request(RequestMethods, params, returnAll, requestPath = 'scrm') {
const type = await network.getNetworkType() const type = await network.getNetworkType()
if (type == 'none') return if (type == 'none') return
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -23,10 +23,14 @@ class Request { ...@@ -23,10 +23,14 @@ class Request {
let projectName = params.apiProjectName || this.getRopProject(params.method) let projectName = params.apiProjectName || this.getRopProject(params.method)
if (!projectName) projectName = this.getRopProject(params.method) if (!projectName) projectName = this.getRopProject(params.method)
let path = pathEnum[projectName] let path = pathEnum[projectName]
if (!path) path = `/rop-scrm-${projectName}/` console.log(path,11)
params = this.getData(params) if (!path) {
path = requestPath == 'dj' ? `/rop-dj-${projectName}/` : `/rop-scrm-${projectName}/`
}
params = this.getData(params, requestPath)
console.log(domain,requestPath,9)
wx.request({ wx.request({
url: `${domain}${path}router?method=${params.method}`, url: `${domain[requestPath]}${path}router?method=${params.method}`,
data: params, data: params,
method: RequestMethods, method: RequestMethods,
header, header,
...@@ -82,16 +86,20 @@ class Request { ...@@ -82,16 +86,20 @@ class Request {
}) })
}) })
} }
getData(params) { getData(params, requestPath) {
let projectName = params.projectName let projectName = params.projectName
if (!projectName) projectName = this.getRopProject(params.method) if (!projectName) projectName = this.getRopProject(params.method)
else delete params.projectName else delete params.projectName
let appKey = '48e5e13229b82c1b4e6e8c96151f0637' let appKey = '48e5e13229b82c1b4e6e8c96151f0637'
let secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b' let secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
if (secretKey[projectName]) { if (requestPath == 'scrm' && secretKey[projectName]) {
appKey = secretKey[projectName].appKey appKey = secretKey[projectName].appKey
secret = secretKey[projectName].secret secret = secretKey[projectName].secret
} }
if (requestPath == 'dj') {
appKey = djSecretKey.appKey
secret = djSecretKey.secret
}
const sessionId = getSessionId() const sessionId = getSessionId()
let noSignAttr = [] let noSignAttr = []
if (!params.sessionId && sessionId) params.sessionId = sessionId if (!params.sessionId && sessionId) params.sessionId = sessionId
......
...@@ -136,7 +136,7 @@ class TRACK { ...@@ -136,7 +136,7 @@ class TRACK {
let { window } = __wxConfig.page[`${route}.html`] let { window } = __wxConfig.page[`${route}.html`]
title = window.navigationStyle == 'custom' ? navigationBarTitleText : window.navigationBarTitleText title = window.navigationStyle == 'custom' ? navigationBarTitleText : window.navigationBarTitleText
} }
if (!title) title = '门店助手' if (!title) title = '生意助手'
return title return title
} }
/**获取设备信息 */ /**获取设备信息 */
......
...@@ -108,6 +108,22 @@ const throttle = (fn, gapTime) => { ...@@ -108,6 +108,22 @@ const throttle = (fn, gapTime) => {
}; };
}; };
/* 防抖函数封装 */
function debounce(fn, interval) {
let timer;
let delay = interval || 1000; // 间隔的时间,如果interval不传,则默认1秒
return function () {
let that = this;
let args = arguments; // 保存此处的arguments,因为setTimeout是全局的,arguments不是防抖函数需要的。
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(function () {
fn.apply(that, args); // 用apply指向调用debounce的对象,相当于this.fn(args);
}, delay);
};
}
/**删除对象里的null值 */ /**删除对象里的null值 */
const clearObjNull = (options) => { const clearObjNull = (options) => {
let obj = {}; let obj = {};
...@@ -288,6 +304,48 @@ const moneyThreeForTwoThousands = num => { ...@@ -288,6 +304,48 @@ const moneyThreeForTwoThousands = num => {
return d + (result + num2) return d + (result + num2)
} }
/**
* 动态校验字段
* @param {*} obj 需校验的对象
* @param {*} formRule 校验规则
* formRule = {
* id: [
* { required: true, message: 'xx不能为空' },
* {
* validator: (rule, value) => {
* return value != 'cwq' ? { message: '错误信息' } : null
* }
* }
* ],
* }
*/
const checkRule = function (obj, formRule) {
let target = Object.keys(formRule)
for (let i = 0; i < target.length; i++) {
let attr = target[i]
let item = formRule[attr]
let requirObj = item.find(k => k.required == true)
let validFn = item.find(k => k.validator)
if (requirObj && !obj[attr]) {
return {
...requirObj,
attr
}
}
if (validFn) {
let validObj = validFn.validator({}, obj[attr], obj)
if (validObj) {
return {
...validObj,
attr
}
}
}
}
return false
}
const Util = { const Util = {
getImgVersion, getImgVersion,
...@@ -295,11 +353,13 @@ const Util = { ...@@ -295,11 +353,13 @@ const Util = {
isFullSucreen, isFullSucreen,
clearObjNull, clearObjNull,
throttle, throttle,
debounce,
isEmptyObj, isEmptyObj,
parseString, parseString,
getCurrentPageUrl, getCurrentPageUrl,
deepClone, deepClone,
setNavigationBarTitle, setNavigationBarTitle,
moneyThreeForTwoThousands moneyThreeForTwoThousands,
checkRule
}; };
export default Util; export default Util;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!