some features
This commit is contained in:
parent
eea5ef4b28
commit
6661b4dd3d
|
|
@ -1235,7 +1235,8 @@ button.cuIcon.lg {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 146upx;
|
left: 146upx;
|
||||||
width: calc(100% - 96upx - 60upx - 120upx - 20upx);
|
width: calc(100% - 96upx - 60upx - 120upx - 20upx);
|
||||||
line-height: 1.6em;
|
/* line-height: 1.6em; */
|
||||||
|
max-height: 128upx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cu-list.menu-avatar>.cu-item .content.flex-sub {
|
.cu-list.menu-avatar>.cu-item .content.flex-sub {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@ import globalData from '@/common/js/globalData.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// address: 'https://www.opsoul.com:8881',https://gmhl.opsoul.com
|
// address: 'https://www.opsoul.com:8881',https://gmhl.opsoul.com
|
||||||
address: 'https://gmhl.opsoul.com',
|
// address: 'https://gmhl.opsoul.com',
|
||||||
|
address: 'https://gmhl.gmjlb.com',
|
||||||
// 异步接口拦截
|
// 异步接口拦截
|
||||||
addInterceptor() {
|
addInterceptor() {
|
||||||
uni.addInterceptor('request', {
|
uni.addInterceptor('request', {
|
||||||
|
|
@ -12,8 +13,8 @@ export default {
|
||||||
title: '加载中'
|
title: '加载中'
|
||||||
})
|
})
|
||||||
// request 触发前拼接 url
|
// request 触发前拼接 url
|
||||||
args.url = 'https://gmhl.opsoul.com' + args.url;
|
// args.url = 'https://gmhl.opsoul.com' + args.url;
|
||||||
// args.url = 'http://192.168.2.54:80' + args.url;
|
args.url = 'https://gmhl.gmjlb.com' + args.url;
|
||||||
// args.url = 'http://127.0.0.1:80' + args.url;
|
// args.url = 'http://127.0.0.1:80' + args.url;
|
||||||
if (args.data && Object.prototype && Object.prototype.toString.call(args.data) === '[object Object]') {
|
if (args.data && Object.prototype && Object.prototype.toString.call(args.data) === '[object Object]') {
|
||||||
args.data.deptId = globalData.deptId;
|
args.data.deptId = globalData.deptId;
|
||||||
|
|
@ -135,11 +136,20 @@ export default {
|
||||||
})
|
})
|
||||||
return res[1].data;
|
return res[1].data;
|
||||||
},
|
},
|
||||||
async login() {
|
async login(phoneNumber) {
|
||||||
let userInfo = await wx.getUserProfile({
|
const _this = this;
|
||||||
desc: '用于小程序登录'
|
// uni.getUserInfo({
|
||||||
});
|
// provider: 'weixin',
|
||||||
console.log(userInfo)
|
// withCredentials: true,
|
||||||
|
// lang: 'zh_CN',
|
||||||
|
// success: async (obj) => {
|
||||||
|
// console.log(obj);
|
||||||
|
// }})
|
||||||
|
// let userInfo = await wx.getUserProfile({
|
||||||
|
// desc: '用于小程序登录'
|
||||||
|
// });
|
||||||
|
// console.log(userInfo)
|
||||||
|
let userInfo;
|
||||||
// 获取微信登录凭证
|
// 获取微信登录凭证
|
||||||
const wxLoginRes = await wx.login();
|
const wxLoginRes = await wx.login();
|
||||||
// 获取openid
|
// 获取openid
|
||||||
|
|
@ -157,9 +167,11 @@ export default {
|
||||||
// 注册完成后再次从服务端获取用户信息
|
// 注册完成后再次从服务端获取用户信息
|
||||||
let registerRes = await this.registerUser({
|
let registerRes = await this.registerUser({
|
||||||
openId: openId,
|
openId: openId,
|
||||||
name: userInfo.userInfo.nickName,
|
name: "微信用户",
|
||||||
customerLogoUrl: userInfo.userInfo.avatarUrl,
|
customerLogoUrl: "https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132",
|
||||||
status: 0
|
status: 0,
|
||||||
|
account: phoneNumber,
|
||||||
|
phone: phoneNumber
|
||||||
});
|
});
|
||||||
if (registerRes.code === 0) {
|
if (registerRes.code === 0) {
|
||||||
wxGetUserRes = await this.qryUserInfo(openId);
|
wxGetUserRes = await this.qryUserInfo(openId);
|
||||||
|
|
@ -182,10 +194,11 @@ export default {
|
||||||
}
|
}
|
||||||
// 页面存储用户登录有效信息,以便其他页面调用
|
// 页面存储用户登录有效信息,以便其他页面调用
|
||||||
uni.setStorageSync('userProfile', userInfo);
|
uni.setStorageSync('userProfile', userInfo);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
async storageExistUser() {
|
async storageExistUser() {
|
||||||
uni.clearStorageSync('userProfile');
|
uni.setStorageSync('userProfile', {});
|
||||||
// 获取微信登录凭证
|
// 获取微信登录凭证
|
||||||
const wxLoginRes = await wx.login();
|
const wxLoginRes = await wx.login();
|
||||||
// 获取openid
|
// 获取openid
|
||||||
|
|
@ -266,12 +279,13 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (phoneRes && phoneRes.data) {
|
if (phoneRes && phoneRes.data) {
|
||||||
let userInfo = this.getCurUserInfo();
|
await this.login(phoneRes.data)
|
||||||
await this.updateUser({
|
// let userInfo = this.getCurUserInfo();
|
||||||
customerId: userInfo.customerId,
|
// await this.updateUser({
|
||||||
account: phoneRes.data,
|
// customerId: userInfo.customerId,
|
||||||
phone: phoneRes.data
|
// account: phoneRes.data,
|
||||||
})
|
// phone: phoneRes.data
|
||||||
|
// })
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -306,6 +320,14 @@ export default {
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getChooseCategories(params = {}) {
|
||||||
|
const res = uni.request({
|
||||||
|
url: '/customer/selection/listNoPage',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
return res;
|
||||||
|
},
|
||||||
qryProductPage(params = {}) {
|
qryProductPage(params = {}) {
|
||||||
return uni.request({
|
return uni.request({
|
||||||
url: '/goods/goods/app/list',
|
url: '/goods/goods/app/list',
|
||||||
|
|
@ -473,7 +495,7 @@ export default {
|
||||||
},
|
},
|
||||||
async qryFinancialDetail(params = {}) {
|
async qryFinancialDetail(params = {}) {
|
||||||
let res = await uni.request({
|
let res = await uni.request({
|
||||||
url: '/financial/detail/app/list',
|
url: '/financial/detail/app/listV2',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
|
|
@ -507,6 +529,14 @@ export default {
|
||||||
})
|
})
|
||||||
return res[1].data;
|
return res[1].data;
|
||||||
},
|
},
|
||||||
|
async updateMasterAddress(params = {}) {
|
||||||
|
let res = await uni.request({
|
||||||
|
url: '/order/master/updateMasterAddress',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
return res[1].data;
|
||||||
|
},
|
||||||
async cancelMasterOrder(params = {}) {
|
async cancelMasterOrder(params = {}) {
|
||||||
let res = await uni.request({
|
let res = await uni.request({
|
||||||
url: '/order/master/cancel',
|
url: '/order/master/cancel',
|
||||||
|
|
|
||||||
|
|
@ -114,12 +114,16 @@
|
||||||
uni.$on('initValid', this.initValid)
|
uni.$on('initValid', this.initValid)
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.authLogin()
|
||||||
// this.$refs.vertifyLogin.showModal();
|
// this.$refs.vertifyLogin.showModal();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initValid(initParam) {
|
async initValid(initParam) {
|
||||||
this.initParam = initParam
|
this.initParam = initParam
|
||||||
this.$refs.validRef.loadData(initParam)
|
if (initParam && initParam.distributor) {
|
||||||
|
const res = await this.authLogin()
|
||||||
|
this.$refs.validRef.loadData(initParam, res)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
goRouter(path) {
|
goRouter(path) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
@ -151,26 +155,30 @@
|
||||||
let curUserInfo = this.$request.getCurUserInfo();
|
let curUserInfo = this.$request.getCurUserInfo();
|
||||||
// 校验提示登录
|
// 校验提示登录
|
||||||
if (!curUserInfo || !curUserInfo.openId) {
|
if (!curUserInfo || !curUserInfo.openId) {
|
||||||
this.$refs.vertifyLogin.showModal();
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
this.$refs.vertifyLogin.hideModal();
|
|
||||||
}
|
|
||||||
// 校验提示获取手机号码
|
|
||||||
if (!curUserInfo.phone) {
|
|
||||||
this.$refs.vertifyPhone.showModal();
|
this.$refs.vertifyPhone.showModal();
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
this.$refs.vertifyPhone.hideModal();
|
this.$refs.vertifyPhone.hideModal();
|
||||||
}
|
}
|
||||||
|
// 校验提示获取手机号码
|
||||||
|
// if (!curUserInfo.phone) {
|
||||||
|
// this.$refs.vertifyPhone.showModal();
|
||||||
|
// return false;
|
||||||
|
// } else {
|
||||||
|
// this.$refs.vertifyPhone.hideModal();
|
||||||
|
// }
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
reloadForwardPage() {
|
async reloadForwardPage() {
|
||||||
if(this.$refs.validRef.inByShare){
|
const res = await this.authLogin()
|
||||||
this.$refs.validRef.loadData(this.initParam)
|
if(res) {
|
||||||
} else {
|
this.$refs.validRef.loadData(this.initParam, res)
|
||||||
this.authLogin()
|
|
||||||
}
|
}
|
||||||
|
// if(this.$refs.validRef.inByShare){
|
||||||
|
// this.$refs.validRef.loadData(this.initParam)
|
||||||
|
// } else {
|
||||||
|
// this.authLogin()
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,20 @@
|
||||||
confirm-type="search"></input>
|
confirm-type="search"></input>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
|
<!-- height 64rpx -->
|
||||||
|
<view class="flex flex-wrap justify-center" style="padding-bottom: 6rpx;">
|
||||||
|
<button class="cu-btn long-btn shadow bg-main-color" style="width: 200rpx;margin-left: 20rpx;" @click="chooseAll()">全选</button>
|
||||||
|
<button class="cu-btn long-btn shadow bg-main-color light" style="width: 200rpx;margin-left: 20rpx;" @click="cancelAll()">取消全选</button>
|
||||||
|
</view>
|
||||||
<view class="VerticalBox" :style="'height:calc(' + containerHeight + ')'">
|
<view class="VerticalBox" :style="'height:calc(' + containerHeight + ')'">
|
||||||
<scroll-view class="VerticalNav nav">
|
<scroll-view class="VerticalNav nav" scroll-y="true">
|
||||||
<view class="cu-item" :class="index==tabCur?'text-main-color cur':''" v-for="(item,index) in list"
|
<view class="cu-item" :class="index==tabCur?'text-main-color cur':''" v-for="(item,index) in list"
|
||||||
:key="index" @tap="tabSelect" :data-index="index" :data-id="item.goodsCategoryId"
|
:key="index" @tap="tabSelect" :data-index="index" :data-id="item.goodsCategoryId"
|
||||||
:data-main-cur="item.child && item.child.length > 0 ? item.child[0].goodsCategoryId : -1">
|
:data-main-cur="item.child && item.child.length > 0 ? item.child[0].goodsCategoryId : -1">
|
||||||
{{item.goodsCategoryName}}
|
{{item.goodsCategoryName}}
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<scroll-view class="VerticalMain">
|
<scroll-view class="VerticalMain" scroll-y="true">
|
||||||
<view class="padding-top padding-lr" v-for="(type, index1) in list[tabCur].child" :key="index1"
|
<view class="padding-top padding-lr" v-for="(type, index1) in list[tabCur].child" :key="index1"
|
||||||
:id="'main-'+type.goodsCategoryId">
|
:id="'main-'+type.goodsCategoryId">
|
||||||
<view class="cu-bar bg-white bottom-border" @click="chooseNavItem(type)">
|
<view class="cu-bar bg-white bottom-border" @click="chooseNavItem(type)">
|
||||||
|
|
@ -45,7 +50,7 @@
|
||||||
props: {
|
props: {
|
||||||
list: {
|
list: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: []
|
default: () => []
|
||||||
},
|
},
|
||||||
containerHeight: {
|
containerHeight: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|
@ -54,6 +59,10 @@
|
||||||
isClick2ShowProducts: {
|
isClick2ShowProducts: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
allLevel3CategoryIds: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -66,8 +75,6 @@
|
||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadData() {
|
|
||||||
},
|
|
||||||
tabSelect(e) {
|
tabSelect(e) {
|
||||||
this.tabCur = e.currentTarget.dataset.index;
|
this.tabCur = e.currentTarget.dataset.index;
|
||||||
},
|
},
|
||||||
|
|
@ -86,6 +93,18 @@
|
||||||
clearChosenItem() {
|
clearChosenItem() {
|
||||||
this.chosenCategoryIds = [];
|
this.chosenCategoryIds = [];
|
||||||
uni.$emit(this.$globalFun.VERTICAL_NAV_GET_ITEM, this.chosenCategoryIds);
|
uni.$emit(this.$globalFun.VERTICAL_NAV_GET_ITEM, this.chosenCategoryIds);
|
||||||
|
},
|
||||||
|
setChooseItems(arr) {
|
||||||
|
this.chosenCategoryIds = [...arr]
|
||||||
|
uni.$emit(this.$globalFun.VERTICAL_NAV_GET_ITEM, this.chosenCategoryIds);
|
||||||
|
},
|
||||||
|
chooseAll() {
|
||||||
|
this.chosenCategoryIds = [...this.allLevel3CategoryIds]
|
||||||
|
uni.$emit(this.$globalFun.VERTICAL_NAV_GET_ITEM, this.chosenCategoryIds);
|
||||||
|
},
|
||||||
|
cancelAll() {
|
||||||
|
this.chosenCategoryIds = []
|
||||||
|
uni.$emit(this.$globalFun.VERTICAL_NAV_GET_ITEM, this.chosenCategoryIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -94,6 +113,7 @@
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.VerticalNav.nav {
|
.VerticalNav.nav {
|
||||||
width: 200upx;
|
width: 200upx;
|
||||||
|
height: 100%;
|
||||||
white-space: initial;
|
white-space: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,7 +150,8 @@
|
||||||
|
|
||||||
.VerticalMain {
|
.VerticalMain {
|
||||||
background-color: #f1f1f1;
|
background-color: #f1f1f1;
|
||||||
flex: 1;
|
/* flex: 1; */
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cu-list>.cu-item {
|
.cu-list>.cu-item {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<view class="cu-modal" :class="isShow?'show':''">
|
<view class="cu-modal" :class="isShow?'show':''">
|
||||||
<view class="cu-dialog">
|
<view class="cu-dialog">
|
||||||
<view class="padding-xl">
|
<view class="padding-xl">
|
||||||
<view>授予小程序绑定手机号码的权限</view>
|
<view>你需要授权手机号码绑定为登录账号</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-bar bg-white">
|
<view class="cu-bar bg-white">
|
||||||
<navigator class="modal-bottom-oper margin-0 flex-sub text-black solid-right" open-type="exit" target="miniProgram">拒绝授权
|
<navigator class="modal-bottom-oper margin-0 flex-sub text-black solid-right" open-type="exit" target="miniProgram">拒绝授权
|
||||||
|
|
@ -36,6 +36,7 @@
|
||||||
this.isShow = false;
|
this.isShow = false;
|
||||||
},
|
},
|
||||||
getPhoneNumber(e) {
|
getPhoneNumber(e) {
|
||||||
|
console.log(e.detail);
|
||||||
this.$request.storagePhoneIntoUserInfo(e.detail.code).then(res => {
|
this.$request.storagePhoneIntoUserInfo(e.detail.code).then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
this.$emit('reload');
|
this.$emit('reload');
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,8 @@
|
||||||
"path": "my-address"
|
"path": "my-address"
|
||||||
}, {
|
}, {
|
||||||
"path": "edit-address"
|
"path": "edit-address"
|
||||||
|
},{
|
||||||
|
"path": "edit-service-address"
|
||||||
}, {
|
}, {
|
||||||
"path": "apply-operator"
|
"path": "apply-operator"
|
||||||
}, {
|
}, {
|
||||||
|
|
|
||||||
|
|
@ -24,18 +24,18 @@
|
||||||
// this.loadData(option);
|
// this.loadData(option);
|
||||||
// },
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
async loadData(option) {
|
async loadData(option, loginRes) {
|
||||||
this.inParam = option;
|
this.inParam = option;
|
||||||
this.curUserInfo = this.$request.getCurUserInfo();
|
this.curUserInfo = this.$request.getCurUserInfo();
|
||||||
// 更新分销人信息
|
// 更新分销人信息
|
||||||
if (option && option.distributor) {
|
if (option && option.distributor) {
|
||||||
let loginRes = await this.authLogin();
|
|
||||||
if (!loginRes) {
|
if (!loginRes) {
|
||||||
this.inByShare = true;
|
this.inByShare = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.inByShare = false;
|
this.inByShare = false;
|
||||||
|
console.log(this.curUserInfo);
|
||||||
let res = await this.$request.updateUser({
|
let res = await this.$request.updateUser({
|
||||||
customerPlace: option.distributor,
|
customerPlace: option.distributor,
|
||||||
customerId: this.curUserInfo.customerId
|
customerId: this.curUserInfo.customerId
|
||||||
|
|
@ -62,34 +62,6 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
reloadForwardPage() {
|
|
||||||
if (this.inByShare) {
|
|
||||||
this.loadData(this.inParam);
|
|
||||||
} else {
|
|
||||||
this.getCurPageInfo({
|
|
||||||
curPageCode: this.forwardingPageCode
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async getCurPageInfo(data) {
|
|
||||||
let pageCode = data.curPageCode;
|
|
||||||
this.forwardingPageCode = pageCode;
|
|
||||||
// 登录校验
|
|
||||||
if (['publishPage', 'myPage'].indexOf(pageCode) >= 0) {
|
|
||||||
let loginRes = await this.authLogin();
|
|
||||||
if (!loginRes) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.forwardingPageCode = null;
|
|
||||||
|
|
||||||
if (pageCode === 'publishPage') {
|
|
||||||
this.isShowPublish = true;
|
|
||||||
} else {
|
|
||||||
this.isShowPublish = false;
|
|
||||||
this.curPageCode = pageCode;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
hidePublish() {
|
hidePublish() {
|
||||||
this.isShowPublish = false;
|
this.isShowPublish = false;
|
||||||
},
|
},
|
||||||
|
|
@ -97,27 +69,6 @@
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: url
|
url: url
|
||||||
})
|
})
|
||||||
},
|
|
||||||
async authLogin() {
|
|
||||||
// 更新缓存中的userInfo
|
|
||||||
let res = await this.$request.storageExistUser();
|
|
||||||
// 获取缓存中的userInfo
|
|
||||||
let curUserInfo = this.$request.getCurUserInfo();
|
|
||||||
// 校验提示登录
|
|
||||||
if (!curUserInfo || !curUserInfo.openId) {
|
|
||||||
this.$refs.vertifyLogin.showModal();
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
this.$refs.vertifyLogin.hideModal();
|
|
||||||
}
|
|
||||||
// 校验提示获取手机号码
|
|
||||||
if (!curUserInfo.phone) {
|
|
||||||
this.$refs.vertifyPhone.showModal();
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
this.$refs.vertifyPhone.hideModal();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
<view class="cu-bar search bg-white">
|
<view class="cu-bar search bg-white">
|
||||||
<view class="search-form round">
|
<view class="search-form round">
|
||||||
<text class="cuIcon-search"></text>
|
<text class="cuIcon-search"></text>
|
||||||
<input @confirm="searchGoods" v-model="searchInfo.inputGoodsName" :adjust-position="true"
|
<input @confirm="chooseCategory(null)" v-model="searchInfo.inputGoodsName" :adjust-position="true"
|
||||||
type="text" placeholder="输入搜索内容" confirm-type="search"></input>
|
type="text" placeholder="输入搜索内容" confirm-type="search"></input>
|
||||||
</view>
|
</view>
|
||||||
<!-- 区域筛选picker -->
|
<!-- 区域筛选picker -->
|
||||||
|
|
@ -184,10 +184,34 @@
|
||||||
otherCityProductPageNum: 0,
|
otherCityProductPageNum: 0,
|
||||||
otherCityProductPageSize: 0,
|
otherCityProductPageSize: 0,
|
||||||
isShowPrivSetting: false,
|
isShowPrivSetting: false,
|
||||||
initParam: null
|
initParam: null,
|
||||||
|
goInfo: false,
|
||||||
|
deptGoodsCategoryIds: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
if(option) {
|
||||||
|
// 跳转逻辑
|
||||||
|
if (option.menuCode) {
|
||||||
|
if(option.menuCode == 'myPage') {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/index/my-home'
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (option.scene) {
|
||||||
|
let paraStr = decodeURIComponent(option.scene);
|
||||||
|
let kvStrArr = paraStr.split("&");
|
||||||
|
kvStrArr.forEach((kvStr) => {
|
||||||
|
let kvArr = kvStr.split("=");
|
||||||
|
option[kvArr[0]] = kvArr[1];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.initParam = option
|
this.initParam = option
|
||||||
uni.hideTabBar();
|
uni.hideTabBar();
|
||||||
},
|
},
|
||||||
|
|
@ -203,6 +227,22 @@
|
||||||
await this.getCurAreaArr();
|
await this.getCurAreaArr();
|
||||||
uni.$emit('initValid', this.initParam)
|
uni.$emit('initValid', this.initParam)
|
||||||
},
|
},
|
||||||
|
async onShow() {
|
||||||
|
if((this.productList.length || this.otherCityProductList.length) && !this.goInfo) {
|
||||||
|
this.reloadProductPage();
|
||||||
|
}
|
||||||
|
this.goInfo = false;
|
||||||
|
this.curUserInfo = this.$request.getCurUserInfo();
|
||||||
|
// if (this.initParam && this.initParam.distributor) {
|
||||||
|
// let res = await this.$request.updateUser({
|
||||||
|
// customerPlace: this.initParam.distributor,
|
||||||
|
// customerId: this.curUserInfo.customerId
|
||||||
|
// });
|
||||||
|
// if (res && res.code === 0) {
|
||||||
|
// this.initParam = null;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
},
|
||||||
async onShareAppMessage(e) {
|
async onShareAppMessage(e) {
|
||||||
let shareInfo = null;
|
let shareInfo = null;
|
||||||
if (e && e.target && e.target.dataset) {
|
if (e && e.target && e.target.dataset) {
|
||||||
|
|
@ -242,6 +282,17 @@
|
||||||
type: 2
|
type: 2
|
||||||
});
|
});
|
||||||
this.hotFittingsCategory = hotFittingsCategoryRes.data;
|
this.hotFittingsCategory = hotFittingsCategoryRes.data;
|
||||||
|
|
||||||
|
const deptGoodsCategoryIds = []
|
||||||
|
if(this.curUserInfo) {
|
||||||
|
const res = await this.$request.getChooseCategories({
|
||||||
|
selectionType: 1,
|
||||||
|
customerId: this.curUserInfo.customerId
|
||||||
|
})
|
||||||
|
deptGoodsCategoryIds.push(...res[1].data.data)
|
||||||
|
}
|
||||||
|
this.deptGoodsCategoryIds = deptGoodsCategoryIds
|
||||||
|
|
||||||
// 加载品类
|
// 加载品类
|
||||||
this.loadCategoryList();
|
this.loadCategoryList();
|
||||||
// 加载当前定位城市的服务列表
|
// 加载当前定位城市的服务列表
|
||||||
|
|
@ -255,6 +306,8 @@
|
||||||
this.moduleBarInfos = await this.$api.data('moduleBarInfos');
|
this.moduleBarInfos = await this.$api.data('moduleBarInfos');
|
||||||
// this.hotGoods = await this.$api.data('hotGoods');
|
// this.hotGoods = await this.$api.data('hotGoods');
|
||||||
// this.discountGoods = await this.$api.data('discountGoods');
|
// this.discountGoods = await this.$api.data('discountGoods');
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// authCallback() {
|
// authCallback() {
|
||||||
// this.$refs.validRef.loadData(this.initParam)
|
// this.$refs.validRef.loadData(this.initParam)
|
||||||
|
|
@ -288,10 +341,21 @@
|
||||||
this.isShowPrivSetting = true;
|
this.isShowPrivSetting = true;
|
||||||
} else {
|
} else {
|
||||||
// 用户授权
|
// 用户授权
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: '请确认是否开启定位',
|
// title: '请确认是否开启定位',
|
||||||
icon: 'none',
|
// icon: 'none',
|
||||||
duration: 1500
|
// duration: 1500
|
||||||
|
// })
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请确认是否开启定位',
|
||||||
|
cancelText: '取消',
|
||||||
|
confirmText: '重试',
|
||||||
|
success: res => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.getCurAreaArr();
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -310,16 +374,38 @@
|
||||||
fail: async (result) => {
|
fail: async (result) => {
|
||||||
console.log(result)
|
console.log(result)
|
||||||
if (result.errCode === 2 || result.errCode === 404) {
|
if (result.errCode === 2 || result.errCode === 404) {
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: '定位获取失败,请确认是否开启定位',
|
// title: '定位获取失败,请确认是否开启定位',
|
||||||
icon: 'none',
|
// icon: 'none',
|
||||||
duration: 2500
|
// duration: 2500
|
||||||
|
// })
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '定位获取失败,请确认是否开启定位',
|
||||||
|
cancelText: '取消',
|
||||||
|
confirmText: '重试',
|
||||||
|
success: res => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.getCurAreaArr();
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: '定位获取失败,请稍后重试',
|
// title: '定位获取失败,请稍后重试',
|
||||||
icon: 'none',
|
// icon: 'none',
|
||||||
duration: 2500
|
// duration: 2500
|
||||||
|
// })
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '定位获取失败,请稍后重试',
|
||||||
|
cancelText: '取消',
|
||||||
|
confirmText: '重试',
|
||||||
|
success: res => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.getCurAreaArr();
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -477,20 +563,29 @@
|
||||||
this.searchInfo.category = item;
|
this.searchInfo.category = item;
|
||||||
this.searchGoods();
|
this.searchGoods();
|
||||||
},
|
},
|
||||||
|
|
||||||
searchGoods() {
|
searchGoods() {
|
||||||
let params = {
|
let params = {
|
||||||
category: this.searchInfo.category,
|
category: this.searchInfo.category,
|
||||||
area: this.searchInfo.area,
|
area: this.searchInfo.area,
|
||||||
inputGoodsName: this.searchInfo.inputGoodsName
|
inputGoodsName: this.searchInfo.category ? '' : this.searchInfo.inputGoodsName,
|
||||||
|
showData: true
|
||||||
};
|
};
|
||||||
|
// if(!this.deptGoodsCategoryIds.includes(this.searchInfo.category)) {
|
||||||
|
// params.showData = false
|
||||||
|
// }
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/product/filtered-products?params=' + encodeURIComponent(JSON.stringify(params))
|
url: '/pages/product/filtered-products?params=' + encodeURIComponent(JSON.stringify(params))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
clickHotCategory(item) {
|
clickHotCategory(item) {
|
||||||
let params = {
|
let params = {
|
||||||
category: item
|
category: item,
|
||||||
|
showData: true
|
||||||
};
|
};
|
||||||
|
// if(!this.deptGoodsCategoryIds.includes(this.searchInfo.category)) {
|
||||||
|
// params.showData = false
|
||||||
|
// }
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/product/filtered-products?params=' + encodeURIComponent(JSON.stringify(params))
|
url: '/pages/product/filtered-products?params=' + encodeURIComponent(JSON.stringify(params))
|
||||||
})
|
})
|
||||||
|
|
@ -513,6 +608,7 @@
|
||||||
let params = {
|
let params = {
|
||||||
goodsId: productItem.goodsId
|
goodsId: productItem.goodsId
|
||||||
}
|
}
|
||||||
|
this.goInfo = true;
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/product/product-detail?params=' + encodeURIComponent(JSON.stringify(params))
|
url: '/pages/product/product-detail?params=' + encodeURIComponent(JSON.stringify(params))
|
||||||
});
|
});
|
||||||
|
|
@ -532,6 +628,8 @@
|
||||||
params.areaIds = this.searchInfo.area[this.searchInfo.area.length - 1].areaIds;
|
params.areaIds = this.searchInfo.area[this.searchInfo.area.length - 1].areaIds;
|
||||||
params.areaId = null;
|
params.areaId = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
params.deptGoodsCategoryIds = this.deptGoodsCategoryIds;
|
||||||
params.pageNum = this[pageNumName];
|
params.pageNum = this[pageNumName];
|
||||||
params.pageSize = this[pageSizeName];
|
params.pageSize = this[pageSizeName];
|
||||||
params.status = 0;
|
params.status = 0;
|
||||||
|
|
|
||||||
|
|
@ -386,9 +386,9 @@
|
||||||
onShow() {
|
onShow() {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
onReady() {
|
// onReady() {
|
||||||
this.loadData();
|
// this.loadData();
|
||||||
},
|
// },
|
||||||
async onShareAppMessage(e) {
|
async onShareAppMessage(e) {
|
||||||
let shareInfo = null;
|
let shareInfo = null;
|
||||||
if (e && e.target && e.target.dataset) {
|
if (e && e.target && e.target.dataset) {
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
<view class="margin-left-sm flex-column-between text-beside-avatar">
|
<view class="margin-left-sm flex-column-between text-beside-avatar">
|
||||||
<view class="text-black text-xl">{{item.name}}</view>
|
<view class="text-black text-xl">{{item.name}}</view>
|
||||||
<view class="text-sm">
|
<view class="text-sm">
|
||||||
<view>
|
<view :class="isShowAllAreaCurCity[index] ? '' : 'certern-height'">
|
||||||
<text class="margin-right-xs">服务技能:</text>
|
<text class="margin-right-xs">服务技能:</text>
|
||||||
<text>{{item.goodsCategories}}</text>
|
<text>{{item.goodsCategories}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -51,9 +51,9 @@
|
||||||
<text class="margin-right-xs">服务范围:</text>
|
<text class="margin-right-xs">服务范围:</text>
|
||||||
<text>{{item.workerAreas}}</text>
|
<text>{{item.workerAreas}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-main-color bg-white padding-top-sm"
|
<view v-if="item.workerAreas.length>55 || item.goodsCategories.length>55" class="text-main-color bg-white padding-top-sm"
|
||||||
@click="showAllArea('CurCity', index)">
|
@click="showAllArea('CurCity', index)">
|
||||||
<text>查看全部服务区域</text>
|
<text>查看全部服务技能范围</text>
|
||||||
<text :class="'cuIcon-' + (isShowAllAreaCurCity[index] ? 'fold' : 'unfold')"></text>
|
<text :class="'cuIcon-' + (isShowAllAreaCurCity[index] ? 'fold' : 'unfold')"></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -95,12 +95,12 @@
|
||||||
<!-- 进店看看 -->
|
<!-- 进店看看 -->
|
||||||
<view class="flex justify-between align-end margin-top-xs">
|
<view class="flex justify-between align-end margin-top-xs">
|
||||||
<view class="cu-capsule">
|
<view class="cu-capsule">
|
||||||
<view class='cu-tag bg-main-color'>
|
<!-- <view class='cu-tag bg-main-color'>
|
||||||
<text class='cuIcon-shopfill'></text>
|
<text class='cuIcon-shopfill'></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-tag line-main-color">
|
<view class="cu-tag line-main-color">
|
||||||
{{item.deptName}}
|
{{item.deptName}}
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="margin-right-sm text-black">{{item.shopName}}</view> -->
|
<!-- <view class="margin-right-sm text-black">{{item.shopName}}</view> -->
|
||||||
<view class='cu-tag light bg-main-color radius' @click="showShopDetail(item)">进店看看<text
|
<view class='cu-tag light bg-main-color radius' @click="showShopDetail(item)">进店看看<text
|
||||||
|
|
@ -130,7 +130,7 @@
|
||||||
<view class="margin-left-sm flex-column-between text-beside-avatar">
|
<view class="margin-left-sm flex-column-between text-beside-avatar">
|
||||||
<view class="text-black text-xl">{{item.name}}</view>
|
<view class="text-black text-xl">{{item.name}}</view>
|
||||||
<view class="text-sm">
|
<view class="text-sm">
|
||||||
<view>
|
<view :class="item.showAllAreas ? '' : 'certern-height'">
|
||||||
<text class="margin-right-xs">服务技能:</text>
|
<text class="margin-right-xs">服务技能:</text>
|
||||||
<text>{{item.goodsCategories}}</text>
|
<text>{{item.goodsCategories}}</text>
|
||||||
<!-- <text v-for="(skill, skillArrIndex) in item.goodsCategories"
|
<!-- <text v-for="(skill, skillArrIndex) in item.goodsCategories"
|
||||||
|
|
@ -147,9 +147,9 @@
|
||||||
<text v-if="areaArrIndex !== item.workerAreas.length - 1">,</text>
|
<text v-if="areaArrIndex !== item.workerAreas.length - 1">,</text>
|
||||||
</text> -->
|
</text> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="text-main-color bg-white padding-top-sm"
|
<view v-if="item.workerAreas.length>55 || item.goodsCategories.length>55" class="text-main-color bg-white padding-top-sm"
|
||||||
@click="showAllArea('OtherCity', index)">
|
@click="showAllArea('OtherCity', index)">
|
||||||
<text>查看全部服务区域</text>
|
<text>查看全部服务技能范围</text>
|
||||||
<text
|
<text
|
||||||
:class="'cuIcon-' + (item.showAllAreas ? 'fold' : 'unfold')"></text>
|
:class="'cuIcon-' + (item.showAllAreas ? 'fold' : 'unfold')"></text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -192,12 +192,12 @@
|
||||||
<!-- 进店看看 -->
|
<!-- 进店看看 -->
|
||||||
<view class="flex justify-between align-end margin-top-xs">
|
<view class="flex justify-between align-end margin-top-xs">
|
||||||
<view class="cu-capsule">
|
<view class="cu-capsule">
|
||||||
<view class='cu-tag bg-main-color'>
|
<!-- <view class='cu-tag bg-main-color'>
|
||||||
<text class='cuIcon-shopfill'></text>
|
<text class='cuIcon-shopfill'></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-tag line-main-color">
|
<view class="cu-tag line-main-color">
|
||||||
{{item.deptName}}
|
{{item.deptName}}
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="margin-right-sm text-black">{{item.shopName}}</view> -->
|
<!-- <view class="margin-right-sm text-black">{{item.shopName}}</view> -->
|
||||||
<view class='cu-tag light bg-main-color radius' @click="showShopDetail(item)">进店看看<text
|
<view class='cu-tag light bg-main-color radius' @click="showShopDetail(item)">进店看看<text
|
||||||
|
|
@ -621,7 +621,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.certern-height {
|
.certern-height {
|
||||||
max-height: 200rpx;
|
max-height: 100rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -0,0 +1,183 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- 顶部操作条 -->
|
||||||
|
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
|
||||||
|
<block slot="backText">返回</block>
|
||||||
|
<block slot="content">编辑地址</block>
|
||||||
|
</cu-custom>
|
||||||
|
<!-- 地址信息form -->
|
||||||
|
<view class="bg-white margin-top-sm">
|
||||||
|
<form @submit="submit">
|
||||||
|
<view class="cu-form-group">
|
||||||
|
<view class="title">联系人</view>
|
||||||
|
<input name="name" v-model="formData.name"></input>
|
||||||
|
</view>
|
||||||
|
<view class="cu-form-group">
|
||||||
|
<view class="title">手机号码</view>
|
||||||
|
<input name="phone" v-model="formData.phone"></input>
|
||||||
|
</view>
|
||||||
|
<!-- #ifndef H5 || APP-PLUS || MP-ALIPAY -->
|
||||||
|
<view class="cu-form-group">
|
||||||
|
<view class="title">地址选择</view>
|
||||||
|
<picker :mode="'multiSelector'" @change="regionChange" @columnchange="regionColChange" :value="multiIndex" :range-key="'areaName'" :range="areaList">
|
||||||
|
<view class="picker">
|
||||||
|
{{formData.provinceName + '-' + formData.cityName + '-' + formData.countryName + '-' + formData.streetName}}
|
||||||
|
</view>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
<view class="cu-form-group">
|
||||||
|
<view class="title">详细地址</view>
|
||||||
|
<input name="address" v-model="formData.address"></input>
|
||||||
|
</view>
|
||||||
|
<!-- 底部操作栏 -->
|
||||||
|
<view class="cu-bar tabbar border shop fixed-bottom-bar">
|
||||||
|
<button class="cu-btn bg-main-color long-btn margin-lr-sm shadow-blur" form-type="submit">保存</button>
|
||||||
|
</view>
|
||||||
|
</form>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
areaList: [],
|
||||||
|
multiIndex: [0, 0, 0],
|
||||||
|
formData: {
|
||||||
|
},
|
||||||
|
mode: 0 // 1为新增,0为修改
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
let params = JSON.parse(decodeURIComponent(options.params));
|
||||||
|
console.log(params);
|
||||||
|
if (this.mode === 0) {
|
||||||
|
// 修改
|
||||||
|
this.fillForm(params);
|
||||||
|
}
|
||||||
|
this.loadData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async loadData() {
|
||||||
|
// this.areaList = await this.$api.data('areaList');
|
||||||
|
this.loadAreaList();
|
||||||
|
},
|
||||||
|
fillForm(addressInfo) {
|
||||||
|
this.formData = addressInfo && Object.keys(addressInfo).length > 0 ? addressInfo : this.formData;
|
||||||
|
},
|
||||||
|
async loadAreaList(idArr) {
|
||||||
|
let areaList = await this.$request.areaListByStep();
|
||||||
|
areaList = areaList.data;
|
||||||
|
let col1Code = idArr ? idArr[0] : areaList[0].areaCode;
|
||||||
|
let subAreaList = await this.$request.areaListByStep({ parentCode: col1Code });
|
||||||
|
subAreaList = subAreaList.data;
|
||||||
|
let col2Code = idArr ? idArr[1] : subAreaList[0].areaCode;
|
||||||
|
let subSubAreaList = await this.$request.areaListByStep({ parentCode: col2Code });
|
||||||
|
subSubAreaList = subSubAreaList.data;
|
||||||
|
let col3Code = idArr ? idArr[2] : subSubAreaList[0].areaCode;
|
||||||
|
let subSub2AreaList = await this.$request.areaListByStep({ parentCode: col3Code });
|
||||||
|
subSub2AreaList = subSub2AreaList.data;
|
||||||
|
this.areaList.push(areaList);
|
||||||
|
this.areaList.push(subAreaList);
|
||||||
|
this.areaList.push(subSubAreaList);
|
||||||
|
this.areaList.push(subSub2AreaList);
|
||||||
|
},
|
||||||
|
regionChange(e) {
|
||||||
|
this.multiIndex = e.detail.value;
|
||||||
|
let chosenArea = [];
|
||||||
|
for(let i = 0; i < this.areaList.length; i++) {
|
||||||
|
chosenArea.push(this.areaList[i][this.multiIndex[i]]);
|
||||||
|
}
|
||||||
|
this.formData.area = chosenArea;
|
||||||
|
this.formData.provinceId = chosenArea[0].areaId;
|
||||||
|
this.formData.provinceName = chosenArea[0].areaName;
|
||||||
|
this.formData.cityId = chosenArea[1].areaId;
|
||||||
|
this.formData.cityName = chosenArea[1].areaName;
|
||||||
|
this.formData.countryId = chosenArea[2].areaId;
|
||||||
|
this.formData.countryName = chosenArea[2].areaName;
|
||||||
|
this.formData.streetId = chosenArea[3].areaId;
|
||||||
|
this.formData.streetName = chosenArea[3].areaName;
|
||||||
|
uni.hideLoading()
|
||||||
|
},
|
||||||
|
async regionColChange(e) {
|
||||||
|
let colObj = e.detail;
|
||||||
|
if (colObj.column == 0) {
|
||||||
|
let subSubAreaList = [], subSub2AreaList = [];
|
||||||
|
// 通过一级查询二级,通过二级查三级
|
||||||
|
let subAreaList = await this.$request.areaListByStep({parentCode: this.areaList[0][colObj.value].areaCode});
|
||||||
|
subAreaList = subAreaList.data;
|
||||||
|
if (subAreaList && subAreaList.length) {
|
||||||
|
subSubAreaList = await this.$request.areaListByStep({parentCode: subAreaList[0].areaCode});
|
||||||
|
subSubAreaList = subSubAreaList.data;
|
||||||
|
if(subSubAreaList && subSubAreaList.length) {
|
||||||
|
subSub2AreaList = await this.$request.areaListByStep({parentCode: subSubAreaList[0].areaCode});
|
||||||
|
subSub2AreaList = subSub2AreaList.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.areaList[1] = subAreaList
|
||||||
|
this.areaList[2] = subSubAreaList
|
||||||
|
this.areaList[3] = subSub2AreaList
|
||||||
|
this.multiIndex = [colObj.value, 0, 0, 0];
|
||||||
|
} else if (colObj.column == 1) {
|
||||||
|
let subSub2AreaList = []
|
||||||
|
// 通过二级查三级
|
||||||
|
let subSubAreaList = await this.$request.areaListByStep({parentCode: this.areaList[1][colObj.value].areaCode});
|
||||||
|
subSubAreaList = subSubAreaList.data;
|
||||||
|
if (subSubAreaList && subSubAreaList.length) {
|
||||||
|
subSub2AreaList = await this.$request.areaListByStep({parentCode: subSubAreaList[0].areaCode});
|
||||||
|
subSub2AreaList = subSub2AreaList.data;
|
||||||
|
}
|
||||||
|
this.areaList[2] = subSubAreaList
|
||||||
|
this.areaList[3] = subSub2AreaList
|
||||||
|
this.multiIndex = [this.multiIndex[0], colObj.value, 0, 0];
|
||||||
|
} else if (colObj.column == 2) {
|
||||||
|
// 通过二级查三级
|
||||||
|
let subSubAreaList = await this.$request.areaListByStep({parentCode: this.areaList[2][colObj.value].areaCode});
|
||||||
|
subSubAreaList = subSubAreaList.data;
|
||||||
|
this.areaList[3] = subSubAreaList;
|
||||||
|
this.multiIndex = [this.multiIndex[0], this.multiIndex[1], colObj.value, 0];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validateForm(addressInfo) {
|
||||||
|
let valid = Boolean(addressInfo.name) &&
|
||||||
|
Boolean(addressInfo.phone) &&
|
||||||
|
Boolean(addressInfo.address) &&
|
||||||
|
Boolean(addressInfo.provinceName) &&
|
||||||
|
Boolean(addressInfo.cityName) &&
|
||||||
|
Boolean(addressInfo.countryName) &&
|
||||||
|
Boolean(addressInfo.streetName)
|
||||||
|
|
||||||
|
if (!valid) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请填写完整信息',
|
||||||
|
icon: 'none',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
} else if (!this.$validate.validContactNum(addressInfo.phone)) {
|
||||||
|
valid = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: '联系号码格式错误',
|
||||||
|
icon: 'none',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return valid;
|
||||||
|
},
|
||||||
|
async submit(e) {
|
||||||
|
const confirmFormData = Object.assign({}, this.formData, e.detail.value)
|
||||||
|
let formValid = this.validateForm(confirmFormData);
|
||||||
|
if (formValid) {
|
||||||
|
uni.$emit(this.$globalFun.CHOOSE_ADDRESS, confirmFormData);
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: -1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<block slot="content">地址列表</block>
|
<block slot="content">地址列表</block>
|
||||||
</cu-custom>
|
</cu-custom>
|
||||||
<!-- 地址列表 -->
|
<!-- 地址列表 -->
|
||||||
<view class="margin-bottom-with-bar">
|
<view class="margin-bottom-with-bar padding-tb-xl">
|
||||||
<view class="padding margin-lr-sm margin-top-sm bg-white flex justify-between align-center" v-for="(item, index) in myAddressList" :key="index">
|
<view class="padding margin-lr-sm margin-top-sm bg-white flex justify-between align-center" v-for="(item, index) in myAddressList" :key="index">
|
||||||
<view @click="chooseAddress(item)">
|
<view @click="chooseAddress(item)">
|
||||||
<view class="flex justify-start align-center">
|
<view class="flex justify-start align-center">
|
||||||
|
|
@ -59,7 +59,8 @@
|
||||||
async loadData() {
|
async loadData() {
|
||||||
// this.myAddressList = await this.$api.data('myAddressList');
|
// this.myAddressList = await this.$api.data('myAddressList');
|
||||||
let res = await this.$request.getAddressList({
|
let res = await this.$request.getAddressList({
|
||||||
customerId: this.$request.getCurUserInfo().customerId
|
customerId: this.$request.getCurUserInfo().customerId,
|
||||||
|
isDelete: 0
|
||||||
});
|
});
|
||||||
this.myAddressList = res.data;
|
this.myAddressList = res.data;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<block slot="backText">返回</block>
|
<block slot="backText">返回</block>
|
||||||
<block slot="content">运营账单</block>
|
<block slot="content">运营账单</block>
|
||||||
</cu-custom>
|
</cu-custom>
|
||||||
<view class="padding-tb bg-white solid-bottom">
|
<!-- <view class="padding-tb bg-white solid-bottom">
|
||||||
<view class="flex justify-between align-center margin-top-xs padding-left">
|
<view class="flex justify-between align-center margin-top-xs padding-left">
|
||||||
<my-uni-combox class="flex-sub margin-right-xs" :candidates="billingStateList"
|
<my-uni-combox class="flex-sub margin-right-xs" :candidates="billingStateList"
|
||||||
:showField="'name'" placeholder="筛选账单状态" v-model="billingStateObj"
|
:showField="'name'" placeholder="筛选账单状态" v-model="billingStateObj"
|
||||||
|
|
@ -14,31 +14,41 @@
|
||||||
<text class="cuIcon-search margin-right-sm" @click="searchBills"></text>
|
<text class="cuIcon-search margin-right-sm" @click="searchBills"></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<uni-collapse ref="collapse">
|
<uni-collapse ref="collapse">
|
||||||
<uni-collapse-item ref="collapseItem" :showArrow="false" v-for="(billItem, index) in bill" :key="index" :open="openStatusArr[index] === '0' ? true : false" >
|
<uni-collapse-item ref="collapseItem" :showArrow="false" v-for="(billItem, index) in bill" :key="index" :open="openStatusArr[index] === '0' ? true : false" >
|
||||||
<template v-slot:title>
|
<template v-slot:title>
|
||||||
<view class="padding bg-white" :data-index="index" @click="showStatement">
|
<view class="padding bg-white" :data-index="index" @click="showStatement">
|
||||||
|
<view class="flex justify-between align-center">
|
||||||
|
<view>
|
||||||
<view class="margin-bottom-xs">{{billItem.createTime}}</view>
|
<view class="margin-bottom-xs">{{billItem.createTime}}</view>
|
||||||
<view>
|
<view>
|
||||||
<text><text>收入:</text><text class="text-price text-black">{{billItem.incomeCount}}</text></text>
|
<text><text>收入:</text><text class="text-price text-black">{{billItem.incomeCount}}</text></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view style="width: 200rpx;" @click.stop v-if="openStatusArr[index] === '0'">
|
||||||
|
<my-uni-combox class="margin-right-xs" :candidates="billingStateList"
|
||||||
|
:showField="'name'" placeholder="筛选" v-model="billingStateObj"
|
||||||
|
@input="chooseBillingState($event)"></my-uni-combox>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<view>
|
<view v-if="billItem.statement">
|
||||||
<view v-for="(item, index1) in billItem.statement"
|
<view v-for="(item, index1) in billItem.statement.filter(i => filterCode.includes(i.orderStatus))"
|
||||||
:key="index1"
|
:key="index1"
|
||||||
class="bg-white padding flex justify-between align-center solid-bottom" @click="showDetail(bill[index].statement[index1])">
|
class="bg-white padding flex justify-between align-center solid-bottom" @click="showDetail(bill[index].statement[index1])">
|
||||||
<view>
|
<view>
|
||||||
<view class="flex">
|
<view class="flex margin-bottom-sm">
|
||||||
<view class="margin-right-sm">提现单号:{{item.code}}</view>
|
<view class="margin-right-sm">订单号:{{item.orderCode}}</view>
|
||||||
<view class="text-gray">
|
|
||||||
<view class="margin-bottom-xs" v-if="item.financialDetailType == 3">分销金额</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="text-gray">{{item.createTime}}</view>
|
<view class="text-gray">{{item.createTime}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-price text-black">{{item.payMoney}}</view>
|
<view class="text-right">
|
||||||
|
<view class="text-price text-black margin-bottom-sm">{{item.payMoney}}</view>
|
||||||
|
<view class="text-black">{{item.orderStatusDesc}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uni-collapse-item>
|
</uni-collapse-item>
|
||||||
|
|
@ -59,8 +69,11 @@
|
||||||
bill: [],
|
bill: [],
|
||||||
curUserInfo: {},
|
curUserInfo: {},
|
||||||
billingStateList: [{
|
billingStateList: [{
|
||||||
|
code: 0,
|
||||||
|
name: '全部'
|
||||||
|
},{
|
||||||
code: 1,
|
code: 1,
|
||||||
name: '待到帐'
|
name: '待分帐'
|
||||||
},{
|
},{
|
||||||
code: 6,
|
code: 6,
|
||||||
name: '已取消'
|
name: '已取消'
|
||||||
|
|
@ -68,6 +81,7 @@
|
||||||
code: 5,
|
code: 5,
|
||||||
name: '已到帐'
|
name: '已到帐'
|
||||||
}],
|
}],
|
||||||
|
filterCode: [0,1,2,3,4,5,6],
|
||||||
billingStateObj: null
|
billingStateObj: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -100,8 +114,10 @@
|
||||||
},
|
},
|
||||||
async showStatement(e) {
|
async showStatement(e) {
|
||||||
let curIndex = e.currentTarget.dataset.index;
|
let curIndex = e.currentTarget.dataset.index;
|
||||||
|
console.log(this.openStatusArr, curIndex);
|
||||||
// 1为缩起状态,0为展开状态
|
// 1为缩起状态,0为展开状态
|
||||||
if (this.openStatusArr[curIndex] == '1' && !this.bill[curIndex].statement) {
|
if (this.openStatusArr[curIndex] == '1') {
|
||||||
|
if(!this.bill[curIndex].statement) {
|
||||||
let createTime = new Date(new Date(this.bill[curIndex].createTime).setHours(0));
|
let createTime = new Date(new Date(this.bill[curIndex].createTime).setHours(0));
|
||||||
let createMonth = createTime.getMonth() + 1;
|
let createMonth = createTime.getMonth() + 1;
|
||||||
let createYear = createTime.getFullYear();
|
let createYear = createTime.getFullYear();
|
||||||
|
|
@ -119,17 +135,26 @@
|
||||||
beginTime: createTimeStr,
|
beginTime: createTimeStr,
|
||||||
endTime: finishTimeStr,
|
endTime: finishTimeStr,
|
||||||
financialDetailTypes: [3],
|
financialDetailTypes: [3],
|
||||||
payeeId: this.curUserInfo.customerId
|
customerId: this.curUserInfo.customerId
|
||||||
});
|
});
|
||||||
let newBill = this.bill.concat();
|
let newBill = this.bill.concat();
|
||||||
newBill[curIndex].statement = res.rows;
|
newBill[curIndex].statement = res.rows;
|
||||||
this.bill = newBill;
|
this.bill = newBill;
|
||||||
|
}
|
||||||
|
for(let k = 0; k < this.openStatusArr.length; k++) {
|
||||||
|
this.$set(this.openStatusArr, k, k === curIndex ? '0' : '1')
|
||||||
|
}
|
||||||
|
uni.hideLoading()
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.collapse.resize();
|
this.$refs.collapse.resize();
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
})
|
})
|
||||||
// #endif
|
// #endif
|
||||||
|
} else {
|
||||||
|
this.$set(this.openStatusArr, curIndex, '1')
|
||||||
|
this.billingStateObj = null
|
||||||
|
this.filterCode = [0,1,2,3,4,5,6]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showDetail(item) {
|
showDetail(item) {
|
||||||
|
|
@ -138,12 +163,23 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
chooseBillingState(e) {
|
chooseBillingState(e) {
|
||||||
|
console.log(e);
|
||||||
this.billingStateObj = e;
|
this.billingStateObj = e;
|
||||||
|
if(e.code === 0) {
|
||||||
|
this.filterCode = [0,1,2,3,4,5,6]
|
||||||
|
} else if(e.code === 1) {
|
||||||
|
this.filterCode = [0,1,2,3,4]
|
||||||
|
} else {
|
||||||
|
this.filterCode = [e.code]
|
||||||
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.collapse.resize();
|
||||||
|
})
|
||||||
},
|
},
|
||||||
searchBills() {
|
searchBills() {
|
||||||
this.qryBills({
|
// this.qryBills({
|
||||||
billingState: this.billingStateObj ? this.billingStateObj.code : null
|
// billingState: this.billingStateObj ? this.billingStateObj.code : null
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
</view>
|
</view>
|
||||||
<!-- 团队人员统计 -->
|
<!-- 团队人员统计 -->
|
||||||
<view class="cu-list grid no-border col-4 solid-top margin-top-sm">
|
<view class="cu-list grid no-border col-4 solid-top margin-top-sm">
|
||||||
<view class="cu-item" :class="index == 2 ? 'solid-left' : ''" v-for="(item, index) in myOperator.analyseItems" v-if="index < 4 && item.type === 'common'">
|
<view class="cu-item" :class="index == 2 ? 'solid-left' : ''" v-for="(item, index) in myOperator.analyseItems" :key="index" v-if="index < 4 && item.type === 'common'">
|
||||||
<view class="margin-bottom-xs">{{item.title}}</view>
|
<view class="margin-bottom-xs">{{item.title}}</view>
|
||||||
<view class="text-red" v-if="item.unit === 'yuan'">
|
<view class="text-red" v-if="item.unit === 'yuan'">
|
||||||
¥{{item.value}}
|
¥{{item.value}}
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
<!-- 团队订单统计 -->
|
<!-- 团队订单统计 -->
|
||||||
<view class="margin-lr-sm margin-top-sm padding bg-white margin-bottom-with-bar">
|
<view class="margin-lr-sm margin-top-sm padding bg-white margin-bottom-with-bar">
|
||||||
<view class="cu-list grid no-border col-4">
|
<view class="cu-list grid no-border col-4">
|
||||||
<view class="cu-item" v-for="(item, index) in myOperator.analyseItems" v-if="index >= 4 && item.type === 'dayAnalyse'">
|
<view class="cu-item" v-for="(item, index) in myOperator.analyseItems" :key="index" v-if="index >= 4 && item.type === 'dayAnalyse'">
|
||||||
<view class="margin-bottom-xs">{{item.title}}</view>
|
<view class="margin-bottom-xs">{{item.title}}</view>
|
||||||
<view class="text-red" v-if="item.unit === 'yuan'">
|
<view class="text-red" v-if="item.unit === 'yuan'">
|
||||||
¥{{item.value}}
|
¥{{item.value}}
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
{{item.value}}{{item.unit}}
|
{{item.value}}{{item.unit}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-item" v-for="(item, index) in myOperator.analyseItems" v-if="index >= 4 && item.type === 'common'">
|
<view class="cu-item" v-for="(item, index) in myOperator.analyseItems" :key="index" v-if="index >= 4 && item.type === 'common'">
|
||||||
<view class="margin-bottom-xs">{{item.title}}</view>
|
<view class="margin-bottom-xs">{{item.title}}</view>
|
||||||
<view class="text-red" v-if="item.unit === 'yuan'">
|
<view class="text-red" v-if="item.unit === 'yuan'">
|
||||||
¥{{item.value}}
|
¥{{item.value}}
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
<!-- 操作栏 -->
|
<!-- 操作栏 -->
|
||||||
<view class="bg-white padding margin-top-sm fixed-bottom-bar">
|
<view class="bg-white padding margin-top-sm fixed-bottom-bar">
|
||||||
<view class="flex flex-wrap justify-between">
|
<view class="flex flex-wrap justify-between">
|
||||||
<view class="basis-df margin-tb-sm" v-for="(item, index) in operBtn">
|
<view class="basis-df margin-tb-sm" v-for="(item, index) in operBtn" :key="item.name">
|
||||||
<button class="cu-btn long-btn shadow bg-main-color light" :data-cur="item.code"
|
<button class="cu-btn long-btn shadow bg-main-color light" :data-cur="item.code"
|
||||||
@click="doSomething">{{item.name}}</button>
|
@click="doSomething">{{item.name}}</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -85,13 +85,19 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="padding-xl">
|
<view class="padding-xl">
|
||||||
<view class="flex align-start margin-bottom-xl padding-lr">
|
<view class="flex align-start margin-bottom-xl padding-lr">
|
||||||
<view class="margin-right">选品广场:</view>
|
<view class="margin-right-sm">选品广场:</view>
|
||||||
<view class="margin-right">
|
<view class="margin-right-sm">
|
||||||
<view class="margin-bottom-sm">
|
<!-- <view class="margin-bottom-sm">
|
||||||
<text class="margin-right-xs">全选</text>
|
<text class="margin-right-xs">全选</text>
|
||||||
<checkbox style="transform:scale(0.9)" class="main-color" :value="agreeShield" :checked="agreeShield === 1"
|
<checkbox style="transform:scale(0.9)" class="main-color" :value="agreeShield" :checked="agreeShield === 1"
|
||||||
@click="changeAgreeShield(1)">
|
@click="changeAgreeShield(1)">
|
||||||
</checkbox>
|
</checkbox>
|
||||||
|
</view> -->
|
||||||
|
<view class="margin-bottom-sm">
|
||||||
|
<text class="margin-right-xs">正选</text>
|
||||||
|
<checkbox style="transform:scale(0.9)" class="main-color" :value="agreeShield" :checked="agreeShield === 1"
|
||||||
|
@click="changeAgreeShield(1)">
|
||||||
|
</checkbox>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<text class="margin-right-xs">反选</text>
|
<text class="margin-right-xs">反选</text>
|
||||||
|
|
@ -102,13 +108,17 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="text-left">
|
<view class="text-left">
|
||||||
<view>逐条选品</view>
|
<view>逐条选品</view>
|
||||||
<view class="text-main-color" @tap="showModal('categoryModal')">去选品</view>
|
<view>
|
||||||
|
<text class="text-main-color" @tap="showModal('categoryModal')">去选品</text>
|
||||||
|
<text v-if="chosenCategoryIds.length" style="color: red;font-size: 24upx;padding-left: 10upx;"> - 您已选品</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="padding-top-lg text-left text-sm">
|
<view class="padding-top-lg text-left text-sm">
|
||||||
<view class="margin-bottom-xs">全选:全部勾选供应链的服务及商品/运营代理所有类目</view>
|
<!-- <view class="margin-bottom-xs">全选:勾选后将运营代理所有供应链上的服务与商品,您的所有客户可见可选!</view> -->
|
||||||
<view class="margin-bottom-xs">反选:把与我提供的服务和商品有冲突的区域范围不勾选</view>
|
<view class="margin-bottom-xs">正选:进行对类目逐条勾选,已勾选的服务与商品,您的所有客户可见可选!</view>
|
||||||
<view class="text-main-color">(注:你所提供的服务及类目以你同手机号上架或入驻为准)</view>
|
<view class="margin-bottom-xs">反选:所有人与我区域范围提供的服务和商品重叠的进行屏蔽!<text class="text-main-color">(注:需两端绑定的手机号一致)</text></view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-bar bg-white">
|
<view class="cu-bar bg-white">
|
||||||
|
|
@ -120,11 +130,11 @@
|
||||||
</view>
|
</view>
|
||||||
<!-- 类目抽屉 -->
|
<!-- 类目抽屉 -->
|
||||||
<view class="DrawerClose" :class="modalName=='categoryModal'?'show':''" @tap="showModal('shieldSetModal')">
|
<view class="DrawerClose" :class="modalName=='categoryModal'?'show':''" @tap="showModal('shieldSetModal')">
|
||||||
<view class="cuIcon-roundcheckfill text-main-color"></view>
|
<view class="cuIcon-roundcheckfill text-main-color" style="margin-top: 20upx;font-size: 70upx;"></view>
|
||||||
<view class="cuIcon-roundclosefill"></view>
|
<view class="cuIcon-roundclosefill" style="margin-top: 20upx;font-size: 70upx;"></view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view scroll-y class="DrawerWindow bg-gray" :class="modalName=='categoryModal'?'show':''">
|
<scroll-view scroll-y class="DrawerWindow bg-gray" :class="modalName=='categoryModal'?'show':''">
|
||||||
<multiselect-vertical-nav ref="multiSelectNav" :list="categoryList" :containerHeight="'calc(100vh - 200rpx)'"></multiselect-vertical-nav>
|
<multiselect-vertical-nav ref="multiSelectNav" :list="categoryList" :containerHeight="'calc(100vh - 270rpx)'" :allLevel3CategoryIds="allLevel3CategoryIds"></multiselect-vertical-nav>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -220,6 +230,10 @@
|
||||||
},
|
},
|
||||||
showModal(modalName) {
|
showModal(modalName) {
|
||||||
this.modalName = modalName;
|
this.modalName = modalName;
|
||||||
|
// 获取已选择项
|
||||||
|
if(modalName = 'shieldSetModal' && !this.chosenCategoryIds.length) {
|
||||||
|
this.goChooseItem()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.modalName = null;
|
this.modalName = null;
|
||||||
|
|
@ -233,18 +247,25 @@
|
||||||
},
|
},
|
||||||
doSomething(e) {
|
doSomething(e) {
|
||||||
const cur = e.currentTarget.dataset.cur;
|
const cur = e.currentTarget.dataset.cur;
|
||||||
|
let findItem, numberMember;
|
||||||
switch (cur) {
|
switch (cur) {
|
||||||
case 'ShieldSet':
|
case 'ShieldSet':
|
||||||
this.showModal('shieldSetModal')
|
this.showModal('shieldSetModal')
|
||||||
break;
|
break;
|
||||||
case 'showTeamMembers':
|
case 'showTeamMembers':
|
||||||
|
findItem = this.myOperator.analyseItems.find(item => item.title === '团队')
|
||||||
|
numberMember = findItem ? findItem.value : 0
|
||||||
|
console.log(numberMember);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/my/my-team-member?placeStatus=2'
|
url: '/pages/my/my-team-member?placeStatus=2&number='+numberMember
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
case 'showCustomers':
|
case 'showCustomers':
|
||||||
|
findItem = this.myOperator.analyseItems.find(item => item.title === '客户数')
|
||||||
|
numberMember = findItem ? findItem.value : 0
|
||||||
|
console.log(numberMember);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/my/my-team-member'
|
url: '/pages/my/my-team-member?number='+numberMember
|
||||||
})
|
})
|
||||||
case 'showMembers2Approval':
|
case 'showMembers2Approval':
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
@ -255,18 +276,34 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeAgreeShield(agreeShield) {
|
changeAgreeShield(agreeShield) {
|
||||||
|
if(agreeShield === this.agreeShield) return
|
||||||
this.agreeShield = agreeShield;
|
this.agreeShield = agreeShield;
|
||||||
this.$refs.multiSelectNav.clearChosenItem();
|
// this.$refs.multiSelectNav.clearChosenItem();
|
||||||
uni.showToast({
|
this.goChooseItem()
|
||||||
icon: 'none',
|
// uni.showToast({
|
||||||
title: '请重新进行逐条选品'
|
// icon: 'none',
|
||||||
})
|
// title: '请重新进行逐条选品'
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
tmpChooseCategory(chosenCategoryIds) {
|
tmpChooseCategory(chosenCategoryIds) {
|
||||||
this.chosenCategoryIds = chosenCategoryIds;
|
this.chosenCategoryIds = chosenCategoryIds;
|
||||||
},
|
},
|
||||||
|
async goChooseItem() {
|
||||||
|
const res = await this.$request.getChooseCategories({
|
||||||
|
selectionType: this.agreeShield,
|
||||||
|
customerId: this.curUserInfo.customerId
|
||||||
|
})
|
||||||
|
console.log(res);
|
||||||
|
if(res[1].data.data.length) {
|
||||||
|
this.$refs.multiSelectNav.setChooseItems([...res[1].data.data])
|
||||||
|
}
|
||||||
|
// this.showModal('categoryModal')
|
||||||
|
},
|
||||||
|
|
||||||
async confirmShield(e) {
|
async confirmShield(e) {
|
||||||
if (this.agreeShield === 2 && this.chosenCategoryIds.length === 0) {
|
// console.log(this.agreeShield, this.chosenCategoryIds);
|
||||||
|
// return
|
||||||
|
if ((this.agreeShield === 2 || this.agreeShield === 1) && this.chosenCategoryIds.length === 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '请至少选择一个类目'
|
title: '请至少选择一个类目'
|
||||||
|
|
@ -274,14 +311,14 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let chosenCategoryIds = this.chosenCategoryIds;
|
let chosenCategoryIds = this.chosenCategoryIds;
|
||||||
if (this.agreeShield === 1 && this.chosenCategoryIds.length === 0) {
|
// if (this.agreeShield === 1 && this.chosenCategoryIds.length === 0) {
|
||||||
// 全选,带上所有的类目id
|
// // 全选,带上所有的类目id
|
||||||
chosenCategoryIds = this.allLevel3CategoryIds;
|
// chosenCategoryIds = this.allLevel3CategoryIds;
|
||||||
}
|
// }
|
||||||
let res = await this.$request.addCustomerSelection({
|
let res = await this.$request.addCustomerSelection({
|
||||||
customerId: this.curUserInfo.customerId,
|
customerId: this.curUserInfo.customerId,
|
||||||
deptCategoryIds: chosenCategoryIds,
|
deptCategoryIds: chosenCategoryIds,
|
||||||
selectionType: this.agreeShield
|
selectionType: this.agreeShield == 3 ? 1 : this.agreeShield
|
||||||
});
|
});
|
||||||
if (res && res.code === 0) {
|
if (res && res.code === 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,9 @@
|
||||||
if (option && option.placeStatus != undefined) {
|
if (option && option.placeStatus != undefined) {
|
||||||
this.placeStatus = option.placeStatus
|
this.placeStatus = option.placeStatus
|
||||||
}
|
}
|
||||||
|
if(option && option.number) {
|
||||||
|
this.totalMembers = option.number
|
||||||
|
}
|
||||||
this.curUserInfo = this.$request.getCurUserInfo();
|
this.curUserInfo = this.$request.getCurUserInfo();
|
||||||
this.resetData();
|
this.resetData();
|
||||||
// this.myOperaMembers = await this.$api.data('myOperaMembers');
|
// this.myOperaMembers = await this.$api.data('myOperaMembers');
|
||||||
|
|
@ -110,7 +113,7 @@
|
||||||
let rowsLength = res.rows.length;
|
let rowsLength = res.rows.length;
|
||||||
if (rowsLength > 0) {
|
if (rowsLength > 0) {
|
||||||
this.members = this.members.concat(res.rows);
|
this.members = this.members.concat(res.rows);
|
||||||
this.totalMembers = res.total;
|
// this.totalMembers = res.total;
|
||||||
this.pageNum++;
|
this.pageNum++;
|
||||||
if (rowsLength === this.pageSize) {
|
if (rowsLength === this.pageSize) {
|
||||||
this.$refs.loadStatusBar.showLoadMore();
|
this.$refs.loadStatusBar.showLoadMore();
|
||||||
|
|
|
||||||
|
|
@ -320,7 +320,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 订单编码和时间 -->
|
<!-- 订单编码和时间 -->
|
||||||
<view class="bg-white margin-top-sm padding margin-lr-sm margin-bottom-with-bar">
|
<view class="bg-white margin-top-sm padding margin-lr-sm margin-bottom-with-bar padding-bottom-xl">
|
||||||
<view>订单编码:{{servDetail.orderMasterCode}}</view>
|
<view>订单编码:{{servDetail.orderMasterCode}}</view>
|
||||||
<view class="margin-top-xs">订单时间:{{servDetail.createTime}}</view>
|
<view class="margin-top-xs">订单时间:{{servDetail.createTime}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -558,26 +558,63 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showAddress2Choose() {
|
showAddress2Choose() {
|
||||||
|
const {provinceId,provinceName,cityId,cityName,countryId,countryName,address,name,streetId,streetName,phone} = this.servDetail
|
||||||
|
let newAddr = address
|
||||||
|
if(newAddr.indexOf(provinceName) > -1) {
|
||||||
|
newAddr = newAddr.replace(provinceName, "")
|
||||||
|
}
|
||||||
|
if(newAddr.indexOf(cityName) > -1) {
|
||||||
|
newAddr = newAddr.replace(cityName, "")
|
||||||
|
}
|
||||||
|
if(newAddr.indexOf(countryName) > -1) {
|
||||||
|
newAddr = newAddr.replace(countryName, "")
|
||||||
|
}
|
||||||
|
if(newAddr.indexOf(streetName) > -1) {
|
||||||
|
newAddr = newAddr.replace(streetName, "")
|
||||||
|
}
|
||||||
|
const addressInfo = {
|
||||||
|
provinceId,
|
||||||
|
provinceName,
|
||||||
|
cityId,
|
||||||
|
cityName,
|
||||||
|
countryId,
|
||||||
|
countryName,
|
||||||
|
address: newAddr,
|
||||||
|
streetId,
|
||||||
|
streetName,
|
||||||
|
phone,
|
||||||
|
name
|
||||||
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/my/my-address?chooseMode=true'
|
url: '/pages/my/edit-service-address?params=' + encodeURIComponent(JSON.stringify(addressInfo))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
editAddress(addressInfo) {
|
async editAddress(addressInfo) {
|
||||||
console.log(addressInfo)
|
console.log(addressInfo)
|
||||||
// let res = await this.$request.updateOrder({
|
const {provinceId,provinceName,cityId,cityName,countryId,countryName,address,name,streetId,streetName,phone} = addressInfo
|
||||||
// id: order.orderMasterId,
|
let res = await this.$request.updateMasterAddress({
|
||||||
// orderStatus: status
|
id: this.servDetail.orderMasterId,
|
||||||
// });
|
provinceId,
|
||||||
// if (res && res.code === 0) {
|
provinceName,
|
||||||
// this.reload();
|
cityId,
|
||||||
// if (ifRollback) {
|
cityName,
|
||||||
// uni.showToast({
|
countryId,
|
||||||
// title: '订单已回滚至服务中状态,请联系师傅',
|
countryName,
|
||||||
// icon: 'none',
|
address,
|
||||||
// duration: 3000
|
streetId,
|
||||||
// })
|
streetName,
|
||||||
// }
|
phone,
|
||||||
// }
|
name
|
||||||
|
});
|
||||||
|
if (res && res.code === 0) {
|
||||||
|
this.loadData(this.order.orderMasterId);
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'success',
|
||||||
|
title: '修改成功'
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
makePhoneCall(phoneNum) {
|
makePhoneCall(phoneNum) {
|
||||||
uni.makePhoneCall({
|
uni.makePhoneCall({
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="padding-tb-lg">
|
<view class="padding-tb-lg">
|
||||||
<view class="margin-bottom-sm">
|
<view class="margin-bottom-sm">
|
||||||
<text class="text-gray">当前状态:</text>
|
<text class="text-gray">订单支付:</text>
|
||||||
<text>{{statementDesc.payStatus == 0 ? '未付款' : '已付款'}}</text>
|
<text>{{statementDesc.payStatusDesc}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-bottom-sm">
|
<view class="margin-bottom-sm">
|
||||||
<text class="text-gray">详情说明:</text>
|
<text class="text-gray">详情说明:</text>
|
||||||
|
|
@ -31,12 +31,12 @@
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-bottom-sm">
|
<view class="margin-bottom-sm">
|
||||||
<text class="text-gray">提现单号:</text>
|
<text class="text-gray">订单号码:</text>
|
||||||
<text v-if="statementDesc.code">{{statementDesc.code}}</text>
|
<text v-if="statementDesc.orderCode">{{statementDesc.orderCode}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-bottom-sm">
|
<view class="margin-bottom-sm">
|
||||||
<text class="text-gray">发起时间:</text>
|
<text class="text-gray">利润支付:</text>
|
||||||
<text v-if="statementDesc.updateTime">{{statementDesc.updateTime}}</text>
|
<text v-if="statementDesc.payTime">{{statementDesc.payTime}}</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="margin-bottom-sm">
|
<!-- <view class="margin-bottom-sm">
|
||||||
<text class="text-gray">订单编号:</text>
|
<text class="text-gray">订单编号:</text>
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
</view>
|
</view>
|
||||||
<!-- 选购的商品列表 -->
|
<!-- 选购的商品列表 -->
|
||||||
<view class="margin-lr-sm margin-top-sm bg-white">
|
<view class="margin-lr-sm margin-top-sm bg-white">
|
||||||
<view class="solid-top" v-for="(item, index0) in pickedProductList">
|
<view class="solid-top" v-for="(item, index0) in pickedProductList" :key="index0">
|
||||||
<view class="cu-bar">
|
<view class="cu-bar">
|
||||||
<view class="action bar-first-action">
|
<view class="action bar-first-action">
|
||||||
<text class="cuIcon-shopfill text-main-color"></text>
|
<text class="cuIcon-shopfill text-main-color"></text>
|
||||||
|
|
@ -98,6 +98,28 @@
|
||||||
</radio-group>
|
</radio-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<template v-if="InsuranceList.length">
|
||||||
|
<view class="margin-lr-sm margin-top-sm bg-white padding">
|
||||||
|
<view class="text-black">
|
||||||
|
<!-- insuranceAmount -->
|
||||||
|
<text style="font-size: 40rpx;">保险</text> <text style="font-size: 26rpx;margin-left: 10upx;" v-if="chooseInsurance.insuranceAmount">核对服务费¥{{chooseInsurance.insuranceAmount}}(预付),未出发上门可退!</text>
|
||||||
|
</view>
|
||||||
|
<view class="text-black" style="font-size: 26rpx;padding-top: 10upx;">本订单勾选全程保险,请平台核对本单家政公司的雇主雇员与订单关联者按下方保险购买并生效:</view>
|
||||||
|
<radio-group @change="changeInsurance" style="width: 100%;">
|
||||||
|
<label v-for="item in InsuranceList" :key="item.id" class="radio" style="width: 100%;display: flex;justify-content: space-between;align-items: center;padding: 20upx 0;">
|
||||||
|
<view>
|
||||||
|
<radio class="main-color" :value="item.id" :checked="chooseInsurance.id == item.id" />
|
||||||
|
<text class="margin-left-xs text-red">{{item.insuranceName}}</text>
|
||||||
|
</view>
|
||||||
|
<text class="text-main-color">条款查看</text>
|
||||||
|
</label>
|
||||||
|
</radio-group>
|
||||||
|
<view style="text-align: right;padding: 10upx 0;">
|
||||||
|
<view class="cu-tag light bg-blue radius" @click="chooseInsurance.id = null; chooseInsurance.insuranceAmount = 0;">清除保险</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
<!-- 发票信息 -->
|
<!-- 发票信息 -->
|
||||||
<view class="margin-lr-sm margin-top-sm bg-white padding">
|
<view class="margin-lr-sm margin-top-sm bg-white padding">
|
||||||
<view class="flex justify-between align-center">
|
<view class="flex justify-between align-center">
|
||||||
|
|
@ -160,12 +182,14 @@
|
||||||
doorTime: null,
|
doorTime: null,
|
||||||
defaultAddress: null,
|
defaultAddress: null,
|
||||||
expectTimeStart: '',
|
expectTimeStart: '',
|
||||||
expectTimeEnd: ''
|
expectTimeEnd: '',
|
||||||
},
|
},
|
||||||
totalPrice: 0,
|
totalPrice: 0,
|
||||||
timeRangeIndex: 0,
|
timeRangeIndex: 0,
|
||||||
timeRange: '',
|
timeRange: '',
|
||||||
timeRangeList: []
|
timeRangeList: [],
|
||||||
|
InsuranceList: [],
|
||||||
|
chooseInsurance: {id: null, insuranceAmount: 0}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
|
@ -181,6 +205,13 @@
|
||||||
this.loadDefaultAddress();
|
this.loadDefaultAddress();
|
||||||
// this.pickedProductList = await this.$api.data('pickedProductList');
|
// this.pickedProductList = await this.$api.data('pickedProductList');
|
||||||
this.pickedProductList = params.pickedProductList;
|
this.pickedProductList = params.pickedProductList;
|
||||||
|
console.log(params);
|
||||||
|
this.InsuranceList = params.pickedProductList[0].insuranceManagers || []
|
||||||
|
if(this.InsuranceList.length) {
|
||||||
|
this.chooseInsurance.id = this.InsuranceList[0].id;
|
||||||
|
this.chooseInsurance.insuranceAmount = this.InsuranceList[0].insuranceAmount;
|
||||||
|
}
|
||||||
|
|
||||||
this.loadTotalPrice();
|
this.loadTotalPrice();
|
||||||
this.timeRangeList = this.$globalData.timeRangeList;
|
this.timeRangeList = this.$globalData.timeRangeList;
|
||||||
this.timeRange = this.timeRangeList[0];
|
this.timeRange = this.timeRangeList[0];
|
||||||
|
|
@ -190,8 +221,12 @@
|
||||||
customerId: this.$request.getCurUserInfo().customerId,
|
customerId: this.$request.getCurUserInfo().customerId,
|
||||||
isDefault: 1
|
isDefault: 1
|
||||||
});
|
});
|
||||||
|
// if (res && res.data &&res.data.length) {
|
||||||
|
// this.formInfo.defaultAddress = res.data[0];
|
||||||
|
// }
|
||||||
if (res && res.data &&res.data.length) {
|
if (res && res.data &&res.data.length) {
|
||||||
this.formInfo.defaultAddress = res.data[0];
|
const defaultAdd = res.data.filter(i => i.isDefault === 1)
|
||||||
|
this.formInfo.defaultAddress = defaultAdd.length ? defaultAdd[0] : res.data[0];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadTotalPrice() {
|
loadTotalPrice() {
|
||||||
|
|
@ -212,6 +247,16 @@
|
||||||
changeIsNeedBill(e) {
|
changeIsNeedBill(e) {
|
||||||
this.formInfo.isNeedBill = e.detail.value;
|
this.formInfo.isNeedBill = e.detail.value;
|
||||||
},
|
},
|
||||||
|
changeInsurance(e) {
|
||||||
|
if(e.detail.value) {
|
||||||
|
const current = this.InsuranceList.find(i => i.id == e.detail.value)
|
||||||
|
this.chooseInsurance.id = current.id;
|
||||||
|
this.chooseInsurance.insuranceAmount = current.insuranceAmount;
|
||||||
|
} else {
|
||||||
|
this.chooseInsurance.id = null;
|
||||||
|
this.chooseInsurance.insuranceAmount = 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
inputComments(e) {
|
inputComments(e) {
|
||||||
this.formInfo.comments = e.detail.value
|
this.formInfo.comments = e.detail.value
|
||||||
},
|
},
|
||||||
|
|
@ -269,11 +314,42 @@
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
async submit() {
|
// 检测当前默认地址是否在服务区域之间
|
||||||
|
checkDefaultAddressIfInclude() {
|
||||||
|
if(!this.formInfo.defaultAddress) return true
|
||||||
|
const allAreaId = []
|
||||||
|
this.pickedProductList.forEach(item => {
|
||||||
|
item.product.forEach(pro => {
|
||||||
|
allAreaId.push(...pro.goodsAreaList.map(i => i.countryAreaId))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
// console.log(allAreaId, this.formInfo.defaultAddress);
|
||||||
|
// const allAreaId = this.shopInfo.workerAreas.map(i => i.districtId)
|
||||||
|
return allAreaId.includes(this.formInfo.defaultAddress.countryId)
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
let valid = this.validForm();
|
let valid = this.validForm();
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(!this.checkDefaultAddressIfInclude()) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '所选服务的区域与您所填地址的区域不匹配!可能会无法服务,请核对!',
|
||||||
|
cancelText: '查看',
|
||||||
|
confirmText: '仍然下单',
|
||||||
|
success: res => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.makeOrderOpration()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.makeOrderOpration()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async makeOrderOpration() {
|
||||||
|
|
||||||
let curUserInfo = this.$request.getCurUserInfo();
|
let curUserInfo = this.$request.getCurUserInfo();
|
||||||
let params = {
|
let params = {
|
||||||
customerId: curUserInfo.customerId,
|
customerId: curUserInfo.customerId,
|
||||||
|
|
@ -284,7 +360,9 @@
|
||||||
remark: this.formInfo.comments,
|
remark: this.formInfo.comments,
|
||||||
isNeedBill: this.formInfo.isNeedBill,
|
isNeedBill: this.formInfo.isNeedBill,
|
||||||
goodsList: this.parseGoodsList(),
|
goodsList: this.parseGoodsList(),
|
||||||
goodsId: this.pickedProductList[0].product[0].goodsId
|
goodsId: this.pickedProductList[0].product[0].goodsId,
|
||||||
|
// 保险id
|
||||||
|
insuranceId: this.chooseInsurance.id
|
||||||
// goodsList: [{
|
// goodsList: [{
|
||||||
// goodsId: 2,
|
// goodsId: 2,
|
||||||
// num: 1
|
// num: 1
|
||||||
|
|
|
||||||
|
|
@ -79,10 +79,15 @@
|
||||||
tabCur: 0
|
tabCur: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
|
||||||
// url: '/pages/my/my-order?tabInfo=' + encodeURIComponent(JSON.stringify(params))
|
uni.reLaunch({
|
||||||
url: '/pages/index/index?menuCode=myPage'
|
url: '/pages/index/home?menuCode=myPage'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// uni.navigateTo({
|
||||||
|
// // url: '/pages/my/my-order?tabInfo=' + encodeURIComponent(JSON.stringify(params))
|
||||||
|
// url: '/pages/index/home?menuCode=myPage'
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,8 @@
|
||||||
chosenArea: [],
|
chosenArea: [],
|
||||||
categoryList: [],
|
categoryList: [],
|
||||||
categoryMultiIndex: [0, 0, 0],
|
categoryMultiIndex: [0, 0, 0],
|
||||||
chosenCategory: []
|
chosenCategory: [],
|
||||||
|
isLoadLocalData: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
|
@ -188,6 +189,9 @@
|
||||||
if (params.inputGoodsName) {
|
if (params.inputGoodsName) {
|
||||||
this.inputGoodsName = params.inputGoodsName;
|
this.inputGoodsName = params.inputGoodsName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.isLoadLocalData = params.showData;
|
||||||
|
|
||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -202,6 +206,7 @@
|
||||||
// 获取当前定位
|
// 获取当前定位
|
||||||
await this.getCurAreaArr();
|
await this.getCurAreaArr();
|
||||||
await this.loadRegionList();
|
await this.loadRegionList();
|
||||||
|
|
||||||
this.loadProductData();
|
this.loadProductData();
|
||||||
this.loadOtherCityProductData();
|
this.loadOtherCityProductData();
|
||||||
},
|
},
|
||||||
|
|
@ -213,6 +218,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async loadProductData(params = {}) {
|
async loadProductData(params = {}) {
|
||||||
|
if(!this.isLoadLocalData) {
|
||||||
|
this.loadMoreStatus = 'over bg-grey padding-tb text-lg'
|
||||||
|
this.hasMoreData = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
params.pageNum = this.pageNum;
|
params.pageNum = this.pageNum;
|
||||||
params.pageSize = this.pageSize;
|
params.pageSize = this.pageSize;
|
||||||
params.goodsName = this.inputGoodsName;
|
params.goodsName = this.inputGoodsName;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@
|
||||||
return {
|
return {
|
||||||
containerHeight: '100vh - ' + this.CustomBar + 'px - 46px',
|
containerHeight: '100vh - ' + this.CustomBar + 'px - 46px',
|
||||||
level0CategoryList: [],
|
level0CategoryList: [],
|
||||||
categoryList: []
|
categoryList: [],
|
||||||
|
deptGoodsCategoryIds: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
|
@ -36,6 +37,16 @@
|
||||||
level: 0
|
level: 0
|
||||||
});
|
});
|
||||||
this.level0CategoryList = res0.data;
|
this.level0CategoryList = res0.data;
|
||||||
|
this.curUserInfo = this.$request.getCurUserInfo();
|
||||||
|
if(this.curUserInfo) {
|
||||||
|
const res = await this.$request.getChooseCategories({
|
||||||
|
selectionType: 1,
|
||||||
|
customerId: this.curUserInfo.customerId
|
||||||
|
})
|
||||||
|
this.deptGoodsCategoryIds = res[1].data.data
|
||||||
|
// this.deptGoodsCategoryIds = [16,234,106,113]
|
||||||
|
// [16,234,106,113]
|
||||||
|
}
|
||||||
this.loadTargetTypeCategoryList(params, type);
|
this.loadTargetTypeCategoryList(params, type);
|
||||||
},
|
},
|
||||||
async loadTargetTypeCategoryList(params = {}, type = 1) {
|
async loadTargetTypeCategoryList(params = {}, type = 1) {
|
||||||
|
|
@ -48,10 +59,34 @@
|
||||||
res = res[1].data.data;
|
res = res[1].data.data;
|
||||||
res.forEach(firstCategory => {
|
res.forEach(firstCategory => {
|
||||||
if (firstCategory.child && firstCategory.child.length) {
|
if (firstCategory.child && firstCategory.child.length) {
|
||||||
|
if(this.deptGoodsCategoryIds.length === 0) {
|
||||||
this.categoryList = this.categoryList.concat(firstCategory.child)
|
this.categoryList = this.categoryList.concat(firstCategory.child)
|
||||||
|
} else {
|
||||||
|
this.categoryList = this.filterDataInSelect(firstCategory.child)
|
||||||
|
console.log(this.categoryList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
filterDataInSelect(data) {
|
||||||
|
const newData = []
|
||||||
|
for(let i = 0; i < data.length; i++) {
|
||||||
|
const newChild = []
|
||||||
|
if(!data[i].child) continue;
|
||||||
|
for(let j = 0; j < data[i].child.length; j++) {
|
||||||
|
const filterChild = (data[i].child[j].child || []).filter(item => this.deptGoodsCategoryIds.includes(item.goodsCategoryId))
|
||||||
|
if(filterChild.length) {
|
||||||
|
data[i].child[j].child = filterChild
|
||||||
|
newChild.push(data[i].child[j])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(newChild.length) {
|
||||||
|
data[i].child = newChild
|
||||||
|
newData.push(data[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newData
|
||||||
|
},
|
||||||
bindEvent() {
|
bindEvent() {
|
||||||
uni.$on(this.$globalFun.VERTICAL_NAV_GET_ITEM, this.chooseSubType);
|
uni.$on(this.$globalFun.VERTICAL_NAV_GET_ITEM, this.chooseSubType);
|
||||||
uni.$on(this.$globalFun.VERTICAL_NAV_SEARCH, this.searchType);
|
uni.$on(this.$globalFun.VERTICAL_NAV_SEARCH, this.searchType);
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,14 @@
|
||||||
<text class="margin-lr-xs text-sm">{{productDetail.remark}}</text>
|
<text class="margin-lr-xs text-sm">{{productDetail.remark}}</text>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="solid-top text-lg padding-tb-sm">
|
<view class="solid-top text-lg padding-tb-sm">
|
||||||
<text class="text-black">选择品类</text>
|
<view class='cu-tag light radius bg-orange padding-lr-xs' style="font-size: 0.9rem;" v-if="productDetail.deptGoodsCategoryName">
|
||||||
|
<text v-if="productDetail.parGoodsCategoryName">
|
||||||
|
{{productDetail.parGoodsCategoryName}}
|
||||||
|
<text>/</text>
|
||||||
|
</text>
|
||||||
|
<text>{{productDetail.deptGoodsCategoryName}}</text>
|
||||||
|
</view>
|
||||||
|
<text class="text-black margin-left-sm" style="vertical-align: middle;">查看产品</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex flex-wrap" :class="isShowAllSpecs ? '' : 'certern-height'">
|
<view class="flex flex-wrap" :class="isShowAllSpecs ? '' : 'certern-height'">
|
||||||
<view class="margin-tb-xs margin-right-xs" v-for="(item,index) in productDetail.goodsStandardList" :key="item.goodsStandardId">
|
<view class="margin-tb-xs margin-right-xs" v-for="(item,index) in productDetail.goodsStandardList" :key="item.goodsStandardId">
|
||||||
|
|
@ -163,7 +170,7 @@
|
||||||
@click="chooseSpecs(item)">{{item.goodsStandardName}}</view>
|
@click="chooseSpecs(item)">{{item.goodsStandardName}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-bold text-gray text-lg text-center bg-white padding-top-sm" @click="showAllSpecs()"><text
|
<view class="text-bold text-gray text-lg text-center bg-white padding-top-sm" @click="showAllSpecs()"><text v-if="!isShowAllSpecs">展开</text><text
|
||||||
:class="'cuIcon-' + (isShowAllSpecs ? 'fold' : 'unfold')"></text></view>
|
:class="'cuIcon-' + (isShowAllSpecs ? 'fold' : 'unfold')"></text></view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 服务评价 -->
|
<!-- 服务评价 -->
|
||||||
|
|
@ -192,7 +199,7 @@
|
||||||
<view id="pageAnchor2" class="margin-lr-sm margin-top-sm bg-white margin-bottom-with-bar ">
|
<view id="pageAnchor2" class="margin-lr-sm margin-top-sm bg-white margin-bottom-with-bar ">
|
||||||
<view class="text-center padding-xl">{{productDetail.remark}}</view>
|
<view class="text-center padding-xl">{{productDetail.remark}}</view>
|
||||||
<view class="image">
|
<view class="image">
|
||||||
<image v-for="(item,index) in detailPicList" :src="item.imgUrl" mode="widthFix" style="width: 100%;"></image>
|
<image v-for="(item,index) in detailPicList" :key="index" :src="item.imgUrl" mode="widthFix" style="width: 100%;"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 底部操作条 -->
|
<!-- 底部操作条 -->
|
||||||
|
|
@ -221,7 +228,7 @@
|
||||||
购物车
|
购物车
|
||||||
</view> -->
|
</view> -->
|
||||||
<!-- <view class="bg-main-color light submit" @click="toggleProductPickModal">加入购物车</view> -->
|
<!-- <view class="bg-main-color light submit" @click="toggleProductPickModal">加入购物车</view> -->
|
||||||
<view class="bg-main-color submit" @tap="checkLogin" @click="toggleProductPickModal($event, true)">立即订购</view>
|
<view class="bg-main-color submit" @tap="checkLogin" @click="beforeCheckStatusThenOpen">立即订购</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 底部弹窗 -->
|
<!-- 底部弹窗 -->
|
||||||
<uni-popup ref="productPickPopup" type="bottom" @change="changePopupState">
|
<uni-popup ref="productPickPopup" type="bottom" @change="changePopupState">
|
||||||
|
|
@ -265,7 +272,8 @@
|
||||||
totalPickCount: 0,
|
totalPickCount: 0,
|
||||||
ifHasCsMsg: true,
|
ifHasCsMsg: true,
|
||||||
picUrls: [],
|
picUrls: [],
|
||||||
curUserInfo: {}
|
curUserInfo: {},
|
||||||
|
defaultAddress: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
|
@ -273,6 +281,7 @@
|
||||||
this.inParam = params;
|
this.inParam = params;
|
||||||
this.loadData();
|
this.loadData();
|
||||||
this.bindEvent();
|
this.bindEvent();
|
||||||
|
this.loadDefaultAddress()
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
this.offBindEvent();
|
this.offBindEvent();
|
||||||
|
|
@ -286,7 +295,8 @@
|
||||||
},
|
},
|
||||||
onShareAppMessage(e) {
|
onShareAppMessage(e) {
|
||||||
let params = {
|
let params = {
|
||||||
goodsId: this.inParam.goodsId
|
goodsId: this.inParam.goodsId,
|
||||||
|
distributor: this.curUserInfo.customerId
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
title: this.productDetail.goodsName,
|
title: this.productDetail.goodsName,
|
||||||
|
|
@ -296,7 +306,8 @@
|
||||||
},
|
},
|
||||||
onShareTimeline(e) {
|
onShareTimeline(e) {
|
||||||
let params = {
|
let params = {
|
||||||
goodsId: this.inParam.goodsId
|
goodsId: this.inParam.goodsId,
|
||||||
|
distributor: this.curUserInfo.customerId
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
title: this.productDetail.goodsName,
|
title: this.productDetail.goodsName,
|
||||||
|
|
@ -308,6 +319,7 @@
|
||||||
async loadData() {
|
async loadData() {
|
||||||
await this.$request.refreshCurUserCache();
|
await this.$request.refreshCurUserCache();
|
||||||
this.curUserInfo = this.$request.getCurUserInfo();
|
this.curUserInfo = this.$request.getCurUserInfo();
|
||||||
|
if(this.curUserInfo) {
|
||||||
let productDetailMock = await this.$api.data('productDetail');
|
let productDetailMock = await this.$api.data('productDetail');
|
||||||
this.productDetail = await this.$request.getGoodsDetail({
|
this.productDetail = await this.$request.getGoodsDetail({
|
||||||
goodsId: this.inParam.goodsId
|
goodsId: this.inParam.goodsId
|
||||||
|
|
@ -334,6 +346,13 @@
|
||||||
this.productInfo = productDetailMock.productInfo;
|
this.productInfo = productDetailMock.productInfo;
|
||||||
this.reviewers = productDetailMock.reviewers;
|
this.reviewers = productDetailMock.reviewers;
|
||||||
// this.shopInfo = productDetailMock.shopInfo;
|
// this.shopInfo = productDetailMock.shopInfo;
|
||||||
|
if(this.inParam.distributor) {
|
||||||
|
await this.$request.updateUser({
|
||||||
|
customerPlace: this.inParam.distributor,
|
||||||
|
customerId: this.curUserInfo.customerId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async checkLogin() {
|
async checkLogin() {
|
||||||
let loginRes = await this.authLogin();
|
let loginRes = await this.authLogin();
|
||||||
|
|
@ -413,6 +432,107 @@
|
||||||
selector: '#pageAnchor' + index
|
selector: '#pageAnchor' + index
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
async loadDefaultAddress() {
|
||||||
|
let res = await this.$request.getAddressList({
|
||||||
|
customerId: this.$request.getCurUserInfo().customerId,
|
||||||
|
isDefault: 1
|
||||||
|
});
|
||||||
|
if (res && res.data &&res.data.length) {
|
||||||
|
const defaultAdd = res.data.filter(i => i.isDefault === 1)
|
||||||
|
this.defaultAddress = defaultAdd.length ? defaultAdd[0] : res.data[0];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 检测当前默认地址是否在服务区域之间
|
||||||
|
checkDefaultAddressIfInclude() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const allAreaId = this.productDetail.goodsAreaList.map(i => i.countryAreaId)
|
||||||
|
const status = allAreaId.includes(this.defaultAddress.countryId)
|
||||||
|
console.log('checkDefaultAddressIfInclude == ', status)
|
||||||
|
if(!status) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '产品页面的【服务区域】与您默认的地址不匹配,如未选错产品,请提交后改新地址!',
|
||||||
|
cancelText: '返回查看',
|
||||||
|
confirmText: '继续下单',
|
||||||
|
success: res => {
|
||||||
|
if (res.confirm) {
|
||||||
|
resolve(true)
|
||||||
|
} else {
|
||||||
|
resolve(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
resolve(true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
async checkCurAreaIncludeServiceAreas() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
let curLocation = uni.getStorageSync('curLocation');
|
||||||
|
if(!curLocation) resolve(true)
|
||||||
|
const curAreaId = curLocation.area[curLocation.area.length - 1].areaId
|
||||||
|
const allAreaId = this.productDetail.goodsAreaList.map(i => i.countryAreaId)
|
||||||
|
if(!allAreaId.includes(curAreaId)) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '所选产品与您目前所在位置定位不是同一个区/县,请查看产品页面的【服务区域】与【区域备注】!',
|
||||||
|
cancelText: '返回查看',
|
||||||
|
confirmText: '继续下单',
|
||||||
|
success: res => {
|
||||||
|
if (res.confirm) {
|
||||||
|
resolve(true)
|
||||||
|
} else {
|
||||||
|
resolve(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
resolve(true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
async beforeCheckStatusThenOpen() {
|
||||||
|
if(this.defaultAddress) {
|
||||||
|
const status = await this.checkDefaultAddressIfInclude()
|
||||||
|
if(status) {
|
||||||
|
this.toggleProductPickModal(null, true)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const areaStatus = await this.checkCurAreaIncludeServiceAreas()
|
||||||
|
if(areaStatus) {
|
||||||
|
this.toggleProductPickModal(null, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// console.log('checkDefaultAddressIfInclude == start',)
|
||||||
|
// const status = await this.checkDefaultAddressIfInclude()
|
||||||
|
// console.log('checkDefaultAddressIfInclude == ', status)
|
||||||
|
// if(status) {
|
||||||
|
// const areaStatus = await this.checkCurAreaIncludeServiceAreas()
|
||||||
|
// if(areaStatus) {
|
||||||
|
// this.toggleProductPickModal(null, true)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if(!status) {
|
||||||
|
// uni.showModal({
|
||||||
|
// title: '提示',
|
||||||
|
// content: '所选产品与您目前所在位置定位不是同一个区/县,请查看产品页面的【服务区域】与【区域备注】!',
|
||||||
|
// cancelText: '返回查看',
|
||||||
|
// confirmText: '继续下单',
|
||||||
|
// success: res => {
|
||||||
|
// if (res.confirm) {
|
||||||
|
// this.toggleProductPickModal(null, true)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// this.toggleProductPickModal(null, true)
|
||||||
|
// }
|
||||||
|
},
|
||||||
async toggleProductPickModal(e, orderNow) {
|
async toggleProductPickModal(e, orderNow) {
|
||||||
this.orderNow = orderNow ? true : false;
|
this.orderNow = orderNow ? true : false;
|
||||||
if (this.ifShowPageMeta) {
|
if (this.ifShowPageMeta) {
|
||||||
|
|
@ -440,8 +560,8 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
showIndex() {
|
showIndex() {
|
||||||
uni.navigateTo({
|
uni.reLaunch({
|
||||||
url: '/pages/index/index'
|
url: '/pages/index/home'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
defaultHead(url) {
|
defaultHead(url) {
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,18 @@
|
||||||
<view class="cu-avatar xl" :style="'background-image:url(' + productInfo.goodsImgUrl + ');'">
|
<view class="cu-avatar xl" :style="'background-image:url(' + productInfo.goodsImgUrl + ');'">
|
||||||
</view>
|
</view>
|
||||||
<view class="content margin-left">
|
<view class="content margin-left">
|
||||||
|
<view>
|
||||||
<text class="text-price text-red text-xxl">{{curSpec.goodsPrice}}</text>
|
<text class="text-price text-red text-xxl">{{curSpec.goodsPrice}}</text>
|
||||||
<text class="margin-left-xs">/{{curSpec.goodsUnit}}</text>
|
<text class="margin-left-xs">/{{curSpec.goodsUnit}}</text>
|
||||||
|
<view class='cu-tag round light bg-blue padding-lr-sm margin-left-xs' v-if="productInfo.deptGoodsCategoryName">
|
||||||
|
<text v-if="productInfo.parGoodsCategoryName">
|
||||||
|
{{productInfo.parGoodsCategoryName}}
|
||||||
|
<text class="margin-lr-xs">/</text>
|
||||||
|
</text>
|
||||||
|
<text>{{productInfo.deptGoodsCategoryName}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<text class="text-gray text-sm flex justify-between">
|
<text class="text-gray text-sm flex justify-between">
|
||||||
{{productInfo.goodsDesc}}
|
{{productInfo.goodsDesc}}
|
||||||
</text>
|
</text>
|
||||||
|
|
@ -24,7 +34,12 @@
|
||||||
<view class='cu-tag padding'
|
<view class='cu-tag padding'
|
||||||
:class="curSpec.goodsStandardId === item.goodsStandardId ? 'line-main-color' : 'line-default'"
|
:class="curSpec.goodsStandardId === item.goodsStandardId ? 'line-main-color' : 'line-default'"
|
||||||
@click="chooseSpecs(item)">{{item.goodsStandardName}}</view>
|
@click="chooseSpecs(item)">{{item.goodsStandardName}}</view>
|
||||||
<uni-number-box :min="0" :max="item.goodsNum ? item.goodsNum : 999" :value="0" @change="changePiecesNum($event, index)">
|
<uni-number-box
|
||||||
|
:min="0"
|
||||||
|
:max="item.goodsNum ? item.goodsNum : 999"
|
||||||
|
:value="0"
|
||||||
|
@change="changePiecesNum($event, index)"
|
||||||
|
@overstock="overstock">
|
||||||
</uni-number-box>
|
</uni-number-box>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
@ -51,15 +66,15 @@
|
||||||
props: {
|
props: {
|
||||||
shopInfo: {
|
shopInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {}
|
default: () => {}
|
||||||
},
|
},
|
||||||
productInfo: {
|
productInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {}
|
default: () => {}
|
||||||
},
|
},
|
||||||
specsList: {
|
specsList: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: []
|
default: () => []
|
||||||
},
|
},
|
||||||
orderNow: {
|
orderNow: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
|
@ -72,7 +87,8 @@
|
||||||
// specsList: [],
|
// specsList: [],
|
||||||
totalPrice: 0,
|
totalPrice: 0,
|
||||||
pickList: [],
|
pickList: [],
|
||||||
totalPickCount: 0
|
totalPickCount: 0,
|
||||||
|
defaultAddress: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -80,6 +96,10 @@
|
||||||
this.loadData();
|
this.loadData();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
this.loadDefaultAddress()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadData() {
|
loadData() {
|
||||||
this.curSpec = this.specsList[0];
|
this.curSpec = this.specsList[0];
|
||||||
|
|
@ -90,6 +110,7 @@
|
||||||
pickCount: 0
|
pickCount: 0
|
||||||
})
|
})
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
},
|
},
|
||||||
changePiecesNum(piecesNum, index) {
|
changePiecesNum(piecesNum, index) {
|
||||||
let spec = this.pickList[index];
|
let spec = this.pickList[index];
|
||||||
|
|
@ -115,6 +136,28 @@
|
||||||
}
|
}
|
||||||
return pickedList;
|
return pickedList;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async loadDefaultAddress() {
|
||||||
|
let res = await this.$request.getAddressList({
|
||||||
|
customerId: this.$request.getCurUserInfo().customerId,
|
||||||
|
isDefault: 1
|
||||||
|
});
|
||||||
|
if (res && res.data &&res.data.length) {
|
||||||
|
this.defaultAddress = res.data[0];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 检测当前默认地址是否在服务区域之间
|
||||||
|
checkDefaultAddressIfInclude() {
|
||||||
|
if(!this.defaultAddress) return true
|
||||||
|
const allAreaId = this.shopInfo.workerAreas.map(i => i.districtId)
|
||||||
|
return allAreaId.includes(this.defaultAddress.countryId)
|
||||||
|
},
|
||||||
|
overstock(maxStock) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '最大库存为:'+maxStock
|
||||||
|
})
|
||||||
|
},
|
||||||
submit() {
|
submit() {
|
||||||
if (this.orderNow) {
|
if (this.orderNow) {
|
||||||
// 从立即订购按钮进来的直接跳转到订单详情确认页
|
// 从立即订购按钮进来的直接跳转到订单详情确认页
|
||||||
|
|
@ -126,6 +169,14 @@
|
||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.makeOrder(pickedList)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// 从加入购物车按钮进来的触发父页面事件
|
||||||
|
uni.$emit('product-detail_add2Cart', this.totalPickCount)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
makeOrder(pickedList) {
|
||||||
let params = {
|
let params = {
|
||||||
pickedProductList: [{
|
pickedProductList: [{
|
||||||
...this.shopInfo,
|
...this.shopInfo,
|
||||||
|
|
@ -134,17 +185,14 @@
|
||||||
...this.productInfo,
|
...this.productInfo,
|
||||||
discountPrice: this.specsList[0].discountPrice,
|
discountPrice: this.specsList[0].discountPrice,
|
||||||
goodsPrice: this.specsList[0].goodsPrice,
|
goodsPrice: this.specsList[0].goodsPrice,
|
||||||
pickedList: pickedList
|
pickedList
|
||||||
}]
|
}],
|
||||||
|
insuranceManagers: this.productInfo.insuranceManagers
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '../order/order-detail?params=' + encodeURIComponent(JSON.stringify(params))
|
url: '../order/order-detail?params=' + encodeURIComponent(JSON.stringify(params))
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
// 从加入购物车按钮进来的触发父页面事件
|
|
||||||
uni.$emit('product-detail_add2Cart', this.totalPickCount)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,7 @@
|
||||||
value = +value;
|
value = +value;
|
||||||
if (value > this.max) {
|
if (value > this.max) {
|
||||||
value = this.max;
|
value = this.max;
|
||||||
|
this.$emit('overstock', this.max)
|
||||||
} else if (value < this.min) {
|
} else if (value < this.min) {
|
||||||
value = this.min;
|
value = this.min;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue