Browse Source

对接登录

master
前端-胡立永 7 months ago
parent
commit
5636497a44
10 changed files with 327 additions and 143 deletions
  1. +25
    -18
      api/api.js
  2. +4
    -2
      components/base/centerList.vue
  3. +62
    -9
      pages/index/center2.vue
  4. +6
    -6
      pages/index/tradingPlatform.vue
  5. +78
    -9
      pages_order/auth/registerShop.vue
  6. +1
    -1
      pages_order/auth/selectionIdentity.vue
  7. +102
    -57
      pages_order/components/order/myOrderList.vue
  8. +41
    -34
      pages_order/order/myOrders.vue
  9. +3
    -6
      pages_order/order/offerOrBillLading.vue
  10. +5
    -1
      store/store.js

+ 25
- 18
api/api.js View File

@ -8,17 +8,17 @@ const config = {
// 示例
// wxLogin : {url : '/api/wxLogin', method : 'POST',
// auth : false, showLoading : true, loadingTitle : '加载中...',
// limit : 1000
// limit : 1500
// },
getConfig: {url: '/index/getSysText', method: 'POST', limit: 500},
getConfig: {url: '/index/getSysText', method: 'POST', limit: 1500},
// 微信登录接口
wxLogin: {
url: '/login/login',
method: 'POST',
limit: 500,
limit: 1500,
showLoading: true,
},
// 修改个人信息接口
@ -26,7 +26,7 @@ const config = {
url: '/info/updateInfo',
method: 'POST',
auth: true,
limit: 500,
limit: 1500,
showLoading: true,
},
//隐私政策
@ -45,35 +45,42 @@ const config = {
loginUser: {
url: '/alUser/login',
method: 'POST',
limit: 500,
limit: 1500,
showLoading: true,
},
//用户注册
registerUser: {
url: '/alUser/regUesr',
method: 'POST',
limit: 500,
limit: 1500,
showLoading: true,
},
// 发送短信接口
sendSms: {
url: '/alUser/sendSms',
method: 'POST',
limit: 500,
limit: 1500,
showLoading: true,
},
// 选择身份
roleOption: {
url: '/alUser/role',
method: 'POST',
limit : 1000,
limit : 1500,
showLoading: true,
},
// 修改身份信息
updateRoleInfo: {
url: '/alUser/updateRoleInfo',
method: 'POST',
limit : 1500,
showLoading: true,
},
// 忘记密码
newPassword: {
url: '/alUser/newPassword',
method: 'POST',
limit : 1000,
limit : 1500,
showLoading: true,
},
@ -82,28 +89,28 @@ const config = {
addCustoms: {
url: '/product/addCustoms',
method: 'POST',
limit : 1000,
limit : 1500,
showLoading: true,
},
// 产品报价
addProduct: {
url: '/product/addProduct',
method: 'POST',
limit: 500,
limit: 1500,
showLoading: true,
},
// 下订单
addProductOrder: {
url: '/product/addProductOrder',
method: 'POST',
limit: 500,
limit: 1500,
showLoading: true,
},
// 确认-取消订单
updateOrder: {
url: '/product/updateOrder',
method: 'POST',
limit: 500,
limit: 1500,
showLoading: true,
},
// 我的挂单列表
@ -115,7 +122,7 @@ const config = {
noShow: {
url: '/product/noShow',
method: 'GET',
limit: 500,
limit: 1500,
showLoading: true,
},
// 现货/期货列表
@ -133,21 +140,21 @@ const config = {
addAddress: {
url: '/address/add',
method: 'POST',
limit: 500,
limit: 1500,
showLoading: true,
},
// 用户地址表-编辑
editAddress: {
url: '/address/edit',
method: 'POST',
limit: 500,
limit: 1500,
showLoading: true,
},
// 用户地址表-删除
deleteAddress: {
url: '/address/edit',
method: 'POST',
limit: 500,
limit: 1500,
showLoading: true,
},
// 用户地址表-分页列表查询
@ -160,7 +167,7 @@ const config = {
addSuggest: {
url: '/index/addSuggest',
method: 'POST',
limit: 500,
limit: 1500,
showLoading: true,
},
// 铝价接口


+ 4
- 2
components/base/centerList.vue View File

@ -1,9 +1,11 @@
<template>
<view class="content">
<view class="item" v-for="(item, index) in list" :key="index" @click="tapItem(item, index)">
<view class="item"
v-for="(item, index) in list"
:key="index" @click="tapItem(item, index)">
<view class="key">
<view class="img">
<img :src="item.imgUrl" style="width: 100%; height: 100%;" />
<image :src="item.imgUrl" style="width: 100%; height: 100%;" />
</view>
<view class="text">
{{ item.text }}


+ 62
- 9
pages/index/center2.vue View File

@ -10,9 +10,25 @@
<view class="headImage">
<image src="1" mode=""></image>
</view>
<view class="info">
<view class="name">
{{userInfo.nickName}}
<view class="info"
@click="toUpdateInfo">
<view class="name"
v-if="userShop">
供应商{{shopData.companyName}}
<uv-icon
name="edit-pen"
color="#fff"
size="30"></uv-icon>
</view>
<view class="name"
v-else>
采购商{{buy.companyName}}
<uv-icon
name="edit-pen"
color="#fff"
size="30"></uv-icon>
</view>
<view class="tips">
{{ $t('components.phoneNumber') }} {{userInfo.phone}}
@ -42,6 +58,12 @@
<!-- 联系客服弹框 -->
<customerServicePopup ref="customerServicePopup" />
<uv-action-sheet
ref="actionSheet"
:actions="actionSheetList"
@select="actionSheetSelect">
</uv-action-sheet>
<configPopup ref="popup"></configPopup>
<tabber select="3" />
@ -53,7 +75,8 @@
import centerList from "@/components/base/centerList.vue";
import customerServicePopup from "@/components/config/customerServicePopup.vue";
import {
mapGetters
mapGetters,
mapState
} from 'vuex'
export default {
@ -65,7 +88,8 @@
centerList
},
computed: {
...mapGetters(['userShop', "userInfo"]),
...mapGetters(['userShop']),
...mapState(["userInfo", 'shopData', 'buy']),
},
data() {
return {
@ -140,15 +164,42 @@
value: ">",
imgUrl: '/static/image/center/13.svg'
},
]
],
actionSheetList: [
{
name : '修改供应商信息',
key : 'shopData',
},
{
name : '修改采购商信息',
key : 'buy',
},
],
}
},
methods: {
openCustomerServicePopup() {
console.log("打开客服弹框")
this.$refs.customerServicePopup.open();
}
},
toUpdateInfo(){
if(this.buy && this.shopData){
this.$refs.actionSheet.open()
}else if(this.buy){
uni.navigateTo({
url: '/pages_order/auth/registerShop?key=buy'
})
}else if(this.shopData){
uni.navigateTo({
url: '/pages_order/auth/registerShop?key=shopData'
})
}
},
actionSheetSelect(e){
uni.navigateTo({
url: '/pages_order/auth/registerShop?key=' + e.key
})
},
},
}
</script>
@ -197,7 +248,9 @@
}
.name {
font-size: 32rpx;
font-size: 26rpx;
display: flex;
align-items: center;
}
.tips {


+ 6
- 6
pages/index/tradingPlatform.vue View File

@ -16,10 +16,10 @@
<view v-if="userShop" class="supplier">
<view class="purchaser-title" style="">
<!-- <span class="active"> {{ $t('other.orderList') }}</span> -->
<span class="active"> {{ $t('other.orderList') }}</span>
<span v-for="(item, index) in type" :class="actionIndex == index ? 'active' : 'noactive'"
@click="actionIndexChange(index)">{{ item.name }}</span>
<!-- <span v-for="(item, index) in type" :class="actionIndex == index ? 'active' : 'noactive'"
@click="actionIndexChange(index)">{{ item.name }}</span> -->
</view>
<view class="supplierList">
@ -96,11 +96,11 @@
},
onLoad() {
if (this.userShop) {
// /
this.mixinsListApi = 'productList'
} else {
//
this.mixinsListApi = 'productlist'
} else {
// /
this.mixinsListApi = 'productList'
}
this.queryParams.productType = this.actionIndex
},


