3
0
Fork 0

feat(order): 升级单流程改造50%

This commit is contained in:
woody 2025-06-10 09:21:43 +08:00
parent 9a46dfe0ef
commit 66558d876f
11 changed files with 322 additions and 340 deletions

View File

@ -1,8 +1,8 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": true
"source.fixAll.eslint": "explicit",
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[vue]": {

View File

@ -108,7 +108,6 @@ export default {
},
handleProductClick(item) {
//
console.log(item, '....ite?')
this.$emit('product-click', item)
},
handleAddToCart(item) {

View File

@ -6,6 +6,7 @@
<area-product-list
:list="registList"
:title="regist.name"
@product-click="redirectList"
></area-product-list>
</view>
</view>
@ -15,6 +16,7 @@
<area-product-list
:list="upgradeList"
:title="upgrade.name"
@product-click="redirectList"
></area-product-list>
</view>
</view>
@ -24,6 +26,7 @@
<area-product-list
:list="repurchaseList"
:title="repurchase.name"
@product-click="redirectList"
></area-product-list>
</view>
</view>
@ -33,6 +36,7 @@
<area-product-list
:list="rescissionList"
:title="rescission.name"
@product-click="redirectList"
></area-product-list>
</view>
</view>
@ -94,6 +98,11 @@ export default {
}
})
},
redirectList(item) {
uni.navigateTo({
url: `/pages/specialArea/list?specialArea=${item.specialArea}&id=${item.pkId}`,
})
},
},
}
</script>

View File

