forked from angelo/web-retail-h5
fix(specialArea): bug-42 修复注册专区等下单支付成功后,订单后退路径不正确的问题, 购物车状态机添加set方法
This commit is contained in:
parent
00f02dc653
commit
eaf598a51e
|
@ -9,23 +9,35 @@
|
||||||
v-show="smallCarLength > 0">{{ smallCarLength }}</view>
|
v-show="smallCarLength > 0">{{ smallCarLength }}</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<u-popup :show="downShow"
|
<u-popup
|
||||||
mode="bottom"
|
:show="downShow"
|
||||||
closeOnClickOverlay
|
mode="bottom"
|
||||||
closeable
|
closeOnClickOverlay
|
||||||
round="10"
|
closeable
|
||||||
@close="close">
|
round="10"
|
||||||
|
@close="close"
|
||||||
|
>
|
||||||
<view class="title">{{ '购物车' }}</view>
|
<view class="title">{{ '购物车' }}</view>
|
||||||
<cartBtmList ref='cartBtmList'></cartBtmList>
|
<cartBtmList ref="cartBtmList" @orderCallBack="orderCallBack"></cartBtmList>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters, mapActions } from 'vuex'
|
||||||
import cartBtmList from '@/components/cartBtmList.vue'
|
import cartBtmList from '@/components/cartBtmList.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
props: {
|
||||||
|
carLength: {
|
||||||
|
type: Number | String,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
specialArea: {
|
||||||
|
type: Number | String,
|
||||||
|
default: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
cartBtmList,
|
cartBtmList,
|
||||||
},
|
},
|
||||||
|
@ -39,37 +51,17 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['smallCarLength']),
|
...mapGetters(['smallCarLength']),
|
||||||
},
|
},
|
||||||
watch: {
|
created() {
|
||||||
carLength(n, o) {
|
this.getCar()
|
||||||
this.smallCarLength = n
|
|
||||||
},
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
carLength: {
|
|
||||||
type: Number | String,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
specialArea: {
|
|
||||||
type: Number | String,
|
|
||||||
default: 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$store.dispatch('getCarLength', this.specialArea)
|
|
||||||
// .then((res) => {
|
|
||||||
// this.smallCarLength = res.data.smallCount
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
this.downShow = false
|
this.downShow = false
|
||||||
this.getCar()
|
this.getCar()
|
||||||
},
|
},
|
||||||
|
|
||||||
getCar() {
|
getCar() {
|
||||||
this.$store.dispatch('getCarLength', this.specialArea)
|
this.$store.dispatch('getCarLength', this.specialArea)
|
||||||
// .then((res) => {
|
|
||||||
// this.smallCarLength = res.data.smallCount
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
goCart() {
|
goCart() {
|
||||||
this.downShow = true
|
this.downShow = true
|
||||||
|
@ -78,6 +70,9 @@ export default {
|
||||||
})
|
})
|
||||||
// uni.switchTab({ url: '/pages/shoppingCar/index' })
|
// uni.switchTab({ url: '/pages/shoppingCar/index' })
|
||||||
},
|
},
|
||||||
|
orderCallBack() {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -12,13 +12,7 @@
|
||||||
v-for="(item, index) in shopCarList"
|
v-for="(item, index) in shopCarList"
|
||||||
:key="item.specialArea"
|
:key="item.specialArea"
|
||||||
>
|
>
|
||||||
<!-- <view class="kuang_t">
|
|
||||||
{{ item.specialAreaVal }}
|
|
||||||
</view> -->
|
|
||||||
<!-- <u-checkbox-group v-model="item.isSelect"
|
|
||||||
shape="circle"
|
|
||||||
placement="column"
|
|
||||||
@change="checkboxChange($event,item)"> -->
|
|
||||||
<view
|
<view
|
||||||
v-for="(ctem, cndex) in item.shoppingCartList"
|
v-for="(ctem, cndex) in item.shoppingCartList"
|
||||||
:key="cndex"
|
:key="cndex"
|
||||||
|
@ -352,34 +346,6 @@ export default {
|
||||||
this.goodsCheck[0].specialArea == 1 ||
|
this.goodsCheck[0].specialArea == 1 ||
|
||||||
this.goodsCheck[0].specialArea == 24
|
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 = [];
|
let deleteList = [];
|
||||||
shoppArr.forEach((item) => {
|
shoppArr.forEach((item) => {
|
||||||
deleteList.push({
|
deleteList.push({
|
||||||
|
@ -393,42 +359,6 @@ export default {
|
||||||
"&shoppArr=" +
|
"&shoppArr=" +
|
||||||
JSON.stringify(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) {
|
} else if (this.goodsCheck[0].specialArea == 21) {
|
||||||
if (
|
if (
|
||||||
this.userInfo.registerShare == 0 ||
|
this.userInfo.registerShare == 0 ||
|
||||||
|
@ -458,34 +388,6 @@ export default {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (this.goodsCheck[0].specialArea == 2) {
|
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 = [];
|
let deleteList = [];
|
||||||
shoppArr.forEach((item) => {
|
shoppArr.forEach((item) => {
|
||||||
deleteList.push({
|
deleteList.push({
|
||||||
|
@ -499,42 +401,6 @@ export default {
|
||||||
"&shoppArr=" +
|
"&shoppArr=" +
|
||||||
JSON.stringify(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) {
|
} else if (this.goodsCheck[0].specialArea == 30) {
|
||||||
if (this.goodsCheck[0].orderItemsParams.length > 1) {
|
if (this.goodsCheck[0].orderItemsParams.length > 1) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
@ -607,42 +473,6 @@ export default {
|
||||||
// this.getShoppingCount()
|
// 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() {
|
checkPrice() {
|
||||||
let totalPrice = 0;
|
let totalPrice = 0;
|
||||||
|
|
|
@ -6,27 +6,7 @@
|
||||||
<u-icon name="checkmark-circle-fill" color="#029B00"></u-icon>
|
<u-icon name="checkmark-circle-fill" color="#029B00"></u-icon>
|
||||||
<view>{{'注册成功'}}</view>
|
<view>{{'注册成功'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="digBody">
|
|
||||||
<view class="red">{{'恭喜您注册成功'}}
|
|
||||||
<view class="copy"
|
|
||||||
@click="onCopy">{{'复制'}}</view>
|
|
||||||
</view>
|
|
||||||
<view>{{'会员姓名'}}: {{ allData.memberName }}</view>
|
|
||||||
<view>{{'会员编号'}}: {{ allData.memberCode }}</view>
|
|
||||||
<view>会员电话: {{ allData.phone }}</view>
|
|
||||||
<view>登录密码: {{ allData.loginPassword }}</view>
|
|
||||||
<view>支付密码: {{ allData.payPassword }}</view>
|
|
||||||
<view>邮箱: {{ allData.email }}</view>
|
|
||||||
<view>登录网址: {{ allData.urlAddress }}</view>
|
|
||||||
</view>
|
|
||||||
<span slot="footer"
|
|
||||||
class="dialog-footer">
|
|
||||||
<view class="btn"
|
|
||||||
@click="handleClose">{{'确定'}}</view>
|
|
||||||
<view class="hui"
|
|
||||||
@click="handleClose">取消</view>
|
|
||||||
</span> -->
|
|
||||||
<!-- <view class="tit1">{{'恭喜您注册成功'}}</view> -->
|
|
||||||
<view class="getCode" @tap="onCopy">{{'复制'}}</view>
|
<view class="getCode" @tap="onCopy">{{'复制'}}</view>
|
||||||
<view class="form">
|
<view class="form">
|
||||||
<u--form labelPosition="left" labelWidth="80px" :model="allData" ref="uForm">
|
<u--form labelPosition="left" labelWidth="80px" :model="allData" ref="uForm">
|
||||||
|
@ -50,26 +30,17 @@
|
||||||
<u-form-item :label="'登录网址'+':'" borderBottom>
|
<u-form-item :label="'登录网址'+':'" borderBottom>
|
||||||
<u--input v-model="allData.urlAddress" border="none"></u--input>
|
<u--input v-model="allData.urlAddress" border="none"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<!-- <u-form-item :label="'公众号搜索'+':'"
|
|
||||||
borderBottom>
|
|
||||||
<u--input v-model="allData.gzh"
|
|
||||||
border="none"></u--input>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item :label="'APP(苹果)'+':'"
|
|
||||||
borderBottom>
|
|
||||||
<u--input v-model="allData.ios"
|
|
||||||
border="none"></u--input>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item :label="'APP(安卓)'+':'"
|
|
||||||
borderBottom>
|
|
||||||
<u--input v-model="allData.android"
|
|
||||||
border="none"></u--input>
|
|
||||||
</u-form-item> -->
|
|
||||||
</u--form>
|
</u--form>
|
||||||
<view class="disflx">
|
<view class="disflx">
|
||||||
<u-button type="success" class="uBtn" shape="circle"
|
<u-button
|
||||||
|
type="success"
|
||||||
|
class="uBtn"
|
||||||
|
shape="circle"
|
||||||
color="linear-gradient(to right, #005BAC, #005BAC )"
|
color="linear-gradient(to right, #005BAC, #005BAC )"
|
||||||
@tap="handleClose">{{'确定'}}</u-button>
|
@tap="handleClose"
|
||||||
|
>
|
||||||
|
确定
|
||||||
|
</u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<img class="yh" v-show="bia" src="@/static/images/yh.gif" alt="">
|
<img class="yh" v-show="bia" src="@/static/images/yh.gif" alt="">
|
||||||
|
|
|
@ -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 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粉确认订单
|
//hi粉确认订单
|
||||||
export const fansConfirm = (params) => http.post('/sale/api/order/fans-confirm-order', params)
|
export const fansConfirm = (params) => http.post('/sale/api/order/fans-confirm-order', params)
|
||||||
//购物车注册下单校验弹框
|
//购物车注册下单校验弹框
|
||||||
|
|
|
@ -13,7 +13,7 @@ module.exports = (vm) => {
|
||||||
|
|
||||||
//#ifdef DEV_SERVER
|
//#ifdef DEV_SERVER
|
||||||
console.log('DEV_SERVER')
|
console.log('DEV_SERVER')
|
||||||
config.baseURL = '/prod-api';
|
config.baseURL = 'http://localhost:8080/';
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#ifdef QA_SERVER
|
//#ifdef QA_SERVER
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<u-form :model="addressForm" labelWidth="auto" ref="uForm">
|
<u-form :model="addressForm" labelWidth="auto" ref="uForm">
|
||||||
<view class="view-class">
|
<view class="view-class">
|
||||||
<u-form-item
|
<u-form-item
|
||||||
:label="'收货人'"
|
label="收货人"
|
||||||
label-width="100px"
|
label-width="100px"
|
||||||
prop="recName"
|
prop="recName"
|
||||||
>
|
>
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="view-class">
|
<view class="view-class">
|
||||||
<u-form-item
|
<u-form-item
|
||||||
:label="'联系方式'"
|
label="联系方式"
|
||||||
label-width="100px"
|
label-width="100px"
|
||||||
prop="recPhone"
|
prop="recPhone"
|
||||||
>
|
>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</view>
|
||||||
<view class="view-class" @click="getDiqu">
|
<view class="view-class" @click="getDiqu">
|
||||||
<u-form-item :label="'收货地址'" label-width="100px" prop="address">
|
<u-form-item label="收货地址" label-width="100px" prop="address">
|
||||||
<view
|
<view
|
||||||
v-if="address"
|
v-if="address"
|
||||||
style="font-size: 28rpx; color: #333; margin-left: 20rpx"
|
style="font-size: 28rpx; color: #333; margin-left: 20rpx"
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="view-class">
|
<view class="view-class">
|
||||||
<u-form-item
|
<u-form-item
|
||||||
:label="'详细地址'"
|
label="详细地址"
|
||||||
class="label-style"
|
class="label-style"
|
||||||
label-width="100px"
|
label-width="100px"
|
||||||
prop="recAddress"
|
prop="recAddress"
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
placeholder-class="place-class"
|
placeholder-class="place-class"
|
||||||
class="border-color"
|
class="border-color"
|
||||||
maxlength="200"
|
maxlength="200"
|
||||||
:placeholder="'请输入详细地址'"
|
placeholder="请输入详细地址"
|
||||||
/>
|
/>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</view>
|
||||||
|
@ -98,9 +98,17 @@
|
||||||
:defaultCode="defaultCode"
|
:defaultCode="defaultCode"
|
||||||
@addressData="addressData"
|
@addressData="addressData"
|
||||||
></v-address>
|
></v-address>
|
||||||
<u-button type="success" shape="circle" class="btn" @click="submit">{{
|
<u-button
|
||||||
'确定'
|
:disabled="!addressForm.recName || !addressForm.recPhone || !addressForm.recAddress"
|
||||||
}}</u-button>
|
type="success"
|
||||||
|
shape="circle"
|
||||||
|
class="btn"
|
||||||
|
@click="submit"
|
||||||
|
color="#005BAC"
|
||||||
|
:loading="loading"
|
||||||
|
>
|
||||||
|
确定
|
||||||
|
</u-button>
|
||||||
<view style="height: 20rpx"></view>
|
<view style="height: 20rpx"></view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -129,6 +137,7 @@ export default {
|
||||||
isDefault: 0,
|
isDefault: 0,
|
||||||
pkId: "",
|
pkId: "",
|
||||||
},
|
},
|
||||||
|
loading: false,
|
||||||
rules: {
|
rules: {
|
||||||
recName: [
|
recName: [
|
||||||
{
|
{
|
||||||
|
@ -195,19 +204,26 @@ export default {
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
this.$refs.uForm.validate().then((res) => {
|
this.$refs.uForm.validate().then((res) => {
|
||||||
|
this.loading = true
|
||||||
api.saveAddress(this.addressForm).then((res) => {
|
api.saveAddress(this.addressForm).then((res) => {
|
||||||
if (res.code == "200") {
|
if (res.code == "200") {
|
||||||
uni.showToast({
|
const toast = uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
success() {
|
complete() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack(1);
|
this.loading = false
|
||||||
}, 2000);
|
uni.navigateBack(1)
|
||||||
|
toast.hideToast()
|
||||||
|
}, 500);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.loading = false
|
||||||
}
|
}
|
||||||
});
|
}).catch(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getDiqu() {
|
getDiqu() {
|
||||||
|
@ -325,8 +341,6 @@ page {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
.btn {
|
.btn {
|
||||||
background-color: #fb3024;
|
|
||||||
border: none;
|
|
||||||
height: 92rpx;
|
height: 92rpx;
|
||||||
line-height: 92rpx;
|
line-height: 92rpx;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
|
|
|
@ -1178,7 +1178,7 @@ export default {
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
|
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
uni.navigateTo({
|
uni.redirectTo({
|
||||||
url:
|
url:
|
||||||
'/pages/pay/index?paramsPost=' +
|
'/pages/pay/index?paramsPost=' +
|
||||||
JSON.stringify(res.data) +
|
JSON.stringify(res.data) +
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
<!--
|
|
||||||
* @Descripttion:
|
|
||||||
* @version:
|
|
||||||
* @Author: kBank
|
|
||||||
* @Date: 2022-11-21 15:11:22
|
|
||||||
-->
|
|
||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="index_header">
|
<view class="index_header">
|
||||||
|
@ -742,8 +737,10 @@
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<successDialog @successClose="successClose"
|
<successDialog
|
||||||
ref="successDialog"></successDialog>
|
@successClose="successClose"
|
||||||
|
ref="successDialog"
|
||||||
|
/>
|
||||||
<u-modal @confirm="toUnBind"
|
<u-modal @confirm="toUnBind"
|
||||||
@cancel='isNoBind=false'
|
@cancel='isNoBind=false'
|
||||||
:show="isNoBind"
|
:show="isNoBind"
|
||||||
|
|
|
@ -1373,7 +1373,7 @@ export default {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
uni.navigateTo({
|
uni.redirectTo({
|
||||||
url:
|
url:
|
||||||
"/pages/pay/index?paramsPost=" +
|
"/pages/pay/index?paramsPost=" +
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
|
|
|
@ -196,9 +196,6 @@ export default {
|
||||||
selTable: [],
|
selTable: [],
|
||||||
allTable: [],
|
allTable: [],
|
||||||
total: "0.00",
|
total: "0.00",
|
||||||
// show:false,
|
|
||||||
// title:'提示',
|
|
||||||
// content:'确认删除该商品?'
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -318,36 +315,7 @@ export default {
|
||||||
if (
|
if (
|
||||||
this.goodsCheck[0].specialArea == 1 ||
|
this.goodsCheck[0].specialArea == 1 ||
|
||||||
this.goodsCheck[0].specialArea == 24
|
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 = [];
|
let deleteList = [];
|
||||||
shoppArr.forEach((item) => {
|
shoppArr.forEach((item) => {
|
||||||
deleteList.push({
|
deleteList.push({
|
||||||
|
@ -361,46 +329,7 @@ export default {
|
||||||
"&shoppArr=" +
|
"&shoppArr=" +
|
||||||
JSON.stringify(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) {
|
} 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(
|
uni.setStorageSync(
|
||||||
"haiConfirm",
|
"haiConfirm",
|
||||||
JSON.stringify(this.goodsCheck[0].orderItemsParams)
|
JSON.stringify(this.goodsCheck[0].orderItemsParams)
|
||||||
|
@ -431,42 +360,6 @@ export default {
|
||||||
"&shoppArr=" +
|
"&shoppArr=" +
|
||||||
JSON.stringify(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) {
|
} else if (this.goodsCheck[0].specialArea == 30) {
|
||||||
if (this.goodsCheck[0].orderItemsParams.length > 1) {
|
if (this.goodsCheck[0].orderItemsParams.length > 1) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
@ -535,17 +428,9 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.getCarList();
|
this.getCarList();
|
||||||
}
|
}
|
||||||
// this.getShoppingCount()
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
checkArea() {
|
checkArea() {
|
||||||
// let i = 0;
|
|
||||||
// this.shopCarList.forEach((item) => {
|
|
||||||
// if (item.isSelected) {
|
|
||||||
// i++;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// this.isTo = i;
|
|
||||||
let arr = [];
|
let arr = [];
|
||||||
this.shopCarList.forEach((item) => {
|
this.shopCarList.forEach((item) => {
|
||||||
item.shoppingCartList.forEach((ctem) => {
|
item.shoppingCartList.forEach((ctem) => {
|
||||||
|
@ -609,13 +494,6 @@ export default {
|
||||||
this.$set(item, "isSelect", e);
|
this.$set(item, "isSelect", e);
|
||||||
this.checkArea();
|
this.checkArea();
|
||||||
}
|
}
|
||||||
// let i = 0
|
|
||||||
// this.shopCarList.forEach((item) => {
|
|
||||||
// if (item.isSelected) {
|
|
||||||
// i++
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// this.isTo = i
|
|
||||||
},
|
},
|
||||||
// 单删
|
// 单删
|
||||||
delOne(ctem) {
|
delOne(ctem) {
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<backIcon :diff="diff"></backIcon>
|
<backIcon :diff="diff"></backIcon>
|
||||||
<cartBall ref="cart" :carLength="shopCarLength" :specialArea="specialArea"></cartBall>
|
|
||||||
<view class="index_header">
|
<view class="index_header">
|
||||||
<view>{{ titLabel }}</view>
|
<view>{{ titLabel }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -100,6 +99,7 @@
|
||||||
<u-picker :show="isCountry" @cancel="isCountry = false" @confirm="sureCountry" :columns="countryList"
|
<u-picker :show="isCountry" @cancel="isCountry = false" @confirm="sureCountry" :columns="countryList"
|
||||||
keyName="label"></u-picker>
|
keyName="label"></u-picker>
|
||||||
<selSpaceGoods ref="selSpaceGoods" @getCar="getCatLength"></selSpaceGoods>
|
<selSpaceGoods ref="selSpaceGoods" @getCar="getCatLength"></selSpaceGoods>
|
||||||
|
<cartBall ref="cart" :carLength="shopCarLength" :specialArea="specialArea"></cartBall>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -107,7 +107,8 @@
|
||||||
import backIcon from "@/components/backIcon.vue";
|
import backIcon from "@/components/backIcon.vue";
|
||||||
import cartBall from "@/components/cartBall.vue";
|
import cartBall from "@/components/cartBall.vue";
|
||||||
import {
|
import {
|
||||||
mapGetters
|
mapGetters,
|
||||||
|
mapActions
|
||||||
} from "vuex";
|
} 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";
|
||||||
|
@ -225,8 +226,20 @@
|
||||||
});
|
});
|
||||||
// 获取国家
|
// 获取国家
|
||||||
this.getJScountry();
|
this.getJScountry();
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.cart.getCar()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onHide() {
|
||||||
|
this.$refs.cart.close()
|
||||||
|
this.setSmallCarLength(0)
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
console.log('beforeDestroy........?')
|
||||||
|
this.setSmallCarLength(0)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapActions(['setSmallCarLength', 'setShopCarLength']),
|
||||||
changeCountry() {
|
changeCountry() {
|
||||||
this.isCountry = true;
|
this.isCountry = true;
|
||||||
},
|
},
|
||||||
|
|
|
@ -22,38 +22,15 @@ const mutations = {
|
||||||
SET_USER: (state, user) => {
|
SET_USER: (state, user) => {
|
||||||
state.user = user
|
state.user = user
|
||||||
},
|
},
|
||||||
shopCarLength: (state, data) => {
|
SET_SMALL_CAR_LENGTH: (state, data) => {
|
||||||
state.shopCarLength = data
|
|
||||||
},
|
|
||||||
smallCarLength: (state, data) => {
|
|
||||||
state.smallCarLength = data
|
state.smallCarLength = data
|
||||||
|
},
|
||||||
|
SET_SHOP_CAR_LENGTH: (state, data) => {
|
||||||
|
state.shopCarLength = data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const actions = {
|
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 }) {
|
GetInfo({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
@ -68,6 +45,7 @@ const actions = {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 退出登录
|
// 退出登录
|
||||||
LogOut({ commit, state }) {
|
LogOut({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
@ -96,13 +74,10 @@ const actions = {
|
||||||
let obj = { specialArea: data, pkCountry: pkCountry }
|
let obj = { specialArea: data, pkCountry: pkCountry }
|
||||||
getShoppingCount(obj).then(res => {
|
getShoppingCount(obj).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
// resolve(res)
|
|
||||||
// commit('shopCarLength', res.data.cont)
|
|
||||||
// commit('smallCarLength', res.data.smallCount)
|
|
||||||
getSmallCount(obj).then(res1 => {
|
getSmallCount(obj).then(res1 => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
commit('smallCarLength', res1.data.smallCount)
|
commit('SET_SMALL_CAR_LENGTH', res1.data.smallCount)
|
||||||
commit('shopCarLength', res.data.cont)
|
commit('SET_SHOP_CAR_LENGTH', res.data.cont)
|
||||||
resolve(res)
|
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 {
|
export default {
|
||||||
|
|
Loading…
Reference in New Issue