Browse Source

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

devlop
buffeyu 4 years ago
parent
commit
95314a9809
23 changed files with 1625 additions and 1430 deletions
  1. 9
      apis/commonApi.js
  2. 2
      components/qn-form-item/qn-form-item.vue
  3. 2
      components/qn-header/qn-header.vue
  4. 149
      components/qn-input-number/qn-input-number.vue
  5. 62
      components/scroll-list/scroll-list.vue
  6. 4
      pages.json
  7. 499
      pages/add-account/index.vue
  8. 499
      pages/add-address-manage/index.vue
  9. 481
      pages/address-manage/index.vue
  10. 1090
      pages/cart/index.vue
  11. 8
      pages/enquiry-list/index.vue
  12. 6
      pages/enterprise-info/index.vue
  13. 10
      pages/for-comparison/index.vue
  14. 9
      pages/mine/index.vue
  15. 2
      pages/notification-page/index.vue
  16. 2
      pages/order-detail/index.vue
  17. 2
      pages/order-list/index.vue
  18. 11
      pages/order-make/index.vue
  19. 105
      pages/paper-details/index.vue
  20. 62
      pages/store/index.vue
  21. 2
      utils/hook.js
  22. 2
      utils/http/index.js
  23. 37
      utils/index.js

9
apis/commonApi.js

@ -37,6 +37,15 @@ function syncStore(res) {
mobile: res.mobile,
avatar: null
})
} else {
if (res) {
store.commit('setUserInfo', {
name: '',
userId: res.userId,
mobile: res.mobile,
avatar: null
})
}
}
}

2
components/qn-form-item/qn-form-item.vue

@ -54,7 +54,7 @@ export default {
flex-direction: row;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #d8d8d8;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
min-height: 80rpx;
.label {
flex-grow: 0;

2
components/qn-header/qn-header.vue

@ -38,6 +38,6 @@ export default {
display: flex;
flex-direction: row;
align-items: center;
border-bottom: 2rpx solid #d8d8d8;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
}
</style>

149
components/qn-input-number/qn-input-number.vue

@ -1,79 +1,92 @@
<template>
<view class="warpper">
<view class="minus-box" @tap="minusTap">
<uni-icons size="16" custom-prefix="iconfont" type="icon-Less" color="#007AFF"></uni-icons>
<!-- <uni-icons size="16" type="minus" color="#007AFF"></uni-icons> -->
</view>
<view class="" style="padding: 0rpx 4rpx;">
<uni-easyinput :inputBorder="false" class="quantity-input" type="number" :value="value" placeholder="请输入" @blur="blur" @confirm="confirm"></uni-easyinput>
</view>
<view class="minus-box" @tap="addTap"><uni-icons size="16" type="plusempty" color="#007AFF"></uni-icons></view>
</view>
<view class="warpper">
<view class="minus-box" @tap="minusTap">
<uni-icons size="16" custom-prefix="iconfont" type="icon-Less" color="#007AFF"></uni-icons>
<!-- <uni-icons size="16" type="minus" color="#007AFF"></uni-icons> -->
</view>
<view class="" style="padding: 0rpx 4rpx">
<qn-easyinput
:inputBorder="false"
class="quantity-input"
style="height: 64rpx"
:clearable="false"
type="number"
:value="value"
placeholder="请输入"
@blur="blur"
@confirm="confirm"
></qn-easyinput>
</view>
<view class="minus-box" @tap="addTap"><uni-icons size="16" type="plusempty" color="#007AFF"></uni-icons></view>
</view>
</template>
<script>
export default {
props: {
quantity: {
type: [Number, String],
default: 0
}
},
data() {
return {
value: 0
}
},
watch: {
quantity: {
handler(nv, ov) {
this.value = nv
},
immediate: true,
}
},
methods: {
blur(e) {
this.$emit('change', e.detail.value)
},
confirm(value) {
if (value.trim()) {
this.$emit('change', value)
}
},
minusTap() {
if (this.value == 0) {
return
}
this.value--
this.$emit('change', this.value)
},
addTap() {
this.value++
this.$emit('change', this.value)
}
}
props: {
quantity: {
type: [Number, String],
default: 0
}
},
data() {
return {
value: 0
}
},
watch: {
quantity: {
handler(nv, ov) {
this.value = nv
},
immediate: true
}
},
methods: {
blur(e) {
this.$emit('change', e.detail.value)
},
confirm(value) {
if (value.trim()) {
this.$emit('change', value)
}
},
minusTap() {
if (this.value == 0) {
return
}
this.value--
this.$emit('change', this.value)
},
addTap() {
this.value++
this.$emit('change', this.value)
}
}
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.warpper {
display: flex;
flex-direction: row;
align-items: center;
.minus-box {
width: 64rpx;
height: 64rpx;
line-height: 64rpx;
text-align: center;
background: #f2f3f5;
border-radius: 8rpx;
color: #007aff;
}
.quantity-input {
width: 120rpx;
height: 64rpx;
background: #f2f3f5;
}
display: flex;
flex-direction: row;
align-items: center;
.minus-box {
width: 64rpx;
height: 64rpx;
line-height: 64rpx;
text-align: center;
background: #f2f3f5;
border-radius: 8rpx;
color: #007aff;
}
.quantity-input {
width: 120rpx;
height: 64rpx;
background: #f2f3f5;
/deep/ .uni-easyinput__content {
min-height: 64rpx;
}
}
}
</style>

62
components/scroll-list/scroll-list.vue

@ -24,11 +24,12 @@
</view>
</view>
<view class="empty-wrap" v-if="showEmpty">
<slot name="empty" v-if="$slots.empty"></slot>
<view class="empty-view" v-else>
<image class="empty-image" :src="defaultOption.emptyImage || images.empty" mode="aspectFit"></image>
<text class="empty-text" :style="[emptyTextStyle]">{{ emptyText }}</text>
</view>
<slot name="empty">
<view class="empty-view flex-col-center-center">
<image class="empty-image" :src="defaultOption.emptyImage || images.empty" mode="aspectFit"></image>
<text class="empty-text" :style="[emptyTextStyle]">{{ emptyText }}</text>
</view>
</slot>
</view>
<view class="list-content"><slot></slot></view>
<view class="pull-up-wrap" v-if="showPullUp">
@ -614,31 +615,7 @@ export default {
}
}
}
.empty-wrap {
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
position: absolute;
align-items: center;
flex-direction: column;
.empty-view {
margin: auto;
display: flex;
align-items: center;
margin-bottom: 400rpx;
flex-direction: column;
.empty-image {
width: 600rpx;
height: 600rpx;
}
.empty-text {
color: #606266;
margin-top: 20rpx;
}
}
}
.list-content {
}
.pull-up-wrap {
@ -666,4 +643,29 @@ export default {
}
}
}
.empty-wrap {
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
position: absolute;
align-items: center;
flex-direction: column;
.empty-view {
margin: auto;
display: flex;
align-items: center;
margin-bottom: 400rpx;
flex-direction: column;
.empty-image {
width: 600rpx;
height: 600rpx;
}
.empty-text {
color: #606266;
margin-top: 20rpx;
}
}
}
</style>

4
pages.json

