新增套餐推广

This commit is contained in:
gyq
2025-12-20 09:12:07 +08:00
parent 8826b206df
commit e8e474d971
15 changed files with 1584 additions and 441 deletions

View File

@@ -8,9 +8,14 @@
<text class="t">可用门店</text>
</view>
<view class="info">
<view class="ipt">
<view class="ipt" v-if="isMainShop()">
<my-shop-select-w v-model:useType="form.useShopType" v-model:selShops="form.useShops"></my-shop-select-w>
</view>
<view class="ipt" v-else>
<u-radio-group v-model="form.useShopType">
<u-radio label="仅本店" name="only"></u-radio>
</u-radio-group>
</view>
</view>
</view>
</u-form-item>
@@ -20,6 +25,7 @@
<view class="switch-wrap">
<view class="top">
<text class="t">商品名称</text>
<text class="t2" @click="toSelectGoodS">导入已有商品</text>
</view>
<view class="info">
<view class="ipt">
@@ -147,9 +153,10 @@
<script setup>
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { filterNumberInput } from '@/utils/index.js';
import { addGbWare, updateGbWareById } from '@/http/api/ware.js';
import { isMainShop } from '@/store/account.js';
const type = ref('add'); // add添加商品 editor编辑商品
const formRef = ref(null);
@@ -283,6 +290,13 @@ const rules = ref({
]
});
// 跳转去选择商品
function toSelectGoodS() {
uni.navigateTo({
url: '/pageMarket/groupGoods/selectGoods'
});
}
const limitBuyNumFalseNum = -10086;
function limitBuyNumSwitchChange(e) {
if (e) {
@@ -347,6 +361,8 @@ function submitHandle() {
if (form.value.wareCommentImgs.length) {
data.wareCommentImgs = form.value.wareCommentImgs.join(',');
} else {
data.wareCommentImgs = '';
}
if (form.value.id) {
@@ -406,7 +422,22 @@ function getLocalGoods() {
}
}
// 从本地获取已选择的拼团商品
function getLocalGroupProduct() {
let groupGoods = uni.getStorageSync('groupProduct');
if (groupGoods && groupGoods.coverImg) {
form.value.wareName = groupGoods.name;
form.value.wareImgs = [groupGoods.coverImg];
form.value.originalPrice = groupGoods.price;
}
}
onShow(() => {
getLocalGroupProduct();
});
onLoad((options) => {
uni.setStorageSync('groupProduct', '');
if (options.type && options.type == 'editor') {
type.value = options.type;
uni.setNavigationBarTitle({
@@ -456,6 +487,10 @@ page {
font-size: 24upx;
color: #666;
}
.t2 {
font-size: 28upx;
color: #3c9cff;
}
}
.info {
padding-top: 16upx;