Commit f95f9042 by zhangxw

不同场景获取门店

1 parent ecb2e354
...@@ -13,7 +13,7 @@ Component({ ...@@ -13,7 +13,7 @@ Component({
let { artificerList, orderInfo } = this.data let { artificerList, orderInfo } = this.data
artificerList.map(i => { artificerList.map(i => {
i.active = false i.active = false
if (i.artificerId == orderInfo?.artificerId) { if (i.technicianId == orderInfo?.technicianId) {
i.active = true i.active = true
} }
return i return i
...@@ -46,7 +46,7 @@ Component({ ...@@ -46,7 +46,7 @@ Component({
let { artificerList } = this.data let { artificerList } = this.data
artificerList.map(i => { artificerList.map(i => {
i.active = false i.active = false
if (i.artificerId == target?.artificerId) { if (i.technicianId == target?.technicianId) {
i.active = true i.active = true
} }
return i return i
...@@ -68,7 +68,8 @@ Component({ ...@@ -68,7 +68,8 @@ Component({
return wx.$util.showToast('请选择技师') return wx.$util.showToast('请选择技师')
} }
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
orderInfo.artificerId = arr[0]?.artificerId || '' orderInfo.technicianId = arr[0]?.technicianId || ''
orderInfo.technicianName = arr[0]?.technicianName || ''
thisPage.setData({ thisPage.setData({
orderInfo, orderInfo,
artificerSelectPopup: false artificerSelectPopup: false
......
...@@ -37,7 +37,7 @@ Component({ ...@@ -37,7 +37,7 @@ Component({
lifetimes: { lifetimes: {
attached() { attached() {
this.setData({ this.setData({
storeInfo: wx.$util.getUserInfo()?.default4SStoreInfo || {}, storeInfo: wx.$util.getUserInfo()?.default4SStoreInfo_crowdFunding || {},
userInfo: wx.$util.getUserInfo() || {} userInfo: wx.$util.getUserInfo() || {}
}) })
this.onLoad(true) this.onLoad(true)
...@@ -48,7 +48,7 @@ Component({ ...@@ -48,7 +48,7 @@ Component({
this.setData({ this.setData({
nothing: false, nothing: false,
pageNum: 1, pageNum: 1,
storeInfo: wx.$util.getUserInfo()?.default4SStoreInfo || {} storeInfo: wx.$util.getUserInfo()?.default4SStoreInfo_crowdFunding || {}
}) })
if (!noGetList) this.getActivityList(true) if (!noGetList) this.getActivityList(true)
}, },
......
...@@ -39,7 +39,7 @@ Page({ ...@@ -39,7 +39,7 @@ Page({
}, },
getActivityList(e) { getActivityList(e) {
let storeInfo = wx.$util.getUserInfo()?.default4SStoreInfo || {} let storeInfo = wx.$util.getUserInfo()?.default4SStoreInfo_crowdFunding || {}
let { defaultSelectInfo, activityId, activityName } = this.data let { defaultSelectInfo, activityId, activityName } = this.data
defaultSelectInfo = { defaultSelectInfo = {
id: activityId, id: activityId,
......
...@@ -94,8 +94,8 @@ Page({ ...@@ -94,8 +94,8 @@ Page({
customerPhone: orderInfo.customerPhone, customerPhone: orderInfo.customerPhone,
userId: orderInfo.uuid, userId: orderInfo.uuid,
employeeName: orderInfo.staffName, employeeName: orderInfo.staffName,
merchantId: userInfo?.default4SStoreInfo?.merchantId, merchantId: userInfo?.default4SStoreInfo_crowdFunding?.merchantId,
merchantName: userInfo?.default4SStoreInfo?.merchantName, merchantName: userInfo?.default4SStoreInfo_crowdFunding?.merchantName,
shopmallGoodsId: orderInfo.goodsId, shopmallGoodsId: orderInfo.goodsId,
orderPaySource: 4, orderPaySource: 4,
activityId: activityId, activityId: activityId,
......
...@@ -38,27 +38,27 @@ Page({ ...@@ -38,27 +38,27 @@ Page({
let { userInfo } = this.data let { userInfo } = this.data
let params = { let params = {
merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId, merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId,
scene: 0, scene: 3,
merchantName: e?.detail.value, merchantName: e?.detail.value,
staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid
} }
this.setData({ this.setData({
defaultSelectInfo: userInfo?.default4SStoreInfo defaultSelectInfo: userInfo?.default4SStoreInfo_crowdFunding
}) })
get4SStoreList(params) get4SStoreList(params)
.then(result => { .then(result => {
userInfo = wx.$util.getUserInfo() userInfo = wx.$util.getUserInfo()
let selectStroeIndex = let selectStroeIndex =
result?.findIndex(v => { result?.findIndex(v => {
return v.merchantId == userInfo?.default4SStoreInfo?.merchantId return v.merchantId == userInfo?.default4SStoreInfo_crowdFunding?.merchantId
}) > -1 }) > -1
? result?.findIndex(v => { ? result?.findIndex(v => {
return v.merchantId == userInfo?.default4SStoreInfo?.merchantId return v.merchantId == userInfo?.default4SStoreInfo_crowdFunding?.merchantId
}) })
: 0 : 0
// 获取门店下的员工(推荐人) // 获取门店下的员工(推荐人)
let params = { let params = {
merchantId: userInfo?.default4SStoreInfo?.merchantId merchantId: userInfo?.default4SStoreInfo_crowdFunding?.merchantId
} }
getStaffListByMerchant({...params}) getStaffListByMerchant({...params})
this.setData({ this.setData({
...@@ -74,10 +74,10 @@ Page({ ...@@ -74,10 +74,10 @@ Page({
changePicker(e) { changePicker(e) {
let { storeListRange, selectStroeIndex } = this.data let { storeListRange, selectStroeIndex } = this.data
let value = (e.detail ?? '') === '' ? selectStroeIndex : e.detail let value = (e.detail ?? '') === '' ? selectStroeIndex : e.detail
let default4SStoreInfo = storeListRange[value] let default4SStoreInfo_crowdFunding = storeListRange[value]
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), default4SStoreInfo }) wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), default4SStoreInfo_crowdFunding })
this.setData({ this.setData({
userInfo: { ...wx.$util.getUserInfo(), default4SStoreInfo } userInfo: { ...wx.$util.getUserInfo(), default4SStoreInfo_crowdFunding }
}) })
// 获取门店下的员工(推荐人) // 获取门店下的员工(推荐人)
let params = { let params = {
......
<!--packageCrowdFunding/pages/paidOrder/paidOrder.wxml--> <!--packageCrowdFunding/pages/paidOrder/paidOrder.wxml-->
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showMenu="{{true}}" bindback="back"> <navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showMenu="{{true}}" bindback="back">
<view class="navigation-title" bindtap="showStorePicker"> <view class="navigation-title" bindtap="showStorePicker">
<view class="navigation-title-text text-hide">{{userInfo && userInfo.default4SStoreInfo && userInfo.default4SStoreInfo.merchantName}}</view> <view class="navigation-title-text text-hide">{{userInfo && userInfo.default4SStoreInfo_crowdFunding && userInfo.default4SStoreInfo_crowdFunding.merchantName}}</view>
<view class="arrow"> <view class="arrow">
<image src="/images/back.png"/> <image src="/images/back.png"/>
</view> </view>
......
...@@ -238,7 +238,10 @@ export const get4SStoreList = options => { ...@@ -238,7 +238,10 @@ export const get4SStoreList = options => {
if (code == 0) { if (code == 0) {
app.globalData.storeListRange = data app.globalData.storeListRange = data
let default4SStoreInfo = wx.$util.getUserInfo()?.default4SStoreInfo ? wx.$util.getUserInfo()?.default4SStoreInfo : data && data[0] let default4SStoreInfo = wx.$util.getUserInfo()?.default4SStoreInfo ? wx.$util.getUserInfo()?.default4SStoreInfo : data && data[0]
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), default4SStoreInfo: default4SStoreInfo }) let default4SStoreInfo_crowdFunding = wx.$util.getUserInfo()?.default4SStoreInfo_crowdFunding ? wx.$util.getUserInfo()?.default4SStoreInfo_crowdFunding : data && data[0]
console.log(options)
if (options.scene == 0) wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), default4SStoreInfo: default4SStoreInfo })
if (options.scene == 3) wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), default4SStoreInfo_crowdFunding: default4SStoreInfo_crowdFunding })
resolve(app.globalData.storeListRange) resolve(app.globalData.storeListRange)
} }
}) })
......
...@@ -50,13 +50,45 @@ Page({ ...@@ -50,13 +50,45 @@ Page({
console.log(err) console.log(err)
}) })
}, },
updateCustomerInfo() {
let { orderInfo } = this.data
let paramsList = ['orderCode', 'customerId', 'customerName', 'customerPhone', 'customerSex', 'carBrandId', 'carBrand', 'carChildsBrandId', 'carChildsBrandName', 'carSeriesId', 'carSeriesName', 'standNo', 'plateNumber', 'experienceFlag', 'remark']
let userInfo = {}
orderInfo = Object.assign(orderInfo, orderInfo.customer)
paramsList.map(item => {
userInfo[item] = orderInfo[item] || ''
})
api
.updateOrderInfo(userInfo)
.then(result => {
wx.$util.hideLoading()
console.log(result)
if (result.code == 0 && result.data) {
wx.$refresh = true
this.back(orderObj.orderCode)
} else {
wx.showToast({
title: result.message,
icon: 'error'
})
}
})
.catch(err => {
// wx.$util.hideLoading()
console.log(err)
})
},
next() { next() {
let { let {
orderInfo: { selectPayType, status, orderCode } orderInfo: { selectPayType, status, orderCode }
} = this.data , orderInfo} = this.data
let _this = this let _this = this
// console.log(orderCode) // console.log(orderCode)
// 有技师选项 并选择了技师 更新客户信息
if (orderInfo.isOpenArtificer && orderInfo.technicianId) {
this.updateCustomerInfo()
}
return
// 微信支付 // 微信支付
if (selectPayType == 1) { if (selectPayType == 1) {
_this.setData({ _this.setData({
...@@ -244,10 +276,12 @@ Page({ ...@@ -244,10 +276,12 @@ Page({
// 校验是否显示二级流量方 // 校验是否显示二级流量方
if (data.subShopMerchantName) { if (data.subShopMerchantName) {
let { customerObj } = this.data let { customerObj } = this.data
if(customerObj.findIndex(val => val.key == 'subShopMerchantName') < 0) {
customerObj[customerObj.length - 2] = { customerObj[customerObj.length - 2] = {
label: '二级流量方:', label: '二级流量方:',
key: 'subShopMerchantName' key: 'subShopMerchantName'
} }
}
this.setData({ this.setData({
customerObj customerObj
}) })
...@@ -275,12 +309,15 @@ Page({ ...@@ -275,12 +309,15 @@ Page({
isArtificer(data) { isArtificer(data) {
let { customerObj, orderInfo } = this.data let { customerObj, orderInfo } = this.data
orderInfo.isOpenArtificer = true
if(customerObj.findIndex(val => val.key == 'technicianName') < 0) {
customerObj[customerObj.length] = { customerObj[customerObj.length] = {
label: '选择技师:', label: '选择技师:',
key: 'subShopMerchantName', key: 'technicianName',
type: 'select', type: 'select',
callBack: 'selectArtificer' callBack: 'selectArtificer'
} }
}
this.setData({ this.setData({
customerObj, customerObj,
artificerList: orderInfo?.technicianConfigDTOList artificerList: orderInfo?.technicianConfigDTOList
......
...@@ -203,10 +203,12 @@ Page({ ...@@ -203,10 +203,12 @@ Page({
// 校验是否显示二级流量方 // 校验是否显示二级流量方
if (data.subShopMerchantName) { if (data.subShopMerchantName) {
let { customerObj } = this.data let { customerObj } = this.data
if(customerObj.findIndex(val => val.key == 'subShopMerchantName') < 0) {
customerObj[customerObj.length - 2] = { customerObj[customerObj.length - 2] = {
label: '二级流量方:', label: '二级流量方:',
key: 'subShopMerchantName' key: 'subShopMerchantName'
} }
}
this.setData({ this.setData({
customerObj customerObj
}) })
...@@ -235,10 +237,12 @@ Page({ ...@@ -235,10 +237,12 @@ Page({
isArtificer(data) { isArtificer(data) {
let { customerObj, orderInfo } = this.data let { customerObj, orderInfo } = this.data
orderInfo.isOpenArtificer = true orderInfo.isOpenArtificer = true
if(customerObj.findIndex(val => val.key == 'technicianName') < 0) {
customerObj[customerObj.length] = { customerObj[customerObj.length] = {
label: '选择技师:', label: '选择技师:',
key: 'technicianName' key: 'technicianName'
} }
}
this.setData({ this.setData({
customerObj, customerObj,
orderInfo orderInfo
......
...@@ -195,10 +195,12 @@ Page({ ...@@ -195,10 +195,12 @@ Page({
// 校验是否显示二级流量方 // 校验是否显示二级流量方
if (data.subShopMerchantName) { if (data.subShopMerchantName) {
let { customerObj } = this.data let { customerObj } = this.data
if(customerObj.findIndex(val => val.key == 'subShopMerchantName') < 0) {
customerObj[customerObj.length - 2] = { customerObj[customerObj.length - 2] = {
label: '二级流量方:', label: '二级流量方:',
key: 'subShopMerchantName' key: 'subShopMerchantName'
} }
}
this.setData({ this.setData({
customerObj customerObj
}) })
...@@ -227,9 +229,11 @@ Page({ ...@@ -227,9 +229,11 @@ Page({
isArtificer(data) { isArtificer(data) {
let { customerObj, orderInfo } = this.data let { customerObj, orderInfo } = this.data
orderInfo.isOpenArtificer = true orderInfo.isOpenArtificer = true
if(customerObj.findIndex(val => val.key == 'technicianName') < 0) {
customerObj[customerObj.length] = { customerObj[customerObj.length] = {
label: '选择技师:', label: '选择技师:',
key: 'subShopMerchantName' key: 'technicianName'
}
} }
this.setData({ this.setData({
customerObj, customerObj,
......
...@@ -44,7 +44,7 @@ Page({ ...@@ -44,7 +44,7 @@ Page({
plateNumber: '', plateNumber: '',
customerSex: 1, customerSex: 1,
experienceFlag: 'Y', experienceFlag: 'Y',
artificerId: '' technicianId: ''
}, },
selectPayType: 2, selectPayType: 2,
remark: '' remark: ''
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</gl-cell> </gl-cell>
<gl-cell border valueAlign="right" label="备注" labelWidth="140rpx" bindclick="showPopup" data-show-name="showRemark" placeholder="30字以内" value="{{orderObj.remark}}" /> <gl-cell border valueAlign="right" label="备注" labelWidth="140rpx" bindclick="showPopup" data-show-name="showRemark" placeholder="30字以内" value="{{orderObj.remark}}" />
<gl-cell border wx:if="{{orderObj.isOpenArtificer}}" valueAlign="right" label="选择技师" labelWidth="140rpx" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="artificerSelectPopup"> <gl-cell border wx:if="{{orderObj.isOpenArtificer}}" valueAlign="right" label="选择技师" labelWidth="140rpx" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="artificerSelectPopup">
<block wx:if="{{orderObj.customer.carSeriesName}}"> <block wx:if="{{orderObj.customer.technicianName}}">
<view class="between"> <view class="between">
技师 技师
</view> </view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!