Commit 7fdc17fc707859ffbdf1fbe761fd69d8e605f3e2

Authored by 陈威
1 parent 0f86ae0e
Exists in dev

微信支付以及订单修改,统一订单状态

frontend/app-user/api/member.js
@@ -75,7 +75,7 @@ export function getwDdDetail(params) { @@ -75,7 +75,7 @@ export function getwDdDetail(params) {
75 //创建订单 75 //创建订单
76 export function savewDd(data) { 76 export function savewDd(data) {
77 return request({ 77 return request({
78 - url: '/user/order/payment/add', 78 + url: '/user/order/add',
79 method: 'post', 79 method: 'post',
80 data: data 80 data: data
81 }) 81 })
frontend/app-user/common/config.js
1 module.exports = { 1 module.exports = {
2 // baseUrl: 'http://192.168.0.48:60011/api', //lst本地 2 // baseUrl: 'http://192.168.0.48:60011/api', //lst本地
3 - // baseUrl: 'http://123.60.140.65:60011/api',// 会员端ip  
4 - baseUrl: 'https://lpg.ip-server.cn/api', //会员端线上 3 + baseUrl: 'http://m8wgk2.natappfree.cc/api', // 会员端ip
  4 + // baseUrl: 'https://lpg.ip-server.cn/api', //会员端线上
5 gaodeMapKey: "ec36eed040d5dad959e19711b83905d6", //高德逆地址解析key 5 gaodeMapKey: "ec36eed040d5dad959e19711b83905d6", //高德逆地址解析key
6 // 超时 6 // 超时
7 timeout: 30000, 7 timeout: 30000,
8 // 禁用 Cookie 等信息 8 // 禁用 Cookie 等信息
9 withCredentials: false, 9 withCredentials: false,
10 isOpenTokenExpiration: false, //token过期弹窗 10 isOpenTokenExpiration: false, //token过期弹窗
11 - appid:'wxb619394476ca1888', 11 + appid: 'wxb619394476ca1888',
12 header: { 12 header: {
13 //租户ID 13 //租户ID
14 'tenant-id': 1 14 'tenant-id': 1
15 - }  
16 -}  
17 \ No newline at end of file 15 \ No newline at end of file
  16 + },
  17 +
  18 +}
frontend/app-user/pages/home/placeOrder.vue
@@ -106,13 +106,10 @@ @@ -106,13 +106,10 @@
106 </template> 106 </template>
107 107
108 <script> 108 <script>
109 -import {  
110 - mergeRecursive  
111 -} from "@/utils/ruoyi"; 109 +import {mergeRecursive} from "@/utils/ruoyi";
112 import storage from '@/utils/storage' 110 import storage from '@/utils/storage'
113 -import {  
114 - mapGetters  
115 -} from 'vuex' 111 +import {mapGetters} from 'vuex'
  112 +import {dd_zflx, dd_fkfs, dd_psfs, dd_zffs, dd_ddly, sys_sf} from "@/utils/enums";
116 113
117 export default { 114 export default {
118 components: {}, 115 components: {},
@@ -125,13 +122,13 @@ export default { @@ -125,13 +122,13 @@ export default {
125 // fPsdz: "", 122 // fPsdz: "",
126 // fQyid: "", 123 // fQyid: "",
127 // fCzid: "", 124 // fCzid: "",
128 - ddly: "线上下单", 125 + ddly: dd_ddly.XSXD.code,
129 zffs: "", 126 zffs: "",
130 - psfs: "配送", 127 + psfs: dd_psfs.PS.code,
131 mjly: "", 128 mjly: "",
132 hydzId: "", 129 hydzId: "",
133 - ddlx: "配送",  
134 - sfhy: "是", 130 + ddlx: null,
  131 + sfhy: sys_sf.Y.code,
135 xqList: [], 132 xqList: [],
136 zflx: "", 133 zflx: "",
137 openId: null 134 openId: null
@@ -253,28 +250,25 @@ export default { @@ -253,28 +250,25 @@ export default {
253 return false 250 return false
254 } 251 }
255 this.$modal.confirm('确认提交订单?', '提示').then(async () => { 252 this.$modal.confirm('确认提交订单?', '提示').then(async () => {
256 - // console.log("提交数据", this.orderBody);  
257 - // uni.navigateTo({  
258 - // url:"/pages/home/orderSuccessful"  
259 - // })  
260 console.log('支付---------》') 253 console.log('支付---------》')
261 let rData = {}; 254 let rData = {};
262 // 判断环境 255 // 判断环境
263 - // #ifdef H5  
264 - this.orderBody.zffs = '微信';  
265 - this.orderBody.zflx = 'JSAPI';  
266 - this.orderBody.openId = uni.getStorageSync('openId'); 256 + //#ifdef H5
  257 + this.orderBody.zffs = dd_zffs.WX_PAY.code;
  258 + this.orderBody.zflx = dd_zflx.JSAPI.code;
  259 + // this.orderBody.openId = uni.getStorageSync('openId');
  260 + this.orderBody.openId = "oH7LG54_Y49mVunw2FLXzUCxHWlM";
267 console.log('H5环境---------》') 261 console.log('H5环境---------》')
268 console.log('H5环境rData---------》', this.orderBody) 262 console.log('H5环境rData---------》', this.orderBody)
269 - // #endif 263 + //#endif
270 264
271 - // #ifdef APP-PLUS  
272 - this.orderBody.zffs = '微信';  
273 - this.orderBody.zflx = 'APP'; 265 + //#ifdef APP-PLUS
  266 + this.orderBody.zffs = dd_zffs.WX_PAY.code;
  267 + this.orderBody.zflx = dd_zflx.APP.code;
274 console.log('app环境rData---------》', this.orderBody) 268 console.log('app环境rData---------》', this.orderBody)
275 uni.$u.toast('APP暂不支持在线下单,请前往微信公众号进行在线下单。'); 269 uni.$u.toast('APP暂不支持在线下单,请前往微信公众号进行在线下单。');
276 return false 270 return false
277 - // #endif 271 + //#endif
278 console.log('orderBody---------》', this.orderBody) 272 console.log('orderBody---------》', this.orderBody)
279 const result = await this.$api.memberApi.savewDd(this.orderBody); 273 const result = await this.$api.memberApi.savewDd(this.orderBody);
280 let { 274 let {
frontend/app-user/pages/order/order.vue
1 <template> 1 <template>
2 - <view class="container">  
3 - <Navbar title="订单" />  
4 - <u-sticky bgColor="#fff">  
5 - <u-tabs :current="current" :list="statusList" :is-scroll="false" lineColor="#EA5707"  
6 - :activeStyle="activeStyle" :itemStyle="itemStyle" @change="tabChange"></u-tabs>  
7 - </u-sticky>  
8 - <view v-for="(item,index) in orderCardList" :key="item.id">  
9 - <view class="orderCard" @click="goOrderDetaPage(item)">  
10 - <view class="flex justify-between align-center">  
11 - <view class="flex align-center w80" @click.stop="goStorePage(item)">  
12 - <!-- <u-icon name="/static/images/home/shopTitle.png" size="20"></u-icon>-->  
13 - <view  
14 - :style="{ backgroundImage: 'url(/static/images/home/shopTitle.png)', backgroundSize:'100% 100%',width:'20px',height:'20px', backgroundRepeat: 'no-repeat'}">  
15 - </view>  
16 - <view class="margin-left-xs overflow-one-lines">  
17 - {{item.fCzmc}}  
18 - </view>  
19 - </view>  
20 - <view class="themeColor">  
21 - {{item.fDdzt}}  
22 - </view>  
23 - </view>  
24 - <u-divider></u-divider>  
25 - <!-- ${$assignKeys(index)}-->  
26 - <view v-for="(ddxpItem,index) of item.ddxqList" :key="`${$assignKeys(ddxpItem.id)}`"  
27 - class="flex justify-between margin-top">  
28 - <view class="" style="min-width: 80px;min-height: 80px">  
29 - <u-image width="80px" height="80px"  
30 - :src="ddxpItem.fTp?ddxpItem.fTp:'/static/images/gas-icon/gasicon.png'"></u-image>  
31 - </view>  
32 - <view class="w60 flex flex-direction justify-between margin-left-sm">  
33 - <view class="overflow-one-lines">  
34 - {{ddxpItem.fSpmc}}  
35 - </view>  
36 - <view class="text-sm text-gray overflow-one-lines">  
37 - 规格8:{{ddxpItem.fMs}}  
38 - </view>  
39 - <view class="text-lg text-bold overflow-one-lines">  
40 - ¥{{ddxpItem.fDj}}  
41 - </view>  
42 - </view>  
43 - <view class="flex flex-wrap justify-end">  
44 - <view v-if="item.fPsfs" :class="[item.fPsfs=='自提'?'ztSty':'psSty','psfsSty']">  
45 - {{item.fPsfs}}  
46 - </view>  
47 - <view class="flex align-end">X{{ddxpItem.fSl}}</view>  
48 - </view>  
49 - </view>  
50 - <u-divider></u-divider>  
51 - <view class="flex margin-top-lg">  
52 - <view class="text-gray overflow-one-lines">  
53 - 订单编号:{{item.fDddh}}  
54 - </view>  
55 - </view>  
56 - <view class="flex margin-top-sm">  
57 - <view class="text-gray">  
58 - 备注信息:{{item.fMjly}}  
59 - </view>  
60 - </view>  
61 - <view class="flex margin-top-lg margin-bottom-lg justify-end ">  
62 - <view class="text-gray">  
63 - <!-- 共{{pageForm.ddxqList.length}}件商品 -->  
64 - 合计:  
65 - </view>  
66 - <view class="themeColor overflow-one-lines">  
67 - ¥{{item.fDdje}}  
68 - </view>  
69 - </view>  
70 - <view class="flex justify-end">  
71 - <view class="margin-left-sm" v-if="item.fDdzt =='待配送' " @click.stop="goGasCancel(item)">  
72 - <u-button shape="circle" color="">取消订单</u-button>  
73 - </view>  
74 - </view>  
75 - </view>  
76 - <!-- <orderCard :orderitem="item" @orderCancel="cancelOrderLoad"></orderCard>-->  
77 - </view>  
78 - <u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png"  
79 - v-if="!orderCardList.length &&!loading "></u-empty>  
80 - <u-loadmore :status="status" marginTop="20" height="10" marginBottom="10"  
81 - v-if="orderCardList.length>0 && !loading" />  
82 - <u-loading-icon text="加载中" style="display: flex;align-items: center; margin-top: 100px;"  
83 - :show="loading"></u-loading-icon> 2 + <view class="container">
  3 + <Navbar title="订单"/>
  4 + <u-sticky bgColor="#fff">
  5 + <u-tabs :current="current" :list="statusList" :is-scroll="false" lineColor="#EA5707"
  6 + :activeStyle="activeStyle" :itemStyle="itemStyle" @change="tabChange"></u-tabs>
  7 + </u-sticky>
  8 + <view v-for="(item,index) in orderCardList" :key="item.id">
  9 + <view class="orderCard" @click="goOrderDetaPage(item)">
  10 + <view class="flex justify-between align-center">
  11 + <view class="flex align-center w80" @click.stop="goStorePage(item)">
  12 + <!-- <u-icon name="/static/images/home/shopTitle.png" size="20"></u-icon>-->
  13 + <view
  14 + :style="{ backgroundImage: 'url(/static/images/home/shopTitle.png)', backgroundSize:'100% 100%',width:'20px',height:'20px', backgroundRepeat: 'no-repeat'}">
  15 + </view>
  16 + <view class="margin-left-xs overflow-one-lines">
  17 + {{ item.fCzmc }}
  18 + </view>
  19 + </view>
  20 + <view class="themeColor">
  21 + {{ ddDdzt.get(item.fDdzt) }}
  22 + </view>
  23 + </view>
  24 + <u-divider></u-divider>
  25 + <!-- ${$assignKeys(index)}-->
  26 + <view v-for="(ddxpItem,index) of item.ddxqList" :key="`${$assignKeys(ddxpItem.id)}`"
  27 + class="flex justify-between margin-top">
  28 + <view class="" style="min-width: 80px;min-height: 80px">
  29 + <u-image width="80px" height="80px"
  30 + :src="ddxpItem.fTp?ddxpItem.fTp:'/static/images/gas-icon/gasicon.png'"></u-image>
  31 + </view>
  32 + <view class="w60 flex flex-direction justify-between margin-left-sm">
  33 + <view class="overflow-one-lines">
  34 + {{ ddxpItem.fSpmc }}
  35 + </view>
  36 + <view class="text-sm text-gray overflow-one-lines">
  37 + 规格8:{{ ddxpItem.fMs }}
  38 + </view>
  39 + <view class="text-lg text-bold overflow-one-lines">
  40 + ¥{{ ddxpItem.fDj }}
  41 + </view>
  42 + </view>
  43 + <view class="flex flex-wrap justify-end">
  44 + <view v-if="item.fPsfs" :class="[item.fPsfs=='1'?'ztSty':'psSty','psfsSty']">
  45 + {{ ddPsfs.get(item.fPsfs) }}
  46 + </view>
  47 + <view class="flex align-end">X{{ ddxpItem.fSl }}</view>
  48 + </view>
  49 + </view>
  50 + <u-divider></u-divider>
  51 + <view class="flex margin-top-lg">
  52 + <view class="text-gray overflow-one-lines">
  53 + 订单编号:{{ item.fDddh }}
  54 + </view>
  55 + </view>
  56 + <view class="flex margin-top-sm">
  57 + <view class="text-gray">
  58 + 备注信息:{{ item.fMjly }}
  59 + </view>
  60 + </view>
  61 + <view class="flex margin-top-lg margin-bottom-lg justify-end ">
  62 + <view class="text-gray">
  63 + <!-- 共{{pageForm.ddxqList.length}}件商品 -->
  64 + 合计:
  65 + </view>
  66 + <view class="themeColor overflow-one-lines">
  67 + ¥{{ item.fDdje }}
  68 + </view>
  69 + </view>
  70 + <view class="flex justify-end">
  71 + <view class="margin-left-sm" v-if="item.fDdzt =='201' || item.fDdzt =='202' || item.fDdzt =='203' "
  72 + @click.stop="goGasCancel(item)">
  73 + <u-button shape="circle" color="">取消订单</u-button>
  74 + </view>
  75 + </view>
  76 + </view>
  77 + <!-- <orderCard :orderitem="item" @orderCancel="cancelOrderLoad"></orderCard>-->
  78 + </view>
  79 + <u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png"
  80 + v-if="!orderCardList.length &&!loading "></u-empty>
  81 + <u-loadmore :status="status" marginTop="20" height="10" marginBottom="10"
  82 + v-if="orderCardList.length>0 && !loading"/>
  83 + <u-loading-icon text="加载中" style="display: flex;align-items: center; margin-top: 100px;"
  84 + :show="loading"></u-loading-icon>
84 85
85 - <!-- app不支持$route -->  
86 - <!-- <TabBar :currentPagePath="this.$route.meta.pagePath"></TabBar> -->  
87 - <TabBar :currentPagePath="'pages/order/order'"></TabBar>  
88 - </view> 86 + <!-- app不支持$route -->
  87 + <!-- <TabBar :currentPagePath="this.$route.meta.pagePath"></TabBar> -->
  88 + <TabBar :currentPagePath="'pages/order/order'"></TabBar>
  89 + </view>
89 </template> 90 </template>
90 91
91 <script> 92 <script>
92 - import login from '../../api/login';  
93 - import orderCard from './components/orderCard.vue'  
94 - export default {  
95 - components: {  
96 - orderCard  
97 - },  
98 - props: { 93 +import login from '../../api/login';
  94 +import orderCard from './components/orderCard.vue'
  95 +import {dd_zflx, dd_fkfs, dd_psfs, dd_zffs, dd_ddly, sys_sf, dd_ddzt} from "@/utils/enums";
99 96
100 - },  
101 - data() {  
102 - return {  
103 - loading: false,  
104 - activeStyle: {  
105 - 'color': '#EA5707',  
106 - 'fontSize': '16px',  
107 - 'fontWeight': 'bold'  
108 - },  
109 - itemStyle: {  
110 - 'width': '75px',  
111 - 'height': '60px',  
112 - },  
113 - orderCardList: [],  
114 - pageParams: {  
115 - currentPage: 1,  
116 - size: 10,  
117 - currentZt: ''  
118 - },  
119 - status: "loadmore",  
120 - current: 0,  
121 - // current:'全部',  
122 - statusList: [{  
123 - name: '全部',  
124 - id: '全部'  
125 - }, {  
126 - name: '待付款',  
127 - id: 1  
128 - }, {  
129 - name: '待配送',  
130 - id: 2  
131 - }, {  
132 - name: '配送中',  
133 - id: 3  
134 - }, {  
135 - name: '已完成',  
136 - id: 4  
137 - }, ],  
138 - total: null,  
139 - }  
140 - },  
141 - computed: { 97 +export default {
  98 + components: {
  99 + orderCard
  100 + },
  101 + props: {},
  102 + data() {
  103 + return {
  104 + ddDdzt: new Map(Object.values(dd_ddzt).map(item => [item.code, item.info])),
  105 + ddPsfs: new Map(Object.values(dd_psfs).map(item => [item.code, item.info])),
  106 + loading: false,
  107 + activeStyle: {
  108 + 'color': '#EA5707',
  109 + 'fontSize': '16px',
  110 + 'fontWeight': 'bold'
  111 + },
  112 + itemStyle: {
  113 + 'width': '75px',
  114 + 'height': '60px',
  115 + },
  116 + orderCardList: [],
  117 + pageParams: {
  118 + currentPage: 1,
  119 + size: 10,
  120 + currentZt: ''
  121 + },
  122 + status: "loadmore",
  123 + current: 0,
  124 + // current:'全部',
  125 + statusList: [{
  126 + name: '全部',
  127 + id: '全部'
  128 + }, {
  129 + name: '待付款',
  130 + id: 1
  131 + }, {
  132 + name: '待配送',
  133 + id: 2
  134 + }, {
  135 + name: '配送中',
  136 + id: 3
  137 + }, {
  138 + name: '已完成',
  139 + id: 4
  140 + },],
  141 + total: null,
  142 + }
  143 + },
  144 + computed: {},
  145 + onPullDownRefresh() {
  146 + this.orderCardList = [];
  147 + this.pageParams.currentPage = 1;
  148 + //调用获取数据方法
  149 + this.getOrderList()
  150 + setTimeout(() => {
  151 + //结束下拉刷新
  152 + uni.stopPullDownRefresh();
  153 + }, 500);
  154 + },
  155 + onReachBottom() {
  156 + let allTotal = this.pageParams.currentPage * this.pageParams.size
  157 + if (allTotal < this.total) {
  158 + //当前条数小于总条数 则增加请求页数
  159 + this.pageParams.currentPage++;
  160 + this.status = 'loading';
  161 + setTimeout(() => {
  162 + this.getOrderList()
  163 + }, 500)
  164 + } else {
  165 + this.status = 'nomore'
  166 + // console.log('已加载全部数据')
  167 + }
  168 + },
  169 + mounted() {
  170 + this.getDictOrder();
  171 + // this.getOrderList();
  172 + },
  173 + async onLoad(options) {
  174 + console.log('options=====', options)
  175 + await this.getOrderList();
142 176
143 - },  
144 - onPullDownRefresh() {  
145 - this.orderCardList = [];  
146 - this.pageParams.currentPage = 1;  
147 - //调用获取数据方法  
148 - this.getOrderList()  
149 - setTimeout(() => {  
150 - //结束下拉刷新  
151 - uni.stopPullDownRefresh();  
152 - }, 500);  
153 - },  
154 - onReachBottom() {  
155 - let allTotal = this.pageParams.currentPage * this.pageParams.size  
156 - if (allTotal < this.total) {  
157 - //当前条数小于总条数 则增加请求页数  
158 - this.pageParams.currentPage++;  
159 - this.status = 'loading';  
160 - setTimeout(() => {  
161 - this.getOrderList()  
162 - }, 500)  
163 - } else {  
164 - this.status = 'nomore'  
165 - // console.log('已加载全部数据')  
166 - }  
167 - },  
168 - mounted() {  
169 - this.getDictOrder();  
170 - // this.getOrderList();  
171 - },  
172 - async onLoad(options) {  
173 - console.log('options=====', options)  
174 - await this.getOrderList(); 177 + uni.$on('onload', status => {
  178 + console.log("onload刷新", status);
  179 + if (status) {
  180 + this.getOrderList()
  181 + }
  182 + });
175 183
176 - uni.$on('onload', status => {  
177 - console.log("onload刷新", status);  
178 - if (status) {  
179 - this.getOrderList()  
180 - }  
181 - }); 184 + },
  185 + async onShow() {
  186 + const orderCardType = uni.getStorageSync('orderCardType');
  187 + console.log("当前", this.pageParams.currentZt);
  188 + let isChange = this.pageParams.currentZt === orderCardType; //记录状态是否发生改变
  189 + if (orderCardType) {
  190 + // this.pageParams.currentZt = orderCardType;
  191 + switch (orderCardType) {
  192 + case '全部':
  193 + this.current = 0;
  194 + this.pageParams.currentZt=null;
  195 + break;
  196 + case '待配送':
  197 + this.current = 1;
  198 + this.pageParams.currentZt='202';
  199 + break;
  200 + case '配送中':
  201 + this.current = 2;
  202 + this.pageParams.currentZt='203';
  203 + break;
  204 + case '已完成':
  205 + this.pageParams.currentZt='204';
  206 + break;
  207 + case '已取消':
  208 + this.pageParams.currentZt='207';
  209 + break;
  210 + }
  211 + console.log('打印orderCardType', orderCardType);
  212 + } else {
  213 + this.current = 0;
  214 + this.pageParams.currentZt = '';
  215 + }
  216 + this.pageParams.currentPage = 1;
  217 + if (!isChange) { //如果状态发生改变后刷新
  218 + await this.getOrderList();
  219 + }
  220 + },
  221 + methods: {
  222 + //用户取消订单
  223 + async goGasCancel(val) {
  224 + let paramsData = {
  225 + ddid: val.id
  226 + };
  227 + this.$modal.confirm('确认取消订单?', '提示').then(async () => {
  228 + let cancelOrderResult = await this.$api.orderApi.cancelOrder(paramsData);
  229 + if (cancelOrderResult.code == 200) {
  230 + this.$modal.msgSuccess('订单取消成功!');
  231 + this.getOrderList();
  232 + } else {
  233 + this.$modal.msgError('会员信息修改失败!');
  234 + }
  235 + }).catch(() => {
  236 + console.log("取消");
  237 + });
182 238
183 - },  
184 - async onShow() {  
185 - const orderCardType = uni.getStorageSync('orderCardType');  
186 - console.log("当前", this.pageParams.currentZt);  
187 - let isChange = this.pageParams.currentZt === orderCardType; //记录状态是否发生改变  
188 - if (orderCardType) {  
189 - this.pageParams.currentZt = orderCardType;  
190 - switch (orderCardType) {  
191 - case '全部':  
192 - this.current = 0;  
193 - break;  
194 - case '待配送':  
195 - this.current = 1;  
196 - break;  
197 - case '配送中':  
198 - this.current = 2;  
199 - break;  
200 - }  
201 - console.log('打印orderCardType', orderCardType);  
202 - } else {  
203 - this.current = 0;  
204 - this.pageParams.currentZt = '';  
205 - }  
206 - this.pageParams.currentPage = 1;  
207 - if (!isChange) { //如果状态发生改变后刷新  
208 - await this.getOrderList();  
209 - }  
210 - },  
211 - methods: {  
212 - //用户取消订单  
213 - async goGasCancel(val) {  
214 - let paramsData = {  
215 - ddid: val.id  
216 - };  
217 - this.$modal.confirm('确认取消订单?', '提示').then(async () => {  
218 - let cancelOrderResult = await this.$api.orderApi.cancelOrder(paramsData);  
219 - if (cancelOrderResult.code == 200) {  
220 - this.$modal.msgSuccess('订单取消成功!');  
221 - this.getOrderList();  
222 - } else {  
223 - this.$modal.msgError('会员信息修改失败!');  
224 - }  
225 - }).catch(() => {  
226 - console.log("取消");  
227 - }); 239 + },
  240 + goStorePage(val) {
  241 + let czid = val.fCzid;
  242 + console.log('打印czid', czid)
  243 + uni.navigateTo({
  244 + url: "/pages/home/storeDetails?czid=" + czid
  245 + })
  246 + },
  247 + goGasDetailPage() {
  248 + uni.navigateTo({
  249 + url: "/pages/home/gasDetail"
  250 + })
  251 + },
  252 + goOrderDetaPage(val) {
  253 + // console.log('打印this.pageForm.id', this.pageForm);
  254 + uni.navigateTo({
  255 + url: `/pages/order/orderDetail?id=${val.id}`
  256 + })
  257 + },
  258 + cancelOrderLoad() {
  259 + this.getOrderList();
  260 + },
  261 + async getDictOrder() {
  262 + let query = [{
  263 + key: 'NAME_',
  264 + value: '订单状态'
  265 + }]
  266 + console.log(query);
  267 + let queryJson = JSON.stringify(query);
  268 + console.log(queryJson);
  269 + const result = await this.$api.dictApi.getDict(queryJson, 'ztyd');
  270 + let {
  271 + rows
  272 + } = result;
  273 + let statusArray = [];
  274 + statusArray = rows.length > 0 ? rows.map((item) => {
  275 + return {
  276 + name: item.NAME_,
  277 + id: item.NAME_
  278 + }
  279 + }) : [];
  280 + statusArray.unshift({
  281 + name: '全部',
  282 + id: '全部'
  283 + });
  284 + this.statusList = statusArray;
  285 + console.log('大于this.statusList', this.statusList);
228 286
229 - },  
230 - goStorePage(val) {  
231 - let czid = val.fCzid;  
232 - console.log('打印czid', czid)  
233 - uni.navigateTo({  
234 - url: "/pages/home/storeDetails?czid=" + czid  
235 - })  
236 - },  
237 - goGasDetailPage() {  
238 - uni.navigateTo({  
239 - url: "/pages/home/gasDetail"  
240 - })  
241 - },  
242 - goOrderDetaPage(val) {  
243 - // console.log('打印this.pageForm.id', this.pageForm);  
244 - uni.navigateTo({  
245 - url: `/pages/order/orderDetail?id=${val.id}`  
246 - })  
247 - },  
248 - cancelOrderLoad() {  
249 - this.getOrderList();  
250 - },  
251 - async getDictOrder() {  
252 - let query = [{  
253 - key: 'NAME_',  
254 - value: '订单状态'  
255 - }]  
256 - console.log(query);  
257 - let queryJson = JSON.stringify(query);  
258 - console.log(queryJson);  
259 - const result = await this.$api.dictApi.getDict(queryJson, 'ztyd');  
260 - let {  
261 - rows  
262 - } = result;  
263 - let statusArray = [];  
264 - statusArray = rows.length > 0 ? rows.map((item) => {  
265 - return {  
266 - name: item.NAME_,  
267 - id: item.NAME_  
268 - }  
269 - }) : [];  
270 - statusArray.unshift({  
271 - name: '全部',  
272 - id: '全部'  
273 - });  
274 - this.statusList = statusArray;  
275 - console.log('大于this.statusList', this.statusList); 287 + },
  288 + async getOrderList() {
  289 + this.loading = true;
  290 + let params = {
  291 + current: this.pageParams.currentPage,
  292 + size: 10,
  293 + }
276 294
277 - },  
278 - async getOrderList() {  
279 - this.loading = true;  
280 - let params = {  
281 - current: this.pageParams.currentPage,  
282 - size: 10,  
283 - }  
284 - if (this.pageParams.currentZt) {  
285 - if (this.pageParams.currentZt == '全部') {  
286 - params.zt = '';  
287 - } else {  
288 - params.zt = this.pageParams.currentZt;  
289 - }  
290 - }  
291 - // setTimeout(async()=>{  
292 - let result = await this.$api.orderApi.getOrderList(params);  
293 - let {  
294 - code,  
295 - value  
296 - } = result;  
297 - // let { current, records,size,total} = value;  
298 - // this.orderCardList = records;  
299 - if (code == 200) {  
300 - let {  
301 - current,  
302 - records,  
303 - size,  
304 - total  
305 - } = value;  
306 - let allTotal = this.pageParams.currentPage * this.pageParams.size  
307 - this.total = total;  
308 - const newlist = records;  
309 - if (this.pageParams.currentPage === 1) {  
310 - this.orderCardList = newlist;  
311 - } else {  
312 - this.orderCardList.push(...newlist)  
313 - }  
314 - if (this.orderCardList.length < allTotal) {  
315 - this.status = 'nomore'  
316 - }  
317 - this.orderCardList.map(async (item) => {  
318 - item.ddxqList.map(async (vitem) => {  
319 - let JsonParse = JSON.parse(vitem.fTp);  
320 - let images = await this.$getPhotoUrl(JsonParse[0].response.fileId);  
321 - vitem.fTp = images;  
322 - this.$forceUpdate();  
323 - });  
324 - this.$forceUpdate();  
325 - });  
326 - this.loading = false;  
327 - // this.orderCardList =JSON.parse(JSON.stringify(this.orderCardList));  
328 - console.log('打印this.orderCardList', this.orderCardList)  
329 - }  
330 295
331 - // },2000)  
332 - // let queryJson = JSON.stringify(params); 296 + switch (this.pageParams.currentZt) {
  297 + case '全部':
  298 + params.zt=null;
  299 + break;
  300 + case '待配送':
  301 + params.zt='202';
  302 + break;
  303 + case '配送中':
  304 + params.zt='203';
  305 + break;
  306 + case '已完成':
  307 + params.zt='204';
  308 + break;
  309 + case '已取消':
  310 + params.zt='207';
  311 + break;
  312 + }
  313 + // setTimeout(async()=>{
  314 + let result = await this.$api.orderApi.getOrderList(params);
  315 + let {
  316 + code,
  317 + value
  318 + } = result;
  319 + // let { current, records,size,total} = value;
  320 + // this.orderCardList = records;
  321 + if (code == 200) {
  322 + let {
  323 + current,
  324 + records,
  325 + size,
  326 + total
  327 + } = value;
  328 + let allTotal = this.pageParams.currentPage * this.pageParams.size
  329 + this.total = total;
  330 + const newlist = records;
  331 + if (this.pageParams.currentPage === 1) {
  332 + this.orderCardList = newlist;
  333 + } else {
  334 + this.orderCardList.push(...newlist)
  335 + }
  336 + if (this.orderCardList.length < allTotal) {
  337 + this.status = 'nomore'
  338 + }
  339 + this.orderCardList.map(async (item) => {
  340 + item.ddxqList.map(async (vitem) => {
  341 + let JsonParse = JSON.parse(vitem.fTp);
  342 + let images = await this.$getPhotoUrl(JsonParse[0].response.fileId);
  343 + vitem.fTp = images;
  344 + this.$forceUpdate();
  345 + });
  346 + this.$forceUpdate();
  347 + });
  348 + this.loading = false;
  349 + // this.orderCardList =JSON.parse(JSON.stringify(this.orderCardList));
  350 + console.log('打印this.orderCardList', this.orderCardList)
  351 + }
333 352
334 - },  
335 - tabChange(e) {  
336 - this.current = e.index;  
337 - this.pageParams.currentZt = e.name;  
338 - this.pageParams.currentPage = 1;  
339 - this.orderCardList = [];  
340 - this.getOrderList();  
341 - },  
342 - openScan() {  
343 - this.$refs.scanCode.open();  
344 - },  
345 - close() {  
346 - this.$refs.scanCode.close();  
347 - }  
348 - }  
349 - } 353 + // },2000)
  354 + // let queryJson = JSON.stringify(params);
  355 +
  356 + },
  357 + tabChange(e) {
  358 + this.current = e.index;
  359 + this.pageParams.currentZt = e.name;
  360 + this.pageParams.currentPage = 1;
  361 + this.orderCardList = [];
  362 + this.getOrderList();
  363 + },
  364 + openScan() {
  365 + this.$refs.scanCode.open();
  366 + },
  367 + close() {
  368 + this.$refs.scanCode.close();
  369 + }
  370 + }
  371 +}
350 </script> 372 </script>
351 373
352 <style lang="scss" scoped> 374 <style lang="scss" scoped>
353 - .container {  
354 - padding-bottom: 60px; 375 +.container {
  376 + padding-bottom: 60px;
355 377
356 - // background-color: #f1f1f1 !important;  
357 - ::v-deep.u-tabbar__placeholder {  
358 - display: none; 378 + // background-color: #f1f1f1 !important;
  379 + ::v-deep.u-tabbar__placeholder {
  380 + display: none;
359 381
360 - }  
361 - } 382 + }
  383 +}
362 384
363 - .tabCss {  
364 - // font-weight: ;  
365 - } 385 +.tabCss {
  386 + // font-weight: ;
  387 +}
366 </style> 388 </style>
367 <style lang="scss" scoped> 389 <style lang="scss" scoped>
368 - .orderCard {  
369 - margin: 10px;  
370 - padding: 10px;  
371 - background: #fff;  
372 - border-radius: 15px; 390 +.orderCard {
  391 + margin: 10px;
  392 + padding: 10px;
  393 + background: #fff;
  394 + border-radius: 15px;
373 395
374 - .psfsSty {  
375 - width: 70px;  
376 - height: 23px;  
377 - border-radius: 5px;  
378 - text-align: center;  
379 - line-height: 23px;  
380 - font-size: 12px;  
381 - } 396 + .psfsSty {
  397 + width: 70px;
  398 + height: 23px;
  399 + border-radius: 5px;
  400 + text-align: center;
  401 + line-height: 23px;
  402 + font-size: 12px;
  403 + }
382 404
383 - .ztSty {  
384 - font-family: "苹方 中等", 苹方, sans-serif;  
385 - font-weight: 400;  
386 - font-style: normal;  
387 - color: rgb(0, 174, 170);  
388 - background-color: #e6f7f7;  
389 - } 405 + .ztSty {
  406 + font-family: "苹方 中等", 苹方, sans-serif;
  407 + font-weight: 400;
  408 + font-style: normal;
  409 + color: rgb(0, 174, 170);
  410 + background-color: #e6f7f7;
  411 + }
390 412
391 - .psSty {  
392 - font-family: "苹方 中等", 苹方, sans-serif;  
393 - font-weight: 400;  
394 - font-style: normal;  
395 - color: rgb(255, 165, 0);  
396 - background-color: #fff6e6;  
397 - }  
398 - }  
399 -</style>  
400 \ No newline at end of file 413 \ No newline at end of file
  414 + .psSty {
  415 + font-family: "苹方 中等", 苹方, sans-serif;
  416 + font-weight: 400;
  417 + font-style: normal;
  418 + color: rgb(255, 165, 0);
  419 + background-color: #fff6e6;
  420 + }
  421 +}
  422 +</style>
frontend/app-user/pages/order/orderDetail.vue
@@ -3,10 +3,10 @@ @@ -3,10 +3,10 @@
3 <Navbar title="订单详情" :canBack="true"></Navbar> 3 <Navbar title="订单详情" :canBack="true"></Navbar>
4 <view class="topTitleCss"> 4 <view class="topTitleCss">
5 <view class="text-xxl text-bold"> 5 <view class="text-xxl text-bold">
6 - {{detailForm.fDdzt}} 6 + {{ddDdzt.get(detailForm.fDdzt)}}
7 </view> 7 </view>
8 <view class="text-gray text-lg margin-top"> 8 <view class="text-gray text-lg margin-top">
9 - 订单完成时间:{{ detailForm.fSjwcsj?detailForm.fSjwcsj:detailForm.fDdzt==='待配送'? "等待配送中":detailForm==='已取消'?'已取消':detailForm.fDdzt }} 9 + 订单完成时间:{{ detailForm.fSjwcsj?detailForm.fSjwcsj:detailForm.fDdzt==='203'? "等待配送中":detailForm==='207'?'已取消':ddDdzt.get(detailForm.fDdzt) }}
10 </view> 10 </view>
11 </view> 11 </view>
12 <view class="orderCard"> 12 <view class="orderCard">
@@ -138,7 +138,7 @@ @@ -138,7 +138,7 @@
138 提取方式 138 提取方式
139 </view> 139 </view>
140 <view class="flex justify-end w70"> 140 <view class="flex justify-end w70">
141 - {{detailForm.fPsfs}} 141 + {{ ddPsfs.get(detailForm.fPsfs) }}
142 </view> 142 </view>
143 </view> 143 </view>
144 </view> 144 </view>
@@ -147,6 +147,8 @@ @@ -147,6 +147,8 @@
147 </template> 147 </template>
148 148
149 <script> 149 <script>
  150 +import {dd_zflx, dd_fkfs, dd_psfs, dd_zffs, dd_ddly, sys_sf, dd_ddzt} from "@/utils/enums";
  151 +
150 export default { 152 export default {
151 components: {}, 153 components: {},
152 props: { 154 props: {
@@ -154,6 +156,8 @@ @@ -154,6 +156,8 @@
154 }, 156 },
155 data() { 157 data() {
156 return { 158 return {
  159 + ddDdzt: new Map(Object.values(dd_ddzt).map(item => [item.code, item.info])),
  160 + ddPsfs: new Map(Object.values(dd_psfs).map(item => [item.code, item.info])),
157 detailForm:{ 161 detailForm:{
158 ddxq:[], 162 ddxq:[],
159 fCzmc:'', 163 fCzmc:'',
frontend/app-user/utils/enums.js 0 → 100644
@@ -0,0 +1,65 @@ @@ -0,0 +1,65 @@
  1 +export const sys_sf = {
  2 + Y: {code: '1', info: '是'},
  3 + N: {code: '0', info: '否'}
  4 +};
  5 +
  6 +/**
  7 + * 订单来源枚举
  8 + */
  9 +export const dd_ddly = {
  10 + XSXD: {code: '1', info: '线上下单'},
  11 + WDPS: {code: '2', info: '无单配送'},
  12 + BZXD: {code: '3', info: '帮助下单'}
  13 +};
  14 +
  15 +/**
  16 + * 付款方式枚举
  17 + */
  18 +export const dd_fkfs = {
  19 + CASH_ON_DELIVERY: {code: '1', info: '货到付款'},
  20 + ONLINE_PAYMENT: {code: '2', info: '在线支付'}
  21 +};
  22 +
  23 +/**
  24 + * 配送方式枚举
  25 + */
  26 +export const dd_psfs = {
  27 + PS: {code: '1', info: '配送'},
  28 + ZT: {code: '2', info: '自提'}
  29 +};
  30 +
  31 +
  32 +/**
  33 + * 付款方式枚举
  34 + */
  35 +export const dd_zffs = {
  36 + CASH: {code: 'CASH', info: '现金支付'},
  37 + WX_PAY: {code: 'WX_PAY', info: '微信支付'},
  38 + ALI_PAY: {code: 'ALI_PAY', info: '支付宝支付'}
  39 +};
  40 +
  41 +
  42 +/**
  43 + * 支付场景枚举
  44 + */
  45 +export const dd_zflx = {
  46 + APP: {code: 'APP', info: '移动应用内的支付场景'},
  47 + NATIVE: {code: 'NATIVE', info: '线下消费场景'},
  48 + JSAPI: {code: 'JSAPI', info: '公众号内或者微信内的网页支付'},
  49 + MWEB: {code: 'MWEB', info: '手机浏览器中的支付场景'}
  50 +};
  51 +
  52 +
  53 +export const dd_ddzt = {
  54 + CREATED: {code: '201', info: '待支付'},
  55 + PAID: {code: '202', info: '待配送'},
  56 + SHIPPED: {code: '203', info: '配送中'},
  57 + COMPLETED: {code: '204', info: '已完成'},
  58 + CANCELLED: {code: '205', info: '取消中'},
  59 + REFUNDING: {code: '206', info: '退款中'},
  60 + REFUNDED: {code: '207', info: '已取消'}
  61 +};
  62 +
  63 +
  64 +
  65 +