Commit 43fede05 by 前端

Merge branch 'sass+V5.2.0' into 'master'

上线合并

See merge request !36
2 parents 0a53c0f6 1534648c
...@@ -62,6 +62,22 @@ module.exports = { ...@@ -62,6 +62,22 @@ module.exports = {
...data ...data
}) })
}, },
// 新历史订单列表
getOrderListPage(data) {
return http.post({
method: 'dj.pad.api.history.order.page',
projectName: 'pad',
...data
})
},
// 查询延保类类目列表
getGoodsCategoryList(data) {
return http.post({
method: 'dj.pad.api.goodsCategoryConfiguration.extendedWarranty',
projectName: 'pad',
...data
})
},
/**客户邀约记录 */ /**客户邀约记录 */
customerInviteRecordPage(data) { customerInviteRecordPage(data) {
......
import sign from "./sign.js"; import sign from './sign.js'
import { import { secretKey, pathEnum, domain, djDomain, merchantDomain, djSecretKey } from '../../env'
secretKey,
pathEnum,
domain,
djDomain,
merchantDomain,
djSecretKey,
} from "../../env";
const HOST = { const HOST = {
scrm: domain, scrm: domain,
dj: djDomain, dj: djDomain,
merchant: merchantDomain, merchant: merchantDomain,
ip: "http://192.168.1.67:8392", ip: 'http://192.168.1.125:8080'
}; }
class Request { class Request {
get (params, returnAll = false, hostType) { get(params, returnAll = false, hostType) {
return this.request("GET", params, returnAll, hostType); return this.request('GET', params, returnAll, hostType)
} }
post (params, returnAll = false, hostType) { post(params, returnAll = false, hostType) {
return this.request("POST", params, returnAll, hostType); return this.request('POST', params, returnAll, hostType)
} }
fetch (method, data, returnAll = true, hostType) { fetch(method, data, returnAll = true, hostType) {
return this.post( return this.post(
{ {
method, method,
...data, ...data
}, },
returnAll, returnAll,
hostType hostType
); )
} }
request (RequestMethods, params, returnAll, hostType = "dj") { request(RequestMethods, params, returnAll, hostType = 'dj') {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let _this = this; let _this = this
uni.getNetworkType({ uni.getNetworkType({
success (res) { success(res) {
if (res.networkType == "none") { if (res.networkType == 'none') {
uni.hideLoading(); uni.hideLoading()
uni.showToast({ uni.showToast({
title: '网络异常', title: '网络异常',
icon: "none", icon: 'none'
}); })
reject("网络异常"); reject('网络异常')
return; return
} }
let header = let header =
RequestMethods === "POST" RequestMethods === 'POST'
? { ? {
"content-type": "application/x-www-form-urlencoded", 'content-type': 'application/x-www-form-urlencoded'
} }
: { : {
"Cache-Control": "no-cache", 'Cache-Control': 'no-cache'
}; }
let projectName = params.projectName; let projectName = params.projectName
if (!projectName) projectName = _this.getRopProject(params.method); if (!projectName) projectName = _this.getRopProject(params.method)
const path = pathEnum[projectName]; const path = pathEnum[projectName]
params = _this.getData(params, hostType); params = _this.getData(params, hostType)
uni.request({ uni.request({
url: `${HOST[hostType]}${path}router?method=${params.method}`, url: `${HOST[hostType]}${path}router?method=${params.method}`,
data: params, data: params,
method: RequestMethods, method: RequestMethods,
header, header,
dataType: "json", dataType: 'json',
responseType: "text", responseType: 'text',
success (response) { success(response) {
/**业务代码 */ /**业务代码 */
let { data, statusCode } = response; let { data, statusCode } = response
if (!data || statusCode != 200) { if (!data || statusCode != 200) {
uni.hideLoading() uni.hideLoading()
let errMsg = '' let errMsg = ''
if (!data) errMsg = '获取数据失败,请重试。' if (!data) errMsg = '获取数据失败,请重试。'
else errMsg = '服务器暂时不可用,请稍后再次尝试。' else errMsg = '服务器暂时不可用,请稍后再次尝试。'
return reject(errMsg); return reject(errMsg)
} }
let { code, message } = data; let { code, message } = data
if (returnAll) { if (returnAll) {
resolve(data); resolve(data)
return; return
} }
if (code == 20 || code == 21) { if (code == 20 || code == 21) {
console.log(params.method) console.log(params.method)
const pages = getCurrentPages(), const pages = getCurrentPages(),
currentPage = pages[pages.length - 1] currentPage = pages[pages.length - 1]
uni.hideLoading(); uni.hideLoading()
if (currentPage.route != 'pages/common/login') uni.reLaunch({ if (currentPage.route != 'pages/common/login')
url: "/pages/common/login", uni.reLaunch({
}); url: '/pages/common/login'
})
} else { } else {
if (code == "0") { if (code == '0') {
resolve(data.data); resolve(data.data)
} else { } else {
uni.hideLoading(); uni.hideLoading()
uni.showToast({ uni.showToast({
title: message || "系统异常", title: message || '系统异常',
icon: "none", icon: 'none'
}); })
} }
} }
}, },
fail (error) { fail(error) {
uni.hideLoading(); uni.hideLoading()
console.error(`${params.method}接口异常:`, error); console.error(`${params.method}接口异常:`, error)
uni.showToast({ uni.showToast({
title: title: typeof error == 'string' ? error : error.errMsg ? error.errMsg : JSON.stringify(error) || '系统异常',
typeof error == "string" icon: 'error'
? error })
: error.errMsg reject(error)
? error.errMsg
: JSON.stringify(error) || "系统异常",
icon: "error",
});
reject(error);
},
complete () {
uni.stopPullDownRefresh();
}, },
}); complete() {
}, uni.stopPullDownRefresh()
});
});
}
getData (params, hostType = "scrm") {
let projectName = params.projectName;
if (!projectName) projectName = this.getRopProject(params.method);
else delete params.projectName;
let appKey = "48e5e13229b82c1b4e6e8c96151f0637";
let secret = "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b";
if (secretKey[projectName]) {
appKey = secretKey[projectName].appKey;
secret = secretKey[projectName].secret;
} }
if (hostType == "dj") { })
appKey = djSecretKey.appKey;
secret = djSecretKey.secret;
} }
let { sessionId } = uni.$storage.get(); })
let noSignAttr = []; })
if (!params.sessionId && sessionId) params.sessionId = sessionId;
if (params.delSessionId) {
delete params.sessionId;
delete params.delSessionId;
} }
if (params.noSignAttr) { getData(params, hostType = 'scrm') {
noSignAttr = params.noSignAttr; let projectName = params.projectName
delete params.noSignAttr; if (!projectName) projectName = this.getRopProject(params.method)
else delete params.projectName
let appKey = '48e5e13229b82c1b4e6e8c96151f0637'
let secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
if (secretKey[projectName]) {
appKey = secretKey[projectName].appKey
secret = secretKey[projectName].secret
} }
params.v = "1.0.0"; if (hostType == 'dj') {
params.format = "json"; appKey = djSecretKey.appKey
params.locale = "zh_CN"; secret = djSecretKey.secret
params.source = "app";
params.appKey = appKey;
return sign(params, secret, noSignAttr);
} }
getRopProject (method) { let { sessionId } = uni.$storage.get()
const projectName = method.split(".")[2]; let noSignAttr = []
return projectName; if (!params.sessionId && sessionId) params.sessionId = sessionId
if (params.delSessionId) {
delete params.sessionId
delete params.delSessionId
} }
uni_request ({ if (params.noSignAttr) {
url, noSignAttr = params.noSignAttr
method = "GET", delete params.noSignAttr
data = {}, }
header = {}, params.v = '1.0.0'
dataType = "json", params.format = 'json'
responseType = "text", params.locale = 'zh_CN'
}) { params.source = 'app'
return new Promise((resolve) => { params.appKey = appKey
return sign(params, secret, noSignAttr)
}
getRopProject(method) {
const projectName = method.split('.')[2]
return projectName
}
uni_request({ url, method = 'GET', data = {}, header = {}, dataType = 'json', responseType = 'text' }) {
return new Promise(resolve => {
uni.request({ uni.request({
url, url,
data, data,
...@@ -172,12 +154,12 @@ class Request { ...@@ -172,12 +154,12 @@ class Request {
header, header,
dataType, dataType,
responseType, responseType,
success (response) { success(response) {
resolve(response.data); resolve(response.data)
}, }
}); })
}); })
} }
} }
export default new Request(); export default new Request()
...@@ -192,7 +192,8 @@ export default { ...@@ -192,7 +192,8 @@ export default {
label: "场景集市", label: "场景集市",
icon: "scene", icon: "scene",
name: 'SceneMarket', name: 'SceneMarket',
eventCode: 'app_scene_market' eventCode: 'app_scene_market',
hidden: false
} }
] ]
let { sceneType } = uni.$storage.get("userInfo") let { sceneType } = uni.$storage.get("userInfo")
...@@ -435,8 +436,14 @@ export default { ...@@ -435,8 +436,14 @@ export default {
eventCode: 'app_scene_change' eventCode: 'app_scene_change'
}) })
}, },
// 学习中心权限获取 // 学习中心权限获取,场景集市权限
getStudyCenterPermission () { getStudyCenterPermission () {
const userInfo = uni.$storage.get('userInfo')
if (userInfo.subLoginUser.channelType == 9) {
this.tabs[2].hidden = true
this.tabs[3].hidden = true
return
} else {
const res = uni.$storage.get('studyCenterPermission') const res = uni.$storage.get('studyCenterPermission')
const { directSaleAuth, hmzxAuth, authorizedBusinessList } = res // 当驻店人员为非直营,且非鸿蒙智行延保业务驻店人员情况下。隐藏左侧【学习中心】图标 const { directSaleAuth, hmzxAuth, authorizedBusinessList } = res // 当驻店人员为非直营,且非鸿蒙智行延保业务驻店人员情况下。隐藏左侧【学习中心】图标
const isYb = authorizedBusinessList && authorizedBusinessList.includes(1) // 1.延保 2.轻改 3.权益 const isYb = authorizedBusinessList && authorizedBusinessList.includes(1) // 1.延保 2.轻改 3.权益
...@@ -444,6 +451,7 @@ export default { ...@@ -444,6 +451,7 @@ export default {
this.tabs[2].hidden = false this.tabs[2].hidden = false
} }
} }
}
}, },
beforeCreate () { beforeCreate () {
// clearInterval(this.trackInterval) // clearInterval(this.trackInterval)
......
<template> <template>
<view class="reception-box"> <view class="reception-box">
<view :class="['record-box-content',`${showInfo || !showRecord?'hide-record':'show-record'}`]"> <view :class="['record-box-content',`${showInfo || !showRecord?'hide-record':'show-record'}`]">
<view class="left box-class"> <view class="left box-class" v-if="!onlyRight">
<view class="common-title"> <view class="common-title">
业绩看板 业绩看板
<view <view
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</view> </view>
</template> </template>
</view> </view>
<view class="right box-class"> <view class="right box-class" :class="{'only-right':onlyRight}">
<type-tab-component <type-tab-component
:typeList="typeList" :typeList="typeList"
:tabIndex.sync="tabIndex" :tabIndex.sync="tabIndex"
...@@ -184,6 +184,10 @@ export default { ...@@ -184,6 +184,10 @@ export default {
} }
}, },
computed: { computed: {
onlyRight() {
const userInfo = uni.$storage.get('userInfo')
return userInfo.subLoginUser.channelType == 9
},
showPageFlag () { showPageFlag () {
return Object.keys(this.pageData).length return Object.keys(this.pageData).length
}, },
...@@ -399,6 +403,9 @@ export default { ...@@ -399,6 +403,9 @@ export default {
width: toRpx(1358); width: toRpx(1358);
border: toRpx(2) solid #fff; border: toRpx(2) solid #fff;
box-sizing: border-box; box-sizing: border-box;
&.only-right {
width: calc(100% - #{toRpx(64)});
}
&-content { &-content {
width: 100%; width: 100%;
position: absolute; position: absolute;
......
<template>
<view class="goods-list is-defeat-order">
<template v-if="params.loadComplete">
<template v-if="categoryList.length">
<view v-for="(category, index) in categoryList" :key="index" class="item-box">
<view class="goods-title flex">{{ category.categoryName }}</view>
<view class="defeat-goods-list">
<view v-for="(subItem, subIndex) in category.subItems" :key="`${index}_${subIndex}`" :class="['item flex', { active: checkActive(subItem) }]" @click="choose(subItem)">
<view class="sprite-icon icon-tag-checked"></view>
<text class="goods-name text-hide">{{ subItem.categoryName }}</text>
</view>
</view>
</view>
</template>
</template>
</view>
</template>
<script>
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'GoodsCategory',
props: {
data: {
type: Array,
default: () => []
}
},
data() {
return {
categoryList: [],
currentIds: [],
chooseList: []
}
},
mounted() {
this.getList()
},
watch: {
data: {
handler(newVal) {
console.log(newVal)
if (newVal && newVal.length > 0) {
if (this.categoryList.length > 0) {
this.restoreSelectedState()
}
}
},
deep: true,
immediate: true
},
categoryList: {
handler(newVal) {
if (newVal && newVal.length > 0 && this.data && this.data.length > 0) {
this.restoreSelectedState()
}
},
deep: true
}
},
methods: {
async getList(searchValue) {
await this.getGoodsCategoryList()
if (searchValue) {
this.handleSearch(searchValue)
}
if (this.data && this.data.length > 0) {
this.restoreSelectedState()
}
},
reset() {
this.currentIds = []
this.chooseList = []
},
restoreSelectedState() {
console.log(this.data)
console.log(this.categoryList)
if (!this.data || !this.categoryList.length) return
this.currentIds = []
this.chooseList = []
this.categoryList.forEach(category => {
category.subItems.forEach(item => {
const isSelected = this.data.some(selectedItem => selectedItem.id === item.id)
console.log(isSelected)
if (isSelected) {
this.currentIds.push(item.id)
this.chooseList.push(item)
}
})
})
},
async getGoodsCategoryList() {
let params = {
categoryType: ''
}
let res = await uni.$api.boutiqueApi.getGoodsCategoryList(params)
console.log(res)
if (res && res.children) {
this.categoryList = this.processCategoryData(res.children)
}
console.log(this.categoryList)
this.$emit('onComplete')
},
processCategoryData(children) {
return children.map(category => {
let subItems = []
if (category.children && category.children.length > 0) {
subItems = category.children
} else {
subItems = [category]
}
return {
categoryName: category.categoryName,
subItems: subItems
}
})
},
handleSearch(searchValue) {
if (!searchValue) {
this.searchStatus = false
return
}
let filteredList = []
this.categoryList.forEach(category => {
if (category.categoryName.indexOf(searchValue) !== -1) {
filteredList.push(category)
} else {
const filteredSubItems = category.subItems.filter(item => item.categoryName.indexOf(searchValue) !== -1)
if (filteredSubItems.length > 0) {
filteredList.push({
...category,
subItems: filteredSubItems
})
}
}
})
this.searchList = filteredList
this.searchStatus = true
},
choose(item) {
let id = item.id
let index = this.currentIds.indexOf(id)
if (index === -1) {
this.currentIds.push(id)
this.chooseList.push(item)
} else {
this.currentIds.splice(index, 1)
this.chooseList.splice(index, 1)
}
console.log(this.chooseList)
this.$emit('choose', this.chooseList)
},
checkActive(item) {
return this.currentIds.includes(item.id)
}
}
}
</script>
<style scoped lang="scss">
.goods-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
overflow: hidden;
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
box-sizing: border-box;
padding: 0 toRpx(32);
text-align: center;
.no-postion {
color: #f24724;
margin-left: toRpx(10);
font-size: toRpx(22);
}
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
.price {
margin-left: auto;
}
.goods-name {
max-width: toRpx(600);
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
.is-defeat-order {
display: block;
margin: 0;
.item-box {
margin-bottom: toRpx(32);
.goods-title {
color: #888888;
font-size: toRpx(28);
height: toRpx(40);
background: #f5f7fa;
padding-left: toRpx(48);
margin-bottom: toRpx(16);
}
.defeat-goods-list {
gap: toRpx(32);
display: flex;
flex-wrap: wrap;
margin: 0 toRpx(48);
.item {
width: calc((100% - #{toRpx(32)}) / 2);
justify-content: center;
min-height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
padding: toRpx(14) toRpx(32);
word-break: break-all;
text-align: center;
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.disabled {
border: toRpx(2) solid #dce0e666;
color: #3333331a;
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
}
}
</style>
...@@ -175,8 +175,8 @@ const componentConfig = { ...@@ -175,8 +175,8 @@ const componentConfig = {
noData: false noData: false
}, },
15: { 15: {
name: 'DateTimeChange', name: 'GoodsCategory',
title: '选择时间', title: '选择商品类目',
hideSearch: true, hideSearch: true,
loadComplete: false loadComplete: false
} }
......
<template> <template>
<view class="order-popup"> <view class="order-popup">
<popup :position="position" :animation="animation" ref="popup" @onConfirm="confirm" @onCancel="cancel"> <popup :position="position" :animation="animation" ref="popup" @onConfirm="confirm" @onCancel="cancel" @onReset="reset" :showReset="popupType === 15">
<view class="popup-title flex"> <view class="popup-title flex">
{{ title }} {{ title }}
<view class="popup-close flex" @click="close"> <view class="popup-close flex" @click="close">
...@@ -43,6 +43,7 @@ import SkuPopup from './components/SkuPopup.vue' ...@@ -43,6 +43,7 @@ import SkuPopup from './components/SkuPopup.vue'
import DateTime from './components/DateTime.vue' import DateTime from './components/DateTime.vue'
import DateTimeChange from './components/DateTimeChange.vue' import DateTimeChange from './components/DateTimeChange.vue'
import AgreementList from './components/AgreementList.vue' import AgreementList from './components/AgreementList.vue'
import GoodsCategory from './components/GoodsCategory.vue'
export default { export default {
components: { components: {
Popup, Popup,
...@@ -56,7 +57,8 @@ export default { ...@@ -56,7 +57,8 @@ export default {
SkuPopup, SkuPopup,
DateTime, DateTime,
AgreementList, AgreementList,
DateTimeChange DateTimeChange,
GoodsCategory
}, },
name: '', name: '',
props: { props: {
...@@ -170,9 +172,17 @@ export default { ...@@ -170,9 +172,17 @@ export default {
confirm () { confirm () {
try { try {
let { chooseContent, popupType, componentObject } = this let { chooseContent, popupType, componentObject } = this
if (popupType == 13 || popupType == 15) { if (popupType == 13 ) {
chooseContent = this.componentRef().getResult() chooseContent = this.componentRef().getResult()
} }
if(popupType == 15 ) {
this.$emit('onConfirm', {
chooseContent,
popupType
})
this.$refs.popup.close()
return
}
if (chooseContent) { if (chooseContent) {
if (Array.isArray(chooseContent) && !chooseContent.length && componentObject[popupType].nullTips) throw componentObject[popupType].nullTips if (Array.isArray(chooseContent) && !chooseContent.length && componentObject[popupType].nullTips) throw componentObject[popupType].nullTips
this.$emit('onConfirm', { this.$emit('onConfirm', {
...@@ -205,6 +215,15 @@ export default { ...@@ -205,6 +215,15 @@ export default {
this.componentObject[this.popupType].searchValue = '' this.componentObject[this.popupType].searchValue = ''
this.handleSearch() this.handleSearch()
}, },
reset () {
let componentRef = this.componentRef()
if (!componentRef) uni.showToast({
title: '请稍后再试',
icon: 'none'
})
else componentRef.reset()
this.chooseContent = null
},
} }
} }
</script> </script>
......
<template> <template>
<uni-popup <uni-popup ref="popup" :type="position" :is-mask-click="maskClick" :animation="animation">
ref="popup" <view :class="['popup-box', { 'right-box': position == 'right' }]">
:type="position"
:is-mask-click="maskClick"
:animation="animation"
>
<view :class="['popup-box',{'right-box':position=='right'}]">
<slot></slot> <slot></slot>
<view class="popup-footer flex"> <view class="popup-footer flex" v-if="showReset">
<view <view class="popup-btn-three popup-cancel" @click="cancel">{{ cancelText }}</view>
class="popup-btn popup-cancel" <view class="popup-btn-three popup-reset" @click="reset">{{ resetText }}</view>
@click="cancel" <view class="popup-btn-three popup-confirm" @click="confirm">{{ confirmText }}</view>
>{{cancelText}}</view> </view>
<view <view class="popup-footer flex" v-else>
class="popup-btn popup-confirm" <view class="popup-btn popup-cancel" @click="cancel">{{ cancelText }}</view>
@click="confirm" <view class="popup-btn popup-confirm" @click="confirm">{{ confirmText }}</view>
>{{confirmText}}</view>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
export default { export default {
name: 'Popup', name: 'Popup',
props: { props: {
...@@ -43,9 +36,17 @@ export default { ...@@ -43,9 +36,17 @@ export default {
type: String, type: String,
default: '取消' default: '取消'
}, },
resetText: {
type: String,
default: '重置'
},
confirmText:{ confirmText:{
type: String, type: String,
default: '确定' default: '确定'
},
showReset: {
type: Boolean,
default: false
} }
}, },
...@@ -72,11 +73,14 @@ export default { ...@@ -72,11 +73,14 @@ export default {
confirm () { confirm () {
this.$emit('onConfirm') this.$emit('onConfirm')
}, },
reset () {
this.$emit('onReset')
},
} }
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
.popup-box { .popup-box {
border-radius: 32rpx 32rpx 0 0; border-radius: 32rpx 32rpx 0 0;
background: #ffffff; background: #ffffff;
...@@ -97,10 +101,26 @@ export default { ...@@ -97,10 +101,26 @@ export default {
font-size: 32rpx; font-size: 32rpx;
font-weight: 500; font-weight: 500;
} }
.popup-btn-three {
display: flex;
align-items: center;
justify-content: center;
width: 470rpx;
height: 80rpx;
border-radius: 64rpx;
background: #f0f1f5;
color: #333333;
font-size: 32rpx;
font-weight: 500;
}
.popup-confirm { .popup-confirm {
color: #fff; color: #fff;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%); background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
} }
.popup-reset {
background: #e9effe;
color: #2c66f7;
}
} }
} }
.right-box { .right-box {
......
...@@ -49,8 +49,8 @@ const domain = { ...@@ -49,8 +49,8 @@ const domain = {
}[target[index]] }[target[index]]
const djDomain = { const djDomain = {
ip: 'https://dj.test.glsx.com.cn', ip: 'http://dj.dev.glsx.com.cn',
// ip: 'http://192.168.2.80:8558', // ip: 'http://192.168.1.125:8080',
dev: 'http://dj.dev.glsx.com.cn', dev: 'http://dj.dev.glsx.com.cn',
beta: 'https://dj.beta.glsx.com.cn', //预发布 appid: wx9f91c1ec493eb425 beta: 'https://dj.beta.glsx.com.cn', //预发布 appid: wx9f91c1ec493eb425
uat: 'https://dj.test.glsx.com.cn', //测试 appid: wxe10067a63c1856ac uat: 'https://dj.test.glsx.com.cn', //测试 appid: wxe10067a63c1856ac
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name" : "展业助手", "name" : "展业助手",
"appid" : "__UNI__D3BD3DF", "appid" : "__UNI__D3BD3DF",
"description" : "", "description" : "",
"versionName" : "2.14.0", "versionName" : "2.16.0",
"versionCode" : "2140", "versionCode" : "2160",
"transformPx" : false, "transformPx" : false,
"sassImplementationName" : "node-sass", "sassImplementationName" : "node-sass",
/* 5+App特有相关 */ /* 5+App特有相关 */
......
...@@ -6,7 +6,17 @@ ...@@ -6,7 +6,17 @@
<view class="form"> <view class="form">
<template v-for="(i, index) in formObject"> <template v-for="(i, index) in formObject">
<view :class="['form-item', { active: focusIndex == index }]" :key="index"> <view :class="['form-item', { active: focusIndex == index }]" :key="index">
<view class="form-item-box"> <view class="form-item-box" v-if="i.key == 'goodsCtegory'">
<view :class="['select flex', { placeholderStyle: !customerInfo[i.key] }]" @click="showPopup(i.popKey, index)">
<view class="value text-hide" v-if="chooseContent.length > 0">
<text class="category-name" v-for="(item, index) in chooseContent.slice(0, 2)" :key="index">{{ item.categoryName }}</text>
<text class="category-name" v-if="chooseContent.length > 2">+ {{ chooseContent.length - 2 }}</text>
</view>
<view class="value text-hide" v-else>请选择</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</view>
<view class="form-item-box" v-else>
<view :class="['select flex', { placeholderStyle: !customerInfo[i.key] }]" @click="showPopup(i.popKey, index)"> <view :class="['select flex', { placeholderStyle: !customerInfo[i.key] }]" @click="showPopup(i.popKey, index)">
<view class="value text-hide">{{ customerInfo[i.key] || i.placeholder }}</view> <view class="value text-hide">{{ customerInfo[i.key] || i.placeholder }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons> <uni-icons class="arrow" type="right" :size="16"></uni-icons>
...@@ -14,13 +24,14 @@ ...@@ -14,13 +24,14 @@
</view> </view>
</view> </view>
</template> </template>
<view class="form-check flex" @click="showphoto = !showphoto"> <view class="form-check flex" @click="showphoto = !showphoto">
<view :class="['check-box flex', { checked: showphoto }]"> <view :class="['check-box flex', { checked: showphoto }]">
<uni-icons type="checkmarkempty" :size="14" color="#fff"></uni-icons> <uni-icons type="checkmarkempty" :size="14" color="#fff"></uni-icons>
</view> </view>
显示凭证 显示凭证
</view> </view>
<view class="form-check flex" @click="merchantOrder = !merchantOrder"> <view class="form-check flex" @click="merchantOrder = !merchantOrder" v-if="!subLoginUserChannelType">
<view :class="['check-box flex', { checked: merchantOrder }]"> <view :class="['check-box flex', { checked: merchantOrder }]">
<uni-icons type="checkmarkempty" :size="14" color="#fff"></uni-icons> <uni-icons type="checkmarkempty" :size="14" color="#fff"></uni-icons>
</view> </view>
...@@ -40,7 +51,7 @@ ...@@ -40,7 +51,7 @@
<view class="card-list"> <view class="card-list">
<view class="card-item" v-for="item in list" :key="item.id"> <view class="card-item" v-for="item in list" :key="item.id">
<template v-if="showphoto"> <template v-if="showphoto">
<image v-if="item.vdQuotationPaymentDoc && item.vdQuotationPaymentDoc.paymentDocUrl" class="image-box" :src="item.vdQuotationPaymentDoc.paymentDocUrl" /> <image v-if="item.paymentDocUrl" class="image-box" :src="item.paymentDocUrl" />
<image v-else class="image-box photo" src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/pay.webp" /> <image v-else class="image-box photo" src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/pay.webp" />
<view class="gradient-overlay"></view> <view class="gradient-overlay"></view>
</template> </template>
...@@ -68,7 +79,7 @@ ...@@ -68,7 +79,7 @@
<view class="label">实收金额</view> <view class="label">实收金额</view>
<view class="price"> <view class="price">
<view class="flag">¥</view> <view class="flag">¥</view>
{{ accDiv(item.equityPrice) }} {{ item.equityPrice }}
</view> </view>
</view> </view>
</view> </view>
...@@ -87,6 +98,7 @@ ...@@ -87,6 +98,7 @@
</template> </template>
</view> </view>
<car-brands ref="carBrandListVisible" @select="handleSelect($event, 'carBrandListVisible')" @close="resetFocusIndex" /> <car-brands ref="carBrandListVisible" @select="handleSelect($event, 'carBrandListVisible')" @close="resetFocusIndex" />
<OrderPopup ref="goodsCtegoryVisible" :data="chooseContent" @onConfirm="onConfirm" :externalData="[]" :popupType="15" />
</view> </view>
</template> </template>
...@@ -95,8 +107,9 @@ import utils from '@/utils/utils' ...@@ -95,8 +107,9 @@ import utils from '@/utils/utils'
import Record from '@/mixin/record' import Record from '@/mixin/record'
import CarBrands from '@/components/CarBrands.vue' import CarBrands from '@/components/CarBrands.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import OrderPopup from '@/components/OrderPopup/index.vue'
export default { export default {
components: { CarBrands }, components: { CarBrands, OrderPopup },
name: 'History', name: 'History',
mixins: [Record], mixins: [Record],
props: { props: {
...@@ -115,13 +128,21 @@ export default { ...@@ -115,13 +128,21 @@ export default {
key: 'carModel', key: 'carModel',
type: 'select', type: 'select',
popKey: 'carBrandListVisible' popKey: 'carBrandListVisible'
},
{
placeholder: '商品类目',
key: 'goodsCtegory',
type: 'select',
popKey: 'goodsCtegoryVisible'
} }
], ],
customerInfo: {}, customerInfo: {},
focusIndex: -1, focusIndex: -1,
showphoto: false, showphoto: false,
formatList: [], formatList: [],
merchantOrder: false //门店订单 merchantOrder: false, //门店订单
historyOrderGoodsTypes: [],
chooseContent: []
} }
}, },
watch: { watch: {
...@@ -165,6 +186,9 @@ export default { ...@@ -165,6 +186,9 @@ export default {
shopMerchantId() { shopMerchantId() {
return uni.$storage.get('userInfo').shopMerchantId return uni.$storage.get('userInfo').shopMerchantId
}, },
subLoginUserChannelType() {
return uni.$storage.get('userInfo').subLoginUser.channelType == 9
},
channelType() { channelType() {
const { channelType } = uni.$storage.get('userInfo') const { channelType } = uni.$storage.get('userInfo')
return channelType return channelType
...@@ -176,6 +200,9 @@ export default { ...@@ -176,6 +200,9 @@ export default {
methods: { methods: {
init() { init() {
this.customerInfo = this.watchCustomerInfo this.customerInfo = this.watchCustomerInfo
if (this.subLoginUserChannelType) {
this.merchantOrder = true
}
// if (!this.customerInfo.carModel && !this.isByd) this.$refs.carBrandListVisible.autoSelect() // if (!this.customerInfo.carModel && !this.isByd) this.$refs.carBrandListVisible.autoSelect()
// else // else
this.search() this.search()
...@@ -198,6 +225,7 @@ export default { ...@@ -198,6 +225,7 @@ export default {
return `${year}-${month}-${day}` return `${year}-${month}-${day}`
}, },
async getQuotationList() { async getQuotationList() {
const { shopMerchantId, pageNum, pageSize, merchantOrder } = this, const { shopMerchantId, pageNum, pageSize, merchantOrder } = this,
carModel = this.customerInfo.carModel carModel = this.customerInfo.carModel
...@@ -213,7 +241,8 @@ export default { ...@@ -213,7 +241,8 @@ export default {
pageSize, pageSize,
carModel: carModel || '', carModel: carModel || '',
orderStatus: 3, orderStatus: 3,
merchantOrder merchantOrder,
historyOrderGoodsTypes: this.historyOrderGoodsTypes
} }
if (!params.merchantOrder) { if (!params.merchantOrder) {
delete params.merchantId delete params.merchantId
...@@ -221,7 +250,7 @@ export default { ...@@ -221,7 +250,7 @@ export default {
params.minCreateTime = dayjs(Date.now() - 90 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') params.minCreateTime = dayjs(Date.now() - 90 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
params.carChildsBrandIds = carChildsBrandIds params.carChildsBrandIds = carChildsBrandIds
} }
let { list, total } = await uni.$api.boutiqueApi.getOrderList(params) let { list, total } = await uni.$api.boutiqueApi.getOrderListPage(params)
uni.hideLoading() uni.hideLoading()
this.list = [...(pageNum == 1 ? [] : this.list), ...list] this.list = [...(pageNum == 1 ? [] : this.list), ...list]
...@@ -291,6 +320,53 @@ export default { ...@@ -291,6 +320,53 @@ export default {
}, },
resetFocusIndex() { resetFocusIndex() {
this.focusIndex = -1 this.focusIndex = -1
},
// 修改 onConfirm 方法
onConfirm(chooseList) {
console.log(chooseList)
this.chooseContent = chooseList.chooseContent || []
this.historyOrderGoodsTypes = []
// 检查chooseList和chooseContent是否存在
if (chooseList && chooseList.chooseContent && chooseList.chooseContent.length > 0) {
// 按parentId分组处理level为3的数据
const level3Map = new Map()
// 首先处理所有数据
chooseList.chooseContent.forEach(item => {
if (item.level === 2) {
// 当level为2时,添加结构为{secondaryGoodsType:item.categoryType, thirdLevelGoodsTypes:null}
this.historyOrderGoodsTypes.push({
secondaryGoodsType: item.categoryType,
thirdLevelGoodsTypes: null
})
} else if (item.level === 3) {
// 当level为3时,先按parentId分组
const parentCategoryType = item.parentCategoryType
if (level3Map.has(parentCategoryType)) {
// 如果parentId已存在,则将当前categoryType添加到数组中
level3Map.get(parentCategoryType).push(item.categoryType)
} else {
// 如果parentId不存在,则创建新数组
level3Map.set(parentCategoryType, [item.categoryType])
}
}
})
// 然后将分组后的level3数据添加到historyOrderGoodsTypes中
level3Map.forEach((categoryTypes, parentCategoryType) => {
this.historyOrderGoodsTypes.push({
secondaryGoodsType: parentCategoryType,
thirdLevelGoodsTypes: categoryTypes
})
})
}
console.log(this.historyOrderGoodsTypes)
this.list = []
this.pageNum = 1
uni.$track.add({ eventCode: 'app_goodsGategory_change', eventType: 0 })
this.getQuotationList()
} }
} }
} }
...@@ -334,6 +410,19 @@ export default { ...@@ -334,6 +410,19 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding: 0 toRpx(24); padding: 0 toRpx(24);
z-index: 2; z-index: 2;
.category-name {
width: toRpx(160);
height: toRpx(48);
border-radius: toRpx(8);
background: #f5f6f7;
color: #333333;
font-size: toRpx(26);
padding: toRpx(6) toRpx(16);
margin-right: toRpx(12);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
} }
.input, .input,
.select { .select {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!