|
|
@@ -48,7 +48,7 @@
|
|
|
|
|
|
<view class="flex padding-xs">
|
|
|
<text class="flex justify-center align-center">热力值:</text>
|
|
|
- <u-number-box :step="10" @change="hotValueChange" :input-width="200" :min="0" :max="+proportion.usableHot" v-model="data.hotValue">
|
|
|
+ <u-number-box :disabled="$u.test.isEmpty(proportion.usableHot)" :step="10" @change="hotValueChange" :input-width="200" :min="0" :max="+proportion.usableHot" v-model="data.hotValue">
|
|
|
</u-number-box>
|
|
|
<view v-if="changeCash.hotCash!=0" class="padding-left-sm text-red flex justify-center align-center">
|
|
|
=
|
|
|
@@ -58,7 +58,7 @@
|
|
|
|
|
|
<view class="flex padding-xs">
|
|
|
<text class="flex justify-center align-center">积分值:</text>
|
|
|
- <u-number-box @change="pointsValueChange" :input-width="200" :min="0" :max="+proportion.usablePoints" v-model="data.pointsValue">
|
|
|
+ <u-number-box :disabled="$u.test.isEmpty(proportion.usablePoints)" @change="pointsValueChange" :input-width="200" :min="0" :max="+proportion.usablePoints" v-model="data.pointsValue">
|
|
|
</u-number-box>
|
|
|
<view v-if="changeCash.pointsCash!=0" class="padding-left-sm text-red flex justify-center align-center">
|
|
|
=
|
|
|
@@ -100,6 +100,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import {appId} from '@/common/conf/config.js';
|
|
|
import {authUrl} from '@/common/conf/config.js';
|
|
|
import {getUrlParams} from '@/common/utils/utils.js';
|
|
|
export default {
|
|
|
@@ -185,6 +186,73 @@
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
+ if (!this.$u.test.isEmpty(this.data.cashValue)) {
|
|
|
+ //去支付,支付成功后
|
|
|
+ let orderInfo = (await this.$u.api.yeePay.initOrder(
|
|
|
+ {
|
|
|
+ "appId": appId,
|
|
|
+ "channel": "WECHAT",
|
|
|
+ "channelPromotionInfo": "",
|
|
|
+ "channelSpecifiedInfo": "",
|
|
|
+ "csUrl": "",
|
|
|
+ "expiredTime": "",
|
|
|
+ "fundProcessType": "",
|
|
|
+ "goodsName": this.detail.name,
|
|
|
+ "memo": "",
|
|
|
+ "notifyUrl": "https://yyzs.nanyue6688.com/vote-h5/index.html",
|
|
|
+ "orderAmount": this.data.cashValue,
|
|
|
+ "orderId": new Date().getTime(),
|
|
|
+ "payWay": "WECHAT_OFFIACCOUNT",
|
|
|
+ "redirectUrl": "",
|
|
|
+ "scene": "OFFLINE",
|
|
|
+ "uniqueOrderNo": "",
|
|
|
+ "userId": uni.getStorageSync("openid"),
|
|
|
+ "userIp": "127.0.0.1"
|
|
|
+ }
|
|
|
+ ));
|
|
|
+ if(typeof orderInfo.prePayTn != 'undefined' ){
|
|
|
+ //调起支付
|
|
|
+ this.toPay(JSON.parse(orderInfo.prePayTn));
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.doConfirm()
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ toPay() {
|
|
|
+ WeixinJSBridge.invoke('getBrandWCPayRequest', info, (res) => {
|
|
|
+ if (res.err_msg == "get_brand_wcpay_request:ok" ) {
|
|
|
+ this.$u.api.boost.billRecord({
|
|
|
+ userId: this.senderId,
|
|
|
+ openId: uni.getStorageSync("openid"),
|
|
|
+ activityId: this.activityId,
|
|
|
+ price: this.data.cashValue,
|
|
|
+ presentId: '',
|
|
|
+ presentCount: '',
|
|
|
+ relationId: this.id,
|
|
|
+ type: 3,
|
|
|
+ payStatus: 1,
|
|
|
+ }).then(res => {
|
|
|
+ this.doConfirm();
|
|
|
+ })
|
|
|
+ } else if (res.err_msg == "get_brand_wcpay_request:cancel") {
|
|
|
+ this.$u.api.boost.billRecord({
|
|
|
+ userId: this.senderId,
|
|
|
+ openId: uni.getStorageSync("openid"),
|
|
|
+ activityId: this.activityId,
|
|
|
+ price: this.data.cashValue,
|
|
|
+ presentId: '',
|
|
|
+ presentCount: '',
|
|
|
+ relationId: this.id,
|
|
|
+ type: 3,
|
|
|
+ payStatus: 2,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ console.log(res.err_msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async doConfirm(){
|
|
|
this.data.pointsGoodsId = this.id
|
|
|
this.data.userId = this.userId
|
|
|
let res = await this.$u.api.pointsGoods.exchange(this.data)
|