first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,82 @@
// pages/orderState/orderState.js
Page({
/**
* 页面的初始数据
*/
data: {
active:0,
titleList:[
{ id: -1, title: "全部订单", orderList:[]},
{ id: 0, title: "待付款", orderList: []},
{ id: 1, title: "待发货", orderList: []},
{ id: 2, title: "待收货", orderList: []},
{ id: 3, title: "退货/售后", orderList: []}
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad (options) {
console.log("data", this.data.titleList)
this.setData({
active: options.id
})
// console.log(options.id);
if (options.id === undefined || options.id == ""){
this.getOrderList(-1)
}else {
var a = options.id-1
console.log(a);
this.getOrderList(a)
}
},
onClick(event) {
var that = this
// wx.showToast({
// title: `点击标签 ${event.detail.name}`,
// icon: 'none'
// });
// console.log(that.data.titleList[event.detail.name].title);
wx.setNavigationBarTitle({
title: that.data.titleList[event.detail.name]
})
this.getOrderList(that.data.titleList[event.detail.name].id)
},
async getOrderList(index) {
var sume= index + 1
console.log(index);
// console.log(this.data.titleList[sume].orderList.length)
if (this.data.titleList[sume].orderList.length === 0) {
var data = await global.$api.post({
url: "/order/allOrder",
data: {
status: index
}
});
if (JSON.stringify(data.result) != "{}"){
data.result.forEach((val) => {
val.wares_info = val.wares_info.substring(0, 10) + '..';
val.wares_masterimg = JSON.parse(val.wares_masterimg)[0]
})
var datalist = this.data.titleList
datalist[sume].orderList = data.result
this.setData({
titleList: datalist
})
}
}
},
setDetails (item) {
console.log("id: ", item.currentTarget.dataset.id)
wx.navigateTo({
url: `/pages/info/info?id=${item.currentTarget.dataset.id}`
})
}
})

View File

@@ -0,0 +1,9 @@
{
"navigationStyle": "default",
"navigationBarTitleText":"全部订单",
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-card": "@vant/weapp/card/index"
}
}

View File

@@ -0,0 +1,18 @@
<view class="order_state">
<van-tabs active="{{ active }}" bind:click="onClick">
<van-tab title="{{ item.title }}" wx:for="{{titleList}}" wx:key="index">
<van-card
wx:for="{{titleList[index].orderList}}"
wx:key="index"
num="{{item.goods_num}}"
price="{{item.wares_nowprice}}"
desc="{{item.wares_info}}"
title="{{item.wares_title}}"
thumb="{{item.wares_masterimg}}"
data-id="{{item.wares_id}}"
bindtap="setDetails"
/>
</van-tab>
</van-tabs>
</view>

View File

@@ -0,0 +1 @@
/* saaa */