27 changed files with 1479 additions and 1 deletions
Unified View
Diff Options
-
2api/request.js
-
123submodel/pages/shop/bidding/index.js
-
8submodel/pages/shop/bidding/index.json
-
65submodel/pages/shop/bidding/index.wxml
-
42submodel/pages/shop/bidding/index.wxss
-
99submodel/pages/shop/bill/index.js
-
6submodel/pages/shop/bill/index.json
-
40submodel/pages/shop/bill/index.wxml
-
14submodel/pages/shop/bill/index.wxs
-
11submodel/pages/shop/bill/index.wxss
-
134submodel/pages/shop/create/index.js
-
7submodel/pages/shop/create/index.json
-
39submodel/pages/shop/create/index.wxml
-
4submodel/pages/shop/create/index.wxss
-
150submodel/pages/shop/detail/index.js
-
8submodel/pages/shop/detail/index.json
-
81submodel/pages/shop/detail/index.wxml
-
75submodel/pages/shop/detail/index.wxss
-
180submodel/pages/shop/index/index.js
-
10submodel/pages/shop/index/index.json
-
81submodel/pages/shop/index/index.wxml
-
18submodel/pages/shop/index/index.wxss
-
118submodel/pages/shop/order/index.js
-
8submodel/pages/shop/order/index.json
-
67submodel/pages/shop/order/index.wxml
-
50submodel/pages/shop/order/index.wxss
-
40submodel/pages/shop/shop.wxs
@ -0,0 +1,123 @@ |
|||||
|
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) |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,8 @@ |
|||||
|
{ |
||||
|
"usingComponents": { |
||||
|
"refresh-view": "/components/refresher/index", |
||||
|
"wux-tabi": "/components/tabi/index", |
||||
|
"wux-image": "/components/image/index", |
||||
|
"wux-divider": "/components/divider/index" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,65 @@ |
|||||
|
<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> |
||||
@ -0,0 +1,42 @@ |
|||||
|
.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; |
||||
|
} |
||||
@ -0,0 +1,99 @@ |
|||||
|
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
|
||||
|
// })
|
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,6 @@ |
|||||
|
{ |
||||
|
"usingComponents": { |
||||
|
"refresh-view": "/components/refresher/index", |
||||
|
"wux-divider": "/components/divider/index" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,40 @@ |
|||||
|
<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> |
||||
@ -0,0 +1,14 @@ |
|||||
|
function billStatus(status) { |
||||
|
if (status == 1) { |
||||
|
return '待结算' |
||||
|
} else if (status == 2) { |
||||
|
return '已结算' |
||||
|
} else if (status == 3) { |
||||
|
return '取消' |
||||
|
} |
||||
|
return '' |
||||
|
} |
||||
|
|
||||
|
module.exports = { |
||||
|
billStatus: billStatus |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
.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); |
||||
|
} |
||||
@ -0,0 +1,134 @@ |
|||||
|
// pages/shop/apply/index.js
|
||||
|
import { updateStore, getStoreInfo, editStore } from "../../../api/ztb" |
||||
|
const util = require('../../../utils/util') |
||||
|
import regions from '../../../const/region' |
||||
|
|
||||
|
Page({ |
||||
|
/** |
||||
|
* 页面的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
options: regions, |
||||
|
theme: 'energized', |
||||
|
warning: '注意:店铺资料审核后不可修改,请谨慎填写', |
||||
|
region: [440000, 440100, 440106], |
||||
|
form: { |
||||
|
contactPhoneNo: '', |
||||
|
name: '', |
||||
|
contacts: '', |
||||
|
locProvinceId: '', |
||||
|
locCityId: '', |
||||
|
locDistrictId: '', |
||||
|
locDetails: '' |
||||
|
}, |
||||
|
imgList: [], |
||||
|
requesting: false |
||||
|
}, |
||||
|
/** |
||||
|
* 生命周期函数--监听页面加载 |
||||
|
*/ |
||||
|
onLoad: function (options) { |
||||
|
this.cascaderView = this.cascaderView || this.selectComponent('#wux-cascader') |
||||
|
if(options.storeId){ |
||||
|
this.data.form['storeId'] = options.storeId |
||||
|
wx.showLoading({ title: '加载中', mask: true }) |
||||
|
getStoreInfo(options.storeId).then(result => { |
||||
|
var fileList = [] |
||||
|
if(result.data.coverImgUrlList && result.data.coverImgUrlList.length){ |
||||
|
result.data.coverImgUrlList.forEach(element => { |
||||
|
fileList.push({ url: element, status: 8 }) |
||||
|
}) |
||||
|
} |
||||
|
this.setData({ |
||||
|
form: result.data, |
||||
|
imgList: fileList, |
||||
|
['form.areaStr']: result.data.locProvinceName + ' ' + result.data.locCityName + ' ' + result.data.locDistrictName, |
||||
|
region: [result.data.locProvinceId, result.data.locCityId, result.data.locDistrictId] |
||||
|
}) |
||||
|
wx.hideLoading() |
||||
|
}).catch(err => { |
||||
|
//异常回调
|
||||
|
wx.hideLoading() |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
bindinput: function(e){ |
||||
|
this.data.form[e.target.id] = e.detail.value |
||||
|
}, |
||||
|
showRegion: function(){ |
||||
|
if(this.data.disabled){ |
||||
|
return |
||||
|
} |
||||
|
this.cascaderView.showPicker(this.data.region) |
||||
|
}, |
||||
|
onRegionChange: function (e) { |
||||
|
if (e.detail && e.detail.options) { |
||||
|
this.setData({ |
||||
|
['form.areaStr']: e.detail.options.map((n) => n.label).join(' '), |
||||
|
region: e.detail.value |
||||
|
}) |
||||
|
this.data.form['locProvinceId'] = e.detail.value[0] |
||||
|
this.data.form['locCityId'] = e.detail.value[1] |
||||
|
this.data.form['locDistrictId'] = e.detail.value[2] |
||||
|
} |
||||
|
}, |
||||
|
onUploadChange: function(e){ |
||||
|
if(e.detail && e.detail.length){ |
||||
|
var list = [] |
||||
|
e.detail.forEach(element => { |
||||
|
if(!util.isEmpty(element.url)){ |
||||
|
list.push(element.url) |
||||
|
} |
||||
|
}) |
||||
|
this.data.form['coverImgUrlList'] = list |
||||
|
} |
||||
|
}, |
||||
|
submitForm: function(){ |
||||
|
if(util.isEmpty(this.data.form.name)){ |
||||
|
util.showToast('请输入店铺名称') |
||||
|
return |
||||
|
} |
||||
|
if(util.isEmpty(this.data.form.contacts)){ |
||||
|
util.showToast('请输入店主昵称') |
||||
|
return |
||||
|
} |
||||
|
if(util.isEmpty(this.data.form.contactPhoneNo)){ |
||||
|
util.showToast('请输入联系电话') |
||||
|
return |
||||
|
} |
||||
|
if(util.isEmpty(this.data.form.locDistrictId)){ |
||||
|
util.showToast('请选择店铺所在区域') |
||||
|
return |
||||
|
} |
||||
|
if(util.isEmpty(this.data.form.locDetails)){ |
||||
|
util.showToast('请输入店铺详细地址') |
||||
|
return |
||||
|
} |
||||
|
if(util.isEmpty(this.data.form.coverImgUrlList) || this.data.form.coverImgUrlList.length <= 0){ |
||||
|
util.showToast('请上传一张店铺图片') |
||||
|
return |
||||
|
} |
||||
|
this.setData({requesting: true}) |
||||
|
wx.showLoading({ title: '加载中', mask: true }) |
||||
|
if(!util.isEmpty(this.data.form.storeId)){ |
||||
|
editStore(this.data.form).then(result => { |
||||
|
wx.hideLoading() |
||||
|
util.showBackToast('店铺完善成功') |
||||
|
}).catch(err => { |
||||
|
wx.hideLoading() |
||||
|
util.showToast(err) |
||||
|
this.setData({requesting: false}) |
||||
|
}) |
||||
|
} else { |
||||
|
updateStore(this.data.form).then(result => { |
||||
|
wx.hideLoading() |
||||
|
util.showBackToast('店铺完善成功') |
||||
|
}).catch(err => { |
||||
|
wx.hideLoading() |
||||
|
util.showToast(err) |
||||
|
this.setData({requesting: false}) |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
}) |
||||
@ -0,0 +1,7 @@ |
|||||
|
{ |
||||
|
"usingComponents": { |
||||
|
"wux-button": "/components/button/index", |
||||
|
"wux-cascader": "/components/cascader/index", |
||||
|
"wux-uploader": "/components/uploader/index" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
<!--pages/shop/apply/index.wxml--> |
||||
|
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
||||
|
<view slot="content">完善店铺</view> |
||||
|
</cu-custom> |
||||
|
|
||||
|
<view class="cu-form-group margin-top"> |
||||
|
<view class="title">店铺名称:</view> |
||||
|
<input id="name" disabled="{{disabled}}" placeholder-style="color:#aaa" placeholder="请输入店铺名称" value="{{form.name}}" bindinput="bindinput"></input> |
||||
|
</view> |
||||
|
<view class="cu-form-group"> |
||||
|
<view class="title">店主昵称:</view> |
||||
|
<input id="contacts" disabled="{{disabled}}" placeholder-style="color:#aaa" placeholder="请输入店主昵称" value="{{form.contacts}}" bindinput="bindinput"></input> |
||||
|
</view> |
||||
|
<view class="cu-form-group"> |
||||
|
<view class="title">联系电话:</view> |
||||
|
<input id="contactPhoneNo" disabled="{{disabled}}" placeholder-style="color:#aaa" placeholder="请输入联系电话" value="{{form.contactPhoneNo}}" bindinput="bindinput"></input> |
||||
|
</view> |
||||
|
|
||||
|
<view class="cu-form-group" data-index="1" style="border-top: 1px solid #f3f3f3" bindtap="showRegion"> |
||||
|
<view class="flex text-sg">所在地区: |
||||
|
<view class="{{form.areaStr||'input-grey'}}">{{form.areaStr||'请选择所在地区'}}</view> |
||||
|
</view> |
||||
|
<text class="cuIcon-right text-gray" wx:if="{{!disabled}}"></text> |
||||
|
</view> |
||||
|
<view class="cu-form-group" style="border-top: 1rpx solid #f3f3f3"> |
||||
|
<view class="title">详细地址:</view> |
||||
|
<input id="locDetails" disabled="{{disabled}}" placeholder-style="color:#aaa" placeholder="请输入店铺详细地址" value="{{form.locDetails}}" bindinput="bindinput"></input> |
||||
|
</view> |
||||
|
|
||||
|
<view class="cu-bar bg-white margin-top"> |
||||
|
<view class="action text-bold" style="color:#333333">{{!disabled?'上传或拍照店铺图片:':'店铺图片:'}}</view> |
||||
|
</view> |
||||
|
<wux-uploader count="5" fileList="{{imgList}}" bindcustomevent="onUploadChange"></wux-uploader> |
||||
|
|
||||
|
<view style="padding:48rpx"> |
||||
|
<wux-button block type="positive" disabled="{{requesting}}" bind:click="submitForm">提交</wux-button> |
||||
|
</view> |
||||
|
|
||||
|
<wux-cascader id="wux-cascader" value="{{region}}" options="{{ options }}" bind:close="onRegionChange" /> |
||||
@ -0,0 +1,4 @@ |
|||||
|
/* pages/shop/apply/index.wxss */ |
||||
|
.margin-top{ |
||||
|
margin-top: 18rpx; |
||||
|
} |
||||
@ -0,0 +1,150 @@ |
|||||
|
// 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 }) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
}) |
||||
@ -0,0 +1,8 @@ |
|||||
|
{ |
||||
|
"usingComponents": { |
||||
|
"refresh-view": "/components/refresher/index", |
||||
|
"wux-tabi": "/components/tabi/index", |
||||
|
"wux-image": "/components/image/index", |
||||
|
"wux-divider": "/components/divider/index" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,81 @@ |
|||||
|
<!--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> |
||||
@ -0,0 +1,75 @@ |
|||||
|
/* 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; |
||||
|
} |
||||
@ -0,0 +1,180 @@ |
|||||
|
// pages/shop/index/index.js
|
||||
|
import { getStoreOverView, getStoreInfo, depositStore } from "../../../api/ztb" |
||||
|
const math = require('../../../utils/math') |
||||
|
const util = require('../../../utils/util') |
||||
|
const tdsdk = require('../../../libs/tdweapp') |
||||
|
const app = getApp() |
||||
|
|
||||
|
Page({ |
||||
|
data: { |
||||
|
iconList: [ |
||||
|
{ index: 0, icon: 'pick', color: 'gray', badge: 0, name: '我要卖货' }, |
||||
|
{ index: 1, icon: 'edit', color: 'gray', badge: 0, name: '发布竞价' }, |
||||
|
{ index: 5, icon: 'shop', color: 'gray', badge: 0, name: '编辑店铺' }, |
||||
|
{ index: 7, icon: 'form', color: 'gray', badge: 0, name: '发布采购' } |
||||
|
], |
||||
|
form: { |
||||
|
margin: 0, |
||||
|
todayMargin: 0, |
||||
|
todayMarginNum: 0 |
||||
|
}, |
||||
|
detail: null, |
||||
|
hasStore: 0, |
||||
|
status: null, |
||||
|
imageHeight: 0, |
||||
|
imgList: [] |
||||
|
}, |
||||
|
/** |
||||
|
* 生命周期函数--监听页面加载 |
||||
|
*/ |
||||
|
onLoad: function (options) { |
||||
|
this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog') |
||||
|
this.setData({ hasStore: app.globalData.userInfo.hasStore }) |
||||
|
}, |
||||
|
onShow: function () { |
||||
|
wx.showLoading({ title: '加载中', mask: true }) |
||||
|
// get/store-overview
|
||||
|
getStoreOverView().then(result => { |
||||
|
//成功回调
|
||||
|
app.globalData.userInfo.hasStore = result.data.hasStore |
||||
|
this.setData({ form: result.data, hasStore: result.data.hasStore, status: result.data.status }) |
||||
|
this.data.status = result.data.status |
||||
|
if (this.data.hasStore && result.data.status != 2) { |
||||
|
this.showDialog() |
||||
|
} |
||||
|
if(this.data.form.storeId){ |
||||
|
getStoreInfo(this.data.form.storeId).then(res => { |
||||
|
this.setData({ detail: res.data, imgList: res.data.coverImgUrlList, imageHeight: math.divide(math.times(750, 9), 16)}) |
||||
|
wx.hideLoading() |
||||
|
}).catch(err => { |
||||
|
wx.hideLoading() |
||||
|
}) |
||||
|
} else { |
||||
|
wx.hideLoading() |
||||
|
} |
||||
|
}).catch(err => { |
||||
|
//异常回调
|
||||
|
wx.hideLoading() |
||||
|
}) |
||||
|
}, |
||||
|
showDialog: function(){ |
||||
|
this.wuxDialog.open({ |
||||
|
resetOnClose: true, |
||||
|
maskClosable: false, |
||||
|
title: '温馨提示', |
||||
|
content: '您还没有完善店铺信息,现在去善店铺信息?', |
||||
|
buttons: [{ |
||||
|
text: '取消' |
||||
|
}, { |
||||
|
text: '确定', |
||||
|
type: 'primary', |
||||
|
onTap(e) { |
||||
|
wx.navigateTo({ url: '/pages/shop/create/index' }) |
||||
|
} |
||||
|
}] |
||||
|
}) |
||||
|
}, |
||||
|
onClose: function(){ |
||||
|
this.setData({visible: false}) |
||||
|
}, |
||||
|
onImageClick: function(){ |
||||
|
this.setData({visible: false}) |
||||
|
wx.navigateTo({ url: '/pages/ztbvip/index' }) |
||||
|
}, |
||||
|
apllyShop: function(){ |
||||
|
if(!app.globalData.userInfo.isAuth){ |
||||
|
this.wuxDialog.open({ |
||||
|
resetOnClose: true, |
||||
|
title: '温馨提示', |
||||
|
content: '您还没有进行个人信息认证,无法开店,现在去进行个人信息认证?', |
||||
|
buttons: [{ |
||||
|
text: '确定', |
||||
|
type: 'primary', |
||||
|
onTap(e) { |
||||
|
wx.navigateTo({ url: '/pages/home/idcard/index' }) |
||||
|
} |
||||
|
}] |
||||
|
}) |
||||
|
return |
||||
|
} |
||||
|
if(!app.globalData.userInfo.isVIP){ |
||||
|
this.setData({visible: true}) |
||||
|
return |
||||
|
} |
||||
|
if (!app.globalData.userInfo.hasStore) { |
||||
|
if(this.data.form.status == 1){ |
||||
|
wx.navigateTo({ url: '/pages/shop/create/index' }) |
||||
|
} else { |
||||
|
wx.showLoading({ title: '加载中', mask: true }) |
||||
|
depositStore().then(result => { |
||||
|
//成功回调
|
||||
|
app.globalData.userInfo.hasStore = 1 |
||||
|
this.data.form.status == 1 |
||||
|
wx.hideLoading() |
||||
|
wx.navigateTo({ url: '/pages/shop/create/index' }) |
||||
|
}).catch(err => { |
||||
|
wx.hideLoading() |
||||
|
util.showToast(err) |
||||
|
}) |
||||
|
} |
||||
|
} else if(this.data.form.storeId){ |
||||
|
if(this.data.form.status == 2){ |
||||
|
wx.navigateTo({ url: '/pages/shop/detail/index?storeId=' + this.data.form.storeId }) |
||||
|
} else { |
||||
|
wx.navigateTo({ url: '/pages/shop/create/index' }) |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
onGridTap: function (e) { |
||||
|
if (!app.globalData.userInfo.hasStore) { |
||||
|
this.wuxDialog.open({ |
||||
|
resetOnClose: true, |
||||
|
maskClosable: false, |
||||
|
title: '温馨提示', |
||||
|
content: '您还没有开店,请先申请开店吧!', |
||||
|
buttons: [ { |
||||
|
text: '确定', |
||||
|
type: 'primary' |
||||
|
}] |
||||
|
}) |
||||
|
return |
||||
|
} |
||||
|
if (this.data.form.status != 2) { |
||||
|
this.showDialog() |
||||
|
return |
||||
|
} |
||||
|
var index = e.currentTarget.dataset.index |
||||
|
if (index === 0) { |
||||
|
wx.navigateTo({ url: '/pages/goods/create/index?type=1' }) |
||||
|
} else if (index === 1) { |
||||
|
wx.navigateTo({ url: '/pages/goods/create/index?type=2' }) |
||||
|
} else if (index === 2) { |
||||
|
wx.navigateTo({ url: '/pages/shop/bidding/index' }) |
||||
|
} else if (index === 3) { |
||||
|
wx.navigateTo({ url: '/pages/goods/index/index' }) |
||||
|
} else if (index === 4) { |
||||
|
wx.navigateTo({ url: '/pages/shop/order/index?storeId=' + this.data.form.storeId }) |
||||
|
} else if (index === 5) { |
||||
|
wx.navigateTo({ url: '/pages/shop/create/index?storeId=' + this.data.form.storeId }) |
||||
|
} else if (index === 6) { |
||||
|
wx.navigateTo({ url: '/pages/shop/bill/index' }) |
||||
|
} else if (index === 7) { |
||||
|
wx.navigateTo({ url: '/submodel/pages/purchase/create/index' }) |
||||
|
} else if (index === 8) { |
||||
|
wx.navigateTo({ url: '/submodel/pages/purchase/index/index?storeId=' + this.data.form.storeId }) |
||||
|
} |
||||
|
}, |
||||
|
viewImage: function(e){ |
||||
|
wx.previewImage({ urls: this.data.imgList, current: e.currentTarget.dataset.url }); |
||||
|
}, |
||||
|
onShow: function () { |
||||
|
tdsdk.Page.onShow() |
||||
|
}, |
||||
|
onHide: function(){ |
||||
|
tdsdk.Page.onHide() |
||||
|
}, |
||||
|
onUnload: function () { |
||||
|
tdsdk.Page.onUnload() |
||||
|
} |
||||
|
|
||||
|
}) |
||||
@ -0,0 +1,10 @@ |
|||||
|
{ |
||||
|
"usingComponents": { |
||||
|
"wux-dialog": "/components/dialog/index", |
||||
|
"wux-button": "/components/button/index", |
||||
|
"wux-cell-group": "/components/cell-group/index", |
||||
|
"wux-cell": "/components/cell/index", |
||||
|
"wux-image": "/components/image/index", |
||||
|
"wux-popup": "/components/popup/index" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,81 @@ |
|||||
|
<!--pages/shop/index/index.wxml--> |
||||
|
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
||||
|
<view slot="content">我的店铺</view> |
||||
|
</cu-custom> |
||||
|
|
||||
|
<view wx:if="{{detail && status == 2}}"> |
||||
|
<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 class="info-layout" style="text-align:right"> |
||||
|
<view class="text-white text-df" style="line-height:50rpx;">店主昵称:{{detail.contacts}}({{detail.contactPhoneNo}})</view> |
||||
|
<view class="text-white text-df" style="line-height:50rpx;">店铺地址:{{detail.locDetails}}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="bg-white text-sg" style="padding: 0rpx 32rpx" wx:if="{{detail && status == 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 text-lg">{{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> |
||||
|
<view class="bg-white" style="padding:32rpx;" wx:else> |
||||
|
<wux-button block type="positive" bind:click="apllyShop">{{ hasStore ? (status == 2 ? '我的店铺' : '完善店铺') : '申请开店' }}</wux-button> |
||||
|
</view> |
||||
|
|
||||
|
<view class="cu-list grid col-4 no-border {{(detail && status == 2) ? '' : ''}}"> |
||||
|
<view class="cu-item" wx:for="{{iconList}}" wx:key="index" data-index="{{item.index}}" bindtap="onGridTap"> |
||||
|
<view class="cuIcon-{{item.icon}} text-{{item.color}}" style="font-size:32px"> |
||||
|
<view class="cu-tag badge" wx:if="{{item.badge!=0}}"> |
||||
|
<block wx:if="{{item.badge!=1}}">{{item.badge>99?"99+":item.badge}}</block> |
||||
|
</view> |
||||
|
</view> |
||||
|
<text>{{item.name}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<view style="height:18rpx"></view> |
||||
|
<wux-cell-group> |
||||
|
<wux-cell title="店铺账单" is-link data-index="{{6}}" bind:click="onGridTap"> |
||||
|
<view slot="header" class="cuIcon-recharge text-black" style="font-size:20px;margin-right:12rpx"></view> |
||||
|
<text slot="footer" style="padding-top:4px">¥{{form.todayMargin || 0}}</text> |
||||
|
</wux-cell> |
||||
|
<wux-cell title="店铺订单" is-link data-index="{{4}}" bind:click="onGridTap"> |
||||
|
<view slot="header" class="cuIcon-text text-black" style="font-size:20px;margin-right:12rpx"></view> |
||||
|
</wux-cell> |
||||
|
<wux-cell title="商品管理" is-link data-index="{{3}}" bind:click="onGridTap"> |
||||
|
<view slot="header" class="cuIcon-form text-black" style="font-size:20px;margin-right:12rpx"></view> |
||||
|
</wux-cell> |
||||
|
<wux-cell title="竞价管理" is-link data-index="{{2}}" bind:click="onGridTap"> |
||||
|
<view slot="header" class="cuIcon-form text-black" style="font-size:20px;margin-right:12rpx"></view> |
||||
|
</wux-cell> |
||||
|
<wux-cell title="采购管理" is-link data-index="{{8}}" bind:click="onGridTap"> |
||||
|
<view slot="header" class="cuIcon-form text-black" style="font-size:20px;margin-right:12rpx"></view> |
||||
|
</wux-cell> |
||||
|
</wux-cell-group> |
||||
|
<view style="height:18rpx"></view> |
||||
|
|
||||
|
<wux-dialog id="wux-dialog" /> |
||||
|
<wux-popup wux-class="wux-landscape" wux-content-class="wux-landscape__popup" wux-body-class="wux-landscape__popup-body" |
||||
|
hasHeader="{{ false }}" hasFooter="{{ false }}" visible="{{ visible }}" mask="{{ true }}" bind:close="onClose"> |
||||
|
<view class="wux-close" bindtap="onClose"> |
||||
|
<text class="cuIcon-roundclose text-white" style="font-size:64rpx"></text> |
||||
|
</view> |
||||
|
<view class="wux-landscape__inner"> |
||||
|
<wux-image width="{{604}}" height="{{806}}" nuit="{{'rpx'}}" src="/assets/popup/need-member.png" bind:click="onImageClick"> |
||||
|
<view class="flex flex-center" slot="loading" style="height:654rpx;width:680rpx"> |
||||
|
<text class="icon--refresher"></text> |
||||
|
</view> |
||||
|
</wux-image> |
||||
|
</view> |
||||
|
</wux-popup> |
||||
@ -0,0 +1,18 @@ |
|||||
|
/* pages/shop/index/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; |
||||
|
} |
||||
@ -0,0 +1,118 @@ |
|||||
|
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) |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,8 @@ |
|||||
|
{ |
||||
|
"usingComponents": { |
||||
|
"refresh-view": "/components/refresher/index", |
||||
|
"wux-tabi": "/components/tabi/index", |
||||
|
"wux-image": "/components/image/index", |
||||
|
"wux-divider": "/components/divider/index" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,67 @@ |
|||||
|
<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> |
||||
@ -0,0 +1,50 @@ |
|||||
|
.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; |
||||
|
} |
||||
@ -0,0 +1,40 @@ |
|||||
|
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