@ -5,7 +5,8 @@
"style": {
"navigationBarTitleText": "店铺首页",
"navigationStyle": "custom"
}
},
"h5": { "titleNView": false }
},
{
"path": "pages/cart/index",
@ -111,6 +112,7 @@
"path": "pages/paper-details/index",
"style": {
"navigationBarTitleText": "纸品详情",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},

499
pages/add-account/index.vue

@ -1,69 +1,76 @@
<template>
<view class="add-account">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="add-account-title">新增企业账号</view>
<view slot="left"></view>
<view slot="right"></view>
</uni-nav-bar>
</view>
<view class="">
<view class="add-paper-list">
<view>
<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 class="add-paper-input">
<qn-easyinput
type="number"
:maxlength="11"
:styles="{ disableColor: '#fff' }"
v-model="form.mobile"
:inputBorder="false"
text="right"
placeholder="请输入手机号"
></qn-easyinput>
</view>
</view>
<view class="add-paper-border"></view>
<view class="add-paper-list">
<view>
<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 class="add-paper-input">
<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>
<view class="add-paper-list" @click="paperpopupShow()">
<view>
<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>
<!-- categoryId -->
<view class="">
<text v-if="form.title === ''" class="add-paph-text">点击选择职务</text>
<text v-else>{{ form.title }}</text>
<text><uni-icons type="right" color="#000000" size="18"></uni-icons></text>
</view>
</view>
</view>
<view class="uploud-btn">
<view class=""><button type="primary" class="btn-class" plain="true" @click="cencelList()">取消</button></view>
<view class=""><button type="primary" class="btn-class-upload" @click="uploadData()">确认</button></view>
</view>
<uni-popup ref="paperpopup" type="bottom">
<view class="popup_modal">
<!-- <slot name="title"><view class="popup_modal-title">选择纸种</view></slot> -->
<scroll-view scroll-y="true" class="popup_modal-scroll">
<view @click="paperSelectChange(item)" class="popup_modal-scroll-item" v-for="item in paperList" :key="item.id">{{ item.name }}</view>
<uGap></uGap>
<view class="cencel-btn" @click="cencelbtn">取消</view>
</scroll-view>
</view>
</uni-popup>
</view>
<view class="add-account">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="add-account-title">新增企业账号</view>
<view slot="left"></view>
<view slot="right"></view>
</uni-nav-bar>
</view>
<view class="">
<view class="add-paper-list">
<view>
<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 class="add-paper-input">
<qn-easyinput
type="number"
:maxlength="11"
:styles="{ disableColor: '#fff' }"
v-model="form.mobile"
:inputBorder="false"
text="right"
placeholder="请输入手机号"
></qn-easyinput>
</view>
</view>
<view class="add-paper-border"></view>
<view class="add-paper-list">
<view>
<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 class="add-paper-input">
<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>
<view class="add-paper-list" @click="paperpopupShow()">
<view>
<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>
<!-- categoryId -->
<view class="">
<text v-if="form.title === ''" class="add-paph-text">点击选择职务</text>
<text v-else>{{ form.title }}</text>
<text><uni-icons type="right" color="#000000" size="18"></uni-icons></text>
</view>
</view>
</view>
<view class="uploud-btn">
<view class=""><button type="primary" class="btn-class" plain="true" @click="cencelList()">取消</button></view>
<view class=""><button type="primary" class="btn-class-upload" @click="uploadData()">确认</button></view>
</view>
<uni-popup ref="paperpopup" type="bottom">
<view class="popup_modal">
<!-- <slot name="title"><view class="popup_modal-title">选择纸种</view></slot> -->
<scroll-view scroll-y="true" class="popup_modal-scroll">
<view @click="paperSelectChange(item)" class="popup_modal-scroll-item" v-for="item in paperList" :key="item.id">{{ item.name }}</view>
<uGap></uGap>
<view class="cencel-btn" @click="cencelbtn">取消</view>
</scroll-view>
</view>
</uni-popup>
</view>
</template>
<script>
@ -72,191 +79,191 @@ import uGap from '@/components/u-gap/u-gap.vue'
import { addEmployee } from '@/apis/setting.js'
const validateFields = ['mobile', 'name', 'title']
export default {
data() {
return {
form: {
title: ''
},
paperList: [
{
name: '管理员',
id: '1'
},
{
name: '业务员',
id: '2'
},
{
name: '司机',
id: '3'
},
{
name: '分切',
id: '4'
},
{
name: '库管',
id: '5'
}
]
}
},
components: { uGap },
methods: {
back,
paperpopupShow() {
this.$refs.paperpopup.open('bottom')
},
paperSelectChange(item) {
this.$set(this.form, 'title', item.name)
this.$refs.paperpopup.close()
},
cencelbtn() {
this.$refs.paperpopup.close()
},
cencelList(){
back()
},
uploadData() {
for (let i = 0; i < validateFields.length; i++) {
if (this.form[validateFields[i]] === null || this.form[validateFields[i]] === '') {
uni.showToast({
title: '请完善信息',
icon: 'none'
})
return
}
}
var params = {
...this.form,
enterpriseId: this.$store.state.companyInfo.id,
// userId:this.$store.state.userInfo.userId,
}
addEmployee(params).then(res => {
if (res) {
uni.showToast({
title: '添加成功',
icon: 'success'
})
setTimeout(() => {
back()
}, 1000)
}
})
}
}
data() {
return {
form: {
title: ''
},
paperList: [
{
name: '管理员',
id: '1'
},
{
name: '业务员',
id: '2'
},
{
name: '司机',
id: '3'
},
{
name: '分切',
id: '4'
},
{
name: '库管',
id: '5'
}
]
}
},
components: { uGap },
methods: {
back,
paperpopupShow() {
this.$refs.paperpopup.open('bottom')
},
paperSelectChange(item) {
this.$set(this.form, 'title', item.name)
this.$refs.paperpopup.close()
},
cencelbtn() {
this.$refs.paperpopup.close()
},
cencelList() {
back()
},
uploadData() {
for (let i = 0; i < validateFields.length; i++) {
if (this.form[validateFields[i]] === null || this.form[validateFields[i]] === '') {
uni.showToast({
title: '请完善信息',
icon: 'none'
})
return
}
}
var params = {
...this.form,
enterpriseId: this.$store.state.companyInfo.id
// userId:this.$store.state.userInfo.userId,
}
addEmployee(params).then((res) => {
if (res) {
uni.showToast({
title: '添加成功',
icon: 'success'
})
setTimeout(() => {
back()
}, 1000)
}
})
}
}
}
</script>
<style lang="scss">
.add-account {
.add-account-title {
width: 100%;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.add-account {
font-size: 28rpx;
color: #007aff;
text-align: right;
line-height: 40rpx;
font-weight: 500;
}
.add-paper-border {
border-bottom: 2rpx solid #d8d8d8;
margin-left: 32rpx;
}
.add-paper-list {
height: 88rpx;
background: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 32rpx;
padding-right: 32rpx;
}
.add-paper-text {
font-size: 28rpx;
color: #000000;
letter-spacing: 0;
font-weight: 400;
}
.add-paper-start {
font-size: 28rpx;
color: #f5222d;
letter-spacing: 0;
font-weight: 400;
}
.add-paper-input {
width: 40%;
}
.popup_modal {
width: 750rpx;
height: 600rpx;
background-color: #fff;
border-radius: 10rpx 10rpx 0 0;
.popup_modal-title {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: 750rpx;
height: 88rpx;
font-weight: 600;
border-bottom: 2rpx solid #d8d8d8;
}
.popup_modal-scroll {
width: 750rpx;
height: 600rpx;
.popup_modal-scroll-item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: 750rpx;
height: 88rpx;
padding: 0rpx 32rpx;
border-bottom: 2rpx solid #d8d8d8;
}
}
}
.cencel-btn {
font-size: 32rpx;
color: #646566;
text-align: center;
line-height: 44rpx;
font-weight: 400;
margin-top: 40rpx;
}
.add-paph-text {
font-size: 28rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
}
.btn-class {
height: 88rpx;
border-radius: 10rpx;
line-height: 80rpx;
width: 150px;
}
.btn-class-upload {
height: 88rpx;
border-radius: 10rpx;
line-height: 80rpx;
width: 200px;
}
.uploud-btn {
display: flex;
justify-content: space-between;
padding: 20rpx 32rpx;
background-color: #ffffff;
position: absolute;
bottom: 0rpx;
width: 100%;
}
.add-account-title {
width: 100%;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.add-account {
font-size: 28rpx;
color: #007aff;
text-align: right;
line-height: 40rpx;
font-weight: 500;
}
.add-paper-border {
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
margin-left: 32rpx;
}
.add-paper-list {
height: 88rpx;
background: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 32rpx;
padding-right: 32rpx;
}
.add-paper-text {
font-size: 28rpx;
color: #000000;
letter-spacing: 0;
font-weight: 400;
}
.add-paper-start {
font-size: 28rpx;
color: #f5222d;
letter-spacing: 0;
font-weight: 400;
}
.add-paper-input {
width: 40%;
}
.popup_modal {
width: 750rpx;
height: 600rpx;
background-color: #fff;
border-radius: 10rpx 10rpx 0 0;
.popup_modal-title {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: 750rpx;
height: 88rpx;
font-weight: 600;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
}
.popup_modal-scroll {
width: 750rpx;
height: 600rpx;
.popup_modal-scroll-item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: 750rpx;
height: 88rpx;
padding: 0rpx 32rpx;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
}
}
}
.cencel-btn {
font-size: 32rpx;
color: #646566;
text-align: center;
line-height: 44rpx;
font-weight: 400;
margin-top: 40rpx;
}
.add-paph-text {
font-size: 28rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
}
.btn-class {
height: 88rpx;
border-radius: 10rpx;
line-height: 80rpx;
width: 150px;
}
.btn-class-upload {
height: 88rpx;
border-radius: 10rpx;
line-height: 80rpx;
width: 200px;
}
.uploud-btn {
display: flex;
justify-content: space-between;
padding: 20rpx 32rpx;
background-color: #ffffff;
position: absolute;
bottom: 0rpx;
width: 100%;
}
}
</style>

499
pages/add-address-manage/index.vue

@ -1,63 +1,84 @@
<template>
<view class="warpper">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed :title="titleText"></uni-nav-bar>
</view>
<view class="qn-form-item">
<view class="label"><text class="label__text">收货人</text></view>
<view class="value">
<qn-easyinput :maxlength="20" @blur="showCompany" v-model="form.receiver" :inputBorder="false" text="left" placeholder="请填写收货人姓名"></qn-easyinput>
</view>
</view>
<view class="qn-form-item">
<view class="label"><text class="label__text">手机号</text></view>
<view class="value">
<qn-easyinput :maxlength="11" type="number" v-model="form.receiverMobile" :inputBorder="false" text="left" placeholder="请填写收货人手机号"></qn-easyinput>
</view>
</view>
<view class="qn-form-item">
<view class="label"><text class="label__text">所在地区</text></view>
<view class="value">
<!-- <qn-easyinput v-model="form.shortName" :inputBorder="false" text="right" placeholder="选择所在区域"></qn-easyinput> -->
<qn-data-picker
:readonly="hasSelected"
text="left"
:border="false"
class="qn-picker"
placeholder="点击选择"
popup-title="请选择城市"
:map="{ text: 'name', value: 'id' }"
@change="onAreaChange"
:clear-icon="true"
:localdata="items"
>
<text v-if="form.districtId">{{ `${form.provinceName || ''}/${form.cityName || ''}/${form.districtName || ''}/${form.streetName || ''}` }}</text>
</qn-data-picker>
</view>
</view>
<view class="qn-form-item">
<view class="label"><text class="label__text">详细地址</text></view>
<view class="value">
<qn-easyinput :maxlength="120" @blur="showCompany" v-model="form.detail" :inputBorder="false" text="left" placeholder="街道/门牌号/小区/乡镇/村等"></qn-easyinput>
</view>
</view>
<uGap></uGap>
<view class="default-address">
<view class="">
<view class="title">设置为默认地址</view>
<view class="tip">提醒每次下单会默认使用该地址</view>
</view>
<view class=""><switch :checked="form.isDefault == 1" @change="switchChange" style="transform:scale(0.8)" /></view>
</view>
<qn-footer fixed height="120rpx">
<view class="button-area">
<!-- <view class="button button__cancel" @click="back">
<view class="warpper">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed :title="titleText"></uni-nav-bar>
</view>
<view class="qn-form-item">
<view class="label"><text class="label__text">收货人</text></view>
<view class="value">
<qn-easyinput
:maxlength="20"
@blur="showCompany"
v-model="form.receiver"
:inputBorder="false"
text="left"
placeholder="请填写收货人姓名"
></qn-easyinput>
</view>
</view>
<view class="qn-form-item">
<view class="label"><text class="label__text">手机号</text></view>
<view class="value">
<qn-easyinput
:maxlength="11"
type="number"
v-model="form.receiverMobile"
:inputBorder="false"
text="left"
placeholder="请填写收货人手机号"
></qn-easyinput>
</view>
</view>
<view class="qn-form-item">
<view class="label"><text class="label__text">所在地区</text></view>
<view class="value">
<!-- <qn-easyinput v-model="form.shortName" :inputBorder="false" text="right" placeholder="选择所在区域"></qn-easyinput> -->
<qn-data-picker
:readonly="hasSelected"
text="left"
:border="false"
class="qn-picker"
placeholder="点击选择"
popup-title="请选择城市"
:map="{ text: 'name', value: 'id' }"
@change="onAreaChange"
:clear-icon="true"
:localdata="items"
>
<text v-if="form.districtId">{{ `${form.provinceName || ''}/${form.cityName || ''}/${form.districtName || ''}/${form.streetName || ''}` }}</text>
</qn-data-picker>
</view>
</view>
<view class="qn-form-item">
<view class="label"><text class="label__text">详细地址</text></view>
<view class="value">
<qn-easyinput
:maxlength="120"
@blur="showCompany"
v-model="form.detail"
:inputBorder="false"
text="left"
placeholder="街道/门牌号/小区/乡镇/村等"
></qn-easyinput>
</view>
</view>
<uGap></uGap>
<view class="default-address">
<view class="">
<view class="title">设置为默认地址</view>
<view class="tip">提醒每次下单会默认使用该地址</view>
</view>
<view class=""><switch :checked="form.isDefault == 1" @change="switchChange" style="transform: scale(0.8)" /></view>
</view>
<qn-footer fixed height="120rpx">
<view class="button-area">
<!-- <view class="button button__cancel" @click="back">
<text class="text">取消</text>
</view> -->
<view class="button button__submit" @click="addTap"><text class="text" style="color: white">保存</text></view>
</view>
</qn-footer>
</view>
<view class="button button__submit" @click="addTap"><text class="text" style="color: white">保存</text></view>
</view>
</qn-footer>
</view>
</template>
<script>
@ -68,191 +89,191 @@ import qnFooter from '@/components/qn-footer/qn-footer.vue'
import qnDataPicker from '@/components/qn-data-picker/qn-data-picker.vue'
import { createAddress, getAddressDetail } from '@/apis/addressManageApi.js'
export default {
components: { uGap, qnFooter, qnDataPicker },
data() {
return {
form: {
cityId: '',
cityName: '',
detail: '',
districtId:'',
districtName: '',
enterpriseId: this.$store.state.companyInfo.id,
id: '',
isDefault: '0',
provinceId: '',
provinceName: '',
receiver: '',
receiverMobile: '',
streetId: '',
streetName: '',
},
hasSelected: false,
items: [],
id: null,
}
},
mounted() {
getArea().then(res => {
if (res) {
this.items = res
}
})
},
onLoad(option) {
this.titleText = option.type
if(option.id) {
this.id = option.id
this.getAddressDetail()
}
},
methods: {
back,
// id
getAddressDetail() {
getAddressDetail({id: this.id}).then(res => {
// console.log('', res)
if(res) {
this.form = Object.assign({}, res)
}
})
},
onAreaChange(e) {
if (e.detail.value && e.detail.value.length > 0) {
const [province, city, district, street] = e.detail.value
this.form.provinceId = province.value
this.form.provinceName = province.text
this.form.cityId = city.value
this.form.cityName = city.text
this.form.districtId = district.value
this.form.districtName = district.text
this.form.streetId = street.value
this.form.streetName = street.text
} else {
this.form.provinceId = null
this.form.provinceName = null
this.form.cityId = null
this.form.cityName = null
this.form.districtId = null
this.form.districtName = null
this.form.streetId = null
this.form.streetName = null
}
},
//
switchChange(e) {
this.form.isDefault = e.target.value ? '1' : '0'
},
showCompany() {},
//
addTap() {
createAddress(this.form).then(res => {
if (res) {
uni.showToast({
title: '保存成功',
icon: 'success'
})
setTimeout(() => {
back()
}, 1000)
}
})
}
}
components: { uGap, qnFooter, qnDataPicker },
data() {
return {
form: {
cityId: '',
cityName: '',
detail: '',
districtId: '',
districtName: '',
enterpriseId: this.$store.state.companyInfo.id,
id: '',
isDefault: '0',
provinceId: '',
provinceName: '',
receiver: '',
receiverMobile: '',
streetId: '',
streetName: ''
},
hasSelected: false,
items: [],
id: null
}
},
mounted() {
getArea().then((res) => {
if (res) {
this.items = res
}
})
},
onLoad(option) {
this.titleText = option.type
if (option.id) {
this.id = option.id
this.getAddressDetail()
}
},
methods: {
back,
// id
getAddressDetail() {
getAddressDetail({ id: this.id }).then((res) => {
// console.log('', res)
if (res) {
this.form = Object.assign({}, res)
}
})
},
onAreaChange(e) {
if (e.detail.value && e.detail.value.length > 0) {
const [province, city, district, street] = e.detail.value
this.form.provinceId = province.value
this.form.provinceName = province.text
this.form.cityId = city.value
this.form.cityName = city.text
this.form.districtId = district.value
this.form.districtName = district.text
this.form.streetId = street.value
this.form.streetName = street.text
} else {
this.form.provinceId = null
this.form.provinceName = null
this.form.cityId = null
this.form.cityName = null
this.form.districtId = null
this.form.districtName = null
this.form.streetId = null
this.form.streetName = null
}
},
//
switchChange(e) {
this.form.isDefault = e.target.value ? '1' : '0'
},
showCompany() {},
//
addTap() {
createAddress(this.form).then((res) => {
if (res) {
uni.showToast({
title: '保存成功',
icon: 'success'
})
setTimeout(() => {
back()
}, 1000)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.warpper {
.warpper-title {
width: 100%;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.qn-form-item {
width: 750rpx;
padding: 0rpx 32rpx;
background-color: #fff;
display: flex;
flex-direction: row;
align-items: center;
// justify-content: space-between;
border-bottom: 2rpx solid #d8d8d8;
min-height: 88rpx;
.label {
flex-grow: 0;
flex-shrink: 0;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
margin-right: 20rpx;
.label__text {
font-size: 28rpx;
color: #000000;
}
}
.value {
flex-grow: 1;
flex-shrink: 1;
text-align: right;
}
}
.default-address {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 0rpx 32rpx;
height: 133rpx;
background: #ffffff;
.title {
font-size: 30rpx;
color: #333333;
letter-spacing: 0;
font-weight: 400;
}
.tip {
padding-top: 10rpx;
font-size: 24rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
}
}
.button-area {
width: 750rpx;
padding: 0 32rpx;
display: flex;
flex-direction: row;
align-items: center;
// justify-content: space-between;
.button {
flex-grow: 0;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10rpx;
.text {
font-size: 30rpx;
font-weight: 500;
text-align: center;
}
}
.button__cancel {
width: 270rpx;
height: 88rpx;
border: 2rpx solid #979797;
}
.button__submit {
width: 100%;
height: 88rpx;
background: #007aff;
}
}
.warpper {
.warpper-title {
width: 100%;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.qn-form-item {
width: 750rpx;
padding: 0rpx 32rpx;
background-color: #fff;
display: flex;
flex-direction: row;
align-items: center;
// justify-content: space-between;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
min-height: 88rpx;
.label {
flex-grow: 0;
flex-shrink: 0;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
margin-right: 20rpx;
.label__text {
font-size: 28rpx;
color: #000000;
}
}
.value {
flex-grow: 1;
flex-shrink: 1;
text-align: right;
}
}
.default-address {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 0rpx 32rpx;
height: 133rpx;
background: #ffffff;
.title {
font-size: 30rpx;
color: #333333;
letter-spacing: 0;
font-weight: 400;
}
.tip {
padding-top: 10rpx;
font-size: 24rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
}
}
.button-area {
width: 750rpx;
padding: 0 32rpx;
display: flex;
flex-direction: row;
align-items: center;
// justify-content: space-between;
.button {
flex-grow: 0;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10rpx;
.text {
font-size: 30rpx;
font-weight: 500;
text-align: center;
}
}
.button__cancel {
width: 270rpx;
height: 88rpx;
border: 2rpx solid #979797;
}
.button__submit {
width: 100%;
height: 88rpx;
background: #007aff;
}
}
}
</style>

481
pages/address-manage/index.vue

@ -1,51 +1,43 @@
<template>
<view class="warpper">
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="收货地址"></uni-nav-bar>
<view class="content" v-for="(item, index) in list" :key="index">
<view class="info-box" @tap="selectAddress(item)">
<view class="name">{{item.receiver}} {{item.receiverMobile}}</view>
<view class="address">{{item.provinceName}}{{item.cityName}}{{item.districtName}}{{item.streetName}}{{item.detail}}</view>
</view>
<view class="other">
<view class="left">
<label @tap="radioTap(item)">
<radio :checked="item.isDefault == 1" style="transform:scale(0.8)" />
<text :class="item.isDefault == 1 ? 'radioText' : 'not-radioText'">{{item.isDefault == 1 ? '已设为默认' : '设为默认'}}</text>
</label>
</view>
<view class="right">
<view class="" @tap="delTap(item, index)">删除</view>
<view class="edit" @tap="editTap(item, index)">编辑</view>
</view>
</view>
</view>
<qn-footer fixed height="120rpx">
<view class="button-area">
<!-- <view class="button button__cancel" @click="back">
<view class="warpper">
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="收货地址"></uni-nav-bar>
<view class="content" v-for="(item, index) in list" :key="index">
<view class="info-box" @tap="selectAddress(item)">
<view class="name">{{ item.receiver }} {{ item.receiverMobile }}</view>
<view class="address">{{ item.provinceName }}{{ item.cityName }}{{ item.districtName }}{{ item.streetName }}{{ item.detail }}</view>
</view>
<view class="other">
<view class="left">
<label @tap="radioTap(item)">
<radio :checked="item.isDefault == 1" style="transform: scale(0.8)" />
<text :class="item.isDefault == 1 ? 'radioText' : 'not-radioText'">{{ item.isDefault == 1 ? '已设为默认' : '设为默认' }}</text>
</label>
</view>
<view class="right">
<view class="" @tap="delTap(item, index)">删除</view>
<view class="edit" @tap="editTap(item, index)">编辑</view>
</view>
</view>
</view>
<qn-footer fixed height="120rpx">
<view class="button-area">
<!-- <view class="button button__cancel" @click="back">
<text class="text">取消</text>
</view> -->
<view class="button button__submit" @click="addTap"><text class="text" style="color: white">添加地址</text></view>
</view>
</qn-footer>
<uni-popup ref="popup" type="center" :mask-click="false">
<view class="popup-box">
<view class="tip-title">
确定要删除改地址吗
</view>
<view class="operation-row">
<view class="cancel-text" @tap="cancelTap">
取消
</view>
<view class="line">
</view>
<view class="confirm-text" @tap="confirmTap">
确定
</view>
</view>
</view>
</uni-popup>
</view>
<view class="button button__submit" @click="addTap"><text class="text" style="color: white">添加地址</text></view>
</view>
</qn-footer>
<uni-popup ref="popup" type="center" :mask-click="false">
<view class="popup-box">
<view class="tip-title">确定要删除改地址吗</view>
<view class="operation-row">
<view class="cancel-text" @tap="cancelTap">取消</view>
<view class="line"></view>
<view class="confirm-text" @tap="confirmTap">确定</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
@ -53,84 +45,83 @@ import { go2, back, setCache } from '@/utils/hook.js'
import qnFooter from '@/components/qn-footer/qn-footer.vue'
import { getAddress, delAddress, setDefaultAddress } from '@/apis/addressManageApi.js'
export default {
components:{ qnFooter },
components: { qnFooter },
data() {
return {
/**
* 页面操作类型 none: 无操作, select: 选择
*/
operation: 'none',
list: [],
id: null
list: [],
id: null
}
},
onShow() {
this.queryData()
this.queryData()
},
methods: {
go2,
back,
//
queryData() {
const params = {
enterpriseId: this.$store.state.companyInfo.id
}
getAddress(params).then(res => {
if(res) {
this.list = res
}
})
},
//
radioTap(item) {
setDefaultAddress({id: item.id}).then(res =>{
if(res) {
this.queryData()
}
})
},
//
queryData() {
const params = {
enterpriseId: this.$store.state.companyInfo.id
}
getAddress(params).then((res) => {
if (res) {
this.list = res
}
})
},
//
radioTap(item) {
setDefaultAddress({ id: item.id }).then((res) => {
if (res) {
this.queryData()
}
})
},
//
selectAddress(item) {
if (this.operation === 'select') {
setCache('address', item)
back()
}
},
},
//
addTap() {
go2('add-address-manage',{type:'新增地址'})
},
//
delTap(item, index) {
this.id = item.id
this.$refs.popup.open('center')
// this.$refs.popup.close()
},
//
editTap(item, index) {
go2('add-address-manage', {id: item.id,type:'编辑地址'})
},
confirmTap() {
delAddress({id: this.id}).then(res => {
this.$refs.popup.close()
if(res) {
uni.showToast({
title: '删除成功',
icon: 'success'
})
this.queryData()
}
})
},
cancelTap() {
this.$refs.popup.close()
}
//
addTap() {
go2('add-address-manage', { type: '新增地址' })
},
//
delTap(item, index) {
this.id = item.id
this.$refs.popup.open('center')
// this.$refs.popup.close()
},
//
editTap(item, index) {
go2('add-address-manage', { id: item.id, type: '编辑地址' })
},
confirmTap() {
delAddress({ id: this.id }).then((res) => {
this.$refs.popup.close()
if (res) {
uni.showToast({
title: '删除成功',
icon: 'success'
})
this.queryData()
}
})
},
cancelTap() {
this.$refs.popup.close()
}
},
onLoad(option) {
if (option) {
if (option) {
this.operation = option.operation
}
}
@ -139,149 +130,149 @@ export default {
<style lang="scss" scoped>
.warpper {
.content {
padding-bottom: 16rpx;
.info-box {
max-height: 197rpx;
background: #ffffff;
padding: 27rpx 32rpx;
border-bottom: 2rpx solid #d8d8d8;
.name {
ont-size: 30rpx;
color: #333333;
letter-spacing: 0;
font-weight: 400;
}
.address {
padding-top: 16rpx;
font-size: 28rpx;
color: #333333;
letter-spacing: 0;
font-weight: 400;
}
}
.other {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 0rpx 32rpx;
height: 80rpx;
background: #ffffff;
.radioText {
font-size: 28rpx;
color: #007AFF;
letter-spacing: 0;
font-weight: 400;
}
.not-radioText {
font-size: 28rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
}
.left {
font-size: 28rpx;
color: #007aff;
letter-spacing: 0;
font-weight: 400;
}
.right {
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: 28rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
.edit {
padding-left: 32rpx;
}
}
}
}
.button-area {
width: 750rpx;
padding: 0 32rpx;
display: flex;
flex-direction: row;
align-items: center;
// justify-content: space-between;
.button {
flex-grow: 0;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10rpx;
.text {
font-size: 30rpx;
font-weight: 500;
text-align: center;
}
}
.button__cancel {
width: 270rpx;
height: 88rpx;
border: 2rpx solid #979797;
}
.button__submit {
width: 100%;
height: 88rpx;
background: #007aff;
}
}
.popup-box {
width: 540rpx;
height: 226rpx;
background: #FFFFFF;
border-radius: 14rpx;
.tip-title {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
height: 126rpx;
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
text-align: center;
font-weight: 400;
}
.operation-row {
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
height: 100rpx;
background: #FFFFFF;
border-top: 2rpx solid #DDDDDD;
.cancel-text {
flex-grow: 1;
flex-shrink: 1;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 400;
}
.line {
flex-grow: 0;
flex-shrink: 0;
width: 2rpx;
height: 100rpx;
border-left: 2rpx solid #DCDEE3;
}
.confirm-text{
flex-grow: 1;
flex-shrink: 1;
font-size: 36rpx;
color: #108EE9;
letter-spacing: 0;
text-align: center;
font-weight: 400;
}
}
}
.content {
padding-bottom: 16rpx;
.info-box {
max-height: 197rpx;
background: #ffffff;
padding: 27rpx 32rpx;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
.name {
ont-size: 30rpx;
color: #333333;
letter-spacing: 0;
font-weight: 400;
}
.address {
padding-top: 16rpx;
font-size: 28rpx;
color: #333333;
letter-spacing: 0;
font-weight: 400;
}
}
.other {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 0rpx 32rpx;
height: 80rpx;
background: #ffffff;
.radioText {
font-size: 28rpx;
color: #007aff;
letter-spacing: 0;
font-weight: 400;
}
.not-radioText {
font-size: 28rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
}
.left {
font-size: 28rpx;
color: #007aff;
letter-spacing: 0;
font-weight: 400;
}
.right {
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: 28rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
.edit {
padding-left: 32rpx;
}
}
}
}
.button-area {
width: 750rpx;
padding: 0 32rpx;
display: flex;
flex-direction: row;
align-items: center;
// justify-content: space-between;
.button {
flex-grow: 0;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10rpx;
.text {
font-size: 30rpx;
font-weight: 500;
text-align: center;
}
}
.button__cancel {
width: 270rpx;
height: 88rpx;
border: 2rpx solid #979797;
}
.button__submit {
width: 100%;
height: 88rpx;
background: #007aff;
}
}
.popup-box {
width: 540rpx;
height: 226rpx;
background: #ffffff;
border-radius: 14rpx;
.tip-title {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
height: 126rpx;
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
text-align: center;
font-weight: 400;
}
.operation-row {
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
height: 100rpx;
background: #ffffff;
border-top: 2rpx solid rgba(221, 221, 221, 0.5);
.cancel-text {
flex-grow: 1;
flex-shrink: 1;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 400;
}
.line {
flex-grow: 0;
flex-shrink: 0;
width: 2rpx;
height: 100rpx;
border-left: 2rpx solid #dcdee3;
}
.confirm-text {
flex-grow: 1;
flex-shrink: 1;
font-size: 36rpx;
color: #108ee9;
letter-spacing: 0;
text-align: center;
font-weight: 400;
}
}
}
}
</style>

1090
pages/cart/index.vue
File diff suppressed because it is too large
View File

8
pages/enquiry-list/index.vue

@ -199,7 +199,7 @@ export default {
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
// border-bottom: 2rpx solid #DDDDDD;
// border-bottom: 2rpx solid rgba(221,221,221,0.5);
background-color: #fff;
border-bottom: 2rpx solid rgba($color: #dddddd, $alpha: 0.8);
height: 90rpx;
@ -228,7 +228,7 @@ export default {
height: 88rpx;
background: #ffffff;
padding: 0rpx 32rpx;
border-bottom: 2rpx solid #dddddd;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
.header-title {
font-size: 30rpx;
color: #333333;
@ -250,7 +250,7 @@ export default {
background-color: #fff;
padding: 24rpx 32rpx;
.list-box:nth-last-child(even) {
border-bottom: 2rpx solid #dddddd;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
}
.list-box {
display: flex;
@ -293,7 +293,7 @@ export default {
padding: 0rpx 32rpx;
height: 80rpx;
background: #ffffff;
border-top: 2rpx solid #dddddd;
border-top: 2rpx solid rgba(221, 221, 221, 0.5);
.left {
font-size: 26rpx;
color: #888888;

6
pages/enterprise-info/index.vue

@ -468,7 +468,7 @@ export default {
flex-direction: row;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #d8d8d8;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
min-height: 80rpx;
.label {
flex-grow: 0;
@ -511,7 +511,7 @@ export default {
width: 750rpx;
height: 88rpx;
font-weight: 600;
border-bottom: 2rpx solid #d8d8d8;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
}
.popup_modal-scroll {
width: 750rpx;
@ -524,7 +524,7 @@ export default {
width: 750rpx;
height: 88rpx;
padding: 0rpx 32rpx;
border-bottom: 2rpx solid #d8d8d8;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
}
}
}

10
pages/for-comparison/index.vue

@ -85,7 +85,7 @@
</view>
<view class="value">
<view class="value">
<qn-easyinput :maxlength="20" v-model="form.quantity" :inputBorder="false" text="right" placeholder="请输入数量"></qn-easyinput>
<qn-easyinput :maxlength="20" type="number" v-model="form.quantity" :inputBorder="false" text="right" placeholder="请输入数量"></qn-easyinput>
</view>
</view>
</view>
@ -476,7 +476,7 @@ export default {
display: flex;
flex-direction: row;
justify-content: space-between;
border-bottom: 2rpx solid #d8d8d8;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
.label {
flex-grow: 0;
flex-shrink: 0;
@ -522,7 +522,7 @@ export default {
flex-direction: row;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #d8d8d8;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
min-height: 80rpx;
.label {
flex-grow: 0;
@ -565,7 +565,7 @@ export default {
width: 750rpx;
height: 88rpx;
font-weight: 600;
border-bottom: 2rpx solid #d8d8d8;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
}
.popup_modal-scroll {
width: 750rpx;
@ -578,7 +578,7 @@ export default {
width: 750rpx;
height: 88rpx;
padding: 0rpx 32rpx;
border-bottom: 2rpx solid #d8d8d8;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
}
}
}

9
pages/mine/index.vue

@ -27,7 +27,7 @@
</view>
</view>
</view>
<view class="logout" @click="logout">
<view v-if="hasLogin" class="logout" @click="logout">
<text class="text">退出登录</text>
<image class="icon" src="/static/imgs/mine/logout-icon.png"></image>
</view>
@ -96,7 +96,7 @@
<text style="font-size: 30rpx; color: rgba(0, 0, 0, 0.85); font-weight: 600">其他工具</text>
</view>
<view class="icon-area">
<view class="icon-item" style="margin-right: 64rpx" @click="go2('account-management')">
<view class="icon-item" style="margin-right: 64rpx" @click="loginGo2('account-management')">
<image class="icon" src="/static/imgs/mine/account-icon.png"></image>
<text class="label">账号管理</text>
</view>
@ -105,13 +105,11 @@
<text class="label">我的询价</text>
</view>
<view class="icon-item" style="margin-right: 64rpx" @click="loginGo2('address-manage')">
<image class="icon" src="/static/imgs/mine/address-icon.png" @click="go2('address-manage')"></image>
<image class="icon" src="/static/imgs/mine/address-icon.png"></image>
<text class="label">收货地址</text>
</view>
</view>
</view>
<view @click="loginGo2('test')">test</view>
<view @click="loginGo2('order-detail')">order-detail</view>
<view @click="loginGo2('enterprise-info')">enterprise-info</view>
</view>
</template>
@ -217,6 +215,7 @@ export default {
}
})
this.hasLogin && getBaseInfo({}, true)
!this.hasLogin && (this.fsInfo.status = -1)
}
}
</script>

2
pages/notification-page/index.vue

@ -36,7 +36,7 @@ export default {
// 退
this.backInfo.isBack = true
this.backInfo.isBackTo = 'order-list'
go2('order-detail', { orderId: orderId })
go2('order-detail', { orderId: orderId }, true)
} else {
this.handleResultError({ fn: this.certifySign, data: orderId, errType: '订单合同签约' })
}

2
pages/order-detail/index.vue

@ -476,7 +476,7 @@ export default {
background-color: #ffffff;
.order-row {
padding: 24rpx 0;
border-bottom: 2rpx solid #d8d8d8;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
.label {
font-size: 28rpx;
color: #000000;

2
pages/order-list/index.vue

@ -39,7 +39,7 @@
<view class="order-footer">
<view class="left">
<text style="font-size: 26rpx; color: #888888; margin-right: 8rpx">交货时间:</text>
<text style="font-size: 26rpx; color: #333333">{{ item.deliveryLeadtime || '-' }}</text>
<text style="font-size: 26rpx; color: #333333">{{ item.deliveryLeadtime || '-' }}</text>
</view>
<view class="right">
<text style="font-size: 30rpx; color: #ff5368"> {{ item.totalOfferPrice }}</text>

11
pages/order-make/index.vue

@ -198,6 +198,13 @@ export default {
if (this.loading) {
return
}
if (!this.deliveryAddress.addressId) {
uni.showToast({
title: '请选择收货地址',
icon: 'none'
})
return
}
this.loading = true
let itemsRemarkList = []
//
@ -280,7 +287,7 @@ export default {
align-items: center;
justify-content: flex-start;
padding: 24rpx 0 40rpx;
border-bottom: 2rpx solid #dddddd;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
.img {
width: 100rpx;
height: 100rpx;
@ -376,7 +383,7 @@ export default {
flex-direction: row;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #d8d8d8;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
.left {
display: flex;
flex-direction: row;

105
pages/paper-details/index.vue

@ -1,5 +1,6 @@
<template>
<view class="warpper">
<view class="wrapper">
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="纸品详情"></uni-nav-bar>
<view class="swiper-dot">
<uni-swiper-dot :info="info.imgList" :current="current" field="content" mode="indexes" style="height: 100%">
<swiper class="swiper-box" @change="swiperChange" style="height: 100%">
@ -57,15 +58,15 @@
<qn-footer fixed height="100rpx">
<view class="footer-row">
<view class="left">
<view class="">
<view @click="storeTap">
<image class="icon" src="/static/imgs/paperDetails/shop-icon.png"></image>
<view class="label" @tap="storeTap">店铺</view>
<view class="label">店铺</view>
</view>
<view class="">
<view @click="shoppingCartTap">
<image class="icon" src="/static/imgs/paperDetails/shopping-trolley.png"></image>
<view class="label" @tap="shoppingCartTap">购物车</view>
<view class="label">购物车</view>
</view>
<view class="" @tap="addShoppingTap(1)">
<view @click="addShoppingTap(1)">
<image class="icon" src="/static/imgs/paperDetails/add-shopping-trolley.png"></image>
<view class="label">加购物车</view>
</view>
@ -141,9 +142,27 @@
import uGap from '@/components/u-gap/u-gap.vue'
import qnFooter from '@/components/qn-footer/qn-footer.vue'
import qnInputNumber from '@/components/qn-input-number/qn-input-number.vue'
import { go2 } from '@/utils/hook.js'
import { go2, back } from '@/utils/hook.js'
import { getPaperDetail, createGoodsReserve, createShoppingCar } from '@/apis/paperDetailsApi.js'
import { round } from '@/utils/index.js'
const validateFields = [
{
value: 'length',
label: '纸品长度'
},
{
value: 'width',
label: '纸品宽度'
},
{
value: 'gramWeight',
label: '纸品克重'
},
{
value: 'pieceQuantity',
label: '购买数量'
}
]
export default {
components: { uGap, qnFooter, qnInputNumber },
data() {
@ -158,7 +177,7 @@ export default {
disabled: true
},
{
name: '特规分切',
name: '大度',
width: '889',
length: '1194',
disabled: true
@ -208,17 +227,44 @@ export default {
}
},
onLoad(option) {
this.params.productId = option.id
this.queryData()
if (option.paperId) {
this.params.productId = option.paperId
if (this.hasLogin) {
this.queryData()
} else {
this.$store.commit('setNextPage', { name: 'paper-detail', data: { paperId: option.paperId } })
go2('login')
}
} else {
uni.showToast({
title: '参数错误',
icon: 'fail',
success: () => {
back()
}
})
}
},
computed: {
buyTon() {
let num = 0
num = round(this.buyPaperDto.gramWeight * this.buyPaperDto.width * this.buyPaperDto.length * this.buyPaperDto.pieceQuantity * 1e-12, 4)
num = round(this.buyPaperDto.gramWeight * this.buyPaperDto.width * this.buyPaperDto.length * this.buyPaperDto.pieceQuantity * 1e-12, 4)
return num
},
hasCompany() {
return this.$store.state.companyInfo.id != null
},
hasLogin() {
return this.$store.state.qnToken != ''
}
},
watch: {
buyTon(newVal) {
this.buyPaperDto.buyTon = newVal
}
},
methods: {
back,
//
queryData() {
getPaperDetail(this.params).then((res) => {
@ -241,6 +287,13 @@ export default {
},
//
addShoppingTap(type) {
if (!this.hasCompany) {
uni.showToast({
title: '请先完善公司信息',
icon: 'none'
})
return
}
this.shoppingCarType = type
this.buyPaperDto = {
buyTon: 0,
@ -258,6 +311,13 @@ export default {
//
inquiryTap() {
if (!this.hasCompany) {
uni.showToast({
title: '请先完善公司信息',
icon: 'none'
})
return
}
go2('for-comparison', { id: this.info.supplierId, productImg: this.info.imgList[0] })
},
closeTap() {
@ -289,15 +349,26 @@ export default {
},
//
confirm() {
//
for (let i = 0; i < validateFields.length; i++) {
let item = validateFields[i]
if (!this.buyPaperDto[item.value]) {
uni.showToast({
title: item.label + '必须大于0',
icon: 'none'
})
return
}
}
//
if (this.shoppingCarType == 1) {
const params = {
length: this.specificationObj.length,
length: this.buyPaperDto.length,
productId: this.info.id,
productSkuId: this.buyPaperDto.productSkuId,
quantity: this.buyPaperDto.pieceQuantity,
supplierId: this.info.supplierId,
width: this.specificationObj.width,
width: this.buyPaperDto.width,
enterpriseId: this.$store.state.companyInfo.id,
userId: this.$store.state.userInfo.userId
}
@ -346,7 +417,7 @@ export default {
</script>
<style lang="scss">
.warpper {
.wrapper {
.swiper-dot {
width: 100%;
height: 500rpx;
@ -431,7 +502,7 @@ export default {
}
.other {
padding: 0rpx 32rpx;
border-bottom: 2rpx solid #d8d8d8;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
background: #ffffff;
.title {
font-size: 28rpx;
@ -512,7 +583,7 @@ export default {
// align-items: center;
// height: 240rpx;
background: #ffffff;
border-bottom: 2rpx solid #d8d8d8;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
padding: 40rpx 0rpx;
.image {
flex: 0 0 160rpx;
@ -553,7 +624,7 @@ export default {
}
}
.choose-box {
border-bottom: 2rpx solid #d8d8d8;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
padding: 24rpx 32rpx;
.label {
font-size: 30rpx;

62
pages/store/index.vue

@ -1,6 +1,6 @@
<template>
<view class="warpper">
<uni-nav-bar statusBar fixed title="店铺首页"></uni-nav-bar>
<view class="wrapper">
<uni-nav-bar statusBar fixed title="店铺首页"></uni-nav-bar>
<view class="top-box">
<view class="">
<!-- <image class="image" src="https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/paper-default-small.png" mode=""></image> -->
@ -26,12 +26,12 @@
type="text"
class="easyinput"
prefixIcon="search"
@confirm="searchConfirm"
@input="searchConfirm"
/>
</view>
<scroll-list ref="list" :option="option" @load="upCallback" @refresh="downCallback" style="background-color: #ffffff">
<view class="content">
<view class="box" v-for="(item, index) in list" :key="index" @tap="seeDetailsTap(item)">
<view class="content flex-row-start-start">
<view class="box" v-for="(item, index) in list" :key="index" @tap="seeDetailsTap(item)" :style="{ marginRight: index % 2 != 0 ? '0' : '20rpx' }">
<view class="image-box">
<view class=""><image class="special-img" :src="item.isPromoting ? '/static/imgs/store/special-offe.png' : ''" mode=""></image></view>
<image
@ -50,7 +50,7 @@
</view>
<view class="footer">
<view class="left">
<text class="price">{{ item.priceRange }}</text>
<text :class="{ price: true, 'price-single': hasLogin, 'price-range': !hasLogin }">{{ transformPrice(item.priceRange) }}</text>
<!-- <text class="unit">/</text> -->
</view>
<view class="btn">马上抢</view>
@ -93,15 +93,13 @@ export default {
supplierId: this.$store.state.supplierId || null
// supplierId: '677166944742412288'
},
customerInfo: {}
customerInfo: {},
timer: null
}
},
onLoad() {
this.getCustomer()
},
methods: {
seeDetailsTap(item) {
loginGo2('paper-details', { id: item.id })
loginGo2('paper-details', { paperId: item.id })
},
//
getCustomer() {
@ -123,9 +121,10 @@ export default {
} else {
this.list = this.list.concat(res.records)
}
// this.list = []
// this.list = [...this.list, ...[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]
resolve({ list: this.list, total: res.total })
} else {
reject()
}
})
.catch((err) => {
@ -155,15 +154,36 @@ export default {
},
searchConfirm(value) {
this.params.name = value
this.pagination.pageNum = 1
this.getList()
if (this.timer) {
clearTimeout(this.timer)
this.timer = null
}
this.timer = setTimeout(() => {
this.downCallback()
}, 500)
},
transformPrice(value) {
if (this.hasLogin) {
return `¥${value}`
} else {
return `¥${value - 150}${value - 0 + 400}`
}
}
},
onShow() {
this.downCallback()
this.getCustomer()
},
computed: {
hasLogin() {
return this.$store.state.qnToken != ''
}
}
}
</script>
<style lang="scss">
.warpper {
.wrapper {
.header {
justify-content: space-between;
.header-title {
@ -258,8 +278,6 @@ export default {
}
.content {
display: flex;
flex-direction: row;
justify-content: space-between;
flex-wrap: wrap;
padding: 0rpx 32rpx 20rpx 32rpx;
.box {
@ -268,6 +286,7 @@ export default {
background: #ffffff;
box-shadow: 0rpx 8rpx 28rpx 0rpx rgba(112, 112, 112, 0.1);
border-radius: 10rpx;
margin-bottom: 20rpx;
.special-img {
width: 110rpx;
height: 110rpx;
@ -314,11 +333,16 @@ export default {
flex-shrink: 1;
}
.price {
font-size: 34rpx;
color: #f5222d;
letter-spacing: 0;
font-weight: 600;
}
.price-single {
font-size: 34rpx;
}
.price-range {
font-size: 24rpx;
}
.unit {
font-size: 24rpx;
color: #f5222d;
@ -337,7 +361,7 @@ export default {
height: 48rpx;
background: #ff4849;
border-radius: 27rpx;
ont-size: 26rpx;
font-size: 26rpx;
color: #ffffff;
letter-spacing: 0;
font-weight: 400;

2
utils/hook.js

@ -118,7 +118,7 @@ export function uploadImage(sourceType = ['album', 'camera'], count = 1) {
},
fail: (err) => {
console.error('chooseImage error:', err)
reject(err)
resolve(null)
}
})
})

2
utils/http/index.js

@ -92,7 +92,7 @@ const resInterceptor = (response, options) => {
if (statusCode >= 200 && statusCode < 300) {
if (res.code == 0) {
// 将成功的null置位1
return res.data || 1
return res.data === null ? 1 : res.data
} else {
uni.showToast({
title: res.message,

37
utils/index.js

@ -124,3 +124,40 @@ export const makeSocket = async ({ pageInfo = '', retry = false }) => {
export function round(number, precision) {
return Math.round(+number + 'e' + precision) / Math.pow(10, precision)
}
/**
* {beyond:是否超出目标时间,day:,hours:小时,minutes:分钟,seconds:秒钟}
* @param time 计算时间
* @param target 对照时间
* @returns 时间差对象
*/
export const difTime = (time, target) => {
let begin = new Date(time).getTime()
// 兼容ios时间
let end = new Date(target.replace(/-/g, '/')).getTime()
let beyond = begin < end ? false : true
let diff = Math.abs(begin - end)
// 计算天数
let day = Math.floor(diff / (24 * 3600 * 1000))
day != day ? (day = 0) : ''
diff = diff % (24 * 3600 * 1000)
// 计算小时数
let hours = Math.floor(diff / (3600 * 1000))
hours != hours ? (hours = 0) : ''
diff = diff % (3600 * 1000)
// 计算分钟数
let minutes = Math.floor(diff / (60 * 1000))
minutes != minutes ? (minutes = 0) : ''
diff = diff % (60 * 1000)
// 计算秒数
let seconds = Math.floor(diff / 1000)
seconds != seconds ? (seconds = 0) : ''
diff = diff % 1000
return {
beyond,
day,
hours,
minutes,
seconds
}
}
Loading…
Cancel
Save