适配app+分销开发
parent
22b3cac96a
commit
8c825be956
|
|
@ -327,10 +327,7 @@ button:before {
|
|||
* 页面底部浮动、增加底部边距
|
||||
*/
|
||||
.page-bottom-fixed {
|
||||
padding-bottom: calc(172rpx + env(safe-area-inset-bottom) - 40rpx) !important;
|
||||
/* #ifdef H5 */
|
||||
padding-bottom: 172rpx !important;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
14
pages.json
14
pages.json
|
|
@ -546,6 +546,20 @@
|
|||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "推广订单"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "visit-list/visit-list",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "拜访客户"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "visit-form/visit-form",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "新增拜访客户"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -84,23 +84,42 @@ export default {
|
|||
},
|
||||
|
||||
// 打开位置服务
|
||||
choose_location() {
|
||||
choose_location() {
|
||||
// app先返回当前页面再调用位置选择组件
|
||||
// #ifdef APP
|
||||
uni.navigateBack();
|
||||
// #endif
|
||||
|
||||
// 调用位置选择组件
|
||||
uni.chooseLocation({
|
||||
success: (res) => {
|
||||
uni.setStorageSync(this.cache_key, res);
|
||||
success: (res) => {
|
||||
// 位置数据存储缓存中
|
||||
uni.setStorageSync(this.cache_key, res);
|
||||
|
||||
// 触发自定义事件并传递参数给上一页
|
||||
uni.$emit('refresh', { location_success: true });
|
||||
|
||||
// app则不执行返回操作、上面已经返回过了
|
||||
// #ifndef APP
|
||||
setTimeout(function () {
|
||||
uni.navigateBack();
|
||||
}, 500);
|
||||
}, 500);
|
||||
// #endif
|
||||
},
|
||||
fail: (res) => {
|
||||
// 取消则自动返回、则显示错误
|
||||
if (res.errMsg.indexOf("cancel") != -1) {
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
this.setData({ error_msg: res.errMsg });
|
||||
app.globalData.showToast(res.errMsg);
|
||||
fail: (res) => {
|
||||
// 取消则自动返回、则显示错误
|
||||
// error=11 支付宝取消、msg包含cancel则其他平台
|
||||
var msg = res.errorMessage || res.chooseLocation || res.errMsg || '位置选择失败';
|
||||
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);
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -98,7 +98,17 @@ export default {
|
|||
if (this.home_extraction_address_position == 1) {
|
||||
// 首次不请求数据
|
||||
if (this.is_first == 0) {
|
||||
this.user_location_init();
|
||||
// 先解绑自定义事件
|
||||
uni.$off('refresh');
|
||||
// 监听自定义事件并进行页面刷新操作
|
||||
uni.$on('refresh', (data) => {
|
||||
// 初始位置数据
|
||||
if((data.location_success || false) == true) {
|
||||
this.user_location_init();
|
||||
}
|
||||
});
|
||||
|
||||
// 初始化数据
|
||||
this.init();
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<!-- true为空对象 false为非空对象 Object.keys(info).length == 0 -->
|
||||
<view class="ask-container bg-white spacing-mb">
|
||||
<view class="padding-main">
|
||||
<view class="fw-b text-size-xl spacing-mb">{{ info.title }}</view>
|
||||
<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">
|
||||
留言时间: {{ info.add_time_date }}
|
||||
<view class="fw-b padding-horizontal-xs">·</view>
|
||||
|
|
@ -93,7 +93,7 @@
|
|||
logo_square: app.globalData.get_application_logo_square(),
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: true,
|
||||
data: null,
|
||||
info: null,
|
||||
data_base: null,
|
||||
emoji_list: [],
|
||||
// 基础配置
|
||||
|
|
@ -181,8 +181,8 @@
|
|||
goods_is_loading: 0,
|
||||
});
|
||||
|
||||
// 基础自定义分享
|
||||
if(info != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: info.title,
|
||||
|
|
@ -191,6 +191,9 @@
|
|||
query: 'id=' + info.id
|
||||
}
|
||||
});
|
||||
|
||||
// 标题
|
||||
uni.setNavigationBarTitle({ title: info.title || info.content });
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@
|
|||
}
|
||||
|
||||
.scroll-box {
|
||||
height: calc(100vh - 194rpx - var(--status-bar-height) - 5px);
|
||||
height: calc(100vh - 174rpx - var(--status-bar-height));
|
||||
/* #ifdef H5 */
|
||||
height: calc(100vh - 170rpx);
|
||||
height: calc(100vh - 174rpx);
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back :prop-fixed="false" prop-class="bg-white" prop-color="#333">
|
||||
<template slot="right" :class="status_bar_height > 0 ? 'top-search-width' : ''">
|
||||
<view class="margin-left-main" :class="status_bar_height > 0 ? '' : 'flex-1 flex-width'">
|
||||
<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>
|
||||
|
|
@ -72,7 +72,10 @@
|
|||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
status_bar_height: parseInt(app.globalData.get_system_info('statusBarHeight', 0)),
|
||||
is_mp_env: false,
|
||||
// #ifdef MP
|
||||
is_mp_env: true,
|
||||
// #endif
|
||||
data_base: {},
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
|
|
|
|||
|
|
@ -1,28 +1,28 @@
|
|||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null">
|
||||
<view v-if="(info || null) != null">
|
||||
<view class="padding-main bg-white spacing-mb">
|
||||
<view class="spacing-mb">
|
||||
<view class="fw-b text-size-xl">{{ data.title }}</view>
|
||||
<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>时间:</text>
|
||||
<text>{{ data.add_time }}</text>
|
||||
<text>{{ info.add_time }}</text>
|
||||
</view>
|
||||
<view class="fr">
|
||||
<text class="margin-left-xxxl">浏览:</text>
|
||||
<text>{{ data.access_count }}</text>
|
||||
<text>{{ info.access_count }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="oh web-html-content spacing-mb">
|
||||
<view v-if="(data.video_url || null) != null && ((data.is_live_play || 0) == 0 || client_type == 'weixin')">
|
||||
<video :src="data.video_url" class="wh-auto" :autoplay="false" :controls="true"></video>
|
||||
<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="data.content" />
|
||||
<mp-html :content="info.content" />
|
||||
</view>
|
||||
<!-- 评论内容 -->
|
||||
<component-blog-comments :propData="data" :propDataBase="data_base" :propEmojiList="emoji_list"></component-blog-comments>
|
||||
<component-blog-comments :propData="info" :propDataBase="data_base" :propEmojiList="emoji_list"></component-blog-comments>
|
||||
</view>
|
||||
|
||||
<view class="padding-horizontal-main">
|
||||
|
|
@ -56,12 +56,12 @@
|
|||
</view>
|
||||
|
||||
<!-- 相关商品 -->
|
||||
<view v-if="(data.goods_list || null) != null && data.goods_list.length > 0">
|
||||
<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">相关商品</text>
|
||||
<navigator url="/pages/goods-search/goods-search" hover-class="none" class="arrow-right padding-right cr-grey">更多</navigator>
|
||||
</view>
|
||||
<component-goods-list :propData="{ style_type: 1, goods_list: data.goods_list }" :propCurrencySymbol="currency_symbol"></component-goods-list>
|
||||
<component-goods-list :propData="{ style_type: 1, goods_list: info.goods_list }" :propCurrencySymbol="currency_symbol"></component-goods-list>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -94,7 +94,7 @@
|
|||
client_type: app.globalData.application_client_type(),
|
||||
params: null,
|
||||
data_base: null,
|
||||
data: null,
|
||||
info: null,
|
||||
right_list: [],
|
||||
last_next: null,
|
||||
emoji_list: [],
|
||||
|
|
@ -158,31 +158,34 @@
|
|||
uni.stopPullDownRefresh();
|
||||
var data = res.data.data;
|
||||
if (res.data.code == 0 && (data.data || null) != null) {
|
||||
var blog = data.data;
|
||||
var info = data.data || null;
|
||||
var base = data.base || null;
|
||||
this.setData({
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_status: 3,
|
||||
data_base: data.base || null,
|
||||
data: blog,
|
||||
data_base: base,
|
||||
info: info,
|
||||
right_list: data.right_list || [],
|
||||
last_next: data.last_next || null,
|
||||
emoji_list: data.emoji_list || [],
|
||||
blog_main_name: (data.base || null) == null ? '博文' : data.base.blog_main_name || '博文',
|
||||
blog_main_name: (info == null) ? (base == null ? '博文' : (base.blog_main_name || '博文')) : info.title,
|
||||
});
|
||||
|
||||
// 基础自定义分享
|
||||
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,
|
||||
}
|
||||
});
|
||||
|
||||
// 标题
|
||||
uni.setNavigationBarTitle({ title: this.data.title });
|
||||
|
||||
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.cover,
|
||||
}
|
||||
});
|
||||
|
||||
// 标题
|
||||
uni.setNavigationBarTitle({ title: info.title });
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
|
|
|
|||
|
|
@ -128,7 +128,15 @@
|
|||
},
|
||||
|
||||
onShow() {
|
||||
this.user_location_init();
|
||||
// 先解绑自定义事件
|
||||
uni.$off('refresh');
|
||||
// 监听自定义事件并进行页面刷新操作
|
||||
uni.$on('refresh', (data) => {
|
||||
// 初始位置数据
|
||||
if((data.location_success || false) == true) {
|
||||
this.user_location_init();
|
||||
}
|
||||
});
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
|
|
|
|||
|
|
@ -93,7 +93,17 @@ export default {
|
|||
if (this.home_extraction_address_position == 1) {
|
||||
// 首次不请求数据
|
||||
if (this.is_first == 0) {
|
||||
this.user_location_init();
|
||||
// 先解绑自定义事件
|
||||
uni.$off('refresh');
|
||||
// 监听自定义事件并进行页面刷新操作
|
||||
uni.$on('refresh', (data) => {
|
||||
// 初始位置数据
|
||||
if((data.location_success || false) == true) {
|
||||
this.user_location_init();
|
||||
}
|
||||
});
|
||||
|
||||
// 初始化数据
|
||||
this.init();
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
/*
|
||||
* 搜索用户
|
||||
*/
|
||||
|
|
@ -0,0 +1,325 @@
|
|||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="data_list_loding_status != 1" class="page-bottom-fixed">
|
||||
<form @submit="form_submit" class="form-container">
|
||||
<view class="padding-main oh border-radius-main">
|
||||
<view class="user-search">
|
||||
<component-search
|
||||
@onsearch="search_submit_event"
|
||||
:propIsOnEvent="true"
|
||||
:propIsRequired="false"
|
||||
propPlaceholder="输入用户名/昵称/手机/邮箱"
|
||||
propClass="br"
|
||||
:propIsBtn="true"
|
||||
:propDefaultValue="search_input_keywords_value"
|
||||
<!-- #ifdef MP || APP -->
|
||||
propIcon="icon-mendian-sousuosm"
|
||||
propIconColor="#333"
|
||||
@onicon="search_icon_event"
|
||||
:propIsIconOnEvent="true"
|
||||
<!-- #endif -->
|
||||
></component-search>
|
||||
</view>
|
||||
<view class="form-gorup bg-white border-radius-main margin-top-main">
|
||||
<view class="form-gorup-title">拜访内容<text class="form-group-tips-must">*</text></view>
|
||||
<textarea class="cr-base textarea-height" name="content" maxlength="230" auto-height placeholder-class="cr-grey-9" placeholder="拜访内容,最多230个字符"></textarea>
|
||||
</view>
|
||||
|
||||
<view class="form-gorup form-container-upload oh border-radius-main margin-top-main">
|
||||
<view class="form-gorup-title">上传照片<text class="form-group-tips-must">*</text><text class="form-group-tips">最多上传{{form_images_max_count}}张</text></view>
|
||||
<view class="form-upload-data oh">
|
||||
<block v-if="form_images_list.length > 0">
|
||||
<view v-for="(item, index) in form_images_list" :key="index" class="item fl">
|
||||
<text class="delete-icon" @tap="upload_delete_event" :data-index="index">x</text>
|
||||
<image :src="item" @tap="upload_show_event" :data-index="index" mode="aspectFill"></image>
|
||||
</view>
|
||||
</block>
|
||||
<image v-if="(form_images_list || null) == null || form_images_list.length < form_images_max_count" class="item fl upload-icon" :src="common_static_url + 'upload-icon.png'" mode="aspectFill" @tap="file_upload_event"></image>
|
||||
</view>
|
||||
</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" :disabled="form_submit_disabled_status">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
<block v-else>
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMag="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
import componentSearch from '../../../../components/search/search';
|
||||
|
||||
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: '',
|
||||
params: null,
|
||||
search_input_keywords_value: "",
|
||||
form_images_list: [],
|
||||
form_images_max_count: 30,
|
||||
editor_path_type: "",
|
||||
form_submit_disabled_status: false,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentSearch
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
// 用户未绑定手机则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.redirectTo({
|
||||
url: "/pages/login/login?event_callback=init",
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("saveinfo", "visit", "distribution"),
|
||||
method: "POST",
|
||||
data: this.params,
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data: data.data,
|
||||
editor_path_type: data.editor_path_type || "",
|
||||
data_list_loding_status: 3,
|
||||
data_list_loding_msg: '',
|
||||
});
|
||||
} 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: () => {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '网络开小差了哦~',
|
||||
});
|
||||
app.globalData.showToast("网络开小差了哦~");
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 数据提交
|
||||
form_submit(e) {
|
||||
// 表单数据
|
||||
var form_data = e.detail.value;
|
||||
form_data['images'] = this.form_images_list;
|
||||
|
||||
// 数据校验
|
||||
var validation = [
|
||||
{ fields: 'content', msg: '请填写拜访内容' },
|
||||
{ fields: 'images', msg: '请上传拜访图片' },
|
||||
];
|
||||
|
||||
// 验证提交表单
|
||||
if (app.globalData.fields_check(form_data, validation)) {
|
||||
this.setData({
|
||||
form_submit_disabled_status: true,
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('save', 'visit', 'distribution'),
|
||||
method: 'POST',
|
||||
data: form_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
|
||||
} else {
|
||||
this.setData({
|
||||
form_submit_disabled_status: false,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
} else {
|
||||
app.globalData.showToast('提交失败,请重试!');
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
form_submit_disabled_status: false,
|
||||
});
|
||||
app.globalData.showToast('获取数据失败');
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 搜索关键字事件
|
||||
search_input_keywords_event(e) {
|
||||
this.setData({
|
||||
search_input_keywords_value: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 搜索确认事件
|
||||
search_submit_event(e) {
|
||||
this.setData({
|
||||
search_input_keywords_value: e
|
||||
});
|
||||
this.search_user();
|
||||
},
|
||||
|
||||
// icon事件
|
||||
search_icon_event(e) {
|
||||
var self = this;
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
self.setData({
|
||||
search_input_keywords_value: res.result
|
||||
});
|
||||
self.search_user();
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 搜索用户
|
||||
search_user() {
|
||||
console.log(this.search_input_keywords_value)
|
||||
},
|
||||
|
||||
// 上传图片预览
|
||||
upload_show_event(e) {
|
||||
uni.previewImage({
|
||||
current: this.form_images_list[e.currentTarget.dataset.index],
|
||||
urls: this.form_images_list,
|
||||
});
|
||||
},
|
||||
|
||||
// 图片删除
|
||||
upload_delete_event(e) {
|
||||
var self = this;
|
||||
uni.showModal({
|
||||
title: "温馨提示",
|
||||
content: "删除后不可恢复、继续吗?",
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
var list = self.form_images_list;
|
||||
list.splice(e.currentTarget.dataset.index, 1);
|
||||
self.setData({
|
||||
form_images_list: list,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 文件上传
|
||||
file_upload_event(e) {
|
||||
var self = this;
|
||||
uni.chooseImage({
|
||||
count: this.form_images_max_count,
|
||||
success(res) {
|
||||
var success = 0;
|
||||
var fail = 0;
|
||||
var length = res.tempFilePaths.length;
|
||||
var count = 0;
|
||||
self.upload_one_by_one(res.tempFilePaths, success, fail, count, length);
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 采用递归的方式上传多张
|
||||
upload_one_by_one(img_paths, success, fail, count, length) {
|
||||
var self = this;
|
||||
if (self.form_images_list.length < this.form_images_max_count) {
|
||||
uni.uploadFile({
|
||||
url: app.globalData.get_request_url("index", "ueditor"),
|
||||
filePath: img_paths[count],
|
||||
name: "upfile",
|
||||
formData: {
|
||||
action: "uploadimage",
|
||||
path_type: self.editor_path_type,
|
||||
},
|
||||
success: function (res) {
|
||||
success++;
|
||||
if (res.statusCode == 200) {
|
||||
var data = typeof res.data == "object" ? res.data : JSON.parse(res.data);
|
||||
if (data.code == 0 && (data.data.url || null) != null) {
|
||||
var list = self.form_images_list;
|
||||
list.push(data.data.url);
|
||||
self.setData({
|
||||
form_images_list: list,
|
||||
});
|
||||
} else {
|
||||
app.globalData.showToast(data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: function (e) {
|
||||
fail++;
|
||||
},
|
||||
complete: function (e) {
|
||||
count++;
|
||||
|
||||
// 下一张
|
||||
if (count >= length) {
|
||||
// 上传完毕,作一下提示
|
||||
//app.showToast('上传成功' + success +'张', 'success');
|
||||
} else {
|
||||
// 递归调用,上传下一张
|
||||
self.upload_one_by_one(img_paths, success, fail, count, length);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import "./visit-form.css";
|
||||
</style>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
<!-- 头部 -->
|
||||
<view class="header pr z-i">
|
||||
<component-nav-back :prop-fixed="false" prop-color="#333">
|
||||
<template slot="right" :class="status_bar_height > 0 ? 'top-search-width' : 'flex-1 flex-width'">
|
||||
<template slot="right" :class="is_mp_env ? 'top-search-width' : 'flex-1 flex-width'">
|
||||
<view :class="'va-m padding-left-main ' + (is_realstore_top_nav_back == 1 ? 'nav-search' : 'wh-auto')">
|
||||
<!-- #ifndef H5 -->
|
||||
<component-search
|
||||
|
|
@ -308,15 +308,19 @@
|
|||
import componentCartParaCurve from '../../../../components/cart-para-curve/cart-para-curve';
|
||||
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
var status_bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0));
|
||||
var status_bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
theme_color: app.globalData.get_theme_color(),
|
||||
status_bar_height: status_bar_height,
|
||||
content_style: '',
|
||||
common_static_url: common_static_url,
|
||||
is_mp_env: false,
|
||||
// #ifdef MP
|
||||
is_mp_env: true,
|
||||
// #endif
|
||||
content_style: '',
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_is_loading: 0,
|
||||
|
|
@ -454,7 +458,7 @@
|
|||
goods_category: data.goods_category || [],
|
||||
favor_user: data.favor_user || [],
|
||||
tablecode: tablecode,
|
||||
content_style: 'height: calc(100vh - '+content_other_height+' - '+status_bar_height+'px - '+(tablecode == null ? '0rpx' : '44rpx')+');',
|
||||
content_style: 'height: calc(100vh - '+content_other_height+' - '+this.status_bar_height+'px - '+(tablecode == null ? '0rpx' : '44rpx')+');',
|
||||
});
|
||||
|
||||
// 下单类型是否存在索引
|
||||
|
|
|
|||
|
|
@ -78,15 +78,12 @@
|
|||
import componentTitle from '../../../../components/title/title';
|
||||
|
||||
var realstore_static_url = app.globalData.get_static_url('realstore', true);
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
realstore_static_url: realstore_static_url,
|
||||
// #ifdef H5
|
||||
screen_width: window.innerWidth,
|
||||
// #endif
|
||||
screen_width: parseInt(app.globalData.get_system_info('windowWidth', 0, true)),
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
|
|
@ -131,6 +128,15 @@
|
|||
onShow() {
|
||||
// 用户位置初始化
|
||||
this.user_location_init();
|
||||
// 先解绑自定义事件
|
||||
uni.$off('refresh');
|
||||
// 监听自定义事件并进行页面刷新操作
|
||||
uni.$on('refresh', (data) => {
|
||||
// 初始位置数据
|
||||
if((data.location_success || false) == true) {
|
||||
this.user_location_init();
|
||||
}
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
|
|
@ -143,7 +149,9 @@
|
|||
|
||||
// 页面销毁时执行
|
||||
onUnload: function () {
|
||||
// #ifdef H5
|
||||
window.removeEventListener('resize', this.handle_resize);
|
||||
// #endif
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@
|
|||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
onReady: function () {
|
||||
uni.setNavigationBarTitle({
|
||||
|
|
@ -235,8 +235,16 @@
|
|||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.user_location_init();
|
||||
onShow() {
|
||||
// 先解绑自定义事件
|
||||
uni.$off('refresh');
|
||||
// 监听自定义事件并进行页面刷新操作
|
||||
uni.$on('refresh', (data) => {
|
||||
// 初始位置数据
|
||||
if((data.location_success || false) == true) {
|
||||
this.user_location_init();
|
||||
}
|
||||
});
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
|
|
|
|||
Loading…
Reference in New Issue