Commit 15bc5e09 by 前端

Merge branch 'dev_4.31.2' into 'master'

Dev 4.31.2

See merge request !197
2 parents b2ca2096 86f9f90c
......@@ -114,6 +114,7 @@ App({
if (res.confirm) {
that.globalData.yqdInfo = {}
that.globalData.YQorderSetting = ''
that.globalData.YQList = ''
util.removeStorage()
wx.$relogin = relogin
router.reLaunch('pages.wxLogin')
......@@ -131,6 +132,7 @@ App({
} else {
this.globalData.yqdInfo = {}
this.globalData.YQorderSetting = ''
this.globalData.YQList = ''
util.removeStorage()
removeSystemStorage()
wx.$relogin = relogin
......
......@@ -2,6 +2,7 @@
// import order_mixins from '../../tabWorkOrder/pages/order_mixins'
import { form } from './form'
import api from '../../api/api'
import { getYQList } from '~/store/index'
Component({
/**
* 组件的属性列表
......@@ -214,9 +215,11 @@ Component({
})
this.setTimeList()
this.getGoodsTypeList()
api.getYQList().then(res => {
let { code, data, message } = res
if (code == 0) {
getYQList().then(data => {
// debugger
console.log(data,'getYQList');
// let { code, data, message } = res
// if (code == 0) {
if (data.length > 0) {
console.log(userInfo,'userInfo');
this.setData({
......@@ -231,9 +234,9 @@ Component({
this.getConversionEmployeeList('', 0)
this.getServiceMerchantList()
}
} else {
wx.$util.showToast(message)
}
// } else {
// wx.$util.showToast(message)
// }
})
this.setOrderStatusList()
this.setInviteStatusList()
......
......@@ -218,7 +218,7 @@ Component({
if (!chooseList.length) return wx.$util.showToast('请勾选商品')
let thisPage = wx.$router.getPageInstance()
thisPage.setGoodsTotal&&thisPage.setGoodsTotal(chooseList)
thisPage?.setGoodsTotal&&thisPage.setGoodsTotal(chooseList)
// console.log(chooseList)
thisPage.setData({
goodsList: chooseList
......
......@@ -24,7 +24,10 @@ Component({
type: Number, //1.销售顾问,2.转化人员
// order:Object,
isDefault: Boolean, //
singleSeller:Boolean,
singleSeller:{
type: Boolean,
value: false
},
oderType: String
},
// 处理先要调用销售顾问接口再调用转化人员接口的问题
......
......@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd'
* 4预发布
* 5cdptest
*/
let index = 2
let index = 3
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
......
......@@ -36,7 +36,7 @@ Page({
type: 2,
typeText: '补录订单'
},
tabIndex: 1,
tabIndex: 0,
pageShow: [true, false, false, false],
navBarHeight: 0,
showPicker: false,
......
<!-- packageEquity/pages/carEquity/serviceInfo/serviceInfo.wxml -->
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack="{{ true }}" bindback="back">
<!-- showMenu="{{true}}" -->
<!-- bindtap="showStorePicker" -->
......
......@@ -26,7 +26,9 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options,'options');
let id = decodeURIComponent(options.scene).split('=')[1]
console.log(id,'id');
id ? this.qrCodeScene(id) : this.getListSelectAccount()
},
getSceneArr(yqMerchantId, loginUserObj) {
......@@ -340,7 +342,9 @@ Page({
wx.$util.hideLoading()
wx.$util.setUserInfo(data.loginUserInfoList[0])
app.gobalCheckYqdSuper(data.loginUserInfoList[0])
getYQorderInfo()
// 超管跳过选择4s店
if (data.loginUserInfoList[0] && data.loginUserInfoList[0].isSuper) {
this.get4SStoreList(data.loginUserInfoList[0])
......
<navigation-bar bindnavbarReady="navbarReady" showBack="{{show_confirm}}" bindback="back">
{{!show_confirm?'预约管理':'筛选'}}
</navigation-bar>
<!-- wx:if="{{navBarHeight > 0}}" -->
<block wx:if="{{navBarHeight > 0}}">
<view class="main" style="margin-top:{{navBarHeight}}px">
<view class="to-box" style="top:{{navBarHeight}}px">
......
......@@ -2,6 +2,7 @@
import api from '../../api'
import order_mixins from '../order_mixins.js'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
let timeoutId;
Page({
/**
* 页面的初始数据
......@@ -9,6 +10,8 @@ Page({
data: {
IMG_URL,
...order_mixins.data,
showIcon1: true, // 初始显示图标
// showIcon2: true, // 初始隐藏第二个图标
activeIndex:0,
orderObj: [
{
......@@ -36,7 +39,46 @@ Page({
tabList: ['全部', '待跟进', '已升级', '战败'],
tabListTemplate: ['全部', '待跟进', '已升级', '战败']
},
// 创建一个动画实例
// createAnimation: function () {
// const animation = wx.createAnimation({
// duration: 300, // 动画持续时间,单位毫秒
// timingFunction: 'ease', // 缓动函数,这里使用了默认的缓动效果
// });
// const iconAnimation = this.selectComponent('#iconAnimation'); // 获取animation组件的实例
// console.log(iconAnimation);
// animation.translateY(0).step(); // 初始状态
// iconAnimation.animationData = animation.export();
// this.setData({
// animationData: animation.export(),
// });
// return animation;
// },
onPageScroll: function (e) {
console.log(e);
const {scrollTop} = e.detail
console.log(scrollTop,'scrollTop');
// const animation = this.createAnimation(); // 创建动画实例
// 滚动时隐藏第一个图标,显示第二个图标
this.setData({
showIcon1: false,
showIcon2: true,
});
// 清除之前的定时器
if (timeoutId) {
clearTimeout(timeoutId);
}
// 设置一个定时器,在滚动停止后一定时间后恢复两个图标的显示状态
timeoutId = setTimeout(() => {
this.setData({
showIcon1: true,
showIcon2: false,
});
}, 1000); // 在这里设置等待的时间,单位是毫秒
},
navbarReady(e) {
// console.log(e)
let navBarHeight = e.detail.height
......
......@@ -2,7 +2,8 @@
<navigation-bar bindnavbarReady="navbarReady" showBack="{{show_confirm}}" bindback="back">
{{!show_confirm?'工单列表':'筛选'}}
</navigation-bar>
<block wx:if="{{navBarHeight > 0}}">
<!-- wx:if="{{navBarHeight > 0}}" -->
<block wx:if="{{navBarHeight > 0}}" >
<view class="main" style="margin-top:{{navBarHeight}}px">
<view class="to-box" style="top:{{navBarHeight}}px">
<view class="search-box">
......@@ -37,6 +38,7 @@
refresher-enabled="{{true}}"
bindrefresherrefresh="search"
bindscrolltolower="scrollonReachBottom"
bindscroll="onPageScroll"
class="list"
style="height:calc(100vh - {{navBarHeight + 104}}px);"
refresher-threshold="104"
......@@ -85,7 +87,7 @@
<image class="name-sex-icon" src="{{IMG_URL}}{{li.customer.customerSex == 1 ? 'miniProgram/icon-man.png' : 'miniProgram/icon-woman.png'}}" mode=""/>
</view>
<view class="goods-list" style="padding-bottom:{{li.subOrderList.length<1?0:''}}">
<block wx:if="{{li.total_price != 0}}">
<block wx:if="{{li.subOrderList.length}}">
<block
wx:for="{{li.subOrderList}}"
wx:key="sindex"
......@@ -208,18 +210,23 @@
</scroll-view>
</block>
</view>
<block wx:if="{{!userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2}}">
<view class="fixed-btns">
<view class="btn text-center" bindtap="jump" data-name="createOrder">
<image src="{{IMG_URL}}upgrade/create_newworkorder.png" />
<block wx:if="{{!userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2 && showIcon1}}">
<view class="fixed-btns" >
<view class="btn text-center" bindtap="jump" data-name="createOrder">
<image src="{{IMG_URL}}upgrade/scancode_verification02.png" />
新增工单
</view>
<view class="btn text-center" bindtap="scan">
<image src="{{IMG_URL}}upgrade/scancode_verification.png" />
<view class="btn text-center" bindtap="scan">
<image src="{{IMG_URL}}upgrade/create_newworkorder01.png" />
扫码核销
</view>
</view>
</block>
<block wx:if="{{!userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2 && !showIcon1}}">
<view class="arrowIcon">
<image class="image" src="{{IMG_URL}}upgrade/arrow-left.png" />
</view>
</block>
</block>
<order-confirm
show="{{show_confirm}}"
......
......@@ -138,7 +138,7 @@ page {
max-width: 404rpx;
}
.list .item .name .name-sex-icon{
.list .item .name .name-sex-icon {
width: 32rpx;
height: 32rpx;
margin-left: 8rpx;
......@@ -318,7 +318,7 @@ page {
/* padding-top: 8rpx; */
}
.list .item .order-price .order-price-label{
.list .item .order-price .order-price-label {
font-size: 24rpx;
width: 136rpx;
color: #999EA8;
......@@ -349,25 +349,25 @@ page {
align-items: flex-end; */
}
.list .item .order-payType .payType{
.list .item .order-payType .payType {
margin-bottom: 16rpx;
display: flex;
}
.list .item .order-payType .payType .payType-label{
.list .item .order-payType .payType .payType-label {
font-size: 24rpx;
width: 136rpx;
color: #999EA8;
}
.list .item .order-payType .payType .payType-value{
.list .item .order-payType .payType .payType-value {
font-size: 24rpx;
display: flex;
align-items: center;
color: #5A5E66;
}
.list .item .order-payType .payType .payType-image{
.list .item .order-payType .payType .payType-image {
width: 28rpx;
height: 28rpx;
margin-left: 10rpx;
......@@ -398,32 +398,61 @@ page {
.fixed-btns {
position: fixed;
right: 20rpx;
top: 700rpx;
width: 104rpx;
height: 296rpx;
bottom: 65rpx;
/* width: 104rpx; */
/* height: 296rpx; */
display: flex;
justify-content: center;
flex-flow: column;
background: #ffffffe6;
/* flex-flow: column; */
background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 #0000001a;
border-radius: 16rpx;
/* background: #ffffffe6;
border: 1px solid #EFF0F2;
box-shadow: 0 2px 10px 0 #0000001a;
border-radius: 26px;
border-radius: 26px; */
}
.fixed-btns .btn {
box-sizing: border-box;
padding: 20rpx 18rpx;
display: flex;
flex-flow: column;
font-size: 20rpx;
color: #757980;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 24rpx;
color: #347BFF;
width: 135rpx;
height: 136rpx;
}
.fixed-btns .btn image {
width: 96rpx;
height: 96rpx;
width: 60rpx;
height: 60rpx;
flex-shrink: 0;
}
.arrowIcon {
position: fixed;
right: 0;
bottom: 65rpx;
width: 36rpx;
height: 136rpx;
background: #FFFFFF;
border: 2rpx solid #EFF0F2;
box-shadow: 0 4rpx 20rpx 0 #0000001a;
border-radius: 16rpx 0 0 16rpx;
display: flex;
align-items: center;
justify-content: center;
}
.arrowIcon .image {
/* line-height: 136rpx; */
width: 32rpx;
height: 32rpx;
}
/* .fixed-btns::after {
position: absolute;
top: 50%;
......
// pages/wxLogin/wxLogin.js
import api from '../../api/api.js'
import { setNoSignInUuid,getNoSignInUuid,rmNoSignInUuid } from '~/utils/cache/storageApi.js'
import { get4SStoreList } from '~/store/index'
import { get4SStoreList,getYQList } from '~/store/index'
const app = getApp()
Page({
/**
......@@ -116,6 +116,8 @@ Page({
wx.$util.showLoading()
if (this.data.jumpPageFlag) return
this.setData({jumpPageFlag: true})
getYQList()
// console.log(smsLogin,'smsLogin');
if (loginType == 1) {
// 手机号登录
api
......@@ -126,13 +128,14 @@ Page({
})
.then(result => {
wx.$util.showLoading()
let { code, data } = result
let { code, data,message } = result
if (code == 0) {
let { loginUserInfoList, sessionId, noSignInUuid, needSelectAccount } = data
if (loginUserInfoList.length) {
const loginUserObj = loginUserInfoList.filter(val => val.subLoginUser && Object.keys(val.subLoginUser)?.length)[0] || {}
wx.$util.setSessionId(sessionId)
getYQList()
noSignInUuid ? setNoSignInUuid(noSignInUuid):rmNoSignInUuid()
// 记录登录信息 已选园区店、4s店和场景
if (!needSelectAccount && Object.keys(loginUserObj)?.length && loginUserObj?.shopMerchantId && !((loginUserObj?.sceneType ?? '') === '')) {
......@@ -171,13 +174,14 @@ Page({
})
.then(result => {
wx.$util.showLoading()
let { code, data } = result
let { code, data,message } = result
if (code == 0) {
let { loginUserInfoList, sessionId, noSignInUuid, needSelectAccount } = data
if (loginUserInfoList.length) {
const loginUserObj = loginUserInfoList.filter(val => val.subLoginUser && Object.keys(val.subLoginUser)?.length)[0] || {}
wx.$util.setSessionId(sessionId)
getYQList()
noSignInUuid ? setNoSignInUuid(noSignInUuid):rmNoSignInUuid()
// 记录登录信息 已选园区店、4s店和场景
if (!needSelectAccount && Object.keys(loginUserObj)?.length && loginUserObj?.shopMerchantId && !((loginUserObj?.sceneType ?? '') === '')) {
......@@ -251,7 +255,80 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {},
onLoad: function (options) {
console.log(options,'options');
let id = decodeURIComponent(options.scene).split('=')[1]
id && this.qrCodeScene(id)
},
// 免登录逻辑
qrCodeScene(id) {
api
.getSceneById({
id,
channelType: 1
})
.then(res => {
// debugger
// res => {
let { code, data } = res
let op = {}
if (code == '0') {
if (data) {
data.split('&').map(item => {
const [key, val] = item.split('=')
op[key] = val
})
this.setData(
{
...op
},
() => {
this.noLoginFn()
}
)
}
}
// }
})
.catch(err => {})
},
noLoginFn (){
let that = this
let { noLogin } = this.data
wx.$util.showLoading()
api
.noLogin({
mobile: noLogin
})
.then(result => {
wx.$util.showLoading()
if (result.code == 0) {
let { loginUserInfoList, sessionId, noSignInUuid, needSelectAccount } = result.data
console.log(result,loginUserInfoList,'loginUserInfoList');
if (loginUserInfoList.length) {
const loginUserObj = loginUserInfoList.filter(val => val.subLoginUser && Object.keys(val.subLoginUser)?.length)[0] || {}
wx.$util.setSessionId(sessionId)
getYQList()
noSignInUuid ? setNoSignInUuid(noSignInUuid):rmNoSignInUuid()
// 记录登录信息 已选园区店、4s店和场景
if (!needSelectAccount && Object.keys(loginUserObj)?.length && loginUserObj?.shopMerchantId && !((loginUserObj?.sceneType ?? '') === '')) {
this.getYqMerchantSceneConfig(loginUserObj, 0)
} else if (!needSelectAccount && Object.keys(loginUserObj)?.length && loginUserObj?.shopMerchantId && (loginUserObj?.sceneType ?? '') === '') { // 已选园区店、4s店
this.getYqMerchantSceneConfig(loginUserObj, 1)
} else if (!needSelectAccount) { // 仅选择园区店
this.getYqMerchantSceneConfig(loginUserObj, 2)
} else { // 未记录到登录信息
this.getAccountLoginList(loginUserInfoList)
}
} else {
wx.$router.reLaunch('pages.nothing')
}
}
})
.catch(err => {
wx.hideLoading()
})
},
/**
* 获取授权手机号
*/
......@@ -274,11 +351,12 @@ Page({
.then(({ code, data, message }) => {
wx.hideLoading()
if (code == 0) {
let { loginUserInfoList, sessionId, noSignInUuid, needSelectAccount } = data
if (loginUserInfoList.length) {
const loginUserObj = loginUserInfoList.filter(val => val.subLoginUser && Object.keys(val.subLoginUser)?.length)[0] || {}
wx.$util.setSessionId(sessionId)
getYQList()
noSignInUuid ? setNoSignInUuid(noSignInUuid):rmNoSignInUuid()
// 记录登录信息 已选园区店、4s店和场景
if (!needSelectAccount && Object.keys(loginUserObj)?.length && loginUserObj?.shopMerchantId && !((loginUserObj?.sceneType ?? '') === '')) {
......
......@@ -4,6 +4,48 @@
"miniprogram": {
"list": [
{
"name": "",
"pathName": "pages/wxLogin/wxLogin",
"query": "scene=sceneId%3D133329",
"launchMode": "default",
"scene": 1047
},
{
"name": "",
"pathName": "pages/wxLogin/wxLogin",
"query": "scene=sceneId%3D133329",
"launchMode": "default",
"scene": 1047
},
{
"name": "",
"pathName": "pages/accountItems/accountItems",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/wxLogin/wxLogin",
"query": "noLogin=18902454301&sence=2",
"launchMode": "default",
"scene": 1047
},
{
"name": "战败下单",
"pathName": "tabWorkOrder/pages/defeatOrder/defeatOrder",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "1.1 订单列表",
"pathName": "pages/tabWorkOrder/pages/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "2.1订单下单",
"pathName": "packageEquity/pages/carQuotation/createOrderCarQuotationSimple/createOrderCarQuotationSimple",
"query": "",
......
......@@ -165,7 +165,7 @@ export const setConfigInfo = globalData => {
}
})
}
// 扫码进来的处理
export const checkScene = options => {
// let query = options.query
let { query } = options
......@@ -210,7 +210,8 @@ export const checkScene = options => {
}
console.log(options, 'options')
wx.$SCENE = options
if (!userInfo && options.path != 'pages/accountItems/accountItems') {
console.log(options.path,'options.path')
if (!userInfo && !( ['pages/accountItems/accountItems', 'pages/wxLogin/wxLogin'].includes(options.path))) {
// if (!userInfo) {
// console.log(userInfo);
console.log('未登录,请登录。');
......@@ -323,3 +324,24 @@ export const getShopSceneConfig = options => {
})
})
}
/** 获取当前园区列表 */
export const getYQList = () => {
// debugger
return new Promise((resolve, reject) => {
const app = getApp()
console.log(app.globalData.YQList,'app.globalData.YQList');
// 如果有 直接返回
if (app.globalData.YQList) {
return resolve(app.globalData.YQList)
} else {
api.getYQList({}).then(res => {
let { code, data } = res
if (code == 0) {
app.globalData.YQList = data
}
resolve(app.globalData.YQList)
})
}
})
}
\ No newline at end of file
......@@ -54,6 +54,16 @@ Component({
label: '车牌号',
valueName: 'plateNumRequiredFlag',
value: false
},
{
label: '战败下单是否体验',
valueName: 'foEfRequiredFlag',
value: true
},
{
label: '战败下单拒升理由提交',
valueName: 'foRrRequiredFlag',
value: true
}
]
},
......@@ -65,7 +75,7 @@ Component({
// app .
getYQorderInfo()
.then(merchantSettingInfo => {
// console.log(merchantSettingInfo)
console.log(merchantSettingInfo)
this.setData({ merchantSettingInfo })
this.setOrderSettingList(merchantSettingInfo)
})
......
......@@ -149,6 +149,7 @@
</view>
</view>
</block>
<!-- isYqdSuper -->
<switch-popup
show="{{showMerchantPop}}"
height="{{merchantPopConfig.height}}"
......
......@@ -288,7 +288,7 @@ Page({
})
let { goodsList } = this.data
this.setGoodsTotal(goodsList)
// this.setGoodsTotal(goodsList)
},
// 屏蔽不用
// setGoodsTotal(goodsList) {
......
import api from '../../api.js'
import order_mixins from '../order_mixins.js'
import { setWebSocket, getPositionList } from '~/store/index'
import {
setWebSocket,
getPositionList
} from '~/store/index'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
let time = null
let app = getApp()
......@@ -22,13 +25,19 @@ Page({
},
setCopyData(e) {
// console.log(e)
let { content } = e.currentTarget.dataset
let {
content
} = e.currentTarget.dataset
wx.$util.setCopyData(`${content}`)
},
// 修改订单时间
rangeSelect(e) {
let { date } = e.detail
let { orderInfo } = this.data
let {
date
} = e.detail
let {
orderInfo
} = this.data
let params = {
orderCode: orderInfo.orderCode,
orderTime: date + ' 00:00:00'
......@@ -38,7 +47,9 @@ Page({
.updateOrderTime(params)
.then(result => {
// console.log(result)
let { code } = result
let {
code
} = result
if (code == '0') {
this.showToast('修改日期成功')
orderInfo.time = params.orderTime
......@@ -54,7 +65,9 @@ Page({
})
},
updateCustomerInfo() {
let { orderInfo } = this.data
let {
orderInfo
} = this.data
console.log(orderInfo)
if (!orderInfo?.customer?.orderCode) {
delete orderInfo?.customer?.orderCode
......@@ -84,7 +97,9 @@ Page({
})
},
next() {
let { orderInfo} = this.data
let {
orderInfo
} = this.data
let _this = this
// console.log(orderCode)
// 有技师选项 并选择了技师 更新客户信息
......@@ -96,7 +111,11 @@ Page({
},
checkPayType() {
let {
orderInfo: { selectPayType, status, orderCode }
orderInfo: {
selectPayType,
status,
orderCode
}
} = this.data
let _this = this
// 微信支付
......@@ -139,7 +158,10 @@ Page({
},
createPayOrder() {
let {
orderInfo: { selectPayType, orderCode },
orderInfo: {
selectPayType,
orderCode
},
outTradeNo,
payVoucherList
} = this.data
......@@ -148,14 +170,20 @@ Page({
payType: selectPayType
}
if (payVoucherList?.length && outTradeNo) {
obj.payVoucherList = payVoucherList.map(v => {return v?.url})
obj.payVoucherList = payVoucherList.map(v => {
return v?.url
})
obj.outTradeNo = outTradeNo
}
wx.$util.showLoading()
wx.$refresh = true
api.createPayOrder(obj).then(res => {
console.log(res)
let { code, data, message } = res
let {
code,
data,
message
} = res
if (code == 0) {
wx.hideLoading()
console.log(`类型为:${selectPayType}`)
......@@ -181,7 +209,9 @@ Page({
},
installOnly(refusalReason) {
let {
orderInfo: { orderCode }
orderInfo: {
orderCode
}
} = this.data
api
.installOnly({
......@@ -191,7 +221,10 @@ Page({
.then(res => {
console.log(res)
wx.$refresh = true
let { code, message } = res
let {
code,
message
} = res
if (code == 0) {
wx.$router.redirectTo('orderDetail', {
orderCode
......@@ -203,7 +236,9 @@ Page({
},
makePhoneCall(e) {
console.log(e)
let { data } = e.currentTarget.dataset
let {
data
} = e.currentTarget.dataset
wx.makePhoneCall({
phoneNumber: data
})
......@@ -247,7 +282,11 @@ Page({
})
.then(res => {
console.log(res)
let { code, message, data } = res
let {
code,
message,
data
} = res
if (code == 0) {
wx.$util.hideLoading()
if (data.payOrder && data.payOrder.payStatus == 2) {
......@@ -292,8 +331,10 @@ Page({
})
// 校验是否显示二级流量方
if (data.subShopMerchantName) {
let { customerObj } = this.data
if(customerObj.findIndex(val =>val?.key && val.key == 'subShopMerchantName') < 0) {
let {
customerObj
} = this.data
if (customerObj.findIndex(val => val?.key && val.key == 'subShopMerchantName') < 0) {
customerObj[customerObj.length - 2] = {
label: '二级流量方',
key: 'subShopMerchantName'
......@@ -308,7 +349,9 @@ Page({
// this.isArtificer(data)
// }
// 获取园区店技师配置信息
api.getQYTechnicianList({yqMerchantId: wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId}).then(respone => {
api.getQYTechnicianList({
yqMerchantId: wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId
}).then(respone => {
if (respone?.code == 0) {
if (respone?.data.length > 0) this.isArtificer(respone.data)
}
......@@ -331,7 +374,10 @@ Page({
},
isArtificer(data) {
let { customerObj, orderInfo } = this.data
let {
customerObj,
orderInfo
} = this.data
orderInfo.isOpenArtificer = true
// if(customerObj.findIndex(val =>val?.key && val.key == 'technicianName') < 0) {
// customerObj[customerObj.length] = {
......@@ -352,7 +398,9 @@ Page({
// 选择技师确认
changeArtificer(e) {
let value = e?.detail || {}
let { orderInfo } = this.data
let {
orderInfo
} = this.data
orderInfo?.subOrderList?.forEach(val => {
if (val.subOrderCode == value?.subOrderCode) {
val.technicianName = value.technicianName
......@@ -360,7 +408,7 @@ Page({
val.technicianId = value.technicianId
}
})
let params ={
let params = {
orderCode: orderInfo?.orderCode,
subOrderCode: value?.subOrderCode,
technicianName: value?.technicianName,
......@@ -368,7 +416,10 @@ Page({
technicianId: value?.technicianId
}
api.updateTechnicianInfo(params).then(res => {
let { code, message } = res
let {
code,
message
} = res
if (code == 0) {
this.setData({
artificerSelectPopup: false,
......@@ -383,7 +434,9 @@ Page({
// 选择技师
selectArtificer(e) {
let { item } = e.currentTarget.dataset
let {
item
} = e.currentTarget.dataset
console.log(item)
this.setData({
artificerSelectPopup: true,
......@@ -394,7 +447,9 @@ Page({
checkPhoneShow(config) {
// 有就屏蔽手机号的显示
if (config) {
let { customerObj } = this.data
let {
customerObj
} = this.data
delete customerObj[2]
this.setData({
customerObj
......@@ -402,8 +457,13 @@ Page({
}
},
edit() {
let { orderInfo } = this.data
wx.$router.redirectTo('createOrder', orderInfo)
let {
orderInfo
} = this.data
// filmOrder 0车膜升级 1精品升级
let routeName = orderInfo?.filmOrder ? 'premiumUpgrade' : 'createOrder'
wx.$router.redirectTo(routeName, orderInfo)
// wx.$router.redirectTo('createOrder', orderInfo)
},
/**
* 生命周期函数--监听页面初次渲染完成
......@@ -448,4 +508,4 @@ Page({
this.edit()
// wx.$router.back()
}
})
})
\ No newline at end of file
// tabWorkOrder/pages/defeatOrder/defeatOrder.js
import api from '../../api'
import {
getYQorderInfo,
getPositionList
} from '~/store/index'
import api2 from '~/api/api.js'
import { getYQorderInfo, getPositionList } from '~/store/index'
const phoneRex = /^[1]([3-9])[0-9]{9}$/
let toastList = {
employeeName: '销售顾问不能为空',
subShopMerchantId: '二级流量方不能为空',
sellerUserId: '转化人员不能为空'
sellerUserId: '转化人员不能为空',
refusalReason: '拒升理由不能为空'
}
Page({
/**
......@@ -17,9 +16,9 @@ Page({
data: {
scanIcon: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/ocr_icon.png',
name: 'createdOrder',
shortcutList: [],
phoneShow: false,
orderObj: {
},
orderObj: {},
goodsData: [],
userInfo: {},
notUpgradeOrderList: [
......@@ -30,6 +29,7 @@ Page({
standNo: '',
plateNumber: '',
customerSex: 1,
experienceFlag: 'Y'
},
confirmIndex: false,
subOrderList: []
......@@ -44,8 +44,10 @@ Page({
},
toView: '',
typeIndx: 0,
// isPlateNumber: false
isPlateNumber: false,
isStandNo: false,
experienceFlag: false,
refusalReason: false,
isShowSubShopMerchant: false,
requiredList: [],
tipsProps: {
......@@ -58,7 +60,7 @@ Page({
frontGearArr: [],
sideRearGearArr: [],
skylightArr: [],
customerInfoBox: false,
customerInfoBox: false
},
routerBack() {
wx.$router.back()
......@@ -77,6 +79,19 @@ Page({
})
wx.$router.go(`ocr?type=${type}`)
},
changeExperience(e) {
// let { gender, index } = e.currentTarget.dataset
let { experience, index } = e.currentTarget.dataset
let prop = `notUpgradeOrderList[${index}].customer.experienceFlag`
this.setData({
[prop]: experience
})
// console.log(experience)
wx.vibrateShort()
// this.setData({
// ['orderObj.customer.experienceFlag']: experience
// })
},
// 选择产品确定
chooseGoods(e) {
let { selectCustomIndex } = this.data
......@@ -114,7 +129,7 @@ Page({
})
},
addUserItem() {
let { notUpgradeOrderList, copyGoodsData } = this.data
let { notUpgradeOrderList, copyGoodsData, shortcutList } = this.data
if (notUpgradeOrderList.length >= 10) return
notUpgradeOrderList.push({
customer: {
......@@ -122,15 +137,17 @@ Page({
customerPhone: '',
standNo: '',
customerSex: 1,
plateNumber: ''
}
plateNumber: '',
experienceFlag: 'Y'
},
shortcutList:wx.$util.deepClone(shortcutList)
})
this.setData({
notUpgradeOrderList
})
if (copyGoodsData.length == 1 && copyGoodsData[0].upgradeGoodsList.length == 1) {
// if (copyGoodsData.length == 1 && copyGoodsData[0].upgradeGoodsList.length == 1) {
this.defaultChoose(notUpgradeOrderList.length - 1)
}
// }
setTimeout(() => {
this.setData({
toView: 'addBtn'
......@@ -286,14 +303,8 @@ Page({
return (360 * Math.atan(_Y / _X)) / (2 * Math.PI)
},
showPopup(e) {
let {
copyGoodsData,
} = this.data
let {
showName,
index,
type
} = e.currentTarget.dataset
let { copyGoodsData } = this.data
let { showName, index, type } = e.currentTarget.dataset
let arr = []
if (showName == 'goodsBox') {
// type 产品类型 1前档 2侧后档 3天窗 4其它精品 根据类型过滤显示商品弹窗数据
......@@ -357,7 +368,7 @@ Page({
},
// 获取商品
async getOrderBaseGoodsList(merchantId) {
const positionTypeList = await getPositionList() || []
const positionTypeList = (await getPositionList()) || []
let { frontGearArr, sideRearGearArr, skylightArr } = this.data
this.setData({
positionTypeList
......@@ -368,11 +379,7 @@ Page({
upradeFlag: 'N'
})
.then(res => {
let {
code,
data,
message
} = res
let { code, data, message } = res
if (code == 0) {
wx.hideLoading()
// 筛选出太阳膜商品 goodsType 1太阳膜
......@@ -417,9 +424,9 @@ Page({
copyGoodsData: goodsData
})
// 仅有一件商品 默认选中
if (goodsData.length == 1 && goodsData[0].upgradeGoodsList.length == 1) {
// if (goodsData.length == 1 && goodsData[0].upgradeGoodsList.length == 1) {
this.defaultChoose(0)
}
// }
} else {
wx.$util.showToast(message)
}
......@@ -442,7 +449,7 @@ Page({
submit(i) {
this.checkPhoneUseConfig()
let { orderObj, notUpgradeOrderList, dateObj, isStandNo, isCarBrand, isPlateNumber } = this.data
let { orderObj, notUpgradeOrderList, dateObj, isStandNo, isCarBrand, isPlateNumber, refusalReason } = this.data
let key = this.checkRequired(orderObj)
// debugger
if (key) {
......@@ -472,6 +479,9 @@ Page({
if (!notUpgradeOrderList[index].subOrderList?.length) {
return this.showToast(`请选择第${index + 1}位客户产品`)
}
if (refusalReason && !notUpgradeOrderList[index].customer.refusalReason) {
return this.showToast(`请输入第${index + 1}位客户拒升理由`)
}
}
notUpgradeOrderList?.forEach(val => {
......@@ -494,19 +504,20 @@ Page({
createDate: dateObj.today
}
delete orderObj.customer
this.showLoading('提交中...')
wx.$util.showLoading('提交中...')
// this.showLoading()
api.notUpgradeOrder(orderObj).then(res => {
wx.hideLoading()
let { code, data, message } = res
if (code == 0) {
wx.$refresh = true
this.showToast({
wx.$util.showToast({
icon: 'success',
title: '提交成功'
})
wx.$router.go('pages.index')
} else {
this.showToast(message)
wx.$util.showToast(message)
}
})
},
......@@ -542,39 +553,101 @@ Page({
}
},
delGoodsList(e) {
let {
index,
customIndex
} = e.currentTarget.dataset
let {
notUpgradeOrderList
} = this.data
let { index, customIndex } = e.currentTarget.dataset
let { notUpgradeOrderList } = this.data
notUpgradeOrderList[customIndex]?.subOrderList?.splice(index, 1)
this.setData({
notUpgradeOrderList
})
},
blur(e) {
let { liindex } = e.currentTarget.dataset
console.log(e,liindex);
console.log(e)
let { value } = e.detail
let { notUpgradeOrderList } = this.data
value = value.substring(0, 30)
let shortcutList = notUpgradeOrderList[liindex].shortcutList
if (!value) {
shortcutList = shortcutList.map(i => {
i.active = false
return i
})
}
let prop = `notUpgradeOrderList[${liindex}].shortcutList`
let prop2 = `notUpgradeOrderList[${liindex}].focus`
let prop3 = `notUpgradeOrderList[${liindex}].customer.refusalReason`
console.log(value,'value');
this.setData({
[prop3]: value,
[prop]: shortcutList,
[prop2]: false
})
},
chooseShortcut(e) {
let { item, index, liindex } = e.currentTarget.dataset
console.log(item, index, liindex)
let { notUpgradeOrderList } = this.data
// console.log(object);
// debugger
// if (notUpgradeOrderList[liindex].shortcutList[index].active) return
let refusalReason = notUpgradeOrderList[liindex].customer.refusalReason || ''
refusalReason += item.confValue
refusalReason = refusalReason.substring(0, 30)
let prop = `notUpgradeOrderList[${liindex}].shortcutList[${index}].active`
// let prop2 = `notUpgradeOrderList[${liindex}].focus`
let prop3 = `notUpgradeOrderList[${liindex}].customer.refusalReason`
this.setData({
[prop3]: refusalReason,
[prop]: true,
// [prop2]: true
})
console.log(refusalReason,this.data.notUpgradeOrderList);
},
getSetting() {
// 动态获取 车型 车架 车牌 是否必填
let { isStandNo, isCarBrand, isPlateNumber } = this.data
// let { isStandNo, isCarBrand, isPlateNumber } = this.data
let { isStandNo, isCarBrand, isPlateNumber, experienceFlag, refusalReason } = this.data
// app .
getYQorderInfo()
.then(merchantSettingInfo => {
// let { requiredList } = this.data
if (merchantSettingInfo.carTypeRequiredFlag == 'Y') isCarBrand = true // 车型必填
if (merchantSettingInfo.standNoRequiredFlag == 'Y') isStandNo = true // 车架号必填
if (merchantSettingInfo.plateNumRequiredFlag == 'Y') isPlateNumber = true // 车牌必填
if (merchantSettingInfo.foEfRequiredFlag == 'Y') experienceFlag = true // 战败订单是否体验
if (merchantSettingInfo.foRrRequiredFlag == 'Y') refusalReason = true // 战败订单拒升理由
this.setData({
isStandNo,
isCarBrand,
isPlateNumber,
// phoneShow: merchantSettingInfo.yqPhoneConfig
experienceFlag,
refusalReason,
phoneShow: wx.$util.deepClone(merchantSettingInfo.yqPhoneConfig)
})
// this.setData({ merchantSettingInfo })
})
.catch(err => {
console.log(err)
})
api2
.getConfigList({
confGroup: 'SMARTCARLIFE_NOT_UPGRADE_LABEL'
})
.then(res => {
console.log(res)
let list = []
let { code, data } = res
if (code == 0) {
list = data
}
let prop = `notUpgradeOrderList[0].shortcutList`
this.setData({
shortcutList: list,
[prop]: list
})
})
},
init(userInfo) {
let { orderObj } = this.data
......@@ -608,13 +681,11 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function (res) {
},
onReady: function (res) {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function (res) {
},
onShow: function (res) {},
onRoute(res) {
res && this.initOPtions(res)
this.getSetting()
......
......@@ -94,7 +94,7 @@ scroll-view ::-webkit-scrollbar {
font-weight: 500;
}
.seller_box{
.seller_box {
margin: 0 20rpx 20rpx;
}
......@@ -167,7 +167,12 @@ scroll-view ::-webkit-scrollbar {
color: #fff;
}
.goods_box .label{
/* .gender-box .male.active,
.gender-box .woman.active {
color: #fff;
} */
.goods_box .label {
font-size: 28rpx;
color: #292D33;
margin: 40rpx 0 0 40rpx;
......@@ -208,11 +213,11 @@ scroll-view ::-webkit-scrollbar {
justify-content: space-between;
}
.goods-box .goods .bottom_box .position{
.goods-box .goods .bottom_box .position {
color: #888888;
}
.goods-box .goods .bottom_box .red_text{
.goods-box .goods .bottom_box .red_text {
color: red;
}
......@@ -232,7 +237,7 @@ scroll-view ::-webkit-scrollbar {
margin-right: 32rpx;
}
.goods-box .goods .price text{
.goods-box .goods .price text {
position: absolute;
left: 16rpx;
top: 50%;
......@@ -260,7 +265,7 @@ scroll-view ::-webkit-scrollbar {
color: #dcdcdc;
}
.goods-box .goods .count{
.goods-box .goods .count {
min-width: 64rpx;
}
......@@ -306,7 +311,9 @@ scroll-view ::-webkit-scrollbar {
transition: none !important;
padding-bottom: 10rpx;
}
.customerNum {
font-size: 24rpx;
}
.btn-box .tips {
display: flex;
justify-content: center;
......@@ -364,7 +371,8 @@ scroll-view ::-webkit-scrollbar {
}
.touch-item {
box-sizing: border-box;position: relative;
box-sizing: border-box;
position: relative;
display: flex;
justify-content: space-between;
overflow: hidden;
......@@ -411,4 +419,59 @@ scroll-view ::-webkit-scrollbar {
.touch-move-active .del {
-webkit-transform: translateX(0);
transform: translateX(0);
}
.requiredStar {
color: #f00;
}
.remarkCon .title {
padding: 24rpx 40rpx;
/* font-size: 32rpx;
color: #333333;
font-weight: 600;
text-align: center; */
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #292D33;
letter-spacing: 0;
text-align: left;
}
.remarkCon .textarea {
background: #F7F7F7;
border: 1rpx solid #C3C3C3;
border-radius: 12rpx;
width: 600rpx;
height: 240rpx;
box-sizing: border-box;
margin: 0 auto 20rpx;
padding: 25rpx 30rpx;
font-size: 28rpx;
color: #333333;
}
.remarkCon .shortcut-list {
padding: 0 52rpx 0 40rpx;
display: flex;
flex-wrap: wrap;
height: 165rpx;
overflow: hidden;
}
.remarkCon .shortcut-list .shortcut {
padding: 0 24rpx;
height: 59rpx;
line-height: 59rpx;
background: #F7F7F7;
border-radius: 8rpx;
font-size: 24rpx;
color: #888888;
max-width: calc(100% - 48rpx);
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0 0 20rpx 12rpx;
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!