Compare commits

..

No commits in common. "bbcbd9ef973c8bd7a260276e46d842c55bb5ca9e" and "9a46dfe0effec98c308ea8480476c153600207b1" have entirely different histories.

18 changed files with 376 additions and 980 deletions

View File

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

13
App.vue
View File

@ -1,3 +1,4 @@
<script> <script>
import { setToken } from '@/config/auth.js' import { setToken } from '@/config/auth.js'
export default { export default {
@ -8,7 +9,7 @@ export default {
setToken(options.query?.token) setToken(options.query?.token)
} }
const whiteList = [ const whiteList = [
'pages/shareRegist/index', // 'pages/shareRegist/index',
// 'pages/shareRegist/success', // 'pages/shareRegist/success',
'pages/login/index', 'pages/login/index',
// 'pages/wechatPay/bfPay/', // 'pages/wechatPay/bfPay/',
@ -30,13 +31,13 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
body { body{
background-color: #f2f2f2; background-color: #f2f2f2;
} }
/*每个页面公共css */ /*每个页面公共css */
@import '@/uni_modules/uview-ui/index.scss'; @import '@/uni_modules/uview-ui/index.scss';
::v-deep .uni-picker-container { ::v-deep .uni-picker-container{
z-index: 100000 !important; z-index: 100000!important;
} }
</style> </style>

View File

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

View File

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

View File

@ -152,13 +152,6 @@
<script> <script>
import * as api from '@/config/goods' 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 { export default {
data() { data() {
@ -352,9 +345,8 @@ export default {
}) })
uni.setStorageSync('allGoods', JSON.stringify(shoppArr)) uni.setStorageSync('allGoods', JSON.stringify(shoppArr))
if ( if (
[REGIEST_AREA.id, UPGRADE_AREA.id].includes( this.goodsCheck[0].specialArea == 1 ||
this.goodsCheck[0].specialArea this.goodsCheck[0].specialArea == 24
)
) { ) {
let deleteList = [] let deleteList = []
shoppArr.forEach(item => { shoppArr.forEach(item => {
@ -438,6 +430,22 @@ 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 { } else {
uni.navigateTo({ uni.navigateTo({
url: url:

View File

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

View File

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

View File

@ -1,22 +0,0 @@
const http = uni.$u.http
// 获取分享码
export const getShareCode = params =>
http.get('/member/api/share/share-code', { params })
// 根据短码获取memberCode
export const getMemberCode = code =>
http.get(`/member/api/share/find-share-code/${code}`)
// 获取手机验证码
export const getPhoneCode = params =>
http.get('/member/api/share/share-sms-code', { params })
// 注册
export const getRegister = data =>
http.post('/member/api/share/share-register', data)
// 自动登录
export const autoLogin = data =>
http.post('/retail-member/api/retail-auth/auto-login', data)

7
package-lock.json generated
View File

@ -17,7 +17,6 @@
"js-cookie": "^3.0.5", "js-cookie": "^3.0.5",
"qrcodejs2": "0.0.2", "qrcodejs2": "0.0.2",
"swiper": "^3.4.2", "swiper": "^3.4.2",
"uqrcodejs": "^4.0.7",
"vue-clipboard2": "^0.3.3", "vue-clipboard2": "^0.3.3",
"vue-i18n": "^9.2.2", "vue-i18n": "^9.2.2",
"vue-tree-color": "^2.3.2", "vue-tree-color": "^2.3.2",
@ -6374,12 +6373,6 @@
"yarn": "*" "yarn": "*"
} }
}, },
"node_modules/uqrcodejs": {
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/uqrcodejs/-/uqrcodejs-4.0.7.tgz",
"integrity": "sha512-84+aZmD2godCVI+93lxE3YUAPNY8zAJvNA7xRS7R7U+q57KzMDepBSfNCwoRUhWOfR6eHFoAOcHRPwsP6ka1cA==",
"license": "Apache-2.0"
},
"node_modules/uri-js": { "node_modules/uri-js": {
"version": "4.4.1", "version": "4.4.1",
"resolved": "https://mirrors.cloud.tencent.com/npm/uri-js/-/uri-js-4.4.1.tgz", "resolved": "https://mirrors.cloud.tencent.com/npm/uri-js/-/uri-js-4.4.1.tgz",

View File

@ -12,7 +12,6 @@
"js-cookie": "^3.0.5", "js-cookie": "^3.0.5",
"qrcodejs2": "0.0.2", "qrcodejs2": "0.0.2",
"swiper": "^3.4.2", "swiper": "^3.4.2",
"uqrcodejs": "^4.0.7",
"vue-clipboard2": "^0.3.3", "vue-clipboard2": "^0.3.3",
"vue-i18n": "^9.2.2", "vue-i18n": "^9.2.2",
"vue-tree-color": "^2.3.2", "vue-tree-color": "^2.3.2",

View File

@ -262,14 +262,10 @@
"path": "pages/shareRegist/index", "path": "pages/shareRegist/index",
"style": { "style": {
"navigationBarTitleText": "注册", "navigationBarTitleText": "注册",
"navigationBarBackgroundColor": "#fff" "navigationBarBackgroundColor": "#F33030",
} "app-plus": {
}, "titleNView": false
{ }
"path": "pages/mine/share/index",
"style": {
"navigationBarTitleText": "个人推广二维码",
"navigationBarBackgroundColor": "#fff"
} }
}, },
{ {

View File

@ -403,13 +403,6 @@ export default {
menuKey: 'selfHelp', menuKey: 'selfHelp',
ifshow: false, ifshow: false,
}, },
{
url: '/pages/mine/share/index',
name: '个人推广',
imgurl: '../../static/images/promotion.svg',
menuKey: 'share',
ifshow: true,
},
{ {
url: '/pages/userSecure/index', url: '/pages/userSecure/index',
name: '账号安全', name: '账号安全',

View File

@ -1,456 +0,0 @@
<template>
<view class="share-container">
<!-- This is the content that will be shared as an image -->
<view class="share-content" :class="{ 'is-loaded': isLoaded }">
<view class="title">扫码注册</view>
<image
class="qr-code"
:src="qrCodeImage"
mode="aspectFit"
v-if="qrCodeImage"
></image>
<view v-else class="qr-code-placeholder">
<view class="loader"></view>
</view>
<view class="tip">扫描二维码即可完成操作</view>
</view>
<button
class="share-button"
:class="{ 'is-loaded': isLoaded }"
@click="sharePage"
>
保存图片并分享
</button>
<!-- Canvas for generating the share image, positioned off-screen -->
<canvas
canvas-id="shareCanvas"
:style="{
width: canvasWidth + 'px',
height: canvasHeight + 'px',
position: 'fixed',
left: '200%',
}"
/>
</view>
</template>
<script>
import { getShareCode } from '@/config/share'
export default {
name: 'ShareQRCode',
data() {
return {
qrCodeImage: '',
// Set canvas dimensions. It's better to get device screen width for this.
canvasWidth: 375,
canvasHeight: 550,
isLoaded: false,
}
},
onLoad() {
this.handleGetShareCode()
// Get screen width to set canvas width dynamically
uni.getSystemInfo({
success: res => {
this.canvasWidth = res.windowWidth
// Adjust height proportionally or keep it fixed
this.canvasHeight = res.windowWidth * 1.4
},
})
},
onReady() {
// Use a short timeout to ensure the initial render is complete before animation
setTimeout(() => {
this.isLoaded = true
}, 100)
},
methods: {
handleGetShareCode() {
// Don't show loading toast, use the placeholder loader instead
// uni.showLoading({ title: '...' })
getShareCode()
.then(res => {
// The screenshot shows the base64 string is in data.datStr
if (res.code === 200 && res.data && res.data.dataStr) {
this.qrCodeImage = 'data:image/png;base64,' + res.data.dataStr
} else {
uni.showToast({
title: '获取分享码失败',
icon: 'none',
})
}
})
.catch(err => {
console.error('getShareCode error:', err)
uni.showToast({
title: '网络错误,请稍后再试',
icon: 'none',
})
})
},
async sharePage() {
if (!this.qrCodeImage) {
uni.showToast({
title: '二维码尚未生成',
icon: 'none',
})
return
}
uni.showLoading({ title: '正在生成图片...' })
try {
const tempImagePath = await this.base64ToTempFilePath(this.qrCodeImage)
if (!tempImagePath) {
throw new Error('图片处理失败')
}
const ctx = uni.createCanvasContext('shareCanvas', this)
this.drawShareImage(ctx, tempImagePath)
ctx.draw(false, () => {
this.saveCanvasToAlbum()
})
} catch (error) {
uni.hideLoading()
uni.showToast({ title: error.message || '图片生成失败', icon: 'none' })
console.error('sharePage error:', error)
}
},
drawShareImage(ctx, tempImagePath) {
const canvasWidth = this.canvasWidth
const canvasHeight = this.canvasHeight
// White background
ctx.fillStyle = '#FFFFFF'
ctx.fillRect(0, 0, canvasWidth, canvasHeight)
// Title
ctx.setFontSize(22)
ctx.fillStyle = '#1e1e1e'
ctx.textAlign = 'center'
ctx.fillText('扫码注册', canvasWidth / 2, 70)
// QR Code Image
const qrCodeSize = canvasWidth * 0.7
const qrCodeX = (canvasWidth - qrCodeSize) / 2
const qrCodeY = 120
ctx.drawImage(tempImagePath, qrCodeX, qrCodeY, qrCodeSize, qrCodeSize)
// Tip text
ctx.setFontSize(15)
ctx.fillStyle = '#888'
ctx.textAlign = 'center'
ctx.fillText(
'扫描二维码,即可完成操作',
canvasWidth / 2,
qrCodeY + qrCodeSize + 50
)
},
saveCanvasToAlbum() {
uni.canvasToTempFilePath(
{
canvasId: 'shareCanvas',
success: res => {
// #ifdef H5
// For H5, trigger download instead of saving to album
const link = document.createElement('a')
link.href = res.tempFilePath
link.download = `share_qrcode_${Date.now()}.png`
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
uni.hideLoading()
uni.showToast({
title: '图片已开始下载',
icon: 'success',
})
// #endif
// #ifndef H5
// For App and Mini Programs
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: () => {
uni.hideLoading()
uni.showToast({
title: '图片已保存到相册',
icon: 'success',
})
},
fail: err => {
uni.hideLoading()
if (
err.errMsg &&
(err.errMsg.includes('auth deny') ||
err.errMsg.includes('auth denied'))
) {
uni.showModal({
title: '提示',
content: '需要您授权保存相册',
showCancel: false,
success: () => {
uni.openSetting({
success(settingdata) {
if (
settingdata.authSetting['scope.writePhotosAlbum']
) {
uni.showToast({
title: '授权成功,请重试',
icon: 'none',
})
} else {
uni.showToast({
title: '获取权限失败',
icon: 'none',
})
}
},
})
},
})
} else {
uni.showToast({ title: '保存失败', icon: 'none' })
console.error('saveImageToPhotosAlbum fail:', err)
}
},
})
// #endif
},
fail: err => {
uni.hideLoading()
uni.showToast({ title: '图片转换失败', icon: 'none' })
console.error('canvasToTempFilePath fail:', err)
},
},
this
)
},
base64ToTempFilePath(base64) {
return new Promise((resolve, reject) => {
// #ifdef H5
// For H5, we load the base64 into an Image to ensure it's valid,
// but resolve with the base64 string to avoid Uniapp's internal errors
// when its functions expect a string path instead of an Image object.
const image = new Image()
// Resolve CORS issue for QR code from different origin
image.crossOrigin = 'Anonymous'
image.src = base64
image.onload = () => {
// Resolve with the string, not the object.
resolve(base64)
}
image.onerror = err => {
console.error('Failed to load image for canvas on H5', err)
reject(new Error('H5图片加载失败'))
}
// #endif
// #ifndef H5
// For App and Mini Programs, write to a temp file and return the path.
const formattedBase64 = base64.replace(/^data:image\/\w+;base64,/, '')
// Use a standard path for user data directory.
const filePath = `${uni.env.USER_DATA_PATH}/share_${Date.now()}.png`
uni.getFileSystemManager().writeFile({
filePath,
data: formattedBase64,
encoding: 'base64',
success: () => {
resolve(filePath)
},
fail: err => {
console.error('Failed to write temp file', err)
reject(new Error('临时文件写入失败'))
},
})
// #endif
})
},
},
}
</script>
<style lang="scss" scoped>
.share-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 40rpx;
background: linear-gradient(to bottom, #e0f7fa 0%, #ffffff 100%);
min-height: 100vh;
box-sizing: border-box;
position: relative;
overflow: hidden;
}
@keyframes float {
0% {
transform: translateY(0px) scale(1);
opacity: 0.7;
}
50% {
transform: translateY(-20px) scale(1.03);
opacity: 1;
}
100% {
transform: translateY(0px) scale(1);
opacity: 0.7;
}
}
.share-container::before,
.share-container::after {
content: '';
position: absolute;
border-radius: 50%;
background: linear-gradient(
to top,
rgba(0, 198, 255, 0.05),
rgba(0, 114, 255, 0.1)
);
z-index: 1;
pointer-events: none;
}
.share-container::before {
width: 400rpx;
height: 400rpx;
top: -150rpx;
left: -150rpx;
animation: float 12s ease-in-out infinite;
}
.share-container::after {
width: 500rpx;
height: 500rpx;
bottom: -200rpx;
right: -200rpx;
animation: float 15s ease-in-out infinite -5s;
}
.share-content {
background: radial-gradient(
circle at 50% 0%,
rgba(220, 235, 255, 0.9),
#ffffff 80%
);
border-radius: 30rpx;
padding: 80rpx 50rpx;
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
box-shadow:
0 16rpx 48rpx rgba(0, 0, 0, 0.1),
inset 0 1px 2px rgba(255, 255, 255, 0.7);
margin-bottom: 60rpx;
position: relative;
z-index: 2;
opacity: 0;
transform: translateY(40rpx);
transition:
transform 0.6s cubic-bezier(0.25, 1, 0.5, 1),
opacity 0.6s ease;
overflow: hidden;
}
.share-content::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 6rpx;
background-image: linear-gradient(90deg, #00c6ff, #0072ff);
opacity: 0.9;
}
.share-content.is-loaded {
opacity: 1;
transform: translateY(0);
}
.title {
font-size: 44rpx;
font-weight: 500;
color: #1e1e1e;
margin-bottom: 60rpx;
}
.qr-code {
width: 450rpx;
height: 450rpx;
margin-bottom: 30rpx;
border-radius: 16rpx;
}
.qr-code-placeholder {
width: 450rpx;
height: 450rpx;
background-color: #f0f2f5;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 30rpx;
border-radius: 16rpx;
}
.loader {
width: 100rpx;
height: 100rpx;
border: 8rpx solid rgba(0, 0, 0, 0.1);
border-left-color: #0072ff;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.tip {
font-size: 30rpx;
color: #888;
}
.share-button {
margin-top: 0;
width: 90%;
background-image: linear-gradient(90deg, #0072ff, #00c6ff);
color: white;
border-radius: 50rpx;
font-size: 34rpx;
height: 100rpx;
line-height: 100rpx;
box-shadow: 0 10rpx 20rpx rgba(0, 114, 255, 0.25);
border: none;
transition:
transform 0.2s ease,
box-shadow 0.2s ease;
z-index: 2;
opacity: 0;
transform: translateY(40rpx);
transition:
transform 0.6s cubic-bezier(0.25, 1, 0.5, 1) 0.1s,
opacity 0.6s ease 0.1s;
}
.share-button.is-loaded {
opacity: 1;
transform: translateY(0);
}
.share-button:active {
transform: translateY(2rpx);
box-shadow: 0 6rpx 12rpx rgba(0, 114, 255, 0.3);
}
</style>

View File

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

View File

@ -1,88 +1,97 @@
<!-- <!--
* @Descripttion: * @Descripttion:
* @version: * @version:
* @Author: kBank * @Author: kBank
* @Date: 2022-11-21 15:11:22 * @Date: 2022-11-21 15:11:22
--> -->
<template> <template>
<view> <view >
<view v-if="!pkCountry" class="content1"> <view v-if="!pkCountry" class="content1">
<!-- <view class="index_header"> <!-- <view class="index_header">
<view>注册</view> <view>注册</view>
</view> --> </view> -->
<view class="title">欢迎注册</view> <!-- <view class="tit" v-if="!pkCountry">{{ '嗨粉扫天下' }}</view> -->
<!-- <view class="tit" v-if="!pkCountry">{{ '嗨粉扫天下' }}</view> --> <!-- 海粉 -->
<!-- 海粉 --> <view class="formed1"
<view class="formed1"> >
<u-form :model="form" labelWidth="90px" ref="uForm" :rules="rules"> <u-form :model="form"
<u-form-item label="推荐编号" prop="parentCode"> labelWidth="80px"
<u-input v-model="form.parentCode" disabled> </u-input> ref="uForm"
</u-form-item> :rules="rules">
<u-form-item label="会员姓名" prop="memberName"> <u-form-item label=""
<u-input prop="memberCode">
v-model="form.memberName" <u-input v-model="form.memberCode"
:placeholder="'请输入会员姓名'" type="number"
/> disabled>
</u-form-item> <u--text :text="howHeader"
<u-form-item label="联系方式" prop="phone"> slot="prefix"
<u-input margin="0 3px 0 0"
v-model="form.phone" type="tips"></u--text>
:placeholder="'请输入联系方式'" </u-input>
type="number" </u-form-item>
maxlength="20" <u-form-item label=""
/> prop="memberName">
</u-form-item> <u-input v-model="form.memberName"
:placeholder="'请输入会员姓名'" />
<u-form-item label="登录密码" prop="loginPwd"> </u-form-item>
<u-input <u-form-item label=""
:password="isPwd" prop="phone">
:placeholder="'请输入登录密码'" <u-input v-model="form.phone" @blur="setMemberCode"
v-model="form.loginPwd" :placeholder="'请输入联系方式'" type="number" maxlength="20" />
> </u-form-item>
<template #suffix>
<u-icon name="eye" @tap="isPwd = !isPwd" v-if="!isPwd"></u-icon> <u-form-item label=""
<u-icon name="eye-off" @tap="isPwd = !isPwd" v-else></u-icon> prop="loginPassword">
</template> <u-input :password="isPwd"
</u-input> :placeholder="'请输入登录密码'"
</u-form-item> v-model="form.loginPassword">
<u-form-item label="支付密码" prop="payPwd"> <template slot="suffix">
<u-input <u-icon name="eye"
:password="isPwd2" @tap="isPwd=!isPwd"
:placeholder="'请输入支付密码'" v-if="!isPwd"></u-icon>
v-model="form.payPwd" <u-icon name="eye-off"
> @tap="isPwd=!isPwd"
<template #suffix> v-else></u-icon>
<u-icon </template>
name="eye" </u-input>
@tap="isPwd2 = !isPwd2" </u-form-item>
v-if="!isPwd2" <u-form-item label=""
></u-icon> prop="payPassword">
<u-icon name="eye-off" @tap="isPwd2 = !isPwd2" v-else></u-icon> <u-input :password="isPwd2"
</template> :placeholder="'请输入支付密码'"
</u-input> v-model="form.payPassword">
</u-form-item> <template slot="suffix">
<u-form-item label="验证码" prop="smsCode"> <u-icon name="eye"
<u-input v-model="form.smsCode" :placeholder="'请输入验证码'"> @tap="isPwd2=!isPwd2"
<template #suffix> v-if="!isPwd2"></u-icon>
<view class="getCode" @tap="getVilCode">{{ getCode }}</view> <u-icon name="eye-off"
</template> @tap="isPwd2=!isPwd2"
</u-input> v-else></u-icon>
</u-form-item> </template>
</u-form> </u-input>
<u-button </u-form-item>
type="success" <u-form-item label=""
class="uBtn" prop="code">
shape="circle" <u-input v-model="form.code"
color="linear-gradient(to right, #005BAC, #005BAC )" :placeholder="'请输入验证码'">
:loading="isLoading" <template slot="suffix">
:loadingText="'注册中'" <view class="getCode"
@click="toLogin" @tap="getVilCode">{{ getCode }}</view>
>{{ '立即注册' }}</u-button </template>
> </u-input>
</view> </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 v-else class="content"> </view>
<!-- <view class="tit" >{{ '海粉扫天下' }}</view> <view v-else class="content">
<!-- <view class="tit" >{{ '海粉扫天下' }}</view>
<view class="formed" <view class="formed"
> >
<u-form :model="form" <u-form :model="form"
@ -130,10 +139,10 @@
</view> </view>
</u-form-item> </u-form-item>
<u-form-item label="" <u-form-item label=""
prop="loginPwd"> prop="loginPassword">
<u-input :password="isPwd1" <u-input :password="isPwd1"
:placeholder="'请输入登录密码'" :placeholder="'请输入登录密码'"
v-model="form.loginPwd"> v-model="form.loginPassword">
<template slot="suffix"> <template slot="suffix">
<u-icon name="eye" <u-icon name="eye"
@tap="isPwd1=!isPwd1" @tap="isPwd1=!isPwd1"
@ -145,10 +154,10 @@
</u-input> </u-input>
</u-form-item> </u-form-item>
<u-form-item label="" <u-form-item label=""
prop="payPwd"> prop="payPassword">
<u-input :password="isPwd2" <u-input :password="isPwd2"
:placeholder="'请输入支付密码'" :placeholder="'请输入支付密码'"
v-model="form.payPwd"> v-model="form.payPassword">
<template slot="suffix"> <template slot="suffix">
<u-icon name="eye" <u-icon name="eye"
@tap="isPwd2=!isPwd2" @tap="isPwd2=!isPwd2"
@ -175,65 +184,24 @@
:columns="countryList"></u-picker> :columns="countryList"></u-picker>
</view> --> </view> -->
</view>
<u-modal
:show="showSuccessModal"
title="注册成功"
:show-cancel-button="true"
cancel-text="复制"
confirm-text="自动登录"
@confirm="onModalConfirm"
@cancel="onModalCancel"
@close="showSuccessModal = false"
>
<view class="slot-content" v-if="successData">
<view class="success-item">
<text class="item-label">会员编号:</text>
<text class="item-value">{{ successData.memberCode }}</text>
</view>
<view class="success-item">
<text class="item-label">会员姓名:</text>
<text class="item-value">{{ successData.memberName }}</text>
</view>
<view class="success-item">
<text class="item-label">联系方式:</text>
<text class="item-value">{{ successData.phone }}</text>
</view>
<view class="success-item">
<text class="item-label">登录密码:</text>
<text class="item-value">{{ successData.loginPassword }}</text>
</view>
<view class="success-item">
<text class="item-label">支付密码:</text>
<text class="item-value">{{ successData.payPassword }}</text>
</view>
</view>
</u-modal>
</view> </view>
<view class="mask" v-if="isTrue">
</view>
</view>
</template> </template>
<script> <script>
import * as api from '@/config/goods' import * as api from '@/config/goods'
import {
getMemberCode,
getPhoneCode,
getRegister,
autoLogin,
} from '@/config/share'
export default { export default {
components: {}, components: {},
data() { data() {
return { return {
isTrue: false, isTrue:false,
howHeader: 'HF', howHeader: 'HF',
pkParent: '', pkParent: '',
form: { form: {
memberName: '', memberName: '',
smsCode: '',
loginPwd: '',
payPwd: '',
parentCode: '',
phone: '',
}, },
isLoading: false, isLoading: false,
getCode: '获取验证码', getCode: '获取验证码',
@ -246,49 +214,47 @@ export default {
isPwd: true, isPwd: true,
isPwd1: true, isPwd1: true,
isPwd2: true, isPwd2: true,
showSuccessModal: false,
successData: null,
rules: { rules: {
parentCode: [ memberCode: [
{ {
required: true, required: true,
message: '请输入推荐编号', asyncValidator: this.memberCodeRule,
trigger: ['blur'], trigger: ['blur'],
}, },
], ],
memberName: [ memberName: [
{ {
required: true, required: true,
message: '请输入会员姓名', message:'请输入会员姓名',
trigger: ['blur'], trigger: [ 'blur'],
}, },
], ],
phone: [ phone: [
{ {
required: true, required: true,
message: '请输入联系方式', message: '请输入联系方式',
trigger: ['blur'], trigger: [ 'blur'],
}, },
], ],
smsCode: [ code: [
{ {
required: true, required: true,
message: '请输入验证码', message: '请输入验证码',
trigger: ['blur'], trigger: ['blur'],
}, },
], ],
loginPwd: [ loginPassword: [
{ {
required: true, required: true,
message: '请输入登录密码', message: '请输入登录密码',
trigger: ['blur'], trigger: ['blur'],
}, },
], ],
payPwd: [ payPassword: [
{ {
required: true, required: true,
message: '请输入支付密码', message: '请输入支付密码',
trigger: ['blur'], trigger: [ 'blur'],
}, },
], ],
}, },
@ -314,14 +280,14 @@ export default {
trigger: ['change', 'blur'], trigger: ['change', 'blur'],
}, },
], ],
loginPwd: [ loginPassword: [
{ {
required: true, required: true,
message: '请输入登录密码', message: '请输入登录密码',
trigger: ['change', 'blur'], trigger: ['change', 'blur'],
}, },
], ],
payPwd: [ payPassword: [
{ {
required: true, required: true,
message: '请输入支付密码', message: '请输入支付密码',
@ -337,12 +303,11 @@ export default {
this.pkCountry = options.country || '' this.pkCountry = options.country || ''
this.getGenerate() this.getGenerate()
if (this.pkCountry) { if (this.pkCountry) {
// this.getCountry()
this.getCountry()
this.form.pkCountry = this.pkCountry this.form.pkCountry = this.pkCountry
uni.setStorageSync('pkCountry', this.pkCountry) uni.setStorageSync('pkCountry',this.pkCountry)
uni.redirectTo({ uni.redirectTo({ url: '/pages/shareArea/hiList?pkParent=' + this.pkParent})
url: '/pages/shareArea/hiList?pkParent=' + this.pkParent,
})
// this.$refs.uForm1.setRules(this.rules1) // this.$refs.uForm1.setRules(this.rules1)
} else { } else {
// //
@ -353,16 +318,20 @@ export default {
}, },
onShow() {}, onShow() {},
methods: { methods: {
selCountry() { setMemberCode(){
// this.form.memberCode = this.form.phone
this.$set(this.form,'memberCode',this.form.phone)
},
selCountry(){
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '确认更换自然国', content: '确认更换自然国',
success: res => { success: (res) => {
if (res.confirm) { if (res.confirm) {
this.isCountry = true this.isCountry = true
} }
}, },
}) })
}, },
memberCodeRule(rule, value, callback) { memberCodeRule(rule, value, callback) {
if (!value) { if (!value) {
@ -371,7 +340,7 @@ export default {
if (value.length < 10 || value.length > 20) { if (value.length < 10 || value.length > 20) {
callback(new Error('请输入10-20位数字')) callback(new Error('请输入10-20位数字'))
} else { } else {
api.validateMember(value).then(res => { api.validateMember(value).then((res) => {
if (res.code == 200) { if (res.code == 200) {
callback() callback()
} else { } else {
@ -382,101 +351,47 @@ export default {
} }
}, },
getHeader() { getHeader() {
getMemberCode(this.pkParent).then(res => { api.checkShare().then((res) => {
this.$set(this.form, 'parentCode', res.data) if(res.code != 200){
console.log(this.form) this.isTrue = true
}else{
this.isTrue = false
}
}) })
// api.prefix(this.pkParent).then((res) => { // api.prefix(this.pkParent).then((res) => {
// this.howHeader = res.msg // this.howHeader = res.msg
// }) // })
}, },
getGenerate() { getGenerate() {
api.generate().then(res => { api.generate().then((res) => {
uni.setStorageSync('mToken', res.msg) uni.setStorageSync('mToken', res.msg)
}) })
}, },
toLogin() { toLogin() {
this.$refs.uForm.validate().then(() => { this.$refs.uForm.validate().then((res) => {
this.isLoading = true this.isLoading = true
getRegister(Object.assign({}, this.form, { parentCode: this.pkParent })) api
.then(res => { .regShareMember(
Object.assign({}, this.form, { parent: this.pkParent })
)
.then((res) => {
this.isLoading = false this.isLoading = false
if (res.code == 200) { if (res.code == 200) {
this.successData = res.data uni.redirectTo({
this.showSuccessModal = true url:
} else { '/pages/shareRegist/success?allData=' +
uni.showToast({ JSON.stringify(res.data),
title: res.msg || '注册失败',
icon: 'none',
}) })
} }
}) })
.catch(() => {
this.isLoading = false
uni.showToast({
title: '注册请求失败',
icon: 'none',
})
})
}) })
}, },
onModalConfirm() {
if (this.successData) {
this.handleAutoLogin(this.successData)
}
},
onModalCancel() {
if (this.successData) {
const modalContent = `会员编号: ${this.successData.memberCode}\n会员姓名: ${this.successData.memberName}\n联系方式: ${this.successData.phone}\n登录密码: ${this.successData.loginPassword}\n支付密码: ${this.successData.payPassword}`
uni.setClipboardData({
data: modalContent,
success: function () {
uni.showToast({
title: '复制成功',
icon: 'success',
})
},
})
}
},
handleAutoLogin(loginData) {
autoLogin({
username: loginData.memberCode,
password: loginData.loginPassword,
uuid: loginData.uuid,
})
.then(loginRes => {
if (loginRes.code === 200) {
uni.showToast({
title: '登录成功',
icon: 'success',
duration: 1500,
})
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index',
})
}, 1500)
} else {
uni.showToast({
title: loginRes.msg || '自动登录失败',
icon: 'none',
})
}
})
.catch(() => {
uni.showToast({
title: '自动登录请求失败',
icon: 'none',
})
})
},
hiLogin() { hiLogin() {
this.$refs.uForm1.validate().then(res => { this.$refs.uForm1.validate().then((res) => {
this.isLoading = true this.isLoading = true
api api
.hiRegister(Object.assign({}, this.form, { pkParent: this.pkParent })) .hiRegister(Object.assign({}, this.form, { pkParent: this.pkParent }))
.then(res => { .then((res) => {
this.isLoading = false this.isLoading = false
if (res.code == 200) { if (res.code == 200) {
uni.redirectTo({ uni.redirectTo({
@ -494,16 +409,16 @@ export default {
this.isCountry = false this.isCountry = false
}, },
getCountry() { getCountry() {
api.getCountry().then(res => { api.getCountry().then((res) => {
this.countryList = [ this.countryList = [
res.data.map(item => { res.data.map((item) => {
return { return {
label: item.shortName, label: item.shortName,
id: item.pkId, id: item.pkId,
} }
}), }),
] ]
this.countryList[0].forEach(item => { this.countryList[0].forEach((item) => {
if (this.pkCountry == item.id) { if (this.pkCountry == item.id) {
this.form.jsName = item.label this.form.jsName = item.label
this.form.pkCountryName = item.label this.form.pkCountryName = item.label
@ -514,12 +429,12 @@ export default {
// //
getVilCode() { getVilCode() {
this.startTime() this.startTime()
getPhoneCode({ api
phone: this.form.phone, .verification({
parentCode: this.pkParent, phone: this.form.phone,
}) })
.then(res => {}) .then((res) => {})
.catch(err => { .catch((err) => {
this.beginTime = 0 this.beginTime = 0
}) })
}, },
@ -545,37 +460,35 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content1 { .content1{
background: linear-gradient(-45deg, #005bac, #0077c2, #0099e0, #00bfff); background-image: url('@/static/images/haiRgeiest1.jpg');
background-size: 400% 400%; background-size: 100%;
animation: gradient 15s ease infinite; background-repeat: no-repeat;
height: 100vh; height: 100vh;
overflow: auto;
} }
.content { .content{
background-image: url('@/static/images/huan.jpg'); background-image: url('@/static/images/huan.jpg');
// background-image: url('@/static/images/regiestBg.jpg'); // background-image: url('@/static/images/regiestBg.jpg');
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
height: 100vh; height: 100vh;
} }
.title { .tit{
font-size: 48rpx; font-size: 48px;
font-weight: bold; font-family: PangMenZhengDao-Regular, PangMenZhengDao;
color: #333; font-weight: 400;
text-align: center; color: #FFFFFF;
padding-top: 120rpx; text-align: center;
padding-bottom: 80rpx; padding-top: 80px;
margin-bottom: 20px;
} }
.index_header { .index_header {
background: #f9f9f9; background: #f9f9f9;;
height: 330rpx; height: 330rpx;
font-size: 18px; font-size: 18px;
font-family: font-family: PingFang SC-Semibold, PingFang SC;
PingFang SC-Semibold,
PingFang SC;
font-weight: 600; font-weight: 600;
color: #333333; color: #333333;
text-align: center; text-align: center;
@ -585,18 +498,14 @@ export default {
padding: 0 120rpx; padding: 0 120rpx;
} }
.formed1 { .formed1 {
margin: 0 40rpx; padding: 0 120rpx;
padding: 40rpx 30rpx; padding-top: 550rpx;
background-color: rgba(255, 255, 255, 0.85);
border-radius: 16rpx;
} }
.getCode { .getCode {
font-size: 10px; font-size: 10px;
font-family: font-family: PingFang SC-Regular, PingFang SC;
PingFang SC-Regular,
PingFang SC;
font-weight: 400; font-weight: 400;
color: #005bac; color: #005BAC;
} }
.uBtn { .uBtn {
margin-top: 120rpx; margin-top: 120rpx;
@ -610,49 +519,16 @@ export default {
border-style: solid; border-style: solid;
border-radius: 4px; border-radius: 4px;
padding: 6px 9px; padding: 6px 9px;
background: #fff;
}
::v-deep .u-input{
background: #fff; background: #fff;
} }
::v-deep .u-input { .mask{
background: #fff;
}
.mask {
position: fixed; position: fixed;
background: rgba(0, 0, 0, 0.5); background: rgba(0,0,0,0.5);
width: 100%; width: 100%;
height: 100vh; height: 100vh;
top: 0; top: 0;
} }
@keyframes gradient {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
.slot-content {
padding: 30rpx 20rpx;
font-size: 28rpx;
}
.success-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10rpx 0;
}
.item-label {
color: #606266;
margin-right: 20rpx;
flex-shrink: 0;
}
.item-value {
color: #303133;
word-break: break-all;
text-align: right;
}
</style> </style>

View File

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

View File

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

View File

@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1749519102102" class="icon" viewBox="128 128 768 768" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4253" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400"><path d="M435.456 128h-256a51.2 51.2 0 0 0-51.2 51.2v256a51.2 51.2 0 0 0 51.2 51.2h256a51.2 51.2 0 0 0 51.2-51.2v-256a51.2 51.2 0 0 0-51.2-51.2zM435.456 537.6h-256a51.2 51.2 0 0 0-51.2 51.2v256a51.2 51.2 0 0 0 51.2 51.2h256a51.2 51.2 0 0 0 51.2-51.2v-256a51.2 51.2 0 0 0-51.2-51.2zM844.544 128h-256a51.2 51.2 0 0 0-51.2 51.2v256a51.2 51.2 0 0 0 51.2 51.2h256a51.2 51.2 0 0 0 51.2-51.2v-256a51.2 51.2 0 0 0-51.2-51.2zM591.9744 610.9696a24.4736 24.4736 0 0 0-24.5248 24.5248v224.0512a24.576 24.576 0 0 0 49.0496 0v-224.0512a24.576 24.576 0 0 0-24.5248-24.5248zM716.544 680.5504a24.576 24.576 0 0 0-24.5248 24.5248v154.4704a24.576 24.576 0 0 0 49.0496 0v-154.4704a24.576 24.576 0 0 0-24.5248-24.5248zM842.3936 547.0208a24.576 24.576 0 0 0-24.5248 24.5248v288a24.576 24.576 0 0 0 49.0496 0v-288a24.576 24.576 0 0 0-24.5248-24.5248z" p-id="4254" fill="#f52a10"></path></svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB