1解决支付问题
parent
d69ea4db2c
commit
42b544b4a6
|
|
@ -282,6 +282,7 @@
|
|||
// 现金支付
|
||||
uni.showModal({
|
||||
content: res.data.msg,
|
||||
showCancel: false,
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
// 跳转订单列表页
|
||||
|
|
@ -309,14 +310,13 @@
|
|||
popup_view_pay_html_is_show: true,
|
||||
});
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
this.order_item_pay_fail_handle(res.data.data, order_id, res.data.msg);
|
||||
}
|
||||
this.order_item_pay_fail_handle(res.data.data, order_id);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
fail: (res) => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
this.order_item_pay_fail_handle(res.data.data, order_id, '服务器请求出错');
|
||||
},
|
||||
});
|
||||
} else {
|
||||
|
|
@ -333,8 +333,7 @@
|
|||
self.order_item_pay_success_handle(data, order_id);
|
||||
},
|
||||
fail: (res) => {
|
||||
app.globalData.showToast('支付失败');
|
||||
self.order_item_pay_fail_handle(data, order_id);
|
||||
self.order_item_pay_fail_handle(data, order_id, '支付失败');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
|
@ -360,13 +359,13 @@
|
|||
success: (res) => {
|
||||
// #ifdef MP-ALIPAY
|
||||
if (res.resultCode != 9000) {
|
||||
app.globalData.showToast(res.memo || '支付失败');
|
||||
self.order_item_pay_fail_handle(data, order_id, res.memo || '支付失败');
|
||||
return false;
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-TOUTIAO
|
||||
if (res.code != 0) {
|
||||
app.globalData.showToast('支付失败');
|
||||
self.order_item_pay_fail_handle(data, order_id, '支付失败');
|
||||
return false;
|
||||
}
|
||||
// #endif
|
||||
|
|
@ -374,8 +373,7 @@
|
|||
self.order_item_pay_success_handle(data, order_id);
|
||||
},
|
||||
fail: (res) => {
|
||||
app.globalData.showToast('支付失败');
|
||||
self.order_item_pay_fail_handle(data, order_id);
|
||||
self.order_item_pay_fail_handle(data, order_id, '支付失败');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
|
@ -395,7 +393,7 @@
|
|||
this.$emit('reset-event');
|
||||
},
|
||||
fail: function (res) {
|
||||
app.globalData.showToast('支付失败');
|
||||
self.order_item_pay_fail_handle(data, order_id, '支付失败');
|
||||
},
|
||||
});
|
||||
} else {
|
||||
|
|
@ -429,7 +427,7 @@
|
|||
// 数据设置
|
||||
self.order_item_pay_success_handle(data, order_id);
|
||||
} else {
|
||||
self.order_item_pay_fail_handle(data, order_id);
|
||||
self.order_item_pay_fail_handle(data, order_id, res.err_msg);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
@ -484,8 +482,7 @@
|
|||
},
|
||||
fail: () => {
|
||||
clearInterval(self.popup_view_pay_timer);
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
self.order_item_pay_fail_handle(data, order_id);
|
||||
self.order_item_pay_fail_handle(data, order_id, '服务器请求出错');
|
||||
},
|
||||
});
|
||||
}, 3000);
|
||||
|
|
@ -524,8 +521,8 @@
|
|||
this.to_success_page_event();
|
||||
}
|
||||
},
|
||||
// 支付失败数据设置 data:后台返回的参数, order_id: 订单id
|
||||
order_item_pay_fail_handle(data, order_id) {
|
||||
// 支付失败数据设置 data:后台返回的参数, order_id: 订单id, msg: 错误提示信息
|
||||
order_item_pay_fail_handle(data, order_id, msg) {
|
||||
let newData = {
|
||||
data: data,
|
||||
order_id: order_id,
|
||||
|
|
@ -533,7 +530,7 @@
|
|||
payment_id: this.propPaymentId,
|
||||
};
|
||||
this.$emit('pay-fail', newData);
|
||||
this.to_fail_page_event();
|
||||
this.to_fail_page_event(msg);
|
||||
},
|
||||
// 成功跳转
|
||||
to_success_page_event() {
|
||||
|
|
@ -554,13 +551,33 @@
|
|||
}
|
||||
},
|
||||
// 失败跳转
|
||||
to_fail_page_event() {
|
||||
console.log(this.propToFailPage);
|
||||
if (this.propToFailPage) {
|
||||
// 跳转支付页面
|
||||
uni.navigateTo({
|
||||
url: this.propToFailPage,
|
||||
});
|
||||
to_fail_page_event(msg) {
|
||||
let to_fail_page = this.propToFailPage;
|
||||
if (to_fail_page) {
|
||||
if (msg) {
|
||||
// 现金支付
|
||||
uni.showModal({
|
||||
content: msg,
|
||||
showCancel: false,
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
// 跳转支付页面
|
||||
uni.redirectTo({
|
||||
url: to_fail_page,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
// 跳转支付页面
|
||||
uni.redirectTo({
|
||||
url: to_fail_page,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (msg) {
|
||||
app.globalData.showToast(msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
// 页面卸载
|
||||
|
|
@ -572,6 +589,7 @@
|
|||
this.setData({
|
||||
popup_view_pay_html_is_show: false,
|
||||
});
|
||||
this.to_fail_page_event();
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -83,6 +83,13 @@
|
|||
/* #endif */
|
||||
}
|
||||
|
||||
.search-content-animation {
|
||||
transition: all 0.2s ease;
|
||||
/* #ifdef MP-WEIXIN */
|
||||
transition: all 1s linear;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
/* #ifdef H5 || MP-TOUTIAO || APP */
|
||||
.search-content-fixed .nav-top-right-icon {
|
||||
top: 9px !important;
|
||||
|
|
|
|||
|
|
@ -17,14 +17,13 @@
|
|||
<!-- #endif -->
|
||||
|
||||
<!-- 搜索 -->
|
||||
<view v-if="search_is_fixed == 1" class="search-fixed-seat"></view>
|
||||
<!-- <view v-if="search_is_fixed == 1" class="search-fixed-seat"></view> -->
|
||||
<view v-if="load_status == 1" :class="'pr ' + (search_is_fixed == 1 ? 'search-content-fixed' : '')" :style="search_is_fixed == 1 ? top_content_title_style : ''">
|
||||
<view v-if="common_app_is_enable_search == 1" :style="search_style">
|
||||
<view v-if="common_app_is_enable_search == 1" :style="search_style" class="search-content-animation">
|
||||
<view class="margin-horizontal-main">
|
||||
<component-search propPlaceholder="输入商品名称搜索" :propIsBtn="true" propBgColor="#fff"></component-search>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- #ifdef H5 || MP-TOUTIAO || APP -->
|
||||
<!-- 右上角icon列表 -->
|
||||
<view v-if="(right_icon_list || null) != null && right_icon_list.length > 0" class="nav-top-right-icon pa">
|
||||
|
|
@ -541,8 +540,8 @@
|
|||
// 页面滚动监听
|
||||
onPageScroll(e) {
|
||||
if (this.common_app_is_header_nav_fixed == 1 && this.common_app_is_enable_search == 1) {
|
||||
var top = e.scrollTop > 35 ? 35 : e.scrollTop;
|
||||
var num = top * 7;
|
||||
var top = e.scrollTop > 42 ? 42 : e.scrollTop;
|
||||
var num = top;
|
||||
var base = 230;
|
||||
// #ifdef MP-ALIPAY
|
||||
base = 235;
|
||||
|
|
@ -553,14 +552,21 @@
|
|||
// #endif
|
||||
// 开启哀悼插件的时候不需要浮动导航并且搜索框也不需要缩短、开启站点灰度会导致浮动失效
|
||||
if (!this.plugins_mourning_data_is_app) {
|
||||
var top_val = 35;
|
||||
var val = num > base ? base : num;
|
||||
var top_val = 42;
|
||||
var val = num * 6 > base ? base : num * 6;
|
||||
// #ifdef MP-TOUTIAO
|
||||
top_val = 0;
|
||||
val = base;
|
||||
// #endif
|
||||
console.log('num', num);
|
||||
// console.log('base', base);
|
||||
this.setData({
|
||||
// #ifdef H5 || MP-TOUTIAO || APP
|
||||
search_style: 'width: calc(100% - ' + (val < 0 ? 0 : val) + 'rpx);',
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
search_style: 'width: calc(100% - ' + (e.scrollTop > 200 ? 200 : e.scrollTop) + 'px);',
|
||||
// #endif
|
||||
search_is_fixed: top >= top_val ? 1 : 0,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,106 +9,107 @@
|
|||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view v-if="(data_base || null) != null">
|
||||
<!-- 广告图片 -->
|
||||
<view class="pa top-0 bg-img wh-auto">
|
||||
<block v-if="(data_base.right_images || null) != null">
|
||||
<!-- <image class="wh-auto advertisement" :src="data_base.right_images" mode="widthFix" :data-value="data_base.right_images_url || ''" @tap="url_event"></image> -->
|
||||
<image class="wh-auto advertisement" :src="points_static_url + 'integral-bg.png'" mode="widthFix" :data-value="data_base.right_images_url || ''" @tap="url_event"></image>
|
||||
</block>
|
||||
<block v-else>
|
||||
<image class="wh-auto advertisement" :src="points_static_url + 'integral-bg.png'" mode="widthFix" :data-value="data_base.right_images_url || ''" @tap="url_event"></image>
|
||||
</block>
|
||||
</view>
|
||||
<view class="pr">
|
||||
<!-- #endif -->
|
||||
<view class="padding-horizontal-main points-content pr">
|
||||
<!-- 顶部 -->
|
||||
<view class="border-radius-main bg-white pr spacing-mb">
|
||||
<view class="points-user">
|
||||
<view class="flex-row">
|
||||
<block v-if="(user || null) == null">
|
||||
<image class="avatar dis-block circle" @tap="preview_event" :src="avatar_default" mode="widthFix"></image>
|
||||
<view class="padding-left-main">
|
||||
<view class="login-submit text-size fw-b" type="default" size="mini" @tap="login_event">立即登录</view>
|
||||
<view class="desc margin-top-sm cr-grey-9">获知会员积分详情</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<image class="avatar dis-block circle" @tap="preview_event" :src="user.avatar || avatar_default" mode="widthFix"></image>
|
||||
<view class="padding-left-main">
|
||||
<view class="text-size fw-b">{{ user.user_name_view }}</view>
|
||||
<view class="desc margin-top-sm cr-grey"
|
||||
>当前可用
|
||||
<text class="cr-black fw-b padding-horizontal-xs">
|
||||
{{ user_integral.integral || 0 }}
|
||||
</text>
|
||||
积分
|
||||
<view v-if="(data_base || null) != null" class="weixin-nav-padding-top">
|
||||
<view class="padding-top-xxxl">
|
||||
<!-- 广告图片 -->
|
||||
<view class="pa top-0 bg-img wh-auto">
|
||||
<block v-if="(data_base.right_images || null) != null">
|
||||
<!-- <image class="wh-auto advertisement" :src="data_base.right_images" mode="widthFix" :data-value="data_base.right_images_url || ''" @tap="url_event"></image> -->
|
||||
<image class="wh-auto advertisement" :src="points_static_url + 'integral-bg.png'" mode="widthFix" :data-value="data_base.right_images_url || ''" @tap="url_event"></image>
|
||||
</block>
|
||||
<block v-else>
|
||||
<image class="wh-auto advertisement" :src="points_static_url + 'integral-bg.png'" mode="widthFix" :data-value="data_base.right_images_url || ''" @tap="url_event"></image>
|
||||
</block>
|
||||
</view>
|
||||
<view class="pr padding-top-main">
|
||||
<view class="padding-horizontal-main points-content pr">
|
||||
<!-- 顶部 -->
|
||||
<view class="border-radius-main bg-white pr spacing-mb">
|
||||
<view class="points-user">
|
||||
<view class="flex-row">
|
||||
<block v-if="(user || null) == null">
|
||||
<image class="avatar dis-block circle" @tap="preview_event" :src="avatar_default" mode="widthFix"></image>
|
||||
<view class="padding-left-main">
|
||||
<view class="login-submit text-size fw-b" type="default" size="mini" @tap="login_event">立即登录</view>
|
||||
<view class="desc margin-top-sm cr-grey-9">获知会员积分详情</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 分享 -->
|
||||
<button class="share-submit pa tc cr-white text-size-md" type="default" size="mini" open-type="share">分享</button>
|
||||
</view>
|
||||
<view v-if="(user || null) !== null" class="points-integral br-t-dashed">
|
||||
<component-title prop-title="积分明细" prop-more-url="/pages/user-integral/user-integral"></component-title>
|
||||
<view v-if="integral_list.length > 0">
|
||||
<view class="item">
|
||||
<view v-for="(item, index) in integral_list" class="list" :key="index">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="cr-grey-9">
|
||||
原始
|
||||
<text class="cr-black fw-b padding-left-sm">{{ item.original_integral }}</text>
|
||||
<text class="padding-horizontal-sm">/</text>
|
||||
最新
|
||||
<text class="cr-black fw-b padding-left-sm">{{ item.new_integral }}</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<image class="avatar dis-block circle" @tap="preview_event" :src="user.avatar || avatar_default" mode="widthFix"></image>
|
||||
<view class="padding-left-main">
|
||||
<view class="text-size fw-b">{{ user.user_name_view }}</view>
|
||||
<view class="desc margin-top-sm cr-grey"
|
||||
>当前可用
|
||||
<text class="cr-black fw-b padding-horizontal-xs">
|
||||
{{ user_integral.integral || 0 }}
|
||||
</text>
|
||||
积分
|
||||
</view>
|
||||
<view class="cr-grey-9">{{ item.add_time_time }}</view>
|
||||
</view>
|
||||
<view class="flex-row jc-sb align-c margin-top-main">
|
||||
<view>{{ item.msg }}</view>
|
||||
<view class="cr-main text-size fw-b" :class="item.type == 1 ? 'cr-green' : 'cr-red'">{{ item.type == 1 ? '+' : '-' }} {{ item.operation_integral }}</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 分享 -->
|
||||
<button class="share-submit pa tc cr-white text-size-md" type="default" size="mini" open-type="share">分享</button>
|
||||
</view>
|
||||
<view v-if="(user || null) !== null" class="points-integral br-t-dashed">
|
||||
<component-title prop-title="积分明细" prop-more-url="/pages/user-integral/user-integral"></component-title>
|
||||
<view v-if="integral_list.length > 0">
|
||||
<view class="item">
|
||||
<view v-for="(item, index) in integral_list" class="list" :key="index">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="cr-grey-9">
|
||||
原始
|
||||
<text class="cr-black fw-b padding-left-sm">{{ item.original_integral }}</text>
|
||||
<text class="padding-horizontal-sm">/</text>
|
||||
最新
|
||||
<text class="cr-black fw-b padding-left-sm">{{ item.new_integral }}</text>
|
||||
</view>
|
||||
<view class="cr-grey-9">{{ item.add_time_time }}</view>
|
||||
</view>
|
||||
<view class="flex-row jc-sb align-c margin-top-main">
|
||||
<view>{{ item.msg }}</view>
|
||||
<view class="cr-main text-size fw-b" :class="item.type == 1 ? 'cr-green' : 'cr-red'">{{ item.type == 1 ? '+' : '-' }} {{ item.operation_integral }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 公告信息 -->
|
||||
<button v-if="(data_base.points_desc || null) != null && data_base.points_desc.length > 0" class="rule-btn pa right-0 tc cr-white text-size-md" @tap="quick_open_event">积分规则</button>
|
||||
|
||||
<!-- 商品兑换 -->
|
||||
<view v-if="(data_base.goods_exchange_data || null) != null && data_base.goods_exchange_data.length > 0">
|
||||
<component-goods-list
|
||||
:propData="{ style_type: 1, title: '商品兑换', url: '/pages/goods-search/goods-search', goods_list: data_base.goods_exchange_data }"
|
||||
prop-more-url-key="url"
|
||||
:propCurrencySymbol="currency_symbol"
|
||||
:prop-grid-btn-config="gridBtnConfig"
|
||||
:prop-is-open-grid-btn-set="isOpenGridBtnSet"
|
||||
propPriceField="price"
|
||||
propIntegral
|
||||
></component-goods-list>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 公告信息 -->
|
||||
<button v-if="(data_base.points_desc || null) != null && data_base.points_desc.length > 0" class="rule-btn pa right-0 tc cr-white text-size-md" @tap="quick_open_event">积分规则</button>
|
||||
|
||||
<!-- 商品兑换 -->
|
||||
<view v-if="(data_base.goods_exchange_data || null) != null && data_base.goods_exchange_data.length > 0">
|
||||
<component-goods-list
|
||||
:propData="{ style_type: 1, title: '商品兑换', url: '/pages/goods-search/goods-search', goods_list: data_base.goods_exchange_data }"
|
||||
prop-more-url-key="url"
|
||||
:propCurrencySymbol="currency_symbol"
|
||||
:prop-grid-btn-config="gridBtnConfig"
|
||||
:prop-is-open-grid-btn-set="isOpenGridBtnSet"
|
||||
propPriceField="price"
|
||||
propIntegral
|
||||
></component-goods-list>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
<!-- 积分规则弹窗 -->
|
||||
<component-popup v-if="(data_base.points_desc || null) != null && data_base.points_desc.length > 0" :propShow="popup_status" :propIsBar="propIsBar" propPosition="bottom" @onclose="quick_close_event">
|
||||
<view class="rule">
|
||||
<view class="cr-black text-size-md fw-b margin-bottom-main tc">积分规则</view>
|
||||
<scroll-view :scroll-y="true" class="item">
|
||||
<view v-for="(item, index) in data_base.points_desc" :key="index" class="cr-grey text-size-md">{{ item }}</view>
|
||||
</scroll-view>
|
||||
<button type="default" class="bg-main cr-white round text-size-md pa bottom-0 left-0 right-0" @tap="quick_close_event">知道了</button>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
<!-- 积分规则弹窗 -->
|
||||
<component-popup v-if="(data_base.points_desc || null) != null && data_base.points_desc.length > 0" :propShow="popup_status" :propIsBar="propIsBar" propPosition="bottom" @onclose="quick_close_event">
|
||||
<view class="rule">
|
||||
<view class="cr-black text-size-md fw-b margin-bottom-main tc">积分规则</view>
|
||||
<scroll-view :scroll-y="true" class="item">
|
||||
<view v-for="(item, index) in data_base.points_desc" :key="index" class="cr-grey text-size-md">{{ item }}</view>
|
||||
</scroll-view>
|
||||
<button type="default" class="bg-main cr-white round text-size-md pa bottom-0 left-0 right-0" @tap="quick_close_event">知道了</button>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
@font-face {
|
||||
font-family: "iconfont";
|
||||
/* Project id 4227145 */
|
||||
/* Project id 4227145 */
|
||||
/* 全局注册需要切换成绝对路径 */
|
||||
/* @/static/icon/ */
|
||||
src: url('@/static/icon/iconfont.ttf?t=1693280977762') format('truetype');
|
||||
|
|
|
|||
Loading…
Reference in New Issue