|
|
|
@ -23,7 +23,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="getSelf"> |
|
|
|
|
<view class="shopAddress"> |
|
|
|
|
<view class="shopAddress" v-if="buyType=='zq'"> |
|
|
|
|
<view class="youTime"> |
|
|
|
|
花梨服务站 |
|
|
|
|
</view> |
|
|
|
@ -33,9 +33,9 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="addressDetail"> |
|
|
|
|
{{addressInfo.name}} |
|
|
|
|
{{addressInfo.name}} {{addressInfo.region.province +addressInfo.region.city+addressInfo.region.region}} |
|
|
|
|
</view> |
|
|
|
|
<view class="lookMap"> |
|
|
|
|
<view class="lookMap" v-if="buyType=='zq'"> |
|
|
|
|
<image src="/static/user/address.png" mode="" class="addressIcon"></image> |
|
|
|
|
<view class="range"> |
|
|
|
|
距您16.39km |
|
|
|
@ -94,7 +94,7 @@ |
|
|
|
|
<switch /> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="time"> |
|
|
|
|
<!-- <view class="time"> |
|
|
|
|
<view class="youTime"> |
|
|
|
|
预计到货时间 |
|
|
|
|
</view> |
|
|
|
@ -103,8 +103,8 @@ |
|
|
|
|
|
|
|
|
|
<image src="/static/order/left.png" mode=""></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="time"> |
|
|
|
|
</view> --> |
|
|
|
|
<!-- <view class="time"> |
|
|
|
|
<view class="youTime"> |
|
|
|
|
您期待的收货时间 |
|
|
|
|
</view> |
|
|
|
@ -112,7 +112,7 @@ |
|
|
|
|
请选择 |
|
|
|
|
<image src="/static/order/left.png" mode=""></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> --> |
|
|
|
|
<view class="goodsDetail"> |
|
|
|
|
<view class="goodsType"> |
|
|
|
|
<image src="/static/order/bag.png" mode="" class="bag"></image> |
|
|
|
@ -121,14 +121,14 @@ |
|
|
|
|
</view> |
|
|
|
|
<view class="goods"> |
|
|
|
|
<view class="goodsImg"> |
|
|
|
|
<image src="/static/home/goodsDemo.png" mode=""></image> |
|
|
|
|
<image :src="goodsInfo.goods_image" mode=""></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="goodsInfo"> |
|
|
|
|
<view class="goodsName"> |
|
|
|
|
iphone13 绿色 128GB |
|
|
|
|
{{goodsInfo.goods_name}} |
|
|
|
|
</view> |
|
|
|
|
<view class="goodsPrice"> |
|
|
|
|
¥ <text>7599</text> |
|
|
|
|
¥ <text>{{goodsInfo.goods_price_min}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="goodsNum"> |
|
|
|
@ -137,13 +137,11 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="time"> |
|
|
|
|
<view class="youTime"> |
|
|
|
|
<view class="youTime" style="width: 60rpx;"> |
|
|
|
|
留言 |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
<view class="leftImg"> |
|
|
|
|
建议留言前与客服沟通确认 |
|
|
|
|
<image src="/static/order/left.png" mode=""></image> |
|
|
|
|
</view> |
|
|
|
|
<input type="textarea" placeholder="建议留言前先和店家沟通" v-model="remark" style="width:100%;" maxlength="100" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="orderTips"> |
|
|
|
|
<view class="orderTitle"> |
|
|
|
@ -151,7 +149,7 @@ |
|
|
|
|
商品总额 |
|
|
|
|
</view> |
|
|
|
|
<view class="price"> |
|
|
|
|
¥7599 |
|
|
|
|
¥{{goodsInfo.goods_price_min}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="orderTitle"> |
|
|
|
@ -159,7 +157,7 @@ |
|
|
|
|
运费 |
|
|
|
|
</view> |
|
|
|
|
<view class="price"> |
|
|
|
|
¥7599 |
|
|
|
|
¥{{goodsInfo.goods_price_min}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="orderTitle"> |
|
|
|
@ -174,8 +172,8 @@ |
|
|
|
|
<view class="total"> |
|
|
|
|
优惠券 |
|
|
|
|
</view> |
|
|
|
|
<view class="price"> |
|
|
|
|
<text class="couponNum">0张可用</text> |
|
|
|
|
<view class="price" @click="choseCoupon"> |
|
|
|
|
<text class="couponNum">{{couponList.length}}张可用</text> |
|
|
|
|
<image src="/static/order/left.png" mode=""></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -188,7 +186,7 @@ |
|
|
|
|
</view> |
|
|
|
|
<view class="right"> |
|
|
|
|
<text class="totalNum">共1件,合计:</text> |
|
|
|
|
<text class="allPrice">¥7664</text> |
|
|
|
|
<text class="allPrice">¥{{goodsInfo.goods_price_min}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -204,30 +202,32 @@ |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
<view class="itemType"> |
|
|
|
|
<view class="payName"> |
|
|
|
|
<image src="/static/order/friends.png" mode="" class="payIcon"></image> |
|
|
|
|
找微信好友代付 |
|
|
|
|
<view class="" v-for="(item,index) in payMethList" :key="index" @click="chosePayType(item)"> |
|
|
|
|
<view class="payName"> |
|
|
|
|
<image src="/static/order/friends.png" mode="" class="payIcon"></image> |
|
|
|
|
余额支付 |
|
|
|
|
</view> |
|
|
|
|
<image src="/static/order/right.png" mode="" class="chose" v-if="payType==item.method"></image> |
|
|
|
|
</view> |
|
|
|
|
<!-- <image src="/static/order/right.png" mode="" class="chose"></image> --> |
|
|
|
|
</view> |
|
|
|
|
<view class="line"> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
<view class="itemType"> |
|
|
|
|
<!-- <view class="itemType"> |
|
|
|
|
<view class="payName"> |
|
|
|
|
<image src="/static/order/shop.png" mode="" class="payIcon"></image> |
|
|
|
|
到店支付 |
|
|
|
|
</view> |
|
|
|
|
<!-- <image src="/static/order/right.png" mode="" class="chose"></image> --> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
</view> --> |
|
|
|
|
</view> |
|
|
|
|
<view class="footer"> |
|
|
|
|
<view class="meetPrice"> |
|
|
|
|
应付款 |
|
|
|
|
<text class="type">¥</text> |
|
|
|
|
<text class="price">7640</text> |
|
|
|
|
<text class="price">{{goodsInfo.goods_price_min}}</text> |
|
|
|
|
</view> |
|
|
|
|
<view class="btn" @click="orderSubmit"> |
|
|
|
|
<view class="btn" @click="orderPay"> |
|
|
|
|
提交订单 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -239,9 +239,16 @@ |
|
|
|
|
import img from "@/static/member/head.png" |
|
|
|
|
import * as storeShop from '@/api/shop.js' |
|
|
|
|
import * as address from '@/api/address.js' |
|
|
|
|
import * as cashier from '@/api/cashier/index.js' |
|
|
|
|
import * as CouponApi from '@/api/coupon' |
|
|
|
|
import { |
|
|
|
|
Wechat |
|
|
|
|
} from '@/core/payment' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
remark: '', |
|
|
|
|
payType: 'weChat', |
|
|
|
|
buyType: 'sm', |
|
|
|
|
background: { |
|
|
|
|
background: 'url(' + img + ') center top no-repeat', |
|
|
|
@ -250,31 +257,61 @@ |
|
|
|
|
goodsInfo: {}, |
|
|
|
|
shopInfo: {}, |
|
|
|
|
addressList: [], |
|
|
|
|
addressInfo: {} |
|
|
|
|
addressInfo: {}, |
|
|
|
|
payMethList: [], |
|
|
|
|
orderID: '', |
|
|
|
|
couponList: [], |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(options) { |
|
|
|
|
if (options.goodsInfo) { |
|
|
|
|
this.goodsInfo = JSON.parse(options.goodsInfo) |
|
|
|
|
} |
|
|
|
|
console.log(options, 'kkkkkk') |
|
|
|
|
// if (options.goodsInfo) { |
|
|
|
|
let goodsInfo = options.goodsID; |
|
|
|
|
console.log(goodsInfo, '5555555', typeof(goodsInfo)); |
|
|
|
|
this.goodsInfo = JSON.parse(decodeURIComponent(goodsInfo)) |
|
|
|
|
console.log(this.goodsInfo, '666666'); |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
this.getGoodsInfo() |
|
|
|
|
this.getShopInfo() |
|
|
|
|
this.getAddressList(); |
|
|
|
|
this.orderSubmit() |
|
|
|
|
this.getCoupon() |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getCoupon() { |
|
|
|
|
const that =this |
|
|
|
|
let param = { |
|
|
|
|
dataType:'isUsable' |
|
|
|
|
} |
|
|
|
|
CouponApi.myCouponList(param) |
|
|
|
|
.then(res => { |
|
|
|
|
that.couponList = res.data.list.data |
|
|
|
|
}) |
|
|
|
|
.finally() |
|
|
|
|
}, |
|
|
|
|
choseCoupon() { |
|
|
|
|
// 选择优惠券 |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/news/coupon/list?chose=true', |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
chosePayType(item) { |
|
|
|
|
this.payType = item.method |
|
|
|
|
}, |
|
|
|
|
choseType(val) { |
|
|
|
|
this.buyType = val |
|
|
|
|
}, |
|
|
|
|
getDefaultAddress() { |
|
|
|
|
const that = this |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
address.defaultId().then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
if (res.status == 200) { |
|
|
|
|
for (var i = 0; i < that.addressList.length; i++) { |
|
|
|
|
if (res.data.defaultId == that.addressList[i].address_id) { |
|
|
|
|
that.addressInfo = that.addressList[i] |
|
|
|
|
that.getOrderInfo() |
|
|
|
|
console.log(that.addressInfo, '获取收货地址') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -282,23 +319,11 @@ |
|
|
|
|
.catch() |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getOrderInfo() { |
|
|
|
|
const that = this |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
address.list().then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
that.addressList = res.data.list |
|
|
|
|
that.getDefaultAddress() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch() |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getAddressList() { |
|
|
|
|
const that = this |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
address.list().then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
if (res.status == 200) { |
|
|
|
|
that.addressList = res.data.list |
|
|
|
|
that.getDefaultAddress() |
|
|
|
|
} |
|
|
|
@ -306,7 +331,7 @@ |
|
|
|
|
.catch() |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getGoodsInfo() { |
|
|
|
|
getShopInfo() { |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
storeShop.list().then(res => { |
|
|
|
|
console.log(res, '获取店铺信息') |
|
|
|
@ -316,25 +341,131 @@ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
orderSubmit() { |
|
|
|
|
const that = this |
|
|
|
|
const that = this; |
|
|
|
|
console.log(that.goodsInfo, '55555') |
|
|
|
|
let params = { |
|
|
|
|
mode: '结算模式', |
|
|
|
|
delivery: '配送方式(10快递配送 20上门自提', |
|
|
|
|
mode: 'buyNow', |
|
|
|
|
delivery: '10', |
|
|
|
|
couponId: '', |
|
|
|
|
isUsePoints: 0, |
|
|
|
|
remark: '留言', |
|
|
|
|
remark: that.remark, |
|
|
|
|
shopId: '', |
|
|
|
|
linkman: '姓名', |
|
|
|
|
phone: '手机哈', |
|
|
|
|
goodsId: '商品id', |
|
|
|
|
linkman: '', |
|
|
|
|
phone: '', |
|
|
|
|
goodsId: that.goodsInfo.goods_id, |
|
|
|
|
goodsNum: 1, |
|
|
|
|
goodsSkuId: '', |
|
|
|
|
goodsSkuId: that.goodsInfo.skuList[0].goods_sku_id, |
|
|
|
|
cartIds: '' |
|
|
|
|
} |
|
|
|
|
order.submit(params) |
|
|
|
|
order.submit('buyNow', params) |
|
|
|
|
.then(res => { |
|
|
|
|
if (res.status == 200) { |
|
|
|
|
that.orderId = res.data.orderId |
|
|
|
|
that.getOrderInfoPay(res.data.orderId) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch() |
|
|
|
|
}, |
|
|
|
|
getOrderInfoPay(val) { |
|
|
|
|
cashier.orderInfo(val).then(res => { |
|
|
|
|
if (res.status == 200) { |
|
|
|
|
this.payMethList = res.data.paymentMethods |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch() |
|
|
|
|
}, |
|
|
|
|
onShowSuccess(res) { |
|
|
|
|
this.$toast(message || '订单支付成功') |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/news/recycling/orderList' |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
orderPay() { |
|
|
|
|
const that = this |
|
|
|
|
if (that.payType == 'balance') { |
|
|
|
|
that.payBanlance() |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
cashier.orderPay(that.orderID).then(res => { |
|
|
|
|
if (res.status == 200) { |
|
|
|
|
|
|
|
|
|
let paymentData = res.data.payment |
|
|
|
|
Wechat.payment({ |
|
|
|
|
orderKey: res.data.payment.out_trade_no, |
|
|
|
|
...paymentData |
|
|
|
|
}) |
|
|
|
|
.then((result) => { |
|
|
|
|
console.log(result) |
|
|
|
|
that.onShowSuccess(result) |
|
|
|
|
}) |
|
|
|
|
.catch(err => { |
|
|
|
|
console.log(err) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch() |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
payBanlance() { |
|
|
|
|
const that = this |
|
|
|
|
let params = { |
|
|
|
|
extra: {}, |
|
|
|
|
method: 'balance', |
|
|
|
|
client: 'weChat' |
|
|
|
|
} |
|
|
|
|
cashier.orderPay(that.orderID, params).then(res => { |
|
|
|
|
that.$toast(res.message) |
|
|
|
|
if (res.status == 200) { |
|
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/news/recycling/orderList' |
|
|
|
|
}) |
|
|
|
|
}, 1000) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch() |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// getOrderInfo() { |
|
|
|
|
// const that = this |
|
|
|
|
// let params = { |
|
|
|
|
// orderId: 10202, |
|
|
|
|
// client: 'wechat' |
|
|
|
|
// } |
|
|
|
|
// cashier.orderInfo(params) |
|
|
|
|
// .then(res => { |
|
|
|
|
// if (res.status == 200) { |
|
|
|
|
// that.payOrderInfo() |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// .catch() |
|
|
|
|
// }, |
|
|
|
|
payOrderInfo() { |
|
|
|
|
const that = this |
|
|
|
|
let form = { |
|
|
|
|
client: 'wechat', |
|
|
|
|
method: 'wechat', |
|
|
|
|
extra: {} |
|
|
|
|
} |
|
|
|
|
cashier.orderInfo(10202, form) |
|
|
|
|
.then(res => { |
|
|
|
|
if (res.status == 200) { |
|
|
|
|
// that.$toast(res.message) |
|
|
|
|
|
|
|
|
|
let paymentData = res.data.payment |
|
|
|
|
Wechat.payment({ |
|
|
|
|
orderKey: res.data.payment.out_trade_no, |
|
|
|
|
...paymentData |
|
|
|
|
}) |
|
|
|
|
.then((result) => { |
|
|
|
|
console.log(result) |
|
|
|
|
}) |
|
|
|
|
.catch(err => { |
|
|
|
|
console.log(err) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch() |
|
|
|
@ -607,7 +738,7 @@ |
|
|
|
|
|
|
|
|
|
.goodsDetail { |
|
|
|
|
width: 694rpx; |
|
|
|
|
height: 266rpx; |
|
|
|
|
min-height: 266rpx; |
|
|
|
|
background: #FFFFFF; |
|
|
|
|
border-radius: 10rpx 10rpx 10rpx 10rpx; |
|
|
|
|
opacity: 1; |
|
|
|
@ -656,7 +787,7 @@ |
|
|
|
|
margin-left: 20rpx; |
|
|
|
|
|
|
|
|
|
.goodsName { |
|
|
|
|
height: 40rpx; |
|
|
|
|
min-height: 40rpx; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
font-family: PingFang SC, PingFang SC; |
|
|
|
|
font-weight: 400; |
|
|
|
|