Commit f95f9042 by zhangxw

不同场景获取门店

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