|
|
@@ -48,13 +48,13 @@
|
|
|
<text style="color: #666666;">规格</text>
|
|
|
<ImageItem v-if="selectedObj" class="imgClass" :src="$globalData.publicUrl + selectedObj.image" />
|
|
|
</view>
|
|
|
- <view style="display: flex;align-items: center;position: relative;">
|
|
|
- <text v-if="selectedObj" style="color: #666666;margin-right: 30rpx;">已选:{{
|
|
|
- selectedObj.specValueText }}</text>
|
|
|
- <text v-else style="color: #999;margin-right: 30rpx;">选择商品</text>
|
|
|
- <span style="position: absolute;right: 0;top: -3rpx;">
|
|
|
- <image style="width: 35rpx;height: 35rpx;" @click="selectProductShowFun"
|
|
|
- src="@/static/points/Keyboard_arrow_rifht.png" mode=""></image>
|
|
|
+ <view style="display: flex;align-items: center;position: relative;" @click="selectProductShowFun">
|
|
|
+ <text v-if="selectedObj" style="color: #666666;margin-right: 35rpx;">
|
|
|
+ 已选:{{ selectedObj.specValueText }}</text>
|
|
|
+ <text v-else style="color: #999;margin-right: 35rpx;">选择商品</text>
|
|
|
+ <span style="position: absolute;right: 0;top: -5rpx;">
|
|
|
+ <image style="width: 35rpx;height: 35rpx;" src="@/static/points/Keyboard_arrow_rifht.png" mode="">
|
|
|
+ </image>
|
|
|
</span>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -62,19 +62,23 @@
|
|
|
</view>
|
|
|
<view class="arriveAddressClass">
|
|
|
<text style="color: #666666;margin-right: 24rpx;">送至</text>
|
|
|
- <text v-if="defaultAddress"
|
|
|
- style="width: 520rpx;white-space:nowrap;overflow: hidden;text-overflow: ellipsis;">
|
|
|
- {{ defaultAddress.address + defaultAddress.atlasAdd }}</text>
|
|
|
- <text v-else style="color: #999;position: absolute;right: 30rpx;">添加收货地址</text>
|
|
|
- <span style="position: absolute;right: 0;top: -3rpx;">
|
|
|
- <image style="width: 35rpx;height: 35rpx;" @click="addressSelectFun"
|
|
|
- src="@/static/points/Keyboard_arrow_rifht.png" mode=""></image>
|
|
|
- </span>
|
|
|
+ <view style="width: 80%; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;" @click="addressSelectFun">
|
|
|
+ <text v-if="defaultAddress">
|
|
|
+ {{ defaultAddress.address + defaultAddress.atlasAdd }}</text>
|
|
|
+
|
|
|
+ <text v-else style="color: #999;position: absolute;right: 35rpx;top:0">添加收货地址</text>
|
|
|
+ <span style="position: absolute;right: 0;top: -5rpx;">
|
|
|
+ <image style="width: 35rpx;height: 35rpx;"
|
|
|
+ src="@/static/points/Keyboard_arrow_rifht.png" mode=""></image>
|
|
|
+ </span>
|
|
|
+ </view>
|
|
|
+
|
|
|
</view>
|
|
|
<view class="seedAddressClass">
|
|
|
<text style="color: #666666;margin-right: 24rpx;">发货</text>
|
|
|
- <text>山西省太原市小店区
|
|
|
- <text v-if="params.freight!=undefined"> | {{ params.freight == 0 ? '免运费' : '运费' + params.freight + '元' }}</text>
|
|
|
+ <text>山西省太原市小店区
|
|
|
+ <text v-if="params.freight != undefined"> | {{ params.freight == 0 ? '免运费' : '运费' + params.freight + '元'
|
|
|
+ }}</text>
|
|
|
</text>
|
|
|
</view>
|
|
|
<view class="promiseSeedTime" style="margin-left: 80rpx;">
|
|
|
@@ -126,7 +130,7 @@
|
|
|
<u-button :disabled="redeemNowBtnDisable" v-if="selectedObj ? selectedObj.stock : params.stock" :customStyle="{
|
|
|
color: '#fff',
|
|
|
background: '#03C1B8'
|
|
|
- }" @click="redeemNowFun">{{ redeemNowBtnDisable ? '支付中...' : '立即兑换' }}</u-button>
|
|
|
+ }" @click="selectProductShowFun">{{ redeemNowBtnDisable ? '支付中...' : '立即兑换' }}</u-button>
|
|
|
<u-button v-else :customStyle="{
|
|
|
color: '#999999 ',
|
|
|
background: '#eee'
|
|
|
@@ -190,21 +194,31 @@ export default {
|
|
|
dBalance: 0.00,
|
|
|
wxconfig: {},
|
|
|
orderNo: null,
|
|
|
+ isGetAddrListFunLoaded:false,
|
|
|
|
|
|
|
|
|
}
|
|
|
},
|
|
|
onLoad(data) {
|
|
|
- console.log(data, '66666')
|
|
|
+ console.log(data, 'onLoad66666')
|
|
|
+ if(data.selectedAddressId)this.selectedAddressId=data.selectedAddressId
|
|
|
if (data.id) {
|
|
|
this.productGetByIdFun(data.id)
|
|
|
this.getAddrListFun()
|
|
|
+ this.isGetAddrListFunLoaded=true
|
|
|
this.getinfo()
|
|
|
}
|
|
|
|
|
|
},
|
|
|
- onShow() {
|
|
|
- this.getAddrListFun()
|
|
|
+ onShow(onShow) {
|
|
|
+ console.log(onShow, this.isGetAddrListFunLoaded,'onShow55555')
|
|
|
+ if(!this.isGetAddrListFunLoaded){
|
|
|
+ this.getAddrListFun()
|
|
|
+ }else{
|
|
|
+ this.isGetAddrListFunLoaded=false
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
onPageScroll(e) {
|
|
|
//console.log("滚动距离为:" + e.scrollTop);
|
|
|
@@ -251,8 +265,6 @@ export default {
|
|
|
} else {
|
|
|
this.defaultAddress = res.data.data[0]
|
|
|
}
|
|
|
- console.log(this.selectedAddressId, 'this.selectedAddressId99999999999')
|
|
|
- console.log(this.defaultAddress, 'this.defaultAddress9999999999')
|
|
|
return
|
|
|
} else if (!this.selectedAddressId || !this.defaultAddress) {
|
|
|
let flag = res.data.data.some(item => {
|
|
|
@@ -301,7 +313,6 @@ export default {
|
|
|
if (selectPayMeth) this.selectPayMeth = selectPayMeth
|
|
|
if (orderRemarks) this.orderRemarks = orderRemarks
|
|
|
|
|
|
- console.log(this.selectedObj, 'this.selectedObj')
|
|
|
if (!this.defaultAddress) {
|
|
|
uni.showToast({
|
|
|
title: '请选择添加地址',
|
|
|
@@ -309,52 +320,48 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
+ if (this.selectPayMeth == null && (params.paymentType !== 1 || this.params.freight > 0)) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请选择支付方式',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
- if (this.selectedObj) {
|
|
|
- if (this.selectPayMeth == null && (params.paymentType !== 1 || this.params.freight>0)) {
|
|
|
- uni.showToast({
|
|
|
- title: '请选择支付方式',
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- this.redeemNowBtnDisable = redeemNowBtnDisable ? redeemNowBtnDisable : true
|
|
|
- let params = {}
|
|
|
- //params.openId = uni.getStorageSync('wx_copenid');//用户openId
|
|
|
- params.userPhone = this.defaultAddress.phone;//用户手机号
|
|
|
- params.userName = this.defaultAddress.userName;//用户名
|
|
|
- params.userAddress = this.defaultAddress.address + this.defaultAddress.atlasAdd;//地图地址+详细地址
|
|
|
- params.addressId = this.defaultAddress.id;//地址ID
|
|
|
- params.productId = this.params.id;
|
|
|
- params.name = this.params.name;
|
|
|
- params.productMainImage = this.params.productMainImage;
|
|
|
- params.skuId = this.selectedObj.skuId; //选中的SKU ID
|
|
|
- params.specNameValueLis = this.selectedObj.specNameValueList; // SKU列表(规格组合明细)
|
|
|
- params.quantity = 1; //购买数量
|
|
|
- params.payType = this.params.paymentType == 1 ? 3 : Number(this.selectPayMeth);//支付方式:1微信支付 2账户余额
|
|
|
- params.freightAmount = this.params.freight; //运费
|
|
|
- params.totalAmount = (this.selectedObj.priceMoney + (this.params.freight > 0 ? this.params.freight : 0));// 支付金额+运费=总金额
|
|
|
- params.payAmount = this.selectedObj.priceMoney;// 支付金额
|
|
|
- params.pointsUsed = this.selectedObj.pricePoint;// 使用的积分
|
|
|
- params.buyerRemark = this.orderRemarks;//买家备注信息
|
|
|
- if (this.params.paymentType == 1 && this.params.freight==0) {//只有积分兑换
|
|
|
- this.productOrderCreateFun(params)
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.selectPayMeth == 1) {
|
|
|
- //微信支付
|
|
|
- this.weixinPay(params)
|
|
|
- } else if (this.selectPayMeth == 2) {
|
|
|
- //余额支付
|
|
|
- this.nowYuyue(params)
|
|
|
- }
|
|
|
-
|
|
|
+ this.selectProductShowPopup = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.selectProductRef.onShowFun(this.selectedObj, this.orderRemarks, this.selectPayMeth)
|
|
|
+ });
|
|
|
|
|
|
- } else {
|
|
|
- this.selectProductShowPopup = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.selectProductRef.onShowFun(this.selectedObj, this.orderRemarks, this.selectPayMeth)
|
|
|
- });
|
|
|
+ this.redeemNowBtnDisable = redeemNowBtnDisable ? redeemNowBtnDisable : true
|
|
|
+ let params = {}
|
|
|
+ //params.openId = uni.getStorageSync('wx_copenid');//用户openId
|
|
|
+ params.userPhone = this.defaultAddress.phone;//用户手机号
|
|
|
+ params.userName = this.defaultAddress.userName;//用户名
|
|
|
+ params.userAddress = this.defaultAddress.address + this.defaultAddress.atlasAdd;//地图地址+详细地址
|
|
|
+ params.addressId = this.defaultAddress.id;//地址ID
|
|
|
+ params.productId = this.params.id;
|
|
|
+ params.name = this.params.name;
|
|
|
+ params.productMainImage = this.params.productMainImage;
|
|
|
+ params.skuId = this.selectedObj.skuId; //选中的SKU ID
|
|
|
+ params.specNameValueLis = this.selectedObj.specNameValueList; // SKU列表(规格组合明细)
|
|
|
+ params.quantity = 1; //购买数量
|
|
|
+ params.payType = this.params.paymentType == 1 ? 3 : Number(this.selectPayMeth);//支付方式:1微信支付 2账户余额
|
|
|
+ params.freightAmount = this.params.freight; //运费
|
|
|
+ params.totalAmount = (this.selectedObj.priceMoney + (this.params.freight > 0 ? this.params.freight : 0));// 支付金额+运费=总金额
|
|
|
+ params.payAmount = this.selectedObj.priceMoney;// 支付金额
|
|
|
+ params.pointsUsed = this.selectedObj.pricePoint;// 使用的积分
|
|
|
+ params.buyerRemark = this.orderRemarks;//买家备注信息
|
|
|
+ if (this.params.paymentType == 1 && this.params.freight == 0) {//只有积分兑换
|
|
|
+ this.productOrderCreateFun(params)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.selectPayMeth == 1) {
|
|
|
+ //微信支付
|
|
|
+ this.weixinPay(params)
|
|
|
+ } else if (this.selectPayMeth == 2) {
|
|
|
+ //余额支付
|
|
|
+ this.nowYuyue(params)
|
|
|
}
|
|
|
|
|
|
},
|
|
|
@@ -365,7 +372,6 @@ export default {
|
|
|
let payConfig = JSON.parse(data.data)
|
|
|
getSignature(h5Url).then(res => {
|
|
|
this.wxconfig = res.data
|
|
|
- console.log(this.wxconfig, 'this.wxconfig66666')
|
|
|
wx.config({
|
|
|
beta: true,
|
|
|
debug: false,
|
|
|
@@ -497,7 +503,7 @@ export default {
|
|
|
//去我的地址页面 /points/productDetails/addressManagement
|
|
|
addressSelectFun() {
|
|
|
uni.navigateTo({
|
|
|
- url: `/pages/address/index?selectedAddressId=${this.defaultAddress ? this.defaultAddress.id : null}`
|
|
|
+ url: `/pages/address/index?selectedAddressId=${this.defaultAddress ? this.defaultAddress.id : null}&productId=${this.params.id}`
|
|
|
});
|
|
|
},
|
|
|
|