11 changed files with 846 additions and 579 deletions
Split View
Diff Options
-
96apis/add-paper.js
-
1manifest.json
-
4pages/add-paper/index.vue
-
5pages/client-credit/index.vue
-
90pages/mall/index.vue
-
115pages/mine/index.vue
-
466pages/paper-detail/index.vue
-
456pages/store-settings/index.vue
-
190pages/switching-mall/index.vue
-
BINstatic/imgs/mall/top-bg.png
-
2utils/hook.js
@ -1,215 +1,281 @@ |
|||
<template> |
|||
<view class="paper-detail"> |
|||
<view> |
|||
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title=""> |
|||
<view class="paper-detail-title">纸品详情</view> |
|||
<view slot="left"></view> |
|||
<view slot="right" class="paper-detail-right-title" @tap="shareTap">分享</view> |
|||
</uni-nav-bar> |
|||
</view> |
|||
<view class="paper-detail-info"> |
|||
<view class=""> |
|||
<text class="paper-detail-info-text">纸品名称:</text> |
|||
<text class="paper-detail-info-subtext">{{form.name}}</text> |
|||
</view> |
|||
<view class=""> |
|||
<text class="paper-detail-info-text">纸厂信息:</text> |
|||
<text class="paper-detail-info-subtext">{{form.manufacturerName}}</text> |
|||
</view> |
|||
<view class=""> |
|||
<text class="paper-detail-info-text">品牌信息:</text> |
|||
<text class="paper-detail-info-subtext">{{form.brandName}}</text> |
|||
</view> |
|||
<view class=""> |
|||
<text class="paper-detail-info-text">纸种信息:</text> |
|||
<text class="paper-detail-info-subtext">{{form.categoryName}}</text> |
|||
</view> |
|||
</view> |
|||
<uGap></uGap> |
|||
<view class="paper-datail-list"> |
|||
<view class="paper-datail-list-title paper-bottom-border">纸品售价</view> |
|||
<view class=""> |
|||
<uni-table emptyText="暂无更多数据"> |
|||
<!-- 表头行 --> |
|||
<uni-tr class="paper-table-title"> |
|||
<uni-th align="left" width="55">克重</uni-th> |
|||
<!-- <uni-th align="left" width="65">规格</uni-th> --> |
|||
<uni-th align="left" width="65">售价</uni-th> |
|||
<uni-th align="left" width="65">库存</uni-th> |
|||
<uni-th align="left" width="75">是否特价</uni-th> |
|||
</uni-tr> |
|||
<!-- 表格数据行 --> |
|||
<uni-tr v-for="(item,index) in skuList" :key="index"> |
|||
<uni-td>{{item.weight}}</uni-td> |
|||
<!-- <uni-td>779*1092</uni-td> --> |
|||
<uni-td>{{item.listPrice}}元</uni-td> |
|||
<uni-td>{{item.stock}}张</uni-td> |
|||
<uni-td>{{item.isPromoting === true ?'是':'否'}}</uni-td> |
|||
</uni-tr> |
|||
</uni-table> |
|||
</view> |
|||
</view> |
|||
<uGap></uGap> |
|||
<view class="paper-datail-list "> |
|||
<view class="paper-datail-list-title">纸品图片</view> |
|||
<view class="paper-list-view"> |
|||
<image v-for="(item,index) in imgList" class="paper-datail-list-image" :src="item" mode=""></image> |
|||
</view> |
|||
</view> |
|||
<uGap></uGap> |
|||
<view class="paper-datail-list paper-bottom-border"> |
|||
<view class="paper-datail-list-title ">商品买点</view> |
|||
<view class="paper-datail-list-text"><text>{{form.sellingProposition}}</text></view> |
|||
</view> |
|||
<view class="paper-datail-list paper-bottom-border"> |
|||
<view class="paper-datail-list-title ">商品描述</view> |
|||
<view class="paper-datail-list-text"><text>{{form.description}}</text></view> |
|||
</view> |
|||
<view class="paper-datail-list paper-bottom-border"> |
|||
<view class="paper-datail-list-title ">送货说明</view> |
|||
<view class="paper-datail-list-text"><text>{{form.shippingNote}}</text></view> |
|||
</view> |
|||
<view class="paper-datail-list paper-bottom-border"> |
|||
<view class="paper-datail-list-title ">其他说明</view> |
|||
<view class="paper-datail-list-text"><text>{{form.otherNote}}</text></view> |
|||
</view> |
|||
</view> |
|||
<view class="paper-detail"> |
|||
<view> |
|||
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title=""> |
|||
<view class="paper-detail-title">纸品详情</view> |
|||
<view slot="left"></view> |
|||
<view slot="right" class="paper-detail-right-title" @tap="shareTap">分享</view> |
|||
</uni-nav-bar> |
|||
</view> |
|||
<view class="paper-detail-info"> |
|||
<view class=""> |
|||
<text class="paper-detail-info-text">纸品名称:</text> |
|||
<text class="paper-detail-info-subtext">{{ form.name }}</text> |
|||
</view> |
|||
<view class=""> |
|||
<text class="paper-detail-info-text">纸厂信息:</text> |
|||
<text class="paper-detail-info-subtext">{{ form.manufacturerName }}</text> |
|||
</view> |
|||
<view class=""> |
|||
<text class="paper-detail-info-text">品牌信息:</text> |
|||
<text class="paper-detail-info-subtext">{{ form.brandName }}</text> |
|||
</view> |
|||
<view class=""> |
|||
<text class="paper-detail-info-text">纸种信息:</text> |
|||
<text class="paper-detail-info-subtext">{{ form.categoryName }}</text> |
|||
</view> |
|||
</view> |
|||
<uGap></uGap> |
|||
<view class="paper-datail-list"> |
|||
<view class="paper-datail-list-title paper-bottom-border">纸品售价</view> |
|||
<view class=""> |
|||
<uni-table emptyText="暂无更多数据"> |
|||
<!-- 表头行 --> |
|||
<uni-tr class="paper-table-title"> |
|||
<uni-th align="left" width="55">克重</uni-th> |
|||
<!-- <uni-th align="left" width="65">规格</uni-th> --> |
|||
<uni-th align="left" width="65">售价</uni-th> |
|||
<uni-th align="left" width="65">库存</uni-th> |
|||
<uni-th align="left" width="75">是否特价</uni-th> |
|||
</uni-tr> |
|||
<!-- 表格数据行 --> |
|||
<uni-tr v-for="(item, index) in skuList" :key="index"> |
|||
<uni-td>{{ item.weight }}</uni-td> |
|||
<!-- <uni-td>779*1092</uni-td> --> |
|||
<uni-td>{{ item.listPrice }}元</uni-td> |
|||
<uni-td>{{ transformStock(item.stock, item.stockUnit) }}</uni-td> |
|||
<uni-td>{{ item.isPromoting === true ? '是' : '否' }}</uni-td> |
|||
</uni-tr> |
|||
</uni-table> |
|||
</view> |
|||
</view> |
|||
<uGap></uGap> |
|||
<view class="paper-datail-list"> |
|||
<view class="paper-datail-list-title">纸品图片</view> |
|||
<view class="paper-list-view"> |
|||
<image v-for="(item, index) in imgList" :key="index" class="paper-datail-list-image" :src="item" mode=""></image> |
|||
</view> |
|||
</view> |
|||
<uGap></uGap> |
|||
<view class="paper-datail-list paper-bottom-border"> |
|||
<view class="paper-datail-list-title">商品买点</view> |
|||
<view class="paper-datail-list-text"> |
|||
<text>{{ form.sellingProposition }}</text> |
|||
</view> |
|||
</view> |
|||
<view class="paper-datail-list paper-bottom-border"> |
|||
<view class="paper-datail-list-title">商品描述</view> |
|||
<view class="paper-datail-list-text"> |
|||
<text>{{ form.description }}</text> |
|||
</view> |
|||
</view> |
|||
<view class="paper-datail-list paper-bottom-border"> |
|||
<view class="paper-datail-list-title">送货说明</view> |
|||
<view class="paper-datail-list-text"> |
|||
<text>{{ form.shippingNote }}</text> |
|||
</view> |
|||
</view> |
|||
<view class="paper-datail-list paper-bottom-border"> |
|||
<view class="paper-datail-list-title">其他说明</view> |
|||
<view class="paper-datail-list-text"> |
|||
<text>{{ form.otherNote }}</text> |
|||
</view> |
|||
</view> |
|||
<view class="share-area" v-if="visible"> |
|||
<view class="close-icon"> |
|||
<uni-icons @click="closeShare" type="close" size="35" color="white"></uni-icons> |
|||
</view> |
|||
<view class="share-content"> |
|||
<view class="flex-col-center-start"> |
|||
<text style="font-size: 34rpx">截图分享纸品</text> |
|||
<image style="width: 250rpx; height: 250rpx; margin-top: 30rpx" :src="paperCodeImg"></image> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { back, go2 } from '@/utils/hook.js' |
|||
import uGap from '@/components/u-gap/u-gap.vue' |
|||
import { getSupplierDteail } from '@/apis/add-paper.js' |
|||
import { getSupplierDetail, getPaperQrCode } from '@/apis/add-paper.js' |
|||
export default { |
|||
components: { |
|||
uGap |
|||
}, |
|||
data() { |
|||
return { |
|||
form:{}, |
|||
skuList:[], |
|||
imgList:[], |
|||
option:'' |
|||
} |
|||
}, |
|||
onLoad(option) { |
|||
this.getDteailList(option) |
|||
this.option = option |
|||
}, |
|||
methods: { |
|||
back, |
|||
//获取详情 |
|||
getDteailList(option) { |
|||
var params = { |
|||
mallSupplierIds : this.$store.state.supplierInfo.supplierId, |
|||
productId : option.id |
|||
} |
|||
getSupplierDteail(params).then(res => { |
|||
if (res) { |
|||
this.form = res |
|||
this.skuList = res.skuList |
|||
this.imgList = res.imgList |
|||
this.$set(this.form,'categoryName',this.option.categoryName) |
|||
} |
|||
}) |
|||
}, |
|||
// 分享 |
|||
shareTap() { |
|||
uni.share({ |
|||
provider: "weixin", |
|||
scene: "WXSceneSession", |
|||
type: 0, |
|||
href: "http://uniapp.dcloud.io/", |
|||
title: "uni-app分享", |
|||
summary: "我正在使用HBuilderX开发uni-app,赶紧跟我一起来体验!", |
|||
imageUrl: "https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-uni-app-doc/d8590190-4f28-11eb-b680-7980c8a877b8.png", |
|||
success: function (res) { |
|||
console.log("success:" + JSON.stringify(res)); |
|||
}, |
|||
fail: function (err) { |
|||
console.log("fail:" + JSON.stringify(err)); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
components: { |
|||
uGap |
|||
}, |
|||
data() { |
|||
return { |
|||
paperCodeImg: '', // 店铺二维码 |
|||
visible: false, // 分享弹窗 |
|||
form: {}, |
|||
skuList: [], |
|||
imgList: [], |
|||
id: null |
|||
} |
|||
}, |
|||
onLoad(option) { |
|||
if (option.id) { |
|||
this.id = option.id |
|||
this.getDetailList() |
|||
} else { |
|||
uni.showToast({ |
|||
title: '参数错误', |
|||
icon: 'none', |
|||
success: () => { |
|||
setTimeout(() => { |
|||
back() |
|||
}, 2000) |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
methods: { |
|||
back, |
|||
//获取详情 |
|||
getDetailList() { |
|||
var params = { |
|||
mallSupplierIds: this.$store.state.supplierInfo.supplierId, |
|||
productId: this.id |
|||
} |
|||
getSupplierDetail(params).then((res) => { |
|||
if (res) { |
|||
this.form = res |
|||
this.skuList = res.skuList |
|||
this.imgList = res.imgList |
|||
this.$set(this.form, 'categoryName', res.categoryName) |
|||
} |
|||
}) |
|||
}, |
|||
transformStock(num, unit) { |
|||
if (unit == 2) { |
|||
return `${num}吨` |
|||
} |
|||
if (unit == 1) { |
|||
return `${num}张` |
|||
} |
|||
}, |
|||
// 分享 |
|||
shareTap() { |
|||
getPaperQrCode({ mallSupplierId: this.$store.state.supplierInfo.supplierId, paperId: this.id }).then((res) => { |
|||
if (res) { |
|||
this.visible = true |
|||
this.paperCodeImg = `data:image/png;base64,${res}` |
|||
} |
|||
}) |
|||
}, |
|||
closeShare() { |
|||
this.visible = false |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.paper-detail { |
|||
.paper-detail-title { |
|||
width: 100%; |
|||
font-size: 36rpx; |
|||
color: #000000; |
|||
letter-spacing: 0; |
|||
text-align: center; |
|||
font-weight: 500; |
|||
} |
|||
.paper-detail-right-title { |
|||
font-size: 28rpx; |
|||
color: #007aff; |
|||
text-align: right; |
|||
line-height: 40rpx; |
|||
font-weight: 500; |
|||
} |
|||
.paper-detail-info { |
|||
height: 260rpx; |
|||
background: #ffffff; |
|||
padding: 24rpx 32rpx; |
|||
line-height: 56rpx; |
|||
} |
|||
.paper-detail-info-text { |
|||
font-size: 28rrpx; |
|||
color: #888888; |
|||
letter-spacing: 0; |
|||
font-weight: 400; |
|||
} |
|||
.paper-detail-info-subtext { |
|||
font-size: 28rpx; |
|||
color: #333333; |
|||
letter-spacing: 0; |
|||
font-weight: 400; |
|||
} |
|||
.paper-detail-title { |
|||
width: 100%; |
|||
font-size: 36rpx; |
|||
color: #000000; |
|||
letter-spacing: 0; |
|||
text-align: center; |
|||
font-weight: 500; |
|||
} |
|||
.paper-detail-right-title { |
|||
font-size: 28rpx; |
|||
color: #007aff; |
|||
text-align: right; |
|||
line-height: 40rpx; |
|||
font-weight: 500; |
|||
} |
|||
.paper-detail-info { |
|||
height: 260rpx; |
|||
background: #ffffff; |
|||
padding: 24rpx 32rpx; |
|||
line-height: 56rpx; |
|||
} |
|||
.paper-detail-info-text { |
|||
font-size: 28rrpx; |
|||
color: #888888; |
|||
letter-spacing: 0; |
|||
font-weight: 400; |
|||
} |
|||
.paper-detail-info-subtext { |
|||
font-size: 28rpx; |
|||
color: #333333; |
|||
letter-spacing: 0; |
|||
font-weight: 400; |
|||
} |
|||
|
|||
.paper-datail-list { |
|||
background: #ffffff; |
|||
.paper-datail-list-title { |
|||
font-size: 28rpx; |
|||
color: #000000; |
|||
letter-spacing: 0; |
|||
font-weight: 600; |
|||
height: 80rpx; |
|||
align-items: center; |
|||
display: flex; |
|||
padding-left: 32rpx; |
|||
} |
|||
.paper-datail-list-text { |
|||
font-size: 28rpx; |
|||
color: #333333; |
|||
letter-spacing: 0; |
|||
font-weight: 400; |
|||
align-items: center; |
|||
line-height: 50rpx; |
|||
padding: 0rpx 32rpx 20rpx 32rpx; |
|||
} |
|||
.paper-table-title { |
|||
font-size: 24rpx; |
|||
color: rgba(0, 0, 0, 0.5); |
|||
letter-spacing: 0; |
|||
font-weight: 400; |
|||
background: #f7f8fa; |
|||
} |
|||
.paper-list-view { |
|||
line-height: 40rpx; |
|||
} |
|||
.paper-datail-list-image { |
|||
width: 120rpx; |
|||
height: 120rpx; |
|||
padding: 32rpx 32rpx; |
|||
} |
|||
} |
|||
.paper-bottom-border { |
|||
border-bottom: 2rpx solid #d8d8d8; |
|||
} |
|||
.paper-datail-list { |
|||
background: #ffffff; |
|||
.paper-datail-list-title { |
|||
font-size: 28rpx; |
|||
color: #000000; |
|||
letter-spacing: 0; |
|||
font-weight: 600; |
|||
height: 80rpx; |
|||
align-items: center; |
|||
display: flex; |
|||
padding-left: 32rpx; |
|||
} |
|||
.paper-datail-list-text { |
|||
font-size: 28rpx; |
|||
color: #333333; |
|||
letter-spacing: 0; |
|||
font-weight: 400; |
|||
align-items: center; |
|||
line-height: 50rpx; |
|||
padding: 0rpx 32rpx 20rpx 32rpx; |
|||
} |
|||
.paper-table-title { |
|||
font-size: 24rpx; |
|||
color: rgba(0, 0, 0, 0.5); |
|||
letter-spacing: 0; |
|||
font-weight: 400; |
|||
background: #f7f8fa; |
|||
} |
|||
.paper-list-view { |
|||
line-height: 40rpx; |
|||
} |
|||
.paper-datail-list-image { |
|||
width: 120rpx; |
|||
height: 120rpx; |
|||
padding: 32rpx 32rpx; |
|||
} |
|||
} |
|||
.paper-bottom-border { |
|||
border-bottom: 2rpx solid #d8d8d8; |
|||
} |
|||
} |
|||
.share-area { |
|||
width: 750rpx; |
|||
height: 100vh; |
|||
background: rgba(0, 0, 0, 0.5); |
|||
position: fixed; |
|||
z-index: 1000; |
|||
top: 0; |
|||
left: 0; |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: center; |
|||
align-items: center; |
|||
.close-icon { |
|||
width: 750rpx; |
|||
padding: 0 32rpx; |
|||
height: 70rpx; |
|||
flex-grow: 0; |
|||
flex-shrink: 0; |
|||
display: flex; |
|||
flex-direction: row; |
|||
align-items: center; |
|||
justify-content: flex-end; |
|||
} |
|||
.share-content { |
|||
width: 560rpx; |
|||
margin-top: 26rpx; |
|||
background-color: #fff; |
|||
border-radius: 20rpx; |
|||
padding: 42rpx; |
|||
} |
|||
} |
|||
</style> |
|||
@ -1,239 +1,245 @@ |
|||
<template> |
|||
<view class="store-setting"> |
|||
<view> |
|||
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title=""> |
|||
<view class="store-setting-title">店铺设置</view> |
|||
<view slot="left"></view> |
|||
<view slot="right"></view> |
|||
</uni-nav-bar> |
|||
</view> |
|||
<view class="store-setting-main"> |
|||
<view class="store-setting-name"><text>店铺名称</text></view> |
|||
<view class=""> |
|||
<qn-easyinput |
|||
class="store-setting-textArea" |
|||
:maxlength="100" |
|||
:styles="{ disableColor: '#F7F8FA' }" |
|||
v-model="storeName" |
|||
:inputBorder="false" |
|||
type="textarea" |
|||
placeholder="请输入店铺名称" |
|||
></qn-easyinput> |
|||
</view> |
|||
<view class="store-log"> |
|||
<view class="tore-setting-name"><text>店铺logo</text></view> |
|||
<view class="store-log store-image-flex"> |
|||
<uni-file-picker |
|||
class="stotr-image-width" |
|||
v-model="logoImage" |
|||
file-mediatype="image" |
|||
mode="grid" |
|||
file-extname="png,jpg" |
|||
:limit="1" |
|||
:image-styles="imageStyles" |
|||
@progress="progress" |
|||
@success="success" |
|||
@fail="fail" |
|||
@select="select" |
|||
@delete="deleteLogo" |
|||
> |
|||
<image class="paper-upload-image" src="../../static/imgs/trade/uploadImage.png" mode=""></image> |
|||
</uni-file-picker> |
|||
<view class="store-image-text ">建议尺寸:200*200像素,尺寸不匹配时,图片将被压缩或拉伸以铺满画面</view> |
|||
</view> |
|||
</view> |
|||
<view class="store-log"> |
|||
<view class="tore-setting-name"><text>背景图片</text></view> |
|||
<view class="store-log store-image-flex"> |
|||
<uni-file-picker @delete="deleteImage" class="stotr-image-widtht" v-model="backgroundImage" @select="backSelect" :limit="1" fileMediatype="image" :image-styles="imageStylest"> |
|||
<image class="paper-upload-image" src="../../static/imgs/trade/uploadImage.png" mode=""></image> |
|||
</uni-file-picker> |
|||
<view class="store-image-text">建议尺寸:750*370像素,尺寸不匹配时,图片将被压缩或拉伸以铺满画面</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class=""> |
|||
<view class="upload-btn"><button type="primary" class="btn-class" @click="uploadSet">保存设置</button></view> |
|||
</view> |
|||
</view> |
|||
<view class="store-setting"> |
|||
<view> |
|||
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title=""> |
|||
<view class="store-setting-title">店铺设置</view> |
|||
<view slot="left"></view> |
|||
<view slot="right"></view> |
|||
</uni-nav-bar> |
|||
</view> |
|||
<view class="store-setting-main"> |
|||
<view class="store-setting-name"><text>店铺名称</text></view> |
|||
<view class=""> |
|||
<qn-easyinput |
|||
class="store-setting-textArea" |
|||
:maxlength="100" |
|||
:styles="{ disableColor: '#F7F8FA' }" |
|||
v-model="storeName" |
|||
:inputBorder="false" |
|||
type="textarea" |
|||
placeholder="请输入店铺名称" |
|||
></qn-easyinput> |
|||
</view> |
|||
<view class="store-log"> |
|||
<view class="tore-setting-name"><text>店铺logo</text></view> |
|||
<view class="store-log store-image-flex"> |
|||
<uni-file-picker |
|||
class="stotr-image-width" |
|||
v-model="logoImage" |
|||
file-mediatype="image" |
|||
mode="grid" |
|||
file-extname="png,jpg" |
|||
:limit="1" |
|||
:image-styles="imageStyles" |
|||
@progress="progress" |
|||
@success="success" |
|||
@fail="fail" |
|||
@select="select" |
|||
@delete="deleteLogo" |
|||
> |
|||
<image class="paper-upload-image" src="../../static/imgs/trade/uploadImage.png" mode=""></image> |
|||
</uni-file-picker> |
|||
<view class="store-image-text">建议尺寸:200*200像素,尺寸不匹配时,图片将被压缩或拉伸以铺满画面</view> |
|||
</view> |
|||
</view> |
|||
<view class="store-log"> |
|||
<view class="tore-setting-name"><text>背景图片</text></view> |
|||
<view class="store-log store-image-flex"> |
|||
<uni-file-picker |
|||
@delete="deleteImage" |
|||
class="stotr-image-widtht" |
|||
v-model="backgroundImage" |
|||
@select="backSelect" |
|||
:limit="1" |
|||
fileMediatype="image" |
|||
:image-styles="imageStylest" |
|||
> |
|||
<image class="paper-upload-image" src="../../static/imgs/trade/uploadImage.png" mode=""></image> |
|||
</uni-file-picker> |
|||
<view class="store-image-text">建议尺寸:750*370像素,尺寸不匹配时,图片将被压缩或拉伸以铺满画面</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class=""> |
|||
<view class="upload-btn"><button type="primary" class="btn-class" @click="uploadSet">保存设置</button></view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { back, go2, uploadFile } from '@/utils/hook.js' |
|||
import { updataStore } from '@/apis/add-paper.js' |
|||
export default { |
|||
data() { |
|||
return { |
|||
storeName: '', |
|||
logoImage: [], |
|||
backgroundImage:[], |
|||
background: '', |
|||
logo: '', |
|||
imageStyles: { |
|||
width: 120, |
|||
height: 100, |
|||
border: false |
|||
}, |
|||
imageStylest: { |
|||
width: 183, |
|||
height: 94, |
|||
border: false |
|||
}, |
|||
option:'' |
|||
} |
|||
}, |
|||
onLoad(option) { |
|||
if (option) { |
|||
this.logoImage = [] |
|||
this.backgroundImage = [] |
|||
this.option = option |
|||
this.storeName = this.option.name |
|||
this.background = this.option.backgroundImg |
|||
this.logo = this.option.logo |
|||
if(this.option.logo !== ""){ |
|||
var logoImage = { |
|||
name:'text', |
|||
type:'image', |
|||
url:this.option.logo |
|||
} |
|||
this.logoImage.push(logoImage) |
|||
} |
|||
if(this.option.backgroundImg !== ""){ |
|||
var backgroundImage = { |
|||
name:'text', |
|||
type:'image', |
|||
url:this.option.backgroundImg |
|||
} |
|||
this.backgroundImage.push(backgroundImage) |
|||
} |
|||
|
|||
} |
|||
|
|||
}, |
|||
methods: { |
|||
back, |
|||
// 上传进度 |
|||
progress() {}, |
|||
// 上传成功回调 |
|||
success(item) { |
|||
console.log(item) |
|||
}, |
|||
// 上传失败回调 |
|||
fail(item) { |
|||
console.log(item) |
|||
}, |
|||
// 图片选择事件 |
|||
select(item) { |
|||
this.postuploadFile(item.tempFiles[0], 'logo') |
|||
}, |
|||
// 删除logo |
|||
deleteLogo(item) { |
|||
console.log('deleteImage', item) |
|||
this.logo = '' |
|||
}, |
|||
// 删除背景图 |
|||
deleteImage(item) { |
|||
console.log('deleteImage', item) |
|||
this.background = '' |
|||
}, |
|||
backSelect(item) { |
|||
console.log('item',item) |
|||
this.postuploadFile(item.tempFiles[0], 'background') |
|||
}, |
|||
postuploadFile(path, type) { |
|||
uploadFile(path.path).then(val => { |
|||
if (type === 'logo') { |
|||
this.logo = val |
|||
} else { |
|||
this.background = val |
|||
} |
|||
}) |
|||
}, |
|||
// 保存设置 |
|||
uploadSet() { |
|||
var params = { |
|||
backgroundImg: this.background, |
|||
id: this.$store.state.supplierInfo.id, |
|||
logo: this.logo, |
|||
name: this.storeName, |
|||
mallSupplierId: this.$store.state.supplierInfo.supplierId |
|||
} |
|||
updataStore(params).then(res => { |
|||
if (res) { |
|||
uni.showToast({ |
|||
title: '设置成功', |
|||
icon: 'success' |
|||
}) |
|||
setTimeout(() => { |
|||
back() |
|||
}, 1000) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
data() { |
|||
return { |
|||
storeName: '', |
|||
logoImage: [], |
|||
backgroundImage: [], |
|||
background: '', |
|||
logo: '', |
|||
imageStyles: { |
|||
width: 120, |
|||
height: 100, |
|||
border: false |
|||
}, |
|||
imageStylest: { |
|||
width: 183, |
|||
height: 94, |
|||
border: false |
|||
}, |
|||
option: '' |
|||
} |
|||
}, |
|||
onLoad(option) { |
|||
if (option) { |
|||
this.logoImage = [] |
|||
this.backgroundImage = [] |
|||
this.option = option |
|||
this.storeName = this.option.name |
|||
this.background = this.option.backgroundImg |
|||
this.logo = this.option.logo |
|||
if (this.option.logo) { |
|||
var logoImage = { |
|||
name: 'text', |
|||
type: 'image', |
|||
url: this.option.logo |
|||
} |
|||
this.logoImage.push(logoImage) |
|||
} |
|||
if (this.option.backgroundImg) { |
|||
var backgroundImage = { |
|||
name: 'text', |
|||
type: 'image', |
|||
url: this.option.backgroundImg |
|||
} |
|||
this.backgroundImage.push(backgroundImage) |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
back, |
|||
// 上传进度 |
|||
progress() {}, |
|||
// 上传成功回调 |
|||
success(item) { |
|||
console.log(item) |
|||
}, |
|||
// 上传失败回调 |
|||
fail(item) { |
|||
console.log(item) |
|||
}, |
|||
// 图片选择事件 |
|||
select(item) { |
|||
this.postuploadFile(item.tempFiles[0], 'logo') |
|||
}, |
|||
// 删除logo |
|||
deleteLogo(item) { |
|||
console.log('deleteImage', item) |
|||
this.logo = '' |
|||
}, |
|||
// 删除背景图 |
|||
deleteImage(item) { |
|||
console.log('deleteImage', item) |
|||
this.background = '' |
|||
}, |
|||
backSelect(item) { |
|||
console.log('item', item) |
|||
this.postuploadFile(item.tempFiles[0], 'background') |
|||
}, |
|||
postuploadFile(path, type) { |
|||
uploadFile(path.path).then((val) => { |
|||
if (type === 'logo') { |
|||
this.logo = val |
|||
} else { |
|||
this.background = val |
|||
} |
|||
}) |
|||
}, |
|||
// 保存设置 |
|||
uploadSet() { |
|||
var params = { |
|||
backgroundImg: this.background, |
|||
id: this.$store.state.supplierInfo.id, |
|||
logo: this.logo, |
|||
name: this.storeName, |
|||
mallSupplierId: this.$store.state.supplierInfo.supplierId |
|||
} |
|||
updataStore(params).then((res) => { |
|||
if (res) { |
|||
uni.showToast({ |
|||
title: '设置成功', |
|||
icon: 'success' |
|||
}) |
|||
setTimeout(() => { |
|||
back() |
|||
}, 1000) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.store-setting { |
|||
background-color: #ffffff; |
|||
.store-setting-title { |
|||
width: 100%; |
|||
font-size: 36rpx; |
|||
color: #000000; |
|||
letter-spacing: 0; |
|||
text-align: center; |
|||
font-weight: 500; |
|||
} |
|||
.store-setting-main { |
|||
padding: 20rpx 32rpx; |
|||
background-color: #ffffff; |
|||
} |
|||
.store-setting-name { |
|||
// font-size: 28rpx; |
|||
color: #000000; |
|||
letter-spacing: 0; |
|||
font-weight: 500; |
|||
} |
|||
.store-setting-textArea { |
|||
background: #f7f8fa; |
|||
border-radius: 20rpx; |
|||
padding: 10rpx; |
|||
margin-top: 20rpx; |
|||
} |
|||
.store-log { |
|||
margin-top: 32rpx; |
|||
} |
|||
.store-image-flex { |
|||
display: flex; |
|||
} |
|||
.store-image-text { |
|||
font-size: 24rpx; |
|||
color: #888888; |
|||
letter-spacing: 0; |
|||
font-weight: 400; |
|||
line-height: 40rpx; |
|||
margin-left: 10rpx; |
|||
} |
|||
.stotr-image-widtht { |
|||
width: 100%; |
|||
background-color: rgba(220, 222, 224, 1); |
|||
} |
|||
.stotr-image-width { |
|||
width: 48%; |
|||
background-color: rgba(220, 222, 224, 1); |
|||
} |
|||
.upload-btn { |
|||
position: absolute; |
|||
width: 92%; |
|||
bottom: 32rpx; |
|||
left: 32rpx; |
|||
} |
|||
.paper-upload-image { |
|||
width: 120rpx; |
|||
height: 120rpx; |
|||
background: rgba(220, 222, 224, 1); |
|||
border-radius: 10rpx; |
|||
} |
|||
background-color: #ffffff; |
|||
.store-setting-title { |
|||
width: 100%; |
|||
font-size: 36rpx; |
|||
color: #000000; |
|||
letter-spacing: 0; |
|||
text-align: center; |
|||
font-weight: 500; |
|||
} |
|||
.store-setting-main { |
|||
padding: 20rpx 32rpx; |
|||
background-color: #ffffff; |
|||
} |
|||
.store-setting-name { |
|||
// font-size: 28rpx; |
|||
color: #000000; |
|||
letter-spacing: 0; |
|||
font-weight: 500; |
|||
} |
|||
.store-setting-textArea { |
|||
background: #f7f8fa; |
|||
border-radius: 20rpx; |
|||
padding: 10rpx; |
|||
margin-top: 20rpx; |
|||
} |
|||
.store-log { |
|||
margin-top: 32rpx; |
|||
} |
|||
.store-image-flex { |
|||
display: flex; |
|||
} |
|||
.store-image-text { |
|||
font-size: 24rpx; |
|||
color: #888888; |
|||
letter-spacing: 0; |
|||
font-weight: 400; |
|||
line-height: 40rpx; |
|||
margin-left: 10rpx; |
|||
} |
|||
.stotr-image-widtht { |
|||
width: 100%; |
|||
background-color: rgba(220, 222, 224, 1); |
|||
} |
|||
.stotr-image-width { |
|||
width: 48%; |
|||
background-color: rgba(220, 222, 224, 1); |
|||
} |
|||
.upload-btn { |
|||
position: absolute; |
|||
width: 92%; |
|||
bottom: 32rpx; |
|||
left: 32rpx; |
|||
} |
|||
.paper-upload-image { |
|||
width: 120rpx; |
|||
height: 120rpx; |
|||
background: rgba(220, 222, 224, 1); |
|||
border-radius: 10rpx; |
|||
} |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save