wechat app 1.0.1

This commit is contained in:
郑茂强 2019-03-06 14:16:09 +08:00
parent 1f79ef2bda
commit ad18b8919c
22 changed files with 142 additions and 66 deletions

View File

@ -40,8 +40,6 @@ class App extends Component {
'pages/myNeedsPublish/myNeedsPublish',// 需求发布 'pages/myNeedsPublish/myNeedsPublish',// 需求发布
'pages/individualCenter/individualCenter',// 个人中心页面 'pages/individualCenter/individualCenter',// 个人中心页面
// 'pages/shopDescription/shopDescription', // 'pages/shopDescription/shopDescription',
], ],
permission: { permission: {

View File

@ -40,12 +40,14 @@ class recommondShop extends Component {
} }
} }
goToShop(value) { goToShop(e) {
console.log('e',e)
const value = e.currentTarget.dataset.eTapAA
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/shop/shop?id=' + value.shop_id url: '/pages/shop/shop?id=' + value.shop_id
}) })
} }
// api 优惠请求 // api 优惠请求
getVoucherInfo({ user = this.state.userName, getVoucherInfo({ user = this.state.userName,
phone = this.state.userPhone, phone = this.state.userPhone,
shops = [this.props.shop.shop_id], shops = [this.props.shop.shop_id],
@ -79,7 +81,7 @@ class recommondShop extends Component {
voucherResponseMsg: res.data.tips, voucherResponseMsg: res.data.tips,
isCanVoucher: res.data.canConsult, isCanVoucher: res.data.canConsult,
}) })
console.log('优惠请求', res) console.log('优惠请求', res)
}) })
} }
@ -237,8 +239,8 @@ class recommondShop extends Component {
const address = this.props.shop.shop_address const address = this.props.shop.shop_address
const distance = this.props.shop.distance const distance = this.props.shop.distance
const ads = this.props.shop.ads const ads = this.props.shop.ads
const voucherLeft = this.props.shop.left_nums // 优惠是否为灰色 const voucherLeft = this.props.shop.left_nums // 优惠是否为灰色
const isShowConsultButton = this.props.shop.wx_open === '0' ? false : true // 优惠是否为灰色 const isShowConsultButton = this.props.shop.wx_open === '0' ? false : true // 优惠是否为灰色
const slicedGoods = goods !== null ? goods.slice(1) : null const slicedGoods = goods !== null ? goods.slice(1) : null
const goodsElementsArray = goods !== null ? slicedGoods.map((item, index) => { const goodsElementsArray = goods !== null ? slicedGoods.map((item, index) => {
return <View className='goods-img-box' key={index}> return <View className='goods-img-box' key={index}>
@ -249,7 +251,7 @@ class recommondShop extends Component {
</View> </View>
}) : null }) : null
// 优惠和咨询元素 // 优惠和咨询元素
const consultModalElement = <AtModal isOpened={this.state.isOpenConsult}> const consultModalElement = <AtModal isOpened={this.state.isOpenConsult}>
<AtModalHeader>咨询</AtModalHeader> <AtModalHeader>咨询</AtModalHeader>
<AtModalContent> <AtModalContent>
@ -315,9 +317,9 @@ class recommondShop extends Component {
<View className='button-container' style='margin-right:5px'> <View className='button-container' style='margin-right:5px'>
{voucherLeft ? <View className='button' onClick={this.isOpenVoucher.bind(this)} > {voucherLeft ? <View className='button' onClick={this.isOpenVoucher.bind(this)} >
<Button size='mini' className='button-blue-mini'> <Button size='mini' className='button-blue-mini'>
优惠</Button> 优惠</Button>
</View> : <View className='button blur' onClick={this.isOpenVoucher.bind(this)} > </View> : <View className='button blur' onClick={this.isOpenVoucher.bind(this)} >
<Button size='mini' className='button-blue-mini'>优惠</Button> <Button size='mini' className='button-blue-mini'>优惠</Button>
</View>} </View>}
{isShowConsultButton ? <View className='button contult-button' onClick={this.isOpenConsult.bind(this)} > {isShowConsultButton ? <View className='button contult-button' onClick={this.isOpenConsult.bind(this)} >

View File

@ -11,7 +11,7 @@ import loginExpired from '../../../util/loginExpired'
class VoucherPoster extends Component { class VoucherPoster extends Component {
config = { config = {
navigationBarTitleText: '优惠活动弹窗' navigationBarTitleText: '优惠活动弹窗'
} }
constructor() { constructor() {
@ -134,7 +134,7 @@ class VoucherPoster extends Component {
</View> </View>
<View className='voucher-left'> <View className='voucher-left'>
当前优惠<Text class='left-amount'>{this.props.voucherLeft}</Text> 当前优惠<Text class='left-amount'>{this.props.voucherLeft}</Text>
</View> </View>
<View className='input-name' > <View className='input-name' >
<View className='title'> <Text>联系人</Text></View> <View className='title'> <Text>联系人</Text></View>

View File

@ -49,6 +49,7 @@ class Goods extends Component {
} }
}) })
.then(res => { .then(res => {
Taro.hideLoading()
console.log('商品详情:', res) console.log('商品详情:', res)
if (res.data.err_msg === "success") { if (res.data.err_msg === "success") {
this.setState({ this.setState({
@ -127,7 +128,9 @@ class Goods extends Component {
} }
componentDidMount() { componentDidMount() {
Taro.showLoading({
title: '加载中'
})
this.getGoodDescription() this.getGoodDescription()
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {

View File

@ -54,6 +54,7 @@ class GrabOrderPage extends Component {
}) })
.then(res => { .then(res => {
console.log('抢单详情获取成功', res) console.log('抢单详情获取成功', res)
Taro.hideLoading()
if (res.data.err_code === 0) { if (res.data.err_code === 0) {
this.setState({ this.setState({
type: res.data.sdInfo.class_name, type: res.data.sdInfo.class_name,
@ -100,6 +101,7 @@ class GrabOrderPage extends Component {
} }
}) })
.then(res => { .then(res => {
Taro.hideLoading()
if (res.data.err_code === 0) { if (res.data.err_code === 0) {
Taro.showToast({ Taro.showToast({
title: '抢单成功', title: '抢单成功',
@ -107,8 +109,8 @@ class GrabOrderPage extends Component {
duration: 1500 duration: 1500
}) })
setTimeout(() => { setTimeout(() => {
Taro.navigateTo({ Taro.navigateBack({
url: '/pages/home/home' delta:1
}) })
}, 1500); }, 1500);
@ -150,11 +152,16 @@ class GrabOrderPage extends Component {
handleGrabConfirm() { handleGrabConfirm() {
this.setState({ isOpen: false }) this.setState({ isOpen: false })
// 确认抢单之后 // 确认抢单之后
Taro.showLoading({
title: '加载中'
})
this.GrabDemand({ demandId: this.state.grabOrderId }) this.GrabDemand({ demandId: this.state.grabOrderId })
} }
componentDidMount() { componentDidMount() {
Taro.showLoading({
title:'加载中'
})
this.getGrabOrderInfo() this.getGrabOrderInfo()
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {

View File

@ -24,7 +24,8 @@ class RenderingView extends Component {
} }
onClickHandler(item) { onClickHandler(e) {
const item = e.currentTarget.dataset.eTapAA
this.setState({ this.setState({
image: URL.Base + item.file_path, image: URL.Base + item.file_path,
isOpened:true isOpened:true

View File

@ -211,7 +211,8 @@ class Home extends Component {
} }
// 点击大类icon // 点击大类icon
onClickParentCate(item) { onClickParentCate(e) {
const item = e.currentTarget.dataset.eTapAA
Taro.showLoading({ Taro.showLoading({
title: '加载中' title: '加载中'
}) })
@ -222,7 +223,8 @@ class Home extends Component {
} }
// 点击子类 // 点击子类
onClickChildCate(item) { onClickChildCate(e) {
const item = e.currentTarget.dataset.eTapAA
Taro.showLoading({ Taro.showLoading({
title: '加载中' title: '加载中'
}) })
@ -252,8 +254,9 @@ class Home extends Component {
}) })
} }
grabOrderId(Id) { grabOrderId(e) {
this.setState({ isOpen: true, grabOrderId: Id }) const id = e.currentTarget.dataset.eTapAA
this.setState({ isOpen: true, grabOrderId: id })
} }
handleGrabModalClose() { handleGrabModalClose() {
this.setState({ isOpen: false }) this.setState({ isOpen: false })
@ -272,9 +275,10 @@ class Home extends Component {
// 导航去抢单页面 // 导航去抢单页面
goToGrabOrderPage(orderId) { goToGrabOrderPage(e) {
Taro.navigateTo({ const orderId = e.currentTarget.dataset.eTapAA
Taro.navigateTo({
url: '/pages/grabOrderPage/grabOrderPage?orderId=' + orderId url: '/pages/grabOrderPage/grabOrderPage?orderId=' + orderId
}) })
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -3,6 +3,8 @@ import { View, Image, Button } from '@tarojs/components'
import { AtGrid, AtList, AtListItem, AtAvatar, AtButton } from "taro-ui" import { AtGrid, AtList, AtListItem, AtAvatar, AtButton } from "taro-ui"
import LoginService from '../../util/LoginService' import LoginService from '../../util/LoginService'
import Logout from '../../util/logout'
import './individualCenter.scss' import './individualCenter.scss'
import URL from '../../serviceAPI.config' import URL from '../../serviceAPI.config'
@ -28,13 +30,14 @@ class IndividualCenter extends Component {
], ],
seller: [ seller: [
{ {
image: 'https://img12.360buyimg.com/jdphoto/s72x72_jfs/t6160/14/2008729947/2754/7d512a86/595c3aeeNa89ddf71.png', image: 'https://img30.360buyimg.com/jdphoto/s72x72_jfs/t5770/97/5184449507/2423/294d5f95/595c3b4dNbc6bc95d.png',
value: '我的商品' value: '我的商品'
}, },
{ {
image: 'https://img20.360buyimg.com/jdphoto/s72x72_jfs/t15151/308/1012305375/2300/536ee6ef/5a411466N040a074b.png', image: 'https://img14.360buyimg.com/jdphoto/s72x72_jfs/t17251/336/1311038817/3177/72595a07/5ac44618Na1db7b09.png',
value: '商品发布' value: '商品发布'
}, },
{ {
image: 'https://img10.360buyimg.com/jdphoto/s72x72_jfs/t5872/209/5240187906/2872/8fa98cd/595c3b2aN4155b931.png', image: 'https://img10.360buyimg.com/jdphoto/s72x72_jfs/t5872/209/5240187906/2872/8fa98cd/595c3b2aN4155b931.png',
value: '我的供求' value: '我的供求'
@ -47,6 +50,7 @@ class IndividualCenter extends Component {
username: '', username: '',
avatar: '', avatar: '',
isShop: false, isShop: false,
vip_level:''
} }
} }
handlerGridClick(e) { handlerGridClick(e) {
@ -88,25 +92,22 @@ class IndividualCenter extends Component {
} }
} }
handlerTitleBarClick() { handlerTitleBarClick() {
Taro.showToast({ // Taro.showToast({
title: '暂时没有更多', // title: '暂时没有更多',
icon: 'none' // icon: 'none'
}) // })
} }
getInfoFromStorage() { getInfoFromStorage() {
const username = Taro.getStorageSync('userInfo').login_name const username = Taro.getStorageSync('userInfo').login_name||''
const avatar = Taro.getStorageSync('userInfo').avatar const avatar = Taro.getStorageSync('userInfo').avatar||''
const vip_level=Taro.getStorageSync('userInfo').vip_name||''
const isShop = Taro.getStorageSync('shopInfo').shop_id ? true : false const isShop = Taro.getStorageSync('shopInfo').shop_id ? true : false
this.setState({ this.setState({
username, avatar, isShop username, avatar, isShop,vip_level
}) })
} }
handleLogoutClick() { handleLogoutClick() {
Taro.clearStorageSync() Logout()
Taro.reLaunch({
url: '/pages/login/login'
})
} }
componentDidMount() { componentDidMount() {
this.getInfoFromStorage() this.getInfoFromStorage()
@ -121,13 +122,13 @@ class IndividualCenter extends Component {
if (!Taro.getStorageSync('userInfo').user_id) { if (!Taro.getStorageSync('userInfo').user_id) {
LoginService() LoginService()
return return
} }
} }
componentDidHide() { } componentDidHide() { }
render() { render() {
const { client, seller, username, avatar, isShop } = this.state const { client, seller, username, avatar,vip_level, isShop } = this.state
return ( return (
<View className='individualCenter'> <View className='individualCenter'>
<View className='avatar'> <View className='avatar'>
@ -135,7 +136,7 @@ class IndividualCenter extends Component {
<View className='user-name'> <View className='user-name'>
<View className='name'> <View className='name'>
{username}</View> {username}</View>
<View className='badge'>????</View> <View className='badge'>{vip_level}</View>
</View> </View>
</View> </View>
<View className='client-container'> <View className='client-container'>
@ -146,21 +147,21 @@ class IndividualCenter extends Component {
/> />
</View> </View>
<View className='row'> <View className='row'>
<View className='title'>收藏的宝贝</View>| {/* <View className='title'></View>|
<View className='title'>收藏的店铺</View>| <View className='title'>收藏的店铺</View>|
<View className='title'>我的足迹</View> <View className='title'>我的足迹</View> */}
</View> </View>
<AtList> <AtList>
<AtListItem hasBorder={false} title='业主中心' onClick={this.handlerTitleBarClick.bind(this)} extraText='更多' arrow='right' /> <AtListItem hasBorder={false} title='业主中心' onClick={this.handlerTitleBarClick.bind(this)} extraText=''/>
</AtList> </AtList>
<AtGrid hasBorder={false} data={client} columnNum={4} onClick={this.handlerGridClick.bind(this)} /> <AtGrid hasBorder={false} data={client} columnNum={4} onClick={this.handlerGridClick.bind(this)} />
</View> </View>
{isShop ? <View className='seller-container'> {isShop ? <View className='seller-container'>
<AtList> <AtList>
<AtListItem hasBorder={false} title='店铺中心' onClick={this.handlerTitleBarClick.bind(this)} extraText='更多' arrow='right' /> <AtListItem hasBorder={false} title='店铺中心' onClick={this.handlerTitleBarClick.bind(this)} extraText=''/>
</AtList> </AtList>
<AtGrid hasBorder={false} data={seller} columnNum={4} onClick={this.handlerGridClick.bind(this)} /> <AtGrid hasBorder={false} data={seller} columnNum={4} onClick={this.handlerGridClick.bind(this)} />
</View> : <View />} </View> : <View />}
<View className='logout' onClick={this.handleLogoutClick.bind(this)}> <View className='logout' onClick={this.handleLogoutClick.bind(this)}>
{/* <AtButton type='primary' size='normal'>退出</AtButton> */} {/* <AtButton type='primary' size='normal'>退出</AtButton> */}

View File

@ -7,13 +7,19 @@
display: flex; display: flex;
.user-name{ .user-name{
display: flex; display: flex;
font-size: 25rpx; font-size: 30rpx;
color: #FFFFFF; color: #FFFFFF;
height:40rpx;
.name{ .name{
margin-left: 15rpx margin-left: 15rpx
} }
.badge{ .badge{
margin-left: 15rpx margin-left: 15rpx;
background-color: #BFB899;
line-height: 40rpx;
padding-left:10rpx;
padding-right:10rpx;
} }
} }
} }

View File

@ -261,6 +261,7 @@ class MyGoodList extends Component {
} }
}).then(res => { }).then(res => {
let responseData = JSON.parse(res.data) let responseData = JSON.parse(res.data)
Taro.hideLoading()
if (responseData.err_code === 0) { if (responseData.err_code === 0) {
this.setState({ this.setState({
isCheckAll: false, isCheckAll: false,
@ -307,6 +308,7 @@ class MyGoodList extends Component {
} }
}).then(res => { }).then(res => {
let responseData = JSON.parse(res.data) let responseData = JSON.parse(res.data)
Taro.hideLoading()
if (responseData.err_code === 0) { if (responseData.err_code === 0) {
Taro.showToast({ Taro.showToast({
title: '删除成功', title: '删除成功',
@ -373,7 +375,11 @@ class MyGoodList extends Component {
} }
// 产品排序 // 产品排序
accendingDescending(value) { accendingDescending(e) {
Taro.showLoading({
title: '加载中'
})
const value = e.currentTarget.dataset.eTapAA
this.setState({ selectedFilterValue: value }) this.setState({ selectedFilterValue: value })
if (value == 0) { if (value == 0) {
this.setState({ this.setState({
@ -484,10 +490,11 @@ class MyGoodList extends Component {
// 单个商品选择 // 单个商品选择
handleCheckChange(Id) { handleCheckChange(e) {
//如果goodid 一样的那么checked 就取反 //如果goodid 一样的那么checked 就取反
const id = e.currentTarget.dataset.eTapAA
const newMyGoodList = this.state.myGoodList.map((item) => { const newMyGoodList = this.state.myGoodList.map((item) => {
if (item.goods_id === Id) { if (item.goods_id === id) {
item.checked = !item.checked item.checked = !item.checked
} }
return item return item
@ -558,6 +565,9 @@ class MyGoodList extends Component {
checkedGoodsId.push(item.goods_id) checkedGoodsId.push(item.goods_id)
} }
}); });
Taro.showLoading({
title: '加载中'
})
this.deleteGood({ goodsID: checkedGoodsId }) this.deleteGood({ goodsID: checkedGoodsId })
} }
deleteModalClose() { deleteModalClose() {
@ -576,6 +586,9 @@ class MyGoodList extends Component {
checkedGoodsId.push(item.goods_id) checkedGoodsId.push(item.goods_id)
} }
}); });
Taro.showLoading({
title: '加载中'
})
this.changeGoodState({ goodsID: checkedGoodsId }) this.changeGoodState({ goodsID: checkedGoodsId })
} }
offStockModalClose() { offStockModalClose() {
@ -592,7 +605,6 @@ class MyGoodList extends Component {
Taro.getSystemInfo().then(res => { Taro.getSystemInfo().then(res => {
return res return res
}).then(res => { }).then(res => {
console.log('res', res)
this.setState({ this.setState({
screenWidth: res.screenWidth - 80 + 'px', screenWidth: res.screenWidth - 80 + 'px',
screenHeight: res.screenHeight - 200 + 'px' screenHeight: res.screenHeight - 200 + 'px'

View File

@ -46,7 +46,7 @@ class MyGoodsEdit extends Component {
} }
}) })
.then(res => { .then(res => {
console.log('res',res) Taro.hideLoading()
if (res.data.err_code === 0) { if (res.data.err_code === 0) {
console.log('商品详情获取成功', res) console.log('商品详情获取成功', res)
@ -238,7 +238,6 @@ class MyGoodsEdit extends Component {
'X-Requested-With': 'XMLHttpRequest' 'X-Requested-With': 'XMLHttpRequest'
}, },
success(response) { success(response) {
const data = JSON.parse(response.data) const data = JSON.parse(response.data)
if (data.err_code === 0) { if (data.err_code === 0) {
console.log('imagedata', data) console.log('imagedata', data)
@ -365,6 +364,9 @@ class MyGoodsEdit extends Component {
componentDidMount() { componentDidMount() {
Taro.showLoading({
title:'加载中'
})
this.getGoodsInfo() this.getGoodsInfo()
} }

View File

@ -264,7 +264,8 @@ class MyNeeds extends Component {
url: '/pages/myNeedsEdit/myNeedsEdit?id=' + id url: '/pages/myNeedsEdit/myNeedsEdit?id=' + id
}) })
} }
deleteButton(item) { deleteButton(e) {
const item = e.currentTarget.dataset.eTapAA
this.setState({ isDeleteModal: true, needsItem: item }) this.setState({ isDeleteModal: true, needsItem: item })
} }
handleWindowModCancel() { handleWindowModCancel() {

View File

@ -263,7 +263,6 @@ class MyNeedsPublish extends Component {
// this.getSupplyDemandInfo() // this.getSupplyDemandInfo()
// 如果路由参数为1 就默认显示 效果图,反之 显示业主需求 // 如果路由参数为1 就默认显示 效果图,反之 显示业主需求
const isRenderingPic = this.$router.params.id const isRenderingPic = this.$router.params.id
console.log(parseInt(isRenderingPic))
if (parseInt(isRenderingPic)) { if (parseInt(isRenderingPic)) {
this.setState({ needsTypeSelected: { name: '效果图', id: '5' } }) this.setState({ needsTypeSelected: { name: '效果图', id: '5' } })
} }

View File

@ -138,6 +138,7 @@ class MySupplyDemand extends Component {
} }
}) })
.then(res => { .then(res => {
Taro.hideLoading()
if (res.data.err_code == 0) { if (res.data.err_code == 0) {
console.log('删除成功') console.log('删除成功')
Taro.showToast({ Taro.showToast({
@ -224,13 +225,18 @@ class MySupplyDemand extends Component {
} }
handleWindowConfirm() { handleWindowConfirm() {
this.setState({ isConfirmWindow: false }) this.setState({ isConfirmWindow: false })
Taro.showLoading({
title: '加载中'
})
this.onDelete({ sdID: this.state.demandSupplyId }) this.onDelete({ sdID: this.state.demandSupplyId })
} }
// 删除我的供求 // 删除我的供求
handleOnDelete(id, itemName) { handleOnDelete(e) {
this.setState({ isConfirmWindow: true, demandSupplyItemName: itemName, demandSupplyId: id }) const title = e.currentTarget.dataset.eTapAA.sd_title
const id = e.currentTarget.dataset.eTapAA.sd_id
this.setState({ isConfirmWindow: true, demandSupplyItemName: title, demandSupplyId: id })
} }
@ -260,7 +266,6 @@ class MySupplyDemand extends Component {
Taro.getSystemInfo().then(res => { Taro.getSystemInfo().then(res => {
return res return res
}).then(res => { }).then(res => {
console.log('res', res)
this.setState({ this.setState({
screenWidth: res.screenWidth - 80 + 'px', screenWidth: res.screenWidth - 80 + 'px',
screenHeight: res.screenHeight - 200 + 'px' screenHeight: res.screenHeight - 200 + 'px'
@ -370,7 +375,7 @@ class MySupplyDemand extends Component {
<View className='button' onClick={this.goToMyDSEditPage.bind(this, item.sd_id)} > <View className='button' onClick={this.goToMyDSEditPage.bind(this, item.sd_id)} >
<Button size='mini' className='button-orange button-no-margin'>编辑</Button> <Button size='mini' className='button-orange button-no-margin'>编辑</Button>
</View> </View>
<View className='button' onClick={this.handleOnDelete.bind(this, item.sd_id, item.sd_title)}> <View className='button' onClick={this.handleOnDelete.bind(this, item)}>
<Button size='mini' className='button-dark-red button-no-margin'>删除</Button> <Button size='mini' className='button-dark-red button-no-margin'>删除</Button>
</View> </View>
</View> </View>

View File

@ -351,7 +351,8 @@ class Shop extends Component {
// 产品排序 // 产品排序
accendingDescending(value) { accendingDescending(e) {
const value = e.currentTarget.dataset.eTapAA
Taro.showLoading({ title: '加载中' }) Taro.showLoading({ title: '加载中' })
this.setState({ selectedFilterValue: value }) this.setState({ selectedFilterValue: value })
if (value == 0) { if (value == 0) {

View File

@ -93,6 +93,7 @@ class SupplyDemandView extends Component {
} }
}) })
.then(res => { .then(res => {
Taro.hideLoading()
if (res.data.err_code == 0) { if (res.data.err_code == 0) {
console.log('删除成功') console.log('删除成功')
Taro.showToast({ Taro.showToast({
@ -151,6 +152,9 @@ class SupplyDemandView extends Component {
} }
handleWindowConfirm() { handleWindowConfirm() {
this.setState({ isDeleteModal: false }) this.setState({ isDeleteModal: false })
Taro.showLoading({
title: '加载中'
})
this.onDelete({ sdID: this.state.itemId }) this.onDelete({ sdID: this.state.itemId })
} }

View File

@ -1,13 +1,15 @@
const LOCALURL = "http://192.168.1.230/" const LOCALURL = "http://192.168.1.230/"
// const LOCALURL = "https://www.ihome6.com/" // const LOCALURL = "https://www.ihome6.com/"
const URL = { const URL = {
Base: LOCALURL, Base: LOCALURL,
Login: LOCALURL + 'Applet-login', //登入接口 Login: LOCALURL + 'Applet-login', //微信登入接口
StandardLogin: LOCALURL+ 'user-login', // 使用用户名和密码登入
LogOut:LOCALURL+'User-ajaxLoginOut',//退出接口
ShopWxStore: LOCALURL + 'Shop-ajaxStore', //商城首页信息 ShopWxStore: LOCALURL + 'Shop-ajaxStore', //商城首页信息
ShopSupplyShops: LOCALURL + 'Shop-supplyShops',// 商城店铺信息 ShopSupplyShops: LOCALURL + 'Shop-supplyShops',// 商城店铺信息
GrabDemand: LOCALURL + 'Supply-grabDemand',// 抢单接口 GrabDemand: LOCALURL + 'Supply-grabDemand',// 抢单接口
GetVoucherInfo: LOCALURL + 'Shop-couponsTips',// 优惠信息 GetVoucherInfo: LOCALURL + 'Shop-couponsTips',// 优惠信息
GetConsultInfo: LOCALURL + 'Shop-consultTips',// 咨询信息 GetConsultInfo: LOCALURL + 'Shop-consultTips',// 咨询信息
BuyConsult: LOCALURL + 'Shop-consult',// 购买咨询 BuyConsult: LOCALURL + 'Shop-consult',// 购买咨询
GetShopItemDetail: LOCALURL + 'GoodsQuery-ajaxGoodsDetail',// 商品详情 GetShopItemDetail: LOCALURL + 'GoodsQuery-ajaxGoodsDetail',// 商品详情

27
src/util/logout.js Normal file
View File

@ -0,0 +1,27 @@
import Taro from '@tarojs/taro'
import URL from '../serviceAPI.config'
export default function logout() {
Taro.request({
url:URL.LogOut,
header: {
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
}
}).then(res=>{
Taro.showToast({
title:'退出成功'
})
Taro.clearStorageSync()
setTimeout(() => {
Taro.reLaunch({
url: '/pages/login/login'
})
}, 2000);
}).catch(err=>{
Taro.showToast({
title:'退出失败',
icon:'none'
})
Taro.clearStorageSync()
})
}

View File

@ -25,7 +25,7 @@ const setUserInfoToStorage = () => {
export default function standardLogin(username, password) { export default function standardLogin(username, password) {
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
Taro.request({ Taro.request({
url: URL.Base + 'user-login', url: URL.StandardLogin,
method: 'POST', method: 'POST',
dataType: 'json', dataType: 'json',
data: { data: {
@ -38,6 +38,7 @@ export default function standardLogin(username, password) {
} }
}) })
.then(res => { .then(res => {
console.log('普通登录',res)
if (res.data.err_code === 0) { if (res.data.err_code === 0) {
Taro.showToast({ Taro.showToast({
title: '登入成功', title: '登入成功',

BIN
weapp.rar

Binary file not shown.