@ -152,6 +152,13 @@
<script>
import * as api from '@/config/goods'
import {
REGIEST_AREA,
UPGRADE_AREA,
REPURCHASE_AREA,
REISSUE_AREA,
} from '@/util/specialAreaMap'
import { MEMBER_SIGN } from '@/util/common'
export default {
data() {
@ -345,8 +352,9 @@ export default {
})
uni.setStorageSync('allGoods', JSON.stringify(shoppArr))
if (
this.goodsCheck[0].specialArea == 1 ||
this.goodsCheck[0].specialArea == 24
[REGIEST_AREA.id, UPGRADE_AREA.id].includes(
this.goodsCheck[0].specialArea
)
) {
let deleteList = []
shoppArr.forEach(item => {
@ -430,22 +438,6 @@ export default {
})
}
}
} else if (this.goodsCheck[0].specialArea == 31) {
if (this.totalPrice < 1000) {
uni.showToast({
title: '购买商品总价格不能低于1000元',
icon: 'none',
duration: 1500,
})
} else {
uni.navigateTo({
url:
'/pages/other/index?specialArea=' +
this.goodsCheck[0].specialArea +
'&shoppArr=' +
JSON.stringify(shoppArr),
})
}
} else {
uni.navigateTo({
url:

View File

@ -49,3 +49,5 @@ export const getUpgradeLevel = params =>
// 下单前校验
export const validRelation = params =>
http.post('sale/api/retail-order/valid-relation', { params })
// 升级订单

View File

@ -20,7 +20,7 @@ module.exports = vm => {
//#ifdef DEV_SERVER
console.log('DEV_SERVER')
config.baseURL = 'http://192.168.0.100:8080'
config.baseURL = 'http://192.168.0.102:8080'
//#endif
//#ifdef QA_SERVER

View File

@ -262,10 +262,7 @@
"path": "pages/shareRegist/index",
"style": {
"navigationBarTitleText": "注册",
"navigationBarBackgroundColor": "#F33030",
"app-plus": {
"titleNView": false
}
"navigationBarBackgroundColor": "#fff"
}
},
{

View File

@ -18,7 +18,7 @@
</view> -->
<view class="context">
<u-form :model="form" labelWidth="75" :rules="rules" ref="uForm">
<u-form-item :label="'申请级别'" borderBottom prop="pkGradeVal">
<u-form-item :label="formLevelLabel" borderBottom prop="pkGradeVal">
<u-input
v-model="form.pkGradeVal"
border="none"
@ -26,47 +26,59 @@
disabled
/>
</u-form-item>
<!-- <u-form-item
:label="'自然国家'"
@tap="changeCountry(0)"
<u-form-item
v-show="isRegiest"
:label="'推荐编号'"
required
borderBottom
prop="parent"
>
<view class="disFlex justBwn">
<view class="disFlex">
<img class="countImg" :src="form.pkCountryImg" alt="" />
<view>{{ form.pkCountryLabel }}</view>
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item> -->
<!-- @tap="changeCountry(1)" -->
<!-- <u-form-item :label="'结算国家'" borderBottom>
<view class="disFlex justBwn">
<view class="disFlex">
<img class="countImg" :src="form.pkSettleCountryImg" alt="" />
<view>{{ form.pkSettleCountryLabel }}</view>
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item> -->
<u-form-item :label="'推荐编号'" required borderBottom prop="parent">
<u-input
v-model="form.parent"
@blur="getValidPcode()"
border="none"
/>
</u-form-item>
<u-form-item :label="'推荐姓名'" borderBottom prop="parentName">
<u-form-item
v-show="isRegiest"
:label="'推荐姓名'"
borderBottom
prop="parentName"
>
<u-input v-model="form.parentName" disabled border="none" />
</u-form-item>
<u-form-item label="会员昵称" required borderBottom prop="memberName">
<u-input :maxlength="40" v-model="form.memberName" border="none" />
<u-form-item
v-if="!isRegiest"
label="会员编号"
required
borderBottom
prop="memberCode"
>
<u-input
:disabled="isRegiest"
:maxlength="40"
v-model="form.memberCode"
border="none"
/>
</u-form-item>
<u-form-item :label="'联系方式'" required borderBottom prop="phone">
<u-form-item label="会员昵称" required borderBottom prop="memberName">
<u-input
:disabled="isRegiest"
:maxlength="40"
v-model="form.memberName"
border="none"
/>
</u-form-item>
<u-form-item
v-show="isRegiest"
:label="'联系方式'"
required
borderBottom
prop="phone"
>
<u-input
v-model="form.phone"
:disabled="isRegiest"
maxlength="11"
type="number"
border="none"
@ -366,14 +378,7 @@
:columns="countryList"
keyName="label"
></u-picker>
<!-- 选择安置位置 -->
<u-picker
:show="isPlace"
@cancel="isPlace = false"
@confirm="surePlace"
:columns="placeList"
keyName="label"
></u-picker>
<!-- 发货方式 -->
<u-picker
:show="isDelivery"
@ -467,19 +472,6 @@ export default {
isDelivery: false,
isBank: false,
isTrans: false,
placeList: [
[
{
id: 1,
label: '安置左区',
},
{
id: 2,
label: '安置右区',
},
],
],
isPlace: false,
countryIndex: 0,
isCountry: false,
userInfo: '',
@ -614,6 +606,14 @@ export default {
selTable: [],
}
},
computed: {
formLevelLabel() {
return this.specialArea == UPGRADE_AREA.id ? '升级级别' : '申请级别'
},
isRegiest() {
return this.specialArea == REGIEST_AREA.id
},
},
onLoad(options) {
const user = uni.getStorageSync('User')
this.pkCountry = user.pkSettleCountry
@ -805,19 +805,31 @@ export default {
// this.allGoodsData.deleteList = deleteList
// console.log(this.shoppingArr, '....allGoodsData')
// return
api
.memLevel({
firstCheck: 0,
specialArea: this.specialArea,
shopList: this.shoppingArr.map(id => {
return {
shoppingId: id,
}
}),
})
.then(res => {
this.form.pkGradeVal = res.data.pkGradeVal
})
const params = {
firstCheck: 0,
specialArea: this.specialArea,
shopList: this.shoppingArr.map(id => {
return {
shoppingId: id,
}
}),
}
if (this.specialArea == UPGRADE_AREA.id) {
params.upgradeMemberCode = this.form.parent
}
api.memLevel(params).then(res => {
if (res.code == 200) {
if (res.data.isEnough) {
this.form.pkGradeVal = res.data.pkGradeVal
} else {
this.form.pkGradeVal = ''
uni.showToast({
title: res.data.msg,
icon: 'none',
})
}
}
})
},
checkAddress() {},
getValidPcode() {

View File

@ -1,97 +1,95 @@
<!--
* @Descripttion:
* @version:
* @Descripttion:
* @version:
* @Author: kBank
* @Date: 2022-11-21 15:11:22
-->
<template>
<view >
<view v-if="!pkCountry" class="content1">
<!-- <view class="index_header">
<view>
<view v-if="!pkCountry" class="content1">
<!-- <view class="index_header">
<view>注册</view>
</view> -->
<!-- <view class="tit" v-if="!pkCountry">{{ '嗨粉扫天下' }}</view> -->
<!-- 海粉 -->
<view class="formed1"
>
<u-form :model="form"
labelWidth="80px"
ref="uForm"
:rules="rules">
<u-form-item label=""
prop="memberCode">
<u-input v-model="form.memberCode"
type="number"
disabled>
<u--text :text="howHeader"
slot="prefix"
margin="0 3px 0 0"
type="tips"></u--text>
</u-input>
</u-form-item>
<u-form-item label=""
prop="memberName">
<u-input v-model="form.memberName"
:placeholder="'请输入会员姓名'" />
</u-form-item>
<u-form-item label=""
prop="phone">
<u-input v-model="form.phone" @blur="setMemberCode"
:placeholder="'请输入联系方式'" type="number" maxlength="20" />
</u-form-item>
<u-form-item label=""
prop="loginPassword">
<u-input :password="isPwd"
:placeholder="'请输入登录密码'"
v-model="form.loginPassword">
<template slot="suffix">
<u-icon name="eye"
@tap="isPwd=!isPwd"
v-if="!isPwd"></u-icon>
<u-icon name="eye-off"
@tap="isPwd=!isPwd"
v-else></u-icon>
</template>
</u-input>
</u-form-item>
<u-form-item label=""
prop="payPassword">
<u-input :password="isPwd2"
:placeholder="'请输入支付密码'"
v-model="form.payPassword">
<template slot="suffix">
<u-icon name="eye"
@tap="isPwd2=!isPwd2"
v-if="!isPwd2"></u-icon>
<u-icon name="eye-off"
@tap="isPwd2=!isPwd2"
v-else></u-icon>
</template>
</u-input>
</u-form-item>
<u-form-item label=""
prop="code">
<u-input v-model="form.code"
:placeholder="'请输入验证码'">
<template slot="suffix">
<view class="getCode"
@tap="getVilCode">{{ getCode }}</view>
</template>
</u-input>
</u-form-item>
</u-form>
<u-button type="success"
class="uBtn"
shape="circle"
color="linear-gradient(to right, #005BAC, #005BAC )"
:loading="isLoading"
:loadingText="'注册中'"
@click="toLogin">{{ '立即注册' }}</u-button>
<!-- <view class="tit" v-if="!pkCountry">{{ '嗨粉扫天下' }}</view> -->
<!-- 海粉 -->
<view class="formed1">
<u-form :model="form" labelWidth="80px" ref="uForm" :rules="rules">
<u-form-item label="" prop="memberCode">
<u-input v-model="form.memberCode" type="number" disabled>
<u--text
:text="howHeader"
slot="prefix"
margin="0 3px 0 0"
type="tips"
></u--text>
</u-input>
</u-form-item>
<u-form-item label="" prop="memberName">
<u-input
v-model="form.memberName"
:placeholder="'请输入会员姓名'"
/>
</u-form-item>
<u-form-item label="" prop="phone">
<u-input
v-model="form.phone"
@blur="setMemberCode"
:placeholder="'请输入联系方式'"
type="number"
maxlength="20"
/>
</u-form-item>
<u-form-item label="" prop="loginPassword">
<u-input
:password="isPwd"
:placeholder="'请输入登录密码'"
v-model="form.loginPassword"
>
<template slot="suffix">
<u-icon name="eye" @tap="isPwd = !isPwd" v-if="!isPwd"></u-icon>
<u-icon name="eye-off" @tap="isPwd = !isPwd" v-else></u-icon>
</template>
</u-input>
</u-form-item>
<u-form-item label="" prop="payPassword">
<u-input
:password="isPwd2"
:placeholder="'请输入支付密码'"
v-model="form.payPassword"
>
<template slot="suffix">
<u-icon
name="eye"
@tap="isPwd2 = !isPwd2"
v-if="!isPwd2"
></u-icon>
<u-icon name="eye-off" @tap="isPwd2 = !isPwd2" v-else></u-icon>
</template>
</u-input>
</u-form-item>
<u-form-item label="" prop="code">
<u-input v-model="form.code" :placeholder="'请输入验证码'">
<template slot="suffix">
<view class="getCode" @tap="getVilCode">{{ getCode }}</view>
</template>
</u-input>
</u-form-item>
</u-form>
<u-button
type="success"
class="uBtn"
shape="circle"
color="linear-gradient(to right, #005BAC, #005BAC )"
:loading="isLoading"
:loadingText="'注册中'"
@click="toLogin"
>{{ '立即注册' }}</u-button
>
</view>
</view>
</view>
<view v-else class="content">
<!-- <view class="tit" >{{ '海粉扫天下' }}</view>
<view v-else class="content">
<!-- <view class="tit" >{{ '海粉扫天下' }}</view>
<view class="formed"
>
<u-form :model="form"
@ -184,11 +182,9 @@
:columns="countryList"></u-picker>
</view> -->
</view>
<view class="mask" v-if="isTrue"> </view>
</view>
<view class="mask" v-if="isTrue">
</view>
</view>
</template>
<script>
@ -197,7 +193,7 @@ export default {
components: {},
data() {
return {
isTrue:false,
isTrue: false,
howHeader: 'HF',
pkParent: '',
form: {
@ -225,15 +221,15 @@ export default {
memberName: [
{
required: true,
message:'请输入会员姓名',
trigger: [ 'blur'],
message: '请输入会员姓名',
trigger: ['blur'],
},
],
phone: [
{
required: true,
message: '请输入联系方式',
trigger: [ 'blur'],
trigger: ['blur'],
},
],
code: [
@ -254,7 +250,7 @@ export default {
{
required: true,
message: '请输入支付密码',
trigger: [ 'blur'],
trigger: ['blur'],
},
],
},
@ -303,11 +299,12 @@ export default {
this.pkCountry = options.country || ''
this.getGenerate()
if (this.pkCountry) {
this.getCountry()
this.form.pkCountry = this.pkCountry
uni.setStorageSync('pkCountry',this.pkCountry)
uni.redirectTo({ url: '/pages/shareArea/hiList?pkParent=' + this.pkParent})
uni.setStorageSync('pkCountry', this.pkCountry)
uni.redirectTo({
url: '/pages/shareArea/hiList?pkParent=' + this.pkParent,
})
// this.$refs.uForm1.setRules(this.rules1)
} else {
//
@ -318,20 +315,20 @@ export default {
},
onShow() {},
methods: {
setMemberCode(){
setMemberCode() {
// this.form.memberCode = this.form.phone
this.$set(this.form,'memberCode',this.form.phone)
this.$set(this.form, 'memberCode', this.form.phone)
},
selCountry(){
selCountry() {
uni.showModal({
title: '提示',
content: '确认更换自然国',
success: (res) => {
if (res.confirm) {
this.isCountry = true
}
},
})
title: '提示',
content: '确认更换自然国',
success: res => {
if (res.confirm) {
this.isCountry = true
}
},
})
},
memberCodeRule(rule, value, callback) {
if (!value) {
@ -340,7 +337,7 @@ export default {
if (value.length < 10 || value.length > 20) {
callback(new Error('请输入10-20位数字'))
} else {
api.validateMember(value).then((res) => {
api.validateMember(value).then(res => {
if (res.code == 200) {
callback()
} else {
@ -351,30 +348,30 @@ export default {
}
},
getHeader() {
api.checkShare().then((res) => {
if(res.code != 200){
this.isTrue = true
}else{
this.isTrue = false
}
api.checkShare().then(res => {
if (res.code != 200) {
this.isTrue = true
} else {
this.isTrue = false
}
})
// api.prefix(this.pkParent).then((res) => {
// this.howHeader = res.msg
// })
},
getGenerate() {
api.generate().then((res) => {
api.generate().then(res => {
uni.setStorageSync('mToken', res.msg)
})
},
toLogin() {
this.$refs.uForm.validate().then((res) => {
this.$refs.uForm.validate().then(res => {
this.isLoading = true
api
.regShareMember(
Object.assign({}, this.form, { parent: this.pkParent })
)
.then((res) => {
.then(res => {
this.isLoading = false
if (res.code == 200) {
uni.redirectTo({
@ -387,11 +384,11 @@ export default {
})
},
hiLogin() {
this.$refs.uForm1.validate().then((res) => {
this.$refs.uForm1.validate().then(res => {
this.isLoading = true
api
.hiRegister(Object.assign({}, this.form, { pkParent: this.pkParent }))
.then((res) => {
.then(res => {
this.isLoading = false
if (res.code == 200) {
uni.redirectTo({
@ -409,16 +406,16 @@ export default {
this.isCountry = false
},
getCountry() {
api.getCountry().then((res) => {
api.getCountry().then(res => {
this.countryList = [
res.data.map((item) => {
res.data.map(item => {
return {
label: item.shortName,
id: item.pkId,
}
}),
]
this.countryList[0].forEach((item) => {
this.countryList[0].forEach(item => {
if (this.pkCountry == item.id) {
this.form.jsName = item.label
this.form.pkCountryName = item.label
@ -433,8 +430,8 @@ export default {
.verification({
phone: this.form.phone,
})
.then((res) => {})
.catch((err) => {
.then(res => {})
.catch(err => {
this.beginTime = 0
})
},
@ -460,35 +457,38 @@ export default {
</script>
<style lang="scss" scoped>
.content1{
background-image: url('@/static/images/haiRgeiest1.jpg');
.content1 {
background-color: #fff;
// background-image: url('@/static/images/haiRgeiest1.jpg');
background-size: 100%;
background-repeat: no-repeat;
background-repeat: no-repeat;
height: 100vh;
}
.content{
.content {
background-image: url('@/static/images/huan.jpg');
// background-image: url('@/static/images/regiestBg.jpg');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-repeat: no-repeat;
background-position: center;
height: 100vh;
}
.tit{
.tit {
font-size: 48px;
font-family: PangMenZhengDao-Regular, PangMenZhengDao;
font-weight: 400;
color: #FFFFFF;
text-align: center;
padding-top: 80px;
margin-bottom: 20px;
font-family: PangMenZhengDao-Regular, PangMenZhengDao;
font-weight: 400;
color: #ffffff;
text-align: center;
padding-top: 80px;
margin-bottom: 20px;
}
.index_header {
background: #f9f9f9;;
background: #f9f9f9;
height: 330rpx;
font-size: 18px;
font-family: PingFang SC-Semibold, PingFang SC;
font-family:
PingFang SC-Semibold,
PingFang SC;
font-weight: 600;
color: #333333;
text-align: center;
@ -503,9 +503,11 @@ margin-bottom: 20px;
}
.getCode {
font-size: 10px;
font-family: PingFang SC-Regular, PingFang SC;
font-family:
PingFang SC-Regular,
PingFang SC;
font-weight: 400;
color: #005BAC;
color: #005bac;
}
.uBtn {
margin-top: 120rpx;
@ -519,14 +521,14 @@ margin-bottom: 20px;
border-style: solid;
border-radius: 4px;
padding: 6px 9px;
background: #fff;
}
::v-deep .u-input{
background: #fff;
}
.mask{
::v-deep .u-input {
background: #fff;
}
.mask {
position: fixed;
background: rgba(0,0,0,0.5);
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100vh;
top: 0;

View File

@ -35,5 +35,6 @@ export default {
background: #f2f2f2;
// padding: 0 20rpx;
min-height: 94vh;
padding-bottom: 100rpx;
}
</style>

View File

@ -10,13 +10,6 @@
<view class="index_header">
<view>{{ titLabel }}</view>
</view>
<view class="shareImg" v-if="specialArea == 7" @click="goShare">
<u-icon name="share-square" size="24" color="#005BAC"> </u-icon>
</view>
<view class="shareImg1" v-if="specialArea == 1" @tap="changeCountry">
<img :src="pkCountryImg" alt="" />
<u-icon name="arrow-down" color="#999"></u-icon>
</view>
<u-scroll-list
:indicator="false"
v-if="itemChildren.length > 1"
@ -107,12 +100,6 @@
<view class="pv" v-if="specialArea == 10">
积分可抵扣:{{ item.deductMoney | numberToCurrency }}
</view>
<view
class="pv"
v-if="specialArea == 31 && userInfo.isMakerSpace == 0"
>
业绩:{{ item.waresAchieve | numberToCurrency }}
</view>
<view class="pv" v-if="specialArea == 13">
BV:{{ item.assAchieve | numberToCurrency }}
</view>
@ -181,6 +168,15 @@ import { mapGetters, mapActions } from 'vuex'
import * as api from '@/config/goods'
import clTabbar from '@/components/cl-tabbar.vue'
import selSpaceGoods from '@/components/selSpaceGoods.vue'
import {
REGIEST_AREA,
UPGRADE_AREA,
REPURCHASE_AREA,
REISSUE_AREA,
} from '@/util/specialAreaMap'
import { MEMBER_SIGN } from '@/util/common'
import areaProductList from '@/components/area-product-list/index.vue'
import { getAreaGoods } from '@/config/special-area'
export default {
components: {
@ -221,13 +217,13 @@ export default {
}
},
onLoad(options) {
if (JSON.parse(options.children).length > 0) {
if (JSON.parse(options?.children || '[]').length > 0) {
let arr = []
if (options.childArea) {
this.specialArea = options.childArea
// this.diff = 1
} else {
JSON.parse(options.children).forEach(item => {
JSON.parse(options?.children || '[]').forEach(item => {
if (item.isShow) {
arr.push(item.value)
}
@ -242,40 +238,36 @@ export default {
this.specialArea = options.specialArea
}
this.titLabel = options.label
let tempArr = JSON.parse(options.children)
if (this.specialArea != 18) {
api.menuList().then(res => {
tempArr = tempArr.filter(item =>
res.data.find(ctem => ctem.menuKey == item.name)
)
this.itemChildren = tempArr
})
}
// this.titLabel = options.label
// let tempArr = JSON.parse(options?.children || '[]')
// if (this.specialArea != 18) {
// api.menuList().then(res => {
// tempArr = tempArr.filter(item =>
// res.data.find(ctem => ctem.menuKey == item.name)
// )
// this.itemChildren = tempArr
// })
// }
//
const areaMap = {
[REGIEST_AREA.id]: REGIEST_AREA.name,
[UPGRADE_AREA.id]: UPGRADE_AREA.name,
[REPURCHASE_AREA.id]: REPURCHASE_AREA.name,
[REISSUE_AREA.id]: REISSUE_AREA.name,
}
this.titLabel = areaMap[this.specialArea]
uni.setNavigationBarTitle({
title: this.titLabel,
success: () => {},
success: () => {
console.log(title)
},
})
//
// this.getClassIfy()
this.userInfo = uni.getStorageSync('User')
console.log(
'%c [ this.userInfo ]-242',
'font-size:13px; background:#cb38d2; color:#ff7cff;',
this.userInfo
)
if (this.specialArea == 1) {
if (uni.getStorageSync('pkCountry')) {
this.pkCountry = uni.getStorageSync('pkCountry')
} else {
this.pkCountry = this.userInfo.pkSettleCountry
uni.setStorageSync('pkCountry', this.pkCountry + '')
}
} else {
this.pkCountry = this.userInfo.pkSettleCountry
}
this.pkCountry = this.userInfo.pkCountry || 1
this.setSpecial({
value: this.specialArea,
})
@ -299,7 +291,6 @@ export default {
this.setSmallCarLength(0)
},
beforeDestroy() {
console.log('beforeDestroy........?')
this.setSmallCarLength(0)
},
methods: {
@ -342,18 +333,8 @@ export default {
})
},
setSpecial(item) {
if (item.value == 21) {
// uni.navigateTo({
// url:
// '/pages/specialArea/haIndex?label=' +
// this.titLabel +
// '&specialArea=21&children=' +
// JSON.stringify(this.itemChildren),
// })
} else {
this.specialArea = item.value
this.getClassIfy()
}
this.specialArea = item.value
this.getClassIfy()
},
addCar(item) {
let carList = {
@ -363,29 +344,20 @@ export default {
waresCode: item.waresCode,
productGroup: item.productGroup,
}
if (
item.isMakerGift == 2 &&
(item.specialArea == 1 || item.specialArea == 3)
) {
this.$refs.selSpaceGoods.getData(carList)
} else {
api.addShopping(carList).then(res => {
if (res.code == 200) {
uni.showToast({
title: '购物车添加成功',
icon: 'success',
mask: true,
api.addShopping(carList).then(res => {
if (res.code == 200) {
uni.showToast({
title: '购物车添加成功',
icon: 'success',
mask: true,
})
setTimeout(() => {
this.$store.dispatch('getCarLength', this.specialArea).then(res => {
this.shopCarLength = res.data.smallCount
})
setTimeout(() => {
this.$store
.dispatch('getCarLength', this.specialArea)
.then(res => {
this.shopCarLength = res.data.smallCount
})
}, 200)
}
})
}
}, 200)
}
})
},
getCatLength() {
this.$store.dispatch('getCarLength', this.specialArea).then(res => {
@ -429,37 +401,33 @@ export default {
})
},
getAllGoods(id) {
api
.getAllGoods({
pkCountry: this.pkCountry,
specialArea: Number(this.specialArea),
pkAreaClassify: id ? id : '',
})
.then(res => {
this.goodList = res.data
this.goodList.forEach(item => {
if (item.waresName.length > 11) {
item.waresName = item.waresName.substring(0, 11) + '...'
}
})
getAreaGoods({
pkCountry: this.pkCountry,
specialArea: Number(this.specialArea),
pkAreaClassify: id ? id : '',
}).then(res => {
this.goodList = res.data || []
this.goodList.forEach(item => {
if (item.waresName.length > 11) {
item.waresName = item.waresName.substring(0, 11) + '...'
}
})
})
},
getAllGoods1(id) {
api
.getAllGoods({
pkCountry: this.pkCountry,
specialArea: this.specialArea,
waresName: this.waresName,
pkAreaClassify: id ? id : this.oneId,
})
.then(res => {
this.goodList = res.data
this.goodList.forEach(item => {
if (item.waresName.length > 11) {
item.waresName = item.waresName.substring(0, 11) + '...'
}
})
getAreaGoods({
pkCountry: this.pkCountry,
specialArea: this.specialArea,
waresName: this.waresName,
pkAreaClassify: id ? id : this.oneId,
}).then(res => {
this.goodList = res.data
this.goodList.forEach(item => {
if (item.waresName.length > 11) {
item.waresName = item.waresName.substring(0, 11) + '...'
}
})
})
},
goDetails(item) {
if (item.preSaleStatus != 3 && item.isSale != 1) {