update
This commit is contained in:
parent
f28a7ca2ff
commit
5d303c310b
@ -1,56 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="main">
|
<view class="main">
|
||||||
<view class="mapBox">
|
<view class="mapBox">
|
||||||
<map
|
<map id="myMap" :longitude="longitude" :latitude="latitude" :markers="markers" class="map" show-location></map>
|
||||||
id="myMap"
|
|
||||||
:longitude="longitude"
|
|
||||||
:latitude="latitude"
|
|
||||||
:markers="markers"
|
|
||||||
class="map"
|
|
||||||
show-location
|
|
||||||
></map>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view
|
<view :style="{
|
||||||
:style="{
|
transform: showLong ? 'translateY(-20vh)' : 'translateY(-32rpx)',
|
||||||
transform: showLong ? 'translateY(-20vh)' : 'translateY(-32rpx)',
|
height: showLong ? '80vh' : '60vh',
|
||||||
height: showLong ? '80vh' : '60vh',
|
}" class="bigBox">
|
||||||
}"
|
|
||||||
class="bigBox"
|
|
||||||
>
|
|
||||||
<view class="topBox" @click="handleChangeLong">
|
<view class="topBox" @click="handleChangeLong">
|
||||||
<image
|
<image class="packUp" src="https://eshangtech.com/ShopICO/ahyd-BID/service/packUp.svg" />
|
||||||
class="packUp"
|
|
||||||
src="https://eshangtech.com/ShopICO/ahyd-BID/service/packUp.svg"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
<scroll-view
|
<scroll-view class="listBox" :scroll-y="true" :style="{
|
||||||
class="listBox"
|
height: showLong ? 'calc(80vh - 32rpx)' : 'calc(60vh - 32rpx)',
|
||||||
:scroll-y="true"
|
}">
|
||||||
:style="{
|
|
||||||
height: showLong ? 'calc(80vh - 32rpx)' : 'calc(60vh - 32rpx)',
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view
|
<view :class="selectId === item.id ? 'itemBox selectItemBox' : 'itemBox'" v-for="(item, index) in dataList"
|
||||||
:class="selectId === item.id ? 'itemBox selectItemBox' : 'itemBox'"
|
:key="index" @click="handleChangePlace(item)">
|
||||||
v-for="(item, index) in dataList"
|
|
||||||
:key="index"
|
|
||||||
@click="handleChangePlace(item)"
|
|
||||||
>
|
|
||||||
<view class="itemLeft">
|
<view class="itemLeft">
|
||||||
<view class="title">{{ item.name || "" }}</view>
|
<view class="title">{{ item.name || "" }}</view>
|
||||||
<view class="phone">{{ item.phone || "" }}</view>
|
<view class="phone">{{ item.phone || "" }}</view>
|
||||||
<view class="distance"
|
<view class="distance">{{ item.distance ? item.distance + "km" : "" }}
|
||||||
>{{ item.distance ? item.distance + "km" : "" }}
|
|
||||||
<span v-if="item.recently" class="recently">距离最近</span>
|
<span v-if="item.recently" class="recently">距离最近</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="itemRight" @click="handleGoMap(item)">
|
<view class="itemRight" @click="handleGoMap(item)">
|
||||||
<image
|
<image class="mapIcon" src="/static/images/home/navigationIcon.svg" />
|
||||||
class="mapIcon"
|
|
||||||
src="/static/images/home/navigationIcon.svg"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -146,6 +121,7 @@ export default {
|
|||||||
let time = Math.ceil(new Date().getTime() / 1000);
|
let time = Math.ceil(new Date().getTime() / 1000);
|
||||||
|
|
||||||
let req = {
|
let req = {
|
||||||
|
// app_id: "530000301",
|
||||||
app_id: "530000301",
|
app_id: "530000301",
|
||||||
biz_content: JSON.stringify(params),
|
biz_content: JSON.stringify(params),
|
||||||
charset: "UTF-8",
|
charset: "UTF-8",
|
||||||
@ -162,19 +138,20 @@ export default {
|
|||||||
// 签名
|
// 签名
|
||||||
const sign = await new Promise((resolve, reject) => {
|
const sign = await new Promise((resolve, reject) => {
|
||||||
uni.request({
|
uni.request({
|
||||||
url: "http://10.104.1.159:8080/RSA/sign",
|
// url: "http://10.104.1.159:8080/RSA/sign",
|
||||||
|
url: "https://admin.es.eshangtech.com/platform/RSA/sign",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: {
|
data: {
|
||||||
originalText: signText,
|
originalText: signText,
|
||||||
privateKey:
|
privateKey:
|
||||||
"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtIkIJLbZYI9NvTRkRbqtjJ73gkAUJZBJw88Z+O8prX2HXMTIedmZZxTwbfM5kGpl9VmS0CY8QL0DnDsgHO8QnSDpN1jiqTD9lk1evycuF7ujmlOk/cJ5x2cLPn9rPIrQn1lxp9mBiO1m9vsrNOze/kx7wRyif/+hvn5Q9KtNEMy0K8oOE5vktnjkk1AhhXrTii9eIjOrO3pRgh9cFA9kqQpvD14CImD7tdCgyntKcYAB7rlin6a2N0yH9JJINjOyOiyHufP8sR7pb9VYXVYXukOCItdC9QQluQhSdyC/3BfZD5zV1A+X7pUle7dDLGG6aSZyCibg16siFIEX94KYfAgMBAAECggEAcP5uwrbGzvdywq06sxnbWTdSwQC9iMd7EaTH4xL6pOD3Zg6Be0givGvxMq9dtA94JUkBKE8kw5dTcHlBKxdiiZCmHK63BM4GgjCLhfrZjWvDLNn68KB7iCpq7j6R+6XWljlczvsxJGs/woqGqTMAy1MlWgPXC7Vk6ZTolpMglt0IJOzPtgJ66qU2CtNRjowkXSCHDO2RCjkmYcjU6W+eCvi9cXIXhLv5yra1PE0KOxn3NiEFwgGUXpu8LKqxuUfGLuHljoLxWV8EEfwZaWB6Wy1DHMMgxhKrO3xEmdMEqtvJmF98LRSYiJerkExY8Gdx8bkLPjlCLYKW4JVuPmyYgQKBgQD8l0lLtB94MQMib0t8RzqlbKcczTAkicjSms3/P4kwh50GC8OqwjJB75n4yQyDPgsjms/SnRMq1zjgm+MHSC4snpLCcvKFYLnvrslWGu/2lyUTwEwdUdQe1ILG4Y9NXKWg4zXpKfJ2Rz/cqw6bHGYhQWZ62AXQgiz+W7cIPrsHsQKBgQCveHGHF0WqtYAmrW7nf04PKmcJ5U2briYCWOtWJE5Mo5BYxsGLX6vI53DMNQ42hFk0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CjMOc2odPKtLhmfgLVvPrRXgQl/+Dj3op54sTS1xHYyKc3/JBHuSE40K/TgB+sMQb1plSa9v6hw6MrleEo24jU82ZVLs8v"
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
},
|
},
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log("resresresresresresres", res);
|
console.log("resresresresresresres", res);
|
||||||
resolve(res.data.data);
|
resolve(res.data.Result_Desc);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -184,7 +161,7 @@ export default {
|
|||||||
|
|
||||||
const mapPointData = await new Promise((resolve, reject) => {
|
const mapPointData = await new Promise((resolve, reject) => {
|
||||||
uni.request({
|
uni.request({
|
||||||
url: `https://sxgzh.etclife.cn/etc/api/v1/wx/point/outlets`,
|
url: `https://tuozhan.yns-etc.com/gzh/api/v1/gzh/point/outlets`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: req,
|
data: req,
|
||||||
header: {
|
header: {
|
||||||
@ -251,9 +228,9 @@ export default {
|
|||||||
const a =
|
const a =
|
||||||
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
|
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
|
||||||
Math.cos(toRad(lat1)) *
|
Math.cos(toRad(lat1)) *
|
||||||
Math.cos(toRad(lat2)) *
|
Math.cos(toRad(lat2)) *
|
||||||
Math.sin(dLon / 2) *
|
Math.sin(dLon / 2) *
|
||||||
Math.sin(dLon / 2);
|
Math.sin(dLon / 2);
|
||||||
|
|
||||||
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
||||||
return (R * c).toFixed(2); // 返回单位:米
|
return (R * c).toFixed(2); // 返回单位:米
|
||||||
@ -313,9 +290,11 @@ export default {
|
|||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background: #f5f7f9;
|
background: #f5f7f9;
|
||||||
|
|
||||||
.mapBox {
|
.mapBox {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 40vh;
|
height: 40vh;
|
||||||
|
|
||||||
.map {
|
.map {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@ -327,12 +306,14 @@ export default {
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
border-top-right-radius: 32rpx;
|
border-top-right-radius: 32rpx;
|
||||||
border-top-left-radius: 32rpx;
|
border-top-left-radius: 32rpx;
|
||||||
|
|
||||||
.topBox {
|
.topBox {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 32rpx;
|
height: 32rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.packUp {
|
.packUp {
|
||||||
width: 32rpx;
|
width: 32rpx;
|
||||||
height: 64rpx;
|
height: 64rpx;
|
||||||
@ -343,6 +324,7 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
|
|
||||||
.itemBox {
|
.itemBox {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@ -353,8 +335,10 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
.itemLeft {
|
.itemLeft {
|
||||||
width: calc(100% - 80rpx);
|
width: calc(100% - 80rpx);
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-family: "PingFangSC";
|
font-family: "PingFangSC";
|
||||||
@ -368,6 +352,7 @@ export default {
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.phone {
|
.phone {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-family: "PingFangSC";
|
font-family: "PingFangSC";
|
||||||
@ -381,6 +366,7 @@ export default {
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.distance {
|
.distance {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-family: "PingFangSC";
|
font-family: "PingFangSC";
|
||||||
@ -393,6 +379,7 @@ export default {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.recently {
|
.recently {
|
||||||
background: #e8f8ee;
|
background: #e8f8ee;
|
||||||
border-radius: 4rpx;
|
border-radius: 4rpx;
|
||||||
@ -403,15 +390,18 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.itemRight {
|
.itemRight {
|
||||||
width: 64rpx;
|
width: 64rpx;
|
||||||
height: 64rpx;
|
height: 64rpx;
|
||||||
|
|
||||||
.mapIcon {
|
.mapIcon {
|
||||||
width: 64rpx;
|
width: 64rpx;
|
||||||
height: 64rpx;
|
height: 64rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.selectItemBox {
|
.selectItemBox {
|
||||||
border: 1px solid #43c577;
|
border: 1px solid #43c577;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -143,19 +143,19 @@ export default {
|
|||||||
// 签名
|
// 签名
|
||||||
const sign = await new Promise((resolve, reject) => {
|
const sign = await new Promise((resolve, reject) => {
|
||||||
uni.request({
|
uni.request({
|
||||||
url: "https://admin.es.eshangtech.com/prod-api/RSA/sign",
|
url: "https://admin.es.eshangtech.com/platform/RSA/sign",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: {
|
data: {
|
||||||
originalText: signText,
|
originalText: signText,
|
||||||
privateKey:
|
privateKey:
|
||||||
"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtIkIJLbZYI9NvTRkRbqtjJ73gkAUJZBJw88Z+O8prX2HXMTIedmZZxTwbfM5kGpl9VmS0CY8QL0DnDsgHO8QnSDpN1jiqTD9lk1evycuF7ujmlOk/cJ5x2cLPn9rPIrQn1lxp9mBiO1m9vsrNOze/kx7wRyif/+hvn5Q9KtNEMy0K8oOE5vktnjkk1AhhXrTii9eIjOrO3pRgh9cFA9kqQpvD14CImD7tdCgyntKcYAB7rlin6a2N0yH9JJINjOyOiyHufP8sR7pb9VYXVYXukOCItdC9QQluQhSdyC/3BfZD5zV1A+X7pUle7dDLGG6aSZyCibg16siFIEX94KYfAgMBAAECggEAcP5uwrbGzvdywq06sxnbWTdSwQC9iMd7EaTH4xL6pOD3Zg6Be0givGvxMq9dtA94JUkBKE8kw5dTcHlBKxdiiZCmHK63BM4GgjCLhfrZjWvDLNn68KB7iCpq7j6R+6XWljlczvsxJGs/woqGqTMAy1MlWgPXC7Vk6ZTolpMglt0IJOzPtgJ66qU2CtNRjowkXSCHDO2RCjkmYcjU6W+eCvi9cXIXhLv5yra1PE0KOxn3NiEFwgGUXpu8LKqxuUfGLuHljoLxWV8EEfwZaWB6Wy1DHMMgxhKrO3xEmdMEqtvJmF98LRSYiJerkExY8Gdx8bkLPjlCLYKW4JVuPmyYgQKBgQD8l0lLtB94MQMib0t8RzqlbKcczTAkicjSms3/P4kwh50GC8OqwjJB75n4yQyDPgsjms/SnRMq1zjgm+MHSC4snpLCcvKFYLnvrslWGu/2lyUTwEwdUdQe1ILG4Y9NXKWg4zXpKfJ2Rz/cqw6bHGYhQWZ62AXQgiz+W7cIPrsHsQKBgQCveHGHF0WqtYAmrW7nf04PKmcJ5U2briYCWOtWJE5Mo5BYxsGLX6vI53D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+AkXrJVxFCjMOc2odPKtLhmfgLVvPrRXgQl/+Dj3op54sTS1xHYyKc3/JBHuSE40K/TgB+sMQb1plSa9v6hw6MrleEo24jU82ZVLs8v"
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
},
|
},
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log("resresresresresresres", res);
|
console.log("resresresresresresres", res);
|
||||||
resolve(res.data.data);
|
resolve(res.data.Result_Desc);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -163,7 +163,7 @@ export default {
|
|||||||
// 推文数据
|
// 推文数据
|
||||||
const tweetsData = await new Promise((resolve, reject) => {
|
const tweetsData = await new Promise((resolve, reject) => {
|
||||||
uni.request({
|
uni.request({
|
||||||
url: `https://sxgzh.etclife.cn/etc/api/v1/gzh/point/tweets`,
|
url: `https://tuozhan.yns-etc.com/gzh/api/v1/gzh/point/tweets`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: req,
|
data: req,
|
||||||
header: {
|
header: {
|
||||||
@ -171,8 +171,8 @@ export default {
|
|||||||
},
|
},
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log(
|
console.log(
|
||||||
"resresresresresresresresres",
|
"resresresresresresresresres3213123123",
|
||||||
res.data.response.data.data.tweets
|
res.data
|
||||||
);
|
);
|
||||||
resolve(res.data.response.data.data.tweets);
|
resolve(res.data.response.data.data.tweets);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -510,6 +510,7 @@ export default {
|
|||||||
setOrder: "ORDERGOOD",
|
setOrder: "ORDERGOOD",
|
||||||
}),
|
}),
|
||||||
...mapMutations(["setInvitedCode"]),
|
...mapMutations(["setInvitedCode"]),
|
||||||
|
|
||||||
// 收藏
|
// 收藏
|
||||||
handleCollect() {
|
handleCollect() {
|
||||||
if (this.isCollect) {
|
if (this.isCollect) {
|
||||||
@ -639,9 +640,14 @@ export default {
|
|||||||
// this.good.COMMODITY_RULE = value;
|
// this.good.COMMODITY_RULE = value;
|
||||||
this.good.COMMODITY_RULE = obj.COMMODITY_NAME;
|
this.good.COMMODITY_RULE = obj.COMMODITY_NAME;
|
||||||
this.good.RTCOMMODITY_MULTI_ID = value;
|
this.good.RTCOMMODITY_MULTI_ID = value;
|
||||||
this.good.COMMODITY_MEMBERPRICE = obj.COMMODITY_MEMBERPRICE
|
if (obj.COMMODITY_MEMBERPRICE) {
|
||||||
this.good.COMMODITY_PURCHASEPRICE = obj.COMMODITY_PURCHASEPRICE
|
this.good.COMMODITY_MEMBERPRICE = obj.COMMODITY_MEMBERPRICE
|
||||||
|
}
|
||||||
|
if (obj.COMMODITY_PURCHASEPRICE) {
|
||||||
|
this.good.COMMODITY_PURCHASEPRICE = obj.COMMODITY_PURCHASEPRICE
|
||||||
|
}
|
||||||
console.log("this.good", this.good);
|
console.log("this.good", this.good);
|
||||||
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
// 点击的锚点
|
// 点击的锚点
|
||||||
handleChangePageTab(value) {
|
handleChangePageTab(value) {
|
||||||
@ -767,92 +773,103 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.good.COMMODITY_MEMBERPRICE) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "商品信息有误,无法添加购物车!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
console.log("this.good", this.good);
|
console.log("this.good", this.good);
|
||||||
console.log('this.shopCarList', this.shopCarList);
|
console.log('this.shopCarList', this.shopCarList);
|
||||||
|
// 当前购物车的数据
|
||||||
if (this.shopCarList && this.shopCarList.length > 0) {
|
if (this.shopCarList && this.shopCarList.length > 0) {
|
||||||
let nowShopList = [];
|
let nowShopList = [];
|
||||||
// 判断有没有一样的
|
// 判断有没有一样的
|
||||||
let isSame = false;
|
let isSame = false;
|
||||||
let list = JSON.parse(JSON.stringify(this.shopCarList));
|
let list = JSON.parse(JSON.stringify(this.shopCarList));
|
||||||
console.log('listlistlistlist', list);
|
console.log('listlistlistlist', list);
|
||||||
this.shopCarList.forEach((item) => {
|
list.forEach((item) => {
|
||||||
// if (item.COMMODITY_BARCODE === this.good.COMMODITY_BARCODE) {
|
|
||||||
// item.count += this.good.count;
|
|
||||||
// item.COMMODITY_RULE = this.good.COMMODITY_RULE;
|
|
||||||
// isSame = true;
|
|
||||||
// }
|
|
||||||
// 先看看有没有规格id 如果选了规格 不一样规格 算不同的商品
|
// 先看看有没有规格id 如果选了规格 不一样规格 算不同的商品
|
||||||
if (this.good.RTCOMMODITY_MULTI_ID) {
|
if (this.good.RTCOMMODITY_MULTI_ID) {
|
||||||
|
// 是多规格 看一下 当前购物车中 是否已经有了 这个规格的商品
|
||||||
let filterRuleList = list.filter(
|
let filterRuleList = list.filter(
|
||||||
(item) => item.RTCOMMODITY_MULTI_ID === this.good.RTCOMMODITY_MULTI_ID
|
(item) => item.RTCOMMODITY_MULTI_ID === this.good.RTCOMMODITY_MULTI_ID
|
||||||
);
|
);
|
||||||
|
console.log('filterRuleList', JSON.parse(JSON.stringify(filterRuleList)));
|
||||||
|
|
||||||
// 如果有一样规格的 就替换值 没有 就等于新增商品
|
// 如果有一样规格的 就替换值 没有 就等于新增商品
|
||||||
|
// 如果原本已经有了 那么就是当前购物车的数量 + 本次的数量
|
||||||
if (filterRuleList && filterRuleList.length > 0) {
|
if (filterRuleList && filterRuleList.length > 0) {
|
||||||
if (item.COMMODITY_ID === this.good.COMMODITY_ID) {
|
if (item.COMMODITY_ID === this.good.COMMODITY_ID) {
|
||||||
item.count = this.good.count;
|
item.count = this.good.count + item.count;
|
||||||
}
|
}
|
||||||
isSame = true;
|
isSame = true;
|
||||||
} else {
|
} else {
|
||||||
|
// 同商品 但是不同规格的添加
|
||||||
list.push({ ...this.good });
|
list.push({ ...this.good });
|
||||||
// nowShopList.forEach((item) => {
|
|
||||||
// if (item.COMMODITY_ID === this.good.COMMODITY_ID) {
|
|
||||||
// item.count = this.good.count;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// 没有多规格 购物车中又已经有了该商品 那么就数量就加上这次添加到购物车的数量
|
||||||
if (item.COMMODITY_ID === this.good.COMMODITY_ID) {
|
if (item.COMMODITY_ID === this.good.COMMODITY_ID) {
|
||||||
item.count = this.good.count;
|
// item.count = this.good.count;
|
||||||
|
item.count = this.good.count + item.count
|
||||||
isSame = true;
|
isSame = true;
|
||||||
} else {
|
} else {
|
||||||
|
// 当前购物车中找不到同样的商品 说明是新商品 那么直接添加到购物车中
|
||||||
list.push({ ...this.good });
|
list.push({ ...this.good });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// nowShopList.forEach((item) => {
|
|
||||||
// if (item.COMMODITY_ID === this.good.COMMODITY_ID) {
|
|
||||||
// item.count = this.good.count;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
});
|
});
|
||||||
if (isSame) {
|
nowShopList = list
|
||||||
// nowShopList = this.shopCarList;
|
// 判断是否是一样的商品
|
||||||
nowShopList = list
|
// if (isSame) {
|
||||||
} else {
|
// // nowShopList = this.shopCarList;
|
||||||
// this.shopCarList.push(this.good);
|
// nowShopList = list
|
||||||
// list.push(this.good);
|
// } else {
|
||||||
// nowShopList = this.shopCarList;
|
// // this.shopCarList.push(this.good);
|
||||||
nowShopList = list;
|
// // list.push(this.good);
|
||||||
}
|
// // nowShopList = this.shopCarList;
|
||||||
|
// nowShopList = list;
|
||||||
|
// }
|
||||||
|
|
||||||
console.log('nowShopListnowShopListnowShopList', nowShopList);
|
console.log('nowShopListnowShopListnowShopList', nowShopList);
|
||||||
this.shopCarList = nowShopList
|
this.shopCarList = nowShopList
|
||||||
|
|
||||||
|
// 区分一下 这个是工会商城的购物车 还是外面商城的购物车
|
||||||
if (this.pageType === "UnionMall") {
|
if (this.pageType === "UnionMall") {
|
||||||
this.$store.commit("unionMyShopCar", nowShopList);
|
this.$store.commit("unionMyShopCar", nowShopList);
|
||||||
} else {
|
} else {
|
||||||
this.$store.commit("myShopCar", nowShopList);
|
this.$store.commit("myShopCar", nowShopList);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// 这是当前购物车为空的情况 那么就直接把当前商品 添加进去即可
|
||||||
let nowShopList = [];
|
let nowShopList = [];
|
||||||
let good = JSON.parse(JSON.stringify(this.good))
|
let good = JSON.parse(JSON.stringify(this.good))
|
||||||
nowShopList.push(good);
|
nowShopList.push(good);
|
||||||
this.shopCarList = [good]
|
this.shopCarList = [good]
|
||||||
|
console.log('nowShopListnowShopListnowShopList', this.shopCarList);
|
||||||
if (this.pageType === "UnionMall") {
|
if (this.pageType === "UnionMall") {
|
||||||
this.$store.commit("unionMyShopCar", nowShopList);
|
this.$store.commit("unionMyShopCar", nowShopList);
|
||||||
} else {
|
} else {
|
||||||
this.$store.commit("myShopCar", nowShopList);
|
this.$store.commit("myShopCar", nowShopList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "加入成功!",
|
title: "加入成功!",
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
});
|
||||||
|
let _this = this
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$refs.shopPopup.close();
|
_this.handleCloseShopPopup()
|
||||||
}, 2000);
|
// this.$refs.shopPopup.close();
|
||||||
|
}, 1000);
|
||||||
},
|
},
|
||||||
// 立即购买方法
|
// 立即购买方法
|
||||||
async handleMakeOrder() {
|
async handleMakeOrder() {
|
||||||
@ -1001,10 +1018,20 @@ export default {
|
|||||||
this.$refs.popup.open("bottom");
|
this.$refs.popup.open("bottom");
|
||||||
this.showShareBox = true;
|
this.showShareBox = true;
|
||||||
},
|
},
|
||||||
|
// 关闭分享框的事件
|
||||||
handleClosePopup() {
|
handleClosePopup() {
|
||||||
this.$refs.popup.close();
|
this.$refs.popup.close();
|
||||||
this.showShareBox = false;
|
this.showShareBox = false;
|
||||||
},
|
},
|
||||||
|
// 关闭商品弹出框 触发的事件
|
||||||
|
handleCloseShopPopup() {
|
||||||
|
this.$refs.shopPopup.close();
|
||||||
|
// this.showShareBox = false;
|
||||||
|
// 关闭详情 在多规格的时候 把商品数量变为1 选择的规格 清空
|
||||||
|
this.good.count = 1
|
||||||
|
this.good.RTCOMMODITY_MULTI_ID = null
|
||||||
|
this.$forceUpdate()
|
||||||
|
},
|
||||||
swiperChange(e) {
|
swiperChange(e) {
|
||||||
this.pageMsg.current = e.mp.detail.current;
|
this.pageMsg.current = e.mp.detail.current;
|
||||||
},
|
},
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -297,18 +297,18 @@ var _default = {
|
|||||||
_context2.next = 13;
|
_context2.next = 13;
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
uni.request({
|
uni.request({
|
||||||
url: "https://admin.es.eshangtech.com/prod-api/RSA/sign",
|
url: "https://admin.es.eshangtech.com/platform/RSA/sign",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: {
|
data: {
|
||||||
originalText: signText,
|
originalText: signText,
|
||||||
privateKey: "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtIkIJLbZYI9NvTRkRbqtjJ73gkAUJZBJw88Z+O8prX2HXMTIedmZZxTwbfM5kGpl9VmS0CY8QL0DnDsgHO8QnSDpN1jiqTD9lk1evycuF7ujmlOk/cJ5x2cLPn9rPIrQn1lxp9mBiO1m9vsrNOze/kx7wRyif/+hvn5Q9KtNEMy0K8oOE5vktnjkk1AhhXrTii9eIjOrO3pRgh9cFA9kqQpvD14CImD7tdCgyntKcYAB7rlin6a2N0yH9JJINjOyOiyHufP8sR7pb9VYXVYXukOCItdC9QQluQhSdyC/3BfZD5zV1A+X7pUle7dDLGG6aSZyCibg16siFIEX94KYfAgMBAAECggEAcP5uwrbGzvdywq06sxnbWTdSwQC9iMd7EaTH4xL6pOD3Zg6Be0givGvxMq9dtA94JUkBKE8kw5dTcHlBK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Y0vZhhnHa5EpnNLS/KRuFem5A4b4GQr+9c5XmbfB6cxtamv1gDyv0sUx6NAi6/kn0YJm0M5KKD88IQ7piPyu31eCDTfKQKBgQCurWpcmHv9G6k/zHlp7474K5u1gDzI00HkaH1U6pqIY7LbAidtn0P+3Cm0fY3VKC8YvLDkH+x86BjYQncv7PKON5hPheBvzV3GVgl1j5ksIb8T61o1FCr68A6JSByYwoYYP3QKFWGgbrhdopPKIcLFeOJkJBtkrDy+/cIJJkSPEQKBgAeG8f7a10mVyVbgyYAwzOFfpXgJYCMfoDlmLuGVZRjjhD1uF4JMK2FMkmzKSKukSPveAOwNml3Z16oZ/oRabkjX8jXETc5SsO3pfFw+yLemnEkQN8SSqDcIl2WziMKhOX6d9MxN37eBMkthjbRcABi0Jfq7QZEthi2UHlwOlx4pAn9C9zkkAmanv6zrsiw5ymcRkEZj+AnMN7m79XQ4fAmDcg4gAYWhJWlM8/g2ww596Qpkl+AkXrJVxFCjMOc2odPKtLhmfgLVvPrRXgQl/+Dj3op54sTS1xHYyKc3/JBHuSE40K/TgB+sMQb1plSa9v6hw6MrleEo24jU82ZVLs8v"
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
"content-type": "application/json"
|
"content-type": "application/json"
|
||||||
},
|
},
|
||||||
success: function success(res) {
|
success: function success(res) {
|
||||||
console.log("resresresresresresres", res);
|
console.log("resresresresresresres", res);
|
||||||
resolve(res.data.data);
|
resolve(res.data.Result_Desc);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -319,14 +319,14 @@ var _default = {
|
|||||||
_context2.next = 17;
|
_context2.next = 17;
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
uni.request({
|
uni.request({
|
||||||
url: "https://sxgzh.etclife.cn/etc/api/v1/gzh/point/tweets",
|
url: "https://tuozhan.yns-etc.com/gzh/api/v1/gzh/point/tweets",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: req,
|
data: req,
|
||||||
header: {
|
header: {
|
||||||
"content-type": "application/x-www-form-urlencoded"
|
"content-type": "application/x-www-form-urlencoded"
|
||||||
},
|
},
|
||||||
success: function success(res) {
|
success: function success(res) {
|
||||||
console.log("resresresresresresresresres", res.data.response.data.data.tweets);
|
console.log("resresresresresresresresres3213123123", res.data);
|
||||||
resolve(res.data.response.data.data.tweets);
|
resolve(res.data.response.data.data.tweets);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -422,9 +422,14 @@ var _default = {
|
|||||||
// this.good.COMMODITY_RULE = value;
|
// this.good.COMMODITY_RULE = value;
|
||||||
this.good.COMMODITY_RULE = obj.COMMODITY_NAME;
|
this.good.COMMODITY_RULE = obj.COMMODITY_NAME;
|
||||||
this.good.RTCOMMODITY_MULTI_ID = value;
|
this.good.RTCOMMODITY_MULTI_ID = value;
|
||||||
this.good.COMMODITY_MEMBERPRICE = obj.COMMODITY_MEMBERPRICE;
|
if (obj.COMMODITY_MEMBERPRICE) {
|
||||||
this.good.COMMODITY_PURCHASEPRICE = obj.COMMODITY_PURCHASEPRICE;
|
this.good.COMMODITY_MEMBERPRICE = obj.COMMODITY_MEMBERPRICE;
|
||||||
|
}
|
||||||
|
if (obj.COMMODITY_PURCHASEPRICE) {
|
||||||
|
this.good.COMMODITY_PURCHASEPRICE = obj.COMMODITY_PURCHASEPRICE;
|
||||||
|
}
|
||||||
console.log("this.good", this.good);
|
console.log("this.good", this.good);
|
||||||
|
this.$forceUpdate();
|
||||||
},
|
},
|
||||||
// 点击的锚点
|
// 点击的锚点
|
||||||
handleChangePageTab: function handleChangePageTab(value) {
|
handleChangePageTab: function handleChangePageTab(value) {
|
||||||
@ -545,76 +550,82 @@ var _default = {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!this.good.COMMODITY_MEMBERPRICE) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "商品信息有误,无法添加购物车!",
|
||||||
|
icon: "none"
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
console.log("this.good", this.good);
|
console.log("this.good", this.good);
|
||||||
console.log('this.shopCarList', this.shopCarList);
|
console.log('this.shopCarList', this.shopCarList);
|
||||||
|
// 当前购物车的数据
|
||||||
if (this.shopCarList && this.shopCarList.length > 0) {
|
if (this.shopCarList && this.shopCarList.length > 0) {
|
||||||
var nowShopList = [];
|
var nowShopList = [];
|
||||||
// 判断有没有一样的
|
// 判断有没有一样的
|
||||||
var isSame = false;
|
var isSame = false;
|
||||||
var list = JSON.parse(JSON.stringify(this.shopCarList));
|
var list = JSON.parse(JSON.stringify(this.shopCarList));
|
||||||
console.log('listlistlistlist', list);
|
console.log('listlistlistlist', list);
|
||||||
this.shopCarList.forEach(function (item) {
|
list.forEach(function (item) {
|
||||||
// if (item.COMMODITY_BARCODE === this.good.COMMODITY_BARCODE) {
|
|
||||||
// item.count += this.good.count;
|
|
||||||
// item.COMMODITY_RULE = this.good.COMMODITY_RULE;
|
|
||||||
// isSame = true;
|
|
||||||
// }
|
|
||||||
// 先看看有没有规格id 如果选了规格 不一样规格 算不同的商品
|
// 先看看有没有规格id 如果选了规格 不一样规格 算不同的商品
|
||||||
if (_this4.good.RTCOMMODITY_MULTI_ID) {
|
if (_this4.good.RTCOMMODITY_MULTI_ID) {
|
||||||
|
// 是多规格 看一下 当前购物车中 是否已经有了 这个规格的商品
|
||||||
var filterRuleList = list.filter(function (item) {
|
var filterRuleList = list.filter(function (item) {
|
||||||
return item.RTCOMMODITY_MULTI_ID === _this4.good.RTCOMMODITY_MULTI_ID;
|
return item.RTCOMMODITY_MULTI_ID === _this4.good.RTCOMMODITY_MULTI_ID;
|
||||||
});
|
});
|
||||||
|
console.log('filterRuleList', JSON.parse(JSON.stringify(filterRuleList)));
|
||||||
|
|
||||||
// 如果有一样规格的 就替换值 没有 就等于新增商品
|
// 如果有一样规格的 就替换值 没有 就等于新增商品
|
||||||
|
// 如果原本已经有了 那么就是当前购物车的数量 + 本次的数量
|
||||||
if (filterRuleList && filterRuleList.length > 0) {
|
if (filterRuleList && filterRuleList.length > 0) {
|
||||||
if (item.COMMODITY_ID === _this4.good.COMMODITY_ID) {
|
if (item.COMMODITY_ID === _this4.good.COMMODITY_ID) {
|
||||||
item.count = _this4.good.count;
|
item.count = _this4.good.count + item.count;
|
||||||
}
|
}
|
||||||
isSame = true;
|
isSame = true;
|
||||||
} else {
|
} else {
|
||||||
|
// 同商品 但是不同规格的添加
|
||||||
list.push(_objectSpread({}, _this4.good));
|
list.push(_objectSpread({}, _this4.good));
|
||||||
// nowShopList.forEach((item) => {
|
|
||||||
// if (item.COMMODITY_ID === this.good.COMMODITY_ID) {
|
|
||||||
// item.count = this.good.count;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// 没有多规格 购物车中又已经有了该商品 那么就数量就加上这次添加到购物车的数量
|
||||||
if (item.COMMODITY_ID === _this4.good.COMMODITY_ID) {
|
if (item.COMMODITY_ID === _this4.good.COMMODITY_ID) {
|
||||||
item.count = _this4.good.count;
|
// item.count = this.good.count;
|
||||||
|
item.count = _this4.good.count + item.count;
|
||||||
isSame = true;
|
isSame = true;
|
||||||
} else {
|
} else {
|
||||||
|
// 当前购物车中找不到同样的商品 说明是新商品 那么直接添加到购物车中
|
||||||
list.push(_objectSpread({}, _this4.good));
|
list.push(_objectSpread({}, _this4.good));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// nowShopList.forEach((item) => {
|
|
||||||
// if (item.COMMODITY_ID === this.good.COMMODITY_ID) {
|
|
||||||
// item.count = this.good.count;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
});
|
});
|
||||||
|
nowShopList = list;
|
||||||
|
// 判断是否是一样的商品
|
||||||
|
// if (isSame) {
|
||||||
|
// // nowShopList = this.shopCarList;
|
||||||
|
// nowShopList = list
|
||||||
|
// } else {
|
||||||
|
// // this.shopCarList.push(this.good);
|
||||||
|
// // list.push(this.good);
|
||||||
|
// // nowShopList = this.shopCarList;
|
||||||
|
// nowShopList = list;
|
||||||
|
// }
|
||||||
|
|
||||||
if (isSame) {
|
|
||||||
// nowShopList = this.shopCarList;
|
|
||||||
nowShopList = list;
|
|
||||||
} else {
|
|
||||||
// this.shopCarList.push(this.good);
|
|
||||||
// list.push(this.good);
|
|
||||||
// nowShopList = this.shopCarList;
|
|
||||||
nowShopList = list;
|
|
||||||
}
|
|
||||||
console.log('nowShopListnowShopListnowShopList', nowShopList);
|
console.log('nowShopListnowShopListnowShopList', nowShopList);
|
||||||
this.shopCarList = nowShopList;
|
this.shopCarList = nowShopList;
|
||||||
|
|
||||||
|
// 区分一下 这个是工会商城的购物车 还是外面商城的购物车
|
||||||
if (this.pageType === "UnionMall") {
|
if (this.pageType === "UnionMall") {
|
||||||
this.$store.commit("unionMyShopCar", nowShopList);
|
this.$store.commit("unionMyShopCar", nowShopList);
|
||||||
} else {
|
} else {
|
||||||
this.$store.commit("myShopCar", nowShopList);
|
this.$store.commit("myShopCar", nowShopList);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// 这是当前购物车为空的情况 那么就直接把当前商品 添加进去即可
|
||||||
var _nowShopList = [];
|
var _nowShopList = [];
|
||||||
var good = JSON.parse(JSON.stringify(this.good));
|
var good = JSON.parse(JSON.stringify(this.good));
|
||||||
_nowShopList.push(good);
|
_nowShopList.push(good);
|
||||||
this.shopCarList = [good];
|
this.shopCarList = [good];
|
||||||
|
console.log('nowShopListnowShopListnowShopList', this.shopCarList);
|
||||||
if (this.pageType === "UnionMall") {
|
if (this.pageType === "UnionMall") {
|
||||||
this.$store.commit("unionMyShopCar", _nowShopList);
|
this.$store.commit("unionMyShopCar", _nowShopList);
|
||||||
} else {
|
} else {
|
||||||
@ -625,9 +636,11 @@ var _default = {
|
|||||||
title: "加入成功!",
|
title: "加入成功!",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
var _this = this;
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
_this4.$refs.shopPopup.close();
|
_this.handleCloseShopPopup();
|
||||||
}, 2000);
|
// this.$refs.shopPopup.close();
|
||||||
|
}, 1000);
|
||||||
},
|
},
|
||||||
// 立即购买方法
|
// 立即购买方法
|
||||||
handleMakeOrder: function handleMakeOrder() {
|
handleMakeOrder: function handleMakeOrder() {
|
||||||
@ -800,10 +813,20 @@ var _default = {
|
|||||||
this.$refs.popup.open("bottom");
|
this.$refs.popup.open("bottom");
|
||||||
this.showShareBox = true;
|
this.showShareBox = true;
|
||||||
},
|
},
|
||||||
|
// 关闭分享框的事件
|
||||||
handleClosePopup: function handleClosePopup() {
|
handleClosePopup: function handleClosePopup() {
|
||||||
this.$refs.popup.close();
|
this.$refs.popup.close();
|
||||||
this.showShareBox = false;
|
this.showShareBox = false;
|
||||||
},
|
},
|
||||||
|
// 关闭商品弹出框 触发的事件
|
||||||
|
handleCloseShopPopup: function handleCloseShopPopup() {
|
||||||
|
this.$refs.shopPopup.close();
|
||||||
|
// this.showShareBox = false;
|
||||||
|
// 关闭详情 在多规格的时候 把商品数量变为1 选择的规格 清空
|
||||||
|
this.good.count = 1;
|
||||||
|
this.good.RTCOMMODITY_MULTI_ID = null;
|
||||||
|
this.$forceUpdate();
|
||||||
|
},
|
||||||
swiperChange: function swiperChange(e) {
|
swiperChange: function swiperChange(e) {
|
||||||
this.pageMsg.current = e.mp.detail.current;
|
this.pageMsg.current = e.mp.detail.current;
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user