合并代码

This commit is contained in:
sx 2025-02-07 11:24:41 +08:00
parent 998330c02b
commit 42072a546e
7 changed files with 84 additions and 47 deletions

View File

@ -73,13 +73,28 @@ const shop = {
}, },
/** /**
* 商家发布商品 * 保存商品信息
* @param {Object} param * @param {Object} param
*/ */
releaseProduct(param) { saveProduct(param) {
return util.request({ return util.request({
url: `/shopify/`, url: `/shopify/webProduct/uploadProduct`,
method: 'POST', method: 'POST',
data: param.data,
load: true,
})
},
/**
* 商家商品删除
* @param {Object} param
*/
removeProduct(param) {
return util.request({
url: `/webProduct`,
method: 'POST',
path: param.path,
load: true,
}) })
}, },
@ -180,19 +195,6 @@ const shop = {
}) })
}, },
/**
* 保存商品信息
* @param {Object} param
*/
saveProduct(param) {
return util.request({
url: `/shopify/webProduct/uploadProduct`,
method: 'POST',
data: param.data,
load: true,
})
},
/** /**
* 商品收藏 * 商品收藏
* @param {Object} param * @param {Object} param

View File

@ -2,12 +2,12 @@
const config = { const config = {
// 接口域名 // 接口域名
// #ifdef H5 // #ifdef H5
// host: 'http://localhost:5173', host: 'http://localhost:5173',
host: 'h5api', // host: 'h5api',
// #endif // #endif
// #ifndef H5 // #ifndef H5
host: 'http://91f.xyz:8080', // host: 'http://91f.xyz:8080',
// host: 'http://192.168.0.110:8080', host: 'http://192.168.0.110:8080',
// host: 'http://192.168.0.100:8080', // host: 'http://192.168.0.100:8080',
// #endif // #endif
// 支付方式配置 // 支付方式配置

View File

@ -150,10 +150,10 @@
<image src="/static/mine-lishijilu.png" mode="aspectFit" class="wh50" /> <image src="/static/mine-lishijilu.png" mode="aspectFit" class="wh50" />
<text class="txt mt10 wsn">历史浏览</text> <text class="txt mt10 wsn">历史浏览</text>
</view> </view>
<view class="item ver" @click="link('/pages/shop/coupon')"> <!-- <view class="item ver" @click="link('/pages/shop/coupon')">
<image src="/static/mine-youhuiquan.png" mode="aspectFit" class="wh50" /> <image src="/static/mine-youhuiquan.png" mode="aspectFit" class="wh50" />
<text class="txt mt10 wsn">优惠券</text> <text class="txt mt10 wsn">优惠券</text>
</view> </view> -->
</view> </view>
</view> </view>
@ -164,13 +164,13 @@
</view> </view>
<view class="main ptb20 f24"> <view class="main ptb20 f24">
<template v-if="0"> <template v-if="userinfo.isShop == 0">
<view class="item ver" @click="link('/pages/shop/settle')"> <view class="item ver" @click="link('/pages/shop/settle')">
<image src="/static/mine-ruzhushangjia.png" mode="aspectFit" class="wh50" /> <image src="/static/mine-ruzhushangjia.png" mode="aspectFit" class="wh50" />
<text class="txt mt10 wsn">入驻商家</text> <text class="txt mt10 wsn">入驻商家</text>
</view> </view>
</template> </template>
<template v-else> <template v-else-if="userinfo.isShop == 1">
<view class="item ver" @click="link('/pages/shop/settle')" > <view class="item ver" @click="link('/pages/shop/settle')" >
<image src="/static/mine-ruzhushangjia.png" mode="aspectFit" class="wh50" /> <image src="/static/mine-ruzhushangjia.png" mode="aspectFit" class="wh50" />
<text class="txt mt10 wsn">店铺管理</text> <text class="txt mt10 wsn">店铺管理</text>
@ -179,14 +179,14 @@
<image src="/static/mien-dianpuguanli.png" mode="aspectFit" class="wh50" /> <image src="/static/mien-dianpuguanli.png" mode="aspectFit" class="wh50" />
<text class="txt mt10 wsn">商品管理</text> <text class="txt mt10 wsn">商品管理</text>
</view> </view>
<view class="item ver" @click="link('pages/merchant/order/index')"> <!-- <view class="item ver" @click="link('pages/merchant/order/index')">
<image src="/static/mine-dingdanguanli.png" mode="aspectFit" class="wh50" /> <image src="/static/mine-dingdanguanli.png" mode="aspectFit" class="wh50" />
<text class="txt mt10 wsn">订单管理</text> <text class="txt mt10 wsn">订单管理</text>
</view> </view> -->
<view class="item ver"> <!-- <view class="item ver">
<image src="/static/mine-kehuxiaoxi.png" mode="aspectFit" class="wh50" /> <image src="/static/mine-kehuxiaoxi.png" mode="aspectFit" class="wh50" />
<text class="txt mt10 wsn">客户消息</text> <text class="txt mt10 wsn">客户消息</text>
</view> </view> -->
</template> </template>
</view> </view>
</view> </view>

View File

@ -183,7 +183,7 @@
<view class="app"> <view class="app">
<apex title="商品收藏"> <apex title="商品收藏">
<template #right> <template #right>
<view class="f26" @click="setting = !setting"> <view class="f26" @click="setting = !setting" v-if="0">
<text v-if="setting">完成</text> <text v-if="setting">完成</text>
<text v-else>管理</text> <text v-else>管理</text>
</view> </view>
@ -201,7 +201,7 @@
<!-- 商品信息 --> <!-- 商品信息 -->
<view class="product line df ptb20" v-for="(secItem,secIndex) in item.shopifyProductInfos" <view class="product line df ptb20" v-for="(secItem,secIndex) in item.shopifyProductInfos"
:key="secItem.id"> :key="secItem.id">
<view class="fmid mr10" @click="handleSelect(index,secIndex)"> <view class="fmid mr10" @click="handleSelect(index,secIndex)" v-if="0">
<template v-if="secItem.selected"> <template v-if="secItem.selected">
<uni-icons type="checkbox-filled" size="40rpx" color="#F8BA4D" /> <uni-icons type="checkbox-filled" size="40rpx" color="#F8BA4D" />
</template> </template>
@ -235,9 +235,9 @@
</view> </view>
</view> </view>
<view class="fill" style="height: 180rpx;"></view> <view class="fill" style="height: 30rpx;"></view>
<view class="footer rows plr30 bfff shadow"> <view class="footer rows plr30 bfff shadow" v-if="0">
<view class="c999 f26">已选择{{selectList.length}}</view> <view class="c999 f26">已选择{{selectList.length}}</view>
<view class="col df aic" v-if="!setting"> <view class="col df aic" v-if="!setting">
<view class="total mr20"> <view class="total mr20">

View File

@ -167,10 +167,10 @@
</view> </view>
</view> </view>
<view class="option ver "> <!-- <view class="option ver ">
<image class="wh30" src="/static/customer-service.png" mode="widthFix" /> <image class="wh30" src="/static/customer-service.png" mode="widthFix" />
<view class="f24 c999 mt10">客服</view> <view class="f24 c999 mt10">客服</view>
</view> </view> -->
</view> </view>
<!-- 下单 --> <!-- 下单 -->

View File

@ -6,7 +6,8 @@
} from 'vue' } from 'vue'
import { import {
onLoad, onLoad,
onReachBottom onReachBottom,
onPullDownRefresh
} from "@dcloudio/uni-app" } from "@dcloudio/uni-app"
// //
@ -27,7 +28,17 @@
getList() getList()
}) })
// onReachBottom(() => {
//
getMoreList()
})
onPullDownRefresh(() => {
//
refeshList()
})
//
function refeshList() { function refeshList() {
if (product.list.length >= product.total) return if (product.list.length >= product.total) return
product.pageNum++ product.pageNum++
@ -65,11 +76,11 @@
/** /**
* 编辑 * 编辑
* @param {Object} item * @param {Object} item 商品对象
*/ */
function handleEdit(item) { function handleEdit(item) {
uni.navigateTo({ uni.navigateTo({
url: util.setUrl('/pages/release/commodity',{ url: util.setUrl('/pages/release/commodity', {
id: item.id id: item.id
}) })
}) })
@ -77,13 +88,39 @@
/** /**
* 跳转 * 跳转
* @param {Object} url 路径 * @param {String} url 路径
*/ */
function link(url) { function link(url) {
uni.navigateTo({ uni.navigateTo({
url url
}) })
} }
/**
* 删除发布的商品
* @param {Object} item 商品对象
*/
function handleRemove(item) {
util.alert({
content: '确定删除该商品吗?',
}).then(res => {
if (!res.confirm) return
//
api.shop.removeProduct({
path: [item.id]
}).then(rs => {
if (rs.code === 200) {
//
refeshList()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
})
}
</script> </script>
<template> <template>
@ -99,8 +136,7 @@
<!-- 商品信息 --> <!-- 商品信息 -->
<view class="product line df ptb20"> <view class="product line df ptb20">
<view class="poster wh160"> <view class="poster wh160">
<image class="wh160 br10" :src="item.sliderImage.split(',')[0]" <image class="wh160 br10" :src="item.sliderImage.split(',')[0]" mode="aspectFill" />
mode="aspectFill" />
</view> </view>
<view class="info df fdc jcsb f1 ml20"> <view class="info df fdc jcsb f1 ml20">
@ -121,10 +157,10 @@
<view class="menu ptb20 df jcr"> <view class="menu ptb20 df jcr">
<!-- <view class="btn sm bar closeHollow plr30">上架</view> --> <!-- <view class="btn sm bar closeHollow plr30">上架</view> -->
<view class="btn sm bar closeHollow plr30">下架</view> <!-- <view class="btn sm bar closeHollow plr30">下架</view> -->
<view class="btn sm bar closeHollow plr30">改价</view> <!-- <view class="btn sm bar closeHollow plr30">改价</view> -->
<!-- 在没有进行中的订单才能删除 --> <!-- 在没有进行中的订单才能删除 -->
<!-- <view class="btn sm bar closeHollow plr30">删除</view> --> <view class="btn sm bar closeHollow plr30" @click="handleRemove(item)">删除</view>
<view class="btn sm bar warmHollow plr30" @click="handleEdit(item)">编辑</view> <view class="btn sm bar warmHollow plr30" @click="handleEdit(item)">编辑</view>
</view> </view>
</view> </view>

View File

@ -3,9 +3,8 @@ import {
} from 'vite'; } from 'vite';
import uni from '@dcloudio/vite-plugin-uni'; import uni from '@dcloudio/vite-plugin-uni';
// // let target = 'http://91f.xyz:8080'
let target = 'http://91f.xyz:8080' let target = 'http://192.168.0.110:8080'
// let target = 'http://192.168.0.110:8080'
// let target = 'http://192.168.0.100:8080' // let target = 'http://192.168.0.100:8080'
export default defineConfig({ export default defineConfig({