+ 78
- 9
pages_order/auth/registerShop.vue View File

@ -1,7 +1,17 @@
<template>
<view class="registerShop">
<navbar :title="titleList[titleIndex]" leftClick @leftClick="$utils.navigateBack" />
<navbar
v-if="key"
:title="titleUpdateList[titleIndex]"
leftClick
@leftClick="$utils.navigateBack" />
<navbar
v-else
:title="titleList[titleIndex]"
leftClick
@leftClick="$utils.navigateBack" />
<view class="frame">
<!--基本信息-->
@ -114,8 +124,15 @@
</view>
</view>
<view class="uni-color-btn"
@click="showModel"
v-if="key">
确认修改
</view>
<view class="bottom">
<view class="bottom"
v-else>
<view class="btns">
<!--申请审核-->
<span @click="applyReview" class="sqsh">
@ -147,14 +164,40 @@
<script>
import customerServicePopup from "@/components/config/customerServicePopup.vue";
import { mapState } from 'vuex'
export default {
components: {
customerServicePopup
},
onLoad(option) {
this.titleIndex = option.identity
this.form.role = option.identity
if(option.key){
this.key = option.key
this.form = this[option.key]
this.titleIndex = ['buy', 'shopData'].indexOf(option.key)
this.yyzzfileList = this.form.businessLicense.split(',').map(url => {
return {
url
}
})
this.jbhxxfileList = this.form.basicAccount.split(',').map(url => {
return {
url
}
})
this.skyhfileList = this.form.bankInfo.split(',').map(url => {
return {
url
}
})
}else{
this.titleIndex = option.identity
this.form.role = option.identity
}
},
computed : {
...mapState(['buy', 'shopData']),
},
data() {
return {
@ -165,6 +208,11 @@
this.$t('other.supplierRegistration'),
this.$t('other.domesticCustomsClearanceApplication')
],
titleUpdateList: [
//
'修改采购商信息',
'修改供应商信息',
],
form: {
"address": "",
"auditStatus": 0,
@ -183,9 +231,19 @@
yyzzfileList: [],//
jbhxxfileList: [],//
skyhfileList: [],//
key : '',
}
},
methods: {
showModel(){
uni.showModal({
title: '确认修改吗?',
content: '修改后该身份将需要重新审核!',
success: (res) => {
this.applyReview()
}
})
},
//
applyReview() {
@ -219,10 +277,14 @@
})
}
let api = this.titleIndex == 2 ? 'addCustoms' : 'roleOption'
this.$api(this.titleIndex == 2 ?
'addCustoms'
: 'roleOption', data, res => {
if(this.key){
api = 'updateRoleInfo'
}
this.$api(api, data, res => {
if (res.code == 200) {
// uni.removeStorageSync('token')
// this.$store.state.userInfo = {}
@ -235,7 +297,14 @@
icon: 'none'
})
setTimeout(uni.navigateBack, 1000, -1)
if(this.key){
setTimeout(uni.reLaunch, 1000, {
url: '/pages_order/auth/selectionIdentity'
})
}else{
setTimeout(uni.navigateBack, 1000, -1)
}
}
})
},


