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
import { defenseData, typeList } from './constants/data'
// import { defenseData, typeList } from './constants/data'
import carLifeApi from '../../../carEquityApi'
import {
setConfigInfo
......@@ -12,38 +12,6 @@ Page({
data: {
navBarHeight: 0,
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,
customeTypeList:[],
linkChainList: [{
......@@ -78,7 +46,9 @@ Page({
scrollIntoView: 0,
list: [],
id: '',
scrollTop: 0
scrollTop: 0,
defenseData: [],
typeList: []
},
// 头部返回上一级
back() {
......@@ -93,6 +63,7 @@ Page({
switchTab(e) {
const { index, type } = e.currentTarget.dataset
const { defenseData } = this.data
const { id } = this.data
console.log(index,type, id)
if (index) {
......@@ -131,29 +102,40 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { id } = options
const recordName = `攻防演练 · ${id==2?'延保':'安心包'}`
const result = typeList.filter(item => item.ids.includes(+id))
console.log(result, 'result')
this.setData({
list: defenseData[id],
id,
recordName,
tabList: result
this.initData().then(r => {
const { id } = options
const recordName = `攻防演练 · ${id==2?'延保':'安心包'}`
const { typeList, defenseData } = this.data
const result = typeList.filter(item => item.ids.includes(+id))
console.log(result, 'result')
this.setData({
list: defenseData[id],
id,
recordName,
tabList: result
})
})
this.initData()
},
async initData() {
const {
aiPhone
} = await setConfigInfo({});
const {
phone
} = wx.$util.getUserInfo()
this.setData({
isDemo: aiPhone.includes(phone)
initData() {
return new Promise(async(resolve, reject) => {
const {
aiPhone,
defenseData,
typeList
} = await setConfigInfo({});
this.setData({
defenseData,
typeList
})
const {
phone
} = wx.$util.getUserInfo()
this.setData({
isDemo: aiPhone.includes(phone)
})
this.getRole()
resolve()
})
this.getRole()
},
getRole() {
carLifeApi.sparringRole({
......
......@@ -5,13 +5,13 @@ refresher-enabled="{{true}}"
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-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-date">时间:{{item.createdDate}}</view>
</view>
<view class="record-right">
<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>
</view>
</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!