DESKTOP-2IO5MST\huting 1 år sedan
förälder
incheckning
a8e4b75c18

+ 21
- 3
components/form-builder/form-builder.vue Visa fil

@@ -210,7 +210,7 @@
<!-- 省市区选择 -->
<view v-if="item.type === 10" style="width: 100%" :class="item.bg ? 'bg' : 'notbg'">
<view class="as-layout-horizontal" style="align-items: center">
<pick-regions :defaultRegion="defaultRegionCode"
<!-- <pick-regions :defaultRegionCode="defaultRegionCode"
@getRegion="handleGetRegion($event, item)" style="flex: 1">
<view :class="item[item.value] ? 'text' : 'text-hint'">
{{
@@ -223,7 +223,15 @@
: "请选择" + item.title
}}
</view>
</pick-regions>
</pick-regions> -->

<picker mode="region" @change="handleGetRegion($event, item)">
<view class="uni-input">{{item.region}}</view>
</picker>

<!-- <picker @change="bindPickerChange" :value="index" :range="[]">
<view class="uni-input">index</view>
</picker> -->
<image class="arror" :src="`${$imgUrl}common/arror-right.png`" mode="aspectFill">
</image>
</view>
@@ -289,6 +297,7 @@
(e : "addressInfo", content : any) : void;
(e : "inputChange", event : any, item : TypeData) : void;
(e : "pickerCustom", item : TypeData) : void;
(e : "handleGetRegion", event : any, item : TypeData) : void;
}>();
//defineExpose 可宏来显式指定在 <script setup> 组件中要暴露出去的属性。

@@ -328,7 +337,11 @@

// 获取选择的地区
function handleGetRegion(e : any, item : TypeData) {
item[item.value] = e[0].name + "/" + e[1].name + "/" + e[2].name;
console.log("获取选择的地区", e)
// item[item.value] = e[0].name + "/" + e[1].name + "/" + e[2].name;
item[item.value] = e.detail.value[0] + e.detail.value[1] + e.detail.value[2];
emit("handleGetRegion", e, item);
console.log("获取选择的地区", item)
}

//多项选择器
@@ -686,4 +699,9 @@
text-align: center;
}
}

.uni-input {
color: #646464;
font-size: 28rpx;
}
</style>

+ 127
- 126
login/pick-regions/pick-regions.vue Visa fil

@@ -1,139 +1,140 @@
<template>
<picker mode="multiSelector"
:value="multiIndex"
:range="multiArray"
@change="handleValueChange"
@columnchange="handleColumnChange">
<slot></slot>
</picker>
<picker mode="multiSelector" :value="multiIndex" :range="multiArray" @change="handleValueChange"
@columnchange="handleColumnChange">
<slot></slot>
</picker>
</template>

<script>
import { CHINA_REGIONS } from './regions';
import {
CHINA_REGIONS
} from './regions';

