Merge branch 'dev' into test
This commit is contained in:
@@ -9,10 +9,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.box-share {
|
.box-share {
|
||||||
|
width: 600rpx;
|
||||||
.box-img {
|
.box-img {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 600rpx;
|
|
||||||
height: 832rpx;
|
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
@@ -26,14 +25,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.main-img {
|
.main-img {
|
||||||
width: 600rpx;
|
width: 100%;
|
||||||
height: 832rpx;
|
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
width: 600rpx;
|
width: 100%;
|
||||||
height: 120rpx;
|
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+25
-11
@@ -399,21 +399,22 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getCart()
|
this.getCart()
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.getAddress()
|
this.getAddress()
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.isEdit = false
|
this.isEdit = false
|
||||||
uni.$on('chooseAddress', (res) => {
|
|
||||||
this.addressInfo = res;
|
|
||||||
this.$forceUpdate()
|
|
||||||
})
|
|
||||||
if (!this.isLoad) {
|
if (!this.isLoad) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.closeAttr()
|
this.closeAttr()
|
||||||
this.getCart()
|
this.getCart()
|
||||||
|
// 选择地址
|
||||||
|
const cartChooseAddress = uni.getStorageSync('cartChooseAddress') || {}
|
||||||
|
if (cartChooseAddress.id) {
|
||||||
|
this.addressInfo = cartChooseAddress
|
||||||
|
uni.setStorageSync('cartChooseAddress', {})
|
||||||
|
return
|
||||||
|
}
|
||||||
this.getAddress()
|
this.getAddress()
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
@@ -435,7 +436,7 @@ export default {
|
|||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/user/address/AddressManagement/index",
|
path: "/pages/user/address/AddressManagement/index",
|
||||||
query: {
|
query: {
|
||||||
choosMode: 1
|
choosMode: 2
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -443,15 +444,28 @@ export default {
|
|||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/user/address/AddAddress/index",
|
path: "/pages/user/address/AddAddress/index",
|
||||||
query: {
|
query: {
|
||||||
choosMode: 1
|
choosMode: 2
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getAddress() {
|
getAddress() {
|
||||||
getAddressList({page: 1, limit: 9999}).then(res => {
|
getAddressList({page: 1, limit: 9999}).then(res => {
|
||||||
this.addressList = res.data
|
const { data = [] } = res
|
||||||
this.addressInfo = res.data.find(e => e.isDefault == 1) || res.data[0] && res.data[0] || null
|
this.addressList = data
|
||||||
});
|
if (!this.addressInfo.id) {
|
||||||
|
this.addressInfo = data.find(e => e.isDefault == 1) || (data && data[0]) || null
|
||||||
|
} else {
|
||||||
|
let isExist = false
|
||||||
|
data.map(item => {
|
||||||
|
if (item.id === this.addressInfo.id) {
|
||||||
|
isExist = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (!isExist) {
|
||||||
|
this.addressInfo = data.find(e => e.isDefault == 1) || (data && data[0]) || null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
clearCart() {
|
clearCart() {
|
||||||
const ids = this.list.map(l => {
|
const ids = this.list.map(l => {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<image :src="webUrl + '/page/qianxian/icon-phone.png'" class="img" />
|
<image :src="webUrl + '/page/qianxian/icon-phone.png'" class="img" />
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center">客服</view>
|
<view class="text-center">咨询</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<view v-if="posterImageStatus" class="poster-first">
|
<view v-if="posterImageStatus" class="poster-first">
|
||||||
<div class="posterCanvasWarp">
|
<view class="poster-pop">
|
||||||
<canvas class="posterCanvas" canvas-id="myCanvas"></canvas>
|
|
||||||
</div>
|
|
||||||
<view class="poster-pop" v-show="canvasStatus">
|
|
||||||
<img
|
<img
|
||||||
src="@/static/images/poster-close.png"
|
src="@/static/images/poster-close.png"
|
||||||
|
mode="widthFix"
|
||||||
class="close"
|
class="close"
|
||||||
@click="posterImageClose"
|
@click="posterImageClose"
|
||||||
mode="widthFix"
|
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
:src="posterImage"
|
:src="posterImage"
|
||||||
@@ -27,15 +24,13 @@
|
|||||||
import { getShareImg } from "@/api/product";
|
import { getShareImg } from "@/api/product";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "StorePoster",
|
name: "LandMarkShareImg",
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
canvasStatus: false,
|
|
||||||
posterImage: "",
|
posterImage: "",
|
||||||
posterImageStatus: false,
|
posterImageStatus: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted: function () {},
|
|
||||||
methods: {
|
methods: {
|
||||||
saveImg(url) {
|
saveImg(url) {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@@ -69,7 +64,6 @@ export default {
|
|||||||
},
|
},
|
||||||
posterImageClose() {
|
posterImageClose() {
|
||||||
this.posterImageStatus = false;
|
this.posterImageStatus = false;
|
||||||
this.canvasStatus = false;
|
|
||||||
this.$emit("setPosterImageStatus");
|
this.$emit("setPosterImageStatus");
|
||||||
},
|
},
|
||||||
savePosterPath(id) {
|
savePosterPath(id) {
|
||||||
@@ -77,7 +71,6 @@ export default {
|
|||||||
|
|
||||||
getShareImg(id)
|
getShareImg(id)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.canvasStatus = true;
|
|
||||||
this.posterImage = res.data;
|
this.posterImage = res.data;
|
||||||
this.posterImageStatus = true;
|
this.posterImageStatus = true;
|
||||||
})
|
})
|
||||||
@@ -118,38 +111,6 @@ export default {
|
|||||||
height: auto;
|
height: auto;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
}
|
}
|
||||||
.poster-pop .canvas .image {
|
|
||||||
width: 4.5 * 100rpx;
|
|
||||||
height: 4.5 * 100rpx;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.poster-pop .canvas .text {
|
|
||||||
text-align: center;
|
|
||||||
color: #000000;
|
|
||||||
margin-top: 0.32 * 100rpx;
|
|
||||||
}
|
|
||||||
.poster-pop .canvas .text.black {
|
|
||||||
height: 0.68 * 100rpx;
|
|
||||||
}
|
|
||||||
.poster-pop .canvas .text.rad {
|
|
||||||
color: #ff0000;
|
|
||||||
}
|
|
||||||
.poster-pop .canvas .code {
|
|
||||||
height: 1.4 * 100rpx;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
.poster-pop .canvas .code .code-img {
|
|
||||||
width: 33%;
|
|
||||||
padding: 0.06 * 100rpx;
|
|
||||||
}
|
|
||||||
.poster-pop .canvas .code .code-img image {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.poster-pop .canvas .code .code-text {
|
|
||||||
width: 60%;
|
|
||||||
font-size: 0.12 * 100rpx;
|
|
||||||
line-height: 1.64 * 100rpx;
|
|
||||||
}
|
|
||||||
.poster-pop .close {
|
.poster-pop .close {
|
||||||
width: 0.46 * 100rpx;
|
width: 0.46 * 100rpx;
|
||||||
height: 0.75 * 100rpx;
|
height: 0.75 * 100rpx;
|
||||||
|
|||||||
@@ -246,9 +246,7 @@ export default {
|
|||||||
delayId: null,
|
delayId: null,
|
||||||
pageKeyId: Object.freeze('userOrderIndex'),
|
pageKeyId: Object.freeze('userOrderIndex'),
|
||||||
keyword: '',
|
keyword: '',
|
||||||
_orderId: '',
|
_orderId: ''
|
||||||
addressId: '',
|
|
||||||
currentRoute: ''
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -258,34 +256,12 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: mapGetters(["userInfo"]),
|
computed: mapGetters(["userInfo"]),
|
||||||
onShow() {
|
onShow() {
|
||||||
this.type = this.type || parseInt(this.$yroute.query.type) || 0;
|
const _this = this
|
||||||
this.changeType(this.type);
|
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
|
||||||
this.getOrderData();
|
const addressId = chooseAddress.id || ''
|
||||||
this.getOrderListReq();
|
// 监听到选择收货地址
|
||||||
uni.$on('chooseAddress', (res) => {
|
if (addressId) {
|
||||||
this.addressId = res.id
|
uni.setStorageSync('chooseAddress', {})
|
||||||
|
|
||||||
})
|
|
||||||
const pages = getCurrentPages() // 获取栈实例
|
|
||||||
this.currentRoute = pages[pages.length - 1].route;
|
|
||||||
},
|
|
||||||
onHide() {
|
|
||||||
this.orderList = [];
|
|
||||||
this.page = 1;
|
|
||||||
this.limit = 20;
|
|
||||||
this.loaded = false;
|
|
||||||
this.loading = false;
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
addressId(val) {
|
|
||||||
const pages = getCurrentPages() // 获取栈实例
|
|
||||||
let currentRoute = pages[pages.length - 2].route;
|
|
||||||
if(val && this.currentRoute === currentRoute) {
|
|
||||||
const params = {
|
|
||||||
addressId: this.addressId,
|
|
||||||
orderId: this._orderId
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title:'确定修改地址吗?',
|
title:'确定修改地址吗?',
|
||||||
content: '',
|
content: '',
|
||||||
@@ -295,23 +271,30 @@ export default {
|
|||||||
success:(success)=>{
|
success:(success)=>{
|
||||||
if(success.confirm) {
|
if(success.confirm) {
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
editAddress(params).then(res => {
|
editAddress({
|
||||||
|
addressId,
|
||||||
|
orderId: _this._orderId
|
||||||
|
}).then(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
title: '修改成功!'
|
title: '修改成功!'
|
||||||
})
|
})
|
||||||
|
_this.changeType()
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
complete:(complete)=>{
|
cancel: () => {
|
||||||
this.addressId = ''
|
_this.changeType()
|
||||||
this._orderId = ''
|
|
||||||
},
|
},
|
||||||
})
|
complete:(complete)=>{
|
||||||
}, 1000)
|
_this._orderId = ''
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
_this.type = _this.type || parseInt(_this.$yroute.query.type) || 0;
|
||||||
|
_this.changeType(_this.type);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -465,7 +465,6 @@ export default {
|
|||||||
mixins: [pageListenMixins],
|
mixins: [pageListenMixins],
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
addressId: null,
|
|
||||||
showExtend: false,
|
showExtend: false,
|
||||||
delayId: '',
|
delayId: '',
|
||||||
showMore: false,
|
showMore: false,
|
||||||
@@ -498,20 +497,12 @@ export default {
|
|||||||
...mapGetters(["userInfo"])
|
...mapGetters(["userInfo"])
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.id = this.$yroute.query.id;
|
const _this = this
|
||||||
this.getDetail();
|
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
|
||||||
uni.$on('chooseAddress', (res) => {
|
const addressId = chooseAddress.id || ''
|
||||||
this.addressId = res.id
|
// 监听到选择收货地址
|
||||||
})
|
if (addressId) {
|
||||||
},
|
uni.setStorageSync('chooseAddress', {})
|
||||||
watch: {
|
|
||||||
addressId(val) {
|
|
||||||
if(val) {
|
|
||||||
const params = {
|
|
||||||
addressId: this.addressId,
|
|
||||||
orderId: this.orderInfo.orderId
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title:'确定修改地址吗?',
|
title:'确定修改地址吗?',
|
||||||
content: '',
|
content: '',
|
||||||
@@ -521,12 +512,15 @@ export default {
|
|||||||
success:(success)=>{
|
success:(success)=>{
|
||||||
if(success.confirm) {
|
if(success.confirm) {
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
editAddress(params).then(res => {
|
editAddress({
|
||||||
|
addressId,
|
||||||
|
orderId: _this.orderInfo.orderId
|
||||||
|
}).then(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
title: '修改成功!'
|
title: '修改成功!'
|
||||||
})
|
})
|
||||||
this.getDetail();
|
_this.getDetail()
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
})
|
})
|
||||||
@@ -534,11 +528,11 @@ export default {
|
|||||||
},
|
},
|
||||||
complete:(complete)=>{
|
complete:(complete)=>{
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
this.addressId = ''
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}, 1000)
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
_this.id = _this.$yroute.query.id;
|
||||||
|
_this.getDetail();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// inject: ["app"],
|
// inject: ["app"],
|
||||||
|
|||||||
@@ -388,49 +388,46 @@ export default {
|
|||||||
this.computedPrice('couponId')
|
this.computedPrice('couponId')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad: function () {
|
onLoad() {
|
||||||
let that = this;
|
const that = this
|
||||||
uni.$on('chooseAddress', (res) => {
|
if (that.$yroute.query.pinkid !== undefined) {
|
||||||
console.log('监听到选择收货地址:' + JSON.stringify(res));
|
that.pinkId = that.$yroute.query.pinkid
|
||||||
setTimeout(() => {
|
}
|
||||||
|
if (that.$yroute.query.id !== undefined) {
|
||||||
|
that.cartid = that.$yroute.query.id
|
||||||
|
console.log(that.cartid)
|
||||||
|
}
|
||||||
|
if (that.$yroute.query.lotteryRecordId !== undefined) {
|
||||||
|
that.lotteryRecordId = that.$yroute.query.lotteryRecordId
|
||||||
|
}
|
||||||
|
that.getCartInfo()
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
const _this = this
|
||||||
|
//获取用户信息
|
||||||
|
_this.$store.dispatch("getUser", true)
|
||||||
|
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
|
||||||
|
// 监听到选择收货地址
|
||||||
|
if (chooseAddress.id) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title:'确定修改地址吗?',
|
title:'确定修改地址吗?',
|
||||||
content: '',
|
content: '',
|
||||||
showCancel: true,
|
showCancel: true,
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
confirmText: '确认',
|
confirmText: '确认',
|
||||||
success:(success)=>{
|
success: (res) => {
|
||||||
if(success.confirm) {
|
if(res.confirm) {
|
||||||
that.addressInfo = res;
|
_this.addressInfo = chooseAddress
|
||||||
// 地址切换也要重新计算一下
|
// 地址切换也要重新计算一下
|
||||||
that.computedPrice('onLoad chooseAddress');
|
_this.computedPrice('onLoad chooseAddress')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
complete:(complete)=>{
|
complete: () => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
},
|
uni.setStorageSync('chooseAddress', {})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
|
||||||
},1000)
|
|
||||||
if (that.$yroute.query.pinkid !== undefined) {
|
|
||||||
that.pinkId = that.$yroute.query.pinkid;
|
|
||||||
}
|
}
|
||||||
if (that.$yroute.query.id !== undefined) {
|
|
||||||
that.cartid = that.$yroute.query.id;
|
|
||||||
console.log(that.cartid)
|
|
||||||
}
|
|
||||||
if (that.$yroute.query.lotteryRecordId !== undefined) {
|
|
||||||
that.lotteryRecordId = that.$yroute.query.lotteryRecordId;
|
|
||||||
}
|
|
||||||
that.getCartInfo();
|
|
||||||
},
|
|
||||||
onUnload: function () {
|
|
||||||
console.log('关闭监听选择收货地址');
|
|
||||||
uni.$off('chooseAddress');
|
|
||||||
},
|
|
||||||
onShow: function () {
|
|
||||||
//获取用户信息
|
|
||||||
this.$store.dispatch("getUser", true);
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isNullOrEmpty,
|
isNullOrEmpty,
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
district: [],
|
district: [],
|
||||||
id: 0,
|
id: 0,
|
||||||
|
// 是否选择地址模式:0-不是,1-来源订单创建页面,2-来源购物车
|
||||||
|
choosMode: 0,
|
||||||
userAddress: {
|
userAddress: {
|
||||||
realName: '',
|
realName: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
@@ -104,6 +106,15 @@ export default {
|
|||||||
addressInput: ''
|
addressInput: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
onLoad(e) {
|
||||||
|
// 是否选择模式
|
||||||
|
const choosMode = this.$yroute.query.choosMode || 0
|
||||||
|
if (choosMode) {
|
||||||
|
this.choosMode = parseInt(choosMode)
|
||||||
|
} else {
|
||||||
|
this.choosMode = 0
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
const id = this.$yroute.query.id
|
const id = this.$yroute.query.id
|
||||||
this.id = id
|
this.id = id
|
||||||
@@ -382,7 +393,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(that.$yroute.query.choosMode == 1) {
|
if (that.choosMode) {
|
||||||
const item = {
|
const item = {
|
||||||
id: res.data.id,
|
id: res.data.id,
|
||||||
realName: name,
|
realName: name,
|
||||||
@@ -394,7 +405,12 @@ export default {
|
|||||||
is_default: isDefault ? true : false,
|
is_default: isDefault ? true : false,
|
||||||
post_code: ""
|
post_code: ""
|
||||||
}
|
}
|
||||||
uni.$emit('chooseAddress', item)
|
if(that.choosMode === 1) {
|
||||||
|
uni.setStorageSync('chooseAddress', item)
|
||||||
|
}
|
||||||
|
if(that.choosMode === 2) {
|
||||||
|
uni.setStorageSync('cartChooseAddress', item)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
that.$yrouter.back();
|
that.$yrouter.back();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view
|
<view
|
||||||
class="address-management"
|
|
||||||
:class="addressList.length < 1 && page > 1 ? 'on' : ''"
|
|
||||||
ref="container"
|
ref="container"
|
||||||
|
:class="addressList.length < 1 && page > 1 ? 'on' : ''"
|
||||||
|
class="address-management"
|
||||||
>
|
>
|
||||||
<view style="margin-bottom: 12rpx;" class="line" v-if="addressList.length > 0">
|
<view style="margin-bottom: 12rpx;" class="line" v-if="addressList.length > 0">
|
||||||
<!-- <image :src="webUrl+'/20230304135025917856.png'"/> -->
|
<!-- <image :src="webUrl+'/20230304135025917856.png'"/> -->
|
||||||
@@ -25,7 +24,7 @@
|
|||||||
}}{{ item.detail }}
|
}}{{ item.detail }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="!chooseMode" class="operation acea-row row-between-wrapper">
|
<view v-if="!choosMode" class="operation acea-row row-between-wrapper">
|
||||||
<view class="select-btn">
|
<view class="select-btn">
|
||||||
<view class="checkbox-wrapper">
|
<view class="checkbox-wrapper">
|
||||||
<checkbox-group @change.stop="radioChange(item.id)">
|
<checkbox-group @change.stop="radioChange(item.id)">
|
||||||
@@ -65,22 +64,13 @@
|
|||||||
<text class="iconfont icon-tianjiadizhi"></text>
|
<text class="iconfont icon-tianjiadizhi"></text>
|
||||||
添加新地址
|
添加新地址
|
||||||
</view>
|
</view>
|
||||||
<!--<view class="addressBnt wxbnt" v-if="isWechat" @click="getAddress">-->
|
|
||||||
<!--<text class="iconfont icon-weixin2"></text>导入微信地址-->
|
|
||||||
<!--</view>-->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<style scoped lang="less">
|
|
||||||
.address-management.on {
|
|
||||||
background-color: #fff;
|
|
||||||
height: 100vh;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script type="text/babel">
|
<script type="text/babel">
|
||||||
import {getAddressDefaultSet, getAddressList, getAddressRemove} from "@/api/user";
|
import {getAddressDefaultSet, getAddressList, getAddressRemove} from "@/api/user"
|
||||||
import Loading from "@/components/Loading";
|
import Loading from "@/components/Loading"
|
||||||
import {isWeixin} from "@/utils";
|
import {isWeixin} from "@/utils"
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -93,85 +83,92 @@ export default {
|
|||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
chooseMode: false,//是否选择地址模式
|
// 是否选择地址模式:0-不是,1-来源订单创建页面,2-来源购物车
|
||||||
|
choosMode: 0,
|
||||||
addressList: [],
|
addressList: [],
|
||||||
loadTitle: "",
|
loadTitle: "",
|
||||||
loading: false,
|
loading: false,
|
||||||
loadend: false,
|
loadend: false,
|
||||||
isWechat: isWeixin(),
|
isWechat: isWeixin(),
|
||||||
pageKeyId: Object.freeze('userAddressIndex')
|
pageKeyId: Object.freeze('userAddressIndex')
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted() {
|
||||||
this.AddressList();
|
this.AddressList()
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
!this.loading && this.AddressList();
|
!this.loading && this.AddressList()
|
||||||
},
|
},
|
||||||
onLoad: function (e) {
|
onLoad(e) {
|
||||||
// 是否选择模式
|
// 是否选择模式
|
||||||
if (this.$yroute.query.choosMode != undefined) {
|
const choosMode = this.$yroute.query.choosMode || 0
|
||||||
this.chooseMode = true;
|
if (choosMode) {
|
||||||
|
this.choosMode = parseInt(choosMode)
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: '选择收货地址'
|
title: '选择收货地址'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.chooseMode = false;
|
this.choosMode = 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow: function () {
|
onShow() {
|
||||||
this.refresh();
|
this.refresh()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
tapAddress: function (item) {
|
tapAddress(item) {
|
||||||
if (this.chooseMode) {
|
// 来源订单创建页面
|
||||||
//通知前一界面修改地址
|
if (this.choosMode === 1) {
|
||||||
uni.$emit('chooseAddress', item)
|
uni.setStorageSync('chooseAddress', item)
|
||||||
//关闭当前页面
|
this.$yrouter.back()
|
||||||
this.$yrouter.back();
|
}
|
||||||
|
// 来源购物车
|
||||||
|
if (this.choosMode === 2) {
|
||||||
|
uni.setStorageSync('cartChooseAddress', item)
|
||||||
|
this.$yrouter.back()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
refresh: function () {
|
refresh() {
|
||||||
this.addressList = [];
|
this.addressList = []
|
||||||
this.page = 1;
|
this.page = 1
|
||||||
this.loadend = false;
|
this.loadend = false
|
||||||
this.AddressList();
|
this.AddressList()
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 获取地址列表
|
* 获取地址列表
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
AddressList: function () {
|
AddressList() {
|
||||||
let that = this;
|
const that = this
|
||||||
if (that.loading) return; //阻止下次请求(false可以进行请求);
|
// 阻止下次请求(false可以进行请求)
|
||||||
if (that.loadend) return; //阻止结束当前请求(false可以进行请求);
|
if (that.loading) return
|
||||||
that.loading = true;
|
// 阻止结束当前请求(false可以进行请求)
|
||||||
|
if (that.loadend) return
|
||||||
|
that.loading = true
|
||||||
getAddressList({page: that.page, limit: that.limit}).then(res => {
|
getAddressList({page: that.page, limit: that.limit}).then(res => {
|
||||||
that.loading = false;
|
that.loading = false
|
||||||
//apply();js将一个数组插入另一个数组;
|
// apply();js将一个数组插入另一个数组
|
||||||
that.addressList.push.apply(that.addressList, res.data);
|
that.addressList.push.apply(that.addressList, res.data)
|
||||||
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成;
|
// 判断所有数据是否加载完成
|
||||||
that.page = that.page + 1;
|
that.loadend = res.data.length < that.limit
|
||||||
});
|
that.page = that.page + 1
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 编辑地址
|
* 编辑地址
|
||||||
*/
|
*/
|
||||||
editAddress: function (index) {
|
editAddress(index) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/user/address/AddAddress/index",
|
path: "/pages/user/address/AddAddress/index",
|
||||||
query: {id: this.addressList[index].id}
|
query: {id: this.addressList[index].id}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 删除地址
|
* 删除地址
|
||||||
*/
|
*/
|
||||||
delAddress: function (index) {
|
delAddress(index) {
|
||||||
let that = this;
|
const that = this
|
||||||
let address = this.addressList[index];
|
const address = this.addressList[index]
|
||||||
let id = address.id;
|
const id = address.id
|
||||||
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '确认删除此收货地址?',
|
title: '确认删除此收货地址?',
|
||||||
content: '',
|
content: '',
|
||||||
@@ -179,7 +176,6 @@ export default {
|
|||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
confirmText: '确认',
|
confirmText: '确认',
|
||||||
success: res => {
|
success: res => {
|
||||||
|
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
getAddressRemove(id).then(function () {
|
getAddressRemove(id).then(function () {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -187,84 +183,40 @@ export default {
|
|||||||
icon: "success",
|
icon: "success",
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
complete: () => {
|
complete: () => {
|
||||||
that.addressList.splice(index, 1);
|
that.addressList.splice(index, 1)
|
||||||
that.$set(that, "addressList", that.addressList);
|
that.$set(that, "addressList", that.addressList)
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
},
|
|
||||||
complete: () => {
|
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 设置默认地址
|
* 设置默认地址
|
||||||
*/
|
*/
|
||||||
radioChange: function (id) {
|
radioChange(id) {
|
||||||
getAddressDefaultSet(id).then(res => {
|
getAddressDefaultSet(id).then(res => {
|
||||||
this.refresh();
|
this.refresh()
|
||||||
uni.showToast({title: res.msg, icon: "none", duration: 2000});
|
uni.showToast({title: res.msg, icon: "none", duration: 2000})
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 新增地址
|
* 新增地址
|
||||||
*/
|
*/
|
||||||
addAddress: function () {
|
addAddress() {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/user/address/AddAddress/index"
|
path: "/pages/user/address/AddAddress/index"
|
||||||
});
|
})
|
||||||
},
|
}
|
||||||
getAddress() {
|
|
||||||
// openAddress().then(userInfo => {
|
|
||||||
// uni.showLoading({ title: "加载中" });
|
|
||||||
// postAddress({
|
|
||||||
// real_name: userInfo.userName,
|
|
||||||
// phone: userInfo.telNumber,
|
|
||||||
// address: {
|
|
||||||
// province: userInfo.provinceName,
|
|
||||||
// city: userInfo.cityName,
|
|
||||||
// district: userInfo.countryName
|
|
||||||
// },
|
|
||||||
// detail: userInfo.detailInfo,
|
|
||||||
// post_code: userInfo.postalCode,
|
|
||||||
// wx_export: 1
|
|
||||||
// })
|
|
||||||
// .then(() => {
|
|
||||||
// this.page = 1;
|
|
||||||
// this.loading = false;
|
|
||||||
// this.loadend = false;
|
|
||||||
// this.addressList = [];
|
|
||||||
// this.AddressList();
|
|
||||||
// uni.hideLoading();
|
|
||||||
// uni.showToast({
|
|
||||||
// title: "添加成功",
|
|
||||||
// icon: 'success',
|
|
||||||
// duration: 2000
|
|
||||||
// });
|
|
||||||
// })
|
|
||||||
// .catch(err => {
|
|
||||||
// uni.hideLoading();
|
|
||||||
// uni.showToast({
|
|
||||||
// title: err.msg || err.response.data.msg|| err.response.data.message,
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 2000
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
.address-management.on {
|
||||||
|
background-color: #fff;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
.address-management .item {
|
.address-management .item {
|
||||||
box-shadow: 0px 6rpx 6rpx rgba(0, 0, 0, 0.1);
|
box-shadow: 0px 6rpx 6rpx rgba(0, 0, 0, 0.1);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
@@ -272,5 +224,4 @@ export default {
|
|||||||
margin-left: 32rpx;
|
margin-left: 32rpx;
|
||||||
margin-right: 32rpx;
|
margin-right: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -401,10 +401,15 @@
|
|||||||
class="icon"
|
class="icon"
|
||||||
@click="changeShare"
|
@click="changeShare"
|
||||||
/>
|
/>
|
||||||
<image :src="posterUrl" class="main-img" />
|
<image
|
||||||
|
:src="posterUrl"
|
||||||
|
mode="widthFix"
|
||||||
|
class="main-img"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/20230608112210135038.png'"
|
:src="webUrl + '/20230608112210135038.png'"
|
||||||
|
mode="widthFix"
|
||||||
class="btn"
|
class="btn"
|
||||||
@click="saveImg"
|
@click="saveImg"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -602,10 +602,11 @@
|
|||||||
class="icon"
|
class="icon"
|
||||||
@click="closeShare"
|
@click="closeShare"
|
||||||
/>
|
/>
|
||||||
<image :src="posterUrl" class="main-img" />
|
<image :src="posterUrl" class="main-img" mode="widthFix" />
|
||||||
</view>
|
</view>
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/20230608112210135038.png'"
|
:src="webUrl + '/20230608112210135038.png'"
|
||||||
|
mode="widthFix"
|
||||||
class="btn"
|
class="btn"
|
||||||
@click="saveImg"
|
@click="saveImg"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -158,9 +158,18 @@ export default {
|
|||||||
<view class="box-share">
|
<view class="box-share">
|
||||||
<view class="box-img">
|
<view class="box-img">
|
||||||
<image class="icon" :src="webUrl+'/20230608112219219303.png'" @click="changeShare"/>
|
<image class="icon" :src="webUrl+'/20230608112219219303.png'" @click="changeShare"/>
|
||||||
<image class="main-img" :src="posterUrl"/>
|
<image
|
||||||
|
:src="posterUrl"
|
||||||
|
mode="widthFix"
|
||||||
|
class="main-img"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
<image class="btn" :src="webUrl+'/20230608112210135038.png'" @click="saveImg"/>
|
<image
|
||||||
|
:src="webUrl+'/20230608112210135038.png'"
|
||||||
|
mode="widthFix"
|
||||||
|
class="btn"
|
||||||
|
@click="saveImg"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user