杨阁辉 4 years ago
parent
commit
646dc69397
21 changed files with 837 additions and 569 deletions
  1. 11
      apis/addUserApi.js
  2. 10
      apis/commonApi.js
  3. 36
      apis/orderApi.js
  4. 4
      components/bussiness-components/packingStationItem.vue
  5. 2
      components/qn-map/qn-map.nvue
  6. 221
      manifest.json
  7. 61
      pages/add-user/index.vue
  8. 4
      pages/client-detail/basic-information.vue
  9. 3
      pages/client-detail/equipment-information.vue
  10. 150
      pages/client-detail/index.vue
  11. 686
      pages/mall/index.vue
  12. 176
      pages/order-detail/index.vue
  13. 6
      pages/page-view/index.vue
  14. 2
      pages/trade/index.vue
  15. 4
      static/icon/iconfont.css
  16. BIN
      static/icon/iconfont.ttf
  17. BIN
      static/imgs/order/camera.png
  18. 4
      utils/hook.js
  19. 3
      utils/http/http.js
  20. 9
      utils/http/index.js
  21. 14
      utils/index.js

11
apis/addUserApi.js

@ -23,3 +23,14 @@ export function addCustomer(data) {
data
})
}
/**
* 根据企业名称查询企业坐标列表
* @param {*} data
* @returns
*/
export function getCompanyLocationList(data) {
return http.get({
url: '/yyt-uec/get/enterprise/geographic/position/address',
data
})
}

10
apis/commonApi.js

@ -76,3 +76,13 @@ export function getVerifyUrl(data = {}) {
export function getGuaranteeContract(data = {}) {
return http.post({ url: '/yyt-uec/create/supplier/guarantee-contract?mallSupplierId=' + data.mallSupplierId, data })
}
/**
* 转换合同成图片
* @param {object} data 图片地址链接 fileUrl
*/
export function transformFileToImg(data) {
http.get({
url: '/document/get/enterprise-documents/file-image-base64',
data: data
})
}

36
apis/orderApi.js

@ -47,3 +47,39 @@ export function confirmSupplierOrder(data) {
data
})
}
/**
* 供应商操作纸品状态
* @param {object} data
* @returns {Promise<Object>}
*/
export function supplierOperatePaper(data) {
return http.post({
url: '/base-paper-trading/supplier/submit/outbound/delivery',
data
})
}
/**
* 供应商上传送货凭证
* @param {object} data
* @returns {Promise<Object>}
*/
export function supplierUploadVoucher(data) {
return http.post({
url: '/base-paper-trading/supplier/submit/upload/delivery/voucher',
data
})
}
/**
* 供应商确认送货
* @param {object} data supplierOrderId
* @returns {Promise<Object>}
*/
export function supplierDelivery(data) {
return http.post({
url: '/base-paper-trading/supplier/submit/confirm/delivery',
data
})
}

4
components/bussiness-components/packingStationItem.vue

@ -10,7 +10,7 @@
<view class="desc">
<text>{{ transformBusiness(info.business) }}</text>
</view>
<view v-show="info.whetherCooperation === 1" class="box-area">
<view v-if="info.whetherCooperation === 1" class="box-area">
<view class="box">
<view><text class="title">月采购量</text></view>
<view style="margin-top: 16rpx">
@ -30,7 +30,7 @@
</view>
</view>
</view>
<view v-show="info.whetherCooperation === 0" class="box-area">
<view v-if="info.whetherCooperation === 0" class="box-area">
<view class="box">
<view><text class="title">法定代表人</text></view>
<view style="margin-top: 16rpx">

2
components/qn-map/qn-map.nvue

