mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2026-06-07 02:12:25 +08:00
qq/头条小程序适配
This commit is contained in:
@ -532,7 +532,7 @@ App({
|
||||
|
||||
// 拨打电话
|
||||
case 4:
|
||||
swan.makePhoneCall({ phoneNumber: value });
|
||||
this.call_tel(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,15 +65,13 @@ App({
|
||||
"user_orderaftersale": "退款/售后",
|
||||
"user_orderaftersale_detail": "订单售后",
|
||||
"user_order_comments": "订单评论",
|
||||
"coupon": "领劵中心",
|
||||
"user_coupon": "优惠劵",
|
||||
"extraction_address": "自提地址",
|
||||
},
|
||||
|
||||
// 请求地址
|
||||
request_url: "{{request_url}}",
|
||||
// request_url: 'http://shopxo.com/',
|
||||
// request_url: 'https://dev.shopxo.net/',
|
||||
request_url: 'http://shopxo.com/',
|
||||
request_url: 'https://dev.shopxo.net/',
|
||||
|
||||
// 基础信息
|
||||
application_title: "{{application_title}}",
|
||||
@ -86,19 +84,13 @@ App({
|
||||
/**
|
||||
* 小程序初始化
|
||||
*/
|
||||
onLaunch(options) {
|
||||
onLaunch(params) {
|
||||
// 启动参数处理
|
||||
options = this.launch_params_handle(options);
|
||||
params = this.launch_params_handle(params);
|
||||
|
||||
// 设置设备信息
|
||||
this.set_system_info();
|
||||
|
||||
// 缓存启动参数
|
||||
qq.setStorage({
|
||||
key: this.data.cache_launch_info_key,
|
||||
data: options
|
||||
});
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
@ -114,6 +106,12 @@ App({
|
||||
if ((params.scene || null) != null) {
|
||||
params = this.url_params_to_json(decodeURIComponent(params.scene));
|
||||
}
|
||||
// 缓存启动参数
|
||||
qq.setStorage({
|
||||
key: this.data.cache_launch_info_key,
|
||||
data: params
|
||||
});
|
||||
|
||||
return params;
|
||||
},
|
||||
|
||||
@ -171,12 +169,13 @@ App({
|
||||
// 用户信息
|
||||
var user = this.get_user_cache_info();
|
||||
var token = (user == false) ? '' : user.token || '';
|
||||
var uuid = this.request_uuid();
|
||||
return this.data.request_url +
|
||||
"index.php?s=/api/" + c + "/" + a + plugins_params+
|
||||
"&application=app&application_client_type=qq" +
|
||||
"&token=" +
|
||||
token +
|
||||
"&token=" + token +
|
||||
"&ajax=ajax" +
|
||||
"&uuid="+ uuid +
|
||||
params;
|
||||
},
|
||||
|
||||
@ -525,17 +524,12 @@ App({
|
||||
return false;
|
||||
}
|
||||
|
||||
qq.openLocation({
|
||||
name: values[0],
|
||||
address: values[1],
|
||||
longitude: parseFloat(values[2]),
|
||||
latitude: parseFloat(values[3])
|
||||
});
|
||||
this.open_location(values[2], values[3], values[0], values[1]);
|
||||
break;
|
||||
|
||||
// 拨打电话
|
||||
case 4:
|
||||
qq.makePhoneCall({ phoneNumber: value });
|
||||
this.call_tel(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -701,4 +695,159 @@ App({
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取配置信息、可指定默认值
|
||||
* key 数据key(支持多级读取、以 . 分割key名称)
|
||||
* default_value 默认值
|
||||
*/
|
||||
get_config(key, default_value) {
|
||||
var value = null;
|
||||
var config = qq.getStorageSync(this.data.cache_config_info_key) || null;
|
||||
if(config != null)
|
||||
{
|
||||
// 数据读取
|
||||
var arr = key.split('.');
|
||||
if(arr.length == 1)
|
||||
{
|
||||
value = config[key] == undefined ? null : config[key];
|
||||
} else {
|
||||
value = config;
|
||||
for(var i in arr)
|
||||
{
|
||||
if(value[arr[i]] != undefined)
|
||||
{
|
||||
value = value[arr[i]];
|
||||
} else {
|
||||
value = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return (value === null) ? ((default_value === undefined) ? value : default_value) : value;
|
||||
},
|
||||
|
||||
// 初始化 配置信息
|
||||
init_config() {
|
||||
var self = this;
|
||||
qq.request({
|
||||
url: this.get_request_url('common', 'base'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
qq.setStorage({
|
||||
key: this.data.cache_config_info_key,
|
||||
data: res.data.data,
|
||||
fail: () => {
|
||||
this.showToast('配置信息缓存失败');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 配置是否有效(100毫秒检验一次、最多检验100次)
|
||||
* object 回调操作对象
|
||||
* method 回调操作对象的函数
|
||||
*/
|
||||
is_config(object, method) {
|
||||
var self = this;
|
||||
var count = 0;
|
||||
var timer = setInterval(function()
|
||||
{
|
||||
if(self.get_config('status') == 1)
|
||||
{
|
||||
clearInterval(timer);
|
||||
if (typeof object === 'object' && (method || null) != null) {
|
||||
object[method](true);
|
||||
}
|
||||
}
|
||||
count++;
|
||||
if(count >= 100)
|
||||
{
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
|
||||
/**
|
||||
* 百度坐标BD-09到火星坐标GCJ02(高德,谷歌,腾讯坐标)
|
||||
* object 回调操作对象
|
||||
* method 回调操作对象的函数
|
||||
*/
|
||||
map_bd_to_gcj(lng, lat) {
|
||||
let x_pi = 3.14159265358979324 * 3000.0 / 180.0;
|
||||
let x = lng - 0.0065;
|
||||
let y = lat - 0.006;
|
||||
let z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
|
||||
let theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
|
||||
let lngs = z * Math.cos(theta);
|
||||
let lats = z * Math.sin(theta);
|
||||
return {
|
||||
lng: lngs,
|
||||
lat: lats
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* 百度坐标BD-09到火星坐标GCJ02(高德,谷歌,腾讯坐标)
|
||||
* lng 经度
|
||||
* lat 纬度
|
||||
* name 地图上面显示的名称
|
||||
* address 地图上面显示的详细地址
|
||||
* scale 缩放比例,范围5~18
|
||||
*/
|
||||
open_location(lng, lat, name, address, scale) {
|
||||
if(lng == undefined || lat == undefined || lng == '' || lat == '') {
|
||||
this.showToast('坐标有误');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 转换坐标打开位置
|
||||
var position = this.map_bd_to_gcj(parseFloat(lng), parseFloat(lat));
|
||||
qq.openLocation({
|
||||
name: name || '',
|
||||
address: address || '',
|
||||
scale: scale || 18,
|
||||
longitude: position.lng,
|
||||
latitude: position.lat
|
||||
});
|
||||
},
|
||||
|
||||
// uuid生成
|
||||
uuid() {
|
||||
var d = new Date().getTime();
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
var r = (d + Math.random() * 16) % 16 | 0;
|
||||
d = Math.floor(d / 16);
|
||||
return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
|
||||
});
|
||||
},
|
||||
|
||||
// 获取当前uuid
|
||||
request_uuid() {
|
||||
var uuid = qq.getStorageSync(this.data.cache_user_uuid_key) || null;
|
||||
if(uuid == null) {
|
||||
uuid = this.uuid();
|
||||
qq.setStorage({
|
||||
key: this.data.cache_user_uuid_key,
|
||||
data: uuid,
|
||||
fail: () => {
|
||||
this.showToast('uuid缓存失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
return uuid;
|
||||
},
|
||||
|
||||
});
|
||||
@ -39,7 +39,8 @@
|
||||
"pages/plugins/wallet/user-cash/user-cash",
|
||||
"pages/plugins/wallet/user-cash-detail/user-cash-detail",
|
||||
"pages/plugins/excellentbuyreturntocash/profit/profit",
|
||||
"pages/plugins/excellentbuyreturntocash/profit-detail/profit-detail"
|
||||
"pages/plugins/excellentbuyreturntocash/profit-detail/profit-detail",
|
||||
"pages/plugins/exchangerate/currency/currency"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTitleText": "{{application_title}}",
|
||||
|
||||
56
sourcecode/qq/components/quick-nav/quick-nav.js
Normal file
56
sourcecode/qq/components/quick-nav/quick-nav.js
Normal file
@ -0,0 +1,56 @@
|
||||
const app = getApp();
|
||||
Component({
|
||||
data: {
|
||||
popup_status: false,
|
||||
data_list: [],
|
||||
system: null,
|
||||
x: 0,
|
||||
y: 0,
|
||||
is_first: 1,
|
||||
},
|
||||
pageLifetimes: {
|
||||
// 页面被展示
|
||||
show: function() {
|
||||
this.init_config();
|
||||
|
||||
// 非首次进入则重新初始化配置接口
|
||||
if(this.data.is_first == 0) {
|
||||
app.init_config();
|
||||
}
|
||||
|
||||
// 数据设置
|
||||
var system = app.get_system_info();
|
||||
this.setData({
|
||||
is_first: 0,
|
||||
system: system,
|
||||
x: 5,
|
||||
y: (system.windowHeight || 450)-160,
|
||||
});
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({ data_list: app.get_config('quick_nav') || [] });
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 弹层开启
|
||||
quick_open_event(e) {
|
||||
this.setData({popup_status: true, data_list: app.get_config('quick_nav') || []});
|
||||
},
|
||||
|
||||
// 弹层关闭
|
||||
quick_close_event(e) {
|
||||
this.setData({ popup_status: false });
|
||||
},
|
||||
|
||||
// 操作事件
|
||||
navigation_event(e) {
|
||||
app.operation_event(e);
|
||||
},
|
||||
},
|
||||
});
|
||||
6
sourcecode/qq/components/quick-nav/quick-nav.json
Normal file
6
sourcecode/qq/components/quick-nav/quick-nav.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"component-popup": "/components/popup/popup"
|
||||
}
|
||||
}
|
||||
31
sourcecode/qq/components/quick-nav/quick-nav.qml
Normal file
31
sourcecode/qq/components/quick-nav/quick-nav.qml
Normal file
@ -0,0 +1,31 @@
|
||||
<!-- 开启事件 -->
|
||||
<movable-area class="quick-nav-movable-container">
|
||||
<movable-view direction="all" x="{{x}}" y="{{y}}" animation="{{false}}" class="quick-nav-event-submit" bindtap="quick_open_event">
|
||||
<image src="/images/quick-submit-icon.png" mode="widthFix"></image>
|
||||
</movable-view>
|
||||
</movable-area>
|
||||
|
||||
<!-- 弹窗 -->
|
||||
<component-popup prop-show="{{popup_status}}" prop-position="bottom" bindonclose="quick_close_event">
|
||||
<view class="quick-nav-popup-container">
|
||||
<view class="close oh">
|
||||
<view class="icon-right" catchtap="quick_close_event">
|
||||
<icon type="clear" size="20" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="quick-nav-popup-content">
|
||||
<view qq:if="{{data_list.length > 0}}" class="quick-nav-data-list">
|
||||
<view class="items" qq:for="{{data_list}}" qq:key="key">
|
||||
<view class="items-content" data-value="{{item.event_value}}" data-type="{{item.event_type}}" bindtap="navigation_event" style="background-color:{{item.bg_color}}">
|
||||
<image src="{{item.images_url}}" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="title">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view qq:else>
|
||||
<import src="/pages/common/nodata.qml" />
|
||||
<template is="nodata" data="{{status: 0}}"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
101
sourcecode/qq/components/quick-nav/quick-nav.qss
Normal file
101
sourcecode/qq/components/quick-nav/quick-nav.qss
Normal file
@ -0,0 +1,101 @@
|
||||
/**
|
||||
* 按钮
|
||||
*/
|
||||
.quick-nav-movable-container {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 150rpx;
|
||||
left: 0;
|
||||
background:transparent;
|
||||
pointer-events: none;
|
||||
z-index: 2;
|
||||
}
|
||||
.quick-nav-event-submit {
|
||||
pointer-events: auto;
|
||||
position: fixed;
|
||||
bottom: 150rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
|
||||
background-color: rgb(210 54 76 / 80%);
|
||||
}
|
||||
.quick-nav-event-submit image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
margin: 25rpx auto 25rpx auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* 弹窗
|
||||
*/
|
||||
.quick-nav-popup-container {
|
||||
padding: 20rpx 10rpx 0 10rpx;
|
||||
background: #fff;
|
||||
}
|
||||
.quick-nav-popup-container .close {
|
||||
overflow: hidden;
|
||||
}
|
||||
.quick-nav-popup-container .close .icon-right {
|
||||
float: right;
|
||||
}
|
||||
.quick-nav-popup-content {
|
||||
max-height: 80vh;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
.quick-nav-data-list {
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
}
|
||||
.quick-nav-data-list .items {
|
||||
width: calc(25% - 60rpx);
|
||||
float: left;
|
||||
padding: 30rpx;
|
||||
}
|
||||
.quick-nav-data-list .items-content {
|
||||
border-radius: 50%;
|
||||
padding: 20rpx;
|
||||
text-align: center;
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.quick-nav-data-list .items image {
|
||||
width: 60rpx !important;
|
||||
height: 60rpx !important;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
.quick-nav-data-list .items .title {
|
||||
margin-top: 10rpx;
|
||||
font-size: 28rpx !important;
|
||||
text-align:center;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/*
|
||||
* 没有数据
|
||||
*/
|
||||
.quick-nav-popup-container .no-data-box {
|
||||
padding: 80rpx 0;
|
||||
text-align: center;
|
||||
}
|
||||
.quick-nav-popup-container .no-data-box image {
|
||||
width: 160rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.quick-nav-popup-container .no-data-box .no-data-tips {
|
||||
font-size: 28rpx;
|
||||
color: #a6a6a6;
|
||||
}
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_list_loding_status: 1,
|
||||
buy_submit_disabled_status: false,
|
||||
data_list_loding_msg: '',
|
||||
@ -16,7 +15,6 @@ Page({
|
||||
is_first: 1,
|
||||
extension_data: [],
|
||||
payment_id: 0,
|
||||
common_order_is_booking: 0,
|
||||
common_site_type: 0,
|
||||
extraction_address: [],
|
||||
site_model: 0,
|
||||
@ -25,6 +23,10 @@ Page({
|
||||
{ name: "自提点取货", value: 2 }
|
||||
],
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
common_order_is_booking: 0,
|
||||
|
||||
// 优惠劵
|
||||
plugins_coupon_data: null,
|
||||
plugins_use_coupon_ids: [],
|
||||
@ -44,11 +46,29 @@ Page({
|
||||
},
|
||||
|
||||
onShow() {
|
||||
qq.setNavigationBarTitle({ title: app.data.common_pages_title.buy });
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
this.setData({ is_first: 0 });
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
common_order_is_booking: app.get_config('config.common_order_is_booking'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
// 订单参数信息是否正确
|
||||
if (this.data.params == null) {
|
||||
@ -102,7 +122,6 @@ Page({
|
||||
total_price: data.base.actual_price,
|
||||
extension_data: data.extension_data || [],
|
||||
data_list_loding_status: 3,
|
||||
common_order_is_booking: data.common_order_is_booking || 0,
|
||||
common_site_type: data.common_site_type || 0,
|
||||
extraction_address: data.base.extraction_address || [],
|
||||
plugins_coupon_data: data.plugins_coupon_data || null,
|
||||
@ -359,14 +378,9 @@ Page({
|
||||
return false;
|
||||
}
|
||||
|
||||
var lng = parseFloat(data.lng || 0);
|
||||
var lat = parseFloat(data.lat || 0);
|
||||
qq.openLocation({
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
scale: 18,
|
||||
name: data.name || data.alias || '',
|
||||
address: (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || ''),
|
||||
});
|
||||
// 打开地图
|
||||
var name = data.name || data.alias || '';
|
||||
var address = (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || '');
|
||||
app.open_location(data.lng, data.lat, name, address);
|
||||
},
|
||||
});
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav",
|
||||
"component-popup": "/components/popup/popup"
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
<import src="/pages/common/nodata.qml" />
|
||||
<template is="nodata" data="{{status: 2, msg: '展示型不允许提交订单'}}"></template>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<block qq:else>
|
||||
<view qq:if="{{goods_list.length > 0}}" class="page">
|
||||
<!-- 销售+自提 模式选择 -->
|
||||
<view qq:if="{{common_site_type == 4}}" class="buy-header-nav oh tc">
|
||||
@ -151,4 +151,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</block>
|
||||
</block>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
@ -11,17 +10,38 @@ Page({
|
||||
is_selected_all: false,
|
||||
buy_submit_disabled_status: true,
|
||||
|
||||
// 站点模式
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
common_site_type: 0,
|
||||
common_is_exhibition_mode_btn_text: null,
|
||||
customer_service_tel: null,
|
||||
common_app_customer_service_tel: null,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
qq.setNavigationBarTitle({ title: app.data.common_pages_title.cart });
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
common_site_type: app.get_config('config.common_site_type'),
|
||||
common_is_exhibition_mode_btn_text: app.get_config('config.common_is_exhibition_mode_btn_text', '立即咨询'),
|
||||
common_app_customer_service_tel: app.get_config('config.common_app_customer_service_tel'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init(e) {
|
||||
var user = app.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
@ -84,11 +104,6 @@ Page({
|
||||
data_list_loding_status: data.data.length == 0 ? 0 : 3,
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_msg: '购物车空空如也',
|
||||
|
||||
// 站点模式
|
||||
common_site_type: data.common_site_type || 0,
|
||||
common_is_exhibition_mode_btn_text: data.common_is_exhibition_mode_btn_text || '立即咨询',
|
||||
customer_service_tel: data.customer_service_tel || null,
|
||||
});
|
||||
|
||||
// 导航购物车处理
|
||||
@ -384,7 +399,7 @@ Page({
|
||||
|
||||
// 展示型事件
|
||||
exhibition_submit_event(e) {
|
||||
app.call_tel(this.data.customer_service_tel);
|
||||
app.call_tel(this.data.common_app_customer_service_tel);
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav"
|
||||
}
|
||||
}
|
||||
@ -81,4 +81,7 @@
|
||||
<view qq:if="{{data_list.length == 0 && data_list_loding_status != 0}}">
|
||||
<import src="/pages/common/nodata.qml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
@ -107,22 +107,17 @@ Page({
|
||||
// 地图查看
|
||||
address_map_event(e) {
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var ads = this.data.data_list[index] || null;
|
||||
if (ads == null)
|
||||
var data = this.data.data_list[index] || null;
|
||||
if (data == null)
|
||||
{
|
||||
app.showToast("地址有误");
|
||||
return false;
|
||||
}
|
||||
|
||||
var lng = parseFloat(ads.lng || 0);
|
||||
var lat = parseFloat(ads.lat || 0);
|
||||
qq.openLocation({
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
scale: 18,
|
||||
name: ads.alias || '',
|
||||
address: (ads.province_name || '') + (ads.city_name || '') + (ads.county_name || '') + (ads.address || ''),
|
||||
});
|
||||
// 打开地图
|
||||
var name = data.name || data.alias || '';
|
||||
var address = (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || '');
|
||||
app.open_location(data.lng, data.lat, name, address);
|
||||
},
|
||||
|
||||
// 地址内容事件
|
||||
|
||||
@ -4,16 +4,31 @@ Page({
|
||||
data_list_loding_status: 1,
|
||||
nav_active_index: 0,
|
||||
data_list: [],
|
||||
category_show_level: 3,
|
||||
data_content: null,
|
||||
|
||||
// 基础配置
|
||||
category_show_level: 3,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
qq.setNavigationBarTitle({title: app.data.common_pages_title.goods_category});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 显示分享菜单
|
||||
app.show_share_menu();
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
category_show_level: app.get_config('config.category_show_level'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
@ -43,7 +58,6 @@ Page({
|
||||
}
|
||||
this.setData({
|
||||
data_list: category,
|
||||
category_show_level: res.data.data.category_show_level || 3,
|
||||
data_content: data_content,
|
||||
data_list_loding_status: category.length == 0 ? 0 : 3,
|
||||
data_bottom_line_status: true,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav"
|
||||
}
|
||||
}
|
||||
@ -12,7 +12,7 @@
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<block qq:else>
|
||||
<!-- 一级内导航 -->
|
||||
<view class='left-nav'>
|
||||
<block qq:for="{{data_list}}" qq:key="key">
|
||||
@ -62,7 +62,7 @@
|
||||
</block>
|
||||
</block>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<block qq:else>
|
||||
<import src="/pages/common/nodata.qml" />
|
||||
<template is="nodata" data="{{status: 0, msg: '没有子分类数据'}}"></template>
|
||||
</block>
|
||||
@ -74,4 +74,7 @@
|
||||
<view qq:if="{{data_list.length == 0 && data_list_loding_status != 0}}">
|
||||
<import src="/pages/common/nodata.qml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
@ -1,8 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
|
||||
indicator_dots: false,
|
||||
indicator_color: 'rgba(0, 0, 0, .3)',
|
||||
indicator_active_color: '#e31c55',
|
||||
@ -17,7 +15,6 @@ Page({
|
||||
goods_photo: [],
|
||||
goods_specifications_choose: [],
|
||||
goods_content_app: [],
|
||||
|
||||
popup_status: false,
|
||||
goods_favor_text: '收藏',
|
||||
goods_favor_icon: '/images/goods-detail-favor-icon-0.png',
|
||||
@ -25,6 +22,8 @@ Page({
|
||||
buy_event_type: 'buy',
|
||||
nav_submit_text: '立即购买',
|
||||
nav_submit_is_disabled: true,
|
||||
common_site_type: 0,
|
||||
is_goods_site_type_consistent: 0,
|
||||
|
||||
goods_spec_base_price: 0,
|
||||
goods_spec_base_original_price: 0,
|
||||
@ -32,12 +31,18 @@ Page({
|
||||
goods_spec_base_images: '',
|
||||
|
||||
show_field_price_text: null,
|
||||
|
||||
goods_video_is_autoplay: false,
|
||||
common_app_is_use_mobile_detail: 1,
|
||||
common_is_goods_detail_show_photo: 0,
|
||||
popup_share_status: false,
|
||||
|
||||
// 购物车快捷导航
|
||||
quick_nav_cart_count: 0,
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
common_app_is_online_service: 0,
|
||||
common_app_is_use_mobile_detail: 0,
|
||||
common_is_goods_detail_show_photo: 0,
|
||||
common_app_customer_service_tel: null,
|
||||
|
||||
// 限时秒杀插件
|
||||
plugins_limitedtimediscount_is_valid: 0,
|
||||
@ -47,33 +52,8 @@ Page({
|
||||
plugins_limitedtimediscount_timer: null,
|
||||
plugins_limitedtimediscount_timers: null,
|
||||
|
||||
// 好物圈分享信息
|
||||
common_app_is_good_thing : 0,
|
||||
share_product: {
|
||||
"item_code": "",
|
||||
"title": "",
|
||||
"desc": "",
|
||||
"category_list": [],
|
||||
"image_list": [],
|
||||
"src_mini_program_path": "",
|
||||
"brand_info": {},
|
||||
},
|
||||
|
||||
// 海报分享
|
||||
common_app_is_poster_share: 0,
|
||||
|
||||
// 优惠劵
|
||||
plugins_coupon_data: null,
|
||||
|
||||
// 购物车快捷导航
|
||||
quick_nav_cart_count: 0,
|
||||
|
||||
// 站点模式
|
||||
common_site_type: 0,
|
||||
is_goods_site_type_consistent: 0,
|
||||
customer_service_tel: null,
|
||||
|
||||
// 优惠劵领取
|
||||
temp_coupon_receive_index: null,
|
||||
temp_coupon_receive_value: null,
|
||||
},
|
||||
@ -85,14 +65,37 @@ Page({
|
||||
// 参数赋值,初始化
|
||||
//params['goods_id']=2;
|
||||
this.setData({params: params});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
qq.setNavigationBarTitle({title: (this.data.goods == null) ? app.data.common_pages_title.goods_detail : this.data.goods.title});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 显示分享菜单
|
||||
app.show_share_menu();
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
common_app_is_use_mobile_detail: app.get_config('config.common_app_is_use_mobile_detail'),
|
||||
common_is_goods_detail_show_photo: app.get_config('config.common_is_goods_detail_show_photo'),
|
||||
common_app_is_online_service: app.get_config('config.common_app_is_online_service'),
|
||||
common_app_customer_service_tel: app.get_config('config.common_app_customer_service_tel'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
// 参数校验
|
||||
if((this.data.params.goods_id || null) == null)
|
||||
@ -124,6 +127,8 @@ Page({
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
self.setData({
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_status: 3,
|
||||
goods: data.goods,
|
||||
indicator_dots: (data.goods.photo.length > 1),
|
||||
autoplay: (data.goods.photo.length > 1),
|
||||
@ -133,23 +138,18 @@ Page({
|
||||
temp_buy_number: data.goods.buy_min_number || 1,
|
||||
goods_favor_text: (data.goods.is_favor == 1) ? '已收藏' : '收藏',
|
||||
goods_favor_icon: '/images/goods-detail-favor-icon-' + data.goods.is_favor+'.png',
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_status: 3,
|
||||
|
||||
nav_submit_text: data.nav_submit_text,
|
||||
nav_submit_is_disabled: data.nav_submit_is_disabled,
|
||||
common_site_type: data.common_site_type || 0,
|
||||
is_goods_site_type_consistent: data.is_goods_site_type_consistent || 0,
|
||||
|
||||
goods_spec_base_price: data.goods.price,
|
||||
goods_spec_base_original_price: data.goods.original_price,
|
||||
goods_spec_base_inventory: data.goods.inventory,
|
||||
goods_spec_base_images: data.goods.images,
|
||||
|
||||
show_field_price_text: (data.goods.show_field_price_text == '销售价') ? null : (data.goods.show_field_price_text.replace(/<[^>]+>/g, "") || null),
|
||||
common_app_is_use_mobile_detail: data.common_app_is_use_mobile_detail || 0,
|
||||
common_is_goods_detail_show_photo: data.common_is_goods_detail_show_photo || 0,
|
||||
//common_app_is_online_service: data.common_app_is_online_service || 0,
|
||||
|
||||
plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || null,
|
||||
plugins_limitedtimediscount_is_valid: ((data.plugins_limitedtimediscount_data || null) != null && (data.plugins_limitedtimediscount_data.is_valid || 0) == 1) ? 1 : 0,
|
||||
|
||||
common_app_is_good_thing: data.common_app_is_good_thing || 0,
|
||||
'share_product.item_code': data.goods.id.toString(),
|
||||
'share_product.title': data.goods.title,
|
||||
'share_product.image_list': data.goods.photo.map(function (v) { return v.images;}),
|
||||
@ -158,7 +158,9 @@ Page({
|
||||
'share_product.src_mini_program_path': '/pages/goods-detail/goods-detail?goods_id='+data.goods.id,
|
||||
'share_product.brand_info.name': data.goods.brand_name,
|
||||
|
||||
common_app_is_poster_share: data.common_app_is_poster_share || 0,
|
||||
plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || null,
|
||||
plugins_limitedtimediscount_is_valid: ((data.plugins_limitedtimediscount_data || null) != null && (data.plugins_limitedtimediscount_data.is_valid || 0) == 1) ? 1 : 0,
|
||||
|
||||
plugins_coupon_data: data.plugins_coupon_data || null,
|
||||
quick_nav_cart_count: data.common_cart_total || 0,
|
||||
});
|
||||
@ -173,34 +175,6 @@ Page({
|
||||
|
||||
// 不能选择规格处理
|
||||
this.goods_specifications_choose_handle_dont(0);
|
||||
|
||||
// 购买按钮处理
|
||||
var nav_submit_text = ((data.common_order_is_booking || 0) == 0) ? '立即购买' : '立即预约';
|
||||
var nav_submit_is_disabled = (data.goods.is_shelves == 1 && data.goods.inventory > 0) ? false : true;
|
||||
if (data.goods.is_shelves != 1) {
|
||||
nav_submit_text = '已下架';
|
||||
nav_submit_is_disabled = true;
|
||||
} else {
|
||||
if(data.goods.inventory <= 0) {
|
||||
nav_submit_text = '卖光了';
|
||||
nav_submit_is_disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 站点模式 - 是否展示型
|
||||
var common_site_type = data.common_site_type || 0;
|
||||
if (common_site_type == 1) {
|
||||
nav_submit_text = data.common_is_exhibition_mode_btn_text || '立即咨询';
|
||||
}
|
||||
|
||||
// 数据赋值
|
||||
this.setData({
|
||||
nav_submit_text: nav_submit_text,
|
||||
nav_submit_is_disabled: nav_submit_is_disabled,
|
||||
common_site_type: common_site_type,
|
||||
is_goods_site_type_consistent: data.is_goods_site_type_consistent || 0,
|
||||
customer_service_tel: data.customer_service_tel || null,
|
||||
});
|
||||
} else {
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
@ -867,7 +841,7 @@ Page({
|
||||
|
||||
// 展示型事件
|
||||
exhibition_submit_event(e) {
|
||||
app.call_tel(this.data.customer_service_tel);
|
||||
app.call_tel(this.data.common_app_customer_service_tel);
|
||||
},
|
||||
|
||||
// 自定义分享
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav",
|
||||
"component-popup": "/components/popup/popup",
|
||||
"component-badge": "/components/badge/badge"
|
||||
}
|
||||
|
||||
@ -248,4 +248,7 @@
|
||||
</view>
|
||||
<image src="/images/default-cart-icon.png" class="dis-block"></image>
|
||||
</view>
|
||||
</navigator>
|
||||
</navigator>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_list: [],
|
||||
@ -18,18 +17,46 @@ Page({
|
||||
{ name: "价格", field: "min_price", sort: "asc", "icon": "default" },
|
||||
{ name: "最新", field: "id", sort: "asc", "icon": "default" }
|
||||
],
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({params: params, post_data: params});
|
||||
this.init();
|
||||
// 启动参数处理
|
||||
params = app.launch_params_handle(params);
|
||||
|
||||
// 初始参数
|
||||
this.setData({
|
||||
params: params,
|
||||
post_data: {
|
||||
keywords: params.keywords || ''
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
qq.setNavigationBarTitle({title: app.data.common_pages_title.goods_search});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
// 获取数据
|
||||
this.get_data_list();
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav",
|
||||
"component-popup": "/components/popup/popup"
|
||||
}
|
||||
}
|
||||
@ -53,4 +53,7 @@
|
||||
</view>
|
||||
<button formType="submit" class="bg-main form-submit wh-auto" disabled="{{popup_form_loading_status}}" hover-class="none">确认</button>
|
||||
</form>
|
||||
</component-popup>
|
||||
</component-popup>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
@ -1,16 +1,18 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
load_status: 0,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_list: [],
|
||||
banner_list: [],
|
||||
navigation: [],
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
common_shop_notice: null,
|
||||
common_app_is_enable_search: 1,
|
||||
common_app_is_enable_answer: 1,
|
||||
common_app_is_enable_search: 0,
|
||||
common_app_is_enable_answer: 0,
|
||||
common_app_is_header_nav_fixed: 0,
|
||||
common_app_is_online_service: 0,
|
||||
|
||||
@ -23,10 +25,30 @@ Page({
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
common_shop_notice: app.get_config('config.common_shop_notice'),
|
||||
common_app_is_enable_search: app.get_config('config.common_app_is_enable_search'),
|
||||
common_app_is_enable_answer: app.get_config('config.common_app_is_enable_answer'),
|
||||
common_app_is_header_nav_fixed: app.get_config('config.common_app_is_header_nav_fixed'),
|
||||
common_app_is_online_service: app.get_config('config.common_app_is_online_service'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var self = this;
|
||||
|
||||
@ -52,10 +74,6 @@ Page({
|
||||
banner_list: data.banner_list || [],
|
||||
navigation: data.navigation || [],
|
||||
data_list: data.data_list,
|
||||
common_shop_notice: data.common_shop_notice || null,
|
||||
common_app_is_enable_search: data.common_app_is_enable_search,
|
||||
common_app_is_enable_answer: data.common_app_is_enable_answer,
|
||||
common_app_is_header_nav_fixed: data.common_app_is_header_nav_fixed,
|
||||
data_list_loding_status: data.data_list.length == 0 ? 0 : 3,
|
||||
plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || null,
|
||||
plugins_limitedtimediscount_is_valid: ((data.plugins_limitedtimediscount_data || null) != null && (data.plugins_limitedtimediscount_data.is_valid || 0) == 1) ? 1 : 0,
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav",
|
||||
"component-icon-nav": "/components/icon-nav/icon-nav",
|
||||
"component-banner": "/components/slider/slider"
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 商城公告 -->
|
||||
<view qq:if="{{common_shop_notice != null}}">
|
||||
<view qq:if="{{(common_shop_notice || null) != null}}">
|
||||
<view class="tips">{{common_shop_notice}}</view>
|
||||
</view>
|
||||
|
||||
@ -81,6 +81,9 @@
|
||||
<template is="online_service"></template>
|
||||
</view>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
|
||||
<view qq:if="{{load_status == 1}}">
|
||||
<import src="/pages/common/copyright.qml" />
|
||||
<template is="copyright"></template>
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
@ -11,16 +10,31 @@ Page({
|
||||
// 优惠劵领取
|
||||
temp_coupon_receive_index: null,
|
||||
temp_coupon_receive_value: null,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
this.init();
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
qq.setNavigationBarTitle({ title: app.data.common_pages_title.coupon });
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
// 获取数据
|
||||
this.get_data_list();
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
{
|
||||
"enablePullDownRefresh": true
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "领劵中心"
|
||||
}
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
@ -13,16 +12,31 @@ Page({
|
||||
{ name: "已过期", value: "already_expire" },
|
||||
],
|
||||
nav_tabs_value: 'not_use',
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
this.init();
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
qq.setNavigationBarTitle({ title: app.data.common_pages_title.user_coupon });
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
{
|
||||
"enablePullDownRefresh": true
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "优惠券"
|
||||
}
|
||||
126
sourcecode/qq/pages/plugins/exchangerate/currency/currency.js
Normal file
126
sourcecode/qq/pages/plugins/exchangerate/currency/currency.js
Normal file
@ -0,0 +1,126 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_list: [],
|
||||
data_default: null,
|
||||
data_base: null,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list() {
|
||||
var self = this;
|
||||
qq.showLoading({ title: "加载中..." });
|
||||
if (self.data.data_list.length <= 0)
|
||||
{
|
||||
self.setData({
|
||||
data_list_loding_status: 1
|
||||
});
|
||||
}
|
||||
|
||||
qq.request({
|
||||
url: app.get_request_url("index", "index", "exchangerate"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
qq.hideLoading();
|
||||
qq.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var status = ((data.data.data || []).length > 0);
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
data_default: data.data.default || null,
|
||||
data_list: data.data.data || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: status ? 3 : 0,
|
||||
data_bottom_line_status: status,
|
||||
});
|
||||
} else {
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
qq.hideLoading();
|
||||
qq.stopPullDownRefresh();
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错',
|
||||
});
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 选择事件
|
||||
selected_event(e) {
|
||||
// 参数处理
|
||||
var index = e.currentTarget.dataset.index;
|
||||
var temp_list = this.data.data_list;
|
||||
var data = temp_list[index] || null;
|
||||
if(data == null)
|
||||
{
|
||||
app.showToast('数据有误');
|
||||
return false;
|
||||
}
|
||||
|
||||
// id与当前默认一致则不处理
|
||||
if (data.id != this.data.data_default.id)
|
||||
{
|
||||
var self = this;
|
||||
qq.showLoading({ title: "处理中..." });
|
||||
qq.request({
|
||||
url: app.get_request_url("setcurrency", "index", "exchangerate"),
|
||||
method: "POST",
|
||||
data: { "currency": data.id },
|
||||
dataType: "json",
|
||||
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success: res => {
|
||||
qq.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.showToast(res.data.msg, "success");
|
||||
self.setData({ data_default: data });
|
||||
// 重新初始化配置
|
||||
app.init_config();
|
||||
|
||||
// 返回上一页
|
||||
setTimeout(function () {
|
||||
qq.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
qq.hideLoading();
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
});
|
||||
@ -0,0 +1,4 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "货币切换"
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
<!-- 货币列表 -->
|
||||
<view qq:if="{{data_list.length > 0}}" class="exchangerate-container">
|
||||
<block qq:for="{{data_list}}" qq:key="item">
|
||||
<view class="item oh spacing-mb bg-white" bindtap="selected_event" data-index="{{index}}">
|
||||
<view qq:if="{{common_site_type != 1}}" class="fl icon">
|
||||
<image src="/images/default-select{{item.id == data_default.id ? '-active' : ''}}-icon.png" mode="widthFix" />
|
||||
</view>
|
||||
<view class="fl single-text {{item.id == data_default.id ? 'cr-main' : 'cr-666'}}">{{item.name}} / {{item.symbol}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<view qq:if="{{data_list_loding_status != 3}}">
|
||||
<import src="/pages/common/nodata.qqml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
|
||||
</view>
|
||||
|
||||
<import src="/pages/common/bottom_line.qqml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
@ -0,0 +1,14 @@
|
||||
.exchangerate-container .item {
|
||||
padding: 20rpx 10rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.exchangerate-container .item .icon image {
|
||||
width: 50rpx;
|
||||
height: 50rpx !important;
|
||||
margin: 0 10rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.exchangerate-container .item .single-text {
|
||||
width: calc(100% - 80rpx);
|
||||
line-height: 50rpx;
|
||||
}
|
||||
@ -8,7 +8,7 @@
|
||||
<view qq:if="{{check_account_value == null}}">
|
||||
请选择认证账号
|
||||
</view>
|
||||
<view wx:else>
|
||||
<view qq:else>
|
||||
{{check_account_list[check_account_value]['msg']}}
|
||||
</view>
|
||||
</view>
|
||||
@ -40,7 +40,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:else>
|
||||
<view qq:else>
|
||||
<import src="/pages/common/nodata.qml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
|
||||
</view>
|
||||
@ -45,7 +45,7 @@
|
||||
<button size="mini" type="primary" hover-class="none" class="submit-cash">返回重新申请提现</button>
|
||||
</navigator>
|
||||
</view>
|
||||
<view wx:else>
|
||||
<view qq:else>
|
||||
<import src="/pages/common/nodata.qml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
|
||||
</view>
|
||||
@ -59,5 +59,5 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:else class="payment-list oh bg-white tc cr-888">没有支付方式</view>
|
||||
<view qq:else class="payment-list oh bg-white tc cr-888">没有支付方式</view>
|
||||
</component-popup>
|
||||
@ -1,19 +1,38 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
qq.setNavigationBarTitle({title: app.data.common_pages_title.user_favor});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
|
||||
@ -1,19 +1,38 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
qq.setNavigationBarTitle({ title: app.data.common_pages_title.user_goods_browse });
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
params: null,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
@ -16,13 +15,16 @@ Page({
|
||||
onLoad(params) {
|
||||
//params['id'] = 5;
|
||||
this.setData({params: params});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
qq.setNavigationBarTitle({title: app.data.common_pages_title.user_order_detail});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var self = this;
|
||||
qq.showLoading({title: "加载中..." });
|
||||
@ -105,17 +107,12 @@ Page({
|
||||
app.showToast("地址有误");
|
||||
return false;
|
||||
}
|
||||
var data = this.data.detail.address_data;
|
||||
|
||||
var ads = this.data.detail.address_data;
|
||||
var lng = parseFloat(ads.lng || 0);
|
||||
var lat = parseFloat(ads.lat || 0);
|
||||
qq.openLocation({
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
scale: 18,
|
||||
name: ads.alias || '',
|
||||
address: (ads.province_name || '') + (ads.city_name || '') + (ads.county_name || '') + (ads.address || ''),
|
||||
});
|
||||
// 打开地图
|
||||
var name = data.name || data.alias || '';
|
||||
var address = (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || '');
|
||||
app.open_location(data.lng, data.lat, name, address);
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
|
||||
@ -29,8 +29,8 @@
|
||||
</block>
|
||||
</view>
|
||||
<view class="oh goods-price">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.price}}</text>
|
||||
<text qq:if="{{item.original_price > 0}}" class="original-price">{{currency_symbol}}{{item.original_price}}</text>
|
||||
<text class="sales-price">{{detail.currency_data.currency_symbol}}{{item.price}}</text>
|
||||
<text qq:if="{{item.original_price > 0}}" class="original-price">{{detail.currency_data.currency_symbol}}{{item.original_price}}</text>
|
||||
<text class="buy-number">x{{item.buy_number}}</text>
|
||||
</view>
|
||||
</navigator>
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
@ -42,13 +41,16 @@ Page({
|
||||
params: params,
|
||||
nav_status_index: nav_status_index,
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
qq.setNavigationBarTitle({title: app.data.common_pages_title.user_order});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<view class="nav">
|
||||
<block qq:for="{{nav_status_list}}" qq:key="key">
|
||||
<view qq:if="{{nav_status_index == index}}" class="item fl tc cr-main" data-index="{{index}}" bindtap="nav_event">{{item.name}}</view>
|
||||
<view wx:else class="item fl tc" data-index="{{index}}" bindtap="nav_event">{{item.name}}</view>
|
||||
<view qq:else class="item fl tc" data-index="{{index}}" bindtap="nav_event">{{item.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
@ -33,8 +33,8 @@
|
||||
<view qq:if="{{(item.is_can_launch_aftersale == 1 || (detail.orderaftersale || null) != null) && (detail.orderaftersale_btn_text || null) != null}}" class="orderaftersale-btn-text" catchtap="orderaftersale_event" data-oid="{{item.id}}" data-did="{{detail.id}}">{{detail.orderaftersale_btn_text}}</view>
|
||||
</view>
|
||||
<view class="oh goods-price">
|
||||
<text class="sales-price">{{currency_symbol}}{{detail.price}}</text>
|
||||
<text qq:if="{{detail.original_price > 0}}" class="original-price">{{currency_symbol}}{{detail.original_price}}</text>
|
||||
<text class="sales-price">{{item.currency_data.currency_symbol}}{{detail.price}}</text>
|
||||
<text qq:if="{{detail.original_price > 0}}" class="original-price">{{item.currency_data.currency_symbol}}{{detail.original_price}}</text>
|
||||
<text class="buy-number">x{{detail.buy_number}}</text>
|
||||
</view>
|
||||
</navigator>
|
||||
@ -76,5 +76,5 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:else class="payment-list oh bg-white tc cr-888">没有支付方式</view>
|
||||
<view qq:else class="payment-list oh bg-white tc cr-888">没有支付方式</view>
|
||||
</component-popup>
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
params: null,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
@ -117,13 +116,16 @@ Page({
|
||||
params: params,
|
||||
popup_delivery_status: ((params.is_delivery_popup || 0) == 1),
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
qq.setNavigationBarTitle({ title: app.data.common_pages_title.user_orderaftersale_detail });
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var self = this;
|
||||
qq.showLoading({ title: "加载中..." });
|
||||
|
||||
@ -13,8 +13,8 @@
|
||||
</block>
|
||||
</view>
|
||||
<view class="oh goods-price">
|
||||
<text class="sales-price">{{currency_symbol}}{{order_data.items.price}}</text>
|
||||
<text qq:if="{{order_data.items.original_price > 0}}" class="original-price">{{currency_symbol}}{{order_data.items.original_price}}</text>
|
||||
<text class="sales-price">{{order_data.currency_data.currency_symbol}}{{order_data.items.price}}</text>
|
||||
<text qq:if="{{order_data.items.original_price > 0}}" class="original-price">{{order_data.currency_data.currency_symbol}}{{order_data.items.original_price}}</text>
|
||||
<text class="buy-number">x{{order_data.items.buy_number}}</text>
|
||||
</view>
|
||||
</navigator>
|
||||
|
||||
@ -44,13 +44,16 @@ Page({
|
||||
form_keyword_value: params.keywords || '',
|
||||
nav_status_index: nav_status_index,
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
qq.setNavigationBarTitle({ title: app.data.common_pages_title.user_orderaftersale });
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
<view class="orderaftersale-btn-text" catchtap="orderaftersale_event" data-oid="{{item.id}}" data-did="{{item.order_data.items.id}}">{{item.order_data.items.orderaftersale_btn_text}}</view>
|
||||
</view>
|
||||
<view class="oh goods-price">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.order_data.items.price}}</text>
|
||||
<text qq:if="{{item.order_data.items.original_price > 0}}" class="original-price">{{currency_symbol}}{{item.order_data.items.original_price}}</text>
|
||||
<text class="sales-price">{{item.order_data.currency_data.currency_symbol}}{{item.order_data.items.price}}</text>
|
||||
<text qq:if="{{item.order_data.items.original_price > 0}}" class="original-price">{{item.order_data.currency_data.currency_symbol}}{{item.order_data.items.original_price}}</text>
|
||||
<text class="buy-number">x{{item.order_data.items.buy_number}}</text>
|
||||
</view>
|
||||
</navigator>
|
||||
@ -38,7 +38,7 @@
|
||||
<text class="cr-ccc ds">/</text>
|
||||
<text class="cr-666">{{item.reason}}</text>
|
||||
<text qq:if="{{item.price > 0}}" class="cr-ccc ds">/</text>
|
||||
<text qq:if="{{item.price > 0}}" class="sales-price">{{currency_symbol}}{{item.price}}</text>
|
||||
<text qq:if="{{item.price > 0}}" class="sales-price">{{item.order_data.currency_data.currency_symbol}}{{item.price}}</text>
|
||||
<text qq:if="{{item.number > 0}}" class="cr-main"> x{{item.number}}</text>
|
||||
</view>
|
||||
<view qq:if="{{item.status <= 2 || item.status == 4}}" class="item-operation tr br-t">
|
||||
|
||||
@ -3,8 +3,6 @@ Page({
|
||||
data: {
|
||||
avatar: app.data.default_user_head_src,
|
||||
nickname: "用户名",
|
||||
customer_service_tel: null,
|
||||
common_user_center_notice: null,
|
||||
message_total: 0,
|
||||
head_nav_list: [
|
||||
{ name: "订单总数", url: "user-order", count: 0 },
|
||||
@ -22,16 +20,39 @@ Page({
|
||||
|
||||
// 远程自定义导航
|
||||
navigation: [],
|
||||
|
||||
|
||||
// 基础配置
|
||||
common_app_customer_service_tel: null,
|
||||
common_user_center_notice: null,
|
||||
common_app_is_online_service: 0,
|
||||
common_app_is_head_vice_nav: 0,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
qq.setNavigationBarTitle({title: app.data.common_pages_title.user});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
common_app_customer_service_tel: app.get_config('config.common_app_customer_service_tel'),
|
||||
common_user_center_notice: app.get_config('config.common_user_center_notice'),
|
||||
common_app_is_online_service: app.get_config('config.common_app_is_online_service'),
|
||||
common_app_is_head_vice_nav: app.get_config('config.common_app_is_head_vice_nav'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init(e) {
|
||||
var user = app.get_user_info(this, "init"),
|
||||
self = this;
|
||||
@ -102,14 +123,11 @@ Page({
|
||||
|
||||
this.setData({
|
||||
user_order_status_list: temp_user_order_status_list,
|
||||
customer_service_tel: data.customer_service_tel || null,
|
||||
common_user_center_notice: data.common_user_center_notice || null,
|
||||
avatar: ((data.avatar || null) != null) ? data.avatar : ((this.data.avatar || null) == null ? app.data.default_user_head_src : this.data.avatar),
|
||||
nickname: (data.nickname != null) ? data.nickname : this.data.nickname,
|
||||
message_total: ((data.common_message_total || 0) == 0) ? 0 : data.common_message_total,
|
||||
head_nav_list: temp_head_nav_list,
|
||||
navigation: data.navigation || [],
|
||||
common_app_is_head_vice_nav: data.common_app_is_head_vice_nav || 0,
|
||||
});
|
||||
|
||||
// 导航购物车处理
|
||||
@ -135,17 +153,29 @@ Page({
|
||||
|
||||
// 清除缓存
|
||||
clear_storage(e) {
|
||||
// 获取uuid重新存储缓存,一定情况下确保用户的uuid不改变
|
||||
var uuid = qq.getStorageSync(app.data.cache_user_uuid_key) || null;
|
||||
|
||||
// 清除所有缓存
|
||||
qq.clearStorage();
|
||||
app.showToast("清除缓存成功", "success");
|
||||
|
||||
// 重新存储用户uuid缓存
|
||||
if(uuid != null) {
|
||||
qq.setStorage({
|
||||
key: app.data.cache_user_uuid_key,
|
||||
data: uuid
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 客服电话
|
||||
call_event() {
|
||||
if(this.data.customer_service_tel == null)
|
||||
if(this.data.common_app_customer_service_tel == null)
|
||||
{
|
||||
app.showToast("客服电话有误");
|
||||
} else {
|
||||
app.call_tel(this.data.customer_service_tel);
|
||||
app.call_tel(this.data.common_app_customer_service_tel);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav",
|
||||
"component-badge": "/components/badge/badge"
|
||||
}
|
||||
}
|
||||
@ -68,7 +68,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 用户中心公告 -->
|
||||
<view qq:if="{{common_user_center_notice != null}}" class="user-notice">
|
||||
<view qq:if="{{(common_user_center_notice || null) != null}}" class="user-notice">
|
||||
<view class="tips">{{common_user_center_notice}}</view>
|
||||
</view>
|
||||
|
||||
@ -78,6 +78,9 @@
|
||||
<template is="online_service"></template>
|
||||
</view>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
|
||||
<!-- 版权 -->
|
||||
<import src="/pages/common/copyright.qml" />
|
||||
<template is="copyright"></template>
|
||||
|
||||
@ -65,15 +65,13 @@ App({
|
||||
"user_orderaftersale": "退款/售后",
|
||||
"user_orderaftersale_detail": "订单售后",
|
||||
"user_order_comments": "订单评论",
|
||||
"coupon": "领劵中心",
|
||||
"user_coupon": "优惠劵",
|
||||
"extraction_address": "自提地址",
|
||||
},
|
||||
|
||||
// 请求地址
|
||||
request_url: "{{request_url}}",
|
||||
// request_url: 'http://shopxo.com/',
|
||||
// request_url: 'https://dev.shopxo.net/',
|
||||
request_url: 'https://dev.shopxo.net/',
|
||||
|
||||
// 基础信息
|
||||
application_title: "{{application_title}}",
|
||||
@ -86,19 +84,13 @@ App({
|
||||
/**
|
||||
* 小程序初始化
|
||||
*/
|
||||
onLaunch(options) {
|
||||
onLaunch(params) {
|
||||
// 启动参数处理
|
||||
options = this.launch_params_handle(options);
|
||||
params = this.launch_params_handle(params);
|
||||
|
||||
// 设置设备信息
|
||||
this.set_system_info();
|
||||
|
||||
// 缓存启动参数
|
||||
tt.setStorage({
|
||||
key: this.data.cache_launch_info_key,
|
||||
data: options
|
||||
});
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
@ -114,6 +106,13 @@ App({
|
||||
if ((params.scene || null) != null) {
|
||||
params = this.url_params_to_json(decodeURIComponent(params.scene));
|
||||
}
|
||||
|
||||
// 缓存启动参数
|
||||
tt.setStorage({
|
||||
key: this.data.cache_launch_info_key,
|
||||
data: params
|
||||
});
|
||||
|
||||
return params;
|
||||
},
|
||||
|
||||
@ -171,12 +170,13 @@ App({
|
||||
// 用户信息
|
||||
var user = this.get_user_cache_info();
|
||||
var token = (user == false) ? '' : user.token || '';
|
||||
var uuid = this.request_uuid();
|
||||
return this.data.request_url +
|
||||
"index.php?s=/api/" + c + "/" + a + plugins_params+
|
||||
"&application=app&application_client_type=toutiao" +
|
||||
"&token=" +
|
||||
token +
|
||||
"&token=" + token +
|
||||
"&ajax=ajax" +
|
||||
"&uuid="+ uuid +
|
||||
params;
|
||||
},
|
||||
|
||||
@ -530,18 +530,12 @@ App({
|
||||
this.showToast('事件值格式有误');
|
||||
return false;
|
||||
}
|
||||
|
||||
tt.openLocation({
|
||||
name: values[0],
|
||||
address: values[1],
|
||||
longitude: parseFloat(values[2]),
|
||||
latitude: parseFloat(values[3])
|
||||
});
|
||||
this.open_location(values[2], values[3], values[0], values[1]);
|
||||
break;
|
||||
|
||||
// 拨打电话
|
||||
case 4:
|
||||
tt.makePhoneCall({ phoneNumber: value });
|
||||
this.call_tel(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -797,4 +791,159 @@ App({
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取配置信息、可指定默认值
|
||||
* key 数据key(支持多级读取、以 . 分割key名称)
|
||||
* default_value 默认值
|
||||
*/
|
||||
get_config(key, default_value) {
|
||||
var value = null;
|
||||
var config = tt.getStorageSync(this.data.cache_config_info_key) || null;
|
||||
if(config != null)
|
||||
{
|
||||
// 数据读取
|
||||
var arr = key.split('.');
|
||||
if(arr.length == 1)
|
||||
{
|
||||
value = config[key] == undefined ? null : config[key];
|
||||
} else {
|
||||
value = config;
|
||||
for(var i in arr)
|
||||
{
|
||||
if(value[arr[i]] != undefined)
|
||||
{
|
||||
value = value[arr[i]];
|
||||
} else {
|
||||
value = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return (value === null) ? ((default_value === undefined) ? value : default_value) : value;
|
||||
},
|
||||
|
||||
// 初始化 配置信息
|
||||
init_config() {
|
||||
var self = this;
|
||||
tt.request({
|
||||
url: this.get_request_url('common', 'base'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
tt.setStorage({
|
||||
key: this.data.cache_config_info_key,
|
||||
data: res.data.data,
|
||||
fail: () => {
|
||||
this.showToast('配置信息缓存失败');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 配置是否有效(100毫秒检验一次、最多检验100次)
|
||||
* object 回调操作对象
|
||||
* method 回调操作对象的函数
|
||||
*/
|
||||
is_config(object, method) {
|
||||
var self = this;
|
||||
var count = 0;
|
||||
var timer = setInterval(function()
|
||||
{
|
||||
if(self.get_config('status') == 1)
|
||||
{
|
||||
clearInterval(timer);
|
||||
if (typeof object === 'object' && (method || null) != null) {
|
||||
object[method](true);
|
||||
}
|
||||
}
|
||||
count++;
|
||||
if(count >= 100)
|
||||
{
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
|
||||
/**
|
||||
* 百度坐标BD-09到火星坐标GCJ02(高德,谷歌,腾讯坐标)
|
||||
* object 回调操作对象
|
||||
* method 回调操作对象的函数
|
||||
*/
|
||||
map_bd_to_gcj(lng, lat) {
|
||||
let x_pi = 3.14159265358979324 * 3000.0 / 180.0;
|
||||
let x = lng - 0.0065;
|
||||
let y = lat - 0.006;
|
||||
let z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
|
||||
let theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
|
||||
let lngs = z * Math.cos(theta);
|
||||
let lats = z * Math.sin(theta);
|
||||
return {
|
||||
lng: lngs,
|
||||
lat: lats
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* 百度坐标BD-09到火星坐标GCJ02(高德,谷歌,腾讯坐标)
|
||||
* lng 经度
|
||||
* lat 纬度
|
||||
* name 地图上面显示的名称
|
||||
* address 地图上面显示的详细地址
|
||||
* scale 缩放比例,范围5~18
|
||||
*/
|
||||
open_location(lng, lat, name, address, scale) {
|
||||
if(lng == undefined || lat == undefined || lng == '' || lat == '') {
|
||||
this.showToast('坐标有误');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 转换坐标打开位置
|
||||
var position = this.map_bd_to_gcj(parseFloat(lng), parseFloat(lat));
|
||||
tt.openLocation({
|
||||
name: name || '',
|
||||
address: address || '',
|
||||
scale: scale || 18,
|
||||
longitude: position.lng,
|
||||
latitude: position.lat
|
||||
});
|
||||
},
|
||||
|
||||
// uuid生成
|
||||
uuid() {
|
||||
var d = new Date().getTime();
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
var r = (d + Math.random() * 16) % 16 | 0;
|
||||
d = Math.floor(d / 16);
|
||||
return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
|
||||
});
|
||||
},
|
||||
|
||||
// 获取当前uuid
|
||||
request_uuid() {
|
||||
var uuid = tt.getStorageSync(this.data.cache_user_uuid_key) || null;
|
||||
if(uuid == null) {
|
||||
uuid = this.uuid();
|
||||
tt.setStorage({
|
||||
key: this.data.cache_user_uuid_key,
|
||||
data: uuid,
|
||||
fail: () => {
|
||||
this.showToast('uuid缓存失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
return uuid;
|
||||
},
|
||||
|
||||
});
|
||||
@ -59,7 +59,8 @@
|
||||
"pages/plugins/wallet/user-recharge/user-recharge",
|
||||
"pages/plugins/wallet/user-recharge-detail/user-recharge-detail",
|
||||
"pages/plugins/wallet/user-cash/user-cash",
|
||||
"pages/plugins/wallet/user-cash-detail/user-cash-detail"
|
||||
"pages/plugins/wallet/user-cash-detail/user-cash-detail",
|
||||
"pages/plugins/exchangerate/currency/currency"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTitleText": "{{application_title}}",
|
||||
|
||||
56
sourcecode/toutiao/components/quick-nav/quick-nav.js
Normal file
56
sourcecode/toutiao/components/quick-nav/quick-nav.js
Normal file
@ -0,0 +1,56 @@
|
||||
const app = getApp();
|
||||
Component({
|
||||
data: {
|
||||
popup_status: false,
|
||||
data_list: [],
|
||||
system: null,
|
||||
x: 0,
|
||||
y: 0,
|
||||
is_first: 1,
|
||||
},
|
||||
lifetimes: {
|
||||
// 页面被展示
|
||||
attached: function() {
|
||||
this.init_config();
|
||||
|
||||
// 非首次进入则重新初始化配置接口
|
||||
if(this.data.is_first == 0) {
|
||||
app.init_config();
|
||||
}
|
||||
|
||||
// 数据设置
|
||||
var system = app.get_system_info();
|
||||
this.setData({
|
||||
is_first: 0,
|
||||
system: system,
|
||||
x: 5,
|
||||
y: (system.windowHeight || 450)-160,
|
||||
});
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({ data_list: app.get_config('quick_nav') || [] });
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 弹层开启
|
||||
quick_open_event(e) {
|
||||
this.setData({popup_status: true, data_list: app.get_config('quick_nav') || []});
|
||||
},
|
||||
|
||||
// 弹层关闭
|
||||
quick_close_event(e) {
|
||||
this.setData({ popup_status: false });
|
||||
},
|
||||
|
||||
// 操作事件
|
||||
navigation_event(e) {
|
||||
app.operation_event(e);
|
||||
},
|
||||
},
|
||||
});
|
||||
6
sourcecode/toutiao/components/quick-nav/quick-nav.json
Normal file
6
sourcecode/toutiao/components/quick-nav/quick-nav.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"component-popup": "/components/popup/popup"
|
||||
}
|
||||
}
|
||||
31
sourcecode/toutiao/components/quick-nav/quick-nav.ttml
Normal file
31
sourcecode/toutiao/components/quick-nav/quick-nav.ttml
Normal file
@ -0,0 +1,31 @@
|
||||
<!-- 开启事件 -->
|
||||
<movable-area class="quick-nav-movable-container">
|
||||
<movable-view direction="all" x="{{x}}" y="{{y}}" animation="{{false}}" class="quick-nav-event-submit" bindtap="quick_open_event">
|
||||
<image src="/images/quick-submit-icon.png" mode="widthFix"></image>
|
||||
</movable-view>
|
||||
</movable-area>
|
||||
|
||||
<!-- 弹窗 -->
|
||||
<component-popup prop-show="{{popup_status}}" prop-position="bottom" bindonclose="quick_close_event">
|
||||
<view class="quick-nav-popup-container">
|
||||
<view class="close oh">
|
||||
<view class="icon-right" catchtap="quick_close_event">
|
||||
<icon type="clear" size="20" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="quick-nav-popup-content">
|
||||
<view tt:if="{{data_list.length > 0}}" class="quick-nav-data-list">
|
||||
<view class="items" tt:for="{{data_list}}" tt:key="key">
|
||||
<view class="items-content" data-value="{{item.event_value}}" data-type="{{item.event_type}}" bindtap="navigation_event" style="background-color:{{item.bg_color}}">
|
||||
<image src="{{item.images_url}}" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="title">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view tt:else>
|
||||
<import src="/pages/common/nodata.ttml" />
|
||||
<template is="nodata" data="{{status: 0}}"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
102
sourcecode/toutiao/components/quick-nav/quick-nav.ttss
Normal file
102
sourcecode/toutiao/components/quick-nav/quick-nav.ttss
Normal file
@ -0,0 +1,102 @@
|
||||
/**
|
||||
* 按钮
|
||||
*/
|
||||
.quick-nav-movable-container {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 150rpx;
|
||||
left: 0;
|
||||
background:transparent;
|
||||
pointer-events: none;
|
||||
z-index: 2;
|
||||
}
|
||||
.quick-nav-event-submit {
|
||||
pointer-events: auto;
|
||||
position: fixed;
|
||||
left: 10rpx;
|
||||
bottom: 150rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
|
||||
background-color: rgb(210 54 76 / 80%);
|
||||
}
|
||||
.quick-nav-event-submit image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
margin: 25rpx auto 25rpx auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* 弹窗
|
||||
*/
|
||||
.quick-nav-popup-container {
|
||||
padding: 20rpx 10rpx 0 10rpx;
|
||||
background: #fff;
|
||||
}
|
||||
.quick-nav-popup-container .close {
|
||||
overflow: hidden;
|
||||
}
|
||||
.quick-nav-popup-container .close .icon-right {
|
||||
float: right;
|
||||
}
|
||||
.quick-nav-popup-content {
|
||||
max-height: 80vh;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
.quick-nav-data-list {
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
}
|
||||
.quick-nav-data-list .items {
|
||||
width: calc(25% - 60rpx);
|
||||
float: left;
|
||||
padding: 30rpx;
|
||||
}
|
||||
.quick-nav-data-list .items-content {
|
||||
border-radius: 50%;
|
||||
padding: 20rpx;
|
||||
text-align: center;
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.quick-nav-data-list .items image {
|
||||
width: 60rpx !important;
|
||||
height: 60rpx !important;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
.quick-nav-data-list .items .title {
|
||||
margin-top: 10rpx;
|
||||
font-size: 28rpx !important;
|
||||
text-align:center;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/*
|
||||
* 没有数据
|
||||
*/
|
||||
.quick-nav-popup-container .no-data-box {
|
||||
padding: 80rpx 0;
|
||||
text-align: center;
|
||||
}
|
||||
.quick-nav-popup-container .no-data-box image {
|
||||
width: 160rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.quick-nav-popup-container .no-data-box .no-data-tips {
|
||||
font-size: 28rpx;
|
||||
color: #a6a6a6;
|
||||
}
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_list_loding_status: 1,
|
||||
buy_submit_disabled_status: false,
|
||||
data_list_loding_msg: '',
|
||||
@ -16,44 +15,61 @@ Page({
|
||||
is_first: 1,
|
||||
extension_data: [],
|
||||
payment_id: 0,
|
||||
common_order_is_booking: 0,
|
||||
common_site_type: 0,
|
||||
extraction_address: [],
|
||||
site_model: 0,
|
||||
buy_header_nav: [{
|
||||
name: "快递邮寄",
|
||||
value: 0
|
||||
}, {
|
||||
name: "自提点取货",
|
||||
value: 2
|
||||
}],
|
||||
buy_header_nav: [
|
||||
{ name: "快递邮寄", value: 0 },
|
||||
{ name: "自提点取货", value: 2 }
|
||||
],
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
common_order_is_booking: 0,
|
||||
|
||||
// 优惠劵
|
||||
plugins_coupon_data: null,
|
||||
plugins_use_coupon_ids: [],
|
||||
plugins_choice_coupon_value: [],
|
||||
popup_plugins_coupon_status: false,
|
||||
popup_plugins_coupon_index: null
|
||||
popup_plugins_coupon_index: null,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
//params['data'] = '{"buy_type":"goods","goods_id":"1","stock":"1","spec":"[]"}';
|
||||
if ((params.data || null) != null && app.get_length(JSON.parse(params.data)) > 0) {
|
||||
this.setData({
|
||||
params: JSON.parse(params.data)
|
||||
}); // 删除地址缓存
|
||||
if((params.data || null) != null && app.get_length(JSON.parse(params.data)) > 0)
|
||||
{
|
||||
this.setData({ params: JSON.parse(params.data)});
|
||||
|
||||
// 删除地址缓存
|
||||
tt.removeStorageSync(app.data.cache_buy_user_address_select_key);
|
||||
}
|
||||
},
|
||||
|
||||
onShow() {
|
||||
tt.setNavigationBarTitle({ title: app.data.common_pages_title.buy });
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
this.setData({
|
||||
is_first: 0
|
||||
});
|
||||
this.setData({ is_first: 0 });
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
common_order_is_booking: app.get_config('config.common_order_is_booking'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
// 订单参数信息是否正确
|
||||
if (this.data.params == null) {
|
||||
@ -110,12 +126,12 @@ Page({
|
||||
total_price: data.base.actual_price,
|
||||
extension_data: data.extension_data || [],
|
||||
data_list_loding_status: 3,
|
||||
common_order_is_booking: data.common_order_is_booking || 0,
|
||||
common_site_type: data.common_site_type || 0,
|
||||
extraction_address: data.base.extraction_address || [],
|
||||
plugins_coupon_data: data.plugins_coupon_data || null
|
||||
}); // 优惠劵选择处理
|
||||
});
|
||||
|
||||
// 优惠劵选择处理
|
||||
if ((data.plugins_coupon_data || null) != null) {
|
||||
var plugins_choice_coupon_value = [];
|
||||
|
||||
@ -393,15 +409,10 @@ Page({
|
||||
return false;
|
||||
}
|
||||
|
||||
var lng = parseFloat(data.lng || 0);
|
||||
var lat = parseFloat(data.lat || 0);
|
||||
tt.openLocation({
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
scale: 18,
|
||||
name: data.name || data.alias || '',
|
||||
address: (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || '')
|
||||
});
|
||||
// 打开地图
|
||||
var name = data.name || data.alias || '';
|
||||
var address = (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || '');
|
||||
app.open_location(data.lng, data.lat, name, address);
|
||||
}
|
||||
|
||||
});
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav",
|
||||
"component-popup": "/components/popup/popup"
|
||||
}
|
||||
}
|
||||
@ -151,4 +151,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</block>
|
||||
</block>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
@ -11,17 +10,38 @@ Page({
|
||||
is_selected_all: false,
|
||||
buy_submit_disabled_status: true,
|
||||
|
||||
// 站点模式
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
common_site_type: 0,
|
||||
common_is_exhibition_mode_btn_text: null,
|
||||
customer_service_tel: null,
|
||||
common_app_customer_service_tel: null,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
tt.setNavigationBarTitle({ title: app.data.common_pages_title.cart });
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
common_site_type: app.get_config('config.common_site_type'),
|
||||
common_is_exhibition_mode_btn_text: app.get_config('config.common_is_exhibition_mode_btn_text', '立即咨询'),
|
||||
common_app_customer_service_tel: app.get_config('config.common_app_customer_service_tel'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init(e) {
|
||||
var user = app.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
@ -84,11 +104,6 @@ Page({
|
||||
data_list_loding_status: data.data.length == 0 ? 0 : 3,
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_msg: '购物车空空如也',
|
||||
|
||||
// 站点模式
|
||||
common_site_type: data.common_site_type || 0,
|
||||
common_is_exhibition_mode_btn_text: data.common_is_exhibition_mode_btn_text || '立即咨询',
|
||||
customer_service_tel: data.customer_service_tel || null,
|
||||
});
|
||||
|
||||
// 导航购物车处理
|
||||
@ -384,7 +399,7 @@ Page({
|
||||
|
||||
// 展示型事件
|
||||
exhibition_submit_event(e) {
|
||||
app.call_tel(this.data.customer_service_tel);
|
||||
app.call_tel(this.data.common_app_customer_service_tel);
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav"
|
||||
}
|
||||
}
|
||||
@ -81,4 +81,7 @@
|
||||
<view tt:if="{{data_list.length == 0 && data_list_loding_status != 0}}">
|
||||
<import src="/pages/common/nodata.ttml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
@ -4,17 +4,31 @@ Page({
|
||||
data_list_loding_status: 1,
|
||||
nav_active_index: 0,
|
||||
data_list: [],
|
||||
data_content: null,
|
||||
|
||||
// 基础配置
|
||||
category_show_level: 3,
|
||||
data_content: null
|
||||
},
|
||||
|
||||
onShow() {
|
||||
tt.setNavigationBarTitle({
|
||||
title: app.data.common_pages_title.goods_category
|
||||
});
|
||||
this.init(); // 显示分享菜单
|
||||
tt.setNavigationBarTitle({title: app.data.common_pages_title.goods_categor });
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
app.show_share_menu();
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
category_show_level: app.get_config('config.category_show_level'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
@ -47,7 +61,6 @@ Page({
|
||||
|
||||
this.setData({
|
||||
data_list: category,
|
||||
category_show_level: res.data.data.category_show_level || 3,
|
||||
data_content: data_content,
|
||||
data_list_loding_status: category.length == 0 ? 0 : 3,
|
||||
data_bottom_line_status: true
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav"
|
||||
}
|
||||
}
|
||||
@ -74,4 +74,7 @@
|
||||
<view tt:if="{{data_list.length == 0 && data_list_loding_status != 0}}">
|
||||
<import src="/pages/common/nodata.ttml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
@ -1,8 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
|
||||
indicator_dots: false,
|
||||
indicator_color: 'rgba(0, 0, 0, .3)',
|
||||
indicator_active_color: '#e31c55',
|
||||
@ -17,7 +15,6 @@ Page({
|
||||
goods_photo: [],
|
||||
goods_specifications_choose: [],
|
||||
goods_content_app: [],
|
||||
|
||||
popup_status: false,
|
||||
goods_favor_text: '收藏',
|
||||
goods_favor_icon: '/images/goods-detail-favor-icon-0.png',
|
||||
@ -25,6 +22,8 @@ Page({
|
||||
buy_event_type: 'buy',
|
||||
nav_submit_text: '立即购买',
|
||||
nav_submit_is_disabled: true,
|
||||
common_site_type: 0,
|
||||
is_goods_site_type_consistent: 0,
|
||||
|
||||
goods_spec_base_price: 0,
|
||||
goods_spec_base_original_price: 0,
|
||||
@ -32,12 +31,18 @@ Page({
|
||||
goods_spec_base_images: '',
|
||||
|
||||
show_field_price_text: null,
|
||||
|
||||
goods_video_is_autoplay: false,
|
||||
common_app_is_use_mobile_detail: 1,
|
||||
common_is_goods_detail_show_photo: 0,
|
||||
popup_share_status: false,
|
||||
|
||||
// 购物车快捷导航
|
||||
quick_nav_cart_count: 0,
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
common_app_is_online_service: 0,
|
||||
common_app_is_use_mobile_detail: 0,
|
||||
common_is_goods_detail_show_photo: 0,
|
||||
common_app_customer_service_tel: null,
|
||||
|
||||
// 限时秒杀插件
|
||||
plugins_limitedtimediscount_is_valid: 0,
|
||||
@ -47,33 +52,8 @@ Page({
|
||||
plugins_limitedtimediscount_timer: null,
|
||||
plugins_limitedtimediscount_timers: null,
|
||||
|
||||
// 好物圈分享信息
|
||||
common_app_is_good_thing : 0,
|
||||
share_product: {
|
||||
"item_code": "",
|
||||
"title": "",
|
||||
"desc": "",
|
||||
"category_list": [],
|
||||
"image_list": [],
|
||||
"src_mini_program_path": "",
|
||||
"brand_info": {},
|
||||
},
|
||||
|
||||
// 海报分享
|
||||
common_app_is_poster_share: 0,
|
||||
|
||||
// 优惠劵
|
||||
plugins_coupon_data: null,
|
||||
|
||||
// 购物车快捷导航
|
||||
quick_nav_cart_count: 0,
|
||||
|
||||
// 站点模式
|
||||
common_site_type: 0,
|
||||
is_goods_site_type_consistent: 0,
|
||||
customer_service_tel: null,
|
||||
|
||||
// 优惠劵领取
|
||||
temp_coupon_receive_index: null,
|
||||
temp_coupon_receive_value: null,
|
||||
},
|
||||
@ -83,16 +63,39 @@ Page({
|
||||
params = app.launch_params_handle(params);
|
||||
|
||||
// 参数赋值,初始化
|
||||
//params['goods_id']=2;
|
||||
//params['goods_id']=12;
|
||||
this.setData({params: params});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
tt.setNavigationBarTitle({title: (this.data.goods == null) ? app.data.common_pages_title.goods_detail : this.data.goods.title});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 显示分享菜单
|
||||
app.show_share_menu();
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
common_app_is_use_mobile_detail: app.get_config('config.common_app_is_use_mobile_detail'),
|
||||
common_is_goods_detail_show_photo: app.get_config('config.common_is_goods_detail_show_photo'),
|
||||
common_app_is_online_service: app.get_config('config.common_app_is_online_service'),
|
||||
common_app_customer_service_tel: app.get_config('config.common_app_customer_service_tel'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
// 参数校验
|
||||
if((this.data.params.goods_id || null) == null)
|
||||
@ -124,6 +127,8 @@ Page({
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
self.setData({
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_status: 3,
|
||||
goods: data.goods,
|
||||
indicator_dots: (data.goods.photo.length > 1),
|
||||
autoplay: (data.goods.photo.length > 1),
|
||||
@ -133,23 +138,21 @@ Page({
|
||||
temp_buy_number: data.goods.buy_min_number || 1,
|
||||
goods_favor_text: (data.goods.is_favor == 1) ? '已收藏' : '收藏',
|
||||
goods_favor_icon: '/images/goods-detail-favor-icon-' + data.goods.is_favor+'.png',
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_status: 3,
|
||||
|
||||
nav_submit_text: data.nav_submit_text,
|
||||
nav_submit_is_disabled: data.nav_submit_is_disabled,
|
||||
common_site_type: data.common_site_type || 0,
|
||||
is_goods_site_type_consistent: data.is_goods_site_type_consistent || 0,
|
||||
|
||||
goods_spec_base_price: data.goods.price,
|
||||
goods_spec_base_original_price: data.goods.original_price,
|
||||
goods_spec_base_inventory: data.goods.inventory,
|
||||
goods_spec_base_images: data.goods.images,
|
||||
|
||||
show_field_price_text: (data.goods.show_field_price_text == '销售价') ? null : (data.goods.show_field_price_text.replace(/<[^>]+>/g, "") || null),
|
||||
common_app_is_use_mobile_detail: data.common_app_is_use_mobile_detail || 0,
|
||||
common_is_goods_detail_show_photo: data.common_is_goods_detail_show_photo || 0,
|
||||
common_app_is_online_service: data.common_app_is_online_service || 0,
|
||||
|
||||
plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || null,
|
||||
plugins_limitedtimediscount_is_valid: ((data.plugins_limitedtimediscount_data || null) != null && (data.plugins_limitedtimediscount_data.is_valid || 0) == 1) ? 1 : 0,
|
||||
|
||||
common_app_is_good_thing: data.common_app_is_good_thing || 0,
|
||||
'share_product.item_code': data.goods.id.toString(),
|
||||
'share_product.title': data.goods.title,
|
||||
'share_product.image_list': data.goods.photo.map(function (v) { return v.images;}),
|
||||
@ -158,7 +161,6 @@ Page({
|
||||
'share_product.src_mini_program_path': '/pages/goods-detail/goods-detail?goods_id='+data.goods.id,
|
||||
'share_product.brand_info.name': data.goods.brand_name,
|
||||
|
||||
common_app_is_poster_share: data.common_app_is_poster_share || 0,
|
||||
plugins_coupon_data: data.plugins_coupon_data || null,
|
||||
quick_nav_cart_count: data.common_cart_total || 0,
|
||||
});
|
||||
@ -173,34 +175,6 @@ Page({
|
||||
|
||||
// 不能选择规格处理
|
||||
this.goods_specifications_choose_handle_dont(0);
|
||||
|
||||
// 购买按钮处理
|
||||
var nav_submit_text = ((data.common_order_is_booking || 0) == 0) ? '立即购买' : '立即预约';
|
||||
var nav_submit_is_disabled = (data.goods.is_shelves == 1 && data.goods.inventory > 0) ? false : true;
|
||||
if (data.goods.is_shelves != 1) {
|
||||
nav_submit_text = '已下架';
|
||||
nav_submit_is_disabled = true;
|
||||
} else {
|
||||
if(data.goods.inventory <= 0) {
|
||||
nav_submit_text = '卖光了';
|
||||
nav_submit_is_disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 站点模式 - 是否展示型
|
||||
var common_site_type = data.common_site_type || 0;
|
||||
if (common_site_type == 1) {
|
||||
nav_submit_text = data.common_is_exhibition_mode_btn_text || '立即咨询';
|
||||
}
|
||||
|
||||
// 数据赋值
|
||||
this.setData({
|
||||
nav_submit_text: nav_submit_text,
|
||||
nav_submit_is_disabled: nav_submit_is_disabled,
|
||||
common_site_type: common_site_type,
|
||||
is_goods_site_type_consistent: data.is_goods_site_type_consistent || 0,
|
||||
customer_service_tel: data.customer_service_tel || null,
|
||||
});
|
||||
} else {
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
@ -867,7 +841,7 @@ Page({
|
||||
|
||||
// 展示型事件
|
||||
exhibition_submit_event(e) {
|
||||
app.call_tel(this.data.customer_service_tel);
|
||||
app.call_tel(this.data.common_app_customer_service_tel);
|
||||
},
|
||||
|
||||
// 自定义分享
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav",
|
||||
"component-popup": "/components/popup/popup",
|
||||
"component-badge": "/components/badge/badge"
|
||||
}
|
||||
|
||||
@ -248,4 +248,7 @@
|
||||
</view>
|
||||
<image src="/images/default-cart-icon.png" class="dis-block"></image>
|
||||
</view>
|
||||
</navigator>
|
||||
</navigator>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_list: [],
|
||||
@ -18,18 +17,46 @@ Page({
|
||||
{ name: "价格", field: "min_price", sort: "asc", "icon": "default" },
|
||||
{ name: "最新", field: "id", sort: "asc", "icon": "default" }
|
||||
],
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({params: params, post_data: params});
|
||||
this.init();
|
||||
// 启动参数处理
|
||||
params = app.launch_params_handle(params);
|
||||
|
||||
// 初始参数
|
||||
this.setData({
|
||||
params: params,
|
||||
post_data: {
|
||||
keywords: params.keywords || ''
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
tt.setNavigationBarTitle({title: app.data.common_pages_title.goods_search});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
// 获取数据
|
||||
this.get_data_list();
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav",
|
||||
"component-popup": "/components/popup/popup"
|
||||
}
|
||||
}
|
||||
@ -53,4 +53,7 @@
|
||||
</view>
|
||||
<button formType="submit" class="bg-main form-submit wh-auto" disabled="{{popup_form_loading_status}}" hover-class="none">确认</button>
|
||||
</form>
|
||||
</component-popup>
|
||||
</component-popup>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
@ -1,21 +1,23 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
load_status: 0,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_list: [],
|
||||
banner_list: [],
|
||||
navigation: [],
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
common_shop_notice: null,
|
||||
common_app_is_enable_search: 1,
|
||||
common_app_is_enable_answer: 1,
|
||||
common_app_is_enable_search: 0,
|
||||
common_app_is_enable_answer: 0,
|
||||
common_app_is_header_nav_fixed: 0,
|
||||
common_app_is_online_service: 0,
|
||||
|
||||
// 限时秒杀插件
|
||||
plugins_limitedtimediscount_is_valid : 0,
|
||||
plugins_limitedtimediscount_is_valid: 0,
|
||||
plugins_limitedtimediscount_data: null,
|
||||
plugins_limitedtimediscount_timer_title: '距离结束',
|
||||
plugins_limitedtimediscount_is_show_time: true,
|
||||
@ -23,10 +25,30 @@ Page({
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
common_shop_notice: app.get_config('config.common_shop_notice'),
|
||||
common_app_is_enable_search: app.get_config('config.common_app_is_enable_search'),
|
||||
common_app_is_enable_answer: app.get_config('config.common_app_is_enable_answer'),
|
||||
common_app_is_header_nav_fixed: app.get_config('config.common_app_is_header_nav_fixed'),
|
||||
common_app_is_online_service: app.get_config('config.common_app_is_online_service'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var self = this;
|
||||
|
||||
@ -52,12 +74,7 @@ Page({
|
||||
banner_list: data.banner_list || [],
|
||||
navigation: data.navigation || [],
|
||||
data_list: data.data_list,
|
||||
common_shop_notice: data.common_shop_notice || null,
|
||||
common_app_is_enable_search: data.common_app_is_enable_search,
|
||||
common_app_is_enable_answer: data.common_app_is_enable_answer,
|
||||
common_app_is_header_nav_fixed: data.common_app_is_header_nav_fixed,
|
||||
data_list_loding_status: data.data_list.length == 0 ? 0 : 3,
|
||||
common_app_is_online_service: data.common_app_is_online_service || 0,
|
||||
plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || null,
|
||||
plugins_limitedtimediscount_is_valid: ((data.plugins_limitedtimediscount_data || null) != null && (data.plugins_limitedtimediscount_data.is_valid || 0) == 1) ? 1 : 0,
|
||||
});
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav",
|
||||
"component-icon-nav": "/components/icon-nav/icon-nav",
|
||||
"component-banner": "/components/slider/slider"
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 商城公告 -->
|
||||
<view tt:if="{{common_shop_notice != null}}">
|
||||
<view tt:if="{{(common_shop_notice || null) != null}}">
|
||||
<view class="tips">
|
||||
<image src="/images/tips.png" mode="aspectFit" />
|
||||
<text>{{common_shop_notice}}</text>
|
||||
@ -84,6 +84,9 @@
|
||||
<template is="online_service"></template>
|
||||
</view>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
|
||||
<view tt:if="{{load_status == 1}}">
|
||||
<import src="/pages/common/copyright.ttml" />
|
||||
<template is="copyright"></template>
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
params: {},
|
||||
default_round_success_icon: app.data.default_round_success_icon,
|
||||
default_round_error_icon: app.data.default_round_error_icon,
|
||||
|
||||
@ -2,10 +2,6 @@
|
||||
<image class="pay-icon" tt:if="{{params.code == '9000'}}" mode="widthFix" src="{{default_round_success_icon}}" />
|
||||
<image class="pay-icon" tt:else mode="widthFix" src="{{default_round_error_icon}}" />
|
||||
<text class="dis-block">{{params.msg}}</text>
|
||||
<view tt:if="{{params.code == '9000'}}" class="price-box">
|
||||
<text class="sales-price">{{currency_symbol}}{{params.total_price}}</text>
|
||||
<text class="price-unit cr-888">元</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn-box">
|
||||
|
||||
@ -1,29 +1,41 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_list: [],
|
||||
data_base: null,
|
||||
|
||||
// 优惠劵领取
|
||||
temp_coupon_receive_index: null,
|
||||
temp_coupon_receive_value: null
|
||||
},
|
||||
temp_coupon_receive_value: null,
|
||||
|
||||
onLoad(params) {
|
||||
this.init();
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
tt.setNavigationBarTitle({
|
||||
title: app.data.common_pages_title.coupon
|
||||
});
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
// 获取数据
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
{
|
||||
"enablePullDownRefresh": true
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "领劵中心"
|
||||
}
|
||||
@ -1,34 +1,42 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_list: null,
|
||||
nav_tabs_list: [{
|
||||
name: "未使用",
|
||||
value: "not_use"
|
||||
}, {
|
||||
name: "已使用",
|
||||
value: "already_use"
|
||||
}, {
|
||||
name: "已过期",
|
||||
value: "already_expire"
|
||||
}],
|
||||
nav_tabs_value: 'not_use'
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
this.init();
|
||||
nav_tabs_list: [
|
||||
{ name: "未使用", value: "not_use" },
|
||||
{ name: "已使用", value: "already_use" },
|
||||
{ name: "已过期", value: "already_expire" },
|
||||
],
|
||||
nav_tabs_value: 'not_use',
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
tt.setNavigationBarTitle({
|
||||
title: app.data.common_pages_title.user_coupon
|
||||
});
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.get_user_info(this, "init");
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
{
|
||||
"enablePullDownRefresh": true
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "优惠券"
|
||||
}
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '加载中...',
|
||||
data_bottom_line_status: false,
|
||||
@ -12,12 +11,31 @@ Page({
|
||||
user_profit_total_price: 0.00,
|
||||
user_data: null,
|
||||
profit_data: null,
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var self = this;
|
||||
tt.showLoading({
|
||||
|
||||
@ -0,0 +1,126 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_list: [],
|
||||
data_default: null,
|
||||
data_base: null,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list() {
|
||||
var self = this;
|
||||
tt.showLoading({ title: "加载中..." });
|
||||
if (self.data.data_list.length <= 0)
|
||||
{
|
||||
self.setData({
|
||||
data_list_loding_status: 1
|
||||
});
|
||||
}
|
||||
|
||||
tt.request({
|
||||
url: app.get_request_url("index", "index", "exchangerate"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
tt.hideLoading();
|
||||
tt.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var status = ((data.data.data || []).length > 0);
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
data_default: data.data.default || null,
|
||||
data_list: data.data.data || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: status ? 3 : 0,
|
||||
data_bottom_line_status: status,
|
||||
});
|
||||
} else {
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
tt.hideLoading();
|
||||
tt.stopPullDownRefresh();
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错',
|
||||
});
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 选择事件
|
||||
selected_event(e) {
|
||||
// 参数处理
|
||||
var index = e.currentTarget.dataset.index;
|
||||
var temp_list = this.data.data_list;
|
||||
var data = temp_list[index] || null;
|
||||
if(data == null)
|
||||
{
|
||||
app.showToast('数据有误');
|
||||
return false;
|
||||
}
|
||||
|
||||
// id与当前默认一致则不处理
|
||||
if (data.id != this.data.data_default.id)
|
||||
{
|
||||
var self = this;
|
||||
tt.showLoading({ title: "处理中..." });
|
||||
tt.request({
|
||||
url: app.get_request_url("setcurrency", "index", "exchangerate"),
|
||||
method: "POST",
|
||||
data: { "currency": data.id },
|
||||
dataType: "json",
|
||||
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success: res => {
|
||||
tt.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.showToast(res.data.msg, "success");
|
||||
self.setData({ data_default: data });
|
||||
// 重新初始化配置
|
||||
app.init_config();
|
||||
|
||||
// 返回上一页
|
||||
setTimeout(function () {
|
||||
tt.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
tt.hideLoading();
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
});
|
||||
@ -0,0 +1,4 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "货币切换"
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
<!-- 货币列表 -->
|
||||
<view tt:if="{{data_list.length > 0}}" class="exchangerate-container">
|
||||
<block tt:for="{{data_list}}" tt:key="item">
|
||||
<view class="item oh spacing-mb bg-white" bindtap="selected_event" data-index="{{index}}">
|
||||
<view tt:if="{{common_site_type != 1}}" class="fl icon">
|
||||
<image src="/images/default-select{{item.id == data_default.id ? '-active' : ''}}-icon.png" mode="widthFix" />
|
||||
</view>
|
||||
<view class="fl single-text {{item.id == data_default.id ? 'cr-main' : 'cr-666'}}">{{item.name}} / {{item.symbol}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<view tt:if="{{data_list_loding_status != 3}}">
|
||||
<import src="/pages/common/nodata.ttml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
|
||||
</view>
|
||||
|
||||
<import src="/pages/common/bottom_line.ttml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
@ -0,0 +1,14 @@
|
||||
.exchangerate-container .item {
|
||||
padding: 20rpx 10rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.exchangerate-container .item .icon image {
|
||||
width: 50rpx;
|
||||
height: 50rpx !important;
|
||||
margin: 0 10rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.exchangerate-container .item .single-text {
|
||||
width: calc(100% - 80rpx);
|
||||
line-height: 50rpx;
|
||||
}
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '加载中...',
|
||||
data_bottom_line_status: false,
|
||||
@ -11,12 +10,31 @@ Page({
|
||||
user_profit_total_price: 0.00,
|
||||
user_data: null,
|
||||
profit_data: null,
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var self = this;
|
||||
tt.showLoading({
|
||||
|
||||
@ -1,19 +1,38 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
tt.setNavigationBarTitle({title: app.data.common_pages_title.user_favor});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
|
||||
@ -1,19 +1,38 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
|
||||
// 基础配置
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
tt.setNavigationBarTitle({ title: app.data.common_pages_title.user_goods_browse });
|
||||
tt.setNavigationBarTitle({title: app.data.common_pages_title.user_goods_browse});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
params: null,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
@ -16,13 +15,16 @@ Page({
|
||||
onLoad(params) {
|
||||
//params['id'] = 5;
|
||||
this.setData({params: params});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
tt.setNavigationBarTitle({title: app.data.common_pages_title.user_order_detail});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var self = this;
|
||||
tt.showLoading({title: "加载中..." });
|
||||
@ -112,17 +114,12 @@ Page({
|
||||
app.showToast("地址有误");
|
||||
return false;
|
||||
}
|
||||
var data = this.data.detail.address_data;
|
||||
|
||||
var ads = this.data.detail.address_data;
|
||||
var lng = parseFloat(ads.lng || 0);
|
||||
var lat = parseFloat(ads.lat || 0);
|
||||
tt.openLocation({
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
scale: 18,
|
||||
name: ads.alias || '',
|
||||
address: (ads.province_name || '') + (ads.city_name || '') + (ads.county_name || '') + (ads.address || ''),
|
||||
});
|
||||
// 打开地图
|
||||
var name = data.alias || '';
|
||||
var address = (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || '');
|
||||
app.open_location(data.lng, data.lat, name, address);
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
|
||||
@ -29,8 +29,8 @@
|
||||
</block>
|
||||
</view>
|
||||
<view class="oh goods-price">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.price}}</text>
|
||||
<text tt:if="{{item.original_price > 0}}" class="original-price">{{currency_symbol}}{{item.original_price}}</text>
|
||||
<text class="sales-price">{{detail.currency_data.currency_symbol}}{{item.price}}</text>
|
||||
<text tt:if="{{item.original_price > 0}}" class="original-price">{{detail.currency_data.currency_symbol}}{{item.original_price}}</text>
|
||||
<text class="buy-number">x{{item.buy_number}}</text>
|
||||
</view>
|
||||
</navigator>
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
@ -54,15 +53,16 @@ Page({
|
||||
params: params,
|
||||
nav_status_index: nav_status_index
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
tt.setNavigationBarTitle({
|
||||
title: app.data.common_pages_title.user_order
|
||||
});
|
||||
tt.setNavigationBarTitle({title: app.data.common_pages_title.user_order});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.get_user_info(this, 'init');
|
||||
|
||||
@ -265,7 +265,7 @@ Page({
|
||||
// self.order_item_pay_success_handle(index);
|
||||
|
||||
// // 跳转支付页面
|
||||
// wx.navigateTo({
|
||||
// tt.navigateTo({
|
||||
// url: "/pages/paytips/paytips?code=9000&total_price=" +
|
||||
// self.data.data_list[index]['total_price']
|
||||
// });
|
||||
|
||||
@ -33,8 +33,8 @@
|
||||
<view tt:if="{{(item.is_can_launch_aftersale == 1 || (detail.orderaftersale || null) != null) && (detail.orderaftersale_btn_text || null) != null}}" class="orderaftersale-btn-text" catchtap="orderaftersale_event" data-oid="{{item.id}}" data-did="{{detail.id}}">{{detail.orderaftersale_btn_text}}</view>
|
||||
</view>
|
||||
<view class="oh goods-price">
|
||||
<text class="sales-price">{{currency_symbol}}{{detail.price}}</text>
|
||||
<text tt:if="{{detail.original_price > 0}}" class="original-price">{{currency_symbol}}{{detail.original_price}}</text>
|
||||
<text class="sales-price">{{item.currency_data.currency_symbol}}{{detail.price}}</text>
|
||||
<text tt:if="{{detail.original_price > 0}}" class="original-price">{{item.currency_data.currency_symbol}}{{detail.original_price}}</text>
|
||||
<text class="buy-number">x{{detail.buy_number}}</text>
|
||||
</view>
|
||||
</navigator>
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
params: null,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
@ -117,13 +116,16 @@ Page({
|
||||
params: params,
|
||||
popup_delivery_status: ((params.is_delivery_popup || 0) == 1),
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
tt.setNavigationBarTitle({ title: app.data.common_pages_title.user_orderaftersale_detail });
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var self = this;
|
||||
tt.showLoading({ title: "加载中..." });
|
||||
|
||||
@ -13,8 +13,8 @@
|
||||
</block>
|
||||
</view>
|
||||
<view class="oh goods-price">
|
||||
<text class="sales-price">{{currency_symbol}}{{order_data.items.price}}</text>
|
||||
<text tt:if="{{order_data.items.original_price > 0}}" class="original-price">{{currency_symbol}}{{order_data.items.original_price}}</text>
|
||||
<text class="sales-price">{{order_data.currency_data.currency_symbol}}{{order_data.items.price}}</text>
|
||||
<text tt:if="{{order_data.items.original_price > 0}}" class="original-price">{{order_data.currency_data.currency_symbol}}{{order_data.items.original_price}}</text>
|
||||
<text class="buy-number">x{{order_data.items.buy_number}}</text>
|
||||
</view>
|
||||
</navigator>
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
currency_symbol: app.data.currency_symbol,
|
||||
params: null,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
@ -44,13 +43,16 @@ Page({
|
||||
form_keyword_value: params.keywords || '',
|
||||
nav_status_index: nav_status_index,
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
tt.setNavigationBarTitle({ title: app.data.common_pages_title.user_orderaftersale });
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init() {
|
||||
var user = app.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
<view class="orderaftersale-btn-text" catchtap="orderaftersale_event" data-oid="{{item.id}}" data-did="{{item.order_data.items.id}}">{{item.order_data.items.orderaftersale_btn_text}}</view>
|
||||
</view>
|
||||
<view class="oh goods-price">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.order_data.items.price}}</text>
|
||||
<text tt:if="{{item.order_data.items.original_price > 0}}" class="original-price">{{currency_symbol}}{{item.order_data.items.original_price}}</text>
|
||||
<text class="sales-price">{{item.order_data.currency_data.currency_symbol}}{{item.order_data.items.price}}</text>
|
||||
<text tt:if="{{item.order_data.items.original_price > 0}}" class="original-price">{{item.order_data.currency_data.currency_symbol}}{{item.order_data.items.original_price}}</text>
|
||||
<text class="buy-number">x{{item.order_data.items.buy_number}}</text>
|
||||
</view>
|
||||
</navigator>
|
||||
@ -38,7 +38,7 @@
|
||||
<text class="cr-ccc ds">/</text>
|
||||
<text class="cr-666">{{item.reason}}</text>
|
||||
<text tt:if="{{item.price > 0}}" class="cr-ccc ds">/</text>
|
||||
<text tt:if="{{item.price > 0}}" class="sales-price">{{currency_symbol}}{{item.price}}</text>
|
||||
<text tt:if="{{item.price > 0}}" class="sales-price">{{item.order_data.currency_data.currency_symbol}}{{item.price}}</text>
|
||||
<text tt:if="{{item.number > 0}}" class="cr-main"> x{{item.number}}</text>
|
||||
</view>
|
||||
<view tt:if="{{item.status <= 2 || item.status == 4}}" class="item-operation tr br-t">
|
||||
|
||||
@ -3,8 +3,6 @@ Page({
|
||||
data: {
|
||||
avatar: app.data.default_user_head_src,
|
||||
nickname: "用户名",
|
||||
customer_service_tel: null,
|
||||
common_user_center_notice: null,
|
||||
message_total: 0,
|
||||
head_nav_list: [
|
||||
{ name: "订单总数", url: "user-order", count: 0 },
|
||||
@ -22,16 +20,39 @@ Page({
|
||||
|
||||
// 远程自定义导航
|
||||
navigation: [],
|
||||
|
||||
|
||||
// 基础配置
|
||||
common_app_customer_service_tel: null,
|
||||
common_user_center_notice: null,
|
||||
common_app_is_online_service: 0,
|
||||
common_app_is_head_vice_nav: 0,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
tt.setNavigationBarTitle({title: app.data.common_pages_title.user});
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
common_app_customer_service_tel: app.get_config('config.common_app_customer_service_tel'),
|
||||
common_user_center_notice: app.get_config('config.common_user_center_notice'),
|
||||
common_app_is_online_service: app.get_config('config.common_app_is_online_service'),
|
||||
common_app_is_head_vice_nav: app.get_config('config.common_app_is_head_vice_nav'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
init(e) {
|
||||
var user = app.get_user_info(this, "init"),
|
||||
self = this;
|
||||
@ -102,15 +123,11 @@ Page({
|
||||
|
||||
this.setData({
|
||||
user_order_status_list: temp_user_order_status_list,
|
||||
customer_service_tel: data.customer_service_tel || null,
|
||||
common_user_center_notice: data.common_user_center_notice || null,
|
||||
avatar: ((data.avatar || null) != null) ? data.avatar : ((this.data.avatar || null) == null ? app.data.default_user_head_src : this.data.avatar),
|
||||
nickname: (data.nickname != null) ? data.nickname : this.data.nickname,
|
||||
message_total: ((data.common_message_total || 0) == 0) ? 0 : data.common_message_total,
|
||||
head_nav_list: temp_head_nav_list,
|
||||
navigation: data.navigation || [],
|
||||
common_app_is_online_service: data.common_app_is_online_service || 0,
|
||||
common_app_is_head_vice_nav: data.common_app_is_head_vice_nav || 0,
|
||||
});
|
||||
|
||||
// 导航购物车处理
|
||||
@ -133,17 +150,29 @@ Page({
|
||||
|
||||
// 清除缓存
|
||||
clear_storage(e) {
|
||||
// 获取uuid重新存储缓存,一定情况下确保用户的uuid不改变
|
||||
var uuid = tt.getStorageSync(app.data.cache_user_uuid_key) || null;
|
||||
|
||||
// 清除所有缓存
|
||||
tt.clearStorage();
|
||||
app.showToast("清除缓存成功", "success");
|
||||
|
||||
// 重新存储用户uuid缓存
|
||||
if(uuid != null) {
|
||||
tt.setStorage({
|
||||
key: app.data.cache_user_uuid_key,
|
||||
data: uuid
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 客服电话
|
||||
call_event() {
|
||||
if(this.data.customer_service_tel == null)
|
||||
if(this.data.common_app_customer_service_tel == null)
|
||||
{
|
||||
app.showToast("客服电话有误");
|
||||
} else {
|
||||
app.call_tel(this.data.customer_service_tel);
|
||||
app.call_tel(this.data.common_app_customer_service_tel);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"component-quick-nav": "/components/quick-nav/quick-nav",
|
||||
"component-badge": "/components/badge/badge"
|
||||
}
|
||||
}
|
||||
@ -68,7 +68,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 用户中心公告 -->
|
||||
<view tt:if="{{common_user_center_notice != null}}" class="user-notice">
|
||||
<view tt:if="{{(common_user_center_notice || null) != null}}" class="user-notice">
|
||||
<view class="tips">
|
||||
<image src="/images/tips.png" mode="aspectFit" />
|
||||
<text>{{common_user_center_notice}}</text>
|
||||
@ -81,5 +81,8 @@
|
||||
<template is="online_service"></template>
|
||||
</view>
|
||||
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav></component-quick-nav>
|
||||
|
||||
<import src="/pages/common/copyright.ttml" />
|
||||
<template is="copyright"></template>
|
||||
|
||||
@ -34,6 +34,7 @@ Page({
|
||||
popup_plugins_coupon_status: false,
|
||||
popup_plugins_coupon_index: null,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
//params['data'] = '{"buy_type":"goods","goods_id":"1","stock":"1","spec":"[]"}';
|
||||
if((params.data || null) != null && app.get_length(JSON.parse(params.data)) > 0)
|
||||
|
||||
Reference in New Issue
Block a user