Merge branch 'pinjinjin' of git.ishopex.cn:onex/espier-taro-fenxiao into pinjinjin

* 'pinjinjin' of git.ishopex.cn:onex/espier-taro-fenxiao:
  收银台,h5部分修改

# Conflicts:
#	src/pages/index/index.js
This commit is contained in:
bentz
2019-03-04 09:12:46 +08:00
18 changed files with 256 additions and 163 deletions

5
src/api/cashier.js Normal file
View File

@@ -0,0 +1,5 @@
import req from './req'
export function weapppay () {
return req.get('http://pjj.aixue7.com/index.php/api/wxapp/payment/config')
}

View File

@@ -6,6 +6,7 @@ import * as user from './user'
import * as wx from './wx'
import * as member from './member'
import * as category from './category'
import * as cashier from './cashier'
export default {
cart,
@@ -15,5 +16,6 @@ export default {
user,
member,
wx,
category
category,
cashier
}

View File

@@ -25,10 +25,13 @@ class App extends Component {
'pages/cart/checkout',
'pages/category/index',
'pages/auth/login',
'pages/auth/reg',
'pages/auth/forgotpwd',
'pages/cashier/index',
'pages/member/index',
'pages/member/favorite',
'pages/member/integral',

View File

@@ -2,7 +2,6 @@ import Taro, { Component } from '@tarojs/taro'
import {View, Form, Text} from '@tarojs/components'
import { AtSearchBar } from 'taro-ui'
import { classNames } from '@/utils'
import api from '@/api'
import './index.scss'
@@ -63,6 +62,9 @@ export default class SearchBar extends Component {
let arrString = arr.join(',')
Taro.setStorage({ key: 'searchHistory', data: arrString })
})
Taro.navigateTo({
url: `/pages/item/list?keywords=${this.state.searchValue}`
})
}
}

View File

