Browse Source

对接登录

master
前端-胡立永 8 months ago
parent
commit
b9ab06a841
21 changed files with 1029 additions and 964 deletions
  1. +2
    -2
      App.vue
  2. +1
    -1
      api/api.js
  3. +87
    -87
      components/base/centerList.vue
  4. +1
    -1
      components/base/tabbar.vue
  5. +1
    -2
      components/config/configPopup.vue
  6. +7
    -5
      components/config/customerServicePopup.vue
  7. +1
    -1
      config.js
  8. +6
    -2
      pages/index/center2.vue
  9. +7
    -7
      pages/index/index.vue
  10. +11
    -9
      pages/index/tradingPlatform.vue
  11. +9
    -9
      pages_order/auth/customsClearApply.vue
  12. +2
    -2
      pages_order/auth/loginAndRegisterAndForgetPassword.vue
  13. +20
    -5
      pages_order/auth/registerShop.vue
  14. +37
    -3
      pages_order/auth/selectionIdentity.vue
  15. +197
    -200
      pages_order/center/addressListManage.vue
  16. +224
    -225
      pages_order/components/address/addressList.vue
  17. +215
    -215
      pages_order/components/address/redactAddress.vue
  18. +1
    -1
      pages_order/mine/address.vue
  19. +9
    -3
      pages_order/tradingPlatform/confirmOrder.vue
  20. +173
    -170
      pages_order/tradingPlatform/nowOrder.vue
  21. +18
    -14
      store/store.js

+ 2
- 2
App.vue View File

@ -1,10 +1,10 @@
<script>
export default {
onLaunch: function() {
this.$store.commit('getUserInfo')
},
onShow: function() {
// this.$store.commit('initConfig')
this.$store.commit('getUserInfo')
this.$store.commit('initConfig')
},
onHide: function() {
}


+ 1
- 1
api/api.js View File

@ -11,7 +11,7 @@ const config = {
// limit : 1000
// },
getConfig: {url: '/api/getConfig', method: 'GET', limit: 500},
getConfig: {url: '/index/getSysText', method: 'POST', limit: 500},
// 微信登录接口


+ 87
- 87
components/base/centerList.vue View File

@ -1,96 +1,96 @@
<template>
<view class="content">
<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%;"/>
</view>
<view class="text">
{{ item.text }}
</view>
</view>
<view class="value">
{{ item.value }}
</view>
</view>
</view>
<view class="content">
<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%;" />
</view>
<view class="text">
{{ item.text }}
</view>
</view>
<view class="value">
{{ item.value }}
</view>
</view>
</view>
</template>
<script>
export default {
name: "centerList",
props: {
list: {}
},
data() {
return {
}
},
methods: {
//
tapItem(item, index) {
console.log(item, index, "item,index==========")
if (item.text === '联系客服' || item.englishText === 'contactCustomerService') {
console.log("联系客服")
this.$emit('open')
} else if (
item.text === '我的挂单' || item.englishText === 'myOrders' ||
item.text === '系统设置' || item.englishText === 'systemSettings' ||
item.text === '关于我们' || item.englishText === 'aboutUs' ||
item.text === '帮助反馈' || item.englishText === 'helpFeedback' ||
item.text === '我的订单' || item.englishText === 'Myorder'
) {
console.log("进入 " + item.text)
uni.navigateTo({
url: item.toPathUrl
})
}
}
,
},
}
export default {
name: "centerList",
props: {
list: {}
},
data() {
return {
}
},
methods: {
//
tapItem(item, index) {
console.log(item, index, "item,index==========")
if(item.text === '关于我们'){
this.$emit('about')
}else if (item.text === '联系客服' || item.englishText === 'contactCustomerService') {
console.log("联系客服")
this.$emit('open')
} else if (
item.text === '我的挂单' || item.englishText === 'myOrders' ||
item.text === '系统设置' || item.englishText === 'systemSettings' ||
item.text === '帮助反馈' || item.englishText === 'helpFeedback' ||
item.text === '我的订单' || item.englishText === 'Myorder'
) {
console.log("进入 " + item.text)
uni.navigateTo({
url: item.toPathUrl
})
}
},
},
}
</script>
<style scoped lang="scss">
.content {
background-color: #2e2e2e;
.item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 40rpx;
.key {
display: flex;
justify-content: center;
align-items: center;
color: #FFF;
font-size: 32rpx;
.img {
width: 40rpx;
height: 40rpx;
}
.text {
margin-left: 20rpx;
}
}
.value {
color: #FFF;
font-size: 36rpx;
}
}
}
.content {
background-color: #2e2e2e;
.item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 40rpx;
.key {
display: flex;
justify-content: center;
align-items: center;
color: #FFF;
font-size: 32rpx;
.img {
width: 40rpx;
height: 40rpx;
}
.text {
margin-left: 20rpx;
}
}
.value {
color: #FFF;
font-size: 36rpx;
}
}
}
</style>

+ 1
- 1
components/base/tabbar.vue View File

@ -89,7 +89,7 @@
flex-direction: row;
height: 120rpx;
padding-bottom: env(safe-area-inset-bottom);
z-index: 99999;
z-index: 99;
bottom: 0;
left: 0;
color: #FFF;


+ 1
- 2
components/config/configPopup.vue View File

