Commit b0e5aa2b by 张立顺

功能开发

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