源文件
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav-base .item {
|
||||
width: 20%;
|
||||
}
|
||||
273
pages/plugins/realstore/batchorder-list/batchorder-list.vue
Normal file
273
pages/plugins/realstore/batchorder-list/batchorder-list.vue
Normal file
@@ -0,0 +1,273 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 导航 -->
|
||||
<view class="nav-base bg-white">
|
||||
<block v-for="(item, index) in nav_status_list" :key="index">
|
||||
<view v-if="nav_status_index == index" class="item fl tc cr-main nav-active-line" :data-index="index" @tap="nav_event">{{ item.name }}</view>
|
||||
<view v-else class="item fl tc" :data-index="index" @tap="nav_event">{{ item.name }}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 数据列表 -->
|
||||
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view v-if="data_list.length > 0" class="padding-horizontal-main padding-top-main">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="list-item padding-horizontal-main padding-top-main border-radius-main bg-white oh spacing-mb">
|
||||
<view class="item-base oh br-b padding-bottom-main">
|
||||
<text class="fl cr-base">{{ item.add_time }}</text>
|
||||
<text class="fr cr-red"
|
||||
>{{ item.status_name }}<text v-if="(item.is_under_line_text || null) != null">({{ item.is_under_line_text }})</text></text
|
||||
>
|
||||
</view>
|
||||
<view class="br-b padding-vertical-main">
|
||||
<view class="cr-base">{{ item.name }}</view>
|
||||
<view v-if="(item.describe || null) != null" class="cr-grey margin-top-xs">{{ item.describe }}</view>
|
||||
</view>
|
||||
<block v-if="(item.detail_data || null) != null && item.detail_data.length > 0">
|
||||
<view v-for="(detail, di) in item.detail_data" :key="di" class="br-b-dashed oh padding-vertical-main">
|
||||
<block v-for="(fv, fi) in content_list" :key="fi">
|
||||
<view class="single-text margin-top-xs">
|
||||
<text class="cr-grey margin-right-xl">{{ fv.name }}</text>
|
||||
<text class="cr-base">{{ detail[fv.field] }}</text>
|
||||
<text v-if="(fv.unit || null) != null" class="cr-grey">{{ fv.unit }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
params: null,
|
||||
nav_status_list: [
|
||||
{ name: this.$t('common.all'), value: "-1" },
|
||||
{ name: this.$t('profit.profit.3c7zmg'), value: "0" },
|
||||
{ name: this.$t('batchorder-list.batchorder-list.25sh5e'), value: "1" },
|
||||
{ name: this.$t('order.order.15lr5l'), value: "2" },
|
||||
{ name: this.$t('order.order.6390gk'), value: "3" },
|
||||
],
|
||||
nav_status_index: 0,
|
||||
content_list: [
|
||||
{ name: this.$t('form.form.xy87t8'), field: "describe" },
|
||||
{ name: this.$t('common.note'), field: "note" },
|
||||
{ name: this.$t('buy.buy.s7rr5s'), field: "upd_time" },
|
||||
{ name: this.$t('invoice-detail.invoice-detail.rrfex6'), field: "status_name" },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 是否指定状态
|
||||
var nav_status_index = 0;
|
||||
if ((params.status || null) != null) {
|
||||
for (var i in this.nav_status_list) {
|
||||
if (this.nav_status_list[i]["value"] == params.status) {
|
||||
nav_status_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
params: params,
|
||||
nav_status_index: nav_status_index,
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
this.get_data_list();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 参数
|
||||
var status = (this.nav_status_list[this.nav_status_index] || null) == null ? -1 : this.nav_status_list[this.nav_status_index]["value"];
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "batchorder", "realstore"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data_page,
|
||||
status: status,
|
||||
oid: this.params.oid || 0,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.data.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = res.data.data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = res.data.data.data;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: res.data.data.total,
|
||||
data_page_total: res.data.data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, "get_data_list")) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
nav_status_index: e.currentTarget.dataset.index || 0,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
|
||||
// 重新拉取数据
|
||||
this.get_data_list(1);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./batchorder-list.css";
|
||||
</style>
|
||||
157
pages/plugins/realstore/check/check.vue
Normal file
157
pages/plugins/realstore/check/check.vue
Normal file
@@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="padding-main">
|
||||
<form @submit="form_submit" class="form-container">
|
||||
<view class="border-radius-main bg-white padding-main padding-bottom-xxxxl spacing-mb">
|
||||
<view class="title fw-b text-size margin-vertical-xxxl">{{$t('common.verification_text')}}</view>
|
||||
<view class="flex-row align-c padding-bottom-xl">
|
||||
<!-- #ifndef H5 -->
|
||||
<view class="margin-right" @tap="scan_event">
|
||||
<uni-icons type="scan" size="56rpx" color="#666"></uni-icons>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<input type="text" class="wh-auto check-value" :placeholder="$t('common.verification_message')" placeholder-class="cr-grey-c" :value="check_value" @input="check_event" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-main">
|
||||
<button type="default" form-type="submit" hover-class="none" class="br-main bg-main cr-white round text-size-lg" :disabled="form_submit_loading">{{$t('common.confirm')}}</button>
|
||||
</view>
|
||||
<view class="padding-lg margin-top-xl text-size-lg tc">
|
||||
<text v-if="(error_msg || null) != null" class="cr-red">{{error_msg}}</text>
|
||||
<text v-if="(success_msg || null) != null" class="cr-green">{{success_msg}}</text>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
form_submit_loading: false,
|
||||
check_value: '',
|
||||
error_msg: '',
|
||||
success_msg: ''
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
init() {
|
||||
app.globalData.get_user_info(this, "init");
|
||||
},
|
||||
|
||||
// 输入事件
|
||||
check_event(e) {
|
||||
this.setData({
|
||||
check_value: e.detail.value
|
||||
});
|
||||
},
|
||||
|
||||
// 扫码事件
|
||||
scan_event(e) {
|
||||
var self = this;
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
if((res.result || null) != null) {
|
||||
self.setData({
|
||||
check_value: res.result
|
||||
});
|
||||
self.form_submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 表单提交
|
||||
form_submit() {
|
||||
this.setData({
|
||||
error_msg: '',
|
||||
success_msg: ''
|
||||
});
|
||||
var form_data = {
|
||||
extraction_code: this.check_value
|
||||
}
|
||||
var validation = [
|
||||
{ fields: 'extraction_code', msg: this.$t('common.verification_message') }
|
||||
];
|
||||
if (app.globalData.fields_check(form_data, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
this.setData({
|
||||
form_submit_loading: true
|
||||
});
|
||||
var temp_code = this.check_value;
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('verification', 'adminorderallot', 'realstore'),
|
||||
method: 'POST',
|
||||
data: form_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
check_value: '',
|
||||
error_msg: '',
|
||||
success_msg: res.data.msg+'('+temp_code+')',
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'form_submit')) {
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
error_msg: res.data.msg+'('+temp_code+')',
|
||||
success_msg: '',
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
error_msg: this.$t('common.internet_error_tips')+'('+temp_code+')',
|
||||
success_msg: '',
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
input.check-value {
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
font-size: 44rpx;
|
||||
}
|
||||
</style>
|
||||
163
pages/plugins/realstore/detail/detail.css
Normal file
163
pages/plugins/realstore/detail/detail.css
Normal file
@@ -0,0 +1,163 @@
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
/**
|
||||
* 头部内容
|
||||
*/
|
||||
.header-content {
|
||||
margin-top: 20rpx;
|
||||
box-shadow: 0 0 8px rgb(0 0 0 / 6%);
|
||||
min-height: 242rpx;
|
||||
}
|
||||
.header-content .address-content {
|
||||
max-width: calc(100% - 100rpx);
|
||||
}
|
||||
.header-content .icon-list {
|
||||
right: 20rpx;
|
||||
bottom: 20rpx;
|
||||
}
|
||||
.header-content .icon-list .icon-item {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
.header-content .icon-list .icon-item.red {
|
||||
background-color: rgba(226, 44, 8, 0.08);
|
||||
}
|
||||
.header-content .icon-list .icon-item.green {
|
||||
background-color: #EEF9E9;
|
||||
}
|
||||
.header-content .icon-item .badge-icon {
|
||||
top: -10px;
|
||||
right: 2px;
|
||||
}
|
||||
.header-content .icon-list .icon-item:not(:last-child) {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
.header-content .logo {
|
||||
width: 100rpx;
|
||||
}
|
||||
.header-content .base-right .title-length-limit {
|
||||
max-width: calc(100% - 100rpx);
|
||||
}
|
||||
.header-content .base-right .title-length-limit .title-content.switch {
|
||||
max-width: calc(100% - 44rpx);
|
||||
}
|
||||
.header-content .base-right .use-type-icon {
|
||||
border-top-left-radius: 8rpx;
|
||||
border-bottom-left-radius: 8rpx;
|
||||
right: 0;
|
||||
padding: 5rpx 10rpx 5rpx 20rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 桌码
|
||||
*/
|
||||
.tablecode {
|
||||
background: rgb(255 255 255 / 60%);
|
||||
padding: 2rpx 20rpx;
|
||||
/* #ifdef MP-ALIPAY || MP-TOUTIAO */
|
||||
margin-top: 15rpx;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
/**
|
||||
* 左侧导航
|
||||
*/
|
||||
.left-content-actual {
|
||||
padding-bottom: 160rpx;
|
||||
}
|
||||
.left-content {
|
||||
width: 186rpx;
|
||||
}
|
||||
.left-content .item {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
padding: 0 10rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.left-content .badge-icon {
|
||||
top: -16rpx;
|
||||
right: 26rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 右侧内容
|
||||
*/
|
||||
.right-content-actual {
|
||||
padding-bottom: calc(145rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
.right-content-actual.base-mode-goods {
|
||||
padding-bottom: calc(40rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
.goods-list-top-nav {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 3;
|
||||
}
|
||||
.nav-sort-content .sort-item {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
width: 20%;
|
||||
}
|
||||
.nav-sort-content .sort-item .sort-icon {
|
||||
width: 26rpx;
|
||||
height: 26rpx !important;
|
||||
}
|
||||
.goods-list .goods-img {
|
||||
width: 160rpx;
|
||||
height: 160rpx !important;
|
||||
}
|
||||
.goods-list .goods-base-content {
|
||||
min-height: 100rpx;
|
||||
}
|
||||
.goods-list .goods-base .simple-desc {
|
||||
line-height: 30rpx;
|
||||
min-height: 30rpx;
|
||||
max-height: 58rpx;
|
||||
}
|
||||
.goods-list .goods-base .sales-price {
|
||||
width: calc(100% - 140rpx);
|
||||
}
|
||||
.goods-list .goods-base .buy-number {
|
||||
min-width: 32rpx;
|
||||
}
|
||||
.goods-list .goods-item.item-highlight {
|
||||
box-shadow: 0rpx 8rpx 12rpx 0px rgba(0, 0, 0, 0.06);
|
||||
background: #F7FBF6 !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 独立模式下底部操作导航
|
||||
*/
|
||||
.button-list {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.button-list .item {
|
||||
height: 70rpx;
|
||||
padding: 0 40rpx;
|
||||
}
|
||||
.button-list .button-left {
|
||||
display: flex;
|
||||
width: 50%;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
.button-list .button-right {
|
||||
display: flex;
|
||||
width: 50%;
|
||||
}
|
||||
.button-list .button-right button {
|
||||
line-height: 70rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 阴影效果
|
||||
*/
|
||||
.box-shadow {
|
||||
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
1110
pages/plugins/realstore/detail/detail.vue
Normal file
1110
pages/plugins/realstore/detail/detail.vue
Normal file
File diff suppressed because it is too large
Load Diff
8
pages/plugins/realstore/favor/favor.css
Normal file
8
pages/plugins/realstore/favor/favor.css
Normal file
@@ -0,0 +1,8 @@
|
||||
.base {
|
||||
min-height: 140rpx;
|
||||
margin-left: 160rpx;
|
||||
}
|
||||
.logo {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
}
|
||||
262
pages/plugins/realstore/favor/favor.vue
Normal file
262
pages/plugins/realstore/favor/favor.vue
Normal file
@@ -0,0 +1,262 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view v-if="data_list.length > 0" class="padding-horizontal-main padding-top-main">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main border-radius-main oh bg-white spacing-mb">
|
||||
<view :data-value="'/pages/plugins/realstore/detail/detail?id=' + item.realstore_info.id" @tap="url_event" class="cp">
|
||||
<image class="logo fl radius" :src="item.realstore_info.logo" mode="aspectFill"></image>
|
||||
<view class="base">
|
||||
<view class="single-text fw-b">{{item.realstore_info.name}}</view>
|
||||
<view class="multi-text cr-grey margin-top-sm">{{item.realstore_info.describe}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="br-yellow cr-yellow bg-white fr round" type="default" size="mini" @tap="cancel_event" :data-value="item.id" :data-index="index" hover-class="none">{{$t('common.cancel')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
this.get_data_list();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if(this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "favor", "realstore"),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page
|
||||
},
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.data.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = res.data.data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = res.data.data.data;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: res.data.data.total,
|
||||
data_page_total: res.data.data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: (this.data_page > 1 && this.data_page > this.data_page_total)
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_is_loading: 0
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_is_loading: 0
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 取消
|
||||
cancel_event(e) {
|
||||
uni.showModal({
|
||||
title: this.$t('common.warm_tips'),
|
||||
content: this.$t('order.order.pn78ns'),
|
||||
confirmText: this.$t('common.confirm'),
|
||||
cancelText: this.$t('recommend-list.recommend-list.w9460o'),
|
||||
success: result => {
|
||||
if (result.confirm) {
|
||||
// 参数
|
||||
var id = e.currentTarget.dataset.value;
|
||||
var index = e.currentTarget.dataset.index;
|
||||
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text')
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("delete", "favor", "realstore"),
|
||||
method: 'POST',
|
||||
data: {
|
||||
ids: id
|
||||
},
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
uni.hideLoading();
|
||||
|
||||
if (res.data.code == 0) {
|
||||
var temp_data_list = this.data_list;
|
||||
temp_data_list.splice(index, 1);
|
||||
this.setData({
|
||||
data_list: temp_data_list
|
||||
});
|
||||
if (temp_data_list.length == 0) {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
}
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './favor.css';
|
||||
</style>
|
||||
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav-base .item {
|
||||
width: 20%;
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 导航 -->
|
||||
<view class="nav-base bg-white">
|
||||
<block v-for="(item, index) in nav_status_list" :key="index">
|
||||
<view v-if="nav_status_index == index" class="item fl tc cr-main nav-active-line" :data-index="index" @tap="nav_event">{{ item.name }}</view>
|
||||
<view v-else class="item fl tc" :data-index="index" @tap="nav_event">{{ item.name }}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 数据列表 -->
|
||||
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view v-if="data_list.length > 0" class="padding-horizontal-main padding-top-main">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="list-item padding-horizontal-main padding-top-main border-radius-main bg-white oh spacing-mb">
|
||||
<view class="item-base oh br-b padding-bottom-main">
|
||||
<text class="fl cr-base">{{ item.add_time }}</text>
|
||||
<text class="fr cr-red"
|
||||
>{{ item.status_name }}<text v-if="(item.is_under_line_text || null) != null">({{ item.is_under_line_text }})</text></text
|
||||
>
|
||||
</view>
|
||||
<view class="br-b padding-vertical-main">
|
||||
<view class="cr-base">{{ item.name }}</view>
|
||||
<view v-if="(item.describe || null) != null" class="cr-grey margin-top-xs">{{ item.describe }}</view>
|
||||
</view>
|
||||
<view class="padding-vertical-main">
|
||||
<block v-for="(fv, fi) in content_list" :key="fi">
|
||||
<view class="single-text margin-top-xs">
|
||||
<text class="cr-grey margin-right-xl">{{ fv.name }}</text>
|
||||
<text class="cr-base">{{ item[fv.field] }}</text>
|
||||
<text v-if="(fv.unit || null) != null" class="cr-grey">{{ fv.unit }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="item-operation tr br-t padding-vertical-main">
|
||||
<button class="round bg-white cr-green br-green" type="default" size="mini" @tap="url_event" :data-value="'/pages/plugins/realstore/frequencycard-used/frequencycard-used?cuid=' + item.id" hover-class="none">{{$t('frequencycard-list.frequencycard-list.cgy327')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
params: null,
|
||||
nav_status_list: [
|
||||
{ name: this.$t('common.all'), value: "-1" },
|
||||
{ name: this.$t('frequencycard-list.frequencycard-list.954ewh'), value: "0" },
|
||||
{ name: this.$t('frequencycard-list.frequencycard-list.8x98g7'), value: "1" },
|
||||
{ name: this.$t('frequencycard-list.frequencycard-list.5n3ums'), value: "2" },
|
||||
{ name: this.$t('frequencycard-list.frequencycard-list.n36x3w'), value: "3" },
|
||||
],
|
||||
nav_status_index: 0,
|
||||
content_list: [
|
||||
{ name: this.$t('frequencycard-list.frequencycard-list.cx75t7'), field: "valid_number", unit: this.$t('buy.buy.0pgsrm') },
|
||||
{ name: this.$t('frequencycard-list.frequencycard-list.3m1w12'), field: "use_number", unit: this.$t('buy.buy.0pgsrm') },
|
||||
{ name: this.$t('frequencycard-list.frequencycard-list.89t8am'), field: "start_time" },
|
||||
{ name: this.$t('team.team.iee9bp'), field: "end_time" },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 是否指定状态
|
||||
var nav_status_index = 0;
|
||||
if ((params.status || null) != null) {
|
||||
for (var i in this.nav_status_list) {
|
||||
if (this.nav_status_list[i]["value"] == params.status) {
|
||||
nav_status_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
params: params,
|
||||
nav_status_index: nav_status_index,
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
this.get_data_list();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 参数
|
||||
var status = (this.nav_status_list[this.nav_status_index] || null) == null ? -1 : this.nav_status_list[this.nav_status_index]["value"];
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "frequencycard", "realstore"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data_page,
|
||||
status: status,
|
||||
oid: this.params.oid || 0,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.data.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = res.data.data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = res.data.data.data;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: res.data.data.total,
|
||||
data_page_total: res.data.data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, "get_data_list")) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
nav_status_index: e.currentTarget.dataset.index || 0,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
|
||||
// 重新拉取数据
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./frequencycard-list.css";
|
||||
</style>
|
||||
@@ -0,0 +1,217 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view v-if="data_list.length > 0" class="padding-horizontal-main padding-top-main">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="list-item padding-horizontal-main padding-top-main border-radius-main bg-white oh spacing-mb">
|
||||
<view class="item-base oh br-b padding-bottom-main">
|
||||
<text class="fl cr-base">{{ item.add_time }}</text>
|
||||
</view>
|
||||
<view class="padding-vertical-main">
|
||||
<block v-for="(fv, fi) in content_list" :key="fi">
|
||||
<view class="single-text margin-top-xs">
|
||||
<text class="cr-grey margin-right-xl">{{ fv.name }}</text>
|
||||
<text class="cr-base">{{ item[fv.field] }}</text>
|
||||
<text v-if="(fv.unit || null) != null" class="cr-grey">{{ fv.unit }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
params: null,
|
||||
content_list: [
|
||||
{ name: this.$t('frequencycard-used.frequencycard-used.538686'), field: "dec_number", unit: this.$t('buy.buy.0pgsrm') },
|
||||
{ name: this.$t('frequencycard-used.frequencycard-used.xjmepo'), field: "msg" },
|
||||
{ name: this.$t('frequencycard-used.frequencycard-used.aod4pc'), field: "operate_name" },
|
||||
{ name: this.$t('common.use_time'), field: "use_time" },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
this.get_data_list();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("usedlist", "frequencycard", "realstore"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data_page,
|
||||
cuid: this.params.cuid || 0,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.data.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = res.data.data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = res.data.data.data;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: res.data.data.total,
|
||||
data_page_total: res.data.data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, "get_data_list")) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
76
pages/plugins/realstore/index/index.css
Normal file
76
pages/plugins/realstore/index/index.css
Normal file
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* 头部
|
||||
*/
|
||||
page {
|
||||
background-color: #F7EDE1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置和搜索
|
||||
*/
|
||||
.nav-location {
|
||||
line-height: 95rpx;
|
||||
}
|
||||
.nav-location .icon-arrow-down {
|
||||
top: 34rpx;
|
||||
}
|
||||
.nav-search {
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 位置选择提示
|
||||
*/
|
||||
.choice-location-tips {
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.choice-location-tips .content {
|
||||
margin-top: 30%;
|
||||
width: 520rpx;
|
||||
}
|
||||
|
||||
.choice-location-tips .content .close {
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 已选门店
|
||||
*/
|
||||
.user-choice-realstore .logo {
|
||||
width: 100rpx;
|
||||
}
|
||||
.user-choice-realstore .address-content {
|
||||
max-width: calc(100% - 100rpx);
|
||||
}
|
||||
.user-choice-realstore .checked {
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 50rpx;
|
||||
height: 38rpx;
|
||||
border-bottom-left-radius: 100rpx;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 媒体查询
|
||||
*/
|
||||
@media only screen and (min-width:960px) {
|
||||
.realstore-nav-bg {
|
||||
/* #ifdef H5 */
|
||||
background-size: cover;
|
||||
/* #endif */
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width:960px) {
|
||||
.realstore-nav-bg {
|
||||
/* #ifdef H5 */
|
||||
background-size: auto 100%;
|
||||
/* #endif */
|
||||
}
|
||||
}
|
||||
461
pages/plugins/realstore/index/index.vue
Normal file
461
pages/plugins/realstore/index/index.vue
Normal file
@@ -0,0 +1,461 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="(data_base || null) != null">
|
||||
<!-- 强制选择一个门店模式 -->
|
||||
<view v-if="is_force_choice_realstore == 1" class="padding-main tc">
|
||||
<!-- 位置展示 -->
|
||||
<component-choice-location ref="choice_location" propBaseColor="#333" @onBack="user_back_choice_location"></component-choice-location>
|
||||
<!-- 提示信息 -->
|
||||
<view class="padding-bottom-xxxxl margin-top-sm">
|
||||
<block v-if="(user_choice_realstore || null) == null">
|
||||
<image :src="not_choice_realstore_images" class="dis-block wh-auto" mode="widthFix"></image>
|
||||
<view v-if="(data_base.home_not_choice_realstore_msg || null) != null" class="cr-grey margin-top-xl">{{data_base.home_not_choice_realstore_msg}}</view>
|
||||
<view class="padding-horizontal-xxxl">
|
||||
<button type="default" class="bg-main br-main cr-white text-size-sm margin-top-xxl round" hover-class="none" @tap="realstore_choice_event">{{$t('realstore-cart.realstore-cart.87tty2')}}</button>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 已选择的门店 -->
|
||||
<block v-else>
|
||||
<view class="padding-main border-radius-main bg-white br-main pr oh tl user-choice-realstore">
|
||||
<view class="checked pa bg-main lh-sm tc padding-top-xs padding-left-xs">
|
||||
<iconfont name="icon-checked" size="32rpx" color="#fff"></iconfont>
|
||||
</view>
|
||||
<view class="base flex-row oh">
|
||||
<!-- 基础内容 -->
|
||||
<image :src="user_choice_realstore.logo" mode="widthFix" class="logo circle fl br"></image>
|
||||
<view class="base-right padding-left-sm flex-1 flex-width">
|
||||
<view class="padding-right-lg">
|
||||
<view class="single-text dis-inline-block va-m">
|
||||
<text v-if="(user_choice_realstore.alias || null) != null" class="va-m border-radius-sm br-main cr-main text-size-xs padding-left-sm padding-right-sm margin-right-xs">{{ user_choice_realstore.alias }}</text>
|
||||
<text class="va-m fw-b text-size">{{ user_choice_realstore.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 地址 -->
|
||||
<view class="flex-row align-s align-c margin-top-sm">
|
||||
<iconfont name="icon-map-address" size="28rpx" propClass="pr top-xs"></iconfont>
|
||||
<view class="address-content single-text cr-base margin-left-xs text-size-sm" :data-value="user_choice_realstore.province_name + user_choice_realstore.city_name + user_choice_realstore.county_name + user_choice_realstore.address" @tap="text_copy_event">
|
||||
{{ user_choice_realstore.province_name }}{{ user_choice_realstore.city_name }}{{ user_choice_realstore.county_name }}{{ user_choice_realstore.address }}
|
||||
</view>
|
||||
<!-- #ifndef MP-KUAISHOU -->
|
||||
<view v-if="user_choice_realstore.lat != 0 && user_choice_realstore.lng != 0" class="tc cp border-radius-sm text-size-xss cr-green br-green padding-horizontal-xs margin-left-xs" @tap="address_map_event">{{$t('detail.detail.688i26')}}</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pr margin-top">
|
||||
<view class="text-size-xs cr-grey">
|
||||
<view v-if="(user_choice_realstore.status_info.time || null) != null">{{$t('detail.detail.dor2v9')}}{{ user_choice_realstore.status_info.time }}</view>
|
||||
<view v-if="(user_choice_realstore.distance || null) != null">{{$t('extraction-address.extraction-address.42v8tv')}}{{ user_choice_realstore.distance }}</view>
|
||||
</view>
|
||||
<button type="default" size="mini" class="bg-main-light br-main cr-main text-size-xss round pa bottom-0 right-0" hover-class="none" :data-value="user_choice_realstore.url" @tap="url_event">{{$t('realstore-cart.realstore-cart.r67uyg')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="(data_base.home_already_choice_realstore_msg || null) != null" class="cr-grey margin-top-xl">{{data_base.home_already_choice_realstore_msg}}</view>
|
||||
<view class="padding-horizontal-xxxl">
|
||||
<button type="default" class="bg-main br-main cr-white text-size-sm margin-top-xxl round" hover-class="none" @tap="realstore_choice_event">{{$t('realstore-cart.realstore-cart.76rfgh')}}</button>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<block v-else>
|
||||
<view class="realstore-nav-bg">
|
||||
<!-- 背景图片 -->
|
||||
<image :src="plugins_static_url + 'title-bg'+(screen_width > 960 ? '-pc' : '')+'.png'" mode="widthFix" class="wh-auto pa bg-img" />
|
||||
<!-- 顶部 -->
|
||||
<view class="spacing-mb pr z-i cr-white">
|
||||
<!-- 位置展示 -->
|
||||
<view class="nav-location single-text dis-inline-block bs-bb pr padding-left-main padding-right-xl margin-top">
|
||||
<component-choice-location ref="choice_location" @onBack="user_back_choice_location"></component-choice-location>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 搜索 -->
|
||||
<view class="nav-search padding-main">
|
||||
<component-search @onsearch="search_button_event" :propIsOnEvent="true" :propIsRequired="false" :propPlaceholder="$t('index.index.c5273j')" propPlaceholderClass="cr-grey-c"></component-search>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 轮播 -->
|
||||
<view v-if="slider_list.length > 0" class="padding-horizontal-main">
|
||||
<component-banner :propData="slider_list"></component-banner>
|
||||
</view>
|
||||
|
||||
<!-- 图标 -->
|
||||
<view v-if="icon_list.length > 0" class="padding-horizontal-main spacing-mb">
|
||||
<view class="bg-white border-radius-main">
|
||||
<component-icon-nav :propData="{...{data: icon_list}, ...{random: random_value}}"></component-icon-nav>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 列表 -->
|
||||
<block v-if="data_list.length > 0">
|
||||
<view class="padding-horizontal-main">
|
||||
<!-- 导航 -->
|
||||
<component-title :propTitle="data_base.home_data_list_title || $t('index.index.1vf378')" :propMoreUrl="'/pages/plugins/realstore/search/search'+(is_force_choice_realstore == 1 ? '?is_choice_mode=1&choice_mode_back_type=realstore-detail&is_open_realstore_redirect=0' : '')"></component-title>
|
||||
<!-- 数据列表 -->
|
||||
<component-realstore-list :propData="{data: data_list}" :propFavorUser="favor_user" :propIsChoice="is_force_choice_realstore == 1" propIsChoiceBackType="realstore-detail" :propIsOpenRealstoreRedirect="false"></component-realstore-list>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</block>
|
||||
|
||||
<!-- 位置选择提示 -->
|
||||
<view v-if="location_tips_close_status && (data_base.is_home_choice_location || 0) == 1 && ((data_base.home_choice_location_images || null) != null || (data_base.home_choice_location_msg || null) != null)" class="choice-location-tips pf wh-auto ht-auto tc bs-bb">
|
||||
<view class="content bg-white auto padding-xxxl pr radius">
|
||||
<view v-if="(data_base.is_home_choice_location_force || 0) == 0" class="close oh pa">
|
||||
<view @tap="location_tips_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-lg">
|
||||
<image v-if="(data_base.home_choice_location_images || null) != null" class="icon max-w" :src="data_base.home_choice_location_images" mode="widthFix"></image>
|
||||
<view v-if="(data_base.home_choice_location_msg || null) != null" class="cr-base margin-top-lg">{{ data_base.home_choice_location_msg }}</view>
|
||||
<button type="default" class="bg-main br-main cr-white text-size-sm margin-top-xxl round" hover-class="none" @tap="choose_user_location_event">{{$t('index.index.t3d917')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
import componentSearch from '@/components/search/search';
|
||||
import componentBanner from '@/components/slider/slider';
|
||||
import componentIconNav from '@/components/icon-nav/icon-nav';
|
||||
import componentRealstoreList from '@/components/realstore-list/realstore-list';
|
||||
import componentTitle from '@/components/title/title';
|
||||
import componentChoiceLocation from '@/components/choice-location/choice-location';
|
||||
var plugins_static_url = app.globalData.get_static_url('realstore', true);
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
plugins_static_url: plugins_static_url,
|
||||
screen_width: parseInt(app.globalData.get_system_info('windowWidth', 0, true)),
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: null,
|
||||
is_first: 1,
|
||||
data_base: null,
|
||||
search_keywords_value: '',
|
||||
favor_user: [],
|
||||
slider_list: [],
|
||||
icon_list: [],
|
||||
data_list: [],
|
||||
// 用户选择的门店
|
||||
not_choice_realstore_images: plugins_static_url+'app/index/not-choice-realstore-images.png',
|
||||
user_choice_realstore: null,
|
||||
// 强制选择门店
|
||||
is_force_choice_realstore: 0,
|
||||
// 强制自动选择第一个门店
|
||||
is_force_auto_choice_realstore: 0,
|
||||
// 强制自动选择第一个门店的最低距离条件
|
||||
force_auto_choice_realstore_distance: 0,
|
||||
// 用户位置信息
|
||||
user_location: {},
|
||||
location_tips_close_status: false,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
// 增加随机数,避免无法监听数据列表内部数据更新
|
||||
random_value: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentSearch,
|
||||
componentBanner,
|
||||
componentIconNav,
|
||||
componentRealstoreList,
|
||||
componentTitle,
|
||||
componentChoiceLocation
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
|
||||
// #ifdef H5
|
||||
// 监听屏幕宽度和高度变化
|
||||
window.addEventListener('resize', this.handle_resize, true);
|
||||
// #endif
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 门店选择初始化
|
||||
this.realstore_choice_init();
|
||||
|
||||
// 用户位置初始化
|
||||
this.user_location_init();
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
if(this.data_list_loding_status === 1) {
|
||||
uni.stopPullDownRefresh();
|
||||
} else {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 页面销毁时执行
|
||||
onUnload: function () {
|
||||
// #ifdef H5
|
||||
window.removeEventListener('resize', this.handle_resize);
|
||||
// #endif
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
get_data(params = {}) {
|
||||
// 网络检查
|
||||
if((params || null) == null || (params.loading || 0) == 0) {
|
||||
app.globalData.network_type_handle(this, 'get_data', params);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 请求数据
|
||||
var lng = 0;
|
||||
var lat = 0;
|
||||
if ((this.user_location || null) != null) {
|
||||
lng = this.user_location.lng || 0;
|
||||
lat = this.user_location.lat || 0;
|
||||
}
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index', 'realstore'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
lng: lng,
|
||||
lat: lat,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var data_list = data.data_list || [];
|
||||
var data_base = data.base || {};
|
||||
this.setData({
|
||||
random_value: Math.random(),
|
||||
data_base: data.base || null,
|
||||
favor_user: data.favor_user || [],
|
||||
slider_list: data.slider_list || [],
|
||||
icon_list: data.icon_list || [],
|
||||
data_list: data_list,
|
||||
not_choice_realstore_images: data_base.home_not_choice_realstore_images || this.not_choice_realstore_images,
|
||||
is_force_choice_realstore: parseInt(data_base.is_home_force_choice_one_realstore_mode || 0),
|
||||
is_force_auto_choice_realstore: parseInt(data_base.is_home_force_choice_one_realstore_mode_auto_lately_realstore || 0),
|
||||
force_auto_choice_realstore_distance: parseFloat(data_base.home_force_choice_one_realstore_mode_auto_lately_distance || 0),
|
||||
data_list_loding_status: data_list.length > 0 ? 3 : 0,
|
||||
data_bottom_line_status: true,
|
||||
});
|
||||
|
||||
if ((this.data_base || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data_base.seo_title || this.data_base.application_name,
|
||||
desc: this.data_base.seo_desc,
|
||||
path: '/pages/plugins/realstore/index/index',
|
||||
},
|
||||
});
|
||||
|
||||
// 导航名称
|
||||
if ((this.data_base.application_name || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data_base.application_name,
|
||||
});
|
||||
}
|
||||
|
||||
// 非首次
|
||||
if(this.is_first == 1) {
|
||||
// 是否自动获取用户当前位置、如果系统已经开启获取位置则这里不调用
|
||||
if(app.globalData.data.get_user_location_status != 1 && parseInt(this.data_base.is_home_auto_user_location || 0) == 1) {
|
||||
app.globalData.get_user_location(this, 'user_back_auto_location', true);
|
||||
}
|
||||
|
||||
// 自动选择第一个门店、不存在已选择的门店
|
||||
if((this.user_choice_realstore || null) == null && this.data_list.length > 0 && this.is_force_choice_realstore == 1 && this.is_force_auto_choice_realstore == 1) {
|
||||
var status = true;
|
||||
var temp_realstore = this.data_list[0];
|
||||
// 最低条件,自动选择第一个最低距离设置、不存在门店位置数据 或 位置值大于最低值则不选择
|
||||
if(this.force_auto_choice_realstore_distance > 0) {
|
||||
if(temp_realstore.distance_value === undefined || temp_realstore.distance_value > this.force_auto_choice_realstore_distance) {
|
||||
status = false;
|
||||
}
|
||||
}
|
||||
if(status) {
|
||||
// 自动进入门店则不显示提示位置选择弹窗
|
||||
this.setData({
|
||||
location_tips_close_status: false
|
||||
});
|
||||
// 存储门店缓存
|
||||
uni.setStorageSync(app.globalData.data.cache_realstore_detail_choice_key, {
|
||||
data: temp_realstore,
|
||||
status: 0
|
||||
});
|
||||
// 进入门店页面
|
||||
app.globalData.url_open(temp_realstore.url);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
|
||||
// 首次状态记录
|
||||
this.setData({
|
||||
is_first: 0,
|
||||
});
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 搜索事件
|
||||
search_button_event(e) {
|
||||
var params = (e || null) == null ? '' : '?keywords=' + e;
|
||||
app.globalData.url_open('/pages/plugins/realstore/search/search' + params);
|
||||
},
|
||||
|
||||
// 选择地理位置
|
||||
choose_user_location_event(e) {
|
||||
if ((this.$refs.choice_location || null) != null) {
|
||||
this.$refs.choice_location.choose_user_location();
|
||||
}
|
||||
},
|
||||
|
||||
// 自动获取用户位置回调
|
||||
user_back_auto_location(e) {
|
||||
// 位置数据更新
|
||||
if ((this.$refs.choice_location || null) != null) {
|
||||
this.$refs.choice_location.init();
|
||||
}
|
||||
// 设置状态为首次
|
||||
this.setData({
|
||||
is_first: 1,
|
||||
});
|
||||
// 设置位置数据,重新获取数据
|
||||
this.user_back_choice_location(e);
|
||||
},
|
||||
|
||||
// 选择用户地理位置回调
|
||||
user_back_choice_location(e) {
|
||||
// 设置数据
|
||||
this.setData({
|
||||
user_location: e,
|
||||
location_tips_close_status: e.status != 1
|
||||
});
|
||||
// 重新获取数据
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 门店选择初始化
|
||||
realstore_choice_init() {
|
||||
var key = app.globalData.data.cache_realstore_detail_choice_key;
|
||||
var res = uni.getStorageSync(key) || null;
|
||||
if(res != null && (res.data || null) != null) {
|
||||
this.setData({
|
||||
user_choice_realstore: res.data
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 地址信息初始化
|
||||
user_location_init() {
|
||||
var res = app.globalData.choice_user_location_init();
|
||||
this.setData({
|
||||
user_location: res,
|
||||
location_tips_close_status: res.status != 1
|
||||
});
|
||||
},
|
||||
|
||||
// 地址选择提示关闭事件
|
||||
location_tips_close_event(e) {
|
||||
this.setData({
|
||||
location_tips_close_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 页面宽度变化监听
|
||||
handle_resize() {
|
||||
// #ifdef H5
|
||||
this.setData({
|
||||
screen_width: window.innerWidth,
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
|
||||
// 门店选择事件
|
||||
realstore_choice_event(e) {
|
||||
app.globalData.url_open('/pages/plugins/realstore/search/search?is_choice_mode=1&choice_mode_back_type=realstore-detail&show_type_mode=1');
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 剪切板
|
||||
text_copy_event(e) {
|
||||
app.globalData.text_copy_event(e);
|
||||
},
|
||||
|
||||
// 地图查看
|
||||
address_map_event(e) {
|
||||
var info = this.user_choice_realstore || {};
|
||||
if (info.lat == 0 || info.lng == 0) {
|
||||
app.globalData.showToast(this.$t('user-order-detail.user-order-detail.i876o3'));
|
||||
return false;
|
||||
}
|
||||
var address = (info.province_name || '') + (info.city_name || '') + (info.county_name || '') + (info.address || '');
|
||||
app.globalData.open_location(info.lng, info.lat, info.name, address);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './index.css';
|
||||
</style>
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* 地址信息
|
||||
*/
|
||||
.address-base,
|
||||
.address-detail {
|
||||
padding: 10rpx 0;
|
||||
}
|
||||
.address-detail .icon {
|
||||
width: 30rpx;
|
||||
height: 35rpx !important;
|
||||
}
|
||||
.address-detail .text {
|
||||
width: calc(100% - 40rpx);
|
||||
}
|
||||
.address-detail .text {
|
||||
line-height: 36rpx;
|
||||
}
|
||||
.no-address {
|
||||
height: 85rpx;
|
||||
line-height: 85rpx;
|
||||
}
|
||||
.address-alias,
|
||||
.address-map-submit {
|
||||
padding: 0 15rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.address-map-submit {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品信息
|
||||
*/
|
||||
.goods-base {
|
||||
min-height: 160rpx;
|
||||
margin-left: 180rpx;
|
||||
}
|
||||
.goods .goods-item:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
.goods-image {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
.orderaftersale-btn-text {
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* 虚拟销售信息
|
||||
*/
|
||||
.site-fictitious .panel-content .tips-value {
|
||||
color: #f37b1d;
|
||||
background-color: #fff2e9;
|
||||
border-color: #ffebdb;
|
||||
}
|
||||
.site-fictitious .panel-content .left-image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.site-fictitious .panel-content .right-value {
|
||||
width: calc(100% - 100rpx);
|
||||
}
|
||||
|
||||
/*
|
||||
* 自提信息
|
||||
*/
|
||||
.site-extraction .panel-content .qrcode {
|
||||
width: 260rpx;
|
||||
height: 260rpx;
|
||||
}
|
||||
274
pages/plugins/realstore/orderallot-detail/orderallot-detail.vue
Normal file
274
pages/plugins/realstore/orderallot-detail/orderallot-detail.vue
Normal file
@@ -0,0 +1,274 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="detail != null">
|
||||
<view class="padding-horizontal-main padding-top-main">
|
||||
<!-- 地址 -->
|
||||
<view v-if="(detail.order_type == 0 || detail.order_type == 1 || detail.order_type == 2) && (detail.address_data || null) != null" class="address bg-white padding-horizontal-main padding-top-main border-radius-main spacing-mb">
|
||||
<view class="address-base oh">
|
||||
<text v-if="(detail.address_data.alias || null) != null" class="address-alias round br-main cr-main bg-white margin-right-sm">{{ detail.address_data.alias }}</text>
|
||||
<text>{{ detail.address_data.name }}</text>
|
||||
<text class="fr">{{ detail.address_data.tel }}</text>
|
||||
</view>
|
||||
<view class="address-detail oh margin-bottom-main">
|
||||
<image class="icon fl" :src="common_static_url + 'map-icon.png'" mode="widthFix"></image>
|
||||
<view class="text fr">
|
||||
<text>{{ detail.address_data.province_name }}{{ detail.address_data.city_name }}{{ detail.address_data.county_name }}{{ detail.address_data.address }}</text>
|
||||
<text v-if="detail.order_model == 2 && (detail.address_data.lng || 0) != 0 && (detail.address_data.lat || (0 && detail.address_data.lng != 0 && detail.address_data.lat != 0)) != 0" class="address-map-submit cr-base br round bg-white margin-left-sm text-size-xs" @tap="address_map_event">{{$t('user-order-detail.user-order-detail.7lp6gw')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="address-divider spacing-mb"></view>
|
||||
</view>
|
||||
|
||||
<!-- 商品列表 -->
|
||||
<view class="goods bg-white padding-main border-radius-main spacing-mb">
|
||||
<view class="br-b padding-bottom-main fw-b text-size">{{$t('user-order-detail.user-order-detail.7f8p26')}}</view>
|
||||
<view v-for="(item, index) in detail.items" :key="index" class="goods-item br-b-dashed oh padding-main">
|
||||
<view :data-value="item.goods_url" @tap="url_event" class="cp">
|
||||
<image class="goods-image fl radius" :src="item.images" mode="aspectFill"></image>
|
||||
<view class="goods-base pr">
|
||||
<view class="multi-text">{{ item.title }}</view>
|
||||
<view v-if="item.spec != null" class="margin-top-sm">
|
||||
<block v-for="(sv, si) in item.spec" :key="si">
|
||||
<text v-if="si > 0" class="cr-grey padding-left-xs padding-right-xs">;</text>
|
||||
<text class="cr-grey">{{ sv.value }}</text>
|
||||
</block>
|
||||
</view>
|
||||
<view class="margin-top-sm">
|
||||
<text class="fw-b">{{ detail.currency_data.currency_symbol }}{{ item.price }}</text>
|
||||
<text class="margin-left-sm">x{{ item.buy_number }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-top-main tr cr-base text-size">
|
||||
<text>{{$t('user-order-detail.user-order-detail.423rmr')}}<text class="fw-b">{{ detail.buy_number_count }}</text>{{$t('user-order-detail.user-order-detail.41ty94')}}<text class="sales-price margin-right-xs">{{ detail.currency_data.currency_symbol }}{{ detail.total_price }}</text></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 虚拟销售数据 -->
|
||||
<view v-if="(site_fictitious || null) != null" class="site-fictitious panel-item padding-horizontal-main padding-top-main border-radius-main bg-white spacing-mb">
|
||||
<view class="br-b padding-bottom-main fw-b text-size">{{ site_fictitious.title || item.fictitious_goods_title }}</view>
|
||||
<view class="panel-content oh padding-top-main">
|
||||
<view v-if="(site_fictitious.tips || null) != null" class="tips-value radius padding-main margin-bottom-main">
|
||||
<mp-html :content="site_fictitious.tips" />
|
||||
</view>
|
||||
<view v-for="(item, index) in detail.items" :key="index" class="item br-b-dashed oh padding-bottom-main margin-bottom-main">
|
||||
<image class="left-image br fl radius" :src="item.images" mode="aspectFill"></image>
|
||||
<view class="right-value fr">
|
||||
<view v-if="(item.spec_text || null) != null" class="text-grey padding-bottom-xs margin-bottom-xs br-b-f9 text-size-xs">{{item.spec_text}}</view>
|
||||
<mp-html v-if="(item.fictitious_goods_value || null) != null" :content="item.fictitious_goods_value" />
|
||||
<text v-else class="cr-grey">{{$t('user-order-detail.user-order-detail.7xtnjt')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 自提信息 -->
|
||||
<view v-if="(detail.extraction_data || null) != null" class="site-extraction panel-item padding-main border-radius-main bg-white spacing-mb">
|
||||
<view class="br-b padding-bottom-main fw-b text-size">{{$t('user-order-detail.user-order-detail.7dikfm')}}</view>
|
||||
<view class="panel-content oh padding-top-main">
|
||||
<view>
|
||||
<text>{{$t('user-order-detail.user-order-detail.o38952')}}</text>
|
||||
<text class="radius bg-green cr-white padding-left-sm padding-right-sm">{{ detail.extraction_data.code || $t("user-order-detail.user-order-detail.hpq62x") }}</text>
|
||||
</view>
|
||||
<image v-if="(detail.extraction_data.images || null) != null" class="qrcode br radius margin-top-lg" :src="detail.extraction_data.images" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单基础数据 -->
|
||||
<view v-if="detail_list.length > 0" class="panel-item padding-main border-radius-main bg-white spacing-mb">
|
||||
<view class="br-b padding-bottom-main fw-b text-size">{{$t('user-order-detail.user-order-detail.0f26j2')}}</view>
|
||||
<view class="panel-content oh">
|
||||
<view v-for="(item, index) in detail_list" :key="index" class="item br-b-dashed oh padding-vertical-main">
|
||||
<view class="title fl padding-right-main cr-grey">{{ item.name }}</view>
|
||||
<view v-if="(item.is_copy || 0) == 1" class="content fl br-l padding-left-main" :data-value="item.value" @tap="text_copy_event">
|
||||
<text>{{ item.value }}</text>
|
||||
<text class="bg-white br-green cr-green round padding-horizontal-sm text-size-xs margin-left-sm">{{$t('common.copy')}}</text>
|
||||
</view>
|
||||
<view v-else class="content fl br-l padding-left-main">{{ item.value }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 快递信息 -->
|
||||
<view v-if="(detail.express_data || null) != null && detail.express_data.length > 0" class="express-data panel-item padding-main border-radius-main bg-white spacing-mb">
|
||||
<view class="br-b padding-bottom-main fw-b text-size">{{$t('user-order-detail.user-order-detail.0876xf')}}</view>
|
||||
<view class="panel-content">
|
||||
<view v-for="(item, index) in detail.express_data" :key="index" class="item br-b-dashed oh padding-vertical-main">
|
||||
<view class="item oh padding-vertical-main">
|
||||
<view class="title fl padding-right-main cr-grey">{{$t('user-order-detail.user-order-detail.12d445')}}</view>
|
||||
<view class="content fl br-l padding-left-main" :data-value="item.express_name" @tap="text_copy_event">{{item.express_name}}</view>
|
||||
</view>
|
||||
<view class="item oh padding-vertical-main">
|
||||
<view class="title fl padding-right-main cr-grey">{{$t('user-order-detail.user-order-detail.2byl8l')}}</view>
|
||||
<view class="content fl br-l padding-left-main" :data-value="item.express_number" @tap="text_copy_event">
|
||||
<text>{{item.express_number}}</text>
|
||||
<text class="bg-white br-green cr-green round padding-horizontal-sm text-size-xs margin-left-sm">{{$t('common.copy')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
|
||||
var common_static_url = app.globalData.get_static_url("common");
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
common_static_url: common_static_url,
|
||||
params: null,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: "",
|
||||
data_bottom_line_status: false,
|
||||
detail: null,
|
||||
detail_list: [],
|
||||
site_fictitious: null,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.init();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
init() {
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("detail", "orderallot", "realstore"),
|
||||
method: "POST",
|
||||
data: {
|
||||
id: this.params.id,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
detail: data.data,
|
||||
detail_list: [
|
||||
{ name: this.$t('orderallot-detail.orderallot-detail.81jvw1'), value: data.data.order_type_name || '' },
|
||||
{ name: this.$t('user-order-detail.user-order-detail.n18sd2'), value: data.data.order_allot_no || '', is_copy: 1 },
|
||||
{ name: this.$t('user-order-detail.user-order-detail.yxwu8n'), value: data.data.status_name || '' },
|
||||
{ name: this.$t('user-order-detail.user-order-detail.2y7l13'), value: data.data.total_price || '' },
|
||||
{ name: this.$t('user-order-detail.user-order-detail.h2c78h'), value: data.data.add_time || '' },
|
||||
{ name: this.$t('common.add_time'), value: data.data.add_time || '' },
|
||||
{ name: this.$t('common.receive_time'), value: data.data.receive_time || '' },
|
||||
{ name: this.$t('common.service_time'), value: data.data.service_time || '' },
|
||||
{ name: this.$t('order-detail.order-detail.2dw4gd'), value: data.data.success_time || '' },
|
||||
{ name: this.$t('user-order-detail.user-order-detail.1jpv4n'), value: data.data.cancel_time || '' },
|
||||
],
|
||||
site_fictitious: data.site_fictitious || null,
|
||||
data_list_loding_status: 3,
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_msg: '',
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, "init")) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 地图查看
|
||||
address_map_event(e) {
|
||||
if ((this.detail.address_data || null) == null) {
|
||||
app.globalData.showToast(this.$t('user-order-detail.user-order-detail.i876o3'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// 打开地图
|
||||
var data = this.detail.address_data;
|
||||
var name = data.alias || data.name || "";
|
||||
var address = (data.province_name || "") + (data.city_name || "") + (data.county_name || "") + (data.address || "");
|
||||
app.globalData.open_location(data.lng, data.lat, name, address);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 文本复制
|
||||
text_copy_event(e) {
|
||||
if((e.currentTarget.dataset.value || null) != null) {
|
||||
app.globalData.text_copy_event(e);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./orderallot-detail.css";
|
||||
</style>
|
||||
18
pages/plugins/realstore/orderallot-list/orderallot-list.css
Normal file
18
pages/plugins/realstore/orderallot-list/orderallot-list.css
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.nav-base .item {
|
||||
width: 16.66%;
|
||||
}
|
||||
|
||||
/*
|
||||
* 列表
|
||||
*/
|
||||
.goods-base {
|
||||
min-height: 160rpx;
|
||||
margin-left: 180rpx;
|
||||
}
|
||||
.goods-image {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
526
pages/plugins/realstore/orderallot-list/orderallot-list.vue
Normal file
526
pages/plugins/realstore/orderallot-list/orderallot-list.vue
Normal file
@@ -0,0 +1,526 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 导航 -->
|
||||
<view class="nav-base bg-white">
|
||||
<block v-for="(item, index) in nav_status_list" :key="index">
|
||||
<view v-if="nav_status_index == index" class="item fl tc cr-main nav-active-line" :data-index="index" @tap="nav_event">{{ item.name }}</view>
|
||||
<view v-else class="item fl tc" :data-index="index" @tap="nav_event">{{ item.name }}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 数据列表 -->
|
||||
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view v-if="data_list.length > 0" class="padding-horizontal-main padding-top-main">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="list-item padding-horizontal-main padding-top-main border-radius-main bg-white oh spacing-mb">
|
||||
<view class="item-base oh br-b padding-bottom-main">
|
||||
<text class="fl cr-base">{{ item.order_allot_no }}</text>
|
||||
<text class="fr cr-red"
|
||||
>{{ item.status_name }}<text v-if="(item.is_under_line_text || null) != null">({{ item.is_under_line_text }})</text></text
|
||||
>
|
||||
</view>
|
||||
<view v-for="(detail, di) in item.items" :key="di" class="br-b-dashed oh padding-vertical-main">
|
||||
<view :data-value="'/pages/plugins/realstore/orderallot-detail/orderallot-detail?id=' + item.id" @tap="url_event" class="cp">
|
||||
<image class="goods-image fl radius" :src="detail.images" mode="aspectFill"></image>
|
||||
<view class="goods-base pr">
|
||||
<view class="multi-text">{{ detail.title }}</view>
|
||||
<view v-if="detail.spec != null" class="margin-top-sm">
|
||||
<block v-for="(sv, si) in detail.spec" :key="si">
|
||||
<text v-if="si > 0" class="cr-grey padding-left-xs padding-right-xs">;</text>
|
||||
<text class="cr-grey">{{ sv.value }}</text>
|
||||
</block>
|
||||
</view>
|
||||
<view class="margin-top-sm">
|
||||
<text class="fw-b">{{ item.currency_data.currency_symbol }}{{ detail.price }}</text>
|
||||
<text class="margin-left-sm">x{{ detail.buy_number }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-vertical-main tr cr-base text-size">
|
||||
<text>{{$t('user-order-detail.user-order-detail.423rmr')}}<text class="fw-b">{{ item.buy_number_count }}</text>{{$t('user-order-detail.user-order-detail.41ty94')}}<text class="sales-price margin-right-xs">{{ item.currency_data.currency_symbol }}{{ item.total_price }}</text></text>
|
||||
</view>
|
||||
<view v-if="
|
||||
(
|
||||
item.operate_data.is_cancel +
|
||||
item.operate_data.is_pay +
|
||||
item.operate_data.is_collect +
|
||||
(item.plugins_delivery_data || 0) +
|
||||
(item.plugins_is_order_frequencycard_button || 0) > 0
|
||||
) ||
|
||||
((item.express_data || null) != null && item.express_data.length > 0) ||
|
||||
(item.operate_data.is_order_batch || 0) == 1 ||
|
||||
(item.operate_data.is_order_frequencycard || 0) == 1
|
||||
" class="item-operation tr br-t padding-vertical-main">
|
||||
<button v-if="item.operate_data.is_cancel == 1" class="round bg-white cr-yellow br-yellow" type="default" size="mini" @tap="cancel_event" :data-value="item.id" :data-index="index" hover-class="none">{{$t('common.cancel')}}</button>
|
||||
<button v-if="item.operate_data.is_pay == 1" class="round bg-white cr-green br-green" type="default" size="mini" @tap="pay_event" :data-value="item.order_id" :data-index="index" :data-price="item.total_price" :data-payment="item.main_order_data.payment_id" :data-currency-symbol="item.currency_data.currency_symbol" hover-class="none">{{$t('order.order.1i873j')}}</button>
|
||||
<button v-if="item.operate_data.is_collect == 1" class="round bg-white cr-green br-green" type="default" size="mini" @tap="collect_event" :data-value="item.id" :data-index="index" hover-class="none">{{$t('orderallot-list.orderallot-list.w2w2w4')}}</button>
|
||||
<button v-if="(item.operate_data.is_order_batch || 0) == 1" class="round bg-white cr-blue br-blue" type="default" size="mini" @tap="url_event" :data-value="'/pages/plugins/realstore/batchorder-list/batchorder-list?oid=' + item.order_id" hover-class="none">{{$t('orderallot-list.orderallot-list.6m73j2')}}</button>
|
||||
<button v-if="(item.operate_data.is_order_frequencycard || 0) == 1" class="round bg-white cr-green br-green" type="default" size="mini" @tap="url_event" :data-value="'/pages/plugins/realstore/frequencycard-list/frequencycard-list?oid=' + item.order_id" hover-class="none">{{$t('orderallot-list.orderallot-list.b13k5r')}}</button>
|
||||
<button v-if="(item.express_data || null) != null && item.express_data.length > 0" class="round bg-white cr-main br-main" type="default" size="mini" @tap="url_event" :data-value="'/pages/plugins/express/detail/detail?oid=' + item.id + '&action_type=realstore'" hover-class="none">{{$t('orderallot-list.orderallot-list.w2t242')}}</button>
|
||||
<button v-if="(item.plugins_delivery_data || 0) > 0" class="round bg-white cr-main br-main margin-bottom-main" type="default" size="mini" @tap="url_event" :data-value="'/pages/plugins/delivery/logistics/logistics?id=' + item.plugins_delivery_data" hover-class="none">{{$t('orderallot-list.orderallot-list.w2t242')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 支付组件 -->
|
||||
<component-payment
|
||||
ref="payment"
|
||||
:propCurrencySymbol="payment_currency_symbol"
|
||||
:propPayUrl="pay_url"
|
||||
:propQrcodeUrl="qrcode_url"
|
||||
:propPaymentList="payment_list"
|
||||
propPayDataKey="ids"
|
||||
:propTempPayValue="temp_pay_value"
|
||||
:propTempPayIndex="temp_pay_index"
|
||||
:propPaymentId="payment_id"
|
||||
:propDefaultPaymentId="default_payment_id"
|
||||
:propPayPrice="pay_price"
|
||||
:propIsShowPayment="is_show_payment_popup"
|
||||
@close-payment-popup="payment_popup_event_close"
|
||||
@pay-success="order_item_pay_success_handle"
|
||||
></component-payment>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
import componentPayment from '@/components/payment/payment';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
params: null,
|
||||
nav_status_list: [
|
||||
{ name: this.$t('common.all'), value: "-1" },
|
||||
{ name: this.$t('extraction.extraction.53h4fj'), value: "0,1" },
|
||||
{ name: this.$t('orderallot-list.orderallot-list.285ir2'), value: "2,5" },
|
||||
{ name: this.$t('order.order.q820hx'), value: "3" },
|
||||
{ name: this.$t('order.order.15lr5l'), value: "4" },
|
||||
{ name: this.$t('detail.detail.32171c'), value: "6,7" },
|
||||
],
|
||||
nav_status_index: 0,
|
||||
// 前往页面携带的参数
|
||||
payment_currency_symbol: app.globalData.currency_symbol(),
|
||||
pay_price: 0,
|
||||
pay_url: '',
|
||||
qrcode_url: '',
|
||||
payment_list: [],
|
||||
temp_pay_value: '',
|
||||
temp_pay_index: 0,
|
||||
payment_id: 0,
|
||||
default_payment_id: 0,
|
||||
is_show_payment_popup: false,
|
||||
// 智能工具箱(限定仅可选择下单支付方式)
|
||||
is_order_pay_only_can_buy_payment: 0,
|
||||
original_payment_list: [],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentPayment
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 是否指定状态
|
||||
var nav_status_index = 0;
|
||||
if ((params.status || null) != null) {
|
||||
for (var i in this.nav_status_list) {
|
||||
if (this.nav_status_list[i]["value"] == params.status) {
|
||||
nav_status_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
params: params,
|
||||
nav_status_index: nav_status_index,
|
||||
});
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if ((status || false) == true) {
|
||||
this.setData({
|
||||
is_order_pay_only_can_buy_payment: parseInt(app.globalData.get_config('plugins_base.intellectstools.data.is_order_pay_only_can_buy_payment', 0)),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
this.setData({
|
||||
pay_url: app.globalData.get_request_url('pay', 'order'),
|
||||
qrcode_url: app.globalData.get_request_url('paycheck', 'order'),
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
this.get_data_list();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 参数
|
||||
var status = (this.nav_status_list[this.nav_status_index] || null) == null ? -1 : this.nav_status_list[this.nav_status_index]["value"];
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "orderallot", "realstore"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data_page,
|
||||
status: status,
|
||||
oid: this.params.oid || 0,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.data.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = res.data.data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = res.data.data.data;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
original_payment_list: res.data.data.payment_list || [],
|
||||
payment_list: res.data.data.payment_list || [],
|
||||
default_payment_id: res.data.data.default_payment_id || 0,
|
||||
data_list: temp_data_list,
|
||||
data_total: res.data.data.total,
|
||||
data_page_total: res.data.data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
|
||||
// 下订单支付处理
|
||||
var key = app.globalData.data.cache_page_pay_key;
|
||||
var pay_data = uni.getStorageSync(key) || null;
|
||||
if (pay_data != null && (pay_data.order_ids || null) != null && (pay_data.payment_id || null) != null) {
|
||||
uni.removeStorageSync(key);
|
||||
this.setData({
|
||||
temp_pay_value: pay_data.order_ids,
|
||||
payment_id: pay_data.payment_id,
|
||||
});
|
||||
if ((this.$refs.payment || null) != null) {
|
||||
this.$refs.payment.pay_handle(pay_data.order_ids, pay_data.payment_id, this.original_payment_list);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, "get_data_list")) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 支付
|
||||
pay_event(e) {
|
||||
// 参数
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var payment_id = e.currentTarget.dataset.payment || 0;
|
||||
|
||||
// 智能工具箱(限定仅可选择下单支付方式)
|
||||
if(this.is_order_pay_only_can_buy_payment == 1) {
|
||||
var payment_list = [];
|
||||
this.original_payment_list.forEach(function(v, k) {
|
||||
if(v.id == payment_id) {
|
||||
payment_list.push(v);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
var payment_list = this.original_payment_list;
|
||||
}
|
||||
|
||||
// 设置支付参数
|
||||
this.setData({
|
||||
is_show_payment_popup: true,
|
||||
payment_list: payment_list,
|
||||
payment_currency_symbol: e.currentTarget.dataset.currencySymbol,
|
||||
temp_pay_value: e.currentTarget.dataset.value,
|
||||
temp_pay_index: index,
|
||||
payment_id: payment_id,
|
||||
pay_price: e.currentTarget.dataset.price,
|
||||
order_select_ids: [],
|
||||
});
|
||||
},
|
||||
|
||||
// 支付弹窗关闭
|
||||
payment_popup_event_close(e) {
|
||||
this.setData({
|
||||
is_show_payment_popup: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 支付成功数据设置
|
||||
// 订单完成回调
|
||||
order_item_pay_success_handle(data) {
|
||||
var order_ids_arr = data.order_id.toString().split(',');
|
||||
var temp_data_list = this.data_list;
|
||||
for (var i in temp_data_list) {
|
||||
if (order_ids_arr.indexOf(temp_data_list[i]['order_id'].toString()) != -1) {
|
||||
temp_data_list[i]['operate_data']['is_pay'] = 0;
|
||||
temp_data_list[i]['operate_data']['is_cancel'] = 0;
|
||||
temp_data_list[i]['status'] = 2;
|
||||
temp_data_list[i]['status_name'] = this.$t('orderallot-list.orderallot-list.x5l17j');
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
});
|
||||
},
|
||||
|
||||
// 取消
|
||||
cancel_event(e) {
|
||||
uni.showModal({
|
||||
title: this.$t('common.warm_tips'),
|
||||
content: this.$t('order.order.pn78ns'),
|
||||
confirmText: this.$t('common.confirm'),
|
||||
cancelText: this.$t('recommend-list.recommend-list.w9460o'),
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
// 参数
|
||||
var id = e.currentTarget.dataset.value;
|
||||
var index = e.currentTarget.dataset.index;
|
||||
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("cancel", "orderallot", "realstore"),
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: id,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var temp_data_list = this.data_list;
|
||||
temp_data_list[index]['status'] = 5;
|
||||
temp_data_list[index]['status_name'] = this.$t('order.order.1k98tk');
|
||||
temp_data_list[index]['operate_data']['is_cancel'] = 0;
|
||||
temp_data_list[index]['operate_data']['is_pay'] = 0;
|
||||
temp_data_list[index]['operate_data']['is_delete'] = 1;
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 收货
|
||||
collect_event(e) {
|
||||
uni.showModal({
|
||||
title: this.$t('common.warm_tips'),
|
||||
content: this.$t('orderallot-list.orderallot-list.o3ouqv'),
|
||||
confirmText: this.$t('common.confirm'),
|
||||
cancelText: this.$t('recommend-list.recommend-list.w9460o'),
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
// 参数
|
||||
var id = e.currentTarget.dataset.value;
|
||||
var index = e.currentTarget.dataset.index;
|
||||
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("collect", "orderallot", "realstore"),
|
||||
method: "POST",
|
||||
data: {
|
||||
id: id,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var temp_data_list = this.data_list;
|
||||
temp_data_list[index]["status"] = 4;
|
||||
temp_data_list[index]["status_name"] = this.$t('order.order.15lr5l');
|
||||
temp_data_list[index]["operate_data"]["is_collect"] = 0;
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg, "success");
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
nav_status_index: e.currentTarget.dataset.index || 0,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
|
||||
// 重新拉取数据
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./orderallot-list.css";
|
||||
</style>
|
||||
37
pages/plugins/realstore/search/search.css
Normal file
37
pages/plugins/realstore/search/search.css
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* 位置和搜索
|
||||
*/
|
||||
.nav-location {
|
||||
max-width: 260rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
}
|
||||
.nav-search {
|
||||
width: calc(100% - 260rpx);
|
||||
}
|
||||
.nav-search.map {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
.scroll-box {
|
||||
height: calc(100vh - 180rpx);
|
||||
}
|
||||
.scroll-box.map {
|
||||
height: calc(100vh - 682rpx);
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图
|
||||
*/
|
||||
.map-container {
|
||||
height: 500rpx;
|
||||
}
|
||||
.map-container .map-center-icon {
|
||||
top: calc(50% - 30rpx);
|
||||
left: calc(50% - 30rpx);
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
495
pages/plugins/realstore/search/search.vue
Normal file
495
pages/plugins/realstore/search/search.vue
Normal file
@@ -0,0 +1,495 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="(data_base || null) != null">
|
||||
<!-- 顶部 -->
|
||||
<view class="bg-white padding-top-main padding-horizontal-main oh flex-row jc-sb align-c cr-grey" :class="show_type_mode == 1 ? 'map padding-bottom' : ''">
|
||||
<!-- 位置 -->
|
||||
<view v-if="show_type_mode == 0" class="nav-location flex-row align-c single-text margin-right-sm">
|
||||
<component-choice-location ref="choice_location" propBaseColor="#666" propTextMaxWidth="180rpx" @onBack="user_back_choice_location"></component-choice-location>
|
||||
</view>
|
||||
<!-- 搜索 -->
|
||||
<view class="nav-search" :class="show_type_mode == 1 ? 'map' : ''">
|
||||
<component-search @onsearch="search_button_event" :propIsOnEvent="true" :propIsRequired="false" :propDefaultValue="search_keywords_value" :propPlaceholder="$t('index.index.c5273j')" propPlaceholderClass="cr-grey-c" propBgColor="#f5f5f5"></component-search>
|
||||
</view>
|
||||
<view v-if="is_search_map == 1" class="dis-inline-block margin-left" @tap="show_event">
|
||||
<iconfont :name="show_type_mode == 1 ? 'icon-list-dot' : 'icon-map-location'" color="#666" size="38rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 地图 -->
|
||||
<view v-show="show_type_mode == 1" class="map-container pr">
|
||||
<map class="wh-auto ht-auto"
|
||||
:enable-zoom="true"
|
||||
:enable-scroll="true"
|
||||
:show-location="true"
|
||||
:latitude="latitude"
|
||||
:longitude="longitude"
|
||||
:scale="map_scale"
|
||||
:markers="markers"
|
||||
@regionchange="region_change_event"
|
||||
@markertap="marker_tap_event"
|
||||
></map>
|
||||
<image v-if="map_center_icon_status == 1" class="map-center-icon pa" :src="map_location_icon" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
||||
<!-- 分类 -->
|
||||
<scroll-view v-if="(category || null) != null && category.length > 0" class="nav-base scroll-view-horizontal bg-white oh" scroll-x="true">
|
||||
<view :class="'item cr-grey dis-inline-block padding-horizontal-main ' + (nav_active_value == 0 ? 'cr-main' : '')" @tap="nav_event" data-value="0">{{$t('common.all')}}</view>
|
||||
<block v-for="(item, index) in category" :key="index">
|
||||
<view :class="'item cr-grey dis-inline-block padding-horizontal-main ' + (nav_active_value == item.id ? 'cr-main fw-b nav-active-line' : '')" @tap="nav_event" :data-value="item.id">{{ item.name }}</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view :scroll-y="true" :scroll-top="scroll_top" :scroll-with-animation="true" class="scroll-box scroll-box-ece-nav" :class="show_type_mode == 1 ? 'map' : ''" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view v-if="(data_list || null) != null && data_list.length > 0" class="padding-top-main padding-horizontal-main">
|
||||
<component-realstore-list :propData="{data: data_list}" :propRealstoreDetailQuery="realstore_detail_query" :propFavorUser="favor_user" :propIsChoice="is_choice_mode == 1" :propIsChoiceBackType="choice_mode_back_type" :propIsOpenRealstoreRedirect="is_open_realstore_redirect"></component-realstore-list>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg" :propLoadingLogoTop="show_type_mode == 1 ? '20%' : ''"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
</block>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
import componentSearch from "@/components/search/search";
|
||||
import componentRealstoreList from "@/components/realstore-list/realstore-list";
|
||||
import componentChoiceLocation from '@/components/choice-location/choice-location';
|
||||
var plugins_static_url = app.globalData.get_static_url('realstore', true);
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: "",
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
params: null,
|
||||
data_base: null,
|
||||
category: [],
|
||||
search_keywords_value: "",
|
||||
nav_active_value: 0,
|
||||
favor_user: [],
|
||||
realstore_detail_query: '',
|
||||
// 是否选择模式(0否,1是)
|
||||
is_choice_mode: 0,
|
||||
// 选择模式回调类型(back返回上一页,realstore-detail进入门店详情)
|
||||
choice_mode_back_type: 'back',
|
||||
// 打开门店详情页面是否关闭当前页面(0否,1是)
|
||||
is_open_realstore_redirect: true,
|
||||
// 显示类型模式(0列表,1地图)
|
||||
show_type_mode: 0,
|
||||
// 地图
|
||||
is_search_map: 0,
|
||||
map_location_icon: plugins_static_url+'app/search/location-icon.png',
|
||||
markers_icon: plugins_static_url+'app/search/markers-icon.png',
|
||||
markers_icon_active: '',
|
||||
map_scale: 12,
|
||||
latitude: 39.909,
|
||||
longitude: 116.39742,
|
||||
markers: [],
|
||||
map_center_icon_status: 1,
|
||||
markers_active_index: null,
|
||||
scroll_top: 0,
|
||||
// 用户位置信息
|
||||
user_location: {},
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentSearch,
|
||||
componentRealstoreList,
|
||||
componentChoiceLocation
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 参数处理
|
||||
params = app.globalData.launch_params_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
is_choice_mode: parseInt(params.is_choice_mode || 0),
|
||||
choice_mode_back_type: (params.choice_mode_back_type === undefined) ? 'back' : (params.choice_mode_back_type || ''),
|
||||
is_open_realstore_redirect: (params.is_open_realstore_redirect === undefined) ? true : parseInt(params.is_open_realstore_redirect || 0) == 1,
|
||||
show_type_mode: parseInt(params.show_type_mode || 0),
|
||||
search_keywords_value: params.keywords || "",
|
||||
nav_active_value: params.category_id || 0,
|
||||
realstore_detail_query: (params.goods_id || null) == null ? '' : '&source_goods_id='+params.goods_id
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 用户位置初始化
|
||||
this.user_location_init();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 标题设置
|
||||
if(this.is_choice_mode == 1) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.$t('realstore-cart.realstore-cart.87tty2')
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "search", "realstore"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var data_base = data.base || {};
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
category: data.category || [],
|
||||
favor_user: data.favor_user || [],
|
||||
is_search_map: parseInt(data_base.is_search_map || 0),
|
||||
map_scale: parseInt(data_base.search_map_scale || 12),
|
||||
markers_icon: data_base.search_map_store_icon || this.markers_icon,
|
||||
markers_icon_active: data_base.search_map_store_icon_active || '',
|
||||
map_location_icon: data_base.search_map_location_icon || this.map_location_icon,
|
||||
});
|
||||
|
||||
// 获取列表数据
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 基础自定义分享
|
||||
this.share_info_handle();
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({ data_is_loading: 1 });
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 用户位置
|
||||
var lng = 0;
|
||||
var lat = 0;
|
||||
if ((this.user_location || null) != null) {
|
||||
lng = this.user_location.lng || 0;
|
||||
lat = this.user_location.lat || 0;
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("datalist", "search", "realstore"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data_page,
|
||||
keywords: this.search_keywords_value,
|
||||
category_id: this.nav_active_value || 0,
|
||||
goods_id: this.params.goods_id || 0,
|
||||
lng: this.longitude || lng,
|
||||
lat: this.latitude || lat,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
if (data.data.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (this.data_page <= 1) {
|
||||
this.setData({
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 地图展示
|
||||
var temp_markers = [];
|
||||
if(this.data_list.length > 0) {
|
||||
this.data_list.forEach((item, index) => {
|
||||
temp_markers.push({
|
||||
id: index,
|
||||
width: 25,
|
||||
height: 25,
|
||||
latitude: item.lat,
|
||||
longitude: item.lng,
|
||||
iconPath: this.markers_icon
|
||||
});
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
markers: temp_markers,
|
||||
markers_active_index: null
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 分享设置处理
|
||||
share_info_handle() {
|
||||
if ((this.data_base || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.search_keywords_value || this.data_base.seo_title || this.data_base.application_name,
|
||||
desc: this.data_base.seo_desc,
|
||||
path: "/pages/plugins/realstore/search/search",
|
||||
query: "category_id=" + this.nav_active_value + "&keywords=" + this.search_keywords_value+"&goods_id="+(this.params.goods_id || 0),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
nav_active_value: e.currentTarget.dataset.value || 0,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 搜索事件
|
||||
search_button_event(e) {
|
||||
this.setData({
|
||||
search_keywords_value: e || "",
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 选择用户地理位置回调
|
||||
user_back_choice_location(e) {
|
||||
this.setData({
|
||||
user_location: e,
|
||||
data_page: 1,
|
||||
});
|
||||
// 重新请求数据
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 地址信息初始化
|
||||
user_location_init() {
|
||||
var user_location = app.globalData.choice_user_location_init();
|
||||
var upd_data = {
|
||||
user_location: user_location
|
||||
};
|
||||
if ((user_location || null) != null) {
|
||||
upd_data['longitude'] = user_location.lng;
|
||||
upd_data['latitude'] = user_location.lat;
|
||||
}
|
||||
this.setData(upd_data);
|
||||
},
|
||||
|
||||
// 显示类型事件
|
||||
show_event(e) {
|
||||
this.setData({
|
||||
show_type_mode: (this.show_type_mode == 1) ? 0 : 1
|
||||
});
|
||||
},
|
||||
|
||||
// 点击标记点事件
|
||||
marker_tap_event(e) {
|
||||
// 索引值
|
||||
var index = e.detail.markerId;
|
||||
// 选中处理
|
||||
this.data_markers_active_handle(index);
|
||||
// 列表滑动到用户位置
|
||||
this.setData({
|
||||
scroll_top: (index*252)+'rpx'
|
||||
});
|
||||
},
|
||||
|
||||
// 用户和覆盖物选中处理
|
||||
data_markers_active_handle(index) {
|
||||
// 列表数据
|
||||
var temp_data_list = this.data_list;
|
||||
for(var i in temp_data_list) {
|
||||
if(i == index) {
|
||||
temp_data_list[i]['active'] = 'active';
|
||||
} else {
|
||||
temp_data_list[i]['active'] = '';
|
||||
}
|
||||
}
|
||||
// 覆盖物
|
||||
var temp_markers = this.markers;
|
||||
for(var i in temp_markers) {
|
||||
if(i == index) {
|
||||
temp_markers[i]['iconPath'] = this.markers_icon_active || temp_data_list[temp_markers[i]['id']]['logo'];
|
||||
} else {
|
||||
temp_markers[i]['iconPath'] = this.markers_icon;
|
||||
}
|
||||
}
|
||||
// 设置数据
|
||||
this.setData({
|
||||
markers_active_index: index,
|
||||
markers: temp_markers,
|
||||
data_list: temp_data_list,
|
||||
map_center_icon_status: 0
|
||||
});
|
||||
},
|
||||
|
||||
// 视野改变事件
|
||||
region_change_event(e) {
|
||||
// 仅拖动及手势有效
|
||||
if(e.causedBy == 'drag' || e.causedBy == 'gesture') {
|
||||
// 1. 开始显示中心图标
|
||||
// 2. 结束重新拉取数据
|
||||
if(e.type == 'end') {
|
||||
this.setData({
|
||||
latitude: e.detail.centerLocation.latitude,
|
||||
longitude: e.detail.centerLocation.longitude,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
this.setData({
|
||||
map_center_icon_status: 1,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./search.css";
|
||||
</style>
|
||||
Reference in New Issue
Block a user