店铺详情修改更新

This commit is contained in:
GaoHao 2024-09-19 10:17:34 +08:00
parent ad93d41550
commit be1ef04ec9
3 changed files with 87 additions and 65 deletions

View File

@ -106,6 +106,13 @@
"navigationBarTitleText": "设置中心"
}
},
{
"pageId": "PAGES_SHOP_EDITVAL",
"path": "pages/shopSetUp/editVal",
"style": {
"navigationBarTitleText": ""
}
},
{
"pageId": "PAGES_SHOP_QRCODE",
"path": "pages/shopSetUp/shopQRcode",

View File

@ -0,0 +1,59 @@
<template>
<view class="page-wrapper">
<view class="content">
<up-textarea v-model="vdata.value" placeholder="请输入内容" maxlength="20" border="none" placeholderStyle="font-size: 28rpx" count></up-textarea>
</view>
<view class="save" @tap="save">保存</view>
</view>
</template>
<script setup>
import { reactive, ref } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const vdata = reactive({
value: "",
name: ""
});
onLoad((options) => {
vdata.value = options.value;
vdata.name = options.name;
})
let save = (e) => {
// console.log(e)
uni.$emit('refreshPreviousPage', {name: vdata.name, value: vdata.value});
uni.navigateBack();
}
</script>
<style lang="scss" scoped>
.page-wrapper {
min-height: calc(100vh - 90rpx);
padding: 32rpx 28rpx;
box-sizing: border-box;
.content{
width: 100%;
background-color: #fff;
border-radius: 18rpx;
}
.save{
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
background: #318AFE;
border-radius: 12rpx;
font-weight: bold;
font-size: 32rpx;
color: #FFFFFF;
margin-top: 48rpx;
}
}
</style>

View File

@ -7,11 +7,12 @@
<view class="file" @tap="chooseAndUploadAvatar('coverImg')"></view>
</view>
</view>
<view class="page-cell m" @tap="updateValue('商户名称','shopName',vdata.shopInfo.shopName)">
<!-- <view class="page-cell m" @tap="updateValue('商户名称','shopName',vdata.shopInfo.shopName)"> -->
<view class="page-cell m" @tap="go.to('PAGES_SHOP_EDITVAL',{name:'shopName',value: vdata.shopInfo.shopName})">
<view class="label">商户名称</view>
<view class="right"><view>{{ vdata.shopInfo.shopName }}</view><up-icon name="arrow-right" color="#999999" size="15"></up-icon></view>
</view>
<view class="page-cell m" @tap="updateValue('商户电话','phone',vdata.shopInfo.phone)">
<view class="page-cell m" @tap="go.to('PAGES_SHOP_EDITVAL',{name:'phone',value: vdata.shopInfo.phone})">
<view class="label">商户电话</view>
<view class="right"><view>{{ vdata.shopInfo.phone }}</view><up-icon name="arrow-right" color="#999999" size="15"></up-icon></view>
</view>
@ -41,7 +42,7 @@
</view>
<view class="page-cell">
<view class="label">桌位费<view v-if="vdata.isTableFee" class="tableFee" @tap="updateValue('桌位费','tableFee',vdata.shopInfo.tableFee)">{{vdata.shopInfo.tableFee}}</view></view>
<view class="label">桌位费<view v-if="vdata.isTableFee" class="tableFee" @tap="go.to('PAGES_SHOP_EDITVAL',{name:'tableFee',value: vdata.shopInfo.tableFee})">{{vdata.shopInfo.tableFee}}</view></view>
<view class="right">
<view>
<up-checkbox-group><up-checkbox label="免桌位费" v-model:checked="vdata.isTableFee" activeColor="#0FC161" shape="circle" @change="isTableFeeChange"> </up-checkbox></up-checkbox-group>
@ -84,19 +85,7 @@
</view>
<view class="cutShop" @tap="go.to('PAGES_SHOP_LIST')">切换门店</view>
</view>
<!-- 弹层 -->
<uni-popup ref="popupRef" type="dialog">
<uni-popup-dialog :before-close="true" mode="input" :title="`请输入${vdata.label}`" @confirm="confirmFunc" @close="popupRef.close()">
<template #default>
<uni-forms ref="formRef">
<uni-forms-item label="" name="singleInputVal">
<uni-easyinput :inputBorder="false" :type="vdata.inputType" v-model="vdata.inputValue" :placeholder="`最多输入${vdata.maxLength}个字`" :maxlength="vdata.maxLength" />
</uni-forms-item>
</uni-forms>
</template>
</uni-popup-dialog>
</uni-popup>
</template>
@ -109,8 +98,6 @@ import go from '@/commons/utils/go.js'
import infoBox from '@/commons/utils/infoBox.js'
import { $uploadFile } from '@/http/yskApi/file.js'
const jeepayPopupInputRef = ref()
const popupRef = ref()
const uploadImg = ref()
const phone = ref(null)
const vdata = reactive({
@ -135,8 +122,24 @@ onMounted(() => {
onShow(() => {
shopInfo();
uni.$on('refreshPreviousPage', (params) => {
// API
refreshData(params);
});
})
let refreshData = (e) => {
let params = {
id : vdata.shopInfo.id,
}
for(let item in params){
params[e.name] = e.value;
}
vdata.type = e.name;
vdata.inputValue = e.value;
updateShopInfo(params,'input')
}
/**
* 获取店铺信息
*/
@ -187,7 +190,6 @@ let updateShopInfo = (params,type) => {
break;
}
}
popupRef.value.close()
})
}
@ -255,52 +257,6 @@ let extendTabClick = (item,index) => {
vdata.extendIndex = index;
}
/**
* 打开修改弹窗
*/
let updateValue = ( label , type , value) => {
vdata.label = label;
vdata.type = type;
vdata.inputValue = value;
switch ( vdata.type ){
case "shopName":
vdata.inputType = 'text';
vdata.maxLength = 999;
break;
case "phone":
vdata.inputType = 'tel';
vdata.maxLength = 12;
break;
case "tableFee":
vdata.inputType = 'number';
vdata.maxLength = 12;
break;
}
popupRef.value.open()
}
/**
* 确认修改
*/
let confirmFunc = () => {
let params = {
id : vdata.shopInfo.id,
}
switch ( vdata.type ){
case "shopName":
params.shopName = vdata.inputValue;
break;
case "phone":
params.phone = vdata.inputValue;
break;
case "tableFee":
params.tableFee = vdata.inputValue;
break;
}
updateShopInfo(params,'input');
}
/**
* 是否免桌位费
*/