Commit 0ffe837c by 前端

Merge branch 'SAAS+V5.5.0' into 'master'

上线合并

See merge request !54
2 parents 9491f35e cb8338fe
Showing 186 changed files with 3872 additions and 263 deletions
{
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version" : "0.0",
"configurations" : [
{
"app-plus" : {
"launchtype" : "local"
},
"default" : {
"launchtype" : "local"
},
"h5" : {
"launchtype" : "local"
},
"mp-weixin" : {
"launchtype" : "local"
},
"provider" : "aliyun",
"type" : "uniCloud"
},
{
"playground" : "standard",
"type" : "uni-app:app-android"
}
]
}
...@@ -458,4 +458,109 @@ module.exports = { ...@@ -458,4 +458,109 @@ module.exports = {
...data ...data
}) })
}, },
// 新 学习中心 - 开始测评
startExam(data) {
return http.post({
method: 'dj.api.pad.learning.center.level.exam',
projectName: 'pad',
...data
})
},
// 新 学习中心 - 员工学习时长统计
getStudyCenterTimeStatistics(data) {
return http.post({
method: 'dj.pad.api.course.staff.statistics',
projectName: 'pad',
...data
})
},
// 新 学习中心 - 我的课程 ,带状态的分页接口
getMyCourseList(data) {
return http.post({
method: 'dj.api.pad.learning.center.myself.course',
projectName: 'pad',
...data
})
},
// 新 学习中心 - 查询考试分页接口
getExamPage(data) {
return http.post({
method: 'dj.pad.api.recommended.staff.examination.page',
projectName: 'pad',
...data
})
},
// 新 学习中心 - 考试统计
getExamStatistics(data) {
return http.post({
method: 'dj.pad.api.recommended.staff.examination.count',
projectName: 'pad',
...data
})
},
// 新 学习中心 - 排行榜
getStudyDurationRank(data) {
return http.post({
method: 'dj.pad.api.recommended.staff.study.duration.rank',
projectName: 'pad',
...data
})
},
// 新学习中心 - 全部课程
getALlCourse(data) {
return http.post({
method: 'dj.pad.api.recommended.course.page',
projectName: 'pad',
...data
})
},
// 新学习中心 - 课程分类树
getCourseCategoryTree(data = {}) {
return http.post({
method: 'dj.pad.api.course.category.list.tree',
projectName: 'pad',
...data
})
},
// 新学习中心 - 员工学习中心剩余时间
getStudyCenterResidueTime(data={}) {
return http.post({
method: 'dj.api.pad.learning.center.residue.time',
projectName: 'pad',
...data
})
},
// 新学习中心 - 查询我的课程页签数量
getMyCourseTabCount(data={}) {
return http.post({
method: 'dj.api.pad.learning.center.myself.course.count',
projectName: 'pad',
...data
})
},
// 新学习中心 - 考试结果
getExamResult(data={}) {
return http.post({
method: 'dj.api.pad.learning.center.beisen.exam.result',
projectName: 'pad',
...data
})
},
// 限制录单
getLimitRecord(data={}) {
return http.post({
method: 'dj.api.pad.learning.center.study.permission',
projectName: 'pad',
...data
})
},
// VIN车架号校验
checkVinValidate(data={}) {
console.log("调用接口checkVinValidate",data);
return http.post({
method: 'dj.pad.api.vin.validate',
projectName: 'pad',
...data,
})
},
} }
import http from '../request/http'
module.exports = {
/**新建车损报价单 */
quotationAdd(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.add',
projectName: 'boutique',
...data
})
},
/** 报价单支付订单生成(带上签名)返回订单号(商户地址) */
quotationUpgrade(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.pay.order.generate',
projectName: 'boutique',
...data
})
},
// 校验订单是否需要上传合同协议
checkZyPayFlag(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.zyPayUrl.check',
projectName: 'boutique',
...data
})
},
// 查询店铺配置
getShopMerchantPointConfig(data) {
return http.post({
method: 'dj.api.smartcarlife.shopMerchantPointConfig.get',
projectName: 'boutique',
...data
})
},
/** 查询报价单信息 */
getQuotationInfoById(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.find.by.id',
projectName: 'boutique',
...data
})
},
/**
* 订单详情
*/
getOrderDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.order.detail',
projectName: 'boutique',
...data
})
},
/**pos支付 */
getPosQr(data) {
return http.post({
method: 'dj.api.smartcarlife.payOrder.create',
projectName: 'boutique',
...data
})
},
/**
* 查询门店录单设置
},
*/
orderSettingList(data) {
return http.post({
method: 'dj.api.smartcarlife.order.field.setting.list',
projectName: 'boutique',
...data
})
},
/** 报价单分页列表 */
quotationPage(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.page',
projectName: 'boutique',
...data
})
},
/** 根据id查询报价单数据 */
getQuotationInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.generate',
projectName: 'boutique',
...data
})
},
/** 修改车损报价单客户基本信息信息 */
updateCustomerInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.customer.base.info.update',
projectName: 'boutique',
...data
})
},
/** 报价单订单分状态统计信息 */
orderStatistics(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.order.status.statistics',
projectName: 'boutique',
...data
})
},
// 查询订单是否支持状态变更
getOrderRefundStep(data) {
return http.post({
method: 'dj.api.smartcarlife.refundApplyRecord.isExist',
projectName: 'boutique',
...data
})
},
/**报价单-撤销工单 */
cancelOrderById(data) {
return http.post({
method: 'dj.api.smartcarlife.quotation.cancel',
projectName: 'boutique',
...data
})
},
// 车损报价单战败订单创建
defeatOrderCreate(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.add.defeat.order',
projectName: 'boutique',
...data
})
},
// 更新合同协议内容
updateZyInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.zyPayUrl.update',
projectName: 'boutique',
...data
})
},
/** 根据商户号商品id获取可选升级商品列表 */
quotationGoodsList(data) {
return http.post({
method: 'dj.api.smartcarlife.quotationGoods.list',
projectName: 'boutique',
...data
})
},
/**
* /** 修改车损报价单信息 */
updateQuotation(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.update',
projectName: 'boutique',
...data
})
},
getCheckEmployeeList(data) {
// 0->2.0 1->1.1 2->1.2 3->1.3 场景对应
// data.sceneList = [1]
return http.post({
method: 'dj.api.smartcarlife.employee.onTheJob.getByMerchantId',
projectName: 'boutique',
...data
})
// return api.post("dj.api.smartcarlife.employee.getByMerchantId", data);
},
/** 更新报价单状态 */
updateOrderStatus(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.status.update',
projectName: 'boutique',
...data
})
},
/**
* 服务信息详情
*
*/
getServiceInfoDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.detail',
projectName: 'boutique',
...data
})
},
/** 权益单分页列表 */
equityPage(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.page',
projectName: 'boutique',
...data
})
},
/** 权益单统计信息 */
equityStatistics(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.statics',
projectName: 'boutique',
...data
})
},
// 更新客户签名
updateCustomerNameUrlAPI(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.updateCustomerNameUrl',
projectName: 'boutique',
...data
})
},
/** 查询合同*/
equityOrderList(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.listContracts',
projectName: 'boutique',
...data
})
},
/** 打印合同*/
printContract(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.print',
projectName: 'boutique',
...data
})
},
/**
* 提交前检查车架号是否已购买
*/
checkVinBuyEquityOrder(data) {
return http.post(
{
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.vin.check',
projectName: 'boutique',
...data
},
true
)
},
/**提交权益单
*
*/
addEquityOrder(data) {
return http.post(
{
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.add',
projectName: 'boutique',
...data
},
true
)
},
/**
* 订单号查服务信息详情
*/
getEquityOrderByOrderId(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.handler',
projectName: 'boutique',
...data
})
},
// 查询订单是否支持状态变更
getOrderRefundStep(data) {
return http.post({
method: 'dj.api.smartcarlife.refundApplyRecord.isExist',
projectName: 'boutique',
...data
})
},
/** 标记错误订单 */
errorOrderById(data) {
return http.post({
method: 'dj.api.smartcarlife.quotation.correct',
projectName: 'boutique',
...data
})
}
}
...@@ -11,6 +11,7 @@ import sceneMarketApi from './sceneMarketApi' ...@@ -11,6 +11,7 @@ import sceneMarketApi from './sceneMarketApi'
import interceptionApi from './interceptionApi' import interceptionApi from './interceptionApi'
import popupApi from './popupApi' import popupApi from './popupApi'
import usedCarApi from './usedCar' import usedCarApi from './usedCar'
import equityApi from './equity'
module.exports = { module.exports = {
commonApi, commonApi,
...@@ -25,5 +26,6 @@ module.exports = { ...@@ -25,5 +26,6 @@ module.exports = {
popupApi, popupApi,
evaluationApi, evaluationApi,
usedCarApi, usedCarApi,
activityApi activityApi,
equityApi
} }
...@@ -84,7 +84,7 @@ module.exports = { ...@@ -84,7 +84,7 @@ module.exports = {
}, },
/** /**
* 战败下单商品列表 * 战败下单商品列表
* *
*/ */
getOrderUpgradeGoodsList (data) { getOrderUpgradeGoodsList (data) {
return http.post({ return http.post({
...@@ -102,5 +102,60 @@ module.exports = { ...@@ -102,5 +102,60 @@ module.exports = {
projectName: 'boutique', projectName: 'boutique',
...data ...data
}) })
}
}
\ No newline at end of file \ No newline at end of file
},
/**
* 获取提单客户档案列表
*
*/
getQuotationCustomerList (data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.customer.page',
projectName: 'boutique',
...data
})
},
/**搜索订单(含套餐) */
getWorkPackageGoodsList (data) {
let params = data || {}
params.sceneType = 1
return http.post(
{
method: 'dj.api.smartcarlife.order.search.containPackageGoods',
projectName: 'boutique',
...data,
pageSize: 10,
pageSize: 999999,
statusList: [1]
},
false,
'dj',
1000000
)
},
/**
* 获取车品牌
*/
getCarBrandList (data = {}) {
return http.post({
method: 'scrm.api.carlife.common.getOnlyCarBrandList',
projectName: 'carlife',
...data
}, false, 'scrm')
},
/** 获取车系列表 */
getCarSeriesList (data = {}) {
return http.post({
method: 'scrm.api.carlife.common.getCarSeriesList',
projectName: 'carlife',
...data
}, false, 'scrm')
},
/** 获取车型 */
getCarTypeList (data = {}) {
return http.post({
method: 'scrm.api.carlife.common.getCarTypeList',
projectName: 'carlife',
...data
}, false, 'scrm')
},
}
import sign from './sign.js' import sign from './sign.js'
import { secretKey, pathEnum, domain, djDomain, merchantDomain, djSecretKey } from '../../env' import { secretKey, pathEnum, domain, djDomain, merchantDomain, djSecretKey } from '../../env'
const HOST = { const HOST = {
scrm: domain, scrm: domain,
dj: djDomain, dj: djDomain,
...@@ -10,8 +11,8 @@ class Request { ...@@ -10,8 +11,8 @@ class Request {
get(params, returnAll = false, hostType) { get(params, returnAll = false, hostType) {
return this.request('GET', params, returnAll, hostType) return this.request('GET', params, returnAll, hostType)
} }
post(params, returnAll = false, hostType) { post(params, returnAll = false, hostType, timeout) {
return this.request('POST', params, returnAll, hostType) return this.request('POST', params, returnAll, hostType, timeout)
} }
fetch(method, data, returnAll = true, hostType) { fetch(method, data, returnAll = true, hostType) {
return this.post( return this.post(
...@@ -23,7 +24,7 @@ class Request { ...@@ -23,7 +24,7 @@ class Request {
hostType hostType
) )
} }
request(RequestMethods, params, returnAll, hostType = 'dj') { request(RequestMethods, params, returnAll, hostType = 'dj', timeout) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let _this = this let _this = this
uni.getNetworkType({ uni.getNetworkType({
...@@ -56,6 +57,7 @@ class Request { ...@@ -56,6 +57,7 @@ class Request {
header, header,
dataType: 'json', dataType: 'json',
responseType: 'text', responseType: 'text',
timeout: timeout || 60000,
success(response) { success(response) {
/**业务代码 */ /**业务代码 */
let { data, statusCode } = response let { data, statusCode } = response
...@@ -161,5 +163,4 @@ class Request { ...@@ -161,5 +163,4 @@ class Request {
}) })
} }
} }
export default new Request() export default new Request()
...@@ -13,6 +13,7 @@ module.exports = { ...@@ -13,6 +13,7 @@ module.exports = {
return; return;
} }
if (!uni.$signHttp) uni.$signHttp = new Request(uni.signHttpConfig) if (!uni.$signHttp) uni.$signHttp = new Request(uni.signHttpConfig)
data.source = 1
resolve(uni.$signHttp.post(url, data, _config)) resolve(uni.$signHttp.post(url, data, _config))
} }
}) })
......
No preview for this file type
...@@ -110,6 +110,9 @@ ...@@ -110,6 +110,9 @@
.mr-12 { .mr-12 {
margin-right: toRpx(12); margin-right: toRpx(12);
} }
.mr-20 {
margin-right: toRpx(20);
}
.mr-24 { .mr-24 {
margin-right: toRpx(24); margin-right: toRpx(24);
} }
...@@ -137,6 +140,9 @@ ...@@ -137,6 +140,9 @@
.ml-32 { .ml-32 {
margin-left: toRpx(32); margin-left: toRpx(32);
} }
.ml-36 {
margin-left: toRpx(36);
}
.ml-48 { .ml-48 {
margin-left: toRpx(48); margin-left: toRpx(48);
} }
...@@ -195,6 +201,9 @@ ...@@ -195,6 +201,9 @@
.py-16 { .py-16 {
padding: toRpx(16) 0; padding: toRpx(16) 0;
} }
.py-24 {
padding: toRpx(24) 0;
}
.pt-32 { .pt-32 {
padding-top: toRpx(32) !important; padding-top: toRpx(32) !important;
} }
...@@ -210,6 +219,9 @@ ...@@ -210,6 +219,9 @@
.px-20 { .px-20 {
padding: 0 toRpx(20); padding: 0 toRpx(20);
} }
.px-24 {
padding: 0 toRpx(20);
}
.px-32 { .px-32 {
padding: 0 toRpx(32); padding: 0 toRpx(32);
} }
......

2.9 MB | W: | H:

2.94 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -3,12 +3,7 @@ ...@@ -3,12 +3,7 @@
<template v-if="entranceList.length"> <template v-if="entranceList.length">
<view class="entrance-container"> <view class="entrance-container">
<view class="entrance-list"> <view class="entrance-list">
<view <view class="entrance-item" v-for="(item, index) in entranceList" :key="index" @click="handleClick(item)">
class="entrance-item"
v-for="(item, index) in entranceList"
:key="index"
@click="handleClick(item)"
>
<view :class="['sprite-icon', `icon-${item.icon}`]"></view> <view :class="['sprite-icon', `icon-${item.icon}`]"></view>
<view class="entrance-name">{{ item.label }}</view> <view class="entrance-name">{{ item.label }}</view>
</view> </view>
...@@ -17,10 +12,7 @@ ...@@ -17,10 +12,7 @@
</template> </template>
<template v-else> <template v-else>
<view class="developing flex"> <view class="developing flex">
<image <image class="developing-icon" src="../assets/images/common/developing.webp" />
class="developing-icon"
src="../assets/images/common/developing.webp"
/>
功能开发中 功能开发中
</view> </view>
</template> </template>
...@@ -30,57 +22,62 @@ ...@@ -30,57 +22,62 @@
<script> <script>
export default { export default {
name: 'Entrance', name: 'Entrance',
data () { data() {
return { return {}
}
}, },
computed: { computed: {
entranceList () { entranceList() {
let { sceneType } = uni.$storage.get('userInfo'), let { sceneType } = uni.$storage.get('userInfo'),
entranceList = [ entranceList = [
{ {
icon: 'daily-report', icon: 'daily-report',
label: '驻店日报', label: '驻店日报',
name: 'DailyReport', name: 'DailyReport',
sceneType: [0, 1, 7]
}, },
{ {
icon: 'create-order', icon: 'create-order',
label: '新建工单', label: '新建工单',
name: 'CreateOrder' name: 'CreateOrder',
sceneType: [0, 1]
},
{
icon: 'equity-order',
label: '权益提单',
name: 'EquityManagement',
sceneType: [0]
}, },
{ {
icon: 'defeat-order', icon: 'defeat-order',
label: '战败下单', label: '战败下单',
name: 'DefeatOrder' name: 'DefeatOrder',
sceneType: [0, 1]
}, },
{ {
icon: 'order-management', icon: 'order-management',
label: '工单列表', label: '工单列表',
name: 'OrderManagement' name: 'OrderManagement',
sceneType: [0, 1]
}, },
{ {
icon: 'evaluation-management', icon: 'evaluation-management',
label: '评估单管理', label: '评估单管理',
name: 'EvaluationFormList' name: 'EvaluationFormList',
}, { sceneType: [7]
},
{
icon: 'delivery-management', icon: 'delivery-management',
label: '交付管理', label: '交付管理',
name: 'DeliveryManagement', name: 'DeliveryManagement',
page: '/pages/usedCar/deliveryManagement/index' page: '/pages/usedCar/deliveryManagement/index',
sceneType: [7]
} }
] ]
if (sceneType == 0) return [] return entranceList.filter(e => e.sceneType.includes(sceneType))
else if (sceneType === 7) {
return entranceList.filter(e => ['DailyReport', 'EvaluationFormList', 'DeliveryManagement'].includes(e.name));
}
if (sceneType === 1) {
return entranceList.filter(e => !['EvaluationFormList', 'DeliveryManagement'].includes(e.name));
}
} }
}, },
methods: { methods: {
handleClick (item) { handleClick(item) {
// 这里可以根据实际需求进行跳转或功能处理 // 这里可以根据实际需求进行跳转或功能处理
this.$emit('entranceClick', item) this.$emit('entranceClick', item)
} }
......
<template>
<view class="exam-submit-popup-wrapper">
<!-- 标题 -->
<view :class="['exam-title', { 'title-loading': isLoading }]">是否已提交考试</view>
<!-- 加载状态 -->
<template v-if="isLoading">
<view class="loading-text">正在查询考试结果,请稍后...</view>
<image
class="loading-gif"
:src="require('@/assets/images/common/loadding.gif')"
/>
</template>
<template v-if="showError">
<view class="error-text">未查询到考试结果,请重新确认</view>
</template>
<!-- 按钮组(始终显示) -->
<view class="button-group">
<view class="cancel-button" @click="handleCancel">
未提交
</view>
<view class="confirm-button" v-if="!isLoading" @click="handleConfirm">
{{ confirmText }}
</view>
<view class="confirm-button confirm-button-loading" v-else> {{ confirmText }}</view>
</view>
</view>
</template>
<script>
export default {
name: 'ExamSubmitPopup',
props: {
isLoading: {
type: Boolean,
default: false
},
showError: {
type: Boolean,
default: false
},
confirmText: {
type: String,
default: '确认'
}
},
watch: {
isLoading(newVal) {
console.log('ExamSubmitPopup isLoading changed:', newVal)
}
},
methods: {
handleCancel() {
this.$emit('cancel')
},
handleConfirm() {
console.log('handleConfirm clicked')
this.$emit('confirm')
},
}
}
</script>
<style lang="scss" scoped>
.exam-submit-popup-wrapper {
position: relative;
width: 100%;
min-height: toRpx(400);
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: toRpx(48);
}
.exam-title {
width: toRpx(280);
height: toRpx(48);
color: #333333;
font-size: toRpx(40);
font-weight: 500;
font-family: "HarmonyOSSansSC";
text-align: center;
margin-top: toRpx(48);
}
.exam-title.title-loading {
margin-bottom: toRpx(40);
margin-top: toRpx(0);
}
.loading-text {
height: toRpx(48);
color: #6c6f75;
font-size: toRpx(32);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(48);
margin-bottom: toRpx(40);
}
.loading-gif {
width: toRpx(64);
height: toRpx(64);
margin-bottom: toRpx(76);
}
.error-text {
color: #6c6f75;
font-size: toRpx(32);
font-weight: 400;
line-height: toRpx(48);
margin-top: toRpx(48);
}
.button-group {
display: flex;
align-items: center;
justify-content: center;
gap: toRpx(16);
margin-top: auto;
}
.cancel-button {
width: toRpx(344);
height: toRpx(80);
border-radius: toRpx(64);
background: #f0f1f5;
color: #1a1a1a;
font-size: toRpx(28);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(80);
}
.confirm-button {
width: toRpx(360);
height: toRpx(80);
border-radius: toRpx(48);
border: toRpx(2) solid #979797;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #ffffff;
font-size: toRpx(28);
font-weight: 500;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(80);
&-loading {
opacity: 0.5;
}
&:active {
opacity: 0.8;
}
}
</style>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</view> </view>
<view :class="['left-tabs', { three: tabs.length == 3 }]"> <view :class="['left-tabs', { three: tabs.length == 3 }]">
<template v-for="(i, index) in tabs"> <template v-for="(i, index) in tabs">
<view :class="['tab-item', { tabActive: tabIndex == index }]" :key="index" @click="changeIndex(index, i)" v-if="!i.hidden"> <view :class="['tab-item', { tabActive: tabIndex == index }]" :key="index" @click="changeIndex(index, i)" v-if="!i.hidden && (i.name !== 'ActivityCenter' || activityTabVisible)">
<view class="icon-box"> <view class="icon-box">
<view :class="['sprite-icon', `icon-${i.icon}${tabIndex == index ? '-active' : ''}`]"></view> <view :class="['sprite-icon', `icon-${i.icon}${tabIndex == index ? '-active' : ''}`]"></view>
</view> </view>
...@@ -151,7 +151,6 @@ export default { ...@@ -151,7 +151,6 @@ export default {
isTrack: true, isTrack: true,
name: 'StudyCenter', name: 'StudyCenter',
eventCode: 'app_study_center', eventCode: 'app_study_center',
hidden: true
}, },
{ {
label: "场景集市", label: "场景集市",
...@@ -174,8 +173,7 @@ export default { ...@@ -174,8 +173,7 @@ export default {
return tabs return tabs
} }
}, },
created() { created () {
// 监听自定义事件 // 监听自定义事件
uni.$on('pageBack', () => { uni.$on('pageBack', () => {
console.log('pageBack') console.log('pageBack')
...@@ -188,11 +186,12 @@ export default { ...@@ -188,11 +186,12 @@ export default {
// index = tabs.findIndex(e => e.name == 'ActivityCenter') // index = tabs.findIndex(e => e.name == 'ActivityCenter')
// this.changeIndex(index, this.tabs[index]) // this.changeIndex(index, this.tabs[index])
// }) // })
// uni.$on('studyCenter', () => { // 监听学习任务弹窗提醒,长课程
// let { tabs } = this, uni.$on('studyCenter', () => {
// index = tabs.findIndex(e => e.name == 'StudyCenter') let { tabs } = this,
// this.changeIndex(index, this.tabs[index]) index = tabs.findIndex(e => e.name == 'StudyCenter')
// }); this.changeIndex(index, this.tabs[index])
});
console.log('this.tabIndex', this.tabIndex) console.log('this.tabIndex', this.tabIndex)
this.getUnreadCount() this.getUnreadCount()
this.getStudyCenterPermission() this.getStudyCenterPermission()
...@@ -273,21 +272,6 @@ export default { ...@@ -273,21 +272,6 @@ export default {
// let jumpUrl // let jumpUrl
if (item.isTrack) { if (item.isTrack) {
this.$emit('closeTips') this.$emit('closeTips')
// try {
// jumpUrl = await this.findBeiSenSSOToken()
// this.jumpUrl = jumpUrl
// } catch (error) {
// }
// if (jumpUrl) {
// this.addTrack()
// this.startTrack()
// }
} else {
// this.leaveTrack()
// this.trackId = 0
// clearInterval(this.trackInterval)
// this.trackInterval = null
} }
this.$emit('update:tabIndex', index) this.$emit('update:tabIndex', index)
this.$emit("changeTab", { this.$emit("changeTab", {
...@@ -301,51 +285,42 @@ export default { ...@@ -301,51 +285,42 @@ export default {
}, },
async haveCustomerAccess(val) { async haveCustomerAccess(val) {
const { shopMerchantId, sceneType: scene } = val const { shopMerchantId, sceneType: scene } = val
// const res = await uni.$api.customerApi.haveCustomerAccess({
// merchantId: shopMerchantId
// })
// if (res)
// this.tabs.push({
// label: "客户档案",
// icon: "customer-file",
// name: 'CustomerFile'
// })
// this.$store.state.user.haveCustomerAccess = res
uni.$api.customerApi.saleOpen({ uni.$api.customerApi.saleOpen({
merchantId: shopMerchantId, merchantId: shopMerchantId,
scene scene
}).then(result => { }).then(result => {
console.log('haveCustomerAccess', result) console.log('有客户权限',result)
// uni.$storage.set('isSaleOpen', result)
if (result) { if (result) {
this.hasPerson = true this.hasPerson = true
// this.activityTabVisible = scene !== 7 // this.activityTabVisible = scene !== 7
// this.tabs[this.tabs.length-1].hidden = scene !== 7 // this.tabs[this.tabs.length-1].hidden = scene !== 7
this.$nextTick(() => { // this.$nextTick(() => {
const activityTabIcon = document.querySelector('.sprite-icon.icon-activity') // const activityTabIcon = document.querySelector('.sprite-icon.icon-activity')
if (activityTabIcon) { // if (activityTabIcon) {
const activityTab = activityTabIcon.closest('.tab-item') // const activityTab = activityTabIcon.closest('.tab-item')
if (activityTab) { // if (activityTab) {
if (scene === 7) { // if (scene === 7) {
activityTab.style.display = 'none' // activityTab.style.display = 'none'
} else { // } else {
activityTab.style.display = 'block' // activityTab.style.display = 'block'
} // }
} // }
} // }
}) // })
this.activityTabVisible = scene !== 7;
} else { } else {
// this.tabs[this.tabs.length-1].hidden = false // this.tabs[this.tabs.length-1].hidden = false
// this.activityTabVisible = false // this.activityTabVisible = false
this.$nextTick(() => { // this.$nextTick(() => {
const activityTabIcon = document.querySelector('.sprite-icon.icon-activity') // const activityTabIcon = document.querySelector('.sprite-icon.icon-activity')
if (activityTabIcon) { // if (activityTabIcon) {
const activityTab = activityTabIcon.closest('.tab-item') // const activityTab = activityTabIcon.closest('.tab-item')
if (activityTab) { // if (activityTab) {
activityTab.style.display = 'none' // activityTab.style.display = 'none'
} // }
} // }
}) // })
this.activityTabVisible = false;
} }
}) })
}, },
...@@ -404,15 +379,11 @@ export default { ...@@ -404,15 +379,11 @@ export default {
} }
}, },
openPop() { openPop() {
// this.messageType = 'system'
// this.$refs.kfRef.open()
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/messageList` url: `/pages/common/messageList`
}) })
}, },
getMessageInfo() { getMessageInfo() {
// this.getMessage()
// this.getMessageCount()
this.getMessagePop() this.getMessagePop()
}, },
jumpPersonCenter() { jumpPersonCenter() {
...@@ -450,20 +421,22 @@ export default { ...@@ -450,20 +421,22 @@ export default {
}) })
}, },
// 学习中心权限获取,场景集市权限 // 学习中心权限获取,场景集市权限
getStudyCenterPermission() { getStudyCenterPermission () {
const userInfo = uni.$storage.get('userInfo') const userInfo = uni.$storage.get('userInfo')
const res = uni.$storage.get('studyCenterPermission')
if(!res){
uni.$api.commonApi.getStudyCenterPermission({}).then(res => {
uni.$storage.set('studyCenterPermission', res)
console.log(res,'res')
})
}
if (userInfo.sceneType == 7) {
this.tabs[2].hidden = true
}
if (userInfo.subLoginUser.channelType == 9) { if (userInfo.subLoginUser.channelType == 9) {
this.tabs[2].hidden = true this.tabs[2].hidden = true
this.tabs[3].hidden = true this.tabs[3].hidden = true
return return
} else {
const res = uni.$storage.get('studyCenterPermission')
console.log('getStudyCenterPermission', res)
const { directSaleAuth, hmzxAuth, authorizedBusinessList } = res // 当驻店人员为非直营,且非鸿蒙智行延保业务驻店人员情况下。隐藏左侧【学习中心】图标
const isYb = authorizedBusinessList && authorizedBusinessList.includes(1) // 1.延保 2.轻改 3.权益
if (directSaleAuth || (hmzxAuth && isYb)) {
this.tabs[2].hidden = false
}
} }
} }
}, },
...@@ -472,6 +445,8 @@ export default { ...@@ -472,6 +445,8 @@ export default {
// this.trackInterval = null // this.trackInterval = null
}, },
beforeDestroy() { beforeDestroy() {
// uni.$off('pageBack')
// uni.$off('studyCenter')
uni.$off('ActivityCenter', this.handleActivityCenter); uni.$off('ActivityCenter', this.handleActivityCenter);
// clearInterval(this.trackInterval) // clearInterval(this.trackInterval)
// this.trackInterval = null // this.trackInterval = null
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<!-- 当前有 3 个学习任务待完成,请及时处理。 <!-- 当前有 3 个学习任务待完成,请及时处理。
坚持学习助您能力提升! --> 坚持学习助您能力提升! -->
<template v-else-if="type=='study'"> <template v-else-if="type=='study'">
<image class="message-bg" :src="require('@//assets/images/common/study-center-bg.webp')"></image> <image class="message-bg" :src="require('@//assets/images/common/study-center-bg.png')"></image>
<view class="text text-first study-title">学习提醒</view> <view class="text text-first study-title">学习提醒</view>
<view class="text study-text">当前有{{messageData.count}}个学习任务待完成,请及时处理。</view> <view class="text study-text">当前有{{messageData.count}}个学习任务待完成,请及时处理。</view>
<view class="text study-text">坚持学习助您能力提升!</view> <view class="text study-text">坚持学习助您能力提升!</view>
......
...@@ -154,7 +154,7 @@ export default { ...@@ -154,7 +154,7 @@ export default {
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
align-items: center; align-items: center;
margin-top: toRpx(12); margin-top: toRpx(12);
margin-bottom: toRpx(42); margin-bottom: toRpx(20);
.statistics-item { .statistics-item {
display: flex; display: flex;
......
...@@ -10,10 +10,13 @@ ...@@ -10,10 +10,13 @@
<view class="tab-item-title">{{ item.title }}</view> <view class="tab-item-title">{{ item.title }}</view>
</view> </view>
</view> </view>
<view class="rank-title">周转化率排名</view> <view class="rank-title">
<view class="rank-value"> <view class="rank-title-text">周转化率排名</view>
<view class="rank-number">{{ currentConversionData.top || '-' }}</view>名 <view class="rank-value">
<view class="rank-number">{{ currentConversionData.top || '-' }}</view>名
</view>
</view> </view>
<view class="bar-box"> <view class="bar-box">
<view class="bar-item" v-for="(item, index) in barList" :key="index"> <view class="bar-item" v-for="(item, index) in barList" :key="index">
<view class="bar-label">{{ item.label }}</view> <view class="bar-label">{{ item.label }}</view>
...@@ -152,7 +155,7 @@ export default { ...@@ -152,7 +155,7 @@ export default {
padding: toRpx(24); padding: toRpx(24);
margin: 0 toRpx(32) toRpx(16); margin: 0 toRpx(32) toRpx(16);
&.big-height { &.big-height {
height: toRpx(764); height: toRpx(704);
} }
&.all-height { &.all-height {
height: calc(100% - #{toRpx(32)}); height: calc(100% - #{toRpx(32)});
...@@ -187,27 +190,32 @@ export default { ...@@ -187,27 +190,32 @@ export default {
color: #1A1A1A; color: #1A1A1A;
margin-top: toRpx(32); margin-top: toRpx(32);
margin-left: toRpx(8); margin-left: toRpx(8);
}
.rank-value {
display: flex; display: flex;
align-items: baseline; align-items: center;
color: #3B73FF; .rank-title-text {
font-size: toRpx(22); font-size: toRpx(28);
font-weight: 500; color: #1A1A1A;
margin-top: toRpx(16); margin-right: toRpx(8);
margin-left: toRpx(8); }
.rank-number { .rank-value {
font-size: toRpx(40); display: flex;
font-weight: 700; align-items: baseline;
margin-right: toRpx(4); color: #3B73FF;
font-size: toRpx(22);
font-weight: 500;s
.rank-number {
font-size: toRpx(40);
font-weight: 700;
margin-right: toRpx(4);
}
} }
} }
/* 进度条整体项样式 */ /* 进度条整体项样式 */
.bar-box { .bar-box {
margin-top: toRpx(44); margin-top: toRpx(28);
} }
.bar-item { .bar-item {
......
<template>
<view class="age-list">
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i)"
:class="['item flex', { active: currentId ? i == currentId : i == data[params.idKey] }]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{ i }}
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'AgeRange',
inject: ['userInfo'],
data () {
return {
}
},
mounted () {
},
methods: {
async getList () {
const { params } = this
this.currentId = ''
let data = [
'20岁以下',
'21-30岁',
'31-40岁',
'41-50岁',
'51岁以上'
]
this.updateParams(params, data)
},
initData (list) {
const { params:{idKey}, data } = this
if(data[idKey]) {
this.currentId = data[idKey]
this.$emit('choose', data[idKey])
}
this.list = list
this.$emit('onComplete')
},
handleSearch (searchValue) {
this.list = []
this.getList(searchValue, true)
},
choose (i) {
this.currentId = i
this.$emit('choose', i)
}
}
}
</script>
<style scoped lang="scss">
.age-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
:class="[ :class="[
{'sub-brand-name':j.isTitle}, {'sub-brand-name':j.isTitle},
{'item flex':!j.isTitle}, {'item flex':!j.isTitle},
{active: (currentId ? j.id == currentId : j.id == data.customer[params.idKey]) && !j.isTitle} {active:checkActive(j) && !j.isTitle}
]" ]"
@click="choose(j,c)" @click="choose(j,c)"
> >
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
this.updateParams(params, data || []) this.updateParams(params, data || [])
}, },
initData (carData) { initData (carData) {
let { params: { idKey }, data: { customer } } = this, let { params: { idKey }, data: { customer, carInfo }, sceneType } = this,
letterList = Array.from(new Set([...carData.map((e) => e.letter)])), letterList = Array.from(new Set([...carData.map((e) => e.letter)])),
carModelList = letterList.map(e => { carModelList = letterList.map(e => {
let list = [] let list = []
...@@ -100,10 +100,21 @@ export default { ...@@ -100,10 +100,21 @@ export default {
c.childs.map((s) => { c.childs.map((s) => {
s.carChildsBrandId = c.id; s.carChildsBrandId = c.id;
s.carChildsBrandName = c.name; s.carChildsBrandName = c.name;
if (customer && customer[idKey]) { if (sceneType == 1) {
if (s.id == customer[idKey]) { if (customer && customer[idKey]) {
s.active = true; if (s.id == customer[idKey]) {
this.letter = i.letter; s.active = true;
this.letter = i.letter;
this.choose(s, c)
}
}
} else {
if (carInfo && carInfo[idKey]) {
if (s.id == carInfo[idKey]) {
s.active = true;
this.letter = i.letter;
this.choose(s, c)
}
} }
} }
}); });
...@@ -184,7 +195,14 @@ export default { ...@@ -184,7 +195,14 @@ export default {
} }
this.currentId = that.id this.currentId = that.id
this.$emit('choose', chooseItem) this.$emit('choose', chooseItem)
} },
checkActive (j) {
let { currentId, data, params, sceneType } = this
return (currentId ?
j.id == currentId :
sceneType == 0 ? j.id == data.carInfo[params.idKey] || '' :
(j.id == (data.customer ? data.customer[params.idKey] : '') || j.id == data[params.idKey]))
},
} }
} }
</script> </script>
......
...@@ -90,12 +90,12 @@ export default { ...@@ -90,12 +90,12 @@ export default {
}) })
this.updateParams(params, data || []) this.updateParams(params, data || [])
}, },
initData (data) { initData (dataList) {
let couponTypeList = Array.from(new Set([...data.map((e) => e.couponInfo.couponType)])), let couponTypeList = Array.from(new Set([...dataList.map((e) => e.couponInfo.couponType)])),
couponList = couponTypeList.map((e, index) => { couponList = couponTypeList.map((e, index) => {
let list = []; let list = [];
let title = ""; let title = "";
data.map((i) => { dataList.map((i) => {
i.merchantCouponCode = i.merchantCouponCode.split("-")[0]; i.merchantCouponCode = i.merchantCouponCode.split("-")[0];
if (i.couponInfo.couponType == e) { if (i.couponInfo.couponType == e) {
list.push(i); list.push(i);
...@@ -107,12 +107,30 @@ export default { ...@@ -107,12 +107,30 @@ export default {
list, list,
}; };
}) })
const { params: { idKey }, data, customerCouponList } = this
this.$emit('onComplete') this.$emit('onComplete')
this.list = couponList this.list = couponList
if (data[idKey]) {
this.currentId = data[idKey]
let item = null,
isCustomer = false
couponList.map(e => {
e.list.map(i => {
if (i.merchantCouponCode == data[idKey]) item = i
})
})
customerCouponList.map(i => {
if (i.customerCouponCode == data[idKey]) {
item = i
isCustomer = true
}
})
if (item) this.choose(item, isCustomer)
}
}, },
async getCustomerCouponList (customerPhone) { async getCustomerCouponList (customerPhone) {
const phoneRex = /^[1]([3-9])[0-9]{9}$/, const phoneRex = /^[1]([3-9])[0-9]{9}$/,
{ data: orderObj } = this, { data: orderObj, params: { idKey } } = this,
params = { params = {
customerPhone, customerPhone,
statusList: [0, 1], statusList: [0, 1],
...@@ -126,7 +144,7 @@ export default { ...@@ -126,7 +144,7 @@ export default {
(item.status == 1 && item.id == orderObj.customerCouponId) (item.status == 1 && item.id == orderObj.customerCouponId)
); );
}) })
if(this.customerCouponList.length) this.choose(this.customerCouponList[0],true) if (this.customerCouponList.length && !orderObj[idKey]) this.choose(this.customerCouponList[0], true, true)
} }
}, },
handleSearch (searchValue) { handleSearch (searchValue) {
...@@ -155,7 +173,7 @@ export default { ...@@ -155,7 +173,7 @@ export default {
this.searchStatus = true this.searchStatus = true
} }
}, },
choose (item, isCustomer = false) { choose (item, isCustomer = false, autoSelect = false) {
if (item.disabled) return if (item.disabled) return
let customerCouponCode = isCustomer ? item.customerCouponCode : item.merchantCouponCode, let customerCouponCode = isCustomer ? item.customerCouponCode : item.merchantCouponCode,
key = isCustomer ? 'customerCouponId' : 'merchantCouponId', key = isCustomer ? 'customerCouponId' : 'merchantCouponId',
...@@ -167,6 +185,7 @@ export default { ...@@ -167,6 +185,7 @@ export default {
} }
this.currentId = customerCouponCode this.currentId = customerCouponCode
this.$emit('choose', chooseItem) this.$emit('choose', chooseItem)
if (autoSelect) this.$emit('confirm', true)
}, },
checkDisabled (item) { checkDisabled (item) {
let disabled = false, let disabled = false,
......
<template>
<view class="customer-list">
<template v-for="(i, index) in listData">
<view
:key="index"
@click="choose(i)"
:class="['item flex', { active: checkActive(i) }]"
>
<view class="sprite-icon icon-tag-checked"></view>
<view class="info flex text-hide">
<template v-if="i.customerName || (i.customer && i.customer.customerName)">
{{ i.customerName || (i.customer && i.customer.customerName) }}
</template>
<template v-if="i.carSeriesName || i.carType">
<view class="car-model text-hide">({{ i.carType ? i.carType : i.carChildsBrandName + '-' + i.carSeriesName || '' }})</view>
</template>
</view>
<template v-if="i.customerPhone || i.customer.customerPhone">
<view class="phone">|{{ i.customerPhone || (i.customer && i.customer.customerPhone) }}</view>
</template>
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'Customer',
inject: ['userInfo'],
data () {
return {
}
},
mounted () {
},
methods: {
async getList (searchValue, search) {
const { userInfo, params } = this,
{ cacheData } = params
this.currentId = ''
if (!search && cacheData && cacheData.length) {
this.initData(cacheData)
return
}
this.componentLoading(params)
const { shopMerchantId } = userInfo,
apiParams = {
merchantId: shopMerchantId,
pageSize: 999999,
currentPage: 1,
search: searchValue
}
let apiTargetName = !params.defeat ? 'getQuotationCustomerList' : 'getWorkPackageGoodsList'
console.log(apiTargetName, 'apiTargetName')
if (params.defeat) {
apiParams.keyword = searchValue
}
const { list } = await uni.$api.popupApi[apiTargetName](apiParams)
let customerList = list
if (params.defeat) {
const listArray = list.map(item => {
if (item.customer && item.customer.carSeriesName) {
item.carType = `${item.customer.carBrand || ''}-${item.customer.carChildsBrandName || ''}-${item.customer.carSeriesName || ''}`
}
return item
})
customerList = listArray
}
console.log(customerList, 'customerList')
this.updateParams(params, customerList || [])
},
initData (list) {
const { params: { idKey, defeat }, data } = this
let key = defeat ? 'id' : 'customerPhone'
console.log(data, idKey)
if (data[idKey]) {
this.currentId = data[idKey]
let item = list.find(i => i[key] == this.currentId)
this.$emit('choose', item)
}
this.list = list
this.$emit('onComplete')
},
handleSearch (searchValue) {
this.list = []
this.getList(searchValue, true)
},
choose (i) {
let { params } = this
let key = params.defeat ? 'id' : 'customerPhone'
this.currentId = i[key]
this.$emit('choose', i)
},
checkActive (i) {
let { currentId, data, params } = this
let key = params.defeat ? 'id' : 'customerPhone'
return currentId ? (i[key] == currentId) : (i[key]) == data[params.idKey]
}
}
}
</script>
<style scoped lang="scss">
.customer-list {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
.info{
max-width: 70%;
}
.phone{
flex-shrink: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
...@@ -127,6 +127,7 @@ export default { ...@@ -127,6 +127,7 @@ export default {
const { days } = this const { days } = this
const { value } = e.detail const { value } = e.detail
const index = value[0] const index = value[0]
console.log( days[index],days,index)
this.currentDate = days[index] this.currentDate = days[index]
// 选择过去时间需要重新初始化时分 // 选择过去时间需要重新初始化时分
const today = dayjs().format('YYYY/MM/DD') const today = dayjs().format('YYYY/MM/DD')
...@@ -175,6 +176,7 @@ export default { ...@@ -175,6 +176,7 @@ export default {
this.minutes = minutes this.minutes = minutes
}, },
getResult () { getResult () {
console.log(this.currentDate,this.currentHour,this.currentMinute)
let str = '' let str = ''
str = this.currentDate + ' ' + this.currentHour + ':' + this.currentMinute + ":00" str = this.currentDate + ' ' + this.currentHour + ':' + this.currentMinute + ":00"
const result = dayjs(str).format('YYYY/MM/DD HH:mm:ss') const result = dayjs(str).format('YYYY/MM/DD HH:mm:ss')
......
...@@ -38,8 +38,14 @@ export default { ...@@ -38,8 +38,14 @@ export default {
}) })
this.updateParams(params, data || []) this.updateParams(params, data || [])
}, },
initData (data) { initData (list) {
this.list = data const { params: { idKey }, data } = this
if (data[idKey]) {
this.currentId = data[idKey]
let item = list.find(i => i.subMerchantId == this.currentId)
this.$emit('choose', item)
}
this.list = list
this.$emit('onComplete') this.$emit('onComplete')
}, },
choose (i) { choose (i) {
......
<template> <template>
<view class="employee-list"> <view class="employee-list">
<template v-for="(i, index) in list"> <template v-for="(i, index) in listData">
<view :key="index" @click="choose(i)" :class="['item flex', { active: currentId ? i.uuid == currentId : i.uuid == data[params.idKey] }]"> <view
:key="index"
@click="choose(i)"
:class="['item flex', { active: checkActive(i) }]"
>
<view class="sprite-icon icon-tag-checked"></view> <view class="sprite-icon icon-tag-checked"></view>
{{ i.staffName }} {{ i.staffName }}
</view> </view>
...@@ -19,49 +23,92 @@ export default { ...@@ -19,49 +23,92 @@ export default {
return { return {
} }
}, },
computed: {
idKey () {
let { params: { idKey }, sceneType } = this
return Array.isArray(idKey) ? idKey[sceneType] : idKey
}
},
mounted () { mounted () {
}, },
methods: { methods: {
async getList (searchValue, search) { async getList (searchValue, search) {
const { userInfo, params } = this, const { userInfo, params } = this,
{ cacheData } = params { cacheData } = params
this.currentId = '' this.currentId = ''
if (!search && cacheData && cacheData.length) { if (!search && cacheData && cacheData.length) {
console.log('getList', params,data)
this.initData(cacheData) this.initData(cacheData)
if (searchValue) this.handleSearch(searchValue)
return return
} }
this.componentLoading(params)
const { shopMerchantId, sceneType, merchantId } = userInfo, const { shopMerchantId, sceneType, merchantId } = userInfo,
data = await uni.$api.popupApi.getEmployeeList({ apiTargetName = sceneType == 1 || params.defeat ? 'getEmployeeList' : 'getOrderScreenEmployeeList',
apiParams = {
merchantId: params.idKey == 'sellerUserId' ? merchantId : shopMerchantId, merchantId: params.idKey == 'sellerUserId' ? merchantId : shopMerchantId,
sceneList: params.idKey == 'sellerUserId' ? '' : [sceneType], sceneList: params.idKey == 'sellerUserId' ? '' : [sceneType],
name: searchValue }
}) if (searchValue) apiParams.name = searchValue
const data = await uni.$api.popupApi[apiTargetName](apiParams)
this.updateParams(params, data || []) this.updateParams(params, data || [])
}, },
initData (data) { initData (list) {
this.list = data const { idKey, data } = this
if (data[idKey]) {
this.currentId = data[idKey]
let item = list.find(i => i.uuid == this.currentId)
console.log(item)
this.$emit('choose', item)
}
this.list = list
this.$emit('onComplete') this.$emit('onComplete')
}, },
handleSearch (searchValue) { handleSearch (searchValue) {
this.list = [] const { sceneType } = this
this.getList(searchValue, true) if (sceneType == 1) {
this.list = []
this.getList(searchValue, true)
} else this.originalDataSearch(searchValue)
},
originalDataSearch (searchValue) {
console.log(searchValue, '===')
if (!searchValue) this.searchStatus = false
else {
searchValue = searchValue.toUpperCase()
let { list } = this,
employeeList = JSON.parse(JSON.stringify(list)),
arr = []
employeeList.map(e => {
if (e.staffName && e.staffName.toUpperCase().indexOf(searchValue) != -1) arr.push(e)
})
this.searchList = arr
this.searchStatus = true
}
}, },
choose (i) { choose (i) {
console.log('choose', i) let { idKey, data } = this,
let { params: { idKey }, data } = this, userId = data.deliveryUserId,
referrerId = data.deliveryId,
deliveryUserId = data.userId,
deliveryId = data.referrerId,
value = { value = {
userId: data.deliveryUserId, userId,
deliveryUserId: data.userId deliveryUserId,
referrerId,
deliveryId
}[idKey] }[idKey]
if ((idKey == 'userId' || idKey == 'deliveryUserId') && value == i.uuid) return uni.showToast({ if (['referrerId', 'userId', 'deliveryId', 'deliveryUserId'].includes(idKey) && value == i.uuid) return uni.showToast({
title: '销售顾问/录单员与交付专员不能选取同一人', title: '销售顾问/录单员与交付专员不能选取同一人',
icon: 'none', icon: 'none',
mask: true mask: true
}) })
this.currentId = i.uuid this.currentId = i.uuid
this.$emit('choose', i) this.$emit('choose', i)
},
checkActive (i) {
let { currentId, idKey, data } = this
return currentId ? i.uuid == currentId : i.uuid == data[idKey]
} }
} }
} }
......
<template>
<view class="gearbox-list">
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i)"
:class="['item flex', { active: currentId ? i.value == currentId : i.value == data[params.idKey] }]"
>
<view class="sprite-icon icon-tag-checked"></view>
<template v-if="!i.type">
{{ i.value }}
</template>
<template v-else>
<input
type="text"
v-model="i.value"
class="input"
:placeholder="i.label"
>
</template>
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'Gearbox',
inject: ['userInfo'],
data () {
return {
}
},
mounted () {
},
methods: {
async getList () {
const { params } = this
this.currentId = ''
let data = [
{
value: 'MT变速箱'
},
{
value: 'AMT变速箱'
},
{
value: 'AT变速箱'
},
{
value: 'CVT变速箱'
},
{
value: 'DCT变速箱'
},
{
label: '自定义',
value: '',
type: 'input'
}
]
this.updateParams(params, data)
},
initData (list) {
const { params: { idKey }, data } = this
console.log(data[idKey])
if (data[idKey]) {
this.currentId = data[idKey]
this.$emit('choose', data[idKey])
let index = list.findIndex(item => item.value == data[idKey])
if(index == -1) list[list.length - 1].value = data[idKey]
}
this.list = list
this.$emit('onComplete')
},
handleSearch (searchValue) {
this.list = []
this.getList(searchValue, true)
},
choose (i) {
this.currentId = i.value
this.$emit('choose', i.value)
}
}
}
</script>
<style scoped lang="scss">
.gearbox-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
.input{
width: 100%;
height: 100%;
text-align: center;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
...@@ -121,8 +121,8 @@ export default { ...@@ -121,8 +121,8 @@ export default {
} }
}, },
initData (goodsData) { initData (goodsData) {
let { data, dataKey, isDefeatOrder, baseConfigData, positionTypeList } = this, let { data, dataKey, isDefeatOrder, baseConfigData, positionTypeList, params } = this,
{ goodsType } = this.params, { goodsType } = params,
arr = [] arr = []
if (isDefeatOrder) { if (isDefeatOrder) {
let arrData = [] let arrData = []
...@@ -168,18 +168,31 @@ export default { ...@@ -168,18 +168,31 @@ export default {
if (goodsType.includes(subVal.merchantGoodsPosition)) arr.push(val) if (goodsType.includes(subVal.merchantGoodsPosition)) arr.push(val)
} }
}) })
let paramsData = dataKey ? data[dataKey] : data }
if (paramsData && paramsData.length) paramsData.map(e => { let paramsData = dataKey ? data[dataKey] : data
this.currentIds.push(e.goods.goodsId) if (paramsData && paramsData.length) {
this.chooseList.push(e) // let idName = isDefeatOrder ? 'id' : 'goodsId'
// paramsData.map(e => {
// this.currentIds.push(e.goods[idName])
// this.chooseList.push(e)
// })
arr.map(i => {
console.log(i)
if (isDefeatOrder) i.upgradeGoodsList.map(e => {
paramsData.map(c => {
if (c.goods.id == e.id) this.choose(e)
})
})
else paramsData.map(c => {
if (i.goods.goodsId == c.goods.goodsId) this.choose(i)
})
}) })
} }
this.$emit('choose', this.chooseList)
this.$emit('onComplete') this.$emit('onComplete')
this.list = arr this.list = arr
}, },
choose (i) { choose (i) {
let { currentIds, isDefeatOrder } = this, let { currentIds, isDefeatOrder } = this,
id = '' id = ''
if (isDefeatOrder) id = i.id if (isDefeatOrder) id = i.id
......
<template>
<view class="seat-list">
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i)"
:class="['item flex', { active: currentId != null ? i.optionId == currentId : i.optionId == data[params.idKey] }]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{ i.optionLabel }}
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'Options',
inject: ['userInfo'],
data () {
return {
}
},
mounted () {
},
methods: {
async getList () {
const { params } = this
this.currentId = '-1'
this.updateParams(params, params.options)
},
initData (list) {
const { params: { idKey }, data } = this
if (data[idKey] != null) {
this.currentId = data[idKey]
this.$emit('choose', data[idKey])
}
this.list = list
this.$emit('onComplete')
},
choose (i) {
this.currentId = i.optionId
this.$emit('choose', i)
}
}
}
</script>
<style scoped lang="scss">
.seat-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
...@@ -108,6 +108,7 @@ export default { ...@@ -108,6 +108,7 @@ export default {
this.currentIds.push(e.packageGoods.packageCode) this.currentIds.push(e.packageGoods.packageCode)
this.chooseList.push(e) this.chooseList.push(e)
}) })
this.$emit('choose', this.chooseList)
this.$emit('onComplete') this.$emit('onComplete')
this.list = arr this.list = arr
}, },
......
<template>
<view class="seat-list">
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i)"
:class="['item flex', { active: currentId ? i == currentId : i == data[params.idKey] }]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{ i }}
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'Seat',
inject: ['userInfo'],
data () {
return {
}
},
mounted () {
},
methods: {
async getList () {
const { params } = this
this.currentId = ''
let data = [
'1',
'2',
'3',
'4',
'5',
'6',
'7',
]
this.updateParams(params, data)
},
initData (list) {
const { params:{idKey}, data } = this
if(data[idKey]) {
this.currentId = data[idKey]
this.$emit('choose', data[idKey])
}
this.list = list
this.$emit('onComplete')
},
handleSearch (searchValue) {
this.list = []
this.getList(searchValue, true)
},
choose (i) {
this.currentId = i
this.$emit('choose', i)
}
}
}
</script>
<style scoped lang="scss">
.seat-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
...@@ -23,6 +23,9 @@ export default { ...@@ -23,6 +23,9 @@ export default {
}, },
noData () { noData () {
return !this.listData.length return !this.listData.length
},
sceneType(){
return uni.$storage.get('userInfo').sceneType
} }
}, },
watch: { watch: {
...@@ -42,7 +45,10 @@ export default { ...@@ -42,7 +45,10 @@ export default {
params.cacheData = data params.cacheData = data
} }
this.$emit('update:params', params) this.$emit('update:params', params)
},
componentLoading (params) {
params.loadComplete = false
this.$emit('update:params', this.params)
} }
} }
......
<template> <template>
<view class="order-popup"> <view class="order-popup">
<popup :position="position" :animation="animation" ref="popup" @onConfirm="confirm" @onCancel="cancel" @onReset="reset" :showReset="popupType === 15"> <popup
:position="position"
:animation="animation"
ref="popup"
@onConfirm="confirm"
@onCancel="cancel"
@onReset="reset"
:showReset="popupType === 15"
:hideFooter="componentObject[popupType].hideFooter"
:popupStyle="componentObject[popupType].popupStyle || ''"
>
<view class="popup-title flex"> <view class="popup-title flex">
{{ title }} {{ title }}
<view class="popup-close flex" @click="close"> <view
<uni-icons type="closeempty" size="16"></uni-icons> class="popup-close flex"
@click="close"
>
<uni-icons
type="closeempty"
size="16"
></uni-icons>
</view> </view>
</view> </view>
<template v-if="!componentObject[popupType].hideSearch"> <template v-if="!componentObject[popupType].hideSearch">
<view class="popup-search"> <view class="popup-search">
<input class="input" type="text" :placeholder="componentObject[popupType].placeholder || '请输入'" placeholder-class="placeholder" v-model="componentObject[popupType].searchValue" confirm-type="search" @confirm="handleSearch" /> <input
<view class="clear flex" @click="clear"> class="input"
<uni-icons type="closeempty" size="16" v-if="componentObject[popupType].searchValue"></uni-icons> type="text"
:placeholder="componentObject[popupType].placeholder || '请输入'"
placeholder-class="placeholder"
v-model="componentObject[popupType].searchValue"
confirm-type="search"
@confirm="handleSearch"
/>
<view
class="clear flex"
@click="clear"
>
<uni-icons
type="closeempty"
size="16"
v-if="componentObject[popupType].searchValue"
></uni-icons>
</view> </view>
</view> </view>
</template> </template>
<view :class="['popup-body', { 'hide-search': componentObject[popupType].hideSearch }]"> <view :class="['popup-body',
<scroll-view scroll-y :class="['popup-scroll-view', { show: componentObject[popupType].loadComplete }]"> {'hide-footer': componentObject[popupType].hideFooter },
<component :is="componentObject[popupType].name" :params.sync="componentObject[popupType]" :data="data" :dataKey="dataKey" :isDefeatOrder="isDefeatOrder" :defaultTime="defaultTime" :positionTypeList="positionTypeList" ref="componentRef" @choose="chooseContent = $event" @openSkuPopup="openSkuPopup" @onComplete="componentObject[popupType].loadComplete = true"></component> {'hide-search': componentObject[popupType].hideSearch },
{'hide-footer-search':componentObject[popupType].hideFooter && componentObject[popupType].hideSearch }
]">
<scroll-view
scroll-y
:class="['popup-scroll-view', { show: componentObject[popupType].loadComplete }]"
>
<component
:is="componentObject[popupType].name"
:params.sync="componentObject[popupType]"
:data="data"
:dataKey="dataKey"
:isDefeatOrder="isDefeatOrder"
:defaultTime="defaultTime"
:positionTypeList="positionTypeList"
ref="componentRef"
@choose="chooseContent = $event"
@openSkuPopup="openSkuPopup"
@onComplete="componentObject[popupType].loadComplete = true"
@confirm="confirm"
></component>
<template v-if="componentObject[popupType].noData"> <template v-if="componentObject[popupType].noData">
<view class="nothing flex">暂无数据</view> <view class="nothing flex">暂无数据</view>
</template> </template>
</scroll-view> </scroll-view>
<image v-if="!componentObject[popupType].loadComplete" class="loading" src="../../assets/images/common/loadding.gif" /> <image
v-if="!componentObject[popupType].loadComplete"
class="loading"
src="../../assets/images/common/loadding.gif"
/>
</view> </view>
</popup> </popup>
<sku-popup ref="skuPopupRef" @onConfirm="skuConfirm"></sku-popup> <sku-popup
ref="skuPopupRef"
@onConfirm="skuConfirm"
></sku-popup>
</view> </view>
</template> </template>
...@@ -44,6 +102,14 @@ import DateTime from './components/DateTime.vue' ...@@ -44,6 +102,14 @@ import DateTime from './components/DateTime.vue'
import DateTimeChange from './components/DateTimeChange.vue' import DateTimeChange from './components/DateTimeChange.vue'
import AgreementList from './components/AgreementList.vue' import AgreementList from './components/AgreementList.vue'
import GoodsCategory from './components/GoodsCategory.vue' import GoodsCategory from './components/GoodsCategory.vue'
import AgeRange from './components/AgeRange.vue'
import City from './components/City.vue'
import Seat from './components/Seat.vue'
import Customer from './components/Customer.vue'
import Options from './components/Options.vue'
import CarBrand from './components/CarBrand.vue'
import Gearbox from './components/Gearbox.vue'
export default { export default {
components: { components: {
Popup, Popup,
...@@ -58,7 +124,14 @@ export default { ...@@ -58,7 +124,14 @@ export default {
DateTime, DateTime,
AgreementList, AgreementList,
DateTimeChange, DateTimeChange,
GoodsCategory GoodsCategory,
AgeRange,
City,
Seat,
Customer,
Options,
CarBrand,
Gearbox
}, },
name: '', name: '',
props: { props: {
...@@ -82,13 +155,15 @@ export default { ...@@ -82,13 +155,15 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
defaultTime: String defaultTime: String,
popupTitle: String
}, },
provide () { provide () {
return { return {
userInfo: this.userInfo, userInfo: this.userInfo,
baseConfigData: this.baseConfigData, baseConfigData: this.baseConfigData,
sceneType: this.sceneType
} }
}, },
data () { data () {
...@@ -129,14 +204,18 @@ export default { ...@@ -129,14 +204,18 @@ export default {
}, },
computed: { computed: {
title () { title () {
return config.componentConfig[this.popupType].title return this.popupTitle || config.componentConfig[this.popupType].title
}, },
userInfo () { userInfo () {
return uni.$storage.get("userInfo") return uni.$storage.get("userInfo")
}, },
baseConfigData () { baseConfigData () {
return this.$store.state.boutique.baseConfigData return this.$store.state.boutique.baseConfigData
} },
sceneType () {
const { sceneType } = uni.$storage.get('userInfo')
return sceneType
},
}, },
mounted () { mounted () {
}, },
...@@ -157,6 +236,7 @@ export default { ...@@ -157,6 +236,7 @@ export default {
this.$emit('close') this.$emit('close')
}, },
initPopupData () { initPopupData () {
this.chooseContent = null
let componentRef = this.componentRef() let componentRef = this.componentRef()
if (!componentRef) setTimeout(this.initPopupData, .1e3) if (!componentRef) setTimeout(this.initPopupData, .1e3)
else componentRef.getList && componentRef.getList(this.componentObject[this.popupType].searchValue) else componentRef.getList && componentRef.getList(this.componentObject[this.popupType].searchValue)
...@@ -169,27 +249,27 @@ export default { ...@@ -169,27 +249,27 @@ export default {
}) })
else componentRef.handleSearch(this.componentObject[this.popupType].searchValue) else componentRef.handleSearch(this.componentObject[this.popupType].searchValue)
}, },
confirm () { confirm (autoClose) {
try { try {
let { chooseContent, popupType, componentObject } = this let { chooseContent, popupType, componentObject } = this
if (popupType == 13 ) { if (popupType == 13) {
chooseContent = this.componentRef().getResult() chooseContent = this.componentRef().getResult()
} }
if(popupType == 15 ) { if (popupType == 15) {
this.$emit('onConfirm', { this.$emit('onConfirm', {
chooseContent, chooseContent,
popupType popupType
}) })
this.$refs.popup.close() if (!autoClose) this.$refs.popup.close()
return return
} }
if (chooseContent) { if (chooseContent != null) {
if (Array.isArray(chooseContent) && !chooseContent.length && componentObject[popupType].nullTips) throw componentObject[popupType].nullTips if (Array.isArray(chooseContent) && !chooseContent.length && componentObject[popupType].nullTips) throw componentObject[popupType].nullTips
this.$emit('onConfirm', { this.$emit('onConfirm', {
chooseContent, chooseContent,
popupType popupType
}) })
this.$refs.popup.close() if (!autoClose) this.$refs.popup.close()
} else { } else {
if (componentObject[popupType].nullTips) throw componentObject[popupType].nullTips if (componentObject[popupType].nullTips) throw componentObject[popupType].nullTips
} }
...@@ -217,7 +297,7 @@ export default { ...@@ -217,7 +297,7 @@ export default {
}, },
reset () { reset () {
let componentRef = this.componentRef() let componentRef = this.componentRef()
if (!componentRef) uni.showToast({ if (!componentRef) uni.showToast({
title: '请稍后再试', title: '请稍后再试',
icon: 'none' icon: 'none'
}) })
...@@ -310,6 +390,18 @@ export default { ...@@ -310,6 +390,18 @@ export default {
} }
.hide-search { .hide-search {
height: calc(100% - #{toRpx(280)}); height: calc(100% - #{toRpx(280)});
.popup-scroll-view {
padding-top: 0;
}
}
.hide-footer {
height: calc(100% - #{toRpx(184)});
}
.hide-footer-search {
height: calc(100% - #{toRpx(104)});
.popup-scroll-view {
padding-top: 0;
}
} }
.popup-footer { .popup-footer {
padding: toRpx(64) 0; padding: toRpx(64) 0;
...@@ -342,6 +434,11 @@ export default { ...@@ -342,6 +434,11 @@ export default {
justify-content: center; justify-content: center;
} }
} }
.car-popup {
.popup-box {
height: 90vh;
}
}
.right-box { .right-box {
width: 46vw; width: 46vw;
height: 100vh; height: 100vh;
......
<template>
<view class="list">
<view
v-for="(item, index) in options"
:key="index"
@click="selectOption(item)"
:class="['item flex', { active: currentId === item.value }]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{ item.label }}
</view>
</view>
</template>
<script>
export default {
name: 'CourseOptionList',
data() {
return {
currentId: '',
options: []
}
},
props: {
params: Object,
data: [Object, Array]
},
watch: {
currentId: {
handler(value) {
let { params: { idKey } } = this
this.$emit('choose', {
key: idKey,
value
})
},
deep: true
}
},
mounted() {
this.getList()
},
methods: {
getList() {
const { params } = this
this.options = params.options || []
// 初始化选中值
let { data, params: { idKey } } = this
if (data && data[idKey]) {
this.currentId = data[idKey]
}
this.$emit('onComplete')
},
selectOption(item) {
// 如果点击已选中的选项,则取消选中
if (this.currentId === item.value) {
this.currentId = ''
} else {
this.currentId = item.value
}
}
}
}
</script>
<style scoped lang='scss'>
.list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
const screenList = [
{
title: '选必修',
componentName: 'CourseOptionList',
params: {
idKey: 'planCourseType',
options: [
{ label: '必修', value: 1 },
{ label: '选修', value: 2 }
]
}
},
{
title: '课程类型',
componentName: 'CourseOptionList',
params: {
idKey: 'courseFileType',
options: [
{ label: '视频', value: 10 },
{ label: '音频', value: 80 },
{ label: '混合', value: 20 },
{ label: '文档', value: 30 },
{ label: 'H5', value: 40 },
{ label: 'URL', value: 70 },
{ label: '图文', value: 120 }
]
}
},
{
title: '评分',
componentName: 'CourseOptionList',
params: {
idKey: 'totalStar',
options: [
{ label: '4星以上', value: 8 },
{ label: '3星以上', value: 6 }
]
}
}
]
export default { screenList }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
cancelText="清除" cancelText="清除"
> >
<view class="popup-title flex"> <view class="popup-title flex">
工单筛选 {{ popupTitle }}
<view <view
class="popup-close flex" class="popup-close flex"
@click="close" @click="close"
...@@ -72,21 +72,31 @@ import EmployeeList from './components/EmployeeList.vue' ...@@ -72,21 +72,31 @@ import EmployeeList from './components/EmployeeList.vue'
import TimeList from './components/TimeList.vue' import TimeList from './components/TimeList.vue'
import OrderStatusList from './components/OrderStatusList.vue' import OrderStatusList from './components/OrderStatusList.vue'
import PayList from './components/PayList.vue' import PayList from './components/PayList.vue'
import CourseOptionList from './components/CourseOptionList.vue'
export default { export default {
components: { components: {
Popup, Popup,
EmployeeList, EmployeeList,
TimeList, TimeList,
OrderStatusList, OrderStatusList,
PayList PayList,
CourseOptionList
}, },
name: 'OrderScreen', name: 'OrderScreen',
props: { props: {
configData: {
type: Object,
default: null
},
title: {
type: String,
default: '工单筛选'
}
}, },
data () { data () {
return { return {
screenList: config.screenList, screenList: this.configData ? this.configData.screenList : config.screenList,
chooseContent: {}, chooseContent: {},
viewKey: Date.now(), viewKey: Date.now(),
onCompleteNum: 0 onCompleteNum: 0
...@@ -99,6 +109,9 @@ export default { ...@@ -99,6 +109,9 @@ export default {
} }
}, },
computed: { computed: {
popupTitle() {
return this.title
},
userInfo () { userInfo () {
return uni.$storage.get("userInfo") return uni.$storage.get("userInfo")
}, },
......
<template>
<view class="list">
<view @click="currentId = ''" :class="['item flex', { active: !currentId }]">
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view :key="index" @click="currentId = i.value" :class="['item flex', { active: currentId == i.value }]">
<view class="sprite-icon icon-tag-checked"></view>
{{ i.name }}
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
export default {
name: 'ContractList',
inject: ['userInfo'],
data () {
return {
list: [],
currentId: '',
// 合同协议状态数据
zyPayStatus: [{
name: '待上传',
value: '1'
}, {
name: '已上传',
value: '2'
}],
}
},
props: {
params: Object,
data: [Object, Array],
},
watch: {
currentId: {
handler (value) {
let { params: { idKey } } = this
this.$emit('choose', {
key: idKey,
value
})
},
deep: true
}
},
mounted () {
this.initList(this.zyPayStatus)
},
methods: {
initList (list) {
this.list = list
let { data, params: { idKey } } = this
this.currentId = data[idKey]
this.$emit('onComplete')
},
}
}
</script>
<style scoped lang="scss">
.list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.splice {
color: #333333;
font-size: toRpx(32);
margin: 0 toRpx(8);
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
<template>
<view class="list">
<view
v-for="(item, index) in options"
:key="index"
@click="selectOption(item)"
:class="['item flex', { active: currentId === item.value }]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{ item.label }}
</view>
</view>
</template>
<script>
export default {
name: 'CourseOptionList',
data() {
return {
currentId: '',
options: []
}
},
props: {
params: Object,
data: [Object, Array]
},
watch: {
currentId: {
handler(value) {
let { params: { idKey } } = this
this.$emit('choose', {
key: idKey,
value
})
},
deep: true
}
},
mounted() {
this.getList()
},
methods: {
getList() {
const { params } = this
this.options = params.options || []
// 初始化选中值
let { data, params: { idKey } } = this
if (data && data[idKey]) {
this.currentId = data[idKey]
}
this.$emit('onComplete')
},
selectOption(item) {
// 如果点击已选中的选项,则取消选中
if (this.currentId === item.value) {
this.currentId = ''
} else {
this.currentId = item.value
}
}
}
}
</script>
<style scoped lang='scss'>
.list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
<template>
<view class="employee-list">
<view @click="currentIds = []" :class="['item flex', { active: !currentIds.length }]">
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view :key="index" @click="choose(i)" :class="['item flex', { active: checkActive(i) }]">
<view class="sprite-icon icon-tag-checked"></view>
{{ i.staffName }}
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
export default {
name: 'EmployeeList',
inject: ['userInfo'],
data () {
return {
list: [],
currentIds: []
}
},
props: {
params: Object,
data: [Array, Object],
},
watch: {
currentIds: {
handler (val) {
let { params: { idKey } } = this
this.$emit('choose', {
key: idKey,
value: val.length ? val : null
})
},
deep: true
}
},
mounted () {
this.getList()
},
methods: {
async getList () {
const { userInfo, params } = this,
{ cacheData } = params
if (cacheData && cacheData.length) {
this.initList(cacheData)
return
}
const { shopMerchantId, sceneType, merchantId } = userInfo,
data = await uni.$api.popupApi.getOrderScreenEmployeeList({
merchantId: params.idKey == 'transferIds' ? merchantId : shopMerchantId,
sceneList: params.idKey == 'transferIds' ? '' : [sceneType]
})
if (data && data.length) {
this.initList(data)
params.cacheData = data
this.$emit('update:params', params)
}
},
initList (list) {
let { data, params: {idKey} } = this
this.list = list
let paramsData = idKey ? data[idKey] : data
if (paramsData && paramsData.length) paramsData.map(e => {
this.currentIds.push(e)
})
this.$emit('onComplete')
},
choose (i) {
if (i) {
let { uuid } = i,
{ currentIds } = this,
index = currentIds.indexOf(uuid)
if (index == -1) this.currentIds.push(uuid)
else this.currentIds.splice(index, 1)
}
},
checkActive (i) {
let { currentIds } = this,
active = false
if (currentIds.length) active = currentIds.includes(i.uuid)
return active
// return this.currentIds.includes(i.uuid)
},
}
}
</script>
<style scoped lang="scss">
.employee-list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
<template>
<view class="list">
<view @click="currentId = ''" :class="['item flex', { active: !currentId }]">
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view :key="index" @click="currentId = i.id" :class="['item flex', { active: currentId == i.id }]">
<view class="sprite-icon icon-tag-checked"></view>
{{ i.name }}
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
export default {
name: 'OrderStatusList',
inject: ['userInfo'],
data () {
return {
// 订单状态 (0待报价、1待确认、2待支付、3已支付、5已完成、6已退款、9已撤销、11错误订单、-1战败)
list: Object.freeze([
{
name: '待报价',
value: 0,
id: 1
},
// {
// name: '待确认',
// value: 1,
// id: 2
// },
{
name: '待支付',
value: 2,
id: 3
},
{
name: '已支付',
value: 3,
id: 4
},
{
name: '已完成',
value: 5,
id: 5
},
{
name: '已退款',
value: 6,
id: 6
},
{
name: '已撤销',
value: 9,
id: 7
},
{
name: '错误订单',
value: 11,
id: 8
},
{
name: '战败',
value: -1,
id: 11
}
]),
currentId: '',
}
},
props: {
params: Object,
data: [Array, Object],
},
watch: {
currentId: {
handler (val) {
let { params: { idKey } } = this,
{ list } = this,
item = list.find(item => item.id == val)
this.$emit('choose', {
key: idKey,
value: item ? item.value : null
})
},
deep: true
}
},
mounted () {
this.initList()
},
methods: {
initList () {
let { data, params: { idKey }, list } = this
console.log(data, idKey ,'32938928392')
if (data[idKey] !== undefined && data[idKey] !== null && data[idKey] !== '') {
let item = list.find(val => val.value == data[idKey])
this.currentId = item ? item.id : ''
}
this.$emit('onComplete')
}
}
}
</script>
<style scoped lang="scss">
.list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.splice {
color: #333333;
font-size: toRpx(32);
margin: 0 toRpx(8);
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
<template>
<view class="list">
<view
@click="currentId = ''"
:class="['item flex',{active:!currentId}]"
>
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view
:key="index"
@click="currentId = i.value"
:class="['item flex',{active:currentId == i.value}]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{i.name}}
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
const payTypeList = [{
name: '门店收款',
value: 2
},
{
name: '微信支付',
value: 1
},
{
name: 'POS机支付',
value: 3
},
{
name: '支付宝支付',
value: 4
},
{
name: '嘀加收款',
value: 5
}
]
export default {
name: 'PayList',
inject: ['userInfo'],
data () {
return {
list: [],
currentId: '',
}
},
props: {
params: Object,
data: [Object, Array],
},
watch: {
currentId: {
handler (value) {
let { params: { idKey } } = this
this.$emit('choose', {
key: idKey,
value
})
},
deep: true
}
},
mounted () {
this.getList()
},
methods: {
async getList () {
const { userInfo, params } = this,
{ cacheData } = params
if (cacheData && cacheData.length) {
this.initList(cacheData)
return
}
const { merchantId } = userInfo,
data = await uni.$api.popupApi.getYqStoreConfig({
yqMerchantId: merchantId
})
if (data) {
let obj = data || {}
let m = obj.supportPayTypes || []
let n = JSON.parse(JSON.stringify(payTypeList))
let payList = n.filter(k => {
let idx = m.find(j => j == k.value)
return idx >= 0
})
payList = [
...payList,
{
name: '对公转账',
value: '6'
},
{
name: '其它收款',
value: '7'
}
]
this.initList(payList)
params.cacheData = payList
this.$emit('update:params', params)
}
},
initList (list) {
this.list = list
let { data, params: { idKey } } = this
this.currentId = data[idKey]
this.$emit('onComplete')
},
}
}
</script>
<style scoped lang='scss'>
.list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.splice {
color: #333333;
font-size: toRpx(32);
margin: 0 toRpx(8);
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="list">
<view
@click="currentId = ''"
:class="['item flex',{active:!currentId}]"
>
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i.id)"
:class="['item flex',{active:currentId == i.id}]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{i.name}}
</view>
</template>
<template v-if="currentId == 3 && customDate.startDate && customDate.endDate">
<view
class="calendar flex"
@click="$refs.calendar.open()"
>
<view class="item flex active">
{{customDate.startDate}}
</view>
<view class="splice">-</view>
<view class="item flex active">
{{customDate.endDate}}
</view>
</view>
</template>
<template v-else>
<view
@click="$refs.calendar.open()"
:class="['item flex']"
>
自定义
</view>
</template>
<uni-calendar
ref="calendar"
:insert="false"
range
:clearDate="false"
startDate="2020-10-01"
:endDate="endDate"
@confirm="confirmCalendar"
:rangeValue="rangeValue"
hideMask
showBottomBtn
/>
</view>
</template>
<script type='text/ecmascript-6'>
import dayjs from 'dayjs'
export default {
name: 'TimeList',
inject: ['userInfo'],
data () {
return {
list: Object.freeze([
{
name: '今日',
startDate: dayjs().format('YYYY-MM-DD'),
endDate: dayjs().format('YYYY-MM-DD'),
id: 1
}, {
name: '本月',
startDate: dayjs().startOf('month').format('YYYY-MM-DD'),
endDate: dayjs().format('YYYY-MM-DD'),
id: 2
}
]),
currentId: '',
endDate: dayjs().format('YYYY-MM-DD'),
customDate: {
startDate: '',
endDate: ''
},
rangeValue: {}
}
},
props: {
params: Object,
data: [Array, Object],
},
watch: {
currentId: {
handler (val) {
let { params: { idKey, currentIdKey } } = this
let { list } = this,
value = {}
if (val) {
let [startDateName, endDateName] = idKey
if (val == 3) {
value = {
[startDateName]: this.customDate.startDate,
[endDateName]: this.customDate.endDate
}
} else {
let item = list.find(e => e.id == val)
value = {
[startDateName]: item.startDate,
[endDateName]: item.endDate
}
}
}
this.$emit('choose', {
currentIdKey,
currentId: val,
keys: idKey,
value
})
},
deep: true
}
},
mounted () {
this.initList()
},
methods: {
async initList () {
let { data, params: { idKey, currentIdKey } } = this
if (data[currentIdKey] == 3) {
this.customDate = {
startDate: data[idKey[0]],
endDate: data[idKey[1]]
}
this.rangeValue = {
before: data[idKey[0]],
after: data[idKey[1]]
}
}
this.currentId = data[currentIdKey]
this.$emit('onComplete')
},
choose (i) {
this.currentId = i
},
confirmCalendar ({range}) {
let { data } = range
this.customDate = {
startDate: data[0] || dayjs().format('YYYY-MM-DD'),
endDate: data[data.length - 1] || dayjs().format('YYYY-MM-DD')
}
this.rangeValue = range
if (this.currentId == 3) {
let { params: { idKey } } = this,
[startDateName, endDateName] = idKey
this.$emit('choose', {
currentId: 3,
keys: idKey,
value: {
[startDateName]: this.customDate.startDate,
[endDateName]: this.customDate.endDate
}
})
} else this.currentId = 3
}
}
}
</script>
<style scoped lang='scss'>
.list {
display: flex;
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
width: toRpx(348);
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.splice {
color: #333333;
font-size: toRpx(32);
margin: 0 toRpx(8);
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
const screenList = [
{
title: '转化人员',
suffix: 'merchantName',
componentName: 'EmployeeList',
params: {
cacheData: [],
idKey: 'transferIds'
},
hasToggle: true,
toggle: false
},
{
title: '销售顾问',
suffix: 'shopMerchantName',
componentName: 'EmployeeList',
params: {
cacheData: [],
idKey: 'referrerIds'
},
hasToggle: true,
toggle: false
},
{
title: '订单时间',
componentName: 'TimeList',
params: {
idKey: ['minCreateTime', 'maxCreateTime'],
currentIdKey: 'orderTimeId'
}
},
{
title: '支付时间',
componentName: 'TimeList',
params: {
idKey: ['minPayTime', 'maxPayTime'],
currentIdKey: 'payTimeId'
}
},
{
title: '订单状态',
componentName: 'OrderStatusList',
params: {
idKey: 'orderStatus'
}
},
{
title: '支付方式',
componentName: 'PayList',
params: {
idKey: 'payType'
}
},
{
title: '合同协议',
componentName: 'ContractList',
params: {
idKey: 'zyPayStatus'
}
}
]
export default { screenList }
const screenList = [
{
title: '选必修',
componentName: 'CourseOptionList',
params: {
idKey: 'required',
options: [
{ label: '必修', value: 'required' },
{ label: '选修', value: 'optional' }
]
}
},
{
title: '课程类型',
componentName: 'CourseOptionList',
params: {
idKey: 'courseType',
options: [
{ label: '视频', value: 'video' },
{ label: '文档', value: 'document' }
]
}
},
{
title: '评分',
componentName: 'CourseOptionList',
params: {
idKey: 'rating',
options: [
{ label: '4星以上', value: '4' },
{ label: '3星以上', value: '3' }
]
}
}
]
export default { screenList }
<template>
<popup ref="popup" @onConfirm="confirm" @onCancel="clear" cancelText="清除">
<view class="popup-title flex">
{{ popupTitle }}
<view class="popup-close flex" @click="close">
<uni-icons type="closeempty" size="16"></uni-icons>
</view>
</view>
<view class="popup-body" :key="viewKey">
<scroll-view scroll-y :class="['popup-scroll-view', { 'popup-show': loadComplete }]">
<template v-for="(i, index) in screenList">
<view class="item-box" :key="index">
<view class="title flex">
{{ i.title }}
<template v-if="i.suffix">({{ userInfo[i.suffix] }})</template>
<template v-if="i.hasToggle">
<view class="toggle-btn" @click="i.toggle = !i.toggle">{{ i.toggle ? '收起' : '展开' }}</view>
</template>
</view>
<view :class="['box', { fold: i.hasToggle }, { show: i.toggle }]">
<component :ref="`${i.componentName}_${index}`" :is="i.componentName" :params.sync="i.params" @choose="choose" :data="chooseContent" @onComplete="onComplete" :key="componentKey" />
</view>
</view>
</template>
</scroll-view>
<image v-if="!loadComplete" class="loading" src="../../assets/images/common/loadding.gif" />
</view>
</popup>
</template>
<script type="text/ecmascript-6">
import Popup from '@/components/Popup.vue'
import config from './config'
import EmployeeList from './components/EmployeeList.vue'
import TimeList from './components/TimeList.vue'
import OrderStatusList from './components/OrderStatusList.vue'
import PayList from './components/PayList.vue'
import CourseOptionList from './components/CourseOptionList.vue'
import ContractList from './components/ContractList.vue'
export default {
components: {
Popup,
EmployeeList,
TimeList,
OrderStatusList,
PayList,
CourseOptionList,
ContractList
},
name: 'OrderScreen',
props: {
configData: {
type: Object,
default: null
},
title: {
type: String,
default: '工单筛选'
}
},
data() {
return {
screenList: this.configData ? this.configData.screenList : config.screenList,
chooseContent: {},
viewKey: Date.now(),
componentKey: Date.now(),
onCompleteNum: 0
}
},
provide() {
return {
userInfo: this.userInfo,
}
},
computed: {
popupTitle() {
return this.title
},
userInfo() {
return uni.$storage.get("userInfo")
},
loadComplete() {
return this.onCompleteNum == this.screenList.length
}
},
mounted() {
},
methods: {
open(data) {
console.log('open', data)
const { orderStatus } =data
if(orderStatus !== undefined && orderStatus !== null && orderStatus !== '') {
this.$set(this.chooseContent, 'orderStatus', orderStatus)
}
this.$refs.popup.open()
},
clear() {
this.chooseContent = {}
// 检查是否有 transferIds 字段配置,如果有则设置为当前用户的 uuid
const hasTransferIds = this.screenList.some(item => {
return item.params && item.params.idKey === 'transferIds'
})
if (hasTransferIds) {
const localUserInfo = uni.$storage.get('userInfo') || {}
console.log('localUserInfo', localUserInfo)
this.chooseContent.transferIds = [localUserInfo.uuid] || []
}
this.viewKey = Date.now()
},
close() {
this.$refs.popup.close()
},
choose(i) {
let { key, value, keys, currentIdKey, currentId } = i;
console.log('choose', key, value)
let updatedChooseContent = { ...this.chooseContent };
let needRefresh = false;
// 有订单状态,将合同协议状态置为全部
if (key == 'orderStatus' && (value || value== 0)) {
if (updatedChooseContent.zyPayStatus !== undefined) {
this.$delete(updatedChooseContent, 'zyPayStatus')
needRefresh = true
}
}
// 有合同协议状态时,将订单状态置为全部
if (key == 'zyPayStatus' && value) {
if (updatedChooseContent.orderStatus !== undefined) {
this.$delete(updatedChooseContent, 'orderStatus')
needRefresh = true
}
}
if (keys) {
if (currentIdKey) this.$set(updatedChooseContent, currentIdKey, currentId || '')
keys.map(e => {
if (value[e] !== undefined && value[e] !== null && value[e] !== '') this.$set(updatedChooseContent, e, value[e])
else this.$delete(updatedChooseContent, e)
})
} else {
if (value !== undefined && value !== null && value !== '') this.$set(updatedChooseContent, key, value)
else this.$delete(updatedChooseContent, key)
}
this.chooseContent = updatedChooseContent;
console.log('chooseContent',this.chooseContent)
if (needRefresh) {
this.componentKey = Date.now()
}
},
confirm() {
let chooseContent = JSON.parse(JSON.stringify(this.chooseContent))
delete chooseContent.payTimeId
delete chooseContent.orderTimeId
Object.keys(chooseContent).map(e => {
if (e == 'placeOrderStartDateStr' || e == 'installUpgradeBeginTimeStr' || e== 'minCreateTime'|| e== 'minPayTime') chooseContent[e] = `${chooseContent[e]} 00:00:00`
if (e == 'placeOrderEndDateStr' || e == 'installUpgradeEndTimeStr' || e== 'maxCreateTime'|| e== 'maxPayTime') chooseContent[e] = `${chooseContent[e]} 23:59:59`
})
this.$emit('onConfirm', chooseContent)
this.close()
},
onComplete() {
console.log('complete',this.chooseContent)
if (this.onCompleteNum == this.screenList.length) return
this.onCompleteNum += 1
}
}
}
</script>
<style scoped lang="scss">
.popup-box {
border-radius: toRpx(32) toRpx(32) 0 0;
background: #ffffff;
height: 70vh;
.popup-title {
height: toRpx(104);
justify-content: center;
position: relative;
color: #333333;
font-size: toRpx(36);
font-weight: 500;
.popup-close {
position: absolute;
height: 100%;
top: 0;
right: 0;
padding: 0 toRpx(48);
font-weight: 400;
color: #1a1a1a;
}
}
.popup-tips {
color: #999ea8;
font-size: toRpx(28);
padding-left: toRpx(48);
}
.popup-body {
height: calc(100% - #{toRpx(312)});
position: relative;
.popup-scroll-view {
opacity: 0;
height: 100%;
padding-top: toRpx(8);
.item-box {
margin-bottom: toRpx(32);
.title {
color: #888888;
font-size: toRpx(28);
height: toRpx(40);
background: #f5f7fa;
padding-left: toRpx(48);
margin-bottom: toRpx(16);
line-height: toRpx(40);
.toggle-btn {
margin-left: auto;
padding: 0 toRpx(48);
color: #4673ff;
font-size: toRpx(24);
}
}
.box {
overflow: hidden;
}
.fold {
height: toRpx(72);
}
.show {
height: auto !important;
}
}
}
.popup-show {
opacity: 1;
}
.loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: toRpx(64);
height: toRpx(64);
}
.show {
opacity: 1;
}
}
}
</style>
<template> <template>
<uni-popup ref="popup" :type="position" :is-mask-click="maskClick" :animation="animation"> <uni-popup ref="popup" :type="position" :is-mask-click="maskClick" :animation="animation">
<view :class="['popup-box', { 'right-box': position == 'right' }]"> <view :class="['popup-box', { 'right-box': position == 'right' }]" :style="popupStyle">
<slot></slot> <slot></slot>
<view class="popup-footer flex" v-if="showReset"> <template v-if="!hideFooter">
<view class="popup-btn-three popup-cancel" @click="cancel">{{ cancelText }}</view> <view class="popup-footer flex" v-if="showReset">
<view class="popup-btn-three popup-reset" @click="reset">{{ resetText }}</view> <view class="popup-btn-three popup-cancel" @click="cancel">{{ cancelText }}</view>
<view class="popup-btn-three popup-confirm" @click="confirm">{{ confirmText }}</view> <view class="popup-btn-three popup-reset" @click="reset">{{ resetText }}</view>
</view> <view class="popup-btn-three popup-confirm" @click="confirm">{{ confirmText }}</view>
<view class="popup-footer flex" v-else> </view>
<view class="popup-btn popup-cancel" @click="cancel">{{ cancelText }}</view> <view class="popup-footer flex" v-else>
<view class="popup-btn popup-confirm" @click="confirm">{{ confirmText }}</view> <view class="popup-btn popup-cancel" @click="cancel">{{ cancelText }}</view>
</view> <view class="popup-btn popup-confirm" @click="confirm">{{ confirmText }}</view>
</view>
</template>
</view> </view>
</uni-popup> </uni-popup>
</template> </template>
...@@ -47,7 +49,12 @@ export default { ...@@ -47,7 +49,12 @@ export default {
showReset: { showReset: {
type: Boolean, type: Boolean,
default: false default: false
} },
popupStyle: {
type: String,
default: ''
},
hideFooter:Boolean
}, },
......
<template> <template>
<view class="select-box"> <view :class="['select-box',{styleV2:styleV2},{'disabled':disabled}]">
<view <view
class="select" class="select"
@click.stop="isSelect = !isSelect" @click.stop="showPop"
> >
{{selectList[selectIndex].label}} {{selectValue}}
<view class="sprite-icon icon-arrow-bottom"></view> <template v-if="!disabled">
<view class="sprite-icon icon-arrow-bottom"></view>
</template>
</view> </view>
<view <view
class="pop-box" class="pop-box"
...@@ -29,6 +31,38 @@ export default { ...@@ -29,6 +31,38 @@ export default {
labelKey: { labelKey: {
type: String, type: String,
default: 'label' default: 'label'
},
styleV2: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
},
defaultValue: [String, Number],
valueKey: {
type: String,
default: 'value'
}
},
computed: {
selectValue () {
let { selectList, selectIndex, labelKey } = this
if (selectIndex == -1) selectIndex = 0
return selectList[selectIndex][labelKey]
}
},
watch: {
defaultValue: {
immediate: true,
deep: true,
handler (n) {
let { selectList, valueKey } = this,
selectIndex = selectList.findIndex(e => e[valueKey] == n)
if (selectIndex == -1) selectIndex = 0
this.selectIndex = selectIndex
}
} }
}, },
name: '', name: '',
...@@ -49,6 +83,10 @@ export default { ...@@ -49,6 +83,10 @@ export default {
this.isSelect = false this.isSelect = false
this.$emit('chooseType', { item, index }) this.$emit('chooseType', { item, index })
}, },
showPop () {
if (this.disabled) return
this.isSelect = !this.isSelect
}
} }
} }
</script> </script>
...@@ -96,4 +134,24 @@ export default { ...@@ -96,4 +134,24 @@ export default {
} }
} }
} }
.styleV2 {
.select {
height: toRpx(80);
background: #3b73ff1a;
color: #333333;
font-size: toRpx(28);
transition: all 0.15s;
}
.pop-box {
font-size: toRpx(28);
.type-item {
height: toRpx(80);
}
}
}
.disabled {
.select {
padding: 0 toRpx(40);
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="study-permission-popup-wrapper">
<!-- 标题 -->
<view class="popup-title">未完成学习任务,暂不能开单</view>
<!-- 第一段描述 -->
<view class="description-text">
优秀的技能是您接单的通行证,磨刀不误砍柴工,您的专业能力是赢得客户信任的关键。
</view>
<!-- 第二段描述(橙色) -->
<view class="highlight-text">
<template v-if="lockReason == '0'">
到学习中心-我的课程-待学习,完成课程学习后,即可解锁开单权限。
</template>
<template v-if="lockReason == '1'">
到学习中心-我的任务,完成长课程学习任务后,即可解锁开单权限。
</template>
</view>
<!-- 第三段描述 -->
<view class="tip-text">
只差一步即可开启您的接单之旅!
</view>
<!-- 按钮 -->
<view class="goto-button" @click="handleGoToStudy">
去往学习中心
</view>
</view>
</template>
<script>
export default {
props: {
lockReason: {
type: String,
default: '0'
}
},
name: 'StudyCenterPermissionPopup',
methods: {
handleGoToStudy() {
this.$emit('confirm')
}
}
}
</script>
<style lang="scss" scoped>
.study-permission-popup-wrapper {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: toRpx(48);
}
.popup-title {
height: toRpx(48);
color: #333333;
font-size: toRpx(40);
font-weight: 500;
font-family: "HarmonyOSSansSC";
text-align: center;
margin-bottom: toRpx(40);
}
.description-text {
width: toRpx(720);
min-height: toRpx(96);
color: #6c6f75;
font-size: toRpx(32);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(48);
margin-bottom: toRpx(40);
}
.highlight-text {
background-color: #FEF5EA;
padding: toRpx(8) toRpx(32);
border-radius: toRpx(8);
width: toRpx(720);
min-height: toRpx(104);
color: #ff9d0a;
font-size: toRpx(32);
font-weight: 400;
text-align: center;
line-height: toRpx(52);
margin-bottom: toRpx(64);
}
.tip-text {
width: toRpx(420);
height: toRpx(34);
color: #6c6f75;
font-size: toRpx(28);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
margin-bottom: toRpx(16);
}
.goto-button {
width: toRpx(704);
height: toRpx(80);
border-radius: toRpx(48);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #ffffff;
font-size: toRpx(28);
font-weight: 500;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(80);
// margin-bottom: toRpx(48);
margin-top: auto;
&:active {
opacity: 0.8;
}
}
</style>
<!-- 开始学习之旅 -->
<template>
<view v-if="show" class="study-popup-mask" @click="handleMaskClick">
<view
class="study-popup-content"
:style="contentStyle"
@click.stop
>
<!-- 顶部图片 -->
<image
v-if="topImage"
class="top-image"
:src="topImage"
:style="topImageStyle"
/>
<view v-if="closeButton" @click.stop="closePopup">
<view class="sprite-icon icon-evaluationClose"></view>
</view>
<!-- 标题 -->
<view v-if="title" class="popup-title">{{ title }}</view>
<!-- 内容区域 - 默认插槽 -->
<view class="popup-body">
<slot></slot>
</view>
<!-- 底部按钮插槽 -->
<slot name="footer"></slot>
</view>
</view>
</template>
<script>
export default {
name: 'StudyPopup',
props: {
show: {
type: Boolean,
default: false
},
width: {
type: [Number, String],
default: 848
},
height: {
type: [Number, String],
default: 1054
},
title: {
type: String,
default: ''
},
topImage: {
type: String,
default: ''
},
topImageWidth: {
type: [Number, String],
default: 848
},
topImageHeight: {
type: [Number, String],
default: 248
},
maskClosable: {
type: Boolean,
default: false
},
closeButton: {
type: Boolean,
default: false
}
},
computed: {
contentStyle() {
return {
width: this.formatSize(this.width),
minHeight: this.formatSize(this.height)
}
},
topImageStyle() {
return {
width: this.formatSize(this.topImageWidth),
height: this.formatSize(this.topImageHeight)
}
}
},
methods: {
formatSize(size) {
return typeof size === 'number' ? `${size}rpx` : size
},
handleMaskClick() {
if (this.maskClosable) {
this.close()
}
},
close() {
this.$emit('update:show', false)
this.$emit('close')
},
closePopup() {
this.close()
}
}
}
</script>
<style lang="scss" scoped>
.study-popup-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
.study-popup-content {
background: #FFFFFF;
border-radius: toRpx(48);
display: flex;
flex-direction: column;
align-items: center;
position: relative;
max-height: toRpx(740);
overflow-y: auto;
}
.sprite-icon {
top: toRpx(48);
right: toRpx(48);
position: absolute;
}
.top-image {
width: 100%;
display: block;
margin-bottom: toRpx(48);
flex-shrink: 0;
border-radius: toRpx(20) toRpx(20) 0 0;
}
.popup-title {
font-size: toRpx(40);
font-weight: 500;
letter-spacing: 0;
line-height: toRpx(46.88);
color: rgba(51, 51, 51, 1);
text-align: center;
margin-bottom: toRpx(48);
padding: 0 toRpx(32);
}
.popup-body {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
padding: 0 toRpx(32);
}
</style>
<template>
<view class="study-popup-content-wrapper">
<!-- 内容卡片 -->
<view class="content-card">
<!-- 卡片标题 -->
<view v-if="cardTitle" class="card-title">{{ cardTitle }}</view>
<!-- 主要描述文本 -->
<view v-if="description" class="description-text">{{ description }}</view>
<!-- 列表项 -->
<view v-if="listItems && listItems.length" class="list-wrapper">
<view
v-for="(item, index) in listItems"
:key="index"
class="list-item"
>
<view class="dot"></view>
<view class="list-text">{{ item }}</view>
</view>
</view>
<!-- 自定义内容插槽 -->
<slot></slot>
</view>
<!-- 提示文本 -->
<view v-if="tipText" class="tip-text">
请先完成 <text class="highlight"> 【 {{ courseName }} 】</text>考试测评后会推送适合您的课程
</view>
<!-- 按钮 -->
<view class="button-group">
<view class="cancel-button" @click="handleCancel">
暂不测评
</view>
<view v-if="buttonText" class="action-button" @click="handleButtonClick">
{{ buttonText }}
</view>
</view>
</view>
</template>
<script>
export default {
name: 'StudyPopupContent',
props: {
cardTitle: {
type: String,
default: ''
},
description: {
type: String,
default: ''
},
listItems: {
type: Array,
default: () => []
},
tipText: {
type: String,
default: ''
},
courseName: {
type: String,
default: 'XXX'
},
buttonText: {
type: String,
default: ''
}
},
methods: {
handleButtonClick() {
this.$emit('button-click')
},
handleCancel() {
this.$emit('cancel')
}
}
}
</script>
<style lang="scss" scoped>
.study-popup-content-wrapper {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.content-card {
width: toRpx(720);
opacity: 1;
border-radius: toRpx(20);
background: rgba(247, 248, 250, 1);
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
padding: toRpx(32) toRpx(40);
box-sizing: border-box;
}
.card-title {
font-size: toRpx(32);
font-weight: 500;
letter-spacing: 0;
line-height: toRpx(40);
color: rgba(41, 45, 51, 1);
text-align: left;
margin-bottom: toRpx(16);
}
.description-text {
width: toRpx(640);
font-size: toRpx(28);
font-weight: 400;
letter-spacing: 0;
line-height: toRpx(48);
color: rgba(108, 111, 117, 1);
}
.list-wrapper {
width: 100%;
margin-top: toRpx(16);
}
.list-item {
display: flex;
align-items: flex-start;
&:last-child {
margin-bottom: 0;
}
}
.dot {
width: toRpx(8);
height: toRpx(8);
border-radius: 50%;
background: rgba(108, 111, 117, 1);
margin-top: toRpx(18);
margin-right: toRpx(12);
flex-shrink: 0;
}
.list-text {
flex: 1;
font-size: toRpx(32);
font-weight: 400;
letter-spacing: 0;
line-height: toRpx(52);
color: rgba(108, 111, 117, 1);
}
.tip-text {
width: toRpx(720);
font-size: toRpx(28);
font-weight: 500;
letter-spacing: 0;
line-height: toRpx(32.82);
color: rgba(108, 111, 117, 1);
margin-top: toRpx(56);
text-align: center;
.highlight {
color: rgba(59, 115, 255, 1);
}
}
.button-group {
display: flex;
align-items: center;
justify-content: center;
gap: toRpx(16);
margin-top: auto;
}
.cancel-button {
width: toRpx(344);
height: toRpx(80);
border-radius: toRpx(64);
background: #f0f1f5;
color: #1a1a1a;
font-size: toRpx(28);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(80);
}
.action-button {
width: toRpx(360);
height: toRpx(80);
border-radius: toRpx(48);
background: linear-gradient(180deg, rgba(44, 102, 247, 1) 0%, rgba(72, 166, 255, 1) 100%);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-top: toRpx(16);
font-size: toRpx(28);
font-weight: 500;
letter-spacing: 0;
line-height: toRpx(40);
color: rgba(255, 255, 255, 1);
text-align: center;
cursor: pointer;
&:active {
opacity: 0.8;
}
}
</style>
<template>
<view class="two-level-select-box">
<view class="select" @click.stop="toggleSelect">
{{ currentLabel }}
<view class="sprite-icon icon-arrow-bottom"></view>
</view>
<view class="pop-box" v-if="isSelect">
<view class="first-level-box ">
<view v-for="(item, index) in selectList" :key="index" class="type-item flex" :class="getItemClass(index, item)"
@click="chooseFirstLevel(index, item)">
<view class="item-label">{{ item[labelKey] }}</view>
</view>
</view>
<view class="second-level-box" v-if="showSecondLevel && currentFirstLevel && currentFirstLevel.children && currentFirstLevel.children.length">
<view v-for="(child, childIndex) in currentFirstLevel.children" :key="childIndex" class="type-item flex"
:class="childIndex === selectSecondIndex ? 'active' : ''" @click.stop="chooseSecondLevel(childIndex, child)">
{{ child[labelKey] }}
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
selectList: Array,
labelKey: {
type: String,
default: 'label'
}
},
name: 'TwoLevelSelectComponent',
data() {
return {
selectFirstIndex: 0,
selectSecondIndex: -1,
isSelect: false,
showSecondLevel: false,
currentFirstLevel: null
}
},
watch: {
selectList: {
immediate: true,
handler (n) {
if (Array.isArray(n) && n.length) {
this.selectFirstIndex = 0
this.currentFirstLevel = n[0]
if (this.currentFirstLevel.children && this.currentFirstLevel.children.length) {
this.showSecondLevel = true
const idx = this.currentFirstLevel.children.findIndex(c => c[this.labelKey] === '全部')
this.selectSecondIndex = idx !== -1 ? idx : 0
} else {
this.showSecondLevel = false
this.selectSecondIndex = -1
}
}
}
}
},
computed: {
currentLabel() {
const firstItem = this.selectList[this.selectFirstIndex]
if (!firstItem) return ''
// 如果有选中的二级分类
if (this.selectSecondIndex >= 0 && firstItem.children && firstItem.children[this.selectSecondIndex]) {
console.log(111111)
const child = firstItem.children[this.selectSecondIndex]
const childLabel = child[this.labelKey]
if (childLabel === '全部') return firstItem[this.labelKey]
return childLabel
}
// 否则显示一级分类
return firstItem[this.labelKey]
}
},
methods: {
getItemClass(index, item) {
const classes = []
if (index === this.selectFirstIndex) {
classes.push('active')
}
if (item.children && item.children.length) {
classes.push('has-children')
}
return classes.join(' ')
},
hideSelect() {
this.isSelect = false
},
toggleSelect() {
this.isSelect = !this.isSelect
if (this.isSelect && this.currentFirstLevel && this.currentFirstLevel.children && this.currentFirstLevel.children.length) {
this.showSecondLevel = true
}
},
chooseFirstLevel(index, item) {
// 如果有二级菜单,显示二级菜单
if (item.children && item.children.length) {
this.currentFirstLevel = item
this.selectFirstIndex = index
this.showSecondLevel = true
const idx = item.children.findIndex(c => c[this.labelKey] === '全部')
this.selectSecondIndex = idx !== -1 ? idx : 0
if(item.children.length === 1 && item.children[0][this.labelKey] === '全部') {
this.isSelect = false
this.$emit('chooseType', { item, index, level: 1 })
}
} else {
// 没有二级菜单,直接选中
this.selectFirstIndex = index
this.selectSecondIndex = -1
this.isSelect = false
this.$emit('chooseType', { item, index, level: 1 })
}
},
chooseSecondLevel(childIndex, child) {
this.selectSecondIndex = childIndex
this.isSelect = false
const isAll = child && child[this.labelKey] === '全部'
if (isAll) {
this.$emit('chooseType', {
item: this.currentFirstLevel,
index: this.selectFirstIndex,
level: 1
})
} else {
this.$emit('chooseType', {
item: child,
index: childIndex,
parentIndex: this.selectFirstIndex,
parent: this.currentFirstLevel,
level: 2
})
}
}
}
}
</script>
<style scoped lang='scss'>
.two-level-select-box {
position: relative;
z-index: 5;
.select {
display: flex;
align-items: center;
justify-content: flex-end;
height: toRpx(84);
border-radius: toRpx(16);
opacity: 1;
background: #f2f2f2;
padding: 0 toRpx(24) 0 toRpx(40);
}
.pop-box {
position: absolute;
top: toRpx(100);
left: 0;
background: #ffffff;
box-shadow: 0 0 toRpx(16) 0 #99999933;
border-radius: toRpx(16);
padding: toRpx(16) 0;
animation: show-view-opacity 0.15s forwards;
display: flex;
max-height: toRpx(600);
overflow-y: auto;
.first-level-box {
text-align: left;
// height: 100%;
// overflow-y: auto;
.item-label {
display: inline-block;
white-space: nowrap;
}
}
.second-level-box {
width: toRpx(400);
// height: 100%;
// overflow-y: auto;
}
.type-item {
padding: 0 toRpx(28);
margin-bottom: toRpx(8);
height: toRpx(84);
// justify-content: center;
align-items: center;
&:last-child {
margin-bottom: 0;
} &.active {
background-color: #ecf1ff;
}
}
}
}
</style>
<template> <template>
<view class="type-tab"> <view class="type-tab">
<view class="type-box"> <template v-if="!styleV2">
<view <view class="type-box">
class="tab-item"
v-for="(i, index) in typeList"
:key="index"
@click="tabClick(index)"
>
<view <view
:class="['sprite-icon',tabClass(index)]" class="tab-item"
:style="{ v-for="(i, index) in typeList"
:key="index"
@click="tabClick(index)"
>
<view
:class="['sprite-icon',tabClass(index)]"
:style="{
left:blockLeft left:blockLeft
}" }"
></view> ></view>
<view <view
class="text" class="text"
:class="[tabIndex == index ? `active` : '']" :class="[tabIndex == index ? `active` : '']"
> >
{{ i[nameKey] }} {{ i[nameKey] }}
</view>
</view> </view>
</view> </view>
</view> <view class="mask-box"></view>
<view class="mask-box"></view> </template>
<template v-else>
<scroll-view
scroll-x
enable-flex
class="scroll-box"
:scroll-into-view="`tab-id-${tabIndex}`"
>
<view class="type-box-v2">
<view
:class="['tab-item',{active:tabIndex == index}]"
v-for="(i, index) in typeList"
:key="index"
@click="tabClick(index)"
:id="`tab-id-${index}`"
>
<template v-if="index == 0">
<view class="sprite-icon icon-first-right"></view>
</template>
<template v-else>
<view class="sprite-icon icon-second-left"></view>
<view class="sprite-icon icon-second-right"></view>
</template>
<view class="text">
{{ i[nameKey] }}
</view>
</view>
</view>
</scroll-view>
</template>
</view> </view>
</template> </template>
...@@ -36,19 +68,24 @@ export default { ...@@ -36,19 +68,24 @@ export default {
nameKey: { nameKey: {
type: String, type: String,
default: 'tabName' default: 'tabName'
},
styleV2: {
type: Boolean,
default: false
} }
}, },
name: '', name: '',
data () { data () {
return { return {
firstClass: Object.freeze(['first-nav', 'second-nav']), firstClass: Object.freeze(['first-nav', 'second-nav']),
viewIndex: ''
} }
}, },
computed: { computed: {
blockLeft () { blockLeft () {
let { tabIndex } = this let { tabIndex } = this
return `${(tabIndex * 400) - (tabIndex == 0 ? 0 : 48)}rpx` return `${(tabIndex * 400) - (tabIndex == 0 ? 0 : 48)}rpx`
} },
}, },
mounted () { mounted () {
}, },
...@@ -63,8 +100,11 @@ export default { ...@@ -63,8 +100,11 @@ export default {
return className return className
}, },
tabClick (index) { tabClick (index) {
if (this.tabIndex == index) return
// this.viewIndex = `tab-id-${index}`
// console.log(this.viewIndex)
this.$emit('update:tabIndex', index) this.$emit('update:tabIndex', index)
this.$emit('tabClick',index) this.$emit('tabClick', index)
} }
} }
} }
...@@ -128,5 +168,77 @@ export default { ...@@ -128,5 +168,77 @@ export default {
border-radius: toRpx(48); border-radius: toRpx(48);
overflow: hidden; overflow: hidden;
} }
.scroll-box {
width: 100%;
}
.type-box-v2 {
position: relative;
display: flex;
width: 100%;
background-color: #eef4fe;
height: toRpx(96);
line-height: toRpx(96);
border-radius: toRpx(48) toRpx(48) 0 0;
z-index: 0;
flex-wrap: nowrap;
gap: 0 toRpx(80);
.tab-item {
padding: 0 toRpx(40);
flex-shrink: 0;
position: relative;
background-color: #eef4fe;
&:first-of-type {
padding-left: toRpx(80);
}
.text {
color: #292d33;
font-size: toRpx(32);
position: relative;
z-index: 2;
}
.sprite-icon {
position: absolute;
display: none;
}
}
.active {
background: #fff;
&:last-of-type {
.icon-second-right {
// display: none;
}
}
.text {
color: #3b73ff;
font-weight: 500;
transition: all 0.15s;
position: relative;
&::after {
width: toRpx(40);
height: toRpx(6);
border-radius: toRpx(4);
background: #3b73ff;
position: absolute;
content: '';
left: 50%;
transform: translateX(-50%);
bottom: toRpx(12);
}
}
.sprite-icon {
display: block;
}
.icon-first-right {
right: toMinusRpx(100);
}
.icon-second-left {
left: toMinusRpx(100);
}
.icon-second-right {
right: toMinusRpx(100);
background-color: #eef4fe;
}
}
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -68,11 +68,11 @@ uni.signHttpConfig = { ...@@ -68,11 +68,11 @@ uni.signHttpConfig = {
}, },
error: (error, config) => { error: (error, config) => {
console.log('error事件触发', error, config) console.log('error事件触发', error, config)
if(error && error.errMsg == 'request:fail') { if (error && error.errMsg == 'request:fail') {
return uni.showToast({ return uni.showToast({
title: '网络异常', title: '网络异常',
icon: 'none', icon: 'none',
}) })
} }
uni.showToast({ uni.showToast({
title: error.msg || '业务异常', title: error.msg || '业务异常',
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name" : "展业助手", "name" : "展业助手",
"appid" : "__UNI__D3BD3DF", "appid" : "__UNI__D3BD3DF",
"description" : "", "description" : "",
"versionName" : "2.18.1", "versionName" : "2.19.0",
"versionCode" : 2181, "versionCode" : 2190,
"transformPx" : false, "transformPx" : false,
"sassImplementationName" : "node-sass", "sassImplementationName" : "node-sass",
/* 5+App特有相关 */ /* 5+App特有相关 */
......
...@@ -179,7 +179,48 @@ export default { ...@@ -179,7 +179,48 @@ export default {
}) })
}, },
/**延保日报 */ /**延保日报 */
equityStaffDailyReport () { }, equityStaffDailyReport () {
let { userInfo } = this
return new Promise((resolve, reject) => {
uni.$api.interceptionApi
.staffDailyReportMerchantValid({
merchantId: userInfo.shopMerchantId,
yqMerchantId: userInfo.merchantId,
staffUuid: userInfo.uuid,
sceneType: 0
})
.then(data => {
if (data) {
// 获取当前日期
let currentDate = new Date()
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
// if (wx.__HAS_NOTLOGIN_MODAL) return false; //
this.addModalToQueue('日报提醒', '您有未填写的日报,请点击前往。', '前往填写', false, 2, res => {
if (res.confirm) {
const pages = getCurrentPages(),
currentPage = pages[pages.length - 1]
if (currentPage.route == 'pages/equity/tool/index') uni.$emit('jumpToDailyReport', formattedDate)
else uni.navigateTo({
url: `/pages/equity/tool/index?componentName=DailyReport&currentDate=${formattedDate}`
})
}
})
resolve(true)
} else {
resolve(false)
}
}).catch(err => {
resolve()
})
})
},
addModalToQueue (title, content, confirmText, showCancel, priority, eventCallback) { addModalToQueue (title, content, confirmText, showCancel, priority, eventCallback) {
if (modalQueue.findIndex(val => val.content == content) < 0) if (modalQueue.findIndex(val => val.content == content) < 0)
modalQueue.push({ modalQueue.push({
...@@ -207,6 +248,13 @@ export default { ...@@ -207,6 +248,13 @@ export default {
confirmColor: '#347BFF' confirmColor: '#347BFF'
}) })
return Promise.resolve(data) return Promise.resolve(data)
} },
// 限制录单
async getLimitRecord () {
const data = await uni.$api.commonApi.getLimitRecord()
if (data)
console.log(data, '限制录单')
return Promise.resolve(data)
},
} }
} }
No preview for this file type
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!