Browse Source

对接接口

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


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

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


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

@ -72,7 +72,7 @@
mode=""></image> mode=""></image>
<view class="shopInfo"> <view class="shopInfo">
<view class="title"> <view class="title">
HOUS水洗店
{{bindShop.name}}
</view> </view>
<view class="tags"> <view class="tags">
<view class="tag"> <view class="tag">
@ -84,9 +84,11 @@
</view> </view>
<view class="time"> <view class="time">
9:00-18:00 9:00-18:00
<!-- {{bindShop.address}} -->
</view> </view>
<view class="address"> <view class="address">
长沙市天心区桂花坪街道231号
<!-- 长沙市天心区桂花坪街道231号 -->
{{bindShop.address}}
</view> </view>
</view> </view>
<view class="btns"> <view class="btns">
@ -159,7 +161,8 @@
key : 'worn', key : 'worn',
title : '破损换货', title : '破损换货',
}, },
]
],
bindShop:{},
} }
}, },
onShow() { onShow() {
@ -171,6 +174,8 @@
// //
this.getLaundryStoreHomeData() this.getLaundryStoreHomeData()
}else{ }else{
//
this.getBindShop()
// //
this.getGoodsPage() this.getGoodsPage()
} }
@ -201,6 +206,15 @@
}, },
methods: { methods: {
//
getBindShop(){
this.$api('bindShop', res => {
if(res.code == 200){
this.bindShop = res.result
}
})
},
banner(){ banner(){
this.$api('bannerList', res => { this.$api('bannerList', res => {
if(res.code == 200){ 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 v-for="(item, index) in commodityList" :key="index" class="address-item">
<view class="itme1" @click="selectSp(item)"> <view class="itme1" @click="selectSp(item)">
<view class="left"> <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>
<view class="center"> <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>
<view class="right">×{{item.total}}</view>
<view class="right">×{{item.num}}</view>
</view> </view>
<uv-line></uv-line> <uv-line></uv-line>
</view> </view>
@ -32,24 +32,7 @@
data() { data() {
return { return {
total: 0, 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: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,


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

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


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

@ -100,18 +100,19 @@
// //
submitApplication() { submitApplication() {
this.form.address = this.form.currentRegion + this.form.address
this.$api('applyShopHotel', this.form, res => { this.$api('applyShopHotel', this.form, res => {
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({
title: '申请成功待审核', //
icon: 'success', // 'success', 'loading', 'none'
duration: 1500 // 1500
title: '申请成功待审核', //
icon: 'success', // 'success', 'loading', 'none'
duration: 1500 // 1500
}); });
setTimeout(()=>{
setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url:'/pages/index/center'
url: '/pages/index/center'
}) })
},1500)
}, 1500)
} }
}) })
}, },
@ -123,6 +124,10 @@
this.setAddress(success) this.setAddress(success)
}) })
}) })
Position.getLocationDetail(res => {
console.log(res);
this.form.address = res
})
}, },
// //
@ -133,6 +138,7 @@
if (!res.address && res.name) { // if (!res.address && res.name) { //
return this.form.currentRegion = res.name return this.form.currentRegion = res.name
} }
if (res.address || res.name) { if (res.address || res.name) {
return this.form.currentRegion = 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="itme1" @click="openSpPopup">
<view class="left"> <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>
<view class="center"> <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>
<view class="right">×{{ commodity.total }}</view>
<view class="right">×{{ commodity.num }}</view>
</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="item2">
<view class="type"> <view class="type">
<span>申请类型</span> <span>申请类型</span>
<span>退货退款</span>
<span>{{ titleIndex == 0?'退货退款':'换货'}}</span>
</view> </view>
<uv-line></uv-line> <uv-line></uv-line>
<view class="reason"> <view class="reason">
<view>申请原因</view> <view>申请原因</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> </view>
</view> </view>
@ -39,14 +41,14 @@
<view class="type"> <view class="type">
<span>{{ titleIndex == 0 ? '退货数量' : '换货数量' }}</span> <span>{{ titleIndex == 0 ? '退货数量' : '换货数量' }}</span>
<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> </span>
</view> </view>
<uv-line v-if='titleIndex == 0 ? true :false'></uv-line> <uv-line v-if='titleIndex == 0 ? true :false'></uv-line>
<view class="reason" v-if='titleIndex == 0 ? true :false'> <view class="reason" v-if='titleIndex == 0 ? true :false'>
<view>申请原因</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> </view>
</view> </view>
@ -55,7 +57,7 @@
<view class="item4"> <view class="item4">
<view>申请说明(选填)</view> <view>申请说明(选填)</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>
<view> <view>
<uv-upload :fileList="fileList" :maxCount="5" multiple width="150rpx" height="150rpx" <uv-upload :fileList="fileList" :maxCount="5" multiple width="150rpx" height="150rpx"
@ -69,7 +71,7 @@
<view class="phone"> <view class="phone">
<view>联系电话</view> <view>联系电话</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> </view>
</view> </view>
@ -83,7 +85,7 @@
<!--商品选择--> <!--商品选择-->
<uv-popup ref="spPopup" :round="30"> <uv-popup ref="spPopup" :round="30">
<commoditySelect height="60vh" @selectSp="selectCommodity" ref="commoditySelect"/>
<commoditySelect height="60vh" @selectSp="selectCommodity" ref="commoditySelect" />
</uv-popup> </uv-popup>
</view> </view>
@ -104,7 +106,7 @@
data() { data() {
return { return {
titleIndex: 0, titleIndex: 0,
title: ['申请换货', '申请退货'],
title: ['申请退货', '申请换货'],
fileList: [], fileList: [],
bottomBtnStyle: { bottomBtnStyle: {
color: '#FFF', color: '#FFF',
@ -117,14 +119,25 @@
bottom: '40rpx' bottom: '40rpx'
}, },
commodity: { 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() { onShow() {
console.log("===");
this.$refs.commoditySelect.getList() this.$refs.commoditySelect.getList()
}, },
methods: { methods: {
@ -136,12 +149,33 @@
// 退 // 退
selectCommodity(e) { selectCommodity(e) {
console.log(e, "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.commodity = e
this.$refs.spPopup.close() this.$refs.spPopup.close()
}, },
//退
confirm() { 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) { deleteImage(e) {
this.fileList.splice(e.index, 1) this.fileList.splice(e.index, 1)
@ -180,15 +214,16 @@
display: flex; display: flex;
height: 200rpx; height: 200rpx;
background-color: #ffffff; background-color: #ffffff;
.left { .left {
padding: 20rpx; padding: 20rpx;
width: 150rpx; width: 150rpx;
height: 150rpx; height: 150rpx;
border-radius: 20rpx;
border-radius: 20rpx;
background-color: #ffffff; background-color: #ffffff;
flex-shrink: 0; flex-shrink: 0;
image{
image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 20rpx; border-radius: 20rpx;
@ -215,6 +250,12 @@
font-size: 28rpx; font-size: 28rpx;
color: #666666; color: #666666;
} }
// view
>view:nth-of-type(3) {
font-size: 28rpx;
color: #666666;
}
} }
.right { .right {


Loading…
Cancel
Save