|
@@ -9,7 +9,54 @@
|
|
<view class="tabsList">
|
|
<view class="tabsList">
|
|
<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
|
|
<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
|
|
<view class="list-scroll-view">
|
|
<view class="list-scroll-view">
|
|
- <view class="list" v-for="(item,index) in list" :key="index">
|
|
|
|
|
|
+ <view class="list_1" v-if="tabs.active=='-0'">
|
|
|
|
+ 全部订单
|
|
|
|
+ </view>
|
|
|
|
+ <view class="list_2" v-for="(item,index) in list" :key="index" v-else-if="tabs.active=='0'">
|
|
|
|
+ <view class="status">
|
|
|
|
+ {{item.status=='0'?'待付款':'已付款'}}
|
|
|
|
+ </view>
|
|
|
|
+ <view class="goods" v-for="(tag,indexs) in item.goods" :key="indexs">
|
|
|
|
+ <view class="goods_1">
|
|
|
|
+ <view class="shopname">
|
|
|
|
+ <text class="iconfont icon-shangdian"></text>
|
|
|
|
+ <text>{{tag.shop_name}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="goods_2">
|
|
|
|
+ <view class="market" v-for="(tags,indexss) in tag.goods" :key="indexss">
|
|
|
|
+ <view class="url">
|
|
|
|
+ <image class="image" :src="tags.goods.file&&tags.goods.file.length>0?tags.goods.file[0].url:''" mode=""></image>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="goodsname">
|
|
|
|
+ {{tags.name}}
|
|
|
|
+ </view>
|
|
|
|
+ <view class="goodsother">
|
|
|
|
+ <view class="price">
|
|
|
|
+ ¥{{tags.sell_money}}
|
|
|
|
+ </view>
|
|
|
|
+ <view class="num">
|
|
|
|
+ ×{{tags.buy_num}}
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="other">
|
|
|
|
+ <text>共{{item.total_detail.freight_total}}件商品</text>
|
|
|
|
+ <text>总价¥{{item.total_detail.goods_total}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="btn">
|
|
|
|
+ <button class="toCancel" v-if="item.status=='0'" type="default" size="mini" @click="toCancel(item)">取消订单</button>
|
|
|
|
+ <button class="toPay" v-if="item.status=='0'" type="default" size="mini" @click="toPay(item)">付款</button>
|
|
|
|
+ <button class="toAfter" v-if="item.status=='3'" type="default" size="mini" @click="toAfter(item)">申请售后</button>
|
|
|
|
+ <button class="toRefund" v-if="item.status=='3'" type="default" size="mini" @click="toRefund(item)">申请退款</button>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="list_3" v-else>
|
|
|
|
+ 其他情况
|
|
|
|
+ </view>
|
|
|
|
+ <!-- <view class="list" v-for="(item,index) in list" :key="index">
|
|
<view class="list_1">
|
|
<view class="list_1">
|
|
<view class="l">
|
|
<view class="l">
|
|
<text class="iconfont icon-shangdian"></text>
|
|
<text class="iconfont icon-shangdian"></text>
|
|
@@ -21,8 +68,7 @@
|
|
</view>
|
|
</view>
|
|
<view class="list_2">
|
|
<view class="list_2">
|
|
<view class="l">
|
|
<view class="l">
|
|
- <image class="image" :src="item.url&&item.url.length>0?item.url[0].url:''"
|
|
|
|
- mode=""></image>
|
|
|
|
|
|
+ <image class="image" :src="item.url&&item.url.length>0?item.url[0].url:''" mode=""></image>
|
|
</view>
|
|
</view>
|
|
<view class="c">
|
|
<view class="c">
|
|
<view class="name">
|
|
<view class="name">
|
|
@@ -40,19 +86,15 @@
|
|
</view>
|
|
</view>
|
|
<view class="other">
|
|
<view class="other">
|
|
<text>共{{item.market_num}}件商品</text>
|
|
<text>共{{item.market_num}}件商品</text>
|
|
- <text>总价¥{{item.money}}</text>
|
|
|
|
|
|
+ <text>总价¥{{item.total_detail.goods_total}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="btn">
|
|
<view class="btn">
|
|
- <button v-if="item.status=='0'" type="default" @click="toCancel(item)"
|
|
|
|
- size="mini">取消订单</button>
|
|
|
|
- <button v-if="item.status=='0'" type="default" @click="toPay(item)"
|
|
|
|
- size="mini">付款</button>
|
|
|
|
- <button v-if="item.status=='3'" type="default" @click="toAfter(item)"
|
|
|
|
- size="mini">申请售后</button>
|
|
|
|
- <button v-if="item.status=='3'" type="default" @click="toRefund(item)"
|
|
|
|
- size="mini">申请退款</button>
|
|
|
|
|
|
+ <button v-if="item.status=='0'" type="default" @click="toCancel(item)" size="mini">取消订单</button>
|
|
|
|
+ <button v-if="item.status=='0'" type="default" @click="toPay(item)" size="mini">付款</button>
|
|
|
|
+ <button v-if="item.status=='3'" type="default" @click="toAfter(item)" size="mini">申请售后</button>
|
|
|
|
+ <button v-if="item.status=='3'" type="default" @click="toRefund(item)" size="mini">申请退款</button>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
|
|
+ </view> -->
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</view>
|
|
</view>
|
|
@@ -98,23 +140,11 @@
|
|
}
|
|
}
|
|
]
|
|
]
|
|
},
|
|
},
|
|
- list: [ //订单列表
|
|
|
|
- {
|
|
|
|
- shop: '官方自营店',
|
|
|
|
- status: '3',
|
|
|
|
- url: [{
|
|
|
|
- name: "20220928155634.jpg",
|
|
|
|
- uri: "/files/point/20220928155634.jpg",
|
|
|
|
- url: "https://broadcast.waityou24.cn/files/point/20220928155634.jpg"
|
|
|
|
- }],
|
|
|
|
- name: '饮用水',
|
|
|
|
- price: 58,
|
|
|
|
- buy_num: 1,
|
|
|
|
- market_num: 1,
|
|
|
|
- money: 58
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
-
|
|
|
|
|
|
+ list: [],
|
|
|
|
+ total: 0,
|
|
|
|
+ skip: 0,
|
|
|
|
+ limit: 5,
|
|
|
|
+ page: 0
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onLoad: function(e) {
|
|
onLoad: function(e) {
|
|
@@ -148,11 +178,45 @@
|
|
const that = this;
|
|
const that = this;
|
|
let user = that.user;
|
|
let user = that.user;
|
|
let status = that.status;
|
|
let status = that.status;
|
|
- console.log(status);
|
|
|
|
|
|
+ if (status == '-0') {
|
|
|
|
+
|
|
|
|
+ } else if (status == '0') {
|
|
|
|
+ const res = await that.$api(`/order`, 'GET', {
|
|
|
|
+ status: '0',
|
|
|
|
+ customer: user._id
|
|
|
|
+ });
|
|
|
|
+ if (res.errcode == '0') {
|
|
|
|
+ let list = [...that.list, ...res.data];
|
|
|
|
+ that.$set(that, `list`, list)
|
|
|
|
+ that.$set(that, `total`, res.total)
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.errmsg,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 分页
|
|
// 分页
|
|
toPage(e) {
|
|
toPage(e) {
|
|
-
|
|
|
|
|
|
+ const that = this;
|
|
|
|
+ let list = that.list;
|
|
|
|
+ let limit = that.limit;
|
|
|
|
+ if (that.total > list.length) {
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '加载中',
|
|
|
|
+ mask: true
|
|
|
|
+ })
|
|
|
|
+ let page = that.page + 1;
|
|
|
|
+ that.$set(that, `page`, page)
|
|
|
|
+ let skip = page * limit;
|
|
|
|
+ that.$set(that, `skip`, skip)
|
|
|
|
+ that.search();
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ } else uni.showToast({
|
|
|
|
+ title: '没有更多数据了'
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 输入框
|
|
// 输入框
|
|
toInput(e) {
|
|
toInput(e) {
|
|
@@ -189,11 +253,12 @@
|
|
},
|
|
},
|
|
// 付款
|
|
// 付款
|
|
toPay(e) {
|
|
toPay(e) {
|
|
|
|
+ const that = this;
|
|
uni.getStorage({
|
|
uni.getStorage({
|
|
key: 'system',
|
|
key: 'system',
|
|
success: async function(res) {
|
|
success: async function(res) {
|
|
// 微信小程序支付
|
|
// 微信小程序支付
|
|
- if (res.data.uniPlatform == "mp-weixin") {
|
|
|
|
|
|
+ if (res.data.uniPlatform == "mp-weixin") {
|
|
const res = await that.$api('/pay/toPayOrder', 'POST', {
|
|
const res = await that.$api('/pay/toPayOrder', 'POST', {
|
|
order_id: e,
|
|
order_id: e,
|
|
type: '0'
|
|
type: '0'
|
|
@@ -204,9 +269,9 @@
|
|
...res.data,
|
|
...res.data,
|
|
success(res) {
|
|
success(res) {
|
|
console.log('in success');
|
|
console.log('in success');
|
|
- console.log(res)
|
|
|
|
|
|
+ console.log(res)
|
|
},
|
|
},
|
|
- fail(e) {
|
|
|
|
|
|
+ fail(e) {
|
|
console.log('in fail');
|
|
console.log('in fail');
|
|
console.log(e)
|
|
console.log(e)
|
|
}
|
|
}
|
|
@@ -290,41 +355,58 @@
|
|
width: 100vw;
|
|
width: 100vw;
|
|
height: 82vh;
|
|
height: 82vh;
|
|
|
|
|
|
- .list {
|
|
|
|
|
|
+ .list_2 {
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
margin: 0 2vw 2vw 2vw;
|
|
margin: 0 2vw 2vw 2vw;
|
|
padding: 2vw;
|
|
padding: 2vw;
|
|
|
|
|
|
- .list_1 {
|
|
|
|
|
|
+ .status {
|
|
|
|
+ text-align: right;
|
|
margin: 0 0 1vw 0;
|
|
margin: 0 0 1vw 0;
|
|
- display: flex;
|
|
|
|
- flex-direction: row;
|
|
|
|
- justify-content: space-between;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- .list_2 {
|
|
|
|
|
|
+ .goods {
|
|
margin: 0 0 1vw 0;
|
|
margin: 0 0 1vw 0;
|
|
- display: flex;
|
|
|
|
-
|
|
|
|
- .l {
|
|
|
|
- width: 20vw;
|
|
|
|
|
|
+ padding: 2vw;
|
|
|
|
+ border-bottom: 1px solid #f5f5f5;
|
|
|
|
|
|
- .image {
|
|
|
|
- width: 100%;
|
|
|
|
- height: 20vw;
|
|
|
|
- border-radius: 5px;
|
|
|
|
|
|
+ .goods_1 {
|
|
|
|
+ margin: 0 0 2vw 0;
|
|
|
|
|
|
|
|
+ .shopname {
|
|
|
|
+ text:last-child {
|
|
|
|
+ padding: 0 0 0 2vw;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- .c {
|
|
|
|
- width: 60vw;
|
|
|
|
- padding: 0 2vw;
|
|
|
|
- }
|
|
|
|
|
|
+ .goods_2 {
|
|
|
|
+ margin: 0 0 1vw 0;
|
|
|
|
+
|
|
|
|
+ .market {
|
|
|
|
+ display: flex;
|
|
|
|
+
|
|
|
|
+ .url {
|
|
|
|
+ width: 20vw;
|
|
|
|
+
|
|
|
|
+ .image {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 20vw;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
|
|
- .r {
|
|
|
|
- width: 15vw;
|
|
|
|
- text-align: right;
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .goodsname {
|
|
|
|
+ width: 60vw;
|
|
|
|
+ padding: 0 2vw;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .goodsother {
|
|
|
|
+ width: 15vw;
|
|
|
|
+ text-align: right;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -347,8 +429,73 @@
|
|
button {
|
|
button {
|
|
margin: 2vw 0 0 2vw;
|
|
margin: 2vw 0 0 2vw;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .toPay {
|
|
|
|
+ border: 1px solid #ff0000;
|
|
|
|
+ color: #ff0000;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // .list {
|
|
|
|
+ // background-color: #fff;
|
|
|
|
+ // margin: 0 2vw 2vw 2vw;
|
|
|
|
+ // padding: 2vw;
|
|
|
|
+
|
|
|
|
+ // .list_1 {
|
|
|
|
+ // margin: 0 0 1vw 0;
|
|
|
|
+ // display: flex;
|
|
|
|
+ // flex-direction: row;
|
|
|
|
+ // justify-content: space-between;
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // .list_2 {
|
|
|
|
+ // margin: 0 0 1vw 0;
|
|
|
|
+ // display: flex;
|
|
|
|
+
|
|
|
|
+ // .l {
|
|
|
|
+ // width: 20vw;
|
|
|
|
+
|
|
|
|
+ // .image {
|
|
|
|
+ // width: 100%;
|
|
|
|
+ // height: 20vw;
|
|
|
|
+ // border-radius: 5px;
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // .c {
|
|
|
|
+ // width: 60vw;
|
|
|
|
+ // padding: 0 2vw;
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // .r {
|
|
|
|
+ // width: 15vw;
|
|
|
|
+ // text-align: right;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // .other {
|
|
|
|
+ // margin: 0 0 2vw 0;
|
|
|
|
+ // text-align: right;
|
|
|
|
+
|
|
|
|
+ // text {
|
|
|
|
+ // font-size: 14px;
|
|
|
|
+
|
|
|
|
+ // padding: 0 0 0 2vw;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // .btn {
|
|
|
|
+ // text-align: right;
|
|
|
|
+ // margin: 2vw 0 0 0;
|
|
|
|
+ // border-top: 1px solid #f1fff1;
|
|
|
|
+
|
|
|
|
+ // button {
|
|
|
|
+ // margin: 2vw 0 0 2vw;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|