You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

277 lines
5.9 KiB

<template>
<view class="page1">
<view class="list-box">
<view class="list-1">
<view class="list-name">
3 months ago
门头图
</view>
3 months ago
<view class="list-right" @tap="pictureAdd('mentou')">
2 days ago
<view class="upload-img" v-if="shop.shopIcon ==''"
style="background: #eee;text-align: center;line-height: 100rpx;">
3 months ago
<uni-icons type="camera" size="28" color="#777"></uni-icons>
</view>
<image :src="shop.shopIcon" v-if="shop.shopIcon !=''" mode="" class="upload-img"></image>
</view>
</view>
<view class="list-1">
<view class="list-name">
店铺名称
</view>
<view class="list-right">
3 months ago
{{shop.shopName}}
</view>
</view>
<view class="list-1">
<view class="list-name">
3 months ago
副标题
</view>
<view class="list-right">
2 days ago
<input type="text" placeholder="请输入副标题" v-model="shop.subtitle"
style="height: 100rpx;line-height: 100rpx;" />
</view>
</view>
<view class="list-1">
<view class="list-name">
3 months ago
店铺地址
</view>
<view class="list-right">
3 months ago
{{shop.shopAddress}}
</view>
</view>
3 months ago
<!-- <view class="list-1">
<view class="list-name">
店铺环境
</view>
<view class="list-right">
<image :src="huanjing" mode=""></image>
</view>
</view> -->
<view class="list-1">
<view class="list-name">
身份证
</view>
<view class="list-right">
3 months ago
<image :src="shopImages[0]" mode="" class="upload-img"></image>
</view>
</view>
<view class="list-1">
<view class="list-name">
营业执照
</view>
<view class="list-right">
3 months ago
<image :src="shopImages[2]" mode="" class="upload-img"></image>
</view>
</view>
<view class="list-1">
<view class="list-name">
3 months ago
补充证照
</view>
<view class="list-right">
3 months ago
<image :src="huanjing" mode="" class="upload-img"></image>
</view>
</view>
<view class="list-1">
<view class="list-name">
3 months ago
支付宝账号
</view>
<view class="list-right">
2 days ago
<input type="text" placeholder="请输入支付宝账号" v-model="shop.aliAccount"
style="height: 100rpx;line-height: 100rpx;" />
</view>
</view>
<view class="list-1">
<view class="list-name">
3 months ago
支付宝实名
</view>
<view class="list-right">
2 days ago
<input type="text" placeholder="请输入支付宝账号" v-model="shop.aliName"
style="height: 100rpx;line-height: 100rpx;" />
</view>
</view>
</view>
<view class="list-box">
3 months ago
<view class="list-2" @click="submit">
保存
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
2 days ago
shop: {},
shopImages: [],
huanjing: ''
}
},
3 months ago
onLoad() {
2 days ago
this.shop = JSON.parse(uni.getStorageSync('area')).shop;
console.log('好的好的',this.shop)
3 months ago
this.shopImages = this.shop.shopImages.split('@@')
this.huanjing = JSON.parse(this.shopImages[3])[0]
3 months ago
for (let key in this.shop) {
2 days ago
if (this.shop[key] === null) {
delete this.shop[key];
}
3 months ago
}
},
methods: {
2 days ago
navigatorTo(e) {
let url = ""
2 days ago
if (e == 'addgoods') {
url = '/package1/myCenter/addGoods'
2 days ago
} else if (e == 'merchant') {
url = '/package1/myCenter/myMerchant'
2 days ago
} else if (e == 'xiugaixinxi') {
url = '/pages/myCenter/shopDetail'
}
uni.navigateTo({
url: url
})
3 months ago
},
pictureAdd(type) {
let that = this
uni.chooseMedia({
2 days ago
count: type == 'qita' ? 9 : 1,
3 months ago
mediaType: ['image'],
sourceType: ['album', 'camera'],
success(res) {
uni.showLoading({
title: '加载中...',
mask: true
})
for (let i = 0; i < res.tempFiles.length; i++) {
2 days ago
that.upLoadFile(res.tempFiles[i].tempFilePath, type)
3 months ago
}
2 days ago
3 months ago
}
})
},
2 days ago
async upLoadFile(path, type) {
3 months ago
let that = this;
let hiver_token = uni.getStorageSync("hiver_token")
await uni.uploadFile({
url: getApp().globalData.mainurl + '/upload/file',
filePath: path,
name: 'file',
header: {
"content-type": "multipart/form-data",
'accessToken': hiver_token
},
formData: {},
success: (uploadFileRes) => {
let pathData = JSON.parse(uploadFileRes.data)
that.shop.shopIcon = pathData.result
2 days ago
3 months ago
that.$forceUpdate()
},
fail: (err) => {
uni.hideLoading();
uni.showToast({
title: JSON.stringify(err),
icon: 'none'
})
}
});
await setTimeout(res => {
uni.hideLoading();
}, 1000)
},
2 days ago
submit() {
3 months ago
console.log(this.shop)
console.log(typeof(this.shop))
2 days ago
this.NB.sendRequest('/app/shop/edit', this.shop, false, 'PUT', 'application/x-www-form-urlencoded').then(
res => {
if (res.code == 200) {
uni.showModal({
title: '提示',
content: '更新信息成功',
showCancel: false,
success: function(res) {
uni.setStorageSync('shop', this.shop)
if (res.confirm) {
uni.navigateBack()
}
3 months ago
}
2 days ago
});
} else {
uni.showToast(res.message)
}
})
}
}
}
</script>
<style>
2 days ago
page,
.page1 {
width: 100%;
height: 100%;
font-size: 28rpx;
background: #eee;
}
2 days ago
.list-box {
width: 100%;
height: auto;
background: #fff;
margin-top: 20rpx;
2 days ago
}
2 days ago
.list-1 {
display: flex;
width: 100%;
height: 100rpx;
line-height: 100rpx;
border-bottom: 1px solid #eee;
2 days ago
}
2 days ago
.list-2 {
width: 100%;
height: 100rpx;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
}
2 days ago
.list-icon {
width: 100rpx;
height: 100rpx;
text-align: center;
}
2 days ago
.list-name {
flex: 1;
padding-left: 20rpx;
}
2 days ago
.list-right {
3 months ago
flex: 1;
height: 100rpx;
3 months ago
text-align: right;
padding-right: 20rpx;
overflow: hidden;
}
2 days ago
.upload-img {
width: 60rpx;
3 months ago
height: 60rpx;
background-size: 100%;
margin-top: 20rpx;
}
2 days ago
.list-2 {
width: 100%;
height: 100rpx;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
}
</style>