Commit 6e85274c by 前端

Merge branch 'V4.56.0' into 'master'

上线合并

See merge request !30
2 parents 48216e90 1d959e0d
Showing 158 changed files with 4853 additions and 25 deletions
......@@ -15,6 +15,9 @@ export default {
computed: {
...mapState('audio', ['isEnd', 'isStart'])
},
globalData: {
userInfo: uni.getStorageSync('release_userInfo')
},
onLaunch: async function () {
this.onKeep()
this.setAPPVersion()
......
......@@ -114,5 +114,236 @@ module.exports = {
projectName: 'boutique',
...data
})
},
// 权益提单相关接口
// 查询店铺配置
getShopMerchantPointConfig(data) {
return http.post({
method: 'dj.api.smartcarlife.shopMerchantPointConfig.get',
projectName: 'boutique',
...data
})
},
/** 根据订单状态统计订单数*/
statByStatus(data) {
return http.post({
method: 'dj.api.smartcarlife.order.statByStatus',
projectName: 'boutique',
...data
})
},
// 根据4s店商户好获取二级流浪方列表
getSubShopMerchantList(data) {
return http.post({
method: 'dj.api.smartcarlife.diversionMerchant.getDiversionMerchantRef',
projectName: 'boutique',
...data
})
},
/**搜索订单(含套餐) */
getWorkPackageGoodsList(data) {
return http.post({
method: 'dj.api.smartcarlife.order.search.containPackageGoods',
projectName: 'boutique',
...data
})
},
// 获取商户订单设置
getMerchantRecordingSettings(data) {
return http.post({
method: 'dj.api.smartcarlife.recordingSettings.getMerchantRecordingSettings',
projectName: 'boutique',
...data
})
},
// 获取园区店配置
getYqStoreConfig(data) {
return http.post({
method: 'dj.api.smarcarlife.yqMerchantConfig.detail',
projectName: 'boutique',
...data
})
},
/**补录订单数 */
waitinputorder(data) {
return http.post({
method: 'dj.api.smartcarlife.weapp.waitinputorder.count',
projectName: 'boutique',
...{ ...data, inputStatus: 0 }
})
},
/**交易流水号 */
transactionSerialNumber(data) {
return http.post({
method: 'dj.api.smartcarlife.weapp.waitinputorder.page',
projectName: 'boutique',
...data
})
},
// 根据商户号获取可选商品列表
getSelectOrderGoodsList(data) {
return http.post({
method: 'dj.api.smartcarlife.selectOrderGoods.list',
projectName: 'boutique',
...data
})
},
/**战败商品列表- upradeFlag(N为基础,Y为升级) */
getOrderBaseGoodsList(data) {
return http.post({
method: 'dj.api.smartcarlife.orderUpgradeGoods.listByMerchantId',
projectName: 'boutique',
...data
})
},
/** 选择支付方式下单 */
createWithPay(data) {
console.log(data)
return http.post({
method: 'dj.api.smartcarlife.order.createWithPay',
projectName: 'boutique',
...data
})
},
/** 订单补录 */
supplementOrder(data) {
return http.post({
method: 'dj.api.smartcarlife.order.supplementOrder',
projectName: 'boutique',
...data
})
},
// 获取精品升级场景 太阳膜类商品部位数据
getPositionList(data) {
return http.post({
method: 'dj.api.smartcarlife.goodsPosition.list',
projectName: 'boutique',
...data
})
},
/** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid(data) {
// return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
return http.post({ method: 'dj.api.smartcarlife.staff.daily.report.popup.need', projectName: 'boutique', ...data })
},
/** 校验手机号是否配置打卡和是否打卡 */
clockInConfigPhone(data) {
// return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
return http.post({ method: 'dj.api.smartcarlife.clock.in.config.phone', projectName: 'boutique', ...data })
},
/** 获取商户基本信息 */
getServiceBaseInfo(data) {
return http.post({ method: 'dj.api.smartcarlife.serviceMerchant.getServiceBaseInfo', projectName: 'boutique', ...data })
},
/** 查询园区店是否开启签名配置 */
getSignatureSwitch(data) {
return http.post({ method: 'dj.api.smartcarlife.serviceMerchant.getSignatureSwitch', projectName: 'boutique', ...data })
},
// 获取服务商库存管理模式(是否使用膜卷号)
getServiceFilmRollSetting(data) {
return http.post({ method: 'dj.api.smarcarlife.stock.management.mode', projectName: 'boutique', ...data })
},
/** 获取转化员上一笔订单的销售顾问 */
getLastUserOrderInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.order.getLastUser',
projectName: 'boutique',
...data
})
},
/**根据订单号获取订单详情(含套餐) */
getPackageGoodsDetail(data) {
return http.post({ method: 'dj.api.smartcarlife.order.packageGoodsDetail', projectName: 'boutique', ...data })
},
/**
* 查询日报门店主营品牌
*/
getDailyReportCarBrand(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.car.brand',
projectName: 'boutique',
...data
})
},
/**
* 查询员工日报是否填写列表
*
*/
getStaffDailyReportDetailWeeklyList(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.weekly.list',
projectName: 'boutique',
...data
})
},
/**
* 查询日报详情
*/
getStaffDailyReportDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.detail',
projectName: 'boutique',
...data
})
},
/** 修改订单备注 */
updateOrderRemark(data) {
return http.post({ method: 'dj.api.smartcarlife.order.updateRemark', projectName: 'boutique', ...data })
},
/** 修改工单时间 */
updateOrderTime(data) {
return http.post({ method: 'dj.api.smartcarlife.order.updateOrderTime', projectName: 'boutique', ...data })
},
/** 获取企微活码 */
getWorkWechatLiveQRCode(data) {
return http.post({ method: 'dj.api.smartcarlife.order.getWorkWechatLiveQRCode', projectName: 'boutique', ...data })
},
/** 升级商品生成条形码 */
createBarCode(data) {
return http.post({ method: 'dj.api.smartcarlife.common.createBarCode', projectName: 'boutique', ...data })
},
/**撤销工单 */
revokeOrder(data) {
return http.post({ method: 'dj.api.smartcarlife.order.revoke', projectName: 'boutique', ...data })
},
/** 获取园区店配置技师数据 */
getQYTechnicianList(data) {
return http.post({ method: 'dj.api.smartcarlife.roleTechnician.list', projectName: 'boutique', ...data })
},
// 生成生成小程序码
createQrcodeImage(data) {
// dj.api.smartcarlife.serviceMerchant.getByMerchantId
return http.post({ method: 'dj.api.smartcarlife.common.createWeappQrcode', projectName: 'boutique', ...data })
},
/**
* 保存日报
*/
saveStaffDailyReport(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.save',
projectName: 'boutique',
...data
})
},
/** 不升级常用字符列表 */
getConfigList(data) {
return http.post({ method: 'dj.api.smartcarlife.config.list', projectName: 'boutique', ...data })
},
/** 战败订单批量补录 */
notUpgradeOrder(data) {
return http.post({ method: 'dj.api.smartcarlife.order.notUpgrade.batchInsert', projectName: 'boutique', ...data })
},
/**改变支付订单状态 */
createPayOrder(data) {
return http.post({ method: 'dj.api.smartcarlife.payOrder.create', projectName: 'boutique', ...data })
},
/** 质保价格编辑接口 */
modifyWarrantyPrice(data) {
return http.post({
method: 'dj.api.smartcarlife.customer.warrantyCard.modifyWarrantyPrice',
projectName: 'boutique',
...data
})
}
}
......@@ -280,7 +280,7 @@ module.exports = {
return http.post(
{
// method: 'dj.pad.api.beisen.getUnreadCount',
method: 'dj.pad.api.staff.getUnreadCount', // 修改为sop+北森的未读数
method: 'dj.pad.api.staff.getUnreadCount', // 修改为sop+北森的未读数
projectName: 'pad',
...data
},
......
......@@ -6,6 +6,8 @@ import customerApi from './customerApi'
import pointApi from './point'
import receptionApi from './receptionApi'
import sceneMarketApi from './sceneMarketApi'
import interceptionApi from './interceptionApi'
import popupApi from './popupApi'
module.exports = {
commonApi,
systemApi,
......@@ -14,5 +16,7 @@ module.exports = {
customerApi,
pointApi,
receptionApi,
sceneMarketApi
sceneMarketApi,
interceptionApi,
popupApi
}
import http from '../request/http'
module.exports = {
/** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid (data) {
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.popup.need',
projectName: 'boutique',
...data
})
},
/** 校验手机号是否配置打卡和是否打卡 */
clockInConfigPhone (data) {
return http.post({
method: 'dj.api.smartcarlife.clock.in.config.phone',
projectName: 'boutique',
...data
})
},
/**
* 查询当前员工处罚情况
*/
checkStaffStudyPunish (data) {
return http.post({
method: 'dj.api.carboutique.staff.study.punish',
projectName: 'boutique',
...data
})
},
}
import http from '../request/http'
module.exports = {
/** 销售顾问/录单员 & 交付专员 */
getEmployeeList (data) {
return http.post({
method: 'dj.api.smartcarlife.employee.onTheJob.getByMerchantId',
projectName: 'boutique',
...data
})
},
/**
* 二级流量方
*/
getDiversionMerchantRef (data) {
return http.post({
method: 'dj.api.smartcarlife.diversionMerchant.getDiversionMerchantRef',
projectName: 'boutique',
...data
})
},
/**
* 获取门店品牌车型
*/
getMerchantCarBrandList (data) {
return http.post({
method: 'dj.api.get.car.brandList',
projectName: 'boutique',
needCarSeries: true,
...data
})
},
/***
* 获取门店礼券列表
*/
getMerchantCouponList (data) {
return http.post({
method: 'dj.api.smartCarLife.merchant.coupon.list',
projectName: 'boutique',
...data
})
},
/**
* 获取客户礼券列表
*/
getCustomerCouponList (data) {
return http.post({
method: 'dj.api.customer.coupon.list',
projectName: 'boutique',
...data
})
},
/**
* 获取商品列表
*/
getGoodsList (data) {
return http.post({
method: 'dj.api.smartcarlife.selectOrderGoods.list',
projectName: 'boutique',
...data
})
},
/**获取订单列表筛选转化人员&销售顾问 */
getOrderScreenEmployeeList (data) {
return http.post({
method: 'dj.api.smartcarlife.employee.getByMerchantId',
projectName: 'boutique',
...data
})
},
/**
* 获取园区店配置
*/
getYqStoreConfig (data) {
return http.get({
method: 'dj.api.smarcarlife.yqMerchantConfig.detail',
projectName: 'boutique',
...data
})
},
/**
* 战败下单商品列表
*
*/
getOrderUpgradeGoodsList (data) {
return http.post({
method: 'dj.api.smartcarlife.orderUpgradeGoods.listByMerchantId',
projectName: 'boutique',
...data
})
},
/**
* 获取精品升级场景 太阳膜类商品部位数据
*/
getPositionList (data) {
return http.post({
method: 'dj.api.smartcarlife.goodsPosition.list',
projectName: 'boutique',
...data
})
}
}
\ No newline at end of file
No preview for this file type
.detail-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding: toRpx(160) toRpx(64) 0;
}
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 999;
pointer-events: none;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
}
}
.flex {
display: flex;
}
.justify-between {
-webkit-box-pack: justify;
-ms-flex-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
}
.align-center {
align-items: center;
}
.align-start {
align-items: start !important;
}
.justify-center {
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
.justify-end {
-webkit-box-pack: end;
-ms-flex-pack: end;
-webkit-justify-content: flex-end;
justify-content: flex-end;
}
.justify-around {
-ms-flex-pack: distribute;
-webkit-justify-content: space-around;
justify-content: space-around;
}
.flex-wrap {
-ms-flex-wrap: wrap;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
}

2.49 MB | W: | H:

2.65 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
<template>
<view class="entrance-container">
<view class="entrance-list">
<view
class="entrance-item"
v-for="(item, index) in entranceList"
:key="index"
@click="handleClick(item)"
>
<view :class="['sprite-icon', `icon-${item.icon}`]"></view>
<view class="entrance-name">{{ item.label }}</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'Entrance',
data() {
return {
entranceList: [
{
icon: 'daily-report',
label: '驻店日报',
name: 'DailyReport'
},
{
icon: 'create-order',
label: '新建工单',
name: 'CreateOrder'
},
{
icon: 'defeat-order',
label: '战败下单',
name: 'DefeatOrder'
},
{
icon: 'order-management',
label: '工单列表',
name: 'OrderManagement'
}
]
}
},
methods: {
handleClick(item) {
// 这里可以根据实际需求进行跳转或功能处理
this.$emit('entranceClick', item)
}
}
}
</script>
<style scoped lang="scss">
.entrance-container {
width: 100%;
// margin-top: toRpx(64);
display: flex;
// justify-content: center;
}
.entrance-list {
display: flex;
flex-wrap: wrap;
gap: toRpx(68);
justify-content: flex-start;
}
.entrance-item {
width: toRpx(120);
// height: 144rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: toRpx(30);
.sprite-icon {
background-color: #fff;
border-radius: toRpx(14);
}
.entrance-name {
margin-top: toRpx(22);
}
}
</style>
\ No newline at end of file
<template>
<view>
<view v-for="(items, boxIdx) in formList" :key="boxIdx">
<view class="cell-box">
<template v-for="(item, idx) in items">
<view v-if="!item.hidden">
<view class="cell-row" :key="idx">
<view class="cell" @click="onCellClick(item)" :class="[item.noBorder ? '' : 'border', item.onlyLabel ? 'small-height' : '', item.class]">
<view :class="['cell-label', { 'only-label': item.onlyLabel }]">
<view v-if="item.labellIcon" :class="['sprite-icon', `icon-${item.labellIcon}`]"></view>
{{ item.label }}
<view v-if="item.required" class="required">*</view>
</view>
<view class="cell-value">
<!-- 输入框 -->
<template v-if="item.type === 'input'">
<view class="input-box">
<input class="input-value" v-model="formData[item.value]" :type="item.inputType || 'text'"
@blur="handleBlur($event, item)" :placeholder="item.placeholder || '请输入'"
:maxlength="item.maxlength ? item.maxlength : -1"
@input="item.inputType === 'number' && item.maxlength ? (formData[item.value] = String($event.target.value).slice(0, item.maxlength)) : null" />
<view v-if="item.valueIcon" :class="['sprite-icon', `icon-${item.valueIcon}`]"
@click="onValueClick(item)"></view>
</view>
</template>
<!-- 下拉选择 -->
<template v-else-if="item.type === 'select'">
<view class="value">
<template v-if="!item.addHtml && formData[item.value] && formData[item.value]">
<template v-if="item.showText && userInfo && userInfo[item.showText]">
{{ userInfo[item.showText] }}
<text>|</text>
</template>
{{ formData[item.value] }}
</template>
<template v-else>
<span class="placeholder">请选择</span>
</template>
<view class="sprite-icon icon-icon-select"></view>
</view>
</template>
<!-- 单选框 -->
<template v-else-if="item.type === 'radio'">
<radio-group class="radio-group value" @change="onRadioChange($event, item)">
<label class="uni-list-cell uni-list-cell-pd" v-for="radio in item.radioList" :key="radio.value + item.value">
<radio style="transform: scale(0.7)" :value="radio.value" :disabled="item.disabled || radio.disabled" :checked="radio.value == item.current" />
<view class="radio-name">{{ radio.name }}</view>
</label>
</radio-group>
</template>
<!-- 多行文本 -->
<template v-else-if="item.type === 'textarea'">
<textarea class="textarea" v-model="formData[item.value]" :placeholder="item.placeholder || '请输入'" placeholder-class="textarea-placeholder" confirm-type="done" auto-height :maxlength="item.maxlength"></textarea>
</template>
</view>
</view>
<slot v-if="item.addHtml" :name="item.addHtml"></slot>
</view>
</view>
</template>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'GlCell',
props: {
/**
* noBorder:默认false:有下边框,true:无下边框
* onlyLabel:判断是否只有label,默认false,主要是为了做样式区分
* class:cell-break:不一行显示,主要用于文本域
* required:是否为必填项,添加星号
* value: 绑定的字段名称
* key:如果绑定的字段名称为对象,则需要传入需要显示在页面上的属性名
* type: 表单的类型 有:input、select、radio、textarea
* placeholder: 占位符,input、textarea默认为[请输入],select默认为[请选择],
* radioList: type为radio时传入
* current: type为radio时传入,设置radio的默认值
*/
formList: {
type: Array,
default: () => []
},
formData: {
type: Object,
default: () => ({})
}
},
data() {
return {
userInfo: {}
}
},
mounted() {
this.userInfo = uni.$storage.get('userInfo') || {}
},
methods: {
onCellClick(item) {
if (item.type === 'select') {
this.$emit('handleCell', item)
}
},
onRadioChange(e, item) {
this.$emit('radioChange', e, item)
},
onValueClick(item) {
this.$emit('handleValue', item)
},
handleBlur(e, item) {
this.$emit('inputBlur', e, item)
}
}
}
</script>
<style scoped lang="scss">
.cell-box {
background-color: #fff;
border-radius: toRpx(16);
overflow: hidden;
margin-bottom: toRpx(18);
}
.cell-row {
padding-left: toRpx(32);
}
.cell {
display: flex;
align-items: center;
padding-right: toRpx(32);
height: toRpx(96);
&.small-height {
height: toRpx(72);
}
&.cell-break {
flex-direction: column;
align-items: normal;
height: auto;
}
&.border {
border-bottom: toRpx(2) solid #f7f7f6;
}
}
.cell-label {
color: #333;
font-size: toRpx(28);
display: flex;
align-items: center;
.sprite-icon {
margin-right: toRpx(8);
}
.required {
display: inline-block;
margin-left: toRpx(8);
color: #f24724;
}
&.only-label {
font-size: toRpx(24);
color: #777;
}
}
.cell-break .cell-label {
height: toRpx(96);
line-height: toRpx(96);
}
.cell-break .cell-value {
width: 100%;
margin-left: 0;
}
.cell-value {
position: relative;
flex: 1;
height: 100%;
margin-left: toRpx(20);
overflow: hidden;
font-size: toRpx(28);
uni-input {
font-size: toRpx(28);
}
.uni-input-placeholder {
color: #999;
}
.value {
display: flex;
justify-content: flex-end;
align-items: center;
height: 100%;
.sprite-icon {
margin-bottom: toRpx(2);
}
}
.input-box {
display: flex;
align-items: center;
justify-content: flex-end;
height: 100%;
width: 100%;
.sprite-icon {
margin-left: toRpx(8);
}
}
.input-value {
height: 100%;
text-align: right;
width: 100%;
}
.input-bottom {
min-height: toRpx(100);
line-height: toRpx(56);
font-size: toRpx(38);
padding: toRpx(32);
}
.placeholder {
color: #999;
font-size: toRpx(28);
line-height: toRpx(32);
}
.uni-list-cell {
margin-left: toRpx(57.2);
}
.radio-name {
display: inline-block;
}
.textarea {
width: 100%;
border-radius: toRpx(16);
border: toRpx(2) solid #eff0f2;
background: #f4f5f7;
padding: toRpx(24);
margin-bottom: toRpx(32);
}
.textarea-placeholder {
line-height: normal;
font-size: toRpx(28);
}
}
</style>
......@@ -31,7 +31,6 @@ export default {
async getMessageSummary() {
const userInfo = uni.$storage.get('userInfo')
const res = await getMessageSummary({businessType: userInfo.sceneType})
console.log(res, '===')
this.messageList = res
},
handleClick(item) {
......
......@@ -124,6 +124,7 @@ export default {
uni.$storage.rm("noSignInUuid");
uni.$storage.rm("beisenToken");
uni.$storage.rm("studyCenterPermission");
uni.$storage.rm("boutique_YQorderSetting")
setTimeout(() => {
uni.hideLoading()
uni.reLaunch({
......
......@@ -43,14 +43,18 @@
<view class="tool-box box-class">
<view class="common-title">展业工具</view>
<view class="content-box">
<view class="developing flex">
<image
class="developing-icon"
src="../../assets/images/common/developing.webp"
/>
功能开发中
</view>
<template v-if="sceneType == 1">
<Entrance @entranceClick="entranceClick"></Entrance>
</template>
<template v-else>
<view class="developing flex">
<image
class="developing-icon"
src="../../assets/images/common/developing.webp"
/>
功能开发中
</view>
</template>
</view>
</view>
</view>
......@@ -187,9 +191,11 @@ import StudyCenter from './components/StudyCenter.vue'
import SwiperComponent from '../SwiperComponent.vue'
import MessageIndex from './components/Message/index.vue'
import permision from '@/js_sdk/wa-permission/permission.js'
import Entrance from '@/components/Entrance.vue';
import { interceptionMixin } from '@/mixin/index'
export default {
mixins: [recorder, uploader, timeout, versionCheck, merge],
components: { ReceptionCenter, StudyCenter, SceneMarket, LeftSide, Point, dayPoint, rulePoint, Course, Ranking, LevelPoint, Calendar, Promotion, History, LevelMedal, MessageDetail, SwiperComponent, MessageIndex },
mixins: [recorder, uploader, timeout, versionCheck, merge, interceptionMixin],
components: { ReceptionCenter, StudyCenter, SceneMarket, LeftSide, Point, dayPoint, rulePoint, Course, Ranking, LevelPoint, Calendar, Promotion, History, LevelMedal, MessageDetail, SwiperComponent, MessageIndex, Entrance },
props: {
id: [String, Number],
finishDoneText: String,
......@@ -241,6 +247,10 @@ export default {
componentName () {
let tabs = this.$refs.leftBox?.tabs
return tabs ? tabs[this.tabIndex].name : ''
},
sceneType () {
const { sceneType } = uni.$storage.get('userInfo')
return sceneType
}
},
methods: {
......@@ -268,7 +278,6 @@ export default {
},
backHome () {
this.showHome = true
console.log(this.$refs.pointRef)
Promise.resolve().then(() => {
this.$refs.pointRef?.$refs?.centerRef?.init && this.$refs.pointRef.$refs.centerRef.init()
})
......@@ -287,7 +296,6 @@ export default {
this.pointComponentName = name
},
handleOperation (val, data) {
console.log(val, data, 'val, data')
const { type } = val;
// 提取公共的webview设置逻辑
......@@ -315,9 +323,6 @@ export default {
if (!setWebviewStyleWithRetry()) {
// 如果未成功,继续重试
setTimeout(retrySetWebviewStyle, 50);
} else {
// 成功设置样式,结束循环
console.log('Webview样式设置成功');
}
};
......@@ -361,9 +366,7 @@ export default {
},
// 学习中心修改阅读状态,打开后才修改
async getStudyCenterRead (id) {
console.log(id, 'getStudyCenterRead')
const res = await uni.$api.commonApi.getStudyCenterRead({ id })
console.log(res)
},
showReadCountTips (res) {
......@@ -396,6 +399,13 @@ export default {
async updateApp (requested = false) {
if (!requested) await uni.$api.systemApi.getMockData(true)
this.checkVersion()
},
async entranceClick (item) {
const noInterceptPage = ['DailyReport']
if (!noInterceptPage.includes(item.name) && (await this.checkDailyReport() || await this.inspectionOfProhibitionBill())) return
uni.navigateTo({
url: `/pages/boutique/tool/index?componentName=${item.name}`
})
}
}
}
......@@ -581,6 +591,9 @@ export default {
}
.tool-box {
height: calc(100% - #{toRpx(712)});
.content-box {
margin: 0 toRpx(48);
}
}
}
.content-right {
......
<template>
<view class="car-model-box">
<scroll-view
class="scroll-view"
scroll-y
:scroll-into-view="letter"
>
<template v-if="listData.length">
<template v-for="(i, index) in listData">
<view
class="item-box"
:key="index"
:id="i.letter"
>
<view class="letter-title flex">{{i.letter}}</view>
<template v-for="(c,cindex) in i.list">
<view
class="car-model"
:key="cindex"
>
<view class="brand-name">{{c.name}}</view>
<view class="brand-list">
<template v-for="(j, jindex) in c.childs_list">
<view
:key="jindex"
:class="[
{'sub-brand-name':j.isTitle},
{'item flex':!j.isTitle},
{active: (currentId ? j.id == currentId : j.id == data.customer[params.idKey]) && !j.isTitle}
]"
@click="choose(j,c)"
>
<view
class="sprite-icon icon-tag-checked"
v-if="!j.isTitle"
></view>
{{j.name}}
</view>
</template>
</view>
</view>
</template>
</view>
</template>
</template>
</scroll-view>
<view class="letter-list">
<template v-for="(i, index) in listData">
<view
class="letter-item"
:key="index"
@click="letter = i.letter"
>
{{i.letter}}
</view>
</template>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'CarModelList',
data () {
return {
letter: 'A',
}
},
mounted () {
},
methods: {
async getList (searchValue) {
const { userInfo, params } = this,
{ cacheData } = params
this.currentId = ''
if (cacheData && cacheData.length) {
this.initData(cacheData)
if (searchValue) this.handleSearch(searchValue)
return
}
const { shopMerchantId } = userInfo,
data = await uni.$api.popupApi.getMerchantCarBrandList({
merchantId: shopMerchantId
})
this.updateParams(params, data || [])
},
initData (carData) {
let { params: { idKey }, data: { customer } } = this,
letterList = Array.from(new Set([...carData.map((e) => e.letter)])),
carModelList = letterList.map(e => {
let list = []
carData.map(i => {
if (e === i.letter) {
let c_list = []
i.childs.map(c => {
if (c.childs) {
c.childs.map((s) => {
s.carChildsBrandId = c.id;
s.carChildsBrandName = c.name;
if (customer && customer[idKey]) {
if (s.id == customer[idKey]) {
s.active = true;
this.letter = i.letter;
}
}
});
let carSecondInfo = {
carChildsBrandId: c.id,
carChildsBrandName: c.name,
name: c.name,
isTitle: true,
};
c_list = [...c_list, carSecondInfo, ...c.childs];
}
})
i.childs_list = c_list;
list.push(i)
}
})
return {
letter: e,
list,
}
})
this.list = carModelList
this.$emit('onComplete')
},
handleSearch (searchValue) {
if (!searchValue) {
this.searchStatus = false
this.letter = 'A'
} else {
searchValue = searchValue.toUpperCase()
let { list } = this,
carBrand = JSON.parse(JSON.stringify(list))
let arr = [];
carBrand.map(c => {
c.list.map(i => {
let childs_list = [],
i_name = i.name.toUpperCase()
i.childs_list.map((k) => {
let k_name = k.name.toUpperCase()
if (k_name.indexOf(searchValue) != -1) {
childs_list.push(k);
}
});
if (i_name.indexOf(searchValue) != -1 || childs_list.length > 0) {
i.childs_list = childs_list.length > 0 ? childs_list : i.childs_list;
arr.push(i);
}
})
})
let letterList = Array.from(new Set([...arr.map((e) => e.letter)]));
let searchList = letterList.map((l) => {
let _list = [];
arr.map((i) => {
if (l === i.letter) {
_list.push(i);
}
})
return {
letter: l,
list: _list,
}
})
this.searchList = searchList
this.searchStatus = true
}
},
choose (that, item) {
if (that.isTitle) return
let chooseItem = {
carBrandId: item.id,
carBrand: item.name,
carChildsBrandId: that.carChildsBrandId,
carChildsBrandName: that.carChildsBrandName,
carSeriesId: that.id,
carSeriesName: that.name,
}
this.currentId = that.id
this.$emit('choose', chooseItem)
}
}
}
</script>
<style scoped lang='scss'>
.car-model-box {
position: relative;
height: 100%;
width: 100%;
.scroll-view {
height: 100%;
}
.letter-list {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 0;
color: #888888;
font-size: toRpx(28);
line-height: toRpx(40);
padding: 0 toRpx(18);
text-align: center;
}
.item-box {
margin-bottom: toRpx(32);
.letter-title {
color: #888888;
font-size: toRpx(28);
height: toRpx(40);
background: #f5f7fa;
padding-left: toRpx(48);
}
.car-model {
margin: 0 toRpx(48);
.brand-name {
color: #333333;
font-size: toRpx(32);
line-height: toRpx(44);
margin: toRpx(16) 0;
}
.sub-brand-name {
color: #888888;
font-size: toRpx(28);
line-height: toRpx(40);
width: 100%;
flex-shrink: 0;
}
}
}
.brand-list {
// display: grid;
// grid-template-columns: repeat(4, 1fr);
gap: toRpx(32);
display: flex;
// gap: toRpx(32) 0;
flex-wrap: wrap;
.item {
width: calc((100% - #{toRpx(96)}) / 4);
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>
\ No newline at end of file
<template>
<view class="coupon-box">
<template v-if="params.loadComplete">
<template v-if="customerCouponList.length">
<view class="item-box">
<view class="coupon-title flex">客户拥有的券</view>
<view class="coupon-list">
<template v-for="(c,cindex) in customerCouponList">
<view
:key="cindex"
:class="[
'item flex',
{active: currentId ? c.customerCouponCode == currentId : c.customerCouponCode == data[params.idKey]},
]"
@click="choose(c,true)"
>
<view class="sprite-icon icon-tag-checked"></view>
{{c.couponName}}{{c.customerCouponCode}}
</view>
</template>
</view>
</view>
</template>
<template v-if="listData.length">
<template v-for="(i, index) in listData">
<view
class="item-box"
:key="index"
>
<view class="coupon-title flex">{{i.title}}</view>
<view class="coupon-list">
<template v-for="(c,cindex) in i.list">
<view
:key="cindex"
:class="[
'item flex',
{active: currentId ? c.merchantCouponCode == currentId : c.merchantCouponCode == data[params.idKey]},
{disabled:checkDisabled(c) }
]"
@click="choose(c)"
>
<view class="sprite-icon icon-tag-checked"></view>
{{c.couponName}}{{c.merchantCouponCode}}
</view>
</template>
</view>
</view>
</template>
</template>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'CouponList',
data () {
return {
customerCouponList: []
}
},
watch: {
'data.customer.customerPhone': {
handler (val) {
if (val) this.getCustomerCouponList(val)
},
deep: true,
immediate: true
}
},
mounted () {
},
methods: {
async getList (searchValue) {
const { userInfo, params } = this,
{ cacheData } = params
this.currentId = ''
if (cacheData && cacheData.length) {
this.initData(cacheData)
if (searchValue) this.handleSearch(searchValue)
return
}
const { shopMerchantId, merchantId } = userInfo,
data = await uni.$api.popupApi.getMerchantCouponList({
merchantId: shopMerchantId,
yqMerchantId: merchantId,
orderByType: 9
})
this.updateParams(params, data || [])
},
initData (data) {
let couponTypeList = Array.from(new Set([...data.map((e) => e.couponInfo.couponType)])),
couponList = couponTypeList.map((e, index) => {
let list = [];
let title = "";
data.map((i) => {
i.merchantCouponCode = i.merchantCouponCode.split("-")[0];
if (i.couponInfo.couponType == e) {
list.push(i);
title = i.couponInfo.couponTypeName;
}
});
return {
title,
list,
};
})
this.$emit('onComplete')
this.list = couponList
},
async getCustomerCouponList (customerPhone) {
const phoneRex = /^[1]([3-9])[0-9]{9}$/,
{ data: orderObj } = this,
params = {
customerPhone,
statusList: [0, 1],
usedFlag: "N",
}
if (phoneRex.test(customerPhone)) {
const data = await uni.$api.popupApi.getCustomerCouponList(params)
this.customerCouponList = data.filter((item) => {
return (
item.status != 1 ||
(item.status == 1 && item.id == orderObj.customerCouponId)
);
})
if(this.customerCouponList.length) this.choose(this.customerCouponList[0],true)
}
},
handleSearch (searchValue) {
if (!searchValue) {
this.searchStatus = false
} else {
searchValue = searchValue.toUpperCase()
let { list } = this,
couponList = JSON.parse(JSON.stringify(list))
let arr = [];
couponList.map((i) => {
let list = [];
i.list.map((s) => {
let name = s.couponName.toUpperCase()
if (name.indexOf(searchValue) != -1) {
list.push(s);
}
});
let title = i.title.toUpperCase()
if (title.indexOf(searchValue) != -1 || list.length > 0) {
i.list = list.length > 0 ? list : i.list;
arr.push(i);
}
})
this.searchList = arr
this.searchStatus = true
}
},
choose (item, isCustomer = false) {
if (item.disabled) return
let customerCouponCode = isCustomer ? item.customerCouponCode : item.merchantCouponCode,
key = isCustomer ? 'customerCouponId' : 'merchantCouponId',
chooseItem = {
couponName: item.couponName,
merchantId: item.merchantId,
customerCouponCode,
[key]: item.id
}
this.currentId = customerCouponCode
this.$emit('choose', chooseItem)
},
checkDisabled (item) {
let disabled = false,
{ customerCouponList } = this
if (customerCouponList.length) {
disabled = customerCouponList.some(i => i.merchantCoupon.id == item.id)
}
item.disabled = disabled
return disabled
}
}
}
</script>
<style scoped lang='scss'>
.coupon-box {
position: relative;
height: 100%;
width: 100%;
.item-box {
margin-bottom: toRpx(32);
.coupon-title {
color: #888888;
font-size: toRpx(28);
height: toRpx(40);
background: #f5f7fa;
padding-left: toRpx(48);
margin-bottom: toRpx(16);
}
}
.coupon-list {
// display: grid;
// grid-template-columns: repeat(4, 1fr);
gap: toRpx(32);
display: flex;
// gap: toRpx(32) 0;
flex-wrap: wrap;
margin: 0 toRpx(48);
.item {
width: calc((100% - #{toRpx(96)}) / 4);
justify-content: center;
min-height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
padding: toRpx(14) toRpx(16);
word-break: break-all;
text-align: center;
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.disabled {
border: toRpx(2) solid #dce0e666;
color: #3333331a;
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
}
</style>
\ No newline at end of file
<template>
<view class="date-list">
<picker-view
class="picker picker_max"
:value="dateValues"
indicator-class="indicator"
@change="changeDate"
>
<picker-view-column>
<template v-for="(item,index) in days">
<view
class="view"
:key="index"
>{{item}}</view>
</template>
</picker-view-column>
</picker-view>
<picker-view
class="picker"
:value="hourValues"
indicator-class="indicator"
@change="changeHour"
>
<picker-view-column>
<template v-for="(item,index) in hours">
<view
class="view"
:key="index"
>{{item}}</view>
</template>
</picker-view-column>
</picker-view>
<picker-view
class="picker"
:value="minuteValues"
indicator-class="indicator"
@change="changeMinutes"
>
<picker-view-column>
<template v-for="(item,index) in minutes">
<view
class="view"
:key="index"
>{{item}}</view>
</template>
</picker-view-column>
</picker-view>
</view>
</template>
<script type='text/ecmascript-6'>
import dayjs from 'dayjs'
export default {
name: 'DateTime',
inject: ['userInfo'],
data () {
return {
hours: [],
days: [],
minutes: [],
dateValues: [],
hourValues: [],
minuteValues: [],
loading: true
}
},
props: {
},
mounted () {
this.initDate()
},
methods: {
initDate () {
this.dateValues = []
this.hourValues = []
this.minuteValues = []
const today = new Date()
this.getDateList('2019/01/01', new Date(today.getFullYear(), today.getMonth(), today.getDate()))
},
getDateList (starDay, endDay) {
const arr = [];
const dates = [];
// 设置两个日期UTC时间
const db = new Date(starDay);
const de = new Date(endDay);
// 获取两个日期GTM时间
const s = db.getTime() - 24 * 60 * 60 * 1000;
const d = de.getTime() - 24 * 60 * 60 * 1000;
// 获取到两个日期之间的每一天的毫秒数
for (let i = s; i <= d;) {
i = i + 24 * 60 * 60 * 1000;
arr.push(parseInt(String(i)));
}
// 获取每一天的时间 YY-MM-DD
for (const j in arr) {
const time = new Date(arr[j]);
const year = time.getFullYear();
const mouth = time.getMonth() + 1 >= 10 ? time.getMonth() + 1 : '0' + (time.getMonth() + 1);
const day = time.getDate() >= 10 ? time.getDate() : '0' + time.getDate();
const YYMMDD = year + '/' + mouth + '/' + day;
dates.push(YYMMDD);
}
this.getHourList(dates)
},
getHourList (days) {
const hours = [], today = new Date();
for (let hour = 0; hour < today.getHours() + 1; hour++) {
hours.push(hour.toString().padStart(2, '0'));
}
this.getMinuteList(days, hours)
},
getMinuteList (days, hours) {
const minutes = [];
const today = new Date()
for (let minute = 0; minute < today.getMinutes() + 1; minute++) {
minutes.push(minute.toString().padStart(2, '0'));
}
// 设置默认时间
let { dateValues, hourValues, minuteValues } = this
const HOUR_STR = today.getHours().toString().padStart(2, '0')
const MUNTUE_STR = today.getMinutes().toString().padStart(2, '0')
// const defalutHIndex = hours.indexOf(HOUR_STR)
// const defalutMIndex = minutes.indexOf(MUNTUE_STR)
dateValues.push(days.length + 1)
hourValues.push(hours.length + 1)
minuteValues.push(minutes.length + 1)
this.currentDate = dayjs().format('YYYY/MM/DD')
this.currentHour = HOUR_STR
this.currentMinute = MUNTUE_STR
this.hours = hours
this.days = days
this.minutes = minutes
this.dateValues = dateValues
this.hourValues = hourValues
this.minuteValues = minuteValues
this.loading = false
setTimeout(() => {
this.minuteValues = minuteValues
this.loading = false
}, 100)
this.$emit('onComplete')
},
changeDate (e) {
const { days } = this
const { value } = e.detail
const index = value[0]
this.currentDate = days[index]
// 选择过去时间需要重新初始化时分
const today = dayjs().format('YYYY/MM/DD')
const timeType = this.currentDate != today ? 1 : 0
this.getAllTimeOrPartTime(timeType)
},
changeHour (e) {
const { hours, days, dateValues } = this
const { value } = e.detail
const index = value[0]
this.currentHour = hours[index]
// 处理当前天切换别的小时,别的分不能选后面分到60的问题
// const dayIndex = dateValues[0]
// this.currentDate = days[dayIndex]
const today = dayjs().format('YYYY/MM/DD')
const timeType = this.currentDate != today ? 1 : 0
this.getAllTimeOrPartTimeMinute(timeType)
},
changeMinutes (e) {
const { minutes } = this
const { value } = e.detail
const index = value[0]
this.currentMinute = minutes[index]
},
getAllTimeOrPartTime (type) {
const today = new Date()
const hours = [], minutes = [], hour_len = type == 1 ? 24 : today.getHours() + 1, minute_len = type == 1 ? 60 : today.getMinutes() + 1;
for (let hour = 0; hour < hour_len; hour++) {
hours.push(hour.toString().padStart(2, '0'));
}
for (let minute = 0; minute < minute_len; minute++) {
minutes.push(minute.toString().padStart(2, '0'));
}
this.hours = hours
this.minutes = minutes
},
getAllTimeOrPartTimeMinute (type) {
const today = new Date()
const currentHour = today.getHours()
const timeType = this.currentHour != currentHour ? 1 : 0
const minutes = [], minute_len = type == 1 || timeType == 1 ? 60 : today.getMinutes() + 1;
for (let minute = 0; minute < minute_len; minute++) {
minutes.push(minute.toString().padStart(2, '0'));
}
this.minutes = minutes
},
getResult () {
let str = ''
str = this.currentDate + ' ' + this.currentHour + ':' + this.currentMinute + ":00"
const result = dayjs(str).format('YYYY/MM/DD HH:mm:ss')
return result
}
}
}
</script>
<style scoped lang='scss'>
.date-list {
height: 100%;
display: grid;
grid-template-columns: repeat(3, 1fr);
.picker {
height: 100%;
text-align: center;
.view {
display: flex;
align-items: center;
justify-content: center;
font-size: toRpx(32);
height: toRpx(72);
}
}
/deep/.indicator{
height: toRpx(72);
}
}
</style>
\ No newline at end of file
<template>
<view class="merchant-list">
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i)"
:class="['item flex',{active: currentId ? i.subMerchantId == currentId : i.subMerchantId == data[params.idKey]}]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{i.subMerchantName}}
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'DiversionMerchant',
data () {
return {
}
},
mounted () {
},
methods: {
async getList () {
const { userInfo: { shopMerchantId }, params } = this,
{ cacheData } = params
this.currentId = ''
if (cacheData && cacheData.length) {
this.initData(cacheData)
return
}
const data = await uni.$api.popupApi.getDiversionMerchantRef({
merchantId: shopMerchantId
})
this.updateParams(params, data || [])
},
initData (data) {
this.list = data
this.$emit('onComplete')
},
choose (i) {
this.currentId = i.subMerchantId
this.$emit('choose', i)
}
}
}
</script>
<style scoped lang='scss'>
.merchant-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>
\ No newline at end of file
<template>
<view class="employee-list">
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i)"
:class="['item flex',{active: currentId ? i.uuid == currentId : i.uuid == data[params.idKey]}]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{i.staffName}}
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'EmployeeList',
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
}
const { shopMerchantId, sceneType, merchantId } = userInfo,
data = await uni.$api.popupApi.getEmployeeList({
merchantId: params.idKey == 'sellerUserId' ? merchantId : shopMerchantId,
sceneList: params.idKey == 'sellerUserId' ? '' : [sceneType],
name: searchValue
})
this.updateParams(params, data || [])
},
initData (data) {
this.list = data
this.$emit('onComplete')
},
handleSearch (searchValue) {
this.list = []
this.getList(searchValue, true)
},
choose (i) {
let { params: { idKey }, data } = this,
value = {
userId: data.deliveryUserId,
deliveryUserId: data.userId
}[idKey]
if ((idKey == 'userId' || idKey == 'deliveryUserId') && value == i.uuid) return uni.showToast({
title: '销售顾问/录单员与交付专员不能选取同一人',
icon: 'none',
mask: true
})
this.currentId = i.uuid
this.$emit('choose', i)
}
}
}
</script>
<style scoped lang='scss'>
.employee-list {
display: grid;
grid-template-columns: repeat(4, 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>
\ No newline at end of file
<template>
<view class="goods-list">
<template v-if="params.loadComplete">
<template v-if="listData.length">
<template v-for="(item, index) in listData">
<view
:key="index"
@click="choose(item)"
:class="['item',{active: checkActive(item)}]"
>
<view class="title flex">
<view class="icon flex">
<uni-icons
type="circle"
:size="20"
color="#8C8C8C"
class="circle"
></uni-icons>
<uni-icons
type="checkbox-filled"
:size="20"
color="#2c66f7"
class="filled"
></uni-icons>
</view>
{{item.packageGoods.packageAlias||item.packageGoods.packageName}}
<text class="price">¥{{item.packageGoods.upgradePrice}}</text>
</view>
<view class="package-list">
<template v-for="(i,ind) in item.packageGoods.goodsList">
<view
class="package-item flex"
:key="ind"
>
<view class="name">{{i.goodsAlias||i.upgradeGoodsAlias||i.upgradeGoodsName}}</view>
<view class="price">¥{{i.sellPrice}}</view>
</view>
</template>
</view>
</view>
</template>
</template>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
import NP from 'number-precision'
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'PackageList',
data () {
return {
}
},
mounted () {
},
methods: {
async getList (searchValue) {
const { userInfo, params } = this,
{ cacheData } = params
this.currentIds = []
this.chooseList = []
if (cacheData && cacheData.length) {
this.initData(cacheData)
if (searchValue) this.handleSearch(searchValue)
return
}
const { shopMerchantId, sceneType } = userInfo,
data = await uni.$api.popupApi.getGoodsList({
merchantId: shopMerchantId,
sceneType
})
this.updateParams(params, data || [])
},
handleSearch (searchValue) {
if (!searchValue) this.searchStatus = false
else {
let { list } = this,
goodsList = JSON.parse(JSON.stringify(list)),
arr = []
goodsList.map(c => {
let name = ''
if (c.goodsFlag == 3 && c.packageGoods) name = c.packageGoods.packageName || c.packageGoods.packageAlias
if (name.indexOf(searchValue) != -1) {
arr.push(c)
}
})
this.searchList = arr
this.searchStatus = true
}
},
initData (goodsData) {
let { data, dataKey } = this,
arr = []
goodsData.map(val => {
if (val.goodsFlag == 3) {
val.packageGoods.upgradePrice = NP.round(val.packageGoods.goodsList.reduce((prev, cur) => {
prev = NP.plus(prev + cur.sellPrice);
return prev;
}, 0), 2)
arr.push(val)
}
})
let paramsData = dataKey ? data[dataKey] : data
if (paramsData && paramsData.length) paramsData.map(e => {
this.currentIds.push(e.packageGoods.packageCode)
this.chooseList.push(e)
})
this.$emit('onComplete')
this.list = arr
},
choose (i) {
let { packageCode } = i.packageGoods,
{ currentIds } = this,
index = currentIds.indexOf(packageCode)
if (index == -1) {
this.currentIds.push(packageCode)
this.chooseList.push(i)
}
else {
this.currentIds.splice(index, 1)
this.chooseList.splice(index, 1)
}
this.$emit('choose', this.chooseList)
},
replaceItemText (item, key) {
let reg = getRegExp(';~;', 'g'),
value = item[key]
return value ? value.replace(reg, ' ') : ''
},
checkActive (i) {
let { currentIds } = this,
active = false
if (currentIds.length) active = currentIds.includes(i.packageGoods.packageCode)
return active
}
}
}
</script>
<style scoped lang='scss'>
.goods-list {
display: flex;
flex-direction: column;
gap: toRpx(32) 0;
margin: 0 toRpx(48);
.item {
justify-content: center;
border-radius: toRpx(24);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
box-sizing: border-box;
padding: 0 toRpx(32) toRpx(24);
.price {
margin-left: auto;
}
.title {
height: toRpx(88);
padding: toRpx(24) 0 toRpx(20);
.icon {
margin-right: toRpx(16);
}
.filled {
display: none;
}
}
.package-list {
border-radius: toRpx(16);
background-color: #f5f7fa;
padding-left: toRpx(32);
overflow: hidden;
.package-item {
color: #333333;
font-size: toRpx(28);
line-height: toRpx(40);
padding: toRpx(24) 0;
border-bottom: toRpx(2) solid #f0f0ef;
padding-right: toRpx(32);
.price {
margin-left: auto;
}
&:last-of-type {
border: none;
}
}
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.icon {
.circle {
display: none;
}
.filled {
display: block;
}
}
.package-list {
background: #fff;
}
}
}
</style>
\ No newline at end of file
<template>
<popup
ref="popup"
@onConfirm="confirm"
@onCancel="cancel"
>
<view class="popup-title flex">
确认需购买的商品
<view
class="popup-close flex"
@click="close"
>
<uni-icons
type="closeempty"
size="16"
></uni-icons>
</view>
</view>
<view class="popup-tips">温馨提示:请仔细确认当前售价,避免录错单</view>
<template v-if="data">
<view class="popup-body">
<scroll-view
scroll-y
class="popup-scroll-view"
>
<view class="goods-list">
<template v-for="(i, index) in data.multipleSpecificationsGoods.skuGoodsList">
<view
:key="index"
@click="choose(i)"
:class="['item flex',{active: i.goodsId == currentId }]"
>
<view class="sprite-icon icon-tag-checked"></view>
<view class="text">
<view class="name"> {{data.multipleSpecificationsGoods.baseGoodsName}}</view>
<view
class="alias"
v-if="i.goodsAlias"
>
商品别名:{{i.goodsAlias}}
</view>
<view
class="position"
v-if="i.specificationStr "
>{{i.specificationStr}}</view>
</view>
<view class="price">¥<text class="price-num">{{i.sellPrice}}</text>x1</view>
</view>
</template>
</view>
</scroll-view>
</view>
</template>
</popup>
</template>
<script type='text/ecmascript-6'>
import Popup from '@/components/Popup.vue'
export default {
components: {
Popup,
},
name: 'SkuPopup',
props: {
},
data () {
return {
data: null,
currentId: ''
}
},
mounted () {
},
methods: {
open (data) {
this.currentId = ''
this.data = data
this.$nextTick(() => {
this.$refs.popup.open()
})
},
cancel () {
this.$refs.popup.close()
this.$emit('cancel')
},
close () {
this.$refs.popup.close()
this.$emit('close')
},
choose (i) {
let { currentId } = this
if (currentId == i.goodsId) {
this.currentId = ''
return
}
this.currentId = i.goodsId
},
confirm () {
let { currentId, data } = this
if (!currentId || !data) return uni.showToast({
title: '请勾选商品',
icon: 'none',
})
let { baseGoodsName, id, specificationGoodsMap, specificationList, skuGoodsList } = data.multipleSpecificationsGoods
let goods = skuGoodsList.find(e => e.goodsId == currentId)
this.$emit('onConfirm', {
count: 1,
goods: null,
goodsFlag: 2,
isFlag: true,
multipleSpecificationsGoods: {
baseGoodsName,
id,
specificationGoodsMap,
specificationList,
goods
}
})
this.close()
},
}
}
</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(350)});
.popup-scroll-view {
height: 100%;
padding-top: toRpx(24);
.goods-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
height: toRpx(176);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
box-sizing: border-box;
padding: 0 toRpx(32);
background: #f5f7fa;
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
.text {
color: #666666;
font-size: toRpx(24);
line-height: toRpx(36);
.name {
color: #333333;
font-size: toRpx(28);
font-weight: 500;
margin-bottom: toRpx(8);
line-height: toRpx(40);
}
.alias {
margin-bottom: toRpx(8);
}
}
.price {
margin-left: auto;
color: #333333;
font-size: toRpx(28);
font-weight: 500;
&-num {
margin-right: toRpx(16);
}
}
}
.active {
border-color: #4673ff;
background: #4673ff1a;
.sprite-icon {
display: block;
}
}
}
}
}
}
</style>
\ No newline at end of file
export default {
inject: ['userInfo', 'baseConfigData'],
data () {
return {
list: [],
searchStatus: false,
searchList: [],
chooseList: [],
currentId: '',
currentIds: [],
}
},
props: {
params: Object,
data: [Object, Array],
dataKey: String,
isDefeatOrder: Boolean,
positionTypeList: Array,
},
computed: {
listData () {
return this.searchStatus ? this.searchList : this.list
},
noData () {
return !this.listData.length
}
},
watch: {
noData: {
handler (val) {
let { params } = this
params.noData = val
this.updateParams(params)
},
deep: true
}
},
methods: {
updateParams (params, data) {
if (data) {
this.initData && this.initData(data)
params.cacheData = data
}
this.$emit('update:params', params)
}
}
}
\ No newline at end of file
/**
* popupType
* 0:销售顾问/录单员
* 1:交付专员
* 2:二级流量方
* 3:转化人员
* 4:车品牌
* 5: 礼券
* 6:前档
* 7:前侧窗玻璃
* 8:后侧窗玻璃
* 9:后档
* 10:天窗
* 11:套餐
* 12:其他精品
* 13:时间选择
*/
const componentConfig = {
0: {
name: 'EmployeeList',
title: '销售顾问/录单员',
placeholder: '请输入姓名',
idKey: 'userId',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
1: {
name: 'EmployeeList',
title: '交付专员',
placeholder: '请输入姓名',
nullTips: '请选择交付专员',
idKey: 'deliveryUserId',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
2: {
name: 'DiversionMerchant',
title: '二级流量方',
hideSearch: true,
idKey: 'subShopMerchantId',
cacheData: [],
loadComplete: false
},
3: {
name: 'EmployeeList',
title: '转化人员',
placeholder: '请输入姓名',
idKey: 'sellerUserId',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
4: {
name: 'CarModelList',
title: '选择车型',
placeholder: '查找',
idKey: 'carSeriesId',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
5: {
name: 'CouponList',
title: '选择礼券',
placeholder: '查找',
idKey: 'customerCouponCode',
nullTips: '优惠券不能为空',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
6: {
name: 'GoodsList',
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
nullTips: '请勾选商品',
goodsType: [1],//前档
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
7: {
name: 'GoodsList',
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
nullTips: '请勾选商品',
goodsType: [2], // 前侧窗玻璃
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
8: {
name: 'GoodsList',
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
nullTips: '请勾选商品',
goodsType: [3], // 后侧窗玻璃
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
9: {
name: 'GoodsList',
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
nullTips: '请勾选商品',
goodsType: [4],// 后档
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
10: {
name: 'GoodsList',
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
nullTips: '请勾选商品',
goodsType: [5, 6, 7],// 天窗
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
11: {
name: 'PackageList',
title: '选择套餐',
placeholder: '查找',
nullTips: '请勾选套餐',
idKey: 'packageCode',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
12: {
name: 'SkuGoodsList',
title: '选择商品',
nullTips: '请勾选商品',
placeholder: '查找',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
13: {
name: 'DateTime',
title: '选择时间',
hideSearch: true,
loadComplete: false
}
}
export default { componentConfig }
\ No newline at end of file
<template>
<view class="order-popup">
<popup
:position="position"
:animation="animation"
ref="popup"
@onConfirm="confirm"
@onCancel="cancel"
>
<view class="popup-title flex">
{{title}}
<view
class="popup-close flex"
@click="close"
>
<uni-icons
type="closeempty"
size="16"
></uni-icons>
</view>
</view>
<template v-if="!componentObject[popupType].hideSearch">
<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"
>
<view
class="clear flex"
@click="clear"
>
<uni-icons
type="closeempty"
size="16"
v-if="componentObject[popupType].searchValue"
></uni-icons>
</view>
</view>
</template>
<view :class="['popup-body',{ 'hide-search' :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"
:positionTypeList="positionTypeList"
ref="componentRef"
@choose="chooseContent = $event"
@openSkuPopup="openSkuPopup"
@onComplete="componentObject[popupType].loadComplete = true"
></component>
<template v-if="componentObject[popupType].noData">
<view class="nothing flex">暂无数据</view>
</template>
</scroll-view>
<image
v-if="!componentObject[popupType].loadComplete"
class="loading"
src="../../assets/images/common/loadding.gif"
/>
</view>
</popup>
<sku-popup
ref="skuPopupRef"
@onConfirm="skuConfirm"
></sku-popup>
</view>
</template>
<script type='text/ecmascript-6'>
import Popup from '@/components/Popup.vue'
import config from './config'
import EmployeeList from './components/EmployeeList.vue'
import DiversionMerchant from './components/DiversionMerchant.vue'
import CarModelList from './components/CarModelList.vue'
import CouponList from './components/CouponList.vue'
import GoodsList from './components/GoodsList.vue'
import PackageList from './components/PackageList.vue'
import SkuGoodsList from './components/SkuGoodsList.vue'
import SkuPopup from './components/SkuPopup.vue'
import DateTime from './components/DateTime.vue'
export default {
components: {
Popup,
EmployeeList,
DiversionMerchant,
CarModelList,
CouponList,
GoodsList,
PackageList,
SkuGoodsList,
SkuPopup,
DateTime
},
name: '',
props: {
animation: {
type: Boolean,
default: true
},
maskClick: {
type: Boolean,
default: false
},
popupType: {
type: [Number, String],
default: 0
},
data: [Object, Array],
externalData: null,
dataKey: String,
isDefeatOrder: {
type: Boolean,
default: false
}
},
provide () {
return {
userInfo: this.userInfo,
baseConfigData: this.baseConfigData,
}
},
data () {
return {
position: 'bottom',
chooseContent: null,
componentObject: JSON.parse(JSON.stringify(config.componentConfig)),
positionTypeList: []
}
},
watch: {
popupType: {
handler (val) {
if (val == 11 || val == 12) this.position = 'right'
else this.position = 'bottom'
},
deep: true,
immediate: true
},
externalData: {
handler (val) {
if (val && val.length && this.componentObject[this.popupType]) {
this.componentObject[this.popupType].cacheData = val
}
},
deep: true,
immediate: true
},
isDefeatOrder: {
async handler (val) {
if (val) {
this.positionTypeList = await uni.$api.popupApi.getPositionList()
}
},
immediate: true
}
},
computed: {
title () {
return config.componentConfig[this.popupType].title
},
userInfo () {
return uni.$storage.get("userInfo")
},
baseConfigData () {
return this.$store.state.boutique.baseConfigData
}
},
mounted () {
},
methods: {
componentRef () {
return this.$refs.componentRef
},
open () {
this.$refs.popup.open()
this.initPopupData()
},
cancel () {
this.$refs.popup.close()
this.$emit('cancel')
},
close () {
this.$refs.popup.close()
this.$emit('close')
},
initPopupData () {
let componentRef = this.componentRef()
if (!componentRef) setTimeout(this.initPopupData, .1e3)
else componentRef.getList && componentRef.getList(this.componentObject[this.popupType].searchValue)
},
handleSearch () {
let componentRef = this.componentRef()
if (!componentRef) uni.showToast({
title: '请稍后再试',
icon: 'none'
})
else componentRef.handleSearch(this.componentObject[this.popupType].searchValue)
},
confirm () {
try {
let { chooseContent, popupType, componentObject } = this
if (popupType == 13) {
chooseContent = this.componentRef().getResult()
}
if (chooseContent) {
if (Array.isArray(chooseContent) && !chooseContent.length && componentObject[popupType].nullTips) throw componentObject[popupType].nullTips
this.$emit('onConfirm', {
chooseContent,
popupType
})
this.$refs.popup.close()
} else {
if (componentObject[popupType].nullTips) throw componentObject[popupType].nullTips
}
} catch (error) {
if (error) uni.showToast({
title: error,
icon: 'none'
})
}
},
openSkuPopup (data, chooseList) {
if (chooseList.length) this.confirm()
else this.$refs.popup.close()
this.$refs.skuPopupRef.open(data)
},
skuConfirm (e) {
this.$emit('onConfirm', {
chooseContent: [e],
popupType: 12
}, true)
},
clear () {
this.componentObject[this.popupType].searchValue = ''
this.handleSearch()
},
}
}
</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-search {
height: toRpx(80);
border-radius: toRpx(40);
background: #f5f7fa;
margin: 0 toRpx(48);
position: relative;
.input {
height: 100%;
width: 100%;
text-align: center;
color: #333;
font-size: toRpx(32);
}
.placeholder {
height: 100%;
color: #999ea8;
font-family: uniicons;
display: flex;
align-items: center;
justify-content: center;
&::after {
display: block;
content: '\e654';
margin-left: toRpx(8);
height: 100%;
display: flex;
align-items: center;
font-size: toRpx(36);
}
}
.clear {
position: absolute;
right: 0;
top: 0;
height: 100%;
padding: 0 toRpx(48);
}
}
.popup-body {
height: calc(100% - #{toRpx(392)});
position: relative;
.popup-scroll-view {
height: 100%;
padding-top: toRpx(32);
opacity: 0;
}
.loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: toRpx(64);
height: toRpx(64);
}
.show {
opacity: 1;
}
}
.hide-search {
height: calc(100% - #{toRpx(280)});
}
.popup-footer {
padding: toRpx(64) 0;
justify-content: center;
gap: 0 toRpx(32);
.popup-btn {
display: flex;
align-items: center;
justify-content: center;
width: toRpx(720);
height: toRpx(80);
border-radius: toRpx(64);
background: #f0f1f5;
color: #333333;
font-size: toRpx(32);
font-weight: 500;
}
.popup-confirm {
color: #fff;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
}
}
.nothing {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
justify-content: center;
}
}
.right-box {
width: 46vw;
height: 100vh;
border-radius: toRpx(32) 0 0 toRpx(32);
.popup-footer {
margin: 0 toRpx(48);
}
}
</style>
\ No newline at end of file
<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 == 'sellerUserIdList' ? merchantId : shopMerchantId,
sceneList: params.idKey == 'sellerUserIdList' ? '' : [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>
\ 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="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 {
list: Object.freeze([
{
name: '待跟进',
value: [1],
id: 1
},
{
name: '已支付',
value: [4],
id: 2
},
{
name: '待支付',
value: [3],
id: 3
},
{
name: '已撤销',
value: [9],
id: 4
},
{
name: '战败',
value: [2],
id: 5
},
{
name: '已评价',
value: [6],
id: 6
},
{
name: '已关闭',
value: [10],
id: 7
},
{
name: '已失效',
value: [11],
id: 8
},
{
name: '未施工',
value: ['N'],
id: 9
},
{
name: '已施工',
value: ['Y'],
id: 10
},
{
name: '已退款',
value: [5, 12],
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
if (data[idKey]) {
let item = list.find(val => val.value.join(',') == data[idKey].join(','))
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>
\ 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="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
<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"
/>
</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
const screenList = [
{
title: '转化人员',
suffix: 'merchantName',
componentName: 'EmployeeList',
params: {
cacheData: [],
idKey: 'sellerUserIdList'
},
hasToggle: true,
toggle: false
},
{
title: '销售顾问',
suffix: 'shopMerchantName',
componentName: 'EmployeeList',
params: {
cacheData: [],
idKey: 'userIdList'
},
hasToggle: true,
toggle: false
},
{
title: '订单时间',
componentName: 'TimeList',
params: {
idKey: ['placeOrderStartDateStr', 'placeOrderEndDateStr'],
currentIdKey: 'orderTimeId',
},
},
{
title: '支付时间',
componentName: 'TimeList',
params: {
idKey: ['installUpgradeBeginTimeStr', 'installUpgradeEndTimeStr'],
currentIdKey: 'payTimeId',
},
},
{
title: '订单状态',
componentName: 'OrderStatusList',
params: {
idKey: 'statusList'
}
},
{
title: '支付方式',
componentName: 'PayList',
params: {
idKey: 'payType'
}
},
]
export default { screenList }
\ No newline at end of file
<template>
<popup
ref="popup"
@onConfirm="confirm"
@onCancel="clear"
cancelText="清除"
>
<view class="popup-title flex">
工单筛选
<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"
/>
</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'
export default {
components: {
Popup,
EmployeeList,
TimeList,
OrderStatusList,
PayList
},
name: 'OrderScreen',
props: {
},
data () {
return {
screenList: config.screenList,
chooseContent: {},
viewKey: Date.now(),
onCompleteNum: 0
}
},
provide () {
return {
userInfo: this.userInfo,
}
},
computed: {
userInfo () {
return uni.$storage.get("userInfo")
},
loadComplete () {
return this.onCompleteNum == this.screenList.length
}
},
mounted () {
},
methods: {
open (data) {
this.$refs.popup.open()
},
clear () {
this.chooseContent = {}
this.viewKey = Date.now()
},
close () {
this.$refs.popup.close()
},
choose (i) {
let { key, value, keys, currentIdKey, currentId } = i,
{ chooseContent } = this
if (keys) {
if (currentIdKey) chooseContent[currentIdKey] = currentId || ''
keys.map(e => {
if (value[e]) chooseContent[e] = value[e]
else delete chooseContent[e]
})
} else {
if (value) chooseContent[key] = value
else delete chooseContent[key]
}
},
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') chooseContent[e] = `${chooseContent[e]} 00:00:00`
if (e == 'placeOrderEndDateStr' || e == 'installUpgradeEndTimeStr') chooseContent[e] = `${chooseContent[e]} 23:59:59`
})
this.$emit('onConfirm', chooseContent)
this.close()
},
onComplete () {
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>
\ No newline at end of file
<template>
<uni-popup
ref="popup"
:type="position"
:is-mask-click="maskClick"
:animation="animation"
>
<view :class="['popup-box',{'right-box':position=='right'}]">
<slot></slot>
<view class="popup-footer flex">
<view
class="popup-btn popup-cancel"
@click="cancel"
>{{cancelText}}</view>
<view
class="popup-btn popup-confirm"
@click="confirm"
>{{confirmText}}</view>
</view>
</view>
</uni-popup>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'Popup',
props: {
animation: {
type: Boolean,
default: true
},
maskClick: {
type: Boolean,
default: false
},
position:{
type: String,
default: 'bottom'
},
cancelText: {
type: String,
default: '取消'
},
confirmText:{
type: String,
default: '确定'
}
},
data () {
return {
}
},
computed: {
},
mounted () {
},
methods: {
open () {
this.$refs.popup.open()
},
cancel () {
this.$emit('onCancel')
},
close () {
this.$refs.popup.close()
this.$emit('close')
},
confirm () {
this.$emit('onConfirm')
},
}
}
</script>
<style scoped lang='scss'>
.popup-box {
border-radius: 32rpx 32rpx 0 0;
background: #ffffff;
height: 70vh;
.popup-footer {
padding: 64rpx 0;
justify-content: center;
gap: 0 32rpx;
.popup-btn {
display: flex;
align-items: center;
justify-content: center;
width: 720rpx;
height: 80rpx;
border-radius: 64rpx;
background: #f0f1f5;
color: #333333;
font-size: 32rpx;
font-weight: 500;
}
.popup-confirm {
color: #fff;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
}
}
}
.right-box {
width: 46vw;
height: 100vh;
border-radius: 32rpx 0 0 32rpx;
.popup-footer {
margin: 0 48rpx;
}
}
</style>
\ No newline at end of file
<!--针对弹窗穿透滚动,统一封装的popup-->
<template>
<page-meta :page-style="'overflow:' + (show ? 'hidden' : 'visible')"></page-meta>
<uni-popup :class="popupClass" ref="publishPopup" :type="type" @change="change" :is-mask-click="isMaskClick" :safe-area="safeArea" :showClose="showClose">
<!-- 顶部标题栏插槽 -->
<slot name="header">
<view class="popup-top-box flex align-center" v-if="showTitle">
<text class="popup-top-box-title">{{ title }}</text>
<view @click.stop="closePopup">
<uni-icons class="icon-close" type="closeempty"></uni-icons>
</view>
</view>
</slot>
<!-- 主要内容插槽 -->
<slot name="content"></slot>
<!-- 底部插槽 插槽有内容就优先自定义内容-->
<slot name="footer">
<view class="footer-box flex justify-center" v-if="isShowFooter">
<view class="cancle-btn btn" @click.stop="closePopup">{{ cancelText }}</view>
<view class="sure-btn btn" @click.stop="confirm">{{ confirmText }}</view>
</view>
</slot>
</uni-popup>
</template>
<script>
export default {
name: 'PublishPopup',
props: {
type: {
type: String,
default: 'bottom'
},
isMaskClick: {
type: Boolean,
default: true
},
safeArea: {
type: Boolean,
default: true
},
popupClass: {
type: String,
default: ''
},
showClose: {
type: Boolean,
default: true
},
title: {
type: String,
default: ''
},
showTitle: {
type: Boolean,
default: true
},
isShowFooter: {
type: Boolean,
default: true
},
cancelText: {
type: String,
default: '取消'
},
confirmText: {
type: String,
default: '确定'
}
},
data() {
return {
show: false
}
},
methods: {
open() {
this.$nextTick(() => {
console.log(this.$refs)
if (this.$refs.publishPopup) {
this.$refs.publishPopup.open()
}
})
return new Promise((resolve, reject) => {
this.resolve = resolve
this.reject = reject
})
},
change(e) {
this.show = e.show
},
closePopup() {
this.$refs.publishPopup.close()
if (this.reject) {
this.reject(null)
}
this.$emit('close')
},
confirm() {
if (this.resolve) {
this.$refs.publishPopup.close()
this.resolve()
}
this.$emit('confirm')
}
}
}
</script>
<style scoped lang="scss">
.popup-top-box {
color: #333333;
font-size: toRpx(36);
font-weight: 500;
text-align: center;
padding: toRpx(32);
.popup-top-box-title {
flex: 1;
}
.icon-close {
text-align: end;
}
}
.justify-between {
-webkit-box-pack: justify;
-ms-flex-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
}
.align-center {
align-items: center;
}
.uniui-closeempty {
color: #1a1a1a;
font-size: toRpx(24);
font-weight: 600;
}
.footer-box {
width: 100%;
height: toRpx(164);
background-color: #fff;
position: absolute;
border-radius: 0 0 toRpx(42) toRpx(42);
bottom: 0;
.btn {
width: 40%;
height: toRpx(80);
border-radius: toRpx(48);
opacity: 1;
line-height: toRpx(80);
text-align: center;
color: rgba(26, 26, 26, 0.6);
font-size: toRpx(32);
font-weight: 500;
}
.cancle-btn {
background: #f0f1f5;
}
.sure-btn {
color: #fff;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
margin-left: toRpx(32);
}
}
</style>
......@@ -2,8 +2,8 @@
"name" : "展业助手",
"appid" : "__UNI__D3BD3DF",
"description" : "",
"versionName" : "2.12.0",
"versionCode" : "2120",
"versionName" : "2.13.0",
"versionCode" : "2130",
"transformPx" : false,
"sassImplementationName" : "node-sass",
/* 5+App特有相关 */
......
......@@ -2,9 +2,11 @@ import loginMixin from './loginMixin'
import receptionTrackMixin from './receptionTrackMixin'
import aiUrlMixin from './aiUrlMixin'
import report from './report'
import interceptionMixin from './interceptionMixin'
module.exports = {
loginMixin,
receptionTrackMixin,
aiUrlMixin,
report
report,
interceptionMixin
}
let modalQueue = [],
eventRequest = []
export default {
data () {
return {}
},
computed: {
userInfo () {
return uni.$storage.get('userInfo') || {}
}
},
mounted () { },
methods: {
async checkDailyReport () {
modalQueue = []
eventRequest = []
let { sceneType, isSuper, loginRole } = this.userInfo
if (!(isSuper || loginRole == 3 || loginRole == 5 || loginRole == 6)) {
// 判断员工是否已打卡上班
eventRequest.push(this.clockedIntoWork())
let apiName = {
0: this.equityStaffDailyReport,
1: this.staffDailyReport
}
eventRequest.push(apiName[sceneType]())
}
return new Promise(resolve => {
Promise.all(eventRequest).then(results => {
results = results.slice(-2)
let resultFlag = results.some(item => item)
this.showNextModal()
resolve(resultFlag)
})
})
},
showNextModal () {
if (modalQueue.length > 0) {
const modalInfo = modalQueue.pop()
// if (wx.__HAS_SHOW_MODAL) return;
// wx.__HAS_SHOW_MODAL = true;
uni.showModal({
title: modalInfo.title,
content: modalInfo.content,
showCancel: modalInfo.showCancel,
cancelColor: '#292D33',
confirmText: modalInfo.confirmText,
confirmColor: '#347BFF',
success: function (res) {
// wx.__HAS_SHOW_MODAL = false;
// if (res.cancel) _this.showNextModal();
if (res.cancel) showNextModal()
modalInfo.eventCallback(res)
}
})
}
},
staffDailyReport () {
let { userInfo } = this
return new Promise((resolve, reject) => {
uni.$api.interceptionApi
.staffDailyReportMerchantValid({
merchantId: userInfo.shopMerchantId,
yqMerchantId: userInfo.merchantId,
staffUuid: userInfo.uuid,
sceneType: 1
})
.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) {
console.log(formattedDate)
const pages = getCurrentPages(),
currentPage = pages[pages.length - 1]
if (currentPage.route == 'pages/boutique/tool/index') uni.$emit('jumpToDailyReport',formattedDate)
else uni.navigateTo({
url: `/pages/boutique/tool/index?componentName=DailyReport&currentDate=${formattedDate}`
})
}
})
resolve(true)
} else {
resolve(false)
}
})
.catch(err => {
resolve()
})
})
},
clockedIntoWork () {
return new Promise((resolve, reject) => {
uni.$api.interceptionApi
.clockInConfigPhone({})
.then(res => {
let { need, clockIn } = res
// 已配置未打卡
if (need == 1 && clockIn == 0) {
// 有配置并且没有打卡就提示
this.addModalToQueue('打卡提醒', '您当前企微未打卡,无法录单,请前往企微打卡后再试,如有异议请联系管理员。', '知道了', false, 4, res => {
if (res.confirm) {
// wx.$router.go("tabWorkOrder.staffDaily", {
// // reportDate: formattedDate,
// });
}
})
resolve(true)
} else {
resolve(false)
}
})
.catch(err => {
resolve(false)
})
})
},
equityStaffDailyReport () { },
addModalToQueue (title, content, confirmText, showCancel, priority, eventCallback) {
if (modalQueue.findIndex(val => val.content == content) < 0)
modalQueue.push({
title,
content,
confirmText,
showCancel,
priority,
eventCallback
})
modalQueue.sort((a, b) => a.priority - b.priority)
},
/**
* 查询当前员工处罚情况
*/
async inspectionOfProhibitionBill () {
const data = await uni.$api.interceptionApi.checkStaffStudyPunish()
if (data)
uni.showModal({
title: '温馨提示',
content: '未完成学习任务,禁止提单!\n请在平板电脑上展业助手-学习中心完成学习。',
showCancel: false,
cancelColor: '#292D33',
confirmText: '确定',
confirmColor: '#347BFF'
})
return Promise.resolve(data)
}
}
}
......@@ -183,6 +183,12 @@
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/boutique/tool/index",
"style": {
"navigationStyle": "custom"
}
}
],
"globalStyle": {
......
......@@ -224,7 +224,6 @@ export default {
}
} catch (e) {
// 可选:错误处理
console.error('上传埋点失败', e)
} finally {
}
},
......
......@@ -221,7 +221,9 @@ export default {
},
// 查询素材
async getSoure () {
let { moduleList, toolList, defaultCarId } = await uni.$api.systemApi.getBoutiqueMockData(true)
let baseConfigData = await uni.$api.systemApi.getBoutiqueMockData(true),
{ moduleList, toolList, defaultCarId } = baseConfigData
this.$store.state.boutique.baseConfigData = baseConfigData
this.moduleList = moduleList
this.toolList = toolList
this.defaultCarId = defaultCarId
......
module.exports = {
data: {
orderObj: [
{
label: '工单编号',
key: 'orderCode',
copy: true
},
{
label: '工单时间',
key: 'time',
dateChange: true
},
{
label: '工单状态',
key: 'status',
color: '#14CC68',
status: true
},
{
label: '支付方式',
key: 'payType',
payType: true
}
],
customerObj: [
{
label: '客户姓名',
key: 'customerName'
},
{
label: '性别',
key: 'customerSex',
enum: {
1: '男',
2: '女'
}
},
{
label: '手机号',
key: 'customerPhone',
color: '#347BFF',
callBack: 'makePhoneCall',
copy: true
},
{
label: '车型',
key: 'carType'
},
{
label: '车架号',
key: 'standNo'
},
{
label: '车牌号',
key: 'plateNumber'
},
{
label: '是否体验',
key: 'experienceFlag',
enum: {
Y: '是',
N: '否'
}
},
{
label: '销售顾问',
arr: ['merchantName', 'employeeName']
},
{
label: '转化专员',
arr: ['sellerMerchantName', 'sellerName']
},
{
label: '备注',
key: 'remark'
}
],
payType: {
0: '战败',
1: '微信支付',
2: '门店收款',
3: 'pos机支付',
4: '支付宝支付',
5: '嘀加收款',
6: '对公转账',
7: '其它收款'
},
orderType: [
{
name: '全部',
active: true,
value: []
},
{
name: '升级下单',
value: [1, 2, 3, 4, 6]
},
{
name: '核销抵扣',
value: [5]
}
],
status: {
12: {
text: '已退款',
color: '#8F959E'
},
11: {
text: '已失效',
color: '#8F959E',
background: ' #F3F4F5'
},
10: {
text: '已关闭',
color: '#8F959E'
},
9: {
text: '已撤销',
color: '#8F959E',
background: '#F0F0F0'
},
1: {
text: '待跟进',
color: '#FF9D0A',
background: '#FFF5E6'
},
2: {
text: '战败',
color: '#F24724',
background: '#FDECE9'
},
3: {
text: '待支付',
color: '#FF9D0A',
background: '#FFF5E6'
},
4: {
text: '已支付',
color: '#35C376',
background: '#EAF9F1'
},
6: {
text: '已评价',
color: '#347BFF',
background: '#EAF1FF'
}
},
// 订单状态 1 待跟进, 2 不升级, 3 待支付,4 已支付,6 已评价 , 9 已撤销
statusList: [
{
name: '待跟进',
value: [1]
},
{
name: '已支付',
value: [4]
},
{
name: '待支付',
value: [3]
},
{
name: '已撤销',
value: [9]
},
{
name: '战败',
value: [2]
},
{
name: '已评价',
value: [6]
},
{
name: '已关闭',
value: [10]
},
{
name: '已失效',
value: [11]
}
],
grassInfo: {},
orderCode: '',
userInfo: {}
}
}
<template>
<uni-popup ref="popup" type="center" border-radius="16px" :mask-click="false">
<view class="popup-content" :class="[`popup-${type}`]">
<view class="popup-icon">
<image
:src="require(`../../../../assets/images/common/${type}-notice.png`)"
mode="aspectFit"
class="icon-image"
/>
</view>
<view class="popup-title">{{ title }}</view>
<view class="popup-text">{{ text }}</view>
<view class="popup-buttons">
<view
v-for="(button, index) in buttonsList"
:key="index"
class="popup-button"
:class="[
`button-${button.type || 'default'}`,
{ 'single-button': buttonsList.length === 1 }
]"
@click="handleButtonClick(button)"
>
{{ button.text }}
</view>
</view>
</view>
</uni-popup>
</template>
<script>
export default {
props: {
// 弹窗类型:success, error, warning, info
type: {
type: String,
default: 'info'
},
// 弹窗标题
title: {
type: String,
default: 'warning'
},
// 弹窗内容
text: {
type: String,
default: ''
},
// 按钮配置
buttons: {
type: Array,
default: () => [{
text: '确认',
type: 'primary',
callback: null
}]
}
},
data() {
return {
popupShow: false,
buttonsList: []
}
},
methods: {
open() {
this.$refs.popup.open("center");
},
close() {
this.$refs.popup.close()
},
// 处理按钮点击事件
handleButtonClick(button) {
if (typeof button.callback === 'function') {
button.callback()
} else {
this.close()
}
// 触发点击事件,传递按钮信息
this.$emit('buttonClick', button)
}
},
// 监听props变化,更新本地数据
watch: {
buttons: {
immediate: true,
handler(newVal) {
if (newVal) {
this.buttonsList = JSON.parse(JSON.stringify(newVal))
}
}
}
},
created() {
// 初始化时将buttons赋值给buttonsList
this.buttonsList = JSON.parse(JSON.stringify(this.buttons))
}
}
</script>
<style scoped lang="scss">
.popup-content {
background-color: #fff;
border-radius: toRpx(38);
width: toRpx(848);
height: toRpx(660);
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
overflow: hidden;
}
.popup-icon {
width: 100%;
margin-bottom: toRpx(48);
.icon-image {
width: 100%;
height: toRpx(248);
// border-radius: toRpx(38) toRpx(38) 0 0;
}
}
.popup-title {
font-size: toRpx(40);
font-weight: 500;
color: #333;
margin-bottom: toRpx(16);
text-align: center;
}
.popup-text {
font-size: 28rpx;
color: #666;
text-align: center;
margin-bottom: 32rpx;
line-height: 1.5;
}
.popup-buttons {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
gap: toRpx(32);
margin-top: auto;
height: toRpx(160);
}
.popup-button {
flex: 1;
height: toRpx(80);
line-height: toRpx(80);
text-align: center;
border-radius: toRpx(40);
font-size: toRpx(28);
max-width: toRpx(344);
&.single-button {
max-width: toRpx(688);
}
}
.button-primary {
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #fff;
}
.button-default {
background-color: #f5f5f5;
color: #333;
}
.button-danger {
background-color: #f45001;
color: #fff;
}
</style>
\ No newline at end of file
<template>
<view>
<view :class="[list.length > 0 ? 'package-list' : '']">
<view class="package-item" v-for="(item, index) in list" :key="index">
<view class="header">
<view class="header-left">
<view class="sprite-icon icon-blue-delete" @click="deleteGoods(index)"></view>
<view class="name">{{ item.packageGoods.packageAlias || item.packageGoods.packageName }}</view>
<view class="control">
<view class="minus" @click="decreaseNumber(item)">-</view>
<input class="uni-input control-input" type="number" maxlength="3" v-model="item.packageGoods.number" @blur="validateNumber($event, item)" />
<view class="add" @click="increaseNumber(item)">+</view>
</view>
</view>
<view class="price">¥{{ changeTotal(item) }}</view>
</view>
<view class="goods-item" v-for="(goods, ind) in item.packageGoods.goodsList" :key="ind">
<view class="goods-name">{{ goods.goodsAlias || goods.upgradeGoodsName }}</view>
<!-- <view class="alias-name">商品别名:阿尔法 T5极狐非三电整车延保(新车2年6万公里)</view> -->
<view class="front-gear-box">
<view class="front-gear-input-box">
<!-- <view class="front-gear-label" v-if="goods.merchantGoodsPosition || goods.goodsInfo.goodsTypeName">{{goods.goodsInfo.goodsType===1?formatPosition(goods.merchantGoodsPosition, positionTypeList):goods.goodsInfo.goodsTypeName}}</view> -->
<view class="front-gear-input">
<view class="unit">¥</view>
<input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="goods.sellPrice" @blur="validatePrice($event, goods, ind, index)" />
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'Package',
props: {
list: {
type: Array,
default: () => []
},
positionTypeList: {
type: Array,
default: []
}
},
created() {
// 初始化商品数量
this.initProductNumbers()
console.log(this.list, 'Package-list')
},
mounted() {
// 确保每次使用组件时都检查并设置number属性
this.initProductNumbers()
},
updated() {
// 当组件数据更新时也检查number属性
this.initProductNumbers()
console.log(this.list, 'Package-list2')
},
methods: {
// 初始化商品数量方法
initProductNumbers() {
if (this.list && this.list.length > 0) {
this.list.forEach(item => {
if (!item.packageGoods.number) {
this.$set(item.packageGoods, 'number', '1')
}
// 存储旧值
item.packageGoods.goodsList.forEach(goods => {
if (!goods.price) {
goods.oldPrice = goods.sellPrice
}
})
})
}
},
// // 格式化位置信息
// formatPosition(item, positionTypeList) {
// const filterData = positionTypeList.filter(v => v.positionValue == item)
// return (filterData.length && filterData[0] && filterData[0].positionName) || ''
// },
// 验证数量输入
validateNumber(event, item) {
let value = event.detail.value
// 限制只能输入整数
value = value.replace(/[^\d]/g, '')
// 如果为空或0,设置为1
if (!value || value.trim() === '' || parseInt(value) === 0) {
value = '1'
}
// 更新值
this.$set(item.packageGoods, 'number', value)
this.$emit('changeTotalPrice')
},
// 增加数量
increaseNumber(item) {
if (!item.packageGoods.number) {
this.$set(item.packageGoods, 'number', '1')
} else {
const currentValue = parseInt(item.packageGoods.number)
// 限制最大数量为999
const newValue = currentValue >= 999 ? 999 : currentValue + 1
this.$set(item.packageGoods, 'number', newValue.toString())
}
this.$emit('changeTotalPrice')
},
// 减少数量
decreaseNumber(item) {
// 如果商品数量不存在或小于等于1,设置为1
if (!item.packageGoods.number || parseInt(item.packageGoods.number) <= 1) {
this.$set(item.packageGoods, 'number', '1')
return
}
const currentValue = parseInt(item.packageGoods.number)
// 确保减少后的值不小于1
const newValue = Math.max(1, currentValue - 1)
this.$set(item.packageGoods, 'number', newValue.toString())
this.$emit('changeTotalPrice')
},
validatePrice(event, goods, ind, index) {
let value = event.detail.value
// 如果为空则设置为0
if (!value || value.trim() === '') {
value = '0'
}
// 限制只能输入数字和小数点
value = value.replace(/[^\d.]/g, '')
// 限制只能有一个小数点
if (value.split('.').length > 2) {
value = value.slice(0, value.lastIndexOf('.')) + value.slice(value.lastIndexOf('.') + 1)
}
// 限制最多两位小数
if (value.includes('.')) {
const parts = value.split('.')
if (parts[1].length > 2) {
parts[1] = parts[1].substring(0, 2)
value = parts.join('.')
}
}
// 限制最大值为100000
if (parseFloat(value) > 100000) {
value = '100000'
}
// 限制最小值为0
if (parseFloat(value) < 0 || parseFloat(value) == 0) {
value = '0'
}
// 如果validMinSellPrice为Y,则强制修改值为最小值
if (goods.validMinSellPrice === 'Y' && goods.minSellPrice && parseFloat(value) < parseFloat(goods.minSellPrice)) {
console.log('最小值', goods.minSellPrice)
uni.showToast({
title: '单价不可低于商品最低价',
icon: 'none'
})
value = goods.minSellPrice.toString()
}
// 更新值
this.$set(this.list[index].packageGoods.goodsList[ind], 'sellPrice', value)
this.$emit('changeTotalPrice')
},
// 删除商品
deleteGoods(index) {
this.list.splice(index, 1)
this.$emit('changeTotalPrice')
},
// 计算套餐的总价
changeTotal(item) {
let total = 0
item.packageGoods.goodsList.forEach(i => {
// total += parseFloat(i.sellPrice) * parseInt(item.packageGoods.number)
total += parseFloat(i.sellPrice)
})
item.packageGoods.upgradePrice = total
return total.toFixed(2)
}
}
}
</script>
<style scoped lang="scss">
.front-gear-box {
display: flex;
justify-content: space-between;
margin-top: toRpx(24);
.front-gear-input-box {
display: flex;
align-items: center;
.front-gear-label {
font-size: toRpx(24);
margin-right: toRpx(24);
color: #999999;
}
.front-gear-input {
position: relative;
display: flex;
border: toRpx(2) solid #eff0f2;
background-color: #fff;
font-size: toRpx(28);
height: toRpx(72);
width: toRpx(250);
line-height: toRpx(70);
text-align: right;
border-radius: toRpx(12);
.uni-input {
padding: 0 toRpx(32);
height: 100%;
}
.unit {
position: absolute;
top: 50%;
left: toRpx(32);
transform: translateY(-50%);
}
}
}
}
.package-list {
padding: toRpx(12) toRpx(32) toRpx(12) 0;
.package-item {
background-color: #f5f7fa;
border-radius: toRpx(16);
margin-bottom: toRpx(16);
.control {
margin-left: toRpx(32);
display: flex;
align-items: center;
.control-input {
width: toRpx(94);
height: toRpx(74);
background-color: #fff;
border: toRpx(2) solid #eff0f2;
padding: 0 toRpx(10);
text-align: center;
}
.minus,
.add {
width: toRpx(80);
height: toRpx(74);
line-height: toRpx(70);
text-align: center;
background-color: #fff;
border-top: toRpx(2) solid #eff0f2;
border-bottom: toRpx(2) solid #eff0f2;
}
.minus {
border-radius: toRpx(12) 0 0 toRpx(12);
border-left: toRpx(2) solid #eff0f2;
}
.add {
border-radius: 0 toRpx(12) toRpx(12) 0;
border-right: toRpx(2) solid #eff0f2;
}
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: toRpx(1.6) solid #dce1e6;
padding: toRpx(24);
&-left {
display: flex;
align-items: center;
font-size: toRpx(28);
.name {
margin-left: toRpx(26);
color: #333;
}
.price {
color: #666;
}
}
}
.goods-item {
padding: toRpx(24);
border-bottom: toRpx(1.6) solid #dce1e6;
&:last-child {
border-bottom: none;
}
.goods-name {
color: #ff781f;
font-size: toRpx(28);
}
.alias-name {
margin-top: toRpx(12);
font-size: toRpx(24);
color: #666;
}
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!