export default {
props:{
defaultRegions:{
type:Array,
default(){
return []
}
},
defaultRegionCode:{
type:String,
default : '520115'
},
defaultRegion:[String,Array]
},
props: {
defaultRegions: {
type: Array,
default () {
return []
}
},
defaultRegionCode: {
type: String,
default: '520115'
},
defaultRegion: [String, Array]
},
data() {
return {
cityArr:CHINA_REGIONS[0].childs,
districtArr:CHINA_REGIONS[0].childs[0].childs,
multiIndex: [0, 0, 0],
isInitMultiArray:true,
cityArr: CHINA_REGIONS[0].childs,
districtArr: CHINA_REGIONS[0].childs[0].childs,
multiIndex: [0, 0, 0],
isInitMultiArray: true,
}
},
watch: {
defaultRegion: {
handler(region, oldRegion) {
if (Array.isArray(region)) {
// 避免传的是字面量的时候重复触发
oldRegion = oldRegion || []
if (region.join('') !== oldRegion.join('')) {
this.handleDefaultRegion(region)
}
} else if (region && region.length == 6) {
this.handleDefaultRegion(region)
} else {
console.warn('defaultRegion非有效格式')
}
},
immediate: true,
}
},
computed: {
multiArray() {
return this.pickedArr.map(arr => arr.map(item => item.name))
},
pickedArr() {
// 进行初始化
if (this.isInitMultiArray) {
return [
CHINA_REGIONS,
CHINA_REGIONS[0].childs,
CHINA_REGIONS[0].childs[0].childs
]
}
return [CHINA_REGIONS, this.cityArr, this.districtArr];
}
},
watch:{
defaultRegion:{
handler(region,oldRegion){
if(Array.isArray(region)){
// 避免传的是字面量的时候重复触发
oldRegion = oldRegion || []
if(region.join('')!==oldRegion.join('')){
this.handleDefaultRegion(region)
}
}else if(region&&region.length == 6){
this.handleDefaultRegion(region)
}else{
console.warn('defaultRegion非有效格式')
}
},
immediate:true,
}
},
computed:{
multiArray(){
return this.pickedArr.map(arr=>arr.map(item=>item.name))
},
pickedArr(){
// 进行初始化
if(this.isInitMultiArray){
return [
CHINA_REGIONS,
CHINA_REGIONS[0].childs,
CHINA_REGIONS[0].childs[0].childs
]
}
return [CHINA_REGIONS,this.cityArr,this.districtArr];
}
},
methods: {
handleColumnChange(e){
// console.log(e);
this.isInitMultiArray = false;
const that = this;
let col = e.detail.column;
let row = e.detail.value;
that.multiIndex[col] = row;
try{
switch(col){
case 0:
if(CHINA_REGIONS[that.multiIndex[0]].childs.length==0){
that.cityArr = that.districtArr = [CHINA_REGIONS[that.multiIndex[0]]]
break;
}
that.cityArr = CHINA_REGIONS[that.multiIndex[0]].childs
that.districtArr = CHINA_REGIONS[that.multiIndex[0]].childs[that.multiIndex[1]].childs
break;
case 1:
that.districtArr = CHINA_REGIONS[that.multiIndex[0]].childs[that.multiIndex[1]].childs
break;
case 2:
break;
}
}catch(e){
console.log(e);
that.districtArr = CHINA_REGIONS[that.multiIndex[0]].childs[0].childs
}
},
handleValueChange(e){
// 结构赋值
let [index0,index1,index2] = e.detail.value;
let [arr0,arr1,arr2] = this.pickedArr;
let address = [arr0[index0],arr1[index1],arr2[index2]];
// console.log(address);
this.$emit('getRegion',address)
},
handleDefaultRegion(region){
const isCode = !Array.isArray(region)
this.isInitMultiArray = false;
let children = CHINA_REGIONS
for(let i=0;i<3;i++){
for(let j=0;j<children.length;j++){
let condition = isCode?children[j].code==region.slice(0,(i+1)*2):children[j].name.includes(region[i]);
if(condition){
// 匹配成功进行赋值
// console.log(i,j,children.length-1);
children = children[j].childs;
if(i==0){
this.cityArr = children
}else if(i==1){
this.districtArr = children
}
this.$set(this.multiIndex,i,j)
// console.log(this.multiIndex);
break;
}else{
// 首次匹配失败就用默认的初始化
// console.log(i,j,children.length-1);
if(i==0 && j==(children.length-1)){
this.isInitMultiArray = true;
}
}
}
}
}
handleColumnChange(e) {
console.log(e);
this.isInitMultiArray = false;
const that = this;
let col = e.detail.column;
let row = e.detail.value;
that.multiIndex[col] = row;
try {
switch (col) {
case 0:
if (CHINA_REGIONS[that.multiIndex[0]].childs.length == 0) {
that.cityArr = that.districtArr = [CHINA_REGIONS[that.multiIndex[0]]]
break;
}
that.cityArr = CHINA_REGIONS[that.multiIndex[0]].childs
that.districtArr = CHINA_REGIONS[that.multiIndex[0]].childs[that.multiIndex[1]].childs
break;
case 1:
that.districtArr = CHINA_REGIONS[that.multiIndex[0]].childs[that.multiIndex[1]].childs
break;
case 2:
break;
}
} catch (e) {
console.log(e);
that.districtArr = CHINA_REGIONS[that.multiIndex[0]].childs[0].childs
}

},
handleValueChange(e) {
// 结构赋值
let [index0, index1, index2] = e.detail.value;
let [arr0, arr1, arr2] = this.pickedArr;
let address = [arr0[index0], arr1[index1], arr2[index2]];

console.log(address);
this.$emit('getRegion', address)
},
handleDefaultRegion(region) {
const isCode = !Array.isArray(region)
this.isInitMultiArray = false;
let children = CHINA_REGIONS
for (let i = 0; i < 3; i++) {
for (let j = 0; j < children.length; j++) {
let condition = isCode ? children[j].code == region.slice(0, (i + 1) * 2) : children[j].name
.includes(region[i]);
if (condition) {
// 匹配成功进行赋值
// console.log(i,j,children.length-1);
children = children[j].childs;
if (i == 0) {
this.cityArr = children
} else if (i == 1) {
this.districtArr = children
}
this.$set(this.multiIndex, i, j)
// console.log(this.multiIndex);
break;
} else {
// 首次匹配失败就用默认的初始化
// console.log(i,j,children.length-1);
if (i == 0 && j == (children.length - 1)) {
this.isInitMultiArray = true;
}
}
}
}
}
},
}
</script>
</script>

+ 86
- 47
subpackage/after-sale/business-processie.vue Visa fil

