feat(order): 注册专区功能实现

This commit is contained in:
woody 2025-06-09 19:50:44 +08:00
parent 42584d727a
commit 9a46dfe0ef
8 changed files with 1191 additions and 1238 deletions

View File

@ -4,7 +4,7 @@ const http = uni.$u.http
export const payConfig = params => http.get('/pay/config', { params })
//查询订单明细
export const orderInfo = params =>
http.post('/sale/api/order/query-order', params)
http.post('/sale/api/retail-order/query-order', params)
//订单状态
export const orderStatus = params =>
http.get('/system/pub/enums/order-status-api', { params })
@ -45,3 +45,7 @@ export const selfRevokeOrder = params =>
// 获取可升级级别
export const getUpgradeLevel = params =>
http.post('/sale/api/retail-order/valid-mem-level', { params })
// 下单前校验
export const validRelation = params =>
http.post('sale/api/retail-order/valid-relation', { params })

View File

@ -1,64 +1,83 @@
const http = uni.$u.http
//支付配置
export const payConfig = (params) => http.get('/pay/config', { params })
export const payConfig = params => http.get('/pay/config', { params })
//京东银行列表
export const jdBankList = (params) => http.get('/pay/jd-fast/list', { params })
export const jdBankList = params => http.get('/pay/jd-fast/list', { params })
//汇付银行列表
export const hfBankList = (params) => http.get('/pay/ada-fast/list', { params })
export const hfBankList = params => http.get('/pay/ada-fast/list', { params })
//通联银行列表
export const tlBankList = (params) => http.get('/pay/all-in-fast/list', { params })
export const tlBankList = params =>
http.get('/pay/all-in-fast/list', { params })
//查询订单明细
export const orderInfo = (params) => http.post('/sale/api/order/query-order', params)
export const orderInfo = params =>
http.post('/sale/api/retail-order/query-order', params)
//查询订单消费明细
export const spendDetails = (params) => http.post('/sale/api/order/query-spend-details', params)
export const spendDetails = params =>
http.post('/sale/api/retail-order/query-spend-details', params)
//京东绑卡短信
export const bindJd = (params) => http.post('/pay/jd-fast/bind', params)
export const bindJd = params => http.post('/pay/jd-fast/bind', params)
//通联绑卡短信
export const bindTl = (params) => http.post('/pay/all-in-fast/bind', params)
export const bindTl = params => http.post('/pay/all-in-fast/bind', params)
//汇付绑卡短信
export const bindHf = (params) => http.post('/pay/ada-fast/bind', params)
export const bindHf = params => http.post('/pay/ada-fast/bind', params)
//京东绑卡
export const bindJdConfirm = (params) => http.post('/pay/jd-fast/bind-confirm', params)
export const bindJdConfirm = params =>
http.post('/pay/jd-fast/bind-confirm', params)
//通联绑卡
export const bindTlConfirm = (params) => http.post('/pay/all-in-fast/bind-confirm', params)
export const bindTlConfirm = params =>
http.post('/pay/all-in-fast/bind-confirm', params)
//汇付绑卡
export const bindHfConfirm = (params) => http.post('/pay/ada-fast/bind-confirm', params)
export const bindHfConfirm = params =>
http.post('/pay/ada-fast/bind-confirm', params)
//银行卡支付获取验证码
export const unifiedorder = (params) => http.post('/pay/unifiedorder', params)
export const unifiedorder = params => http.post('/pay/unifiedorder', params)
//汇付银行卡确认
export const payConfirmHf = (params) => http.post('/pay/ada-fast/pay-confirm', params)
export const payConfirmHf = params =>
http.post('/pay/ada-fast/pay-confirm', params)
//京东银行卡确认
export const payConfirmJd = (params) => http.post('/pay/jd-fast/pay-confirm', params)
export const payConfirmJd = params =>
http.post('/pay/jd-fast/pay-confirm', params)
//通联银行卡确认
export const payConfirmTl = (params) => http.post('/pay/all-in-fast/pay-confirm', params)
export const payConfirmTl = params =>
http.post('/pay/all-in-fast/pay-confirm', params)
//支付状态
export const payStatus = (params) => http.get('/pay/status', { params })
export const payStatus = params => http.get('/pay/status', { params })
//幂等性
export const generate = (params) => http.get('/system/api/idempotent/generate', { params })
export const generate = params =>
http.get('/system/api/idempotent/generate', { params })
//支付注册订单
export const payRegOrder = (params) => http.post('/sale/api/order/pay-reg-order', params)
export const payRegOrder = params =>
http.post('/sale/api/retail-order/pay-reg-order', params)
//支付其他订单
export const payOthOrder = (params) => http.post('/sale/api/order/pay-oth-order', params)
export const payOthOrder = params =>
http.post('/sale/api/retail-order/pay-oth-order', params)
//宝付确认支付h5
export const baoFuPay = (params) => http.post('/pay/baofu-code/order', params)
export const baoFuPay = params => http.post('/pay/baofu-code/order', params)
//汇付确认支付h5
export const huiFuPay = (params) => http.post('/pay/ada-code/order', params)
export const huiFuPay = params => http.post('/pay/ada-code/order', params)
//在线预充值
export const preCharge = (params) => http.get('/member/api/recharge/preCharge', { params })
export const preCharge = params =>
http.get('/member/api/recharge/preCharge', { params })
//海粉注册信息
export const fansOrder = (params) => http.get('/member/api/member/fans-order/'+params)
export const fansOrder = params =>
http.get('/member/api/member/fans-order/' + params)
//抽奖下单
export const payDrawGift = (params) => http.post('/activity/api/draw/pay-draw-num', params)
export const payDrawGift = params =>
http.post('/activity/api/draw/pay-draw-num', params)
//提货下单
export const payPickOrder = (params) => http.post('/activity/api/pick/order', params)
export const payPickOrder = params =>
http.post('/activity/api/pick/order', params)
//植树查看账户
export const deductionAccount = (params) => http.post('activity/api/sa-tree-order/deductionAccount', params)
export const deductionAccount = params =>
http.post('activity/api/sa-tree-order/deductionAccount', params)
//植树活动
export const shoppingTree = (params) => http.post('activity/api/sa-tree-order/shoppingTree', params)
export const shoppingTree = params =>
http.post('activity/api/sa-tree-order/shoppingTree', params)
//解绑银行卡
export const unBind = (params) => http.post('/pay/ada-fast/un-bind', params)
export const unBind = params => http.post('/pay/ada-fast/un-bind', params)
//查询注册信息
export const registerInfo = (params) => http.get('/member/api/member/register-order/' + params,)
export const registerInfo = params =>
http.get('/member/api/member/register-order/' + params)

