代码更新
This commit is contained in:
@@ -82,20 +82,20 @@
|
||||
v-for="(item,index) in vdata.extendList" :key="index"
|
||||
:class="{'active':vdata.extendIndex==index}"
|
||||
@click="extendTabClick(item,index)"
|
||||
>{{item.title}}</view>
|
||||
>{{item.name}}</view>
|
||||
</view>
|
||||
<view class="extend_content">
|
||||
<view class="preview">
|
||||
<view class="index_bg"><up-image v-if="'index_bg' == vdata.extendInfo.autokey" :src="vdata.extendInfo.value"></up-image></view>
|
||||
<view class="my_bg"><up-image v-if="'my_bg' == vdata.extendInfo.autokey" :src="vdata.extendInfo.value"></up-image></view>
|
||||
<view class="bg"><up-image v-if="'member_bg' == vdata.extendInfo.autokey" :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/'+vdata.extendInfo.autokey+'1.png'" ></up-image></view>
|
||||
<view class="member_bg"><up-image v-if="'member_bg' == vdata.extendInfo.autokey" :src="vdata.extendInfo.value"></up-image></view>
|
||||
<view class="shopinfo_bg"><up-image v-if="'shopinfo_bg' == vdata.extendInfo.autokey" :src="vdata.extendInfo.value"></up-image></view>
|
||||
<view class="shopinfo_bg_f" v-if="'shopinfo_bg' == vdata.extendInfo.autokey"></view>
|
||||
<view class="bg"><up-image v-if="vdata.extendInfo.autokey" :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/'+vdata.extendInfo.autokey+'.png'" ></up-image></view>
|
||||
<view class="index_bg"><up-image v-if="'index_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||
<view class="my_bg"><up-image v-if="'my_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||
<view class="bg"><up-image v-if="'member_bg' == vdata.extendInfo.autoKey" :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/'+vdata.extendInfo.autoKey+'.png'" ></up-image></view>
|
||||
<view class="member_bg"><up-image v-if="'member_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||
<view class="shopinfo_bg"><up-image v-if="'shopinfo_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||
<view class="shopinfo_bg_f" v-if="'shopinfo_bg' == vdata.extendInfo.autoKey"></view>
|
||||
<view class="bg"><up-image v-if="vdata.extendInfo.autoKey" :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/'+vdata.extendInfo.autoKey+'.png'" ></up-image></view>
|
||||
</view>
|
||||
<view class="extend_img">
|
||||
<view class="extend_title">{{vdata.extendInfo.title}}背景图片</view>
|
||||
<view class="extend_title">{{vdata.extendInfo.name}}背景图片</view>
|
||||
<view class="fileUp">
|
||||
<up-image :src="vdata.extendInfo.value"></up-image>
|
||||
<view class="file" @tap="chooseAndUploadAvatar('extendUp')"></view>
|
||||
@@ -113,16 +113,10 @@
|
||||
<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 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';
|
||||
import { getShopInfo, editShopInfo, getShopExtend, editShopExtend } from '@/api/shop.js'
|
||||
|
||||
const phone = ref(null)
|
||||
const vdata = reactive({
|
||||
shopInfo: {
|
||||
status: 2,
|
||||
@@ -141,12 +135,10 @@ const vdata = reactive({
|
||||
label: "",
|
||||
type: "",
|
||||
inputValue: "",
|
||||
inputType: "text",
|
||||
maxLength: '999',
|
||||
|
||||
})
|
||||
onMounted(() => {
|
||||
// shopExtend();
|
||||
shopExtend();
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
@@ -184,7 +176,6 @@ const shopInfo = () => {
|
||||
vdata.takeout = true
|
||||
}
|
||||
vdata.shopInfo = res;
|
||||
console.log(vdata.shopInfo)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -192,13 +183,11 @@ const shopInfo = () => {
|
||||
* 获取店铺图片
|
||||
*/
|
||||
let shopExtend = () => {
|
||||
getShopExtend({
|
||||
autokey: "index_bg",
|
||||
}).then((res) => {
|
||||
if ( res.content && res.content.length > 0 ) {
|
||||
vdata.extendList = res.content;
|
||||
getShopExtend().then((res) => {
|
||||
if ( res && res.length > 0 ) {
|
||||
vdata.extendList = res;
|
||||
vdata.extendIndex = 0;
|
||||
vdata.extendInfo = res.content[0];
|
||||
vdata.extendInfo = res[0];
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -207,7 +196,6 @@ let shopExtend = () => {
|
||||
* 付费模式修改
|
||||
*/
|
||||
let radioChange = (n) => {
|
||||
console.log('radioChange', n);
|
||||
let params = {
|
||||
id : vdata.shopInfo.id,
|
||||
registerType : n,
|
||||
@@ -230,9 +218,10 @@ let updateShopInfo = (params,type) => {
|
||||
* 修改店铺图片
|
||||
*/
|
||||
let updateShopExtend = () => {
|
||||
editShopExtend(vdata.extendInfo).then((res) => {
|
||||
|
||||
})
|
||||
editShopExtend({
|
||||
autokey: vdata.extendInfo.autoKey,
|
||||
value: vdata.extendInfo.value,
|
||||
}).then((res) => {})
|
||||
}
|
||||
|
||||
|
||||
@@ -248,9 +237,7 @@ let chooseAndUploadAvatar = ( type ) => {
|
||||
sourceType: ['album', 'camera'], // 图片来源,相册或相机
|
||||
success: (res) => {
|
||||
let file = res.tempFiles[0];
|
||||
console.log(res)
|
||||
uploadFile(file).then(res => {
|
||||
console.log(res);
|
||||
if ( type == "coverImg") {
|
||||
vdata.shopInfo.coverImg = res;
|
||||
let params = {
|
||||
@@ -265,7 +252,6 @@ let chooseAndUploadAvatar = ( type ) => {
|
||||
}
|
||||
|
||||
}).catch(res=>{
|
||||
console.log(res);
|
||||
if(res.errMsg){
|
||||
uni.showToast({
|
||||
title:'图片大小超出限制',
|
||||
@@ -309,7 +295,6 @@ let switchChange = ( type ) => {
|
||||
let params = {
|
||||
id : vdata.shopInfo.id,
|
||||
}
|
||||
console.log(vdata.shopInfo)
|
||||
switch ( type ){
|
||||
case "address":
|
||||
params.lng = vdata.shopInfo.lng;
|
||||
@@ -414,13 +399,14 @@ let showMap = () => {
|
||||
margin-top: 24rpx;
|
||||
.extendTab{
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
justify-content: flex-start;
|
||||
.extendTab_item{
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 4rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.active{
|
||||
background: #318AFE;
|
||||
|
||||
Reference in New Issue
Block a user