@@ -1,34 +1,30 @@
<template>
<view class="content">
<view class="card">
<text>请选择具体业务:</text>
<uni-data-select v-model="state.businessTypeVal" :localdata="state.businessRange" @change="changeBusiness"
:clear="false"></uni-data-select>
</view>
<view class="example-body">
<uni-datetime-picker v-model="state.range" type="daterange" />
<button size="mini" style="color: #ffffff;
backgroundColor: rgb(118, 200, 77);
borderColor: rgb(118, 200, 77);
font-size: 26rpx;
flex-shrink: 0;margin-left: 20rpx;" @click="search(1)">搜索</button>
<view class="top-content">
<view class="card">
<text>请选择具体业务:</text>
<uni-data-select v-model="state.businessTypeVal" :localdata="state.businessRange"
@change="changeBusiness" :clear="false"></uni-data-select>
</view>
<view class="example-body">
<uni-datetime-picker v-model="state.range" type="daterange" />
<button size="mini" style="color: #ffffff;
backgroundColor: rgb(118, 200, 77);
borderColor: rgb(118, 200, 77);
font-size: 26rpx;
flex-shrink: 0;margin-left: 20rpx;" @click="search(1)">搜索</button>
</view>
</view>


<view class="uni-container">
<uni-table ref="table" border stripe emptyText="暂无更多数据">
<uni-tr>
<uni-th width="140" align="center">业务类型</uni-th>
<uni-th width="150" align="center">操作时间</uni-th>
<uni-th width="170" align="center">日志记录时间</uni-th>
</uni-tr>
<uni-tr v-for="(item,index) in state.listData" :key="index">
<uni-td align="center">{{item.serviceType}}</uni-td>
<uni-td align="center">{{item.operateTime}}</uni-td>
<uni-td align="center">{{item.insertTime}}</uni-td>
</uni-tr>
</uni-table>
<view class="list-item" v-for="(item,index) in state.listData">
<view><text>业务类型:</text><text>{{item.serviceType}}</text></view>
<view><text>操作时间:</text><text>{{item.operateTime}}</text></view>
<view><text>日志记录时间:</text><text>{{item.insertTime}}</text></view>
</view>
</view>
<!-- <view class="uni-pagination-box"><uni-pagination show-icon :page-size="state.pageSize" :current="state.pageNo"
:total="state.total" @change="change" /></view> -->
<view class="bottom-line" v-if="state.flags">我是有底线的~~~</view>
</view>

