代码更新

This commit is contained in:
GaoHao
2025-02-26 19:46:20 +08:00
parent 7519ffced3
commit b4a0393d2d
413 changed files with 7483 additions and 60762 deletions

View File

@@ -2,7 +2,7 @@
<view class="page-wrapper">
<view class="page-cell">
<view class="label">头像</view>
<view class="right" @tap="uploadImg.preview()">
<view class="right">
<up-avatar class="fileImg" :src="vdata.shopInfo.coverImg?vdata.shopInfo.coverImg:''" mode="aspectFill"></up-avatar>
<view class="file" @tap="chooseAndUploadAvatar('coverImg')"></view>
</view>
@@ -34,11 +34,11 @@
</view> -->
<view class="page-cell">
<view class="label">允许打包</view>
<view class="right"><up-switch v-model="vdata.takeout" size="20"activeColor="#0FC161" @change="switchChange('eatModel')"></up-switch></view>
<view class="right"><up-switch v-model="vdata.takeout" size="20" activeColor="#0FC161" @change="switchChange('eatModel')"></up-switch></view>
</view>
<view class="page-cell m">
<view class="label">是否开启会员支付</view>
<view class="right"><up-switch v-model="vdata.shopInfo.isUseVip" size="20" :inactiveValue="0" :activeValue="1" activeColor="#0FC161" @change="switchChange('isUseVip')"></up-switch></view>
<view class="right"><up-switch v-model="vdata.shopInfo.isAccountPay" size="20" :inactiveValue="0" :activeValue="1" activeColor="#0FC161" @change="switchChange('isAccountPay')"></up-switch></view>
</view>
<view class="page-cell">
@@ -62,6 +62,7 @@
:key="index"
:label="item.name"
:name="item.value"
activeColor="#0FC161"
@change="radioChange"
>
</up-radio>
@@ -112,24 +113,25 @@
<script setup>
import { ref, reactive, onMounted } from 'vue'
import { onShow } from '@dcloudio/uni-app';
import { getShopInfo , editShopInfo, getShopExtend, editShopExtend } from '@/http/yskApi/shop.js'
// import { getShopInfo , editShopInfo, getShopExtend, editShopExtend } from '@/http/yskApi/shop.js'
import storageManage from '@/commons/utils/storageManage.js'
import go from '@/commons/utils/go.js'
import infoBox from '@/commons/utils/infoBox.js'
import { $uploadFile } from '@/http/yskApi/file.js'
import { uploadFile } from '@/api/index.js'
import { getShopInfo, editShopInfo } from '@/api/shop.js'
import { forIn } from 'lodash';
const uploadImg = ref()
const phone = ref(null)
const vdata = reactive({
shopInfo: {
status: 2,
isUseVip: 0,
isAccountPay: 0,
},
extendList: [],
registerTypeList: [
{name: "先付费", value: "munchies"},
{name: "后付费", value: "restaurant"}
{name: "先付费", value: "before"},
{name: "后付费", value: "after"}
],
extendIndex: 0,
extendInfo: {},
@@ -144,7 +146,7 @@ const vdata = reactive({
})
onMounted(() => {
shopExtend();
// shopExtend();
})
onShow(() => {
@@ -173,15 +175,16 @@ let refreshData = (e) => {
* 获取店铺信息
*/
const shopInfo = () => {
getShopInfo(storageManage.shopId()).then((res) => {
getShopInfo({id:uni.getStorageSync('shopInfo').id}).then((res) => {
vdata.isTableFee = res.isTableFee == 1 ? true: false;
if (res.eatModel.join(",").indexOf("dine-in") != -1) {
if (res.eatModel.split(",").indexOf("dine-in") != -1) {
vdata.dineIn = true
}
if (res.eatModel.join(",").indexOf("take-out") != -1) {
if (res.eatModel.split(",").indexOf("take-out") != -1) {
vdata.takeout = true
}
vdata.shopInfo = res;
console.log(vdata.shopInfo)
})
}
@@ -246,10 +249,10 @@ let chooseAndUploadAvatar = ( type ) => {
success: (res) => {
let file = res.tempFiles[0];
console.log(res)
$uploadFile(file).then(res => {
uploadFile(file).then(res => {
console.log(res);
if ( type == "coverImg") {
vdata.shopInfo.coverImg = res.data[0];
vdata.shopInfo.coverImg = res;
let params = {
id : vdata.shopInfo.id,
coverImg : vdata.shopInfo.coverImg,
@@ -257,7 +260,7 @@ let chooseAndUploadAvatar = ( type ) => {
updateShopInfo(params)
}
if ( type == "extendUp") {
vdata.extendInfo.value = res.data[0];
vdata.extendInfo.value = res;
updateShopExtend()
}
@@ -306,6 +309,7 @@ let switchChange = ( type ) => {
let params = {
id : vdata.shopInfo.id,
}
console.log(vdata.shopInfo)
switch ( type ){
case "address":
params.lng = vdata.shopInfo.lng;
@@ -323,9 +327,10 @@ let switchChange = ( type ) => {
if ( vdata.takeout ) {
params.eatModel.push('take-out');
}
params.eatModel = params.eatModel.join(',')
break;
case "isUseVip":
params.isUseVip = vdata.shopInfo.isUseVip;
case "isAccountPay":
params.isAccountPay = vdata.shopInfo.isAccountPay;
break;
case "isTableFee":
if ( vdata.isTableFee ) {