1 Commits
gyq ... gyq_app

Author SHA1 Message Date
gyq
2bd6f25498 新增APP适配 2025-09-18 18:13:56 +08:00
9 changed files with 73 additions and 69 deletions

View File

@@ -12,12 +12,14 @@
// 数据接口请求地址
// request_url: 'http://192.168.1.43:7777/',
// request_url: env == 'development' ? '/api/' : 'https://store.sxczgkj.com/',
request_url: 'https://store.sxczgkj.com/',
// request_url: 'https://store.sxczgkj.com/',
request_url: 'http://www.fulaijiajiazheng.cn/',
// 静态资源地址如系统根目录不在public目录下面请在静态地址后面加public目录、如https://d1.shopxo.vip/public/
// static_url: 'http://192.168.1.43:7777/',
// static_url: env == 'development' ? '/api/' : 'https://store.sxczgkj.com/',
static_url: 'https://store.sxczgkj.com/',
// static_url: 'https://store.sxczgkj.com/',
static_url: 'http://www.fulaijiajiazheng.cn/',
// 系统类型默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立
system_type: 'default',

View File

@@ -338,7 +338,7 @@
// 从一开始就判断支付方式,如果是无忧支付直接进入支付状态判断页面
console.log('payment===', payment);
if (payment.payment == 'IEPayPoli') {
if (payment.payment == 'IEPayPoli' || payment == 'Alipay') {
console.log('直接进入无忧支付,开始跳转');
uni.setStorageSync('wuyouPay', '');
uni.redirectTo({
@@ -354,7 +354,7 @@
payment_id: payment_id || this.payment_id,
};
// h5自定义重定向地址
// #ifdef H5
// #ifdef H5 || APP
var redirect_url = app.globalData.page_url_protocol(this.propToAppointPage || app.globalData.get_page_url(false));
post_data['redirect_url'] = encodeURIComponent(base64.encode(redirect_url));
// 存在支付标识、指定支付方式使用respond_url返回地址、移除重定向地址
@@ -403,8 +403,10 @@
switch (payment_type) {
// 正常线上支付
case 0:
console.log('111');
// #ifdef APP
this.app_pay_handle(this, data, order_id);
// this.app_pay_handle(this, data, order_id);
this.h5_pay_handle(this, data, order_id);
// #endif
// #ifdef MP-TOUTIAO
// 头条是否非普通版本支持
@@ -429,27 +431,32 @@
break;
// 线下支付
case 1:
console.log('222');
this.h5_pay_handle(this, data, order_id);
// 现金支付
let self = this;
uni.showModal({
content: res.data.msg,
showCancel: false,
confirmText: self.$t('common.confirm'),
success(res) {
if (res.confirm) {
self.to_other(order_id);
} else {
self.order_item_pay_fail_handle(data, order_id, self.$t('paytips.paytips.6mpsl7'));
}
},
});
// let self = this;
// uni.showModal({
// content: res.data.msg,
// showCancel: false,
// confirmText: self.$t('common.confirm'),
// success(res) {
// if (res.confirm) {
// self.to_other(order_id);
// } else {
// self.order_item_pay_fail_handle(data, order_id, self.$t('paytips.paytips.6mpsl7'));
// }
// },
// });
break;
// 钱包支付
case 2:
console.log('333');
this.order_item_pay_success_handle(data, order_id);
break;
// 默认
default:
console.log('444');
app.globalData.showToast(this.$t('payment.payment.vhx5dv'));
}
}
@@ -686,6 +693,7 @@
},
// h5支付处理
h5_pay_handle(self, data, order_id) {
console.log('111111111111111111111111');
console.log('h5_pay_handle===', order_id);
// 字符串则为跳转地址直接进入
if (typeof data.data == 'string') {
@@ -750,7 +758,7 @@
}
// 无忧支付
if (data.payment.payment == 'IEPayPoli') {
if (data.payment.payment == 'IEPayPoli' || data.payment.payment == 'Alipay') {
console.log('无忧支付order_id===', order_id);
console.log('无忧支付===', data);
uni.setStorageSync('wuyouPay', '');

View File

@@ -1,7 +1,7 @@
{
"name" : "ShopXO",
"name" : "商城",
"appid" : "__UNI__F095115",
"description" : "ShopXO开源商城、MIT协议、可商用、可二次开发、满足99%电商运营需求",
"description" : "商城",
"versionName" : "1.0.0",
"versionCode" : 100,
"transformPx" : false,

View File

@@ -10,7 +10,8 @@
"titlePenetrate": "YES",
// #endif
"enablePullDownRefresh": true,
"navigationBarTitleText": ""
"navigationBarTitleText": "",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/contact/contact",

View File

@@ -347,7 +347,7 @@
<text class="t">明细{{ total_count }}</text>
</view>
<view class="nav-submit padding-horizontal-main fr">
<view class="btn bg-main cr-white text-size-md" type="default" @tap="buy_submit_event" :disabled="buy_submit_disabled_status" hover-class="none" style="padding: 12upx 22upx;border-radius: 12upx;">{{ $t('buy.buy.4884hk') }}</view>
<view class="btn bg-main cr-white text-size-md" type="default" @tap="buy_submit_event" :disabled="buy_submit_disabled_status" hover-class="none" style="padding: 12upx 22upx; border-radius: 12upx">{{ $t('buy.buy.4884hk') }}</view>
</view>
</view>
</view>
@@ -540,6 +540,7 @@
},
onLoad(params) {
console.log('进入页面了');
// 调用公共事件方法
app.globalData.page_event_onload_handle(params);
@@ -730,9 +731,12 @@
} else if (payment == 'WalletPay') {
// 支付宝支付 改装钱包余额支付
console.log('支付宝支付===', order_id);
} else if (payment == 'IEPayPoli') {
} else if (payment == 'IEPayPoli' || payment == 'Alipay') {
console.log('开始无忧支付===', order_id);
this.pay_url = app.globalData.get_request_url('wuYouPay', 'xo');
console.log('this.pay_url===123455667', this.pay_url);
this.$nextTick(() => {
this.$refs.payment.pay_handle(order_id, payment_id, payment_list);
});
@@ -817,6 +821,7 @@
data: this.request_data_ext_params_merge(data),
dataType: 'json',
success: (res) => {
console.log(res);
uni.stopPullDownRefresh();
if (this.is_first == 0) {
uni.hideLoading();

View File

@@ -10,7 +10,7 @@
</template>
<script>
import base64 from '../../common/js/lib/base64';
import base64 from '@/common/js/lib/base64';
const app = getApp();
export default {
@@ -33,7 +33,9 @@
};
},
onLoad(e) {
// #ifdef H5
window.addEventListener('popstate', this.onPageBack);
// #endif
console.log('wu_you_status.onLoad===', e);
this.pay_url = e;
let wuyou = uni.getStorageSync('wuyouPay');
@@ -79,7 +81,9 @@
data: {
ids: this.pay_url.order_id,
payment_id: this.pay_url.payment_id,
// #ifdef H5
redirect_url: this.encodeAlipayCallbackUrl(window.location.href),
// #endif
},
dataType: 'json',
success: (res) => {
@@ -91,7 +95,13 @@
let wuyou2 = uni.getStorageSync('wuyouPay');
wuyou2.check = true;
uni.setStorageSync('wuyouPay', wuyou2);
// #ifdef H5
window.location.href = data.data.data.h5_url;
// #endif
// #ifdef APP
plus.runtime.openURL(data.data.data.h5_url);
// #endif
} else {
uni.showToast({
title: msg.msg,

View File

@@ -813,6 +813,7 @@
},
onShow() {
console.log('进入页面了goods-detail');
// 调用公共事件方法
app.globalData.page_event_onshow_handle();

View File

@@ -1177,12 +1177,12 @@
console.log('getThemeConfig===', JSON.parse(res.data.data.json_data));
if (res.data.code == 0) {
this.themeConfigData = JSON.parse(res.data.data.json_data);
if (this.themeConfigData.layout == 'layout4') {
uni.setNavigationBarColor({
frontColor: '#000000',
backgroundColor: '#ffffff',
});
}
// if (this.themeConfigData.layout == 'layout4') {
// uni.setNavigationBarColor({
// frontColor: '#000000',
// backgroundColor: '#ffffff',
// });
// }
} else {
console.log('主题获取失败===', res.data.msg);
}
@@ -1686,9 +1686,7 @@
}
.container {
&.layout2 {
/* #ifdef H5 */
padding-top: calc(40upx + var(--status-bar-height));
/* #endif */
/* #ifdef MP-ALIPAY */
padding-top: calc(54upx + var(--status-bar-height));
/* #endif */
@@ -1839,7 +1837,7 @@
width: 100%;
position: absolute;
left: 0;
top: 0;
top: var(--status-bar-height);
/* #ifdef MP-ALIPAY */
top: calc(var(--status-bar-height) + 40upx);
left: 50upx;
@@ -1950,9 +1948,7 @@
width: 100%;
position: absolute;
left: 0;
/* #ifdef H5 */
top: 0;
/* #endif */
top: var(--status-bar-height);
/* #ifdef MP-ALIPAY */
top: calc(var(--status-bar-height) + 40upx);
/* #endif */
@@ -1992,9 +1988,7 @@
.search-wrap2 {
position: absolute;
width: 100%;
/* #ifdef H5 */
top: 100upx;
/* #endif */
top: calc(100upx + var(--status-bar-height));
/* #ifdef MP-ALIPAY */
top: calc(130upx + var(--status-bar-height));
/* #endif */
@@ -2112,6 +2106,10 @@
z-index: 99;
.status {
position: relative;
display: none;
/* #ifdef MP-WEIXIN */
display: block;
/* #endif */
.status_img {
position: absolute;
top: 0;
@@ -2127,10 +2125,8 @@
.page-tab {
width: 100%;
position: absolute;
/* #ifdef H5 */
left: 0;
top: 88upx;
/* #endif */
top: calc(var(--status-bar-height) + 20upx);
/* #ifdef MP-ALIPAY */
top: calc(var(--status-bar-height) + 44upx);
left: 40upx;
@@ -2333,10 +2329,8 @@
}
.search-wrap2 {
/* #ifdef H5 */
width: 100%;
padding: 28upx 20upx 0 20upx;
/* #endif */
/* #ifdef MP-ALIPAY */
width: 80%;
padding: 0 20upx 0 80upx;
@@ -2436,19 +2430,14 @@
position: absolute;
z-index: 1;
left: 0;
/* #ifdef H5 */
width: 100%;
top: 0;
top: var(--status-bar-height);
padding: 28upx 20upx 0 20upx;
/* #endif */
/* #ifdef MP-ALIPAY */
top: calc(var(--status-bar-height) + 40upx);
width: 80%;
padding: 0 20upx 0 80upx;
/* #endif */
box-sizing: border-box;
.search-content {
height: 60upx;
@@ -2496,10 +2485,7 @@
padding: 20upx;
position: absolute;
left: 0;
/* #ifdef H5 */
top: 128upx;
/* #endif */
top: calc(128upx + var(--status-bar-height));
/* #ifdef MP-ALIPAY */
top: calc(var(--status-bar-height) + 128upx);
/* #endif */
@@ -2526,14 +2512,11 @@
position: absolute;
z-index: 1;
left: 0;
/* #ifdef H5 */
width: 100%;
top: 0;
padding: 28upx 20upx 0 20upx;
/* #endif */
/* #ifdef MP-ALIPAY */
/* #ifdef MP-WEIXIN */
top: calc(var(--status-bar-height) + 40upx);
width: 80%;
padding: 0 20upx 0 80upx;
@@ -2588,9 +2571,7 @@
padding: 20upx;
position: absolute;
left: 0;
/* #ifdef H5 */
top: 128upx;
/* #endif */
/* #ifdef MP-ALIPAY */
top: calc(var(--status-bar-height) + 128upx);
@@ -2620,11 +2601,9 @@
z-index: 1;
left: 0;
/* #ifdef H5 */
width: 100%;
top: 0;
top: var(--status-bar-height);
padding: 28upx 20upx 0 20upx;
/* #endif */
/* #ifdef MP-ALIPAY */
top: calc(var(--status-bar-height) + 40upx);
@@ -2681,9 +2660,7 @@
padding: 20upx;
position: absolute;
left: 0;
/* #ifdef H5 */
top: 128upx;
/* #endif */
top: calc(116upx + var(--status-bar-height));
/* #ifdef MP-ALIPAY */
top: calc(var(--status-bar-height) + 128upx);

View File

@@ -260,7 +260,7 @@ function handleSocketOpen(res, resolve) {
function handleSocketMessage(res) {
try {
let data = JSON.parse(res.data);
console.log('收到socket消息:', data);
// console.log('收到socket消息:', data);
eventBus.emit('message', data);
} catch (e) {
console.error('解析socket消息失败:', e);
@@ -341,7 +341,7 @@ function sendMessage(data) {
socketTask.send({
data: messageData,
success: () => {
console.log('消息发送成功');
// console.log('消息发送成功');
},
fail: (err) => {
console.error('消息发送失败:', err);