diff --git a/api-interface/.idea/.gitignore b/api-interface/.idea/.gitignore
new file mode 100644
index 0000000..35410ca
--- /dev/null
+++ b/api-interface/.idea/.gitignore
@@ -0,0 +1,8 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml
+# 基于编辑器的 HTTP 客户端请求
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/api-interface/.idea/MarsCodeWorkspaceAppSettings.xml b/api-interface/.idea/MarsCodeWorkspaceAppSettings.xml
new file mode 100644
index 0000000..3b9bb1d
--- /dev/null
+++ b/api-interface/.idea/MarsCodeWorkspaceAppSettings.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api-interface/.idea/api-interface.iml b/api-interface/.idea/api-interface.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/api-interface/.idea/api-interface.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api-interface/.idea/compiler.xml b/api-interface/.idea/compiler.xml
new file mode 100644
index 0000000..cfdba17
--- /dev/null
+++ b/api-interface/.idea/compiler.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api-interface/.idea/encodings.xml b/api-interface/.idea/encodings.xml
new file mode 100644
index 0000000..7e50513
--- /dev/null
+++ b/api-interface/.idea/encodings.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api-interface/.idea/jarRepositories.xml b/api-interface/.idea/jarRepositories.xml
new file mode 100644
index 0000000..712ab9d
--- /dev/null
+++ b/api-interface/.idea/jarRepositories.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api-interface/.idea/misc.xml b/api-interface/.idea/misc.xml
new file mode 100644
index 0000000..ba2a02d
--- /dev/null
+++ b/api-interface/.idea/misc.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api-interface/.idea/modules.xml b/api-interface/.idea/modules.xml
new file mode 100644
index 0000000..55d8e64
--- /dev/null
+++ b/api-interface/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api-interface/.idea/vcs.xml b/api-interface/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/api-interface/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/order-app/src/api/order.js b/order-app/src/api/order.js
index 2a626ca..02573e9 100644
--- a/order-app/src/api/order.js
+++ b/order-app/src/api/order.js
@@ -1,4 +1,7 @@
import http from '../common/http.js'
export const splaceOrderApi = (parm) => {
return http.post("/wxapi/order/splaceOrder", parm)
+}
+export const getOrderListApi = (parm)=>{
+ return http.get("/wxapi/order/getOrderList",parm)
}
\ No newline at end of file
diff --git a/order-app/src/pages/category/category.vue b/order-app/src/pages/category/category.vue
index 74cf2e7..4ff0dc9 100644
--- a/order-app/src/pages/category/category.vue
+++ b/order-app/src/pages/category/category.vue
@@ -49,6 +49,7 @@
const scrollTop = ref(0)
const current = ref(0)
const menuHeight = ref(0)
+
const menuItemHeight = ref(0)
const getImg = () => {
return Math.floor(Math.random() * 35)
@@ -104,6 +105,7 @@
// });
uni.navigateTo({
+
url: '../detail/detail?goods=' + encodeURIComponent(JSON.stringify(item))
});
}
diff --git a/order-app/src/pages/order/order.vue b/order-app/src/pages/order/order.vue
index ccbc020..042b826 100644
--- a/order-app/src/pages/order/order.vue
+++ b/order-app/src/pages/order/order.vue
@@ -7,40 +7,40 @@
-
+
-
+
- {{ res.store }}
+ {{ res.userName }}
- {{ res.deal }}
+ {{ res.phone }}
-
+
- {{ item.title }}
- {{ item.type }}
- 发货时间 {{ item.deliveryTime }}
+ {{ item.goodsName }}
+ {{ item.specsName }}{{item.goodsUnit}}
+
- ¥{{ priceInt(item.price) }}
- .{{ priceDecimal(item.price) }}
+ ¥{{ item.price }}
+
- x{{ item.number }}
+ x{{ item.num }}
- 共{{ totalNum(res.goodsList) }}件商品 合计:
+ 共{{ res.goodsList.length }}件商品 合计:
- ¥{{ priceInt(totalPrice(res.goodsList)) }}.
- {{ priceDecimal(totalPrice(res.goodsList)) }}
+ ¥{{ res.price }}
+
@@ -52,122 +52,7 @@
评价
-
-
-
-
-
-
-
-
-
-
-
- {{ res.store }}
-
-
- {{ res.deal }}
-
-
-
-
-
-
- {{ item.title }}
- {{ item.type }}
- 发货时间 {{ item.deliveryTime }}
-
-
-
- ¥{{ priceInt(item.price) }}
- .{{ priceDecimal(item.price) }}
-
- x{{ item.number }}
-
-
-
- 共{{ totalNum(res.goodsList) }}件商品 合计:
-
- ¥{{ priceInt(totalPrice(res.goodsList)) }}.
- {{ priceDecimal(totalPrice(res.goodsList)) }}
-
-
-
-
-
-
- 查看物流
- 卖了换钱
- 评价
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 您还没有相关的订单
- 可以去看看有那些想买的
-
- 随便逛逛
-
-
-
-
-
-
-
-
-
-
-
-
- {{ res.store }}
-
-
- {{ res.deal }}
-
-
-
-
-
-
- {{ item.title }}
- {{ item.type }}
- 发货时间 {{ item.deliveryTime }}
-
-
-
- ¥{{ priceInt(item.price) }}
- .{{ priceDecimal(item.price) }}
-
- x{{ item.number }}
-
-
-
- 共{{ totalNum(res.goodsList) }}件商品 合计:
-
- ¥{{ priceInt(totalPrice(res.goodsList)) }}.
- {{ priceDecimal(totalPrice(res.goodsList)) }}
-
-
-
-
-
-
- 查看物流
- 卖了换钱
- 评价
-
-
-
+
@@ -180,6 +65,9 @@
import {
onReady
} from '@dcloudio/uni-app';
+ import {
+ getOrderListApi
+ } from '../../api/order.js'
import {
ref,
computed
@@ -191,171 +79,48 @@
[],
[]
])
- const dataList = ref([{
- id: 1,
- store: '夏日流星限定贩卖',
- deal: '交易成功',
- goodsList: [{
- goodsUrl: '//img13.360buyimg.com/n7/jfs/t1/103005/7/17719/314825/5e8c19faEb7eed50d/5b81ae4b2f7f3bb7.jpg',
- title: '【冬日限定】现货 原创jk制服女2020冬装新款小清新宽松软糯毛衣外套女开衫短款百搭日系甜美风',
- type: '灰色;M',
- deliveryTime: '付款后30天内发货',
- price: '348.58',
- number: 2
- },
- {
- goodsUrl: '//img12.360buyimg.com/n7/jfs/t1/102191/19/9072/330688/5e0af7cfE17698872/c91c00d713bf729a.jpg',
- title: '【葡萄藤】现货 小清新学院风制服格裙百褶裙女短款百搭日系甜美风原创jk制服女2020新款',
- type: '45cm;S',
- deliveryTime: '付款后30天内发货',
- price: '135.00',
- number: 1
- }
- ]
- },
- {
- id: 2,
- store: '江南皮革厂',
- deal: '交易失败',
- goodsList: [{
- goodsUrl: '//img14.360buyimg.com/n7/jfs/t1/60319/15/6105/406802/5d43f68aE9f00db8c/0affb7ac46c345e2.jpg',
- title: '【冬日限定】现货 原创jk制服女2020冬装新款小清新宽松软糯毛衣外套女开衫短款百搭日系甜美风',
- type: '粉色;M',
- deliveryTime: '付款后7天内发货',
- price: '128.05',
- number: 1
- }]
- },
- {
- id: 3,
- store: '三星旗舰店',
- deal: '交易失败',
- goodsList: [{
- goodsUrl: '//img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg',
- title: '三星(SAMSUNG)京品家电 UA65RUF70AJXXZ 65英寸4K超高清 HDR 京东微联 智能语音 教育资源液晶电视机',
- type: '4K,广色域',
- deliveryTime: '保质5年',
- price: '1998',
- number: 3
- },
- {
- goodsUrl: '//img14.360buyimg.com/n7/jfs/t6007/205/4099529191/294869/ae4e6d4f/595dcf19Ndce3227d.jpg!q90.jpg',
- title: '美的(Midea)639升 对开门冰箱 19分钟急速净味 一级能效冷藏双开门杀菌智能家用双变频节能 BCD-639WKPZM(E)',
- type: '容量大,速冻',
- deliveryTime: '保质5年',
- price: '2354',
- number: 1
- }
- ]
- },
- {
- id: 4,
- store: '三星旗舰店',
- deal: '交易失败',
- goodsList: [{
- goodsUrl: '//img10.360buyimg.com/n7/jfs/t22300/31/1505958241/171936/9e201a89/5b2b12ffNe6dbb594.jpg!q90.jpg',
- title: '法国进口红酒 拉菲(LAFITE)传奇波尔多干红葡萄酒750ml*6整箱装',
- type: '4K,广色域',
- deliveryTime: '珍藏10年好酒',
- price: '1543',
- number: 3
- },
- {
- goodsUrl: '//img10.360buyimg.com/n7/jfs/t1/107598/17/3766/525060/5e143aacE9a94d43c/03573ae60b8bf0ee.jpg',
- title: '蓝妹(BLUE GIRL)酷爽啤酒 清啤 原装进口啤酒 罐装 500ml*9听 整箱装',
- type: '一打',
- deliveryTime: '口感好',
- price: '120',
- number: 1
- }
- ]
- },
- {
- id: 5,
- store: '三星旗舰店',
- deal: '交易成功',
- goodsList: [{
- goodsUrl: '//img12.360buyimg.com/n7/jfs/t1/52408/35/3554/78293/5d12e9cfEfd118ba1/ba5995e62cbd747f.jpg!q90.jpg',
- title: '企业微信 中控人脸指纹识别考勤机刷脸机 无线签到异地多店打卡机WX108',
- type: '识别效率高',
- deliveryTime: '使用方便',
- price: '451',
- number: 9
- }]
- }
- ])
const list = ref([{
- name: '待付款'
+ name: '全部'
},
{
name: '待发货'
},
{
- name: '待收货'
+ name: '已发货'
},
{
- name: '待评价',
- count: 12
+ name: '已收货'
}
])
const currents = ref(0)
const swiperCurrent = ref(0)
const tabsHeight = ref(0)
const dx = ref(0)
+ const currentPage = ref(1)
+ const pageSize = ref(3)
+ const pages = ref(0)
const loadStatus = ref(['loadmore', 'loadmore', 'loadmore', 'loadmore'])
-
- const getOrderList = (idx) => {
- for (let i = 0; i < 5; i++) {
- let index = Math.round(Math.random() * (dataList.value.length - 1));
- // let index = Math.random(0, dataList.value.length - 1);
- // console.log('666')
- // console.log(index)
- let data = JSON.parse(JSON.stringify(dataList.value[index]));
- data.id = Math.floor(Math.random() * 100 + 1);
- // console.log(data)
- orderList.value[idx].push(data);
- }
- loadStatus.value.splice(currents.value, 1, "loadmore")
- }
- let priceDecimal = computed(() => {
- return val => {
- if (val !== parseInt(val)) return val.slice(-2);
- else return '00';
- }
- })
-
- let priceInt = computed(() => {
- return val => {
- if (val !== parseInt(val)) return val.split('.')[0];
- else return val;
- }
- })
- const totalPrice = (item) => {
- let price = 0;
- item.map(val => {
- price += parseFloat(val.price);
- });
- return price.toFixed(2);
- }
-
- const totalNum = (item) => {
- let num = 0;
- item.map(val => {
- num += val.number;
- });
- return num;
- }
const reachBottom = () => {
if (currents.value != 2) {
loadStatus.value.splice(currents.value, 1, "loading")
setTimeout(() => {
- getOrderList(currents.value);
- }, 1200);
+ if (currentPage.value < pages.value) {
+ currentPage.value = ++currentPage.value
+ getOrderList(currents.value);
+ } else {
+ loadStatus.value.splice(currents.value, 1, "nomore")
+ }
+
+ }, 1000);
}
}
const change = (index) => {
+ loadStatus.value.splice(index, 1, 'loading')
swiperCurrent.value = index;
- getOrderList(index);
+ currentPage.value = 1;
+ pages.value = 0;
+ //清空数据列表
+ orderList.value[currents.value] = [];
}
const transition = ({
detail: {
@@ -374,11 +139,39 @@
tabs.value.setFinishCurrent(current);
swiperCurrent.value = current;
currents.value = current;
+ currentPage.value = 1;
+ pages.value = 0;
+ //清空数据列表
+ orderList.value[currents.value] = [];
+ getOrderList(current)
+
+ }
+ //查询订单
+ const getOrderList = async (idx) => {
+ let res = await getOrderListApi({
+ openid: uni.getStorageSync("openid"),
+ type: idx == 0 ? '' : idx,
+ currentPage: currentPage.value,
+ pageSize: pageSize.value
+ })
+ if (res && res.code == 200) {
+ console.log(res)
+
+ if (res.data.records.length == 0) { //没有数据
+ loadStatus.value.splice(currents.value, 1, 'nomore')
+ return;
+ }
+ pages.value = res.data.pages
+ res.data.records.map(item => {
+ orderList.value[idx].push(item)
+ })
+ loadStatus.value.splice(currents.value, 1, 'loadmore')
+ } else {
+ loadStatus.value.splice(currents.value, 1, 'nomore')
+ }
}
onReady(() => {
getOrderList(0);
- getOrderList(1);
- getOrderList(3);
})