diff --git a/components/cartBall.vue b/components/cartBall.vue
index 2d8e0b6..cc8e27c 100644
--- a/components/cartBall.vue
+++ b/components/cartBall.vue
@@ -9,23 +9,35 @@
v-show="smallCarLength > 0">{{ smallCarLength }}
-
+
{{ '购物车' }}
-
+
diff --git a/components/cartBtmList.vue b/components/cartBtmList.vue
index a8c159e..6f1d0a5 100644
--- a/components/cartBtmList.vue
+++ b/components/cartBtmList.vue
@@ -12,13 +12,7 @@
v-for="(item, index) in shopCarList"
:key="item.specialArea"
>
-
-
+
{
- // deleteList.push({
- // shoppingId: item,
- // })
- // })
- // api
- // .validShop({
- // specialArea: this.goodsCheck[0].specialArea,
- // deleteList: deleteList,
- // })
- // .then((res) => {
- // if (res.code == 200) {
- // uni.navigateTo({
- // url:
- // '/pages/regiest/index?specialArea=' +
- // this.goodsCheck[0].specialArea +
- // '&shoppArr=' +
- // JSON.stringify(shoppArr),
- // })
- // } else {
- // uni.showToast({
- // title: res.msg,
- // icon: 'none',
- // mask: true,
- // })
- // }
- // })
let deleteList = [];
shoppArr.forEach((item) => {
deleteList.push({
@@ -393,42 +359,6 @@ export default {
"&shoppArr=" +
JSON.stringify(shoppArr),
});
- // api
- // .validShop({
- // specialArea: this.goodsCheck[0].specialArea,
- // deleteList: deleteList,
- // })
- // .then((res) => {
- // if (res.code == 200) {
- // // this.tableData = response.data;
- // // this.tableData.forEach((item) => {
- // // this.$set(item, "quantity", 1);
- // // });
- // // this.dialogVisible2 = true;
- // // api
- // // .energyShop({
- // // specialArea: this.goodsCheck[0].specialArea,
- // // deleteList: deleteList,
- // // })
- // // .then((response) => {
- // // if (response.data && response.data.length > 0) {
- // // this.tableData = response.data;
- // // this.tableData.forEach((item) => {
- // // this.$set(item, "quantity", 1);
- // // });
- // // this.dialogVisible2 = true;
- // // } else {
- // // uni.navigateTo({
- // // url:
- // // "/pages/regiest/index?specialArea=" +
- // // this.goodsCheck[0].specialArea +
- // // "&shoppArr=" +
- // // JSON.stringify(shoppArr),
- // // });
- // // }
- // // });
- // }
- // });
} else if (this.goodsCheck[0].specialArea == 21) {
if (
this.userInfo.registerShare == 0 ||
@@ -458,34 +388,6 @@ export default {
});
} else {
if (this.goodsCheck[0].specialArea == 2) {
- // let deleteList = []
- // shoppArr.forEach((item) => {
- // deleteList.push({
- // shoppingId: item,
- // })
- // })
- // api
- // .validShop({
- // specialArea: this.goodsCheck[0].specialArea,
- // deleteList: deleteList,
- // })
- // .then((res) => {
- // if (res.code == 200) {
- // uni.navigateTo({
- // url:
- // '/pages/other/index?specialArea=' +
- // this.goodsCheck[0].specialArea +
- // '&shoppArr=' +
- // JSON.stringify(shoppArr),
- // })
- // } else {
- // uni.showToast({
- // title: res.msg,
- // icon: 'none',
- // mask: true,
- // })
- // }
- // })
let deleteList = [];
shoppArr.forEach((item) => {
deleteList.push({
@@ -499,42 +401,6 @@ export default {
"&shoppArr=" +
JSON.stringify(shoppArr),
});
- // api
- // .validShop({
- // specialArea: this.goodsCheck[0].specialArea,
- // deleteList: deleteList,
- // })
- // .then((res) => {
- // if (res.code == 200) {
- // // this.tableData = response.data;
- // // this.tableData.forEach((item) => {
- // // this.$set(item, "quantity", 1);
- // // });
- // // this.dialogVisible2 = true;
- // // api
- // // .energyShop({
- // // specialArea: this.goodsCheck[0].specialArea,
- // // deleteList: deleteList,
- // // })
- // // .then((response) => {
- // // if (response.data && response.data.length > 0) {
- // // this.tableData = response.data;
- // // this.tableData.forEach((item) => {
- // // this.$set(item, "quantity", 1);
- // // });
- // // this.dialogVisible2 = true;
- // // } else {
- // // uni.navigateTo({
- // // url:
- // // "/pages/other/index?specialArea=" +
- // // this.goodsCheck[0].specialArea +
- // // "&shoppArr=" +
- // // JSON.stringify(shoppArr),
- // // });
- // // }
- // // });
- // }
- // });
} else if (this.goodsCheck[0].specialArea == 30) {
if (this.goodsCheck[0].orderItemsParams.length > 1) {
uni.showToast({
@@ -607,42 +473,6 @@ export default {
// this.getShoppingCount()
});
},
- // checkArea() {
- // let arr = []
- // this.shopCarList.forEach((item) => {
- // item.shoppingCartList.forEach((ctem) => {
- // if (item.isSelect.indexOf(ctem.shoppingId) > -1) {
- // arr.push({
- // specialArea: item.specialArea,
- // orderItemsParams: [
- // {
- // waresCode: ctem.waresCode,
- // shoppingId: ctem.shoppingId,
- // waresName: ctem.waresName,
- // achieve: ctem.achieve,
- // waresPrice: ctem.waresPrice,
- // cover1: ctem.cover1,
- // quantity: ctem.number,
- // waresItemsParamList: ctem.waresItemsParamList,
- // waresSkuList: ctem.waresSkuList || [],
- // source: ctem.source || '',
- // },
- // ],
- // })
- // }
- // })
- // })
- // const arrayHashmap = arr.reduce((obj, item) => {
- // obj[item.specialArea]
- // ? obj[item.specialArea].orderItemsParams.push(
- // ...item.orderItemsParams
- // )
- // : (obj[item.specialArea] = item)
- // return obj
- // }, {})
- // this.goodsCheck = Object.values(arrayHashmap)
- // this.checkPrice()
- // },
// 计算价格
checkPrice() {
let totalPrice = 0;
diff --git a/components/successDialog.vue b/components/successDialog.vue
index f1b6360..4d5e46e 100644
--- a/components/successDialog.vue
+++ b/components/successDialog.vue
@@ -6,27 +6,7 @@
{{'注册成功'}}
-
-
+
{{'复制'}}
@@ -50,26 +30,17 @@
-
- {{'确定'}}
+ @tap="handleClose"
+ >
+ 确定
+
diff --git a/config/goods.js b/config/goods.js
index 530a20f..f6c14bc 100644
--- a/config/goods.js
+++ b/config/goods.js
@@ -77,8 +77,7 @@ export const checkShare = (params) => http.get('/member/api/share/check-share-co
//海粉订单详情
export const waresinfo = (params) => http.post('/sale/api/wares/query-confirm-waresinfo', params)
-//购物车注册下单校验
-export const validShop = (params) => http.post('/sale/api/order/valid-enough-shop', params)
+
//hi粉确认订单
export const fansConfirm = (params) => http.post('/sale/api/order/fans-confirm-order', params)
//购物车注册下单校验弹框
diff --git a/config/request.js b/config/request.js
index 5fa9b1b..fe5e1ce 100644
--- a/config/request.js
+++ b/config/request.js
@@ -13,7 +13,7 @@ module.exports = (vm) => {
//#ifdef DEV_SERVER
console.log('DEV_SERVER')
- config.baseURL = '/prod-api';
+ config.baseURL = 'http://localhost:8080/';
//#endif
//#ifdef QA_SERVER
diff --git a/pages/address/index.vue b/pages/address/index.vue
index 0178065..65b6e2e 100644
--- a/pages/address/index.vue
+++ b/pages/address/index.vue
@@ -4,7 +4,7 @@
@@ -19,7 +19,7 @@
@@ -43,7 +43,7 @@
-
+
@@ -98,9 +98,17 @@
:defaultCode="defaultCode"
@addressData="addressData"
>
- {{
- '确定'
- }}
+
+ 确定
+
@@ -129,6 +137,7 @@ export default {
isDefault: 0,
pkId: "",
},
+ loading: false,
rules: {
recName: [
{
@@ -195,19 +204,26 @@ export default {
},
submit() {
this.$refs.uForm.validate().then((res) => {
+ this.loading = true
api.saveAddress(this.addressForm).then((res) => {
if (res.code == "200") {
- uni.showToast({
+ const toast = uni.showToast({
title: res.msg,
icon: "none",
- success() {
+ complete() {
setTimeout(() => {
- uni.navigateBack(1);
- }, 2000);
+ this.loading = false
+ uni.navigateBack(1)
+ toast.hideToast()
+ }, 500);
},
});
+ } else {
+ this.loading = false
}
- });
+ }).catch(() => {
+ this.loading = false
+ })
});
},
getDiqu() {
@@ -325,8 +341,6 @@ page {
background-color: #fff;
}
.btn {
- background-color: #fb3024;
- border: none;
height: 92rpx;
line-height: 92rpx;
font-size: 30rpx;
diff --git a/pages/other/index.vue b/pages/other/index.vue
index 79dcdf5..43eec48 100644
--- a/pages/other/index.vue
+++ b/pages/other/index.vue
@@ -1178,7 +1178,7 @@ export default {
this.isLoading = false
if (res.code == 200) {
- uni.navigateTo({
+ uni.redirectTo({
url:
'/pages/pay/index?paramsPost=' +
JSON.stringify(res.data) +
diff --git a/pages/pay/index.vue b/pages/pay/index.vue
index e8cd396..e1126a7 100644
--- a/pages/pay/index.vue
+++ b/pages/pay/index.vue
@@ -1,9 +1,4 @@
-
+
-
+
{
this.isLoading = false;
if (res.code == 200) {
- uni.navigateTo({
+ uni.redirectTo({
url:
"/pages/pay/index?paramsPost=" +
JSON.stringify(
diff --git a/pages/shoppingCar/index.vue b/pages/shoppingCar/index.vue
index ce6f0ad..95a5e00 100644
--- a/pages/shoppingCar/index.vue
+++ b/pages/shoppingCar/index.vue
@@ -196,9 +196,6 @@ export default {
selTable: [],
allTable: [],
total: "0.00",
- // show:false,
- // title:'提示',
- // content:'确认删除该商品?'
};
},
computed: {
@@ -318,36 +315,7 @@ export default {
if (
this.goodsCheck[0].specialArea == 1 ||
this.goodsCheck[0].specialArea == 24
- ) {
- // let deleteList = []
- // shoppArr.forEach((item) => {
- // deleteList.push({
- // shoppingId: item,
- // })
- // })
- // api
- // .validShop({
- // specialArea: this.goodsCheck[0].specialArea,
- // deleteList: deleteList,
- // })
- // .then((res) => {
- // if (res.code == 200) {
- // uni.navigateTo({
- // url:
- // '/pages/regiest/index?specialArea=' +
- // this.goodsCheck[0].specialArea +
- // '&shoppArr=' +
- // JSON.stringify(shoppArr),
- // })
- // } else {
- // uni.showToast({
- // title: res.msg,
- // icon: 'none',
- // mask: true,
- // })
- // }
- // })
-
+ ) {
let deleteList = [];
shoppArr.forEach((item) => {
deleteList.push({
@@ -361,46 +329,7 @@ export default {
"&shoppArr=" +
JSON.stringify(shoppArr),
});
-
- // api
- // .validShop({
- // specialArea: this.goodsCheck[0].specialArea,
- // deleteList: deleteList,
- // })
- // .then((res) => {
- // if (res.code == 200) {
- // // api
- // // .energyShop({
- // // specialArea: this.goodsCheck[0].specialArea,
- // // deleteList: deleteList,
- // // })
- // // .then((response) => {
- // // if (response.data && response.data.length > 0) {
- // // this.tableData = response.data;
- // // this.tableData.forEach((item) => {
- // // this.$set(item, "quantity", 1);
- // // });
- // // this.dialogVisible2 = true;
- // // } else {
- // // uni.navigateTo({
- // // url:
- // // "/pages/regiest/index?specialArea=" +
- // // this.goodsCheck[0].specialArea +
- // // "&shoppArr=" +
- // // JSON.stringify(shoppArr),
- // // });
- // // }
- // // });
- // }
- // });
} else if (this.goodsCheck[0].specialArea == 21) {
- // uni.navigateTo({
- // url:
- // '/pages/other/haiConfirm?allData=' +
- // JSON.stringify(this.goodsCheck[0].orderItemsParams) +
- // '&shoppArr=' +
- // JSON.stringify(shoppArr),
- // })
uni.setStorageSync(
"haiConfirm",
JSON.stringify(this.goodsCheck[0].orderItemsParams)
@@ -431,42 +360,6 @@ export default {
"&shoppArr=" +
JSON.stringify(shoppArr),
});
- // api
- // .validShop({
- // specialArea: this.goodsCheck[0].specialArea,
- // deleteList: deleteList,
- // })
- // .then((res) => {
- // if (res.code == 200) {
- // // this.tableData = response.data;
- // // this.tableData.forEach((item) => {
- // // this.$set(item, "quantity", 1);
- // // });
- // // this.dialogVisible2 = true;
- // // api
- // // .energyShop({
- // // specialArea: this.goodsCheck[0].specialArea,
- // // deleteList: deleteList,
- // // })
- // // .then((response) => {
- // // if (response.data && response.data.length > 0) {
- // // this.tableData = response.data;
- // // this.tableData.forEach((item) => {
- // // this.$set(item, "quantity", 1);
- // // });
- // // this.dialogVisible2 = true;
- // // } else {
- // // uni.navigateTo({
- // // url:
- // // "/pages/other/index?specialArea=" +
- // // this.goodsCheck[0].specialArea +
- // // "&shoppArr=" +
- // // JSON.stringify(shoppArr),
- // // });
- // // }
- // // });
- // }
- // });
} else if (this.goodsCheck[0].specialArea == 30) {
if (this.goodsCheck[0].orderItemsParams.length > 1) {
uni.showToast({
@@ -535,17 +428,9 @@ export default {
} else {
this.getCarList();
}
- // this.getShoppingCount()
});
},
checkArea() {
- // let i = 0;
- // this.shopCarList.forEach((item) => {
- // if (item.isSelected) {
- // i++;
- // }
- // });
- // this.isTo = i;
let arr = [];
this.shopCarList.forEach((item) => {
item.shoppingCartList.forEach((ctem) => {
@@ -609,13 +494,6 @@ export default {
this.$set(item, "isSelect", e);
this.checkArea();
}
- // let i = 0
- // this.shopCarList.forEach((item) => {
- // if (item.isSelected) {
- // i++
- // }
- // })
- // this.isTo = i
},
// 单删
delOne(ctem) {
diff --git a/pages/specialArea/list.vue b/pages/specialArea/list.vue
index 6bccf88..bb9380e 100644
--- a/pages/specialArea/list.vue
+++ b/pages/specialArea/list.vue
@@ -7,7 +7,6 @@
-
@@ -100,6 +99,7 @@
+
@@ -107,7 +107,8 @@
import backIcon from "@/components/backIcon.vue";
import cartBall from "@/components/cartBall.vue";
import {
- mapGetters
+ mapGetters,
+ mapActions
} from "vuex";
import * as api from "@/config/goods";
import clTabbar from "@/components/cl-tabbar.vue";
@@ -225,8 +226,20 @@
});
// 获取国家
this.getJScountry();
+ this.$nextTick(() => {
+ this.$refs.cart.getCar()
+ })
+ },
+ onHide() {
+ this.$refs.cart.close()
+ this.setSmallCarLength(0)
+ },
+ beforeDestroy() {
+ console.log('beforeDestroy........?')
+ this.setSmallCarLength(0)
},
methods: {
+ ...mapActions(['setSmallCarLength', 'setShopCarLength']),
changeCountry() {
this.isCountry = true;
},
diff --git a/store/modules/user.js b/store/modules/user.js
index c55a3d9..ca98c5c 100644
--- a/store/modules/user.js
+++ b/store/modules/user.js
@@ -22,38 +22,15 @@ const mutations = {
SET_USER: (state, user) => {
state.user = user
},
- shopCarLength: (state, data) => {
- state.shopCarLength = data
- },
- smallCarLength: (state, data) => {
+ SET_SMALL_CAR_LENGTH: (state, data) => {
state.smallCarLength = data
+ },
+ SET_SHOP_CAR_LENGTH: (state, data) => {
+ state.shopCarLength = data
}
}
const actions = {
- checkFunc({ commit }) {
- return new Promise((resolve, reject) => {
- // uni.login({
- // provider: "weixin",
- // success: function (loginRes) {
- // // 登录成功
- // let data = {
- // code: loginRes.code,
- // }
- // wxSqlogin(data).then(res => {
- // console.log("🚀 ~ AdminToken res", res);
- // if (res.code == 200) {
- // uni.setStorageSync('AdminToken', res.token)
- // uni.setStorageSync("User", res.data);
- // resolve(true)
- // }
- // })
- // },
- // fail: function (err) {
- // },
- // });
- })
- },
// 获取用户信息
GetInfo({ commit, state }) {
return new Promise((resolve, reject) => {
@@ -68,6 +45,7 @@ const actions = {
})
})
},
+
// 退出登录
LogOut({ commit, state }) {
return new Promise((resolve, reject) => {
@@ -96,13 +74,10 @@ const actions = {
let obj = { specialArea: data, pkCountry: pkCountry }
getShoppingCount(obj).then(res => {
if (res.code == 200) {
- // resolve(res)
- // commit('shopCarLength', res.data.cont)
- // commit('smallCarLength', res.data.smallCount)
getSmallCount(obj).then(res1 => {
if (res.code == 200) {
- commit('smallCarLength', res1.data.smallCount)
- commit('shopCarLength', res.data.cont)
+ commit('SET_SMALL_CAR_LENGTH', res1.data.smallCount)
+ commit('SET_SHOP_CAR_LENGTH', res.data.cont)
resolve(res)
}
})
@@ -111,6 +86,12 @@ const actions = {
})
})
},
+ setSmallCarLength({ commit }, data) {
+ commit('SET_SMALL_CAR_LENGTH', data)
+ },
+ setShopCarLength({ commit }, data) {
+ commit('SET_SHOP_CAR_LENGTH', data)
+ }
}
export default {