-
+
+
+
-
+
{{ val.goodsSku.goodsName }}
x{{ val.num }}
@@ -123,66 +174,119 @@
¥
{{
- $options.filters.goodsFormatPrice(val.purchasePrice)[0]
+ $options.filters.goodsFormatPrice(val.purchasePrice)[0]
}}
- .{{ $options.filters.goodsFormatPrice(val.purchasePrice)[1] }}
+ .{{
+ $options.filters.goodsFormatPrice(val.purchasePrice)[1]
+ }}
发票信息
-
- {{ receiptList.receiptTitle }} -
- {{ receiptList.receiptContent }}
+
+ {{ receiptList.receiptTitle }} -
+ {{ receiptList.receiptContent }}
不开发票
- 配送
+ 配送
-
+
{{
- shippingMethod.find((e) => {
- return e.value == shippingText;
- }).label
+ shippingMethod.find((e) => {
+ return e.value == shippingText;
+ }).label
}}
- 备注信息
+ 备注信息
-
+
-
-
+
+
商品合计
- ¥{{ orderMessage.priceDetailDTO.goodsPrice | unitPrice }}
+ ¥{{ orderMessage.priceDetailDTO.goodsPrice | unitPrice }}
- 运费
-
- 包邮
- ¥{{
+ 运费
+
+ 包邮
+ ¥{{
orderMessage.priceDetailDTO.freightPrice | unitPrice
- }}
+ }}
-
+
优惠券
优惠金额
-
+
- -¥{{ orderMessage.priceDetailDTO.couponPrice | unitPrice }}
+ -¥{{ orderMessage.priceDetailDTO.couponPrice | unitPrice }}
0.00
@@ -217,9 +326,11 @@
活动优惠
- -¥{{
+ -¥{{
orderMessage.priceDetailDTO.discountPrice | unitPrice
- }}
+ }}
0.00
@@ -228,7 +339,12 @@
-
+
@@ -239,14 +355,24 @@
¥
{{
- $options.filters.goodsFormatPrice(orderMessage.priceDetailDTO.flowPrice)[0]
+ $options.filters.goodsFormatPrice(
+ orderMessage.priceDetailDTO.flowPrice
+ )[0]
}}
- .{{ $options.filters.goodsFormatPrice(orderMessage.priceDetailDTO.flowPrice)[1] }}
+ .{{
+ $options.filters.goodsFormatPrice(
+ orderMessage.priceDetailDTO.flowPrice
+ )[1]
+ }}
- {{
+ {{
orderMessage.priceDetailDTO.payPoint | unitPrice
- }}积分
+ }}积分
@@ -264,9 +390,9 @@ import * as API_Trade from "@/api/trade";
import * as API_Address from "@/api/address";
import * as API_Order from "@/api/order";
import invoices from "@/pages/order/invoice/setInvoice";
-
+import { mapState } from "vuex";
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
-import configs from '@/config/config'
+import configs from "@/config/config";
export default {
onLoad: function (val) {
this.routerVal = val;
@@ -275,11 +401,10 @@ export default {
invoices,
},
- watch: {},
data() {
return {
configs,
- userImage:configs.defaultUserPhoto,
+ userImage: configs.defaultUserPhoto,
invoiceFlag: false, //开票开关
shippingText: "LOGISTICS",
shippingFlag: false,
@@ -295,7 +420,8 @@ export default {
},
],
isAssemble: false, //是否拼团
- couponNums: "", //结算页面优惠券数量
+ // 判断是否填写过备注
+ remarkFlag: false,
selectAddressId: "",
routerVal: "",
params: {},
@@ -311,15 +437,29 @@ export default {
data: "",
// 存储备注
remarkVal: [],
+ remarkVal1: "",
detail: "", //返回的所有数据
endWay: "", //最后一个参团人
masterWay: "", //团长信息
pintuanFlage: true, //是开团还是拼团
notSupportFreight: [], //不支持运费
notSupportFreightGoodsList: ["以下商品超出配送范围:"],
- storeAddress:"",
+ storeAddress: "",
};
},
+ watch: {
+ // 监听备注 并在 vuex 中存储
+ remarkVal: {
+ handler(val) {
+ this.$store.commit("setRemark", val);
+ },
+ immediate: true,
+ deep: true,
+ },
+ },
+ computed: {
+ ...mapState(["remark"]),
+ },
filters: {
/**
* 发票收据类型
@@ -368,12 +508,18 @@ export default {
},
async onShow() {
+ // 判断是否存在写过备注信息的商品
+ if (this.remark && this.remark.length > 0) {
+ this.remarkFlag = true;
+ }
uni.showLoading({
mask: true,
});
await this.getOrderList();
await this.getDistribution();
- if (this.$store.state.isShowToast){ uni.hideLoading() };
+ if (this.$store.state.isShowToast) {
+ uni.hideLoading();
+ }
if (this.routerVal.way == "PINTUAN") {
this.isAssemble = true;
this.routerVal.parentOrder = JSON.parse(
@@ -382,7 +528,7 @@ export default {
this.pintuanWay();
}
},
- mounted() { },
+ mounted() {},
methods: {
//发票回调 选择发票之后刷新购物车
@@ -411,7 +557,8 @@ export default {
// 点击跳转地址
clickToAddress() {
this.navigateTo(
- `/pages/mine/address/address?from=cart&way=${this.routerVal.way
+ `/pages/mine/address/address?from=cart&way=${
+ this.routerVal.way
}&parentOrder=${encodeURIComponent(
JSON.stringify(this.routerVal.parentOrder)
)}`
@@ -419,8 +566,7 @@ export default {
},
clickToStoreAddress() {
this.navigateTo(
- `/pages/mine/address/storeAddress?from=cart&way=${this.routerVal.way
- }&storeId=${this.remarkVal[0].storeId}`
+ `/pages/mine/address/storeAddress?from=cart&way=${this.routerVal.way}&storeId=${this.remarkVal[0].storeId}`
);
},
@@ -496,7 +642,7 @@ export default {
createTradeFun() {
// 防抖
this.$u.throttle(() => {
- if (this.shippingText === 'SELF_PICK_UP') {
+ if (this.shippingText === "SELF_PICK_UP") {
if (!this.storeAddress.id) {
uni.showToast({
title: "请选择提货点",
@@ -505,7 +651,7 @@ export default {
});
return false;
}
- } else if (this.shippingText === 'LOGISTICS') {
+ } else if (this.shippingText === "LOGISTICS") {
if (!this.address.id) {
uni.showToast({
title: "请选择地址",
@@ -602,12 +748,14 @@ export default {
},
// 获取配送列表
async getDistribution() {
- let shopRes = await API_Trade.shippingMethodList({ way: this.routerVal.way });
+ let shopRes = await API_Trade.shippingMethodList({
+ way: this.routerVal.way,
+ });
let shopList;
if (shopRes.data.success) {
shopList = shopRes.data.result;
let way = [];
- console.log(shopList)
+ console.log(shopList);
this.shippingWay.forEach((item) => {
shopList.forEach((child) => {
if (item.value == child) {
@@ -650,12 +798,22 @@ export default {
url: "/pages/order/myOrder?status=0",
});
}
+
+ let repeatData;
res.data.result.cartList.forEach((item, index) => {
- this.remarkVal[index] = {
- remark: item.remark,
+ // 如果已经写过备注信息的话赋值
+ repeatData = {
+ remark: this.remarkFlag
+ ? this.remark[index].storeId == item.storeId
+ ? this.remark[index].remark
+ : item.remark
+ : item.remark,
storeId: item.storeId,
};
+
+ this.$set(this.remarkVal, index, repeatData);
});
+
this.orderMessage = res.data.result;
/**
* 为了避免路径传值在h5中超出限制问题
@@ -673,8 +831,8 @@ export default {
res.data.result.memberAddress.consigneeAddressPath.split(",");
}
if (res.data.result.storeAddress) {
- this.storeAddress = res.data.result.storeAddress
- console.log("storeAddress",this.storeAddress);
+ this.storeAddress = res.data.result.storeAddress;
+ console.log("storeAddress", this.storeAddress);
}
if (
res.data.result.notSupportFreight &&
@@ -834,7 +992,7 @@ page {
width: 100%;
transition: 0.35s;
- >.tips {
+ > .tips {
margin: 0 32rpx;
}
}
@@ -917,7 +1075,7 @@ page {
font-size: 26rpx;
font-weight: bold;
- >span {
+ > span {
font-size: 36rpx;
}
}
@@ -928,7 +1086,7 @@ page {
font-size: 28rpx;
font-weight: bold;
- >.goods-price {
+ > .goods-price {
font-size: 38rpx;
padding: 0 2rpx;
}
@@ -1023,7 +1181,7 @@ page {
flex: 8;
margin-left: 20rpx !important;
- >p {
+ > p {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
diff --git a/pages/order/myOrder.vue b/pages/order/myOrder.vue
index 53a5bd2..f5b1809 100644
--- a/pages/order/myOrder.vue
+++ b/pages/order/myOrder.vue
@@ -542,13 +542,13 @@ export default {
*/
submitCancel() {
cancelOrder(this.orderSn, { reason: this.reason }).then((res) => {
- if (res.statusCode == 200) {
+ if (res.data.success) {
uni.showToast({
title: "订单已取消",
duration: 2000,
icon: "none",
});
- this.initData(0);
+ this.initData(this.tabCurrentIndex);
this.cancelShow = false;
} else {
diff --git a/pages/product/goods.vue b/pages/product/goods.vue
index 9d8cd0b..ba280b4 100644
--- a/pages/product/goods.vue
+++ b/pages/product/goods.vue
@@ -88,14 +88,14 @@
¥{{
$options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length - 1].price)[0]
}}.{{
- $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length - 1].price)[1]
-}}
+ $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length - 1].price)[1]
+ }}
~
¥{{
$options.filters.goodsFormatPrice(wholesaleList[0].price)[0]
}}.{{
- $options.filters.goodsFormatPrice(wholesaleList[0].price)[1]
-}}
+ $options.filters.goodsFormatPrice(wholesaleList[0].price)[1]
+ }}
¥{{
@@ -105,7 +105,12 @@
+
+ 暂无报价
+
+
¥0 .00
+
@@ -189,6 +194,7 @@
+
@@ -205,15 +211,20 @@
{{ nums }}
+
+
+
+ 查看类似商品
+
-
+
加入购物车
立即购买
暂未开始
-
+
¥{{ goodsDetail.price | unitPrice }}
单独购买
@@ -253,6 +264,10 @@
@queryCart="cartCount()" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" :isGroup="isGroup" :id="productId"
v-if="goodsDetail.id" :pointDetail="pointDetail" :wholesaleList="wholesaleList" @handleClickSku="selectSku"
:buyMask="buyMask" />
+
+
+
+
@@ -284,6 +299,7 @@ import popupGoods from "@/components/m-buy/goods"; //购物车商品的模块
import popupAddress from "./product/popup/address"; //地址选择模块
import shares from "@/components/m-share/index"; //分享
import popups from "@/components/popups/popups"; //气泡框
+import takeDownFormSaleGoods from "@/components/m-take-down-sale-goods/index"; //下架框
import setup from "./product/popup/popup";
export default {
@@ -302,6 +318,7 @@ export default {
GoodsSwiper,
popupGoods,
popupAddress,
+ takeDownFormSaleGoods
},
data () {
return {
@@ -385,10 +402,8 @@ export default {
tabScrollTop: null,
scrollArr: [],
scrollId: "1",
-
scrollFlag: true,
current: "1", //当前显示的轮播图页
-
goodsDetail: {}, //商品数据
goodsSpec: "", //规格数据
imgList: [], //轮播图数据
@@ -398,12 +413,9 @@ export default {
goodsInfo: false, //商品介绍弹窗
addressFlag: false, //配送地址弹窗
buyMask: false, //添加购物车直接购买,查看已选 弹窗
-
num: 1, //添加到购物车的数量
-
skuId: "", //
storeDetail: "", //店铺基本信息,
-
// 店铺信息
storeParams: {
pageNumber: 1,
@@ -413,7 +425,6 @@ export default {
likeGoodsList: "", //相似商品列表
PromotionList: "", //活动,促销,列表
specList: [],
- skusCombination: [],
selectedSpec: [],
nums: 0,
delivery: "",
@@ -425,7 +436,8 @@ export default {
routerVal: "",
IMLink: "", // IM地址
- wholesaleList: []
+ wholesaleList: [],
+ takeDownFromSale: false, // 下架销售状态
};
},
@@ -504,6 +516,10 @@ export default {
},
methods: {
+ // 重新打开下架
+ reStartTakeDownSale(){
+ this.$refs.takeDownSale.show = true
+ },
share () {
return `/pages/product/goods?id=${this.routerVal.id}&goodsId=${this.routerVal.goodsId}`;
},
@@ -538,11 +554,16 @@ export default {
// 这里请求获取到页面数据 解析数据
let response = await getGoods(id, goodsId);
-
+
+ // 判断当前接口返回内容
if (!response.data.success) {
- setTimeout(() => {
- uni.navigateBack();
- }, 500);
+ // 商品已下架
+ if(response.data.code == 11001){
+ this.takeDownFromSale = true
+ }
+ // setTimeout(() => {
+ // uni.navigateBack();
+ // }, 500);
}
// 这里是绑定分销员
if (distributionId || this.$store.state.distributionId) {
diff --git a/pages/product/product/product.scss b/pages/product/product/product.scss
index 6dcbb8b..b1f7791 100644
--- a/pages/product/product/product.scss
+++ b/pages/product/product/product.scss
@@ -62,3 +62,7 @@
color: #262626;
font-weight: 700;
}
+
+.down-goods{
+ font-size: 50rpx !important;
+}
diff --git a/pages/product/shopPage.vue b/pages/product/shopPage.vue
index 487e497..f3cc7de 100644
--- a/pages/product/shopPage.vue
+++ b/pages/product/shopPage.vue
@@ -181,8 +181,8 @@ import { getStoreBaseInfo, getStoreCategory } from "@/api/store.js";
import {
receiveCoupons,
deleteStoreCollection,
- collectionGoods,
- getGoodsIsCollect,
+ collectionStore,
+ getStoreIsCollect,
} from "@/api/members.js";
import config from "@/config/config";
@@ -374,7 +374,7 @@ export default {
},
/**是否收藏店铺 */
async enableGoodsIsCollect() {
- let res = await getGoodsIsCollect("STORE", this.storeId);
+ let res = await getStoreIsCollect("STORE", this.storeId);
if (res.data.success) {
this.isCollection = res.data.result;
}
@@ -465,7 +465,7 @@ export default {
}
});
} else {
- collectionGoods("STORE", this.storeId).then((res) => {
+ collectionStore(this.storeId).then((res) => {
if (res.data.success) {
this.isCollection = true;
uni.showToast({
diff --git a/store/index.js b/store/index.js
index c4c8218..baadedd 100644
--- a/store/index.js
+++ b/store/index.js
@@ -7,6 +7,7 @@ Vue.use(Vuex);
const store = new Vuex.Store({
state: {
isShowToast:false, // 是否在展示Toast中
+ remark:[], //填写订单备注
shareLink:"", //分享链接
verificationKey: "", //获取key表示验证通过
distributionId:"", //分销员Id 如果当前账户从未登录过时记录
@@ -26,6 +27,11 @@ const store = new Vuex.Store({
state.userName = "";
state.hasLogin = false;
},
+
+ // 设置填写订单中备注
+ setRemark(state, remark) {
+ state.remark = remark;
+ }
},
actions: {},
});
diff --git a/utils/request.js b/utils/request.js
index 65393ae..60e6767 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -53,12 +53,19 @@ function cleanStorage() {
let http = new Request();
-http.setConfig((config) => {
- // 没有uuid创建
+/**
+ * 创建uuid方法
+ */
+const createUuid = () => {
if (!storage.getUuid()) {
storage.setUuid(uuid.v1());
+ console.log("uuid", storage.getUuid());
}
+}
+
+http.setConfig((config) => {
+ createUuid();
/* 设置全局配置 */
config.baseURL = api.buyer;
config.header = {
@@ -105,9 +112,10 @@ http.interceptors.request.use(
}
+ createUuid();
config.header = {
...config.header,
- uuid: storage.getUuid() || uuid.v1(),
+ uuid: storage.getUuid()
};
return config;
},