源文件
This commit is contained in:
4
pages/about/about.css
Normal file
4
pages/about/about.css
Normal file
@@ -0,0 +1,4 @@
|
||||
.logo {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
92
pages/about/about.vue
Normal file
92
pages/about/about.vue
Normal file
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="padding-main tc">
|
||||
<view class="bg-white border-radius-main padding-main">
|
||||
<view class="padding-vertical-xxl">
|
||||
<!-- logo -->
|
||||
<image class="logo circle br-f5 padding-sm dis-block auto margin-top-xl" :src="logo" mode="aspectFill"></image>
|
||||
<!-- 名称 -->
|
||||
<view class="margin-top-sm text-size">{{title}}</view>
|
||||
<!-- app管理 -->
|
||||
<component-app-admin ref="app_admin"></component-app-admin>
|
||||
<!-- 简介 -->
|
||||
<view class="margin-top-xxxxl cr-base text-size-sm">{{describe}}</view>
|
||||
<!-- 协议 -->
|
||||
<view class="margin-top-xxxxl padding-vertical-xxxxl">
|
||||
<text class="cp cr-blue margin-right" data-value="userregister" @tap="agreement_event">{{ $t('login.login.2v11we') }}</text>
|
||||
<text class="cp cr-blue margin-left" data-value="userprivacy" @tap="agreement_event">{{ $t('login.login.myno2x') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top cr-grey-c">Copyright 2018-{{year}} by {{title}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common" :propIsAppAdmin="false"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentAppAdmin from '@/components/app-admin/app-admin';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
logo: app.globalData.get_application_logo_square(),
|
||||
title: app.globalData.get_application_title(),
|
||||
describe: app.globalData.get_application_describe(),
|
||||
year: (new Date()).getFullYear(),
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentAppAdmin
|
||||
},
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// app管理
|
||||
if ((this.$refs.app_admin || null) != null) {
|
||||
this.$refs.app_admin.init();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 协议事件
|
||||
agreement_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
if (value == null) {
|
||||
app.globalData.showToast(this.$t('login.login.4wc3hr'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// 是否存在协议 url 地址
|
||||
var key = 'agreement_' + value + '_url';
|
||||
var url = app.globalData.get_config('config.' + key) || null;
|
||||
if (url == null) {
|
||||
app.globalData.showToast(this.$t('login.login.x0nxxf'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// 打开 webview
|
||||
app.globalData.open_web_view(url);
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './about.css';
|
||||
</style>
|
||||
8
pages/article-category/article-category.css
Normal file
8
pages/article-category/article-category.css
Normal file
@@ -0,0 +1,8 @@
|
||||
.data-list .item-cover .cover {
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
}
|
||||
.data-list .item-cover .base-right,
|
||||
.data-list .item-cover .base-right-bottom{
|
||||
width: calc(100% - 200rpx);
|
||||
}
|
||||
284
pages/article-category/article-category.vue
Normal file
284
pages/article-category/article-category.vue
Normal file
@@ -0,0 +1,284 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 分类 -->
|
||||
<scroll-view v-if="(category_list || null) != null && category_list.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_list" :key="index">
|
||||
<view :class="'item cr-grey dis-inline-block padding-horizontal-main ' + (nav_active_value == item.id ? 'cr-main' : '')" @tap="nav_event" :data-value="item.id">{{ item.name }}</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view v-if="(data_list || null) != null && data_list.length > 0" class="data-list padding-horizontal-main padding-top-main oh">
|
||||
<block v-for="(item, index) in data_list" :key="index">
|
||||
<view :data-value="item.url" @tap="url_event" class="item padding-main border-radius-main bg-white oh cp spacing-mb">
|
||||
<view v-if="(item.cover || null) != null" class="oh pr item-cover">
|
||||
<image :src="item.cover" mode="aspectFit" class="radius fl cover"></image>
|
||||
<view class="base-right fr">
|
||||
<view class="fw-b single-text text-size" :style="(item.title_color || null) != null ? 'color:' + item.title_color + ' !important;' : ''">{{ item.title }}</view>
|
||||
<view v-if="(item.describe || null) != null" class="cr-base margin-top-sm multi-text text-size-sm">{{item.describe}}</view>
|
||||
<view class="pa right-0 bottom-0 base-right-bottom cr-grey text-size-xs">
|
||||
<text class="fl">{{ item.add_time }}</text>
|
||||
<text class="fr">{{$t('article-category.article-category.gxra15')}}{{ item.access_count }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-else>
|
||||
<view class="fw-b single-text text-size" :style="(item.title_color || null) != null ? 'color:' + item.title_color + ' !important;' : ''">{{ item.title }}</view>
|
||||
<view class="cr-grey oh text-size-xs margin-top-sm">
|
||||
<text class="fl">{{ item.add_time }}</text>
|
||||
<text class="fr">{{$t('article-category.article-category.gxra15')}}{{ item.access_count }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></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_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,
|
||||
category_list: [],
|
||||
nav_active_value: 0,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
nav_active_value: params.id || 0,
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_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: {
|
||||
// 初始化
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "article"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
category_list: data.category_list || [],
|
||||
});
|
||||
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
path: "/pages/article-category/article-category",
|
||||
query: "id=" + this.nav_active_value,
|
||||
},
|
||||
});
|
||||
|
||||
// 获取列表数据
|
||||
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);
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
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'),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("datalist", "article"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data_page,
|
||||
id: this.nav_active_value || 0,
|
||||
},
|
||||
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,
|
||||
});
|
||||
}
|
||||
}
|
||||
} 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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
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);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./article-category.css";
|
||||
</style>
|
||||
3
pages/article-detail/article-detail.css
Normal file
3
pages/article-detail/article-detail.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.last-next-data .item {
|
||||
width: calc(100% - 120rpx);
|
||||
}
|
||||
162
pages/article-detail/article-detail.vue
Normal file
162
pages/article-detail/article-detail.vue
Normal file
@@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null" class="padding-main">
|
||||
<view class="padding-main border-radius-main bg-white spacing-mb">
|
||||
<view class="fw-b text-size-xl">{{ data.title }}</view>
|
||||
<view class="cr-grey margin-top-lg oh br-t padding-top-main">
|
||||
<view class="fl">
|
||||
<text>{{$t('article-detail.article-detail.728374')}}</text>
|
||||
<text>{{ data.add_time }}</text>
|
||||
</view>
|
||||
<view class="fr">
|
||||
<text class="margin-left-xxxl">{{$t('article-detail.article-detail.j92ru0')}}</text>
|
||||
<text>{{ data.access_count }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-main border-radius-main bg-white oh web-html-content spacing-mb">
|
||||
<mp-html :content="data.content" />
|
||||
</view>
|
||||
|
||||
<!-- 上一篇、下一篇 -->
|
||||
<view v-if="(last_next || null) != null" class="last-next-data spacing-mb">
|
||||
<view v-if="(last_next.last || null) != null">
|
||||
<text class="cr-grey va-m">{{$t('article-detail.article-detail.281s4a')}}</text>
|
||||
<text :data-value="last_next.last.url" @tap="url_event" class="dis-inline-block va-m cr-blue cp item">{{ last_next.last.title }}</text>
|
||||
</view>
|
||||
<view v-if="(last_next.next || null) != null" class="margin-top-sm">
|
||||
<text class="cr-grey va-m">{{$t('article-detail.article-detail.uq5814')}}</text>
|
||||
<text :data-value="last_next.next.url" @tap="url_event" class="dis-inline-block va-m cr-blue cp item">{{ last_next.next.title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</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_loding_status: 1,
|
||||
data_list_loding_msg: "",
|
||||
data_bottom_line_status: false,
|
||||
params: null,
|
||||
data: null,
|
||||
last_next: null,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("detail", "article"),
|
||||
method: "POST",
|
||||
data: {
|
||||
id: this.params.id || 0,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
var data = res.data.data;
|
||||
if (res.data.code == 0 && (data.data || null) != null) {
|
||||
var article = data.data;
|
||||
this.setData({
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_status: 3,
|
||||
data: article,
|
||||
last_next: data.last_next || null,
|
||||
});
|
||||
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data.seo_title || this.data.title,
|
||||
desc: this.data.seo_desc,
|
||||
path: "/pages/article-detail/article-detail",
|
||||
query: "id=" + this.data.id,
|
||||
img: this.data.share_images || this.data.cover,
|
||||
},
|
||||
});
|
||||
|
||||
// 标题
|
||||
uni.setNavigationBarTitle({ title: article.title });
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./article-detail.css";
|
||||
</style>
|
||||
255
pages/buy/buy.css
Normal file
255
pages/buy/buy.css
Normal file
@@ -0,0 +1,255 @@
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
.address-base,
|
||||
.address-detail {
|
||||
padding-right: 40rpx;
|
||||
;
|
||||
}
|
||||
.address-detail .text {
|
||||
width: calc(100% - 40rpx);
|
||||
}
|
||||
.address-alias,
|
||||
.goods-group-alias,
|
||||
.goods-group-map-submit {
|
||||
padding: 0 15rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品
|
||||
*/
|
||||
.goods-group-icon {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
.goods-group-title {
|
||||
font-weight: bold;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.goods-group-alias {
|
||||
border: 1px solid #3bb4f2;
|
||||
color: #3bb4f2;
|
||||
}
|
||||
.goods-image {
|
||||
width: 168rpx;
|
||||
height: 168rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.buy-number {
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.goods-base {
|
||||
min-height: 168rpx;
|
||||
margin-left: 180rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航
|
||||
*/
|
||||
.bottom-fixed .nav-base {
|
||||
width: 60%;
|
||||
}
|
||||
.bottom-fixed .nav-submit {
|
||||
width: 40%;
|
||||
}
|
||||
.bottom-fixed .nav-submit .btn {
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付方式
|
||||
*/
|
||||
.payment-list .item-content {
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
.payment-list .item-content .icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx !important;
|
||||
}
|
||||
.pay-tips {
|
||||
height: 32rpx;
|
||||
line-height: 32rpx;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
top: 12rpx;
|
||||
color: #fff;
|
||||
padding: 0 12rpx;
|
||||
border-radius: 16rpx 0 16rpx 0;
|
||||
font-size: 20rpx;
|
||||
background: #D8D8D8 linear-gradient(107deg, #FC6F31 0%, #E22C08 100%);
|
||||
}
|
||||
|
||||
/**
|
||||
* 扩展数据
|
||||
*/
|
||||
.extension-list {
|
||||
background-color: #ffffeb;
|
||||
border: 1px solid #ffe2cf;
|
||||
}
|
||||
.extension-list .item:not(:last-child) {
|
||||
border-bottom: 1px dashed #ffe2cf;
|
||||
}
|
||||
.extension-list .item .text-tips {
|
||||
color: #ff8f44;
|
||||
}
|
||||
|
||||
/**
|
||||
* 留言
|
||||
*/
|
||||
.content-textarea-container .content {
|
||||
height: 100rpx;
|
||||
}
|
||||
.content-textarea-container .textarea-view,
|
||||
.content-textarea-container .textarea {
|
||||
height: 100% !important;
|
||||
}
|
||||
.content-textarea-container .textarea {
|
||||
padding: 5rpx 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 销售+自提 模式选择
|
||||
*/
|
||||
.buy-site-model .item {
|
||||
padding: 25rpx 0;
|
||||
width: 50%;
|
||||
}
|
||||
.buy-site-model.count-3 .item {
|
||||
width: 33.33%;
|
||||
}
|
||||
.buy-site-model.count-4 .item {
|
||||
width: 25%;
|
||||
}
|
||||
.buy-site-model.count-5 .item {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表项
|
||||
*/
|
||||
.buy-data-item,
|
||||
.buy-data-item .right-value {
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.buy-data-item .right-value {
|
||||
width: calc(100% - 260rpx);
|
||||
}
|
||||
.buy-data-item .right-value .right-value-content {
|
||||
width: calc(100% - 32rpx);
|
||||
}
|
||||
|
||||
/*
|
||||
* 插件样式区域
|
||||
*/
|
||||
/*
|
||||
* 优惠劵
|
||||
*/
|
||||
.plugins-coupon-popup {
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.plugins-coupon-popup .close {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.plugins-coupon-container {
|
||||
max-height: 80vh;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.plugins-coupon-container .item,
|
||||
.plugins-coupon-container .v-right,
|
||||
.plugins-coupon-container .v-right .circle {
|
||||
height: 230rpx;
|
||||
}
|
||||
.plugins-coupon-container .not-use-tips {
|
||||
color: #f7b240;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 积分
|
||||
*/
|
||||
.plugins-points-buy-container {
|
||||
padding: 20rpx;
|
||||
}
|
||||
.plugins-points-buy-container .select .sales-price {
|
||||
margin-left: 30rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
.plugins-points-buy-container .desc {
|
||||
color: #F37B1D;
|
||||
}
|
||||
|
||||
.plugins-points-use-value {
|
||||
border-top-right-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
width: 130rpx;
|
||||
height: 38rpx;
|
||||
line-height: 38rpx;
|
||||
}
|
||||
|
||||
.plugins-points-use-submit {
|
||||
border-top-left-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;
|
||||
height: 42rpx !important;
|
||||
line-height: 42rpx !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店次卡-页面选择
|
||||
*/
|
||||
.plugins-realstore-container-view .image {
|
||||
width: 34rpx;
|
||||
height: 34rpx !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 门店次卡-弹窗选择
|
||||
*/
|
||||
.plugins-realstore-container {
|
||||
max-height: 80vh;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.plugins-realstore-container .item {
|
||||
overflow: hidden;
|
||||
height: 220rpx;
|
||||
}
|
||||
.plugins-realstore-container .v-left {
|
||||
width: calc(100% - 140rpx);
|
||||
padding: 30rpx 0 30rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
.plugins-realstore-container .v-left .base {
|
||||
font-family: arial;
|
||||
color: #D2364C;
|
||||
}
|
||||
.plugins-realstore-container .v-right {
|
||||
width: 140rpx;
|
||||
height: 220rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.plugins-realstore-container .v-right:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.plugins-realstore-container .item-disabled .v-right {
|
||||
background: #dfdfdf !important;
|
||||
color: #c0c0c0 !important;
|
||||
cursor: no-drop !important;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 留言快捷选择 - 智能工具箱
|
||||
*/
|
||||
.plugins-intellectstools-data-note-fast .note-fast-data-list {
|
||||
width: calc(100% - 112rpx);
|
||||
}
|
||||
1275
pages/buy/buy.vue
Normal file
1275
pages/buy/buy.vue
Normal file
File diff suppressed because it is too large
Load Diff
56
pages/cart-page/cart-page.vue
Normal file
56
pages/cart-page/cart-page.vue
Normal file
@@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 购物车 -->
|
||||
<component-cart ref="cart" :propCartNavBottomValue="footer_height_value" propSourceType="page"></component-cart>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav :propIsBar="true"></component-quick-nav>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common" @onFooterHeight="footer_height_value_event" :propIsFooterSeat="false"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentQuickNav from '@/components/quick-nav/quick-nav';
|
||||
import componentCart from '@/components/cart/cart';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
footer_height_value: 0
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentQuickNav,
|
||||
componentCart,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 底部菜单高度
|
||||
footer_height_value_event(value) {
|
||||
this.setData({
|
||||
footer_height_value: value
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
63
pages/cart/cart.vue
Normal file
63
pages/cart/cart.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 购物车 -->
|
||||
<component-cart ref="cart" :propCartNavBottomValue="footer_height_value"></component-cart>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common" @onFooterHeight="footer_height_value_event" :propIsFooterSeat="false"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentCart from "@/components/cart/cart";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
footer_height_value: 0
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentCart
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 初始化
|
||||
this.init();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
init() {
|
||||
// 数据加载
|
||||
if ((this.$refs.cart || null) != null) {
|
||||
this.$refs.cart.init();
|
||||
}
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show({object: this, method: 'init'});
|
||||
}
|
||||
},
|
||||
|
||||
// 底部菜单高度
|
||||
footer_height_value_event(value) {
|
||||
this.setData({
|
||||
footer_height_value: value
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
41
pages/common/open-setting-location/open-setting-location.css
Normal file
41
pages/common/open-setting-location/open-setting-location.css
Normal file
@@ -0,0 +1,41 @@
|
||||
page {
|
||||
background: #fbfbfb;
|
||||
}
|
||||
.open-setting-view {
|
||||
background: hsla(0, 0%, 0%, 0.1);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
/* #ifdef H5 */
|
||||
top: calc(88rpx + env(safe-area-inset-top));
|
||||
/* #endif */
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
z-index: 1000000;
|
||||
}
|
||||
.open-setting-view .content {
|
||||
margin: 0 auto;
|
||||
width: 360rpx;
|
||||
height: 200rpx;
|
||||
padding: 50rpx;
|
||||
border-radius: 12rpx;
|
||||
margin-top: 70%;
|
||||
position: relative;
|
||||
}
|
||||
.open-setting-view .content button {
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
.open-setting-view .content .value {
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
.open-setting-view .content .value text {
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
.open-setting-loding {
|
||||
padding-top: 35%;
|
||||
}
|
||||
.open-setting-loding image {
|
||||
margin: 0 auto;
|
||||
}
|
||||
149
pages/common/open-setting-location/open-setting-location.vue
Normal file
149
pages/common/open-setting-location/open-setting-location.vue
Normal file
@@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="is_show_open_setting" class="open-setting-view">
|
||||
<view class="content bg-white">
|
||||
<view class="msg cr-grey">{{$t('open-setting-location.open-setting-location.61wezw')}}</view>
|
||||
<view class="value cr-base">{{$t('open-setting-location.open-setting-location.6vev38')}}<text>{{$t('open-setting-location.open-setting-location.lult41')}}</text>{{$t('open-setting-location.open-setting-location.407106')}}</view>
|
||||
<button type="primary" open-type="openSetting" size="mini" @opensetting="setting_event">{{$t('open-setting-location.open-setting-location.65q4b3')}}</button>
|
||||
<view class="tc margin-top-sm">
|
||||
<navigator open-type="navigateBack" class="cp cr-grey dis-inline-block" hover-class="none">{{$t('common.return')}}</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="open-setting-loding">
|
||||
<image :src="common_static_url + 'bg-loding.gif'" class="avatar dis-block" mode="widthFix"></image>
|
||||
<view class="tc margin-top-sm">
|
||||
<navigator open-type="navigateBack" class="cp cr-grey dis-inline-block" hover-class="none">{{$t('common.return')}}</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="(error_msg || null) != null" class="cr-red margin-top-lg padding-horizontal-main">{{ error_msg }}</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
|
||||
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,
|
||||
is_show_open_setting: false,
|
||||
auth: "scope.userLocation",
|
||||
cache_key: app.globalData.data.cache_userlocation_key,
|
||||
error_msg: null,
|
||||
};
|
||||
},
|
||||
|
||||
components: {},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取权限
|
||||
init() {
|
||||
app.globalData.get_location_check(this.auth, this, "location_back_handle");
|
||||
},
|
||||
|
||||
// 位置权限校验回调
|
||||
location_back_handle(status = 0) {
|
||||
if (status == 1) {
|
||||
// 是否校验成功直接返回
|
||||
if (parseInt(this.params.is_check_success_back || 0) == 1) {
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
this.choose_location();
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
is_show_open_setting: true,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 配置打开事件
|
||||
setting_event(e) {
|
||||
if (e.detail.authSetting[this.auth]) {
|
||||
// 不展示打开设置的按钮容器
|
||||
this.setData({
|
||||
is_show_open_setting: false,
|
||||
});
|
||||
|
||||
// 是否校验成功直接返回
|
||||
if (parseInt(this.params.is_check_success_back || 0) == 1) {
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
this.choose_location();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 打开位置服务
|
||||
choose_location() {
|
||||
// app先返回当前页面再调用位置选择组件
|
||||
// #ifdef APP
|
||||
uni.navigateBack();
|
||||
// #endif
|
||||
|
||||
// 调用位置选择组件
|
||||
uni.chooseLocation({
|
||||
success: (res) => {
|
||||
// 位置数据存储缓存中,改变状态值(成功)
|
||||
res['status'] = 1;
|
||||
res['lat'] = res.latitude;
|
||||
res['lng'] = res.longitude;
|
||||
delete res['latitude'];
|
||||
delete res['longitude'];
|
||||
uni.setStorageSync(this.cache_key, res);
|
||||
|
||||
// 触发自定义事件并传递参数给上一页
|
||||
uni.$emit('refresh', { location_success: true });
|
||||
|
||||
// app则不执行返回操作、上面已经返回过了
|
||||
// #ifndef APP
|
||||
setTimeout(function () {
|
||||
uni.navigateBack();
|
||||
}, 500);
|
||||
// #endif
|
||||
},
|
||||
fail: (res) => {
|
||||
// 存在数据则改变状态值(失败)
|
||||
var result = {...(uni.getStorageSync(this.cache_key) || {}), ...{status: 3}};
|
||||
uni.setStorageSync(this.cache_key, result);
|
||||
|
||||
// 取消则自动返回、则显示错误
|
||||
// error=11 支付宝取消、msg包含cancel则其他平台
|
||||
var msg = res.errorMessage || res.chooseLocation || res.errMsg || this.$t('open-setting-location.open-setting-location.hwn386');
|
||||
if(res.error == 11 || msg.indexOf('cancel') != -1) {
|
||||
// app则不执行返回操作、上面已经返回过了
|
||||
// #ifndef APP
|
||||
uni.navigateBack();
|
||||
// #endif
|
||||
} else {
|
||||
this.setData({ error_msg: res.errMsg });
|
||||
app.globalData.showToast(res.errMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./open-setting-location.css";
|
||||
</style>
|
||||
146
pages/customview/customview.vue
Normal file
146
pages/customview/customview.vue
Normal file
@@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null">
|
||||
<!-- 搜索 -->
|
||||
<block v-if="(data.is_header || 0) == 1">
|
||||
<!-- 搜索框 -->
|
||||
<view class="padding-main bg-white">
|
||||
<component-search propClass="br" :propPlaceholder="$t('customview.customview.726k7y')"></component-search>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 内容 -->
|
||||
<mp-html :content="data.html_content" />
|
||||
|
||||
<!-- 结尾 -->
|
||||
<block v-if="(data.is_footer || 0) == 1">
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else>
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentSearch from "@/components/search/search";
|
||||
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_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: {},
|
||||
data: null,
|
||||
// 自定义分享信息
|
||||
share_info: {}
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentSearch,
|
||||
componentNoData,
|
||||
componentBottomLine
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 加载数据
|
||||
this.get_data();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "customview"),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data: data.data || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true
|
||||
});
|
||||
|
||||
if ((this.data || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data.seo_title || this.data.name,
|
||||
desc: this.data.seo_desc,
|
||||
path: '/pages/customview/customview',
|
||||
query: 'id='+this.data.id,
|
||||
img: this.data.logo
|
||||
}
|
||||
});
|
||||
|
||||
// 标题名称
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data.name
|
||||
});
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips')
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
193
pages/design/design.vue
Normal file
193
pages/design/design.vue
Normal file
@@ -0,0 +1,193 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="(data || null) != null">
|
||||
<!-- 搜索 -->
|
||||
<block v-if="(data.is_header || 0) == 1">
|
||||
<!-- 搜索框 -->
|
||||
<view class="padding-main bg-white">
|
||||
<component-search propClass="br" :propPlaceholder="$t('customview.customview.726k7y')"></component-search>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 拖拽模式、引入拖拽数据模块 -->
|
||||
<component-layout :propData="layout_data"></component-layout>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<block v-if="(data.is_footer || 0) == 1">
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</block>
|
||||
</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 componentLayout from "@/components/layout/layout";
|
||||
import componentSearch from "@/components/search/search";
|
||||
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_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
load_status: 0,
|
||||
params: null,
|
||||
data: null,
|
||||
layout_data: [],
|
||||
// 自定义分享信息
|
||||
share_info: {}
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentLayout,
|
||||
componentSearch,
|
||||
componentNoData,
|
||||
componentBottomLine
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 加载数据
|
||||
this.get_data();
|
||||
|
||||
// 公共onshow事件
|
||||
this.init_common();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化公共
|
||||
init_common() {
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data(params = {}) {
|
||||
// 还没有数据则读取缓存
|
||||
var cache_key = app.globalData.data.cache_design_page_data_key+(this.params.id || 0);
|
||||
if (this.load_status == 0) {
|
||||
// 本地缓存数据
|
||||
var upd_data = uni.getStorageSync(cache_key) || null;
|
||||
if (upd_data != null) {
|
||||
// 先使用缓存数据展示
|
||||
this.setData(upd_data);
|
||||
|
||||
// 已有本地缓存则直接取远程有效数据(默认首次取的是远程缓存数据)
|
||||
params['is_cache'] = 0;
|
||||
|
||||
// 公共onshow事件
|
||||
this.init_common();
|
||||
}
|
||||
} else {
|
||||
// 已有本地缓存则直接取远程有效数据(默认首次取的是远程缓存数据)
|
||||
params['is_cache'] = 0;
|
||||
}
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "design"),
|
||||
method: 'POST',
|
||||
data: {...this.params, ...params},
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var upd_data = {
|
||||
data: (data.data || null) != null && data.data.length != 0 ? data.data : null,
|
||||
layout_data: data.layout_data || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true
|
||||
};
|
||||
this.setData(upd_data);
|
||||
|
||||
// 存储缓存
|
||||
uni.setStorageSync(cache_key, upd_data);
|
||||
|
||||
// 是否需要重新加载数据
|
||||
if (parseInt(data.is_result_data_cache || 0) == 1) {
|
||||
this.get_data({ is_cache: 0 });
|
||||
}
|
||||
|
||||
if ((this.data || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data.seo_title || this.data.name,
|
||||
desc: this.data.seo_desc,
|
||||
path: '/pages/design/design',
|
||||
query: 'id='+this.data.id,
|
||||
img: this.data.logo
|
||||
}
|
||||
});
|
||||
|
||||
// 标题名称
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data.name
|
||||
});
|
||||
|
||||
// 公共onshow事件
|
||||
this.init_common();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg
|
||||
});
|
||||
}
|
||||
|
||||
// 非首次状态
|
||||
this.setData({
|
||||
load_status: 1
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
load_status: 1,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips')
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
208
pages/diy/diy.vue
Normal file
208
pages/diy/diy.vue
Normal file
@@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="(data || null) != null && (data.config || null) != null">
|
||||
<!-- diy模块 -->
|
||||
<componentDiy :propValue="data.config" :propDataId="data.id" :propKey="random_value" @onLocationBack="user_back_choice_location">
|
||||
<!-- 底部内容 -->
|
||||
<template slot="diy-bottom-content">
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</template>
|
||||
<!-- 底部公共 -->
|
||||
<template slot="diy-bottom-common">
|
||||
<component-common ref="common"></component-common>
|
||||
</template>
|
||||
</componentDiy>
|
||||
</block>
|
||||
<block v-else>
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentDiy from '@/components/diy/diy';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
export default {
|
||||
components: {
|
||||
componentCommon,
|
||||
componentDiy,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
load_status: 0,
|
||||
params: null,
|
||||
data: null,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
// 增加随机数,避免无法监听数据列表内部数据更新
|
||||
random_value: 0,
|
||||
};
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 加载数据
|
||||
this.get_data();
|
||||
|
||||
// 公共onshow事件
|
||||
this.init_common();
|
||||
|
||||
// 设置顶部导航的默认颜色
|
||||
this.set_navigation_bar_color();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化公共
|
||||
init_common() {
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data(params = {}) {
|
||||
// 还没有数据则读取缓存
|
||||
var cache_key = app.globalData.data.cache_diy_page_data_key + (this.params.id || 0);
|
||||
if (this.load_status == 0) {
|
||||
// 本地缓存数据
|
||||
var upd_data = uni.getStorageSync(cache_key) || null;
|
||||
if (upd_data != null) {
|
||||
// 先使用缓存数据展示
|
||||
this.setData(upd_data);
|
||||
|
||||
// 已有本地缓存则直接取远程有效数据(默认首次取的是远程缓存数据)
|
||||
params['is_cache'] = 0;
|
||||
|
||||
// 设置顶部导航的默认颜色
|
||||
this.set_navigation_bar_color();
|
||||
|
||||
// 公共onshow事件
|
||||
this.init_common();
|
||||
}
|
||||
} else {
|
||||
// 已有本地缓存则直接取远程有效数据(默认首次取的是远程缓存数据)
|
||||
params['is_cache'] = 0;
|
||||
}
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'diy'),
|
||||
method: 'POST',
|
||||
data: { ...this.params, ...params },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var upd_data = {
|
||||
data: data.data || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true,
|
||||
random_value: Math.random(),
|
||||
};
|
||||
this.setData(upd_data);
|
||||
// 存储缓存
|
||||
uni.setStorageSync(cache_key, upd_data);
|
||||
|
||||
// 是否需要重新加载数据
|
||||
if (parseInt(data.is_result_data_cache || 0) == 1) {
|
||||
this.get_data({ is_cache: 0 });
|
||||
}
|
||||
|
||||
if ((this.data || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data.name,
|
||||
desc: this.data.describe,
|
||||
path: '/pages/diy/diy',
|
||||
query: 'id=' + this.data.id,
|
||||
img: this.data.logo,
|
||||
},
|
||||
});
|
||||
|
||||
// 标题名称
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data.name,
|
||||
});
|
||||
|
||||
// 设置顶部导航的默认颜色
|
||||
this.set_navigation_bar_color();
|
||||
|
||||
// 公共onshow事件
|
||||
this.init_common();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
|
||||
// 非首次状态
|
||||
this.setData({
|
||||
load_status: 1,
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
load_status: 1,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 状态栏设置
|
||||
set_navigation_bar_color() {
|
||||
app.globalData.set_navigation_bar_color(parseInt(app.globalData.get_key_data(this.data, 'config.header.com_data.style.function_buttons_type', 0)) == 1);
|
||||
},
|
||||
|
||||
// 选择用户地理位置回调
|
||||
user_back_choice_location(e) {
|
||||
// 重新刷新数据
|
||||
this.get_data();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
// ::v-deep ::-webkit-scrollbar {
|
||||
// /* 滚动条整体样式 */
|
||||
// display: block !important;
|
||||
// width: 4rpx;
|
||||
// }
|
||||
</style>
|
||||
66
pages/error/error.vue
Normal file
66
pages/error/error.vue
Normal file
@@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="content padding-horizontal-main tc">
|
||||
<view class="margin-top-xxxl">
|
||||
<icon type="warn" size="16" color="#f00" class="va-m" />
|
||||
<view class="cr-red va-m dis-inline-block margin-left-sm">
|
||||
<block v-if="(params || null) != null && (params.msg || null) != null">{{params.msg}}</block>
|
||||
<block v-else>{{$t('error.error.u697ih')}}</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-xxl">
|
||||
<button type="default" size="mini" class="bg-main br-main cr-white round text-size-sm padding-left-xxxl padding-right-xxxl padding-top-xs padding-bottom-xs margin-top-xl" @tap="back_event">{{$t('common.return')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import base64 from '@/common/js/lib/base64.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
params: null
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
|
||||
// 页面加载初始化
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
if((params.msg || null) != null) {
|
||||
params['msg'] = base64.decode(decodeURIComponent(params.msg));
|
||||
}
|
||||
this.setData({
|
||||
params: params
|
||||
});
|
||||
},
|
||||
|
||||
// 页面显示
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 方法
|
||||
methods: {
|
||||
// 返回
|
||||
back_event(e) {
|
||||
app.globalData.page_back_prev_event();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.content {
|
||||
padding-top: 30%;
|
||||
}
|
||||
</style>
|
||||
15
pages/extraction-address/extraction-address.css
Normal file
15
pages/extraction-address/extraction-address.css
Normal file
@@ -0,0 +1,15 @@
|
||||
.address-logo {
|
||||
width: 140rpx;
|
||||
height: 140rpx !important;
|
||||
}
|
||||
.address .item-icon {
|
||||
width: 25rpx;
|
||||
height: 28rpx !important;
|
||||
}
|
||||
.address-alias {
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
.address .text {
|
||||
line-height: 44rpx;
|
||||
width: calc(100% - 35rpx);
|
||||
}
|
||||
255
pages/extraction-address/extraction-address.vue
Normal file
255
pages/extraction-address/extraction-address.vue
Normal file
@@ -0,0 +1,255 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="page">
|
||||
<view v-if="data_list.length > 0" class="padding-main">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="item bg-white padding-main border-radius-main spacing-mb">
|
||||
<view @tap="address_conent_event" :data-index="index" class="oh">
|
||||
<view v-if="(item.logo || null) != null" class="fl oh margin-right-lg">
|
||||
<image class="dis-block address-logo radius" :src="item.logo" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="oh">
|
||||
<view class="base oh padding-bottom-main padding-top-xs">
|
||||
<text v-if="(item.alias || null) != null" class="address-alias br-main cr-main round margin-right-sm">{{ item.alias }}</text>
|
||||
<text>{{ item.name }}</text>
|
||||
<text class="fr">{{ item.tel }}</text>
|
||||
</view>
|
||||
<view class="address oh padding-top-sm">
|
||||
<image class="item-icon fl margin-top-xs" :src="common_static_url + 'map-icon.png'" mode="widthFix"></image>
|
||||
<view class="text fr"> {{ item.province_name || "" }}{{ item.city_name || "" }}{{ item.county_name || "" }}{{ item.address || "" }} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="((item.distance_value || null) != null && (item.distance_unit || null) != null) || ((item.lng || 0) != 0 && (item.lat || 0) != 0)" class="item-operation br-t oh padding-top-main margin-top-main">
|
||||
<view v-if="(item.distance_value || null) != null && (item.distance_unit || null) != null" class="fl margin-top-sm">
|
||||
<text class="cr-grey text-size-xs">{{$t('extraction-address.extraction-address.42v8tv')}}{{ item.distance_value }}{{ item.distance_unit }}</text>
|
||||
</view>
|
||||
<button v-if="(item.lng || 0) != 0 && (item.lat || 0) != 0" class="fr round bg-white cr-base br" type="default" size="mini" @tap="address_map_event" :data-index="index" hover-class="none">{{$t('buy.buy.o7722q')}}</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>
|
||||
</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";
|
||||
|
||||
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,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_list: [],
|
||||
params: null,
|
||||
is_default: 0,
|
||||
is_first: 1,
|
||||
home_extraction_address_position: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
home_extraction_address_position: app.globalData.get_config("config.home_extraction_address_position", 0),
|
||||
});
|
||||
},
|
||||
|
||||
onReady() {
|
||||
// #ifndef MP-KUAISHOU
|
||||
// 是否获取位置、下单选择地址进入需要传参 is_buy
|
||||
if ((this.params.is_buy || 0) == 1 && this.home_extraction_address_position == 1) {
|
||||
app.globalData.choose_user_location_event();
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// #ifndef MP-KUAISHOU
|
||||
// 是否需要选择地理位置、这里不校验参数is_buy,仅页面进入才需要校验is_buy进入位置选择页面
|
||||
if (this.home_extraction_address_position == 1) {
|
||||
// 首次不请求数据
|
||||
if (this.is_first == 0) {
|
||||
// 先解绑自定义事件
|
||||
uni.$off('refresh');
|
||||
// 监听自定义事件并进行页面刷新操作
|
||||
uni.$on('refresh', (data) => {
|
||||
// 初始位置数据
|
||||
if((data.location_success || false) == true) {
|
||||
// 重新请求数据
|
||||
// #ifdef APP
|
||||
this.init();
|
||||
// #endif
|
||||
}
|
||||
});
|
||||
|
||||
// 初始化数据
|
||||
this.init();
|
||||
}
|
||||
} else {
|
||||
this.init();
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-KUAISHOU
|
||||
this.init();
|
||||
// #endif
|
||||
|
||||
// 首次状态
|
||||
this.setData({
|
||||
is_first: 0,
|
||||
});
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
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() {
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
var data = this.params || {};
|
||||
|
||||
// 是否有坐标
|
||||
var user_location = app.globalData.choice_user_location_init();
|
||||
if ((user_location || null) != null) {
|
||||
data["lng"] = user_location.lng;
|
||||
data["lat"] = user_location.lat;
|
||||
}
|
||||
|
||||
// 请求接口
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("extraction", "useraddress"),
|
||||
method: "POST",
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.length > 0) {
|
||||
// 获取当前默认地址
|
||||
var is_default = 0;
|
||||
for (var i in res.data.data) {
|
||||
if (res.data.data[i]["is_default"] == 1) {
|
||||
is_default = res.data.data[i]["id"];
|
||||
}
|
||||
}
|
||||
|
||||
// 设置数据
|
||||
this.setData({
|
||||
data_list: res.data.data,
|
||||
is_default: is_default,
|
||||
data_list_loding_status: 3,
|
||||
data_bottom_line_status: true,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, "get_data_list")) {
|
||||
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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 地图查看
|
||||
address_map_event(e) {
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var data = this.data_list[index] || null;
|
||||
if (data == null) {
|
||||
app.globalData.showToast(this.$t('user-order-detail.user-order-detail.i876o3'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// 打开地图
|
||||
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);
|
||||
},
|
||||
|
||||
// 地址内容事件
|
||||
address_conent_event(e) {
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var is_back = this.params.is_back || 0;
|
||||
if (is_back == 1) {
|
||||
uni.setStorage({
|
||||
key: app.globalData.data.cache_buy_user_address_select_key,
|
||||
data: this.data_list[index],
|
||||
});
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./extraction-address.css";
|
||||
</style>
|
||||
335
pages/goods-category/goods-category.css
Normal file
335
pages/goods-category/goods-category.css
Normal file
@@ -0,0 +1,335 @@
|
||||
/**
|
||||
* 头部背景
|
||||
*/
|
||||
.goods-top-bg {
|
||||
height: calc(320rpx + var(--status-bar-height) + 5px);
|
||||
/* #ifdef H5 */
|
||||
height: 286rpx;
|
||||
/* #endif */
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.goods-top-search-bg {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航搜索、内容区域
|
||||
*/
|
||||
.nav-search {
|
||||
padding-right: 250rpx;
|
||||
/* #ifdef MP-ALIPAY */
|
||||
padding-right: 255rpx;
|
||||
padding-left: 80rpx;
|
||||
/* #endif */
|
||||
/* #ifdef H5 || MP-TOUTIAO || APP */
|
||||
padding-right: 20rpx;
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
padding-top: 20rpx !important;
|
||||
/* #endif */
|
||||
padding-bottom: 20rpx;
|
||||
height: 64rpx;
|
||||
z-index: 5;
|
||||
}
|
||||
.nav-more-top {
|
||||
/* #ifdef H5 || APP */
|
||||
top: 135rpx !important;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
/**
|
||||
* 左侧导航
|
||||
*/
|
||||
.left-nav {
|
||||
width: 200rpx;
|
||||
background-color: #f5f5f5;
|
||||
height: 100%;
|
||||
}
|
||||
.left-nav .item {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
padding: 0 10rpx;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
.left-nav .nav-active {
|
||||
background: #fff;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/**
|
||||
* 右侧内容
|
||||
*/
|
||||
.right-container {
|
||||
width: calc(100% - 200rpx);
|
||||
height: 100%;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
.content-item {
|
||||
width: calc(100% / 3);
|
||||
}
|
||||
.content-item .content {
|
||||
padding: 28rpx;
|
||||
}
|
||||
.content-item .text {
|
||||
font-weight: 600;
|
||||
}
|
||||
.content-item .icon {
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
}
|
||||
.content-item.two-img .icon {
|
||||
width: 104rpx;
|
||||
height: 104rpx;
|
||||
}
|
||||
.content-item.two-img .content {
|
||||
padding: 26rpx 0;
|
||||
}
|
||||
.model-one .content-item:nth-child(3n) {
|
||||
border-right: 0;
|
||||
}
|
||||
.model-one .content .desc {
|
||||
min-height: 52rpx;
|
||||
line-height: 26rpx;
|
||||
}
|
||||
.model-one .content {
|
||||
height: 240rpx;
|
||||
}
|
||||
.one-content image {
|
||||
height: 120rpx;
|
||||
}
|
||||
.text-random-1,
|
||||
.text-random-2,
|
||||
.text-random-3,
|
||||
.text-random-4,
|
||||
.text-random-5,
|
||||
.text-random-6,
|
||||
.text-random-7,
|
||||
.text-random-8,
|
||||
.text-random-9 {
|
||||
position: relative;
|
||||
}
|
||||
.text-random-1::before,
|
||||
.text-random-2::before,
|
||||
.text-random-3::before,
|
||||
.text-random-4::before,
|
||||
.text-random-5::before,
|
||||
.text-random-6::before,
|
||||
.text-random-7::before,
|
||||
.text-random-8::before,
|
||||
.text-random-9::before {
|
||||
content: '';
|
||||
width: 126rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 6rpx;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.text-random-1::before {
|
||||
background: linear-gradient(90deg, #F2C3A5 0%, rgba(255, 255, 255, 0) 100%);
|
||||
}
|
||||
.text-random-2::before {
|
||||
background: linear-gradient(90deg, #FF9BBB 0%, rgba(255, 255, 255, 0) 100%);
|
||||
}
|
||||
.text-random-3::before {
|
||||
background: linear-gradient(90deg, #EAC5A9 0%, rgba(255, 255, 255, 0) 100%);
|
||||
}
|
||||
.text-random-4::before {
|
||||
background: linear-gradient(90deg, #F7BEBE 0%, rgba(255, 255, 255, 0) 100%);
|
||||
}
|
||||
.text-random-5::before {
|
||||
background: linear-gradient(90deg, #F2DC86 0%, rgba(255, 255, 255, 0) 100%);
|
||||
}
|
||||
.text-random-6::before {
|
||||
background: linear-gradient(90deg, #98B7E8 0%, rgba(255, 255, 255, 0) 100%);
|
||||
}
|
||||
.text-random-7::before {
|
||||
background: linear-gradient(90deg, #CD92F3 0%, rgba(255, 255, 255, 0) 100%);
|
||||
}
|
||||
.text-random-8::before {
|
||||
background: linear-gradient(90deg, #5EEA7C 0%, rgba(255, 255, 255, 0) 100%);
|
||||
}
|
||||
.text-random-9::before {
|
||||
background: linear-gradient(90deg, #E67A7A 0%, rgba(255, 255, 255, 0) 100%);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 商品列表模式
|
||||
*/
|
||||
.category-content {
|
||||
height: 100vh;
|
||||
/* #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU || MP-ALIPAY || APP */
|
||||
height: calc(100vh - 134rpx - var(--window-bottom));
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
height: calc(100vh - 104rpx - var(--window-bottom));
|
||||
/* #endif */
|
||||
}
|
||||
.category-content.goods-model {
|
||||
padding-top: 182rpx;
|
||||
}
|
||||
.top-nav {
|
||||
height: 182rpx;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 4;
|
||||
}
|
||||
.top-nav-scroll {
|
||||
width: calc(100% - 70rpx);
|
||||
}
|
||||
.top-nav .icon-content {
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
padding: 1px;
|
||||
}
|
||||
.top-nav-scroll .item:first-of-type {
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
.top-nav .item {
|
||||
padding: 20rpx 4rpx;
|
||||
}
|
||||
.nav-list-more {
|
||||
width: 100%;
|
||||
max-height: 550rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.nav-list-more image {
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.nav-list-more .item {
|
||||
width: 20%;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
.goods-right-content {
|
||||
width: calc(100% - 200rpx);
|
||||
height: calc(100% - 182rpx);
|
||||
top: 182rpx;
|
||||
right: 0;
|
||||
}
|
||||
.right-content-actual .item {
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.right-content-actual .item:not(:last-of-type) {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.right-content-actual .item .plugins-label-img {
|
||||
border-top-left-radius: 10rpx;
|
||||
}
|
||||
.goods-right-content.category-one-subset-content {
|
||||
width: 100%;
|
||||
}
|
||||
.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 {
|
||||
width: calc(100% - 200rpx);
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 底部导航
|
||||
*/
|
||||
.botton-nav {
|
||||
width: calc(100% - 60rpx);
|
||||
left: auto;
|
||||
bottom: 20rpx;
|
||||
z-index: 2;
|
||||
margin-left: 20rpx;
|
||||
box-shadow: 0rpx 4rpx 8rpx 0px rgba(0, 0, 0, 0.16);
|
||||
line-height: 84rpx;
|
||||
height: 84rpx;
|
||||
}
|
||||
.botton-nav .btn {
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
.botton-nav .cart .badge-icon {
|
||||
top: -20rpx;
|
||||
right: -2rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 购物车
|
||||
*/
|
||||
.cart-mask {
|
||||
left: 0;
|
||||
top: 0;
|
||||
background: rgb(0, 0, 0, 0.6);
|
||||
z-index: 5;
|
||||
}
|
||||
.cart-content {
|
||||
left: auto;
|
||||
bottom: 150rpx;
|
||||
width: calc(100% - 40rpx);
|
||||
z-index: 6;
|
||||
max-width: calc(800px - 40rpx);
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.cart-content .cart-list {
|
||||
max-height: 60vh;
|
||||
}
|
||||
.cart-content .cart-list .goods-img {
|
||||
width: 132rpx;
|
||||
height: 132rpx !important;
|
||||
}
|
||||
.cart-content .cart-list .goods-base {
|
||||
padding-right: 0;
|
||||
padding-left: 24rpx;
|
||||
}
|
||||
.cart-content .cart-list .goods-base-content {
|
||||
min-height: 60rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 无数据
|
||||
*/
|
||||
.no-data {
|
||||
z-index: 101;
|
||||
}
|
||||
|
||||
/*
|
||||
* 隐藏滚动条
|
||||
*/
|
||||
scroll-view ::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
color: transparent;
|
||||
}
|
||||
1393
pages/goods-category/goods-category.vue
Normal file
1393
pages/goods-category/goods-category.vue
Normal file
File diff suppressed because it is too large
Load Diff
52
pages/goods-comment/goods-comment.css
Normal file
52
pages/goods-comment/goods-comment.css
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 评分
|
||||
*/
|
||||
.score-container .score {
|
||||
width: 180rpx;
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
.score-container .score .value {
|
||||
font-weight: bold;
|
||||
font-size: 60rpx;
|
||||
line-height: 60rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.progress {
|
||||
overflow: hidden;
|
||||
height: 40rpx;
|
||||
background-color: #eee;
|
||||
margin-left: 24rpx;
|
||||
}
|
||||
.progress .cr-grey {
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.progress-bar {
|
||||
float: left;
|
||||
width: 0;
|
||||
height: 100%;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background-color: #0e90d2;
|
||||
}
|
||||
.progress-bar-danger {
|
||||
background-color: #dd514c;
|
||||
}
|
||||
.progress-bar-warning {
|
||||
background-color: #F37B1D;
|
||||
}
|
||||
.progress-bar-secondary {
|
||||
background-color: #3bb4f2;
|
||||
}
|
||||
.progress-bar-success {
|
||||
background-color: #5eb95e;
|
||||
}
|
||||
|
||||
/*
|
||||
* 列表
|
||||
*/
|
||||
.scroll-box {
|
||||
height: calc(100vh - 148rpx);
|
||||
}
|
||||
254
pages/goods-comment/goods-comment.vue
Normal file
254
pages/goods-comment/goods-comment.vue
Normal file
@@ -0,0 +1,254 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 提示信息 -->
|
||||
<block v-if="data_list_loding_status == 1">
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 评分 -->
|
||||
<view v-if="goods_score != null" class="score-container oh padding-main">
|
||||
<view class="bg-white border-radius-main padding-main flex-row jc-sb align-c">
|
||||
<view class="score tc">
|
||||
<view class="cr-base">{{$t('goods-comment.goods-comment.dfmjxd')}}</view>
|
||||
<view class="value cr-main">{{ goods_score.avg || "0.0" }}</view>
|
||||
</view>
|
||||
<view class="progress tc border-radius-main flex-1 flex-width">
|
||||
<block v-if="goods_score.avg > 0">
|
||||
<block v-for="(item, index) in goods_score.rating" :key="index">
|
||||
<view v-if="item.portion > 0" :class="'progress-bar ' + progress_class[index]" :style="'width: ' + item.portion + '%;'">{{ item.name }}</view>
|
||||
</block>
|
||||
</block>
|
||||
<text v-else class="cr-grey">{{$t('goods-comment.goods-comment.1qh8s8')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view class="padding-horizontal-main goods-comment">
|
||||
<!-- 评价 -->
|
||||
<component-goods-comments :propData="data_list" :propIsReply="true" propClass="bg-white padding-main border-radius-main"></component-goods-comments>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
</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 componentGoodsComments from "@/components/goods-comments/goods-comments";
|
||||
|
||||
var static_url = app.globalData.get_static_url("home");
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
static_url: static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
goods_score: null,
|
||||
params: null,
|
||||
progress_class: ["progress-bar-danger", "progress-bar-warning", "progress-bar-secondary", "", "progress-bar-success"],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentGoodsComments,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: 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() {
|
||||
// 获取数据
|
||||
this.get_goods_score();
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 获取商品评分
|
||||
get_goods_score() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("goodsscore", "goods"),
|
||||
method: "POST",
|
||||
data: {
|
||||
goods_id: this.params.goods_id,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
goods_score: res.data.data || null,
|
||||
});
|
||||
} else {
|
||||
if (res.data.code != -400) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
get_data_list(is_mandatory) {
|
||||
// 参数校验
|
||||
if ((this.params.goods_id || null) == null) {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
});
|
||||
} else {
|
||||
// 分页是否还有数据
|
||||
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,
|
||||
});
|
||||
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("comments", "goods"),
|
||||
method: "POST",
|
||||
data: {
|
||||
goods_id: this.params.goods_id,
|
||||
page: this.data_page,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
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,
|
||||
});
|
||||
if (this.data_page <= 1) {
|
||||
this.setData({
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
} 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: () => {
|
||||
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();
|
||||
},
|
||||
|
||||
// 评价图片预览
|
||||
comment_images_show_event(e) {
|
||||
var index = e.currentTarget.dataset.index;
|
||||
var ix = e.currentTarget.dataset.ix;
|
||||
uni.previewImage({
|
||||
current: this.data_list[index]["images"][ix],
|
||||
urls: this.data_list[index]["images"],
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./goods-comment.css";
|
||||
</style>
|
||||
578
pages/goods-detail/goods-detail.css
Normal file
578
pages/goods-detail/goods-detail.css
Normal file
@@ -0,0 +1,578 @@
|
||||
.page {
|
||||
padding-bottom: 130rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 顶部导航内容
|
||||
*/
|
||||
.top-nav-left-icon {
|
||||
top: 28px;
|
||||
z-index: 11;
|
||||
}
|
||||
.top-nav-left-icon {
|
||||
left: auto;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.top-nav-left-icon .icon {
|
||||
background: rgb(255 255 255 / 70%);
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
display: block;
|
||||
float: left;
|
||||
text-align: center;
|
||||
padding: 3px;
|
||||
}
|
||||
.top-nav {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: calc(100% - 40rpx);
|
||||
/* #ifdef H5 || APP */
|
||||
bottom: 6px;
|
||||
padding-bottom: 5px;
|
||||
/* #endif */
|
||||
}
|
||||
.top-nav-content {
|
||||
margin: 0 auto;
|
||||
width: 310rpx;
|
||||
margin-left: calc(50% - 170rpx);
|
||||
}
|
||||
.top-nav-content text {
|
||||
font-size: 30rpx;
|
||||
/* #ifdef H5 || APP */
|
||||
font-size: 14px;
|
||||
/* #endif */
|
||||
}
|
||||
.top-nav-content text:not(:last-child) {
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
.top-nav-content .nav-active {
|
||||
font-weight: 500;
|
||||
padding-bottom: 2rpx;
|
||||
border-style: solid;
|
||||
border-width: 0 0 2px 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 顶部更多导航
|
||||
*/
|
||||
.nav-more-view {
|
||||
position: fixed;
|
||||
z-index: 20;
|
||||
top: 62px;
|
||||
left: 20rpx;
|
||||
}
|
||||
.nav-more-view .triangle {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-width: 0 5px 5px 5px;
|
||||
border-style: solid;
|
||||
border-color: transparent transparent rgb(0 0 0 / 0.7) transparent;
|
||||
top: -5px;
|
||||
left: calc(20rpx + 42px);
|
||||
}
|
||||
.nav-more-view .content {
|
||||
background: rgb(0 0 0 / 0.7);
|
||||
}
|
||||
.nav-more-view .content .item {
|
||||
font-size: 12px;
|
||||
}
|
||||
.nav-more-view .content .item:not(:last-child) {
|
||||
border-bottom: 1px solid #585858;
|
||||
}
|
||||
|
||||
/**
|
||||
* 相册
|
||||
*/
|
||||
.goods-photo .swiper,
|
||||
.goods-photo .swiper-item {
|
||||
height: 55vh !important;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* 购买操作导航
|
||||
*/
|
||||
.goods-buy-nav .btn-items .btn {
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
padding: 0 10rpx;
|
||||
margin-right: 15rpx;
|
||||
position: relative;
|
||||
}
|
||||
.goods-buy-nav .image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin: 10rpx 0 5rpx 0;
|
||||
}
|
||||
.goods-buy-nav .dis-block {
|
||||
margin-top: -10rpx;
|
||||
}
|
||||
.goods-buy-nav .badge-icon {
|
||||
position: absolute;
|
||||
top: 2rpx;
|
||||
left: calc(50% + 25rpx);
|
||||
z-index: 1;
|
||||
}
|
||||
.goods-buy-nav-btn-number-0 .btn,
|
||||
.goods-buy-nav-btn-number-1 .btn {
|
||||
width: calc(100% - 15rpx) !important;
|
||||
}
|
||||
.goods-buy-nav-btn-number-2 .btn {
|
||||
width: calc(50% - 15rpx) !important;
|
||||
}
|
||||
.goods-buy-nav-btn-number-3 .btn {
|
||||
width: calc(33.33% - 15rpx) !important;
|
||||
}
|
||||
.goods-buy-nav-btn-number-4 .btn {
|
||||
width: calc(25% - 15rpx) !important;
|
||||
}
|
||||
.goods-buy-nav-btn-number-5 .btn {
|
||||
width: calc(20% - 15rpx) !important;
|
||||
}
|
||||
.goods-buy-nav-btn-number-6 .btn {
|
||||
width: calc(16.66% - 15rpx) !important;
|
||||
}
|
||||
.goods-buy-nav-btn-number-7 .btn {
|
||||
width: calc(14.28% - 15rpx) !important;
|
||||
}
|
||||
.goods-buy-nav-btn-number-8 .btn {
|
||||
width: calc(12.5% - 15rpx) !important;
|
||||
}
|
||||
.goods-buy-nav-btn-number-9 .btn {
|
||||
width: calc(11.11% - 15rpx) !important;
|
||||
}
|
||||
.goods-buy-nav-btn-number-10 .btn {
|
||||
width: calc(10% - 15rpx) !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品基础
|
||||
*/
|
||||
.goods-base-content .goods-title-content {
|
||||
position: relative;
|
||||
min-height: 86rpx;
|
||||
}
|
||||
.goods-base-content .goods-title-content .goods-title {
|
||||
font-size: 30rpx;
|
||||
line-height: 40rpx;
|
||||
font-weight: bold;
|
||||
width: calc(100% - 200rpx);
|
||||
}
|
||||
.goods-base-content image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
.goods-base-content .collect {
|
||||
width: 76rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 视频
|
||||
*/
|
||||
.goods-video {
|
||||
width: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
.goods-video video {
|
||||
width: 100%;
|
||||
height: 55vh !important;
|
||||
}
|
||||
.goods-video-submit {
|
||||
left: 50rpx;
|
||||
top: auto;
|
||||
bottom: 60rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
.goods-video-submit image {
|
||||
width: 80rpx;
|
||||
height: 80rpx !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础价格信息
|
||||
*/
|
||||
.goods-base-price,
|
||||
.price-content,
|
||||
.goods-base-right-opt {
|
||||
min-height: 145rpx;
|
||||
}
|
||||
.price-content {
|
||||
width: calc(100% - 200rpx);
|
||||
}
|
||||
.goods-base-right-opt {
|
||||
width: 200rpx;
|
||||
}
|
||||
.price-content,
|
||||
.goods-base-right-opt {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
.goods-base-right-opt image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
.goods-base-right-opt .collect {
|
||||
width: 76rpx;
|
||||
}
|
||||
.price-content .price-icon {
|
||||
padding: 0px 8rpx;
|
||||
color: #fff;
|
||||
border: 1px solid #FF5722;
|
||||
background: #FF5722;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.price-content .sales-price {
|
||||
font-size: 42rpx;
|
||||
}
|
||||
.price-content .item:not(:last-child) {
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* app独立内容
|
||||
*/
|
||||
.goods-detail-app .content-items view {
|
||||
padding: 15rpx 10rpx;
|
||||
line-height: 44rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 价格信息与秒杀结合
|
||||
*/
|
||||
.countdown-content {
|
||||
width: 38%;
|
||||
}
|
||||
.countdown-content .time-title {
|
||||
font-size: 38rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.goods-base-price-countdown {
|
||||
background: #e84742 !important;
|
||||
}
|
||||
.goods-base-price-countdown .price-content {
|
||||
background: #f9534e;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
width: 60%;
|
||||
min-height: 164rpx;
|
||||
}
|
||||
.goods-base-price-countdown .price-content .price-icon {
|
||||
border-color: #fff;
|
||||
color: #fff;
|
||||
background: transparent;
|
||||
}
|
||||
.goods-base-price-countdown .price-content .sales-price,
|
||||
.goods-base-price-countdown .price-content .sales-price-unit,
|
||||
.goods-base-price-countdown .price-content .points-price-value,
|
||||
.goods-base-price-countdown .price-content .points-price-unit {
|
||||
color: #fff !important;
|
||||
}
|
||||
.goods-base-price-countdown .price-content .original-price,
|
||||
.goods-base-price-countdown .price-content .unit{
|
||||
color: #ffcece !important;
|
||||
}
|
||||
.price-content .price-icon.seckill {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
bottom: 20rpx;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品参数
|
||||
*/
|
||||
.parameters-base .content-item .item {
|
||||
color: #666;
|
||||
}
|
||||
.goods-parameters .content-item .item {
|
||||
padding: 8rpx 10rpx;
|
||||
width: calc(50% - 20rpx);
|
||||
}
|
||||
.goods-parameters .content-item .item .name {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.goods-parameters .content-item .item:nth-child(2n-1) {
|
||||
float: left;
|
||||
}
|
||||
.goods-parameters .content-item .item:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品参数弹窗
|
||||
*/
|
||||
.popup-params-container {
|
||||
max-height: 80vh;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.popup-params-container .item .name {
|
||||
width: 220rpx;
|
||||
}
|
||||
.popup-params-container .item .value {
|
||||
width: calc(100% - 240rpx);
|
||||
}
|
||||
|
||||
/*
|
||||
* 标题icon
|
||||
*/
|
||||
.goods-title-icon-item {
|
||||
background: #666;
|
||||
color: #fff;
|
||||
padding: 0 8rpx;
|
||||
line-height: 26rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
/*
|
||||
* 面板
|
||||
*/
|
||||
.goods-panel-container {
|
||||
background: #fffbfc;
|
||||
color: #d2354c;
|
||||
}
|
||||
.goods-panel-container view {
|
||||
padding: 15rpx 0;
|
||||
}
|
||||
.goods-panel-container view:not(:first-child) {
|
||||
border-top: 1px dashed #fff1f2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 购买记录 - 插件
|
||||
*/
|
||||
.plugins-salerecords-tips,
|
||||
.plugins-salerecords-tips-top-left,
|
||||
.plugins-salerecords-tips-top-right,
|
||||
.plugins-salerecords-tips-bottom-left,
|
||||
.plugins-salerecords-tips-bottom-right,
|
||||
.plugins-salerecords-tips-top-center,
|
||||
.plugins-salerecords-tips-bottom-center {
|
||||
position: fixed;
|
||||
left: calc(50% - 170rpx);
|
||||
top: 50%;
|
||||
background: rgb(0 0 0 / 60%);
|
||||
border-radius: 60rpx;
|
||||
padding: 8rpx 20rpx;
|
||||
color: #fff;
|
||||
z-index: 50;
|
||||
-webkit-box-shadow: 0 8px 10px rgb(0 0 0 / 20%);
|
||||
-moz-box-shadow: 0 8px 10px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 8px 10px rgb(0 0 0 / 20%);
|
||||
}
|
||||
.plugins-salerecords-tips image,
|
||||
.plugins-salerecords-tips-top-left image,
|
||||
.plugins-salerecords-tips-top-right image,
|
||||
.plugins-salerecords-tips-bottom-left image,
|
||||
.plugins-salerecords-tips-bottom-right image,
|
||||
.plugins-salerecords-tips-top-center image,
|
||||
.plugins-salerecords-tips-bottom-center image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.plugins-salerecords-tips-top-left {
|
||||
left: 5%;
|
||||
top: 13%;
|
||||
}
|
||||
.plugins-salerecords-tips-top-right {
|
||||
right: 5%;
|
||||
top: 13%;
|
||||
left: auto;
|
||||
}
|
||||
.plugins-salerecords-tips-top-center {
|
||||
top: 13%;
|
||||
}
|
||||
|
||||
/* #ifdef MP-ALIPAY */
|
||||
.plugins-salerecords-tips-top-left {
|
||||
top: 5%;
|
||||
}
|
||||
.plugins-salerecords-tips-top-right {
|
||||
top: 5%;
|
||||
}
|
||||
.plugins-salerecords-tips-top-center {
|
||||
top: 5%;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
.plugins-salerecords-tips-bottom-left {
|
||||
left: 5%;
|
||||
bottom: 10%;
|
||||
top: auto;
|
||||
}
|
||||
.plugins-salerecords-tips-bottom-right {
|
||||
right: 5%;
|
||||
bottom: 10%;
|
||||
left: auto;
|
||||
top: auto;
|
||||
}
|
||||
.plugins-salerecords-tips-bottom-center {
|
||||
bottom: 10%;
|
||||
top: auto;
|
||||
}
|
||||
|
||||
/*
|
||||
* 优惠劵 - 插件
|
||||
*/
|
||||
.coupon-padding {
|
||||
padding: 2rpx;
|
||||
}
|
||||
.mini-coupon {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 4rpx;
|
||||
padding: 0 16rpx;
|
||||
}
|
||||
.mini-coupon::before,
|
||||
.mini-coupon::after {
|
||||
content: '';
|
||||
width: 14rpx;
|
||||
height: 14rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.mini-coupon::before {
|
||||
left: -8rpx;
|
||||
}
|
||||
.mini-coupon::after {
|
||||
right: -8rpx;
|
||||
}
|
||||
.mini-coupon-br::before,
|
||||
.mini-coupon-br::after {
|
||||
border: 1px solid #FE5500;
|
||||
}
|
||||
.coupon-srcoll {
|
||||
white-space: nowrap;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.coupon-srcoll::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
display: none;
|
||||
}
|
||||
.received-coupon {
|
||||
background: #FFEBE0;
|
||||
border: 2rpx solid #FE5500;
|
||||
color: #FE5500;
|
||||
}
|
||||
.not-received-coupon {
|
||||
background: #FE5500;
|
||||
border: 2rpx solid #FE5500;
|
||||
color: #fff;
|
||||
}
|
||||
.received-coupon .divider-l::before {
|
||||
background: red;
|
||||
}
|
||||
.not-received-coupon .divider-l::before {
|
||||
background: #fff;
|
||||
}
|
||||
.plugins-coupon-container-view .item-title {
|
||||
min-width: 70rpx;
|
||||
}
|
||||
.plugins-coupon-container-view .item:not(:last-child) {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.plugins-coupon-container {
|
||||
max-height: 50vh;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.plugins-coupon-container .v-left {
|
||||
padding: 20rpx 10rpx 20rpx 20rpx;
|
||||
}
|
||||
.plugins-coupon-container .item:not(:last-child) {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.plugins-coupon-container .item,
|
||||
.plugins-coupon-container .v-right,
|
||||
.plugins-coupon-container .v-right .circle {
|
||||
height: 175rpx;
|
||||
}
|
||||
.plugins-coupon-container .v-left .base .price {
|
||||
font-size: 46rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签 - 插件
|
||||
*/
|
||||
.plugins-label navigator:not(:last-child) {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.plugins-label navigator {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.plugins-label-top-left,
|
||||
.plugins-label-top-center,
|
||||
.plugins-label-top-right {
|
||||
top: calc(var(--status-bar-height) + 130rpx);
|
||||
}
|
||||
.plugins-label-text {
|
||||
padding: 20rpx 20rpx 0 20rpx;
|
||||
}
|
||||
.plugins-label-bottom-left,
|
||||
.plugins-label-bottom-center,
|
||||
.plugins-label-bottom-right {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 智能工具 - 插件
|
||||
*/
|
||||
.plugins-intellectstools-base-bottom-container .notice-content {
|
||||
padding: 10rpx 20rpx;
|
||||
background: #fff1f0;
|
||||
border-color: #ffe2e0;
|
||||
color: #dd514c;
|
||||
}
|
||||
.plugins-intellectstools-content-top-container {
|
||||
background: #daeeff;
|
||||
color: #2b6e8f;
|
||||
border: 1px solid #c9e9ff;
|
||||
}
|
||||
.plugins-intellectstools-content-top-container .panel-content .item:first-child {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
.plugins-intellectstools-content-top-container .panel-title,
|
||||
.plugins-intellectstools-content-top-container .panel-content .item:not(:last-child) {
|
||||
border-bottom: 1px solid #c8e4fb !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店 - 插件
|
||||
*/
|
||||
.plugins-realstore-popup {
|
||||
max-height: 80vh;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品服务 - 插件
|
||||
*/
|
||||
.plugins-goodsservice-view-container .item image {
|
||||
width: 32rpx;
|
||||
height: 32rpx !important;
|
||||
}
|
||||
.plugins-goodsservice-container .item image {
|
||||
width: 70rpx;
|
||||
height: 70rpx !important;
|
||||
}
|
||||
.plugins-goodsservice-container .item .left {
|
||||
width: 80rpx;
|
||||
}
|
||||
.plugins-goodsservice-container .item .right {
|
||||
width: calc(100% - 90rpx);
|
||||
}
|
||||
1511
pages/goods-detail/goods-detail.vue
Normal file
1511
pages/goods-detail/goods-detail.vue
Normal file
File diff suppressed because it is too large
Load Diff
16
pages/goods-search-start/goods-search-start.css
Normal file
16
pages/goods-search-start/goods-search-start.css
Normal file
@@ -0,0 +1,16 @@
|
||||
.ranking-list .ranking-item {
|
||||
width: 65vw;
|
||||
}
|
||||
.ranking-list .goods-list .goods-image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
.ranking-list .goods-list .goods-title {
|
||||
width: calc(100% - 120rpx);
|
||||
}
|
||||
.ranking-list .goods-list .single-text {
|
||||
width: 59vw;
|
||||
}
|
||||
.ranking-list .goods-list .icon {
|
||||
width: 38rpx;
|
||||
}
|
||||
208
pages/goods-search-start/goods-search-start.vue
Normal file
208
pages/goods-search-start/goods-search-start.vue
Normal file
@@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="padding-bottom-main">
|
||||
<view class="padding-horizontal-main padding-top-main">
|
||||
<!-- 搜索 -->
|
||||
<view class="margin-bottom-xxxl">
|
||||
<component-search ref="search" :propIsBtn="true" :propIsOnEvent="true" propSize="sm" @onsearch="search_history_handle" :propPlaceholderValue="search_placeholder_keywords_value" :propPlaceholder="search_keywords_value" :propDefaultValue="search_keywords_value" propBrColor="#eee" propPlaceholderClass="cr-grey-c" propIconColor="#999" propBgColor="#fff"></component-search>
|
||||
</view>
|
||||
<!-- 历史搜索关键字 -->
|
||||
<view v-if="history_keywords.length > 0" class="history-keywords margin-bottom-xxxl">
|
||||
<view class="margin-bottom flex-row jc-sb align-c">
|
||||
<text class="text-size-sm fw-b">历史搜索</text>
|
||||
<view class="dis-inline-block" @tap="history_delete_event">
|
||||
<iconfont name="icon-delete" size="30rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="oh">
|
||||
<block v-for="(item, index) in history_keywords" :key="index">
|
||||
<view class="dis-inline-block bg-grey-e cr-base round padding-vertical-xs padding-horizontal-lg margin-right margin-bottom" :data-value="item" @tap="keywords_event">{{item}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 推荐搜索关键字 -->
|
||||
<view v-if="recommend_keywords.length > 0" class="recommend-keywords margin-bottom-xxxl">
|
||||
<view class="text-size-sm fw-b margin-bottom">热门搜索</view>
|
||||
<view class="oh">
|
||||
<block v-for="(item, index) in recommend_keywords" :key="index">
|
||||
<view class="dis-inline-block bg-grey-e cr-base round padding-vertical-xs padding-horizontal-lg margin-right margin-bottom" :data-value="item" @tap="keywords_event">{{item}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 排行榜 -->
|
||||
<view v-if="ranking_list.length > 0" class="ranking-list scroll-view-horizontal oh">
|
||||
<scroll-view scroll-x="true">
|
||||
<block v-for="(item, index) in ranking_list" :key="index">
|
||||
<view class="ranking-item dis-inline-grid bg-main-light padding-sm border-radius-main margin-right-main" :class="index == 0 ? 'margin-left-main' : ''">
|
||||
<view class="padding-vertical-sm padding-left-sm">
|
||||
<view v-if="(item.icon || null) != null" class="dis-inline-block margin-right-sm">
|
||||
<iconfont :name="item.icon" size="26rpx" propClass="cr-main"></iconfont>
|
||||
</view>
|
||||
<text class="text-size-sm fw-b cr-main">{{item.name}}</text>
|
||||
</view>
|
||||
<view class="goods-list bg-white border-radius-main padding-main margin-top-xs">
|
||||
<block v-for="(item2, index2) in item.data" :key="index2">
|
||||
<view class="goods-item oh margin-bottom-main" :data-value="item2.goods_url" @tap="url_event">
|
||||
<view v-if="index2 > 2" class="single-text">
|
||||
<view class="dis-inline-block pr va-m margin-right-sm">
|
||||
<iconfont name="icon-label" size="38rpx" propClass="cr-grey-c"></iconfont>
|
||||
<view class="icon pa top-xs left-xs tc cr-white text-size-xs">{{index2+1}}</view>
|
||||
</view>
|
||||
<text class="text-size-sm va-m">{{item2.title}}</text>
|
||||
</view>
|
||||
<view v-else class="pr">
|
||||
<view class="pa top-sm left-sm z-i tc">
|
||||
<iconfont name="icon-label" size="38rpx" :propClass="index2 == 0 ? 'cr-red' : (index2 == 1 ? 'cr-yellow' : 'cr-blue-dark')"></iconfont>
|
||||
<view class="icon pa top-xs left-xs tc cr-white text-size-xs">{{index2+1}}</view>
|
||||
</view>
|
||||
<image class="goods-image radius fl" :src="item2.images" mode="aspectFill"></image>
|
||||
<view class="goods-title text-size-sm multi-text fr">{{item2.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common" :propIsFooterSeat="false"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentSearch from '@/components/search/search';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
history_keywords: [],
|
||||
recommend_keywords: [],
|
||||
ranking_list: [],
|
||||
search_placeholder_keywords_value: '',
|
||||
search_keywords_value: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentSearch,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
params = app.globalData.launch_params_handle(params);
|
||||
this.setData({
|
||||
params: params,
|
||||
search_placeholder_keywords_value: params.keywords || '',
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 历史搜索
|
||||
this.setData({
|
||||
history_keywords: uni.getStorageSync(app.globalData.data.cache_search_history_key) || [],
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
get_data(params = {}) {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("start", "search"),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
recommend_keywords: data.search_keywords || [],
|
||||
ranking_list: data.ranking_list || [],
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 搜索历史记录删除事件
|
||||
history_delete_event(e) {
|
||||
uni.removeStorageSync(app.globalData.data.cache_search_history_key);
|
||||
this.setData({
|
||||
history_keywords: []
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.del_success'), 'success');
|
||||
},
|
||||
|
||||
// 搜索历史处理
|
||||
search_history_handle(value = '') {
|
||||
// 记录缓存
|
||||
var key = app.globalData.data.cache_search_history_key;
|
||||
var data = uni.getStorageSync(key) || [];
|
||||
var index = data.indexOf(value);
|
||||
if(index != -1) {
|
||||
data.splice(index, 1);
|
||||
}
|
||||
data.unshift(value);
|
||||
uni.setStorageSync(key, data);
|
||||
|
||||
// 数据存储
|
||||
this.setData({
|
||||
search_keywords_value: value
|
||||
});
|
||||
|
||||
// 执行搜索
|
||||
this.search_submit_confirm_event();
|
||||
},
|
||||
|
||||
// 搜索关键字事件
|
||||
keywords_event(e) {
|
||||
this.search_history_handle(e.currentTarget.dataset.value);
|
||||
},
|
||||
|
||||
// 搜索事件
|
||||
search_submit_confirm_event() {
|
||||
if ((this.$refs.search || null) != null) {
|
||||
this.$refs.search.search_submit_confirm(this.search_keywords_value);
|
||||
}
|
||||
},
|
||||
|
||||
// 打开url
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './goods-search-start.css';
|
||||
</style>
|
||||
156
pages/goods-search/goods-search.css
Normal file
156
pages/goods-search/goods-search.css
Normal file
@@ -0,0 +1,156 @@
|
||||
/**
|
||||
* 顶部搜索
|
||||
*/
|
||||
.top-search-input {
|
||||
padding-right: 80rpx;
|
||||
}
|
||||
.top-search-right {
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
.top-search-submit {
|
||||
line-height: 66rpx;
|
||||
height: 66rpx;
|
||||
}
|
||||
.top-search-right .badge-icon {
|
||||
top: -4px;
|
||||
right: 10rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 排序导航
|
||||
*/
|
||||
.nav-sort-content .item {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
width: calc(20% - 33.33rpx);
|
||||
}
|
||||
.nav-sort-content .item .icon {
|
||||
width: 26rpx;
|
||||
height: 26rpx !important;
|
||||
}
|
||||
.screening-submit,
|
||||
.show-type-submit {
|
||||
width: 46rpx;
|
||||
height: 46rpx !important;
|
||||
top: 20rpx;
|
||||
}
|
||||
.screening-submit {
|
||||
right: 82rpx;
|
||||
}
|
||||
.show-type-submit {
|
||||
right: 16rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
.scroll-box {
|
||||
height: calc(100vh - 176rpx);
|
||||
}
|
||||
.data-list .item {
|
||||
width: calc(50% - 10rpx);
|
||||
}
|
||||
.data-list .item:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
.data-list .item:nth-child(2n+1) {
|
||||
float: left;
|
||||
}
|
||||
.data-list .item .goods-img {
|
||||
width: 100%;
|
||||
height: 380rpx !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件
|
||||
*/
|
||||
.search-map {
|
||||
height: calc(100vh - 160rpx);
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.search-map,
|
||||
.search-map .search-submit {
|
||||
width: 660rpx;
|
||||
}
|
||||
.map-keywords {
|
||||
padding: 0 20rpx;
|
||||
line-height: 66rpx;
|
||||
height: 66rpx;
|
||||
font-size: 26rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.map-nav text:first-child {
|
||||
font-weight: bold;
|
||||
}
|
||||
.map-nav .arrow-bottom {
|
||||
top: 0;
|
||||
right: 10rpx;
|
||||
padding-right: 46rpx;
|
||||
}
|
||||
.map-item {
|
||||
line-height: 66rpx;
|
||||
}
|
||||
.map-content {
|
||||
line-height: 60rpx;
|
||||
}
|
||||
.map-content .item {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.map-text-item .item,
|
||||
.map-images-text-item .item {
|
||||
padding: 0 15rpx;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
.map-images-text-item .item {
|
||||
vertical-align: middle;
|
||||
border: 1px solid #eee;
|
||||
width: 150rpx;
|
||||
height: 72rpx;
|
||||
line-height: 72rpx;
|
||||
}
|
||||
.map-images-text-item .item image {
|
||||
width: 150rpx;
|
||||
height: calc(100% - 8rpx);
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
.search-map .search-submit {
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.search-map .search-submit button {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 品牌基础信息
|
||||
*/
|
||||
.brand-info {
|
||||
height: 160rpx;
|
||||
}
|
||||
.brand-info image,
|
||||
.brand-info .info-logo-empty {
|
||||
width: 300rpx;
|
||||
height: 130rpx;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.brand-info .info-logo-empty {
|
||||
line-height: 130rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.brand-info .info-right {
|
||||
width: calc(100% - 330rpx);
|
||||
}
|
||||
.brand-info .info-name {
|
||||
line-height: 56rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.brand-info .info-desc {
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
min-height: 80rpx;
|
||||
}
|
||||
816
pages/goods-search/goods-search.vue
Normal file
816
pages/goods-search/goods-search.vue
Normal file
@@ -0,0 +1,816 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="bg-white">
|
||||
<!-- 搜索关键字 -->
|
||||
<view class="padding-horizontal-main padding-top-main padding-bottom-sm pr">
|
||||
<view class="top-search-input">
|
||||
<component-search :propDefaultValue="post_data.wd || ''" propBrColor="#ddd" @onsearch="search_input_confirm_event" :propIsOnEvent="true" @oninput="search_input_value_event" :propIsOnInputEvent="true"
|
||||
@onfocus="search_input_focus_event" :propIsOnFocusEvent="true" @onblur="search_input_blur_event" :propIsOnBlurEvent="true" :propIsRequired="false"
|
||||
:propPlaceholder="$t('customview.customview.726k7y')"></component-search>
|
||||
</view>
|
||||
<view class="pa top-search-right">
|
||||
<view v-if="top_search_right_type_status" class="pr cp" @tap="search_submit_confirm_event">
|
||||
<uni-icons type="search" size="60rpx" color="#bbb"></uni-icons>
|
||||
</view>
|
||||
<view v-if="!top_search_right_type_status" class="pr cp" data-value="/pages/cart-page/cart-page" @tap="url_event">
|
||||
<uni-icons type="cart" size="60rpx" color="#bbb"></uni-icons>
|
||||
<view v-if="top_right_cart_total != 0" class="badge-icon pa">
|
||||
<component-badge :propNumber="top_right_cart_total"></component-badge>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 排序 -->
|
||||
<view class="nav-sort oh pr">
|
||||
<view class="nav-sort-content">
|
||||
<block v-for="(item, index) in search_nav_sort_list" :key="index">
|
||||
<view class="item tc fl cp" :data-index="index" @tap="nav_sort_event">
|
||||
<text class="cr-base va-m text-size-sm">{{item.name}}</text>
|
||||
<image v-if="(item.icon || null) != null" class="icon va-m" :src="common_static_url + 'sort-' + item.icon + '-icon.png'" mode="aspectFill"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<image class="screening-submit pa cp" :src="common_static_url+'search-submit-icon.png'" mode="aspectFill" @tap="popup_form_event_show"></image>
|
||||
<image class="show-type-submit pa cp" :src="common_static_url+'show-'+(data_show_type_value == 0 ? 'list' : 'grid')+'-icon.png'" mode="aspectFill" @tap="data_show_type_event"></image>
|
||||
</view>
|
||||
</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 oh">
|
||||
<component-goods-list :propData="{style_type: (data_show_type_value) == 0 ? 1 : 0, goods_list: data_list, random: random_value}" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol"
|
||||
:propIsCartParaCurve="true"></component-goods-list>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 筛选条件 popup -->
|
||||
<component-popup :propShow="is_show_popup_form" propPosition="left" @onclose="popup_form_event_close">
|
||||
<form @submit="form_submit_event" class="popup-form oh">
|
||||
<view class="search-map padding-main bg-base">
|
||||
<view class="padding-main border-radius-main bg-white">
|
||||
<view class="map-item map-base br-b">
|
||||
<text>{{$t('goods-search.goods-search.j8o278')}}</text>
|
||||
<text class="cr-main"> {{data_total}} </text>
|
||||
<text>{{$t('goods-search.goods-search.t9nikq')}}</text>
|
||||
<text class="fr cr-red cp" @tap="map_remove_event">{{$t('goods-search.goods-search.pxk051')}}</text>
|
||||
</view>
|
||||
<!-- 搜索关键字 -->
|
||||
<input type="text" confirm-type="search" :placeholder="$t('customview.customview.726k7y')" name="wd" :value="(post_data.wd || '')" class="map-keywords wh-auto round bg-base margin-top-lg"
|
||||
placeholder-class="cr-grey">
|
||||
</view>
|
||||
|
||||
<!-- 品牌 -->
|
||||
<view v-if="((search_map_list.brand_list || null) != null && search_map_list.brand_list.length > 0) || ((search_map_info.brand || null) != null)"
|
||||
class="map-item padding-horizontal-main padding-top-main border-radius-main bg-white spacing-mt">
|
||||
<view class="map-nav br-b pr">
|
||||
<text>{{$t('goods-search.goods-search.6n8316')}}</text>
|
||||
<text class="arrow-bottom pa cr-grey cp" v-if="search_map_list.brand_list.length > 3" @tap="more_event" data-value="brand_list">{{$t('common.more')}}</text>
|
||||
</view>
|
||||
<view v-if="(search_map_info.brand || null) != null && (params.brand || null) != null" class="map-content brand-info oh margin-top-lg">
|
||||
<image v-if="(search_map_info.brand.logo || null) != null" :src="search_map_info.brand.logo" mode="aspectFit" class="fl"></image>
|
||||
<view v-else class="info-logo-empty tc fl">{{search_map_info.brand.name}}</view>
|
||||
<view class="info-right fr">
|
||||
<view v-if="(search_map_info.brand.logo || null) != null" class="info-name">{{search_map_info.brand.name}}</view>
|
||||
<view v-if="(search_map_info.brand.describe || null) != null" class="info-desc multi-text cr-grey">{{search_map_info.brand.describe}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="map-content map-images-text-item map-brand-container oh margin-top-lg" :style="'height:' + map_fields_list.brand_list.height + ';'">
|
||||
<block v-for="(item, index) in search_map_list.brand_list" :key="index">
|
||||
<view :class="'item fl cr-base radius cp single-text tc '+ (index > 0 ? 'margin-left-sm ' : '') + (item.active == 1 ? 'cr-main br-main' : '')" @tap="map_item_event" :data-index="index"
|
||||
data-field="brand_list">
|
||||
<image v-if="(item.logo || null) != null" :src="item.logo" mode="aspectFit"></image>
|
||||
<text v-else>{{item.name}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 分类 -->
|
||||
<view v-if="(search_map_list.category_list || null) != null && search_map_list.category_list.length > 0"
|
||||
class="map-item padding-horizontal-main padding-top-main border-radius-main bg-white spacing-mt">
|
||||
<view class="map-nav pr br-b">
|
||||
<text>{{$t('common.category')}}</text>
|
||||
<text class="arrow-bottom pa cr-grey cp" v-if="search_map_list.category_list.length > 3" @tap="more_event" data-value="category_list">{{$t('common.more')}}</text>
|
||||
</view>
|
||||
<view class="map-content map-text-item map-category-container oh margin-top-lg" :style="'height:' + map_fields_list.category_list.height + ';'">
|
||||
<block v-for="(item, index) in search_map_list.category_list" :key="index">
|
||||
<view :class="'item fl cr-base radius cp margin-right-sm ' + (item.active == 1 ? 'cr-main br-main' : '')" @tap="map_item_event" :data-index="index" data-field="category_list">
|
||||
{{item.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 价格 -->
|
||||
<view v-if="(search_map_list.screening_price_list || null) != null && search_map_list.screening_price_list.length > 0"
|
||||
class="map-item padding-horizontal-main padding-top-main border-radius-main bg-white spacing-mt">
|
||||
<view class="map-nav br-b pr">
|
||||
<text>{{$t('goods-category.goods-category.g2u3lf')}}</text>
|
||||
<text class="arrow-bottom pa cr-grey cp" v-if="search_map_list.screening_price_list.length > 3" @tap="more_event" data-value="screening_price_list">{{$t('common.more')}}</text>
|
||||
</view>
|
||||
<view class="map-content map-text-item screening-price-container oh margin-top-lg" :style="'height:' + map_fields_list.screening_price_list.height + ';'">
|
||||
<block v-for="(item, index) in search_map_list.screening_price_list" :key="index">
|
||||
<view :class="'item fl cr-base radius cp margin-right-sm ' + (item.active == 1 ? 'cr-main br-main' : '')" @tap="map_item_event" :data-index="index" data-field="screening_price_list">
|
||||
{{item.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品产地 -->
|
||||
<view v-if="(search_map_list.goods_place_origin_list || null) != null && search_map_list.goods_place_origin_list.length > 0"
|
||||
class="map-item padding-horizontal-main padding-top-main border-radius-main bg-white spacing-mt">
|
||||
<view class="map-nav br-b pr">
|
||||
<text>{{$t('goods-search.goods-search.4eerty')}}</text>
|
||||
<text class="arrow-bottom pa cr-grey cp" v-if="search_map_list.goods_place_origin_list.length > 3" @tap="more_event" data-value="goods_place_origin_list">{{$t('common.more')}}</text>
|
||||
</view>
|
||||
<view class="map-content map-text-item screening-price-container oh margin-top-lg" :style="'height:' + map_fields_list.goods_place_origin_list.height + ';'">
|
||||
<block v-for="(item, index) in search_map_list.goods_place_origin_list" :key="index">
|
||||
<view :class="'item fl cr-base radius cp margin-right-sm ' + (item.active == 1 ? 'cr-main br-main' : '')" @tap="map_item_event" :data-index="index" data-field="goods_place_origin_list">
|
||||
{{item.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 属性 -->
|
||||
<view v-if="(search_map_list.goods_params_list || null) != null && search_map_list.goods_params_list.length > 0"
|
||||
class="map-item padding-horizontal-main padding-top-main border-radius-main bg-white spacing-mt">
|
||||
<view class="map-nav br-b pr">
|
||||
<text>{{$t('goods-search.goods-search.v6e5b7')}}</text>
|
||||
<text class="arrow-bottom pa cr-grey cp" v-if="search_map_list.goods_params_list.length > 3" @tap="more_event" data-value="goods_params_list">{{$t('common.more')}}</text>
|
||||
</view>
|
||||
<view class="map-content map-text-item goods-params-container oh margin-top-lg" :style="'height:' + map_fields_list.goods_params_list.height + ';'">
|
||||
<block v-for="(item, index) in search_map_list.goods_params_list" :key="index">
|
||||
<view :class="'item fl cr-base radius cp margin-right-sm ' + (item.active == 1 ? 'cr-main br-main' : '')" @tap="map_item_event" :data-index="index" data-field="goods_params_list">
|
||||
{{item.value}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 规格 -->
|
||||
<view v-if="(search_map_list.goods_spec_list || null) != null && search_map_list.goods_spec_list.length > 0"
|
||||
class="map-item padding-horizontal-main padding-top-main border-radius-main bg-white spacing-mt">
|
||||
<view class="map-nav br-b pr">
|
||||
<text>{{$t('goods-detail.goods-detail.u401fi')}}</text>
|
||||
<text class="arrow-bottom pa cr-grey cp" v-if="search_map_list.goods_spec_list.length > 3" @tap="more_event" data-value="goods_spec_list">{{$t('common.more')}}</text>
|
||||
</view>
|
||||
<view class="map-content map-text-item goods-spec-container oh margin-top-lg" :style="'height:' + map_fields_list.goods_spec_list.height + ';'">
|
||||
<block v-for="(item, index) in search_map_list.goods_spec_list" :key="index">
|
||||
<view :class="'item fl cr-base radius cp margin-right-sm ' + (item.active == 1 ? 'cr-main br-main' : '')" @tap="map_item_event" :data-index="index" data-field="goods_spec_list">
|
||||
{{item.value}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="search-submit padding-main pa">
|
||||
<button form-type="submit" class="bg-main cr-white text-size wh-auto round" :disabled="popup_form_loading_status" hover-class="none">{{$t('common.confirm')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
</component-popup>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentQuickNav from "@/components/quick-nav/quick-nav";
|
||||
import componentPopup from "@/components/popup/popup";
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
import componentGoodsList from "@/components/goods-list/goods-list";
|
||||
import componentSearch from "@/components/search/search";
|
||||
import componentBadge from "@/components/badge/badge";
|
||||
|
||||
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,
|
||||
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,
|
||||
post_data: {},
|
||||
is_show_popup_form: false,
|
||||
popup_form_loading_status: false,
|
||||
top_search_right_type_status: false,
|
||||
load_status: 0,
|
||||
// 增加随机数,避免无法监听数据列表内部数据更新
|
||||
random_value: 0,
|
||||
// 购物车
|
||||
top_right_cart_total: 0,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
// 排序导航
|
||||
search_nav_sort_index: 0,
|
||||
search_nav_sort_list: [{
|
||||
name: this.$t('goods-category.goods-category.x69aow'),
|
||||
field: 'default',
|
||||
sort: 'asc',
|
||||
icon: null
|
||||
},
|
||||
{
|
||||
name: this.$t('goods-category.goods-category.at5p35'),
|
||||
field: 'sales_count',
|
||||
sort: 'asc',
|
||||
icon: 'default'
|
||||
},
|
||||
{
|
||||
name: this.$t('goods-category.goods-category.283ot0'),
|
||||
field: 'access_count',
|
||||
sort: 'asc',
|
||||
icon: 'default'
|
||||
},
|
||||
{
|
||||
name: this.$t('goods-category.goods-category.g2u3lf'),
|
||||
field: 'min_price',
|
||||
sort: 'asc',
|
||||
icon: 'default'
|
||||
},
|
||||
{
|
||||
name: this.$t('goods-category.goods-category.5p4ksj'),
|
||||
field: 'id',
|
||||
sort: 'asc',
|
||||
icon: 'default'
|
||||
}
|
||||
],
|
||||
// 数据展示样式(0九方格、1图文)
|
||||
data_show_type_value: 0,
|
||||
// 基础配置
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
// 搜素条件
|
||||
search_map_list: {
|
||||
brand_list: [],
|
||||
category_list: [],
|
||||
screening_price_list: [],
|
||||
goods_place_origin_list: [],
|
||||
goods_params_list: [],
|
||||
goods_spec_list: []
|
||||
},
|
||||
search_map_info: [],
|
||||
map_fields_list: {
|
||||
brand_list: {
|
||||
height: "96rpx",
|
||||
default: "96rpx",
|
||||
form_key: "brand_ids"
|
||||
},
|
||||
category_list: {
|
||||
height: "82rpx",
|
||||
default: "82rpx",
|
||||
form_key: "category_ids"
|
||||
},
|
||||
screening_price_list: {
|
||||
height: "82rpx",
|
||||
default: "82rpx",
|
||||
form_key: "screening_price_values"
|
||||
},
|
||||
goods_place_origin_list: {
|
||||
height: "82rpx",
|
||||
default: "82rpx",
|
||||
form_key: "place_origin_ids"
|
||||
},
|
||||
goods_params_list: {
|
||||
height: "82rpx",
|
||||
default: "82rpx",
|
||||
form_key: "goods_params_values"
|
||||
},
|
||||
goods_spec_list: {
|
||||
height: "82rpx",
|
||||
default: "82rpx",
|
||||
form_key: "goods_spec_values"
|
||||
}
|
||||
},
|
||||
// 标签插件
|
||||
plugins_label_data: null
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentQuickNav,
|
||||
componentPopup,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentGoodsList,
|
||||
componentSearch,
|
||||
componentBadge
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 参数处理
|
||||
params = app.globalData.launch_params_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
post_data: {
|
||||
wd: params.keywords || ''
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 公共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({
|
||||
currency_symbol: app.globalData.get_config('currency_symbol'),
|
||||
data_show_type_value: parseInt(app.globalData.get_config('config.home_search_goods_show_type', 0))
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
var post_data = this.request_map_handle();
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "search"),
|
||||
method: 'POST',
|
||||
data: post_data,
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var temp_load_status = this.load_status;
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
search_map_info: data.search_map_info || [],
|
||||
search_map_list: {
|
||||
brand_list: data.brand_list || [],
|
||||
category_list: data.category_list || [],
|
||||
screening_price_list: data.screening_price_list || [],
|
||||
goods_place_origin_list: data.goods_place_origin_list || [],
|
||||
goods_params_list: data.goods_params_list || [],
|
||||
goods_spec_list: data.goods_spec_list || []
|
||||
},
|
||||
load_status: 1,
|
||||
top_right_cart_total: data.cart_total.buy_number || 0,
|
||||
plugins_label_data: (data.plugins_label_data || null) == null || (data.plugins_label_data.base || null) == null || (data.plugins_label_data.data ||
|
||||
null) == null || data.plugins_label_data.data.length <= 0 ? null : data.plugins_label_data
|
||||
});
|
||||
|
||||
// 获取数据列表
|
||||
if (temp_load_status == 0) {
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
// 如果购物车为0则处理列表,避免存在购物车数量
|
||||
if (this.top_right_cart_total == 0 && this.data_list.length > 0) {
|
||||
var temp_data_list = this.data_list;
|
||||
for (var i in temp_data_list) {
|
||||
temp_data_list[i]['user_cart_count'] = '';
|
||||
}
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
random_value: Math.random()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 导航购物车处理
|
||||
this.set_tab_bar_badge_handle();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg
|
||||
});
|
||||
app.globalData.is_login_check(res.data, this, 'get_data');
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: 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
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
var post_data = this.request_map_handle();
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("datalist", "search"),
|
||||
method: 'POST',
|
||||
data: post_data,
|
||||
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,
|
||||
random_value: Math.random(),
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_list_loding_msg: '',
|
||||
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_loding_msg: res.data.msg,
|
||||
data_total: 0,
|
||||
data_is_loading: 0
|
||||
});
|
||||
if (this.data_page <= 1) {
|
||||
this.setData({
|
||||
data_list: [],
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
data_is_loading: 0
|
||||
});
|
||||
app.globalData.is_login_check(res.data, this, 'get_data_list', is_mandatory);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
data_is_loading: 0
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 搜索条件处理
|
||||
request_map_handle() {
|
||||
var params = this.params;
|
||||
var post_data = this.post_data;
|
||||
post_data['page'] = this.data_page;
|
||||
|
||||
// 指定分类、品牌
|
||||
post_data['category_id'] = params['category_id'] || 0;
|
||||
post_data['brand'] = params['brand'] || 0;
|
||||
|
||||
// 搜索条件
|
||||
var temp_field = this.map_fields_list;
|
||||
var temp_list = this.search_map_list;
|
||||
for (var i in temp_field) {
|
||||
if (temp_list[i] != null != null && temp_list[i].length > 0) {
|
||||
var temp = {};
|
||||
var index = 0;
|
||||
for (var k in temp_list[i]) {
|
||||
if ((temp_list[i][k]['active'] || 0) == 1) {
|
||||
switch (i) {
|
||||
// 价格
|
||||
case 'screening_price_list':
|
||||
temp[index] = temp_list[i][k]['min_price'] + '-' + temp_list[i][k]['max_price'];
|
||||
break;
|
||||
// 属性、规格
|
||||
case 'goods_params_list':
|
||||
case 'goods_spec_list':
|
||||
temp[index] = temp_list[i][k]['value'];
|
||||
break;
|
||||
// 默认取值id
|
||||
default:
|
||||
temp[index] = temp_list[i][k]['id'];
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
post_data[temp_field[i]['form_key']] = app.globalData.get_length(temp) > 0 ? JSON.stringify(temp) : '';
|
||||
}
|
||||
}
|
||||
|
||||
// 排序
|
||||
var temp_index = this.search_nav_sort_index;
|
||||
var temp_search_nav_sort = this.search_nav_sort_list;
|
||||
post_data['order_by_type'] = temp_search_nav_sort[temp_index]['sort'] == 'desc' ? 'asc' : 'desc';
|
||||
post_data['order_by_field'] = temp_search_nav_sort[temp_index]['field'];
|
||||
|
||||
return post_data;
|
||||
},
|
||||
|
||||
// 分享设置处理
|
||||
share_info_handle() {
|
||||
var category_id = this.params.category_id || 0;
|
||||
var brand = this.params.brand || 0;
|
||||
var keywords = this.post_data.wd || '';
|
||||
this.setData({
|
||||
share_info: {
|
||||
path: '/pages/goods-search/goods-search',
|
||||
query: 'category_id=' + category_id + '&brand=' + brand + '&keywords=' + keywords
|
||||
}
|
||||
});
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 搜索条件
|
||||
form_submit_event(e) {
|
||||
this.setData({
|
||||
post_data: e.detail.value,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
this.popup_form_event_close();
|
||||
},
|
||||
|
||||
// 筛选条件关闭
|
||||
popup_form_event_close(e) {
|
||||
this.setData({
|
||||
is_show_popup_form: false
|
||||
});
|
||||
},
|
||||
|
||||
// 筛选条件开启
|
||||
popup_form_event_show(e) {
|
||||
this.setData({
|
||||
is_show_popup_form: true
|
||||
});
|
||||
},
|
||||
|
||||
// 排序事件
|
||||
nav_sort_event(e) {
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var temp_search_nav_sort = this.search_nav_sort_list;
|
||||
var temp_sort = temp_search_nav_sort[index]['sort'] == 'desc' ? 'asc' : 'desc';
|
||||
for (var i in temp_search_nav_sort) {
|
||||
if (i != index) {
|
||||
if (temp_search_nav_sort[i]['icon'] != null) {
|
||||
temp_search_nav_sort[i]['icon'] = 'default';
|
||||
}
|
||||
temp_search_nav_sort[i]['sort'] = 'desc';
|
||||
}
|
||||
}
|
||||
temp_search_nav_sort[index]['sort'] = temp_sort;
|
||||
if (temp_search_nav_sort[index]['icon'] != null) {
|
||||
temp_search_nav_sort[index]['icon'] = temp_sort;
|
||||
}
|
||||
|
||||
this.setData({
|
||||
search_nav_sort_index: index,
|
||||
search_nav_sort_list: temp_search_nav_sort,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 条件-更多数据展示事件
|
||||
more_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
var temp_more = this.map_fields_list;
|
||||
if (value != null && (temp_more[value] || null) != null) {
|
||||
temp_more[value]['height'] = temp_more[value]['height'] == 'auto' ? temp_more[value]['default'] : 'auto';
|
||||
this.setData({
|
||||
map_fields_list: temp_more
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 条件-选择事件
|
||||
map_item_event(e) {
|
||||
var index = e.currentTarget.dataset.index;
|
||||
var field = e.currentTarget.dataset.field;
|
||||
var temp_list = this.search_map_list;
|
||||
if ((temp_list[field] || null) != null && (temp_list[field][index] || null) != null) {
|
||||
temp_list[field][index]['active'] = (temp_list[field][index]['active'] || 0) == 0 ? 1 : 0;
|
||||
this.setData({
|
||||
search_map_list: temp_list
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 条件-清空
|
||||
map_remove_event(e) {
|
||||
var temp_list = this.search_map_list;
|
||||
var temp_post = this.post_data;
|
||||
|
||||
// 关键字
|
||||
temp_post['wd'] = '';
|
||||
|
||||
// 品牌、分类、价格、属性、规格
|
||||
for (var i in temp_list) {
|
||||
if ((temp_list[i] || null) != null && temp_list[i].length > 0) {
|
||||
for (var k in temp_list[i]) {
|
||||
temp_list[i][k]['active'] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 排序导航
|
||||
var temp_search_nav_sort = this.search_nav_sort_list;
|
||||
for (var i in temp_search_nav_sort) {
|
||||
temp_search_nav_sort[i]['sort'] = 'asc';
|
||||
temp_search_nav_sort[i]['icon'] = (temp_search_nav_sort[i]['field'] == 'default') ? null : 'default';
|
||||
}
|
||||
|
||||
// 关闭弹窗、分页恢复1页、重新获取数据
|
||||
this.setData({
|
||||
search_map_list: temp_list,
|
||||
post_data: temp_post,
|
||||
is_show_popup_form: false,
|
||||
search_nav_sort_list: temp_search_nav_sort,
|
||||
search_nav_sort_index: 0,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 数据展示类型
|
||||
data_show_type_event(e) {
|
||||
this.setData({
|
||||
data_show_type_value: this.data_show_type_value == 0 ? 1 : 0
|
||||
});
|
||||
},
|
||||
|
||||
// 购物车导航角标
|
||||
set_tab_bar_badge_handle() {
|
||||
app.globalData.set_tab_bar_badge('cart', this.top_right_cart_total);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 搜索输入事件
|
||||
search_input_value_event(value) {
|
||||
var temp_post = this.post_data;
|
||||
temp_post['wd'] = value;
|
||||
this.setData({
|
||||
post_data: temp_post
|
||||
});
|
||||
},
|
||||
|
||||
// 搜索输入框输入失去焦点事件
|
||||
search_input_blur_event(value) {
|
||||
if (value == '') {
|
||||
this.setData({
|
||||
top_search_right_type_status: false
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 搜索输入框输入获取焦点事件
|
||||
search_input_focus_event() {
|
||||
this.setData({
|
||||
top_search_right_type_status: true
|
||||
});
|
||||
},
|
||||
|
||||
// 搜索输入确认事件
|
||||
search_input_confirm_event(value) {
|
||||
var temp_post = this.post_data;
|
||||
temp_post['wd'] = value;
|
||||
this.setData({
|
||||
top_search_right_type_status: false,
|
||||
post_data: temp_post,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 搜索确认事件
|
||||
search_submit_confirm_event() {
|
||||
this.setData({
|
||||
top_search_right_type_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 购物车总数处理
|
||||
goods_cart_count_handle(cart_number) {
|
||||
this.setData({
|
||||
top_right_cart_total: cart_number
|
||||
});
|
||||
// 导航购物车处理
|
||||
this.set_tab_bar_badge_handle();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './goods-search.css';
|
||||
</style>
|
||||
168
pages/index/index.css
Normal file
168
pages/index/index.css
Normal file
@@ -0,0 +1,168 @@
|
||||
/**
|
||||
* 顶部内容
|
||||
*/
|
||||
.home-top-nav-content {
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% auto;
|
||||
padding-top: calc(var(--status-bar-height) + 5px);
|
||||
}
|
||||
.home-top-nav {
|
||||
min-height: 56rpx;
|
||||
/* #ifdef MP-ALIPAY */
|
||||
padding-left: 60rpx;
|
||||
/* #endif */
|
||||
}
|
||||
.home-top-nav-location {
|
||||
max-width: calc(100% - 200rpx);
|
||||
}
|
||||
.home-top-nav-logo {
|
||||
text-align: left;
|
||||
height: 56rpx;
|
||||
}
|
||||
.home-top-nav-logo-image {
|
||||
width: 56rpx;
|
||||
height: 100% !important;
|
||||
}
|
||||
.home-top-nav-logo-title {
|
||||
font-weight: bold;
|
||||
font-size: 42rpx;
|
||||
/* #ifdef H5 || MP-TOUTIAO || APP */
|
||||
font-size: 24px;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
/**
|
||||
* 右侧图标导航
|
||||
*/
|
||||
/* #ifdef H5 || APP */
|
||||
.nav-top-right-icon {
|
||||
line-height: 56rpx;
|
||||
}
|
||||
.nav-top-right-icon .item:not(:last-child) {
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
.nav-top-right-icon .badge-icon {
|
||||
top: -10px;
|
||||
right: 2px;
|
||||
}
|
||||
/* #endif */
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
.search-fixed-seat {
|
||||
padding-top: 78rpx;
|
||||
}
|
||||
.search-fixed-seat.nav-enable-search {
|
||||
padding-top: 146rpx;
|
||||
}
|
||||
.search-content-fixed {
|
||||
position: fixed !important;
|
||||
top: 0;
|
||||
z-index: 11;
|
||||
width: 100%;
|
||||
}
|
||||
.search-content-fixed-content {
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% auto;
|
||||
background-position: top;
|
||||
padding-bottom: 6rpx;
|
||||
/* #ifdef H5 */
|
||||
padding-top: 15rpx !important;
|
||||
/* #endif */
|
||||
}
|
||||
.search-content-fixed-content.nav-enable-search {
|
||||
padding-bottom: 24rpx;
|
||||
}
|
||||
|
||||
/* #ifdef H5 || MP-TOUTIAO */
|
||||
.search-content-fixed .nav-top-right-icon {
|
||||
top: 8px !important;
|
||||
}
|
||||
/* #endif */
|
||||
|
||||
/**
|
||||
* 推荐文章
|
||||
*/
|
||||
.article-list .new-icon {
|
||||
width: 130rpx !important;
|
||||
height: 42rpx !important;
|
||||
}
|
||||
.article-list .right-content {
|
||||
width: calc(100% - 150rpx);
|
||||
}
|
||||
.article-list .right-content swiper {
|
||||
height: 40rpx;
|
||||
}
|
||||
.notice {
|
||||
margin: 20rpx 0 14rpx 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* 限时秒杀 - 插件
|
||||
*/
|
||||
|
||||
.plugins-seckill-data {
|
||||
background-size: 100% auto;
|
||||
background-repeat: no-repeat;
|
||||
background-position: top;
|
||||
background-color: #fff;
|
||||
|
||||
}
|
||||
.plugins-seckill-data .icon {
|
||||
max-width: 140rpx;
|
||||
max-height: 34rpx;
|
||||
}
|
||||
.plugins-seckill-data .goods-list .swiper {
|
||||
height: 310rpx !important;
|
||||
}
|
||||
.plugins-seckill-data .goods-list .item .goods-img {
|
||||
width: 100%;
|
||||
height: 210rpx;
|
||||
}
|
||||
.plugins-seckill-data .goods-list .goods-base .icon {
|
||||
right: 20rpx;
|
||||
bottom: 13rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 购买记录 - 插件
|
||||
*/
|
||||
.plugins-salerecords swiper {
|
||||
height: 506rpx;
|
||||
}
|
||||
.plugins-salerecords image {
|
||||
width: 40rpx !important;
|
||||
height: 40rpx !important;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.plugins-salerecords .item-content {
|
||||
width: 24%;
|
||||
}
|
||||
.plugins-salerecords .item-content:nth-child(1) {
|
||||
width: 36%;
|
||||
}
|
||||
.plugins-salerecords .item-content:nth-child(2) {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签 - 秒杀单独修改样式
|
||||
*/
|
||||
.plugins-seckill-data .plugins-label-bottom-left,
|
||||
.plugins-seckill-data .plugins-label-bottom-center,
|
||||
.plugins-seckill-data .plugins-label-bottom-right {
|
||||
bottom: calc(100% - 240rpx);
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页中间广告- 插件
|
||||
*/
|
||||
.plugins-homemiddleadv {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.plugins-homemiddleadv .item {
|
||||
flex: 1 1 calc(50% - 20rpx);
|
||||
}
|
||||
665
pages/index/index.vue
Normal file
665
pages/index/index.vue
Normal file
@@ -0,0 +1,665 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view :class="(plugins_mourning_data_is_app ? ' grayscale' : '') + (is_single_page == 1 ? ' single-page-top' : '')">
|
||||
<!-- diy模式 -->
|
||||
<block v-if="data_mode == 3">
|
||||
<block v-if="(data_list || null) != null && (data_list.config || null) != null">
|
||||
<componentDiy :propValue="data_list.config" :propDataId="data_list.id" :propKey="random_value" @onLocationBack="user_back_choice_location">
|
||||
<!-- 底部内容 -->
|
||||
<template slot="diy-bottom-content">
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
<!-- 版权信息 -->
|
||||
<component-copyright></component-copyright>
|
||||
</template>
|
||||
<!-- 底部公共 -->
|
||||
<template slot="diy-bottom-common">
|
||||
<component-common ref="common" :propIsGrayscale="plugins_mourning_data_is_app"></component-common>
|
||||
</template>
|
||||
</componentDiy>
|
||||
</block>
|
||||
<block v-else>
|
||||
<component-no-data propStatus="0" propPage="home"></component-no-data>
|
||||
</block>
|
||||
</block>
|
||||
<!-- 自动和手动模式 -->
|
||||
<block v-else>
|
||||
<!-- 顶部内容、如果没有轮播和导航则使用矮的浮动导航背景样式,则使用高的背景样式 -->
|
||||
<view v-if="load_status == 1" class="home-top-nav-content pr" :style="(banner_list.length > 0 || navigation.length > 0 ? top_content_bg_color : top_content_search_bg_color) + top_content_style">
|
||||
<!-- 顶部背景图片 -->
|
||||
<view class="pa top-0 left-0 right-0">
|
||||
<image class="bg-img wh-auto" mode="widthFix" :src="static_url + 'nav-top.png'"></image>
|
||||
</view>
|
||||
|
||||
<!-- 搜索 -->
|
||||
<view v-if="common_app_is_header_nav_fixed == 1" :class="'search-fixed-seat ' + (common_app_is_enable_search == 1 ? 'nav-enable-search' : '')"></view>
|
||||
<view :class="'pr ' + (common_app_is_header_nav_fixed == 1 ? 'search-content-fixed' : '')" :style="common_app_is_header_nav_fixed == 1 ? top_content_search_bg_color : ''">
|
||||
<view :class="'search-content-fixed-content ' + (common_app_is_enable_search == 1 ? 'nav-enable-search' : '')" :style="(common_app_is_header_nav_fixed == 1 ? top_content_style : '') + (common_app_is_header_nav_fixed == 1 ? top_content_search_content_style : '')">
|
||||
<view class="home-top-nav margin-bottom-sm pr padding-right-main">
|
||||
<!-- 定位 -->
|
||||
<view v-if="is_home_location_choice == 1" class="home-top-nav-location dis-inline-block va-m single-text cr-white pr bs-bb padding-left-main padding-right-lg">
|
||||
<component-choice-location @onBack="user_back_choice_location"></component-choice-location>
|
||||
</view>
|
||||
<block v-else>
|
||||
<!-- logo/标题 -->
|
||||
<view class="home-top-nav-logo dis-inline-block va-m padding-left-main">
|
||||
<block v-if="is_home_logo_use_text == 0 && (application_logo || null) != null">
|
||||
<image :src="application_logo" mode="heightFix" class="home-top-nav-logo-image"></image>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view v-if="(application_title || null) != null" class="home-top-nav-logo-title cr-white single-text">{{ application_title }}</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<!-- #ifdef H5 || APP -->
|
||||
<!-- 右上角icon列表 -->
|
||||
<view v-if="(right_icon_list || null) != null && right_icon_list.length > 0" class="nav-top-right-icon fr">
|
||||
<block v-for="(item, index) in right_icon_list">
|
||||
<view class="item dis-inline-block cp pr" :data-value="item.url || ''" @tap="url_event">
|
||||
<iconfont :name="item.icon" size="38rpx" color="#fff"></iconfont>
|
||||
<view v-if="(item.badge || null) != null" class="badge-icon pa">
|
||||
<component-badge :propNumber="item.badge"></component-badge>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view v-if="common_app_is_enable_search == 1" class="search-content-input padding-horizontal-main">
|
||||
<!-- 是否开启搜索框前面icon扫一扫 -->
|
||||
<block v-if="is_home_search_scan == 1">
|
||||
<component-search :propIsBtn="true" propSize="sm" :propPlaceholder="$t('customview.customview.726k7y')" propPlaceholderClass="cr-grey-c" propIconColor="#999" propBgColor="#fff"
|
||||
<!-- #ifndef H5 -->
|
||||
@onicon="search_icon_event" propIcon="icon-scan" :propIsIconOnEvent="true"
|
||||
<!-- #endif -->
|
||||
></component-search>
|
||||
</block>
|
||||
<block v-else>
|
||||
<component-search :propIsBtn="true" propSize="sm" :propPlaceholder="$t('customview.customview.726k7y')" propPlaceholderClass="cr-grey-c" propIconColor="#999" propBgColor="#fff"></component-search>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 轮播 -->
|
||||
<view class="banner-content padding-horizontal-main margin-top-xs" v-if="banner_list.length > 0">
|
||||
<component-banner :propData="banner_list" @changeBanner="change_banner"></component-banner>
|
||||
</view>
|
||||
<!-- 导航 -->
|
||||
<view v-if="navigation.length > 0" class="spacing-mt" :class="load_status == 1 && (common_shop_notice || null) != null ? '' : ' spacing-mb'">
|
||||
<view class="padding-horizontal-main">
|
||||
<view class="bg-white border-radius-main">
|
||||
<component-icon-nav :propData="{ ...{ data: navigation }, ...{ random: random_value } }"></component-icon-nav>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 内容 -->
|
||||
<view class="content padding-horizontal-main pr">
|
||||
<!-- 商城公告 -->
|
||||
<view v-if="load_status == 1 && (common_shop_notice || null) != null" class="notice">
|
||||
<uni-notice-bar show-icon scrollable :text="common_shop_notice" background-color="transparent" color="#666" />
|
||||
</view>
|
||||
<!-- 推荐文章 -->
|
||||
<view v-if="article_list.length > 0" class="article-list padding-main border-radius-main oh bg-white spacing-mb">
|
||||
<view mode="aspectFit" class="new-icon va-m fl cp pr divider-r" data-value="/pages/article-category/article-category" @tap="url_event">
|
||||
<text>{{ $t('index.index.t8bll8') }}</text
|
||||
><text class="cr-red">{{ $t('index.index.t8bll9') }}</text>
|
||||
</view>
|
||||
<view class="right-content fr va-m">
|
||||
<swiper :vertical="true" :autoplay="true" :circular="true" display-multiple-items="1" interval="3000">
|
||||
<block v-for="(item, index) in article_list" :key="index">
|
||||
<swiper-item class="single-text">
|
||||
<text class="cr-base text-size-sm cp" :data-value="item.category_url" @tap="url_event">[{{ item.article_category_name }}]</text>
|
||||
<text class="cr-base text-size-sm margin-left-xs cp" :style="(item.title_color || null) != null ? 'color:' + item.title_color + ' !important;' : ''" :data-value="item.url" @tap="url_event">{{ item.title }}</text>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 按照插件顺序渲染插件数据 -->
|
||||
<block v-if="plugins_sort_list.length > 0">
|
||||
<block v-for="(pv, pi) in plugins_sort_list" :key="pi">
|
||||
<!-- 首页中间广告 - 插件 -->
|
||||
<view v-if="pv.plugins == 'homemiddleadv' && (plugins_homemiddleadv_data || null) != null && plugins_homemiddleadv_data.length > 0" class="plugins-homemiddleadv oh spacing-mb">
|
||||
<view v-for="(item, index) in plugins_homemiddleadv_data" :key="index" class="item border-radius-main oh cp" :data-value="item.url || ''" @tap="url_event">
|
||||
<image class="dis-block wh-auto border-radius-main" :src="item.images" mode="widthFix"> </image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 限时秒杀 - 插件 -->
|
||||
<view v-if="pv.plugins == 'seckill' && (plugins_seckill_data || null) != null && (plugins_seckill_data.data || null) != null && (plugins_seckill_data.data.goods || null) != null && plugins_seckill_data.data.goods.length > 0" class="plugins-seckill-data border-radius-main spacing-mb bg-white" :style="'background-image: url(' + seckill_static_url + 'seckill-bg.png);'">
|
||||
<view class="flex-row jc-sb align-c padding-top-main padding-horizontal-main">
|
||||
<view class="flex-1">
|
||||
<image class="dis-inline-block va-m icon" :src="plugins_seckill_data.data.home_title_icon" mode="widthFix"></image>
|
||||
<view class="dis-inline-block va-m margin-left-sm">
|
||||
<component-countdown :propHour="plugins_seckill_data.data.time.hours" :propMinute="plugins_seckill_data.data.time.minutes" :propSecond="plugins_seckill_data.data.time.seconds"></component-countdown>
|
||||
</view>
|
||||
</view>
|
||||
<text data-value="/pages/plugins/seckill/index/index" @tap="url_event" class="arrow-right padding-right cr-grey text-size-xs cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<component-goods-list :propData="{ style_type: 2, goods_list: plugins_seckill_data.data.goods }" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" :propIsCartParaCurve="true" propSource="index" :propOpenCart="false"></component-goods-list>
|
||||
</view>
|
||||
|
||||
<!-- 活动配置-楼层顶部 - 插件 -->
|
||||
<view v-if="pv.plugins == 'activity' && (plugins_activity_data || null) != null">
|
||||
<component-activity-list :propConfig="plugins_activity_data.base" :propData="plugins_activity_data.data" propLocation="0" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" :propIsCartParaCurve="true" propSource="index"></component-activity-list>
|
||||
</view>
|
||||
|
||||
<!-- 门店 - 插件 -->
|
||||
<view v-if="pv.plugins == 'realstore' && (plugins_realstore_data || null) != null">
|
||||
<view v-if="(plugins_realstore_data.base.home_data_list_title || null) != null" class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ plugins_realstore_data.base.home_data_list_title }}</text>
|
||||
<text data-value="/pages/plugins/realstore/search/search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<component-realstore-list :propData="{ ...{ data: plugins_realstore_data.data }, ...{ random: random_value } }"></component-realstore-list>
|
||||
</view>
|
||||
|
||||
<!-- 多商户 - 插件 -->
|
||||
<view v-if="pv.plugins == 'shop' && (plugins_shop_data || null) != null">
|
||||
<view v-if="(plugins_shop_data.base.home_data_list_title || null) != null" class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ plugins_shop_data.base.home_data_list_title }}</text>
|
||||
<text data-value="/pages/plugins/shop/index/index" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<component-shop-list :propConfig="plugins_shop_data.base" :propData="{ ...{ data: plugins_shop_data.data }, ...{ random: random_value } }"></component-shop-list>
|
||||
</view>
|
||||
|
||||
<!-- 组合搭配 - 插件 -->
|
||||
<view v-if="pv.plugins == 'binding' && (plugins_binding_data || null) != null">
|
||||
<view v-if="(plugins_binding_data.base.home_data_list_title || null) != null" class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ plugins_binding_data.base.home_data_list_title }}</text>
|
||||
<text data-value="/pages/plugins/binding/index/index" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<component-binding-list :propConfig="plugins_binding_data.base" :propData="{ ...{ data: plugins_binding_data.data }, ...{ random: random_value } }" :propCurrencySymbol="currency_symbol"></component-binding-list>
|
||||
</view>
|
||||
|
||||
<!-- 博客-楼层顶部 - 插件 -->
|
||||
<view v-if="pv.plugins == 'blog' && (plugins_blog_data || null) != null">
|
||||
<component-blog-list :propConfig="plugins_blog_data.base" :propData="plugins_blog_data.data" propLocation="0"></component-blog-list>
|
||||
</view>
|
||||
|
||||
<!-- 魔方 - 插件 -->
|
||||
<view v-if="pv.plugins == 'magic' && (plugins_magic_data || null) != null">
|
||||
<component-magic-list :propData="{ ...plugins_magic_data, ...{ random: random_value } }" :propCurrencySymbol="currency_symbol" :propLabel="plugins_label_data"></component-magic-list>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
|
||||
<!-- 楼层数据 -->
|
||||
<block v-if="(data_list || null) != null && data_list.length > 0">
|
||||
<!-- 数据模式0,1自动+手动、2拖拽 -->
|
||||
<block v-if="data_mode == 2">
|
||||
<!-- 引入拖拽数据模块 -->
|
||||
<component-layout :propData="data_list"></component-layout>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 自动+手动 -->
|
||||
<view v-for="(floor, index) in data_list" :key="index" class="floor">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<view class="title-left">
|
||||
<text class="text-wrapper title-left-border" :style="'color:' + (floor.bg_color || '#333') + ';'">{{ floor.name }}</text>
|
||||
<text v-if="(floor.describe || null) != null" class="vice-name margin-left-lg cr-grey">{{ floor.describe }}</text>
|
||||
</view>
|
||||
<text :data-value="'/pages/goods-search/goods-search?category_id=' + floor.id" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<view class="floor-list wh-auto oh pr">
|
||||
<block v-if="(floor.goods || null) != null && floor.goods.length > 0">
|
||||
<component-goods-list :propData="{ style_type: 1, goods_list: floor.goods }" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" :propIsCartParaCurve="true" propSource="index"></component-goods-list>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
|
||||
<!-- 按照插件顺序渲染插件数据 -->
|
||||
<block v-if="plugins_sort_list.length > 0">
|
||||
<block v-for="(pv, pi) in plugins_sort_list" :key="pi">
|
||||
<!-- 活动配置-楼层底部 - 插件 -->
|
||||
<view v-if="pv.plugins == 'activity' && (plugins_activity_data || null) != null">
|
||||
<component-activity-list :propConfig="plugins_activity_data.base" :propData="plugins_activity_data.data" propLocation="1" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" propSource="index" :propOpenCart="false"></component-activity-list>
|
||||
</view>
|
||||
|
||||
<!-- 博客-楼层底部 - 插件 -->
|
||||
<view v-if="pv.plugins == 'blog' && (plugins_blog_data || null) != null">
|
||||
<component-blog-list :propConfig="plugins_blog_data.base" :propData="plugins_blog_data.data" propLocation="1"></component-blog-list>
|
||||
</view>
|
||||
|
||||
<!--- 底部购买记录 - 插件 -->
|
||||
<view v-if="pv.plugins == 'salerecords' && (plugins_salerecords_data || null) != null && (plugins_salerecords_data.data || null) != null && plugins_salerecords_data.data.length > 0" class="plugins-salerecords bg-white border-radius-main padding-main spacing-mb">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<view class="title-left">
|
||||
<text class="text-wrapper">{{ plugins_salerecords_data.base.home_bottom_title || $t('index.index.s5r784') }}</text>
|
||||
<text v-if="(plugins_salerecords_data.base || null) != null && (plugins_salerecords_data.base.home_bottom_desc || null) != null" class="vice-name margin-left-sm cr-grey-9">{{ plugins_salerecords_data.base.home_bottom_desc }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="oh">
|
||||
<swiper :vertical="true" :autoplay="true" :circular="true" :display-multiple-items="plugins_salerecords_data.data.length < 6 ? plugins_salerecords_data.data.length : 6" interval="3000" :style="plugins_salerecords_data.data.length < 6 ? 'height:' + plugins_salerecords_data.data.length * 84.33 + 'rpx;' : ''">
|
||||
<block v-for="(item, index) in plugins_salerecords_data.data" :key="index">
|
||||
<swiper-item>
|
||||
<view class="item oh padding-vertical-main">
|
||||
<view class="item-content single-text fl">
|
||||
<image mode="widthFix" :src="item.user.avatar" class="va-m br"> </image>
|
||||
<text class="margin-left-sm">{{ item.user.user_name_view }}</text>
|
||||
<text v-if="(item.user.province || null) != null"><text class="padding-left-xs padding-right-xs">-</text>{{ item.user.province }}</text>
|
||||
</view>
|
||||
<view class="item-content fl">
|
||||
<view :data-value="item.goods_url" @tap="url_event" class="cp single-text">
|
||||
<image mode="widthFix" :src="item.images" class="va-m br"> </image>
|
||||
<text class="margin-left-sm single-text">{{ item.title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-content single-text fr tr cr-grey padding-top-xs">
|
||||
{{ item.add_time }}
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 提示信息 -->
|
||||
<block v-if="load_status == 0">
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg" propPage="home" :propIsHeader="true"></component-no-data>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 页面已加载、模式 -->
|
||||
<block v-if="load_status == 1 && data_mode != 3">
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
|
||||
<!-- 版权信息 -->
|
||||
<component-copyright></component-copyright>
|
||||
|
||||
<!-- 在线客服 -->
|
||||
<component-online-service :propIsNav="true" :propIsBar="true" :propIsGrayscale="plugins_mourning_data_is_app"></component-online-service>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav :propIsNav="true" :propIsBar="true" :propIsGrayscale="plugins_mourning_data_is_app"></component-quick-nav>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common" :propIsGrayscale="plugins_mourning_data_is_app"></component-common>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentSearch from '@/components/search/search';
|
||||
import componentQuickNav from '@/components/quick-nav/quick-nav';
|
||||
import componentIconNav from '@/components/icon-nav/icon-nav';
|
||||
import componentBanner from '@/components/slider/slider';
|
||||
import componentCountdown from '@/components/countdown/countdown';
|
||||
import componentLayout from '@/components/layout/layout';
|
||||
import componentBadge from '@/components/badge/badge';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
import componentCopyright from '@/components/copyright/copyright';
|
||||
import componentOnlineService from '@/components/online-service/online-service';
|
||||
import componentActivityList from '@/components/activity-list/activity-list';
|
||||
import componentBlogList from '@/components/blog-list/blog-list';
|
||||
import componentRealstoreList from '@/components/realstore-list/realstore-list';
|
||||
import componentShopList from '@/components/shop-list/shop-list';
|
||||
import componentGoodsList from '@/components/goods-list/goods-list';
|
||||
import componentBindingList from '@/components/binding-list/binding-list';
|
||||
import componentMagicList from '@/components/magic-list/magic-list';
|
||||
import componentDiy from '@/components/diy/diy';
|
||||
import componentChoiceLocation from '@/components/choice-location/choice-location';
|
||||
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: '',
|
||||
theme_color: '',
|
||||
common_static_url: '',
|
||||
seckill_static_url: '',
|
||||
static_url: '',
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
load_status: 0,
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
is_home_search_scan: app.globalData.data.is_home_search_scan,
|
||||
data_list: [],
|
||||
banner_list: [],
|
||||
navigation: [],
|
||||
article_list: [],
|
||||
cart_total: 0,
|
||||
message_total: 0,
|
||||
right_icon_list: [],
|
||||
// 首页数据模式
|
||||
data_mode: 0,
|
||||
// 增加随机数,避免无法监听数据列表内部数据更新
|
||||
random_value: 0,
|
||||
// 基础配置
|
||||
common_shop_notice: null,
|
||||
common_app_is_enable_search: 0,
|
||||
common_app_is_header_nav_fixed: 0,
|
||||
common_app_is_online_service: 0,
|
||||
// 顶部导航、名称、logo、定位
|
||||
application_title: app.globalData.data.application_title,
|
||||
application_logo: app.globalData.data.application_logo,
|
||||
is_home_logo_use_text: app.globalData.data.is_home_logo_use_text,
|
||||
is_home_location_choice: app.globalData.data.is_home_location_choice,
|
||||
// 顶部+搜索样式配置
|
||||
top_content_bg_color: '',
|
||||
top_content_search_bg_color: '',
|
||||
top_content_search_content_style: '',
|
||||
// #ifdef MP
|
||||
top_content_style: 'padding-top:' + (bar_height + 10) + 'px;',
|
||||
// #endif
|
||||
// #ifdef H5 || MP-TOUTIAO
|
||||
top_content_style: 'padding-top:' + (bar_height + 14) + 'px;',
|
||||
// #endif
|
||||
// #ifdef APP
|
||||
top_content_style: 'padding-top:' + bar_height + 'px;',
|
||||
// #endif
|
||||
// 是否单页预览
|
||||
is_single_page: app.globalData.is_current_single_page() || 0,
|
||||
// 轮播滚动时,背景色替换
|
||||
slider_bg: null,
|
||||
// 插件顺序列表
|
||||
plugins_sort_list: [],
|
||||
// 限时秒杀插件
|
||||
plugins_seckill_data: null,
|
||||
// 购买记录插件
|
||||
plugins_salerecords_data: null,
|
||||
// 活动配置插件
|
||||
plugins_activity_data: null,
|
||||
// 标签插件
|
||||
plugins_label_data: null,
|
||||
// 首页中间广告插件
|
||||
plugins_homemiddleadv_data: null,
|
||||
// 哀悼灰度插件
|
||||
plugins_mourning_data_is_app: app.globalData.is_app_mourning(),
|
||||
// 标签插件
|
||||
plugins_blog_data: null,
|
||||
// 门店插件
|
||||
plugins_realstore_data: null,
|
||||
// 多商户插件
|
||||
plugins_shop_data: null,
|
||||
// 组合搭配插件
|
||||
plugins_binding_data: null,
|
||||
// 魔方插件
|
||||
plugins_magic_data: null,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentSearch,
|
||||
componentQuickNav,
|
||||
componentIconNav,
|
||||
componentBanner,
|
||||
componentCountdown,
|
||||
componentLayout,
|
||||
componentBadge,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentCopyright,
|
||||
componentOnlineService,
|
||||
componentActivityList,
|
||||
componentBlogList,
|
||||
componentRealstoreList,
|
||||
componentShopList,
|
||||
componentGoodsList,
|
||||
componentBindingList,
|
||||
componentMagicList,
|
||||
componentDiy,
|
||||
componentChoiceLocation,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show({object: this, method: 'init'});
|
||||
}
|
||||
|
||||
// 设置顶部导航的默认颜色
|
||||
this.set_navigation_bar_color();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
if (this.data_list_loding_status === 1) {
|
||||
uni.stopPullDownRefresh();
|
||||
} else {
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if ((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.globalData.get_config('currency_symbol'),
|
||||
common_shop_notice: app.globalData.get_config('config.common_shop_notice'),
|
||||
common_app_is_enable_search: app.globalData.get_config('config.common_app_is_enable_search'),
|
||||
common_app_is_header_nav_fixed: app.globalData.get_config('config.common_app_is_header_nav_fixed'),
|
||||
common_app_is_online_service: app.globalData.get_config('config.common_app_is_online_service'),
|
||||
application_title: app.globalData.get_application_title(),
|
||||
application_logo: app.globalData.get_application_logo(),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init(params = {}) {
|
||||
// 还没有数据则读取缓存
|
||||
var cache_key = app.globalData.data.cache_index_data_key;
|
||||
if (this.load_status == 0) {
|
||||
// 本地缓存数据
|
||||
var upd_data = uni.getStorageSync(cache_key) || null;
|
||||
if (upd_data != null) {
|
||||
// 先使用缓存数据展示
|
||||
this.setData(upd_data);
|
||||
|
||||
// 初始化返回公共处理
|
||||
this.init_result_common_handle();
|
||||
|
||||
// 已有本地缓存则直接取远程有效数据(默认首次取的是远程缓存数据)
|
||||
params['is_cache'] = 0;
|
||||
|
||||
// 设置顶部导航的默认颜色
|
||||
this.set_navigation_bar_color();
|
||||
}
|
||||
} else {
|
||||
// 已有本地缓存则直接取远程有效数据(默认首次取的是远程缓存数据)
|
||||
params['is_cache'] = 0;
|
||||
}
|
||||
|
||||
// 网络检查
|
||||
if ((params || null) == null || (params.loading || 0) == 0) {
|
||||
app.globalData.network_type_handle(this, 'init', params);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 没有缓存数据则开启加载层
|
||||
if (upd_data == null) {
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
}
|
||||
// 请求远程数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index'),
|
||||
method: 'POST',
|
||||
data: params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
// 数据处理
|
||||
var data = res.data.data;
|
||||
if (res.data.code == 0) {
|
||||
var data_list = data.data_list || null;
|
||||
var upd_data = {
|
||||
random_value: Math.random(),
|
||||
data_bottom_line_status: true,
|
||||
banner_list: data.banner_list || [],
|
||||
navigation: data.navigation || [],
|
||||
article_list: data.article_list || [],
|
||||
data_mode: data.data_mode || 0,
|
||||
data_list: data_list,
|
||||
cart_total: data.cart_total.buy_number || 0,
|
||||
message_total: parseInt(data.message_total || 0),
|
||||
right_icon_list: data.right_icon_list || [],
|
||||
data_list_loding_status: data_list == null || data_list.length == 0 ? 0 : 3,
|
||||
plugins_sort_list: data.plugins_sort_list || [],
|
||||
plugins_seckill_data: data.plugins_seckill_data || null,
|
||||
plugins_salerecords_data: (data.plugins_salerecords_data || null) == null || data.plugins_salerecords_data.length <= 0 ? null : data.plugins_salerecords_data,
|
||||
plugins_activity_data: (data.plugins_activity_data || null) == null || data.plugins_activity_data.length <= 0 ? null : data.plugins_activity_data,
|
||||
plugins_label_data: (data.plugins_label_data || null) == null || (data.plugins_label_data.base || null) == null || (data.plugins_label_data.data || null) == null || data.plugins_label_data.data.length <= 0 ? null : data.plugins_label_data,
|
||||
plugins_homemiddleadv_data: (data.plugins_homemiddleadv_data || null) == null || data.plugins_homemiddleadv_data.length <= 0 ? null : data.plugins_homemiddleadv_data,
|
||||
plugins_mourning_data_is_app: parseInt(data.plugins_mourning_data || 0) == 1,
|
||||
plugins_blog_data: data.plugins_blog_data || null,
|
||||
plugins_realstore_data: data.plugins_realstore_data || null,
|
||||
plugins_shop_data: data.plugins_shop_data || null,
|
||||
plugins_binding_data: data.plugins_binding_data || null,
|
||||
plugins_magic_data: data.plugins_magic_data || null,
|
||||
};
|
||||
// 如果开启了哀悼灰色则不固定导航
|
||||
if (upd_data.plugins_mourning_data_is_app == 1) {
|
||||
upd_data['common_app_is_header_nav_fixed'] = 0;
|
||||
}
|
||||
this.setData(upd_data);
|
||||
|
||||
// 存储缓存
|
||||
uni.setStorageSync(cache_key, upd_data);
|
||||
|
||||
// 设置顶部导航的默认颜色
|
||||
this.set_navigation_bar_color();
|
||||
|
||||
// 是否需要重新加载数据
|
||||
if (parseInt(data.is_result_data_cache || 0) == 1) {
|
||||
this.init({ is_cache: 0 });
|
||||
} else {
|
||||
// 购物车导航角标
|
||||
app.globalData.set_tab_bar_badge('cart', this.cart_total);
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
data_bottom_line_status: true,
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化返回公共处理
|
||||
this.init_result_common_handle();
|
||||
},
|
||||
fail: () => {
|
||||
// 轮播数据处理
|
||||
if (this.load_status == 0 || (this.top_content_search_bg_color || null) == null) {
|
||||
this.change_banner(app.globalData.get_theme_color());
|
||||
}
|
||||
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
data_bottom_line_status: true,
|
||||
load_status: 1,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 设置顶部导航的默认颜色
|
||||
set_navigation_bar_color() {
|
||||
if(this.data_mode == 3) {
|
||||
app.globalData.set_navigation_bar_color(parseInt(app.globalData.get_key_data(this.data_list, 'config.header.com_data.style.function_buttons_type', 0)) == 1);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化返回公共处理
|
||||
init_result_common_handle() {
|
||||
var theme_view = app.globalData.get_theme_value_view();
|
||||
var theme_color = app.globalData.get_theme_color();
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
var seckill_static_url = app.globalData.get_static_url('seckill', true) + 'app/';
|
||||
var static_url = app.globalData.get_static_url('home');
|
||||
|
||||
// 轮播数据处理
|
||||
if (this.load_status == 0 || (this.top_content_search_bg_color || null) == null) {
|
||||
var color = this.banner_list && this.banner_list.length > 0 && (this.banner_list[0]['bg_color'] || null) != null ? this.banner_list[0]['bg_color'] : theme_color;
|
||||
this.change_banner(color);
|
||||
}
|
||||
|
||||
// 公共数据
|
||||
this.setData({
|
||||
top_content_search_content_style: 'background-image: url("' + static_url + 'nav-top.png");',
|
||||
theme_view: theme_view,
|
||||
theme_color: theme_color,
|
||||
common_static_url: common_static_url,
|
||||
seckill_static_url: seckill_static_url,
|
||||
static_url: static_url,
|
||||
load_status: 1,
|
||||
});
|
||||
|
||||
// 分享菜单处理、延时执行,确保基础数据已加载完成
|
||||
setTimeout(function () {
|
||||
app.globalData.page_share_handle();
|
||||
}, 3000);
|
||||
},
|
||||
|
||||
// 选择用户地理位置回调
|
||||
user_back_choice_location(e) {
|
||||
// 重新刷新数据
|
||||
this.init();
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 轮播改变、背景色处理
|
||||
change_banner(color) {
|
||||
if ((color || null) == null) {
|
||||
color = this.theme_color;
|
||||
}
|
||||
this.setData({
|
||||
top_content_bg_color: 'background: linear-gradient(180deg, ' + color + ' 0%, #f5f5f5 80%);',
|
||||
top_content_search_bg_color: 'background: linear-gradient(180deg, ' + color + ' 0%, #f5f5f5 300%);',
|
||||
});
|
||||
},
|
||||
|
||||
// 搜索icon扫码事件
|
||||
search_icon_event(e) {
|
||||
app.globalData.scan_handle();
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './index.css';
|
||||
</style>
|
||||
137
pages/login/login.css
Normal file
137
pages/login/login.css
Normal file
@@ -0,0 +1,137 @@
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础
|
||||
*/
|
||||
.content .icon {
|
||||
width: 130rpx;
|
||||
height: 130rpx !important;
|
||||
}
|
||||
.dom-content {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/**
|
||||
* 表单内容
|
||||
*/
|
||||
.form-content {
|
||||
padding: 34rpx;
|
||||
}
|
||||
.form-content .form-item,
|
||||
.form-content .code,
|
||||
.form-content .verify {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
background: #F9F9F9;
|
||||
border-radius: 25px;
|
||||
border: 0;
|
||||
}
|
||||
.form-content .code input,
|
||||
.form-content .verify input {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
}
|
||||
.form-content .form-item,
|
||||
.form-content .code input,
|
||||
.form-content .verify input {
|
||||
padding: 0 36rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.form-content .form-item ::v-deep .input-placeholder,
|
||||
.form-content .form-item ::v-deep .uni-input-input,
|
||||
.form-content .form-item ::v-deep .input-placeholder,
|
||||
.form-content .code input ::v-deep .input-placeholder,
|
||||
.form-content .verify input ::v-deep .input-placeholder {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.form-content .code input,
|
||||
.form-content .verify input {
|
||||
width: 63%;
|
||||
}
|
||||
.form-content .form-item ::v-deep .uni-input-input:-webkit-autofill {
|
||||
/* //这个地方的颜色是字体颜色,可以根据实际情况修改 */
|
||||
/* -webkit-text-fill-color: #ededed !important; */
|
||||
/* //设置input输入框的背景颜色为透明色 */
|
||||
-webkit-box-shadow: 0 0 0px 1000px #f9f9f9 inset !important;
|
||||
/* //设置input输入框的背景颜色为透明色 */
|
||||
background-color: #f9f9f9;
|
||||
background-image: none;
|
||||
transition: background-color 50000s ease-in-out 0s;
|
||||
}
|
||||
.form-content .code ::v-deep .uni-input-input:-webkit-autofill {
|
||||
/* //设置input输入框的背景颜色为透明色 */
|
||||
background-color: #f9f9f9;
|
||||
background-image: none;
|
||||
transition: background-color 50000s ease-in-out 0s;
|
||||
}
|
||||
.form-content .code .verify-submit {
|
||||
padding: 0 12px;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
top: 11px;
|
||||
right: 36rpx;
|
||||
}
|
||||
.form-content .verify .verify-image {
|
||||
width: 35%;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
top: 0;
|
||||
right: 36rpx;
|
||||
}
|
||||
.opt-type-list text:not(:last-child) {
|
||||
margin-right: 50rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 第三方登录 - 插件
|
||||
*/
|
||||
.plugins-thirdpartylogin .item {
|
||||
width: 76rpx;
|
||||
height: 76rpx;
|
||||
padding: 5rpx;
|
||||
}
|
||||
.plugins-thirdpartylogin .item:not(:last-child) {
|
||||
margin-right: 54rpx;
|
||||
}
|
||||
.plugins-thirdpartylogin .item image {
|
||||
width: 50rpx !important;
|
||||
height: 50rpx !important;
|
||||
}
|
||||
.plugins-thirdpartylogin .item.more-submit image {
|
||||
width: 76rpx !important;
|
||||
height: 76rpx !important;
|
||||
}
|
||||
.plugins-thirdpartylogin-bind image {
|
||||
width: 40rpx !important;
|
||||
height: 40rpx !important;
|
||||
}
|
||||
.plugins-thirdpartylogin-bind button {
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.popup-login .content,
|
||||
.popup-login .footer .cancel-btn {
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
.popup-login .content .item:not(:last-child) {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.popup-login .content .item image {
|
||||
width: 36rpx !important;
|
||||
height: 36rpx !important;
|
||||
}
|
||||
.popup-login .content .item .login-width {
|
||||
width: 180rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 多语言
|
||||
*/
|
||||
.popup-language {
|
||||
height: 100vh;
|
||||
}
|
||||
.popup-language .list {
|
||||
height: calc(100vh - 95rpx);
|
||||
overflow-y: auto;
|
||||
}
|
||||
1758
pages/login/login.vue
Normal file
1758
pages/login/login.vue
Normal file
File diff suppressed because it is too large
Load Diff
3
pages/logout/logout.css
Normal file
3
pages/logout/logout.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.bottom-fixed button {
|
||||
width: calc(50% - 10rpx);
|
||||
}
|
||||
166
pages/logout/logout.vue
Normal file
166
pages/logout/logout.vue
Normal file
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<scroll-view :scroll-y="true" class="scroll-box bg-white">
|
||||
<view class="page-bottom-fixed">
|
||||
<block v-if="data_list_loding_status == 3">
|
||||
<view class="padding-main">
|
||||
<view class="">
|
||||
<mp-html :content="agreement_data.value" />
|
||||
</view>
|
||||
<view class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item bg-grey br-grey cr-base round text-size fl" type="default" size="mini" hover-class="none" @tap="logout_submit_event">{{$t('logout.logout.u10002')}}</button>
|
||||
<button class="item bg-main br-main cr-white round text-size fr" type="default" size="mini" hover-class="none" @tap="logout_cancel_event">{{$t('common.cancel')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 错误提示 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</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';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
bottom_fixed_style: '',
|
||||
agreement_data: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
},
|
||||
|
||||
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() {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: this.$t('setup.setup.nwt4o1'),
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'agreement'),
|
||||
method: 'POST',
|
||||
data: { document: 'userlogout' },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data_list_loding_status: 3,
|
||||
agreement_data: res.data.data || {},
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 注销提交
|
||||
logout_submit_event(e) {
|
||||
// 是否再次确认
|
||||
if (e.alert_status != 0 && e.alert_status != 1) {
|
||||
app.globalData.alert({
|
||||
msg: this.$t('logout.logout.9vfzz4'),
|
||||
is_show_cancel: 1,
|
||||
object: this,
|
||||
method: 'logout_submit_event',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
// 注销提交
|
||||
if (e.alert_status == 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('logout', 'safety'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.remove_user_cache_event();
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open(app.globalData.app_tabbar_pages()[0]);
|
||||
}, 1500);
|
||||
} 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'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 取消返回
|
||||
logout_cancel_event() {
|
||||
app.globalData.page_back_prev_event();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './logout.css';
|
||||
</style>
|
||||
193
pages/message/message.vue
Normal file
193
pages/message/message.vue
Normal file
@@ -0,0 +1,193 @@
|
||||
<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 bg-white oh spacing-mb">
|
||||
<view class="oh">
|
||||
<text class="fw-b">{{item.title}}</text>
|
||||
<text class="fr cr-base">{{item.add_time_time}}</text>
|
||||
</view>
|
||||
<view class="cr-grey margin-top-lg">{{item.detail}}</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
|
||||
};
|
||||
},
|
||||
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", "message"),
|
||||
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();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
20
pages/password/password.css
Normal file
20
pages/password/password.css
Normal file
@@ -0,0 +1,20 @@
|
||||
.password {
|
||||
height: 100vh;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.password .form-item {
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
background: #F9F9F9;
|
||||
border-radius: 50rpx;
|
||||
border: 0;
|
||||
padding: 0 36rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.eyes {
|
||||
right: 32rpx;
|
||||
top: calc(50% - 12rpx);
|
||||
z-index: 2;
|
||||
}
|
||||
157
pages/password/password.vue
Normal file
157
pages/password/password.vue
Normal file
@@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 主体内容 -->
|
||||
<block v-if="data_list_loding_status == 3">
|
||||
<view class="password">
|
||||
<view class="padding-main">
|
||||
<form @submit="form_bind_pwd">
|
||||
<view class="margin-top-xxxl">
|
||||
<view class="pr">
|
||||
<input type="text" :placeholder="$t('password.password.4e24j1')" minlength="6" maxlength="18" name="my_pwd" :password="!eyes1" class="form-item margin-bottom-main" />
|
||||
<view class="eyes pa" data-index="1" @tap="eyes_event"><iconfont :name="eyes1 ? 'icon-wodeqianbao-eye' : 'icon-eye-half'" color="#666" size="32rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="pr">
|
||||
<input type="text" :placeholder="$t('password.password.1lwiaz')" minlength="6" maxlength="18" name="new_pwd" :password="!eyes2" class="form-item margin-bottom-main" />
|
||||
<view class="eyes pa" data-index="2" @tap="eyes_event"><iconfont :name="eyes2 ? 'icon-wodeqianbao-eye' : 'icon-eye-half'" color="#666" size="32rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="pr">
|
||||
<input type="text" :placeholder="$t('password.password.338433')" minlength="6" maxlength="18" name="confirm_new_pwd" :password="!eyes3" class="form-item margin-bottom-main" />
|
||||
<view class="eyes pa" data-index="3" @tap="eyes_event"><iconfont :name="eyes3 ? 'icon-wodeqianbao-eye' : 'icon-eye-half'" color="#666" size="32rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-xxxxl tc">
|
||||
<button class="bg-main br-main cr-white round text-size" form-type="submit" type="default" hover-class="none" :loading="form_submit_loading" :disabled="form_submit_loading">{{$t('password.password.xyekjf')}}</button>
|
||||
</view>
|
||||
</form>
|
||||
</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';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
form_submit_loading: false,
|
||||
// 是否显示密码
|
||||
eyes1: false,
|
||||
eyes2: false,
|
||||
eyes3: false,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData
|
||||
},
|
||||
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() {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.setData({
|
||||
data_list_loding_status: 3,
|
||||
user: user,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: this.$t('setup.setup.nwt4o1'),
|
||||
});
|
||||
}
|
||||
},
|
||||
eyes_event(e) {
|
||||
if (e.currentTarget.dataset.index == '1') {
|
||||
this.setData({
|
||||
eyes1: !this.eyes1,
|
||||
});
|
||||
} else if (e.currentTarget.dataset.index == '2') {
|
||||
this.setData({
|
||||
eyes2: !this.eyes2,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
eyes3: !this.eyes3,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 绑定表单
|
||||
form_bind_pwd(e) {
|
||||
// 数据验证
|
||||
var validation = [
|
||||
{ fields: 'my_pwd', msg: this.$t('login.login.277w03') },
|
||||
{ fields: 'new_pwd', msg: this.$t('password.password.1lwiaz') },
|
||||
{ fields: 'confirm_new_pwd', msg: this.$t('password.password.3pp6t7') },
|
||||
];
|
||||
if (app.globalData.fields_check(e.detail.value, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
this.setData({
|
||||
form_submit_loading: true,
|
||||
});
|
||||
|
||||
// 网络请求
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('loginpwdupdate', 'safety'),
|
||||
method: 'POST',
|
||||
data: e.detail.value,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
if (res.data.code == 0) {
|
||||
setTimeout(() => {
|
||||
// 默认返回上一页
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './password.css';
|
||||
</style>
|
||||
21
pages/paytips/paytips.css
Normal file
21
pages/paytips/paytips.css
Normal file
@@ -0,0 +1,21 @@
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
.content {
|
||||
padding-top: 15%;
|
||||
}
|
||||
.content .pay-icon {
|
||||
width: 200rpx;
|
||||
height: 200rpx !important;
|
||||
margin: 60rpx auto;
|
||||
}
|
||||
.btn-box {
|
||||
margin-top: 150rpx;
|
||||
}
|
||||
.btn-box button {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
width: 300rpx;
|
||||
}
|
||||
120
pages/paytips/paytips.vue
Normal file
120
pages/paytips/paytips.vue
Normal file
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="content tc">
|
||||
<image class="pay-icon dis-block" v-if="params.code == '9000'" mode="widthFix" :src="default_round_success_icon"></image>
|
||||
<image class="pay-icon dis-block" v-else mode="widthFix" :src="default_round_error_icon"></image>
|
||||
<view class="text-size-lg cr-base">{{ params.msg || $t('paytips.paytips.679rxu') }}</view>
|
||||
</view>
|
||||
<view class="btn-box tc">
|
||||
<view>
|
||||
<button class="bg-main br-main cr-white round" type="default" hover-class="none" size="mini" @tap="back_event">{{$t('common.return')}}</button>
|
||||
</view>
|
||||
<view class="margin-top-lg">
|
||||
<button class="bg-main-pair br-main-pair cr-white round" type="default" hover-class="none" size="mini" data-redirect="1" :data-value="default_to_url" @tap="url_event">{{ params.title || $t('paytips.paytips.jifuu8') }}</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import base64 from '@/common/js/lib/base64.js';
|
||||
import componentCommon from '@/components/common/common';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
params: {},
|
||||
default_round_success_icon: app.globalData.data.default_round_success_icon,
|
||||
default_round_error_icon: app.globalData.data.default_round_error_icon,
|
||||
default_to_url: '',
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面加载初始化
|
||||
*/
|
||||
onLoad(params) {
|
||||
// 参数处理
|
||||
if((params || null) != null) {
|
||||
params = JSON.parse(base64.decode(decodeURIComponent(params.params)));
|
||||
}
|
||||
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 根据状态处理
|
||||
var msg = null;
|
||||
switch (params.code) {
|
||||
// 支付成功
|
||||
case '9000':
|
||||
msg = this.$t('paytips.paytips.679rxu');
|
||||
break;
|
||||
// 正在处理中
|
||||
case '8000':
|
||||
msg = this.$t('paytips.paytips.d8m853');
|
||||
break;
|
||||
// 支付失败
|
||||
case '4000':
|
||||
msg = this.$t('paytips.paytips.6y488i');
|
||||
break;
|
||||
// 用户中途取消
|
||||
case '6001':
|
||||
msg = this.$t('paytips.paytips.e732we');
|
||||
break;
|
||||
// 网络连接出错
|
||||
case '6002':
|
||||
msg = this.$t('paytips.paytips.13v11t');
|
||||
break;
|
||||
// 支付结果未知(有可能已经支付成功),请查询商户订单列表中订单的支付状态
|
||||
case '6004':
|
||||
msg = this.$t('paytips.paytips.u1153p');
|
||||
break;
|
||||
// 用户点击忘记密码导致快捷界面退出(only iOS)
|
||||
case '99':
|
||||
msg = this.$t('paytips.paytips.6mpsl7');
|
||||
break;
|
||||
// 默认错误
|
||||
default:
|
||||
msg = this.$t('paytips.paytips.59u769');
|
||||
}
|
||||
params['msg'] = msg;
|
||||
this.setData({
|
||||
params: params,
|
||||
default_to_url: params.page || app.globalData.app_tabbar_pages()[0],
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 返回
|
||||
back_event(e) {
|
||||
app.globalData.page_back_prev_event();
|
||||
},
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './paytips.css';
|
||||
</style>
|
||||
11
pages/personal/personal.css
Normal file
11
pages/personal/personal.css
Normal file
@@ -0,0 +1,11 @@
|
||||
.user-avatar {
|
||||
width: 80rpx;
|
||||
height: 80rpx !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 表单排版
|
||||
*/
|
||||
.form-container .form-gorup:not(:last-child) {
|
||||
border-bottom: 2rpx solid #F5F5F5;
|
||||
}
|
||||
266
pages/personal/personal.vue
Normal file
266
pages/personal/personal.vue
Normal file
@@ -0,0 +1,266 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="page-bottom-fixed">
|
||||
<!-- 主体内容 -->
|
||||
<block v-if="data_list_loding_status == 3">
|
||||
<form @submit="form_submit" class="form-container">
|
||||
<view class="padding-main page-bottom-fixed">
|
||||
<view class="bg-white border-radius-main oh">
|
||||
<view class="form-gorup oh flex-row jc-sb align-c">
|
||||
<view>{{$t('personal.personal.cw1d8p')}}</view>
|
||||
<view class="flex-row align-c">
|
||||
<button class="bg-white br-0 lh-0 padding-horizontal-sm" hover-class="none" open-type="chooseAvatar" @chooseavatar="choose_avatar_event" @tap="choose_avatar_event">
|
||||
<image :src="user_data.avatar || default_avatar" mode="widthFix" class="circle br user-avatar flex-1 flex-width"></image>
|
||||
</button>
|
||||
<iconfont name="icon-arrow-right" size="34rpx" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-gorup oh flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title">{{$t('personal.personal.gw8br3')}}<text class="form-group-tips-must">*</text></view>
|
||||
<view class="flex-row align-c flex-1 flex-width">
|
||||
<input :type="application_client_type == 'weixin' ? 'nickname' : 'text'" name="nickname" :value="user_data.nickname || ''" maxlength="16" placeholder-class="cr-grey-9 tr" class="cr-base tr margin-right-sm" :placeholder="$t('personal.personal.44112i')" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-gorup oh flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title">{{$t('personal.personal.jibx42')}}</view>
|
||||
<view class="flex-1 flex-width flex-row jc-e align-c">
|
||||
<picker class="margin-right-sm wh-auto tr" name="birthday" mode="date" :value="user_data.birthday || ''" data-field="birthday" @change="select_change_event">
|
||||
<view :class="'picker ' + ((user_data.birthday || null) == null ? 'cr-grey' : '')">{{ user_data.birthday || $t('personal.personal.85404s') }}</view>
|
||||
</picker>
|
||||
<iconfont name="icon-arrow-right" size="34rpx" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-gorup oh flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title">{{$t('personal.personal.6m33c4')}}</view>
|
||||
<view class="flex-row align-c flex-1 flex-width">
|
||||
<input type="text" name="address" :value="user_data.address || ''" maxlength="30" placeholder-class="cr-grey-9 tr" class="cr-base tr margin-right-sm" :placeholder="$t('personal.personal.re674n')" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-gorup oh flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title">{{$t('personal.personal.x2fofv')}}</view>
|
||||
<view class="flex-row jc-e align-c flex-1 flex-width">
|
||||
<picker @change="select_change_event" :value="user_data.gender || ''" :range="gender_list" range-key="name" name="gender" data-field="gender" class="margin-right-sm wh-auto tr">
|
||||
<view class="uni-input cr-base picker">{{ gender_list[user_data.gender].name || '' }}</view>
|
||||
</picker>
|
||||
<iconfont name="icon-arrow-right" size="34rpx" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item bg-main br-main cr-white round text-size" type="default" form-type="submit" hover-class="none" :disabled="form_submit_disabled_status">{{$t('common.save')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
</block>
|
||||
|
||||
<!-- 错误提示 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</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';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
application_client_type: app.globalData.application_client_type(),
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
bottom_fixed_style: '',
|
||||
form_submit_disabled_status: false,
|
||||
default_avatar: app.globalData.data.default_user_head_src,
|
||||
user_data: {},
|
||||
gender_list: [],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData
|
||||
},
|
||||
|
||||
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() {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: this.$t('setup.setup.nwt4o1'),
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'personal'),
|
||||
method: 'POST',
|
||||
data: {lang_can_key: 'gender_list'},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data_list_loding_status: 3,
|
||||
user_data: res.data.data.data || {},
|
||||
gender_list: res.data.data.gender_list || [],
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 生日、性别选择事件
|
||||
select_change_event(e) {
|
||||
var temp = this.user_data;
|
||||
temp[e.currentTarget.dataset.field] = e.detail.value;
|
||||
this.setData({ user_data: temp });
|
||||
},
|
||||
|
||||
// 头像事件
|
||||
choose_avatar_event(e) {
|
||||
var self = this;
|
||||
if (this.application_client_type == 'weixin') {
|
||||
self.upload_handle(e.detail.avatarUrl);
|
||||
} else {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
success(res) {
|
||||
if (res.tempFilePaths.length > 0) {
|
||||
self.upload_handle(res.tempFilePaths[0]);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 上传处理
|
||||
upload_handle(image) {
|
||||
var self = this;
|
||||
uni.uploadFile({
|
||||
url: app.globalData.get_request_url('useravatarupload', 'personal'),
|
||||
filePath: image,
|
||||
name: 'file',
|
||||
formData: {},
|
||||
success: function (res) {
|
||||
if (res.statusCode == 200) {
|
||||
var data = typeof res.data == 'object' ? res.data : JSON.parse(res.data);
|
||||
if (data.code == 0) {
|
||||
var temp = self.user_data;
|
||||
temp['avatar'] = data.data;
|
||||
self.setData({ user_data: temp });
|
||||
} else {
|
||||
app.globalData.showToast(data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 数据提交
|
||||
form_submit(e) {
|
||||
// 表单数据
|
||||
var form_data = e.detail.value;
|
||||
// 头像
|
||||
form_data['avatar'] = this.user_data.avatar || '';
|
||||
// 生日
|
||||
form_data['birthday'] = this.user_data.birthday || '';
|
||||
// 性别
|
||||
form_data['gender'] = this.user_data.gender || 0;
|
||||
|
||||
// 数据保存
|
||||
this.setData({
|
||||
form_submit_disabled_status: true,
|
||||
});
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('save', 'personal'),
|
||||
method: 'POST',
|
||||
data: form_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
form_submit_disabled_status: false,
|
||||
});
|
||||
if (res.data.code == 0) {
|
||||
uni.setStorageSync(app.globalData.data.cache_user_info_key, res.data.data);
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
} 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();
|
||||
this.setData({
|
||||
form_submit_disabled_status: false,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './personal.css';
|
||||
</style>
|
||||
17
pages/plugins/activity/detail/detail.css
Normal file
17
pages/plugins/activity/detail/detail.css
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* 基础
|
||||
*/
|
||||
.base-container {
|
||||
height: 280rpx;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
}
|
||||
.base-container .text {
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgb(0 0 0 / 35%);
|
||||
padding: 100rpx 20rpx 20rpx 20rpx;
|
||||
}
|
||||
.word-content .word-icon:not(:last-child) {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
193
pages/plugins/activity/detail/detail.vue
Normal file
193
pages/plugins/activity/detail/detail.vue
Normal file
@@ -0,0 +1,193 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null">
|
||||
<view class="padding-horizontal-main padding-top-main">
|
||||
<!-- 基础信息 -->
|
||||
<view class="base-container tc pr padding-main border-radius-main bg-main oh spacing-mb" :style="'background-color:' + data.color + ' !important;background-image:url(' + (data.banner || data.cover) + ')'">
|
||||
<view v-if="(data.describe || null) != null" class="text cr-white pa bs-bb text-size wh-auto ht-auto">{{ data.describe }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 关键字 -->
|
||||
<view v-if="data.keywords_arr.length > 0" class="word-content scroll-view-horizontal margin-bottom-sm">
|
||||
<scroll-view scroll-x>
|
||||
<block v-for="(kv, ki) in data.keywords_arr" :key="ki">
|
||||
<text :data-value="'/pages/goods-search/goods-search?keywords=' + kv" @tap="url_event" class="word-icon dis-inline-block bg-main-light text-size-xs cr-main round padding-top-xs padding-bottom-xs padding-left padding-right cp">{{ kv }}</text>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 推荐商品 -->
|
||||
<view v-if="(data.goods_list || null) != null && data.goods_list.length > 0">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<view class="title-left">
|
||||
<text class="text-wrapper title-left-border">{{$t('detail.detail.b4f3nw')}}</text>
|
||||
<text class="vice-name margin-left-lg cr-grey">{{ data.vice_title }}</text>
|
||||
</view>
|
||||
<text data-value="/pages/plugins/activity/index/index" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{$t('detail.detail.ans2p4')}}</text>
|
||||
</view>
|
||||
<component-goods-list :propData="{ style_type: 1, goods_list: data.goods_list }" :propCurrencySymbol="currency_symbol"></component-goods-list>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0" :propMsg="$t('detail.detail.5knxg6')"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</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';
|
||||
import componentGoodsList from '@/components/goods-list/goods-list';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
params: null,
|
||||
user: null,
|
||||
data_base: null,
|
||||
data: null,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentGoodsList,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if ((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.globalData.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'index', 'activity'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: this.params.id || 0,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
data: data.data || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: (data.data || null) != null && (data.data.goods_list || null) != null && data.data.goods_list.length > 0,
|
||||
});
|
||||
|
||||
if ((this.data || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data.seo_title || this.data.title,
|
||||
desc: this.data.seo_desc || this.data.describe,
|
||||
path: '/pages/plugins/activity/detail/detail',
|
||||
query: 'id=' + this.data.id,
|
||||
img: this.data.share_images || this.data.cover,
|
||||
},
|
||||
});
|
||||
|
||||
// 标题
|
||||
if ((this.data.title || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data.title,
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './detail.css';
|
||||
</style>
|
||||
12
pages/plugins/activity/index/index.css
Normal file
12
pages/plugins/activity/index/index.css
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
.data-list {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.data-list .item {
|
||||
width: calc(50% - 10rpx);
|
||||
}
|
||||
287
pages/plugins/activity/index/index.vue
Normal file
287
pages/plugins/activity/index/index.vue
Normal file
@@ -0,0 +1,287 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 轮播 -->
|
||||
<view v-if="slider_list.length > 0" class="padding-horizontal-main padding-top-main">
|
||||
<component-banner :propData="slider_list" propSize="mini"></component-banner>
|
||||
</view>
|
||||
|
||||
<!-- 分类 -->
|
||||
<scroll-view v-if="(activity_category || null) != null && activity_category.length > 0" class="scroll-view-horizontal bg-white oh" scroll-x="true">
|
||||
<view :class="'item cr-grey dis-inline-block padding-horizontal-main padding-top-main padding-bottom-sm ' + (nav_active_value == 0 ? 'cr-main nav-active-line bg-main-befor fw-b' : '')" @tap="nav_event" data-value="0">{{$t('common.all')}}</view>
|
||||
<block v-for="(item, index) in activity_category" :key="index">
|
||||
<view :class="'item cr-grey dis-inline-block padding-horizontal-main padding-top-main padding-bottom-sm ' + (nav_active_value == item.id ? 'cr-main nav-active-line bg-main-befor fw-b' : '')" @tap="nav_event" :data-value="item.id">{{ item.name }}</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" @scrolltolower="scroll_lower" lower-threshold="30" :style="slider_list.length > 0 ? 'height:calc(100vh - 320rpx);' : ''">
|
||||
<view v-if="(data_list || null) != null && data_list.length > 0" class="data-list padding-horizontal-main padding-top-main oh">
|
||||
<block v-for="(item, index) in data_list" :key="index">
|
||||
<view :data-value="'/pages/plugins/activity/detail/detail?id=' + item.id" @tap="url_event" class="item oh cp spacing-mb">
|
||||
<image :src="item.cover" mode="widthFix" class="wh-auto border-radius-main"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></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 componentBanner from '@/components/slider/slider';
|
||||
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_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,
|
||||
slider_list: [],
|
||||
activity_category: [],
|
||||
nav_active_value: 0,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentBanner,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_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: {
|
||||
// 初始化
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index', 'activity'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
slider_list: data.slider_list || [],
|
||||
activity_category: data.activity_category || [],
|
||||
});
|
||||
|
||||
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/activity/index/index',
|
||||
},
|
||||
});
|
||||
|
||||
// 标题
|
||||
if ((this.data_base.application_name || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data_base.application_name,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 获取列表数据
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
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'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
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,
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('datalist', 'index', 'activity'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
category_id: this.nav_active_value || 0,
|
||||
},
|
||||
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,
|
||||
});
|
||||
}
|
||||
}
|
||||
} 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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
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);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './index.css';
|
||||
</style>
|
||||
6
pages/plugins/allocation/cashier/cashier.css
Normal file
6
pages/plugins/allocation/cashier/cashier.css
Normal file
@@ -0,0 +1,6 @@
|
||||
.page {
|
||||
height: 100vh;
|
||||
}
|
||||
.page > .content {
|
||||
padding-top: 20%;
|
||||
}
|
||||
177
pages/plugins/allocation/cashier/cashier.vue
Normal file
177
pages/plugins/allocation/cashier/cashier.vue
Normal file
@@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="page bg-white">
|
||||
<view class="content padding-horizontal-main tc">
|
||||
<block v-if="data_list_loding_status == 3">
|
||||
<view class="padding-vertical-xxxxl">
|
||||
<text class="cr-price fw-b text-size-lg">{{payment_currency_symbol}}</text>
|
||||
<text class="cr-price fw-b text-size-xxl">{{data.pay_price}}</text>
|
||||
</view>
|
||||
<view class="margin-top-sm padding-bottom-xxxxl">
|
||||
<view :class="'cr-'+(pay_status == 1 ? 'green' : (pay_status == 2 ? 'red' : 'grey'))">{{pay_msg}}</view>
|
||||
</view>
|
||||
<view v-if="pay_status == 2" class="margin-top-xxxxl padding-vertical-xxxxl">
|
||||
<button class="bg-green br-green cr-white round text-size-sm padding-horizontal-xxxxl" size="mini" hover-class="none" @tap="pay_handle">重新发起支付</button>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<view v-if="is_back_btn && pay_status != 0" class="margin-top-xxxxl padding-top-xxxxl tc">
|
||||
<button class="bg-white br-main cr-main round text-size-sm padding-horizontal-xxxxl" size="mini" hover-class="none" open-type="launchApp" app-parameter="wechat">返回APP</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common" :propIsAppAdmin="false"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
payment_currency_symbol: app.globalData.currency_symbol(),
|
||||
params: {},
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
scene: 0,
|
||||
scene_back_arr: [1069, 1038, 1089, 1090, 1001, 1131, 1187],
|
||||
is_back_btn: false,
|
||||
data: {},
|
||||
pay_status: 0,
|
||||
pay_msg: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData
|
||||
},
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
params = app.globalData.launch_params_handle(params);
|
||||
var scene = app.globalData.get_scene_data();
|
||||
this.setData({
|
||||
params: params,
|
||||
scene: scene,
|
||||
is_back_btn: this.scene_back_arr.indexOf(scene) != -1,
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// // 初始化
|
||||
get_data() {
|
||||
var self = this;
|
||||
var action = 'login';
|
||||
// #ifdef MP-BAIDU
|
||||
action = 'getLoginCode';
|
||||
// #endif
|
||||
uni[action]({
|
||||
success: (res) => {
|
||||
if (res.code) {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("paydata", "cashier", "allocation"),
|
||||
method: 'POST',
|
||||
data: {...self.params, ...{authcode: res.code}},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0 && (res.data.data || null) != null) {
|
||||
this.setData({
|
||||
data_list_loding_status: 3,
|
||||
data_list_loding_msg: '',
|
||||
data: res.data.data,
|
||||
});
|
||||
|
||||
// 直接调起支付
|
||||
this.pay_handle();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: self.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (e) => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: self.$t('login.login.3nmrg2'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 支付处理
|
||||
pay_handle(e) {
|
||||
if(this.pay_status != 1)
|
||||
{
|
||||
this.setData({
|
||||
pay_status: 0,
|
||||
pay_msg: this.$t('common.payment_in_text'),
|
||||
});
|
||||
uni.requestPayment({
|
||||
timeStamp: this.data.pay_data.timeStamp,
|
||||
nonceStr: this.data.pay_data.nonceStr,
|
||||
package: this.data.pay_data.package,
|
||||
signType: this.data.pay_data.signType,
|
||||
paySign: this.data.pay_data.paySign,
|
||||
success: (res) => {
|
||||
this.setData({
|
||||
pay_status: 1,
|
||||
pay_msg: this.$t('paytips.paytips.679rxu'),
|
||||
});
|
||||
},
|
||||
fail: (res) => {
|
||||
this.setData({
|
||||
pay_status: 2,
|
||||
pay_msg: this.$t('paytips.paytips.6y488i'),
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './cashier.css';
|
||||
</style>
|
||||
19
pages/plugins/antifakecode/index/index.css
Normal file
19
pages/plugins/antifakecode/index/index.css
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* 基础
|
||||
*/
|
||||
.page-content {
|
||||
background: #fff;
|
||||
}
|
||||
.scan-button {
|
||||
background: linear-gradient( 270deg, #F1E6C1 0%, #DBC583 100%);
|
||||
max-width: 300rpx;
|
||||
}
|
||||
.scan-button text {
|
||||
color: #CC2121;
|
||||
}
|
||||
/**
|
||||
* 扫码按钮增加页面底部间距
|
||||
*/
|
||||
.page-bottom-fixed {
|
||||
padding-bottom: 100rpx !important;
|
||||
}
|
||||
151
pages/plugins/antifakecode/index/index.vue
Normal file
151
pages/plugins/antifakecode/index/index.vue
Normal file
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null" :class="'page-content min-ht '+((user == null || data.status == -10000) ? 'page-bottom-fixed' : '')">
|
||||
<block v-if="data.status == -10000">
|
||||
<!-- 顶部banner -->
|
||||
<image v-if="(data.data.scan_top_banner || null) != null" :src="data.data.scan_top_banner" mode="widthFix" class="dis-block wh-auto auto"></image>
|
||||
<!-- 底部图片 -->
|
||||
<image v-if="(data.data.scan_bottom_images || null) != null" :src="data.data.scan_bottom_images" mode="widthFix" class="dis-block wh-auto auto"></image>
|
||||
<!-- 扫码 -->
|
||||
<view class="pf left-0 bottom-xxxxl wh-auto tc padding-horizontal-main bs-bb">
|
||||
<view class="bottom-line-exclude">
|
||||
<button type="default" class="scan-button text-size-sm round" @tap="scan_event">
|
||||
<!-- #ifndef H5 -->
|
||||
<view class="va-m dis-inline-block margin-right-xs">
|
||||
<iconfont name="icon-scan" size="28rpx" propClass="lh-il va-m" color="#CC2121"></iconfont>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<text class="va-m">{{$t('common.scan_name')}}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 领取成功 -->
|
||||
<block v-if="data.status == 0">
|
||||
<image v-if="(data.data.scan_first_images || null) != null" :src="data.data.scan_first_images" mode="widthFix" class="dis-block wh-auto auto"></image>
|
||||
<view class="margin-vertical-xxxl tc">{{data.data.scan_first_tips}}</view>
|
||||
</block>
|
||||
<!-- 领取失败 -->
|
||||
<block v-else-if="data.status == -100">
|
||||
<image v-if="(data.data.scan_last_images || null) != null" :src="data.data.scan_last_images" mode="widthFix" class="dis-block wh-auto auto"></image>
|
||||
<view class="margin-vertical-xxxl tc">{{data.data.scan_last_tips}}</view>
|
||||
</block>
|
||||
<!-- 其他错误 -->
|
||||
<block v-else>
|
||||
<component-no-data propStatus="0" :propMsg="data.msg"></component-no-data>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
<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';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: null,
|
||||
data: null,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index', 'antifakecode'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
var data = res.data.data || null;
|
||||
this.setData({
|
||||
data: data,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 扫码事件
|
||||
scan_event() {
|
||||
var self = this;
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
if (res.result !== '') {
|
||||
var arr = ['/antifakecode-index-index-id-', 'plugins/index/pluginsname/antifakecode/pluginscontrol/index/pluginsaction/index/id/'];
|
||||
var ret = app.globalData.web_url_value_mate(res.result, arr);
|
||||
if (ret.status == 1 && ret.value != null) {
|
||||
var temp = self.params;
|
||||
temp['id'] = ret.value;
|
||||
self.setData({
|
||||
params: temp
|
||||
});
|
||||
self.get_data();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './index.css';
|
||||
</style>
|
||||
129
pages/plugins/ask/comments/comments.vue
Normal file
129
pages/plugins/ask/comments/comments.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null" class="padding-main bg-white">
|
||||
<!-- 评论内容 -->
|
||||
<component-ask-comments :propData="data" :propDataBase="data_base" :propEmojiList="emoji_list" propType="comments"></component-ask-comments>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</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';
|
||||
import componentAskComments from '../components/ask-comments/ask-comments';
|
||||
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,
|
||||
params: null,
|
||||
data_base: null,
|
||||
data: null,
|
||||
emoji_list: [],
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentAskComments,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
get_data() {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('commentsinfo', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: this.params.id || 0,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
var data = res.data.data;
|
||||
if (res.data.code == 0 && (data.data || null) != null) {
|
||||
var ask = data.data;
|
||||
this.setData({
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_status: 3,
|
||||
data_base: data.base || null,
|
||||
data: ask,
|
||||
emoji_list: data.emoji_list || [],
|
||||
});
|
||||
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data.seo_title || this.data.title,
|
||||
desc: this.data.seo_desc || this.data.describe,
|
||||
path: '/pages/plugins/ask/detail/detail',
|
||||
query: 'id=' + this.data.id,
|
||||
img: this.data.cover,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
579
pages/plugins/ask/components/ask-comments/ask-comments.vue
Normal file
579
pages/plugins/ask/components/ask-comments/ask-comments.vue
Normal file
@@ -0,0 +1,579 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null && (data_base || null) != null">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view v-if="(data_base.is_ask_comments_show || 0) == 1" class="fw-b">{{$t('user-order-detail.user-order-detail.423rmr')}}{{ data.comments_count || 0 }}{{$t('goods-list.goods-list.8y3cc7')}}</view>
|
||||
<!-- 点赞、评论、分享 -->
|
||||
<view v-if="propType == 'detail'" class="tr ask-comments-bottom-container cr-base">
|
||||
<view v-if="(data_base.is_ask_comments_show || 0) == 1" class="item dis-inline-block cr-base" :data-value="'/pages/plugins/ask/comments/comments?id=' + data.id" @tap="url_event">
|
||||
<iconfont name="icon-message-square" size="28rpx" propClass="pr top-sm margin-right-xs"></iconfont>
|
||||
<text class="text-size-xs">{{$t('ask-comments.ask-comments.2zlnb5')}}{{ data.comments_count }})</text>
|
||||
</view>
|
||||
<view v-if="(data_base.is_ask_give_thumbs || 0) == 1" :class="'item dis-inline-block cr-' + ((data.is_give_thumbs || 0) == 1 ? 'main' : 'base')" :data-askid="data.id" @tap="give_thumbs_event">
|
||||
<iconfont :name="(data.is_give_thumbs || 0) == 1 ? 'icon-givealike' : 'icon-givealike-o'" size="28rpx" propClass="pr top-sm margin-right-xs"></iconfont>
|
||||
<text class="va-m text-size-xs">{{$t('ask-comments.ask-comments.du7rcv')}}{{ data.give_thumbs_count }})</text>
|
||||
</view>
|
||||
<view class="item dis-inline-block cr-base" @tap="popup_share_event">
|
||||
<iconfont name="icon-share" size="28rpx" propClass="pr top-sm margin-right-xs"></iconfont>
|
||||
<text class="text-size-xs">{{$t('common.share')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 评论回复表单 -->
|
||||
<view v-if="(data_base.is_ask_comments_add || 0) == 1 && !input_comments_modal_status" class="padding-top-xxxl padding-bottom-xxl ask-comments-reply-container flex-row jc-sb spacing-mb">
|
||||
<image :src="avatar" mode="aspectFill" class="user-avatar fl circle"></image>
|
||||
<view class="right-base flex-1 flex-width">
|
||||
<view class="comments border-radius-main padding-main">
|
||||
<textarea :placeholder="$t('ask-comments.ask-comments.m67961')" placeholder-class="cr-base" class="textarea wh-auto bg-grey-f8" :value="input_comments_value" :maxlength="input_comments_length_max" @input="comments_input_event" @blur="comments_input_event"></textarea>
|
||||
<view class="oh flex-row jc-sb align-e">
|
||||
<image :src="common_static_url + 'emoji-icon.png'" mode="aspectFill" class="emoji-icon va-m" @tap="emoji_event"></image>
|
||||
<view class="flex-row align-e">
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<text class="text-size-xs cr-grey-d margin-right-sm">{{$t('login.login.n24i5u')}}{{ input_comments_length_value }}{{$t('ask-comments.ask-comments.6l6vz7')}}</text>
|
||||
<!-- #endif -->
|
||||
<button type="default" size="mini" class="comment-btn cr-white border-radius-sm text-size-md va-m" :class="input_comments_value.length > 0 ? 'bg-main br-main ' : 'comment-btn-default'" @tap="comments_event">{{$t('user-order.user-order.twc3r7')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 评论回复内容 -->
|
||||
<view v-if="(data_base.is_ask_comments_show || 0) == 1 && (data.comments_list || null) != null && data.comments_list.length > 0" class="ask-comments-list">
|
||||
<block v-for="(item, index) in data.comments_list" :key="index">
|
||||
<view class="item oh flex-row jc-sb">
|
||||
<image :src="item.user.avatar" mode="aspectFill" class="user-avatar circle fl"></image>
|
||||
<view class="right-content flex-1 flex-width" :class="data.comments_list.length > index + 1 ? 'br-b-e padding-bottom-main margin-bottom-main' : ''">
|
||||
<view class="comments-base oh">
|
||||
<text class="username fw-b">{{ item.user.user_name_view }}</text>
|
||||
<text class="cr-grey-9 margin-left-main">{{ item.add_time }}</text>
|
||||
</view>
|
||||
<view class="margin-top-sm comments-content">
|
||||
<mp-html :content="item.content" />
|
||||
</view>
|
||||
<view class="ask-comments-right-content-operate margin-top-main flex-row jc-e align-c text-size-xs cr-grey-9">
|
||||
<view v-if="(data_base.is_ask_comments_show || 0) == 1" class="item dis-inline-block" :data-index="index" :data-username="item.user.user_name_view" :data-askcommentsid="item.id" @tap="modal_open_event">
|
||||
<iconfont name="icon-message-square" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.3fcnme')}}{{ item.comments_count }})</text>
|
||||
</view>
|
||||
<view v-if="(data_base.is_ask_give_thumbs || 0) == 1" :class="'item dis-inline-block margin-left-xxxl padding-left-sm cr-' + ((item.is_give_thumbs || 0) == 1 ? 'main' : '')" data-type="1" :data-index="index" :data-askid="item.ask_id" :data-askcommentsid="item.id" @tap="give_thumbs_event">
|
||||
<iconfont :name="(item.is_give_thumbs || 0) == 1 ? 'icon-givealike' : 'icon-givealike-o'" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.du7rcv')}}{{ item.give_thumbs_count }})</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="(item.reply_comments_list || null) != null && item.reply_comments_list.length > 0" class="reply-ask-comments-list">
|
||||
<block v-for="(comments, index2) in item.reply_comments_list" :key="index2">
|
||||
<view class="bg-grey-e">
|
||||
<view class="item padding-main oh flex-row jc-sb">
|
||||
<image :src="comments.user.avatar" mode="aspectFill" class="user-avatar circle fl"></image>
|
||||
<view class="right-content flex-1 flex-width">
|
||||
<view class="comments-reply-base oh">
|
||||
<text class="username fw-b">{{ comments.user.user_name_view }}</text>
|
||||
<text class="cr-grey-9 margin-left-main">{{ comments.add_time }}</text>
|
||||
</view>
|
||||
<view v-if="(comments.reply_comments_text || null) != null" class="margin-top-sm reply-content">{{ comments.reply_comments_text }}</view>
|
||||
<view class="margin-top-sm">{{ comments.content }}</view>
|
||||
<view class="ask-comments-right-content-operate flex-row jc-e align-c text-size-xs cr-grey-9 padding-0">
|
||||
<view v-if="(data_base.is_ask_comments_show || 0) == 1" class="item dis-inline-block" :data-index="index" :data-username="comments.user.user_name_view" :data-askcommentsid="comments.ask_comments_id" :data-replycommentsid="comments.id" @tap="modal_open_event">
|
||||
<iconfont name="icon-message-square" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.3fcnme')}}{{ comments.comments_count }})</text>
|
||||
</view>
|
||||
<view v-if="(data_base.is_ask_give_thumbs || 0) == 1" :class="'item dis-inline-block margin-left-xxxl padding-left-sm cr-' + ((comments.is_give_thumbs || 0) == 1 ? 'main' : '')" data-type="2" :data-index="index" :data-indexs="index2" :data-askid="comments.ask_id" :data-askcommentsid="comments.id" :data-replycommentsid="comments.ask_comments_id" @tap="give_thumbs_event">
|
||||
<iconfont :name="(comments.is_give_thumbs || 0) == 1 ? 'icon-givealike' : 'icon-givealike-o'" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.du7rcv')}}{{ comments.give_thumbs_count }})</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-if="(item.comments_count || 0) > 0 && (item.is_comments_list_submit == undefined || item.is_comments_list_submit == 1)" class="margin-top-lg text-size-xs">
|
||||
<text :data-index="index" :data-askid="item.ask_id" :data-askcommentsid="item.id" @tap="comments_list_reply_event">
|
||||
<text v-if="item.is_comments_list_submit == undefined" class="cr-base">{{$t('goods-list.goods-list.278qr1')}}{{ item.comments_count }}{{$t('ask-comments.ask-comments.ymmd24')}}</text>
|
||||
<text v-else class="cr-base">{{$t('ask-comments.ask-comments.dfhg54')}}</text>
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" propClass="margin-left-xs pr top-xs"></iconfont>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="((data_base.ask_detail_comments_more_page_number || 0) == 0 && (data.comments_count || 0) > 20) || ((data_base.ask_detail_comments_more_page_number || 0) > 0 && data.comments_count > data_base.ask_detail_comments_more_page_number)">
|
||||
<view v-if="propType == 'detail'" class="margin-top-xxxl tc padding-vertical-main bg-grey-f8 border-radius-sm">
|
||||
<text :data-value="'/pages/plugins/ask/comments/comments?id=' + data.id" @tap="url_event">
|
||||
<text class="cr-base">{{$t('goods-list.goods-list.278qr1')}}{{ data.comments_count }}{{$t('ask-comments.ask-comments.5401r1')}}</text>
|
||||
<iconfont name="icon-arrow-right" size="24rpx" propClass="margin-left-xs pr top-xs"></iconfont>
|
||||
</text>
|
||||
</view>
|
||||
<view v-if="propType == 'comments' && (data.is_comments_list_submit == undefined || data.is_comments_list_submit == 1)" class="margin-top-xxxl tc padding-vertical-main bg-grey-f8 border-radius-sm">
|
||||
<text :data-askid="data.id" @tap="comments_list_reply_event">
|
||||
<text class="cr-base">{{$t('ask-comments.ask-comments.4l77wt')}}</text>
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" propClass="margin-left-xs pr top-xs"></iconfont>
|
||||
</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 回复弹窗 -->
|
||||
<view v-if="input_comments_modal_status" class="ask-comments-modal pf">
|
||||
<view class="ask-comments-modal-content bg-white border-radius-main pr">
|
||||
<view class="tc margin-bottom-lg">
|
||||
<text>{{$t('ask-comments.ask-comments.8sjar6')}}{{ input_comments_modal_username }}</text>
|
||||
<view class="close pa">
|
||||
<view @tap.stop="modal_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<textarea :placeholder="$t('ask-comments.ask-comments.m67961')" placeholder-class="cr-base" class="textarea wh-auto br padding-main" :value="input_comments_value" :maxlength="input_comments_length_max" @input="comments_input_event" @blur="comments_input_event"></textarea>
|
||||
<view class="margin-top-lg oh">
|
||||
<image :src="common_static_url + 'emoji-icon.png'" mode="aspectFill" class="emoji-icon va-m" @tap="emoji_event"></image>
|
||||
<view class="fr">
|
||||
<text class="va-m text-size-xs cr-base margin-right-lg">{{$t('login.login.n24i5u')}}{{ input_comments_length_value }}{{$t('ask-comments.ask-comments.6l6vz7')}}</text>
|
||||
<button type="default" size="mini" class="comment-btn cr-white border-radius-sm text-size-xs va-m" :class="input_comments_value.length > 0 ? 'bg-main br-main ' : 'comment-btn-default'" @tap="comments_event">{{$t('user-order.user-order.twc3r7')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 表情弹窗 -->
|
||||
<component-emoji-popup ref="emoji" v-on:choiceConfirmEvent="emoji_choice_confirm_event"></component-emoji-popup>
|
||||
|
||||
<!-- 分享弹窗 -->
|
||||
<component-share-popup ref="share"></component-share-popup>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentSharePopup from '@/components/share-popup/share-popup';
|
||||
import componentEmojiPopup from '@/components/emoji-popup/emoji-popup';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
common_static_url: common_static_url,
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
user: null,
|
||||
data_base: null,
|
||||
data: null,
|
||||
emoji_list: [],
|
||||
input_comments_value: '',
|
||||
input_comments_cursor: 0,
|
||||
input_comments_length_value: 500,
|
||||
input_comments_length_max: 500,
|
||||
input_comments_modal_status: false,
|
||||
input_comments_modal_index: 0,
|
||||
input_comments_modal_username: '',
|
||||
input_comments_modal_ask_comments_id: 0,
|
||||
input_comments_modal_reply_comments_id: 0,
|
||||
};
|
||||
},
|
||||
props: {
|
||||
propType: {
|
||||
type: String,
|
||||
default: 'detail',
|
||||
},
|
||||
propData: {
|
||||
type: [Object, null],
|
||||
default: null,
|
||||
},
|
||||
propDataBase: {
|
||||
type: [Object, null],
|
||||
default: null,
|
||||
},
|
||||
propEmojiList: {
|
||||
type: [Array, null],
|
||||
default: [],
|
||||
},
|
||||
propShareInfo: {
|
||||
type: [Object, null],
|
||||
default: {},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
componentPopup,
|
||||
componentSharePopup,
|
||||
componentEmojiPopup,
|
||||
},
|
||||
|
||||
// 页面被展示
|
||||
created: function (e) {
|
||||
var avatar = app.globalData.data.default_user_head_src;
|
||||
var user = app.globalData.get_user_cache_info() || null;
|
||||
this.setData({
|
||||
user: user,
|
||||
avatar: user == null ? avatar : user.avatar || avatar,
|
||||
data: this.propData,
|
||||
data_base: this.propDataBase,
|
||||
emoji_list: this.propEmojiList,
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 分享开启弹层
|
||||
popup_share_event(e) {
|
||||
if ((this.$refs.share || null) != null) {
|
||||
this.$refs.share.init({
|
||||
share_info: this.propShareInfo
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 评论弹窗关闭
|
||||
modal_close_event(e) {
|
||||
this.setData({
|
||||
input_comments_modal_status: false,
|
||||
input_comments_modal_index: 0,
|
||||
input_comments_modal_username: '',
|
||||
input_comments_modal_ask_comments_id: 0,
|
||||
input_comments_modal_reply_comments_id: 0,
|
||||
input_comments_value: '',
|
||||
});
|
||||
},
|
||||
|
||||
// 评论弹窗开启
|
||||
modal_open_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this, 'modal_open_event', e);
|
||||
if (user != false) {
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var username = e.currentTarget.dataset.username;
|
||||
var ask_comments_id = e.currentTarget.dataset.askcommentsid || 0;
|
||||
var reply_comments_id = e.currentTarget.dataset.replycommentsid || 0;
|
||||
this.setData({
|
||||
input_comments_modal_status: true,
|
||||
input_comments_value: '',
|
||||
input_comments_modal_index: index,
|
||||
input_comments_modal_username: username,
|
||||
input_comments_modal_ask_comments_id: ask_comments_id,
|
||||
input_comments_modal_reply_comments_id: reply_comments_id,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 表情选择事件
|
||||
emoji_event() {
|
||||
if (this.input_comments_length_value == 0) {
|
||||
app.globalData.showToast(this.$t('ask-comments.ask-comments.3o1rq6'));
|
||||
return false;
|
||||
}
|
||||
if ((this.$refs.emoji || null) != null) {
|
||||
this.$refs.emoji.init({ emoji_list: this.emoji_list });
|
||||
}
|
||||
},
|
||||
|
||||
// 评论输入和失去焦点事件
|
||||
comments_input_event(e) {
|
||||
var value = e.detail.value.trim();
|
||||
var length = this.input_comments_length_max - value.length;
|
||||
this.setData({
|
||||
input_comments_cursor: e.detail.cursor || 0,
|
||||
input_comments_value: value,
|
||||
input_comments_length_value: length <= 0 ? 0 : length,
|
||||
});
|
||||
},
|
||||
|
||||
// 表情选择确认事件
|
||||
emoji_choice_confirm_event(emoji) {
|
||||
var value = this.input_comments_value;
|
||||
var cursor = parseInt(this.input_comments_cursor || 0);
|
||||
if (value != '') {
|
||||
if (cursor == 0) {
|
||||
value = emoji + value;
|
||||
} else {
|
||||
var first = value.substr(0, cursor);
|
||||
var last = value.substr(cursor, value.length);
|
||||
value = first + emoji + last;
|
||||
}
|
||||
} else {
|
||||
value = emoji;
|
||||
}
|
||||
var length = this.input_comments_length_max - value.length;
|
||||
this.setData({
|
||||
input_comments_value: value,
|
||||
input_comments_length_value: length <= 0 ? 0 : length,
|
||||
});
|
||||
},
|
||||
|
||||
// 获取评论列表
|
||||
comments_list_reply_event(e) {
|
||||
var temp_data = this.data;
|
||||
var page = 1;
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var ask_id = e.currentTarget.dataset.askid;
|
||||
var ask_comments_id = e.currentTarget.dataset.askcommentsid || 0;
|
||||
if (ask_comments_id == 0) {
|
||||
if ((temp_data['page'] || null) == null) {
|
||||
temp_data['page'] = 1;
|
||||
} else {
|
||||
temp_data['page'] += 1;
|
||||
}
|
||||
page = temp_data['page'];
|
||||
} else {
|
||||
if ((temp_data['comments_list'][index]['page'] || null) == null) {
|
||||
temp_data['comments_list'][index]['page'] = 1;
|
||||
} else {
|
||||
temp_data['comments_list'][index]['page'] += 1;
|
||||
}
|
||||
page = temp_data['comments_list'][index]['page'];
|
||||
}
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('commentsreplylist', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
ask_id: ask_id,
|
||||
ask_comments_id: ask_comments_id,
|
||||
page: page,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
if (ask_comments_id == 0) {
|
||||
var temp_list = temp_data['comments_list'] || [];
|
||||
} else {
|
||||
var temp_list = temp_data['comments_list'][index]['reply_comments_list'] || [];
|
||||
}
|
||||
var data = res.data.data.data;
|
||||
for (var i in data) {
|
||||
temp_list.push(data[i]);
|
||||
}
|
||||
if (ask_comments_id == 0) {
|
||||
temp_data['comments_list'] = temp_list;
|
||||
temp_data['is_comments_list_submit'] = res.data.data.page >= res.data.data.page_total ? 0 : 1;
|
||||
} else {
|
||||
temp_data['comments_list'][index]['reply_comments_list'] = temp_list;
|
||||
temp_data['comments_list'][index]['is_comments_list_submit'] = res.data.data.page >= res.data.data.page_total ? 0 : 1;
|
||||
}
|
||||
this.setData({ data: temp_data });
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 评论
|
||||
comments_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this, 'comments_event', e);
|
||||
if (user != false) {
|
||||
if (this.input_comments_value == '') {
|
||||
app.globalData.showToast(this.$t('user-order-comments.user-order-comments.8f303u'));
|
||||
return false;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: this.$t('buy.buy.r79t77'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('comments', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
ask_id: this.data.id,
|
||||
content: this.input_comments_value,
|
||||
ask_comments_id: this.input_comments_modal_ask_comments_id,
|
||||
reply_comments_id: this.input_comments_modal_reply_comments_id,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var temp_data = this.data;
|
||||
if ((this.input_comments_modal_ask_comments_id || 0) == 0) {
|
||||
var temp_list = temp_data.comments_list || [];
|
||||
temp_list.splice(0, 0, res.data.data);
|
||||
temp_data['comments_list'] = temp_list;
|
||||
temp_data['comments_count'] = parseInt(temp_data['comments_count']) + 1;
|
||||
} else {
|
||||
var index = this.input_comments_modal_index;
|
||||
var temp_list = temp_data.comments_list[index]['reply_comments_list'] || [];
|
||||
temp_list.splice(0, 0, res.data.data);
|
||||
if ((this.input_comments_modal_reply_comments_id || 0) != 0) {
|
||||
for (var i in temp_list) {
|
||||
if (temp_list[i]['id'] == this.input_comments_modal_reply_comments_id) {
|
||||
temp_list[i]['comments_count'] = parseInt(temp_list[i]['comments_count']) + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
temp_data.comments_list[index]['reply_comments_list'] = temp_list;
|
||||
temp_data.comments_list[index]['comments_count'] = parseInt(temp_data.comments_list[index]['comments_count']) + 1;
|
||||
}
|
||||
this.setData({
|
||||
data: temp_data,
|
||||
input_comments_value: '',
|
||||
input_comments_length_value: this.input_comments_length_max,
|
||||
input_comments_modal_status: false,
|
||||
input_comments_modal_index: 0,
|
||||
input_comments_modal_username: '',
|
||||
input_comments_modal_ask_comments_id: 0,
|
||||
input_comments_modal_reply_comments_id: 0,
|
||||
});
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 点赞
|
||||
give_thumbs_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this, 'give_thumbs_event', e);
|
||||
if (user != false) {
|
||||
var type = parseInt(e.currentTarget.dataset.type || 0);
|
||||
var ask_id = e.currentTarget.dataset.askid;
|
||||
var ask_comments_id = e.currentTarget.dataset.askcommentsid || 0;
|
||||
var reply_comments_id = e.currentTarget.dataset.replycommentsid || 0;
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('givethumbs', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
ask_id: ask_id,
|
||||
ask_comments_id: ask_comments_id,
|
||||
reply_comments_id: reply_comments_id,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var temp_data = this.data;
|
||||
switch (type) {
|
||||
// 博客
|
||||
case 0:
|
||||
temp_data.is_give_thumbs = data.is_active;
|
||||
temp_data.give_thumbs_count = data.count;
|
||||
break;
|
||||
// 博客评论
|
||||
case 1:
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
temp_data['comments_list'][index]['is_give_thumbs'] = data.is_active;
|
||||
temp_data['comments_list'][index]['give_thumbs_count'] = data.count;
|
||||
break;
|
||||
// 博客评论回复
|
||||
case 2:
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var indexs = parseInt(e.currentTarget.dataset.indexs || 0);
|
||||
temp_data['comments_list'][index]['reply_comments_list'][indexs]['is_give_thumbs'] = data.is_active;
|
||||
temp_data['comments_list'][index]['reply_comments_list'][indexs]['give_thumbs_count'] = data.count;
|
||||
break;
|
||||
}
|
||||
this.setData({ data: temp_data });
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/**
|
||||
* 聚合点赞、评论、分享
|
||||
*/
|
||||
.ask-comments-bottom-container .item:not(:last-child) {
|
||||
margin-right: 64rpx;
|
||||
}
|
||||
.ask-comments-reply-container .emoji-icon,
|
||||
.ask-comments-modal .emoji-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx !important;
|
||||
}
|
||||
.ask-comments-reply-container .user-avatar {
|
||||
width: 72rpx;
|
||||
height: 72rpx !important;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.ask-comments-reply-container .right-base {
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
.ask-comments-reply-container .right-base .comments {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
.ask-comments-reply-container .right-base .textarea {
|
||||
height: 120rpx;
|
||||
}
|
||||
.ask-comments-modal {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: calc(100% - 80rpx);
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
padding: 40rpx;
|
||||
z-index: 10;
|
||||
}
|
||||
.ask-comments-modal-content {
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
margin: 0 auto;
|
||||
margin-top: 30%;
|
||||
max-width: calc(800px - 180rpx);
|
||||
}
|
||||
.ask-comments-modal-content .textarea {
|
||||
height: 200rpx;
|
||||
}
|
||||
.ask-comments-modal-content .close {
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
.comment-btn {
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
.comment-btn-default {
|
||||
border: 2rpx solid #d8dadc;
|
||||
background-color: #d8dadc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论列表
|
||||
*/
|
||||
.ask-comments-list > .item .user-avatar {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.ask-comments-list .comments-base,
|
||||
.ask-comments-list .comments-content {
|
||||
padding-left: 16rpx;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
.reply-ask-comments-list {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
.reply-ask-comments-list .right-content {
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
</style>
|
||||
46
pages/plugins/ask/detail/detail.css
Normal file
46
pages/plugins/ask/detail/detail.css
Normal file
@@ -0,0 +1,46 @@
|
||||
.admin-img {
|
||||
width: 68rpx;
|
||||
height: 68rpx !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品链接
|
||||
*/
|
||||
.goods-link .img {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.goods-link .title {
|
||||
min-height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 猜你喜欢
|
||||
*/
|
||||
.guess-like {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.guess-like::before,
|
||||
.guess-like::after {
|
||||
content: "";
|
||||
width: 76px;
|
||||
height: 1px;
|
||||
background: #dddddd;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.guess-like::before {
|
||||
left: calc(100% + 20rpx);
|
||||
}
|
||||
|
||||
.guess-like::after {
|
||||
right: calc(100% + 20rpx);
|
||||
}
|
||||
244
pages/plugins/ask/detail/detail.vue
Normal file
244
pages/plugins/ask/detail/detail.vue
Normal file
@@ -0,0 +1,244 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(info || null) !== null" :class="(data_base.is_user_add_ask || 0) == 1 ? 'page-bottom-fixed' : ''">
|
||||
<!-- true为空对象 false为非空对象 Object.keys(info).length == 0 -->
|
||||
<view class="ask-container bg-white spacing-mb">
|
||||
<view class="padding-main">
|
||||
<view v-if="(info.title || null) != null" class="fw-b text-size-xl spacing-mb">{{ info.title }}</view>
|
||||
<view class="cr-grey-9 text-size-xs margin-bottom-sm flex-row">
|
||||
{{ $t('detail.detail.kt41ki') }}{{ info.add_time_date }}
|
||||
<view class="fw-b padding-horizontal-xs">·</view>
|
||||
{{ info.access_count || '0' }}{{ $t('detail.detail.e6ga1y') }}
|
||||
</view>
|
||||
<view v-if="info.title != info.content">
|
||||
<mp-html :content="info.content" />
|
||||
</view>
|
||||
<block v-if="(info.goods || null) !== null">
|
||||
<view :data-value="info.goods.goods_url" @tap="url_event" class="cp">
|
||||
<view class="goods-link spacing-mt bg-grey-f9 padding-main border-radius-sm">
|
||||
<view class="flex-row jc-sb">
|
||||
<view class="img border-radius-sm oh margin-right-main">
|
||||
<image :src="info.goods.images" mode="widthFix" class="wh-auto"></image>
|
||||
</view>
|
||||
<view class="flex-1 flex-width flex-row jc-sb align-c">
|
||||
<view class="flex-1 flex-width padding-right-sm">
|
||||
<view class="title multi-text">{{ info.goods.title }}</view>
|
||||
<view class="flex-row align-c margin-top-xs">
|
||||
<text class="cr-red fw-b margin-right-main">{{ currency_symbol }}{{ info.goods.price }}</text>
|
||||
<text class="text-size-xs cr-grey-9 original-price">{{ currency_symbol }}{{ info.goods.original_price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<iconfont name="icon-arrow-right" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-if="info.is_reply && info.is_reply === '1'" class="padding-main br-t-dashed">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="flex-row align-c">
|
||||
<image v-if="(logo_square || null) != null" :src="logo_square" mode="widthFix" class="admin-img circle br-f5 margin-right-sm"></image>
|
||||
<text>{{ $t('detail.detail.ng628i') }}</text>
|
||||
</view>
|
||||
<view v-if="(info.reply_time_date || null) != null" class="cr-grey-9 text-size-xs">{{ $t('detail.detail.7rg4bb') }}{{ info.reply_time_date }}</view>
|
||||
</view>
|
||||
<view class="padding-top-main">
|
||||
<mp-html :content="info.reply" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-main br-t-dashed">
|
||||
<!-- 评论内容 -->
|
||||
<component-ask-comments :propData="info" :propDataBase="data_base" :propEmojiList="emoji_list" :propShareInfo="share_info"></component-ask-comments>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 猜你喜欢 -->
|
||||
<view v-if="goods_list.length > 0" class="padding-horizontal-main padding-top-sm">
|
||||
<view class="tc spacing-mb">
|
||||
<view class="guess-like fw-b text-size-md">{{ $t('goods-detail.goods-detail.v2974w') }}</view>
|
||||
</view>
|
||||
<component-goods-list :propData="{ style_type: 1, goods_list: goods_list, random: random_value }" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" propSource="detail" @CartSuccessEvent="cart_success_event"></component-goods-list>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-if="(data_base.is_user_add_ask || 0) == 1" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<view class="item flex-row jc-sa align-c text-size fw-b br bg-white round padding-vertical">
|
||||
<view data-value="/pages/plugins/ask/form/form" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="divider-r-d wh-auto"> <iconfont name="icon-edit-below-line" size="30rpx" color="#333" propClass="margin-right-sm"></iconfont>{{ $t('goods-detail.goods-detail.7ulh8b') }}</view>
|
||||
</view>
|
||||
<view data-value="/pages/plugins/ask/user-list/user-list" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="wh-auto"> <iconfont name="icon-list-dot" size="32rpx" color="#333" propClass="margin-right-sm pr top-xs"></iconfont>{{ $t('detail.detail.p7o522') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<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 componentGoodsList from '@/components/goods-list/goods-list';
|
||||
import componentAskComments from '../components/ask-comments/ask-comments';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
logo_square: app.globalData.get_application_logo_square(),
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: true,
|
||||
bottom_fixed_style: '',
|
||||
info: null,
|
||||
data_base: null,
|
||||
emoji_list: [],
|
||||
// 基础配置
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
// 猜你喜欢 参数
|
||||
goods_list: [],
|
||||
goods_is_loading: 0,
|
||||
goods_total: 0,
|
||||
goods_page_total: 0,
|
||||
goods_page: 1,
|
||||
// 标签插件
|
||||
plugins_label_data: null,
|
||||
// 增加随机数,避免无法监听数据列表内部数据更新
|
||||
random_value: 0,
|
||||
params: '',
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentGoodsList,
|
||||
componentAskComments,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
get_data(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.goods_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 是否加载中
|
||||
if (this.goods_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
goods_is_loading: 1,
|
||||
});
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
let data = res.data.data;
|
||||
var info = data.data || null;
|
||||
this.setData({
|
||||
info: info,
|
||||
data_base: data.base || null,
|
||||
emoji_list: data.emoji_list || [],
|
||||
goods_list: data.goods,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
goods_is_loading: 0,
|
||||
});
|
||||
|
||||
if (info != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: info.title,
|
||||
desc: info.content,
|
||||
path: '/pages/plugins/ask/detail/detail',
|
||||
query: 'id=' + info.id,
|
||||
},
|
||||
});
|
||||
|
||||
// 标题
|
||||
uni.setNavigationBarTitle({ title: info.title || info.content });
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_msg: res.data.msg,
|
||||
data_list_loding_status: 0,
|
||||
goods_is_loading: 0,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
data_list_loding_status: 2,
|
||||
goods_is_loading: 0,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 猜你喜欢加入购物车回调
|
||||
cart_success_event() {
|
||||
// 传1表示为购物车回调方法调用的此方法
|
||||
this.get_data(1);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './detail.css';
|
||||
</style>
|
||||
3
pages/plugins/ask/form/form.css
Normal file
3
pages/plugins/ask/form/form.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.form-container .form-gorup .textarea-height {
|
||||
min-height: 200rpx !important;
|
||||
}
|
||||
318
pages/plugins/ask/form/form.vue
Normal file
318
pages/plugins/ask/form/form.vue
Normal file
@@ -0,0 +1,318 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<form v-if="data_list_loding_status == 3" @submit="formSubmit" class="form-container">
|
||||
<view class="padding-main oh page-bottom-fixed">
|
||||
<view class="form-gorup border-radius-main oh flex-row jc-sb align-c margin-bottom-main">
|
||||
<view class=""> 标题 <text class="form-group-tips-must">*</text></view>
|
||||
<view class="flex-row align-c flex-1 flex-width">
|
||||
<input type="text" name="title" :value="data.title" maxlength="16" placeholder-class="cr-grey-9 tr" class="cr-base tr" placeholder="请输入标题" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-gorup border-radius-main margin-bottom-main">
|
||||
<view class="margin-bottom-sm">提问内容 <text class="form-group-tips-must">*</text></view>
|
||||
<sp-editor @init="initEditor" @input="rich_text_event" @upinImage="up_in_image_event"></sp-editor>
|
||||
</view>
|
||||
<view class="form-gorup border-radius-main oh flex-row jc-sb align-c margin-bottom-main">
|
||||
<view class=""> 提问分类 </view>
|
||||
<view class="flex-row jc-e align-c flex-1 flex-width">
|
||||
<picker @change="select_change_event" :value="category_id_index" :range="ask_category_list" range-key="name" name="category_id" data-field="category_id" class="margin-right-sm wh-auto tr">
|
||||
<view class="uni-input cr-base picker">
|
||||
<template v-if="category_id_index !== -1">
|
||||
{{ ask_category_list[category_id_index].name || '' }}
|
||||
</template>
|
||||
</view>
|
||||
</picker>
|
||||
<iconfont name="icon-arrow-right" size="34rpx" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="is_show_email_notice == 1" class="form-gorup border-radius-main oh flex-row jc-sb align-c margin-bottom-main">
|
||||
<view class=""> 回复邮件通知 </view>
|
||||
<view class="flex-row align-c flex-1 flex-width">
|
||||
<input type="text" name="email_notice" :value="data.email_notice" placeholder-class="cr-grey-9 tr" class="cr-base tr" placeholder="请输入邮件" />
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="is_show_mobile_notice == 1" class="form-gorup border-radius-main oh flex-row jc-sb align-c margin-bottom-main">
|
||||
<view class="form-gorup-title"> 回复手机通知 </view>
|
||||
<view class="flex-row align-c flex-1 flex-width">
|
||||
<input type="text" name="mobile_notice" :value="data.mobile_notice" maxlength="16" placeholder-class="cr-grey-9 tr" class="cr-base tr" placeholder="请输入手机号" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- 匿名发布 -->
|
||||
<!-- <view class="form-gorup border-radius-main oh flex-row jc-e align-c">
|
||||
<checkbox-group @change="is_anonymous_change_event">
|
||||
<label class="cr-grey-9">
|
||||
<checkbox value="1" :checked="false" :color="theme_color" style="transform: scale(0.7)" />
|
||||
<text class="pr top-xs">{{ $t('form.form.2f52v3') }}</text>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view> -->
|
||||
<view class="bottom-fixed">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="bg-main br-main cr-white round text-size" type="default" form-type="submit" hover-class="none" :loading="form_submit_loading" :disabled="form_submit_loading">{{ $t('form.form.4yd066') }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</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 componentUpload from '@/components/upload/upload';
|
||||
const theme_color = app.globalData.get_theme_color();
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
theme_color: theme_color,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: this.$t('form.form.bniyyt'),
|
||||
params: {},
|
||||
form_submit_loading: false,
|
||||
is_anonymous: '0',
|
||||
editor_path_type: '',
|
||||
|
||||
data: {},
|
||||
ask_category_list: [],
|
||||
is_show_email_notice: 0,
|
||||
is_show_mobile_notice: 0,
|
||||
category_id_index: -1,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentUpload,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: 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();
|
||||
},
|
||||
|
||||
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: 2,
|
||||
data_list_loding_msg: this.$t('form.form.8l3ul5'),
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取初始化信息
|
||||
get_data_list() {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
// 网络请求
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('saveinfo', 'ask', 'ask'),
|
||||
method: 'POST',
|
||||
data: { id: this.params.id || null },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
var data = res.data.data;
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_status: 3,
|
||||
data: data.data || {},
|
||||
ask_category_list: data.ask_category_list || [],
|
||||
editor_path_type: data.editor_path_type,
|
||||
is_show_email_notice: data.is_show_email_notice,
|
||||
is_show_mobile_notice: data.is_show_mobile_notice,
|
||||
category_id_index: (data.ask_category_list || []).length > 0 && data.data != null ? data.ask_category_list.findIndex((item) => item.id === data.data.category_id) : -1,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 表单提交
|
||||
formSubmit(e) {
|
||||
// 数据验证
|
||||
var validation = [
|
||||
{ fields: 'content', msg: this.$t('form.form.5v5bjs') },
|
||||
{ fields: 'title', msg: this.$t('form.form.5v5bjs') },
|
||||
];
|
||||
const new_data = {
|
||||
goods_id: this.params.goods_id || 0,
|
||||
id: this.params.id || null,
|
||||
...e.detail.value,
|
||||
content: this.data.content,
|
||||
category_id: this.data.category_id,
|
||||
};
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('buy.buy.r79t77'),
|
||||
});
|
||||
this.setData({
|
||||
form_submit_loading: true,
|
||||
});
|
||||
// 网络请求
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('save', 'ask', 'ask'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/ask/user-list/user-list', true);
|
||||
}, 2000);
|
||||
} else {
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
});
|
||||
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();
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// // 匿名发布
|
||||
// is_anonymous_change_event(e) {
|
||||
// this.setData({
|
||||
// is_anonymous: e.detail.value.length > 0 ? e.detail.value[0] : 0,
|
||||
// });
|
||||
// },
|
||||
|
||||
initEditor(editor) {
|
||||
// 初始化编辑器内容
|
||||
editor.setContents({
|
||||
html: (this.data || null) !== null ? this.data.content : '',
|
||||
});
|
||||
},
|
||||
|
||||
// 回调富文本内容
|
||||
rich_text_event(e) {
|
||||
var new_data = this.data;
|
||||
new_data.content = e.html;
|
||||
this.setData({
|
||||
data: new_data,
|
||||
});
|
||||
},
|
||||
|
||||
// 上传图片
|
||||
up_in_image_event(tempFiles, editorCtx) {
|
||||
var self = this;
|
||||
// 使用 uniCloud.uploadFile 上传图片的示例方法(可适用多选上传)
|
||||
tempFiles.forEach(async (item) => {
|
||||
uni.showLoading({
|
||||
title: self.$t('form.form.2e5rv3'),
|
||||
mask: true,
|
||||
});
|
||||
await uni.uploadFile({
|
||||
url: app.globalData.get_request_url('index', 'ueditor'),
|
||||
// #ifdef APP-PLUS || H5
|
||||
filePath: item.path,
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
filePath: item.tempFilePath,
|
||||
// #endif
|
||||
name: 'upfile',
|
||||
formData: {
|
||||
action: 'uploadimage',
|
||||
path_type: this.editor_path_type, // 路径类型,默认common
|
||||
},
|
||||
success: function (res) {
|
||||
let data = JSON.parse(res.data);
|
||||
if (res.statusCode == 200) {
|
||||
// 上传完成后处理
|
||||
editorCtx.insertImage({
|
||||
src: data.data.url, // 此处需要将图片地址切换成服务器返回的真实图片地址
|
||||
// width: '50%',
|
||||
alt: self.$t('common.video'),
|
||||
success: function (e) {},
|
||||
});
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
fail: function (e) {
|
||||
app.globalData.showToast(e.errMsg);
|
||||
uni.hideLoading();
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 分类选择事件
|
||||
select_change_event(e) {
|
||||
var temp = this.data;
|
||||
const category_id = this.ask_category_list[e.detail.value].id;
|
||||
temp[e.currentTarget.dataset.field] = category_id;
|
||||
this.setData({
|
||||
data: temp,
|
||||
category_id_index: e.detail.value,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './form.css';
|
||||
</style>
|
||||
23
pages/plugins/ask/goods-list/goods-list.css
Normal file
23
pages/plugins/ask/goods-list/goods-list.css
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
.question .title{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
background: #fd9525;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
.question .avatar,
|
||||
.ask .avatar {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 4rpx;
|
||||
background: #F5F5F5;
|
||||
}
|
||||
.ask .title{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
background: #99BB12;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
332
pages/plugins/ask/goods-list/goods-list.vue
Normal file
332
pages/plugins/ask/goods-list/goods-list.vue
Normal file
@@ -0,0 +1,332 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="data_list.length > 0">
|
||||
<scroll-view :scroll-y="true" class="scroll-box padding-main bs-bb" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="bg-white border-radius-main padding-main oh" :class="data_list.length > index + 1 ? 'spacing-mb' : ''">
|
||||
<view class="title flex-row jc-sb align-c wh-auto">
|
||||
<view class="name flex-1 flex-width cr-base">{{ item.name }}{{$t('goods-list.goods-list.27nkjm')}}</view>
|
||||
<view class="date cr-grey-9">{{ item.add_time_date }}</view>
|
||||
</view>
|
||||
<view class="question spacing-mt">
|
||||
<view :data-value="item.url" @tap="url_event" class="flex-row cp">
|
||||
<view class="title cr-white tc margin-right-sm">{{$t('goods-list.goods-list.00n7i3')}}</view>
|
||||
<view class="flex-1 flex-width">
|
||||
<mp-html :content="item.content" />
|
||||
<view v-if="(item.images || null) != null && item.images.length > 0" class="avatar spacing-mt-10 radius margin-right-sm oh">
|
||||
<image v-for="(img, i) in item.images" class="wh-auto" @tap="comment_images_show_event" :data-index="i" :data-ix="i + 1" :src="img" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="item.is_reply == 1 || (item.reply || null) != null">
|
||||
<view class="ask flex-row spacing-mt">
|
||||
<view class="title cr-white tc margin-right-sm">{{$t('goods-list.goods-list.rw12i7')}}</view>
|
||||
<view class="flex-1 flex-width">
|
||||
<view class="padding-bottom-main">
|
||||
<mp-html :content="item.reply" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="item.bool_more && (item.comments_list || null) != null && item.comments_list.length > 0">
|
||||
<block v-for="(it, ix) in item.comments_list" :key="ix">
|
||||
<view class="cr-base br-t-f9 padding-vertical-main">{{ it.content }}</view>
|
||||
<view v-if="(it.images || null) != null && it.images.length > 0" class="avatar spacing-mt-10 radius margin-right-sm oh">
|
||||
<block v-for="(img, i) in it.images">
|
||||
<image class="wh-auto" @tap="comment_images_show_event" :data-index="i" :data-ix="i + 1" :src="img" mode="aspectFit"></image>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<view v-if="item.comments_count > 0" class="more flex-row jc-e align-c br-t-f9 padding-top-main">
|
||||
<view v-if="(item.hide_more || false) === false && ((item.hide_comments_list_num === 0 && !item.bool_more) || (item.hide_comments_list_num == undefined || item.hide_comments_list_num > 0))" class="cr-red text-size-xs" @tap="open_more(item.id, index)">
|
||||
<text v-if="item.hide_comments_list_num === 0 && !item.bool_more">{{$t('common.view_more')}}</text>
|
||||
<text v-if="item.hide_comments_list_num == undefined || item.hide_comments_list_num > 0">{{$t('goods-list.goods-list.278qr1')}}{{ item.hide_comments_list_num || item.comments_count }}{{$t('goods-list.goods-list.8y3cc7')}}</text>
|
||||
<iconfont :name="item.bool_more ? 'icon-arrow-bottom' : 'icon-arrow-top'" size="24rpx" propClass="pr top-xs"></iconfont>
|
||||
</view>
|
||||
<view v-if="item.bool_more" class="cr-red text-size-xs margin-left-main" @tap="close_more(index)">
|
||||
<text>{{$t('goods-list.goods-list.aem3e6')}}</text>
|
||||
<iconfont name="icon-arrow-top" size="24rpx" propClass="pr top-xs"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></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';
|
||||
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: {},
|
||||
};
|
||||
},
|
||||
|
||||
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();
|
||||
|
||||
// 公共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('datalist', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
goods_id: this.params.goods_id || 0,
|
||||
is_comments: 1,
|
||||
},
|
||||
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();
|
||||
},
|
||||
|
||||
// 评价图片预览
|
||||
comment_images_show_event(e) {
|
||||
var index = e.currentTarget.dataset.index;
|
||||
var ix = e.currentTarget.dataset.ix;
|
||||
uni.previewImage({
|
||||
current: this.data_list[index]['images'][ix],
|
||||
urls: this.data_list[index]['images'],
|
||||
});
|
||||
},
|
||||
|
||||
// 查看更多
|
||||
open_more(id, i) {
|
||||
var new_data_list = this.data_list;
|
||||
new_data_list[i].bool_more = true;
|
||||
if (new_data_list[i].bool_api === undefined || new_data_list[i].bool_api === true) {
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('commentsreplylist', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
ask_id: id,
|
||||
ask_comments_id: 0,
|
||||
page: new_data_list[i].page || 1,
|
||||
is_comments: 1,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.data.length > 0) {
|
||||
if ((new_data_list[i].page || 1) <= 1) {
|
||||
new_data_list[i].comments_list = res.data.data.data;
|
||||
} else {
|
||||
new_data_list[i].comments_list = new_data_list[i].comments_list.concat(res.data.data.data);
|
||||
}
|
||||
new_data_list[i].hide_comments_list_num = res.data.data.total-new_data_list[i].comments_list.length;
|
||||
// 判断当前页数是否小于总页数,如果是则继续显示更多按钮,且当前页+1,如果不是则隐藏更多按钮
|
||||
if (res.data.data.page < res.data.data.page_total) {
|
||||
new_data_list[i].hide_more = false;
|
||||
new_data_list[i].page = (new_data_list[i].page || 1) + 1;
|
||||
} else {
|
||||
new_data_list[i].hide_more = true;
|
||||
}
|
||||
new_data_list[i].page_total = res.data.data.page_total;
|
||||
new_data_list[i].bool_api = true;
|
||||
this.setData({
|
||||
data_list: new_data_list,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
} else {
|
||||
// 查看更多是否调用接口
|
||||
new_data_list[i].bool_api = true;
|
||||
// 是否隐藏更多查看按钮
|
||||
new_data_list[i].hide_more = !((new_data_list[i].hide_comments_list_num == undefined && new_data_list[i].comments_count > 0) || new_data_list[i].hide_comments_list_num < new_data_list[i].comments_count);
|
||||
this.setData({
|
||||
data_list: new_data_list,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 收起更多
|
||||
close_more(i) {
|
||||
var new_data_list = this.data_list;
|
||||
// 查看更多是否调用接口
|
||||
new_data_list[i].bool_api = false;
|
||||
// 是否隐藏更多查看按钮
|
||||
new_data_list[i].hide_more = false;
|
||||
// 是否展示更多内容
|
||||
new_data_list[i].bool_more = false;
|
||||
this.setData({
|
||||
data_list: new_data_list,
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './goods-list.css';
|
||||
</style>
|
||||
38
pages/plugins/ask/index/index.css
Normal file
38
pages/plugins/ask/index/index.css
Normal file
@@ -0,0 +1,38 @@
|
||||
.scroll-box {
|
||||
height: calc(100vh - 40px);
|
||||
}
|
||||
|
||||
.status .ask-status {
|
||||
padding: 4rpx 10rpx;
|
||||
}
|
||||
|
||||
.ask-bg-green {
|
||||
background-color: #5FB95E;
|
||||
}
|
||||
|
||||
.ask-bg-yellow {
|
||||
background-color: #FAAD14;
|
||||
}
|
||||
|
||||
.status .num {
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
.ask-hot {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
line-height: 32rpx;
|
||||
color: #FFB868;
|
||||
}
|
||||
|
||||
.hot-bg-0 {
|
||||
background: linear-gradient(150deg, #FC6761 0%, #ED4540 100%);
|
||||
}
|
||||
|
||||
.hot-bg-1 {
|
||||
background: linear-gradient(150deg, #FFA12A 0%, #FF8605 100%);
|
||||
}
|
||||
|
||||
.hot-bg-2 {
|
||||
background: linear-gradient(150deg, #FFCE90 0%, #FFAA4E 100%);
|
||||
}
|
||||
324
pages/plugins/ask/index/index.vue
Normal file
324
pages/plugins/ask/index/index.vue
Normal file
@@ -0,0 +1,324 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back :propFixed="false" propClass="bg-white cr-black" propColor="#333" :style="'padding-top:' + (status_bar_height + 5) + 'px;'">
|
||||
<template slot="right" :class="is_mp_env ? 'top-search-width' : ''">
|
||||
<view class="margin-left-main" :class="is_mp_env ? '' : 'flex-1 flex-width'">
|
||||
<component-search @onsearch="search_button_event" propIsOnEvent :propIsRequired="false" propIconColor="#ccc" propPlaceholderClass="cr-grey-c" propBgColor="#f6f6f6"></component-search>
|
||||
</view>
|
||||
</template>
|
||||
</component-nav-back>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60" :style="'height: calc(100vh - '+(40+status_bar_height)+'px)'">
|
||||
<view class="wh-auto">
|
||||
<!-- 轮播 -->
|
||||
<view v-if="slider_list.length > 0" class="padding-horizontal-main spacing-mb padding-top-main">
|
||||
<component-banner :propData="slider_list"></component-banner>
|
||||
</view>
|
||||
<!-- tab -->
|
||||
<view v-if="nav_list.length > 0" class="ask-tab flex-row jc-sa align-c bg-white wh-auto left-0 top-0 ps z-i padding-bottom-sm">
|
||||
<view v-for="(item, index) in nav_list" :key="index" class="flex-1 padding-vertical-sm tc" :class="nav_index === index ? 'cr-main fw-b nav-active-line' : 'cr-base'" :data-index="index" :data-type="item.type" @tap="nav_change_event">{{ item.name }}</view>
|
||||
</view>
|
||||
<!-- 内容列表 -->
|
||||
<view :class="(data_base.is_user_add_ask || 0) == 1 ? 'page-bottom-fixed' : ''">
|
||||
<view v-if="data_list.length > 0" class="padding-horizontal-main padding-top-main">
|
||||
<block v-for="(item, index) in data_list" :key="index">
|
||||
<view :data-value="'/pages/plugins/ask/detail/detail?id=' + item.id" @tap="url_event" class="padding-main border-radius-main bg-white oh cp spacing-mb flex-row">
|
||||
<view v-if="nav_index === 1">
|
||||
<view class="ask-hot border-radius-sm tc margin-right-sm va-m pr top-md" :class="index < 3 ? 'cr-white text-size-xs hot-bg-' + index : 'text-size-md'">{{ index + 1 }}</view>
|
||||
</view>
|
||||
<view class="flex-1 flex-width">
|
||||
<view class="title text-size fw-b">{{ item.title }}</view>
|
||||
<view v-if="item.title != item.content" class="content cr-base margin-top-sm padding-top-xs multi-text">
|
||||
<mp-html :content="item.content" />
|
||||
</view>
|
||||
<view class="status flex-row align-c spacing-mt text-size-xs">
|
||||
<view v-if="nav_index !== 1" class="ask-status cr-white border-radius-sm text-size-xss" :class="item.is_reply === '1' ? 'ask-bg-green' : 'ask-bg-yellow'">{{ item.is_reply === '1' ? $t('index.index.1c17n3') : $t('index.index.75l3l2') }}</view>
|
||||
<view class="num cr-grey-9 flex-row self-c">
|
||||
{{ item.add_time_date }}
|
||||
<view class="fw-b padding-horizontal-xs">·</view>
|
||||
{{ item.access_count || '0' }}{{ $t('detail.detail.e6ga1y') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg" :propLoadingLogoTop="slider_list.length > 0 ? '80%' : '50%'"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view v-if="(data_base.is_user_add_ask || 0) == 1" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<view class="item flex-row jc-sa align-c text-size fw-b br bg-white round padding-vertical">
|
||||
<view data-value="/pages/plugins/ask/form/form" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="divider-r-d wh-auto"> <iconfont name="icon-edit-below-line" size="30rpx" color="#333" propClass="margin-right-sm"></iconfont>{{ $t('goods-detail.goods-detail.7ulh8b') }}</view>
|
||||
</view>
|
||||
<view data-value="/pages/plugins/ask/user-list/user-list" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="wh-auto"> <iconfont name="icon-list-dot" size="32rpx" color="#333" propClass="margin-right-sm pr top-xs"></iconfont>{{ $t('detail.detail.p7o522') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNavBack from '@/components/nav-back/nav-back';
|
||||
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';
|
||||
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
status_bar_height: bar_height,
|
||||
is_mp_env: false,
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-ALIPAY || MP-QQ || MP-KUAISHOU
|
||||
is_mp_env: true,
|
||||
// #endif
|
||||
bottom_fixed_style: '',
|
||||
data_base: {},
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
// 轮播
|
||||
slider_list: [],
|
||||
// 导航分类
|
||||
nav_list: [],
|
||||
nav_index: 0,
|
||||
nav_type: '',
|
||||
// 搜索框关键字
|
||||
search_bwg: '',
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentSearch,
|
||||
componentBanner
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 加载数据
|
||||
this.get_data();
|
||||
|
||||
// 公共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: {
|
||||
get_data() {
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.search_tab_list.length > 0) {
|
||||
var data_base = res.data.data.base || {};
|
||||
this.setData({
|
||||
data_base: data_base,
|
||||
slider_list: res.data.data.slider_list || [],
|
||||
nav_list: res.data.data.search_tab_list || [],
|
||||
// 基础自定义分享
|
||||
share_info: {
|
||||
title: data_base.seo_title || data_base.application_name || this.$t('goods-detail.goods-detail.k5u755'),
|
||||
desc: data_base.seo_desc || '',
|
||||
path: '/pages/plugins/ask/index/index',
|
||||
},
|
||||
});
|
||||
|
||||
// 拉取列表数据
|
||||
this.get_data_list();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('index.index.17vy72'),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: 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;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('datalist', 'index', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
type: this.nav_type,
|
||||
bwd: this.search_bwg,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 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: temp_data_list.length > 0 ? 3 : 0,
|
||||
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: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
data_is_loading: 0,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 查询
|
||||
search_button_event(e) {
|
||||
this.setData({
|
||||
search_bwg: e || '',
|
||||
data_page: 1,
|
||||
data_list: []
|
||||
});
|
||||
this.reset_scroll();
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 重置滑动位置
|
||||
reset_scroll() {
|
||||
this.setData({
|
||||
scroll_top: this.scroll_top_old,
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
this.setData({
|
||||
scroll_top: 0,
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
nav_change_event(e) {
|
||||
// 索引值
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var type = e.currentTarget.dataset.type || 0;
|
||||
this.setData({
|
||||
data_list: [],
|
||||
nav_index: index,
|
||||
nav_type: type,
|
||||
data_page: 1,
|
||||
});
|
||||
this.reset_scroll();
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './index.css';
|
||||
</style>
|
||||
146
pages/plugins/ask/user-detail/user-detail.vue
Normal file
146
pages/plugins/ask/user-detail/user-detail.vue
Normal file
@@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="data_list_loding_status != 1 && data.length != 0">
|
||||
<component-panel-content :propData="data" :propDataField="field_list" propExcludeField="content" propTitle="详情"></component-panel-content>
|
||||
|
||||
<component-panel-content propTitle="提问内容">
|
||||
<view class="item br-b-f5 oh padding-vertical-main">
|
||||
<mp-html :content="data.content"></mp-html>
|
||||
</view>
|
||||
</component-panel-content>
|
||||
|
||||
<component-panel-content propTitle="回复内容">
|
||||
<view class="item br-b-f5 oh padding-vertical-main">
|
||||
<mp-html :content="data.reply"></mp-html>
|
||||
</view>
|
||||
</component-panel-content>
|
||||
</block>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPanelContent from '@/components/panel-content/panel-content';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
ask_static_url: app.globalData.get_static_url('ask', true),
|
||||
data: {},
|
||||
field_list: [],
|
||||
data_list_loding_status: 1,
|
||||
params: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentPanelContent,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
if (params) {
|
||||
this.setData({
|
||||
params: 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.init();
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
get_data() {
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'ask', 'ask'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data: res.data.data.data || [],
|
||||
field_list: res.data.data.field_list || [],
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
|
||||
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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 顶部返回操作
|
||||
top_nav_left_back_event(e) {
|
||||
app.globalData.page_back_prev_event();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
onPageScroll(res) {
|
||||
uni.$emit('onPageScroll', res);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
3
pages/plugins/ask/user-list/user-list.css
Normal file
3
pages/plugins/ask/user-list/user-list.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.ask-status {
|
||||
padding: 4rpx 10rpx;
|
||||
}
|
||||
237
pages/plugins/ask/user-list/user-list.vue
Normal file
237
pages/plugins/ask/user-list/user-list.vue
Normal file
@@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="page-bottom-fixed">
|
||||
<view v-if="data_list.length > 0" class="padding-main">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="item padding-main border-radius-main oh bg-white spacing-mb">
|
||||
<view class="base oh br-b-dashed padding-bottom-main flex-row jc-sb align-c">
|
||||
<text class="cr-grey-9">{{ item.add_time_time }}</text>
|
||||
<text class="ask-status margin-left-xs" :class="item.is_reply == 1 ? 'cr-green' : 'cr-grey-c'">{{ item.is_reply_name }}</text>
|
||||
</view>
|
||||
<view :data-value="'/pages/plugins/ask/user-detail/user-detail?id=' + item.id" @tap="url_event" class="content margin-top-main cp">
|
||||
<component-panel-content :propData="item" :propDataField="field_list" :propIsItemShowMax="4" propExcludeField="add_time_time,is_reply" :propIsTerse="true"></component-panel-content>
|
||||
</view>
|
||||
<view class="item-operation tr margin-top-main">
|
||||
<button class="btn round br-grey-9 bg-white text-size-md" type="default" size="mini" @tap="delete_event" :data-value="item.id" hover-class="none">{{ $t('common.del') }}</button>
|
||||
<button v-if="item.is_reply == 0" class="btn round cr-main br-main bg-white text-size-md" type="default" size="mini" :data-value="'/pages/plugins/ask/form/form?id=' + item.id" @tap="url_event" hover-class="none">{{ $t('common.edit') }}</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>
|
||||
|
||||
<view class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item bg-white br-main cr-main round text-size" type="default" data-value="/pages/plugins/ask/form/form" @tap="url_event" hover-class="none">{{ $t('goods-detail.goods-detail.7ulh8b') }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</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';
|
||||
import componentPanelContent from '@/components/panel-content/panel-content';
|
||||
|
||||
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,
|
||||
bottom_fixed_style: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentPanelContent,
|
||||
},
|
||||
|
||||
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', 'ask', 'ask'),
|
||||
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 (this.data_page <= 1) {
|
||||
var temp_data_list = res.data.data.data_list;
|
||||
} 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,
|
||||
field_list: res.data.data.field_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,
|
||||
});
|
||||
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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 删除留言
|
||||
delete_event(e) {
|
||||
const value = e.currentTarget.dataset.value;
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('delete', 'ask', 'ask'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
ids: value,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
} 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: () => {
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './user-list.css';
|
||||
</style>
|
||||
87
pages/plugins/binding/detail/detail.css
Normal file
87
pages/plugins/binding/detail/detail.css
Normal file
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
.data-list .item .goods-img {
|
||||
width: 160rpx;
|
||||
height: 160rpx !important;
|
||||
}
|
||||
|
||||
.data-list .item .binding-check {
|
||||
width: 40rpx;
|
||||
}
|
||||
|
||||
.data-list .item .spec-choice {
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
padding: 0 34rpx 0 20rpx;
|
||||
}
|
||||
|
||||
.data-list .item .cart-badge-icon {
|
||||
top: -16rpx;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.lose-efficacy {
|
||||
z-index: 1;
|
||||
background: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
.lose-efficacy .rotate {
|
||||
width: 130rpx;
|
||||
transform: rotate(-30deg);
|
||||
}
|
||||
|
||||
.lose-efficacy .rotate-img {
|
||||
width: 100%;
|
||||
transform: rotate(30deg);
|
||||
}
|
||||
|
||||
.lose-efficacy .rotate-text {
|
||||
margin-left: 18rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航
|
||||
*/
|
||||
.bottom-fixed .left-price {
|
||||
width: calc(100% - 270rpx);
|
||||
}
|
||||
|
||||
.bottom-fixed .right-button {
|
||||
width: 240rpx;
|
||||
}
|
||||
|
||||
.bottom-fixed .right-button .btn {
|
||||
height: 80rpx;
|
||||
line-height: 78rpx;
|
||||
}
|
||||
|
||||
.bottom-fixed .left-price .discount-icon {
|
||||
border-top-right-radius: 30rpx;
|
||||
border-bottom-left-radius: 30rpx;
|
||||
background-image: linear-gradient(45deg, #a3f9a3, #248828, #8bc34a, #d2374c, #9c27b0);
|
||||
background-size: 400%;
|
||||
animation: gradient 5s ease infinite;
|
||||
padding: 0 16rpx;
|
||||
}
|
||||
|
||||
.sales-price .price {
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
@keyframes gradient {
|
||||
0% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
|
||||
50% {
|
||||
background-position: 100% 50%;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
}
|
||||
415
pages/plugins/binding/detail/detail.vue
Normal file
415
pages/plugins/binding/detail/detail.vue
Normal file
@@ -0,0 +1,415 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null" class="page-bottom-fixed">
|
||||
<view class="padding-horizontal-main padding-top-main">
|
||||
<!-- 基础信息 -->
|
||||
<view class="base-container oh spacing-mb">
|
||||
<view class="title-left-border text-size fw-b">{{ data.title }}</view>
|
||||
</view>
|
||||
<view v-if="(data.goods || null) != null && data.goods.length > 0">
|
||||
<!-- 商品 -->
|
||||
<view class="data-list oh">
|
||||
<view v-for="(item, index) in data.goods" :key="index" class="item padding-main border-radius-main bg-white oh spacing-mb flex-row pr">
|
||||
<image class="goods-img dis-block border-radius-main" :src="item.images" mode="aspectFit" :data-value="item.goods_url" @tap="url_event"></image>
|
||||
<view class="right-base flex-1 flex-width padding-left-main">
|
||||
<view class="flex-row jc-c">
|
||||
<view :class="'multi-text flex-1 flex-width ' + (data.type == 1 ? 'padding-right' : '')">{{ item.title }}</view>
|
||||
<label v-if="data.type == 1 && item.is_error == 0" class="tr binding-check pr bottom-sm" :data-index="index" @tap="goods_choice_event">
|
||||
<radio :checked="item.checked == undefined || item.checked == true" :color="theme_color" style="transform: scale(0.7)" />
|
||||
</label>
|
||||
</view>
|
||||
<view class="single-text margin-top-sm flex-row align-c">
|
||||
<view v-if="(item.show_field_price_status || 0) == 1" class="margin-right-lg">
|
||||
<text class="sales-price va-m">
|
||||
<text class="text-size-xs">{{ item.show_price_symbol }}</text>
|
||||
<text class="text-size-lg fw-b">{{ item.price }}</text>
|
||||
</text>
|
||||
<text class="cr-grey text-size-xs va-m">{{ item.show_price_unit }}</text>
|
||||
</view>
|
||||
<view v-if="(item.discount_price || 0) != 0" class="cr-green text-size-xs">{{$t('detail.detail.6026t4')}}<text class="text-size-xs">{{ currency_symbol }}</text>
|
||||
{{ item.discount_price }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-xs">
|
||||
<view v-if="item.is_error == 0" class="flex-row jc-sb align-c">
|
||||
<view class="flex-row align-c">
|
||||
<view class="margin-right-sm pr" :data-index="index" @tap="goods_cart_event">
|
||||
<iconfont name="icon-cart-add" size="42rpx" color="#E22C08"></iconfont>
|
||||
<view class="cart-badge-icon pa">
|
||||
<component-badge :propNumber="item.user_cart_count || 0"></component-badge>
|
||||
</view>
|
||||
</view>
|
||||
<text class="cr-grey-9 text-size-xs">{{ item.inventory }}{{ item.inventory_unit }}</text>
|
||||
</view>
|
||||
<view v-if="(item.is_exist_many_spec || 0) == 1" class="bg-grey-e cr-grey round single-text text-size-xss spec-choice" :data-index="index" @tap="spec_choice_event">
|
||||
{{ item.spec_choice_text || $t('detail.detail.9624hp') }}
|
||||
<iconfont name="icon-arrow-bottom" size="14rpx" color="#666" class="pa"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="cr-grey-9 text-size-xs">{{ item.error_msg }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.is_error !== 0" class="pa left-0 right-0 top-0 bottom-0 lose-efficacy flex-row jc-c align-c">
|
||||
<view class="rotate pr">
|
||||
<image :src="binding_static_url + 'lapse-icon.png'" mode="widthFix" class="dis-block rotate-img"></image>
|
||||
<text class="rotate-text pa cr-red text-size">{{$t('detail.detail.32171c')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 导航 -->
|
||||
<view class="bottom-fixed br-top-shadow pr bg-white bt">
|
||||
<view class="bottom-line-exclude oh flex-row jc-sb align-c">
|
||||
<view class="left-price">
|
||||
<view class="sales-price single-text">
|
||||
<text class="text-size-xs">
|
||||
{{ currency_symbol }}
|
||||
</text>
|
||||
<text class="price">
|
||||
{{ data.estimate_price }}
|
||||
</text>
|
||||
</view>
|
||||
<view v-if="data.estimate_discount_price != 0" class="single-text estimate-discount-price margin-top-sm">
|
||||
<text class="discount-icon cr-white text-size-xs">{{$t('detail.detail.6026t4')}}</text>
|
||||
<text class="cr-green text-size-md">
|
||||
<text class="text-size-xss">
|
||||
{{ currency_symbol }}
|
||||
</text>
|
||||
{{ data.estimate_discount_price }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-button">
|
||||
<button type="default" size="mini" class="btn bg-main br-main cr-white round text-size fw-b wh-auto" @tap="buy_event">{{$t('detail.detail.27pmj3')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0" :propMsg="$t('detail.detail.5knxg6')"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 规格选择 -->
|
||||
<component-goods-spec-choice ref="goods_spec_choice" v-on:specConfirmEvent="spec_confirm_event"></component-goods-spec-choice>
|
||||
|
||||
<!-- 商品购买 -->
|
||||
<component-goods-buy ref="goods_buy" :propCurrencySymbol="currency_symbol" v-on:CartSuccessEvent="goods_cart_back_event"></component-goods-buy>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import base64 from '@/common/js/lib/base64.js';
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
import componentGoodsSpecChoice from '@/components/goods-spec-choice/goods-spec-choice';
|
||||
import componentGoodsBuy from '@/components/goods-buy/goods-buy';
|
||||
import componentBadge from '@/components/badge/badge';
|
||||
let binding_static_url = app.globalData.get_static_url('binding', true);
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
binding_static_url: binding_static_url,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
params: null,
|
||||
user: null,
|
||||
data_base: null,
|
||||
data: null,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
theme_color: app.globalData.get_theme_color(),
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentGoodsSpecChoice,
|
||||
componentGoodsBuy,
|
||||
componentBadge
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if ((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.globalData.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'index', 'binding'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: this.params.id || 0,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
data: data.data || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: (data.data || null) != null && (data.data.goods || null) != null && data.data.goods.length > 0,
|
||||
});
|
||||
|
||||
if ((this.data || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data.seo_title || this.data.title,
|
||||
desc: this.data.seo_desc || this.data.describe,
|
||||
path: '/pages/plugins/binding/detail/detail',
|
||||
query: 'id=' + this.data.id,
|
||||
img: this.data.share_images || this.data.images,
|
||||
},
|
||||
});
|
||||
|
||||
// 标题
|
||||
if ((this.data.title || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data.title,
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 商品选择事件
|
||||
goods_choice_event(e) {
|
||||
// 选择处理
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var temp_data = this.data;
|
||||
var goods = temp_data.goods;
|
||||
goods[index]['checked'] = goods[index]['checked'] == undefined || goods[index]['checked'] == true ? false : true;
|
||||
temp_data['goods'] = goods;
|
||||
|
||||
// 已选商品
|
||||
var min_price = 0;
|
||||
var max_price = 0;
|
||||
var min_discount_price = 0;
|
||||
var max_discount_price = 0;
|
||||
for (var i in goods) {
|
||||
if ((goods[i]['checked'] == undefined || goods[i]['checked'] == true) && goods[i]['is_error'] == 0) {
|
||||
min_price += parseFloat(goods[i]['min_price'] || 0);
|
||||
max_price += parseFloat(goods[i]['max_price'] || 0);
|
||||
var discount_price = goods[i]['discount_price'] || null;
|
||||
if (discount_price != null) {
|
||||
if (discount_price.indexOf('-') == -1) {
|
||||
min_discount_price += parseFloat(discount_price);
|
||||
max_discount_price += parseFloat(discount_price);
|
||||
} else {
|
||||
var temp = discount_price.split('-');
|
||||
min_discount_price += parseFloat(temp[0]);
|
||||
max_discount_price += parseFloat(temp[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 价格
|
||||
if (min_price == max_price) {
|
||||
var price = app.globalData.price_two_decimal(min_price);
|
||||
} else {
|
||||
var price = app.globalData.price_two_decimal(min_price) + '-' + app.globalData.price_two_decimal(max_price);
|
||||
}
|
||||
|
||||
// 节省
|
||||
if (min_discount_price == max_discount_price) {
|
||||
var discount_price = app.globalData.price_two_decimal(min_discount_price);
|
||||
} else {
|
||||
var discount_price = app.globalData.price_two_decimal(min_discount_price) + '-' + app.globalData.price_two_decimal(max_discount_price);
|
||||
}
|
||||
|
||||
// 购买价格
|
||||
temp_data['estimate_price'] = price;
|
||||
// 节省价格
|
||||
temp_data['estimate_discount_price'] = discount_price;
|
||||
this.setData({ data: temp_data });
|
||||
},
|
||||
|
||||
// 规格选择
|
||||
spec_choice_event(e) {
|
||||
if ((this.$refs.goods_spec_choice || null) != null) {
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var goods = this.data['goods'][index];
|
||||
this.$refs.goods_spec_choice.init(goods.id, goods['specifications']['choose'], goods.buy_min_number, index);
|
||||
}
|
||||
},
|
||||
|
||||
// 规格确认回调事件
|
||||
spec_confirm_event(value) {
|
||||
var temp_data = this.data;
|
||||
temp_data['goods'][value.out_value]['spec_choice_data'] = value.spec;
|
||||
temp_data['goods'][value.out_value]['spec_choice_text'] = value.spec
|
||||
.map(function (v) {
|
||||
return v.value;
|
||||
})
|
||||
.join(' / ');
|
||||
this.setData({ data: temp_data });
|
||||
},
|
||||
|
||||
// 立即购买
|
||||
buy_event(e) {
|
||||
// 是否需要选择商品
|
||||
var type = parseInt(this.data.type || 0);
|
||||
var goods_data = [];
|
||||
var temp_goods = this.data.goods;
|
||||
for (var i in temp_goods) {
|
||||
if (temp_goods[i]['is_error'] == 0) {
|
||||
var goods_id = null;
|
||||
if (type == 1) {
|
||||
if (temp_goods[i]['checked'] == undefined || temp_goods[i]['checked'] == true) {
|
||||
goods_id = temp_goods[i]['id'];
|
||||
}
|
||||
} else {
|
||||
goods_id = temp_goods[i]['id'];
|
||||
}
|
||||
if (goods_id !== null) {
|
||||
// 是否存在多规格
|
||||
if ((temp_goods[i]['is_exist_many_spec'] || 0) == 1 && (temp_goods[i]['spec_choice_data'] || null) == null) {
|
||||
app.globalData.showToast(this.$t('detail.detail.8618mj') + (parseInt(i) + 1) + this.$t('detail.detail.09e3bx'));
|
||||
return false;
|
||||
}
|
||||
goods_data.push({
|
||||
goods_id: goods_id,
|
||||
stock: temp_goods[i]['buy_min_number'] || 1,
|
||||
spec: temp_goods[i]['spec_choice_data'] || '',
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// 组合搭配则每一个商品都需要正确状态
|
||||
if (type == 0) {
|
||||
app.globalData.showToast(this.$t('detail.detail.40298g') + (parseInt(i) + 1) + this.$t('detail.detail.5kbjoy'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
var buy_min_number = parseInt(this.data.buy_min_number || 1);
|
||||
if (goods_data.length < buy_min_number) {
|
||||
app.globalData.showToast(this.$t('detail.detail.jsj3u8') + buy_min_number + this.$t('detail.detail.jksm81'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// 进入订单确认页面
|
||||
var data = {
|
||||
binding_id: this.data.id,
|
||||
buy_type: 'goods',
|
||||
goods_data: encodeURIComponent(base64.encode(JSON.stringify(goods_data))),
|
||||
};
|
||||
app.globalData.url_open('/pages/buy/buy?data=' + encodeURIComponent(base64.encode(JSON.stringify(data))));
|
||||
},
|
||||
|
||||
// 加入购物车
|
||||
goods_cart_event(e) {
|
||||
if ((this.$refs.goods_buy || null) != null) {
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var goods = this.data['goods'][index];
|
||||
this.$refs.goods_buy.init(goods, { buy_event_type: 'cart', is_direct_cart: 1 }, { index: index });
|
||||
}
|
||||
},
|
||||
|
||||
// 加入购物车成功回调
|
||||
goods_cart_back_event(e) {
|
||||
// 增加数量
|
||||
var back = e.back_data;
|
||||
var temp = this.data;
|
||||
var goods = temp['goods'][back.index];
|
||||
goods['user_cart_count'] = parseInt(goods['user_cart_count'] || 0) + parseInt(e.stock);
|
||||
if (goods['user_cart_count'] > 99) {
|
||||
goods['user_cart_count'] = '99+';
|
||||
}
|
||||
temp['goods'][back.index] = goods;
|
||||
this.setData({ data: temp });
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './detail.css';
|
||||
</style>
|
||||
7
pages/plugins/binding/index/index.css
Normal file
7
pages/plugins/binding/index/index.css
Normal file
@@ -0,0 +1,7 @@
|
||||
.page {
|
||||
padding-bottom: 100rpx;
|
||||
}
|
||||
|
||||
.back-icon {
|
||||
top: -6rpx;
|
||||
}
|
||||
284
pages/plugins/binding/index/index.vue
Normal file
284
pages/plugins/binding/index/index.vue
Normal file
@@ -0,0 +1,284 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 列表 -->
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view :class="'padding-main ' + ((shop || null) != null ? 'page-bottom-fixed' : '')">
|
||||
<block v-if="(data_list || null) != null && data_list.length > 0">
|
||||
<!-- 组合搭配组件 -->
|
||||
<component-binding-list :propConfig="data_base" :propData="{data: data_list}" :propCurrencySymbol="currency_symbol"></component-binding-list>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
|
||||
<!-- 回到店铺 -->
|
||||
<view v-if="(shop || null) != null" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item bg-white cr-main br-main round dis-block text-size" type="default" hover-class="none" @tap="shop_event" :data-value="shop.url">{{$t('index.index.i78v36')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</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';
|
||||
import componentBindingList from '@/components/binding-list/binding-list';
|
||||
|
||||
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,
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
bottom_fixed_style: '',
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
params: null,
|
||||
data_base: null,
|
||||
shop: null,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentBindingList,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_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({
|
||||
currency_symbol: app.globalData.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index', 'binding'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
shop: data.shop || null,
|
||||
});
|
||||
|
||||
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/binding/index/index',
|
||||
},
|
||||
});
|
||||
|
||||
// 导航名称
|
||||
if ((this.data_base.application_name || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data_base.application_name,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 获取列表数据
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
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'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
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 });
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('datalist', 'index', 'binding'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
shop_id: this.params.shop_id || 0,
|
||||
},
|
||||
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,
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
data_is_loading: 0,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 店铺事件
|
||||
shop_event(e) {
|
||||
var prev_url = app.globalData.prev_page();
|
||||
if (prev_url != null && prev_url.indexOf('pages/plugins/shop/detail/detail') != -1) {
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './index.css';
|
||||
</style>
|
||||
129
pages/plugins/blog/comments/comments.vue
Normal file
129
pages/plugins/blog/comments/comments.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null" class="padding-main bg-white">
|
||||
<!-- 评论内容 -->
|
||||
<component-blog-comments :propData="data" :propDataBase="data_base" :propEmojiList="emoji_list" propType="comments"></component-blog-comments>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</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';
|
||||
import componentBlogComments from '../components/blog-comments/blog-comments';
|
||||
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,
|
||||
params: null,
|
||||
data_base: null,
|
||||
data: null,
|
||||
emoji_list: [],
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentBlogComments,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
get_data() {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('commentsinfo', 'index', 'blog'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: this.params.id || 0,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
var data = res.data.data;
|
||||
if (res.data.code == 0 && (data.data || null) != null) {
|
||||
var blog = data.data;
|
||||
this.setData({
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_status: 3,
|
||||
data_base: data.base || null,
|
||||
data: blog,
|
||||
emoji_list: data.emoji_list || [],
|
||||
});
|
||||
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data.seo_title || this.data.title,
|
||||
desc: this.data.seo_desc || this.data.describe,
|
||||
path: '/pages/plugins/blog/detail/detail',
|
||||
query: 'id=' + this.data.id,
|
||||
img: this.data.cover,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
587
pages/plugins/blog/components/blog-comments/blog-comments.vue
Normal file
587
pages/plugins/blog/components/blog-comments/blog-comments.vue
Normal file
@@ -0,0 +1,587 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null && (data_base || null) != null">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view v-if="(data_base.is_blog_comments_show || 0) == 1" class="fw-b">{{$t('user-order.user-order.twc3r7')}}{{ data.comments_count || '' }}</view>
|
||||
<!-- 点赞、评论、分享 -->
|
||||
<view v-if="propType == 'detail'" class="tr blog-comments-bottom-container cr-grey">
|
||||
<view v-if="(data_base.is_blog_comments_show || 0) == 1" class="item dis-inline-block cr-base" :data-value="'/pages/plugins/blog/comments/comments?id=' + data.id" @tap="url_event">
|
||||
<iconfont name="icon-message-square" size="28rpx" propClass="pr top-sm margin-right-xs"></iconfont>
|
||||
<text class="text-size-xs">{{$t('ask-comments.ask-comments.2zlnb5')}}{{ data.comments_count }})</text>
|
||||
</view>
|
||||
<view v-if="(data_base.is_blog_give_thumbs || 0) == 1" :class="'item dis-inline-block cr-' + ((data.is_give_thumbs || 0) == 1 ? 'main' : 'base')" :data-blogid="data.id" @tap="give_thumbs_event">
|
||||
<iconfont :name="(data.is_give_thumbs || 0) == 1 ? 'icon-givealike' : 'icon-givealike-o'" size="28rpx" propClass="pr top-sm margin-right-xs"></iconfont>
|
||||
<text class="va-m text-size-xs">{{$t('ask-comments.ask-comments.du7rcv')}}{{ data.give_thumbs_count }})</text>
|
||||
</view>
|
||||
<view class="item dis-inline-block cr-base" @tap="popup_share_event">
|
||||
<iconfont name="icon-share" size="28rpx" propClass="pr top-sm margin-right-xs"></iconfont>
|
||||
<text class="text-size-xs">{{$t('common.share')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 评论回复表单 -->
|
||||
<view v-if="(data_base.is_blog_comments_add || 0) == 1 && !input_comments_modal_status" class="padding-top-xxxl padding-bottom-xxl blog-comments-reply-container flex-row jc-sb spacing-mb">
|
||||
<image :src="avatar" mode="aspectFill" class="user-avatar fl circle"></image>
|
||||
<view class="right-base flex-1 flex-width">
|
||||
<view class="comments border-radius-main padding-main">
|
||||
<textarea :placeholder="$t('ask-comments.ask-comments.m67961')" placeholder-class="cr-grey" class="wh-auto bg-grey-f8" :value="input_comments_value" :maxlength="input_comments_length_max" @input="comments_input_event" @blur="comments_input_event"></textarea>
|
||||
<view class="oh flex-row jc-sb align-e">
|
||||
<image :src="common_static_url + 'emoji-icon.png'" mode="aspectFill" class="emoji-icon va-m" @tap="emoji_event"></image>
|
||||
<view class="flex-row align-e">
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<text class="text-size-xs cr-grey-d margin-right-sm">{{$t('login.login.n24i5u')}}{{ input_comments_length_value }}{{$t('ask-comments.ask-comments.6l6vz7')}}</text>
|
||||
<!-- #endif -->
|
||||
<button type="default" size="mini" class="comment-btn cr-white border-radius-sm text-size-md va-m" :class="input_comments_value.length > 0 ? 'bg-main br-main ' : 'comment-btn-default'" @tap="comments_event">{{$t('user-order.user-order.twc3r7')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 评论回复内容 -->
|
||||
<view v-if="(data_base.is_blog_comments_show || 0) == 1 && (data.comments_list || null) != null && data.comments_list.length > 0" class="blog-comments-list">
|
||||
<block v-for="(item, index) in data.comments_list" :key="index">
|
||||
<view class="item oh flex-row jc-sb">
|
||||
<image :src="item.user.avatar" mode="aspectFill" class="user-avatar circle fl"></image>
|
||||
<view class="right-content flex-1 flex-width" :class="data.comments_list.length > index + 1 ? 'br-b-e padding-bottom-main margin-bottom-main' : ''">
|
||||
<view class="comments-base oh">
|
||||
<text class="username fw-b">{{ item.user.user_name_view }}</text>
|
||||
<text class="cr-grey-9 margin-left-main">{{ item.add_time }}</text>
|
||||
</view>
|
||||
<view class="margin-top-sm comments-content">{{ item.content }}</view>
|
||||
<view class="blog-comments-right-content-operate margin-top-main flex-row jc-e align-c text-size-xs cr-grey-9">
|
||||
<view v-if="(data_base.is_blog_comments_show || 0) == 1" class="item dis-inline-block" :data-index="index" :data-username="item.user.user_name_view" :data-blogcommentsid="item.id" @tap="modal_open_event">
|
||||
<iconfont name="icon-message-square" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.3fcnme')}}{{ item.comments_count }})</text>
|
||||
</view>
|
||||
<view v-if="(data_base.is_blog_give_thumbs || 0) == 1" :class="'item dis-inline-block margin-left-xxxl padding-left-sm cr-' + ((item.is_give_thumbs || 0) == 1 ? 'main' : '')" data-type="1" :data-index="index" :data-blogid="item.blog_id" :data-blogcommentsid="item.id" @tap="give_thumbs_event">
|
||||
<iconfont :name="(item.is_give_thumbs || 0) == 1 ? 'icon-givealike' : 'icon-givealike-o'" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.du7rcv')}}{{ item.give_thumbs_count }})</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="(item.reply_comments_list || null) != null && item.reply_comments_list.length > 0" class="reply-blog-comments-list">
|
||||
<block v-for="(comments, index2) in item.reply_comments_list" :key="index2">
|
||||
<view class="bg-grey-e">
|
||||
<view class="item padding-main oh flex-row jc-sb">
|
||||
<image :src="comments.user.avatar" mode="aspectFill" class="user-avatar circle fl"></image>
|
||||
<view class="right-content flex-1 flex-width">
|
||||
<view class="comments-reply-base oh">
|
||||
<text class="username fw-b">{{ comments.user.user_name_view }}</text>
|
||||
<text class="cr-grey-9 margin-left-main">{{ comments.add_time }}</text>
|
||||
</view>
|
||||
<view v-if="(comments.reply_comments_text || null) != null" class="margin-top-sm reply-content">{{ comments.reply_comments_text }}</view>
|
||||
<view class="margin-top-sm">{{ comments.content }}</view>
|
||||
<view class="blog-comments-right-content-operate flex-row jc-e align-c text-size-xs cr-grey-9 padding-0">
|
||||
<view v-if="(data_base.is_blog_comments_show || 0) == 1" class="item dis-inline-block" :data-index="index" :data-username="comments.user.user_name_view" :data-blogcommentsid="comments.blog_comments_id" :data-replycommentsid="comments.id" @tap="modal_open_event">
|
||||
<iconfont name="icon-message-square" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.3fcnme')}}{{ comments.comments_count }})</text>
|
||||
</view>
|
||||
<view
|
||||
v-if="(data_base.is_blog_give_thumbs || 0) == 1"
|
||||
:class="'item dis-inline-block margin-left-xxxl padding-left-sm cr-' + ((comments.is_give_thumbs || 0) == 1 ? 'main' : '')"
|
||||
data-type="2"
|
||||
:data-index="index"
|
||||
:data-indexs="index2"
|
||||
:data-blogid="comments.blog_id"
|
||||
:data-blogcommentsid="comments.id"
|
||||
:data-replycommentsid="comments.blog_comments_id"
|
||||
@tap="give_thumbs_event"
|
||||
>
|
||||
<iconfont :name="(comments.is_give_thumbs || 0) == 1 ? 'icon-givealike' : 'icon-givealike-o'" size="28rpx" propClass="pr top-md margin-right-xs"></iconfont>
|
||||
<text class="va-m">{{$t('ask-comments.ask-comments.du7rcv')}}{{ comments.give_thumbs_count }})</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-if="(item.comments_count || 0) > 0 && (item.is_comments_list_submit == undefined || item.is_comments_list_submit == 1)" class="margin-top-lg text-size-xs">
|
||||
<text :data-index="index" :data-blogid="item.blog_id" :data-blogcommentsid="item.id" @tap="comments_list_reply_event">
|
||||
<text v-if="item.is_comments_list_submit == undefined" class="cr-grey">{{$t('goods-list.goods-list.278qr1')}}{{ item.comments_count }}{{$t('ask-comments.ask-comments.ymmd24')}}</text>
|
||||
<text v-else class="cr-grey">{{$t('ask-comments.ask-comments.dfhg54')}}</text>
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" propClass="margin-left-xs pr top-xs"></iconfont>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="((data_base.blog_detail_comments_more_page_number || 0) == 0 && (data.comments_count || 0) > 20) || ((data_base.blog_detail_comments_more_page_number || 0) > 0 && data.comments_count > data_base.blog_detail_comments_more_page_number)">
|
||||
<view v-if="propType == 'detail'" class="margin-top-xxxl tc padding-vertical-main bg-grey-f8 border-radius-sm">
|
||||
<text :data-value="'/pages/plugins/blog/comments/comments?id=' + data.id" @tap="url_event">
|
||||
<text class="cr-grey">{{$t('goods-list.goods-list.278qr1')}}{{ data.comments_count }}{{$t('ask-comments.ask-comments.5401r1')}}</text>
|
||||
<iconfont name="icon-arrow-right" size="24rpx" propClass="margin-left-xs pr top-xs"></iconfont>
|
||||
</text>
|
||||
</view>
|
||||
<view v-if="propType == 'comments' && (data.is_comments_list_submit == undefined || data.is_comments_list_submit == 1)" class="margin-top-xxxl tc padding-vertical-main bg-grey-f8 border-radius-sm">
|
||||
<text :data-blogid="data.id" @tap="comments_list_reply_event">
|
||||
<text class="cr-grey">{{$t('ask-comments.ask-comments.4l77wt')}}</text>
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" propClass="margin-left-xs pr top-xs"></iconfont>
|
||||
</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 回复弹窗 -->
|
||||
<view v-if="input_comments_modal_status" class="blog-comments-modal pf">
|
||||
<view class="blog-comments-modal-content bg-white border-radius-main pr">
|
||||
<view class="tc margin-bottom-lg">
|
||||
<text>{{$t('ask-comments.ask-comments.8sjar6')}}{{ input_comments_modal_username }}</text>
|
||||
<view class="close pa">
|
||||
<view @tap.stop="modal_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<textarea :placeholder="$t('ask-comments.ask-comments.m67961')" placeholder-class="cr-grey" class="wh-auto br padding-main" :value="input_comments_value" :maxlength="input_comments_length_max" @input="comments_input_event" @blur="comments_input_event"></textarea>
|
||||
<view class="margin-top-lg oh">
|
||||
<image :src="common_static_url + 'emoji-icon.png'" mode="aspectFill" class="emoji-icon va-m" @tap="emoji_event"></image>
|
||||
<view class="fr">
|
||||
<text class="va-m text-size-xs cr-grey margin-right-lg">{{$t('login.login.n24i5u')}}{{ input_comments_length_value }}{{$t('ask-comments.ask-comments.6l6vz7')}}</text>
|
||||
<button type="default" size="mini" class="comment-btn cr-white border-radius-sm text-size-xs va-m" :class="input_comments_value.length > 0 ? 'bg-main br-main ' : 'comment-btn-default'" @tap="comments_event">{{$t('user-order.user-order.twc3r7')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 表情弹窗 -->
|
||||
<component-emoji-popup ref="emoji" v-on:choiceConfirmEvent="emoji_choice_confirm_event"></component-emoji-popup>
|
||||
|
||||
<!-- 分享弹窗 -->
|
||||
<component-share-popup ref="share"></component-share-popup>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentSharePopup from '@/components/share-popup/share-popup';
|
||||
import componentEmojiPopup from '@/components/emoji-popup/emoji-popup';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
common_static_url: common_static_url,
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
user: null,
|
||||
data_base: null,
|
||||
data: null,
|
||||
emoji_list: [],
|
||||
input_comments_value: '',
|
||||
input_comments_cursor: 0,
|
||||
input_comments_length_value: 500,
|
||||
input_comments_length_max: 500,
|
||||
input_comments_modal_status: false,
|
||||
input_comments_modal_index: 0,
|
||||
input_comments_modal_username: '',
|
||||
input_comments_modal_blog_comments_id: 0,
|
||||
input_comments_modal_reply_comments_id: 0,
|
||||
};
|
||||
},
|
||||
props: {
|
||||
propType: {
|
||||
type: String,
|
||||
default: 'detail',
|
||||
},
|
||||
propData: {
|
||||
type: [Object, null],
|
||||
default: null,
|
||||
},
|
||||
propDataBase: {
|
||||
type: [Object, null],
|
||||
default: null,
|
||||
},
|
||||
propEmojiList: {
|
||||
type: [Array, null],
|
||||
default: [],
|
||||
},
|
||||
propShareInfo: {
|
||||
type: [Object, null],
|
||||
default: {},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
componentPopup,
|
||||
componentSharePopup,
|
||||
componentEmojiPopup,
|
||||
},
|
||||
|
||||
// 页面被展示
|
||||
created: function (e) {
|
||||
var avatar = app.globalData.data.default_user_head_src;
|
||||
var user = app.globalData.get_user_cache_info() || null;
|
||||
this.setData({
|
||||
user: user,
|
||||
avatar: user == null ? avatar : user.avatar || avatar,
|
||||
data: this.propData,
|
||||
data_base: this.propDataBase,
|
||||
emoji_list: this.propEmojiList,
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 分享开启弹层
|
||||
popup_share_event(e) {
|
||||
if ((this.$refs.share || null) != null) {
|
||||
this.$refs.share.init({
|
||||
share_info: this.propShareInfo
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 评论弹窗关闭
|
||||
modal_close_event(e) {
|
||||
this.setData({
|
||||
input_comments_modal_status: false,
|
||||
input_comments_modal_index: 0,
|
||||
input_comments_modal_username: '',
|
||||
input_comments_modal_blog_comments_id: 0,
|
||||
input_comments_modal_reply_comments_id: 0,
|
||||
input_comments_value: '',
|
||||
});
|
||||
},
|
||||
|
||||
// 评论弹窗开启
|
||||
modal_open_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this, 'modal_open_event', e);
|
||||
if (user != false) {
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var username = e.currentTarget.dataset.username;
|
||||
var blog_comments_id = e.currentTarget.dataset.blogcommentsid || 0;
|
||||
var reply_comments_id = e.currentTarget.dataset.replycommentsid || 0;
|
||||
this.setData({
|
||||
input_comments_modal_status: true,
|
||||
input_comments_value: '',
|
||||
input_comments_modal_index: index,
|
||||
input_comments_modal_username: username,
|
||||
input_comments_modal_blog_comments_id: blog_comments_id,
|
||||
input_comments_modal_reply_comments_id: reply_comments_id,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 表情选择事件
|
||||
emoji_event() {
|
||||
if (this.input_comments_length_value == 0) {
|
||||
app.globalData.showToast(this.$t('ask-comments.ask-comments.3o1rq6'));
|
||||
return false;
|
||||
}
|
||||
if ((this.$refs.emoji || null) != null) {
|
||||
this.$refs.emoji.init({ emoji_list: this.emoji_list });
|
||||
}
|
||||
},
|
||||
|
||||
// 评论输入和失去焦点事件
|
||||
comments_input_event(e) {
|
||||
var value = e.detail.value.trim();
|
||||
var length = this.input_comments_length_max - value.length;
|
||||
this.setData({
|
||||
input_comments_cursor: e.detail.cursor || 0,
|
||||
input_comments_value: value,
|
||||
input_comments_length_value: length <= 0 ? 0 : length,
|
||||
});
|
||||
},
|
||||
|
||||
// 表情选择确认事件
|
||||
emoji_choice_confirm_event(emoji) {
|
||||
var value = this.input_comments_value;
|
||||
var cursor = parseInt(this.input_comments_cursor || 0);
|
||||
if (value != '') {
|
||||
if (cursor == 0) {
|
||||
value = emoji + value;
|
||||
} else {
|
||||
var first = value.substr(0, cursor);
|
||||
var last = value.substr(cursor, value.length);
|
||||
value = first + emoji + last;
|
||||
}
|
||||
} else {
|
||||
value = emoji;
|
||||
}
|
||||
var length = this.input_comments_length_max - value.length;
|
||||
this.setData({
|
||||
input_comments_value: value,
|
||||
input_comments_length_value: length <= 0 ? 0 : length,
|
||||
});
|
||||
},
|
||||
|
||||
// 获取评论列表
|
||||
comments_list_reply_event(e) {
|
||||
var temp_data = this.data;
|
||||
var page = 1;
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var blog_id = e.currentTarget.dataset.blogid;
|
||||
var blog_comments_id = e.currentTarget.dataset.blogcommentsid || 0;
|
||||
if (blog_comments_id == 0) {
|
||||
if ((temp_data['page'] || null) == null) {
|
||||
temp_data['page'] = 1;
|
||||
} else {
|
||||
temp_data['page'] += 1;
|
||||
}
|
||||
page = temp_data['page'];
|
||||
} else {
|
||||
if ((temp_data['comments_list'][index]['page'] || null) == null) {
|
||||
temp_data['comments_list'][index]['page'] = 1;
|
||||
} else {
|
||||
temp_data['comments_list'][index]['page'] += 1;
|
||||
}
|
||||
page = temp_data['comments_list'][index]['page'];
|
||||
}
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('commentsreplylist', 'index', 'blog'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
blog_id: blog_id,
|
||||
blog_comments_id: blog_comments_id,
|
||||
page: page,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
if (blog_comments_id == 0) {
|
||||
var temp_list = temp_data['comments_list'] || [];
|
||||
} else {
|
||||
var temp_list = temp_data['comments_list'][index]['reply_comments_list'] || [];
|
||||
}
|
||||
var data = res.data.data.data;
|
||||
for (var i in data) {
|
||||
temp_list.push(data[i]);
|
||||
}
|
||||
if (blog_comments_id == 0) {
|
||||
temp_data['comments_list'] = temp_list;
|
||||
temp_data['is_comments_list_submit'] = res.data.data.page >= res.data.data.page_total ? 0 : 1;
|
||||
} else {
|
||||
temp_data['comments_list'][index]['reply_comments_list'] = temp_list;
|
||||
temp_data['comments_list'][index]['is_comments_list_submit'] = res.data.data.page >= res.data.data.page_total ? 0 : 1;
|
||||
}
|
||||
this.setData({ data: temp_data });
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 评论
|
||||
comments_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this, 'comments_event', e);
|
||||
if (user != false) {
|
||||
if (this.input_comments_value == '') {
|
||||
app.globalData.showToast(this.$t('user-order-comments.user-order-comments.8f303u'));
|
||||
return false;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: this.$t('buy.buy.r79t77'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('comments', 'index', 'blog'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
blog_id: this.data.id,
|
||||
content: this.input_comments_value,
|
||||
blog_comments_id: this.input_comments_modal_blog_comments_id,
|
||||
reply_comments_id: this.input_comments_modal_reply_comments_id,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var temp_data = this.data;
|
||||
if ((this.input_comments_modal_blog_comments_id || 0) == 0) {
|
||||
var temp_list = temp_data.comments_list || [];
|
||||
temp_list.splice(0, 0, res.data.data);
|
||||
temp_data['comments_list'] = temp_list;
|
||||
temp_data['comments_count'] = parseInt(temp_data['comments_count']) + 1;
|
||||
} else {
|
||||
var index = this.input_comments_modal_index;
|
||||
var temp_list = temp_data.comments_list[index]['reply_comments_list'] || [];
|
||||
temp_list.splice(0, 0, res.data.data);
|
||||
if ((this.input_comments_modal_reply_comments_id || 0) != 0) {
|
||||
for (var i in temp_list) {
|
||||
if (temp_list[i]['id'] == this.input_comments_modal_reply_comments_id) {
|
||||
temp_list[i]['comments_count'] = parseInt(temp_list[i]['comments_count']) + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
temp_data.comments_list[index]['reply_comments_list'] = temp_list;
|
||||
temp_data.comments_list[index]['comments_count'] = parseInt(temp_data.comments_list[index]['comments_count']) + 1;
|
||||
}
|
||||
this.setData({
|
||||
data: temp_data,
|
||||
input_comments_value: '',
|
||||
input_comments_length_value: this.input_comments_length_max,
|
||||
input_comments_modal_status: false,
|
||||
input_comments_modal_index: 0,
|
||||
input_comments_modal_username: '',
|
||||
input_comments_modal_blog_comments_id: 0,
|
||||
input_comments_modal_reply_comments_id: 0,
|
||||
});
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 点赞
|
||||
give_thumbs_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this, 'give_thumbs_event', e);
|
||||
if (user != false) {
|
||||
var type = parseInt(e.currentTarget.dataset.type || 0);
|
||||
var blog_id = e.currentTarget.dataset.blogid;
|
||||
var blog_comments_id = e.currentTarget.dataset.blogcommentsid || 0;
|
||||
var reply_comments_id = e.currentTarget.dataset.replycommentsid || 0;
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('givethumbs', 'index', 'blog'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
blog_id: blog_id,
|
||||
blog_comments_id: blog_comments_id,
|
||||
reply_comments_id: reply_comments_id,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var temp_data = this.data;
|
||||
switch (type) {
|
||||
// 博客
|
||||
case 0:
|
||||
temp_data.is_give_thumbs = data.is_active;
|
||||
temp_data.give_thumbs_count = data.count;
|
||||
break;
|
||||
// 博客评论
|
||||
case 1:
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
temp_data['comments_list'][index]['is_give_thumbs'] = data.is_active;
|
||||
temp_data['comments_list'][index]['give_thumbs_count'] = data.count;
|
||||
break;
|
||||
// 博客评论回复
|
||||
case 2:
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var indexs = parseInt(e.currentTarget.dataset.indexs || 0);
|
||||
temp_data['comments_list'][index]['reply_comments_list'][indexs]['is_give_thumbs'] = data.is_active;
|
||||
temp_data['comments_list'][index]['reply_comments_list'][indexs]['give_thumbs_count'] = data.count;
|
||||
break;
|
||||
}
|
||||
this.setData({ data: temp_data });
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/**
|
||||
* 聚合点赞、评论、分享
|
||||
*/
|
||||
.blog-comments-bottom-container .item:not(:last-child) {
|
||||
margin-right: 64rpx;
|
||||
}
|
||||
.blog-comments-reply-container .emoji-icon,
|
||||
.blog-comments-modal .emoji-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx !important;
|
||||
}
|
||||
.blog-comments-reply-container .user-avatar {
|
||||
width: 72rpx;
|
||||
height: 72rpx !important;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.blog-comments-reply-container .right-base {
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
.blog-comments-reply-container .right-base .comments {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
.blog-comments-reply-container .right-base textarea {
|
||||
height: 120rpx;
|
||||
}
|
||||
.blog-comments-modal {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: calc(100% - 80rpx);
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
padding: 40rpx;
|
||||
z-index: 10;
|
||||
}
|
||||
.blog-comments-modal-content {
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
margin: 0 auto;
|
||||
margin-top: 30%;
|
||||
max-width: calc(800px - 180rpx);
|
||||
}
|
||||
.blog-comments-modal-content textarea {
|
||||
height: 200rpx;
|
||||
}
|
||||
.blog-comments-modal-content .close {
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
.comment-btn {
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
.comment-btn-default {
|
||||
border: 2rpx solid #d8dadc;
|
||||
background-color: #d8dadc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论列表
|
||||
*/
|
||||
.blog-comments-list > .item .user-avatar {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.blog-comments-list .comments-base,
|
||||
.blog-comments-list .comments-content {
|
||||
padding-left: 16rpx;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
.reply-blog-comments-list {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
.reply-blog-comments-list .right-content {
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
</style>
|
||||
245
pages/plugins/blog/detail/detail.vue
Normal file
245
pages/plugins/blog/detail/detail.vue
Normal file
@@ -0,0 +1,245 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(info || null) != null" :class="(data_base || null) != null && (data_base.is_user_add_blog || 0) == 1 ? 'page-bottom-fixed' : ''">
|
||||
<view class="padding-main bg-white spacing-mb">
|
||||
<view class="spacing-mb">
|
||||
<view class="fw-b text-size-xl">{{ info.title }}</view>
|
||||
<view class="cr-grey-9 margin-top-lg oh br-t padding-top-main text-size-xs">
|
||||
<view class="fl">
|
||||
<text>{{ $t('article-detail.article-detail.728374') }}</text>
|
||||
<text>{{ info.add_time }}</text>
|
||||
</view>
|
||||
<view class="fr">
|
||||
<text class="margin-left-xxxl">{{ $t('article-detail.article-detail.j92ru0') }}</text>
|
||||
<text>{{ info.access_count }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="oh web-html-content spacing-mb">
|
||||
<view v-if="(info.video_url || null) != null && ((info.is_live_play || 0) == 0 || client_type == 'weixin')">
|
||||
<video :src="info.video_url" class="wh-auto" :autoplay="false" :controls="true"></video>
|
||||
</view>
|
||||
<mp-html :content="info.content" />
|
||||
</view>
|
||||
<!-- 评论内容 -->
|
||||
<component-blog-comments :propData="info" :propDataBase="data_base" :propEmojiList="emoji_list" :propShareInfo="share_info"></component-blog-comments>
|
||||
</view>
|
||||
|
||||
<view class="padding-horizontal-main">
|
||||
<!-- 上一篇、下一篇 -->
|
||||
<view v-if="(last_next || null) != null" class="last-next-data spacing-mt margin-bottom-xxxl cr-grey-9">
|
||||
<view v-if="(last_next.last || null) != null" class="flex-row">
|
||||
<text>{{ $t('article-detail.article-detail.281s4a') }}</text>
|
||||
<text :data-value="last_next.last.url" @tap="url_event" class="dis-inline-block flex-row flex-width single-text cp item">{{ last_next.last.title }}</text>
|
||||
</view>
|
||||
<view v-if="(last_next.next || null) != null" class="margin-top flex-row cr-main">
|
||||
<text>{{ $t('article-detail.article-detail.uq5814') }}</text>
|
||||
<text :data-value="last_next.next.url" @tap="url_event" class="dis-inline-block flex-row flex-width single-text cp item">{{ last_next.next.title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 推荐博文 -->
|
||||
<view v-if="right_list.length > 0" class="plugins-blog-list">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ $t('detail.detail.455787') }}{{ blog_main_name }}</text>
|
||||
<text data-value="/pages/plugins/blog/search/search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<view v-for="(item, index) in right_list" :key="index">
|
||||
<view :data-value="item.url" @tap="url_event" class="item oh padding-main border-radius-main bg-white spacing-mb cp">
|
||||
<image class="blog-img fl radius" :src="item.cover" mode="aspectFill"></image>
|
||||
<view class="base fr">
|
||||
<view class="single-text">{{ item.title }}</view>
|
||||
<view class="cr-grey margin-top-sm">{{ item.add_time_date_cn }}</view>
|
||||
<view class="cr-grey multi-text margin-top-sm">{{ item.describe }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 相关商品 -->
|
||||
<view v-if="(info.goods_list || null) != null && info.goods_list.length > 0">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ $t('detail.detail.1j6yxy') }}</text>
|
||||
<text data-value="/pages/goods-search/goods-search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<component-goods-list :propData="{ style_type: 1, goods_list: info.goods_list }" :propCurrencySymbol="currency_symbol"></component-goods-list>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
|
||||
<!-- 发布博文、我的博文入口 -->
|
||||
<view v-if="(data_base || null) != null && (data_base.is_user_add_blog || 0) == 1" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<view class="item flex-row jc-sa align-c text-size fw-b br bg-white round padding-vertical">
|
||||
<view data-value="/pages/plugins/blog/form/form" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="divider-r-d wh-auto"> <iconfont name="icon-edit-below-line" size="30rpx" color="#333" propClass="margin-right-sm"></iconfont>{{$t('detail.detail.fn3w01')}}{{ blog_main_name }}</view>
|
||||
</view>
|
||||
<view data-value="/pages/plugins/blog/user-list/user-list" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="wh-auto"> <iconfont name="icon-list-dot" size="32rpx" color="#333" propClass="margin-right-sm pr top-xs"></iconfont>{{$t('common.my')}}{{ blog_main_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</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';
|
||||
import componentBlogComments from '../components/blog-comments/blog-comments';
|
||||
import componentGoodsList from '@/components/goods-list/goods-list';
|
||||
|
||||
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,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
client_type: app.globalData.application_client_type(),
|
||||
bottom_fixed_style: '',
|
||||
params: null,
|
||||
data_base: null,
|
||||
info: null,
|
||||
right_list: [],
|
||||
last_next: null,
|
||||
emoji_list: [],
|
||||
blog_main_name: this.$t('detail.detail.e439j9'),
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentBlogComments,
|
||||
componentGoodsList,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if ((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.globalData.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'index', 'blog'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: this.params.id || 0,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
var data = res.data.data;
|
||||
if (res.data.code == 0 && (data.data || null) != null) {
|
||||
var info = data.data || null;
|
||||
var base = data.base || null;
|
||||
this.setData({
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
data_base: base,
|
||||
info: info,
|
||||
right_list: data.right_list || [],
|
||||
last_next: data.last_next || null,
|
||||
emoji_list: data.emoji_list || [],
|
||||
blog_main_name: base == null ? this.$t('detail.detail.e439j9') : (base.blog_main_name || this.$t('detail.detail.e439j9')),
|
||||
});
|
||||
|
||||
if (info != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: info.seo_title || info.title,
|
||||
desc: info.seo_desc || info.describe,
|
||||
path: '/pages/plugins/blog/detail/detail',
|
||||
query: 'id=' + info.id,
|
||||
img: info.share_images || info.cover,
|
||||
},
|
||||
});
|
||||
|
||||
// 标题
|
||||
uni.setNavigationBarTitle({ title: info.title });
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
data_list_loding_status: 2,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
11
pages/plugins/blog/form/form.css
Normal file
11
pages/plugins/blog/form/form.css
Normal file
@@ -0,0 +1,11 @@
|
||||
.sp-editor {
|
||||
height: 500rpx;
|
||||
}
|
||||
|
||||
.more {
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
.p-content {
|
||||
max-height: 50vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
450
pages/plugins/blog/form/form.vue
Normal file
450
pages/plugins/blog/form/form.vue
Normal file
@@ -0,0 +1,450 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="data_list_loding_status !== 1">
|
||||
<form @submit="form_submit" class="form-container">
|
||||
<view class="page-bottom-fixed padding-main">
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb">
|
||||
<view class="form-gorup">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('user-detail.user-detail.uy6lrz')}}<text class="form-group-tips-must">*</text></view>
|
||||
<input type="text" name="title" :value="data.title || ''" maxlength="16" placeholder-class="cr-grey-9" class="cr-base flex-1 flex-width tr" :placeholder="$t('common.please_input')" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb">
|
||||
<view class="form-gorup">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('common.category')}}<text class="form-group-tips-must">*</text></view>
|
||||
<view class="flex-1 flex-width tr" @tap="popupOpen">
|
||||
<text :class="data.blog_category_name ? 'cr-black' : 'cr-grey-9'">{{ data.blog_category_name || $t('form.form.4cbom4') }}</text>
|
||||
<view class="pr top-sm margin-left-sm dis-inline-block">
|
||||
<iconfont name="icon-arrow-right" color="#999" size="28rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb">
|
||||
<view class="form-gorup">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('form.form.043a10')}}</view>
|
||||
<view class="flex-1 flex-width tr">
|
||||
<switch :color="theme_color" :checked="(data.is_enable || 0) == 1 ? true : false" @change="is_enable_event" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('form.form.5hn8k3')}}</view>
|
||||
<view class="margin-top-main">
|
||||
<component-upload :propData="image_list" :propMaxNum="1" :propPathType="editor_path_type" @call-back="retrun_image_event"></component-upload>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('user-detail.user-detail.7cufw6')}}<text class="form-group-tips-must">*</text></view>
|
||||
<view class="margin-top-main sp-editor">
|
||||
<!-- <sp-editor :templates="(data || null) !== null ? data.content : ''" @input="rich_text_event" @upinImage="up_in_image_event"></sp-editor> -->
|
||||
<sp-editor @init="initEditor" @input="rich_text_event" @upinImage="up_in_image_event"></sp-editor>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="more oh" :style="'height:' + more_height">
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb spacing-mt">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('form.form.xy87t8')}}</view>
|
||||
<textarea name="describe" placeholder-class="cr-grey-9" class="cr-base" :placeholder="$t('common.please_input')" maxlength="200" :value="data.describe"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb">
|
||||
<view class="form-gorup">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('form.form.kvr2i3')}}</view>
|
||||
<input type="text" name="seo_title" :value="data.seo_title || ''" maxlength="16" placeholder-class="cr-grey-9" class="cr-base flex-1 flex-width tr" :placeholder="$t('common.please_input')" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb">
|
||||
<view class="form-gorup">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('form.form.l87ju1')}}</view>
|
||||
<input type="text" name="seo_keywords" :value="data.seo_keywords || ''" maxlength="16" placeholder-class="cr-grey-9" class="cr-base flex-1 flex-width tr" :placeholder="$t('common.please_input')" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh">
|
||||
<view class="form-gorup">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="form-gorup-title padding-right-main">{{$t('form.form.5487bt')}}</view>
|
||||
<input type="text" name="seo_desc" :value="data.seo_desc || ''" maxlength="16" placeholder-class="cr-grey-9" class="cr-base flex-1 flex-width tr" :placeholder="$t('common.please_input')" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white border-radius-main pr oh spacing-mb spacing-mt">
|
||||
<view class="padding-main flex-row jc-c align-c cr-grey-9" @tap="more_event">
|
||||
<text>{{ is_more ? $t('form.form.4h814w') : $t('form.form.lfwj0g') }}</text>
|
||||
<view class="margin-left-sm dis-inline-block">
|
||||
<iconfont :name="is_more ? 'icon-arrow-top' : 'icon-arrow-bottom'" color="#999" size="24rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部操作 -->
|
||||
<view class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item cr-white bg-main round text-size wh-auto" type="default" form-type="submit" hover-class="none" :loading="form_submit_loading" :disabled="form_submit_loading">{{$t('form.form.4yd066')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 分类选择 -->
|
||||
<component-popup :propShow="popup_status" propPosition="bottom" @onclose="popup_close_event">
|
||||
<view class="p-title flex-row jc-sb align-c padding-main br-b-e">
|
||||
<view class="text-size-lg fw-b">{{$t('form.form.4vku7u')}}</view>
|
||||
<view class="popup-colse" @tap="popup_close_event">
|
||||
<iconfont name="icon-close-o" color="#333" size="28rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="p-content padding-main">
|
||||
<view v-for="(item, index) in blog_category_list" :key="index">
|
||||
<view class="padding-vertical-main flex-row jc-sb align-c" :class="data.blog_category_id == item.id ? 'cr-main' : ''" :data-value="item.name" :data-id="item.id" @tap="get_type_event">
|
||||
{{ item.name }}
|
||||
<iconfont v-if="data.blog_category_id === item.id" name="icon-checked" color="#333" size="28rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</form>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentUpload from '@/components/upload/upload';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
theme_color: app.globalData.get_theme_color(),
|
||||
data_list_loding_status: 1,
|
||||
bottom_fixed_style: '',
|
||||
params: {},
|
||||
data: {},
|
||||
index: 0,
|
||||
// 分类选择弹窗
|
||||
popup_status: false,
|
||||
blog_category_list: [],
|
||||
|
||||
// 封面图片
|
||||
image_list: [],
|
||||
// 路径类型
|
||||
editor_path_type: 'common',
|
||||
|
||||
// 内容
|
||||
input_length_max: 500,
|
||||
input_value: '',
|
||||
// 查看更多
|
||||
more_height: '0',
|
||||
is_more: false,
|
||||
|
||||
// 提交按钮
|
||||
form_submit_loading: false,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentPopup,
|
||||
componentUpload,
|
||||
componentNoData,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params || {},
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 页面销毁时执行
|
||||
onUnload: function () {},
|
||||
|
||||
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: 2,
|
||||
data_list_loding_msg: this.$t('form.form.8l3ul5'),
|
||||
});
|
||||
}
|
||||
},
|
||||
get_data_list() {
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('saveinfo', 'blog', 'blog'),
|
||||
method: 'POST',
|
||||
data: {...this.params, ...{lang_can_key: 'blog_category_list'}},
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var blog_category_list = res.data.data.blog_category_list || [];
|
||||
if (res.data.data.data) {
|
||||
var data = res.data.data.data || {};
|
||||
// 封面列表
|
||||
var img_list = [];
|
||||
if ((data.cover || null) != null && data.cover.length > 0) {
|
||||
img_list.push(data.cover);
|
||||
}
|
||||
// 分类名称匹配重新匹配赋值
|
||||
var blog_category_name = '';
|
||||
for(var i in blog_category_list) {
|
||||
if(blog_category_list[i]['id'] == data.blog_category_id) {
|
||||
blog_category_name = blog_category_list[i]['name'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
data['blog_category_name'] = blog_category_name;
|
||||
// 设置数据
|
||||
this.setData({
|
||||
data: data,
|
||||
blog_category_list: blog_category_list,
|
||||
image_list: img_list,
|
||||
more_height: data.describe || data.seo_title || data.seo_keywords || data.seo_desc ? '708rpx' : '0',
|
||||
is_more: data.describe || data.seo_title || data.seo_keywords || data.seo_desc ? 'true' : 'false',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
blog_category_list: blog_category_list,
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
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'));
|
||||
},
|
||||
});
|
||||
},
|
||||
// 弹层打开
|
||||
popupOpen() {
|
||||
this.setData({
|
||||
popup_status: true,
|
||||
});
|
||||
},
|
||||
|
||||
// 弹层关闭
|
||||
popup_close_event(e) {
|
||||
this.setData({
|
||||
popup_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 是否启用
|
||||
is_enable_event(e) {
|
||||
var new_data = this.data;
|
||||
new_data.is_enable = e.detail.value ? 1 : 0;
|
||||
this.setData({
|
||||
data: new_data,
|
||||
});
|
||||
},
|
||||
|
||||
// 获取选中的分类
|
||||
get_type_event(e) {
|
||||
var new_data = this.data;
|
||||
new_data.blog_category_id = e.currentTarget.dataset.id;
|
||||
new_data.blog_category_name = e.currentTarget.dataset.value;
|
||||
this.setData({
|
||||
data: new_data,
|
||||
popup_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 上传回调
|
||||
retrun_image_event(data) {
|
||||
var new_data = this.data;
|
||||
new_data.cover = data[0];
|
||||
this.setData({
|
||||
data: new_data,
|
||||
});
|
||||
},
|
||||
|
||||
// 回调富文本内容
|
||||
rich_text_event(e) {
|
||||
var new_data = this.data;
|
||||
new_data.content = e.html;
|
||||
this.setData({
|
||||
data: new_data,
|
||||
});
|
||||
},
|
||||
initEditor(editor) {
|
||||
// 初始化编辑器内容
|
||||
editor.setContents({
|
||||
html: (this.data || null) !== null ? this.data.content : '',
|
||||
});
|
||||
},
|
||||
|
||||
// 上传图片
|
||||
up_in_image_event(tempFiles, editorCtx) {
|
||||
var self = this;
|
||||
// 使用 uniCloud.uploadFile 上传图片的示例方法(可适用多选上传)
|
||||
tempFiles.forEach(async (item) => {
|
||||
uni.showLoading({
|
||||
title: self.$t('form.form.2e5rv3'),
|
||||
mask: true,
|
||||
});
|
||||
await uni.uploadFile({
|
||||
url: app.globalData.get_request_url('index', 'ueditor'),
|
||||
// #ifdef APP-PLUS || H5
|
||||
filePath: item.path,
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
filePath: item.tempFilePath,
|
||||
// #endif
|
||||
name: 'upfile',
|
||||
formData: {
|
||||
action: 'uploadimage',
|
||||
path_type: 'common', // 路径类型,默认common
|
||||
},
|
||||
success: function (res) {
|
||||
let data = JSON.parse(res.data);
|
||||
if (res.statusCode == 200) {
|
||||
// 上传完成后处理
|
||||
editorCtx.insertImage({
|
||||
src: data.data.url, // 此处需要将图片地址切换成服务器返回的真实图片地址
|
||||
// width: '50%',
|
||||
alt: self.$t('common.video'),
|
||||
success: function (e) {},
|
||||
});
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
fail: function (e) {
|
||||
app.globalData.showToast(e.errMsg);
|
||||
uni.hideLoading();
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 更多内容
|
||||
more_event() {
|
||||
this.setData({
|
||||
more_height: !this.is_more ? '708rpx' : '0',
|
||||
is_more: !this.is_more,
|
||||
});
|
||||
},
|
||||
|
||||
// 表单提交
|
||||
form_submit(e) {
|
||||
// 数据验证
|
||||
var validation = [
|
||||
{ fields: 'title', msg: this.$t('form.form.v19gg8') },
|
||||
{ fields: 'blog_category_id', msg: this.$t('form.form.gu3x97') },
|
||||
{ fields: 'content', msg: this.$t('form.form.adiq70') },
|
||||
];
|
||||
var validate = {
|
||||
blog_category_id: this.data.blog_category_id,
|
||||
content: this.data.content,
|
||||
title: e.detail.value.title,
|
||||
};
|
||||
if (app.globalData.fields_check(validate, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('buy.buy.r79t77'),
|
||||
});
|
||||
this.setData({
|
||||
form_submit_loading: true,
|
||||
});
|
||||
var new_data = {
|
||||
...e.detail.value,
|
||||
...this.data,
|
||||
};
|
||||
// 网络请求
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('save', 'blog', 'blog'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.page_back_prev_event();
|
||||
}, 2000);
|
||||
} else {
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
});
|
||||
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();
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './form.css';
|
||||
</style>
|
||||
42
pages/plugins/blog/index/index.css
Normal file
42
pages/plugins/blog/index/index.css
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 分类
|
||||
*/
|
||||
.nav-list {
|
||||
height: 38rpx;
|
||||
line-height: 38rpx;
|
||||
width: calc(100% - 155rpx);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推荐博文
|
||||
*/
|
||||
.right-list .item .blog-title {
|
||||
width: calc(100% - 210rpx);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类导航
|
||||
*/
|
||||
.nav-blog-category .item {
|
||||
width: calc(50% - 10rpx);
|
||||
}
|
||||
.nav-blog-category .item:nth-child(odd) {
|
||||
float: left;
|
||||
}
|
||||
.nav-blog-category .item:nth-child(even) {
|
||||
float: right;
|
||||
}
|
||||
.nav-blog-category .item .icon,
|
||||
.nav-blog-category .item .icon-text {
|
||||
width: 74rpx;
|
||||
height: 74rpx !important;
|
||||
}
|
||||
.nav-blog-category .item .icon-text {
|
||||
line-height: 72rpx;
|
||||
font-size: 48rpx;
|
||||
background: #e6f2f8;
|
||||
color: #3f51b5;
|
||||
}
|
||||
.nav-blog-category .item .right-base {
|
||||
width: calc(100% - 84rpx);
|
||||
}
|
||||
280
pages/plugins/blog/index/index.vue
Normal file
280
pages/plugins/blog/index/index.vue
Normal file
@@ -0,0 +1,280 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data_base || null) != null" :class="(data_base || null) != null && (data_base.is_user_add_blog || 0) == 1 ? 'page-bottom-fixed' : ''">
|
||||
<!-- 搜索框 -->
|
||||
<view class="nav-search padding-main">
|
||||
<component-search propBrColor="#efefef" propBgColor="#fff" propUrl="/pages/plugins/blog/search/search"></component-search>
|
||||
</view>
|
||||
|
||||
<!-- 轮播 -->
|
||||
<view v-if="slide_list.length > 0" class="padding-horizontal-main spacing-mb">
|
||||
<component-banner :propData="slide_list"></component-banner>
|
||||
</view>
|
||||
|
||||
<!-- 分类导航 -->
|
||||
<view v-if="(data_base.is_home_category_main_nav || 0) == 1 && (category || null) != null && category.length > 0" class="nav-blog-category padding-horizontal-main oh">
|
||||
<block v-for="(item, index) in category" :key="index">
|
||||
<view class="item oh padding-main margin-bottom-main radius bg-white bs-bb" :data-value="item.url" @tap="url_event">
|
||||
<image v-if="(item.icon || null) != null" :src="item.icon" mode="aspectFill" class="fl icon radius"></image>
|
||||
<view v-else class="fl radius icon-text tc">{{ item.name.substr(0, 1) }}</view>
|
||||
<view class="fr right-base">
|
||||
<view class="single-text cr-base">
|
||||
<text class="fw">{{ item.name }}</text>
|
||||
<text v-if="(item.blog_data || null) != null && item.blog_data.day_comments_count > 0" class="margin-left-sm cr-red fw">({{ item.blog_data.day_comments_count }})</text>
|
||||
</view>
|
||||
<view v-if="(item.blog_data || null) != null" class="single-text cr-grey text-size-xs">
|
||||
<text>{{ blog_main_name }}: {{ item.blog_data.blog_count }}</text>
|
||||
<text v-if="(data_base.is_blog_comments_show || 0) == 1" class="margin-left">{{ $t('index.index.lkld04') }}{{ item.blog_data.comments_count }}</text>
|
||||
<text v-if="(data_base.is_blog_give_thumbs || 0) == 1" class="margin-left">{{ $t('index.index.r6vv25') }}{{ item.blog_data.give_thumbs_count }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 分类 -->
|
||||
<view class="padding-horizontal-main">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ $t('index.index.6rsqp1') }}{{ blog_main_name }}</text>
|
||||
<text data-value="/pages/plugins/blog/search/search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 博文列表 -->
|
||||
<view v-if="data_list.length > 0" class="plugins-blog-list padding-horizontal-main">
|
||||
<view v-for="(item, index) in data_list" :key="index">
|
||||
<view :data-value="item.url" @tap="url_event" class="item oh padding-main border-radius-main bg-white cp spacing-mb">
|
||||
<image class="blog-img fl radius" :src="item.cover" mode="aspectFill"></image>
|
||||
<view class="base fr">
|
||||
<view class="single-text text-size">{{ item.title }}</view>
|
||||
<view class="cr-grey margin-top-sm">{{ item.add_time_date_cn }}</view>
|
||||
<view class="cr-base text-size-sm multi-text margin-top-sm">{{ item.describe }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 热门博文-滚动 -->
|
||||
<view v-if="hot_list.length > 0" class="padding-horizontal-main spacing-mb">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ $t('index.index.pot64x') }}{{ blog_main_name }}</text>
|
||||
<text data-value="/pages/plugins/blog/search/search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<view class="rolling-horizontal border-radius-main oh">
|
||||
<view class="plugins-blog-rolling-list scroll-view-horizontal">
|
||||
<swiper :vertical="false" :autoplay="(data_base.is_home_hot_auto_play || 0) == 1" :circular="false" :display-multiple-items="hot_list.length < 3 ? hot_list.length : 3" interval="3000">
|
||||
<block v-for="(item, index) in hot_list" :key="index">
|
||||
<swiper-item>
|
||||
<view :data-value="item.url" @tap="url_event" class="item bg-white border-radius-main margin-right-main oh pr ht-auto pr cp">
|
||||
<image class="blog-img dis-block wh-auto" :src="item.cover" mode="aspectFill"></image>
|
||||
<view class="blog-title pa single-text cr-white padding-horizontal-main padding-top-sm padding-bottom-sm">{{ item.title }}</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 推荐博文 -->
|
||||
<view v-if="right_list.length > 0" class="padding-horizontal-main spacing-mb">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ $t('detail.detail.455787') }}{{ blog_main_name }}</text>
|
||||
<text data-value="/pages/plugins/blog/search/search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<view class="right-list padding-horizontal-main border-radius-main bg-white">
|
||||
<block v-for="(item, index) in right_list" :key="index">
|
||||
<view :data-value="item.url" @tap="url_event" :class="'item padding-vertical-main oh cp ' + (index > 0 ? 'br-t' : '')">
|
||||
<view class="blog-title single-text fl">{{ item.title }}</view>
|
||||
<text class="cr-grey fr">{{ $t('detail.detail.e6ga1y') }}{{ item.access_count }}{{ $t('buy.buy.0pgsrm') }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 推荐商品 -->
|
||||
<view v-if="goods_list.length > 0" class="goods-list oh padding-horizontal-main">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ $t('index.index.8t4j95') }}</text>
|
||||
<text data-value="/pages/goods-search/goods-search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
|
||||
</view>
|
||||
<component-goods-list :propData="{ style_type: 1, goods_list: goods_list }" :propCurrencySymbol="currency_symbol"></component-goods-list>
|
||||
</view>
|
||||
|
||||
<!-- 发布博文、我的博文入口 -->
|
||||
<view v-if="(data_base || null) != null && (data_base.is_user_add_blog || 0) == 1" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<view class="item flex-row jc-sa align-c text-size fw-b br bg-white round padding-vertical">
|
||||
<view data-value="/pages/plugins/blog/form/form" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="divider-r-d wh-auto"> <iconfont name="icon-edit-below-line" size="30rpx" color="#333" propClass="margin-right-sm"></iconfont>{{$t('detail.detail.fn3w01')}}{{ blog_main_name }}</view>
|
||||
</view>
|
||||
<view data-value="/pages/plugins/blog/user-list/user-list" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="wh-auto"> <iconfont name="icon-list-dot" size="32rpx" color="#333" propClass="margin-right-sm pr top-xs"></iconfont>{{$t('common.my')}}{{ blog_main_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<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 componentSearch from '@/components/search/search';
|
||||
import componentBanner from '@/components/slider/slider';
|
||||
import componentCountdown from '@/components/countdown/countdown';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
import componentGoodsList from '@/components/goods-list/goods-list';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
bottom_fixed_style: '',
|
||||
data_base: null,
|
||||
category: [],
|
||||
data_list: [],
|
||||
slide_list: [],
|
||||
goods_list: [],
|
||||
hot_list: [],
|
||||
right_list: [],
|
||||
blog_main_name: this.$t('detail.detail.e439j9'),
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentSearch,
|
||||
componentBanner,
|
||||
componentCountdown,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentGoodsList,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if ((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.globalData.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index', 'blog'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
category: data.category || [],
|
||||
data_list: data.data_list || [],
|
||||
slide_list: data.slide_list || [],
|
||||
goods_list: data.goods_list || [],
|
||||
hot_list: data.hot_list || [],
|
||||
right_list: data.right_list || [],
|
||||
blog_main_name: (data.base || null) == null ? this.$t('detail.detail.e439j9') : data.base.blog_main_name || this.$t('detail.detail.e439j9'),
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true,
|
||||
});
|
||||
|
||||
// 基础自定义分享
|
||||
var title = this.data_base.seo_title || this.data_base.application_name;
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: title,
|
||||
desc: this.data_base.seo_desc,
|
||||
path: '/pages/plugins/blog/index/index',
|
||||
img: (this.slide_list || null) != null && this.slide_list.length > 0 ? this.slide_list[0]['images_url'] : '',
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
|
||||
// 标题
|
||||
uni.setNavigationBarTitle({ title: title });
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './index.css';
|
||||
</style>
|
||||
31
pages/plugins/blog/search/search.css
Normal file
31
pages/plugins/blog/search/search.css
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
.search-keywords icon {
|
||||
left: 30rpx;
|
||||
top: calc(50% - 6px);
|
||||
z-index: 1;
|
||||
}
|
||||
.search-keywords input {
|
||||
font-size: 26rpx;
|
||||
padding: 0 30rpx 0 76rpx;
|
||||
box-sizing: border-box;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类导航
|
||||
*/
|
||||
.nav-list {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
.scroll-box {
|
||||
height: calc(100vh - 110rpx - 30px);
|
||||
}
|
||||
342
pages/plugins/blog/search/search.vue
Normal file
342
pages/plugins/blog/search/search.vue
Normal file
@@ -0,0 +1,342 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data_base || null) != null">
|
||||
<!-- 搜索关键字 -->
|
||||
<view class="padding-horizontal-main padding-top-main padding-bottom-sm bg-white">
|
||||
<view class="search-keywords pr">
|
||||
<icon type="search" size="12" class="pa"></icon>
|
||||
<input type="text" confirm-type="search" :placeholder="$t('search.search.723rbx')" :value="search_keywords_value" @confirm="search_keywords_event" class="cr-base round wh-auto" placeholder-class="cr-grey" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 分类 -->
|
||||
<scroll-view v-if="(category || null) != null && category.length > 0" class="nav-list 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' : '')" @tap="nav_event" :data-value="item.id">{{ item.name }}</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view :class="(data_base.is_user_add_blog || 0) == 1 ? 'page-bottom-fixed' : ''">
|
||||
<view v-if="(data_list || null) != null && data_list.length > 0" class="plugins-blog-list padding-horizontal-main padding-top-main oh">
|
||||
<view v-for="(item, index) in data_list" :key="index">
|
||||
<view :data-value="item.url" @tap="url_event" class="item oh cp padding-main border-radius-main bg-white spacing-mb">
|
||||
<image class="blog-img fl radius" :src="item.cover" mode="aspectFill"></image>
|
||||
<view class="base fr">
|
||||
<view class="single-text text-size">{{ item.title }}</view>
|
||||
<view class="cr-grey margin-top-sm">{{ item.add_time_date_cn }}</view>
|
||||
<view class="cr-base text-size-sm multi-text margin-top-sm">{{ item.describe }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 发布博文、我的博文入口 -->
|
||||
<view v-if="(data_base.is_user_add_blog || 0) == 1" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<view class="item flex-row jc-sa align-c text-size fw-b br bg-white round padding-vertical">
|
||||
<view data-value="/pages/plugins/blog/form/form" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="divider-r-d wh-auto"> <iconfont name="icon-edit-below-line" size="30rpx" color="#333" propClass="margin-right-sm"></iconfont>{{$t('detail.detail.fn3w01')}}{{ blog_main_name }}</view>
|
||||
</view>
|
||||
<view data-value="/pages/plugins/blog/user-list/user-list" @tap="url_event" class="flex-1 tc flex-col jc-c align-c cp">
|
||||
<view class="wh-auto"> <iconfont name="icon-list-dot" size="32rpx" color="#333" propClass="margin-right-sm pr top-xs"></iconfont>{{$t('common.my')}}{{ blog_main_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<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';
|
||||
|
||||
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,
|
||||
bottom_fixed_style: '',
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
params: null,
|
||||
data_base: null,
|
||||
category: [],
|
||||
nav_active_value: 0,
|
||||
search_keywords_value: '',
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
blog_main_name: this.$t('detail.detail.e439j9'),
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 参数处理
|
||||
params = app.globalData.launch_params_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
nav_active_value: params.id || 0,
|
||||
search_keywords_value: params.keywords || '',
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_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: {
|
||||
// 初始化
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'search', 'blog'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
// 标题
|
||||
var blog_main_name = (data.base || null) == null ? this.$t('detail.detail.e439j9') : data.base.blog_main_name || this.$t('detail.detail.e439j9');
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
category: data.category || [],
|
||||
blog_main_name: blog_main_name,
|
||||
});
|
||||
uni.setNavigationBarTitle({ title: blog_main_name + this.$t('common.search') });
|
||||
|
||||
// 获取列表数据
|
||||
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'),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('datalist', 'search', 'blog'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
id: this.nav_active_value,
|
||||
bwd: this.search_keywords_value,
|
||||
},
|
||||
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_list_loding_msg: this.$t('common.no_relevant_data_tips'),
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (this.data_page <= 1) {
|
||||
this.setData({
|
||||
data_list: [],
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
} 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() {
|
||||
// 基础自定义分享
|
||||
var info = this.data_base || {};
|
||||
if ((this.nav_active_value || 0) != 0 && this.category.length > 0) {
|
||||
for (var i in this.category) {
|
||||
if (this.nav_active_value == this.category[i]['id']) {
|
||||
info = this.category[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: info.seo_title || this.data_base.application_name,
|
||||
desc: info.seo_desc,
|
||||
path: '/pages/plugins/blog/search/search',
|
||||
query: 'id=' + this.nav_active_value + '&keywords=' + this.search_keywords_value,
|
||||
},
|
||||
});
|
||||
|
||||
// 分享菜单处理
|
||||
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_keywords_event(e) {
|
||||
this.setData({
|
||||
search_keywords_value: e.detail.value || '',
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './search.css';
|
||||
</style>
|
||||
37
pages/plugins/blog/user-list/user-list.css
Normal file
37
pages/plugins/blog/user-list/user-list.css
Normal file
@@ -0,0 +1,37 @@
|
||||
.blog-img {
|
||||
width: 236rpx;
|
||||
height: 182rpx;
|
||||
}
|
||||
|
||||
.badge {
|
||||
display: inline-block;
|
||||
height: 32rpx;
|
||||
line-height: 32rpx;
|
||||
border-radius: 18rpx;
|
||||
font-size: 10px;
|
||||
padding: 0 16rpx;
|
||||
}
|
||||
|
||||
.badge.success {
|
||||
color: #52C41A;
|
||||
background: rgb(82 196 26 / 10%);
|
||||
}
|
||||
|
||||
.badge.info {
|
||||
color: #999;
|
||||
background: #f4f4f4;
|
||||
}
|
||||
|
||||
.badge.error {
|
||||
color: #E22C08;
|
||||
background: rgba(226, 45, 8, 0.1);
|
||||
}
|
||||
|
||||
.add-icon {
|
||||
height: 80rpx;
|
||||
line-height: 76rpx;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
.multi-text {
|
||||
min-height: auto;
|
||||
}
|
||||
281
pages/plugins/blog/user-list/user-list.vue
Normal file
281
pages/plugins/blog/user-list/user-list.vue
Normal file
@@ -0,0 +1,281 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="data.length > 0">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view class="page-bottom-fixed padding-top-main">
|
||||
<view v-for="(item, index) in data" class="bg-white spacing-mb" :key="index">
|
||||
<view class="padding-main flex-row">
|
||||
<view v-if="item.cover" class="padding-right-main">
|
||||
<image class="blog-img radius" :src="item.cover" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="flex-1 flex-width">
|
||||
<view class="multi-text text-size fw-b margin-bottom-xs">{{ item.title }}</view>
|
||||
<view class="text-size-sm cr-grey-9 margin-bottom-sm">{{ item.date }}</view>
|
||||
<view class="badge" :class="item.status == '0' ? 'info' : item.status === '1' ? 'success' : 'error'">{{ item.status_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="br-t-f5 flex-row jc-sa align-c text-size tc">
|
||||
<view class="cr-base flex-1 divider-r-f5 padding-vertical-main" :data-value="'/pages/plugins/blog/form/form?id=' + item.id" @tap="url_event">
|
||||
<view class="margin-right-xs dis-inline-block">
|
||||
<iconfont name="icon-edit-below-line" size="32rpx"></iconfont>
|
||||
</view>{{$t('common.edit')}}</view>
|
||||
<view class="cr-main flex-1 padding-vertical-main" :data-id="item.id" @tap="del_event">
|
||||
<view class="margin-right-xs dis-inline-block">
|
||||
<iconfont name="icon-delete" size="32rpx"></iconfont>
|
||||
</view>{{$t('common.del')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</block>
|
||||
|
||||
<!-- 底部操作 -->
|
||||
<view class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item cr-main bg-white br-main round text-size wh-auto flex-row align-c jc-c" type="default" hover-class="none" data-value="/pages/plugins/blog/form/form" @tap="url_event">
|
||||
<view class="add-icon">
|
||||
<iconfont name="icon-xzdz-tianjiabiaoq" size="32rpx"></iconfont>
|
||||
</view>
|
||||
<text>{{$t('common.add')}}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="data.length == 0 && data_list_loding_status != 3">
|
||||
<!-- 提示信息 -->
|
||||
<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';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
theme_color: app.globalData.get_theme_color(),
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
bottom_fixed_style: '',
|
||||
data: [],
|
||||
data_is_loading: 0,
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
};
|
||||
},
|
||||
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();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 页面销毁时执行
|
||||
onUnload: function () {},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
// 提示错误
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('form.form.8l3ul5'),
|
||||
});
|
||||
}
|
||||
},
|
||||
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', 'blog', 'blog'),
|
||||
method: 'POST',
|
||||
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: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_list_loding_msg: '',
|
||||
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_total: 0,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (this.data_page <= 1) {
|
||||
this.setData({
|
||||
data: [],
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
} 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_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 删除blog
|
||||
del_event(e) {
|
||||
// 是否再次确认
|
||||
if (e.alert_status != 0 && e.alert_status != 1) {
|
||||
app.globalData.alert({
|
||||
msg: this.$t('user-list.user-list.yhvl2q'),
|
||||
is_show_cancel: 1,
|
||||
object: this,
|
||||
params: { id: e.currentTarget.dataset.id },
|
||||
method: 'del_event',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (e.alert_status == 1) {
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('delete', 'blog', 'blog'),
|
||||
method: 'POST',
|
||||
data: { ids: e.id },
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var temp_list = [];
|
||||
var temp_data_list = this.data;
|
||||
for (var i in temp_data_list) {
|
||||
if (e.id.indexOf(temp_data_list[i]['id']) == -1) {
|
||||
temp_list.push(temp_data_list[i]);
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data: temp_list,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.del_success'), 'success');
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(this.$t('common.del_fail'));
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './user-list.css';
|
||||
</style>
|
||||
64
pages/plugins/brand/index/index.css
Normal file
64
pages/plugins/brand/index/index.css
Normal file
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 分类导航
|
||||
*/
|
||||
|
||||
.nav-list {
|
||||
width: calc(100% - 70rpx);
|
||||
}
|
||||
|
||||
.nav-list .item:first-of-type {
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
.nav-list .item {
|
||||
padding: 20rpx 4rpx;
|
||||
}
|
||||
|
||||
.nav-list image {
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
margin: 0 15rpx;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.nav-list-more {
|
||||
width: 100%;
|
||||
max-height: 550rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.nav-list-more image {
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.nav-list-more .item {
|
||||
width: 20%;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
.data-list .item {
|
||||
width: calc(50% - 10rpx);
|
||||
margin-bottom: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.data-list .item:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.data-list .item:nth-child(2n+1) {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.data-list .item image {
|
||||
padding-top: 24rpx;
|
||||
width: calc(100% - 48rpx);
|
||||
height: 160rpx !important;
|
||||
}
|
||||
224
pages/plugins/brand/index/index.vue
Normal file
224
pages/plugins/brand/index/index.vue
Normal file
@@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data_base || null) != null">
|
||||
<view class="pr">
|
||||
<!-- 分类 -->
|
||||
<scroll-view v-if="(brand_category_list || null) != null && brand_category_list.length > 0" :scroll-x="true" :show-scrollbar="false" :scroll-with-animation="true" :scroll-into-view="'one-nav-item-' + nav_active_index" class="nav-list scroll-view-horizontal bg-white oh" scroll-x="true">
|
||||
<view class="flex-row flex-nowrap align-c">
|
||||
<block v-for="(item, index) in brand_category_list" :key="index">
|
||||
<view class="item flex-col align-c text-size-xss" :id="'one-nav-item-' + index" :data-index="index" @tap="nav_event" :data-value="item.id">
|
||||
<image :src="item.icon" mode="aspectFit"></image>
|
||||
<view class="padding-left-sm padding-right-sm round" :class="nav_active_value == item.id ? 'bg-main cr-white' : ''">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<component-nav-more propClass="bg-white" :propStatus="popupStatus" @open-popup="open_popup_event">
|
||||
<view class="nav-list-more">
|
||||
<view class="flex-row flex-wrap align-c">
|
||||
<block v-for="(item, index) in brand_category_list" :key="index">
|
||||
<view class="item flex-col align-c text-size-xss" @tap="nav_event" :id="'one-nav-item-' + index" :data-index="index" :data-value="item.id">
|
||||
<image :src="item.icon" mode="aspectFit"></image>
|
||||
<view class="padding-left-sm padding-right-sm round" :class="nav_active_value == item.id ? 'bg-main cr-white' : ''">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</component-nav-more>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<view v-if="(brand_list || null) != null && brand_list.length > 0" class="data-list padding-horizontal-main padding-top-main oh">
|
||||
<block v-for="(item, index) in brand_list" :key="index">
|
||||
<view v-if="(item.is_not_show || 0) == 0" :data-value="'/pages/goods-search/goods-search?brand=' + item.id" @tap="url_event" class="item border-radius-main bg-white oh cp spacing-mb">
|
||||
<image :src="item.logo" mode="aspectFit"></image>
|
||||
<view class="padding-main tc">
|
||||
<view class="single-text fw-b cr-base">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
|
||||
<!-- 公共 -->
|
||||
<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 componentNavMore from '@/components/nav-more/nav-more';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: null,
|
||||
data_base: null,
|
||||
brand_list: [],
|
||||
brand_category_list: [],
|
||||
nav_active_value: 0,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
popupStatus: false,
|
||||
nav_active_index: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentNavMore,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 加载数据
|
||||
this.get_data();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'index', 'brand'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var brand_list = data.brand_list || [];
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
brand_list: brand_list,
|
||||
brand_category_list: data.brand_category_list || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: brand_list.length > 0 ? 3 : 0,
|
||||
data_bottom_line_status: brand_list.length > 0,
|
||||
});
|
||||
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data_base.seo_title || this.data_base.application_name,
|
||||
desc: this.data_base.seo_desc,
|
||||
path: '/pages/plugins/brand/index/index',
|
||||
},
|
||||
});
|
||||
|
||||
// 导航选中处理
|
||||
this.nav_active_handle();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
nav_active_value: e.currentTarget.dataset.value || 0,
|
||||
popupStatus: false,
|
||||
nav_active_index: e.currentTarget.dataset.index,
|
||||
});
|
||||
this.nav_active_handle();
|
||||
},
|
||||
// 打开弹窗
|
||||
open_popup_event(e) {
|
||||
this.setData({
|
||||
popupStatus: e,
|
||||
});
|
||||
},
|
||||
|
||||
// 导航选中处理
|
||||
nav_active_handle() {
|
||||
var value = this.nav_active_value;
|
||||
var temp_brand_list = this.brand_list;
|
||||
var count = 0;
|
||||
for (var i in temp_brand_list) {
|
||||
if (value == 0) {
|
||||
temp_brand_list[i]['is_not_show'] = 0;
|
||||
count++;
|
||||
} else {
|
||||
var is_not_show = temp_brand_list[i]['brand_category_ids'].indexOf(value) == -1 ? 1 : 0;
|
||||
temp_brand_list[i]['is_not_show'] = is_not_show;
|
||||
if (is_not_show == 0) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
brand_list: temp_brand_list,
|
||||
data_list_loding_status: count > 0 ? 3 : 0,
|
||||
data_bottom_line_status: count > 0,
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './index.css';
|
||||
</style>
|
||||
32
pages/plugins/coin/cash-list/cash-list.css
Normal file
32
pages/plugins/coin/cash-list/cash-list.css
Normal file
@@ -0,0 +1,32 @@
|
||||
.cash .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
.recharge-del-btn {
|
||||
padding: 0 60rpx;
|
||||
font-size: 28rpx;
|
||||
margin: 0 0 0 20rpx;
|
||||
color: #0079ff !important;
|
||||
background-color: #fff;
|
||||
border: 2rpx solid #0079ff;
|
||||
}
|
||||
|
||||
.recharge-del-btn:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
518
pages/plugins/coin/cash-list/cash-list.vue
Normal file
518
pages/plugins/coin/cash-list/cash-list.vue
Normal file
@@ -0,0 +1,518 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="cash">
|
||||
<view class="padding-main bg-white pr nav flex-row oa">
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_accounts_open_event">
|
||||
<view>{{ accounts_name !== null && accounts_name !== $t('common.all') ? accounts_name : $t('cash-list.cash-list.n74r94') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_recharge_status_open_event">
|
||||
<view>{{ recharge_status_name !== null && recharge_status_name !== $t('common.all') ? recharge_status_name : $t('invoice-detail.invoice-detail.rrfex6') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_recharge_status_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c padding-right-xl pr" @tap="popup_network_open_event">
|
||||
<view>{{ network_name !== null && network_name !== $t('common.all') ? network_name : $t('cash-list.cash-list.2g251t') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_network_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main">
|
||||
<view v-if="data_list.length > 0">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-sb align-c">
|
||||
<view class="cr-grey-9 title">{{ item.add_time }}</view>
|
||||
<view :class="item.status == 0 ? 'cr-black' : item.status_type == 1 ? 'cr-grey-9' : 'cr-black'">{{ item.status_name }}</view>
|
||||
</view>
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.e6pffe')}}</text>
|
||||
<text class="fw-b warp">{{ item.cash_no }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title title">{{$t('cash-list.cash-list.2w20g2')}}</text>
|
||||
<text class="fw-b warp">{{ item.platform_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title title">{{$t('cash-list.cash-list.23ii8s')}}</text>
|
||||
<text class="fw-b warp">{{ item.network_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title title">{{$t('cash-list.cash-list.714g2h')}}</text>
|
||||
<text class="fw-b warp">{{ item.address }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.1o8838')}}</text>
|
||||
<text class="fw-b warp">{{ item.coin }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<div v-if="item.status == 0" class="br-t-dashed padding-top-main margin-top-main flex-row jc-e align-c">
|
||||
<button type="default" class="recharge-del-btn round margin-0" :data-id="item.id" @tap="cash_del_event">{{$t('common.del')}}</button>
|
||||
</div>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 账户 -->
|
||||
<component-popup :propShow="popup_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.s7l616')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 类型 -->
|
||||
<component-popup :propShow="popup_recharge_status_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_recharge_status_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.t66tu3')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="recharge_status_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="recharge_status_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in recharge_status_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="recharge_status_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="recharge_status_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_recharge_status_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 网络 -->
|
||||
<component-popup :propShow="popup_network_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_network_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.311tt2')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="network_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="network_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in network_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="network_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.id" :data-index="index" @tap="network_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_network_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</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 componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
|
||||
// 弹窗距离顶部距离
|
||||
popup_top_height: 0,
|
||||
|
||||
// 账户
|
||||
popup_accounts_status: false,
|
||||
accounts_id: null,
|
||||
accounts_list_index: null,
|
||||
accounts_name: null,
|
||||
accounts_list: [],
|
||||
// 类型
|
||||
popup_recharge_status_status: false,
|
||||
status: null,
|
||||
recharge_status_list_index: null,
|
||||
recharge_status_name: null,
|
||||
recharge_status_list: [],
|
||||
// 网络
|
||||
popup_network_status: false,
|
||||
network_id: null,
|
||||
network_list_index: null,
|
||||
network_name: null,
|
||||
network_list: [],
|
||||
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_is_loading: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
accounts_id: params.id || null,
|
||||
});
|
||||
},
|
||||
|
||||
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(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.get_data_list();
|
||||
var self = this;
|
||||
var timer = setInterval(function () {
|
||||
if (self.popup_top_height == 0) {
|
||||
self.popup_top_height_computer();
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('init', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts_list: data.accounts_list || [],
|
||||
recharge_status_list: data.recharge_status_list || [],
|
||||
network_list: data.network_list || [],
|
||||
});
|
||||
if (this.accounts_list.length > 0 && (this.accounts_id || null) != null) {
|
||||
var index = this.accounts_list.findIndex((item) => item.id == this.accounts_id);
|
||||
this.setData({
|
||||
accounts_list_index: index,
|
||||
accounts_id: this.accounts_list[index].id,
|
||||
accounts_name: this.accounts_list[index].platform_name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
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;
|
||||
}
|
||||
}
|
||||
// 是否加载中
|
||||
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 new_data = {
|
||||
accounts_id: this.accounts_id,
|
||||
network_id: this.network_id,
|
||||
status: this.status,
|
||||
page: this.data_page,
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'cash', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
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: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
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: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: !this.popup_accounts_status,
|
||||
popup_recharge_status_status: false,
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
accounts_list_event(e) {
|
||||
this.setData({
|
||||
accounts_list_index: e.currentTarget.dataset.index,
|
||||
accounts_id: e.currentTarget.dataset.value,
|
||||
accounts_name: e.currentTarget.dataset.name,
|
||||
popup_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 类型打开
|
||||
popup_recharge_status_open_event() {
|
||||
this.setData({
|
||||
popup_recharge_status_status: !this.popup_recharge_status_status,
|
||||
popup_accounts_status: false,
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 类型关闭
|
||||
popup_recharge_status_close_event() {
|
||||
this.setData({
|
||||
popup_recharge_status_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 类型选择
|
||||
recharge_status_list_event(e) {
|
||||
this.setData({
|
||||
recharge_status_list_index: e.currentTarget.dataset.index,
|
||||
status: e.currentTarget.dataset.value,
|
||||
recharge_status_name: e.currentTarget.dataset.name,
|
||||
popup_recharge_status_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 网络打开
|
||||
popup_network_open_event() {
|
||||
this.setData({
|
||||
popup_network_status: !this.popup_network_status,
|
||||
popup_accounts_status: false,
|
||||
popup_recharge_status_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 网络关闭
|
||||
popup_network_close_event() {
|
||||
this.setData({
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 网络选择
|
||||
network_list_event(e) {
|
||||
this.setData({
|
||||
network_list_index: e.currentTarget.dataset.index,
|
||||
network_id: e.currentTarget.dataset.value,
|
||||
network_name: e.currentTarget.dataset.name,
|
||||
popup_network_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 删除支付
|
||||
cash_del_event(e) {
|
||||
// 是否再次确认
|
||||
if (e.alert_status != 0 && e.alert_status != 1) {
|
||||
app.globalData.alert({
|
||||
msg: this.$t('cash-list.cash-list.8hrc73'),
|
||||
is_show_cancel: 1,
|
||||
object: this,
|
||||
params: { id: e.currentTarget.dataset.id },
|
||||
method: 'cash_del_event',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (e.alert_status == 1) {
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('delete', 'cash', 'coin'),
|
||||
method: 'POST',
|
||||
data: { ids: e.id },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.del_success'), 'success');
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(this.$t('common.del_fail'));
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 计算搜索框的高度
|
||||
popup_top_height_computer() {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select('.nav')
|
||||
.boundingClientRect((res) => {
|
||||
if ((res || null) != null) {
|
||||
// 获取搜索框高度
|
||||
this.setData({
|
||||
popup_top_height: res.height,
|
||||
});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './cash-list.css';
|
||||
</style>
|
||||
118
pages/plugins/coin/cash/cash.css
Normal file
118
pages/plugins/coin/cash/cash.css
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* 顶部
|
||||
*/
|
||||
.cash .title {
|
||||
background: radial-gradient(60% 70% at 90% 79%, rgba(33, 125, 239, 0.85) 0%, #A6C8F3 100%);
|
||||
padding-top: 130rpx;
|
||||
/* #ifndef H5 */
|
||||
padding-top: calc(var(--status-bar-height) + 5px + 130rpx);
|
||||
/* #endif */
|
||||
padding-bottom: 180rpx;
|
||||
}
|
||||
|
||||
.coin-dropdown {
|
||||
--height: 48rpx;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 64rpx 0 32rpx;
|
||||
background: rgba(255, 255, 255, 0.23);
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.coin-dropdown-icon {
|
||||
right: 36rpx;
|
||||
top: 2rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.cash .detail {
|
||||
--height: 64rpx;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
background: rgba(255, 255, 255, 0.34);
|
||||
border-radius: 200rpx 0 0 200rpx;
|
||||
padding: 0 32rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.cash .text {
|
||||
color: #EBF3FF;
|
||||
}
|
||||
|
||||
/*
|
||||
* 内容
|
||||
*/
|
||||
.cash .content {
|
||||
margin-top: -200rpx;
|
||||
border-radius: 32rpx 32rpx 0 0;
|
||||
min-height: calc(100vh - 528rpx);
|
||||
/* #ifndef H5 */
|
||||
min-height: calc(100vh - 528rpx - var(--status-bar-height) - 5px);
|
||||
/* #endif */
|
||||
}
|
||||
.cash .recharge-content-input-bg,
|
||||
.cash .content-input-bg {
|
||||
background-color: #fafafc;
|
||||
}
|
||||
|
||||
.cash .price-item {
|
||||
--size: -10rpx;
|
||||
margin-left: var(--size);
|
||||
margin-right: var(--size);
|
||||
width: calc(100% - var(--size));
|
||||
}
|
||||
|
||||
.cash .price-list {
|
||||
background: #F5F7F9;
|
||||
border: 2rpx solid #F5F7F9;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 0;
|
||||
margin: 18rpx 10rpx;
|
||||
width: calc((100% / 3) - 24rpx);
|
||||
}
|
||||
|
||||
.cash .price-img {
|
||||
--size: 36rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.cash-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.cash-btn:active {
|
||||
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
|
||||
}
|
||||
|
||||
.cash .content-tips .item::before {
|
||||
content: '';
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #30B3FC;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 12rpx;
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 28rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 虚拟币弹窗
|
||||
*/
|
||||
.popup_coin_status_container .scroll-y {
|
||||
height: 40vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
362
pages/plugins/coin/cash/cash.vue
Normal file
362
pages/plugins/coin/cash/cash.vue
Normal file
@@ -0,0 +1,362 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back></component-nav-back>
|
||||
<block v-if="accounts_list.length > 0">
|
||||
<view class="cash">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="title flex-col padding-lg">
|
||||
<view class="margin-bottom-xxxl flex-row jc-sb margin-top-xl">
|
||||
<view v-if="(accounts || mull) != null" class="cr-white">
|
||||
<view class="flex-row align-e margin-bottom-main">
|
||||
<view class="flex-row align-c pr coin-dropdown" @tap="popup_coin_status_open_event">
|
||||
<image v-if="(accounts.platform_icon || null) != null" :src="accounts.platform_icon" mode="widthFix" class="coin-content-list-img round" />
|
||||
<text class="margin-left-xs">{{ accounts.platform_name }}</text>
|
||||
<view class="coin-dropdown-icon pa padding-left-xxl">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#fff"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-size-xs fw-b padding-left-main text">{{$t('cash.cash.zmhf3n')}}</view>
|
||||
</view>
|
||||
<view class="flex-row align-e">
|
||||
<view class="text-size-40 fw-b">{{ accounts.normal_coin }}</view>
|
||||
<view class="padding-left-sm margin-bottom-main cr-grey-d">{{ accounts.default_symbol }} {{ accounts.default_coin }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail pa right-0 fw-b cr-white" :data-value="'/pages/plugins/coin/cash-list/cash-list?id='+accounts.id" @tap="url_event">{{$t('pages.plugins-coin-cash-list')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content padding-main">
|
||||
<view class="padding-xxxl bg-white radius-md margin-bottom-main">
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main fw-b">{{$t('cash.cash.f6p4hm')}}</view>
|
||||
<view class="padding-vertical-main br-b-e flex-row align-c">
|
||||
<input type="digit" :value="coin_num" class="flex-1 flex-width" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('common.please_input')" @input="coin_num_change" />
|
||||
<view @tap.stop="all_cash_event">{{$t('cash.cash.6oc6e7')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main">{{$t('cash.cash.ucg8e2')}}</view>
|
||||
<view class="recharge-content-input-bg padding-main border-radius-sm flex-row align-c">
|
||||
<input type="text" name="coin_address" class="padding-right-sm flex-1 flex-width" :value="coin_address" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('cash.cash.i1f373')" @input="coin_address_change" />
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="margin-bottom-main">{{$t('cash.cash.h9i16y')}}</view>
|
||||
<block v-if="network_list.length > 0">
|
||||
<picker class="content-input-bg padding-main margin-bottom-main border-radius-sm" @change="cash_event" :value="network_list_index" :range="network_list" range-key="name">
|
||||
<view class="picker arrow-bottom">
|
||||
{{ network_list[network_list_index]['name'] }}
|
||||
</view>
|
||||
</picker>
|
||||
</block>
|
||||
<view v-else class="cr-grey margin-bottom">{{$t('cash.cash.1g49wo')}}</view>
|
||||
<view class="content-input-bg padding-main border-radius-sm">
|
||||
<input type="text" name="user_note" :value="user_note" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('cash.cash.g05p4g')" @input="user_note_change" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="padding-main bg-white radius-md">
|
||||
<view class="padding-vertical-sm border-radius-sm flex-row align-c">
|
||||
<text class="text-size fw-b">支付密码</text>
|
||||
<view class="padding-left-lg">
|
||||
<input type="digit" name="coin" :value="pay_pwd" placeholder-class="text-size-md cr-grey-9" placeholder="请输入支付密码" />
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="padding-xxxl">
|
||||
<button type="default" class="cash-btn cr-white round" @tap="apply_for_cash_event">{{$t('cash.cash.42b37m')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 虚拟币下拉框 -->
|
||||
<component-popup :propShow="popup_coin_status" propPosition="bottom" @onclose="popup_coin_status_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<view class="fr" @tap.stop="popup_coin_status_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_coin_status_container padding-vertical-main flex-col text-size">
|
||||
<view class="scroll-y">
|
||||
<view v-for="(item, index) in accounts_list" :key="index">
|
||||
<view class="flex-row jc-sb align-c padding-vertical-main" :class="accounts_list.length == index + 1 ? '' : 'br-b-f9'" :data-value="item.id" :data-index="index" @tap="coin_checked_event">
|
||||
<view class="flex-row align-c">
|
||||
<image v-if="platform_icon" :src="item.platform_icon" mode="widthFix" class="coin-list-img round" />
|
||||
<view class="margin-left-sm text-size-md single-text">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="accounts.id == item.id ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="40rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</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 componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
status_bar_height: bar_height,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: {},
|
||||
|
||||
// 虚拟币
|
||||
coin_num: '',
|
||||
|
||||
// 账户
|
||||
accounts: {},
|
||||
|
||||
// 虚拟币下拉框探弹窗状态
|
||||
popup_coin_status: false,
|
||||
// 虚拟币下拉框list
|
||||
accounts_list: [],
|
||||
// 充币网络
|
||||
network_list_index: 0,
|
||||
network_list: [],
|
||||
// 提币地址
|
||||
coin_address: '',
|
||||
// 备注
|
||||
user_note: '',
|
||||
// 支付密码
|
||||
pay_pwd: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
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.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('createinfo', 'cash', 'coin'),
|
||||
method: 'POST',
|
||||
data: {accounts_id : this.accounts.id || this.params.id || null},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts: data.accounts || {},
|
||||
accounts_list: data.accounts_list || [],
|
||||
network_list: data.network_list || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.is_login_check(res.data, this, 'get_data');
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 显示隐藏虚拟币
|
||||
price_change() {
|
||||
this.setData({});
|
||||
},
|
||||
|
||||
// 虚拟币切换
|
||||
coin_checked_event(e) {
|
||||
this.setData({
|
||||
accounts: this.accounts_list[e.currentTarget.dataset.index],
|
||||
coin_num: '',
|
||||
popup_coin_status: false,
|
||||
});
|
||||
this.get_data();
|
||||
},
|
||||
popup_coin_status_open_event() {
|
||||
this.setData({
|
||||
popup_coin_status: !this.popup_coin_status,
|
||||
});
|
||||
},
|
||||
popup_coin_status_close_event() {
|
||||
this.setData({
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 充币网络切换
|
||||
cash_event(e) {
|
||||
this.setData({
|
||||
network_list_index: parseInt(e.detail.value || 0),
|
||||
});
|
||||
},
|
||||
|
||||
// 全部提现
|
||||
all_cash_event(e) {
|
||||
this.setData({
|
||||
coin_num: this.accounts.normal_coin || '',
|
||||
});
|
||||
},
|
||||
|
||||
// 提币地址
|
||||
coin_address_change(e) {
|
||||
this.setData({
|
||||
coin_address: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 提现数量
|
||||
coin_num_change(e) {
|
||||
this.setData({
|
||||
coin_num: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 备注
|
||||
user_note_change(e) {
|
||||
this.setData({
|
||||
user_note: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 申请提现
|
||||
apply_for_cash_event() {
|
||||
if(this.network_list.length == 0) {
|
||||
app.globalData.showToast(this.$t('cash.cash.en6vsa'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// 表单数据
|
||||
var new_data = {
|
||||
accounts_id: this.accounts.id,
|
||||
network_id: this.network_list[this.network_list_index].id,
|
||||
address: this.coin_address,
|
||||
coin: this.coin_num,
|
||||
user_note: this.user_note,
|
||||
};
|
||||
// 数据校验
|
||||
var validation = [
|
||||
{ fields: 'coin', msg: this.$t('cash.cash.w01qjc') },
|
||||
{ fields: 'address', msg: this.$t('cash.cash.i1f373') },
|
||||
];
|
||||
// 验证提交表单
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('create', 'cash', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/coin/cash-list/cash-list', true);
|
||||
}, 1000);
|
||||
} 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.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
|
||||
// 复制文本
|
||||
text_copy_event(e) {
|
||||
app.globalData.text_copy_event(e);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './cash.css';
|
||||
</style>
|
||||
19
pages/plugins/coin/collection/collection.css
Normal file
19
pages/plugins/coin/collection/collection.css
Normal file
@@ -0,0 +1,19 @@
|
||||
.collection .qrcode {
|
||||
margin-bottom: 80rpx;
|
||||
margin-top: 52rpx;
|
||||
}
|
||||
|
||||
.collection .code {
|
||||
margin-bottom: 52rpx;
|
||||
}
|
||||
|
||||
.collection .code .num {
|
||||
padding: 20rpx 28rpx;
|
||||
word-break: break-all;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.collection .code .copy {
|
||||
padding: 40rpx;
|
||||
color: #635BFF;
|
||||
}
|
||||
87
pages/plugins/coin/collection/collection.vue
Normal file
87
pages/plugins/coin/collection/collection.vue
Normal file
@@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="collection">
|
||||
<view class="padding-main pr">
|
||||
<block v-if="(params.accounts_key || null) != null">
|
||||
<view class="padding-lg bg-white radius-md margin-bottom-main tc">
|
||||
<view class="flex-row jc-c qrcode">
|
||||
<w-qrcode :options="qrcode"></w-qrcode>
|
||||
</view>
|
||||
<view class="code br-c radius flex-row">
|
||||
<view class="num flex-1 flex-width flex-row align-c text-size-md">{{ params.accounts_key }}</view>
|
||||
<view class="copy br-l-c text-size fw-b" :data-value="params.accounts_key" @tap.stop="text_copy_event">{{$t('collection.collection.856g12')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cr-grey-9 margin-top-xxl flex-row">
|
||||
<view class="pr">
|
||||
<iconfont name="icon-sigh-o" size="32rpx"></iconfont>
|
||||
</view>
|
||||
<text class="margin-left-sm text-size-xs">{{$t('collection.collection.9p43lu')}}</text>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0"></component-no-data>
|
||||
</block>
|
||||
</view>
|
||||
</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';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
params: {},
|
||||
qrcode: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
qrcode: {
|
||||
code: params.accounts_key || null,
|
||||
size: 280,
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 复制文本
|
||||
text_copy_event(e) {
|
||||
app.globalData.text_copy_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './collection.css';
|
||||
</style>
|
||||
18
pages/plugins/coin/convert-list/convert-list.css
Normal file
18
pages/plugins/coin/convert-list/convert-list.css
Normal file
@@ -0,0 +1,18 @@
|
||||
.convert .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
408
pages/plugins/coin/convert-list/convert-list.vue
Normal file
408
pages/plugins/coin/convert-list/convert-list.vue
Normal file
@@ -0,0 +1,408 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="convert">
|
||||
<view class="padding-main bg-white pr nav flex-row oa">
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_send_accounts_open_event">
|
||||
<view>{{ send_accounts_name !== null && send_accounts_name !== $t('common.all') ? send_accounts_name : $t('convert-list.convert-list.q48666') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_send_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c padding-right-xl pr" @tap="popup_receive_accounts_open_event">
|
||||
<view>{{ receive_accounts_name !== null && receive_accounts_name !== $t('common.all') ? receive_accounts_name : $t('convert-list.convert-list.47646p') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_receive_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main">
|
||||
<view v-if="data_list.length > 0">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-e align-c">
|
||||
<view class="cr-grey-9">{{ item.add_time }}</view>
|
||||
</view>
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.8813rd')}}</text>
|
||||
<text class="fw-b warp">{{ item.convert_no }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.c374ec')}}</text>
|
||||
<text class="fw-b warp">{{ item.convert_value }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.6mxu85')}}</text>
|
||||
<text class="fw-b warp">{{ item.send_accounts_id }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.733518')}}</text>
|
||||
<text class="fw-b warp">{{ item.receive_accounts_id }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.6347mw')}}</text>
|
||||
<text class="fw-b warp">{{ item.coin }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.9oy325')}}</text>
|
||||
<text class="fw-b warp">{{ item.note }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 发起账户 -->
|
||||
<component-popup :propShow="popup_send_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_send_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('convert-list.convert-list.q48666')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="send_accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="send_accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in send_accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="send_accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="send_accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_send_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 接收账户 -->
|
||||
<component-popup :propShow="popup_receive_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_receive_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('convert-list.convert-list.47646p')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="receive_accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="receive_accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in receive_accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="receive_accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="receive_accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_receive_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</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 componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var accounts_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
accounts_static_url: accounts_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
|
||||
// 弹窗距离顶部距离
|
||||
popup_top_height: 0,
|
||||
|
||||
// 发起账户
|
||||
popup_send_accounts_status: false,
|
||||
send_accounts_id: null,
|
||||
send_accounts_list_index: null,
|
||||
send_accounts_name: null,
|
||||
send_accounts_list: [],
|
||||
// 接收账户
|
||||
popup_receive_accounts_status: false,
|
||||
receive_accounts_id: null,
|
||||
receive_accounts_list_index: null,
|
||||
receive_accounts_name: null,
|
||||
receive_accounts_list: [],
|
||||
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_is_loading: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
send_accounts_id: params.id || null,
|
||||
});
|
||||
},
|
||||
|
||||
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(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.get_data_list();
|
||||
var self = this;
|
||||
var timer = setInterval(function () {
|
||||
if (self.popup_top_height == 0) {
|
||||
self.popup_top_height_computer();
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('init', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
send_accounts_list: data.accounts_list || [],
|
||||
receive_accounts_list: data.accounts_list || [],
|
||||
});
|
||||
if (this.send_accounts_list.length > 0 && (this.send_accounts_id || null) != null) {
|
||||
var index = this.send_accounts_list.findIndex((item) => item.id == this.send_accounts_id);
|
||||
this.setData({
|
||||
send_accounts_list_index: index,
|
||||
send_accounts_id: this.send_accounts_list[index].id,
|
||||
send_accounts_name: this.send_accounts_list[index].platform_name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
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;
|
||||
}
|
||||
}
|
||||
// 是否加载中
|
||||
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 new_data = {
|
||||
send_accounts_id: this.send_accounts_id,
|
||||
receive_accounts_id: this.receive_accounts_id,
|
||||
page: this.data_page,
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'convert', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
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: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
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: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_send_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_send_accounts_status: !this.popup_send_accounts_status,
|
||||
popup_receive_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_send_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_send_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
send_accounts_list_event(e) {
|
||||
this.setData({
|
||||
send_accounts_list_index: e.currentTarget.dataset.index,
|
||||
send_accounts_id: e.currentTarget.dataset.value,
|
||||
send_accounts_name: e.currentTarget.dataset.name,
|
||||
popup_send_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_receive_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_receive_accounts_status: !this.popup_receive_accounts_status,
|
||||
popup_send_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_receive_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_receive_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
receive_accounts_list_event(e) {
|
||||
this.setData({
|
||||
receive_accounts_list_index: e.currentTarget.dataset.index,
|
||||
receive_accounts_id: e.currentTarget.dataset.value,
|
||||
receive_accounts_name: e.currentTarget.dataset.name,
|
||||
popup_receive_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 计算搜索框的高度
|
||||
popup_top_height_computer() {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select('.nav')
|
||||
.boundingClientRect((res) => {
|
||||
if ((res || null) != null) {
|
||||
// 获取搜索框高度
|
||||
this.setData({
|
||||
popup_top_height: res.height,
|
||||
});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './convert-list.css';
|
||||
</style>
|
||||
77
pages/plugins/coin/convert/convert.css
Normal file
77
pages/plugins/coin/convert/convert.css
Normal file
@@ -0,0 +1,77 @@
|
||||
.coin-dropdown {
|
||||
--height: 72rpx;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 52rpx 0 20rpx;
|
||||
background: #F6F6F6;
|
||||
border-radius: 36rpx;
|
||||
width: 180rpx;
|
||||
}
|
||||
|
||||
.coin-dropdown-icon {
|
||||
right: 24rpx;
|
||||
top: 2rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.coin-num {
|
||||
--height: 72rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.num.input-br {
|
||||
border: 2rpx solid #F6F6F6;
|
||||
}
|
||||
|
||||
.coin-num .num {
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 20rpx 0 20rpx;
|
||||
border-radius: 36rpx;
|
||||
width: 196rpx;
|
||||
}
|
||||
|
||||
.coin-center-convert {
|
||||
--size: 82rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
margin-top: -54rpx;
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
border: 2rpx solid #e1e1e1;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.convert-icon {
|
||||
transition: all 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.convert_true {
|
||||
transform: rotate3d(1, 0, 0, 180deg);
|
||||
}
|
||||
|
||||
.convert_false {
|
||||
transform: rotate3d(1, 0, 0, 0deg);
|
||||
}
|
||||
|
||||
.convert-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.convert-btn:active {
|
||||
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 36rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
342
pages/plugins/coin/convert/convert.vue
Normal file
342
pages/plugins/coin/convert/convert.vue
Normal file
@@ -0,0 +1,342 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="accounts_list.length > 0">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main pr">
|
||||
<view class="padding-lg bg-white radius-md margin-bottom-main">
|
||||
<view class="br-f5 margin-bottom-main radius-md padding-lg flex-row jc-sb">
|
||||
<view>
|
||||
<view class="flex-row align-c pr coin-dropdown" @tap="popup_coin_status_event(1)">
|
||||
<image v-if="accounts_list[send_accounts_id_index]['platform_icon']" :src="accounts_list[send_accounts_id_index]['platform_icon']" mode="widthFix" class="coin-content-list-img round" />
|
||||
<text class="margin-left-sm fw-b single-text">{{ accounts_list[send_accounts_id_index]['platform_name'] }}</text>
|
||||
<view class="coin-dropdown-icon pa padding-left-xxl">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#666"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-main text-size-xs flex-row align-c">
|
||||
<text class="margin-right-sm">{{$t('convert.convert.o56h58')}}</text><text class="cr-blue">{{ accounts_list[send_accounts_id_index]['platform_symbol'] }} {{ accounts_list[send_accounts_id_index]['normal_coin'] }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coin-num pr flex-col">
|
||||
<input type="digit" name="coin" :value="default_value" class="num input-br text-size" placeholder-class="text-size-sm cr-grey-9" :placeholder="$t('common.please_input')" @input="default_coin_change_event" />
|
||||
<view class="margin-top-main tr text-size-xs">{{ accounts_list[send_accounts_id_index]['platform_symbol'] }} {{ accounts_list[send_accounts_id_index]['default_coin'] }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coin-center-convert pa flex-row jc-c align-c" @tap="coin_center_convert_event(2)">
|
||||
<iconfont name="icon-convert" class="pa convert-icon" :class="convert_bool ? 'convert_true' : 'convert_false'" color="#1D7DEF" size="36rpx"></iconfont>
|
||||
</view>
|
||||
<view class="br-f5 margin-bottom-main radius-md padding-lg flex-row jc-sb">
|
||||
<view>
|
||||
<view class="flex-row align-c pr coin-dropdown" @tap="popup_coin_status_event">
|
||||
<image v-if="accounts_list[receive_accounts_id_index]['platform_icon']" :src="accounts_list[receive_accounts_id_index]['platform_icon']" mode="widthFix" class="coin-content-list-img round" />
|
||||
<text class="margin-left-sm fw-b single-text">{{ accounts_list[receive_accounts_id_index]['platform_name'] }}</text>
|
||||
<view class="coin-dropdown-icon pa padding-left-xxl">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#666"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-main text-size-xs flex-row align-c">
|
||||
<text class="margin-right-sm">{{$t('convert.convert.o56h58')}}</text><text class="cr-blue">{{ accounts_list[receive_accounts_id_index]['platform_symbol'] }} {{ accounts_list[receive_accounts_id_index]['normal_coin'] }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coin-num pr flex-col">
|
||||
<input type="digit" :value="convert_value" class="num text-size" placeholder-class="text-size-sm cr-grey-9" disabled />
|
||||
<view class="margin-top-main tr text-size-xs">{{ accounts_list[receive_accounts_id_index]['platform_symbol'] }} {{ accounts_list[receive_accounts_id_index]['default_coin'] }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row align-c">
|
||||
<iconfont name="icon-recharge" color="#333" size="32rpx"></iconfont>
|
||||
<view class="margin-left-sm">{{ default_value || 0 }} * {{ accounts_list[send_accounts_id_index]['platform_rate'] }} = {{ Math.round(default_value * accounts_list[receive_accounts_id_index]['platform_rate'] * 100) / 100 }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="padding-main bg-white radius-md margin-bottom-xxxxl flex-row align-c">
|
||||
<text class="padding-right">支付密码</text>
|
||||
<input type="password" :value="pay_pwd" class="text-size flex-1 flex-width" placeholder-class="text-size-md cr-grey-9" placeholder="请输入支付密码" />
|
||||
</view> -->
|
||||
<view class="padding-main radius-md margin-bottom-main">
|
||||
<button type="default" class="convert-btn cr-white round" @tap="convert_submit">{{$t('convert.convert.4kcix6')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 虚拟币下拉框 -->
|
||||
<component-popup :propShow="popup_coin_status" propPosition="bottom" @onclose="popup_coin_status_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<view class="fr" @tap.stop="popup_coin_status_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_coin_status_container padding-vertical-main flex-col text-size">
|
||||
<view class="scroll-y">
|
||||
<view v-for="(item, index) in accounts_list" :key="index" class="flex-row jc-sb align-c padding-vertical-main" :class="accounts_list.length == index + 1 ? '' : 'br-b-f9'" :data-value="item.id" :data-index="index" @tap="coin_checked_event">
|
||||
<view class="flex-row align-c">
|
||||
<image v-if="item.platform_icon" :src="item.platform_icon" mode="widthFix" class="coin-list-img round" />
|
||||
<view class="margin-left-sm text-size-md single-text">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="coin_index == index ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="40rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</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 componentPopup from '@/components/popup/popup';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
|
||||
// 虚拟币状态
|
||||
coin_type: 1,
|
||||
coin_index: 0,
|
||||
// 下标
|
||||
send_accounts_id_index: 0,
|
||||
receive_accounts_id_index: 0,
|
||||
// id
|
||||
send_accounts_id: 0,
|
||||
receive_accounts_id: 0,
|
||||
popup_coin_status: false,
|
||||
accounts_list: [],
|
||||
// 是否转换
|
||||
convert_bool: false,
|
||||
// 输入默认币
|
||||
default_value: '',
|
||||
// 转换币
|
||||
convert_value: '0.00',
|
||||
// 支付密码
|
||||
pay_pwd: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
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.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('createinfo', 'convert', 'coin'),
|
||||
method: 'POST',
|
||||
data: { send_accounts_id: this.send_accounts_id, receive_accounts_id: this.receive_accounts_id },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var send_accounts = data.send_accounts || null;
|
||||
var receive_accounts = data.receive_accounts || null;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
accounts_list: data.accounts_list || [],
|
||||
convert_value: data.convert_value || '0',
|
||||
send_accounts_id: (send_accounts == null) ? 0 : send_accounts.id,
|
||||
receive_accounts_id: (receive_accounts == null) ? 0 : receive_accounts.id,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
if (data.accounts_list.length > 0) {
|
||||
this.setData({
|
||||
send_accounts_id_index: data.accounts_list.findIndex((item) => item.id == data.send_accounts.id),
|
||||
receive_accounts_id_index: data.accounts_list.findIndex((item) => item.id == data.receive_accounts.id),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.is_login_check(res.data, this, 'get_data');
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 虚拟币切换
|
||||
popup_coin_status_event(type) {
|
||||
this.setData({
|
||||
coin_type: type,
|
||||
receive_accounts_idsend_accounts_id_index: this.receive_accounts_id_index,
|
||||
popup_coin_status: true,
|
||||
});
|
||||
},
|
||||
// 切换账户
|
||||
coin_checked_event(e) {
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var old_index = (this.coin_type == 1) ? this.receive_accounts_id_index : this.send_accounts_id_index;
|
||||
if(index == old_index) {
|
||||
app.globalData.showToast(this.$t('convert.convert.327y2v'));
|
||||
return false;
|
||||
}
|
||||
if (this.coin_type == 1) {
|
||||
this.setData({
|
||||
send_accounts_id_index: index,
|
||||
send_accounts_id: e.currentTarget.dataset.value,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
receive_accounts_id_index: index,
|
||||
receive_accounts_id: e.currentTarget.dataset.value,
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
coin_index: index,
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
// 关闭账户选择弹窗
|
||||
popup_coin_status_close_event() {
|
||||
this.setData({
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 虚拟货币调换
|
||||
coin_center_convert_event() {
|
||||
var send_index = this.send_accounts_id_index;
|
||||
var receive_index = this.receive_accounts_id_index;
|
||||
var send_id = this.send_accounts_id;
|
||||
var receive_id = this.receive_accounts_id;
|
||||
this.setData({
|
||||
receive_accounts_id_index: send_index,
|
||||
send_accounts_id_index: receive_index,
|
||||
receive_accounts_id: send_id,
|
||||
send_accounts_id: receive_id,
|
||||
convert_bool: !this.convert_bool,
|
||||
});
|
||||
},
|
||||
// 需要转换的值事件
|
||||
default_coin_change_event(e) {
|
||||
this.setData({
|
||||
default_value: e.detail.value,
|
||||
convert_value: Math.round(e.detail.value * this.accounts_list[this.receive_accounts_id_index]['platform_rate'] * 100) / 100,
|
||||
});
|
||||
},
|
||||
|
||||
// 立即转换
|
||||
convert_submit() {
|
||||
var new_data = {
|
||||
send_accounts_id: this.send_accounts_id,
|
||||
receive_accounts_id: this.receive_accounts_id,
|
||||
coin: this.default_value,
|
||||
};
|
||||
|
||||
// 数据校验
|
||||
var validation = [{ fields: 'coin', msg: this.$t('convert.convert.vyjy7s') }];
|
||||
|
||||
// 验证提交表单
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
// 远程请求
|
||||
this.setData({
|
||||
form_submit_loading: true,
|
||||
});
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('create', 'convert', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/coin/convert-list/convert-list', true);
|
||||
}, 1000);
|
||||
} else {
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
});
|
||||
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: () => {
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
});
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './convert.css';
|
||||
</style>
|
||||
56
pages/plugins/coin/detail/detail.css
Normal file
56
pages/plugins/coin/detail/detail.css
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 顶部
|
||||
*/
|
||||
.coin-title {
|
||||
background: radial-gradient(60% 70% at 90% 79%, rgba(33, 125, 239, 0.41) 0%, rgba(222, 237, 255, 0.56) 100%);
|
||||
padding-top: 130rpx;
|
||||
/* #ifndef H5 */
|
||||
padding-top: calc(var(--status-bar-height) + 5px + 130rpx);
|
||||
/* #endif */
|
||||
border-bottom-left-radius: 60rpx;
|
||||
border-bottom-right-radius: 60rpx;
|
||||
}
|
||||
|
||||
.coin-oprate-list {
|
||||
--size: 76rpx;
|
||||
height: var(--size);
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 内容
|
||||
*/
|
||||
.coin-content .coin-item {
|
||||
max-height: calc(100vh - 688rpx);
|
||||
/* #ifndef H5 */
|
||||
max-height: calc(100vh - 688rpx - var(--status-bar-height) - 5px);
|
||||
/* #endif */
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 80rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 虚拟币弹窗
|
||||
*/
|
||||
.popup_coin_status_container .scroll-y {
|
||||
height: 40vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 明细弹窗
|
||||
*/
|
||||
.popup_user_detail_container .item {
|
||||
background: #EFF0F1;
|
||||
}
|
||||
348
pages/plugins/coin/detail/detail.vue
Normal file
348
pages/plugins/coin/detail/detail.vue
Normal file
@@ -0,0 +1,348 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back :propName="$t('detail.detail.yvmu0z')"></component-nav-back>
|
||||
<view v-if="accounts_list.length > 0">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="coin-title flex-col padding-lg">
|
||||
<view v-if="accounts_list.length > 0 && (accounts || null) != null" class="margin-bottom-xxxxl padding-bottom-main flex-row jc-sb align-c">
|
||||
<view class="flex-row">
|
||||
<image v-if="(accounts.platform_icon || null) != null" :src="accounts.platform_icon" mode="widthFix" class="coin-content-list-img round" />
|
||||
<view class="padding-left-main">
|
||||
<view class="coin-dropdown text-size-md pr margin-bottom-xs flex-row" @tap="popup_coin_status_open_event">
|
||||
<text class="cr-666">{{ accounts.platform_name }}</text>
|
||||
<view class="padding-left-sm">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#666"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="fw-b text-size">{{ is_price_show ? accounts.normal_coin : '***' }}</text>
|
||||
<text v-if="is_price_show" class="cr-grey-9 text-size-xs margin-left">{{ accounts.default_symbol }} {{ accounts.default_coin }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @tap="price_change">
|
||||
<iconfont :name="is_price_show ? 'icon-wodeqianbao-eye' : 'icon-eye-half'" size="44rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row jc-sb">
|
||||
<view v-for="(item, index) in coin_oprate_list" class="flex-1 padding-sm tc text-size-md" :key="index" :data-value="item.url" :data-method="item.method" @tap="url_event">
|
||||
<view class="coin-oprate-list bg-white flex-row align-c jc-c">
|
||||
<view class="pr top-xs">
|
||||
<iconfont :name="item.icon" size="28rpx" color="#635BFF"></iconfont>
|
||||
</view>
|
||||
<view class="margin-left-sm fw-b">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coin-content padding-lg pr">
|
||||
<block v-if="log_list.length > 0" >
|
||||
<view v-for="(item, index) in log_list" :key="index" class="bg-white radius-md padding-main margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-sb align-c">
|
||||
<view>{{ item.coin_type_name }}</view>
|
||||
<view class="cr-grey-9">{{ item.add_time }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9">{{$t('detail.detail.4w20tq')}}</text>
|
||||
<text class="fw-b warp">{{ item.operate_type_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9">{{$t('detail.detail.s101d1')}}</text>
|
||||
<text class="fw-b warp">{{ item.operate_coin }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9">{{$t('detail.detail.e30wj1')}}</text>
|
||||
<text class="fw-b warp">{{ item.original_coin }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9">{{$t('detail.detail.jdour8')}}</text>
|
||||
<text class="fw-b warp">{{ item.latest_coin }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc cr-grey cp" :data-value="'/pages/plugins/coin/transaction-list/transaction-list?id=' + accounts.id" @tap="url_event">
|
||||
<text class="va-m">{{$t('detail.detail.7fhy2u')}}</text>
|
||||
<view class="dis-inline-block va-m margin-top-xs margin-left-xs">
|
||||
<iconfont name="icon-arrow-right" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
<!-- 虚拟币下拉框 -->
|
||||
<component-popup :propShow="popup_coin_status" propPosition="bottom" @onclose="popup_coin_status_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<view class="fr" @tap.stop="popup_coin_status_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_coin_status_container padding-vertical-main flex-col text-size">
|
||||
<view class="scroll-y">
|
||||
<view v-for="(item, index) in accounts_list" :key="index">
|
||||
<view class="flex-row jc-sb align-c padding-vertical-main" :class="accounts_list.length == index + 1 ? '' : 'br-b-f9'" :data-value="item" :data-index="index" @tap="coin_checked_event">
|
||||
<view class="flex-row align-c">
|
||||
<image v-if="item.platform_icon" :src="item.platform_icon" mode="widthFix" class="coin-list-img round" />
|
||||
<view class="margin-left-sm text-size-md single-text">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="accounts.id == item.id ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="40rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 明细 -->
|
||||
<component-popup :propShow="popup_user_detail_status" propPosition="bottom" @onclose="popup_user_detail_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<text class="text-size">{{$t('pages.plugins-coin-detail')}}</text>
|
||||
<view class="fr" @tap.stop="popup_user_detail_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="accounts_list.length > 0 && (accounts || null) != null" class="popup_user_detail_container padding-vertical-main flex-row flex-wrap align-c tc text-size">
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/recharge-list/recharge-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-recharge-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/transfer-list/transfer-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-transfer-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/transaction-list/transaction-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-transaction-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/cash-list/cash-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-cash-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/convert-list/convert-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-convert-list')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
status_bar_height: bar_height,
|
||||
params: null,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
|
||||
// 虚拟币下拉框探弹窗状态
|
||||
popup_coin_status: false,
|
||||
// 虚拟币下拉框list
|
||||
accounts_list: [],
|
||||
// 账户
|
||||
accounts: {},
|
||||
|
||||
// 是否显示虚拟币
|
||||
is_price_show: false,
|
||||
// 虚拟币操作列表
|
||||
coin_oprate_list: [],
|
||||
|
||||
// 明细弹窗
|
||||
popup_user_detail_status: false,
|
||||
|
||||
// 日志列表
|
||||
log_list: [],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
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.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'accounts', 'coin'),
|
||||
method: 'POST',
|
||||
data: {id: this.accounts.id || this.params.id || null},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
accounts: data.accounts || {},
|
||||
accounts_list: data.accounts_list || [],
|
||||
log_list: data.log_list || [],
|
||||
accounts_summary: data.accounts_summary || 0,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
|
||||
// 操作导航
|
||||
var temp_coin_oprate_list = [];
|
||||
if(parseInt(this.accounts.platform_data.is_enable_transfer || 0) == 1) {
|
||||
temp_coin_oprate_list.push({
|
||||
name: this.$t('user.user.29f6n5'),
|
||||
icon: 'icon-transfer-count',
|
||||
url: '/pages/plugins/coin/transfer/transfer?id=' + this.accounts.id,
|
||||
});
|
||||
}
|
||||
temp_coin_oprate_list.push({
|
||||
name: this.$t('index.index.6941e7'),
|
||||
icon: 'icon-collection',
|
||||
url: '/pages/plugins/coin/collection/collection?accounts_key=' + this.accounts.accounts_key,
|
||||
});
|
||||
temp_coin_oprate_list.push({
|
||||
name: this.$t('pages.plugins-coin-detail'),
|
||||
icon: 'icon-detail',
|
||||
url: '',
|
||||
method: true,
|
||||
});
|
||||
this.setData({
|
||||
coin_oprate_list: temp_coin_oprate_list
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 显示隐藏虚拟币
|
||||
price_change() {
|
||||
this.setData({
|
||||
is_price_show: !this.is_price_show,
|
||||
});
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
|
||||
// 虚拟币切换
|
||||
coin_checked_event(e) {
|
||||
this.setData({
|
||||
accounts: this.accounts_list[e.currentTarget.dataset.index],
|
||||
popup_coin_status: false,
|
||||
log_list: [],
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
this.get_data();
|
||||
},
|
||||
popup_coin_status_open_event() {
|
||||
this.setData({
|
||||
popup_coin_status: !this.popup_coin_status,
|
||||
});
|
||||
},
|
||||
popup_coin_status_close_event() {
|
||||
this.setData({
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 明细弹窗打开
|
||||
popup_user_detail_open_event() {
|
||||
this.setData({
|
||||
popup_user_detail_status: true,
|
||||
});
|
||||
},
|
||||
// 明细弹窗关闭
|
||||
popup_user_detail_close_event(e) {
|
||||
this.setData({
|
||||
popup_user_detail_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
if (e.currentTarget.dataset.method) {
|
||||
this.popup_user_detail_open_event();
|
||||
} else {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './detail.css';
|
||||
</style>
|
||||
42
pages/plugins/coin/recharge-list/recharge-list.css
Normal file
42
pages/plugins/coin/recharge-list/recharge-list.css
Normal file
@@ -0,0 +1,42 @@
|
||||
.convert .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.recharge-apy-btn,
|
||||
.recharge-del-btn {
|
||||
padding: 0 60rpx;
|
||||
font-size: 28rpx;
|
||||
margin: 0 0 0 20rpx;
|
||||
}
|
||||
|
||||
.recharge-apy-btn:active,
|
||||
.recharge-del-btn:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.recharge-del-btn {
|
||||
color: #0079ff !important;
|
||||
background-color: #fff;
|
||||
border: 2rpx solid #0079ff;
|
||||
}
|
||||
|
||||
.recharge-apy-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%), #0079FF;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
523
pages/plugins/coin/recharge-list/recharge-list.vue
Normal file
523
pages/plugins/coin/recharge-list/recharge-list.vue
Normal file
@@ -0,0 +1,523 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="convert">
|
||||
<view class="padding-main bg-white pr nav flex-row oa">
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_accounts_open_event">
|
||||
<view>{{ accounts_name !== null && accounts_name !== $t('common.all') ? accounts_name : $t('cash-list.cash-list.n74r94') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_recharge_status_open_event">
|
||||
<view>{{ recharge_status_name !== null && recharge_status_name !== $t('common.all') ? recharge_status_name : $t('invoice-detail.invoice-detail.rrfex6') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_recharge_status_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c padding-right-xl pr" @tap="popup_network_open_event">
|
||||
<view>{{ network_name !== null && network_name !== $t('common.all') ? network_name : $t('cash-list.cash-list.2g251t') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_network_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main">
|
||||
<view v-if="data_list.length > 0">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-sb align-c">
|
||||
<view>{{ item.status_name }}</view>
|
||||
<view class="cr-grey-9">{{ item.add_time }}</view>
|
||||
</view>
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('recharge-list.recharge-list.6b9399')}}</text>
|
||||
<text class="fw-b warp">{{ item.recharge_no }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.2w20g2')}}</text>
|
||||
<text class="fw-b warp">{{ item.platform_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.23ii8s')}}</text>
|
||||
<text class="fw-b warp">{{ item.network_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.714g2h')}}</text>
|
||||
<text class="fw-b warp">{{ item.address }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('recharge-list.recharge-list.epd531')}}</text>
|
||||
<text class="fw-b warp">{{ item.coin }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<div v-if="item.status == 0" class="br-t-dashed padding-top-main margin-top-main flex-row jc-e align-c">
|
||||
<button type="default" class="recharge-del-btn round" :data-id="item.id" @tap="recharge_del_event">{{$t('common.del')}}</button>
|
||||
<button type="default" class="recharge-apy-btn round" :data-id="item.id" @tap="recharge_pay_event">{{$t('order.order.1i873j')}}</button>
|
||||
</div>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 账户 -->
|
||||
<component-popup :propShow="popup_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.s7l616')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 类型 -->
|
||||
<component-popup :propShow="popup_recharge_status_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_recharge_status_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.t66tu3')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="recharge_status_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="recharge_status_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in recharge_status_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="recharge_status_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="recharge_status_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_recharge_status_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 网络 -->
|
||||
<component-popup :propShow="popup_network_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_network_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.311tt2')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="network_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="network_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in network_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="network_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.id" :data-index="index" @tap="network_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_network_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</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 componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var accounts_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
accounts_static_url: accounts_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
|
||||
// 弹窗距离顶部距离
|
||||
popup_top_height: 0,
|
||||
|
||||
// 账户
|
||||
popup_accounts_status: false,
|
||||
accounts_id: null,
|
||||
accounts_list_index: null,
|
||||
accounts_name: null,
|
||||
accounts_list: [],
|
||||
// 类型
|
||||
popup_recharge_status_status: false,
|
||||
status: null,
|
||||
recharge_status_list_index: null,
|
||||
recharge_status_name: null,
|
||||
recharge_status_list: [],
|
||||
// 网络
|
||||
popup_network_status: false,
|
||||
network_id: null,
|
||||
network_list_index: null,
|
||||
network_name: null,
|
||||
network_list: [],
|
||||
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_is_loading: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
accounts_id: params.id || null,
|
||||
});
|
||||
},
|
||||
|
||||
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(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.get_data_list();
|
||||
var self = this;
|
||||
var timer = setInterval(function () {
|
||||
if (self.popup_top_height == 0) {
|
||||
self.popup_top_height_computer();
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('init', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts_list: data.accounts_list || [],
|
||||
recharge_status_list: data.recharge_status_list || [],
|
||||
network_list: data.network_list || [],
|
||||
});
|
||||
if (this.accounts_list.length > 0 && (this.accounts_id || null) != null) {
|
||||
var index = this.accounts_list.findIndex((item) => item.id == this.accounts_id);
|
||||
this.setData({
|
||||
accounts_list_index: index,
|
||||
accounts_id: this.accounts_list[index].id,
|
||||
accounts_name: this.accounts_list[index].platform_name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
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;
|
||||
}
|
||||
}
|
||||
// 是否加载中
|
||||
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 new_data = {
|
||||
accounts_id: this.accounts_id,
|
||||
network_id: this.network_id,
|
||||
status: this.status,
|
||||
page: this.data_page,
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
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: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
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: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: !this.popup_accounts_status,
|
||||
popup_recharge_status_status: false,
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
accounts_list_event(e) {
|
||||
this.setData({
|
||||
accounts_list_index: e.currentTarget.dataset.index,
|
||||
accounts_id: e.currentTarget.dataset.value,
|
||||
accounts_name: e.currentTarget.dataset.name,
|
||||
popup_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 类型打开
|
||||
popup_recharge_status_open_event() {
|
||||
this.setData({
|
||||
popup_recharge_status_status: !this.popup_recharge_status_status,
|
||||
popup_accounts_status: false,
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 类型关闭
|
||||
popup_recharge_status_close_event() {
|
||||
this.setData({
|
||||
popup_recharge_status_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 类型选择
|
||||
recharge_status_list_event(e) {
|
||||
this.setData({
|
||||
recharge_status_list_index: e.currentTarget.dataset.index,
|
||||
status: e.currentTarget.dataset.value,
|
||||
recharge_status_name: e.currentTarget.dataset.name,
|
||||
popup_recharge_status_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 网络打开
|
||||
popup_network_open_event() {
|
||||
this.setData({
|
||||
popup_network_status: !this.popup_network_status,
|
||||
popup_accounts_status: false,
|
||||
popup_recharge_status_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 网络关闭
|
||||
popup_network_close_event() {
|
||||
this.setData({
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 网络选择
|
||||
network_list_event(e) {
|
||||
this.setData({
|
||||
network_list_index: e.currentTarget.dataset.index,
|
||||
network_id: e.currentTarget.dataset.value,
|
||||
network_name: e.currentTarget.dataset.name,
|
||||
popup_network_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 删除
|
||||
recharge_del_event(e) {
|
||||
// 是否再次确认
|
||||
if (e.alert_status != 0 && e.alert_status != 1) {
|
||||
app.globalData.alert({
|
||||
msg: this.$t('recharge-list.recharge-list.l5g8m1'),
|
||||
is_show_cancel: 1,
|
||||
object: this,
|
||||
params: { id: e.currentTarget.dataset.id },
|
||||
method: 'recharge_del_event',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (e.alert_status == 1) {
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('delete', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: { ids: e.id },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.del_success'), 'success');
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(this.$t('common.del_fail'));
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
// 支付
|
||||
recharge_pay_event(e) {
|
||||
app.globalData.url_open('/pages/plugins/coin/recharge-pay/recharge-pay?id=' + e.currentTarget.dataset.id);
|
||||
},
|
||||
|
||||
// 计算搜索框的高度
|
||||
popup_top_height_computer() {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select('.nav')
|
||||
.boundingClientRect((res) => {
|
||||
if ((res || null) != null) {
|
||||
// 获取搜索框高度
|
||||
this.setData({
|
||||
popup_top_height: res.height,
|
||||
});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './recharge-list.css';
|
||||
</style>
|
||||
105
pages/plugins/coin/recharge-pay/recharge-pay.css
Normal file
105
pages/plugins/coin/recharge-pay/recharge-pay.css
Normal file
@@ -0,0 +1,105 @@
|
||||
.coin-dropdown {
|
||||
--height: 72rpx;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 52rpx 0 20rpx;
|
||||
background: #F6F6F6;
|
||||
border-radius: 36rpx;
|
||||
width: 168rpx;
|
||||
}
|
||||
|
||||
.coin-dropdown-icon {
|
||||
right: 24rpx;
|
||||
top: 2rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.coin-num {
|
||||
--height: 72rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.num.input-br {
|
||||
border: 2rpx solid #F6F6F6;
|
||||
}
|
||||
|
||||
.coin-num .num {
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 20rpx 0 20rpx;
|
||||
border-radius: 36rpx;
|
||||
width: 196rpx;
|
||||
}
|
||||
|
||||
.coin-center-convert {
|
||||
--size: 82rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
margin-top: -54rpx;
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
border: 2rpx solid #e1e1e1;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.convert-icon {
|
||||
transition: all 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.convert_true {
|
||||
transform: rotate3d(1, 0, 0, 180deg);
|
||||
}
|
||||
|
||||
.convert_false {
|
||||
transform: rotate3d(1, 0, 0, 0deg);
|
||||
}
|
||||
|
||||
.convert-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.convert-btn:active {
|
||||
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 36rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
.cancel-btn,
|
||||
.submit-btn {
|
||||
width: 50%;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.cancel-btn:active,
|
||||
.submit-btn:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
border: 2rpx solid #0079FF;
|
||||
background-color: transparent;
|
||||
color: #0079FF !important;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background: linear-gradient(107deg, #3AB1F3 0%, #3C6BF7 100%);
|
||||
color: #fff !important;
|
||||
}
|
||||
243
pages/plugins/coin/recharge-pay/recharge-pay.vue
Normal file
243
pages/plugins/coin/recharge-pay/recharge-pay.vue
Normal file
@@ -0,0 +1,243 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main pr page-bottom-fixed">
|
||||
<view class="padding-lg bg-white radius-md margin-bottom-main">
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('recharge-list.recharge-list.6b9399')}}</text>
|
||||
<text class="fw-b">{{ accounts.recharge_no }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.714g2h')}}</text>
|
||||
<text class="fw-b">{{ accounts.address }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.23ii8s')}}</text>
|
||||
<text class="fw-b">{{ accounts.network_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('recharge-list.recharge-list.epd531')}}</text>
|
||||
<text class="fw-b">{{ accounts.coin }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.2w20g2')}}</text>
|
||||
<text class="fw-b">{{ accounts.platform_name }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.2w20g2')}}</text>
|
||||
<text class="fw-b">{{ accounts.add_time }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="flex-row align-e margin-bottom-main">
|
||||
<text class="fw-b">{{$t('recharge-pay.recharge-pay.lutmsv')}}</text>
|
||||
<text class="cr-grey-c text-size-xs">{{$t('recharge-pay.recharge-pay.1a5vqk')}}</text>
|
||||
</view>
|
||||
<component-upload :propData="image_list" :propMaxNum="10" :propPathType="editor_path_type" @call-back="return_image_event"></component-upload>
|
||||
</view>
|
||||
<view class="padding-main bg-white radius-md margin-bottom-xxxxl">
|
||||
<view class="flex-row align-e margin-bottom-main">
|
||||
<text class="fw-b">{{$t('recharge-pay.recharge-pay.wu49vk')}}</text>
|
||||
</view>
|
||||
<textarea :placeholder="$t('recharge-pay.recharge-pay.95pfkd')" name="pay_note" placeholder-class="cr-base" class="wh-auto bg-white" :value="pay_note" :maxlength="pay_note_length_max" @input="pay_note_event"></textarea>
|
||||
</view>
|
||||
<view class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<view class="flex-row align-c">
|
||||
<button type="default" class="item cancel-btn round margin-right-sm" @tap="cancel_event">{{$t('common.cancel')}}</button>
|
||||
<button type="default" class="item submit-btn round margin-left-sm" @tap="submit_event">{{$t('form.form.4yd066')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</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 componentPopup from '@/components/popup/popup';
|
||||
import componentUpload from '@/components/upload/upload';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
bottom_fixed_style: '',
|
||||
params: null,
|
||||
accounts: {},
|
||||
image_list: [],
|
||||
editor_path_type: '',
|
||||
// 备注
|
||||
pay_note: '',
|
||||
pay_note_length_max: '500',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentUpload,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
|
||||
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.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
editor_path_type: data.editor_path_type || '',
|
||||
accounts: data.data || {},
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 上传图片回调
|
||||
return_image_event(data) {
|
||||
this.setData({
|
||||
image_list: data,
|
||||
});
|
||||
},
|
||||
|
||||
// 备注
|
||||
pay_note_event(e) {
|
||||
this.setData({
|
||||
pay_note: e.detail.value.trim(),
|
||||
});
|
||||
},
|
||||
|
||||
// 取消
|
||||
cancel_event() {
|
||||
app.globalData.page_back_prev_event();
|
||||
},
|
||||
|
||||
// 提交
|
||||
submit_event() {
|
||||
var new_data = {
|
||||
id: this.params.id,
|
||||
pay_voucher: this.image_list,
|
||||
pay_note: this.pay_note,
|
||||
};
|
||||
// 数据校验
|
||||
var validation = [
|
||||
{ fields: 'pay_voucher', msg: this.$t('recharge-pay.recharge-pay.v5fok8') },
|
||||
{ fields: 'pay_note', msg: this.$t('recharge-pay.recharge-pay.95pfkd') },
|
||||
];
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('pay', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/coin/recharge-list/recharge-list', true);
|
||||
}, 1000);
|
||||
} 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.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './recharge-pay.css';
|
||||
</style>
|
||||
137
pages/plugins/coin/recharge/recharge.css
Normal file
137
pages/plugins/coin/recharge/recharge.css
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* 顶部
|
||||
*/
|
||||
.recharge-title {
|
||||
background: radial-gradient(60% 70% at 90% 79%, rgba(33, 125, 239, 0.85) 0%, #A6C8F3 100%);
|
||||
padding-top: 130rpx;
|
||||
/* #ifndef H5 */
|
||||
padding-top: calc(var(--status-bar-height) + 5px + 130rpx);
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.coin-dropdown {
|
||||
--height: 48rpx;
|
||||
display: inline-block;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 64rpx 0 32rpx;
|
||||
background: rgba(255, 255, 255, 0.23);
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.coin-dropdown-icon {
|
||||
right: -36rpx;
|
||||
top: 2rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.recharge-qrcode {
|
||||
background-color: #fff;
|
||||
border-radius: 40rpx;
|
||||
text-align: center;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.recharge-qrcode .img {
|
||||
width: 160rpx !important;
|
||||
height: 160rpx !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 内容
|
||||
*/
|
||||
.recharge-content {
|
||||
margin-top: -32rpx;
|
||||
border-radius: 32rpx 32rpx 0 0;
|
||||
min-height: calc(100vh - 528rpx);
|
||||
/* #ifndef H5 */
|
||||
min-height: calc(100vh - 528rpx - var(--status-bar-height) - 5px);
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.recharge-content-input-bg {
|
||||
background-color: #fafafc;
|
||||
}
|
||||
|
||||
.recharge-price-item {
|
||||
--size: -10rpx;
|
||||
margin-left: var(--size);
|
||||
margin-right: var(--size);
|
||||
width: calc(100% - var(--size));
|
||||
}
|
||||
|
||||
.recharge-price-list {
|
||||
background: #F5F7F9;
|
||||
border: 2rpx solid #F5F7F9;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 0;
|
||||
margin: 18rpx 10rpx;
|
||||
width: calc((100% / 3) - 24rpx);
|
||||
}
|
||||
|
||||
.recharge-price-badge {
|
||||
background: linear-gradient(107deg, #8A18DF 0%, #8D17DD 100%), #D8D8D8;
|
||||
border-radius: 16rpx 0px 16rpx 0px;
|
||||
padding: 2rpx 20rpx;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: -20rpx;
|
||||
max-width: calc(100% - 20px);
|
||||
}
|
||||
|
||||
.recharge-price-list.active {
|
||||
background: rgba(8, 140, 226, 0.06);
|
||||
border-radius: 8px;
|
||||
border: 1px solid #2FB0FB;
|
||||
}
|
||||
|
||||
.recharge-price-name {
|
||||
font-size: 44rpx;
|
||||
}
|
||||
|
||||
.recharge-price-img {
|
||||
--size: 36rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.recharge-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.recharge-btn:active {
|
||||
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
|
||||
}
|
||||
|
||||
.recharge-content-tips .item::before {
|
||||
content: '';
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #30B3FC;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 12rpx;
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 28rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 虚拟币弹窗
|
||||
*/
|
||||
.popup_coin_status_container .scroll-y {
|
||||
height: 40vh;
|
||||
overflow-y: auto;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
338
pages/plugins/coin/recharge/recharge.vue
Normal file
338
pages/plugins/coin/recharge/recharge.vue
Normal file
@@ -0,0 +1,338 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back></component-nav-back>
|
||||
<block v-if="accounts_list.length > 0">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="recharge-title flex-col padding-lg">
|
||||
<view v-if="(accounts || mull) != null" class="margin-bottom-xxxl flex-row jc-sb margin-top-xl">
|
||||
<view class="cr-white flex-1 flex-width">
|
||||
<view class="coin-dropdown margin-bottom-main">
|
||||
<view class="flex-row align-c pr" @tap="popup_coin_status_open_event">
|
||||
<image v-if="(accounts.platform_icon || null) != null" :src="accounts.platform_icon" mode="widthFix" class="coin-content-list-img round" />
|
||||
<text class="margin-left-xs">{{ accounts.platform_name }}</text>
|
||||
<view class="coin-dropdown-icon pa padding-left-xxl">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#fff"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-size-xl fw-b single-text">{{ accounts.normal_coin }}</view>
|
||||
</view>
|
||||
<view class="recharge-qrcode">
|
||||
<block v-if="accounts.platform_data.recharge_qrcode">
|
||||
<image :src="accounts.platform_data.recharge_qrcode" mode="widthFix" class="img margin-right-xs radius dis-block" :data-value="accounts.platform_data.recharge_qrcode" @tap="recharge_qrcode_event" />
|
||||
</block>
|
||||
<block v-else>
|
||||
<iconfont name="icon-qrcode" size="160rpx" color="#f6f6f6"></iconfont>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="recharge-content padding-xxl bg-white">
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main">{{$t('recharge.recharge.lh6k86')}}</view>
|
||||
<view class="recharge-content-input-bg padding-main border-radius-sm flex-row align-c">
|
||||
<view class="single-text padding-right-sm flex-1 flex-width">{{ accounts.platform_data.recharge_address }}</view>
|
||||
<view :data-value="accounts.platform_data.recharge_address" @tap.stop="text_copy_event">
|
||||
<iconfont name="icon-copy" size="24rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main">{{$t('recharge.recharge.e5rblc')}}</view>
|
||||
<block v-if="network_list.length > 0">
|
||||
<picker class="recharge-content-input-bg padding-main border-radius-sm" @change="recharge_event" :value="network_list_index" :range="network_list" range-key="name">
|
||||
<view class="picker arrow-bottom">
|
||||
{{ network_list[network_list_index]['name'] }}
|
||||
</view>
|
||||
</picker>
|
||||
</block>
|
||||
<view v-else class="cr-grey">{{$t('cash.cash.1g49wo')}}</view>
|
||||
</view>
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view v-if="accounts.platform_data.preset_data.length > 0">
|
||||
<view class="margin-bottom-xs">{{$t('recharge.recharge.eb6722')}}</view>
|
||||
<view class="flex-row flex-wrap recharge-price-item margin-bottom-xs">
|
||||
<block v-for="(item, index) in accounts.platform_data.preset_data" :key="index">
|
||||
<view class="recharge-price-list flex-col align-c jc-c pr" :class="preset_data_index == index ? 'active' : ''" :data-index="index" :data-value="item.value" @tap="preset_data_change">
|
||||
<view class="flex-row align-c jc-c">
|
||||
<image :src="wallet_static_url + 'recharge-price.png'" mode="widthFix" class="recharge-price-img round" />
|
||||
<view class="margin-left-xs recharge-price-name">{{ item.value }}</view>
|
||||
</view>
|
||||
<view class="margin-top-sm cr-grey-9 text-size-xs">10000</view>
|
||||
<view v-if="item.tips" class="recharge-price-badge text-size-xss cr-white single-text">{{ item.tips }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="recharge-content-input-bg padding-main border-radius-sm flex-row align-c margin-bottom-xxl">
|
||||
<text>{{$t('recharge.recharge.k1e7hs')}}</text>
|
||||
<view class="padding-left-lg">
|
||||
<input type="digit" name="coin" :value="recharge_num" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('recharge.recharge.0i541i')" @input="recharge_num_change" />
|
||||
</view>
|
||||
</view>
|
||||
<button type="default" class="recharge-btn cr-white round" @tap="recharge_submit">{{$t('recharge.recharge.x27b25')}}</button>
|
||||
</view>
|
||||
<view v-if="accounts.platform_data.recharge_desc.length > 0" class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main">{{$t('recharge.recharge.e8n7ul')}}</view>
|
||||
<view class="recharge-content-tips">
|
||||
<view v-for="(item, index) in accounts.platform_data.recharge_desc" :key="index" class="item pr padding-left-xl margin-bottom-sm cr-grey-9 text-size-xs">{{ item }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 虚拟币下拉框 -->
|
||||
<component-popup :propShow="popup_coin_status" propPosition="bottom" @onclose="popup_coin_status_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<view class="fr" @tap.stop="popup_coin_status_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_coin_status_container padding-vertical-main flex-col text-size">
|
||||
<view class="scroll-y">
|
||||
<view v-for="(item, index) in accounts_list" :key="index" class="flex-row jc-sb align-c padding-vertical-main" :class="accounts_list.length == index + 1 ? '' : 'br-b-f9'" :data-value="item" :data-index="index" @tap="coin_checked_event">
|
||||
<view class="flex-row align-c">
|
||||
<image v-if="item.platform_icon" :src="item.platform_icon" mode="widthFix" class="coin-list-img round" />
|
||||
<view class="margin-left-sm text-size-md single-text">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="accounts.id == item.id ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="40rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</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 componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
status_bar_height: bar_height,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: {},
|
||||
|
||||
// 账户
|
||||
accounts: {},
|
||||
// 虚拟币下拉框探弹窗状态
|
||||
popup_coin_status: false,
|
||||
// 虚拟币下拉框list
|
||||
accounts_list: [],
|
||||
// 充币网络
|
||||
network_list_index: 0,
|
||||
network_list: [],
|
||||
// 充值选中下标
|
||||
preset_data_index: null,
|
||||
// 充值数量
|
||||
recharge_num: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
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.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('createinfo', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: {accounts_id : this.accounts.id || this.params.id || null},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts: data.accounts || {},
|
||||
accounts_list: data.accounts_list || [],
|
||||
network_list: data.network_list || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.is_login_check(res.data, this, 'get_data');
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 虚拟币切换
|
||||
coin_checked_event(e) {
|
||||
this.setData({
|
||||
accounts: this.accounts_list[e.currentTarget.dataset.index],
|
||||
popup_coin_status: false,
|
||||
});
|
||||
this.get_data();
|
||||
},
|
||||
popup_coin_status_open_event() {
|
||||
this.setData({
|
||||
popup_coin_status: !this.popup_coin_status,
|
||||
});
|
||||
},
|
||||
popup_coin_status_close_event() {
|
||||
this.setData({
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
// 充币网络切换
|
||||
recharge_event(e) {
|
||||
this.setData({
|
||||
network_list_index: parseInt(e.detail.value || 0),
|
||||
});
|
||||
},
|
||||
// 充值币选中
|
||||
recharge_num_change(e) {
|
||||
this.setData({
|
||||
recharge_num: e.detail.value,
|
||||
});
|
||||
},
|
||||
// 其他充值数量
|
||||
preset_data_change(e) {
|
||||
this.setData({
|
||||
preset_data_index: parseInt(e.currentTarget.dataset.index || 0),
|
||||
recharge_num: parseInt(e.currentTarget.dataset.value || 0),
|
||||
});
|
||||
},
|
||||
// 立即充值
|
||||
recharge_submit() {
|
||||
if(this.network_list.length == 0) {
|
||||
app.globalData.showToast(this.$t('cash.cash.en6vsa'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// 表单数据
|
||||
var new_data = {
|
||||
accounts_id: this.accounts.id,
|
||||
network_id: this.network_list[this.network_list_index].id,
|
||||
address: this.accounts.platform_data.recharge_address,
|
||||
coin: this.recharge_num,
|
||||
};
|
||||
// 数据校验
|
||||
var validation = [{ fields: 'coin', msg: this.$t('recharge.recharge.5q02ar') }];
|
||||
|
||||
// 验证提交表单
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('create', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/coin/recharge-list/recharge-list', true);
|
||||
}, 1000);
|
||||
} 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.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
|
||||
// 复制文本
|
||||
text_copy_event(e) {
|
||||
app.globalData.text_copy_event(e);
|
||||
},
|
||||
|
||||
// 二维码预览
|
||||
recharge_qrcode_event(e) {
|
||||
app.globalData.image_show_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './recharge.css';
|
||||
</style>
|
||||
18
pages/plugins/coin/transaction-list/transaction-list.css
Normal file
18
pages/plugins/coin/transaction-list/transaction-list.css
Normal file
@@ -0,0 +1,18 @@
|
||||
.transaction .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
537
pages/plugins/coin/transaction-list/transaction-list.vue
Normal file
537
pages/plugins/coin/transaction-list/transaction-list.vue
Normal file
@@ -0,0 +1,537 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="transaction">
|
||||
<view class="padding-main bg-white pr nav flex-row oa">
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_accounts_open_event">
|
||||
<view>{{ accounts_name !== null && accounts_name !== $t('common.all') ? accounts_name : $t('cash-list.cash-list.n74r94') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_operate_type_open_event">
|
||||
<view>{{ operate_type_name !== null && operate_type_name !== $t('common.all') ? operate_type_name : $t('wallet-log-detail.wallet-log-detail.tdf3wo') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_operate_type_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_business_type_open_event">
|
||||
<view>{{ business_type_name !== null && business_type_name !== $t('common.all') ? business_type_name : $t('invoice.invoice.l3832z') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_business_type_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c padding-right-xl pr" @tap="popup_coin_type_open_event">
|
||||
<view>{{ coin_type_name !== null && coin_type_name !== $t('common.all') ? coin_type_name : $t('transaction-list.transaction-list.cu39n5') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_coin_type_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main">
|
||||
<view v-if="data_list.length > 0">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-sb align-c">
|
||||
<view>{{ item.business_type_name }}</view>
|
||||
<view class="cr-grey-9">{{ item.add_time }}</view>
|
||||
</view>
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transaction-list.transaction-list.1mf6wj')}}</text>
|
||||
<text class="fw-b warp">{{ item.coin_type_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('detail.detail.4w20tq')}}</text>
|
||||
<text class="fw-b warp">{{ item.operate_type_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transaction-list.transaction-list.2w1o1l')}}</text>
|
||||
<text class="fw-b warp">{{ item.operate_coin }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transaction-list.transaction-list.jgx0cf')}}</text>
|
||||
<text class="fw-b warp">{{ item.original_coin }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.6347mw')}}</text>
|
||||
<text class="fw-b warp">{{ item.latest_coin }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transaction-list.transaction-list.7cv11k')}}</text>
|
||||
<text class="fw-b warp">{{ item.msg }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 账户 -->
|
||||
<component-popup :propShow="popup_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.s7l616')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 操作类型 -->
|
||||
<component-popup :propShow="popup_operate_type_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_operate_type_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('wallet-log-detail.wallet-log-detail.tdf3wo')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="operate_type_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="operate_type_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in operate_type_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="operate_type_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="operate_type_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_operate_type_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 业务类型 -->
|
||||
<component-popup :propShow="popup_business_type_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_business_type_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('invoice.invoice.l3832z')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="business_type_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="business_type_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in business_type_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="business_type_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="business_type_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_business_type_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 币类型 -->
|
||||
<component-popup :propShow="popup_coin_type_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_coin_type_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('transaction-list.transaction-list.cu39n5')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="coin_type_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="coin_type_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in coin_type_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="coin_type_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="coin_type_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_coin_type_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</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 componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var accounts_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
accounts_static_url: accounts_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
|
||||
// 弹窗距离顶部距离
|
||||
popup_top_height: 0,
|
||||
|
||||
// 账户
|
||||
popup_accounts_status: false,
|
||||
accounts_id: null,
|
||||
accounts_list_index: null,
|
||||
accounts_name: null,
|
||||
accounts_list: [],
|
||||
// 操作类型
|
||||
popup_operate_type_status: false,
|
||||
operate_type: null,
|
||||
operate_type_list_index: null,
|
||||
operate_type_name: null,
|
||||
operate_type_list: [],
|
||||
// 业务类型
|
||||
popup_business_type_status: false,
|
||||
business_type: null,
|
||||
business_type_list_index: null,
|
||||
business_type_name: null,
|
||||
business_type_list: [],
|
||||
// 币类型
|
||||
popup_coin_type_status: false,
|
||||
coin_type: null,
|
||||
coin_type_list_index: null,
|
||||
coin_type_name: null,
|
||||
coin_type_list: [],
|
||||
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_is_loading: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
accounts_id: params.id || null,
|
||||
});
|
||||
},
|
||||
|
||||
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(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.get_data_list();
|
||||
var self = this;
|
||||
var timer = setInterval(function () {
|
||||
if (self.popup_top_height == 0) {
|
||||
self.popup_top_height_computer();
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('init', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts_list: data.accounts_list || [],
|
||||
operate_type_list: data.log_operate_type_list || [],
|
||||
business_type_list: data.log_business_type_list || [],
|
||||
coin_type_list: data.log_coin_type_list || [],
|
||||
});
|
||||
if (this.accounts_list.length > 0 && (this.accounts_id || null) != null) {
|
||||
var index = this.accounts_list.findIndex((item) => item.id == this.accounts_id);
|
||||
this.setData({
|
||||
accounts_list_index: index,
|
||||
accounts_id: this.accounts_list[index].id,
|
||||
accounts_name: this.accounts_list[index].platform_name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
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;
|
||||
}
|
||||
}
|
||||
// 是否加载中
|
||||
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 new_data = {
|
||||
accounts_id: this.accounts_id,
|
||||
business_type: this.business_type,
|
||||
operate_type: this.operate_type,
|
||||
coin_type: this.coin_type,
|
||||
page: this.data_page,
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'accountslog', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
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: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
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: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: !this.popup_accounts_status,
|
||||
popup_operate_type_status: false,
|
||||
popup_business_type_status: false,
|
||||
popup_coin_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
accounts_list_event(e) {
|
||||
this.setData({
|
||||
accounts_list_index: e.currentTarget.dataset.index,
|
||||
accounts_id: e.currentTarget.dataset.value,
|
||||
accounts_name: e.currentTarget.dataset.name,
|
||||
popup_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 操作类型打开
|
||||
popup_operate_type_open_event() {
|
||||
this.setData({
|
||||
popup_operate_type_status: !this.popup_operate_type_status,
|
||||
popup_accounts_status: false,
|
||||
popup_business_type_status: false,
|
||||
popup_coin_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 操作类型关闭
|
||||
popup_operate_type_close_event() {
|
||||
this.setData({
|
||||
popup_operate_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 操作类型选择
|
||||
operate_type_list_event(e) {
|
||||
this.setData({
|
||||
operate_type_list_index: e.currentTarget.dataset.index,
|
||||
operate_type: e.currentTarget.dataset.value,
|
||||
operate_type_name: e.currentTarget.dataset.name,
|
||||
popup_operate_type_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 业务类型打开
|
||||
popup_business_type_open_event() {
|
||||
this.setData({
|
||||
popup_business_type_status: !this.popup_business_type_status,
|
||||
popup_accounts_status: false,
|
||||
popup_operate_type_status: false,
|
||||
popup_coin_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 业务类型关闭
|
||||
popup_business_type_close_event() {
|
||||
this.setData({
|
||||
popup_business_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 业务类型选择
|
||||
business_type_list_event(e) {
|
||||
this.setData({
|
||||
business_type_list_index: e.currentTarget.dataset.index,
|
||||
business_type: e.currentTarget.dataset.value,
|
||||
business_type_name: e.currentTarget.dataset.name,
|
||||
popup_business_type_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 币类型打开
|
||||
popup_coin_type_open_event() {
|
||||
this.setData({
|
||||
popup_coin_type_status: !this.popup_coin_type_status,
|
||||
popup_accounts_status: false,
|
||||
popup_operate_type_status: false,
|
||||
popup_business_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 币类型关闭
|
||||
popup_coin_type_close_event() {
|
||||
this.setData({
|
||||
popup_coin_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 币类型选择
|
||||
coin_type_list_event(e) {
|
||||
this.setData({
|
||||
coin_type_list_index: e.currentTarget.dataset.index,
|
||||
coin_type: e.currentTarget.dataset.value,
|
||||
coin_type_name: e.currentTarget.dataset.name,
|
||||
popup_coin_type_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 计算搜索框的高度
|
||||
popup_top_height_computer() {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select('.nav')
|
||||
.boundingClientRect((res) => {
|
||||
if ((res || null) != null) {
|
||||
// 获取搜索框高度
|
||||
this.setData({
|
||||
popup_top_height: res.height,
|
||||
});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './transaction-list.css';
|
||||
</style>
|
||||
18
pages/plugins/coin/transfer-list/transfer-list.css
Normal file
18
pages/plugins/coin/transfer-list/transfer-list.css
Normal file
@@ -0,0 +1,18 @@
|
||||
.transfer-accounts .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user