Commit e48ea6c6 by 前端

Merge branch 'SAAS+V4.46.1-1107' of http://192.168.3.233:8090/saas_plus/dj-car-b…

…outique-work-wechat into SAAS+V4.46.1-1107
2 parents 7abd9aec 154267c0
// packageEquity/pages/aiCheck/defense/defense.js // packageEquity/pages/aiCheck/defense/defense.js
import { defenseData, typeList } from './constants/data' // import { defenseData, typeList } from './constants/data'
import carLifeApi from '../../../carEquityApi' import carLifeApi from '../../../carEquityApi'
import { import {
setConfigInfo setConfigInfo
...@@ -12,38 +12,6 @@ Page({ ...@@ -12,38 +12,6 @@ Page({
data: { data: {
navBarHeight: 0, navBarHeight: 0,
tabList: [], tabList: [],
// typeList: [
// {
// id: 0,
// name: '全部',
// icon: 'all',
// ids: [2,3]
// },
// {
// id: 1,
// name: '产品异议',
// icon: 'product',
// ids: [2,3]
// },
// {
// id: 2,
// name: '决策异议',
// icon: 'decision',
// ids: [2]
// },
// {
// id: 3,
// name: '价格异议',
// icon: 'price',
// ids: [2]
// },
// {
// id: 4,
// name: '服务异议',
// icon: 'service',
// ids: [2,3]
// },
// ],
currentTab: 0, currentTab: 0,
customeTypeList:[], customeTypeList:[],
linkChainList: [{ linkChainList: [{
...@@ -78,7 +46,9 @@ Page({ ...@@ -78,7 +46,9 @@ Page({
scrollIntoView: 0, scrollIntoView: 0,
list: [], list: [],
id: '', id: '',
scrollTop: 0 scrollTop: 0,
defenseData: [],
typeList: []
}, },
// 头部返回上一级 // 头部返回上一级
back() { back() {
...@@ -93,6 +63,7 @@ Page({ ...@@ -93,6 +63,7 @@ Page({
switchTab(e) { switchTab(e) {
const { index, type } = e.currentTarget.dataset const { index, type } = e.currentTarget.dataset
const { defenseData } = this.data
const { id } = this.data const { id } = this.data
console.log(index,type, id) console.log(index,type, id)
if (index) { if (index) {
...@@ -131,29 +102,40 @@ Page({ ...@@ -131,29 +102,40 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
const { id } = options this.initData().then(r => {
const recordName = `攻防演练 · ${id==2?'延保':'安心包'}` const { id } = options
const result = typeList.filter(item => item.ids.includes(+id)) const recordName = `攻防演练 · ${id==2?'延保':'安心包'}`
console.log(result, 'result') const { typeList, defenseData } = this.data
this.setData({ const result = typeList.filter(item => item.ids.includes(+id))
list: defenseData[id], console.log(result, 'result')
id, this.setData({
recordName, list: defenseData[id],
tabList: result id,
recordName,
tabList: result
})
}) })
this.initData()
}, },
async initData() { initData() {
const { return new Promise(async(resolve, reject) => {
aiPhone const {
} = await setConfigInfo({}); aiPhone,
const { defenseData,
phone typeList
} = wx.$util.getUserInfo() } = await setConfigInfo({});
this.setData({ this.setData({
isDemo: aiPhone.includes(phone) defenseData,
typeList
})
const {
phone
} = wx.$util.getUserInfo()
this.setData({
isDemo: aiPhone.includes(phone)
})
this.getRole()
resolve()
}) })
this.getRole()
}, },
getRole() { getRole() {
carLifeApi.sparringRole({ carLifeApi.sparringRole({
......
...@@ -5,13 +5,13 @@ refresher-enabled="{{true}}" ...@@ -5,13 +5,13 @@ refresher-enabled="{{true}}"
refresher-threshold="104" scroll-top="{{scrollTop}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="restPageNum" bindscrolltolower="onBottomRefresh" class="record-list"> refresher-threshold="104" scroll-top="{{scrollTop}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="restPageNum" bindscrolltolower="onBottomRefresh" class="record-list">
<view class="record-item" wx:for="{{recordList}}" data-role="{{item.roleType}}" wx:key="id" bindtap="toReport" data-id="{{item.id}}"> <view class="record-item" wx:for="{{recordList}}" data-role="{{item.roleType}}" wx:key="id" bindtap="toReport" data-id="{{item.id}}">
<view class="record-left"> <view class="record-left">
<view class="record-title">驻店延保</view> <view class="record-title">{{item.recordName}}</view>
<view class="record-time" wx:if="{{item.sparringDuration}}">时长:{{item.sparringDuration}}</view> <view class="record-time" wx:if="{{item.sparringDuration}}">时长:{{item.sparringDuration}}</view>
<view class="record-date">时间:{{item.createdDate}}</view> <view class="record-date">时间:{{item.createdDate}}</view>
</view> </view>
<view class="record-right"> <view class="record-right">
<view class="under-way" wx:if="{{item.sparringStatus == 0}}">报告生成中...</view> <view class="under-way" wx:if="{{item.sparringStatus == 0}}">报告生成中...</view>
<view class="score" wx:else><view class="score-num">{{item.score}}</view>分</view> <view class="score" wx:else><view class="score-num">{{item.level}}</view></view>
<gl-image class="arrow-right" src="/equity/arrow-right.png"></gl-image> <gl-image class="arrow-right" src="/equity/arrow-right.png"></gl-image>
</view> </view>
</view> </view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!