合并代码
This commit is contained in:
parent
998330c02b
commit
42072a546e
|
@ -73,13 +73,28 @@ const shop = {
|
|||
},
|
||||
|
||||
/**
|
||||
* 商家发布商品
|
||||
* 保存商品信息
|
||||
* @param {Object} param
|
||||
*/
|
||||
releaseProduct(param) {
|
||||
saveProduct(param) {
|
||||
return util.request({
|
||||
url: `/shopify/`,
|
||||
url: `/shopify/webProduct/uploadProduct`,
|
||||
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
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
const config = {
|
||||
// 接口域名
|
||||
// #ifdef H5
|
||||
// host: 'http://localhost:5173',
|
||||
host: 'h5api',
|
||||
host: 'http://localhost:5173',
|
||||
// host: 'h5api',
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
host: 'http://91f.xyz:8080',
|
||||
// host: 'http://192.168.0.110:8080',
|
||||
// host: 'http://91f.xyz:8080',
|
||||
host: 'http://192.168.0.110:8080',
|
||||
// host: 'http://192.168.0.100:8080',
|
||||
// #endif
|
||||
// 支付方式配置
|
||||
|
|
|
@ -150,10 +150,10 @@
|
|||
<image src="/static/mine-lishijilu.png" mode="aspectFit" class="wh50" />
|
||||
<text class="txt mt10 wsn">历史浏览</text>
|
||||
</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" />
|
||||
<text class="txt mt10 wsn">优惠券</text>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
@ -164,13 +164,13 @@
|
|||
</view>
|
||||
|
||||
<view class="main ptb20 f24">
|
||||
<template v-if="0">
|
||||
<template v-if="userinfo.isShop == 0">
|
||||
<view class="item ver" @click="link('/pages/shop/settle')">
|
||||
<image src="/static/mine-ruzhushangjia.png" mode="aspectFit" class="wh50" />
|
||||
<text class="txt mt10 wsn">入驻商家</text>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-else-if="userinfo.isShop == 1">
|
||||
<view class="item ver" @click="link('/pages/shop/settle')" >
|
||||
<image src="/static/mine-ruzhushangjia.png" mode="aspectFit" class="wh50" />
|
||||
<text class="txt mt10 wsn">店铺管理</text>
|
||||
|
@ -179,14 +179,14 @@
|
|||
<image src="/static/mien-dianpuguanli.png" mode="aspectFit" class="wh50" />
|
||||
<text class="txt mt10 wsn">商品管理</text>
|
||||
</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" />
|
||||
<text class="txt mt10 wsn">订单管理</text>
|
||||
</view>
|
||||
<view class="item ver">
|
||||
</view> -->
|
||||
<!-- <view class="item ver">
|
||||
<image src="/static/mine-kehuxiaoxi.png" mode="aspectFit" class="wh50" />
|
||||
<text class="txt mt10 wsn">客户消息</text>
|
||||
</view>
|
||||
</view> -->
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -183,7 +183,7 @@
|
|||
<view class="app">
|
||||
<apex title="商品收藏">
|
||||
<template #right>
|
||||
<view class="f26" @click="setting = !setting">
|
||||
<view class="f26" @click="setting = !setting" v-if="0">
|
||||
<text v-if="setting">完成</text>
|
||||
<text v-else>管理</text>
|
||||
</view>
|
||||
|
@ -201,7 +201,7 @@
|
|||
<!-- 商品信息 -->
|
||||
<view class="product line df ptb20" v-for="(secItem,secIndex) in item.shopifyProductInfos"
|
||||
: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">
|
||||
<uni-icons type="checkbox-filled" size="40rpx" color="#F8BA4D" />
|
||||
</template>
|
||||
|
@ -235,9 +235,9 @@
|
|||
</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="col df aic" v-if="!setting">
|
||||
<view class="total mr20">
|
||||
|
|
|
@ -167,10 +167,10 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<view class="option ver ">
|
||||
<!-- <view class="option ver ">
|
||||
<image class="wh30" src="/static/customer-service.png" mode="widthFix" />
|
||||
<view class="f24 c999 mt10">客服</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- 下单 -->
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
} from 'vue'
|
||||
import {
|
||||
onLoad,
|
||||
onReachBottom
|
||||
onReachBottom,
|
||||
onPullDownRefresh
|
||||
} from "@dcloudio/uni-app"
|
||||
|
||||
// 顶部导航
|
||||
|
@ -27,7 +28,17 @@
|
|||
getList()
|
||||
})
|
||||
|
||||
// 获取更多商品
|
||||
onReachBottom(() => {
|
||||
// 获取更多商品
|
||||
getMoreList()
|
||||
})
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
// 重载商品列表
|
||||
refeshList()
|
||||
})
|
||||
|
||||
// 重载商品列表
|
||||
function refeshList() {
|
||||
if (product.list.length >= product.total) return
|
||||
product.pageNum++
|
||||
|
@ -65,11 +76,11 @@
|
|||
|
||||
/**
|
||||
* 编辑
|
||||
* @param {Object} item
|
||||
* @param {Object} item 商品对象
|
||||
*/
|
||||
function handleEdit(item) {
|
||||
uni.navigateTo({
|
||||
url: util.setUrl('/pages/release/commodity',{
|
||||
url: util.setUrl('/pages/release/commodity', {
|
||||
id: item.id
|
||||
})
|
||||
})
|
||||
|
@ -77,13 +88,39 @@
|
|||
|
||||
/**
|
||||
* 跳转
|
||||
* @param {Object} url 路径
|
||||
* @param {String} url 路径
|
||||
*/
|
||||
function link(url) {
|
||||
uni.navigateTo({
|
||||
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>
|
||||
|
||||
<template>
|
||||
|
@ -99,8 +136,7 @@
|
|||
<!-- 商品信息 -->
|
||||
<view class="product line df ptb20">
|
||||
<view class="poster wh160">
|
||||
<image class="wh160 br10" :src="item.sliderImage.split(',')[0]"
|
||||
mode="aspectFill" />
|
||||
<image class="wh160 br10" :src="item.sliderImage.split(',')[0]" mode="aspectFill" />
|
||||
</view>
|
||||
|
||||
<view class="info df fdc jcsb f1 ml20">
|
||||
|
@ -121,10 +157,10 @@
|
|||
|
||||
<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" @click="handleRemove(item)">删除</view>
|
||||
<view class="btn sm bar warmHollow plr30" @click="handleEdit(item)">编辑</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -3,9 +3,8 @@ import {
|
|||
} from 'vite';
|
||||
import uni from '@dcloudio/vite-plugin-uni';
|
||||
|
||||
//
|
||||
let target = 'http://91f.xyz:8080'
|
||||
// let target = 'http://192.168.0.110:8080'
|
||||
// let target = 'http://91f.xyz:8080'
|
||||
let target = 'http://192.168.0.110:8080'
|
||||
// let target = 'http://192.168.0.100:8080'
|
||||
|
||||
export default defineConfig({
|
||||
|
|
Loading…
Reference in New Issue