Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
王文桦
/
sxBusinessMp
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8dc00125
authored
Jun 13, 2020
by
wwh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
1 parent
0a44b9a6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
285 additions
and
68 deletions
src/components/coupon/dateTimePicker.wpy
src/couponModule/pages/index.wpy
src/couponModule/pages/newCoupon.wpy
src/pages/home/home.wpy
src/pages/supply/index.wpy
src/supplyModule/pages/detail.wpy
src/utils/Http.js
src/components/coupon/dateTimePicker.wpy
0 → 100644
View file @
8dc0012
<template>
<picker mode="multiSelector" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange" value="{{multiIndex}}" range="{{multiArray}}">
<view class="form-line">
<view class="label-line">{{labelTxt}}</view>
<view class="info">
<view class="money">{{time}}</view>
<image src="../../images/right.png" class="right"/>
</view>
</view>
</picker>
</template>
<script>
import wepy from 'wepy'
export default class TimePicker extends wepy.component {
props = {
time: {
type: String,
default: ''
},
labelTxt:{
type: String,
default: ''
}
}
data = {
years: [],
months: [],
days: [],
hours: [],
minutes: [],
multiArray: [], // 选择范围
multiIndex: [0, 0, 0, 0, 0], // 选中值数组
choose_year: '',
yearIndex: 0
}
// 设置初始值
setTimeDate() {
const date = new Date()
let _yearIndex = 0
// 默认设置
// console.info(this.time)
let _defaultYear = this.time ? this.time.split('-')[0] : 0
// 获取年
for (let i = date.getFullYear(); i <= date.getFullYear() + 5; i++) {
this.years.push('' + i)
// 默认设置的年的位置
if (_defaultYear && i === parseInt(_defaultYear)) {
this.yearIndex = _yearIndex
this.choose_year = _defaultYear
}
_yearIndex = _yearIndex + 1
}
// 获取月份
for (let i = 1; i <= 12; i++) {
if (i < 10) {
i = '0' + i
}
this.months.push('' + i)
}
// 获取日期
for (let i = 1; i <= 31; i++) {
if (i < 10) {
i = '0' + i
}
this.days.push('' + i)
}
// 获取小时
for (let i = 0; i < 24; i++) {
if (i < 10) {
i = '0' + i
}
this.hours.push('' + i)
}
// 获取分钟
for (let i = 0; i < 60; i++) {
if (i < 10) {
i = '0' + i
}
this.minutes.push('' + i)
}
}
// 返回月份的天数
setDays(selectYear, selectMonth) {
let num = selectMonth
let temp = []
if (num === 1 || num === 3 || num === 5 || num === 7 || num === 8 || num === 10 || num === 12) {
// 判断31天的月份
for (let i = 1; i <= 31; i++) {
if (i < 10) {
i = '0' + i
}
temp.push('' + i)
}
} else if (num === 4 || num === 6 || num === 9 || num === 11) { // 判断30天的月份
for (let i = 1; i <= 30; i++) {
if (i < 10) {
i = '0' + i
}
temp.push('' + i)
}
} else if (num === 2) { // 判断2月份天数
let year = parseInt(selectYear)
console.log(year)
if (((year % 400 === 0) || (year % 100 !== 0)) && (year % 4 === 0)) {
for (let i = 1; i <= 29; i++) {
if (i < 10) {
i = '0' + i
}
temp.push('' + i)
}
} else {
for (let i = 1; i <= 28; i++) {
if (i < 10) {
i = '0' + i
}
temp.push('' + i)
}
}
}
return temp
}
// 设置默认值 格式2019-07-10 10:30
setDefaultTime() {
let allDateList = this.time.split(' ')
// 日期
let dateList = allDateList[0].split('-')
let month = parseInt(dateList[1]) - 1
let day = parseInt(dateList[2]) - 1
// 时间
let timeList = allDateList[1].split(':')
this.multiArray[2] = this.setDays(dateList[0], parseInt(dateList[1]))
this.multiIndex = [this.yearIndex, month, day, timeList[0], timeList[1]]
}
methods = {
// 监听picker的滚动事件
bindMultiPickerColumnChange(e) {
// 获取年份
if (e.detail.column === 0) {
this.choose_year = this.multiArray[e.detail.column][e.detail.value]
console.log(this.choose_year)
}
// console.log('修改的列为', e.detail.column, ',值为', e.detail.value);
// 设置月份数组
if (e.detail.column === 1) {
let num = parseInt(this.multiArray[e.detail.column][e.detail.value])
this.multiArray[2] = this.setDays(this.choose_year, num)
}
this.multiIndex[e.detail.column] = e.detail.value
this.$apply()
},
// 获取时间日期
bindMultiPickerChange(e) {
// console.log('picker发送选择改变,携带值为', e.detail.value)
this.multiIndex = e.detail.value
const index = this.multiIndex
const year = this.multiArray[0][index[0]]
const month = this.multiArray[1][index[1]]
const day = this.multiArray[2][index[2]]
const hour = this.multiArray[3][index[3]]
const minute = this.multiArray[4][index[4]]
// console.log(`${year}-${month}-${day}-${hour}-${minute}`);
this.time = year + '-' + month + '-' + day + ' ' + hour + ':' + minute
this.$emit('getDateTime',this.time)
this.$apply()
}
}
onLoad () {
this.setTimeDate()
this.multiArray = [this.years, this.months, this.days, this.hours, this.minutes]
this.choose_year = this.multiArray[0][0]
if (!this.time) {
// 默认显示当前日期
let date = new Date()
let currentMonth = date.getMonth()
let currentDay = date.getDate() - 1
// console.info('月', date.getMonth())
// console.info('日', date.getDate())
let currentHours = date.getHours()
let currentMinutes = date.getMinutes()
this.multiArray[2] = this.setDays(this.choose_year, currentMonth + 1)
this.multiIndex = [0, currentMonth, currentDay, currentHours, currentMinutes]
} else {
this.setDefaultTime()
}
this.$apply()
}
}
</script>
<style lang="scss">
.time-picker{
width: 240rpx;
}
.form-line {
height: 100rpx;
border-bottom: 1rpx #E8E8E8 solid;
padding: 0 24rpx;
display: flex;
align-items: center;
justify-content: space-between;
.label-line {
font-size: 28rpx;
color: #333333;
}
.info {
display: flex;
align-items: center;
justify-content: flex-end;
.money {
font-size: 28rpx;
color: #333333;
}
.right {
width: 26rpx;
height: 26rpx;
margin-left: 24rpx;
}
}
}
</style>
src/couponModule/pages/index.wpy
View file @
8dc0012
...
...
@@ -15,16 +15,6 @@
<view class="circle">
<view class="circle-item" wx:for="{{circle}}" wx:for-index="index1" wx:for-item="item1" wx:key="index1" ></view>
</view>
<!--<view class="top" wx:if="{{item.coupon_discount_way.is_type == 1 && item.coupon_limit_use.is_type== 2 }}"><text>减免</text>{{item.coupon_discount_way.money / 100}}</view>-->
<!--<view class="top" wx:elif="{{item.coupon_discount_way.is_type == 2 && item.coupon_limit_use.is_type== 2 }}"><text>折扣</text>{{item.coupon_discount_way.money}}</view>-->
<!--<view class="top" wx:elif="{{item.coupon_discount_way.is_type== 1 && item.coupon_limit_use.is_type== 1 }}"><text>减免</text>{{item.coupon_discount_way.money / 100}}</view>-->
<!--<view class="top" wx:elif="{{item.coupon_discount_way.is_type== 2 && item.coupon_limit_use.is_type== 1}}"><text>折扣</text>{{item.coupon_discount_way.money}}</view>-->
<!--<view class="bottom" wx:if="{{item.coupon_discount_way.is_type== 1 && item.coupon_limit_use.is_type== 2 }}">满{{item.coupon_limit_use.money / 100}}元可用</view>-->
<!--<view class="bottom" wx:if="{{item.coupon_discount_way.is_type== 2 && item.coupon_limit_use.is_type== 2 }}">订单满{{item.coupon_limit_use.money / 100}}元可用</view>-->
<!--<view class="bottom" wx:if="{{item.coupon_discount_way.is_type== 1 && item.coupon_limit_use.is_type== 1 }}">不限制</view>-->
<!--<view class="bottom" wx:if="{{item.coupon_discount_way.is_type== 2 && item.coupon_limit_use.is_type== 1 }}">不限制</view>-->
<view class="top" wx:if="{{item.coupon_discount_way.is_type == 1}}"><text>减免</text>{{item.coupon_discount_way.money / 100}}</view>
<view class="top" wx:elif="{{item.coupon_discount_way.is_type == 2}}"><text>折扣</text>{{item.coupon_discount_way.money}}</view>
<view class="top" wx:elif="{{item.coupon_discount_way.is_type == 3}}"><text>包邮</text></view>
...
...
src/couponModule/pages/newCoupon.wpy
View file @
8dc0012
This diff is collapsed.
Click to expand it.
src/pages/home/home.wpy
View file @
8dc0012
...
...
@@ -291,20 +291,6 @@
tap: 'scan',
auth: false
},
// {
// name : '客户管理',
// img: 'http://static.ledouya.com/Fri_t8HvQvgLX3LVMxSndrvUo9rq',
// url : '/customerModule/pages/index',
// tap: '',
// auth: false
// },
// {
// name : '优惠券',
// img: 'http://static.ledouya.com/FpYGmWD1FnQuMep0mnvqugsinbCL',
// url : '../../couponModule/pages/index',
// tap: '',
// auth: false
// },
{
name : '订单管理',
img: 'http://static.ledouya.com/FjReFSSw0qXd_PPSA5TfPB5svtLo',
...
...
@@ -312,20 +298,13 @@
tap: "order",
auth: false
},
// {
// name : '财务管理',
// img: 'http://static.ledouya.com/Fn1UW8kmP5-czVPZhAiOdpjOj6FM',
// url : '../../financeModule/pages/index',
// tap: "",
// auth: false
// },
// {
// name : '帮助中心',
// img: 'http://static.ledouya.com/Fs_1qNyrhU7csc-3XZV0hs4uxrb_',
// url : '',
// tap: 'helpCenter',
// auth: false
// }
{
name : '优惠券',
img: 'http://static.ledouya.com/FpYGmWD1FnQuMep0mnvqugsinbCL',
url : '../../couponModule/pages/index',
tap: '',
auth: false
},
],
shopInfo:{},
expirationTime:'',
...
...
@@ -349,7 +328,7 @@
this.func[1].auth = false;
this.func[2].auth = false;
this.func[3].auth = false;
//
this.func[4].auth = false;
this.func[4].auth = false;
// this.func[5].auth = false;
console.log(this.roles,'roleListroleList---');
for(let i=0;i<this.roleList.length;i++){
...
...
@@ -360,7 +339,7 @@
this.func[1].auth = true;
this.func[2].auth = true;
this.func[3].auth = true;
//
this.func[4].auth = true;
this.func[4].auth = true;
// this.func[5].auth = true;
this.$apply();
}
...
...
src/pages/supply/index.wpy
View file @
8dc0012
...
...
@@ -16,7 +16,7 @@
</view>
<view class='goods-numBox'>
<text class='goods-price'>¥{{item.price_current/100}}</text>
<view class="goods-btn {{item.is_insert == '1'?'btn_defalut':''}}" data-index='{{item.is_insert}}' data-goods="{{item}}" @tap.stop='upDownShelf'>{{item.is_insert == '0'?'上架到网店':'已上架
到网店
'}}</view>
<view class="goods-btn {{item.is_insert == '1'?'btn_defalut':''}}" data-index='{{item.is_insert}}' data-goods="{{item}}" @tap.stop='upDownShelf'>{{item.is_insert == '0'?'上架到网店':'已上架'}}</view>
</view>
</view>
</view>
...
...
@@ -128,13 +128,14 @@ export default class supplyIndex extends wepy.page {
<style lang="scss">
@import "../../styles/variable";
page{
padding-top:
90
rpx;
padding-top:
115
rpx;
}
.supply-contanier{
height:100%;
.scroll-box{
width:100%;
height:90rpx;
// height:90rpx;
height:115rpx;
white-space: nowrap;
position: fixed;
top:0;
...
...
@@ -144,32 +145,42 @@ export default class supplyIndex extends wepy.page {
background: #fff;
.nav-header{
width:100%;
height:90rpx;
// height:90rpx;
height:66rpx;
margin-top:25rpx;
.nav_h_item{
display: inline-block;
font-size:32rpx;
font-weight:400;
color:rgba(51,51,51,1);
margin-right:85rpx;
position: relative;
height:90rpx;
line-height: 90rpx;
display:inline-block;
padding:8rpx 20rpx;
background:rgba(242,242,243,1);
border-radius:30rpx;
margin-right: 20rpx;
line-height: 50rpx;
// margin-right:85rpx;
// position: relative;
// height:90rpx;
// line-height: 90rpx;
// display:inline-block;
&:first-child{
margin-left:
60
rpx;
margin-left:
24
rpx;
}
}
.nav_h_item.nav_active{
&:after{
content:'';
position: absolute;
bottom:0;
left:50%;
margin-left:-25px;
width:100rpx;
height:8rpx;
background:rgba(5,133,255,1);
border-radius:4rpx;
}
background:rgba(26,151,219,1);
color:#fff;
// &:after{
// content:'';
// position: absolute;
// bottom:0;
// left:50%;
// margin-left:-25px;
// width:100rpx;
// height:8rpx;
// background:rgba(5,133,255,1);
// border-radius:4rpx;
// }
}
}
}
...
...
@@ -219,21 +230,19 @@ export default class supplyIndex extends wepy.page {
line-height:42rpx;
}
.goods-btn{
// width:140rpx;
padding:0rpx 10rpx;
height:58rpx;
width:150rpx;
height:56rpx;
background:#1296db;
border-radius:8rpx;
font-size:26rpx;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(255,255,255,1);
line-height:5
8
rpx;
line-height:5
6
rpx;
text-align: center;
}
.btn_defalut{
background: #aaa;
padding:0rpx 10rpx;
}
}
}
...
...
src/supplyModule/pages/detail.wpy
View file @
8dc0012
...
...
@@ -28,7 +28,7 @@
<view class="btn-groups">
<view class="btn-back" @tap='back'>供销主页</view>
<view class="btn-upGoods" @tap='shelfGoods' wx:if="{{goodsInfo.is_insert == '0'}}">上架到网店</view>
<view class="btn-upGoods is_insert" wx:elif="{{goodsInfo.is_insert == '1'}}">已上架
到网店
</view>
<view class="btn-upGoods is_insert" wx:elif="{{goodsInfo.is_insert == '1'}}">已上架</view>
</view>
</view>
</template>
...
...
src/utils/Http.js
View file @
8dc0012
...
...
@@ -15,7 +15,22 @@ export default class http {
if
(
this
.
isSuccess
(
res
))
{
if
(
res
.
data
.
error
==
-
1
)
{
Tips
.
modal
(
res
.
data
.
error_reason
,
'温馨提示'
);
// Tips.modal(res.data.error_reason,'温馨提示');
wx
.
showModal
({
title
:
'温馨提示'
,
content
:
res
.
data
.
error_reason
,
showCancel
:
false
,
success
:
res
=>
{
wepy
.
reLaunch
({
url
:
'/pages/home/index'
})
},
fail
:
res
=>
{
wepy
.
reLaunch
({
url
:
'/pages/home/index'
})
}
})
return
;
}
if
(
res
.
data
.
error
==
10001
||
res
.
data
.
error
==
10002
||
res
.
data
.
error
==
10003
||
res
.
data
.
error
==
10004
||
res
.
data
.
error
==
11020
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment