商铺列表添加长按删除

parent 989b45f0
...@@ -16,3 +16,11 @@ export function applyShop(data) { ...@@ -16,3 +16,11 @@ export function applyShop(data) {
data, data,
}); });
} }
export function deleteShopInfoById(data) {
return request({
url: `/sgyrdd/shop/delByShopId`,
method: 'GET',
data,
});
}
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
v-for="item in list" v-for="item in list"
:key="item.shopId" :key="item.shopId"
@click="item.shopStatus != [1, 2, 3] ? shopGto(item.shopId) : ''" @click="item.shopStatus != [1, 2, 3] ? shopGto(item.shopId) : ''"
@longpress="deleteShop(item.shopId)"
> >
<!-- 列表头部 --> <!-- 列表头部 -->
<view class="titlecon"> <view class="titlecon">
...@@ -41,7 +42,7 @@ ...@@ -41,7 +42,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="shbox" v-if="list.length > 0">审核被拒可点击修改重新提交</view> <view class="shbox" v-if="list.length > 0">审核被拒可点击修改重新提交,长按可删除店铺</view>
<wd-status-tip image="content" tip="暂无内容" v-else /> <wd-status-tip image="content" tip="暂无内容" v-else />
</view> </view>
<view class="butCon"><button class="butXz" @click="shopGto()">申请入驻</button></view> <view class="butCon"><button class="butXz" @click="shopGto()">申请入驻</button></view>
...@@ -50,7 +51,7 @@ ...@@ -50,7 +51,7 @@
<script setup> <script setup>
import Header from '@/pages/order/components/Header/index.vue'; import Header from '@/pages/order/components/Header/index.vue';
import { shopList } from '@/api/storeEntry'; import { shopList, deleteShopInfoById } from '@/api/storeEntry';
const itemUrl = import.meta.env.VITE_APP_IMG_URL; const itemUrl = import.meta.env.VITE_APP_IMG_URL;
const shopStatus = reactive({ const shopStatus = reactive({
0: '停业中', 0: '停业中',
...@@ -79,7 +80,38 @@ const shopGto = (item) => { ...@@ -79,7 +80,38 @@ const shopGto = (item) => {
}, },
}); });
}; };
getList();
onLoad(() => {
getList();
});
const deleteShop = (shopId) => {
xma.showModal({
title: '删除提示',
content: '确定删除店铺吗?',
success: async (res) => {
if (res.confirm) {
const msg = '';
const res = await deleteShopInfoById({ shopId });
if (res.code === 0) {
xma.showToast({
title: '删除成功',
duration: 3000,
success: (res) => {
getList();
},
});
} else {
xma.showToast({
title: '删除失败,请稍后再试',
duration: 3000,
});
}
}
},
});
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment