Browse Source

Merge branch 'devlop' of http://git.qniao.cn/dengxiongfei/paper-shopkeeper-app into devlop

# Conflicts:
#	pages/mall/index.vue
devlop
buffeyu 4 years ago
parent
commit
a3c5a9a0bf
7 changed files with 195 additions and 116 deletions
  1. 8
      apis/add-paper.js
  2. 76
      pages/add-paper/index.vue
  3. 27
      pages/mall/index.vue
  4. 5
      pages/my-offer/index.vue
  5. 16
      pages/paper-detail/index.vue
  6. 95
      pages/quotation-details/index.vue
  7. 84
      pages/store-settings/index.vue

8
apis/add-paper.js

@ -44,6 +44,14 @@ export function productStatus(data) {
data
})
}
// 编辑店铺、
export function updataStore(data) {
return http.post({
url: '/base-paper-trading/update/store?mallSupplierId='+data.mallSupplierId,
data
})
}
/**
* 获取我店铺列表
* swagger:http://api-ops-yyt-test.qniao.cn/base-paper-trading/swagger-ui/index.html?urls.primaryName=CustomerApi#/店铺/getMyStoreListUsingGET

76
pages/add-paper/index.vue

@ -14,7 +14,7 @@
<text class="add-paper-text">纸品名称</text>
</view>
<view class="add-paper-input">
<qn-easyinput type="digit" :styles="{ disableColor: '#fff' }" v-model="form.name" :inputBorder="false" text="right" placeholder="请输入纸品名称"></qn-easyinput>
<qn-easyinput type="text" :styles="{ disableColor: '#fff' }" v-model="form.name" :inputBorder="false" text="right" placeholder="请输入纸品名称"></qn-easyinput>
</view>
</view>
<view class="add-paper-border"></view>
@ -25,7 +25,7 @@
</view>
<view class="add-paper-input">
<qn-easyinput
type="digit"
type="text"
:styles="{ disableColor: '#fff' }"
v-model="form.manufacturerName"
:inputBorder="false"
@ -42,7 +42,7 @@
</view>
<view class="add-paper-input">
<qn-easyinput
type="digit"
type="text"
:styles="{ disableColor: '#fff' }"
v-model="form.brandName"
:inputBorder="false"
@ -70,7 +70,7 @@
<text class="add-paper-start"><uni-icons custom-prefix="iconfont" type="icon-required" size="14" color="#F5222D"></uni-icons></text>
<text class="add-paper-text">是否主营</text>
</view>
<view><uni-data-checkbox v-model="form.isMainProduct" :localdata="range" @change="change"></uni-data-checkbox></view>
<view><uni-data-checkbox v-model="form.isMainProductRep" :localdata="range"></uni-data-checkbox></view>
</view>
</view>
<uGap></uGap>
@ -281,11 +281,11 @@
</template>
<script>
import { back, go2,uploadFile } from '@/utils/hook.js'
import { back, go2, uploadFile } from '@/utils/hook.js'
import qnEasyinput from '@/components/qn-easyinput/qn-easyinput.vue'
import uGap from '@/components/u-gap/u-gap.vue'
import { getCategoryList, createProduct, getSupplierDteail, updateProduct } from '@/apis/add-paper.js'
const validateFields = ['name', 'isMainProduct', 'manufacturerName', 'brandName', 'categoryId']
const validateFields = ['name', 'isMainProductRep', 'manufacturerName', 'brandName', 'categoryId']
const validatePriceFields = ['isPromoting', 'listPrice', 'minimum', 'stock', 'stockUnit', 'weight']
export default {
components: {
@ -297,7 +297,7 @@ export default {
title: '添加纸品',
form: {
name: null,
isMainProduct: 0,
isMainProductRep: 0,
manufacturerName: null,
brandName: null,
categoryId: null
@ -337,24 +337,26 @@ export default {
],
imgList: [],
priceIndex: 0,
eidtFor: 0
eidtFor: 0,
option: ''
}
},
onLoad(option) {
if (option) {
this.title = option.title
}
this.option = option
this.eidtFor = 0
if (this.title === '编辑纸品') {
this.getDteailList()
this.eidtFor = 1
}
console.log('this.$store.state.supplierInfo.id',this.$store.state.supplierInfo.id)
console.log('this.$store.state.supplierInfo.id', this.$store.state.supplierInfo.id)
this.getCategoryListQuery()
},
watch: {
['form.name'](val) {
this.form.id = ""
this.form.id = ''
console.log(111)
}
},
@ -379,14 +381,40 @@ export default {
//
getDteailList(res) {
var params = {
mallSupplierIds : null,
productId : null
mallSupplierIds: this.$store.state.supplierInfo.supplierId,
productId: this.option.id
}
this.getSupplierDteail(params).then(res => {
getSupplierDteail(params).then(res => {
if (res) {
this.form = res
if (this.form.isMainProduct === true) {
this.$set(this.form, 'isMainProductRep', 0)
} else {
this.$set(this.form, 'isMainProductRep', 1)
}
this.skuList = res.skuList
this.imgList = res.imgList
for(let j = 0;j<this.skuList.length;j++){
if(this.skuList[j].isPromoting === true){
this.skuList[j].isPromoting = 0
}else{
this.skuList[j].isPromoting = 1
}
}
for(let x =0;x<this.paperList.length;x++){
if(this.paperList[x].id === this.form.categoryId){
this.$set(this.form,'categoryName',this.paperList[x].name)
}
}
this.imgList = []
for (let i = 0; i < res.imgList.length; i++) {
var params = {
name: 'text',
extname: 'text',
url: res.imgList[i]
}
this.imgList.push(params)
}
console.log('this.form',this.form)
}
})
},
@ -421,9 +449,9 @@ export default {
this.imgList.push(item.tempFiles[0])
this.postuploadFile(item.tempFiles[0])
},
postuploadFile(path){
uploadFile(path.path).then(val=>{
this.imgList[this.imgList.length -1].pathUrl = val
postuploadFile(path) {
uploadFile(path.path).then(val => {
this.imgList[this.imgList.length - 1].pathUrl = val
})
},
//
@ -458,14 +486,22 @@ export default {
}
}
var upImage = []
for(let i = 0;i < this.imgList.length;i++){
for (let i = 0; i < this.imgList.length; i++) {
upImage.push(this.imgList[i].pathUrl)
}
for(let j = 0;j<this.skuList.length;j++){
if(this.skuList[j].isPromoting === 0){
this.skuList[j].isPromoting = true
}else{
this.skuList[j].isPromoting = false
}
}
var params = {
...this.form,
isMainProduct: this.form.isMainProductRep === 0 ? true : false,
skuList: this.skuList,
imgList:upImage,
supplierId:this.$store.state.supplierInfo.supplierId
imgList: upImage,
supplierId: this.$store.state.supplierInfo.supplierId
}
if (this.eidtFor === 0) {
createProduct(params).then(res => {

27
pages/mall/index.vue

@ -15,15 +15,15 @@
切换商城
<image class="cut-icon" src="/static/imgs/mall/cut-icon.png" mode=""></image>
</view>
<view class="set" @click="setting()">设置</view>
<view class="set" @click="setting">设置</view>
</view>
</view>
<uGap></uGap>
<view class="" v-if="pageShow">
<scroll-list ref="list" :option="option" @load="upCallback" @refresh="downCallback" style="background-color: #FFFFFF;">
<view v-for="(item, index) in listData" :key="index" @click="detailInfo(item)">
<view class="content">
<image class="image" src="https://qncloud.oss-cn-shenzhen.aliyuncs.com/ztb_pic/testPic.jfif" mode=""></image>
<view v-for="(item, index) in listData" :key="index" >
<view class="content" @click="detailInfo(item)">
<image class="image" :src="item.litPicUrl" mode=""></image>
<view class="">
<view class="title">
<view class="">{{ item.brandName }}</view>
@ -38,7 +38,7 @@
<view class="other">
<view class="time">{{ item.updateTime }}</view>
<view class="btn">
<view class="" @click="editPaper()">编辑</view>
<view class="" @click="editPaper(item)">编辑</view>
<view class="divide"></view>
<view class="" @click="productStatusChange(item)">{{ item.status === '30111' ? '下架' : '上架' }}</view>
</view>
@ -160,19 +160,20 @@ export default {
go2('add-paper', params)
},
//
editPaper() {
editPaper(item) {
var params = {
...item,
title: '编辑纸品'
}
go2('add-paper', params)
},
//
setting() {
setting(item) {
go2('store-settings')
},
//
detailInfo(item) {
loginGo2('paper-detail', item)
detailInfo(item) {
loginGo2('paper-detail', item)
},
//
productStatusChange(item) {
@ -183,12 +184,12 @@ export default {
productStatus(params).then(res => {
if (res) {
uni.showToast({
title: '添加成功',
title: '状态修改成功',
icon: 'success'
})
setTimeout(() => {
back()
}, 1000)
this.orderPagination.pageNum = 1
this.quertData()
}
})
},

5
pages/my-offer/index.vue

@ -140,10 +140,7 @@ export default {
//
myPriceInfo(item) {
console.log(item)
uni.navigateTo({
url: '/pages/quotation-details/index'
})
go2('quotation-details',item)
}
}
}

16
pages/paper-detail/index.vue

@ -32,19 +32,19 @@
<uni-table emptyText="暂无更多数据">
<!-- 表头行 -->
<uni-tr class="paper-table-title">
<uni-th align="left" width="65">克重</uni-th>
<uni-th align="left" width="65">规格</uni-th>
<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="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>779*1092</uni-td> -->
<uni-td>{{item.listPrice}}</uni-td>
<uni-td>{{item.stock}}</uni-td>
<uni-td>{{item.isPromoting === ture ?'是':'否'}}</uni-td>
<uni-td>{{item.isPromoting === true ?'是':'否'}}</uni-td>
</uni-tr>
</uni-table>
</view>
@ -99,10 +99,10 @@ export default {
//
getDteailList(option) {
var params = {
mallSupplierIds : option.id,
productId : null
mallSupplierIds : this.$store.state.supplierInfo.supplierId,
productId : option.id
}
this.getSupplierDteail(params).then(res => {
getSupplierDteail(params).then(res => {
if (res) {
this.form = res
this.skuList = res.skuList

95
pages/quotation-details/index.vue

@ -28,12 +28,12 @@
<uGap></uGap>
<view class="submit-contant" v-for="(items, index) in upDataObj.itemList" :key="index">
<view class="submit-contant-head">
<view class="submit-contant-title">{{ items.brandName }}|{{ items.gramWeight }}|{{ items.length }}*{{ items.width }}|{{ items.quantity }}</view>
<view class="submit-contant-title">{{ items.brandName }}|{{ items.gramWeight }}|{{ items.length }}*{{ items.width }}|{{ items.quantity }}</view>
</view>
<view class="submit-contant-body">
<view class="">
<text class="submit-contant-body-title">重量()</text>
<text class="submit-contant-body-subtitle">1.6544</text>
<text class="submit-contant-body-subtitle">{{ items.wight }}</text>
</view>
<view>
<text class="submit-contant-body-title">单价(/)</text>
@ -51,18 +51,18 @@
<view class="submit-contant-order">
<view class="">
<text class="submit-contant-order-title">其他费用</text>
<text class="submit-contant-order-subtitle">¥ 80.00</text>
<text class="submit-contant-order-subtitle">¥ {{ upDataObj.otherFee }}</text>
</view>
<view class="">
<text class="submit-contant-order-title">合计</text>
<text class="submit-contant-order-money">¥ 13800.32</text>
<text class="submit-contant-order-money">¥ {{ upDataObj.totalAllPrice }}</text>
</view>
</view>
<uGap></uGap>
<view class="submit-contant-time">
<view class="">
<text class="submit-contant-time-title">有效时间</text>
<text class="submit-contant-time-title">24小时</text>
<text class="submit-contant-time-title">{{ upDataObj.enquiryValidTime }}</text>
</view>
</view>
<uGap></uGap>
@ -91,46 +91,36 @@ export default {
value: '',
visible: true,
title: 'picker-view',
upDataObj:{
belongEnterpriseName:'东莞市隆兴纸业有限公司',
deliveryArea:'广东省/广州市/天河区',
deliveryDay:'2021/12/29 12:30',
enquiryValidTime:[12,11,10],
itemList:[
{
brandName:'丽品白卡',
categoryName:"",
gramWeight:'200g',
length:'787',
quantity:'5000张',
width:'1092',
unitFee:'1000',
totalPrice:'1202'
},
{
brandName:'丽品白卡',
categoryName:"",
gramWeight:'200g',
length:'787',
quantity:'5000张',
width:'1092',
unitFee:'1000',
totalPrice:'1202'
}
]
},
upDataObj: {
belongEnterpriseName: '东莞市隆兴纸业有限公司',
deliveryArea: '广东省/广州市/天河区',
deliveryDay: '2021/12/29 12:30',
enquiryValidTime: [12, 11, 10],
itemList: []
}
}
},
onLoad(Option) {
this.getDetail(Option.id)
},
methods: {
back,
//
getDetail(id){
this.enquiryReplyDetail(id)
.then(({ list, total }) => {
this.$refs.orderRef.loadSuccess({ list, total })
getDetail(id) {
enquiryReplyDetail(id)
.then(res => {
if (res) {
this.upDataObj = res
var timeb = this.upDataObj.enquiryValidTime.split(' ')
var timeabs = timeb[1].split(':')
this.$set(this.upDataObj, 'enquiryValidTimeSplit', timeabs)
this.$set(this.upDataObj, 'otherFee', 0)
this.$set(this.upDataObj, 'totalAllPrice', 0)
this.priceFree()
}
})
.catch(() => {
this.$refs.orderRef.loadFail()
.catch(err => {
reject(err)
})
},
//
@ -150,6 +140,14 @@ export default {
bindChange(e) {
console.log(e.detail.value)
},
priceFree() {
for (let i = 0; i < this.upDataObj.itemList.length; i++) {
var totalAllPrice = parseFloat(this.upDataObj.totalAllPrice) + parseFloat(this.upDataObj.itemList[i].totalPrice)
this.upDataObj.totalAllPrice = totalAllPrice.toFixed(2)
var otherFee = parseFloat(this.upDataObj.otherFee) + parseFloat(this.upDataObj.itemList[i].otherFee)
this.upDataObj.otherFee = otherFee.toFixed(2)
}
},
close() {
this.$refs.popup.close()
this.$refs.popupPrice.close()
@ -168,13 +166,12 @@ export default {
this.$refs.popupTime.close()
},
//
editPrice(){
var params= {
title:"修改报价"
editPrice() {
var params = {
title: '修改报价'
}
go2('submit-quotation', params)
},
go2('submit-quotation', params)
}
}
}
</script>
@ -557,16 +554,16 @@ export default {
padding: 32rpx;
line-height: 42rpx;
}
.edit-price{
.edit-price {
font-size: 28rpx;
color: #007AFF;
color: #007aff;
text-align: right;
line-height: 40prx;
font-weight: 500;
}
.price-tips{
.price-tips {
font-size: 30rpx;
color: #FF5368;
color: #ff5368;
letter-spacing: 0;
text-align: right;
font-weight: 500;

84
pages/store-settings/index.vue

@ -24,7 +24,7 @@
<view class="tore-setting-name"><text>店铺logo</text></view>
<view class="store-log store-image-flex">
<uni-file-picker
class="stotr-image-width"
class="stotr-image-width"
v-model="imageValue"
file-mediatype="image"
mode="grid"
@ -35,9 +35,8 @@
@success="success"
@fail="fail"
@select="select"
@delete="deleteImage"
>
<image class="paper-upload-image" src="../../static/imgs/trade/uploadImage.png" mode=""></image>
<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>
@ -45,7 +44,7 @@
<view class="store-log">
<view class="tore-setting-name"><text>背景图片</text></view>
<view class="store-log store-image-flex">
<uni-file-picker class="stotr-image-widtht" :limit="1" fileMediatype="image" :image-styles="imageStylest" >
<uni-file-picker class="stotr-image-widtht" @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>
@ -53,18 +52,21 @@
</view>
</view>
<view class="">
<view class="upload-btn"><button type="primary" class="btn-class">保存设置</button></view>
<view class="upload-btn"><button type="primary" class="btn-class" @click="uploadSet">保存设置</button></view>
</view>
</view>
</template>
<script>
import { back, go2 } from '@/utils/hook.js'
import { back, go2, uploadFile } from '@/utils/hook.js'
import { updataStore } from '@/apis/add-paper.js'
export default {
data() {
return {
storeName: '',
imageValue: [],
background: '',
logo: '',
imageStyles: {
width: 120,
height: 100,
@ -74,9 +76,16 @@ export default {
width: 183,
height: 94,
border: false
}
},
option:''
}
},
onLoad(option) {
if (option) {
this.option = option
}
},
methods: {
back,
//
@ -91,9 +100,10 @@ export default {
},
//
select(item) {
console.log(item)
console.log(this.imageValue)
this.imageValue.push(item.tempFiles[0])
this.postuploadFile(item.tempFiles[0], 'logo')
},
backSelect(item) {
this.postuploadFile(item.tempFiles[0], 'background')
},
//
deleteImage(item) {
@ -104,6 +114,36 @@ export default {
}
}
console.log(this.imageValue)
},
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)
}
})
}
}
}
@ -111,7 +151,7 @@ export default {
<style lang="scss">
.store-setting {
background-color: #FFFFFF;
background-color: #ffffff;
.store-setting-title {
width: 100%;
font-size: 36rpx;
@ -139,7 +179,7 @@ export default {
.store-log {
margin-top: 32rpx;
}
.store-image-flex{
.store-image-flex {
display: flex;
}
.store-image-text {
@ -150,24 +190,24 @@ export default {
line-height: 40rpx;
margin-left: 10rpx;
}
.stotr-image-widtht{
.stotr-image-widtht {
width: 100%;
background-color: rgba(220,222,224,1);
background-color: rgba(220, 222, 224, 1);
}
.stotr-image-width{
.stotr-image-width {
width: 48%;
background-color: rgba(220,222,224,1);
background-color: rgba(220, 222, 224, 1);
}
.upload-btn{
.upload-btn {
position: absolute;
width: 92%;
bottom: 32rpx;
left: 32rpx;
width: 92%;
bottom: 32rpx;
left: 32rpx;
}
.paper-upload-image{
.paper-upload-image {
width: 120rpx;
height: 120rpx;
background: rgba(220,222,224,1);
background: rgba(220, 222, 224, 1);
border-radius: 10rpx;
}
}

Loading…
Cancel
Save