View File

@ -1,71 +1,109 @@
const http = uni.$u.http
//幂等性
export const generate = (params) => http.get('/system/api/idempotent/generate', { params })
export const generate = params =>
http.get('/system/api/idempotent/generate', { params })
//商品列表
export const getAllGoods = (params) => http.post('/sale/api/wares/query-spe-wares', params)
export const getAllGoods = params =>
http.post('/sale/api/wares/query-spe-wares', params)
//商品详情
export const waresDetail = (params) => http.post('/sale/api/wares/query-spe-wares-detail', params)
export const waresDetail = params =>
http.post('/sale/api/wares/query-spe-wares-detail', params)
//获取国家
export const countryList = (params) => http.get('/system/api/country/list', { params })
export const countryList = params =>
http.get('/system/api/country/list', { params })
//发货
export const deliveryList = (params) => http.get('/system/pub/enums/delivery-list', { params })
export const deliveryList = params =>
http.get('/system/pub/enums/delivery-list', { params })
//运输
export const transportList = (params) => http.get('/system/pub/enums/transport-type', { params })
export const transportList = params =>
http.get('/system/pub/enums/transport-type', { params })
//行列表输
export const bankList = (params) => http.get('/system/api/bank/list', { params })
export const bankList = params => http.get('/system/api/bank/list', { params })
//购物车商品详情
export const shoppingWaresDetail = (params) => http.post('/sale/api/shopping/get-shopping-wares-detail', params)
export const shoppingWaresDetail = params =>
http.post('/sale/api/shopping/get-shopping-wares-detail', params)
//一键注册
export const quickReg = (params) => http.post('/sale/api/order/quick-reg', params)
export const quickReg = params =>
http.post('/sale/api/retail-order/quick-reg', params)
//获取会员等级
export const memLevel = (params) => http.post('/sale/api/order/valid-mem-level', params)
export const memLevel = params =>
http.post('/sale/api/retail-order/valid-mem-level', params)
//注册页面显示权限
export const registerList = (params) => http.get('/system/api/register-page/list', { params })
export const registerList = params =>
http.get('/system/api/register-page/list', { params })
//获取地址列表
export const addressList = (params) => http.get('/member/api/member-address/list', { params })
export const addressList = params =>
http.get('/member/api/member-address/list', { params })
//查询邮费
export const queryPostage = (params) => http.post('/sale/api/order/query-order-postage', params)
export const queryPostage = params =>
http.post('/sale/api/retail-order/query-order-postage', params)
//确认注册订单-生成待支付订单
export const confirmRegOrder = (params) => http.post('/sale/api/order/confirm-reg-order', params)
export const confirmRegOrder = params =>
http.post('/sale/api/retail-order/confirm-reg-order', params)
//根据推荐人编号获取安置信息
export const validPcode = (params) => http.post('/sale/api/order/valid-p-code', params)
export const validPcode = params =>
http.post('/sale/api/retail-order/valid-p-code', params)
//注册订单验证安置人编号
export const validPPcode = (params) => http.post('/sale/api/order/valid-p-p-code', params)
export const validPPcode = params =>
http.post('/sale/api/retail-order/valid-p-p-code', params)
//注册订单验证手机号
export const validPhone = (params) => http.post('/sale/api/order/valid-phone', params)
export const validPhone = params =>
http.post('/sale/api/retail-order/valid-phone', params)
//获取name
export const upgRel = (params) => http.post('/sale/api/order/validate-upg-rel', params)
export const upgRel = params =>
http.post('/sale/api/retail-order/validate-upg-rel', params)
//升级复购单确认
export const confirmOthOrder = (params) => http.post('/sale/api/order/confirm-oth-order', params)
export const confirmOthOrder = params =>
http.post('/sale/api/retail-order/confirm-oth-order', params)
//嗨粉确认订单
export const confirmFunOrder = (params) => http.post('/sale/api/order/confirm-fun-order', params)
export const confirmFunOrder = params =>
http.post('/sale/api/retail-order/confirm-fun-order', params)
//协议
export const waresAgreement = (params) => http.post('/sale/api/wares/get-wares-agreement', params)
export const waresAgreement = params =>
http.post('/sale/api/wares/get-wares-agreement', params)
//海粉订单详情
export const waresinfo = (params) => http.post('/sale/api/wares/query-confirm-waresinfo', params)
export const waresinfo = params =>
http.post('/sale/api/wares/query-confirm-waresinfo', params)
//海粉订单确认
export const confirmShareOrder = (params) => http.post('/sale/api/order/confirm-share-order', params)
export const confirmShareOrder = params =>
http.post('/sale/api/retail-order/confirm-share-order', params)
//删除地址
export const delAddress = (data) => http.delete('/member/api/member-address/' + data)
export const delAddress = data =>
http.delete('/member/api/member-address/' + data)
//省市区
export const areaList = (params) => http.get('system/api/area/get-level-list', { params })
export const areaList = params =>
http.get('system/api/area/get-level-list', { params })
//创客空间选择
export const list_maker = (data) => http.post('/member/api/maker-space/list-maker?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize, data )
export const list_maker = data =>
http.post(
'/member/api/maker-space/list-maker?pageNum=' +
data.pageNum +
'&pageSize=' +
data.pageSize,
data
)
// 礼包获取邮费
export const queryAdressPostage = (params) => http.post('/sale/api/order/self-order-postage', params)
export const queryAdressPostage = params =>
http.post('/sale/api/retail-order/self-order-postage', params)
// 特殊会员完善信息
export const saveSpecial = (params) => http.post('/member/api/member-special/save-special', params)
export const saveSpecial = params =>
http.post('/member/api/member-special/save-special', params)
// 下载
export const specialExport = (params) => http.post('/member/api/member-special/special-export', params,{header: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob',})
export const specialExport = params =>
http.post('/member/api/member-special/special-export', params, {
header: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob',
})
//特殊信息列表
export const specialList = (params) => http.get('/member/api/member-special/special-list', { params })
export const specialList = params =>
http.get('/member/api/member-special/special-list', { params })
// 创客空间接口
export const queryCard = (params) => http.post('/sale/api/wares/query-cabin-card', params)
export const queryCard = params =>
http.post('/sale/api/wares/query-cabin-card', params)
//复购特殊商品列表
export const makerList = (params) => http.get('/sale/api/order/list-maker-ware', { params })
export const makerList = params =>
http.get('/sale/api/retail-order/list-maker-ware', { params })

View File

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

View File

@ -656,6 +656,7 @@ export default {
this.agreementShow = [1]
this.$forceUpdate()
}
this.setPageTitle(this.specialArea)
},
onShow() {
//

File diff suppressed because it is too large Load Diff

View File

@ -53,83 +53,26 @@
<u-form-item :label="'推荐编号'" required borderBottom prop="parent">
<u-input
v-model="form.parent"
@blur="isClick == 0 ? getQuickReg() : getValidPcode()"
@blur="getValidPcode()"
border="none"
/>
</u-form-item>
<u-form-item :label="'推荐姓名'" borderBottom prop="parentName">
<u-input v-model="form.parentName" disabled border="none" />
</u-form-item>
<u-form-item
:label="'安置编号'"
required
borderBottom
prop="placeParent"
>
<u-input v-model="form.placeParent" :disabled="pt" border="none" />
</u-form-item>
<u-form-item :label="'安置姓名'" borderBottom prop="placeParentName">
<u-input v-model="form.placeParentName" disabled border="none" />
</u-form-item>
<u-form-item
:label="'安置位置'"
required
@click="!pt ? (isPlace = true) : (isPlace = false)"
borderBottom
prop="placeDeptLabel"
>
<view class="disFlex justBwn">
<u-input
v-model="form.placeDeptLabel"
:disabled="pt"
border="none"
/>
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item>
<u-form-item
v-if="userInfo.specialRegistration == 1"
:label="'会员姓名'"
required
borderBottom
prop="memberName"
>
<u-form-item label="会员昵称" required borderBottom prop="memberName">
<u-input :maxlength="40" v-model="form.memberName" border="none" />
</u-form-item>
<u-form-item
v-if="userInfo.specialRegistration == 1"
:label="'联系方式'"
required
borderBottom
prop="phone"
>
<u-form-item :label="'联系方式'" required borderBottom prop="phone">
<u-input
v-if="pkCountry == 1"
v-model="form.phone"
maxlength="11"
type="number"
border="none"
/>
<u-input v-else v-model="form.phone" maxlength="30" border="none" />
</u-form-item>
<u-form-item
v-if="userInfo.specialRegistration == 0"
:label="'会员姓名'"
required
borderBottom
prop="memberName"
>
<u-input maxlength="40" v-model="form.memberName" border="none" />
</u-form-item>
<u-form-item
v-if="userInfo.specialRegistration == 0"
:label="'联系方式'"
required
borderBottom
prop="phone"
>
<u-input v-model="form.phone" maxlength="30" border="none" />
</u-form-item>
<u-form-item
:label="'证件号码'"
borderBottom
@ -174,75 +117,7 @@
>
<u-input v-model="form.idCard" border="none" />
</u-form-item>
<u-form-item
:label="'发货方式'"
required
borderBottom
@click="pkCountry != 1 ? (isDelivery = true) : ''"
prop="deliveryWayLabel"
>
<view class="disFlex justBwn">
<u-input
v-model="form.deliveryWayLabel"
:disabled="pkCountry == 1"
border="none"
/>
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item>
<u-form-item
:label="'运输方式'"
borderBottom
@click="pkCountry != 1 ? (isTrans = true) : ''"
:required="isDeliveryWay"
prop="transTypeLabel"
>
<view class="disFlex justBwn">
<u-input
v-model="form.transTypeLabel"
:disabled="pkCountry == 1"
border="none"
/>
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item>
<u-form-item
v-if="howSure"
:label="'创客空间'"
borderBottom
required
@click="ishowSure = true"
prop="makerSpaceMemberLabel"
>
<view class="disFlex justBwn">
<u-input v-model="form.makerSpaceMemberLabel" border="none" />
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item>
<!-- <u-form-item
:label="'仓库'"
v-if="pkCountry != 1"
borderBottom
@click="isCk = true"
prop="pkStorehouseLabel"
>
<view class="disFlex justBwn">
<u-input v-model="form.pkStorehouseLabel" border="none" />
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item>
<u-form-item
:label="'会员店铺'"
v-if="pkCountry != 1"
borderBottom
@click="isDp = true"
prop="pkMemberStoreLabel"
>
<view class="disFlex justBwn">
<u-input v-model="form.pkMemberStoreLabel" border="none" />
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item> -->
<view class="subTxt" v-if="isDeliveryWay">
<view class="subTxt1">{{ '收货人信息' }}</view>
<span
@ -559,7 +434,12 @@ import address from '@/components/address.vue'
import mustAgreeMent from '@/components/mustAgreeMent.vue'
import * as api from '@/config/regiest'
import agreement from '@/components/agreement.vue'
import {
REGIEST_AREA,
UPGRADE_AREA,
REPURCHASE_AREA,
REISSUE_AREA,
} from '@/util/specialAreaMap'
export default {
components: {
'v-address': address,
@ -737,7 +617,6 @@ export default {
onLoad(options) {
const user = uni.getStorageSync('User')
this.pkCountry = user.pkSettleCountry
console.log(this.pkCountry, '....pkCountry')
this.specialArea = options.specialArea
this.shoppingArr = JSON.parse(options.shoppArr)
if (options.selTable) {
@ -774,12 +653,25 @@ export default {
this.getGenerate()
//
this.userInfo = uni.getStorageSync('User')
this.setPageTitle(this.specialArea)
},
onShow() {
//
this.getAddressList()
},
methods: {
setPageTitle(areaId) {
const areaList = [
REGIEST_AREA,
UPGRADE_AREA,
REISSUE_AREA,
REPURCHASE_AREA,
]
const title = areaList.find(item => item.id == areaId)?.name
uni.setNavigationBarTitle({
title,
})
},
toAgree() {
// agreeMent
this.$refs.agreement.openDig()
@ -855,9 +747,9 @@ export default {
//
this.getCountry()
//
this.getTransList()
// this.getTransList()
//
this.getDeliveryList()
// this.getDeliveryList()
//
this.getBank()
@ -876,8 +768,6 @@ export default {
//
this.form.parentName = this.userInfo.memberName
this.pt = false
//
this.getQuickReg()
} else {
}
if (this.pkCountry == 1) {
@ -906,77 +796,38 @@ export default {
})
},
getMember() {
let deleteList = []
this.shoppingArr.forEach(item => {
deleteList.push({
shoppingId: item,
// let deleteList = []
// this.shoppingArr.forEach(item => {
// deleteList.push({
// shoppingId: item,
// })
// })
// 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,
}
}),
})
})
this.allGoodsData.deleteList = deleteList
api.memLevel(this.allGoodsData).then(res => {
.then(res => {
this.form.pkGradeVal = res.data.pkGradeVal
})
},
checkAddress() {},
getQuickReg() {
api
.quickReg({
parent: this.form.parent,
specialArea: this.specialArea,
pkSettleCountry: this.pkCountry,
})
.then(res => {
if (res.code == 200) {
this.form.placeDept = res.data.placeDept
this.form.placeDeptLabel = res.data.placeDeptVal
this.$set(this.form, 'placeDeptLabel', res.data.placeDeptVal)
this.form.placeParent = res.data.placeParent
this.form.placeParentName = res.data.placeParentName
this.form.parentName = res.data.parentName
if (res.data.isFirst) {
//
this.pt = true
} else {
//
this.pt = false
}
//
if (this.howSure) {
this.getQueryCard()
}
this.$forceUpdate()
} else {
console.log(122)
this.$set(this.form, 'parentName', '')
}
})
},
getValidPcode() {
api
.validPcode({
parent: this.form.parent,
pkSettleCountry: this.pkCountry,
})
.then(res => {
if (res.code == 200) {
this.form.parentName = res.data.parentName
if (res.data.isFirst) {
//
this.pt = true
this.form.placeDept = res.data.placeDept
this.form.placeDeptLabel =
res.data.placeDept == 1 ? '左区' : '右区'
this.form.placeParent = res.data.placeParent
this.form.placeParentName = res.data.placeParentName
} else {
//
this.pt = false
}
//
if (this.howSure) {
this.getQueryCard()
}
this.$forceUpdate()
}
})
},
@ -1120,6 +971,7 @@ export default {
})
})
this.allGoodsData.deleteList = deleteList
this.allGoodsData.shopList = deleteList
api
.queryPostage(
Object.assign(
@ -1314,14 +1166,6 @@ export default {
},
goBuy() {
this.$refs.uForm.validate().then(res => {
// if (this.agreementShow.length == 0) {
// uni.showToast({
// title: '',
// icon: "none",
// duration: 1500,
// });
// return;
// }
this.isLoading = true
let deleteList = []
this.shoppingArr.forEach(item => {
@ -1333,6 +1177,8 @@ export default {
.confirmRegOrder(
Object.assign({}, this.form, this.allGoodsData, {
deleteList: deleteList,
shopList: deleteList,
parentCode: this.form.parent,
})
)
.then(res => {
@ -1342,10 +1188,7 @@ export default {
url:
'/pages/pay/index?paramsPost=' +
JSON.stringify(
Object.assign(
{ makerSpaceMember: this.form.makerSpaceMember },
res.data
)
Object.assign({ specialArea: this.specialArea }, res.data)
) +
'&businessType=1',
})

View File

@ -17,41 +17,74 @@
<img :src="pkCountryImg" alt="" />
<u-icon name="arrow-down" color="#999"></u-icon>
</view>
<u-scroll-list :indicator="false" v-if="itemChildren.length > 1" class="tabList_a">
<u-scroll-list
:indicator="false"
v-if="itemChildren.length > 1"
class="tabList_a"
>
<view class="tab">
<view v-for="(item, index) in itemChildren" :key="index" @click="setSpecial(item)" v-show="item.isShow"
:class="[specialArea == item.value ? 'actTab' : 'tab_i']">
<view
v-for="(item, index) in itemChildren"
:key="index"
@click="setSpecial(item)"
v-show="item.isShow"
:class="[specialArea == item.value ? 'actTab' : 'tab_i']"
>
<view>{{ item.label }}</view>
</view>
</view>
</u-scroll-list>
<view class="index_btm">
<view class="index_l">
<view v-for="item in oneList" :class="['classIfy', oneId == item.pkId ? 'actOne' : '']" @click="
(oneId = item.pkId),
<view
v-for="item in oneList"
:class="['classIfy', oneId == item.pkId ? 'actOne' : '']"
@click="
((oneId = item.pkId),
getAllGoods(item.pkId),
getClassIfyTwo(item.pkId)
" :key="item.pkId">{{ item.classifyName }}</view>
getClassIfyTwo(item.pkId))
"
:key="item.pkId"
>{{ item.classifyName }}</view
>
</view>
<view class="index_r">
<u-scroll-list :indicator="false" class="tabList">
<view class="tab">
<view v-for="(item, index) in twoList" :key="index"
@click="(twoId = item.pkId), getAllGoods1(item.pkId)"
:class="[twoId == item.pkId ? 'actTab' : 'tab_i']">
<view
v-for="(item, index) in twoList"
:key="index"
@click="((twoId = item.pkId), getAllGoods1(item.pkId))"
:class="[twoId == item.pkId ? 'actTab' : 'tab_i']"
>
<view>{{ item.classifyName }}</view>
<!-- <view :class="[twoId == item.pkId ? 'heng' : 'heng1']"></view> -->
</view>
</view>
</u-scroll-list>
<view class="search">
<u--input placeholder="请输入商品名称" placeholderStyle="font-size:14px;" prefixIcon="search"
shape="circle" v-model="waresName" border="none" @confirm="getAllGoods1()"
prefixIconStyle="font-size: 22px;color: #909399"></u--input>
<u--input
placeholder="请输入商品名称"
placeholderStyle="font-size:14px;"
prefixIcon="search"
shape="circle"
v-model="waresName"
border="none"
@confirm="getAllGoods1()"
prefixIconStyle="font-size: 22px;color: #909399"
></u--input>
</view>
<view class="goodList">
<view v-for="item in goodList" :key="item.waresCode" class="goodList_i" @tap="goDetails(item)">
<view class="fly" v-show="item.preSaleStatus == 3 || item.isSale == 1"></view>
<view
v-for="item in goodList"
:key="item.waresCode"
class="goodList_i"
@tap="goDetails(item)"
>
<view
class="fly"
v-show="item.preSaleStatus == 3 || item.isSale == 1"
></view>
<img :src="item.cover1" class="cover" alt="" />
<view class="goodList_ir">
<view>
@ -60,14 +93,24 @@
}}</span>
{{ item.waresName }}
</view>
<view class="pv"
v-if="specialArea != 18 && specialArea != 13&& specialArea != 31&& specialArea != 10">
<view
class="pv"
v-if="
specialArea != 18 &&
specialArea != 13 &&
specialArea != 31 &&
specialArea != 10
"
>
业绩:{{ item.waresAchieve | numberToCurrency }}
</view>
<view class="pv" v-if="specialArea ==10">
<view class="pv" v-if="specialArea == 10">
积分可抵扣:{{ item.deductMoney | numberToCurrency }}
</view>
<view class="pv" v-if="specialArea == 31&&userInfo.isMakerSpace == 0">
<view
class="pv"
v-if="specialArea == 31 && userInfo.isMakerSpace == 0"
>
业绩:{{ item.waresAchieve | numberToCurrency }}
</view>
<view class="pv" v-if="specialArea == 13">
@ -75,18 +118,38 @@
</view>
<!-- <view class="pv"> 销量:{{ item.sales | seles }} </view> -->
<view class="goodList_ib">
<view v-if="specialArea == 31&&userInfo.isMakerSpace == 1">
<view v-if="specialArea == 31 && userInfo.isMakerSpace == 1">
{{ item.vipPrice | numberToCurrency }}
</view>
<view v-if="(specialArea == 31&&userInfo.isMakerSpace == 0)||specialArea !=31">
<view
v-if="
(specialArea == 31 && userInfo.isMakerSpace == 0) ||
specialArea != 31
"
>
{{ item.waresPrice | numberToCurrency }}
</view>
<img @click.stop="addCar(item)"
v-show="item.preSaleStatus != 3 && item.isSale != 1&&specialArea != 31"
src="@/static/images/cart.png" alt="" />
<img @click.stop="addCar(item)"
v-show="item.preSaleStatus != 3 && item.isSale != 1&&specialArea == 31&&userInfo.isMakerSpace == 0"
src="@/static/images/cart.png" alt="" />
<img
@click.stop="addCar(item)"
v-show="
item.preSaleStatus != 3 &&
item.isSale != 1 &&
specialArea != 31
"
src="@/static/images/cart.png"
alt=""
/>
<img
@click.stop="addCar(item)"
v-show="
item.preSaleStatus != 3 &&
item.isSale != 1 &&
specialArea == 31 &&
userInfo.isMakerSpace == 0
"
src="@/static/images/cart.png"
alt=""
/>
</view>
<!-- <view class="pv" v-show="specialArea == 31"> 统一零售价:{{ item.retailPrice| numberToCurrency | isLocal}} </view> -->
</view>
@ -95,27 +158,33 @@
</view>
</view>
</view>
<u-picker :show="isCountry" @cancel="isCountry = false" @confirm="sureCountry" :columns="countryList"
keyName="label"></u-picker>
<u-picker
:show="isCountry"
@cancel="isCountry = false"
@confirm="sureCountry"
:columns="countryList"
keyName="label"
></u-picker>
<selSpaceGoods ref="selSpaceGoods" @getCar="getCatLength"></selSpaceGoods>
<cartBall ref="cart" :carLength="shopCarLength" :specialArea="specialArea"></cartBall>
<cartBall
ref="cart"
:carLength="shopCarLength"
:specialArea="specialArea"
></cartBall>
</view>
</template>
<script>
import backIcon from "@/components/backIcon.vue";
import cartBall from "@/components/cartBall.vue";
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 backIcon from '@/components/backIcon.vue'
import cartBall from '@/components/cartBall.vue'
import { mapGetters, mapActions } from 'vuex'
import * as api from '@/config/goods'
import clTabbar from '@/components/cl-tabbar.vue'
import selSpaceGoods from '@/components/selSpaceGoods.vue'
export default {
export default {
components: {
"cl-tabbar": clTabbar,
'cl-tabbar': clTabbar,
backIcon,
cartBall,
selSpaceGoods,
@ -124,9 +193,9 @@
filters: {
seles(value) {
if (value > 999) {
return 999 + "+";
return 999 + '+'
} else {
return value;
return value
}
},
},
@ -134,88 +203,93 @@
return {
specialArea: 1,
oneList: [],
oneId: "",
oneId: '',
twoList: [],
twoId: "",
twoId: '',
goodList: [],
titLabel: "",
titLabel: '',
itemChildren: [],
diff: 0,
shopCarLength: false,
userInfo: {},
pkCountry: 1,
pkCountryLabel: "",
pkCountryImg: "",
pkCountryLabel: '',
pkCountryImg: '',
countryList: [],
isCountry: false,
waresName: "",
};
waresName: '',
}
},
onLoad(options) {
console.log('%c [ options ]-25', 'font-size:13px; background:#cb38d2; color:#ff7cff;', options)
if (JSON.parse(options.children).length > 0) {
let arr = [];
let arr = []
if (options.childArea) {
this.specialArea = 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);
arr.push(item.value)
}
});
this.specialArea = arr[0];
})
this.specialArea = arr[0]
// this.diff = 0
}
if (options.diff) {
this.diff = options.diff;
this.diff = options.diff
}
} else {
this.specialArea = options.specialArea;
this.specialArea = options.specialArea
}
this.titLabel = options.label;
let tempArr = JSON.parse(options.children);
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;
});
api.menuList().then(res => {
tempArr = tempArr.filter(item =>
res.data.find(ctem => ctem.menuKey == item.name)
)
this.itemChildren = tempArr
})
}
//
uni.setNavigationBarTitle({
title: this.titLabel,
success: () => {},
});
})
//
// this.getClassIfy()
this.userInfo = uni.getStorageSync("User");
console.log('%c [ this.userInfo ]-242', 'font-size:13px; background:#cb38d2; color:#ff7cff;', this.userInfo)
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");
if (uni.getStorageSync('pkCountry')) {
this.pkCountry = uni.getStorageSync('pkCountry')
} else {
this.pkCountry = this.userInfo.pkSettleCountry;
uni.setStorageSync("pkCountry", this.pkCountry + "");
this.pkCountry = this.userInfo.pkSettleCountry
uni.setStorageSync('pkCountry', this.pkCountry + '')
}
} else {
this.pkCountry = this.userInfo.pkSettleCountry;
this.pkCountry = this.userInfo.pkSettleCountry
}
this.setSpecial({
value: this.specialArea
});
value: this.specialArea,
})
},
onShow() {
let that = this;
uni.$on("returnData", function(data) {
that.specialArea = data.value;
let that = this
uni.$on('returnData', function (data) {
that.specialArea = data.value
that.setSpecial({
value: data.value
});
});
value: data.value,
})
})
//
this.getJScountry();
this.getJScountry()
this.$nextTick(() => {
this.$refs.cart.getCar()
})
@ -231,43 +305,41 @@
methods: {
...mapActions(['setSmallCarLength', 'setShopCarLength']),
changeCountry() {
this.isCountry = true;
this.isCountry = true
},
sureCountry(e) {
const {
value
} = e;
this.pkCountry = value[0].id;
this.pkCountryLabel = value[0].label;
this.pkCountryImg = value[0].img;
this.isCountry = false;
uni.setStorageSync("pkCountry", this.pkCountry + "");
const { value } = e
this.pkCountry = value[0].id
this.pkCountryLabel = value[0].label
this.pkCountryImg = value[0].img
this.isCountry = false
uni.setStorageSync('pkCountry', this.pkCountry + '')
//
this.getClassIfy();
this.$refs.cart.getCar();
this.getClassIfy()
this.$refs.cart.getCar()
},
getJScountry() {
api.currencyList().then((res) => {
let data = res.data.map((item) => {
api.currencyList().then(res => {
let data = res.data.map(item => {
return {
img: item.nationalFlag2,
id: item.pkId,
label: item.shortName,
};
});
this.countryList = [data];
this.countryList[0].forEach((item) => {
if (item.id == this.pkCountry) {
this.pkCountryLabel = item.label;
this.pkCountryImg = item.img;
}
});
});
})
this.countryList = [data]
this.countryList[0].forEach(item => {
if (item.id == this.pkCountry) {
this.pkCountryLabel = item.label
this.pkCountryImg = item.img
}
})
})
},
goShare() {
uni.navigateTo({
url: "/pages/specialArea/share?specialArea=7",
});
url: '/pages/specialArea/share?specialArea=7',
})
},
setSpecial(item) {
if (item.value == 21) {
@ -279,8 +351,8 @@
// JSON.stringify(this.itemChildren),
// })
} else {
this.specialArea = item.value;
this.getClassIfy();
this.specialArea = item.value
this.getClassIfy()
}
},
addCar(item) {
@ -290,35 +362,35 @@
number: 1,
waresCode: item.waresCode,
productGroup: item.productGroup,
};
}
if (
item.isMakerGift == 2 &&
(item.specialArea == 1 || item.specialArea == 3)
) {
this.$refs.selSpaceGoods.getData(carList);
this.$refs.selSpaceGoods.getData(carList)
} else {
api.addShopping(carList).then((res) => {
api.addShopping(carList).then(res => {
if (res.code == 200) {
uni.showToast({
title: '购物车添加成功',
icon: "success",
icon: 'success',
mask: true,
});
})
setTimeout(() => {
this.$store
.dispatch("getCarLength", this.specialArea)
.then((res) => {
this.shopCarLength = res.data.smallCount;
});
}, 200);
.dispatch('getCarLength', this.specialArea)
.then(res => {
this.shopCarLength = res.data.smallCount
})
}, 200)
}
});
})
}
},
getCatLength() {
this.$store.dispatch("getCarLength", this.specialArea).then((res) => {
this.shopCarLength = res.data.smallCount;
});
this.$store.dispatch('getCarLength', this.specialArea).then(res => {
this.shopCarLength = res.data.smallCount
})
},
getClassIfy() {
api
@ -327,16 +399,16 @@
specialArea: this.specialArea,
hierarchy: 0,
})
.then((res) => {
.then(res => {
res.data.unshift({
classifyName: '全部',
pkId: "",
});
this.oneList = res.data;
this.oneId = this.oneList[0]?this.oneList[0].pkId : '';
this.getClassIfyTwo(this.oneList[0].pkId);
this.getAllGoods(this.oneList[0].pkId);
});
pkId: '',
})
this.oneList = res.data
this.oneId = this.oneList[0] ? this.oneList[0].pkId : ''
this.getClassIfyTwo(this.oneList[0].pkId)
this.getAllGoods(this.oneList[0].pkId)
})
},
//
getClassIfyTwo(pkId) {
@ -347,30 +419,30 @@
hierarchy: 1,
pkCountry: this.pkCountry,
})
.then((res) => {
.then(res => {
res.data.unshift({
classifyName: '全部',
pkId: pkId,
});
this.twoList = res.data;
this.twoId = pkId;
});
})
this.twoList = res.data
this.twoId = pkId
})
},
getAllGoods(id) {
api
.getAllGoods({
pkCountry: this.pkCountry,
specialArea: Number(this.specialArea),
pkAreaClassify: id ? id : "",
pkAreaClassify: id ? id : '',
})
.then((res) => {
this.goodList = res.data;
this.goodList.forEach((item) => {
.then(res => {
this.goodList = res.data
this.goodList.forEach(item => {
if (item.waresName.length > 11) {
item.waresName = item.waresName.substring(0, 11) + "...";
item.waresName = item.waresName.substring(0, 11) + '...'
}
});
});
})
})
},
getAllGoods1(id) {
api
@ -380,58 +452,64 @@
waresName: this.waresName,
pkAreaClassify: id ? id : this.oneId,
})
.then((res) => {
this.goodList = res.data;
this.goodList.forEach((item) => {
.then(res => {
this.goodList = res.data
this.goodList.forEach(item => {
if (item.waresName.length > 11) {
item.waresName = item.waresName.substring(0, 11) + "...";
item.waresName = item.waresName.substring(0, 11) + '...'
}
});
});
})
})
},
goDetails(item) {
if (item.preSaleStatus != 3 && item.isSale != 1) {
uni.navigateTo({
url: "/pages/specialArea/details?waresCode=" +
url:
'/pages/specialArea/details?waresCode=' +
item.waresCode +
"&specialArea=" +
'&specialArea=' +
item.specialArea,
});
})
}
},
},
};
}
</script>
<style lang="scss" scoped>
.index_header {
.index_header {
background: #fff;
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;
padding: 10px 0;
}
}
.content {
.content {
background: #f9f9f9;
height: 93vh;
display: flex;
flex-direction: column;
overflow: hidden;
}
}
.tabList_a {}
.tabList_a {
}
.index_btm {
.index_btm {
flex: 1; // display: flex;
.index_l {
width: 198rpx;
padding: 10rpx 0;
font-size: 11px;
font-family: PingFang SC-Regular, PingFang SC;
font-family:
PingFang SC-Regular,
PingFang SC;
font-weight: 400;
color: #000000;
overflow-y: auto;
@ -448,33 +526,31 @@
margin-left: 198rpx; // padding: 20rpx;
// display: flex;
}
}
}
.classIfy {
.classIfy {
padding: 20rpx 20rpx;
margin: 20rpx 0;
font-size: 26rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
}
}
.actOne {
.actOne {
// border-left: 6rpx solid #005BAC;
color: #fff;
background: #005BAC;
}
background: #005bac;
}
.tab {
.tab {
display: flex;
align-items: center;
padding: 0 24rpx;
margin-top: 20rpx;
}
}
.tab_i {
.tab_i {
// width: 120rpx;
text-align: center;
font-size: 14px;
@ -495,16 +571,18 @@
line-height: 1;
height: 58rpx;
box-sizing: border-box;
}
}
.actTab {
.actTab {
// width: 120rpx;
text-align: center;
font-size: 14px;
font-family: PingFang SC-Semibold, PingFang SC;
font-family:
PingFang SC-Semibold,
PingFang SC;
font-weight: 600;
// color: #005BAC;
background-color: #005BAC;
background-color: #005bac;
color: #fff;
margin-right: 28rpx;
white-space: nowrap;
@ -519,41 +597,41 @@
line-height: 1;
height: 58rpx;
box-sizing: border-box;
}
}
.heng {
.heng {
width: 24px;
height: 2px;
background: #005BAC;
background: #005bac;
border-radius: 1px 1px 1px 1px;
margin-top: 4rpx;
}
}
.heng1 {
.heng1 {
width: 24px;
height: 2px;
background: f9f9f9;
border-radius: 1px 1px 1px 1px;
margin-top: 4rpx;
}
}
.heng2 {
.heng2 {
width: 24px;
height: 2px;
background: f9f9f9;
border-radius: 1px 1px 1px 1px;
margin-top: 4rpx;
}
}
::v-deep .u-scroll-list {
::v-deep .u-scroll-list {
padding-bottom: 10rpx;
}
}
.zhan {
.zhan {
height: 200px;
}
}
.goodList {
.goodList {
padding: 0 20rpx;
height: 95vh;
overflow-y: auto;
@ -608,24 +686,24 @@
border: 1px solid #eeeeee;
border-radius: 10rpx;
}
}
}
.pv {
.pv {
font-size: 22rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #999999;
}
}
.shareImg {
.shareImg {
position: fixed;
margin: 14rpx 24rpx;
z-index: 9999;
right: 20rpx;
top: 5rpx;
}
}
.shareImg1 {
.shareImg1 {
position: fixed;
margin: 14rpx 24rpx;
z-index: 1;
@ -639,9 +717,9 @@
height: 30rpx;
margin-right: 20rpx;
}
}
}
.qzbq {
.qzbq {
background: #d61820;
border-radius: 2px 2px 2px 2px;
font-size: 10px;
@ -650,13 +728,13 @@
color: #ffffff;
padding: 0px 5px;
margin-right: 5px;
}
}
.search {
.search {
margin: 10rpx 20rpx;
padding: 10rpx;
background: #eeeeee;
border-radius: 20px;
font-size: 14px;
}
}
</style>