Commit b0e5aa2b by 张立顺

功能开发

1 parent 5dcd1e01
......@@ -10,7 +10,7 @@
* 2测试
* 3生产环境
*/
let index = 0
let index = 1
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
......
......@@ -78,5 +78,9 @@ module.exports = {
/** 门店模式查询 */
merchantMode(data) {
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.merchant.mode', data)
},
/** 商品查询 */
listByMerchantIdAndIds(data) {
return api.post('dj.api.smartcarlife.quotationGoods.listByMerchantIdAndIds', data)
}
}
......@@ -31,18 +31,22 @@ Component({
orderInfo: {
type: Object,
observer: function (n) {
if (n?.modifyEquityQuotation) {
this.setData({
activeNames: ['3'],
disable: true
})
} else {
this.setData({
activeNames: ['1', '2', '3', '4'],
disable: false
})
}
// if (n?.modifyEquityQuotation) {
// this.setData({
// activeNames: ['3'],
// disable: true
// })
// } else {
// this.setData({
// activeNames: ['1', '2', '3', '4'],
// disable: false
// })
// }
}
},
quotationGoodsList: {
type: Array,
value: () => {}
}
},
......
......@@ -37,20 +37,20 @@
请勾选增值车损险服务
</van-checkbox> -->
<!-- <block wx:if="{{insuranceCheck}}"> -->
<view class="goodsCheckItem">
<view class="goodsCheckItem" wx:for="{{quotationGoodsList}}" wx:key="index">
<view class="check">
<van-checkbox value="{{ insuranceCheck }}" shape="square" bind:change="onChangeInsurance"></van-checkbox>
</view>
<view class="goodsInfo">
<view class="incrementInfo">
<image class="img" src="{{orderInfo.quotationGoodsInfo.titlePictureUrl}}" />
<image class="img" src="{{item.quotationGoodsInfo.titlePictureUrl}}" />
<view class="info">
<view class="infoTitle">{{orderInfo.quotationGoodsInfo.goodsName}}</view>
<view class="infoTitle">{{item.quotationGoodsInfo.goodsName}}</view>
<view>
<text>包含</text>
<block wx:key="index" wx:for="{{orderInfo.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList}}">
<block wx:for-index="itemIndex" wx:for-item="i" wx:key="itemIndex" wx:for="{{item.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList}}">
<text>
{{item.serviceName}}{{orderInfo.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList.length==index?'':'、'}}
{{i.serviceName}}{{i.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList.length==index?'':'、'}}
</text>
</block>
</view>
......
......@@ -17,6 +17,7 @@ Page({
confirmStatus: false,
saveStatus: false
},
quotationGoodsList: [], //权益商品列表
// owner: {
// owner: 'test2',
// phone: 15816539334,
......@@ -315,19 +316,32 @@ Page({
.then(result => {
console.log(result)
let { data } = result
if (!data.length) return wx.$util.showToast('请先添加权益配置')
let { id: appreciation, goodsInfo, upgradeGoodsName: goodsName, upgradeGoodsServiceItemsList } = data[0]
this.setData({
['orderInfo.valueAddedVehicleLoss']: {
appreciation,
goodsName,
type: 3
},
['orderInfo.quotationGoodsInfo']: {
titlePictureUrl: goodsInfo.thumbUrl,
goodsName,
quotationGoodsServiceItemsRelationDTOList: upgradeGoodsServiceItemsList
data = data.map(item => {
return {
...item,
appreciation: item.appreciation,
goodsName: item.upgradeGoodsName,
quotationGoodsServiceItemsRelationDTOList: item.upgradeGoodsServiceItemsList,
titlePictureUrl: item.titlePictureUrl
}
})
this.setData({
quotationGoodsList: data
})
// this.setData({
// ['orderInfo.valueAddedVehicleLoss']: {
// appreciation,
// goodsName,
// type: 3
// },
// ['orderInfo.quotationGoodsInfo']: {
// titlePictureUrl: goodsInfo.thumbUrl,
// goodsName,
// quotationGoodsServiceItemsRelationDTOList: upgradeGoodsServiceItemsList
// }
// })
})
.catch(err => {})
},
......
......@@ -64,7 +64,8 @@ Component({
triggered: false,
scrollTop: 0,
userInfo: {},
sufferReason: ''
sufferReason: '',
mode: 0
},
lifetimes: {
......@@ -96,19 +97,23 @@ Component({
getMerchant4SMode() {
let { storeInfo } = this.data
// 场景
merchantMode({ merchantId4s: storeInfo?.merchantId, Source: 2 })
merchantMode({ merchantId4s: storeInfo?.merchantId })
.then(result => {
console.log(result, 'mode')
this.setData({
mode: result.data
})
let { data, code } = result
if (code == 0) {
this.setData({
mode: data.mode
})
}
})
.catch(err => {})
},
handleClickOrderBtn(e) {
// console.log(e)
// let { target } = e.target.dataset
wx.$router.go('createOrderCarQuotation')
let { mode } = this.data
wx.$router.go(mode ? 'createOrderCarQuotationSimple' : 'createOrderCarQuotation')
},
onBottomRefresh() {
this.getList()
......
......@@ -3,7 +3,7 @@ import api from '~/api/api.js'
// console.log(app, 'app')
// console.log(wx)globalData
/** 判断是不是超管角色 */
export const checkYqdSuper = (userInfo,globalData) => {
export const checkYqdSuper = (userInfo, globalData) => {
let merchantAccountType = userInfo.merchantAccountList.every(item => {
return item == 6 || item == 8
})
......@@ -14,7 +14,7 @@ export const checkYqdSuper = (userInfo,globalData) => {
// console.log(app);
globalData.isYqdSuper = userInfo.userType != 2 && !userInfo.isSuper && merchantAccountType
globalData.isStaff = userInfo.userType == 2 && !userInfo.isSuper && merchantAccountType
console.log(globalData.isStaff);
// console.log(globalData.isStaff);
}
// 获取园区店信息
export const getYQInfo = userInfo => {
......@@ -30,9 +30,11 @@ export const getYQInfo = userInfo => {
if (!userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2) {
app.globalData.yqdInfo = {
subIndex,
merchantRange: [{
merchantName: userInfo.merchantName
}]
merchantRange: [
{
merchantName: userInfo.merchantName
}
]
}
// this.setData({
// merchantRange: [{ merchantName: userInfo.merchantName }]
......@@ -47,10 +49,7 @@ export const getYQInfo = userInfo => {
.getYQList()
.then(res => {
// console.log(res)
let {
code,
data
} = res
let { code, data } = res
if (code == 0) {
let arr = []
if (data.length > 1) {
......@@ -61,9 +60,11 @@ export const getYQInfo = userInfo => {
}
arr = [all, ...data]
} else {
arr = [{
merchantName: userInfo.merchantName
}]
arr = [
{
merchantName: userInfo.merchantName
}
]
}
app.globalData.yqdInfo = {
merchantRange: arr,
......@@ -89,10 +90,7 @@ export const getYQorderInfo = () => {
} else {
let userInfo = wx.$util.getUserInfo()
if (!userInfo) this.login(true)
let {
merchantId,
merchantName
} = userInfo.subLoginUser
let { merchantId, merchantName } = userInfo.subLoginUser
api
.getMerchantRecordingSettings({
......@@ -101,10 +99,7 @@ export const getYQorderInfo = () => {
})
.then(res => {
// console.log(res)
let {
code,
data
} = res
let { code, data } = res
if (code == 0) {
// debugger
// console.log(typeof data.yqPhoneConfig, 'data.yqPhoneConfig')
......@@ -131,9 +126,7 @@ export const setConfigInfo = globalData => {
// 如果有 直接返回
// console.log(app.globalData.YQorderSetting, 'app.globalData.YQorderSetting')
// console.log('app.globalData.YQorderSetting', app.globalData.YQorderSetting)
let {
configInfo
} = globalData
let { configInfo } = globalData
if (configInfo) {
return resolve(configInfo)
} else {
......@@ -162,9 +155,7 @@ export const setConfigInfo = globalData => {
export const checkScene = options => {
// let query = options.query
let {
query
} = options
let { query } = options
if (query) {
// 解码
for (const key in query) {
......@@ -252,23 +243,22 @@ export const get4SStoreList = options => {
api
.getSceneMerchantRefStoreList(options)
.then(res => {
let {
code,
data
} = res
let { code, data } = res
if (code == 0) {
app.globalData.storeListRange = data
let default4SStoreInfo = wx.$util.getUserInfo()?.default4SStoreInfo ? wx.$util.getUserInfo()?.default4SStoreInfo : data && data[0]
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
})
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)
}
})
......@@ -285,10 +275,7 @@ export const getStaffListByMerchant = options => {
api
.getStaffListByMerchantAPI(options)
.then(res => {
let {
code,
data
} = res
let { code, data } = res
if (code == 0) {
app.globalData.staffListRange = data
resolve(app.globalData.staffListRange)
......@@ -298,4 +285,4 @@ export const getStaffListByMerchant = options => {
console.log(error)
})
})
}
\ 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!