Browse Source

对接接口

master
chenkun 10 months ago
parent
commit
45d2190131
8 changed files with 256 additions and 168 deletions
  1. +37
    -0
      api/api.js
  2. +3
    -3
      components/bottom/bottomBtn.vue
  3. +37
    -4
      pages/index/index.vue
  4. +43
    -22
      pages_order/mine/purse.vue
  5. +46
    -47
      pages_order/mine/runningWater.vue
  6. +86
    -88
      pages_order/order/applyLaundryStore.vue
  7. +3
    -3
      pages_order/order/refundsOrExchange.vue
  8. +1
    -1
      store/store.js

+ 37
- 0
api/api.js View File

@ -123,6 +123,13 @@ const config = {
auth : true, auth : true,
showLoading : true, showLoading : true,
}, },
// 分页查询我的客户
getMyUserPage: {
url: '/shop/user',
method: 'GET',
auth : true,
showLoading : true,
},
//分页查询订单 //分页查询订单
@ -172,6 +179,36 @@ const config = {
method: 'POST', method: 'POST',
showLoading : true, showLoading : true,
}, },
// 申请成为水洗店
applyShopHotel: {
url: '/shop/apply',
method: 'POST',
showLoading : true,
auth : true,
},
// 店铺申请提现
storeWithdrawalApplication: {
url: '/shop/withdrawal/apply',
method: 'POST',
showLoading : true,
auth : true,
},
// 提现日志
withdrawalLog: {
url: '/withdrawal/page',
method: 'GET',
showLoading : true,
auth : true,
},
// 水洗店首页数据
laundryStoreHomeData: {
url: '/shop/index',
method: 'GET',
// showLoading : true,
auth : true,
},
} }


+ 3
- 3
components/bottom/bottomBtn.vue View File