</template>
@@ -38,7 +34,7 @@
import {
businessType
} from "@/datas/businessType.js"
import { onLoad } from "@dcloudio/uni-app";
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
import { businessApi } from "@/utils/network/api.js";
import { stringToJson } from "@/utils/network/encryption";
import { request } from "@/utils/network/request.js";
@@ -47,16 +43,16 @@
startTime: Date.now(), //日期
businessTypeVal: "",
businessRange: [],
listDataTitle: ["业务类型", "操作时间", "日志记录时间"],
listData: [],
range: ['', ''],
pageSize: 10, //每页数据量
pageNo: 1, // 当前页
total: 0, // 数据总量
flags: false,
})
onLoad((option) => {
state.businessRange = businessType;
search(0)
search(1)
})
const changeBusiness = (e) => {
state.businessTypeVal = e
@@ -65,20 +61,22 @@
//业务完成日志
const search = (val) => {
if (val == 1) {
var data = {
opId: getItem(StorageKeys.OpenId),
serviceType: state.businessTypeVal,
startDate: state.range[0],
endDate: state.range[1],
// pageNo: state.pageNo,
// pageSize: state.pageSize,
};
} else {
var data = {
opId: getItem(StorageKeys.OpenId),
// pageNo: state.pageNo,
// pageSize: state.pageSize,
};
state.pageNo = 1
}
if (state.pageNo == 1 && state.listData.length > 0) {
state.listData = []
}
var data = {
opId: getItem(StorageKeys.OpenId),
serviceType: state.businessTypeVal,
startDate: state.range[0],
endDate: state.range[1],
pageNo: state.pageNo,
pageSize: state.pageSize,
};

if (data.serviceType == "") {
delete data.serviceType
}
const options = {
type: 2,
@@ -89,23 +87,43 @@

request(businessApi, options).then((res) => {
const data = stringToJson(res.bizContent);
state.listData = [];
state.listData = data.data
// state.listData = [];
state.listData = [...stringToJson(res.bizContent).data, ...state.listData]
// state.listData = data.data
state.total = data.data.length
console.log("业务完成日志", data.data)
console.log("业务完成日志", state.listData, state.pageNo,)
});
}
const change = (e) => {
console.log("e", e)
state.pageNo = e.current
search(1)
search(2)
}
// 触底加载
onReachBottom(() => {
if (state.listData.length < state.pageNo * 10) return state.flags = true
console.log("触底了")
state.pageNo++
search(2)
})
</script>

<style scoped>
.top-content {
position: fixed;
left: 0;
top: 0;
background-color: white;
width: 100%;
padding: 20rpx;
box-sizing: border-box;
}

.content {
font-size: 32rpx;
padding: 20rpx 30rpx;
background-color: #EEF7F7;
min-height: 100vh;
}

.card {
@@ -120,6 +138,7 @@

.uni-container {
margin: 50rpx 0;
margin-top: 200rpx;
}

/deep/.uni-table-th,
@@ -157,4 +176,24 @@
/deep/.uni-date-x {
height: 76rpx !important;
}

.list-item {
width: 95%;
border-radius: 10rpx;
margin: 30rpx auto;
font-size: 28rpx;
border: 1rpx solid #ccc;
padding: 12rpx;
box-sizing: border-box;
background-color: white;
}

.list-item>view {
margin-bottom: 10rpx;
}

.bottom-line {
text-align: center;
margin: 30rpx 0;
}
</style>

+ 414
- 416
subpackage/orders/apply-ex-goods.vue Visa fil

@@ -1,442 +1,440 @@
<!-- 申请换货 -->
<template>
<view class="box">
<form-builder
:config="config"
:formData="state.formData"
@submit="submit"
@addressInfo="addressInfo"
@radioChange="radioChange"
/>
</view>
<view class="box">
<form-builder :config="config" :formData="state.formData" @submit="submit" @addressInfo="addressInfo"
@radioChange="radioChange" @handleGetRegion="handleGetRegion" />
</view>
</template>

<script setup lang="ts">
import { reactive } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { msg, confirm, getOrderStatusName } from "@/utils/utils";
import { request } from "@/utils/network/request";
import {
getLogistics,
orderDetail,
orderExchange,
outletList,
} from "@/utils/network/api";
import { stringToJson } from "@/utils/network/encryption";
import { getItem, StorageKeys } from "@/utils/storage";
import { reactive } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { msg, confirm, getOrderStatusName } from "@/utils/utils";
import { request } from "@/utils/network/request";
import {
getLogistics,
orderDetail,
orderExchange,
outletList,
} from "@/utils/network/api";
import { stringToJson } from "@/utils/network/encryption";
import { getItem, StorageKeys } from "@/utils/storage";

const config = {
submitName: "申请换货",
titleWidth: 160,
};
const config = {
submitName: "申请换货",
titleWidth: 160,
};

const state = reactive({
//订单信息
orderInfo: {} as any,
//网点信息
outlets: [],
//换货类型: MAIL-线上-邮寄 SELF-线上-自提 OFFLINE-线下
exchangeMode: "SELF",
formData: [
{
title: "订单编号:",
inputType: "number",
type: 2,
value: "id",
hint: "订单编号",
disabled: true,
divider: true,
},
{
title: "订单车牌号:",
type: 2,
value: "vehiclePlate",
hint: "订单车牌号",
disabled: true,
divider: true,
},
{
title: "订单状态:",
type: 2,
value: "orderStep",
hint: "订单状态",
disabled: true,
divider: true,
},
{
title: "换货方式:",
type: 7,
value: "exchangeMode",
star: true,
required: true,
divider: true,
emptyHint: "请选择退货方式",
itemData: [
{
checked: false,
value: "ON_LINE",
name: "线上",
},
{
checked: false,
value: "OFFLINE",
name: "线下",
},
],
},
const state = reactive({
//订单信息
orderInfo: {} as any,
//网点信息
outlets: [],
//换货类型: MAIL-线上-邮寄 SELF-线上-自提 OFFLINE-线下
exchangeMode: "SELF",
formData: [
{
title: "订单编号:",
inputType: "number",
type: 2,
value: "id",
hint: "订单编号",
disabled: true,
divider: true,
},
{
title: "订单车牌号:",
type: 2,
value: "vehiclePlate",
hint: "订单车牌号",
disabled: true,
divider: true,
},
{
title: "订单状态:",
type: 2,
value: "orderStep",
hint: "订单状态",
disabled: true,
divider: true,
},
{
title: "换货方式:",
type: 7,
value: "exchangeMode",
star: true,
required: true,
divider: true,
emptyHint: "请选择退货方式",
itemData: [
{
checked: false,
value: "ON_LINE",
name: "线上",
},
{
checked: false,
value: "OFFLINE",
name: "线下",
},
],
},

/* 区别-线上方式 */
{
title: "物流公司:",
type: 4,
value: "exchangeLogisticsCompany",
required: true,
star: true,
hint: "请输入",
divider: true,
itemData: [],
hide: false,
emptyHint: "请选择物流公司",
mode: "search",
searchPickerVisible: false,
},
{
title: "物流单号:",
type: 2,
value: "exchangeLogisticsNumber",
required: true,
maxlength: 20,
hint: "请输入",
emptyHint: "请输入物流单号",
star: true,
divider: true,
hide: false,
},
{
title: "收货方式:",
type: 7,
value: "exchangeRgMode",
required: true,
star: true,
divider: true,
itemData: [
{
checked: false,
value: "SELF",
name: "营业点自提",
},
{
checked: false,
value: "MAIL",
name: "邮寄",
},
],
hide: false,
emptyHint: "请选择收货方式",
},
/* 区别-线上方式 */
{
title: "物流公司:",
type: 4,
value: "exchangeLogisticsCompany",
required: true,
star: true,
hint: "请输入",
divider: true,
itemData: [],
hide: false,
emptyHint: "请选择物流公司",
mode: "search",
searchPickerVisible: false,
},
{
title: "物流单号:",
type: 2,
value: "exchangeLogisticsNumber",
required: true,
maxlength: 20,
hint: "请输入",
emptyHint: "请输入物流单号",
star: true,
divider: true,
hide: false,
},
{
title: "收货方式:",
type: 7,
value: "exchangeRgMode",
required: true,
star: true,
divider: true,
itemData: [
{
checked: false,
value: "SELF",
name: "营业点自提",
},
{
checked: false,
value: "MAIL",
name: "邮寄",
},
],
hide: false,
emptyHint: "请选择收货方式",
},

/* 线上-营业点自提 */
{
title: "自提网点:",
type: 4,
value: "exchangeRgNetworkName",
required: true,
star: true,
hint: "请输入",
divider: true,
hide: false,
itemData: [],
emptyHint: "请选择自提网点",
mode: "search",
searchPickerVisible: false,
},
/* 线上-营业点自提 */
{
title: "自提网点:",
type: 4,
value: "exchangeRgNetworkName",
required: true,
star: true,
hint: "请输入",
divider: true,
hide: false,
itemData: [],
emptyHint: "请选择自提网点",
mode: "search",
searchPickerVisible: false,
},

/* 线上-邮寄 */
{
title: "收件人地址:",
type: 2,
value: "address",
maxlength: 50,
hint: " ",
disabled: true,
divider: true,
btn: true,
btnTitle: "获取微信地址",
btnType: "address",
hide: true,
},
{
title: "姓名:",
type: 2,
value: "consignee",
maxlength: 20,
required: true,
hint: "请输入",
emptyHint: "请输入收件人姓名",
star: true,
divider: true,
hide: true,
},
{
title: "电话:",
type: 2,
value: "consigneeTel",
required: true,
inputType: "number",
maxlength: 11,
hint: "请输入",
emptyHint: "请输入收件人电话",
star: true,
divider: true,
hide: true,
},
{
title: "地区:",
type: 10,
value: "region",
required: true,
hint: "选择省/市/区",
emptyHint: "请选择收件人所在地区",
star: true,
divider: true,
hide: true,
},
{
title: "详细地址:",
type: 2,
value: "address",
maxlength: 100,
required: true,
hint: "街道门牌、楼层房间号等信息",
emptyHint: "请输入收件人详细地址",
star: true,
divider: true,
hide: true,
},
{
title: "邮政编码:",
type: 2,
value: "postalCode",
inputType: "number",
maxlength: 20,
hint: "请输入邮政编码",
emptyHint: "请输入邮政编码",
divider: true,
hide: true,
},
/* 线上-邮寄 */
{
title: "收件人地址:",
type: 2,
value: "address",
maxlength: 50,
hint: " ",
disabled: true,
divider: true,
btn: true,
btnTitle: "获取微信地址",
btnType: "address",
hide: true,
},
{
title: "姓名:",
type: 2,
value: "consignee",
maxlength: 20,
required: true,
hint: "请输入",
emptyHint: "请输入收件人姓名",
star: true,
divider: true,
hide: true,
},
{
title: "电话:",
type: 2,
value: "consigneeTel",
required: true,
inputType: "number",
maxlength: 11,
hint: "请输入",
emptyHint: "请输入收件人电话",
star: true,
divider: true,
hide: true,
},
{
title: "地区:",
type: 10,
value: "region",
required: true,
hint: "选择省/市/区",
emptyHint: "请选择收件人所在地区",
star: true,
divider: true,
hide: true,
},
{
title: "详细地址:",
type: 2,
value: "address",
maxlength: 100,
required: true,
hint: "街道门牌、楼层房间号等信息",
emptyHint: "请输入收件人详细地址",
star: true,
divider: true,
hide: true,
},
{
title: "邮政编码:",
type: 2,
value: "postalCode",
inputType: "number",
maxlength: 20,
hint: "请输入邮政编码",
emptyHint: "请输入邮政编码",
divider: true,
hide: true,
},

/* 区别-线下方式 */
{
title: "退货网点:",
type: 4,
value: "exchangeNetworkName",
required: true,
star: true,
hint: "请输入",
divider: true,
itemData: [],
hide: true,
emptyHint: "请选择退货网点",
mode: "search",
searchPickerVisible: false,
},
/* 区别-线下方式 */
{
title: "退货网点:",
type: 4,
value: "exchangeNetworkName",
required: true,
star: true,
hint: "请输入",
divider: true,
itemData: ["1"],
hide: true,
emptyHint: "请选择退货网点",
mode: "search",
searchPickerVisible: false,
},

{
title: "换货原因:",
required: true,
type: 5,
vertical: 2,
value: "exchangeReason",
maxlength: 50,
bg: true,
star: true,
hint: "请输入换货原因,限制50字以内",
emptyHint: "请输入换货原因",
},
],
});
{
title: "换货原因:",
required: true,
type: 5,
vertical: 2,
value: "exchangeReason",
maxlength: 50,
bg: true,
star: true,
hint: "请输入换货原因,限制50字以内",
emptyHint: "请输入换货原因",
},
],
});

/* 获取订单详情 */
const getOrderDetails = (id) => {
const options = {
type: 2,
data: { id: id },
method: "POST",
showLoading: true,
};
request(orderDetail, options).then((res) => {
//回显订单信息
console.log(stringToJson(res.bizContent))
state.orderInfo = stringToJson(res.bizContent);
state.formData[0].hint = state.orderInfo.orderId;
state.formData[1].hint = state.orderInfo.vehiclePlate;
state.formData[2].hint = getOrderStatusName(state.orderInfo.orderStep);
/* 获取订单详情 */
const getOrderDetails = (id) => {
const options = {
type: 2,
data: { id: id },
method: "POST",
showLoading: true,
};
request(orderDetail, options).then((res) => {
//回显订单信息
console.log(stringToJson(res.bizContent))
state.orderInfo = stringToJson(res.bizContent);
state.formData[0].hint = state.orderInfo.orderId;
state.formData[1].hint = state.orderInfo.vehiclePlate;
state.formData[2].hint = getOrderStatusName(state.orderInfo.orderStep);

//回显收件人地址
state.formData[9][state.formData[9].value] =
state.orderInfo.orderInfoExt.consignee;
state.formData[10][state.formData[10].value] =
state.orderInfo.orderInfoExt.consigneeTel;
state.formData[11][state.formData[11].value] =
state.orderInfo.orderInfoExt.region;
state.formData[12][state.formData[12].value] =
state.orderInfo.orderInfoExt.address;
state.formData[13][state.formData[13].value] =
state.orderInfo.orderInfoExt.postalCode;
});
};
//回显收件人地址
state.formData[9][state.formData[9].value] =
state.orderInfo.orderInfoExt.consignee;
state.formData[10][state.formData[10].value] =
state.orderInfo.orderInfoExt.consigneeTel;
state.formData[11][state.formData[11].value] =
state.orderInfo.orderInfoExt.region;
state.formData[12][state.formData[12].value] =
state.orderInfo.orderInfoExt.address;
state.formData[13][state.formData[13].value] =
state.orderInfo.orderInfoExt.postalCode;
});
};

/* 获取所有的快递公司 */
const getLogisticsList = () => {
const options = {
type: 2,
data: {},
method: "POST",
showLoading: true,
};
request(getLogistics, options).then((res) => {
const data = stringToJson(res.bizContent);
state.formData[4].itemData = data;
});
};
/* 获取所有的快递公司 */
const getLogisticsList = () => {
const options = {
type: 2,
data: {},
method: "POST",
showLoading: true,
};
request(getLogistics, options).then((res) => {
const data = stringToJson(res.bizContent);
state.formData[4].itemData = data;
});
};

/* 获取退货网点 */
const getOutletList = () => {
const options = {
type: 2,
data: {},
method: "POST",
showLoading: true,
};
/* 获取退货网点 */
const getOutletList = () => {
const options = {
type: 2,
data: {},
method: "POST",
showLoading: true,
};
request(outletList, options).then((res) => {
state.outlets = stringToJson(res.bizContent);
let nameList = [];
state.outlets.map((item) => {
nameList.push(item.name);
});

request(outletList, options).then((res) => {
state.outlets = stringToJson(res.bizContent);
let nameList = [];
state.outlets.map((item) => {
nameList.push(item.name);
});
state.formData[7].itemData = nameList;
state.formData[14].itemData = nameList;
});
};

state.formData[7].itemData = nameList;
state.formData[14].itemData = nameList;
});
};
//radio改变
const radioChange = (e : any, item : any) => {
if (item.value === "exchangeMode") {
//退货方式
state.exchangeMode =
item.exchangeMode === "ON_LINE"
? state.formData[6][state.formData[6].value] ? state.formData[6][state.formData[6].value] : "SELF"
: item.exchangeMode;
} else if (item.value === "exchangeRgMode") {
//收货方式
state.exchangeMode = item.exchangeRgMode;
}

//radio改变
const radioChange = (e: any, item: any) => {
if (item.value === "exchangeMode") {
//退货方式
state.exchangeMode =
item.exchangeMode === "ON_LINE"
? state.formData[6][state.formData[6].value] ?state.formData[6][state.formData[6].value]: "SELF"
: item.exchangeMode;
} else if (item.value === "exchangeRgMode") {
//收货方式
state.exchangeMode = item.exchangeRgMode;
}
state.formData[4].hide = state.exchangeMode === "OFFLINE" ? true : false;
state.formData[5].hide = state.exchangeMode === "OFFLINE" ? true : false;
state.formData[6].hide = state.exchangeMode === "OFFLINE" ? true : false;
for (let i = 7; i < 15; i++) {
state.formData[i].hide = true;
}
if (state.exchangeMode === "MAIL") {
//MAIL-线上-邮寄
for (let i = 8; i < 14; i++) {
state.formData[i].hide = false;
}
} else if (state.exchangeMode === "SELF") {
//SELF-线上-营业点自提
state.formData[7].hide = false;
} else if (state.exchangeMode === "OFFLINE") {
//OFFLINE-线下
state.formData[14].hide = false;
}
console.log("全部数据", state.formData)
};
const handleGetRegion = (e : any, item : any) => {
console.log("dizhi")
}
//地址改变
const addressInfo = (content : any) => {
state.formData[9][state.formData[9].value] = content.userName;
state.formData[10][state.formData[10].value] = content.telNumber;
state.formData[11][
state.formData[11].value
] = `${content.provinceName}/${content.cityName}/${content.countyName}`;
state.formData[12][state.formData[12].value] = content.detailInfo;
state.formData[13][state.formData[13].value] = content.postalCode;
};

state.formData[4].hide = state.exchangeMode === "OFFLINE" ? true : false;
state.formData[5].hide = state.exchangeMode === "OFFLINE" ? true : false;
state.formData[6].hide = state.exchangeMode === "OFFLINE" ? true : false;
for (let i = 7; i < 15; i++) {
state.formData[i].hide = true;
}
if (state.exchangeMode === "MAIL") {
//MAIL-线上-邮寄
for (let i = 8; i < 14; i++) {
state.formData[i].hide = false;
}
} else if (state.exchangeMode === "SELF") {
//SELF-线上-营业点自提
state.formData[7].hide = false;
} else if (state.exchangeMode === "OFFLINE") {
//OFFLINE-线下
state.formData[14].hide = false;
}
};
//提交换货申请
const submit = (e : any) => {
confirm(
"是否确认换货?",
() => {
const curOutletName =
e.exchangeMode === "ON_LINE"
? e.exchangeRgNetworkName
: e.exchangeNetworkName;
const curOutlet = state.outlets.find((out) => out.name === curOutletName);
const curRegin = e.region == null ? null : e.region.split("/");
const options = {
type: 2,
data: {
id: state.orderInfo.id,
exchangeMode: e.exchangeMode,
// exchangeNetworkId: curOutlet == null ? "" : curOutlet.servicehallId,
exchangeNetworkId: e.exchangeNetworkName,
exchangeNetworkName: e.exchangeNetworkName,
exchangeRgMode: e.exchangeRgMode,
// exchangeRgNetworkId: curOutlet == null ? "" : curOutlet.servicehallId,
exchangeRgNetworkId: e.exchangeNetworkName,
exchangeRgNetworkName: e.exchangeRgNetworkName,
exchangeLogisticsCompany: e.exchangeLogisticsCompany,
exchangeLogisticsNumber: e.exchangeLogisticsNumber,
exchangeReason: e.exchangeReason,
consignee: e.consignee,
consigneeTel: e.consigneeTel,
region: curRegin ? `${curRegin[0]}${curRegin[1]}${curRegin[2]}` : "",
address: e.address,
postalCode: e.postalCode,
opId: getItem(StorageKeys.OpenId),
},
method: "POST",
showLoading: true,
};
console.log("提交数据", options)
// return;
request(orderExchange, options).then((res) => {
confirm(
"您申办的ETC订单已申请换货",
() => {
uni.$emit("refreshOrder");
uni.navigateBack();
},
"申请成功",
false
);
});
},
"换货确认",
true
);
};

//地址改变
const addressInfo = (content: any) => {
state.formData[9][state.formData[9].value] = content.userName;
state.formData[10][state.formData[10].value] = content.telNumber;
state.formData[11][
state.formData[11].value
] = `${content.provinceName}/${content.cityName}/${content.countyName}`;
state.formData[12][state.formData[12].value] = content.detailInfo;
state.formData[13][state.formData[13].value] = content.postalCode;
};

//提交换货申请
const submit = (e: any) => {
confirm(
"是否确认换货?",
() => {
const curOutletName =
e.exchangeMode === "ON_LINE"
? e.exchangeRgNetworkName
: e.exchangeNetworkName;
const curOutlet = state.outlets.find((out) => out.name === curOutletName);
const curRegin = e.region == null ? null : e.region.split("/");
const options = {
type: 2,
data: {
id: state.orderInfo.id,
exchangeMode: e.exchangeMode,
// exchangeNetworkId: curOutlet == null ? "" : curOutlet.servicehallId,
exchangeNetworkId: e.exchangeNetworkName,
exchangeNetworkName: e.exchangeNetworkName,
exchangeRgMode: e.exchangeRgMode,
// exchangeRgNetworkId: curOutlet == null ? "" : curOutlet.servicehallId,
exchangeRgNetworkId: e.exchangeNetworkName,
exchangeRgNetworkName: e.exchangeRgNetworkName,
exchangeLogisticsCompany: e.exchangeLogisticsCompany,
exchangeLogisticsNumber: e.exchangeLogisticsNumber,
exchangeReason: e.exchangeReason,
consignee: e.consignee,
consigneeTel: e.consigneeTel,
region: curRegin ? `${curRegin[0]}${curRegin[1]}${curRegin[2]}` : "",
address: e.address,
postalCode: e.postalCode,
opId: getItem(StorageKeys.OpenId),
},
method: "POST",
showLoading: true,
};

request(orderExchange, options).then((res) => {
confirm(
"您申办的ETC订单已申请换货",
() => {
uni.$emit("refreshOrder");
uni.navigateBack();
},
"申请成功",
false
);
});
},
"换货确认",
true
);
};

onLoad((option) => {
console.log(option);//id是申请的接口获取的id
getOrderDetails(option.orderId);
getLogisticsList();
getOutletList();
});
onLoad((option) => {
console.log(option);//id是申请的接口获取的id
getOrderDetails(option.orderId);
getLogisticsList();
getOutletList();
});
</script>

<style>
page {
background-color: #f3f3f3;
padding-bottom: 30rpx;
}
page {
background-color: #f3f3f3;
padding-bottom: 30rpx;
}
</style>
<style lang="scss" scoped>
.box {
margin: 20rpx 0rpx;
background-color: white;
padding: 0 20rpx 20rpx;
}
</style>
.box {
margin: 20rpx 0rpx;
background-color: white;
padding: 0 20rpx 20rpx;
}
</style>

+ 10
- 2
subpackage/orders/order-evaluate-product.vue Visa fil

@@ -122,6 +122,10 @@
msg('请对产品进行打分!');
return;
}
if (state.interest.score === 0) {
msg('请对权益产品进行打分!');
return;
}
//若不填评价内容,根据打分规则自动填充评价内容
//差评展示:默认差评 2.5分及以下
//中评展示:默认中评 2.5以上4.0以下
@@ -219,8 +223,12 @@
showLoading: true,
}
request(judageQuanProduct, options).then((res) => {
console.log("获取是否有业务员", stringToJson(res.bizContent))
state.haveInterestsProduct = stringToJson(res.bizContent);
if (res.bizContent == "") {
state.haveInterestsProduct = false;
} else {
state.haveInterestsProduct = true;
}
console.log("获取是否有业务员", res.bizContent)
})
}
/* 获取订单详情 */