@ -23,11 +23,10 @@
//
open(key){
this.content = this.configList[key]
this.content = this.configList[key] && this.configList[key].value
this.$refs.popup.open('bottom');
}
},
computed : {


+ 7
- 5
components/config/customerServicePopup.vue View File

@ -21,6 +21,9 @@
</template>
<script>
import {
mapState
} from 'vuex'
export default {
data() {
return {
@ -28,7 +31,6 @@
phone:'',
}
},
computed: {
customStyle1() {
return {
@ -58,10 +60,11 @@
'border-bottom-right-radius': '40rpx',
'width': '150rpx',
}
}
},
...mapState(['customerPhone']),
},
mounted() {
this.getCustomPhone()
// this.getCustomPhone()
},
methods: {
getCustomPhone(){
@ -79,13 +82,12 @@
//
confirm() {
this.show = false
let phone = this.phone; //
// console.log('', phone)
const res = uni.getSystemInfoSync();
// ios
if (res.platform == 'ios') {
uni.makePhoneCall({
phoneNumber: phone,
phoneNumber: this.customerPhone,
success() {
console.log('ios拨打成功');
},


+ 1
- 1
config.js View File

@ -13,7 +13,7 @@ const type = 'prod'
// 环境配置
const config = {
dev : {
baseUrl : 'http://www.gcosc.fun:82',
baseUrl : 'http://3fl8266127.qicp.vip/aluminium-prod',
},
prod : {
baseUrl : 'https://aluminium-prod.hhlm1688.com/aluminium-prod',


+ 6
- 2
pages/index/center2.vue View File

@ -28,19 +28,23 @@
<!-- 供应商 -->
<view class="supplier" v-if="userShop">
<centerList :list="supplierList" @open="openCustomerServicePopup"></centerList>
<centerList :list="supplierList"
@open="openCustomerServicePopup"
@about="$refs.popup.open('gywm')"></centerList>
</view>
<!-- 采购商 -->
<view class="purchaser" v-else>
<centerList :list="purchaserList" @open="openCustomerServicePopup"></centerList>
<centerList :list="purchaserList" @open="openCustomerServicePopup"
@about="$refs.popup.open('gywm')"></centerList>
</view>
</view>
<!-- 联系客服弹框 -->
<customerServicePopup ref="customerServicePopup" />
<configPopup ref="popup"></configPopup>
<tabber select="3"/>
</view>
</template>


+ 7
- 7
pages/index/index.vue View File

@ -110,14 +110,14 @@
.supplier {
display: flex;
flex-direction: column;
height: calc(100vh - 120rpx - 120rpx);
// height: calc(100vh - 120rpx - 120rpx);
background-color: #2e394d;
.topItem {
display: flex;
justify-content: center;
align-items: center;
height: 30%;
// height: 30%;
background-size: cover;
.imageFrame {
@ -133,13 +133,13 @@
padding: 20rpx 40rpx 10rpx;
flex-direction: column;
height: 60%;
// height: 60%;
.oneItem {
display: flex;
height: 33%;
// height: 33%;
.left {
display: flex;
@ -175,7 +175,7 @@
display: flex;
justify-content: space-between;
gap: 20rpx;
height: 33%;
// height: 33%;
margin-top: 20rpx;
padding: 10rpx;
@ -195,7 +195,7 @@
.threeItem {
display: flex;
//width: 100vw;
height: 33%;
// height: 33%;
.left {
@ -288,7 +288,7 @@
.imageFrame {
width: 90%;
height: 90%;
// height: 90%;
//padding:80rpx;
}
}


+ 11
- 9
pages/index/tradingPlatform.vue View File

@ -66,7 +66,8 @@
return {
actionIndex: 0,
mixinsListApi: 'getMyProductlist',
type: [{
type: [
{
name: this.$t('other.spotTrading')
},
{
@ -97,8 +98,8 @@
} else {
//
this.mixinsListApi = 'productlist'
this.queryParams.productType = this.actionIndex
}
this.queryParams.productType = this.actionIndex
},
mounted() {
// this.getAlPrice()
@ -230,22 +231,23 @@
<style scoped lang="scss">
.trading-platform {
background-image: url('../../static/image/index/1.png');
padding-bottom: 100rpx;
.frame {
display: flex;
flex-direction: column;
justify-content: center;
height: calc(100vh - 120rpx - 120rpx);
// height: calc(100vh - 120rpx - 120rpx);
.chart {
height: 300px !important;
// height: 300px !important;
background-color: #1B263B;
/* 背景颜色 */
}
.supplier {
height: 70%;
// height: 70%;
padding: 20rpx 20rpx;
background-image: url('../../static/image/index/1.png');
color: #FFF;
@ -253,12 +255,12 @@
.supplierList {
margin-top: 20rpx;
height: 92%;
// height: 92%;
overflow: auto;
}
.purchaser-title {
height: 8%;
// height: 8%;
.active {
text-decoration: underline;
@ -279,7 +281,7 @@
}
.purchaser {
height: 60%;
// height: 60%;
padding: 20rpx 0;
color: #FFF;
font-size: 32rpx;
@ -306,7 +308,7 @@
.productList {
margin-top: 20rpx;
height: 60vh;
// height: 60vh;
overflow: auto;
}
}


+ 9
- 9
pages_order/auth/customsClearApply.vue View File

@ -25,7 +25,7 @@
<view class="item">
<view>{{ $t('other.companyName') }}</view>
<view>
<input v-model="form.companyName" :placeholder="$t('other.enterCompanyName')"
<input v-model="form.companyName" :placeholder="$t('other.enterCompanyName')"
clearable></input>
</view>
</view>
@ -117,20 +117,24 @@
<span @click="applyReview" class="sqsh">
{{ $t('components.submitReview') }}
</span>
<span @click="contactUs" class="lxwm">
<span @click="$refs.customerServicePopup.open()" class="lxwm">
{{ $t('components.contactUs') }}
</span>
</view>
<view class="others">
<span @click="applyReview" class="zcxz">
<span @click="$refs.popup.open('zcxz')" class="zcxz">
{{ $t('components.registrationNotice') }}
</span>
<span @click="contactUs" class="kjhtyl">
<span @click="$refs.popup.open('kjht')" class="kjhtyl">
{{ $t('other.frameworkContractPreview') }}
</span>
</view>
</view>
<!-- 联系客服弹框 -->
<customerServicePopup ref="customerServicePopup" />
<configPopup ref="popup"></configPopup>
</view>
</template>
@ -184,11 +188,6 @@
}
})
},
//
contactUs() {
},
//
afterRead(type, e) {
@ -355,6 +354,7 @@
}
.others {
margin: 20rpx 0;
display: flex;
justify-content: center;
align-items: center;


+ 2
- 2
pages_order/auth/loginAndRegisterAndForgetPassword.vue View File

@ -83,9 +83,9 @@
<view style="display: flex;">
<uv-checkbox size="30rpx" :name="1"></uv-checkbox>
请你阅读并同意我们的<span style="color: #fd5100"
@click="$refs.popup.open('getPrivacyPolicy')">隐私条款</span><span
@click="$refs.popup.open('yszc')">隐私条款</span><span
style="color: #fd5100"
@click="$refs.popup.open('getUserAgreement')">服务协议</span>
@click="$refs.popup.open('fwxy')">服务协议</span>
</view>
</view>
</uv-checkbox-group>


+ 20
- 5
pages_order/auth/registerShop.vue View File

@ -27,7 +27,7 @@
<view class="item">
<view>{{ $t('other.companyName')}}</view>
<view>
<input v-model="form.companyName" type="number" :placeholder="$t('other.enterCompanyName')"
<input v-model="form.companyName" :placeholder="$t('other.enterCompanyName')"
clearable></input>
</view>
</view>
@ -128,11 +128,11 @@
</view>
<view class="others">
<!--注册须知-->
<span @click="applyReview" class="zcxz">
<span @click="$refs.popup.open('zcxz')" class="zcxz">
{{ $t('components.registrationNotice') }}
</span>
<!--框架合同预览-->
<span @click="contactUs" class="kjhtyl">
<span @click="$refs.popup.open('kjht')" class="kjhtyl">
{{ $t('other.frameworkContractPreview') }}
</span>
</view>
@ -140,6 +140,7 @@
<!-- 联系客服弹框 -->
<customerServicePopup ref="customerServicePopup" />
<configPopup ref="popup"></configPopup>
</view>
</template>
@ -210,12 +211,22 @@
return
}
if (!this.$utils.verificationPhone(this.form.userName)) {
return uni.showToast({
title: '请输入合法的手机号',
icon: 'none'
})
}
this.$api(this.titleIndex == 2 ?
'addCustoms'
: 'roleOption', this.form, res => {
if (res.code == 200) {
uni.removeStorageSync('token')
this.$store.state.userInfo = {}
// uni.removeStorageSync('token')
// this.$store.state.userInfo = {}
this.form = {}
// uni.redirectTo({
// url: '/pages/index/index'
// })
@ -223,6 +234,8 @@
title: '提交成功!耐心等待审核',
icon: 'none'
})
setTimeout(uni.navigateBack, 1000, -1)
}
})
},
@ -272,6 +285,7 @@
<style scoped lang="scss">
.registerShop {
padding-bottom: 300rpx;
.frame {
min-height: 100vh;
overflow: auto;
@ -398,6 +412,7 @@
}
.others {
margin: 20rpx 0;
display: flex;
justify-content: center;
align-items: center;


+ 37
- 3
pages_order/auth/selectionIdentity.vue View File

@ -9,20 +9,37 @@
<view class="title">{{ $t('components.selectIdentity') }}</view>
<view class="button-group">
<!--供应商-->
<view class="identity-button" @click="selectIdentity(0)">
<view :class="{'identity-button' : true, act : !!$store.state.buy}" @click="selectIdentity(0)">
<view class="identity-text"> {{ $t('other.iAmBuyer') }}</view>
<view class="identity-icon">
<img src="../../static/image/index/5.png" style="width: 100%; height: 100%;">
</view>
</view>
<!--采购-->
<view class="identity-button" @click="selectIdentity(1)">
<view :class="{'identity-button' : true, act : !!$store.state.shopData}" @click="selectIdentity(1)">
<view class="identity-text"> {{ $t('other.iAmSupplier') }}</view>
<view class="identity-icon">
<img src="../../static/image/index/6.png" style="width: 100%; height: 100%;">
</view>
</view>
</view>
<view style="margin-top: 100rpx;
text-decoration: underline;color: blue;
display: flex;
gap: 100rpx;">
<view style=""
@click="refus">
刷新身份信息
</view>
<view style=""
@click="$store.commit('logout')">
退出登录
</view>
</view>
</view>
</view>
@ -37,6 +54,9 @@
computed: {
...mapGetters(['userShop', "userInfo"]),
},
onShow() {
this.$store.commit('getUserInfo')
},
methods: {
selectIdentity(identity) {
// if (userInfo)
@ -56,6 +76,17 @@
})
}
},
refus(){
this.$store.commit('getUserInfo')
uni.showLoading()
setTimeout(() => {
uni.showToast({
title: '刷新成功',
icon: 'none'
})
uni.hideLoading()
}, 500)
},
}
}
</script>
@ -95,7 +126,7 @@
width: 80%;
margin-bottom: 40rpx;
padding: 40rpx 50rpx;
background-color: #2d2f59;
background-color: #2d2f5997;
border-radius: 20rpx;
color: white;
@ -108,6 +139,9 @@
height: 130rpx;
}
}
.act{
background-color: #2d2f59;
}
}
}
</style>

+ 197
- 200
pages_order/center/addressListManage.vue View File

@ -1,214 +1,211 @@
<template>
<view class="address">
<view class="address">
<navbar title="地址管理" leftClick @leftClick="leftClick" />
<navbar title="地址管理" leftClick @leftClick="leftClick" />
<view class="address-list">
<addressList
controls
ref="addressList"
@deleteAddress="deleteAddress"
@editAddress="editAddress"
@editDefault="editDefault"/>
</view>
<view class="address-list">
<addressList controls ref="addressList" @deleteAddress="deleteAddress" @editAddress="editAddress"
@editDefault="editDefault" />
</view>
<redactAddress
ref="addressPopup"
:addressDetail="addressDetail"
@saveOrUpdate="saveOrUpdate"
:title="title"></redactAddress>
<redactAddress ref="addressPopup" @saveOrUpdate="saveOrUpdate" :title="title">
</redactAddress>
<view class="add-btn">
<view @click="addBtn" class="btn">
新增地址
</view>
</view>
</view>
<view class="add-btn">
<view @click="addBtn" class="btn">
新增地址
</view>
</view>
</view>
</template>
<script>
import redactAddress from '../components/address/redactAddress.vue'
import addressList from '../components/address/addressList.vue'
export default {
components: {
redactAddress,
addressList
},
data() {
return {
title: '新增地址',
type : '',
}
},
onLoad(args) {
this.type = args.type
if(this.type == 'back'){
this.addBtn()
}
},
mounted() {
this.getAddressList()
},
methods: {
//
getAddressList() {
this.$refs.addressList.getAddressList()
},
//
editAddress(address) {
this.$refs.addressPopup.open({...address})
},
//
leftClick() {
uni.navigateBack(-1)
},
//
saveOrUpdate(addressDetail) {
let data = {
name: addressDetail.name,
phone: addressDetail.phone,
address: addressDetail.address,
addressDetail: addressDetail.addressDetail,
// defaultId: addressDetail.defaultId || '0',
latitude: addressDetail.latitude,
longitude: addressDetail.longitude
}
console.log(addressDetail.id,"addressDetail.id")
if (addressDetail.id) {
data.id = addressDetail.id
}
this.$api(data.id ? 'editAddress' : 'addAddress', data, res => {
if (res.code == 200) {
this.$refs.addressPopup.close()
this.getAddressList()
if(this.type == 'back'){
uni.navigateBack(-1)
}
uni.showToast({
title: '操作成功',
icon: 'none'
})
}
})
},
//
editDefault(id) {
this.$api('editAddress', {
id: id,
defaultFlag: 1
}, res => {
if (res.code == 200) {
this.$refs.addressPopup.close()
uni.showToast({
title: '操作成功',
icon: 'none'
})
this.getAddressList()
}
})
},
//
deleteAddress(id) {
let self = this
uni.showModal({
title: this.$t('components.deleteAddress'),
content: this.$t('components.confirmDeleteAddress'),
success(e) {
if(e.confirm){
self.$api('editAddress', {id: id, isDisable: 1, defaultFla: 0}, res => {
if (res.code == 200) {
uni.showToast({
title: this.$t('components.deleteSuccessful'),
icon: 'none'
})
self.getAddressList()
}
})
}
}
})
},
//
addBtn() {
this.title = '新增地址'
this.$refs.addressPopup.open({ //
name: '',
phone: '',
address: '',
addressDetail: '',
defaultId: '',
latitude: '',
longitude: ''
})
},
}
}
import redactAddress from '../components/address/redactAddress.vue'
import addressList from '../components/address/addressList.vue'
export default {
components: {
redactAddress,
addressList
},
data() {
return {
title: '新增地址',
type: '',
}
},
onLoad(args) {
this.type = args.type
if (this.type == 'back') {
this.addBtn()
}
},
mounted() {
this.getAddressList()
},
methods: {
//
getAddressList() {
this.$refs.addressList.getAddressList()
},
//
editAddress(address) {
this.$refs.addressPopup.open({
...address
})
},
//
leftClick() {
uni.navigateBack(-1)
},
//
saveOrUpdate(addressDetail) {
let data = {
name: addressDetail.name,
phone: addressDetail.phone,
address: addressDetail.address,
addressDetail: addressDetail.addressDetail,
defaultFlag: addressDetail.defaultFlag || '0',
latitude: addressDetail.latitude,
longitude: addressDetail.longitude
}
if (addressDetail.id) {
data.id = addressDetail.id
}
this.$api(data.id ? 'editAddress' : 'addAddress', data, res => {
if (res.code == 200) {
this.$refs.addressPopup.close()
this.getAddressList()
if (this.type == 'back') {
uni.navigateBack(-1)
}
uni.showToast({
title: '操作成功',
icon: 'none'
})
}
})
},
//
editDefault(id) {
this.$api('editAddress', {
id: id,
defaultFlag: 1
}, res => {
if (res.code == 200) {
this.$refs.addressPopup.close()
this.getAddressList()
uni.showToast({
title: '操作成功',
icon: 'none'
})
}
})
},
//
deleteAddress(id) {
let self = this
uni.showModal({
title: this.$t('components.deleteAddress'),
content: this.$t('components.confirmDeleteAddress'),
success(e) {
if (e.confirm) {
self.$api('editAddress', {
id: id,
isDisable: 1,
defaultFlag: 0
}, res => {
if (res.code == 200) {
self.getAddressList()
uni.showToast({
title: this.$t('components.deleteSuccessful'),
icon: 'none'
})
}
})
}
}
})
},
//
addBtn() {
this.title = '新增地址'
this.$refs.addressPopup.open({ //
name: '',
phone: '',
address: '',
addressDetail: '',
defaultFlag: '0',
latitude: '',
longitude: ''
})
},
}
}
</script>
<style lang="scss" scoped>
.address {
width: 750rpx;
margin: 0rpx auto;
background: #F5F5F5;
box-sizing: border-box;
min-height: 100vh;
.address-list {
padding: 40rpx 20rpx 120rpx 20rpx;
}
.add-btn {
position: fixed;
display: flex;
justify-content: center;
align-items: center;
left: 0;
bottom: 0;
width: 750rpx;
height: 100rpx;
background: white;
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 85%;
height: 80rpx;
border-radius: 40rpx;
color: white;
text-align: center;
font-size: 28rpx;
background: $uni-color;
}
}
}
@media all and (min-width: 961px) {
.add-btn {
left: 50% !important;
transform: translateX(-50%);
}
}
//
:deep(.uni-system-choose-location) {
z-index: 99999 !important;
}
.address {
width: 750rpx;
margin: 0rpx auto;
background: #F5F5F5;
box-sizing: border-box;
min-height: 100vh;
.address-list {
padding: 40rpx 20rpx 120rpx 20rpx;
}
.add-btn {
position: fixed;
display: flex;
justify-content: center;
align-items: center;
left: 0;
bottom: 0;
width: 750rpx;
height: 100rpx;
background: white;
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 85%;
height: 80rpx;
border-radius: 40rpx;
color: white;
text-align: center;
font-size: 28rpx;
background: $uni-color;
}
}
}
@media all and (min-width: 961px) {
.add-btn {
left: 50% !important;
transform: translateX(-50%);
}
}
//
:deep(.uni-system-choose-location) {
z-index: 99999 !important;
}
</style>

+ 224
- 225
pages_order/components/address/addressList.vue View File

@ -1,233 +1,232 @@
<template>
<scroll-view :style="{height: height}" scroll-y="true" @scrolltolower="moreAddress">
<uv-radio-group v-if="addressList.length > 0" v-model="selectAddress" @change="editDefault">
<view v-for="item in addressList" :key="item.id" class="address-item">
<view class="address-item-top" @click="select(item)">
<view class="img-box">
<image mode="aspectFill" src="/static/image/address/icon.png"></image>
</view>
<view class="address-info">
<view class="user-info">
<text class="user-name">{{ item.name }}</text>
<text class="user-phone">{{ item.phone }}</text>
<text v-if="item.id == selectAddress" class="is-default">默认</text>
</view>
<view class="address-detail">
{{ item.address + " " + item.addressDetail }}
</view>
</view>
</view>
<view v-if="item.defaultFlag=1" class="controls">
<view class="default-checkbox" @click="editDefault(item.id)">
<uv-radio :name="item.id" icon-size="30rpx" label-disabled size="30rpx">
默认地址
</uv-radio>
</view>
<view class="edit-btn">
<uv-icon name="edit-pen"></uv-icon>
<text class="control-title" @click="editAddress(item)">编辑</text>
</view>
<view class="del-btn" @click="deleteAddress(item.id)">
<uv-icon name="trash"></uv-icon>
<text class="control-title">删除</text>
</view>
</view>
</view>
</uv-radio-group>
<view v-else style="padding: 100rpx 0;">
<uv-empty iconSize="100rpx" mode="history" textSize="28rpx"/>
</view>
</scroll-view>
<scroll-view :style="{height: height}" scroll-y="true" @scrolltolower="moreAddress">
<uv-radio-group v-if="addressList.length > 0" v-model="selectAddress" @change="editDefault">
<view v-for="item in addressList" :key="item.id" class="address-item">
<view class="address-item-top" @click="select(item)">
<view class="img-box">
<image mode="aspectFill" src="/static/image/address/icon.png"></image>
</view>
<view class="address-info">
<view class="user-info">
<text class="user-name">{{ item.name }}</text>
<text class="user-phone">{{ item.phone }}</text>
<text v-if="item.defaultFlag == 1" class="is-default">默认</text>
</view>
<view class="address-detail">
{{ item.address + " " + item.addressDetail }}
</view>
</view>
</view>
<!-- 是否开启编辑模式 -->
<view v-if="controls" class="controls">
<view class="default-checkbox" @click="editDefault(item.id)">
<uv-radio :name="item.id" icon-size="30rpx" label-disabled size="30rpx">
默认地址
</uv-radio>
</view>
<view class="edit-btn">
<uv-icon name="edit-pen"></uv-icon>
<text class="control-title" @click="editAddress(item)">编辑</text>
</view>
<view class="del-btn" @click="deleteAddress(item.id)">
<uv-icon name="trash"></uv-icon>
<text class="control-title">删除</text>
</view>
</view>
</view>
</uv-radio-group>
<view v-else style="padding: 100rpx 0;">
<uv-empty iconSize="100rpx" mode="history" textSize="28rpx" />
</view>
</scroll-view>
</template>
<script>
export default {
props: {
controls: {
default: false,
type: Boolean,
},
height: {
default: 'calc(90vh - 180rpx)'
}
},
data() {
return {
selectAddress: 0,
queryParams: {
pageNo: 1,
pageSize: 10,
},
addressList: [],
total: 0,
}
},
created() {
},
methods: {
//
getAddressList() {
return new Promise((success, fail) => {
this.$api('addressList', this.queryParams, res => {
if (res.code == 200) {
console.log("res.result.records", res.result.records)
this.addressList = res.result.records || [];
this.total = res.result.total || 0;
this.addressList.forEach(n => { //
if (n.defaultFlag == 1) {
this.selectAddress = n.id
}
})
success(res.result)
}
})
})
},
//
moreAddress() {
if (this.queryParams.pageSize > this.total) {
return
}
this.queryParams.pageSize += 10
this.getAddressList()
},
//
deleteAddress(e) {
this.$emit('deleteAddress', e)
},
//
editAddress(e) {
this.$emit('editAddress', e)
},
//
editDefault(e) {
this.$emit('editDefault', e)
},
//
select(e) {
this.$emit('select', e)
},
}
}
export default {
props: {
controls: {
default: false,
type: Boolean,
},
height: {
default: 'calc(90vh - 180rpx)'
}
},
data() {
return {
selectAddress: 0,
queryParams: {
pageNo: 1,
pageSize: 10,
},
addressList: [],
total: 0,
}
},
created() {},
methods: {
//
getAddressList() {
return new Promise((success, fail) => {
this.$api('addressList', this.queryParams, res => {
if (res.code == 200) {
this.addressList = res.result.records || [];
this.total = res.result.total || 0;
res.result.records.forEach(n => { //
if (n.defaultFlag == 1) {
this.selectAddress = n.id
}
})
success(res.result)
}
})
})
},
//
moreAddress() {
if (this.queryParams.pageSize > this.total) {
return
}
this.queryParams.pageSize += 10
this.getAddressList()
},
//
deleteAddress(e) {
this.$emit('deleteAddress', e)
},
//
editAddress(e) {
console.log(e.defaultFlag);
this.$emit('editAddress', e)
},
//
editDefault(e) {
this.$emit('editDefault', e)
},
//
select(e) {
this.$emit('select', e)
},
}
}
</script>
<style scoped lang="scss">
.address-item {
background: white;
border-radius: 20rpx;
overflow: hidden;
margin-bottom: 20rpx;
padding: 15rpx 15rpx 0rpx 15rpx;
width: 680rpx;
.address-item-top {
border-bottom: 1px dashed #D3D1D1;
display: flex;
align-items: center;
padding: 0rpx 0rpx 15rpx 0rpx;
.img-box {
width: 120rpx;
height: 120rpx;
image {
width: 75%;
height: 75%;
display: block;
margin: 12.5% auto;
}
}
.address-info {
width: calc(100% - 120rpx);
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
.user-info {
display: flex;
align-items: center;
text {
display: block;
line-height: 40rpx;
margin-right: 20rpx;
}
.user-name,
.user-phone {
font-size: 30rpx;
}
.is-default {
display: flex;
align-items: center;
justify-content: center;
background: #FEB773;
color: white;
width: 80rpx;
height: 35rpx;
border-radius: 20rpx;
font-size: 22rpx;
}
}
.address-detail {
color: #4a4a4a;
font-size: 26rpx;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
}
}
}
.controls {
display: flex;
align-items: center;
justify-content: space-between;
align-items: center;
font-size: 26rpx;
padding: 15rpx 15rpx 25rpx 15rpx;
.default-checkbox {
display: flex;
text {
margin-left: 8rpx;
}
}
.control-title {
height: 30rpx;
line-height: 30rpx;
color: #666666;
}
view {
display: flex;
align-items: center;
}
image {
width: 23rpx;
height: 23rpx;
vertical-align: middle;
margin-right: 8rpx;
}
}
}
.address-item {
background: white;
border-radius: 20rpx;
overflow: hidden;
margin-bottom: 20rpx;
padding: 15rpx 15rpx 0rpx 15rpx;
width: 680rpx;
.address-item-top {
border-bottom: 1px dashed #D3D1D1;
display: flex;
align-items: center;
padding: 0rpx 0rpx 15rpx 0rpx;
.img-box {
width: 120rpx;
height: 120rpx;
image {
width: 75%;
height: 75%;
display: block;
margin: 12.5% auto;
}
}
.address-info {
width: calc(100% - 120rpx);
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
.user-info {
display: flex;
align-items: center;
text {
display: block;
line-height: 40rpx;
margin-right: 20rpx;
}
.user-name,
.user-phone {
font-size: 30rpx;
}
.is-default {
display: flex;
align-items: center;
justify-content: center;
background: #FEB773;
color: white;
width: 80rpx;
height: 35rpx;
border-radius: 20rpx;
font-size: 22rpx;
}
}
.address-detail {
color: #4a4a4a;
font-size: 26rpx;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
}
}
}
.controls {
display: flex;
align-items: center;
justify-content: space-between;
align-items: center;
font-size: 26rpx;
padding: 15rpx 15rpx 25rpx 15rpx;
.default-checkbox {
display: flex;
text {
margin-left: 8rpx;
}
}
.control-title {
height: 30rpx;
line-height: 30rpx;
color: #666666;
}
view {
display: flex;
align-items: center;
}
image {
width: 23rpx;
height: 23rpx;
vertical-align: middle;
margin-right: 8rpx;
}
}
}
</style>

+ 215
- 215
pages_order/components/address/redactAddress.vue View File

@ -1,223 +1,223 @@
<template>
<uv-popup round="40rpx" ref="addressPopup" :customStyle="{ height: 'auto' , width : '100%' , padding : '20rpx'}">
<view class="redact-address">
<view class="redact-address-title">{{ title }}</view>
<uv-form label-width="210rpx" :model="addressDetail" ref="form">
<uv-form-item label="联系人" prop="name">
<uv-input v-model="addressDetail.name" placeholder="请输入联系人姓名" border="none">
</uv-input>
</uv-form-item>
<uv-form-item label="手机号" prop="phone">
<uv-input v-model="addressDetail.phone" placeholder="请输入手机号" border="none">
</uv-input>
</uv-form-item>
<uv-form-item label="所在地区" prop="address">
<uv-input v-model="addressDetail.address" placeholder="请选择所在地区" border="none">
</uv-input>
<template #right>
<view style="padding-right: 40rpx;color: #FBAB32;" @click.stop="selectAddr">
<image src="../../static/address/selectIcon.png" mode="aspectFit"></image>
定位
</view>
</template>
</uv-form-item>
<uv-form-item label="详细地址" prop="addressDetail">
<uv-input v-model="addressDetail.addressDetail" placeholder="请输入详细地址" border="none">
</uv-input>
</uv-form-item>
</uv-form>
<view @click="onSubmit" class="save">{{ addressDetail.id ? '修改地址' : '新增地址' }}</view>
</view>
</uv-popup>
<uv-popup round="40rpx" ref="addressPopup" :customStyle="{ height: 'auto' , width : '100%' , padding : '20rpx'}">
<view class="redact-address">
<view class="redact-address-title">{{ title }}</view>
<uv-form label-width="210rpx" :model="addressDetail" ref="form">
<uv-form-item label="联系人" prop="name">
<uv-input v-model="addressDetail.name" placeholder="请输入联系人姓名" border="none">
</uv-input>
</uv-form-item>
<uv-form-item label="手机号" prop="phone">
<uv-input v-model="addressDetail.phone" placeholder="请输入手机号" border="none">
</uv-input>
</uv-form-item>
<uv-form-item label="所在地区" prop="address">
<uv-input v-model="addressDetail.address" placeholder="请选择所在地区" border="none">
</uv-input>
<template #right>
<view style="padding-right: 40rpx;color: #FBAB32;" @click.stop="selectAddr">
<image src="../../static/address/selectIcon.png" mode="aspectFit"></image>
定位
</view>
</template>
</uv-form-item>
<uv-form-item label="详细地址" prop="addressDetail">
<uv-input v-model="addressDetail.addressDetail" placeholder="请输入详细地址" border="none">
</uv-input>
</uv-form-item>
</uv-form>
<view @click="onSubmit" class="save">{{ addressDetail.id ? '修改地址' : '新增地址' }}</view>
</view>
</uv-popup>
</template>
<script>
import Position from '@/utils/position.js'
export default {
data() {
return {
addressDetail: {}
}
},
props: {
title: {
type: String,
default: '新增地址'
}
},
methods: {
open(addressDetail) {
this.addressDetail = addressDetail
this.$refs.addressPopup.open('bottom')
},
close() {
this.$refs.addressPopup.close()
},
//
onSubmit() {
let isOk = this.parameterVerification(this.addressDetail)
if (isOk && !isOk.auth) {
return uni.showToast({
icon: 'none',
title: isOk.title,
'zIndex': 10000
})
}
this.$emit('saveOrUpdate', this.addressDetail)
},
//
parameterVerification(addressDetaila) {
let {
name,
phone,
address,
addressDetail
} = addressDetaila
if (name.trim() == '') {
return {
title: '请填写联系人',
auth: false
}
} else if (phone.trim() == '') {
return {
title: '请填写手机号',
auth: false
}
} else if (address.trim() == '') {
return {
title: '请填写所在地区',
auth: false
}
} else if (addressDetail.trim() == '') {
return {
title: '请填写详细地址',
auth: false
}
} else if (phone.trim() != '') {
if (!this.$utils.verificationPhone(phone)) {
return {
title: '手机号格式不合法',
auth: false
}
}
}
return {
title: '验证通过',
auth: true
}
},
//
selectAddr() {
Position.getLocation(res => {
Position.selectAddress(res.longitude, res.latitude, success => {
this.setAddress(success)
})
})
},
//
setAddress(res) {
//
this.addressDetail.latitude = res.latitude
this.addressDetail.longitude = res.longitude
if (!res.address && res.name) { //
return this.addressDetail.address = res.name
}
if (res.address || res.name) {
return this.addressDetail.address = res.address + res.name
}
this.addressDetail.address = '' //
},
}
}
import Position from '@/utils/position.js'
export default {
data() {
return {
addressDetail: {}
}
},
props: {
title: {
type: String,
default: '新增地址'
}
},
methods: {
open(addressDetail) {
this.addressDetail = addressDetail
this.$refs.addressPopup.open('bottom')
},
close() {
this.$refs.addressPopup.close()
},
//
onSubmit() {
let isOk = this.parameterVerification(this.addressDetail)
if (isOk && !isOk.auth) {
return uni.showToast({
icon: 'none',
title: isOk.title,
'zIndex': 10000
})
}
this.$emit('saveOrUpdate', this.addressDetail)
},
//
parameterVerification(addressDetaila) {
let {
name,
phone,
address,
addressDetail
} = addressDetaila
if (name.trim() == '') {
return {
title: '请填写联系人',
auth: false
}
} else if (phone.trim() == '') {
return {
title: '请填写手机号',
auth: false
}
} else if (address.trim() == '') {
return {
title: '请填写所在地区',
auth: false
}
} else if (addressDetail.trim() == '') {
return {
title: '请填写详细地址',
auth: false
}
} else if (phone.trim() != '') {
if (!this.$utils.verificationPhone(phone)) {
return {
title: '手机号格式不合法',
auth: false
}
}
}
return {
title: '验证通过',
auth: true
}
},
//
selectAddr() {
Position.getLocation(res => {
Position.selectAddress(res.longitude, res.latitude, success => {
this.setAddress(success)
})
})
},
//
setAddress(res) {
//
this.addressDetail.latitude = res.latitude
this.addressDetail.longitude = res.longitude
if (!res.address && res.name) { //
return this.addressDetail.address = res.name
}
if (res.address || res.name) {
return this.addressDetail.address = res.address + res.name
}
this.addressDetail.address = '' //
},
}
}
</script>
<style lang="scss" scoped>
.redact-address {
box-sizing: border-box;
.redact-address-title {
height: 80rpx;
line-height: 80rpx;
font-size: 30rpx;
color: #333333;
font-weight: 600;
}
.save {
display: flex;
align-items: center;
justify-content: center;
width: 90%;
height: 80rpx;
border-radius: 40rpx;
color: white;
font-size: 28rpx;
margin: 0rpx auto;
background: $uni-color;
margin-top: 150rpx;
}
image {
width: 25rpx;
height: 25rpx;
}
//
.uv-form {
padding: 30rpx 0rpx;
}
&::v-deep .uv-cell {
padding: 0rpx 0rpx;
font-size: 26rpx;
&::after {
border: none !important;
}
.uv-field__label {
display: flex;
align-items: center;
height: 80rpx;
}
.uv-field__control,
.uv-field__right-icon {
height: 80rpx;
font-size: 26rpx;
border-bottom: 2rpx solid #cbc8c8;
}
.uv-field__right-icon {
display: flex;
align-items: center;
height: 78rpx;
color: #5FCC9F;
}
.uv-cell__value {
height: 120rpx;
}
}
&::v-deep .uv-field__error-message {
color: #5AC796;
font-size: 20rpx;
margin-top: 10rpx;
}
}
.redact-address {
box-sizing: border-box;
.redact-address-title {
height: 80rpx;
line-height: 80rpx;
font-size: 30rpx;
color: #333333;
font-weight: 600;
}
.save {
display: flex;
align-items: center;
justify-content: center;
width: 90%;
height: 80rpx;
border-radius: 40rpx;
color: white;
font-size: 28rpx;
margin: 0rpx auto;
background: $uni-color;
margin-top: 150rpx;
}
image {
width: 25rpx;
height: 25rpx;
}
//
.uv-form {
padding: 30rpx 0rpx;
}
&::v-deep .uv-cell {
padding: 0rpx 0rpx;
font-size: 26rpx;
&::after {
border: none !important;
}
.uv-field__label {
display: flex;
align-items: center;
height: 80rpx;
}
.uv-field__control,
.uv-field__right-icon {
height: 80rpx;
font-size: 26rpx;
border-bottom: 2rpx solid #cbc8c8;
}
.uv-field__right-icon {
display: flex;
align-items: center;
height: 78rpx;
color: #5FCC9F;
}
.uv-cell__value {
height: 120rpx;
}
}
&::v-deep .uv-field__error-message {
color: #5AC796;
font-size: 20rpx;
margin-top: 10rpx;
}
}
</style>

+ 1
- 1
pages_order/mine/address.vue View File

@ -78,7 +78,7 @@
phone: addressDetail.phone,
address: addressDetail.address,
addressDetail: addressDetail.addressDetail,
defaultId: addressDetail.defaultId || '0',
defaultFlag: addressDetail.defaultFlag || '0',
latitude: addressDetail.latitude,
longitude: addressDetail.longitude
}


+ 9
- 3
pages_order/tradingPlatform/confirmOrder.vue View File

@ -90,9 +90,15 @@
type
}, res => {
if (res.code == 200) {
uni.redirectTo({
url: '/pages/index/clearanceService'
})
if(type){
uni.redirectTo({
url: '/pages_order/order/myOrders'
})
}else{
uni.redirectTo({
url: '/pages/index/tradingPlatform'
})
}
}
})
},


+ 173
- 170
pages_order/tradingPlatform/nowOrder.vue View File

@ -21,54 +21,59 @@
<!--<uv-divider text="" :hairline="true"></uv-divider>-->
<!--提货地点-->
<!--<view class="currentRegion">-->
<!-- <view>{{ $t('components.pickupLocation') }}</view>-->
<!-- &lt;!&ndash; <view @click.stop="selectAddr">-->
<!-- <input class="input" disabled v-model="form.currentRegion" placeholder="请选择所在地区"></input>-->
<!-- <view class="orientation">-->
<!-- <img src="../../static/image/address/selectIcon.png"-->
<!-- style="width:30rpx;height: 30rpx;margin:5rpx 5rpx 5rpx 5rpx;">-->
<!-- </view>-->
<!-- </view> &ndash;&gt;-->
<!-- <view class="">-->
<!-- {{ fatherData.address }}-->
<!-- </view>-->
<!--</view>-->
<view class="addressA" @click="openAddress">
<view class="title">提货地点</view>
<view class="address" style="width: 70%">
<image mode="" src="/static/image/address/selectIcon.png"></image>
<view class="">
{{ address.name }}
</view>
<view class="icon">
<uv-icon name="arrow-right" size="30rpx"></uv-icon>
</view>
</view>
</view>
<!--详细地址-->
<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>
<!--&lt;!&ndash;详细地址&ndash;&gt;-->
<!--<view class="item">-->
<!-- <view>{{ $t('components.detailedAddress') }}</view>-->
<!-- <view>-->
<!-- &lt;!&ndash; <input v-model="form.address" placeholder="请输入详细地址" clearable></input> &ndash;&gt;-->
<!-- </view>-->
<!--</view>-->
<!-- <view class="currentRegion">
<view>{{ $t('components.pickupLocation') }}</view>
&lt;!&ndash; <view @click.stop="selectAddr">
<input class="input" disabled v-model="form.currentRegion" placeholder="请选择所在地区"></input>
<view class="orientation">
<img src="../../static/image/address/selectIcon.png"
style="width:30rpx;height: 30rpx;margin:5rpx 5rpx 5rpx 5rpx;">
</view>
</view> &ndash;&gt;
<view class="">
{{ fatherData.address }}
</view>
</view> -->
<!-- <view class="addressA" @click="openAddress">
<view class="title">提货地点</view>
<view class="address" style="width: 70%">
<image mode="" src="/static/image/address/selectIcon.png"></image>
<view class="">
{{ address.name }}
</view>
<view class="icon">
<uv-icon name="arrow-right" size="30rpx"></uv-icon>
</view>
</view>
</view>
详细地址
<view v-if="address.addressDetail" class="item">
<view>{{ $t('components.detailedAddress') }}</view>
<view>
<view class="">
{{ address.address + ' ' + address.addressDetail }}
</view>
</view>
</view> -->
<view class="addressA">
<view class="title">提货地点</view>
<view class="address" style="width: 70%">
{{ fatherData.address }}
</view>
</view>
<!--&lt;!&ndash;详细地址&ndash;&gt;-->
<!--<view class="item">-->
<!-- <view>{{ $t('components.detailedAddress') }}</view>-->
<!-- <view>-->
<!-- &lt;!&ndash; <input v-model="form.address" placeholder="请输入详细地址" clearable></input> &ndash;&gt;-->
<!-- </view>-->
<!--</view>-->
@ -76,15 +81,12 @@
<view class="delivery-date">
<view>{{ $t('components.deliveryDate') }}</view>
<view class="value">
<view class="dateTimeCls"
@click="startDateOpen">
<view class="dateTimeCls" @click="startDateOpen">
<view class="date">
{{ form.takeTime }}
<uv-datetime-picker ref="startDateRef"
v-model="form.takeTime"
mode="date"
:minDate="$dayjs(fatherData.transactionTime).valueOf()"
@confirm="startDateChange"></uv-datetime-picker>
<uv-datetime-picker ref="startDateRef" v-model="form.takeTime" mode="date"
:minDate="$dayjs(fatherData.transactionTime).valueOf()"
@confirm="startDateChange"></uv-datetime-picker>
</view>
<view class="img">
>
@ -99,8 +101,7 @@
<view class="tentativeQuantity">
<view class="key">{{ $t('other.tentativeQuantity') }}</view>
<view class="value">
<uv-number-box
inputWidth="200rpx" v-model="form.num" :max="fatherData.num"></uv-number-box>
<uv-number-box inputWidth="200rpx" v-model="form.num" :max="fatherData.num"></uv-number-box>
</view>
</view>
@ -124,7 +125,7 @@
<view class="Tip">
<span class="span">{{ $t('other.priceQuantityPercentage', [10]) }}</span>
</view>
<!--立即下单和联系我们-->
<view class="btns">
<span @click="ljxd" class="ljxd">
@ -144,47 +145,49 @@
<customerServicePopup ref="customerServicePopup" />
<!-- 地址选择弹框 -->
<uv-popup ref="addressPopup" :round="30">
<addressList ref="addressList" height="60vh" @select="selectAddress"/>
</uv-popup>
<!-- 地址选择弹框 -->
<uv-popup ref="addressPopup" :round="30">
<addressList ref="addressList" height="60vh" @select="selectAddress" />
</uv-popup>
</view>
</template>
<script>
import topbar from "@/components/base/topbar.vue";
import {mapGetters} from 'vuex'
import Position from '@/utils/position.js'
import dayjs from "dayjs";
import customerServicePopup from '@/components/config/customerServicePopup.vue'
import AddressList from "@/pages_order/components/address/addressList.vue";
export default {
import topbar from "@/components/base/topbar.vue";
import {
mapGetters
} from 'vuex'
import Position from '@/utils/position.js'
import dayjs from "dayjs";
import customerServicePopup from '@/components/config/customerServicePopup.vue'
import AddressList from "@/pages_order/components/address/addressList.vue";
export default {
name: "nowOrder",
components: {
AddressList,
AddressList,
topbar,
customerServicePopup,
},
computed: {
...mapGetters(['userShop']),
deposit(){
deposit() {
return (this.fatherData.price * this.form.num * (0.1)).toFixed(2)
},
},
onLoad(options) {
// if (options.params) {
// const fatherData = JSON.parse(decodeURIComponent(options.params));
// vuex
const fatherData = this.$store.state.productDetail
console.log(fatherData, "fatherData==========")
this.fatherData = fatherData;
//
// this.form.deposit = (fatherData.price * this.form.num * (0.02)).toFixed(2);
// const fatherData = JSON.parse(decodeURIComponent(options.params));
// vuex
const fatherData = this.$store.state.productDetail
console.log(fatherData, "fatherData==========")
this.fatherData = fatherData;
//
// this.form.deposit = (fatherData.price * this.form.num * (0.02)).toFixed(2);
// }
},
data() {
@ -198,16 +201,16 @@ export default {
"num": 1,
"price": 0,
"productId": "",
"takeTime": dayjs(new Date()).format("YYYY-MM-DD"),
"takeTime": dayjs(new Date()).format("YYYY-MM-DD"),
},
id: 0,
address: {
name: '请选择地址',
addressDetail: '',
},
id : 0,
address: {
name: '请选择地址',
addressDetail: '',
},
}
},
methods: {
//
@ -216,21 +219,21 @@ export default {
// uni.navigateTo({
// url: `/pages_order/tradingPlatform/confirmOrder`,
// });
this.form.deposit = this.deposit
this.form.productId = this.fatherData.id
if(this.$utils.verificationAll(this.form, {
"takeTime": '请选择交货时间',
})){
if (this.$utils.verificationAll(this.form, {
"takeTime": '请选择交货时间',
})) {
return
}
this.$api('addProductOrder', this.form, res => {
if(res.code == 200){
if (res.code == 200) {
// vuex
this.$store.state.cartInfo = res.result
uni.navigateTo({
url: `/pages_order/tradingPlatform/confirmOrder`,
});
@ -242,11 +245,11 @@ export default {
this.$refs.customerServicePopup.open()
},
//
selectAddress(e) {
this.address = e
this.$refs.addressPopup.close()
},
//
selectAddress(e) {
this.address = e
this.$refs.addressPopup.close()
},
startDateChange(val) {
this.$nextTick(() => {
@ -270,29 +273,29 @@ export default {
this.form.address = res
})
},
openAddress() {
this.$refs.addressPopup.open('bottom')
// this.getAddressList()
this.$nextTick(() => {
this.getAddressListA()
})
},
//
getAddressListA() {
this.$refs.addressList
.getAddressList()
.then(res => {
if (res == 0) {
this.$refs.popup.close()
return uni.navigateTo({
url: '/pages_order/mine/address?type=back'
})
}
})
},
openAddress() {
this.$refs.addressPopup.open('bottom')
// this.getAddressList()
this.$nextTick(() => {
this.getAddressListA()
})
},
//
getAddressListA() {
this.$refs.addressList
.getAddressList()
.then(res => {
if (res == 0) {
this.$refs.popup.close()
return uni.navigateTo({
url: '/pages_order/mine/address?type=back'
})
}
})
},
//
setAddress(res) {
//
@ -532,50 +535,50 @@ export default {
}
}
.addressA {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
// margin: 10rpx 0 0 0;
//padding: 10rpx 0 0 20rpx;
.title {
display: flex;
align-items: center;
justify-content: flex-start;
font-weight: 400;
width: 30%;
}
.address {
width: 70%;
display: flex;
padding: 20rpx;
background-color: #fff;
image {
width: 30rpx;
height: 30rpx;
margin: 10rpx;
}
view {
//margin: 20rpx;
overflow: hidden; //
text-overflow: ellipsis; //
white-space: nowrap; //
}
.icon {
display: flex;
justify-content: center;
align-items: center;
margin-left: auto;
}
}
}
.addressA {
display: flex;
align-items: center;
background-color: #FFF;
// height: 80rpx;
// margin: 10rpx 0 0 0;
//padding: 10rpx 0 0 20rpx;
.title {
display: flex;
align-items: center;
justify-content: flex-start;
font-weight: 400;
width: 30%;
}
.address {
width: 70%;
display: flex;
padding: 20rpx;
background-color: #fff;
image {
width: 30rpx;
height: 30rpx;
margin: 10rpx;
}
view {
//margin: 20rpx;
overflow: hidden; //
text-overflow: ellipsis; //
white-space: nowrap; //
}
.icon {
display: flex;
justify-content: center;
align-items: center;
margin-left: auto;
}
}
}
.currentRegion {
display: flex;


+ 18
- 14
store/store.js View File

@ -9,7 +9,7 @@ import { date } from '../uni_modules/uv-ui-tools/libs/function/test';
//Vuex.Store 构造器选项
const store = new Vuex.Store({
state: {
configList: [], //配置列表
configList: {}, //配置列表
shop : true,
userInfo : {}, //用户信息
shopData : {},
@ -32,20 +32,24 @@ const store = new Vuex.Store({
mutations: {
// 初始化配置
initConfig(state){
// api('getConfig', res => {
// if(res.code == 200){
// state.configList = res.result
// }
// })
let config = ['getPrivacyPolicy', 'getUserAgreement']
config.forEach(k => {
api(k, res => {
if (res.code == 200) {
state.configList[k] = res.result
}
})
api('getConfig', res => {
if(res.code == 200){
// state.configList = res.result
res.result.forEach(n => {
state.configList[n.name] = n
})
}
})
// let config = ['getPrivacyPolicy', 'getUserAgreement']
// config.forEach(k => {
// api(k, res => {
// if (res.code == 200) {
// state.configList[k] = res.result
// }
// })
// })
},
login(state, form){
uni.showLoading({


Loading…
Cancel
Save