47 changed files with 145 additions and 1784 deletions
Split View
Diff Options
-
2app.js
-
8app.json
-
83pages/agent/address/index.js
-
6pages/agent/address/index.json
-
32pages/agent/address/index.wxml
-
12pages/agent/address/index.wxss
-
6pages/api/saas.js
-
26pages/balance/detail/index.js
-
3pages/balance/detail/index.json
-
48pages/balance/detail/index.wxml
-
1pages/balance/detail/index.wxss
-
70pages/balance/fragment/index.js
-
6pages/balance/fragment/index.json
-
20pages/balance/fragment/index.wxml
-
4pages/balance/fragment/index.wxss
-
38pages/balance/index/index.js
-
6pages/balance/index/index.json
-
16pages/balance/index/index.wxml
-
1pages/balance/index/index.wxss
-
19pages/home/authory/index.js
-
7pages/home/authory/index.wxml
-
2pages/home/pauthory/index.wxss
-
119pages/home/pindex/index.js
-
9pages/home/pindex/index.json
-
54pages/home/pindex/index.wxml
-
63pages/home/pindex/index.wxss
-
340pages/home/pinfo/index.js
-
9pages/home/pinfo/index.json
-
40pages/home/pinfo/index.wxml
-
1pages/home/pinfo/index.wxss
-
8pages/home/setting/index.js
-
19pages/index/index.js
-
176pages/order/detail/index.js
-
10pages/order/detail/index.json
-
174pages/order/detail/index.wxml
-
110pages/order/detail/index.wxss
-
120pages/order/index/index.js
-
9pages/order/index/index.json
-
58pages/order/index/index.wxml
-
60pages/order/index/index.wxss
-
62pages/order/order.wxs
-
26pages/paper/index.js
-
7pages/paper/index.json
-
14pages/paper/index.wxml
-
23pages/paper/index.wxs
-
0pages/paper/index.wxss
-
2project.config.json
@ -0,0 +1,83 @@ |
|||
// pages/shop/apply/index.js
|
|||
import { createAddress } from "../../api/ztb" |
|||
const util = require('../../../utils/util') |
|||
import regions from '../../../utils/region' |
|||
const app = getApp() |
|||
|
|||
Page({ |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
safeBottom: app.globalData.safeBottom, |
|||
options: regions, |
|||
region: [], |
|||
form: { |
|||
receiver:'', |
|||
phone:'', |
|||
details:'', |
|||
isDefault:'', |
|||
locProvinceId: '', |
|||
locCityId: '', |
|||
districtId: '' |
|||
}, |
|||
requesting: false |
|||
}, |
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
this.cascaderView = this.cascaderView || this.selectComponent('#wux-cascader') |
|||
this.setData({ safeBottom: app.globalData.safeBottom }) |
|||
}, |
|||
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['districtId'] = e.detail.value[2] |
|||
} |
|||
}, |
|||
submitForm: function(){ |
|||
if(util.isEmpty(this.data.form.receiver)){ |
|||
util.showToast('请输入收货人') |
|||
return |
|||
} |
|||
if(util.isEmpty(this.data.form.phone)){ |
|||
util.showToast('请输入手机号') |
|||
return |
|||
} |
|||
if(util.isEmpty(this.data.form.districtId)){ |
|||
util.showToast('请选择店铺所在区域') |
|||
return |
|||
} |
|||
if(util.isEmpty(this.data.form.details)){ |
|||
util.showToast('请输入店铺详细地址') |
|||
return |
|||
} |
|||
if(util.isEmpty(this.data.form.isDefault)){ |
|||
util.showToast('请确定是否默认') |
|||
return |
|||
} |
|||
wx.showLoading({ title: '处理中', mask: true }) |
|||
createAddress(this.data.form).then(res => { |
|||
wx.hideLoading() |
|||
util.showBackToast('新增地址成功') |
|||
}).catch(err => { |
|||
wx.hideLoading() |
|||
util.showToast(err) |
|||
}) |
|||
} |
|||
}) |
|||
@ -0,0 +1,6 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"wux-button": "/components/button/index", |
|||
"wux-cascader": "/components/cascader/index" |
|||
} |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
<!--pages/adress/create/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="receiver" placeholder-style="color:#aaa" placeholder="请输入工厂全称" value="{{form.receiver}}" 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"></text> |
|||
</view> |
|||
<view class="cu-form-group" style="border-top: 1rpx solid #f3f3f3"> |
|||
<view class="title">详细地址:</view> |
|||
<input id="details" placeholder-style="color:#aaa" placeholder="请输入详细地址" value="{{form.details}}" bindinput="bindinput"></input> |
|||
</view> |
|||
<view class="cu-form-group"> |
|||
<view class="title">发货人姓名:</view> |
|||
<input id="phone" placeholder-style="color:#aaa" placeholder="请输入发货人姓名" value="{{form.phone}}" bindinput="bindinput"></input> |
|||
</view> |
|||
|
|||
|
|||
<view class="cu-bar bg-white foot" style="height:{{120 + safeBottom}}rpx;padding: 32rpx 32rpx {{safeBottom + 32}}rpx 32rpx;"> |
|||
<view style="width:100%"> |
|||
<wux-button block type="positive" bind:click="submitForm" disabled="{{requesting}}">提交</wux-button> |
|||
</view> |
|||
</view> |
|||
|
|||
<wux-cascader id="wux-cascader" value="{{region}}" options="{{ options }}" bind:close="onRegionChange" /> |
|||
@ -0,0 +1,12 @@ |
|||
/* pages/adress/create/index.wxss */ |
|||
.margin-top{ |
|||
margin-top: 16rpx; |
|||
} |
|||
|
|||
.page-btn { |
|||
height: 27px; |
|||
background: rgba(255, 66, 43, 1); |
|||
box-shadow: 0px 4px 14px -6px rgba(255, 43, 45, 0.8); |
|||
color: white; |
|||
font-size: 32rpx; |
|||
} |
|||
@ -1,26 +0,0 @@ |
|||
// pages/balance/detail/index.js
|
|||
import { getFinanceLog } from "../../api/saas" |
|||
const util = require('../../../utils/util') |
|||
|
|||
Page({ |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
dataDetails: null |
|||
}, |
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
wx.showLoading({ title: '加载中', mask: true }) |
|||
getFinanceLog(options.id).then(result => { |
|||
this.setData({ dataDetails: result.data, type: Number(options.type) }) |
|||
wx.hideLoading() |
|||
}).catch(err => { |
|||
wx.hideLoading() |
|||
util.showToast(err) |
|||
}) |
|||
} |
|||
|
|||
}) |
|||
@ -1,3 +0,0 @@ |
|||
{ |
|||
"usingComponents": {} |
|||
} |
|||
@ -1,48 +0,0 @@ |
|||
<!--pages/balance/detail/index.wxml--> |
|||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">{{type == 0 ? '收入详细' : '支出详细'}}</view> |
|||
</cu-custom> |
|||
|
|||
<view wx:if="{{dataDetails}}" style="margin-top:24rpx"> |
|||
<view class="cu-form-group"> |
|||
<view class="content"> |
|||
<text class="text-black ">流水号</text> |
|||
</view> |
|||
<view class="action"> |
|||
<text class="text-grey text-sm">{{dataDetails.tradeSn}}</text> |
|||
</view> |
|||
</view> |
|||
<view class="cu-form-group"> |
|||
<view class="content"> |
|||
<text class="text-black ">类型</text> |
|||
</view> |
|||
<view class="action"> |
|||
<text class="text-grey text-sm">{{dataDetails.operTypeStr}}</text> |
|||
</view> |
|||
</view> |
|||
<view class="cu-form-group"> |
|||
<view class="content"> |
|||
<text class="text-black ">{{type == 0 ? '收入' : '支出'}}</text> |
|||
</view> |
|||
<view class="action"> |
|||
<text class="text-grey text-sm">{{formate.formateMoney(dataDetails.money)}}</text> |
|||
</view> |
|||
</view> |
|||
<view class="cu-form-group"> |
|||
<view class="content"> |
|||
<text class="text-black ">时间</text> |
|||
</view> |
|||
<view class="action"> |
|||
<text class="text-grey text-sm">{{dataDetails.createTime}}</text> |
|||
</view> |
|||
</view> |
|||
<view class="cu-form-group"> |
|||
<view class="content"> |
|||
<text class="text-black ">余额</text> |
|||
</view> |
|||
<view class="action"> |
|||
<text class="text-grey text-sm">{{formate.formateMoney(dataDetails.remainMoney)}}</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
@ -1 +0,0 @@ |
|||
/* pages/balance/detail/index.wxss */ |
|||
@ -1,70 +0,0 @@ |
|||
// pages/balance/fragment/index.js
|
|||
import { getFinanceList } from "../../api/saas" |
|||
const util = require('../../../utils/util') |
|||
|
|||
Component({ |
|||
options: { |
|||
addGlobalClass: true, |
|||
multipleSlots: true |
|||
}, |
|||
properties: { |
|||
direction: { type: Number, value: 0 }, |
|||
height: { type: Number, value: 0 } |
|||
}, |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
firstShow: false, |
|||
finished: false, |
|||
requesting: false, |
|||
taskList: [], |
|||
form: { |
|||
pageSize: 10, |
|||
pageNum: 1, |
|||
direction: null, |
|||
pageSize:15 |
|||
} |
|||
}, |
|||
methods: { |
|||
onRestart: function () { |
|||
if (!this.data.firstShow) { |
|||
this.fetchList() |
|||
this.data.firstShow = true |
|||
} |
|||
}, |
|||
fetchList: function () { |
|||
if (this.data.requesting || this.data.finished) { |
|||
return |
|||
} |
|||
this.data.form.direction = this.data.direction |
|||
this.data.requesting = true |
|||
wx.showLoading({ title: '加载中', mask: true }) |
|||
getFinanceList(this.data.form).then(result => { |
|||
this.setData({ requesting: false, loading: false }) |
|||
if (result.data.records.length) { |
|||
var respList = result.data.records |
|||
let nowList = `taskList[${this.data.taskList.length}]` |
|||
var num = this.data.form.pageNum |
|||
var finished = this.data.form.pageNum >= result.data.pages |
|||
this.setData({ |
|||
[nowList]: respList, |
|||
total: result.data.total, |
|||
['form.pageNum']: (num + 1), |
|||
finished |
|||
}) |
|||
} else { |
|||
this.setData({ finished: true }) |
|||
} |
|||
wx.hideLoading() |
|||
}).catch(err => { |
|||
this.setData({ requesting: false, loading: false }) |
|||
wx.hideLoading() |
|||
util.showToast(err) |
|||
}) |
|||
}, |
|||
lookItem: function(e){ |
|||
wx.navigateTo({ url: '/pages/balance/detail/index?id=' + e.currentTarget.id + '&type=' + this.data.direction }) |
|||
} |
|||
} |
|||
}) |
|||
@ -1,6 +0,0 @@ |
|||
{ |
|||
"component": true, |
|||
"usingComponents": { |
|||
|
|||
} |
|||
} |
|||
@ -1,20 +0,0 @@ |
|||
<!--pages/balance/fragment/index.wxml--> |
|||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|||
<view class="list-empty" wx:if="{{!taskList.length}}" style="height:{{height}}rpx"> |
|||
<image class="img-empty" src="/assets/image/list_empty.png"></image> |
|||
<view class="text-empty">暂无数据</view> |
|||
</view> |
|||
<scroll-view wx:else scroll-y style="height: {{height}}rpx;" class="nav margin-top-sm" bindscrolltolower="fetchList"> |
|||
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{taskList}}" wx:key="pageIndex"> |
|||
<view class="bg-white col-1 padding" bindtap="lookItem" wx:for="{{pageItem}}" wx:key="index" id="{{item.id}}"> |
|||
<view class="flex flex-justify"> |
|||
<view class="text-sm text-black text-bold">{{item.operTypeStr}}</view> |
|||
<view><text class="text-gray text-sm">{{item.createTime}}</text></view> |
|||
</view> |
|||
<view class="flex flex-justify" style="margin-top:8rpx"> |
|||
<view class="text-sm text-bold">余额:{{formate.formateMoney(item.remainMoney)}}元</view> |
|||
<view><text class="text-sm text-black text-bold">{{formate.formateMoney(item.money)}}元</text></view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
@ -1,4 +0,0 @@ |
|||
/* pages/balance/fragment/index.wxss */ |
|||
.padding{ |
|||
padding: 18rpx 30rpx; |
|||
} |
|||
@ -1,38 +0,0 @@ |
|||
// pages/balance/index/index.js
|
|||
const app = getApp() |
|||
|
|||
Page({ |
|||
data: { |
|||
height: app.globalData.fragmentHeight, |
|||
CustomBar: 0, |
|||
tabList:['收入', '支出'], |
|||
tabIndex: 0 |
|||
}, |
|||
onLoad: function (options) { |
|||
this.setData({ height: app.globalData.fragmentHeight - 100, CustomBar: app.globalData.CustomBar }) |
|||
}, |
|||
onReady: function(){ |
|||
this.pageResume() |
|||
}, |
|||
onTabChange: function({detail}) { |
|||
if(this.data.tabIndex == Number(detail.index)){ |
|||
return |
|||
} |
|||
this.setData({tabIndex: Number(detail.index)}) |
|||
this.pageResume() |
|||
}, |
|||
onSwiperChange: function(e){ |
|||
const { current: index, source } = e.detail |
|||
if (!!source) { |
|||
this.setData({tabIndex: index}) |
|||
} |
|||
this.pageResume() |
|||
}, |
|||
pageResume: function (e) { |
|||
var pageView = this.selectComponent('#fragment' + this.data.tabIndex) |
|||
if (pageView) { |
|||
pageView.onRestart() |
|||
} |
|||
} |
|||
|
|||
}) |
|||
@ -1,6 +0,0 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"wux-tabi": "/components/tabi/index", |
|||
"fragment": "/pages/balance/fragment/index" |
|||
} |
|||
} |
|||
@ -1,16 +0,0 @@ |
|||
<!--pages/balance/index/index.wxml--> |
|||
<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:80rpx;width:100%"></view> |
|||
|
|||
<swiper current="{{tabIndex}}" bindchange="onSwiperChange" style="height:{{height}}rpx"> |
|||
<swiper-item wx:for="{{2}}" wx:key="index"> |
|||
<fragment id="fragment{{index}}" height="{{height}}" direction="{{index}}"/> |
|||
</swiper-item> |
|||
</swiper> |
|||
@ -1 +0,0 @@ |
|||
/* pages/balance/index/index.wxss */ |
|||
@ -1,119 +0,0 @@ |
|||
// pages/stock/index.js
|
|||
import { getBaseInfo, getBalanceInfo } from "../../api/saas" |
|||
const util = require('../../../utils/util') |
|||
const math = require('../../../utils/math') |
|||
const event = require('../../../utils/event') |
|||
const app = getApp() |
|||
|
|||
Component({ |
|||
options: { |
|||
addGlobalClass: true, |
|||
multipleSlots: true |
|||
}, |
|||
lifetimes: { |
|||
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|||
attached: function () { |
|||
event.on('EventMessage', this, this.onEvent) |
|||
}, |
|||
detached: function () { |
|||
event.remove('EventMessage', this) |
|||
} |
|||
}, |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
firstShow: false, |
|||
token: app.globalData.token, |
|||
userInfo: null, |
|||
userName: null, |
|||
avatarUrl: null, |
|||
accountMoney: 0 |
|||
}, |
|||
methods: { |
|||
onRestart: function () { |
|||
this.fetchUserInfo() |
|||
this.data.firstShow = true |
|||
}, |
|||
fetchUserInfo: function () { |
|||
if(!app.globalData.userInfo){ |
|||
return |
|||
} |
|||
getBaseInfo().then(result => { |
|||
app.globalData.userInfo = result.data |
|||
this.setData({ |
|||
avatarUrl: util.isEmpty(app.globalData.userInfo.avatar) ? '/assets/image/ygImg.png' : app.globalData.userInfo.avatar, |
|||
userInfo: app.globalData.userInfo, |
|||
userName: util.isEmpty(app.globalData.userInfo.userName) ? '' : app.globalData.userInfo.userName.substring(0, 14) |
|||
}) |
|||
}).catch((e) => { |
|||
}) |
|||
getBalanceInfo().then(res => { |
|||
this.setData({ accountMoney: math.minus(res.data.accountMoney, res.data.frozenMoney) }) |
|||
}).catch(err => { |
|||
}) |
|||
}, |
|||
onEvent: function (message) { |
|||
if (message.what == 888) { |
|||
this.setData({ userInfo: app.globalData.userInfo, accountMoney: 0, avatarUrl: '/assets/image/ygImg.png', userName: null }) |
|||
} |
|||
}, |
|||
checkout: function () { |
|||
if(!app.globalData.userInfo){ |
|||
wx.navigateTo({ url: '/pages/login/index' }) |
|||
return |
|||
} |
|||
wx.navigateTo({ url: '/pages/withdrawal/checkout/index' }) |
|||
}, |
|||
toUserInfo: function () { |
|||
if(!app.globalData.userInfo){ |
|||
wx.navigateTo({ url: '/pages/login/index' }) |
|||
return |
|||
} |
|||
if(app.globalData.userInfo.isAuth != 1 && app.globalData.userInfo.userType == 1){ |
|||
wx.navigateTo({ url: '/pages/home/pauthory/index' }) |
|||
} else { |
|||
wx.navigateTo({ url: '/pages/home/pinfo/index' }) |
|||
} |
|||
}, |
|||
toAuthor: function () { |
|||
if(!app.globalData.userInfo){ |
|||
wx.navigateTo({ url: '/pages/login/index' }) |
|||
return |
|||
} |
|||
if(app.globalData.userInfo.isAuth != 1 && app.globalData.userInfo.userType == 1){ |
|||
wx.navigateTo({ url: '/pages/home/pauthory/index' }) |
|||
} else { |
|||
wx.navigateTo({ url: '/pages/home/pinfo/index' }) |
|||
} |
|||
}, |
|||
toBankCard: function () { |
|||
if(!app.globalData.userInfo){ |
|||
wx.navigateTo({ url: '/pages/login/index' }) |
|||
return |
|||
} |
|||
wx.navigateTo({ url: '/pages/bank/index/index' }) |
|||
}, |
|||
toWithdrawal: function () { |
|||
if(!app.globalData.userInfo){ |
|||
wx.navigateTo({ url: '/pages/login/index' }) |
|||
return |
|||
} |
|||
wx.navigateTo({ url: '/pages/withdrawal/index/index' }) |
|||
}, |
|||
toBalance: function () { |
|||
if(!app.globalData.userInfo){ |
|||
wx.navigateTo({ url: '/pages/login/index' }) |
|||
return |
|||
} |
|||
wx.navigateTo({ url: '/pages/balance/index/index' }) |
|||
}, |
|||
toSetting: function () { |
|||
if(!app.globalData.userInfo){ |
|||
wx.navigateTo({ url: '/pages/login/index' }) |
|||
return |
|||
} |
|||
wx.navigateTo({ url: '/pages/home/setting/index' }) |
|||
} |
|||
} |
|||
}) |
|||
@ -1,9 +0,0 @@ |
|||
{ |
|||
"component": true, |
|||
"usingComponents": { |
|||
"wux-button": "/components/button/index", |
|||
"wux-image": "/components/image/index", |
|||
"wux-cell-group": "/components/cell-group/index", |
|||
"wux-cell": "/components/cell/index" |
|||
} |
|||
} |
|||
@ -1,54 +0,0 @@ |
|||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{false}}"> |
|||
<view slot="content" style="color:black;font-size:18px">我的</view> |
|||
</cu-custom> |
|||
|
|||
<view class="header-box flex flex-justify" style="padding:32rpx" bindtap="toUserInfo"> |
|||
<view class="flex"> |
|||
<wux-image width="{{60}}" height="{{60}}" wux-class="image" shape="circle" src="{{avatarUrl}}" /> |
|||
<view class="flex flex-column flex-center" style="margin-left:24rpx;align-items:flex-start"> |
|||
<view class="flex flex-center"> |
|||
<text style="white-space: nowrap">{{userName || '您还没有登录,去登录'}}</text> |
|||
</view> |
|||
<view class="flex flex-center" style="font-size:13px" catchtap="toAuthor" wx:if="{{userInfo}}"> |
|||
<image class="img-auth2" src="{{userInfo.isAuth == 1 ? '/assets/image/icon_author.png' : '/assets/image/icon_unauthor.png'}}"></image> |
|||
<text class="{{userInfo.isAuth == 1 ? 'text-blue' : 'text-gray'}}">{{userInfo.isAuth == 1 ? '已认证' : '未实名认证'}}</text> |
|||
<text class="text-yellow" style="font-size:14px;padding:4px;" wx:if="{{userInfo.isAuth != 1 && userInfo.userType == 1}}">去认证</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<text class="cuIcon-right text-gray" style="font-size:18px"></text> |
|||
</view> |
|||
|
|||
<view style="padding:32rpx"> |
|||
<view class="account-bg flex flex-justify" style="padding:32rpx"> |
|||
<view> |
|||
<view class="money">¥{{formate.numberFormat2(accountMoney)}}</view> |
|||
<view class="label">账户余额(元)</view> |
|||
</view> |
|||
<view style="width:160rpx"> |
|||
<wux-button block outline size="small" type="light" bind:click="checkout">立即提现</wux-button> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<wux-cell-group> |
|||
<wux-cell title="银行卡" is-link bind:click="toBankCard"> |
|||
<image slot="header" style="width:32rpx;height:32rpx;margin:12rpx 12rpx 0rpx 0rpx" src="/assets/image/icon_bank.png"></image> |
|||
</wux-cell> |
|||
<wux-cell title="提现记录" is-link bind:click="toWithdrawal"> |
|||
<image slot="header" style="width:32rpx;height:32rpx;margin:12rpx 12rpx 0rpx 0rpx" src="/assets/image/icon_withdrawal.png"></image> |
|||
</wux-cell> |
|||
<wux-cell title="收支明细" is-link bind:click="toBalance"> |
|||
<image slot="header" style="width:32rpx;height:32rpx;margin:12rpx 12rpx 0rpx 0rpx" src="/assets/image/icon_balance.png"></image> |
|||
</wux-cell> |
|||
</wux-cell-group> |
|||
<view style="height:32rpx"></view> |
|||
<wux-cell-group> |
|||
<wux-cell title="联系客服" is-link url="/pages/home/service/index"> |
|||
<image slot="header" style="width:32rpx;height:32rpx;margin:12rpx 12rpx 0rpx 0rpx" src="/assets/image/icon_kefu.png"></image> |
|||
</wux-cell> |
|||
<wux-cell title="设置" is-link bind:click="toSetting"> |
|||
<image slot="header" style="width:32rpx;height:32rpx;margin:12rpx 12rpx 0rpx 0rpx" src="/assets/image/icon_setting.png"></image> |
|||
</wux-cell> |
|||
</wux-cell-group> |
|||
@ -1,63 +0,0 @@ |
|||
/* pages/home/index.wxss */ |
|||
|
|||
.header-bg { |
|||
margin-top: 0px; |
|||
width: 100%; |
|||
height: 80px; |
|||
background: linear-gradient(314deg, rgba(50, 107, 250, 1) 0%, rgba(0, 138, 255, 1) 100%); |
|||
border-bottom-left-radius: 64rpx; |
|||
border-bottom-right-radius: 64rpx; |
|||
} |
|||
|
|||
.header-box { |
|||
width: 100%; |
|||
background: rgba(255, 255, 255, 1); |
|||
/* box-shadow: 0px 0px 15px -6px rgba(0, 0, 0, 0.32); |
|||
border-radius: 6px; */ |
|||
} |
|||
|
|||
.userinfo-avatar { |
|||
overflow: hidden; |
|||
width: 120rpx; |
|||
height: 120rpx; |
|||
border-radius: 12rpx; |
|||
border: 2px solid #fff; |
|||
box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2); |
|||
} |
|||
|
|||
.account-bg { |
|||
background: linear-gradient(314deg, rgba(50, 107, 250, 1) 0%, rgba(0, 138, 255, 1) 100%); |
|||
border-radius: 6px; |
|||
} |
|||
|
|||
.money { |
|||
font-size: 44rpx; |
|||
font-family: SFProDisplay-Semibold, SFProDisplay; |
|||
font-weight: 600; |
|||
color: rgba(255, 255, 255, 1); |
|||
} |
|||
|
|||
.label { |
|||
font-size: 24rpx; |
|||
font-family: PingFang-SC-Regular, PingFang-SC; |
|||
font-weight: 400; |
|||
color: rgba(255, 255, 255, 1); |
|||
} |
|||
|
|||
.img-auth { |
|||
width: 32rpx; |
|||
height: 32rpx; |
|||
margin-left: 24rpx; |
|||
margin-right: 12rpx |
|||
} |
|||
|
|||
.img-auth2 { |
|||
width: 32rpx; |
|||
height: 32rpx; |
|||
margin-right: 12rpx |
|||
} |
|||
|
|||
.realName { |
|||
max-width: 100px; |
|||
white-space: nowrap; |
|||
} |
|||
@ -1,340 +0,0 @@ |
|||
import { getBaseInfo, updateUserInfo, getTrades } from "../../api/saas" |
|||
const util = require('../../../utils/util') |
|||
const event = require('../../../utils/event') |
|||
const app = getApp() |
|||
|
|||
Page({ |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
backStatus: true, |
|||
nickName: '', //用户昵称
|
|||
avatarUrl: '', //用户头像
|
|||
banckCardList: [{ |
|||
id: 1, |
|||
name: '个体回收户' |
|||
}, { |
|||
id: 2, |
|||
name: '打包站' |
|||
}, { |
|||
id: 3, |
|||
name: '废品站' |
|||
}, { |
|||
id: 4, |
|||
name: '印刷' |
|||
}, { |
|||
id: 6, |
|||
name: '包装厂' |
|||
}, { |
|||
id: 7, |
|||
name: '纸箱纸板厂' |
|||
}, { |
|||
id: 8, |
|||
name: '后加工' |
|||
}, { |
|||
id: 5, |
|||
name: '其他' |
|||
}], |
|||
cardList: [ |
|||
{ value: '1', text: '个体回收户' }, |
|||
{ value: '2', text: '打包站' }, |
|||
{ value: '3', text: '废品站' }, |
|||
{ value: '4', text: '印刷' }, |
|||
{ value: '6', text: '包装厂' }, |
|||
{ value: '7', text: '纸箱纸板厂' }, |
|||
{ value: '8', text: '后加工' }, |
|||
{ value: '5', text: '其他' } |
|||
], |
|||
modalName: null, |
|||
identity: '', |
|||
identityStr: '', |
|||
licenseUrl: '', |
|||
userType: 1 |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
this.setData({ |
|||
isRequesting: false |
|||
}) |
|||
event.on('EventMessage', this, this.onEvent) |
|||
this.pickerView = this.pickerView || this.selectComponent('#picker-view') |
|||
this.getUserInfoData() |
|||
}, |
|||
onEvent: function (message) { |
|||
if (message.what == 103) { |
|||
this.getUserInfoData() |
|||
} |
|||
}, |
|||
showPicker: function () { |
|||
this.pickerView.showPicker(this.data.cardList, this.data.identity.toString(), 0) |
|||
}, |
|||
onPickerChange: function (e) { |
|||
getTrades({ identity: e.detail.value }).then(res => { |
|||
if (res.code == 0) { |
|||
this.setData({ identity: e.detail.value, identityStr: e.detail.text }) |
|||
util.showToast('修改身份成功!') |
|||
} else { |
|||
util.showToast('修改身份失败') |
|||
} |
|||
}) |
|||
}, |
|||
getUserInfoData: function () { |
|||
getBaseInfo().then(res => { |
|||
var identityStr = '' |
|||
for (var i = 0; i < this.data.cardList.length; i++) { |
|||
if (parseInt(this.data.cardList[i].value) == parseInt(res.data.identity)) { |
|||
identityStr = this.data.cardList[i].text |
|||
break |
|||
} |
|||
} |
|||
this.setData({ |
|||
nickName: res.data.nickName, |
|||
avatarUrl: res.data.avatar || '/assets/image/ygImg.png', |
|||
linkman: res.data.nickName, |
|||
linkPhone: res.data.mobile, |
|||
companyAddress: res.data.fullAddress, |
|||
identity: res.data.identity, |
|||
userType: res.data.userType, |
|||
identityStr: identityStr, |
|||
realName:res.data.realName || res.data.userName, |
|||
licenseUrl: res.data.businessLicenseList |
|||
}) |
|||
if (res.data.linkman == '' || res.data.linkPhone == '' || res.data.companyAddress == '' || res.data.identity == '') { |
|||
this.setData({ |
|||
backStatus: false |
|||
}) |
|||
} else { |
|||
this.setData({ |
|||
backStatus: true |
|||
}) |
|||
|
|||
} |
|||
}) |
|||
}, |
|||
//通过事件执行更换头像方法比如点击头像执行该方法
|
|||
updatahead() { |
|||
var that = this; |
|||
wx.chooseImage({ |
|||
count: 1, // 默认9
|
|||
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
|||
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
|||
success: function (res) { |
|||
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
|
|||
var imgPaths = res.tempFilePaths |
|||
that.updataheadservice(imgPaths[0]); |
|||
} |
|||
}) |
|||
}, |
|||
//通过事件执行更换执照方法比如点击头像执行该方法
|
|||
updatalicenseUrl() { |
|||
var that = this; |
|||
wx.chooseImage({ |
|||
count: 1, // 默认9
|
|||
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
|||
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
|||
success: function (res) { |
|||
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
|
|||
var imgPaths = res.tempFilePaths |
|||
that.updataheadservice2(imgPaths[0]); |
|||
} |
|||
}) |
|||
}, |
|||
//上传图片
|
|||
updataheadservice(imgPaths) { |
|||
var that = this; |
|||
wx.uploadFile({ |
|||
header: { |
|||
'user-token': app.globalData.SessionId |
|||
}, |
|||
url: app.apiHttp + '/saas-user/utils/uploadImage', //你的服务器地址
|
|||
filePath: imgPaths, //要上传文件资源的路径
|
|||
name: 'image', //文件对应的 key,开发者在服务端可以通过这个 key 获取文件的二进制内容
|
|||
formData: { |
|||
adminid: app.globalData.adminid //HTTP 请求中其他额外的参数比如 用户id
|
|||
}, |
|||
success(res) { |
|||
var jsonStr = res.data; |
|||
jsonStr = jsonStr.replace(" ", ""); |
|||
if (typeof jsonStr != 'object') { |
|||
jsonStr = jsonStr.replace(/\ufeff/g, ""); //重点
|
|||
var jj = JSON.parse(jsonStr); |
|||
res.data = jj; |
|||
} |
|||
that.setData({ |
|||
avatarUrl: res.data.data |
|||
}) |
|||
that.preservationheadimg(res.data.data) |
|||
} |
|||
}) |
|||
}, |
|||
//上传执照
|
|||
updataheadservice2(imgPaths) { |
|||
var that = this; |
|||
wx.uploadFile({ |
|||
header: { 'user-token': app.globalData.userToken }, |
|||
url: app.apiHttp + '/saas-user/utils/uploadImage', //你的服务器地址
|
|||
filePath: imgPaths, //要上传文件资源的路径
|
|||
name: 'image', //文件对应的 key,开发者在服务端可以通过这个 key 获取文件的二进制内容
|
|||
formData: { |
|||
adminid: app.globalData.adminid //HTTP 请求中其他额外的参数比如 用户id
|
|||
}, |
|||
success(res) { |
|||
var jsonStr = res.data; |
|||
jsonStr = jsonStr.replace(" ", ""); |
|||
if (typeof jsonStr != 'object') { |
|||
jsonStr = jsonStr.replace(/\ufeff/g, ""); //重点
|
|||
var jj = JSON.parse(jsonStr); |
|||
res.data = jj; |
|||
} |
|||
that.setData({ |
|||
licenseUrl: res.data.data |
|||
}) |
|||
that.preservationheadimg2(res.data.data) |
|||
} |
|||
}) |
|||
}, |
|||
//保存用户头像
|
|||
preservationheadimg(imgUrl) { |
|||
updateUserInfo({ avatarUrl: imgUrl, nickName: this.data.nickName }).then(res => { |
|||
if (res.code == 0) { |
|||
util.showToast('修改头像成功!') |
|||
this.getUserInfoData() |
|||
} else { |
|||
util.showToast('头像上传失败') |
|||
} |
|||
}) |
|||
}, |
|||
//保存用户执照
|
|||
preservationheadimg2(imgUrl) { |
|||
updateUserInfo({ licenseUrl: this.data.licenseUrl }).then(res => { |
|||
if (res.code == 0) { |
|||
util.showToast('修改执照成功!') |
|||
this.getUserInfoData() |
|||
} else { |
|||
util.showToast('执照上传失败') |
|||
} |
|||
}) |
|||
}, |
|||
bindAndSet(e) { |
|||
let key = e.currentTarget.dataset.name |
|||
this.setData({ [key]: e.detail.value }) |
|||
}, |
|||
inputBlur(e) { |
|||
if (e.target.dataset.name == "nickName") { |
|||
if (this.data.nickName == '') { |
|||
util.showToast('请填写昵称') |
|||
this.setData({ backStatus: false }) |
|||
return |
|||
} else { |
|||
this.setData({ backStatus: true }) |
|||
} |
|||
updateUserInfo({ avatarUrl: this.data.avatarUrl, nickName: e.detail.value }).then(res => { |
|||
if (res.code == 0) { |
|||
util.showToast('修改昵称成功!') |
|||
this.getUserInfoData() |
|||
} else { |
|||
util.showToast('修改昵称失败') |
|||
} |
|||
}) |
|||
} else if (e.target.dataset.name == "linkman") { |
|||
if (this.data.linkman == '') { |
|||
util.showToast('请填写联系人') |
|||
this.setData({ |
|||
backStatus: false |
|||
}) |
|||
return |
|||
} else { |
|||
this.setData({ |
|||
backStatus: true |
|||
}) |
|||
} |
|||
updateUserInfo({ avatarUrl: this.data.avatarUrl, linkman: e.detail.value }).then(res => { |
|||
if (res.code == 0) { |
|||
util.showToast('修改联系人成功!') |
|||
this.getUserInfoData() |
|||
} else { |
|||
util.showToast('修改联系人失败!') |
|||
} |
|||
}) |
|||
} else if (e.target.dataset.name == "linkPhone") { |
|||
if (this.data.linkPhone == '') { |
|||
util.showToast('请填写联系方式') |
|||
this.setData({ backStatus: false }) |
|||
return |
|||
} else { |
|||
this.setData({ backStatus: true }) |
|||
} |
|||
updateUserInfo({ avatarUrl: this.data.avatarUrl, linkPhone: e.detail.value }).then(res => { |
|||
if (res.code == 0) { |
|||
util.showToast('修改联系方式成功!') |
|||
this.getUserInfoData() |
|||
} else { |
|||
util.showToast('修改联系方式失败!') |
|||
} |
|||
|
|||
}) |
|||
} else if (e.target.dataset.name == "companyAddress") { |
|||
if (this.data.companyAddress == '') { |
|||
util.showToast('请填写公司地址') |
|||
this.setData({ |
|||
backStatus: false |
|||
}) |
|||
return |
|||
} else { |
|||
this.setData({ |
|||
backStatus: true |
|||
}) |
|||
} |
|||
updateUserInfo({ avatarUrl: this.data.avatarUrl, companyAddress: e.detail.value }).then(res => { |
|||
if (res.code == 0) { |
|||
util.showToast('修改公司地址成功!') |
|||
this.getUserInfoData() |
|||
} else { |
|||
util.showToast('修改公司地址失败') |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
showModal(e) { |
|||
this.setData({ |
|||
modalName: e.currentTarget.dataset.target |
|||
}) |
|||
}, |
|||
hideModal(e) { |
|||
this.setData({ |
|||
modalName: null |
|||
}) |
|||
}, |
|||
bindchange: function (e) { |
|||
this.setData({ identity: e.detail.value }) |
|||
if (this.data.identity == '') { |
|||
util.showToast('请选择身份') |
|||
this.setData({ backStatus: false }) |
|||
return |
|||
} else { |
|||
this.setData({ backStatus: true }) |
|||
} |
|||
updateUserInfo({ avatarUrl: this.data.avatarUrl, identity: e.detail.value }).then(res => { |
|||
if (res.code == 0) { |
|||
util.showToast('修改身份成功!') |
|||
this.getUserInfoData() |
|||
this.hideModal() |
|||
} else { |
|||
util.showToast('修改身份失败') |
|||
} |
|||
}) |
|||
}, |
|||
returnHome(){ |
|||
wx.redirectTo({ url: '/pages/index/index' }) |
|||
}, |
|||
ViewImage(e) { |
|||
var list = [] |
|||
list.push(this.data.licenseUrl) |
|||
wx.previewImage({ urls: list, current: e.currentTarget.dataset.url }) |
|||
}, |
|||
|
|||
}) |
|||
@ -1,9 +0,0 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"wux-button": "/components/button/index", |
|||
"wux-cell-group": "/components/cell-group/index", |
|||
"wux-cell": "/components/cell/index", |
|||
"wux-image": "/components/image/index", |
|||
"picker-view": "/components/picker-view/index" |
|||
} |
|||
} |
|||
@ -1,40 +0,0 @@ |
|||
<!--pages/home/info/index.wxml--> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">个人中心</view> |
|||
</cu-custom> |
|||
|
|||
<view class="cu-form-group margin-top" style="min-height:120rpx;margin-bottom:1rpx;padding: 20rpx 30rpx"> |
|||
<text class="lg text-black">头像</text> |
|||
<wux-image width="{{50}}" height="{{50}}" wux-class="image" shape="circle" src="{{avatarUrl}}" /> |
|||
</view> |
|||
<wux-cell-group> |
|||
<wux-cell title="姓名"> |
|||
<view slot="footer">{{linkman}}</view> |
|||
</wux-cell> |
|||
<wux-cell title="公司名称" wx:if="{{userType == 2}}"> |
|||
<view slot="footer">{{realName}}</view> |
|||
</wux-cell> |
|||
<wux-cell title="公司性质" wx:if="{{userType == 2}}"> |
|||
<view slot="footer">{{identityStr}}</view> |
|||
</wux-cell> |
|||
<wux-cell title="联系电话"> |
|||
<view slot="footer">{{linkPhone}}</view> |
|||
</wux-cell> |
|||
<wux-cell title="公司地址" wx:if="{{userType == 2}}"> |
|||
<view slot="footer" style="width:500rpx">{{companyAddress}}</view> |
|||
</wux-cell> |
|||
</wux-cell-group> |
|||
|
|||
<view class="bg-white margin-top" style="padding: 1rpx 30rpx;" wx:if="{{licenseUrl}}"> |
|||
<view style="padding: 20rpx 0rpx;"> |
|||
<text class="lg text-sg text-black" decode="{{true}}">营业执照</text> |
|||
</view> |
|||
<view class="grid col-3 grid-square"> |
|||
<view class="bg-img" wx:if="{{licenseUrl}}" bindtap="viewImage" data-url="{{licenseUrl}}"> |
|||
<image src='{{licenseUrl}}' mode='aspectFill'></image> |
|||
<view class="cu-tag bg-red" catchtap="updatalicenseUrl"> |
|||
<text class="cuIcon-close"></text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
@ -1 +0,0 @@ |
|||
/* pages/home/info/index.wxss */ |
|||
@ -1,176 +0,0 @@ |
|||
import { getBaseInfo, getOrderOutInfo, getReceiveInfo, feedbackReceiveInfo, deleteReceive, getCancelReceive, putReceive } from "../../api/saas" |
|||
import { $wuxDialog } from '../../../components/index' |
|||
const util = require('../../../utils/util') |
|||
const event = require('../../../utils/event') |
|||
const app = getApp() |
|||
|
|||
Page({ |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
requesting: false, |
|||
orderId: null, |
|||
type: null, |
|||
dataDetails: {}, |
|||
content: null, |
|||
safeBottom: app.globalData.safeBottom |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
if (options.id) { |
|||
this.data.orderId = options.id |
|||
} |
|||
if (options.type) { |
|||
this.setData({ type: Number(options.type) }) |
|||
} |
|||
this.setData({ safeBottom: app.globalData.safeBottom }) |
|||
this.getDetailsInfo() |
|||
}, |
|||
/** |
|||
* 获取支出详情 |
|||
*/ |
|||
getDetailsInfo: function () { |
|||
wx.showLoading({ title: '加载中', mask: true }) |
|||
if (util.isEmpty(app.globalData.userInfo.userName)) { |
|||
getBaseInfo().then(result => { |
|||
app.globalData.userInfo = result.data |
|||
}).catch(err => { |
|||
|
|||
}) |
|||
} |
|||
if (this.data.type == 1) { |
|||
getReceiveInfo(this.data.orderId).then(res => { |
|||
this.setData({ dataDetails: res.data }) |
|||
wx.hideLoading() |
|||
}).catch(err => { |
|||
wx.hideLoading() |
|||
}) |
|||
} else if (this.data.type == 2) { |
|||
getOrderOutInfo(this.data.orderId).then(res => { |
|||
this.setData({ dataDetails: res.data }) |
|||
wx.hideLoading() |
|||
}).catch(err => { |
|||
wx.hideLoading() |
|||
}) |
|||
} |
|||
|
|||
}, |
|||
bindAndSet(e) { |
|||
let key = e.currentTarget.dataset.name |
|||
this.setData({ [key]: e.detail.value }) |
|||
}, |
|||
// 提交反馈
|
|||
subFeedBack(feed) { |
|||
var that = this |
|||
const alert = (content) => { |
|||
$wuxDialog('#wux-dialog--alert').alert({ |
|||
resetOnClose: true, |
|||
title: '提示', |
|||
content: content, |
|||
}) |
|||
} |
|||
$wuxDialog().prompt({ |
|||
resetOnClose: true, |
|||
title: '反馈内容', |
|||
fieldtype: 'textarea', |
|||
defaultText: '', |
|||
placeholder: '请输入反馈内容', |
|||
maxlength: 100, |
|||
onConfirm(e, response) { |
|||
var postModel = { remark: response, orderId: that.data.orderId } |
|||
if (response == "") { |
|||
util.showToast('反馈内容不能为空!') |
|||
return |
|||
} |
|||
wx.showLoading({ title: '处理中', mask: true }) |
|||
feedbackReceiveInfo(postModel).then(res => { |
|||
wx.hideLoading() |
|||
util.showToast('提交反馈成功!') |
|||
}).catch(err => { |
|||
//异常回调
|
|||
wx.hideLoading() |
|||
util.showToast(err) |
|||
}) |
|||
}, |
|||
}) |
|||
}, |
|||
ViewImage(e) { |
|||
var list = [] |
|||
this.data.dataDetails.imgList.forEach(element => { |
|||
list.push(element.imgUrl) |
|||
}); |
|||
wx.previewImage({ urls: list, current: e.currentTarget.dataset.url }) |
|||
}, |
|||
showDialog: function () { |
|||
var that = this |
|||
$wuxDialog().open({ |
|||
resetOnClose: true, |
|||
title: '温馨提示', |
|||
content: '确定取消当前订单?', |
|||
buttons: [{ |
|||
text: '取消' |
|||
}, { |
|||
text: '确定', |
|||
type: 'primary', |
|||
onTap(e) { |
|||
that.stopReceviePost() |
|||
} |
|||
}] |
|||
}) |
|||
}, |
|||
deleteOrder: function () { |
|||
var that = this |
|||
$wuxDialog().open({ |
|||
resetOnClose: true, |
|||
title: '温馨提示', |
|||
content: '确定删除当前订单?', |
|||
buttons: [{ |
|||
text: '取消' |
|||
}, { |
|||
text: '确定', |
|||
type: 'primary', |
|||
onTap(e) { |
|||
wx.showLoading({ title: '处理中', mask: true }) |
|||
deleteReceive(that.data.orderId).then(res => { |
|||
event.emit('EventMessage', { what: 13, desc: '订单已删除' }) |
|||
wx.hideLoading() |
|||
util.showBackToast('订单已删除!') |
|||
}).catch(err => { |
|||
wx.hideLoading() |
|||
util.showToast(err) |
|||
}) |
|||
} |
|||
}] |
|||
}) |
|||
}, |
|||
//取消订单
|
|||
stopReceviePost: function () { |
|||
wx.showLoading({ title: '处理中', mask: true }) |
|||
getCancelReceive(this.data.orderId).then(result => { |
|||
event.emit('EventMessage', { what: 13, desc: '订单已取消' }) |
|||
wx.hideLoading() |
|||
util.showToast('订单已取消!') |
|||
this.setData({ ['dataDetails.status']: 5 }) |
|||
}).catch(err => { |
|||
wx.hideLoading() |
|||
util.showToast(err) |
|||
}) |
|||
}, |
|||
// 确认订单
|
|||
receviePost() { |
|||
wx.showLoading({ title: '处理中', mask: true }) |
|||
putReceive(this.data.orderId).then(res => { |
|||
wx.hideLoading() |
|||
util.showBackToast('订单已确认!') |
|||
event.emit('EventMessage', { what: 13, desc: '订单已订单' }) |
|||
}).catch(err => { |
|||
wx.hideLoading() |
|||
util.showToast(err) |
|||
}) |
|||
} |
|||
|
|||
}) |
|||
@ -1,10 +0,0 @@ |
|||
{ |
|||
"navigationBarTitleText": "Dialog", |
|||
"usingComponents": { |
|||
"wux-row": "/components/row/index", |
|||
"wux-col": "/components/col/index", |
|||
"wux-button": "/components/button/index", |
|||
"wux-dialog": "/components/dialog/index", |
|||
"wux-divider": "/components/divider/index" |
|||
} |
|||
} |
|||
@ -1,174 +0,0 @@ |
|||
<!--订单详情--> |
|||
<wxs module="order" src="../../order/order.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">订单详情</view> |
|||
</cu-custom> |
|||
|
|||
<view class="cu-form-group"> |
|||
<view class="text-black" style="font-size:30rpx">{{dataDetails.customerName||''}}</view> |
|||
<view class="action"> |
|||
<text class="text-df" style="color:#FF9800">{{order.orderStatus(dataDetails.status)}}</text> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="bg-white" style="margin-top: 24rpx;padding-left:32rpx;padding-top:24rpx" wx:if="{{type == 1}}"> |
|||
<view class="text-black" style="font-size:36rpx;">订单信息</view> |
|||
<scroll-view class="scroll-view_H" scroll-x="true" style="width: 100%"> |
|||
<view class="flex" style="width:1600rpx"> |
|||
<view class="col-title" style="width:200rpx">品类</view> |
|||
<view class="col-title" style="width:300rpx">磅单流水号</view> |
|||
<view class="col-title" style="width:200rpx">实重(kg)</view> |
|||
<view class="col-title" style="width:200rpx">金额(元)</view> |
|||
<view class="col-title" style="width:200rpx">扣重(kg)</view> |
|||
<view class="col-title" style="width:200rpx">单价(元/kg)</view> |
|||
<view class="col-title" style="width:200rpx">重磅重(kg)</view> |
|||
<view class="col-title" style="width:200rpx">空磅重(kg)</view> |
|||
</view> |
|||
<view class="wux-divider" style="width:1560rpx"></view> |
|||
<view wx:for="{{dataDetails.paperCategories}}" wx:key="index"> |
|||
<view class="flex" style="width:1600rpx"> |
|||
<view class="col-title" style="width:200rpx;font-size: 24rpx">{{item.paperCategoryName}}</view> |
|||
<view class="col-title" style="width:300rpx;font-size: 24rpx">{{item.tradeNo || '----'}}</view> |
|||
<view class="col-title" style="width:200rpx;font-size: 24rpx">{{item.settleWeight}}</view> |
|||
<view class="col-title" style="width:200rpx;font-size: 24rpx">{{item.totalPrice}}</view> |
|||
<view class="col-title" style="width:200rpx;font-size: 24rpx">{{item.deductWeight}}</view> |
|||
<view class="col-title" style="width:200rpx;font-size: 24rpx">{{item.unitPrice}}</view> |
|||
<view class="col-title" style="width:200rpx;font-size: 24rpx">{{item.totalWeight}}</view> |
|||
<view class="col-title" style="width:200rpx;font-size: 24rpx">{{item.emptyWeight}}</view> |
|||
</view> |
|||
<view class="wux-divider" style="width:1560rpx"></view> |
|||
</view> |
|||
</scroll-view> |
|||
<view class="cu-form-group1"> |
|||
<view> |
|||
<text class="item-label">总重量(Kg):</text> |
|||
<text class="item-val">{{order.settleOrder(dataDetails, 1)}}</text> |
|||
</view> |
|||
<view> |
|||
<text class="item-label">总金额(元):</text> |
|||
<text class="item-val">{{order.settleOrder(dataDetails, 2)}}</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="bg-white" style="margin-top: 24rpx;padding-left:32rpx;padding-top:24rpx" wx:elif="{{type == 2}}"> |
|||
<view class="text-black" style="font-size:36rpx;">订单信息</view> |
|||
<scroll-view class="scroll-view_H" scroll-x="true" style="width: 100%"> |
|||
<view class="flex" style="width:800rpx"> |
|||
<view class="col-title" style="width:200rpx">品类</view> |
|||
<view class="col-title" style="width:200rpx">价格(元/kg)</view> |
|||
<view class="col-title" style="width:200rpx">结算重量(kg)</view> |
|||
<view class="col-title" style="width:200rpx">结算金额(元)</view> |
|||
</view> |
|||
<view class="wux-divider" style="width:760rpx"></view> |
|||
<view wx:for="{{dataDetails.paperCategories}}" wx:key="index"> |
|||
<view class="flex" style="width:800rpx"> |
|||
<view class="col-title" style="width:200rpx;font-size: 24rpx">{{item.paperCategoryName}}</view> |
|||
<view class="col-title" style="width:200rpx;font-size: 24rpx">{{item.unitPrice}}</view> |
|||
<view class="col-title" style="width:200rpx;font-size: 24rpx">{{item.settleWeight}}</view> |
|||
<view class="col-title" style="width:200rpx;font-size: 24rpx">{{item.settlePrice}}</view> |
|||
</view> |
|||
<view class="wux-divider" style="width:760rpx"></view> |
|||
</view> |
|||
</scroll-view> |
|||
<view class="cu-form-group1"> |
|||
<view> |
|||
<text class="item-label">总重量(Kg):</text> |
|||
<text class="item-val">{{order.settleOrder(dataDetails, 1)}}</text> |
|||
</view> |
|||
<view> |
|||
<text class="item-label">总金额(元):</text> |
|||
<text class="item-val">{{order.settleOrder(dataDetails, 2)}}</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="bg-white" style="margin-top: 24rpx;padding-left:32rpx" wx:if="{{type == 1}}"> |
|||
<view class="cu-form-group1"> |
|||
<text class="text-gray">打包站名称</text> |
|||
<text class="text-black">{{dataDetails.factoryName || dataDetails.userName}}</text> |
|||
</view> |
|||
<wux-divider show-text="{{ false }}"></wux-divider> |
|||
<view class="cu-form-group1"> |
|||
<text class="text-gray">订单编号</text> |
|||
<text class="text-black">{{dataDetails.orderNo||''}}</text> |
|||
</view> |
|||
</view> |
|||
<view class="bg-white" style="margin-top: 24rpx;padding-left:32rpx" wx:elif="{{type == 2}}"> |
|||
<view class="cu-form-group1"> |
|||
<text class="text-gray">上门时间</text> |
|||
<text class="text-black">{{dataDetails.expectedTime}}</text> |
|||
</view> |
|||
<wux-divider show-text="{{ false }}"></wux-divider> |
|||
<view class="cu-form-group1"> |
|||
<text class="text-gray" style="white-space:nowrap">收货地址</text> |
|||
<text class="text-black" style="margin-left:24rpx">{{dataDetails.address||''}}</text> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="bg-white" style="margin-top: 24rpx;padding-left:32rpx"> |
|||
<view wx:if="{{dataDetails.plateNumber}}"> |
|||
<view class="cu-form-group1"> |
|||
<text class="text-gray">车牌号</text> |
|||
<text class="text-black">{{dataDetails.plateNumber}}</text> |
|||
</view> |
|||
<wux-divider show-text="{{ false }}"></wux-divider> |
|||
</view> |
|||
<view wx:if="{{dataDetails.receiveType == 1}}"> |
|||
<view class="cu-form-group1"> |
|||
<text class="text-gray">扣点</text> |
|||
<text class="text-black">{{dataDetails.deductPercent/100||0}}%</text> |
|||
</view> |
|||
<wux-divider show-text="{{ false }}"></wux-divider> |
|||
</view> |
|||
<view wx:if="{{dataDetails.customerManagerName}}"> |
|||
<view class="cu-form-group1"> |
|||
<text class="text-gray">商务</text> |
|||
<text class="text-black">{{dataDetails.customerManagerName||''}}</text> |
|||
</view> |
|||
<wux-divider show-text="{{ false }}"></wux-divider> |
|||
</view> |
|||
<view wx:if="{{dataDetails.weighmanName}}"> |
|||
<view class="cu-form-group1"> |
|||
<text class="text-gray">过磅员</text> |
|||
<text class="text-black">{{dataDetails.weighmanName}}</text> |
|||
</view> |
|||
<wux-divider show-text="{{ false }}"></wux-divider> |
|||
</view> |
|||
<view class="cu-form-group1"> |
|||
<text class="text-gray">下单时间</text> |
|||
<text class="text-black">{{dataDetails.createTime||''}}</text> |
|||
</view> |
|||
<wux-divider show-text="{{ false }}"></wux-divider> |
|||
<view class="cu-form-group1"> |
|||
<text class="text-gray">收货方式</text> |
|||
<text class="text-black">{{type == 1 ? '厂内收货' : '厂外收货'}}</text> |
|||
</view> |
|||
<wux-divider show-text="{{ false }}"></wux-divider> |
|||
<view class="cu-form-group1"> |
|||
<text class="text-gray" style="white-space: nowrap">备注</text> |
|||
<text class="text-black" style="margin-left:48rpx">{{dataDetails.remark||''}}</text> |
|||
</view> |
|||
<view class="bg-white" style="margin-top:16rpx;padding-right:32rpx"> |
|||
<view class="grid col-4 grid-square"> |
|||
<view class="bg-img" wx:for="{{dataDetails.imgList}}" wx:key="index" bindtap="ViewImage" data-url="{{item.imgUrl}}"> |
|||
<image src="{{item.imgUrl}}" mode="aspectFill"></image> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="cu-form-group1" wx:if="{{dataDetails.rejectReason}}" style="justify-content: left;align-items: flex-start"> |
|||
<text class="text-gray" style="white-space:nowrap">不通过原因:</text> |
|||
<text class="text-red">{{dataDetails.rejectReason}}</text> |
|||
</view> |
|||
</view> |
|||
|
|||
<view style="height:20rpx;"></view> |
|||
<view style="height:{{safeBottom}}rpx;" wx:if="{{dataDetails.status==2}}"></view> |
|||
<view class="cu-bar bg-white shadow foot flex justify-end" wx:if="{{dataDetails.status==2}}" style="height:{{100 + safeBottom}}rpx;padding-right: 32rpx;padding-bottom:{{safeBottom}}rpx"> |
|||
<!-- <wux-button wx:if="{{dataDetails.status==3||dataDetails.status==4}}" size="order" style="margin-right:24rpx" type="positive" bind:click="subFeedBack">我要报错</wux-button> --> |
|||
<wux-button wx:if="{{dataDetails.status==2 && type == 1}}" outline style="margin-right:32rpx" type="positive" size="order" bind:click="showDialog">取消订单</wux-button> |
|||
<!-- <wux-button wx:if="{{dataDetails.status==4||dataDetails.status==5||dataDetails.status==6}}" size="order" type="positive" bind:click="deleteOrder">删除订单</wux-button> --> |
|||
<wux-button wx:if="{{dataDetails.status==2}}" type="positive" size="order" bind:click="receviePost">确认订单</wux-button> |
|||
</view> |
|||
|
|||
<wux-dialog id="wux-dialog"></wux-dialog> |
|||
<wux-dialog id="wux-dialog--alert" /> |
|||
@ -1,110 +0,0 @@ |
|||
/* pages/order/index.wxss */ |
|||
|
|||
.tower-swiper .tower-item { |
|||
transform: scale(calc(0.5 + var(--index) / 10)); |
|||
margin-left: calc(var(--left) * 100rpx - 150rpx); |
|||
z-index: var(--index); |
|||
} |
|||
|
|||
.mt-5 { |
|||
margin-top: 5rpx; |
|||
} |
|||
|
|||
.mt-30 { |
|||
margin-top: 30rpx; |
|||
} |
|||
|
|||
.mt-15 { |
|||
margin-top: 15rpx; |
|||
} |
|||
|
|||
.ft-left { |
|||
float: left |
|||
} |
|||
|
|||
.ft-right { |
|||
float: right |
|||
} |
|||
|
|||
.mg-left { |
|||
margin-left: 15rpx; |
|||
} |
|||
|
|||
.mg-right { |
|||
margin-right: 15rpx; |
|||
} |
|||
|
|||
.min-height { |
|||
min-height: 160rpx; |
|||
} |
|||
|
|||
.bottom-min-height { |
|||
min-height: 250rpx; |
|||
} |
|||
|
|||
.bottom-button { |
|||
border-radius: 1000rpx; |
|||
} |
|||
|
|||
.ftweight600 { |
|||
font-weight: 600 |
|||
} |
|||
|
|||
.cu-form-group1 { |
|||
background-color: var(--white); |
|||
padding-right: 32rpx; |
|||
display: flex; |
|||
font-size: 28rpx; |
|||
align-items: center; |
|||
min-height: 80rpx; |
|||
justify-content: space-between; |
|||
} |
|||
|
|||
.cu-form-group2 { |
|||
background-color: var(--white); |
|||
padding: 1rpx 30rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
min-height: 80rpx; |
|||
justify-content: space-between; |
|||
} |
|||
|
|||
.item-label { |
|||
font-size: 28rpx; |
|||
font-family: PingFang-SC-Medium, PingFang-SC; |
|||
font-weight: 500; |
|||
color: rgba(0, 0, 0, 1); |
|||
line-height: 17px; |
|||
} |
|||
|
|||
.item-val { |
|||
font-size: 26rpx; |
|||
font-family: PingFang-SC-Medium, PingFang-SC; |
|||
font-weight: 500; |
|||
color: rgba(255, 164, 28, 1); |
|||
line-height: 17px; |
|||
} |
|||
|
|||
.col-title { |
|||
font-size: 14px; |
|||
font-family: PingFang-SC-Medium, PingFang-SC; |
|||
font-weight: 500; |
|||
height: 80rpx; |
|||
text-align: center; |
|||
line-height: 80rpx; |
|||
color: rgba(51, 51, 51, 1); |
|||
} |
|||
|
|||
.scroll-view_H{ |
|||
white-space: nowrap; |
|||
} |
|||
|
|||
.wux-divider { |
|||
display: block; |
|||
height: 2rpx; |
|||
width: 1680rpx; |
|||
clear: both; |
|||
border-top: 2rpx solid #e8e8e8 |
|||
} |
|||
|
|||
|
|||
@ -1,120 +0,0 @@ |
|||
// pages/stock/index.js
|
|||
import { getOrderList } from "../../api/saas" |
|||
const util = require('../../../utils/util') |
|||
const event = require('../../../utils/event') |
|||
const app = getApp() |
|||
|
|||
Component({ |
|||
options: { |
|||
addGlobalClass: true, |
|||
multipleSlots: true |
|||
}, |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
height: app.globalData.fragmentHeight - 100, |
|||
loading: true, |
|||
requesting: false, |
|||
finished: false, |
|||
tabList: [ |
|||
{id: 1, name: '预约单'}, |
|||
{id: 2, name: '待确认'}, |
|||
{id: 3, name: '待结算'}, |
|||
{id: 4, name: '已完成'}, |
|||
{id: 5, name: '已取消'} |
|||
], |
|||
orderList: [], |
|||
form: { |
|||
status: 1, |
|||
pageNum: 1, |
|||
pageSize:15 |
|||
} |
|||
}, |
|||
lifetimes: { |
|||
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|||
attached: function () { |
|||
event.on('EventMessage', this, this.onEvent) |
|||
}, |
|||
detached: function () { |
|||
event.remove('EventMessage', this) |
|||
} |
|||
}, |
|||
methods: { |
|||
onRestart: function () { |
|||
if (!this.data.firstShow) { |
|||
this.setData({userInfo: app.globalData.userInfo, height: app.globalData.fragmentHeight - 100 }) |
|||
this.fetchOrderList() |
|||
} |
|||
this.data.firstShow = true |
|||
}, |
|||
onEvent: function (message) { |
|||
if (message.what == 13) { |
|||
this.onRefreshList() |
|||
} else if (message.what == 888) { |
|||
this.setData({ |
|||
userInfo: app.globalData.userInfo, orderList: [], loading: false }) |
|||
} |
|||
}, |
|||
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 (!app.globalData.userInfo) { |
|||
this.setData({ requesting: false, loading: false }) |
|||
return |
|||
} |
|||
if (this.data.requesting || this.data.finished) { |
|||
return |
|||
} |
|||
if (this.data.loading) { |
|||
this.data.requesting = true |
|||
} else { |
|||
this.setData({ requesting: true }) |
|||
} |
|||
getOrderList(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 |
|||
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: '/pages/order/detail/index?id=' + item.id + '&type=' + item.receiveType }) |
|||
}, |
|||
onTabChange: function (e) { |
|||
if (this.data.form.status == e.detail.key) { |
|||
return |
|||
} |
|||
this.data.form.status = e.detail.key |
|||
this.onRefreshList() |
|||
} |
|||
} |
|||
}) |
|||
@ -1,9 +0,0 @@ |
|||
{ |
|||
"component": true, |
|||
"usingComponents": { |
|||
"refresh-view": "/components/refresher/index", |
|||
"wux-tabs": "/components/tabs/index", |
|||
"wux-tab": "/components/tab/index", |
|||
"wux-divider": "/components/divider/index" |
|||
} |
|||
} |
|||
@ -1,58 +0,0 @@ |
|||
<wxs module="order" src="../../order/order.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{false}}"> |
|||
<view slot="content" style="color:black;font-size:36rpx">订单列表</view> |
|||
</cu-custom> |
|||
|
|||
<!-- <scroll-view scroll-y="true" style="height: {{height}}rpx" bindscroll="scroll" bindscrolltolower="fetchOrderList"> --> |
|||
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" bind:scrolltolower="fetchOrderList"> |
|||
|
|||
<image style="width:100%;height:360rpx" mode="aspectFill" src="https://sc03.alicdn.com/kf/Had940d771b7a4cfe87ce933c21e8e5f5Q.jpg"></image> |
|||
|
|||
<view class="bg-white {{stick? 'shadow' : ''}}" style="width:100%;height:80rpx;"> |
|||
<wux-tabs controlled current="{{form.status}}" theme="positive" bindchange="onTabChange"> |
|||
<wux-tab wx:for="{{tabList}}" wx:key="index" key="{{item.id}}"> |
|||
<text class="text-df">{{item.name}}</text> |
|||
</wux-tab> |
|||
</wux-tabs> |
|||
</view> |
|||
<view wx:if="{{!orderList.length}}"> |
|||
<view class="list-empty" style="height:{{ stick ? height : (height - 440)}}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? '正在加载' : userInfo ? '暂无数据' : '你还没登录'}}</view> |
|||
</view> |
|||
</view> |
|||
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex"> |
|||
<view class="item-content" wx:for="{{pageItem}}" wx:key="index" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem" style="margin-top:{{index==0?24:0}}rpx"> |
|||
<view class="flex flex-justify" style="width:100%;height:80rpx"> |
|||
<view class="item-name">{{item.userName || item.factoryName}}<text>{{item.receiveType == 1 ? '(厂内收货)' : '(厂外收货)'}}</text></view> |
|||
<view>{{order.orderStatus(item.status)}}</view> |
|||
</view> |
|||
<wux-divider dashed show-text="{{ false }}"></wux-divider> |
|||
<view style="width:100%;padding: 24rpx 0rpx"> |
|||
<view class="item-cate">{{order.cateString(item.paperCategoryNameList)}}</view> |
|||
<view class="item-time">{{item.createTime}}</view> |
|||
</view> |
|||
<wux-divider show-text="{{ false }}"></wux-divider> |
|||
<view class="flex flex-justify" style="width:100%;height:80rpx"> |
|||
<view> |
|||
<text class="item-label">总重量(Kg):</text> |
|||
<text class="item-val">{{order.numberFormat(item.settleWeight, 3)}}</text> |
|||
</view> |
|||
<view> |
|||
<text class="item-label">总金额(元):</text> |
|||
<text class="item-val">{{order.numberFormat(item.settlePrice, 2)}}</text> |
|||
</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> |
|||
</refresh-view> |
|||
@ -1,60 +0,0 @@ |
|||
/* pages/home/index.wxss */ |
|||
|
|||
.item-content { |
|||
background-color: white; |
|||
padding: 0rpx 32rpx; |
|||
margin-bottom: 16rpx; |
|||
} |
|||
|
|||
.item-name { |
|||
font-size: 30rpx; |
|||
font-family: PingFang-SC-Regular, PingFang-SC; |
|||
font-weight: 400; |
|||
color: rgba(83, 83, 83, 1); |
|||
line-height: 20px; |
|||
} |
|||
|
|||
.item-status { |
|||
font-size: 30rpx; |
|||
font-family: PingFang-SC-Medium, PingFang-SC; |
|||
font-weight: 500; |
|||
color: rgba(255, 43, 45, 1); |
|||
line-height: 20px; |
|||
} |
|||
|
|||
.item-label { |
|||
font-size: 28rpx; |
|||
font-family: PingFang-SC-Medium, PingFang-SC; |
|||
font-weight: 500; |
|||
color: rgba(0, 0, 0, 1); |
|||
line-height: 17px; |
|||
} |
|||
|
|||
.item-val { |
|||
font-size: 26rpx; |
|||
font-family: PingFang-SC-Medium, PingFang-SC; |
|||
font-weight: 500; |
|||
color: rgba(255, 164, 28, 1); |
|||
line-height: 17px; |
|||
} |
|||
|
|||
.item-cate { |
|||
font-size: 28rpx; |
|||
font-family: PingFang-SC-Medium, PingFang-SC; |
|||
font-weight: 500; |
|||
color: rgba(0, 0, 0, 1); |
|||
line-height: 20px; |
|||
} |
|||
|
|||
.item-time { |
|||
font-size: 20rpx; |
|||
margin-top: 12rpx; |
|||
font-family: PingFang-SC-Regular, PingFang-SC; |
|||
font-weight: 400; |
|||
color: rgba(0, 0, 0, 1); |
|||
line-height: 14px; |
|||
} |
|||
|
|||
.shadow { |
|||
box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0.1) |
|||
} |
|||
@ -1,62 +0,0 @@ |
|||
function isEmpty(val) { |
|||
return typeof val === 'undefined' || val === '' || val === null |
|||
} |
|||
|
|||
function orderStatus(status) { |
|||
if (status == 2) { |
|||
return '待确认' |
|||
} else if (status == 3 || status == 30) { |
|||
return '待审核' |
|||
} else if (status == 23 || status == 31) { |
|||
return '待审核' |
|||
} else if (status == 4) { |
|||
return '已完成' |
|||
} else if (status == 5) { |
|||
return '已取消' |
|||
} else if (status == 6) { |
|||
return '不通过' |
|||
} |
|||
return '' |
|||
} |
|||
|
|||
function cateString(cateList) { |
|||
return cateList.toString() |
|||
} |
|||
|
|||
function numberFormat(value, fix) { |
|||
if (value) { |
|||
return value.toFixed(fix) |
|||
} |
|||
return '' |
|||
} |
|||
|
|||
function orderOperated(status) { |
|||
return status in [2, 3, 4] |
|||
} |
|||
|
|||
function settleOrder(orderInfo, type) { |
|||
if (type == 1) { |
|||
if (parseFloat(orderInfo.settleWeight) > 0) { |
|||
return numberFormat(orderInfo.settleWeight, 3) |
|||
} |
|||
if (parseFloat(orderInfo.allSettleWeight) > 0) { |
|||
return numberFormat(orderInfo.allSettleWeight, 3) |
|||
} |
|||
} else if (type == 2) { |
|||
if (parseFloat(orderInfo.settlePrice) > 0) { |
|||
return numberFormat(orderInfo.settlePrice, 2) |
|||
} |
|||
if (!isEmpty(orderInfo.allTotalPrice) && parseFloat(orderInfo.allTotalPrice) > 0) { |
|||
return numberFormat(orderInfo.allTotalPrice, 2) |
|||
} |
|||
} |
|||
return '' |
|||
} |
|||
|
|||
module.exports = { |
|||
orderStatus: orderStatus, |
|||
cateString: cateString, |
|||
numberFormat: numberFormat, |
|||
orderOperated: orderOperated, |
|||
settleOrder: settleOrder |
|||
} |
|||
@ -1,26 +0,0 @@ |
|||
const app = getApp() |
|||
|
|||
Page({ |
|||
data: { |
|||
TabList: [ |
|||
{ index: 0, value: 'order', icon: 'form', badge: 0, name: '订单' }, |
|||
{ index: 1, value: 'home', icon: 'my', badge: 0, name: '我的' } |
|||
], |
|||
pageIndex: 0, |
|||
safeBottom: app.globalData.safeBottom |
|||
}, |
|||
onLoad: function (options) { |
|||
this.setData({safeBottom: app.globalData.safeBottom }) |
|||
}, |
|||
onNavChange(e) { |
|||
this.setData({ pageIndex: Number(e.currentTarget.dataset.tab) }) |
|||
var pageView = this.selectComponent('#' + this.data.TabList[this.data.pageIndex].value); |
|||
pageView.onRestart() |
|||
}, |
|||
onShow: function () { |
|||
var pageView = this.selectComponent('#' + this.data.TabList[this.data.pageIndex].value); |
|||
if (pageView) { |
|||
pageView.onRestart() |
|||
} |
|||
} |
|||
}) |
|||
@ -1,7 +0,0 @@ |
|||
{ |
|||
"disableScroll": true, |
|||
"usingComponents": { |
|||
"order": "/pages/order/index/index", |
|||
"home": "/pages/home/pindex/index" |
|||
} |
|||
} |
|||
@ -1,14 +0,0 @@ |
|||
<wxs module="index" src="./index.wxs"></wxs> |
|||
|
|||
<!-- <main id="main" style="display:{{pageIndex == 0 ? 'block' : 'none'}}"/> --> |
|||
<order id="order" style="display:{{pageIndex == 0 ? 'block' : 'none'}}"/> |
|||
<home id="home" style="display:{{pageIndex == 1 ? 'block' : 'none'}}"/> |
|||
|
|||
<view class="cu-bar tabbar bg-white shadow foot" style="height:{{100 + safeBottom}}rpx;padding-bottom:{{safeBottom}}rpx"> |
|||
<view wx:for="{{TabList}}" wx:key="index" class="action" bindtap="onNavChange" data-tab="{{item.index}}"> |
|||
<view class="cuIcon-cu-image"> |
|||
<image style="width:44rpx;height:44rpx" mode="aspectFill" src="{{index.tabImage(pageIndex, item.index)}}"></image> |
|||
</view> |
|||
<view class="{{pageIndex == item.index?'text-blue':'text-gray'}}">{{item.name}}</view> |
|||
</view> |
|||
</view> |
|||
@ -1,23 +0,0 @@ |
|||
function tabImage(tabIndex, index) { |
|||
if (index == 0) { |
|||
if(tabIndex == index){ |
|||
return '/assets/image/icon_trans_blue.png' |
|||
} |
|||
return '/assets/image/icon_trans_gray.png' |
|||
} else if (index == 1) { |
|||
if(tabIndex == index){ |
|||
return '/assets/image/icon_self_blue.png' |
|||
} |
|||
return '/assets/image/icon_self_gray.png' |
|||
} else if (index == 2) { |
|||
if(tabIndex == index){ |
|||
return '/assets/image/icon_self_blue.png' |
|||
} |
|||
return '/assets/image/icon_self_gray.png' |
|||
} |
|||
return '' |
|||
} |
|||
|
|||
module.exports = { |
|||
tabImage: tabImage |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save