@ -49,9 +49,11 @@ export default {
watch: {
// 只监听items一层变化
items(val) {
console.log('val:',val)
this.markers = val.map((item) => {
return this.causeMarker(item)
})
console.log('res:',this.markers)
this.mapContext.addMarkers({
markers: this.markers,
clear: true,

221
manifest.json

@ -1,120 +1,119 @@
{
"name" : "纸掌柜",
"appid" : "__UNI__8C1E198",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"networkTimeout" : {
"request" : 6000
"name": "纸掌柜",
"appid": "__UNI__8C1E198",
"description": "",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
"networkTimeout": {
"request": 6000
},
/* 5+App */
"app-plus": {
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
"compatible" : {
"ignoreVersion" : true
},
/* */
"modules" : {
"Maps" : {},
"Geolocation" : {},
"FaceID" : {},
"iBeacon" : {}
"compatible": {
"ignoreVersion": true
},
/* */
"modules": {
"Maps": {},
"Geolocation": {},
"FaceID": {},
"iBeacon": {}
},
/* */
"distribute": {
/* android */
"android": {
"permissions": [
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
],
"abiFilters": ["armeabi-v7a", "x86"]
},
/* ios */
"ios": {},
/* SDK */
"sdkConfigs": {
"maps": {
"amap": {
"appkey_ios": "0182ee2a9fdd5fd3ef6a8bd5a2f98325",
"appkey_android": "877848546f7f3717101a17c33e1d4df3"
}
},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
],
"abiFilters" : [ "armeabi-v7a", "x86" ]
},
/* ios */
"ios" : {},
/* SDK */
"sdkConfigs" : {
"maps" : {
"amap" : {
"appkey_ios" : "0182ee2a9fdd5fd3ef6a8bd5a2f98325",
"appkey_android" : "877848546f7f3717101a17c33e1d4df3"
}
},
"payment" : {
"weixin" : {
"__platform__" : [ "ios", "android" ],
"appid" : "",
"UniversalLinks" : ""
}
},
"ad" : {},
"geolocation" : {
"amap" : {
"__platform__" : [ "ios", "android" ],
"appkey_ios" : "0182ee2a9fdd5fd3ef6a8bd5a2f98325",
"appkey_android" : "877848546f7f3717101a17c33e1d4df3"
}
},
"share" : {},
"oauth" : {}
}
"payment": {
"weixin": {
"__platform__": ["ios", "android"],
"appid": "",
"UniversalLinks": ""
}
},
"uniStatistics" : {
"enable" : true
}
},
/* */
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false
"ad": {},
"geolocation": {
"amap": {
"__platform__": ["ios", "android"],
"appkey_ios": "0182ee2a9fdd5fd3ef6a8bd5a2f98325",
"appkey_android": "877848546f7f3717101a17c33e1d4df3"
}
},
"usingComponents" : true
"share": {}
}
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
"uniStatistics": {
"enable": true
}
},
/* */
"quickapp": {},
/* */
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false
},
"vueVersion" : "2",
"h5" : {
"router" : {
"mode" : "history"
}
"usingComponents": true
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"vueVersion": "2",
"h5": {
"router": {
"mode": "history"
}
}
}

61
pages/add-user/index.vue

@ -73,6 +73,9 @@
></qn-easyinput>
</view>
</view>
<qn-form-item label="点击定位" required v-if="!hasSelected">
<image @click="showLocationList" style="width: 32rpx; height: 32rpx" src="/static/imgs/order/location-icon.png"></image>
</qn-form-item>
<view class="qn-form-item qn-form-item">
<view class="label">
<uni-icons custom-prefix="iconfont" type="icon-required" size="14" color="#F5222D"></uni-icons>
@ -81,7 +84,7 @@
<view class="value">
<!-- <qn-easyinput v-model="form.shortName" :inputBorder="false" text="right" placeholder="选择所在区域"></qn-easyinput> -->
<qn-data-picker
:readonly="hasSelected"
:readonly="true"
text="right"
:border="false"
class="qn-picker"
@ -106,12 +109,12 @@
<view class="value">
<qn-easyinput
:maxlength="20"
:disabled="hasSelected"
:disabled="true"
:styles="{ disableColor: '#fff' }"
v-model="form.locDetail"
:inputBorder="false"
text="right"
placeholder="请输入详细地址"
placeholder="请定位详细地址"
></qn-easyinput>
</view>
</view>
@ -243,6 +246,21 @@
</scroll-view>
</view>
</uni-popup>
<uni-popup ref="locationPopup" 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="selectLocation(item)" style="height: 100rpx" class="popup_modal-scroll-item" v-for="(item, index) in locationList" :key="index">
<view class="location-item">
<text class="title">{{ item.enterpriseName }}</text>
<text class="address">{{ `${item.provinceName}/${item.cityName}/${item.districtName}/${item.address}` }}</text>
</view>
</view>
</scroll-view>
</view>
</uni-popup>
<qn-footer fixed height="120rpx">
<view class="button-area">
<view class="button button__cancel" @click="back">
@ -259,7 +277,7 @@
<script>
import { back, uploadImage } from '@/utils/hook.js'
import { getArea } from '@/apis/commonApi.js'
import { getCompanyList, getCompanyInfoById, addCustomer } from '@/apis/addUserApi.js'
import { getCompanyList, getCompanyInfoById, addCustomer, getCompanyLocationList } from '@/apis/addUserApi.js'
import qnEasyinput from '@/components/qn-easyinput/qn-easyinput.vue'
import qnDataPicker from '@/components/qn-data-picker/qn-data-picker.vue'
import qnDatetimePicker from '@/components/qn-datetime-picker/qn-datetime-picker.vue'
@ -314,6 +332,7 @@ export default {
registeredCapital: null,
foundDate: null
},
locationList: [],
searchList: [],
hasSelected: false,
items: []
@ -341,6 +360,38 @@ export default {
})
}
},
showLocationList() {
if (!this.form.name || !this.form.name.trim()) {
uni.showToast({
title: '请先填写公司名称',
icon: 'none'
})
return
}
getCompanyLocationList({ enterpriseName: this.form.name }).then((res) => {
if (res) {
this.locationList = res
this.$refs.locationPopup.open('bottom')
} else {
uni.showToast({
title: '暂无定位公司',
icon: 'error'
})
}
})
},
selectLocation(location) {
this.form.locProvinceId = location.provinceCode
this.form.locCityId = location.cityCode
this.form.locDistrictId = location.districtCode
this.form.locProvinceName = location.provinceName
this.form.locCityName = location.cityName
this.form.locDistrictName = location.districtName
this.form.locDetail = location.address
this.form.regAddrLongitude = location.longitude
this.form.regAddrLatitude = location.latitude
this.$refs.locationPopup.close()
},
selectCompany(enterpriseId) {
this.$refs.popup.close()
getCompanyInfoById({ enterpriseId }).then((res) => {
@ -368,6 +419,8 @@ export default {
this.form.locDetail = info.locDetail
this.form.registeredCapital = info.registeredCapital
this.form.foundDate = info.foundDate
this.form.regAddrLongitude = info.regAddrLongitude
this.form.regAddrLatitude = info.regAddrLatitude
},
onAreaChange(e) {
if (e.detail.value && e.detail.value.length > 0) {

4
pages/client-detail/basic-information.vue

@ -14,7 +14,7 @@
<text class="text">{{info.name}}</text>
<image
class="icon"
:src="info.registrationStatus ? '/static/imgs/general/cooperation-icon.png' : '/static/imgs/general/no-cooperation-icon.png'"
:src="info.cooperation == 1 ? '/static/imgs/general/cooperation-icon.png' : '/static/imgs/general/no-cooperation-icon.png'"
></image>
</view>
<view class="desc u-line-2">
@ -38,7 +38,7 @@
</view>
<view class="site">
<image class="icon" src="/static/imgs/client-detail/address-icon.png"></image>
<text class="text">{{ info.locProvinceName }}{{ info.locCityName }} {{ info.locDetail }}</text>
<text class="text">{{ info.locProvinceName }}{{ info.locCityName }}{{info.locDistrictName}}{{info.locStreetName}} {{ info.locDetail }}</text>
</view>
</view>
</view>

3
pages/client-detail/equipment-information.vue

@ -131,7 +131,8 @@ export default {
asc: '',
desc: '',
duration: '3',
enterpriseIds: []
customerEnterpriseId: this.$store.state.supplierInfo.id || null, // IDid
// customerEnterpriseId: '651107734133018624',
},
pagination: {
pageNum: 0, //

150
pages/client-detail/index.vue

@ -1,23 +1,29 @@
<template>
<view class="warpper">
<qnHeader class="header">
<!-- <view class="header"> -->
<view class="header-title">客户详情</view>
<view class="right-title">客户授信</view>
<!-- </view> -->
</qnHeader>
<view>
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text" activeColor="#007AFF" class="segmented"></uni-segmented-control>
<view class="content">
<view v-show="current === 0"><basicInformation ref="basicInformationRef" :customerId="customerId"></basicInformation></view>
<view v-show="current === 1"><equipmentInformation></equipmentInformation></view>
<view v-show="current === 2"><basePaperDeals></basePaperDeals></view>
<view v-show="current === 3"><wastePaperTrading></wastePaperTrading></view>
</view>
</view>
</view>
<view class="warpper">
<qnHeader class="header">
<!-- <view class="header"> -->
<view class="header-title">客户详情</view>
<view class="right-title" @click="go2('client-credit')">客户授信</view>
<!-- </view> -->
</qnHeader>
<view>
<uni-segmented-control
:current="current"
:values="items"
@clickItem="onClickItem"
styleType="text"
activeColor="#007AFF"
class="segmented"
></uni-segmented-control>
<view class="content">
<view v-show="current === 0"><basicInformation ref="basicInformationRef" :customerId="customerId"></basicInformation></view>
<view v-show="current === 1"><equipmentInformation></equipmentInformation></view>
<view v-show="current === 2"><basePaperDeals></basePaperDeals></view>
<view v-show="current === 3"><wastePaperTrading></wastePaperTrading></view>
</view>
</view>
</view>
</template>
<script>
@ -26,65 +32,65 @@ import basicInformation from './basic-information.vue'
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'
export default {
components: {
qnHeader,
basicInformation,
equipmentInformation,
basePaperDeals,
wastePaperTrading
},
data() {
return {
current: 0,
items: ['基础信息', '设备信息', '原纸交易', '废纸交易'],
customerId: null,
}
},
onLoad(option) {
this.customerId = option.id || '800890'
this.$nextTick(() => {
this.$refs.basicInformationRef.getBaseInfo()
})
},
methods: {
onClickItem(e) {
console.log('e', e)
this.current = e.currentIndex
},
}
components: {
qnHeader,
basicInformation,
equipmentInformation,
basePaperDeals,
wastePaperTrading
},
data() {
return {
current: 0,
items: ['基础信息', '设备信息', '原纸交易', '废纸交易'],
customerId: null
}
},
onLoad(option) {
this.customerId = option.id || '800890'
this.$nextTick(() => {
this.$refs.basicInformationRef.getBaseInfo()
})
},
methods: {
go2,
onClickItem(e) {
console.log('e', e)
this.current = e.currentIndex
}
}
}
</script>
<style lang="scss" scoped>
.warpper {
.header {
justify-content: space-between;
}
.header-title {
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.header {
justify-content: space-between;
}
.header-title {
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.right-title {
font-size: 28rpx;
color: #007aff;
text-align: center;
line-height: 40rpx;
font-weight: 500;
}
.segmented {
height: 88rpx;
border-bottom: 2rpx solid #ECECEC;
font-size: 28rpx;
color: #333333;
text-align: center;
font-weight: 400;
}
.right-title {
font-size: 28rpx;
color: #007aff;
text-align: center;
line-height: 40rpx;
font-weight: 500;
}
.segmented {
height: 88rpx;
border-bottom: 2rpx solid #ececec;
font-size: 28rpx;
color: #333333;
text-align: center;
font-weight: 400;
}
}
</style>

686
pages/mall/index.vue

@ -1,101 +1,101 @@
<template>
<view class="warpper">
<uni-nav-bar>
<view slot="left" class="left-title">纸商城</view>
<template>
<view class="warpper">
<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">
<view class=""><image class="image" src="https://qncloud.oss-cn-shenzhen.aliyuncs.com/ztb_pic/testPic.jfif" mode=""></image></view>
<view class="center">
<view class="title">{{ storeInformation.name }}</view>
<view class="desc">全部商品 39 &nbsp; | &nbsp;上新 9</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="desc">全部商品 39 &nbsp; | &nbsp;上新 9</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>
<uGap></uGap>
<view class="" v-if="pageShow">
<scroll-list ref="list" :option="option" @load="upCallback" @refresh="downCallback" style="background-color: #FFFFFF;">
</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="">
<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>
<view class="sub-title">{{ item.categoryName }}/{{ item.name }}/{{ item.manufacturerName }}</view>
<view class="desc">
克重(价格)
<text v-for="(sku,index) in item.skuList">{{sku.weight}}({{sku.listPrice}})</text>
</view>
<view class="sub-title">{{ item.categoryName }}/{{ item.name }}/{{ item.manufacturerName }}</view>
<view class="desc">
克重(价格)
<text v-for="(sku,index) in item.skuList">{{sku.weight}}({{sku.listPrice}})</text>
</view>
</view>
</view>
<view class="other">
<view class="time">{{ item.updateTime }}</view>
<view class="btn">
</view>
</view>
<view class="other">
<view class="time">{{ item.updateTime }}</view>
<view class="btn">
<view class="" @click="editPaper(item)">编辑</view>
<view class="divide"></view>
<view class="divide"></view>
<view class="" @click="productStatusChange(item)">{{ item.status === 30111 ? '下架' : '上架' }}</view>
</view>
</view>
<uGap></uGap>
</view>
</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>
</template>
<script>
import uGap from '@/components/u-gap/u-gap.vue'
</view>
</view>
<uGap></uGap>
</view>
</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>
</template>
<script>
import uGap from '@/components/u-gap/u-gap.vue'
import { back, go2, loginGo2 } from '@/utils/hook.js'
import { SupplierList, productStatus } from '@/apis/add-paper.js'
import noData from './no-data.vue'
export default {
components: { uGap, noData },
data() {
return {
pageShow: true,
import { SupplierList, productStatus } from '@/apis/add-paper.js'
import noData from './no-data.vue'
export default {
components: { uGap, noData },
data() {
return {
pageShow: true,
storeInformation: {
supplierId: null,
name: null
},
option: {
size: 10,
auto: true,
emptyText: '暂无数据~',
background: '#F7F8FA',
disabled: false
},
pattern: {
backgroundColor: '#007AFF',
buttonColor: '#007AFF'
},
content: [],
horizontal: 'right',
vertical: 'bottom',
direction: 'vertical',
orderPagination: {
pageNum: 0, //
pageSize: 10,
storeId: null,
name: null,
supplierId: this.$store.state.supplierInfo.supplierId
},
listData: []
}
},
option: {
size: 10,
auto: true,
emptyText: '暂无数据~',
background: '#F7F8FA',
disabled: false
},
pattern: {
backgroundColor: '#007AFF',
buttonColor: '#007AFF'
},
content: [],
horizontal: 'right',
vertical: 'bottom',
direction: 'vertical',
orderPagination: {
pageNum: 0, //
pageSize: 10,
storeId: null,
name: null,
supplierId: this.$store.state.supplierInfo.supplierId
},
listData: []
}
},
onShow() {
this.storeInformation = {
supplierId: this.$store.state.supplierInfo.supplierId,
@ -103,93 +103,93 @@ export default {
}
this.quertData()
},
onLoad() {
this.quertData()
},
methods: {
back,
// pageShow
quertData() {
return new Promise((resolve, reject) => {
SupplierList({ ...this.orderPagination })
.then(res => {
console.log('纸品列表', res)
if (res) {
if (res.records.length === 0) {
this.pageShow = false
return
}
if (this.orderPagination.pageNum == 1) {
this.listData = res.records
} else {
this.listData = this.listData.concat(res.records)
}
resolve({ list: this.listData, total: res.total })
}
})
.catch(err => {
reject(err)
})
})
},
downCallback() {
this.orderPagination.pageNum = 1
this.quertData()
.then(({ list, total }) => {
this.$refs.list.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.list.refreshFail()
})
},
upCallback() {
this.orderPagination.pageNum++
this.quertData()
.then(({ list, total }) => {
this.$refs.list.loadSuccess({ list, total })
})
.catch(() => {
this.$refs.list.loadFail()
})
},
//
checkMall() {
onLoad() {
this.quertData()
},
methods: {
back,
// pageShow
quertData() {
return new Promise((resolve, reject) => {
SupplierList({ ...this.orderPagination })
.then(res => {
console.log('纸品列表', res)
if (res) {
if (res.records.length === 0) {
this.pageShow = false
return
}
if (this.orderPagination.pageNum == 1) {
this.listData = res.records
} else {
this.listData = this.listData.concat(res.records)
}
resolve({ list: this.listData, total: res.total })
}
})
.catch(err => {
reject(err)
})
})
},
downCallback() {
this.orderPagination.pageNum = 1
this.quertData()
.then(({ list, total }) => {
this.$refs.list.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.list.refreshFail()
})
},
upCallback() {
this.orderPagination.pageNum++
this.quertData()
.then(({ list, total }) => {
this.$refs.list.loadSuccess({ list, total })
})
.catch(() => {
this.$refs.list.loadFail()
})
},
//
checkMall() {
go2('switching-mall', { supplierId: this.storeInformation.supplierId })
},
//
nativeTo() {
var params = {
title: '添加纸品'
}
go2('add-paper', params)
},
//
},
//
nativeTo() {
var params = {
title: '添加纸品'
}
go2('add-paper', params)
},
//
editPaper(item) {
var params = {
var params = {
...item,
title: '编辑纸品'
}
go2('add-paper', params)
},
//
title: '编辑纸品'
}
go2('add-paper', params)
},
//
setting(item) {
go2('store-settings')
},
//
go2('store-settings')
},
//
detailInfo(item) {
loginGo2('paper-detail', item)
},
//
productStatusChange(item) {
var params = {
id: item.id,
},
//
productStatusChange(item) {
var params = {
id: item.id,
status: item.status === 30111 ? 30112 : 30111
}
productStatus(params).then(res => {
if (res) {
uni.showToast({
}
productStatus(params).then(res => {
if (res) {
uni.showToast({
title: '状态修改成功',
icon: 'success'
icon: 'success'
})
setTimeout(()=>{
this.orderPagination.pageNum = 1
@ -197,8 +197,8 @@ export default {
},500)
}
})
}
})
},
//
shareTap() {
@ -217,188 +217,188 @@ export default {
console.log("fail:" + JSON.stringify(err));
}
});
}
}
}
</script>
<style lang="scss">
.warpper {
width: 750rpx;
.left-title {
font-size: 40rpx;
color: #000000;
letter-spacing: 0;
font-weight: 500;
}
.right-title {
font-size: 28rpx;
color: #007aff;
text-align: right;
font-weight: 500;
}
.top-box {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
height: 180rpx;
background: url('/static/imgs/mall/zsc-bg-icon.png') no-repeat;
background-size: 100%;
.image {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.right {
width: 140rpx;
}
.center {
position: relative;
left: -20rpx;
}
.title {
font-size: 34rpx;
color: #ffffff;
letter-spacing: 2rpx;
font-weight: 600;
margin-bottom: 12rpx;
}
.desc {
opacity: 0.75;
font-size: 28rpx;
color: #ffffff;
letter-spacing: 0;
font-weight: 500;
padding-right: 32rpx;
}
.cut {
display: flex;
align-items: center;
font-size: 24rpx;
color: #ffffff;
letter-spacing: 0;
text-align: center;
font-weight: 400;
.cut-icon {
width: 29.42rpx;
height: 26.67rpx;
margin-left: 10rpx;
}
}
.set {
opacity: 0.75;
font-size: 28rpx;
color: #ffffff;
letter-spacing: 0;
font-weight: 500;
position: relative;
top: 39rpx;
left: 60rpx;
}
}
.content {
background: #ffffff;
border-bottom: 2rpx solid #dddddd;
display: flex;
flex-direction: row;
padding: 24rpx 0rpx 24rpx 32rpx;
.image {
width: 100rpx;
height: 100rpx;
flex: 0 0 100rpx;
margin-right: 18rpx;
}
.title {
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
font-weight: 500;
.icon {
position: relative;
top: -22rpx;
width: 150rpx;
height: 50rpx;
}
}
.sub-title {
position: relative;
font-size: 28rpx;
color: #333333;
letter-spacing: 0;
font-weight: 400;
top: -4rpx;
}
.desc {
font-size: 28rpx;
color: #555555;
letter-spacing: 0;
font-weight: 400;
padding-top: 10rpx;
line-height: 1.4;
}
}
.other {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 80rpx;
background: #ffffff;
padding: 0rpx 32rpx;
.time {
font-size: 28rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
}
.btn {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
font-size: 28rpx;
color: #007aff;
letter-spacing: 0;
text-align: right;
font-weight: 400;
}
.divide {
width: 2rpx;
height: 32rpx;
background: #d8d8d8;
margin: 0 32rpx;
}
.icon {
width: 24rpx;
height: 24rpx;
margin-left: 6rpx;
}
}
.offer-prices {
position: absolute;
z-index: 9999;
right: 32rpx;
bottom: 122rpx;
background-color: #007aff;
border-radius: 50%;
padding: 10rpx;
text-align: center;
width: 110rpx;
height: 110rpx;
border: 2rpx solid #f9f9f9;
box-shadow: 0rpx 4rpx 34rpx 0rpx rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.my-image {
width: 100rpx;
height: 100rpx;
}
}
}
}
}
</script>
<style lang="scss">
.warpper {
width: 750rpx;
.left-title {
font-size: 40rpx;
color: #000000;
letter-spacing: 0;
font-weight: 500;
}
.right-title {
font-size: 28rpx;
color: #007aff;
text-align: right;
font-weight: 500;
}
.top-box {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
height: 180rpx;
background: url('/static/imgs/mall/zsc-bg-icon.png') no-repeat;
background-size: 100%;
.image {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.right {
width: 140rpx;
}
.center {
position: relative;
left: -20rpx;
}
.title {
font-size: 34rpx;
color: #ffffff;
letter-spacing: 2rpx;
font-weight: 600;
margin-bottom: 12rpx;
}
.desc {
opacity: 0.75;
font-size: 28rpx;
color: #ffffff;
letter-spacing: 0;
font-weight: 500;
padding-right: 32rpx;
}
.cut {
display: flex;
align-items: center;
font-size: 24rpx;
color: #ffffff;
letter-spacing: 0;
text-align: center;
font-weight: 400;
.cut-icon {
width: 29.42rpx;
height: 26.67rpx;
margin-left: 10rpx;
}
}
.set {
opacity: 0.75;
font-size: 28rpx;
color: #ffffff;
letter-spacing: 0;
font-weight: 500;
position: relative;
top: 39rpx;
left: 60rpx;
}
}
.content {
background: #ffffff;
border-bottom: 2rpx solid #dddddd;
display: flex;
flex-direction: row;
padding: 24rpx 0rpx 24rpx 32rpx;
.image {
width: 100rpx;
height: 100rpx;
flex: 0 0 100rpx;
margin-right: 18rpx;
}
.title {
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
font-weight: 500;
.icon {
position: relative;
top: -22rpx;
width: 150rpx;
height: 50rpx;
}
}
.sub-title {
position: relative;
font-size: 28rpx;
color: #333333;
letter-spacing: 0;
font-weight: 400;
top: -4rpx;
}
.desc {
font-size: 28rpx;
color: #555555;
letter-spacing: 0;
font-weight: 400;
padding-top: 10rpx;
line-height: 1.4;
}
}
.other {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 80rpx;
background: #ffffff;
padding: 0rpx 32rpx;
.time {
font-size: 28rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
}
.btn {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
font-size: 28rpx;
color: #007aff;
letter-spacing: 0;
text-align: right;
font-weight: 400;
}
.divide {
width: 2rpx;
height: 32rpx;
background: #d8d8d8;
margin: 0 32rpx;
}
.icon {
width: 24rpx;
height: 24rpx;
margin-left: 6rpx;
}
}
.offer-prices {
position: absolute;
z-index: 9999;
right: 32rpx;
bottom: 122rpx;
background-color: #007aff;
border-radius: 50%;
padding: 10rpx;
text-align: center;
width: 110rpx;
height: 110rpx;
border: 2rpx solid #f9f9f9;
box-shadow: 0rpx 4rpx 34rpx 0rpx rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.my-image {
width: 100rpx;
height: 100rpx;
}
}
</style>

176
pages/order-detail/index.vue

@ -30,20 +30,22 @@
<text style="font-size: 30rpx; font-weight: 600; line-height: 1.2">
{{ `${order.brandName}${order.productName} | ${order.gramWeight}g | ${order.width}*${order.length} | ${order.pieceQuantity}` }}
</text>
<view v-if="steps[index].length > 0 && steps[index][0].desc == '未完成'" class="button-item" @click="operatePaper(index, 'cut')">分切</view>
<view
v-else-if="steps[index].length > 0 && steps[index][steps[index].length - 2].desc == '未完成'"
class="button-item"
@click="operatePaper(index, 'outbound')"
>
出库
</view>
<view
v-else-if="steps[index].length > 0 && steps[index][steps[index].length - 1].desc == '未完成'"
class="button-item"
@click="operatePaper(index, 'send')"
>
发货
<view v-if="orderInfo.status == supplierOrderStatusEnum.WAIT_DELIVERY">
<view v-if="steps[index].length > 0 && steps[index][0].desc == '未完成'" class="button-item" @click="operatePaper(index, 'cut')">分切</view>
<view
v-else-if="steps[index].length > 0 && steps[index][steps[index].length - 2].desc == '未完成'"
class="button-item"
@click="operatePaper(index, 'outbound', 1000)"
>
出库
</view>
<view
v-else-if="steps[index].length > 0 && steps[index][steps[index].length - 1].desc == '未完成'"
class="button-item"
@click="operatePaper(index, 'send')"
>
发货
</view>
</view>
</view>
<view class="order-row flex-row-center-space">
@ -66,7 +68,7 @@
<uni-steps
:options="steps[index]"
active-color="#1890FF"
:active="order.outboundProcessList.length > 0 ? order.outboundProcessList.length : -1"
:active="order.outboundProcessList.length > 0 ? order.outboundProcessList.length - 1 : -1"
></uni-steps>
</view>
</view>
@ -80,6 +82,10 @@
</view>
</view>
<view class="imgs flex-row-start-start">
<view class="default-upload" @click="uploadVoucher()">
<image src="/static/imgs/order/camera.png" class="icon"></image>
<text style="font-size: 26rpx; color: #4c4a58">上传凭证</text>
</view>
<image style="width: 120rpx; height: 120rpx; margin-right: 12rpx" src=""></image>
</view>
</view>
@ -129,17 +135,25 @@
<qn-footer fixed height="120rpx" v-if="orderInfo.status === supplierOrderStatusEnum.WAIT_DELIVERY">
<view class="flex-row-center-space" style="padding: 0 32rpx">
<view class="button button_cancel" style="width: 220rpx" @click="cancel">取消订单</view>
<view class="button button_contact">查看合同</view>
<view class="button button_confirm" style="width: 220rpx">确认发货</view>
<view class="button button_contact" @click="viewContract">查看合同</view>
<view class="button button_confirm" @click="delivery" style="width: 220rpx">确认发货</view>
</view>
</qn-footer>
</view>
</template>
<script>
import { go2, back } from '@/utils/hook.js'
import { getSupplierOrderDetail, cancelSupplierOrder, confirmSupplierOrder } from '@/apis/orderApi.js'
import { go2, back, uploadImage } from '@/utils/hook.js'
import {
getSupplierOrderDetail,
cancelSupplierOrder,
confirmSupplierOrder,
supplierOperatePaper,
supplierUploadVoucher,
supplierDelivery
} from '@/apis/orderApi.js'
import { supplierOrderStatusMap, supplierOrderStatusEnum } from '@/enums/index.js'
import { transformFileToImg } from '@/apis/commonApi.js'
export default {
data() {
return {
@ -319,14 +333,108 @@ export default {
if (res.confirm) {
confirmSupplierOrder({
orderId: order.orderId
}).then((res) => {
if (res) {
if (res) {
// #ifdef APP-PLUS
go2('page-view', { title: '供应商订单签约', url: encodeURIComponent(res.signUrl), params: this.params })
// #endif
// #ifdef H5
window ? (window.location.href = res.signUrl) : ''
// #endif
}
// uni.showToast({
// title: '',
// icon: 'success',
// success: () => {
// setTimeout(() => {
// this.init(order.orderId)
// }, 1000)
// }
// })
}
})
}
}
})
},
// cut: outbound: send:
operatePaper(index, type, quantity) {
const map = {
cut: 30301,
outbound: 30302,
send: 30303
}
let target = this.orderInfo.orderItems[index]
supplierOperatePaper({
quantity: quantity || target.pieceQuantity,
supplierOderItemId: target.supplierOderItemId,
status: map[type]
}).then((res) => {
if (res) {
uni.showToast({
title: '操作成功',
icon: 'success',
success: () => {
setTimeout(() => {
this.init(this.orderInfo.orderId)
}, 1000)
}
})
}
})
},
//
uploadVoucher() {
uploadImage(['album'], 5)
.then((urls) => {
if (urls) {
let promiseList = []
urls.forEach((url) => {
promiseList.push(
supplierUploadVoucher({
supplierOrderId: this.orderInfo.orderId,
proofDeliveryUrl: url
})
)
})
Promise.all(promiseList).then(() => {
uni.showToast({
title: '上传成功',
icon: 'success',
success: () => {
setTimeout(() => {
this.init(this.orderInfo.orderId)
}, 1000)
}
})
})
}
})
.catch((e) => {
uni.showToast({
title: '上传失败',
icon: 'fail'
})
})
},
//
delivery() {
uni.showModal({
title: '提示',
content: '确定确认送货吗?',
success: (res) => {
if (res.confirm) {
supplierDelivery({
supplierOrderId: this.orderInfo.orderId
}).then((res) => {
if (res) {
uni.showToast({
title: '确认订单成功',
title: '确认送货成功',
icon: 'success',
success: () => {
setTimeout(() => {
this.init(order.orderId)
this.init(this.orderInfo.orderId)
}, 1000)
}
})
@ -336,8 +444,15 @@ export default {
}
})
},
// cut: outbound: send:
operatePaper(index, type) {},
//
viewContract() {
let url = this.orderInfo.contractUrl
if (url) {
transformFileToImg({ fileUrl: url }).then((res) => {
uni.previewImage({ urls: [res.imgUrl], current: res.imgUrl })
})
}
},
clip(content) {
uni.setClipboardData({
data: content,
@ -460,4 +575,19 @@ export default {
color: #007aff;
margin: 0 14rpx;
}
.default-upload {
width: 120rpx;
height: 120rpx;
border-radius: 10rpx;
background-color: #dcdee0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.icon {
width: 56rpx;
height: 56rpx;
margin-bottom: 8rpx;
}
}
</style>

6
pages/page-view/index.vue

@ -37,7 +37,13 @@ export default {
})
},
methods: {
/**
* @param {Object} data {data:{},type:''}
*/
getMessage(data) {
if (data.type == 'zzgSupplierTCSignSuccess') {
go2('order-detail', { orderId: data.data.orderId }, true)
}
//
if (data.type == 'signSuccess') {
// go2('paper-mall-order-detail', { id: data.orderId }, true)

2
pages/trade/index.vue

@ -1,6 +1,6 @@
<template>
<view class="trade-index">
<uni-nav-bar>
<uni-nav-bar :fixed="true" color="#ffffff" background-color="#ffffff" :status-bar="true">
<view class="left-title">
<view v-if="mainKey === '0'" class="text-view"><text class="title">交易大厅</text></view>
<view v-if="mainKey === '1'">

4
static/icon/iconfont.css

@ -11,6 +11,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-Less:before {
content: "\e734";
}
.icon-m_dow_arrow:before {
content: "\e600";
}

BIN
static/icon/iconfont.ttf

BIN
static/imgs/order/camera.png

Before After
Width: 56  |  Height: 56  |  Size: 1.7 KiB

4
utils/hook.js

@ -100,7 +100,7 @@ export function exit() {
export function uploadImage(sourceType = ['album', 'camera'], count = 1) {
return new Promise((resolve, reject) => {
uni.chooseImage({
count: 1,
count: count,
sizeType: ['original', 'compressed'],
sourceType: sourceType,
success: (res) => {
@ -141,7 +141,7 @@ export function uploadFile(path, type = 'image') {
let result = JSON.parse(res.data)
if (result.data) {
resolve(result.data)
return result.data
return result.data
} else {
reject(result.message)
}

3
utils/http/http.js

@ -53,6 +53,9 @@ export default class Http {
method: conf.method,
success: (res) => {
let data = resInterceptor(res, opt)
if (env === 'test') {
console.log('报错的请求参数:', conf)
}
// 服务器错误也会用then抛出,需要自己判断data==null
resolve(data)
},

9
utils/http/index.js

@ -8,7 +8,8 @@ const xappid = '503258978847966403'
const prefixList = {
'/yyt-uec': `https://api-client-yyt${urlEnv}.qniao.cn`,
'/base-paper-trading': `https://api-client-yyt${urlEnv}.qniao.cn`,
'/uec': `https://api-client-uec${urlEnv}.qniao.cn`
'/uec': `https://api-client-uec${urlEnv}.qniao.cn`,
'/document': `https://api-ops-yyt${urlEnv}.qniao.cn`
}
const config = {
@ -87,12 +88,18 @@ const resInterceptor = (response, options) => {
title: res.message,
icon: 'none'
})
if (env === 'test') {
console.log('报错的返回信息:', response)
}
return null
}
} else {
uni.showToast({
title: '服务器错误,请联系客服'
})
if (env === 'test') {
console.log('服务器错误的返回信息:', response)
}
// 后期可以加记录
return null
}

14
utils/index.js

@ -50,16 +50,16 @@ export const makeSocket = async ({ pageInfo = '', retry = false }) => {
async function createSocket() {
let url = ''
// if (env == 'production') {
// url = 'wss://api-client-yyt.qniao.cn/qn-websocket-service/wechatwebsock?token='
// } else if (env == 'test') {
// url = 'wss://api-client-yyt-test.qniao.cn/qn-websocket-service/wechatwebsock?token='
// }
if (env == 'production') {
url = 'wss://api-client-yyt.qniao.cn/trading-center/wechatwebsock?token='
url = 'wss://api-client-yyt.qniao.cn/qn-websocket-service/wechatwebsock?token='
} else if (env == 'test') {
url = 'wss://api-client-yyt-test.qniao.cn/trading-center/wechatwebsock?token='
url = 'wss://api-client-yyt-test.qniao.cn/qn-websocket-service/wechatwebsock?token='
}
// if (env == 'production') {
// url = 'wss://api-client-yyt.qniao.cn/trading-center/wechatwebsock?token='
// } else if (env == 'test') {
// url = 'wss://api-client-yyt-test.qniao.cn/trading-center/wechatwebsock?token='
// }
const token = store.state.qnToken
const socketTask = await uni.connectSocket({
url: `${url}${token}`,

Loading…
Cancel
Save