商品分类页面结算支持问诊开方

master
gongfuxiang 2025-10-21 15:17:07 +08:00
parent b786fa0ce9
commit d78b04f2f7
4 changed files with 171 additions and 58 deletions

37
App.vue
View File

@ -7,10 +7,10 @@
data: {
//
//
request_url:'https://d1.shopxo.vip/',
request_url:'http://shopxo.com/',
// publicpublichttps://d1.shopxo.vip/public/
static_url:'https://d1.shopxo.vip/',
static_url:'http://shopxo.com/',
// default
system_type: 'default',
@ -2472,6 +2472,39 @@
return this.get_config('currency_symbol') || this.data.currency_symbol;
},
//
// appoint_goods_ids idid
buy_cart_data_params(data, appoint_goods_ids = null) {
// id
var temp_appoint_goods_ids = [];
if((appoint_goods_ids || null) != null) {
temp_appoint_goods_ids = appoint_goods_ids.split(',').map(function(v){return parseInt(v);});
}
//
var ids = [];
if ((data || null) != null) {
for (var i in data) {
if (data[i]['is_error'] == 0 && (temp_appoint_goods_ids.length == 0 || temp_appoint_goods_ids.indexOf(parseInt(data[i]['goods_id'])) != -1)) {
ids.push(data[i]['id']);
}
}
}
if(ids.length <= 0) {
return false;
}
//
return {
buy_type: 'cart',
ids: ids.join(','),
};
},
//
to_buy_handle(buy_data, pages = '/pages/buy/buy') {
this.url_open(pages+'?data=' + encodeURIComponent(base64.encode(JSON.stringify(buy_data))));
},
//
get_location_check(type, object, method) {
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ

View File

@ -1,3 +1,11 @@
## v6.7.12025-09-26
1. 多商户导航事件优化
2. 商品详情左上角返回图标丢失修复
3. 智能工具箱商品评价id丢失修复
4. 表单新增编辑
5. 商品分类页面结算支持问诊开方
## v6.7.02025-09-26
1. 新增商品对比
2. 修改优惠劵处理逻辑、领取错误修复

View File

@ -1027,7 +1027,7 @@
//
pre_order_handle() {
var data = this.buy_data_params();
var data = this.buy_cart_data_params();
if (data !== false) {
uni.request({
url: app.globalData.get_request_url('index', 'buy'),
@ -1063,23 +1063,16 @@
//
// appoint_goods_ids idid
buy_data_params(appoint_goods_ids = null) {
// id
var temp_appoint_goods_ids = [];
if((appoint_goods_ids || null) != null) {
temp_appoint_goods_ids = appoint_goods_ids.split(',').map(function(v){return parseInt(v);});
}
//
var selected_count = 0;
var ids = [];
buy_cart_data_params(appoint_goods_ids = null) {
var data_list = [];
var temp_data_list = this.data_list || [];
for (var i in temp_data_list) {
if ((temp_data_list[i]['is_error'] || 0) == 0 && (temp_data_list[i]['selected'] || false) == true && (temp_appoint_goods_ids.length == 0 || temp_appoint_goods_ids.indexOf(parseInt(temp_data_list[i]['goods_id'])) != -1)) {
ids.push(temp_data_list[i]['id']);
selected_count++;
if ((temp_data_list[i]['selected'] || false) == true) {
data_list.push(temp_data_list[i]);
}
}
if (selected_count <= 0) {
var data = app.globalData.buy_cart_data_params(data_list, appoint_goods_ids);
if(data === false) {
this.setData({
preferential_price: 0,
increase_price: 0,
@ -1088,19 +1081,13 @@
total_num: 0,
discount_detail_list: [],
});
return false;
}
//
var data = {
buy_type: 'cart',
ids: ids.join(','),
};
//
if (this.cart_type_value == 'realstore' && (this.plugins_realstore_info || null) != null) {
var type_data = this.$refs.realstore_cart.buy_use_type_data();
data['buy_use_type_data_index'] = type_data.data_index;
data['realstore_id'] = this.plugins_realstore_info.id;
} else {
//
if (this.cart_type_value == 'realstore' && (this.plugins_realstore_info || null) != null) {
var type_data = this.$refs.realstore_cart.buy_use_type_data();
data['buy_use_type_data_index'] = type_data.data_index;
data['realstore_id'] = this.plugins_realstore_info.id;
}
}
return data;
},
@ -1108,7 +1095,7 @@
//
buy_submit_event(e) {
//
var buy_data = this.buy_data_params();
var buy_data = this.buy_cart_data_params();
if (buy_data === false) {
app.globalData.showToast(this.$t('cart.cart.3sy0mp'));
return false;
@ -1122,7 +1109,7 @@
}
//
this.to_buy_handle(buy_data);
app.globalData.to_buy_handle(buy_data);
},
//
@ -1145,11 +1132,11 @@
plugins_hospital_prescription_status: true
});
} else {
this.to_buy_handle(buy_data);
app.globalData.to_buy_handle(buy_data);
}
} else {
if (app.globalData.is_login_check(res.data)) {
this.to_buy_handle(buy_data);
app.globalData.to_buy_handle(buy_data);
} else {
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
}
@ -1166,13 +1153,13 @@
hospital_prescription_confirm_event(e) {
var index = e.currentTarget.dataset.index || 0;
var data = this.plugins_hospital_prescription_data.choice_data[index];
var buy_data = this.buy_data_params(data.goods_ids);
var buy_data = this.buy_cart_data_params(data.goods_ids);
//
if(data.type == 'prescription') {
this.to_buy_handle(buy_data, '/pages/plugins/hospital/prescription/prescription');
app.globalData.to_buy_handle(buy_data, '/pages/plugins/hospital/prescription/prescription');
} else {
//
this.to_buy_handle(buy_data);
app.globalData.to_buy_handle(buy_data);
}
},
@ -1183,11 +1170,6 @@
});
},
//
to_buy_handle(buy_data, pages = '/pages/buy/buy') {
app.globalData.url_open(pages+'?data=' + encodeURIComponent(base64.encode(JSON.stringify(buy_data))));
},
//
exhibition_submit_event(e) {
app.globalData.call_tel(this.common_app_customer_service_tel);

View File

@ -360,6 +360,31 @@
</block>
</view>
</view>
<!-- 互联网医院问诊下单弹窗 -->
<component-popup :propShow="plugins_hospital_prescription_status" propPosition="bottom" @onclose="hospital_prescription_close_event">
<view class="padding-horizontal-main padding-top-main bg-white">
<view class="oh tc">
<text class="text-size">{{ (plugins_hospital_prescription_data || null) != null ? (plugins_hospital_prescription_data.title || '') : '' }}</text>
<view class="fr" @tap.stop="hospital_prescription_close_event">
<iconfont name="icon-close-line" size="28rpx" color="#999"></iconfont>
</view>
</view>
<view class="padding-vertical-main">
<block v-if="(plugins_hospital_prescription_data || null) != null && plugins_hospital_prescription_data.choice_data.length > 0">
<block v-for="(item, index) in plugins_hospital_prescription_data.choice_data" :key="index">
<view class="padding-vertical-xxl pr">
<text>{{item.name}}</text>
<button type="default" size="mini" class="bg-main br-main cr-white round text-size-xs pa top-xxxxxl right-0" :data-index="index" @tap="hospital_prescription_confirm_event">{{item.btn_text}}</button>
</view>
</block>
</block>
<block v-else>
<component-no-data></component-no-data>
</block>
</view>
</view>
</component-popup>
<!-- 公共 -->
<component-common ref="common" @onFooterHeight="footer_height_value_event" :propIsFooterSeat="false"></component-common>
@ -457,6 +482,9 @@
botton_nav_style: '',
cart_content_style: '',
footer_height_value: 0,
//
plugins_hospital_prescription_data: null,
plugins_hospital_prescription_status: false
};
},
@ -1308,33 +1336,95 @@
});
},
//
// appoint_goods_ids idid
buy_cart_data_params(appoint_goods_ids = null) {
if ((this.cart || null) != null) {
return app.globalData.buy_cart_data_params(this.cart.data || [], appoint_goods_ids);
}
return false;
},
//
buy_submit_event(e) {
if (!app.globalData.is_single_page_check()) {
return false;
}
//
var ids = [];
if ((this.cart || null) != null) {
var temp_data = this.cart.data || [];
for (var i in temp_data) {
if (temp_data[i]['is_error'] == 0) {
ids.push(temp_data[i]['id']);
}
}
}
if (ids.length <= 0) {
//
var buy_data = this.buy_cart_data_params();
if (buy_data === false) {
app.globalData.showToast(this.$t('goods-category.goods-category.5pj8ip'));
return false;
}
//
var data = {
buy_type: 'cart',
ids: ids.join(','),
};
app.globalData.url_open('/pages/buy/buy?data=' + encodeURIComponent(base64.encode(JSON.stringify(data))));
//
var is_goods_is_prescription = parseInt(app.globalData.get_config('plugins_base.hospital.data.is_goods_is_prescription', 0));
if(is_goods_is_prescription == 1) {
this.plugins_hospital_prescription_handle(buy_data);
return false;
}
//
app.globalData.to_buy_handle(buy_data);
},
//
plugins_hospital_prescription_handle(buy_data) {
uni.showLoading({
title: this.$t('common.processing_in_text'),
});
uni.request({
url: app.globalData.get_request_url('savecheck', 'prescription', 'hospital'),
method: 'POST',
data: buy_data,
dataType: 'json',
success: (res) => {
uni.hideLoading();
if (res.data.code == 0) {
var data = res.data.data;
if((data.choice_data || null) != null && data.choice_data.length > 0) {
this.setData({
plugins_hospital_prescription_data: data,
plugins_hospital_prescription_status: true
});
} else {
app.globalData.to_buy_handle(buy_data);
}
} else {
if (app.globalData.is_login_check(res.data)) {
app.globalData.to_buy_handle(buy_data);
} else {
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
}
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
//
hospital_prescription_confirm_event(e) {
var index = e.currentTarget.dataset.index || 0;
var data = this.plugins_hospital_prescription_data.choice_data[index];
var buy_data = this.buy_cart_data_params(data.goods_ids);
//
if(data.type == 'prescription') {
app.globalData.to_buy_handle(buy_data, '/pages/plugins/hospital/prescription/prescription');
} else {
//
app.globalData.to_buy_handle(buy_data);
}
},
//
hospital_prescription_close_event(e) {
this.setData({
plugins_hospital_prescription_status: false
});
},
//