@@ -1,11 +1,12 @@
@import "../../style/imports";
.auth-forgotpwd {
height: 100vh;
padding-top: 160px;
background: $color-brand-primary-text;
&__form {
background: #fff;
padding: $edge-size;
margin: 0 0 $edge-margin;
}
.accountAgreement{
width: 100%;

View File

@@ -1,15 +1,15 @@
@import "../../style/imports";
.auth-login {
height: 100vh;
padding-top: 160px;
background: $color-brand-primary-text;
&__reg {
background: #fff;
//width: 100%;
padding: 10px $edge-size 0;
text-align: right;
box-sizing: border-box;
}
&__form {
background: #fff;
padding: $edge-size;
margin: 0 0 $edge-margin;
.icon-pwd {

View File

@@ -1,11 +1,12 @@
@import "../../style/imports";
.auth-reg {
height: 100vh;
padding-top: 160px;
background: $color-brand-primary-text;
&__form {
background: #fff;
padding: $edge-size;
margin: 0 0 $edge-margin;
}
.accountAgreement{
width: 100%;

View File

@@ -0,0 +1,25 @@
import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import { AtButton } from 'taro-ui'
import api from '@/api'
import './alipay.scss'
export default class AlipayBtn extends Component {
static options = {
addGlobalClass: true
}
constructor (props) {
super(props)
this.state = {
}
}
render () {
return (
<View className='alipay-btn'>支付宝支付</View>
)
}
}

View File

@@ -0,0 +1,12 @@
@import "../../../style/imports";
.alipay-btn {
background: #00a6e9 !important;
color: $color-brand-primary-text;
border-radius: 6px;
text-align: center;
padding:0 32px;
height:80px;
line-height: 80px;
margin-bottom: 20px;
}

View File

@@ -0,0 +1,99 @@
import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import { AtButton } from 'taro-ui'
import api from '@/api'
import './weapp.scss'
export default class WeappBtn extends Component {
static options = {
addGlobalClass: true
}
constructor (props) {
super(props)
this.state = {
}
}
componentDidMount () {
}
// async fetch (number) {
// Taro.getPayData({
// tid: tid
// }).then(res => {
// const data = res.data
// Taro.requestPayment({
// timeStamp: data.timeStamp,
// nonceStr: data.nonceStr,
// package: data.package,
// signType: data.signType,
// paySign: data.paySign,
// success: () => {
// console.log("z支付成功")
// // Taro.navigateTo({
// // url: '/pages/cart/paystatus?tid=' + tid
// // })
// },
// fail:()=>{
// console.log("z支付失败")
// // 取消支付则直接进入到未付款页面
// // Taro.redirectTo({
// // url: '/pages/user/orders'
// // })
// }
// })
// })
// const query = {
// ...this.state.query,
// number
// }
// const { a } = await api.item.search(query)
// console.log(a, 35)
// // const nList = pickBy(list, {
// // img: 'pics[0]',
// // item_id: 'item_id',
// // title: 'itemName',
// // desc: 'brief',
// // price: ({ price }) => (price/100).toFixed(2),
// // market_price: ({ market_price }) => (market_price/100).toFixed(2)
// // })
// //
// // this.setState({
// // list: [...this.state.list, ...nList],
// // query
// // })
// //
// // return {
// // total
// // }
// }
handleClickPay = async (number) => {
// const query = {
// ...this.state.query,
// number
// }
let query = {
number: number
}
const { a } = await api.cashier.weapppay(query)
console.log(a, 35)
}
render () {
const { number } = this.props
return (
<View
className='weapp-btn'
onClick={this.handleClickPay.bind(this, number)}
>
微信支付
</View>
)
}
}

View File

@@ -0,0 +1,11 @@
@import "../../../style/imports";
.weapp-btn{
background: #8bde4d !important;
color: $color-brand-primary-text;
border-radius: 6px;
text-align: center;
padding:0 32px;
height:80px;
line-height: 80px;
}

View File

@@ -0,0 +1,42 @@
import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import { AtButton } from 'taro-ui'
import AlipayBtn from './comps/alipay'
import WeappBtn from './comps/weapp'
import api from '@/api'
import './index.scss'
export default class Cashier extends Component {
constructor (props) {
super(props)
this.state = {
}
}
render () {
// const { list, pluralType, imgType, currentIndex } = this.state
return (
<View className='page-cashier-index'>
<View className='cashier-money'>
<View className='cashier-money__tip'>订单提交成功请选择支付方式</View>
<View className='cashier-money__content'>
<View className='cashier-money__content-title'>应付总额</View>
<View className='cashier-money__content-number'>1843.00</View>
</View>
</View>
<View className='pay-status'>
<AlipayBtn />
<WeappBtn
number='66'
/>
</View>
</View>
)
}
}

View File

@@ -0,0 +1,33 @@
@import "../../style/imports";
.page-cashier-index {
height: 100%;
.cashier-money {
border-top: 1px solid $color-border-gray-dark;
background: $color-brand-primary-text;
padding: 50px $edge-size ;
&__tip {
font-size: $font-size;
color: $color-primary-text;
margin-bottom: 42px;
}
&__content {
background: #FDE9E6;
padding: $edge-size ;
&-title {
color: #000;
font-size: $font-size;
}
&-number {
color: $color-brand-primary;
font-size: 96px;
}
}
}
.pay-status {
background: $color-brand-primary-text;
margin-top: 20px;
padding: $edge-size ;
}
}

View File

@@ -17,8 +17,6 @@ export default class CartIndex extends Component {
pluralType: true,
imgType: true,
currentIndex: 0,
// searchValue: '',
// showSearchDailog: false
}
}

View File

@@ -10,7 +10,7 @@ export default class Index extends Component {
componentWillMount () {
if (process.env.NODE_ENV === 'development') {
Taro.redirectTo({
url: '/pages/home/index'
url: '/pages/member/recharge'
})
}
}

View File

@@ -151,15 +151,15 @@ export default class Integral extends Component {
}
{
!page.isLoading && !page.hasNext && !list.length
&& (<SpNote className='integral_empty' img='trades_empty.png'>赶快赚积分吧~</SpNote>)
&& (
<View>
<SpNote className='integral_empty' img='integral_empty.png'>赶快赚积分吧~</SpNote>
<View className='btns'>
<AtButton type='primary' onClick={this.handleClickRoam}>随便逛逛</AtButton>
</View>
</View>
)
}
{/*{*/}
{/*!list.length*/}
{/*&& (<SpNote className='integral_empty' img='integral_empty.png'>赶快赚积分吧~</SpNote>)*/}
{/*}*/}
<View className='btns'>
<AtButton type='primary' onClick={this.handleClickRoam}>随便逛逛</AtButton>
</View>
</ScrollView>
</View>
</View>

View File

@@ -98,7 +98,7 @@
padding: 40px 30px 0 30px;
&-item {
width: 200px;
border: 1px solid $color-brand-primary;
border: 1PX solid $color-brand-primary;
background-color: $color-brand-primary-text;
margin: 20px 0;
}

View File

@@ -1,143 +1,2 @@
@import '../../style/imports';
.page-member-integral {
padding-bottom: $tabbar-height;
.sp-icon-pay, .sp-icon-clock, .sp-icon-baoguo, .sp-icon-comment {
@include iconfont-gradient(linear-gradient(90deg, #FAA761, #FA3515));
}
.sp-icon-star, .sp-icon-thumb {
@include iconfont-gradient(linear-gradient(270deg, #AF6FF7, #CD3AE3));
}
.sp-icon-money, .sp-icon-hongbao {
@include iconfont-gradient(linear-gradient(90deg, #FAD346, #F7B11C));
}
.sp-icon-setting, .sp-icon-help {
@include iconfont-gradient(linear-gradient(103deg, #7FD5FA, #2580FC));
}
.sp-icon-location {
@include iconfont-gradient(linear-gradient(270deg, #2757C5, #7298FD));
}
.sp-icon-qrcode {
@include iconfont-gradient(linear-gradient(90deg, #B4EC51, #429321));
}
}
.member-integral {
&__hd {
background: #FA3515;
background: linear-gradient(180deg,rgba(#FA9461, 1) 0%,rgba(#FA3515, 1) 100%);
height: 280px;
&:before {
transform: rotate(40deg) translate3D(0, -72%, 0);
background:linear-gradient(348deg,rgba(#fff, 0) 0%,rgba(#fff, 1) 100%);
content: '';
width: 300px;
height: 300px;
display: block;
position: absolute;
top: 0;
right: 0;
}
}
&__bd {
position: relative;
margin-top: -30px;
}
}
.integral {
&-info {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 50px 0 0;
color: $color-brand-primary-text;
&__status {
padding: $edge-margin 0;
display: flex;
align-items: center;
color: #666;
font-size: 24px;
justify-content: space-around;
}
}
&-number{
&__text{
font-weight: bold;
font-size: 60px;
}
}
&-text{
margin-top: 30px;
font-weight: bold;
font-size: 36px;
}
&-sec {
background: #fff;
border-radius: 20px;
overflow: hidden;
margin: 0 30px 30px;
&__horn {
padding: 0 30px 0 60px;
}
&__share {
height: 60px;
line-height: 60px;
flex: 1;
text-align: left;
padding-left: 30px;
border-left: 2px solid #D9D9D9;
}
}
}
.member-integral {
position: fixed;
top: 380px;
right: 0px;
left: 0px;
bottom: 30px;
box-sizing: border-box;
&__scroll {
//border: 1px solid red;
position: absolute;
top: 120px;
right: 30px;
left: 30px;
bottom: 30px;
box-sizing: border-box;
width: auto !important;
.integral_empty{
padding: 20px 0 0
}
}
&__panel {
display: none;
}
}
.integral-item {
border-bottom: 1px solid $color-gray-light;
padding: 20px 0 12px;
&__title {
display: flex;
justify-content: space-between;
&-name {
font-size: $edge-size;
color: $color-primary-text;
}
&-income {
color: $color-brand-primary;
}
&-pay {
color: $color-green;
}
}
&__data {
font-size: $font-size;
color: $color-primary-text;
}
}
@import './integral';