+ 3
- 2
subpackage/personal-center/search/select-card.vue Visa fil

@@ -73,9 +73,10 @@
showLoading: true,
};
request(cardList, options).then((res) => {
console.log("152", stringToJson(res.bizContent))
let result = stringToJson(res.bizContent);
state.cards = result.cards ?result.cards: null;
console.log(result.cards);
state.cards = result.data ? result.data : null;
console.log(result.data);
})
}
</script>

+ 1
- 1
utils/network/request.js Visa fil

@@ -176,7 +176,7 @@ export function request(code, options = {}, start = false) {
// let content = res
// console.log(content);
// content.data.bizContent = JSON.stringify(content.data.bizContent)
console.log('请求成功返回参数:', content)
console.log('请求成功返回参数:', code, content)
resolve(content.data)
}
}

+ 4
- 3
utils/util/sm4.js Visa fil

@@ -49,7 +49,7 @@ function SM4() {
0x89, 0x69, 0x97, 0x4a, 0x0c, 0x96, 0x77, 0x7e, 0x65, 0xb9, 0xf1, 0x09, 0xc5, 0x6e, 0xc6, 0x84,
0x18, 0xf0, 0x7d, 0xec, 0x3a, 0xdc, 0x4d, 0x20, 0x79, 0xee, 0x5f, 0x3e, 0xd7, 0xcb, 0x39, 0x48
]
const FK = [0xa3b1bac6, 0x56aa3350, 0x677d9197, 0xb27022dc]

