27 changed files with 14 additions and 1034 deletions
Unified View
Diff Options
-
4app.json
-
2pages/html/message/index.js
-
6pages/mall/detail/index.js
-
123pages/shop/bidding/index.js
-
8pages/shop/bidding/index.json
-
65pages/shop/bidding/index.wxml
-
42pages/shop/bidding/index.wxss
-
99pages/shop/bill/index.js
-
6pages/shop/bill/index.json
-
40pages/shop/bill/index.wxml
-
14pages/shop/bill/index.wxs
-
11pages/shop/bill/index.wxss
-
150pages/shop/detail/index.js
-
8pages/shop/detail/index.json
-
81pages/shop/detail/index.wxml
-
75pages/shop/detail/index.wxss
-
118pages/shop/order/index.js
-
8pages/shop/order/index.json
-
67pages/shop/order/index.wxml
-
50pages/shop/order/index.wxss
-
40pages/shop/shop.wxs
-
2submodel/pages/bidding/detail/index.js
-
2submodel/pages/morder/detail/index.js
-
16submodel/pages/purchase/detail/index.js
-
1submodel/pages/shop/detail/index.wxml
-
8submodel/pages/shop/index/index.js
-
2utils/util.js
@ -1,123 +0,0 @@ |
|||||
import { getBiddingActivityList } from "../../../api/ztb" |
|
||||
const util = require('../../../utils/util') |
|
||||
const event = require('../../../utils/event.js') |
|
||||
const app = getApp() |
|
||||
const status = ['', 0 ,1, 2, -1] |
|
||||
|
|
||||
Page({ |
|
||||
/** |
|
||||
* 页面的初始数据 |
|
||||
*/ |
|
||||
data: { |
|
||||
height: app.globalData.fragmentHeight, |
|
||||
kg: app.globalData.kg, |
|
||||
loading: true, |
|
||||
requesting: false, |
|
||||
finished: false, |
|
||||
tabList: ['全部', '竞价中', '待下单', '已结束', '已流拍' ], |
|
||||
tabIndex: 0, |
|
||||
top: 0, |
|
||||
orderList: [], |
|
||||
form: { |
|
||||
status: '', |
|
||||
pageNum: 1, |
|
||||
pageSize:15 |
|
||||
} |
|
||||
}, |
|
||||
/** |
|
||||
* 生命周期函数--监听页面加载 |
|
||||
*/ |
|
||||
onLoad: function (options) { |
|
||||
this.setData({ |
|
||||
height: app.globalData.fragmentHeight - 90, |
|
||||
kg: app.globalData.kg, |
|
||||
CustomBar: app.globalData.CustomBar |
|
||||
}) |
|
||||
event.on('EventMessage', this, this.onEvent) |
|
||||
this.fetchBiddingList() |
|
||||
}, |
|
||||
onEvent: function (message) { |
|
||||
if (message.what == 301 || message.what == 102) { |
|
||||
this.onRefreshList() |
|
||||
} |
|
||||
}, |
|
||||
onRefreshList: function () { |
|
||||
if (this.data.requesting) { |
|
||||
return |
|
||||
} |
|
||||
this.setData({ |
|
||||
orderList: [], |
|
||||
['form.status']: this.data.form.status, |
|
||||
['form.pageNum']: 1, |
|
||||
loading: true, |
|
||||
finished: false |
|
||||
}) |
|
||||
this.fetchBiddingList() |
|
||||
}, |
|
||||
fetchBiddingList: function () { |
|
||||
if (this.data.requesting || this.data.finished) { |
|
||||
return |
|
||||
} |
|
||||
if (this.data.loading) { |
|
||||
this.data.requesting = true |
|
||||
} else { |
|
||||
this.setData({ requesting: true }) |
|
||||
} |
|
||||
getBiddingActivityList(this.data.form).then(result => { |
|
||||
if (result.data.records.length) { |
|
||||
var respList = result.data.records |
|
||||
let nowList = `orderList[${this.data.orderList.length}]` |
|
||||
var num = this.data.form.pageNum |
|
||||
var finished = this.data.form.pageNum >= result.data.pages |
|
||||
if(this.data.form.pageNum == 1){ |
|
||||
this.setData({ |
|
||||
[nowList]: respList, |
|
||||
total: result.data.total, |
|
||||
['form.pageNum']: (num + 1), |
|
||||
top: 0, |
|
||||
finished, |
|
||||
requesting: false, |
|
||||
loading: false |
|
||||
}) |
|
||||
} else { |
|
||||
this.setData({ |
|
||||
[nowList]: respList, |
|
||||
total: result.data.total, |
|
||||
['form.pageNum']: (num + 1), |
|
||||
finished, |
|
||||
requesting: false, |
|
||||
loading: false |
|
||||
}) |
|
||||
} |
|
||||
} else { |
|
||||
this.setData({ |
|
||||
finished: true, |
|
||||
requesting: false, |
|
||||
loading: false |
|
||||
}) |
|
||||
} |
|
||||
}).catch(err => { |
|
||||
//异常回调
|
|
||||
this.setData({ |
|
||||
requesting: false, |
|
||||
loading: false |
|
||||
}) |
|
||||
util.showToast(err) |
|
||||
}) |
|
||||
}, |
|
||||
lookItem: function (e) { |
|
||||
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] |
|
||||
wx.navigateTo({ url: '/submodel/pages/bidding/detail/index?type=1&id=' + item.id }) |
|
||||
}, |
|
||||
onTabChange: function ({detail}) { |
|
||||
if (this.data.tabIndex == detail.index) { |
|
||||
return |
|
||||
} |
|
||||
this.data.tabIndex = detail.index |
|
||||
this.data.form.status = status[detail.index] |
|
||||
this.onRefreshList() |
|
||||
}, |
|
||||
onUnload: function(){ |
|
||||
event.remove('EventMessage', this) |
|
||||
} |
|
||||
}) |
|
||||
@ -1,8 +0,0 @@ |
|||||
{ |
|
||||
"usingComponents": { |
|
||||
"refresh-view": "/components/refresher/index", |
|
||||
"wux-tabi": "/components/tabi/index", |
|
||||
"wux-image": "/components/image/index", |
|
||||
"wux-divider": "/components/divider/index" |
|
||||
} |
|
||||
} |
|
||||
@ -1,65 +0,0 @@ |
|||||
<wxs module="shop" src="../../shop/shop.wxs"></wxs> |
|
||||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|
||||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|
||||
<view slot="content">竞价管理</view> |
|
||||
</cu-custom> |
|
||||
|
|
||||
<view class="nav bg-white fixed" style="top:{{CustomBar}}px;"> |
|
||||
<wux-tabi tab-data="{{tabList}}" tab-index="{{tabIndex}}" bind:change="onTabChange"></wux-tabi> |
|
||||
</view> |
|
||||
<view style="height:90rpx;width:100%"></view> |
|
||||
|
|
||||
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchBiddingList"> |
|
||||
<view wx:if="{{!orderList.length}}"> |
|
||||
<view class="list-empty" style="height:{{height}}rpx"> |
|
||||
<view class="load-spinner text-gray" style="margin-bottom:24px" wx:if="{{loading}}" /> |
|
||||
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image> |
|
||||
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view wx:else> |
|
||||
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex"> |
|
||||
<view wx:for="{{pageItem}}" wx:key="index"> |
|
||||
<wux-divider show-text="{{ false }}" wx:if="{{pageIndex != 0 || index != 0 }}"></wux-divider> |
|
||||
<view data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem"> |
|
||||
<view class="flex flex-justify item-content"> |
|
||||
<view> |
|
||||
<view class="flex" style="align-items: center;justify-content: start;"> |
|
||||
<view class="page-name">竞拍订单</view> |
|
||||
<view class="page-num" style="margin-left:12rpx">起拍价:{{formate.formatePrice(item.initialUnitPrice,kg)}}</view> |
|
||||
</view> |
|
||||
<view class="page-num">单号:{{item.id}}</view> |
|
||||
</view> |
|
||||
<view class="page-name">{{shop.orderBidding(item.status)}}</view> |
|
||||
</view> |
|
||||
<view class="flex item-content"> |
|
||||
<wux-image width="{{80}}" height="{{80}}" shape="rounded" lazyLoad="true" src="{{item.productCoverImgUrl}}" mode="aspectFill"> |
|
||||
<image class="image-load" slot="loading" src="/assets/image/def_image.png"></image> |
|
||||
</wux-image> |
|
||||
<view style="flex:1;padding-left:20rpx;padding-top:8rpx;height:80px"> |
|
||||
<view class="flex flex-justify" style="height:20px;"> |
|
||||
<view> |
|
||||
<text class="page-name">{{item.productSecondCategoryName}}</text> |
|
||||
<!-- <text class="page-num">【库存(Kg):{{item.stock}}】</text> --> |
|
||||
</view> |
|
||||
<text class="page-num">库存:{{formate.formateWeight(item.stock, kg)}}</text> |
|
||||
</view> |
|
||||
<view style="height:50px"> |
|
||||
<view class="page-outline">{{item.productSummary}}</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<!--加载更多的UI--> |
|
||||
<view wx:if="{{form.pageNum>1}}" style="padding:20rpx"> |
|
||||
<wux-divider> |
|
||||
<view class="loadmore"> |
|
||||
<text class="icon--refresher" wx:if="{{!finished}}"></text> |
|
||||
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text> |
|
||||
</view> |
|
||||
</wux-divider> |
|
||||
</view> |
|
||||
</view> |
|
||||
</refresh-view> |
|
||||
@ -1,42 +0,0 @@ |
|||||
.item-content { |
|
||||
background-color: white; |
|
||||
padding: 24rpx 32rpx; |
|
||||
} |
|
||||
|
|
||||
.page-name { |
|
||||
font-size: 32rpx; |
|
||||
font-family: PingFang-SC-Medium, PingFang-SC; |
|
||||
font-weight: 500; |
|
||||
color: rgba(51, 51, 51, 1); |
|
||||
line-height: 22px; |
|
||||
} |
|
||||
|
|
||||
.page-num { |
|
||||
font-size: 24rpx; |
|
||||
font-family: PingFang-SC-Regular, PingFang-SC; |
|
||||
font-weight: 400; |
|
||||
color: rgba(153, 153, 153, 1); |
|
||||
} |
|
||||
|
|
||||
.image-load { |
|
||||
width: 80px; |
|
||||
height: 80px; |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
justify-content: center; |
|
||||
} |
|
||||
|
|
||||
.page-outline { |
|
||||
padding-top: 8rpx; |
|
||||
font-size: 26rpx; |
|
||||
font-family: PingFang-SC-Regular, PingFang-SC; |
|
||||
font-weight: 400; |
|
||||
color: rgba(51, 51, 51, 1); |
|
||||
display: -webkit-box; |
|
||||
overflow: hidden; |
|
||||
text-overflow: ellipsis; |
|
||||
word-wrap: break-word; |
|
||||
white-space: normal !important; |
|
||||
-webkit-line-clamp: 3; |
|
||||
-webkit-box-orient: vertical; |
|
||||
} |
|
||||
@ -1,99 +0,0 @@ |
|||||
import { getStoreWater } from "../../../api/ztb" |
|
||||
const util = require('../../../utils/util') |
|
||||
const app = getApp() |
|
||||
|
|
||||
Page({ |
|
||||
/** |
|
||||
* 页面的初始数据 |
|
||||
*/ |
|
||||
data: { |
|
||||
height: app.globalData.fragmentHeight, |
|
||||
loading: true, |
|
||||
requesting: false, |
|
||||
finished: false, |
|
||||
top: 0, |
|
||||
orderList: [], |
|
||||
form: { |
|
||||
pageNum: 1, |
|
||||
pageSize:15 |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 生命周期函数--监听页面加载 |
|
||||
*/ |
|
||||
onLoad: function (options) { |
|
||||
// wx.navigateTo({ url: options.url + '?' + options.key + '=' + options.value })
|
|
||||
this.setData({ |
|
||||
height: app.globalData.fragmentHeight |
|
||||
}) |
|
||||
this.fetchBillList() |
|
||||
}, |
|
||||
onRefreshList: function () { |
|
||||
if (this.data.requesting) { |
|
||||
return |
|
||||
} |
|
||||
this.setData({ |
|
||||
orderList: [], |
|
||||
['form.pageNum']: 1, |
|
||||
loading: true, |
|
||||
finished: false |
|
||||
}) |
|
||||
this.fetchBillList() |
|
||||
}, |
|
||||
fetchBillList: function () { |
|
||||
if (this.data.requesting || this.data.finished) { |
|
||||
return |
|
||||
} |
|
||||
if (this.data.loading) { |
|
||||
this.data.requesting = true |
|
||||
} else { |
|
||||
this.setData({ requesting: true }) |
|
||||
} |
|
||||
getStoreWater(this.data.form).then(result => { |
|
||||
if (result.data && result.data.records && result.data.records.length) { |
|
||||
var respList = result.data.records |
|
||||
let nowList = `orderList[${this.data.orderList.length}]` |
|
||||
var num = this.data.form.pageNum |
|
||||
var finished = this.data.form.pageNum >= result.data.pages |
|
||||
if(this.data.form.pageNum == 1){ |
|
||||
this.setData({ |
|
||||
[nowList]: respList, |
|
||||
['form.pageNum']: (num + 1), |
|
||||
top: 0, |
|
||||
finished, |
|
||||
requesting: false, |
|
||||
loading: false |
|
||||
}) |
|
||||
} else { |
|
||||
this.setData({ |
|
||||
[nowList]: respList, |
|
||||
['form.pageNum']: (num + 1), |
|
||||
finished, |
|
||||
requesting: false, |
|
||||
loading: false |
|
||||
}) |
|
||||
} |
|
||||
} else { |
|
||||
this.setData({ |
|
||||
finished: true, |
|
||||
requesting: false, |
|
||||
loading: false |
|
||||
}) |
|
||||
} |
|
||||
}).catch(err => { |
|
||||
//异常回调
|
|
||||
this.setData({ |
|
||||
requesting: false, |
|
||||
loading: false |
|
||||
}) |
|
||||
util.showToast(err) |
|
||||
}) |
|
||||
}, |
|
||||
lookItem: function (e) { |
|
||||
// var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index]
|
|
||||
// wx.navigateTo({
|
|
||||
// url: '/submodelpages/home/bill-detail/index?id=' + item.id
|
|
||||
// })
|
|
||||
} |
|
||||
}) |
|
||||
@ -1,6 +0,0 @@ |
|||||
{ |
|
||||
"usingComponents": { |
|
||||
"refresh-view": "/components/refresher/index", |
|
||||
"wux-divider": "/components/divider/index" |
|
||||
} |
|
||||
} |
|
||||
@ -1,40 +0,0 @@ |
|||||
<wxs module="bill" src="./index.wxs"></wxs> |
|
||||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|
||||
<view slot="content">店铺收入</view> |
|
||||
</cu-custom> |
|
||||
|
|
||||
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchBillList"> |
|
||||
<view wx:if="{{!orderList.length}}"> |
|
||||
<view class="list-empty" style="height:{{height}}rpx"> |
|
||||
<view class="load-spinner text-gray" style="margin-bottom:24px" wx:if="{{loading}}" /> |
|
||||
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image> |
|
||||
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view wx:else> |
|
||||
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex"> |
|
||||
<view class="bg-white" wx:for="{{pageItem}}" wx:key="index"> |
|
||||
<wux-divider show-text="{{ false }}" wx:if="{{pageIndex != 0 || index != 0 }}"></wux-divider> |
|
||||
<view class="item-content" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem"> |
|
||||
<view class="flex flex-justify"> |
|
||||
<view class="page-name">{{item.type == 1 ? '一口价订单' : '竞价订单'}}</view> |
|
||||
<view class="page-num">{{bill.billStatus(item.status)}}</view> |
|
||||
</view> |
|
||||
<view class="flex flex-justify" style="margin-top:6rpx"> |
|
||||
<view class="page-num">订单编号:{{item.orderNo}}</view> |
|
||||
<view class="page-name">{{item.price}}</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<!--加载更多的UI--> |
|
||||
<view wx:if="{{form.pageNum>1}}" style="padding:20rpx"> |
|
||||
<wux-divider> |
|
||||
<view class="loadmore"> |
|
||||
<text class="icon--refresher" wx:if="{{!finished}}"></text> |
|
||||
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text> |
|
||||
</view> |
|
||||
</wux-divider> |
|
||||
</view> |
|
||||
</view> |
|
||||
</refresh-view> |
|
||||
@ -1,14 +0,0 @@ |
|||||
function billStatus(status) { |
|
||||
if (status == 1) { |
|
||||
return '待结算' |
|
||||
} else if (status == 2) { |
|
||||
return '已结算' |
|
||||
} else if (status == 3) { |
|
||||
return '取消' |
|
||||
} |
|
||||
return '' |
|
||||
} |
|
||||
|
|
||||
module.exports = { |
|
||||
billStatus: billStatus |
|
||||
} |
|
||||
@ -1,11 +0,0 @@ |
|||||
.item-content { |
|
||||
background-color: white; |
|
||||
padding: 18rpx 24rpx; |
|
||||
} |
|
||||
|
|
||||
.page-num { |
|
||||
font-size: 24rpx; |
|
||||
font-family: PingFang-SC-Regular, PingFang-SC; |
|
||||
font-weight: 400; |
|
||||
color: rgba(153, 153, 153, 1); |
|
||||
} |
|
||||
@ -1,150 +0,0 @@ |
|||||
// pages/shop/detail/index.js
|
|
||||
import { getStoreInfo, getProductList, getStoreProductList } from "../../../api/ztb" |
|
||||
const math = require('../../../utils/math') |
|
||||
const util = require('../../../utils/util') |
|
||||
const app = getApp() |
|
||||
|
|
||||
Page({ |
|
||||
/** |
|
||||
* 页面的初始数据 |
|
||||
*/ |
|
||||
data: { |
|
||||
height: app.globalData.fragmentHeight, |
|
||||
kg: app.globalData.kg, |
|
||||
imageHeight: 0, |
|
||||
imgList: [], |
|
||||
detail: null, |
|
||||
tabList: [ '供应', '采购', '联系'], |
|
||||
tabIndex: 0, |
|
||||
orderList: [], |
|
||||
loading: true, |
|
||||
requesting: false, |
|
||||
finished: false, |
|
||||
form: { |
|
||||
storeId: null, |
|
||||
pageNum: 1, |
|
||||
pageSize:15 |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 生命周期函数--监听页面加载 |
|
||||
*/ |
|
||||
onLoad: function (options) { |
|
||||
this.data.form.storeId = options.storeId |
|
||||
wx.showLoading({ title: '加载中', mask: true }) |
|
||||
getStoreInfo(options.storeId).then(result => { |
|
||||
this.setData({ |
|
||||
detail: result.data, |
|
||||
imgList: result.data.coverImgUrlList, |
|
||||
imageHeight: math.divide(math.times(750, 9), 16), |
|
||||
height: app.globalData.fragmentHeight, |
|
||||
kg: app.globalData.kg, |
|
||||
}) |
|
||||
wx.hideLoading() |
|
||||
}).catch(err => { |
|
||||
//异常回调
|
|
||||
wx.hideLoading() |
|
||||
}) |
|
||||
this.fetchGoodList() |
|
||||
}, |
|
||||
viewImage: function(event){ |
|
||||
wx.previewImage({ urls: this.data.imgList, current: event.currentTarget.dataset.url }) |
|
||||
}, |
|
||||
onTabChange: function({detail}){ |
|
||||
if (this.data.tabIndex == Number(detail.index)) { |
|
||||
return |
|
||||
} |
|
||||
this.data.tabIndex = Number(detail.index) |
|
||||
if(this.data.tabIndex != 2){ |
|
||||
this.onRefreshList() |
|
||||
} else { |
|
||||
this.setData({ tabIndex: this.data.tabIndex }) |
|
||||
} |
|
||||
}, |
|
||||
onRefreshList: function () { |
|
||||
if(this.data.tabIndex == 2){ |
|
||||
this.setData({ requesting: false }) |
|
||||
return |
|
||||
} |
|
||||
if (this.data.requesting) { |
|
||||
return |
|
||||
} |
|
||||
this.setData({ |
|
||||
orderList: [], |
|
||||
tabIndex: this.data.tabIndex, |
|
||||
['form.pageNum']: 1, |
|
||||
loading: true, |
|
||||
finished: false |
|
||||
}) |
|
||||
this.fetchGoodList() |
|
||||
}, |
|
||||
fetchGoodList: function () { |
|
||||
if (this.data.requesting || this.data.finished) { |
|
||||
return |
|
||||
} |
|
||||
if (this.data.loading) { |
|
||||
this.data.requesting = true |
|
||||
} else { |
|
||||
this.setData({ requesting: true }) |
|
||||
} |
|
||||
if(this.data.tabIndex == 0){ |
|
||||
getStoreProductList(this.data.form).then(result => { |
|
||||
this.doResult(result) |
|
||||
}).catch(err => { |
|
||||
this.setData({ requesting: false, loading: false }) |
|
||||
util.showToast(err) |
|
||||
}) |
|
||||
} else if(this.data.tabIndex == 1){ |
|
||||
getProductList(this.data.form).then(result => { |
|
||||
this.doResult(result) |
|
||||
}).catch(err => { |
|
||||
this.setData({ requesting: false, loading: false }) |
|
||||
util.showToast(err) |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
doResult: function(result){ |
|
||||
if (result.data.records.length) { |
|
||||
var respList = result.data.records |
|
||||
let nowList = `orderList[${this.data.orderList.length}]` |
|
||||
var num = this.data.form.pageNum |
|
||||
var finished = this.data.form.pageNum >= result.data.pages |
|
||||
if(this.data.form.pageNum == 1){ |
|
||||
this.setData({ |
|
||||
[nowList]: respList, |
|
||||
total: result.data.total, |
|
||||
['form.pageNum']: (num + 1), |
|
||||
top: 0, |
|
||||
finished, |
|
||||
requesting: false, |
|
||||
loading: false |
|
||||
}) |
|
||||
} else { |
|
||||
this.setData({ |
|
||||
[nowList]: respList, |
|
||||
total: result.data.total, |
|
||||
['form.pageNum']: (num + 1), |
|
||||
finished, |
|
||||
requesting: false, |
|
||||
loading: false |
|
||||
}) |
|
||||
} |
|
||||
} else { |
|
||||
this.setData({ |
|
||||
finished: true, |
|
||||
requesting: false, |
|
||||
loading: false |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
lookItem: function(event){ |
|
||||
var item = this.data.orderList[event.currentTarget.dataset.page][event.currentTarget.dataset.index] |
|
||||
if(item.bidType == 3){ |
|
||||
wx.navigateTo({ url: '/submodel/pages/purchase/detail/index?id=' + item.id }) |
|
||||
} else { |
|
||||
wx.navigateTo({ url: '/pages/mall/detail/index?id=' + item.id }) |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
}) |
|
||||
@ -1,8 +0,0 @@ |
|||||
{ |
|
||||
"usingComponents": { |
|
||||
"refresh-view": "/components/refresher/index", |
|
||||
"wux-tabi": "/components/tabi/index", |
|
||||
"wux-image": "/components/image/index", |
|
||||
"wux-divider": "/components/divider/index" |
|
||||
} |
|
||||
} |
|
||||
@ -1,81 +0,0 @@ |
|||||
<!--pages/shop/detail/index.wxml--> |
|
||||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|
||||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|
||||
<view slot="content">店铺详情</view> |
|
||||
</cu-custom> |
|
||||
|
|
||||
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" bind:scrolltolower="fetchGoodList"> |
|
||||
<view wx:if="{{detail}}" style="position: relative"> |
|
||||
<swiper class="screen-swiper {{imgList.length > 1 ? 'square-dot' : ''}}" style="min-height:{{imageHeight}}rpx" indicator-dots="{{imgList.length > 1}}" indicator-color="#FFFFFF" indicator-active-color="#008AFF" autoplay="true" interval="3000" duration="500"> |
|
||||
<swiper-item wx:for="{{imgList}}" wx:key="index"> |
|
||||
<view bindtap="viewImage" style="width:100%;height:100%" data-url="{{item}}"> |
|
||||
<image src="{{item}}" mode="aspectFill"></image> |
|
||||
</view> |
|
||||
</swiper-item> |
|
||||
</swiper> |
|
||||
</view> |
|
||||
<view class="bg-white" style="height:90rpx;width:100%"> |
|
||||
<wux-tabi tab-data="{{tabList}}" tab-index="{{tabIndex}}" bind:change="onTabChange"></wux-tabi> |
|
||||
</view> |
|
||||
<wux-divider show-text="{{ false }}"></wux-divider> |
|
||||
<view class="bg-white text-sg margin-top" style="padding: 0rpx 32rpx" wx:if="{{detail && tabIndex == 2}}"> |
|
||||
<view class="flex flex-justify detail-layout" style="border-bottom:1px solid #f3f3f3"> |
|
||||
<view class="flex" style="align-items: center;"> |
|
||||
<view class="text-black">{{detail.name}}</view> |
|
||||
</view> |
|
||||
<view class="flex" style="align-items: center;"> |
|
||||
<text class="cuIcon-locationfill text-blue" style="font-size:16px;padding-top:6rpx" /> |
|
||||
<view class="text-df text-blue" style="margin-left:6rpx">{{detail.locProvinceName}} {{detail.locCityName}}</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view style="height:16rpx;"></view> |
|
||||
<view class="text-gray text-df" style="line-height:50rpx;">店主昵称:{{detail.contacts}}</view> |
|
||||
<view class="text-gray text-df" style="line-height:50rpx;">店铺地址:{{detail.locDetails}}</view> |
|
||||
<view class="text-gray text-df" style="line-height:50rpx;">联系方式:{{detail.contactPhoneNo}}</view> |
|
||||
<view style="height:20rpx;"></view> |
|
||||
</view> |
|
||||
<view wx:elif="{{!orderList.length}}"> |
|
||||
<view class="list-empty" style="height:{{height - imageHeight - 88}}rpx"> |
|
||||
<view class="load-spinner text-gray" style="margin-bottom:24px" wx:if="{{loading}}" /> |
|
||||
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image> |
|
||||
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view wx:else> |
|
||||
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex"> |
|
||||
<view wx:for="{{pageItem}}" wx:key="index"> |
|
||||
<wux-divider show-text="{{ false }}" wx:if="{{pageIndex != 0 || index != 0 }}"></wux-divider> |
|
||||
<view class="flex item-content" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem"> |
|
||||
<wux-image width="{{100}}" height="{{100}}" lazyLoad="true" src="{{item.coverImgUrl}}" mode="aspectFill"> |
|
||||
<image class="image-load" slot="loading" src="/assets/image/def_image.png"></image> |
|
||||
<image class="image-load" slot="empty" src="/assets/image/def_image.png"></image> |
|
||||
<image class="image-load" slot="error" src="/assets/image/def_image.png"></image> |
|
||||
</wux-image> |
|
||||
<view style="flex:1;padding-left:20rpx;padding-top:8rpx;height:100px"> |
|
||||
<view class="flex" style="height:20px;align-items: center"> |
|
||||
<image style="width:72rpx;height:36rpx;margin-right:12rpx" src="/assets/image/ico_tag{{item.bidType == 2 ? '2' : '1'}}.png"></image> |
|
||||
<view class="page-name" style="margin-left:2rpx">{{item.secondCategoryName}}</view> |
|
||||
<!-- <view class="page-num">{{item.locProvinceName + item.locCityName}}</view> --> |
|
||||
</view> |
|
||||
<view style="height:50px"> |
|
||||
<view class="page-outline">{{item.description || ''}}</view> |
|
||||
</view> |
|
||||
<view class="flex flex-justify"> |
|
||||
<view class="page-price">{{item.unitPrice ? '¥' + formate.formatePrice(item.unitPrice, kg) : '价格面议'}}</view> |
|
||||
<view style="font-size:24rpx" wx:if="{{tabIndex == 0}}">库存:{{formate.formateWeight(item.stock, kg)}}</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<!--加载更多的UI--> |
|
||||
<view wx:if="{{form.pageNum>1}}" style="padding:24rpx"> |
|
||||
<wux-divider> |
|
||||
<view class="loadmore"> |
|
||||
<text class="icon--refresher" wx:if="{{!finished}}"></text> |
|
||||
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text> |
|
||||
</view> |
|
||||
</wux-divider> |
|
||||
</view> |
|
||||
</view> |
|
||||
</refresh-view> |
|
||||
@ -1,75 +0,0 @@ |
|||||
/* pages/shop/detail/index.wxss */ |
|
||||
.margin-top { |
|
||||
margin-top: 18rpx; |
|
||||
} |
|
||||
|
|
||||
.detail-layout { |
|
||||
min-height: 90rpx; |
|
||||
font-size: 30rpx; |
|
||||
align-items: center; |
|
||||
} |
|
||||
|
|
||||
.info-layout { |
|
||||
position: absolute; |
|
||||
bottom: 0; |
|
||||
width: 100%; |
|
||||
background-color: rgba(0, 0, 0, 0.3); |
|
||||
padding: 18rpx 30rpx; |
|
||||
} |
|
||||
|
|
||||
.item-content { |
|
||||
height: 120px; |
|
||||
background: rgba(255, 255, 255, 1); |
|
||||
padding: 20rpx |
|
||||
} |
|
||||
|
|
||||
.page-name { |
|
||||
font-size: 32rpx; |
|
||||
font-family: PingFang-SC-Medium, PingFang-SC; |
|
||||
font-weight: 500; |
|
||||
color: rgba(51, 51, 51, 1); |
|
||||
line-height: 22px; |
|
||||
} |
|
||||
|
|
||||
.page-num { |
|
||||
font-size: 24rpx; |
|
||||
font-family: PingFang-SC-Regular, PingFang-SC; |
|
||||
font-weight: 400; |
|
||||
color: rgba(153, 153, 153, 1); |
|
||||
} |
|
||||
|
|
||||
.page-outline { |
|
||||
margin-top: 8rpx; |
|
||||
font-size: 28rpx; |
|
||||
font-family: PingFang-SC-Regular, PingFang-SC; |
|
||||
font-weight: 400; |
|
||||
color: rgba(51, 51, 51, 1); |
|
||||
display: -webkit-box; |
|
||||
overflow: hidden; |
|
||||
text-overflow: ellipsis; |
|
||||
word-wrap: break-word; |
|
||||
white-space: normal !important; |
|
||||
-webkit-line-clamp: 2; |
|
||||
-webkit-box-orient: vertical; |
|
||||
} |
|
||||
|
|
||||
.page-price { |
|
||||
line-height: 30rpx; |
|
||||
font-size: 32rpx; |
|
||||
font-family: DINAlternate-Bold, DINAlternate; |
|
||||
font-weight: bold; |
|
||||
color: rgba(255, 66, 43, 1); |
|
||||
} |
|
||||
|
|
||||
.image-load { |
|
||||
width: 100px; |
|
||||
height: 100px; |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
justify-content: center; |
|
||||
} |
|
||||
|
|
||||
.tag { |
|
||||
height: 40rpx; |
|
||||
padding: 2rpx 18rpx 4rpx 18rpx; |
|
||||
} |
|
||||
@ -1,118 +0,0 @@ |
|||||
import { getStoreTradeList } from "../../../api/ztb" |
|
||||
const util = require('../../../utils/util') |
|
||||
const event = require('../../../utils/event.js') |
|
||||
const app = getApp() |
|
||||
const status = ['', 1, 2, 3, 4, 5, 6, 7, 8, 9] |
|
||||
|
|
||||
Page({ |
|
||||
|
|
||||
/** |
|
||||
* 页面的初始数据 |
|
||||
*/ |
|
||||
data: { |
|
||||
height: app.globalData.fragmentHeight, |
|
||||
kg: app.globalData.kg, |
|
||||
loading: true, |
|
||||
requesting: false, |
|
||||
finished: false, |
|
||||
tabList: [ '全部', '待付诚意金', '待上传资料', '待上传资料确认', '待支付尾款', '待收货', '待扣点确认', '待退货确认', '已完成', '已关闭' ], |
|
||||
tabIndex: 0, |
|
||||
top: 0, |
|
||||
orderList: [], |
|
||||
form: { |
|
||||
storeId: '', |
|
||||
status: '', |
|
||||
pageNum: 1, |
|
||||
pageSize:15 |
|
||||
} |
|
||||
}, |
|
||||
/** |
|
||||
* 生命周期函数--监听页面加载 |
|
||||
*/ |
|
||||
onLoad: function (options) { |
|
||||
this.setData({ |
|
||||
['form.storeId']: options.storeId, |
|
||||
height: app.globalData.fragmentHeight - 90, |
|
||||
kg: app.globalData.kg, |
|
||||
CustomBar: app.globalData.CustomBar |
|
||||
}) |
|
||||
event.on('EventMessage', this, this.onEvent) |
|
||||
this.fetchOrderList() |
|
||||
}, |
|
||||
onEvent: function (message) { |
|
||||
if (message.what == 320) { |
|
||||
this.onRefreshList() |
|
||||
} |
|
||||
}, |
|
||||
onRefreshList: function () { |
|
||||
if (this.data.requesting) { |
|
||||
return |
|
||||
} |
|
||||
this.setData({ |
|
||||
orderList: [], |
|
||||
['form.status']: this.data.form.status, |
|
||||
['form.pageNum']: 1, |
|
||||
loading: true, |
|
||||
finished: false |
|
||||
}) |
|
||||
this.fetchOrderList() |
|
||||
}, |
|
||||
fetchOrderList: function () { |
|
||||
if (this.data.requesting || this.data.finished) { |
|
||||
return |
|
||||
} |
|
||||
if (this.data.loading) { |
|
||||
this.data.requesting = true |
|
||||
} else { |
|
||||
this.setData({ requesting: true }) |
|
||||
} |
|
||||
getStoreTradeList(this.data.form).then(result => { |
|
||||
if (result.data.records.length) { |
|
||||
var respList = result.data.records |
|
||||
let nowList = `orderList[${this.data.orderList.length}]` |
|
||||
var num = this.data.form.pageNum |
|
||||
var finished = this.data.form.pageNum >= result.data.pages |
|
||||
if(this.data.form.pageNum == 1){ |
|
||||
this.setData({ |
|
||||
[nowList]: respList, |
|
||||
total: result.data.total, |
|
||||
['form.pageNum']: (num + 1), |
|
||||
top: 0, |
|
||||
finished, |
|
||||
requesting: false, |
|
||||
loading: false |
|
||||
}) |
|
||||
} else { |
|
||||
this.setData({ |
|
||||
[nowList]: respList, |
|
||||
total: result.data.total, |
|
||||
['form.pageNum']: (num + 1), |
|
||||
finished, |
|
||||
requesting: false, |
|
||||
loading: false |
|
||||
}) |
|
||||
} |
|
||||
} else { |
|
||||
this.setData({ finished: true, requesting: false, loading: false }) |
|
||||
} |
|
||||
}).catch(err => { |
|
||||
this.setData({ requesting: false, loading: false }) |
|
||||
util.showToast(err) |
|
||||
}) |
|
||||
}, |
|
||||
lookItem: function (e) { |
|
||||
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] |
|
||||
wx.navigateTo({ url: '/submodel/pages/morder/detail/index?type=1&orderId=' + item.orderId }) |
|
||||
}, |
|
||||
onTabChange: function ({detail}) { |
|
||||
if (this.data.tabIndex == detail.index) { |
|
||||
return |
|
||||
} |
|
||||
this.data.tabIndex = detail.index |
|
||||
this.data.form.status = status[this.data.tabIndex] |
|
||||
this.onRefreshList() |
|
||||
}, |
|
||||
onUnload: function(){ |
|
||||
event.remove('EventMessage', this) |
|
||||
} |
|
||||
}) |
|
||||
@ -1,8 +0,0 @@ |
|||||
{ |
|
||||
"usingComponents": { |
|
||||
"refresh-view": "/components/refresher/index", |
|
||||
"wux-tabi": "/components/tabi/index", |
|
||||
"wux-image": "/components/image/index", |
|
||||
"wux-divider": "/components/divider/index" |
|
||||
} |
|
||||
} |
|
||||
@ -1,67 +0,0 @@ |
|||||
<wxs module="shop" src="../../shop/shop.wxs"></wxs> |
|
||||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|
||||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|
||||
<view slot="content">订单管理</view> |
|
||||
</cu-custom> |
|
||||
|
|
||||
<view class="nav bg-white fixed" style="top:{{CustomBar}}px;"> |
|
||||
<wux-tabi tab-data="{{tabList}}" tab-index="{{tabIndex}}" scroll="{{true}}" bind:change="onTabChange"></wux-tabi> |
|
||||
</view> |
|
||||
<view style="height:90rpx;width:100%"></view> |
|
||||
|
|
||||
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchOrderList"> |
|
||||
<view wx:if="{{!orderList.length}}"> |
|
||||
<view class="list-empty" style="height:{{height}}rpx"> |
|
||||
<view class="load-spinner text-gray" style="margin-bottom:24px" wx:if="{{loading}}" /> |
|
||||
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image> |
|
||||
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view wx:else> |
|
||||
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex"> |
|
||||
<view wx:for="{{pageItem}}" wx:key="index"> |
|
||||
<wux-divider show-text="{{ false }}" wx:if="{{pageIndex != 0 || index != 0 }}"></wux-divider> |
|
||||
<view data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem"> |
|
||||
<view class="flex flex-justify bg-white" style="width:100%;height:80rpx;padding: 0rpx 24rpx"> |
|
||||
<view> |
|
||||
<text class="cuIcon-people text-blue" style="width:32rpx;height:32rpx"></text> |
|
||||
<text style="width:32rpx;height:32rpx;margin-left: 8rpx">{{item.orderPlacerName}}</text> |
|
||||
<text style="width:32rpx;height:32rpx;margin-left: 8rpx">{{item.phone}}</text> |
|
||||
</view> |
|
||||
</view> |
|
||||
<wux-divider show-text="{{ false }}" dashed></wux-divider> |
|
||||
<view class="flex flex-justify item-content"> |
|
||||
<view> |
|
||||
<view class="page-name">{{item.bidType == 1 ? '一口价' : '竞拍订单'}}</view> |
|
||||
<view class="page-num">单号:{{item.orderId}}</view> |
|
||||
</view> |
|
||||
<view class="page-name">{{shop.orderStatus(item.status)}}</view> |
|
||||
</view> |
|
||||
<view class="flex item-content"> |
|
||||
<wux-image width="{{80}}" height="{{80}}" shape="rounded" lazyLoad="true" src="{{item.coverImgUrl}}" mode="aspectFill"> |
|
||||
<image class="image-load" slot="loading" src="/assets/image/def_image.png"></image> |
|
||||
</wux-image> |
|
||||
<view style="flex:1;padding-left:20rpx;padding-top:8rpx;height:80px"> |
|
||||
<view class="flex flex-justify" style="height:20px;"> |
|
||||
<view class="page-name">{{item.secondCategoryName}}</view> |
|
||||
<view class="page-num">单价:{{formate.formatePrice2(item.unitPrice, kg)}}</view> |
|
||||
</view> |
|
||||
<view style="height:50px"> |
|
||||
<view class="page-outline">{{item.description}}</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<!--加载更多的UI--> |
|
||||
<view wx:if="{{form.pageNum>1}}" style="padding:20rpx"> |
|
||||
<wux-divider> |
|
||||
<view class="loadmore"> |
|
||||
<text class="icon--refresher" wx:if="{{!finished}}"></text> |
|
||||
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text> |
|
||||
</view> |
|
||||
</wux-divider> |
|
||||
</view> |
|
||||
</view> |
|
||||
</refresh-view> |
|
||||
@ -1,50 +0,0 @@ |
|||||
.item-content { |
|
||||
background-color: white; |
|
||||
padding: 24rpx 32rpx; |
|
||||
} |
|
||||
|
|
||||
.page-name { |
|
||||
font-size: 32rpx; |
|
||||
font-family: PingFang-SC-Medium, PingFang-SC; |
|
||||
font-weight: 500; |
|
||||
color: rgba(51, 51, 51, 1); |
|
||||
line-height: 22px; |
|
||||
} |
|
||||
|
|
||||
.page-num { |
|
||||
font-size: 24rpx; |
|
||||
font-family: PingFang-SC-Regular, PingFang-SC; |
|
||||
font-weight: 400; |
|
||||
color: rgba(153, 153, 153, 1); |
|
||||
} |
|
||||
|
|
||||
.image-load { |
|
||||
width: 80px; |
|
||||
height: 80px; |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
justify-content: center; |
|
||||
} |
|
||||
|
|
||||
.page-outline { |
|
||||
padding-top: 8rpx; |
|
||||
font-size: 26rpx; |
|
||||
font-family: PingFang-SC-Regular, PingFang-SC; |
|
||||
font-weight: 400; |
|
||||
color: rgba(51, 51, 51, 1); |
|
||||
display: -webkit-box; |
|
||||
overflow: hidden; |
|
||||
text-overflow: ellipsis; |
|
||||
word-wrap: break-word; |
|
||||
white-space: normal !important; |
|
||||
-webkit-line-clamp: 3; |
|
||||
-webkit-box-orient: vertical; |
|
||||
} |
|
||||
|
|
||||
.image-load { |
|
||||
width: 100px; |
|
||||
height: 100px; |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
justify-content: center; |
|
||||
} |
|
||||
@ -1,40 +0,0 @@ |
|||||
function orderBidding(status) { |
|
||||
if (status == -1) { |
|
||||
return '已流拍' |
|
||||
} else if (status == 0) { |
|
||||
return '竞价中' |
|
||||
} else if (status == 1) { |
|
||||
return '待下单' |
|
||||
} else if (status == 2) { |
|
||||
return '已结束' |
|
||||
} |
|
||||
return '' |
|
||||
} |
|
||||
|
|
||||
function orderStatus(status) { |
|
||||
if (status == 1) { |
|
||||
return '待付诚意金' |
|
||||
} else if (status == 2) { |
|
||||
return '待上传资料' |
|
||||
} else if (status == 3) { |
|
||||
return '待上传资料确认' |
|
||||
} else if (status == 4) { |
|
||||
return '待支付尾款' |
|
||||
} else if (status == 5) { |
|
||||
return '待收货' |
|
||||
} else if (status == 6) { |
|
||||
return '待扣点确认' |
|
||||
} else if (status == 7) { |
|
||||
return '待退货确认' |
|
||||
} else if (status == 8) { |
|
||||
return '已完成' |
|
||||
} else if (status == 9) { |
|
||||
return '已关闭' |
|
||||
} |
|
||||
return '' |
|
||||
} |
|
||||
|
|
||||
module.exports = { |
|
||||
orderBidding: orderBidding, |
|
||||
orderStatus: orderStatus |
|
||||
} |
|
||||
Write
Preview
Loading…
Cancel
Save