@ -24,16 +24,16 @@
export default { export default {
props: { props: {
color: { color: {
default: '#000000' //
default: '#FFF' //
}, },
backgroundColor: { backgroundColor: {
default: '#FFFFFF' //
default: '#fd5100' //
}, },
fontSize: { fontSize: {
default: '36rpx' // default: '36rpx' //
}, },
text: { text: {
default: '按钮' //
default: '提交' //
}, },
width: { width: {
default: '150rpx' // default: '150rpx' //


+ 37
- 4
pages/index/index.vue View File

@ -41,7 +41,7 @@
v-if="userShop"> v-if="userShop">
<view class="list"> <view class="list">
<view class="item" <view class="item"
v-for="(item, index) in 4"
v-for="(item, index) in userList"
:key="index"> :key="index">
<view class=""> <view class="">
<view class=""> <view class="">
@ -141,16 +141,32 @@
records : [], records : [],
total : 0, total : 0,
}, },
userList:{
records : [],
total : 0,
}
} }
}, },
onShow() { onShow() {
this.getGoodsPage()
// this.getGoodsPage()
this.noticeList() this.noticeList()
this.banner() this.banner()
if(!this.userShop.shop){
//
this.getUserPage()
}else{
//
this.getGoodsPage()
}
}, },
// //
onPullDownRefresh(){ onPullDownRefresh(){
this.getGoodsPage()
if(!this.userShop.shop){
this.getUserPage()
}else{
this.getGoodsPage()
}
this.noticeList() this.noticeList()
this.banner() this.banner()
}, },
@ -158,13 +174,18 @@
onReachBottom() { onReachBottom() {
if(this.queryParams.pageSize < this.productList.total){ if(this.queryParams.pageSize < this.productList.total){
this.queryParams.pageSize += 10 this.queryParams.pageSize += 10
this.getGoodsPage()
if(!this.userShop.shop){
this.getUserPage()
}else{
this.getGoodsPage()
}
} }
}, },
computed : { computed : {
...mapGetters(['userShop']), ...mapGetters(['userShop']),
}, },
methods: { methods: {
banner(){ banner(){
this.$api('bannerList', res => { this.$api('bannerList', res => {
if(res.code == 200){ if(res.code == 200){
@ -179,11 +200,23 @@
} }
}) })
}, },
//
getGoodsPage(){ getGoodsPage(){
this.$api('goodsPage', this.queryParams, res => { this.$api('goodsPage', this.queryParams, res => {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
if(res.code == 200){ if(res.code == 200){
this.productList = res.result this.productList = res.result
console.log("===getGoodsPage==");
}
})
},
//
getUserPage(){
this.$api('getMyUserPage', this.queryParams, res => {
uni.stopPullDownRefresh()
if(res.code == 200){
this.userList = res.result
console.log("===getUserPage==");
} }
}) })
}, },


+ 43
- 22
pages_order/mine/purse.vue View File

@ -10,27 +10,30 @@
<view class="from-body"> <view class="from-body">
<view>我要提现</view> <view>我要提现</view>
<view class="from-line"> <view class="from-line">
<input placeholder="请输入提现金额" />
<input v-model="form.money" placeholder="请输入提现金额" />
</view> </view>
<view class="from-line"> <view class="from-line">
<input placeholder="请输入姓名" />
<input v-model="form.name" placeholder="请输入姓名" />
</view> </view>
<view class="from-line"> <view class="from-line">
<input placeholder="请输入开户行" />
<input v-model="form.phone" placeholder="请输入手机号" />
</view> </view>
<view class="from-line"> <view class="from-line">
<input placeholder="请输入银行卡卡号" />
<input v-model="form.bankAddress" placeholder="请输入开户行" />
</view>
<view class="from-line">
<input v-model="form.bankCard" placeholder="请输入银行卡卡号" />
</view> </view>
<view class="mt56">提现说明</view> <view class="mt56">提现说明</view>
<view style="line-height: 45rpx; font-size: 24rpx;color: #666666;" v-html="notice"> <view style="line-height: 45rpx; font-size: 24rpx;color: #666666;" v-html="notice">
</view> </view>
<!-- <p>1本次提现必须通过银行卡提现暂不支持其他途径</p>
<p>2如若遇到24小时提现未到账请联系客服</p> -->
<view style="font-size: 28rpx;height: 40rpx;font-weight: 400;pad: 10rpx;">1本次提现必须通过银行卡提现暂不支持其他途径</view>
<view style="font-size: 28rpx;height: 40rpx;font-weight: 400;">2如若遇到24小时提现未到账请联系客服</view>
</view> </view>
<view class="b-fiexd"> <view class="b-fiexd">
<view class="button-submit">提交</view>
<view class="button-submit" @click="submit">提交</view>
</view> </view>
</view> </view>
@ -44,43 +47,62 @@
}, },
data() { data() {
return { return {
notice : ''
notice: '',
form: {
name: '',
phone: '',
money: '',
bankCard: '',
bankAddress: '',
}
} }
}, },
methods: { methods: {
submit() {
this.$api('storeWithdrawalApplication', this.queryParams, res => {
if (res.code == 200) {
uni.navigateBack(-1)
}
})
},
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.purse{
.purse {
min-height: 100vh; min-height: 100vh;
background-color: #ffffff; background-color: #ffffff;
// padding: 0 0 10rpx 0;
.from-body { .from-body {
padding: 40rpx 20rpx;
padding: 40rpx 20rpx 0rpx 20rpx;
font-size: 28rpx; font-size: 28rpx;
font-family: PingFang SC, PingFang SC-Bold; font-family: PingFang SC, PingFang SC-Bold;
font-weight: 700; font-weight: 700;
text-align: left; text-align: left;
color: #333333; color: #333333;
line-height: 40px;
// line-height: 40px;
padding-bottom: 160rpx; padding-bottom: 160rpx;
.from-line { .from-line {
margin-top: 40rpx; margin-top: 40rpx;
} }
.mt56 {
margin-top: 30rpx;
}
input { input {
width: 612rpx; width: 612rpx;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
background: #F5F5F5; background: #F5F5F5;
border-radius: 46rpx; border-radius: 46rpx;
padding: 0 50rpx; padding: 0 50rpx;
font-size: 28rpx; font-size: 28rpx;
font-family: PingFang SC, PingFang SC-Regular; font-family: PingFang SC, PingFang SC-Regular;
font-weight: 400; font-weight: 400;
@ -88,22 +110,21 @@
color: #333; color: #333;
} }
} }
.button-submit { .button-submit {
width: 596rpx; width: 596rpx;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
background: $uni-color; background: $uni-color;
border-radius: 46rpx; border-radius: 46rpx;
margin: 20rpx auto; margin: 20rpx auto;
font-size: 28rpx;
font-size: 36rpx;
font-family: PingFang SC, PingFang SC-Regular; font-family: PingFang SC, PingFang SC-Regular;
font-weight: 400; font-weight: 400;
text-align: center; text-align: center;
color: #ffffff; color: #ffffff;
} }
} }
</style> </style>

+ 46
- 47
pages_order/mine/runningWater.vue View File

@ -1,23 +1,17 @@
<template> <template>
<view class="running-water"> <view class="running-water">
<navbar :title="title[status]" leftClick @leftClick="leftClick" /> <navbar :title="title[status]" leftClick @leftClick="leftClick" />
<view class="tab-box"> <view class="tab-box">
<view class="tab-box1" v-if="agentFlow && agentFlow.total"> <view class="tab-box1" v-if="agentFlow && agentFlow.total">
<uv-cell center border :title="item.title"
v-for="(item, index) in agentFlow.records"
:value="x[item.type] + item.money" :label="item.createTime" />
<uv-cell center border :title="item.title" v-for="(item, index) in agentFlow.records"
:value="x[item.type] + item.money" :label="item.createTime" />
</view> </view>
<view
style="padding: 100rpx 0;"
v-else>
<uv-empty
mode="history"
textSize="28rpx"
iconSize="100rpx"/>
<view style="padding: 100rpx 0;" v-else>
<uv-empty mode="history" textSize="28rpx" iconSize="100rpx" />
</view> </view>
</view> </view>
</view> </view>
</template> </template>
@ -25,45 +19,49 @@
export default { export default {
data() { data() {
return { return {
title : ['余额记录','提现记录','佣金记录'],
agentFlow : {
total : 0,
records : [
{
type : 0,
money : 100,
createTime : '2024-04-02 20:00',
title : "佣金提现",
title: ['余额记录', '提现记录', '佣金记录'],
agentFlow: {
total: 1,
records: [{
type: 0,
money: 100,
createTime: '2024-04-02 20:00',
title: "佣金提现",
}, },
{ {
type : 0,
money : 100,
createTime : '2024-04-02 20:00',
title : "佣金提现",
type: 0,
money: 100,
createTime: '2024-04-02 20:00',
title: "佣金提现",
}, },
{ {
type : 0,
money : 100,
createTime : '2024-04-02 20:00',
title : "佣金提现",
type: 0,
money: 100,
createTime: '2024-04-02 20:00',
title: "佣金提现",
}, },
] ]
}, },
x : ['+', '-' , '-' , '+'],
status : 0,
x: ['+', '-', '-', '+'],
status: 0,
} }
}, },
onLoad(e) { onLoad(e) {
this.status = e.status this.status = e.status
}, },
onShow() {
this.getAgentFlow()
},
methods: { methods: {
leftClick() { //
leftClick() { //
uni.navigateBack(-1) uni.navigateBack(-1)
}, },
getAgentFlow(){ //
getAgentFlow() { //( )
let type = this.status; let type = this.status;
this.$api('getAgentFlow', { type }, res => {
if(res.code == 200){
this.$api('withdrawalLog', {
type
}, res => {
if (res.code == 200) {
this.agentFlow = res.result this.agentFlow = res.result
} }
}) })
@ -73,16 +71,17 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.running-water{
width: 750rpx;
background: #F5F5F5;
margin: 0 auto;
min-height: 100vh;
.tab-box{
margin: 20rpx;
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
.running-water {
width: 750rpx;
background: #F5F5F5;
margin: 0 auto;
min-height: 100vh;
.tab-box {
margin: 20rpx;
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
}
} }
}
</style>
</style>

+ 86
- 88
pages_order/order/applyLaundryStore.vue View File

@ -5,45 +5,48 @@
<view class="frame"> <view class="frame">
<view class="title"> <view class="title">
<span style="width: 10rpx;height: 40rpx;background-color: #f78142;border-radius: 10rpx;overflow: hidden;"></span>
<span
style="width: 10rpx;height: 40rpx;background-color: #f78142;border-radius: 10rpx;overflow: hidden;"></span>
<span>店铺信息</span> <span>店铺信息</span>
</view> </view>
<view class="shopName"> <view class="shopName">
<view>店铺名称</view> <view>店铺名称</view>
<view> <view>
<input placeholder="请输入店铺名称" clearable></input>
<input v-model="form.name" placeholder="请输入店铺名称" clearable></input>
</view> </view>
</view> </view>
<view class="shopName"> <view class="shopName">
<view>您的姓名</view> <view>您的姓名</view>
<view> <view>
<input placeholder="请输入您的姓名" clearable></input>
<input v-model="form.userName" placeholder="请输入您的姓名" clearable></input>
</view> </view>
</view> </view>
<view class="shopName"> <view class="shopName">
<view>联系方式</view> <view>联系方式</view>
<view> <view>
<input placeholder="请输入联系方式" clearable></input>
<input v-model="form.phone" type="number" placeholder="请输入联系方式" clearable></input>
</view> </view>
</view> </view>
<view class="currentRegion"> <view class="currentRegion">
<view>所在地区</view> <view>所在地区</view>
<view @click="open">
湖南省
<view>
<input class="input" v-model="form.currentRegion" placeholder="请选择所在地区"></input>
<view class="orientation" @click.stop="selectAddr">
定位
<image src="../static/address/selectIcon.png"
style="width:30rpx;height: 30rpx;margin:5rpx 5rpx 5rpx 5rpx;"></image>
</view>
</view> </view>
</view> </view>
<view class="shopName"> <view class="shopName">
<view>详细地址</view> <view>详细地址</view>
<view> <view>
<input placeholder="请输入详细地址" clearable></input>
<input v-model="form.address" placeholder="详细地址" clearable></input>
</view> </view>
</view> </view>
</view> </view>
<!-- 省市区三级联动 -->
<uv-picker ref="provinceCityDistrictLinkageRef" :columns="addressList" :loading="loading" keyName="name"
@change="change" @confirm="confirm">
</uv-picker>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<bottomBtn @confirm='submitApplication()' :color='bottomBtnStyle.color' <bottomBtn @confirm='submitApplication()' :color='bottomBtnStyle.color'
@ -57,6 +60,7 @@
</template> </template>
<script> <script>
import Position from '@/utils/position.js'
import bottomBtn from "../../components/bottom/bottomBtn.vue" import bottomBtn from "../../components/bottom/bottomBtn.vue"
export default { export default {
components: { components: {
@ -64,12 +68,16 @@
}, },
data() { data() {
return { return {
loading: true,
provinces: [], //
citys: [], //
areas: [], //
pickerValue: [0, 0, 0],
defaultValue: [3442, 1, 2],
form: {
userName: '',
name: '',
phone: '',
currentRegion: '',
address: '',
latitude: '',
longitude: '',
},
bottomBtnStyle: { bottomBtnStyle: {
color: '#FFF', color: '#FFF',
backgroundColor: '#fd5100', backgroundColor: '#fd5100',
@ -83,84 +91,56 @@
} }
}, },
computed: { computed: {
addressList() {
return [this.provinces, this.citys, this.areas];
}
}, },
mounted() {
this.getprovinceCityDistrictLinkageData();
onShow() {
}, },
methods: { methods: {
// //
submitApplication() { submitApplication() {
},
getprovinceCityDistrictLinkageData() {
uni.request({
method: 'GET',
url: '/static/uvui/example/regions.json',
success: res => {
const {
statusCode,
data
} = res
if (statusCode === 200) {
console.log('获取的数据:', res);
this.provinces = data.sort((left, right) => (Number(left.code) > Number(right
.code) ? 1 : -1));
console.log(this.provinces)
this.handlePickValueDefault()
setTimeout(() => {
this.loading = false
}, 200)
}
this.$api('applyShopHotel', this.form, res => {
if (res.code == 200) {
uni.showToast({
title: '申请成功待审核', //
icon: 'success', // 'success', 'loading', 'none'
duration: 1500 // 1500
});
setTimeout(()=>{
uni.navigateTo({
url:'/pages/index/center'
})
},1500)
} }
}) })
}, },
handlePickValueDefault() {
//
this.pickerValue[0] = this.provinces.findIndex(item => Number(item.id) === this.defaultValue[0]);
//
this.citys = this.provinces[this.pickerValue[0]]?.children || [];
this.pickerValue[1] = this.citys.findIndex(item => Number(item.id) === this.defaultValue[1]);
//
this.areas = this.citys[this.pickerValue[1]]?.children || [];
this.pickerValue[2] = this.areas.findIndex(item => Number(item.id) === this.defaultValue[2]);
//
this.$refs.provinceCityDistrictLinkageRef.setIndexs([this.pickerValue[0], this.pickerValue[1], this
.pickerValue[2]
], true);
//
selectAddr() {
Position.getLocation(res => {
Position.selectAddress(res.longitude, res.latitude, success => {
this.setAddress(success)
})
})
}, },
change(e) {
if (this.loading) return;
const {
columnIndex,
index,
indexs
} = e
//
if (columnIndex === 0) {
this.citys = this.provinces[index]?.children || []
this.areas = this.citys[0]?.children || []
this.$refs.provinceCityDistrictLinkageRef.setIndexs([index, 0, 0], true)
} else if (columnIndex === 1) {
this.areas = this.citys[index]?.children || []
this.$refs.provinceCityDistrictLinkageRef.setIndexs(indexs, true)
//
setAddress(res) {
//
this.form.latitude = res.latitude
this.form.longitude = res.longitude
if (!res.address && res.name) { //
return this.form.currentRegion = res.name
} }
if (res.address || res.name) {
return this.form.currentRegion = res.address + res.name
}
this.form.currentRegion = '' //
}, },
open() {
this.$refs.provinceCityDistrictLinkageRef.open();
this.handlePickValueDefault()
},
confirm(e) {
console.log('确认选择的地区:', e);
uni.showToast({
icon: 'none',
title: `${e.value[0].name}/${e.value[1].name}/${e.value[2].name}`
})
}
} }
} }
@ -189,7 +169,7 @@
font-size: 34rpx; font-size: 34rpx;
font-weight: 700; font-weight: 700;
padding: 0 0 0 20rpx; padding: 0 0 0 20rpx;
>span:nth-of-type(1) { >span:nth-of-type(1) {
margin: 4rpx 0 0 8rpx; margin: 4rpx 0 0 8rpx;
background-color: #FFF; background-color: #FFF;
@ -219,10 +199,10 @@
// padding: 0 20rpx 0 0; // padding: 0 20rpx 0 0;
border-radius: 10rpx; border-radius: 10rpx;
overflow: hidden; overflow: hidden;
input{
input {
background-color: #f5f5f5; background-color: #f5f5f5;
color: #a4a4a4;
// color: #a4a4a4;
font-size: 28rpx; font-size: 28rpx;
padding: 8rpx 8rpx 8rpx 15rpx; padding: 8rpx 8rpx 8rpx 15rpx;
} }
@ -283,7 +263,25 @@
>view:nth-of-type(2) { >view:nth-of-type(2) {
width: 70%; width: 70%;
padding: 0 20rpx 0 0; padding: 0 20rpx 0 0;
display: flex;
.input {
background-color: #f5f5f5;
// color: #a4a4a4;
font-size: 28rpx;
padding: 8rpx 8rpx 8rpx 15rpx;
width: 300rpx;
}
.orientation {
display: flex;
padding: 10rpx 10rpx 10rpx 20rpx;
font-size: 30rpx;
color: #FBAB32;
}
} }
} }


+ 3
- 3
pages_order/order/refundsOrExchange.vue View File

@ -124,6 +124,7 @@
} }
}, },
onShow() { onShow() {
console.log("===");
this.$refs.commoditySelect.getList() this.$refs.commoditySelect.getList()
}, },
methods: { methods: {
@ -165,14 +166,13 @@
} }
.refundsOrExchange { .refundsOrExchange {
padding: 0 40rpx 0 40rpx;
.frame { .frame {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 30rpx; gap: 30rpx;
width: 100%;
padding-top: 40rpx;
// width: 100%;
padding: 40rpx 40rpx 0 40rpx;
background-color: #f5f5f5; background-color: #f5f5f5;


+ 1
- 1
store/store.js View File

@ -10,7 +10,7 @@ import Position from '@/utils/position.js'
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
configList: [], //配置列表 configList: [], //配置列表
shop : false,
shop : true,
position : {//定位信息 position : {//定位信息
latitude : 0, latitude : 0,
longitude : 0, longitude : 0,


Loading…
Cancel
Save