Browse Source

纸商城

devlop
邓雄飞 4 years ago
parent
commit
0741abe856
9 changed files with 224 additions and 168 deletions
  1. 18
      apis/commonApi.js
  2. 4
      pages/client-detail/base-paper-deals.vue
  3. 12
      pages/client-detail/index.vue
  4. 16
      pages/enterprise-info/index.vue
  5. 146
      pages/mall/index.vue
  6. 13
      pages/mine/index.vue
  7. 5
      pages/order-detail/index.vue
  8. 176
      pages/setting/index.vue
  9. 2
      pages/trade/orderList.vue

18
apis/commonApi.js

@ -43,7 +43,23 @@ function syncStore(res) {
supplierId: supplierInfo.supplier.id,
isVip
})
store.commit('setUserInfo', { name: supplierInfo.employeeName, userId: res.userId, mobile: res.mobile, avatar: null })
let userInfo = {
name: supplierInfo.employeeName, // 没有企业就没有name,
userId: res.userId,
mobile: res.mobile,
avatar: null
}
store.commit('setUserInfo', userInfo)
} else {
let userInfo = {
name: '', // 没有企业就没有name,
userId: res.userId,
mobile: res.mobile,
avatar: null
}
store.commit('setUserInfo', userInfo)
// 移除企业信息
store.commit('removeSupplierInfo')
}
}
/**

4
pages/client-detail/base-paper-deals.vue

@ -97,7 +97,9 @@ export default {
},
created() {
this.getOrderVolumeStatistics()
if (this.id) {
this.getOrderVolumeStatistics()
}
},
methods: {
//

12
pages/client-detail/index.vue

@ -44,7 +44,7 @@ import equipmentInformation from './equipment-information.vue'
import basePaperDeals from './base-paper-deals.vue'
import wastePaperTrading from './waste-paper-trading.vue'
import { go2 } from '@/utils/hook.js'
import { getBaseInfo, getVerifyUrl } from '@/apis/commonApi.js'
import { getVerifyUrl } from '@/apis/commonApi.js'
export default {
components: {
qnHeader,
@ -65,10 +65,12 @@ export default {
}
},
onLoad(option) {
this.customerId = option.id || '800890'
this.$nextTick(() => {
this.$refs.basicInformationRef.getBaseInfo()
})
if (option.id) {
this.customerId = option.id
this.$nextTick(() => {
this.$refs.basicInformationRef.getBaseInfo()
})
}
},
// onShow() {
// this.$refs.popup.close()

16
pages/enterprise-info/index.vue

@ -22,7 +22,7 @@
:clear-icon="true"
:localdata="items"
>
<text v-if="form.locStreetName">
<text v-if="form.locDistrictName">
{{ `${form.locProvinceName || ''}/${form.locCityName || ''}/${form.locDistrictName || ''}/${form.locStreetName || ''}` }}
</text>
</qn-data-picker>
@ -103,14 +103,14 @@
placeholder="请输入账户名"
></qn-easyinput>
</qn-form-item>
<qn-form-item label="对公账户" required>
<qn-form-item label="银行卡号" required>
<qn-easyinput
:maxlength="50"
:styles="{ disableColor: '#fff' }"
v-model="form.bankAccount"
:inputBorder="false"
text="right"
placeholder="请输入银行账户"
placeholder="请输入银行卡号"
></qn-easyinput>
</qn-form-item>
<qn-form-item label="开户行" required>
@ -134,14 +134,14 @@
placeholder="请输入账户名"
></qn-easyinput>
</qn-form-item>
<qn-form-item label="对公账户" required>
<qn-form-item label="银行卡号" required>
<qn-easyinput
:maxlength="50"
:styles="{ disableColor: '#fff' }"
v-model="form.bankCardNumber"
:inputBorder="false"
text="right"
placeholder="请输入银行账户"
placeholder="请输入银行卡号"
></qn-easyinput>
</qn-form-item>
<qn-form-item label="开户行" required>
@ -193,7 +193,7 @@ const columns = [
label: '企业简称'
},
{
key: 'locStreetName',
key: 'locDistrictName',
type: 'item',
label: '所在地区',
required: true
@ -260,7 +260,7 @@ const columns = [
{
key: 'bankAccount',
type: 'item',
label: '对公账户',
label: '银行卡号',
required: true
},
{
@ -283,7 +283,7 @@ const columns = [
{
key: 'bankCardNumber',
type: 'item',
label: '对公账户',
label: '银行卡号',
required: true
},
{

146
pages/mall/index.vue

@ -1,63 +1,73 @@
<template>
<view class="wrapper">
<uni-nav-bar :fixed="true" color="#ffffff" background-color="#ffffff" :status-bar="true">
<view slot="left" class="left-title">纸商城</view>
<view slot="right" class="right-title" @tap="shareTap">分享</view>
</uni-nav-bar>
<view class="top-box" :style="backgroundStyle">
<view class=""><image class="image" :src="logo" mode=""></image></view>
<view class="center">
<view class="title">{{ storeInformation.name }}</view>
<view class="desc">全部商品 {{ storeInformation.productNumber }} &nbsp; | &nbsp;上新 {{ storeInformation.currentProductNumber }}</view>
</view>
<view class="right">
<view class="cut" @click="checkMall()">
切换商城
<image class="cut-icon" src="/static/imgs/mall/cut-icon.png" mode=""></image>
<view>
<view v-if="hasCompany" class="wrapper">
<uni-nav-bar :fixed="true" color="#ffffff" background-color="#ffffff" :status-bar="true">
<view slot="left" class="left-title">纸商城</view>
<view slot="right" class="right-title" @tap="shareTap">分享</view>
</uni-nav-bar>
<view class="top-box" :style="backgroundStyle">
<view class=""><image class="image" :src="logo" mode=""></image></view>
<view class="center">
<view class="title">{{ storeInformation.name }}</view>
<view class="desc">全部商品 {{ storeInformation.productNumber }} &nbsp; | &nbsp;上新 {{ storeInformation.currentProductNumber }}</view>
</view>
<view class="right">
<view class="cut" @click="checkMall()">
切换商城
<image class="cut-icon" src="/static/imgs/mall/cut-icon.png" mode=""></image>
</view>
<view class="set" @click="setting">设置</view>
</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">
<view class="content" @click="detailInfo(item)">
<image class="image" :src="item.litPicUrl" mode=""></image>
<view class="" style="width: 100%">
<view class="title">
<view class="">{{ item.brandName }}</view>
<view class="">
<image
class="icon"
:src="item.status === 30111 ? '/static/imgs/mall/grounding-icon.png' : '/static/imgs/mall/sold-out-icon.png'"
mode=""
></image>
<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">
<view class="content" @click="detailInfo(item)">
<image class="image" :src="item.litPicUrl" mode=""></image>
<view class="" style="width: 100%">
<view class="title">
<view class="">{{ item.brandName }}</view>
<view class="">
<image
class="icon"
:src="item.status === 30111 ? '/static/imgs/mall/grounding-icon.png' : '/static/imgs/mall/sold-out-icon.png'"
mode=""
></image>
</view>
</view>
<view class="sub-title">{{ item.categoryName }}/{{ item.name }}/{{ item.manufacturerName }}</view>
<view class="desc">
克重(价格)
<text v-for="(sku, index) in item.skuList" :key="index">{{ sku.weight }}({{ sku.listPrice }})</text>
</view>
</view>
<view class="sub-title">{{ item.categoryName }}/{{ item.name }}/{{ item.manufacturerName }}</view>
<view class="desc">
克重(价格)
<text v-for="(sku, index) in item.skuList" :key="index">{{ sku.weight }}({{ sku.listPrice }})</text>
</view>
</view>
</view>
<view class="other">
<view class="time">{{ item.updateTime | timeFilter }}</view>
<view class="btn">
<view class="" @click="editPaper(item)" v-if="item.status === 30112">编辑</view>
<view class="divide"></view>
<view class="" @click="productStatusChange(item)">{{ item.status === 30111 ? '下架' : '上架' }}</view>
<view class="other">
<view class="time">{{ item.updateTime | timeFilter }}</view>
<view class="btn">
<view class="" @click="editPaper(item)" v-if="item.status === 30112">编辑</view>
<view class="divide"></view>
<view class="" @click="productStatusChange(item)">{{ item.status === 30111 ? '下架' : '上架' }}</view>
</view>
</view>
<uGap></uGap>
</view>
<uGap></uGap>
</view>
</scroll-list>
</scroll-list>
</view>
<view>
<view class="offer-prices" @click="nativeTo()"><image class="my-image" src="../../static/imgs/trade/camera.png" mode=""></image></view>
</view>
<no-data v-if="!pageShow"></no-data>
</view>
<view>
<view class="offer-prices" @click="nativeTo()"><image class="my-image" src="../../static/imgs/trade/camera.png" mode=""></image></view>
<view v-else>
<uni-nav-bar :fixed="true" :status-bar="true">
<view slot="left" style="font-size: 40rpx; color: #000000">纸商城</view>
</uni-nav-bar>
<view class="flex-col-center-center" style="margin-top: 100rpx">
<text style="font-size: 30rpx; text-align: center; font-weight: 600">请先完善企业基本信息</text>
</view>
</view>
<no-data v-if="!pageShow"></no-data>
</view>
</template>
@ -112,28 +122,32 @@ export default {
listData: [],
logo: 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/ztb_pic/testPic.jfif',
backgroundStyle: 'background: url("/static/imgs/mall/zsc-bg-icon.png") no-repeat;',
stoteInfo:''
storeInfo: ''
}
},
onShow() {
this.storeInformation = {
supplierId: this.$store.state.supplierInfo.supplierId,
name: this.$store.state.supplierInfo.name
computed: {
hasCompany() {
return this.$store.state.supplierInfo.id != null
}
this.quertData()
this.getSuliper(this.$store.state.supplierInfo.supplierId)
},
onLoad() {
this.quertData()
onShow() {
if (this.hasCompany) {
this.storeInformation = {
supplierId: this.$store.state.supplierInfo.supplierId,
name: this.$store.state.supplierInfo.name
}
this.queryData()
this.getSupplier(this.$store.state.supplierInfo.supplierId)
}
},
methods: {
back,
//
getSuliper(id) {
getSupplier(id) {
storeDetail(id)
.then((res) => {
if (res) {
this.stoteInfo = res
this.storeInfo = res
this.$set(this.storeInformation, 'productNumber', res.productNumber)
this.$set(this.storeInformation, 'currentProductNumber', res.currentProductNumber)
if (res.logo === '') {
@ -153,7 +167,7 @@ export default {
})
},
// pageShow
quertData() {
queryData() {
return new Promise((resolve, reject) => {
SupplierList({ ...this.orderPagination })
.then((res) => {
@ -177,7 +191,7 @@ export default {
},
downCallback() {
this.orderPagination.pageNum = 1
this.quertData()
this.queryData()
.then(({ list, total }) => {
this.$refs.list.refreshSuccess({ list, total })
})
@ -187,7 +201,7 @@ export default {
},
upCallback() {
this.orderPagination.pageNum++
this.quertData()
this.queryData()
.then(({ list, total }) => {
this.$refs.list.loadSuccess({ list, total })
})
@ -216,7 +230,7 @@ export default {
},
//
setting(item) {
go2('store-settings',this.stoteInfo)
go2('store-settings', this.storeInfo)
},
//
detailInfo(item) {
@ -236,7 +250,7 @@ export default {
})
setTimeout(() => {
this.orderPagination.pageNum = 1
this.quertData()
this.queryData()
}, 500)
}
})

13
pages/mine/index.vue

@ -273,12 +273,13 @@ export default {
},
onLoad() {},
onShow() {
getBaseInfo({}, true).then((res) => {
if (res) {
this.companyNum = res.enterpriseList?.length || 1
}
})
this.getStatistics()
this.hasLogin &&
getBaseInfo({}, true).then((res) => {
if (res) {
this.companyNum = res.enterpriseList?.length || 1
}
})
this.hasLogin && this.getStatistics()
}
}
</script>

5
pages/order-detail/index.vue

@ -281,6 +281,9 @@ export default {
let outboundQuantity = 0
if (list && list.length > 0) {
list.forEach((item) => {
if (item.userName && item.userName.length > 3) {
item.userName = item.userName.substr(0, 2) + '...'
}
if (item.status == '30301') {
step1.push({
title: '分切',
@ -295,7 +298,7 @@ export default {
} else if (item.status == '30303') {
step3.push({
title: '完成',
desc: '已收货'
desc: '已完成'
})
}
})

176
pages/setting/index.vue

@ -1,92 +1,110 @@
<template>
<view class="system-settimg">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="system-settimg-title">系统设置</view>
<view slot="left"></view>
<view slot="right"></view>
</uni-nav-bar>
</view>
<view class="list-main" v-for="(item, index) in name" :key="index">
<view class="list-flex" :class="index + 1 === name.length ? '' : 'list-border'" @click="checkList(index)">
<view class="list-text">
<text>{{ item }}</text>
</view>
<view class="">
<text><uni-icons type="right" color="#000000" size="18"></uni-icons></text>
</view>
</view>
</view>
</view>
<view class="system-settimg">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="system-settimg-title">系统设置</view>
<view slot="left"></view>
<view slot="right"></view>
</uni-nav-bar>
</view>
<view class="list-main" v-for="(item, index) in name" :key="index">
<view class="list-flex" :class="index + 1 === name.length ? '' : 'list-border'" @click="checkList(index)">
<view class="list-text">
<text>{{ item }}</text>
</view>
<view class="">
<text><uni-icons type="right" color="#000000" size="18"></uni-icons></text>
</view>
</view>
</view>
</view>
</template>
<script>
import { back, go2, uploadFile } from '@/utils/hook.js'
export default {
data() {
return {
name: ['用户名', '账号管理', '用户协议', '系统权限', '关于纸掌柜']
}
},
methods: {
back,
checkList(item) {
switch (item) {
case 0:
go2('user-info')
break
case 1:
go2('account-management')
break
case 2:
go2('agreement')
break
case 3:
let main = plus.android.runtimeMainActivity()
let Intent = plus.android.importClass('android.content.Intent')
let mIntent = new Intent('android.settings.WIRELESS_SETTINGS')
main.startActivity(mIntent)
break
case 4:
go2('about')
break
default:
break
}
}
}
data() {
return {
name: ['用户名', '账号管理', '用户协议', '系统权限', '关于纸掌柜']
}
},
methods: {
back,
//
checkCompany(msg = '请完善企业信息') {
let company = this.$store.state.supplierInfo
if (!company || !company.id) {
uni.showToast({
title: msg,
icon: 'none'
})
return false
}
return true
},
checkList(item) {
switch (item) {
case 0:
if (!this.checkCompany()) {
return
}
go2('user-info')
break
case 1:
if (!this.checkCompany()) {
return
}
go2('account-management')
break
case 2:
go2('agreement')
break
case 3:
let main = plus.android.runtimeMainActivity()
let Intent = plus.android.importClass('android.content.Intent')
let mIntent = new Intent('android.settings.WIRELESS_SETTINGS')
main.startActivity(mIntent)
break
case 4:
go2('about')
break
default:
break
}
}
}
}
</script>
<style lang="scss">
.system-settimg {
.system-settimg-title {
width: 100%;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.list-main {
background-color: #ffffff;
}
.list-border {
border-bottom: 2rpx solid #d8d8d8;
}
.list-flex {
display: flex;
justify-content: space-between;
.system-settimg-title {
width: 100%;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.list-main {
background-color: #ffffff;
}
.list-border {
border-bottom: 2rpx solid #d8d8d8;
}
.list-flex {
display: flex;
justify-content: space-between;
margin: 0rpx 32rpx;
height: 100rpx;
align-items: center;
}
.list-text {
font-size: 28rpx;
color: #000000;
letter-spacing: 0;
font-weight: 400;
}
margin: 0rpx 32rpx;
height: 100rpx;
align-items: center;
}
.list-text {
font-size: 28rpx;
color: #000000;
letter-spacing: 0;
font-weight: 400;
}
}
</style>
</style>

2
pages/trade/orderList.vue

@ -164,7 +164,7 @@ export default {
default:
break
}
this.getList()
this.orderDown()
}
}
}

Loading…
Cancel
Save