Browse Source

对接接口

master
chenkun 5 months ago
parent
commit
bb5e4392a1
7 changed files with 208 additions and 147 deletions
  1. +88
    -67
      api/api.js
  2. +19
    -23
      pages/index/center.vue
  3. +17
    -3
      pages/index/index.vue
  4. +6
    -23
      pages_order/components/commodity/commoditySelect.vue
  5. +1
    -1
      pages_order/mine/purse.vue
  6. +12
    -6
      pages_order/order/applyLaundryStore.vue
  7. +65
    -24
      pages_order/order/refundsOrExchange.vue

+ 88
- 67
api/api.js View File

@ -19,71 +19,71 @@ const config = {
bannerList: {
url: '/banner/list',
method: 'GET',
showLoading : true,
showLoading: true,
},
// 公告列表
noticeList: {
url: '/notice/list',
method: 'GET',
showLoading : true,
showLoading: true,
},
// 公告详情
noticeOne: {
url: '/notice/one',
method: 'GET',
showLoading : true,
showLoading: true,
},
// 商品列表
goodsPage: {
url: '/goods/page',
method: 'GET',
showLoading : true,
showLoading: true,
},
// 商品详情
goodsOne: {
url: '/goods/one',
method: 'GET',
showLoading : true,
showLoading: true,
},
// 购物车分页
cartPage: {
url: '/goods/shopping/cart/page',
method: 'GET',
showLoading : true,
auth : true,
showLoading: true,
auth: true,
},
// 加入购物车
cartAdd: {
url: '/goods/join/shopping/cart',
method: 'POST',
showLoading : true,
auth : true,
showLoading: true,
auth: true,
},
// 删除购物车
cartDel: {
url: '/goods/shopping/cart/delete',
method: 'POST',
showLoading : true,
auth : true,
showLoading: true,
auth: true,
},
// 修改购物车数量
cartNum: {
url: '/goods/shopping/cart/add/or/delete',
method: 'POST',
auth : true,
debounce : 1000,
auth: true,
debounce: 1000,
},
//分类列表
categoryList: {
url: '/category/list',
method: 'GET',
showLoading : true,
showLoading: true,
},
//新增地址
@ -91,123 +91,144 @@ const config = {
url: '/address/add',
method: 'POST',
limit: 500,
auth : true,
showLoading : true,
auth: true,
showLoading: true,
},
//修改默认地址
addressDefault: {
url: '/address/default',
method: 'POST',
auth : true,
showLoading : true,
auth: true,
showLoading: true,
},
//删除地址
addressDelete: {
url: '/address/delete',
method: 'POST',
auth : true,
showLoading : true,
auth: true,
showLoading: true,
},
//修改地址
addressEdit: {
url: '/address/edit',
method: 'POST',
limit: 500,
auth : true,
showLoading : true,
auth: true,
showLoading: true,
},
//分页查询地址
addressPage: {
url: '/address/page',
method: 'GET',
auth : true,
showLoading : true,
auth: true,
showLoading: true,
},
// 分页查询我的客户
getMyUserPage: {
url: '/shop/user',
method: 'GET',
auth : true,
showLoading : true,
auth: true,
showLoading: true,
},
//分页查询订单
orderPage: {
url: '/order/page',
method: 'GET',
auth : true,
showLoading : true,
auth: true,
showLoading: true,
},
//查询订单详情
orderOne: {
url: '/order/one',
method: 'GET',
auth : true,
showLoading : true,
auth: true,
showLoading: true,
},
// 微信登录接口
wxLogin: {
url: '/login/login',
method: 'POST',
limit : 500,
showLoading : true,
method: 'POST',
limit: 500,
showLoading: true,
},
// 修改个人信息接口
updateInfo: {
url: '/user/edit',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
auth: true,
limit: 500,
showLoading: true,
},
// 获取用户信息
getInfo: {
url: '/user/info',
method: 'GET',
auth: true,
showLoading : true,
auth: true,
showLoading: true,
},
// 获取我的租赁
getLeasePage: {
url: '/user/lease/page',
method: 'POST',
showLoading : true,
showLoading: true,
},
// 申请成为水洗店
applyShopHotel: {
url: '/shop/apply',
method: 'POST',
showLoading : true,
auth : true,
showLoading: true,
auth: true,
},
// 店铺申请提现
storeWithdrawalApplication: {
url: '/shop/withdrawal/apply',
method: 'POST',
showLoading : true,
auth : true,
showLoading: true,
auth: true,
},
// 提现日志
withdrawalLog: {
url: '/withdrawal/page',
url: '/shop/withdrawal/page',
method: 'GET',
showLoading : true,
auth : true,
showLoading: true,
auth: true,
},
// 水洗店首页数据
laundryStoreHomeData: {
url: '/shop/index',
method: 'GET',
// showLoading : true,
auth : true,
auth: true,
},
// 获取绑定店铺的数据
bindShop: {
url: '/shop/bind',
method: 'GET',
// showLoading : true,
auth: true,
},
// 修改店铺营业时间
updateJobTime: {
url: '/job/time',
method: 'GET',
// showLoading : true,
auth: true,
},
// 退货、换货申请
refundOrder: {
url: '/order/refund',
method: 'POST',
// showLoading : true,
auth: true,
},
}
@ -250,27 +271,27 @@ export function api(key, data, callback, loadingTitle) {
return
}
}
// 接口防抖
if(req.debounce){
if (req.debounce) {
let storageKey = req.url
let storage = debounce[storageKey]
if (storage) {
clearTimeout(storage)
}
debounce[storageKey] = setTimeout(() => {
clearTimeout(storage)
delete debounce[storageKey]
http.http(req.url, data, callback, req.method,
loadingTitle || req.showLoading, loadingTitle || req.loadingTitle)
}, req.debounce)
return
}


+ 19
- 23
pages/index/center.vue View File

@ -34,9 +34,8 @@
我的用户
</view>
<view class="list">
<view class="item"
@click="$utils.navigateTo('/index/order?uid=' + item.id)"
v-for="(item, index) in userList" :key="index">
<view class="item" @click="$utils.navigateTo('/index/order?uid=' + item.id)"
v-for="(item, index) in userList" :key="index">
<view class="name">
客户{{ item.name }}
</view>
@ -85,14 +84,15 @@
</uv-grid-item>
<uv-grid-item @click="$utils.navigateTo('/pages_order/order/refundsOrExchange?index='+0)">
<image class="image" src="/static/image/center/5.png" mode=""></image>
<text class="grid-text"></text>
<image class="image" src="/static/image/center/7.png" mode=""></image>
<text class="grid-text">退</text>
</uv-grid-item>
<uv-grid-item @click="$utils.navigateTo('/pages_order/order/refundsOrExchange?index='+1)">
<image class="image" src="/static/image/center/7.png" mode=""></image>
<text class="grid-text">退</text>
<image class="image" src="/static/image/center/5.png" mode=""></image>
<text class="grid-text"></text>
</uv-grid-item>
</uv-grid>
</view>
<view class="line grid">
@ -113,16 +113,15 @@
<text class="grid-text">租赁车</text>
</uv-grid-item>
<uv-grid-item
@click="$utils.navigateTo('/pages_order/order/applyLaundryStore')">
<uv-grid-item @click="$utils.navigateTo('/pages_order/order/applyLaundryStore')">
<image class="image" src="/static/image/center/7.png" mode=""></image>
<text class="grid-text">申请成为水洗店</text>
</uv-grid-item>
</uv-grid>
</view>
</view>
<customerServicePopup ref="customerServicePopup"/>
<customerServicePopup ref="customerServicePopup" />
<tabber select="4" />
</view>
@ -148,29 +147,29 @@
},
data() {
return {
userList : [],
userList: [],
queryParams: {
pageNo: 1,
pageSize: 10,
title: '',
},
total : 0,
total: 0,
}
},
onShow() {
this.$store.commit('getUserInfo')
//
if(this.userShop){
if (this.userShop) {
this.getUserPage()
}
},
//
onReachBottom() {
if(this.queryParams.pageSize < this.total){
if (this.queryParams.pageSize < this.total) {
this.queryParams.pageSize += 10
//
if(this.userShop){
if (this.userShop) {
this.getUserPage()
}
}
@ -188,10 +187,10 @@
})
},
//
getUserPage(){
getUserPage() {
this.$api('getMyUserPage', this.queryParams, res => {
uni.stopPullDownRefresh()
if(res.code == 200){
if (res.code == 200) {
this.userList = res.result.records
this.total = res.result.total
console.log("===getUserPage==");
@ -203,10 +202,7 @@
</script>
<style scoped lang="scss">
.page {
}
.page {}
image {
width: 100%;


+ 17
- 3
pages/index/index.vue View File

@ -72,7 +72,7 @@
mode=""></image>
<view class="shopInfo">
<view class="title">
HOUS水洗店
{{bindShop.name}}
</view>
<view class="tags">
<view class="tag">
@ -84,9 +84,11 @@
</view>
<view class="time">
9:00-18:00
<!-- {{bindShop.address}} -->
</view>
<view class="address">
长沙市天心区桂花坪街道231号
<!-- 长沙市天心区桂花坪街道231号 -->
{{bindShop.address}}
</view>
</view>
<view class="btns">
@ -159,7 +161,8 @@
key : 'worn',
title : '破损换货',
},
]
],
bindShop:{},
}
},
onShow() {
@ -171,6 +174,8 @@
//
this.getLaundryStoreHomeData()
}else{
//
this.getBindShop()
//
this.getGoodsPage()
}
@ -201,6 +206,15 @@
},
methods: {
//
getBindShop(){
this.$api('bindShop', res => {
if(res.code == 200){
this.bindShop = res.result
}
})
},
banner(){
this.$api('bannerList', res => {
if(res.code == 200){


+ 6
- 23
pages_order/components/commodity/commoditySelect.vue View File

@ -4,14 +4,14 @@
<view v-for="(item, index) in commodityList" :key="index" class="address-item">
<view class="itme1" @click="selectSp(item)">
<view class="left">
<image src="https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg" mode="aspectFill"/>
<image :src="item.goodsPic" mode="aspectFill"/>
</view>
<view class="center">
<view>{{ item.title }}</view>
<view>{{ item.smallTitle }}</view>
<view>起租时间2024.03.02</view>
<view>{{ item.goodsName }}</view>
<view>规格:{{ item.sku }}</view>
<view>下单时间:{{item.startTime}}</view>
</view>
<view class="right">×{{item.total}}</view>
<view class="right">×{{item.num}}</view>
</view>
<uv-line></uv-line>
</view>
@ -32,24 +32,7 @@
data() {
return {
total: 0,
commodityList: [
{
title: '商品名称',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total: 1,
},
{
title: '商品名称1',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total: 1,
},
{
title: '商品名称2',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total: 1,
}
],
commodityList: [],
queryParams: {
pageNo: 1,
pageSize: 10,


+ 1
- 1
pages_order/mine/purse.vue View File

@ -59,7 +59,7 @@
},
methods: {
submit() {
this.$api('storeWithdrawalApplication', this.queryParams, res => {
this.$api('storeWithdrawalApplication', this.form, res => {
if (res.code == 200) {
uni.navigateBack(-1)
}


+ 12
- 6
pages_order/order/applyLaundryStore.vue View File

@ -100,18 +100,19 @@
//
submitApplication() {
this.form.address = this.form.currentRegion + this.form.address
this.$api('applyShopHotel', this.form, res => {
if (res.code == 200) {
uni.showToast({
title: '申请成功待审核', //
icon: 'success', // 'success', 'loading', 'none'
duration: 1500 // 1500
title: '申请成功待审核', //
icon: 'success', // 'success', 'loading', 'none'
duration: 1500 // 1500
});
setTimeout(()=>{
setTimeout(() => {
uni.navigateTo({
url:'/pages/index/center'
url: '/pages/index/center'
})
},1500)
}, 1500)
}
})
},
@ -123,6 +124,10 @@
this.setAddress(success)
})
})
Position.getLocationDetail(res => {
console.log(res);
this.form.address = res
})
},
//
@ -133,6 +138,7 @@
if (!res.address && res.name) { //
return this.form.currentRegion = res.name
}
if (res.address || res.name) {
return this.form.currentRegion = res.address + res.name


+ 65
- 24
pages_order/order/refundsOrExchange.vue View File

@ -7,29 +7,31 @@
<!-- 商品简介 -->
<view class="itme1" @click="openSpPopup">
<view class="left">
<image src="https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg" mode="aspectFill"/>
<image :src="commodity.goodsPic" mode="aspectFill" />
</view>
<view class="center">
<view>{{ commodity.title }}</view>
<view>{{ commodity.smallTitle }}</view>
<view>{{ commodity.goodsName }}</view>
<view>商品规格:{{ commodity.sku }}</view>
<view>下单时间:{{ commodity.startTime }}</view>
</view>
<view class="right">×{{ commodity.total }}</view>
<view class="right">×{{ commodity.num }}</view>
</view>
<!--<commoditySelect ></commoditySelect>-->
<!-- 暂未选择商品的时候 -->
<!-- <view v-else style="height: 200rpx;;display: flex;justify-content: center;align-items: center;font-size: 36px;">
请选择商品...
</view> -->
<!-- 申请类型&申请原因 -->
<view class="item2">
<view class="type">
<span>申请类型</span>
<span>退货退款</span>
<span>{{ titleIndex == 0?'退货退款':'换货'}}</span>
</view>
<uv-line></uv-line>
<view class="reason">
<view>申请原因</view>
<view>
<uv-input placeholder="请输入申请原因" border="none" clearable></uv-input>
<uv-input v-model="form.reason" placeholder="请输入申请原因" border="none" clearable></uv-input>
</view>
</view>
</view>
@ -39,14 +41,14 @@
<view class="type">
<span>{{ titleIndex == 0 ? '退货数量' : '换货数量' }}</span>
<span>
<uv-number-box :min="1" :max="100"></uv-number-box>
<uv-number-box v-model="form.refundNum" :min="1" :max="commodity.num"></uv-number-box>
</span>
</view>
<uv-line v-if='titleIndex == 0 ? true :false'></uv-line>
<view class="reason" v-if='titleIndex == 0 ? true :false'>
<view>申请原因</view>
<view>申请金额</view>
<view>
<uv-input disabled placeholder="$" border="none" clearable></uv-input>
<uv-input v-model="form.reasonPrice" disabled border="none" clearable></uv-input>
</view>
</view>
</view>
@ -55,7 +57,7 @@
<view class="item4">
<view>申请说明(选填)</view>
<view>
<uv-input placeholder="请您详细填写申请说明" border="none" clearable></uv-input>
<uv-input v-model="form.reasonInfo" placeholder="请您详细填写申请说明" border="none" clearable></uv-input>
</view>
<view>
<uv-upload :fileList="fileList" :maxCount="5" multiple width="150rpx" height="150rpx"
@ -69,7 +71,7 @@
<view class="phone">
<view>联系电话</view>
<view>
<uv-input placeholder="请输入联系电话" border="none" clearable></uv-input>
<uv-input v-model="form.phone" placeholder="请输入联系电话" border="none" clearable></uv-input>
</view>
</view>
</view>
@ -83,7 +85,7 @@
<!--商品选择-->
<uv-popup ref="spPopup" :round="30">
<commoditySelect height="60vh" @selectSp="selectCommodity" ref="commoditySelect"/>
<commoditySelect height="60vh" @selectSp="selectCommodity" ref="commoditySelect" />
</uv-popup>
</view>
@ -104,7 +106,7 @@
data() {
return {
titleIndex: 0,
title: ['申请换货', '申请退货'],
title: ['申请退货', '申请换货'],
fileList: [],
bottomBtnStyle: {
color: '#FFF',
@ -117,14 +119,25 @@
bottom: '40rpx'
},
commodity: {
title: '商品名称',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total: 1,
goodsName: '',
sku: '',
num: 0,
startTime: '',
goodsPic: '',
},
form: {
id: "",
phone: "",
reason: "",
reasonInfo: "",
reasonPic: "",
reasonPrice: "",
refundNum: "",
type: '', //0退 1
},
}
},
onShow() {
console.log("===");
this.$refs.commoditySelect.getList()
},
methods: {
@ -136,12 +149,33 @@
// 退
selectCommodity(e) {
console.log(e, "selectCommodity--e")
console.log(e.id, 'e.id');
this.form.id = e.id //ID
this.form.reasonPrice = e.price //退()
this.form.refundNum = e.num //
this.commodity = e
this.$refs.spPopup.close()
},
//退
confirm() {
console.log("===");
this.form.type = this.titleIndex
this.form.reasonPic = this.fileList.map(item=>item.url).join(",")
console.log(this.form, "form");
this.$api('refundOrder', this.form, res => {
if (res.code == 200) {
uni.showToast({
icon: "success",
title: "申请成功"
})
setTimeout(() => {
uni.navigateTo({
url: '/pages/index/center'
})
}, 3000)
}
})
},
deleteImage(e) {
this.fileList.splice(e.index, 1)
@ -180,15 +214,16 @@
display: flex;
height: 200rpx;
background-color: #ffffff;
.left {
padding: 20rpx;
width: 150rpx;
height: 150rpx;
border-radius: 20rpx;
border-radius: 20rpx;
background-color: #ffffff;
flex-shrink: 0;
image{
image {
width: 100%;
height: 100%;
border-radius: 20rpx;
@ -215,6 +250,12 @@
font-size: 28rpx;
color: #666666;
}
// view
>view:nth-of-type(3) {
font-size: 28rpx;
color: #666666;
}
}
.right {


Loading…
Cancel
Save