const CK = [0x00070e15, 0x1c232a31, 0x383f464d, 0x545b6269,
@@ -393,12 +393,14 @@ function SM4Util() {
let keyBytes = this.stringToByte(secretKey.substring(0, 16))
let ivBytes = this.stringToByte(this.iv)
sm4.sm4_setkey_dec(ctx, keyBytes)

if (cipherText.data.errorMsg == "成功" && !cipherText.data.bizContent) {
cipherText.data.bizContent = 1 //884换货/换卡签取消查询接口
} else {
let decrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, base64js.toByteArray(cipherText.data.bizContent))
let bizContent = utf8ByteToUnicodeStr(decrypted)
if (bizContent.indexOf('{') == "-1" || bizContent.indexOf('{') == -1) {
// console.log("没处理之前的数据", bizContent)
if (bizContent.substr(0, 1) == '[') {
// 返回数据是数组情况
cipherText.data.bizContent = bizContent;
} else {
@@ -408,7 +410,6 @@ function SM4Util() {
cipherText.data.bizContent = bizContent.substring(begin, end + 1)
}
}
// console.log("没处理之前的数据", cipherText.data.bizContent, cipherText.data.errorMsg)
// cipherText.data.bizContent = bizContent;
return cipherText
} catch (e) {

Laddar…
Avbryt
Spara