物流+下单+地址修改
This commit is contained in:
@@ -7,9 +7,9 @@ if (process.env.NODE_ENV === 'development') {
|
|||||||
// baseUrl = "https://twin-ui.com/demo/";
|
// baseUrl = "https://twin-ui.com/demo/";
|
||||||
// baseUrl = "http://59.110.212.44:9200/pb/";
|
// baseUrl = "http://59.110.212.44:9200/pb/";
|
||||||
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
|
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
|
||||||
baseUrl = "https://api.nuttyreading.com/"; // 线上正式
|
// baseUrl = "https://api.nuttyreading.com/"; // 线上正式
|
||||||
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
|
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
|
||||||
// baseUrl = "http://192.168.110.38:9200/pb/"; // 吴春磊笔记本1
|
baseUrl = "http://192.168.110.38:9200/pb/"; // 吴春磊笔记本1
|
||||||
// socketUrl = "ws://8.129.186.35:6001/";
|
// socketUrl = "ws://8.129.186.35:6001/";
|
||||||
} else if (process.env.NODE_ENV === 'production') {
|
} else if (process.env.NODE_ENV === 'production') {
|
||||||
// 生产环境11
|
// 生产环境11
|
||||||
|
|||||||
@@ -37,7 +37,8 @@
|
|||||||
},
|
},
|
||||||
"distribute" : {
|
"distribute" : {
|
||||||
"apple" : {
|
"apple" : {
|
||||||
"devices" : "universal"
|
"devices" : "universal",
|
||||||
|
"UIBackgroundModes" : [ "audio" ]
|
||||||
},
|
},
|
||||||
"android" : {
|
"android" : {
|
||||||
"permissionPhoneState" : {
|
"permissionPhoneState" : {
|
||||||
@@ -85,7 +86,7 @@
|
|||||||
"share" : {
|
"share" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"appid" : "wx47134a8f15083734",
|
"appid" : "wx47134a8f15083734",
|
||||||
"UniversalLinks" : ""
|
"UniversalLinks" : "https://verification.nuttyreading.com/uni-universallinks/__UNI__9788EB5/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"payment" : {
|
"payment" : {
|
||||||
@@ -96,7 +97,7 @@
|
|||||||
"weixin" : {
|
"weixin" : {
|
||||||
"__platform__" : [ "android" ],
|
"__platform__" : [ "android" ],
|
||||||
"appid" : "wx47134a8f15083734",
|
"appid" : "wx47134a8f15083734",
|
||||||
"UniversalLinks" : ""
|
"UniversalLinks" : "https://verification.nuttyreading.com/uni-universallinks/__UNI__9788EB5/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -107,7 +108,12 @@
|
|||||||
},
|
},
|
||||||
"ios" : {
|
"ios" : {
|
||||||
"dSYMs" : false,
|
"dSYMs" : false,
|
||||||
"UIBackgroundModes" : [ "audio" ] // 背景播放音乐
|
"UIBackgroundModes" : [ "audio" ], // 背景播放音乐
|
||||||
|
"capabilities" : {
|
||||||
|
"entitlements" : {
|
||||||
|
"com.apple.developer.associated-domains" : [ "applinks:verification.nuttyreading.com" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"icons" : {
|
"icons" : {
|
||||||
"android" : {
|
"android" : {
|
||||||
@@ -178,7 +184,8 @@
|
|||||||
"enable" : true
|
"enable" : true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"_spaceID" : "mp-3614b80b-2d75-4462-a481-4998f8187274"
|
||||||
}
|
}
|
||||||
// 小程序特有相关
|
// 小程序特有相关
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
this.deliverList = []
|
this.deliverList = []
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
this.$http
|
this.$http
|
||||||
.post(`/book/buyorder/queryFMS?orderId=${this.orderId}`)
|
.post(`/book/buyOrder/queryFMS?orderId=${this.orderId}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res, '物流信息')
|
console.log(res, '物流信息')
|
||||||
if (res && res.code === 0) {
|
if (res && res.code === 0) {
|
||||||
|
|||||||
@@ -500,7 +500,7 @@
|
|||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
$http.request({
|
$http.request({
|
||||||
url: "book/buyorder/update",
|
url: "book/buyOrder/update",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data,
|
data,
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
@@ -529,16 +529,16 @@
|
|||||||
getOrderList() {
|
getOrderList() {
|
||||||
console.log('this.orderType',this.orderType)
|
console.log('this.orderType',this.orderType)
|
||||||
this.$http
|
this.$http
|
||||||
.post(`book/buyorder/appGetOrderInfo/${this.orderType}?orderId=${this.orderID}`)
|
.get(`book/buyOrder/getOrderInfo?orderId=${this.orderID}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log('res+++',res)
|
console.log('订单详情',res)
|
||||||
var seconds = res.buyOrder.timestamp + 30 * 60 + 2 // 过期时间
|
var seconds = res.result.timestamp + 30 * 60 + 2 // 过期时间
|
||||||
var nowSeconds = Math.floor(new Date().getTime() / 1000);
|
var nowSeconds = Math.floor(new Date().getTime() / 1000);
|
||||||
res.buyOrder.overTime = seconds - nowSeconds
|
res.result.overTime = seconds - nowSeconds
|
||||||
|
|
||||||
this.orderContet = res.buyOrder
|
this.orderContet = res.result
|
||||||
this.userRecordid = res.userRecordid
|
this.userRecordid = res.userRecordid
|
||||||
this.productIDs = res.buyOrder.products.map(item => {
|
this.productIDs = res.result.products.map(item => {
|
||||||
return item.productId
|
return item.productId
|
||||||
})
|
})
|
||||||
// console.log(this.orderContet,'this.orderContet')
|
// console.log(this.orderContet,'this.orderContet')
|
||||||
@@ -558,7 +558,7 @@
|
|||||||
// 获取物流
|
// 获取物流
|
||||||
getdeliverDetails() {
|
getdeliverDetails() {
|
||||||
this.$http
|
this.$http
|
||||||
.post(`/book/buyorder/queryFMS?orderId=${this.orderID}`)
|
.post(`/book/buyOrder/queryFMS?orderId=${this.orderID}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res && res.code === 0) {
|
if (res && res.code === 0) {
|
||||||
console.log(res, '物流信息')
|
console.log(res, '物流信息')
|
||||||
@@ -587,7 +587,7 @@
|
|||||||
success: res => {
|
success: res => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
this.$http
|
this.$http
|
||||||
.post('book/buyorder/appDelete?orderId=' + this.orderContet.orderId)
|
.post('book/buyOrder/appDelete?orderId=' + this.orderContet.orderId)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ import {
|
|||||||
// 获取订单列表
|
// 获取订单列表
|
||||||
getOrderList() {
|
getOrderList() {
|
||||||
this.$http
|
this.$http
|
||||||
.post(`book/buyorder/appUserGetlist?userId=${this.userInfo.id}&orderStatus=${this.orderListTab}`)
|
.post(`book/buyOrder/getMyOrderList?userId=${this.userInfo.id}&orderStatus=${this.orderListTab}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
res.page.list.forEach((item,index) => {
|
res.page.list.forEach((item,index) => {
|
||||||
var seconds = item.timestamp + 30 * 60 + 2 // 过期时间 30分钟+2
|
var seconds = item.timestamp + 30 * 60 + 2 // 过期时间 30分钟+2
|
||||||
@@ -231,7 +231,7 @@ import {
|
|||||||
success: res => {
|
success: res => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
this.$http
|
this.$http
|
||||||
.post(`book/buyorder/appDelete?orderId=${e.orderId}`)
|
.post(`book/buyOrder/appDelete?orderId=${e.orderId}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
|
|||||||
@@ -3,25 +3,25 @@
|
|||||||
<!-- 公共组件-每个页面必须引入 -->
|
<!-- 公共组件-每个页面必须引入 -->
|
||||||
<public-module></public-module>
|
<public-module></public-module>
|
||||||
<z-nav-bar title="商品结算"></z-nav-bar>
|
<z-nav-bar title="商品结算"></z-nav-bar>
|
||||||
<view v-if="adressMoRen.username==undefined" class="addShouhuo" @click="toAddress()">
|
<view v-if="adressMoRen.consigneeName==undefined" class="addShouhuo" @click="toAddress()">
|
||||||
<u-icon name="plus" size="20" style="display: inline-block;margin-right: 10rpx;"></u-icon>
|
<u-icon name="plus" size="20" style="display: inline-block;margin-right: 10rpx;"></u-icon>
|
||||||
请添加收货地址
|
请添加收货地址
|
||||||
</view>
|
</view>
|
||||||
<view class="adDefault" @click="dizhiShow = true" v-if="adressMoRen.username!=undefined">
|
<view class="adDefault" @click="dizhiShow = true" v-if="adressMoRen.consigneeName!=undefined">
|
||||||
<view class="defalTop">
|
<view class="defalTop">
|
||||||
<text class="userName">
|
<text class="userName">
|
||||||
{{adressMoRen.username}}
|
{{adressMoRen.consigneeName}}
|
||||||
</text>
|
</text>
|
||||||
<text class="userTel">
|
<text class="userTel">
|
||||||
{{adressMoRen.userphone}}
|
{{adressMoRen.consigneePhone}}
|
||||||
</text>
|
</text>
|
||||||
<text class="userMoren" v-if="adressMoRen.isdefault==1">
|
<text class="userMoren" v-if="adressMoRen.isDefault==1">
|
||||||
默认
|
默认
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="defalBottom">
|
<view class="defalBottom">
|
||||||
<text class="userAddress">
|
<text class="userAddress">
|
||||||
{{adressMoRen.areaidpathtext}} {{adressMoRen.useraddress}}
|
{{adressMoRen.province}} {{adressMoRen.city}} {{adressMoRen.county}} {{adressMoRen.useraddress}}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -137,12 +137,12 @@
|
|||||||
<view class="addrContent">
|
<view class="addrContent">
|
||||||
<view class="addrContentTop">
|
<view class="addrContentTop">
|
||||||
<view class="userName">
|
<view class="userName">
|
||||||
{{item.username}}
|
{{item.consigneeName}}
|
||||||
</view>
|
</view>
|
||||||
<view class="userTel">
|
<view class="userTel">
|
||||||
{{item.userphone}}
|
{{item.consigneePhone}}
|
||||||
</view>
|
</view>
|
||||||
<view class="userMoren" v-if="item.isdefault==1">
|
<view class="userMoren" v-if="item.isDefault==1">
|
||||||
默认
|
默认
|
||||||
</view>
|
</view>
|
||||||
<u-icon name="checkmark-circle-fill" class="chooseCheck" size="20" color="#fd6004"
|
<u-icon name="checkmark-circle-fill" class="chooseCheck" size="20" color="#fd6004"
|
||||||
@@ -150,7 +150,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="addrContentBottom">
|
<view class="addrContentBottom">
|
||||||
<view class="userAddress">
|
<view class="userAddress">
|
||||||
{{item.areaidpathtext}} {{item.useraddress}}
|
{{item.province}} {{item.city}} {{item.county}}
|
||||||
|
{{item.useraddress}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -303,6 +304,7 @@
|
|||||||
// }
|
// }
|
||||||
this.getData()
|
this.getData()
|
||||||
this.getOS()
|
this.getOS()
|
||||||
|
this.getUserAddress()
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['userInfo']),
|
...mapState(['userInfo']),
|
||||||
@@ -347,7 +349,8 @@
|
|||||||
// 获取地址列表
|
// 获取地址列表
|
||||||
getUserAddress() {
|
getUserAddress() {
|
||||||
this.$http
|
this.$http
|
||||||
.post(`book/useraddress/getUserAddress?userId=${this.userInfo.id}`)
|
// .post(`book/useraddress/getUserAddress?userId=${this.userInfo.id}`)
|
||||||
|
.post(`book/userAddress/getUserAddress?userId=${this.userInfo.id}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
if (res.list.length != 0) {
|
if (res.list.length != 0) {
|
||||||
@@ -450,14 +453,18 @@
|
|||||||
let dataToString = ''
|
let dataToString = ''
|
||||||
// console.log(this.adressMoRen, '默认地址')
|
// console.log(this.adressMoRen, '默认地址')
|
||||||
this.cartList.forEach((item, index) => {
|
this.cartList.forEach((item, index) => {
|
||||||
key.push({productsid: item.productId, productAmount:item.productAmount})
|
key.push({productId: item.productId, quantity:item.productAmount})
|
||||||
dataToString = dataToString.concat(item.productId+"="+item.productAmount+"&")
|
// dataToString = dataToString.concat(item.productId+"="+item.productAmount+"&")
|
||||||
})
|
})
|
||||||
console.log(this.adressMoRen.areaidpath,dataToString,'this.adressMoRen.areaidpath')
|
console.log(key,'this.adressMoRen.areaidpath')
|
||||||
|
|
||||||
$http.request({
|
$http.request({
|
||||||
url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
|
url: "book/buyOrder/calculateTransportPrice/",
|
||||||
|
// url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data:{
|
data:{
|
||||||
|
'regionCode':this.adressMoRen.regionCode,
|
||||||
|
'products':key,
|
||||||
loadAnimate:'none', // 请求加载动画
|
loadAnimate:'none', // 请求加载动画
|
||||||
} ,
|
} ,
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
@@ -465,11 +472,11 @@
|
|||||||
},
|
},
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.farePrice = res.price
|
this.farePrice = res.result
|
||||||
}else{
|
}else{
|
||||||
this.farePrice = 0
|
this.farePrice = 0
|
||||||
}
|
}
|
||||||
console.log('需要的运费',res.price)
|
console.log('需要的运费',res.result)
|
||||||
this.allPrice()
|
this.allPrice()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -589,12 +596,14 @@
|
|||||||
let data = {
|
let data = {
|
||||||
buyType: this.typeId, //0- 商品页直接下单 1- 购物车结算
|
buyType: this.typeId, //0- 商品页直接下单 1- 购物车结算
|
||||||
userId: this.userInfo.id, //下单人ID
|
userId: this.userInfo.id, //下单人ID
|
||||||
shippingUser: this.adressMoRen.username, //收货人姓名
|
shippingUser: this.adressMoRen.consigneeName, //收货人姓名
|
||||||
userPhone: this.adressMoRen.userphone, //收货人手机号
|
userPhone: this.adressMoRen.consigneePhone, //收货人手机号
|
||||||
province: this.adressMoRen.areaidpathtext.split(' ')[0], //省
|
|
||||||
city: this.adressMoRen.areaidpathtext.split(' ')[1], //市
|
// province: this.adressMoRen.areaidpathtext.split(' ')[0], //省
|
||||||
district: this.adressMoRen.areaidpathtext.split(' ')[2], //区
|
// city: this.adressMoRen.areaidpathtext.split(' ')[1], //市
|
||||||
address: this.adressMoRen.useraddress, //地址
|
// district: this.adressMoRen.areaidpathtext.split(' ')[2], //区
|
||||||
|
//address: this.adressMoRen.useraddress, //地址
|
||||||
|
|
||||||
paymentMethod: this.payType, //支付方式 2支付宝,1微信,3ios内购 4,天医币购买
|
paymentMethod: this.payType, //支付方式 2支付宝,1微信,3ios内购 4,天医币购买
|
||||||
orderMoney: this.totalPrice, //订单金额
|
orderMoney: this.totalPrice, //订单金额
|
||||||
realMoney: this.realPrice, //实收金额
|
realMoney: this.realPrice, //实收金额
|
||||||
@@ -606,11 +615,11 @@
|
|||||||
orderStatus: 0, //订单状态
|
orderStatus: 0, //订单状态
|
||||||
products: xiaBiao, //订单列表
|
products: xiaBiao, //订单列表
|
||||||
orderType: "order", //订单类型
|
orderType: "order", //订单类型
|
||||||
addressId:this.adressMoRen.addressid // 地址ID
|
addressId:this.adressMoRen.id // 地址ID
|
||||||
}
|
}
|
||||||
$http.request({
|
$http.request({
|
||||||
// url: "book/buyorder/save",
|
// url: "book/buyorder/save",
|
||||||
url: "book/buyorder/buySave",
|
url: "book/buyOrder/buySave",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data,
|
data,
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
|
|||||||
@@ -473,7 +473,7 @@
|
|||||||
})
|
})
|
||||||
console.log(this.adressMoRen.areaidpath,dataToString,'this.adressMoRen.areaidpath')
|
console.log(this.adressMoRen.areaidpath,dataToString,'this.adressMoRen.areaidpath')
|
||||||
$http.request({
|
$http.request({
|
||||||
url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
|
url: "book/buyOrder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data:{
|
data:{
|
||||||
loadAnimate:'none', // 请求加载动画
|
loadAnimate:'none', // 请求加载动画
|
||||||
@@ -627,7 +627,7 @@
|
|||||||
}
|
}
|
||||||
$http.request({
|
$http.request({
|
||||||
// url: "book/buyorder/save",
|
// url: "book/buyorder/save",
|
||||||
url: "book/buyorder/buysave",
|
url: "book/buyOrder/buysave",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data,
|
data,
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
|
|||||||
@@ -727,11 +727,20 @@
|
|||||||
// 说点什么
|
// 说点什么
|
||||||
goToSign() {
|
goToSign() {
|
||||||
// images数据处理
|
// images数据处理
|
||||||
|
if(this.formData.images.length > 0){
|
||||||
var imgs = []
|
var imgs = []
|
||||||
imgs = this.formData.images.map(item => {
|
imgs = this.formData.images.map(item => {
|
||||||
return item.url
|
return item.url
|
||||||
|
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
if(this.formData.content == ''){
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入内容',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
let data = {
|
let data = {
|
||||||
// 'bookId': this.bookid,
|
// 'bookId': this.bookid,
|
||||||
"userId": this.userInfo.id,
|
"userId": this.userInfo.id,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<text class="name" v-if="userMes.nickname!=null">{{userMes.nickname}}</text>
|
<text class="name" v-if="userMes.nickname!=null">{{userMes.nickname}}</text>
|
||||||
<text class="name" v-if="userMes.nickname==null">未设置</text>
|
<text class="name" v-if="userMes.nickname==null">未设置</text>
|
||||||
<image v-if="userMes.vip==1" src="../../static/icon/mine_v.png" alt="" class="per_user_img"></image>
|
<!-- <image v-if="userMes.vip==1" src="../../static/icon/mine_v.png" alt="" class="per_user_img"></image> -->
|
||||||
<text style="margin-left: 20rpx;font-size: 22rpx;color: #888;">({{userMes.tel}})</text>
|
<text style="margin-left: 20rpx;font-size: 22rpx;color: #888;">({{userMes.tel}})</text>
|
||||||
|
|
||||||
<!-- <text class="tong">累计读书5本
|
<!-- <text class="tong">累计读书5本
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
<!-- <view class="nav_list" @click="onGoing()">
|
<!-- <view class="nav_list" @click="onGoing()">
|
||||||
<text>帮助与反馈11111</text>
|
<text>帮助与反馈11111</text>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="nav_list" @click="newOnShare">
|
<view class="nav_list" @click="newOnShare" v-if="isAndorid">
|
||||||
<text>分享App</text>
|
<text>分享App</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="nav_list" @click="onPageJump('../peanut/aboutUs')">
|
<view class="nav_list" @click="onPageJump('../peanut/aboutUs')">
|
||||||
@@ -131,13 +131,15 @@
|
|||||||
userMes: {},
|
userMes: {},
|
||||||
signShow: false,
|
signShow: false,
|
||||||
signContent: '是否要退出登录?',
|
signContent: '是否要退出登录?',
|
||||||
playData:{}
|
playData:{},
|
||||||
|
isAndorid:true,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
//第一次加载
|
//第一次加载
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
// 隐藏原生的tabbar
|
// 隐藏原生的tabbar
|
||||||
uni.hideTabBar();
|
uni.hideTabBar();
|
||||||
|
this.getOS()
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['userInfo'])
|
...mapState(['userInfo'])
|
||||||
@@ -153,6 +155,17 @@
|
|||||||
},
|
},
|
||||||
//方法
|
//方法
|
||||||
methods: {
|
methods: {
|
||||||
|
// 获得操作系统
|
||||||
|
getOS(){
|
||||||
|
let oprateOs = ''
|
||||||
|
oprateOs = uni.getSystemInfoSync().platform
|
||||||
|
// console.log(oprateOs)
|
||||||
|
if(oprateOs == 'android'){
|
||||||
|
this.isAndorid = true
|
||||||
|
}else{
|
||||||
|
this.isAndorid = false
|
||||||
|
}
|
||||||
|
},
|
||||||
haveSelected(data){
|
haveSelected(data){
|
||||||
console.log(data,' 选择的是')
|
console.log(data,' 选择的是')
|
||||||
if(data.index == 0){
|
if(data.index == 0){
|
||||||
|
|||||||
@@ -288,7 +288,7 @@
|
|||||||
orderType: "vip", //订单类型
|
orderType: "vip", //订单类型
|
||||||
}
|
}
|
||||||
$http.request({
|
$http.request({
|
||||||
url: "book/buyorder/rechargeSave",
|
url: "book/buyOrder/rechargeSave",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data,
|
data,
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
|
|||||||
@@ -401,7 +401,7 @@
|
|||||||
productId: that.stepsCj.priceTypeId // 充值的类型id
|
productId: that.stepsCj.priceTypeId // 充值的类型id
|
||||||
}
|
}
|
||||||
$http.request({
|
$http.request({
|
||||||
url: "book/buyorder/rechargeSave",
|
url: "book/buyOrder/rechargeSave",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data,
|
data,
|
||||||
header: { //默认 无 说明:请求头1
|
header: { //默认 无 说明:请求头1
|
||||||
|
|||||||
@@ -359,7 +359,7 @@
|
|||||||
orderType: "point", //订单类型
|
orderType: "point", //订单类型
|
||||||
}
|
}
|
||||||
$http.request({
|
$http.request({
|
||||||
url: "book/buyorder/rechargeSave",
|
url: "book/buyOrder/rechargeSave",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data,
|
data,
|
||||||
header: { //默认 无 说明:请求头1
|
header: { //默认 无 说明:请求头1
|
||||||
|
|||||||
@@ -270,7 +270,7 @@
|
|||||||
this.addressForm.areaidpathtext = e.value[0].UName + ' ' + e.value[1].UName + ' ' + e.value[2].UName
|
this.addressForm.areaidpathtext = e.value[0].UName + ' ' + e.value[1].UName + ' ' + e.value[2].UName
|
||||||
this.provId = e.value[0].provId
|
this.provId = e.value[0].provId
|
||||||
this.cityId = e.value[1].cityId
|
this.cityId = e.value[1].cityId
|
||||||
this.countyId = e.value[2].countyId
|
this.countyId = e.value[2].regionCode
|
||||||
},
|
},
|
||||||
|
|
||||||
addcancel() { //点击取消按钮
|
addcancel() { //点击取消按钮
|
||||||
@@ -284,9 +284,9 @@
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
let link_add = ''
|
let link_add = ''
|
||||||
if (!this.isShowDel) {
|
if (!this.isShowDel) {
|
||||||
link_add = 'book/useraddress/save'
|
link_add = 'book/userAddress/save'
|
||||||
} else {
|
} else {
|
||||||
link_add = 'book/useraddress/update'
|
link_add = 'book/userAddress/update'
|
||||||
// this.addconfirm(e)
|
// this.addconfirm(e)
|
||||||
}
|
}
|
||||||
if (this.addressForm.areaidpath == '') {
|
if (this.addressForm.areaidpath == '') {
|
||||||
@@ -296,15 +296,30 @@
|
|||||||
});
|
});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.addressForm.userid = this.userInfo.id
|
// this.addressForm.userId = this.userInfo.id
|
||||||
if(this.addressChanged){ // 如果修改过地址区域,就重新赋值,否则保持不变
|
// this.addressForm.consigneePhone = this.addressForm.userphone
|
||||||
this.addressForm.areaidpath = `${this.provId}_${this.cityId}_${this.countyId}`
|
// this.addressForm.consigneeName = this.addressForm.username
|
||||||
this.addressChanged = false
|
// this.addressForm.regionCode = ''
|
||||||
}
|
|
||||||
this.addressForm.areaid = this.countyId
|
|
||||||
this.addressForm.isdefault = this.addressForm.isDafault ? 1 : 0
|
|
||||||
|
|
||||||
let data = this.addressForm
|
// // this.addressForm.userid = this.userInfo.id
|
||||||
|
// if(this.addressChanged){ // 如果修改过地址区域,就重新赋值,否则保持不变
|
||||||
|
// this.addressForm.areaidpath = `${this.provId}_${this.cityId}_${this.countyId}`
|
||||||
|
// this.addressChanged = false
|
||||||
|
// }
|
||||||
|
// this.addressForm.areaid = this.countyId
|
||||||
|
// this.addressForm.isDefault = this.addressForm.isDafault ? 1 : 0
|
||||||
|
|
||||||
|
// let data = this.addressForm
|
||||||
|
let data = {
|
||||||
|
'id':this.addressForm.addressid,
|
||||||
|
'detailAddress' : this.addressForm.useraddress,
|
||||||
|
'regionCode':this.countyId,
|
||||||
|
'userId':this.userInfo.id,
|
||||||
|
'consigneePhone':this.addressForm.userphone,
|
||||||
|
'consigneeName': this.addressForm.username,
|
||||||
|
'isDefault':this.addressForm.isDafault ? 1 : 0
|
||||||
|
}
|
||||||
|
console.log(data,'保存参数')
|
||||||
$http.request({
|
$http.request({
|
||||||
url: link_add,
|
url: link_add,
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
@@ -315,7 +330,7 @@
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '地址添加成功',
|
title: '操作成功',
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
});
|
});
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
@@ -334,17 +349,28 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
changeSwitch(e) {
|
changeSwitch(e) {
|
||||||
|
e ? this.addressForm.isdefault = 1 : this.addressForm.isdefault = 0
|
||||||
this.addressForm.isDafault = e
|
this.addressForm.isDafault = e
|
||||||
console.log(this.addressForm)
|
console.log(this.addressForm, e)
|
||||||
},
|
},
|
||||||
|
|
||||||
// 编辑地址获取信息
|
// 编辑地址获取信息
|
||||||
getAddress() {
|
getAddress() {
|
||||||
this.$http
|
this.$http
|
||||||
.post(`book/useraddress/getUserAddress?userId=${this.userInfo.id}`)
|
.post(`book/userAddress/getUserAddress?userId=${this.userInfo.id}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.addressForm = res.list[this.editIndex]
|
this.addressForm = {
|
||||||
|
'useraddress':res.list[this.editIndex].detailAddress,
|
||||||
|
'userphone':res.list[this.editIndex].consigneePhone,
|
||||||
|
'username':res.list[this.editIndex].consigneeName,
|
||||||
|
'isdefault':res.list[this.editIndex].isDefault,
|
||||||
|
'isDafault':res.list[this.editIndex].isDefault == 1 ? true : false,
|
||||||
|
'areaidpathtext':res.list[this.editIndex].province + res.list[this.editIndex].city + res.list[this.editIndex].county
|
||||||
|
,'addressid':res.list[this.editIndex].id
|
||||||
|
}
|
||||||
|
this.countyId = res.list[this.editIndex].regionCode
|
||||||
|
// this.addressForm = res.list[this.editIndex]
|
||||||
if (this.addressForm.isdefault == 1) {
|
if (this.addressForm.isdefault == 1) {
|
||||||
this.addressForm.isDafault = true
|
this.addressForm.isDafault = true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,18 +10,19 @@
|
|||||||
<view class="addrContent">
|
<view class="addrContent">
|
||||||
<view class="addrContentTop">
|
<view class="addrContentTop">
|
||||||
<view class="userName">
|
<view class="userName">
|
||||||
{{item.username}}
|
{{item.consigneeName}}
|
||||||
</view>
|
</view>
|
||||||
<view class="userTel">
|
<view class="userTel">
|
||||||
{{item.userphone}}
|
{{item.consigneePhone}}
|
||||||
</view>
|
</view>
|
||||||
<view class="userMoren" v-if="item.isdefault==1">
|
<view class="userMoren" v-if="item.isDefault==1">
|
||||||
默认
|
默认
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="addrContentBottom">
|
<view class="addrContentBottom">
|
||||||
<view class="userAddress">
|
<view class="userAddress">
|
||||||
{{item.areaidpathtext}} {{item.useraddress}}
|
{{item.province}} {{item.city}} {{item.county}}
|
||||||
|
{{item.detailAddress}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -63,7 +64,8 @@
|
|||||||
methods: {
|
methods: {
|
||||||
getUserAddress() {
|
getUserAddress() {
|
||||||
this.$http
|
this.$http
|
||||||
.post(`book/useraddress/getUserAddress?userId=${this.userInfo.id}`)
|
.post(`book/userAddress/getUserAddress?userId=${this.userInfo.id}`)
|
||||||
|
// .post(`book/useraddress/getUserAddress?userId=${this.userInfo.id}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.addressList = res.list
|
this.addressList = res.list
|
||||||
|
|||||||
Reference in New Issue
Block a user