+ 1
- 1
pages_order/auth/selectionIdentity.vue View File

@ -54,7 +54,7 @@
computed: {
...mapGetters(['userShop', "userInfo"]),
},
onShow() {
onLoad() {
this.$store.commit('getUserInfo')
},
methods: {


+ 102
- 57
pages_order/components/order/myOrderList.vue View File

@ -1,42 +1,55 @@
<template>
<view class="page">
<view v-for="(item, index) in list" v-if="list.length>0" :key="index" class="content"
@click="lookDetail(item, index)">
<view class="left">
<image :src="item.pic" mode="aspectFill"></image>
</view>
<view class="right">
<view class="text-hidden-1">
订单状态{{ orderStatusText(item.orderFlag) }}
</view>
<view class="text-hidden-1">
公司名称{{ item.companyName }}
</view>
<view class="text-hidden-1">
单价{{ item.price }}
</view>
<view class="text-hidden-1">
购买数量{{ item.num }}
<view v-for="(item, index) in list"
v-if="list.length>0"
:key="index"
class="content"
@click="lookDetail(item, index)">
<view class="box-flex">
<view class="left">
<image :src="item.pic" mode="aspectFill"/>
</view>
<view class="text-hidden-1">
规格{{ item.specsName }}
</view>
<view class="text-hidden-1">
提货地址{{ item.address }}
<view class="right">
<view class="text-hidden-1">
订单状态{{ orderStatusText(item.orderFlag) }}
</view>
<view class="text-hidden-1">
公司名称{{ item.companyName }}
</view>
<view class="text-hidden-1">
单价{{ item.price }}
</view>
<view class="text-hidden-1">
购买数量{{ item.num }}
</view>
<view class="text-hidden-1">
规格{{ item.specsName }}
</view>
<view class="text-hidden-1">
提货地址{{ item.address }}
</view>
<!--<view class="text-hidden-1">-->
<!-- 定金{{ item.deposit }}-->
<!--</view>-->
<view class="text-hidden-1">
提货时间{{ item.takeTime }}
</view>
<!--审核状态 0审核中 1 审核通过 2审核未通过-->
<!--<view class="text-hidden-1">-->
<!-- 审核状态{{ item.auditStatus == 0? '审核中' : (item.auditStatus == 1? '审核通过' : '审核未通过') }}-->
<!--</view>-->
</view>
<!--<view class="text-hidden-1">-->
<!-- 定金{{ item.deposit }}-->
<!--</view>-->
<view class="text-hidden-1">
提货时间{{ item.takeTime }}
</view>
<view class="bottom">
<view class="uni-color-btn"
v-if="item.orderFlag == 0"
@click.stop="closeOrder(item.id)">
取消订单
</view>
<!--审核状态 0审核中 1 审核通过 2审核未通过-->
<!--<view class="text-hidden-1">-->
<!-- 审核状态{{ item.auditStatus == 0? '审核中' : (item.auditStatus == 1? '审核通过' : '审核未通过') }}-->
<!--</view>-->
</view>
</view>
@ -85,7 +98,29 @@
url: `/pages_order/order/myOrderDetail`
});
},
//
closeOrder(orderId){
let self = this
uni.showModal({
title: '确认取消订单吗?',
success(e) {
if (e.confirm) {
self.$api('updateOrder', {
orderId,
type : 1
}, res => {
if (res.code == 200) {
uni.showToast({
title: '取消成功',
icon: 'none'
})
self.$emit("getData")
}
})
}
}
})
},
}
}
@ -97,37 +132,47 @@
display: flex;
flex-direction: column;
gap: 20rpx;
height: calc(90vh - 180rpx);
.content {
display: flex;
margin: 10rpx 0;
.left {
width: 200rpx;
height: 100%;
//height: 130rpx;
border-radius: 10rpx;
image {
//width: 130rpx;
//height: 130rpx;
width: 100%;
.box-flex{
display: flex;
height: calc(100% - 80px);
.left {
width: 200rpx;
height: 100%;
height: 100%;
border-radius: 10rpx;
image {
width: 100%;
height: 100%;
border-radius: 10rpx;
}
}
}
.right {
width: calc(100% - 160rpx);
color: #777;
font-size: 24rpx;
padding-left: 20rpx;
line-height: 40rpx;
background-color: #F8F8F8;
.right {
width: calc(100% - 160rpx);
color: #777;
font-size: 24rpx;
padding-left: 20rpx;
line-height: 40rpx;
background-color: #F8F8F8;
}
}
.bottom{
display: flex;
justify-content: flex-end;
gap: 20rpx;
&>view{
width: fit-content;
font-size: 24rpx;
padding: 10rpx 30rpx;
}
}
}
}

+ 41
- 34
pages_order/order/myOrders.vue View File

@ -1,49 +1,56 @@
<template>
<!--我的订单-->
<view class="page">
<!--我的订单-->
<view class="page">
<navbar :title="$t('other.Myorder')" leftClick @leftClick="$utils.navigateBack"/>
<navbar :title="$t('other.Myorder')" leftClick @leftClick="$utils.navigateBack" />
<view class="frame">
<view class="content">
<myOrderList :list="list"></myOrderList>
</view>
</view>
<view class="frame">
<view class="content">
<myOrderList
:list="list"
@getData="getData"
></myOrderList>
</view>
</view>
</view>
</view>
</template>
<script>
import myOrderList from "../components/order/myOrderList.vue";
import topbar from "@/components/base/topbar.vue";
import tabber from "@/components/base/tabbar.vue";
import mixinsList from '@/mixins/list.js'
export default {
name: "pendingOrder",
components: {tabber, topbar, myOrderList},
mixins: [mixinsList],
data() {
return {
mixinsListApi: 'myOrderlist',
}
},
methods: {},
}
import myOrderList from "../components/order/myOrderList.vue";
import topbar from "@/components/base/topbar.vue";
import tabber from "@/components/base/tabbar.vue";
import mixinsList from '@/mixins/list.js'
export default {
name: "pendingOrder",
components: {
tabber,
topbar,
myOrderList
},
mixins: [mixinsList],
data() {
return {
mixinsListApi: 'myOrderlist',
}
},
methods: {},
}
</script>
<style lang="scss" scoped>
.page {
.page {
.frame {
padding: 30rpx;
background-color: #f5f5f5;
.frame {
padding: 30rpx;
background-color: #f5f5f5;
.content {
//height: calc(100vh - 120rpx);
.content {
//height: calc(100vh - 120rpx);
}
}
}
}
}
}
</style>

+ 3
- 6
pages_order/order/offerOrBillLading.vue View File

@ -86,7 +86,7 @@
<view class="address" style="width: 70%">
<image mode="" src="/static/image/address/selectIcon.png"></image>
<view class="">
{{ address.name }}
{{ address.name + '' + address.phone }}
</view>
<view class="icon">
<uv-icon name="arrow-right" size="30rpx"></uv-icon>
@ -110,17 +110,14 @@
<!--</view>-->
<!--详细地址-->
<view v-if="address.addressDetail" class="item">
<!-- <view v-if="address.addressDetail" class="item">
<view>{{ $t('components.detailedAddress') }}</view>
<view>
<view class="">
{{ address.address + ' ' + address.addressDetail }}
<!--</view>-->
<!--<view class="">-->
<!-- {{ address.addressDetail }}-->
</view>
</view>
</view>
</view> -->
<view class="item"
@click="$refs.startDateRef.open()">


+ 5
- 1
store/store.js View File

@ -94,7 +94,11 @@ const store = new Vuex.Store({
state.pic = res.result.pic
// 如果什么身份都没有,就去注册
if(!state.shopData && !state.buy){
if(!state.shopData && !state.buy &&
![
'/pages_order/auth/selectionIdentity',
'/pages_order/auth/registerShop',
].includes(this.$route.path)){
uni.reLaunch({
url: '/pages_order/auth/selectionIdentity?back=no&'
})


Loading…
Cancel
Save