|
|
|
@ -6,7 +6,8 @@ |
|
|
|
门头图 |
|
|
|
</view> |
|
|
|
<view class="list-right" @tap="pictureAdd('mentou')"> |
|
|
|
<view class="upload-img" v-if="shop.shopIcon ==''" style="background: #eee;text-align: center;line-height: 100rpx;"> |
|
|
|
<view class="upload-img" v-if="shop.shopIcon ==''" |
|
|
|
style="background: #eee;text-align: center;line-height: 100rpx;"> |
|
|
|
<uni-icons type="camera" size="28" color="#777"></uni-icons> |
|
|
|
</view> |
|
|
|
<image :src="shop.shopIcon" v-if="shop.shopIcon !=''" mode="" class="upload-img"></image> |
|
|
|
@ -25,7 +26,8 @@ |
|
|
|
副标题 |
|
|
|
</view> |
|
|
|
<view class="list-right"> |
|
|
|
<input type="text" placeholder="请输入副标题" v-model="shop.subtitle" style="height: 100rpx;line-height: 100rpx;" /> |
|
|
|
<input type="text" placeholder="请输入副标题" v-model="shop.subtitle" |
|
|
|
style="height: 100rpx;line-height: 100rpx;" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="list-1"> |
|
|
|
@ -73,7 +75,8 @@ |
|
|
|
支付宝账号 |
|
|
|
</view> |
|
|
|
<view class="list-right"> |
|
|
|
<input type="text" placeholder="请输入支付宝账号" v-model="shop.aliAccount" style="height: 100rpx;line-height: 100rpx;" /> |
|
|
|
<input type="text" placeholder="请输入支付宝账号" v-model="shop.aliAccount" |
|
|
|
style="height: 100rpx;line-height: 100rpx;" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="list-1"> |
|
|
|
@ -81,7 +84,8 @@ |
|
|
|
支付宝实名 |
|
|
|
</view> |
|
|
|
<view class="list-right"> |
|
|
|
<input type="text" placeholder="请输入支付宝账号" v-model="shop.aliName" style="height: 100rpx;line-height: 100rpx;" /> |
|
|
|
<input type="text" placeholder="请输入支付宝账号" v-model="shop.aliName" |
|
|
|
style="height: 100rpx;line-height: 100rpx;" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -97,30 +101,31 @@ |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
shop:{}, |
|
|
|
shopImages:[], |
|
|
|
huanjing:'' |
|
|
|
shop: {}, |
|
|
|
shopImages: [], |
|
|
|
huanjing: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
this.shop = JSON.parse(uni.getStorageSync('shop')); |
|
|
|
this.shop = JSON.parse(uni.getStorageSync('area')).shop; |
|
|
|
console.log('好的好的',this.shop) |
|
|
|
this.shopImages = this.shop.shopImages.split('@@') |
|
|
|
this.huanjing = JSON.parse(this.shopImages[3])[0] |
|
|
|
|
|
|
|
for (let key in this.shop) { |
|
|
|
if (this.shop[key] === null) { |
|
|
|
delete this.shop[key]; |
|
|
|
} |
|
|
|
if (this.shop[key] === null) { |
|
|
|
delete this.shop[key]; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
navigatorTo(e){ |
|
|
|
navigatorTo(e) { |
|
|
|
let url = "" |
|
|
|
if(e=='addgoods'){ |
|
|
|
if (e == 'addgoods') { |
|
|
|
url = '/package1/myCenter/addGoods' |
|
|
|
}else if(e=='merchant'){ |
|
|
|
} else if (e == 'merchant') { |
|
|
|
url = '/package1/myCenter/myMerchant' |
|
|
|
}else if(e == 'xiugaixinxi'){ |
|
|
|
} else if (e == 'xiugaixinxi') { |
|
|
|
url = '/pages/myCenter/shopDetail' |
|
|
|
} |
|
|
|
uni.navigateTo({ |
|
|
|
@ -130,7 +135,7 @@ |
|
|
|
pictureAdd(type) { |
|
|
|
let that = this |
|
|
|
uni.chooseMedia({ |
|
|
|
count: type == 'qita'?9:1, |
|
|
|
count: type == 'qita' ? 9 : 1, |
|
|
|
mediaType: ['image'], |
|
|
|
sourceType: ['album', 'camera'], |
|
|
|
success(res) { |
|
|
|
@ -139,13 +144,13 @@ |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
for (let i = 0; i < res.tempFiles.length; i++) { |
|
|
|
that.upLoadFile(res.tempFiles[i].tempFilePath,type) |
|
|
|
that.upLoadFile(res.tempFiles[i].tempFilePath, type) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
async upLoadFile(path,type) { |
|
|
|
async upLoadFile(path, type) { |
|
|
|
let that = this; |
|
|
|
let hiver_token = uni.getStorageSync("hiver_token") |
|
|
|
await uni.uploadFile({ |
|
|
|
@ -160,7 +165,7 @@ |
|
|
|
success: (uploadFileRes) => { |
|
|
|
let pathData = JSON.parse(uploadFileRes.data) |
|
|
|
that.shop.shopIcon = pathData.result |
|
|
|
|
|
|
|
|
|
|
|
that.$forceUpdate() |
|
|
|
}, |
|
|
|
fail: (err) => { |
|
|
|
@ -175,84 +180,94 @@ |
|
|
|
uni.hideLoading(); |
|
|
|
}, 1000) |
|
|
|
}, |
|
|
|
submit(){ |
|
|
|
submit() { |
|
|
|
console.log(this.shop) |
|
|
|
console.log(typeof(this.shop)) |
|
|
|
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() |
|
|
|
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() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
uni.showToast(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
} else { |
|
|
|
uni.showToast(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style> |
|
|
|
page,.page1{ |
|
|
|
page, |
|
|
|
.page1 { |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
font-size: 28rpx; |
|
|
|
background: #eee; |
|
|
|
} |
|
|
|
.list-box{ |
|
|
|
|
|
|
|
.list-box { |
|
|
|
width: 100%; |
|
|
|
height: auto; |
|
|
|
background: #fff; |
|
|
|
margin-top: 20rpx; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
.list-1{ |
|
|
|
|
|
|
|
.list-1 { |
|
|
|
display: flex; |
|
|
|
width: 100%; |
|
|
|
height: 100rpx; |
|
|
|
line-height: 100rpx; |
|
|
|
border-bottom: 1px solid #eee; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
.list-2{ |
|
|
|
|
|
|
|
.list-2 { |
|
|
|
width: 100%; |
|
|
|
height: 100rpx; |
|
|
|
line-height: 100rpx; |
|
|
|
text-align: center; |
|
|
|
border-bottom: 1px solid #eee; |
|
|
|
} |
|
|
|
.list-icon{ |
|
|
|
|
|
|
|
.list-icon { |
|
|
|
width: 100rpx; |
|
|
|
height: 100rpx; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
.list-name{ |
|
|
|
|
|
|
|
.list-name { |
|
|
|
flex: 1; |
|
|
|
padding-left: 20rpx; |
|
|
|
} |
|
|
|
.list-right{ |
|
|
|
|
|
|
|
.list-right { |
|
|
|
flex: 1; |
|
|
|
height: 100rpx; |
|
|
|
text-align: right; |
|
|
|
padding-right: 20rpx; |
|
|
|
overflow: hidden; |
|
|
|
} |
|
|
|
.upload-img{ |
|
|
|
width:60rpx; |
|
|
|
|
|
|
|
.upload-img { |
|
|
|
width: 60rpx; |
|
|
|
height: 60rpx; |
|
|
|
background-size: 100%; |
|
|
|
margin-top: 20rpx; |
|
|
|
} |
|
|
|
.list-2{ |
|
|
|
|
|
|
|
.list-2 { |
|
|
|
width: 100%; |
|
|
|
height: 100rpx; |
|
|
|
line-height: 100rpx; |
|
|
|
|