Merge branch 'dev' of gitee.com:zongzhige/shopxo-uniapp into dev-sws
commit
cc2319dd5c
|
|
@ -116,10 +116,15 @@
|
|||
.interval_time)) {
|
||||
status = false;
|
||||
}
|
||||
this.setData({
|
||||
popup_status: status,
|
||||
user: user
|
||||
});
|
||||
|
||||
// 1秒后再提示用户填写信息
|
||||
var self = this;
|
||||
setTimeout(function() {
|
||||
self.setData({
|
||||
popup_status: status,
|
||||
user: user
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@
|
|||
"desc" : "你的位置将用于小程序中相应业务位置服务使用"
|
||||
}
|
||||
},
|
||||
"__usePrivacyCheck__": true,
|
||||
"plugins" : {
|
||||
// 直播(需要开通权限 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/liveplayer/live-player-plugin.html)
|
||||
// "live-player-plugin" : {
|
||||
|
|
|
|||
2080
pages.json
2080
pages.json
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,113 @@
|
|||
<template>
|
||||
<view class="agreement-page bs-bb">
|
||||
<view class="agreement-content border-radius-main bg-white" v-if="is_show_privacy">
|
||||
<view class="tc">
|
||||
<image class="logo circle auto dis-block margin-bottom-lg br" :src="logo" mode="widthFix"></image>
|
||||
<view class="cr-base fw-b text-size-lg">{{title}}温馨提示</view>
|
||||
</view>
|
||||
<view class="margin-top-lg text-size-sm cr-base content-desc">
|
||||
<block v-if="(content || null) == null">
|
||||
尊敬的用户、为了向您提供更优质的服务,在您使用{{title}}小程序前,您需要通过点击【同意】并阅读以下协议内容以表示您充分知悉、理解并同意本温馨提示的相关协议的各项规则,包括我们会在您开启的位置信息提供更契合您需求的页面展示、产品或服务,比如首页向您推荐商品或相关门店及排行榜信息。
|
||||
</block>
|
||||
<block v-else>{{content}}</block>
|
||||
</view>
|
||||
<view class="cr-blue margin-top-lg">
|
||||
<view>
|
||||
<text @tap="agreement_event" data-value="userregister">《{{title}}服务用户协议》</text>
|
||||
</view>
|
||||
<view class="margin-top-sm">
|
||||
<text @tap="agreement_event" data-value="userprivacy">《{{title}}隐私权政策》</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="buttom tc margin-top-xxxl padding-top-lg">
|
||||
<button type="default" size="mini" class="br-base cr-base bg-white text-size-sm round margin-right-xxxl" @tap="exit_event">不同意</button>
|
||||
<button type="default" size="mini" class="br-main cr-white bg-main text-size-sm round margin-left-xxxl" open-type="agreePrivacyAuthorization" @agreeprivacyauthorization="agree_privacy_auth_event">同意</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
logo: app.globalData.get_application_logo_square(),
|
||||
title: app.globalData.get_application_title(),
|
||||
is_show_privacy: false,
|
||||
content: null
|
||||
}
|
||||
},
|
||||
|
||||
// 页面加载初始化
|
||||
onLoad() {
|
||||
uni.getPrivacySetting({
|
||||
success: res => {
|
||||
if (res.needAuthorization) {
|
||||
this.setData({
|
||||
is_show_privacy: true,
|
||||
content: app.globalData.get_config('config.common_app_mini_weixin_privacy_content', null),
|
||||
});
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 协议事件
|
||||
agreement_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
if (value == null) {
|
||||
app.globalData.showToast('协议类型有误');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 是否存在协议 url 地址
|
||||
var key = 'agreement_' + value + '_url';
|
||||
var url = app.globalData.get_config('config.' + key) || null;
|
||||
if (url == null) {
|
||||
app.globalData.showToast('协议url地址有误');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 打开 webview
|
||||
app.globalData.open_web_view(url);
|
||||
},
|
||||
|
||||
// 退出小程序
|
||||
exit_event(e) {
|
||||
uni.exitMiniProgram();
|
||||
},
|
||||
|
||||
// 授权回调
|
||||
agree_privacy_auth_event() {
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.agreement-page {
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
height: 100vh;
|
||||
padding: 40rpx;
|
||||
}
|
||||
.agreement-content {
|
||||
margin-top: 30%;
|
||||
padding: 40rpx;
|
||||
}
|
||||
.agreement-content .logo {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
.agreement-content .content-desc {
|
||||
line-height: 46rpx;
|
||||
}
|
||||
.agreement-content .buttom button {
|
||||
min-width: 200rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -113,7 +113,7 @@
|
|||
</radio-group>
|
||||
</view>
|
||||
<view class="dis-inline-block va-m">
|
||||
阅读并同意 《<text class="cr-main" @tap="agreement_event" data-value="userregister">服务协议</text>》 与 《<text class="cr-main" @tap="agreement_event" data-value="userprivacy">隐私政策</text>》
|
||||
阅读并同意 《<text class="cr-main" @tap="agreement_event" data-value="userregister">服务协议</text>》 与 《<text class="cr-main" @tap="agreement_event" data-value="userprivacy">隐私权政策</text>》
|
||||
</view>
|
||||
</view>
|
||||
<button class="bg-main br-main cr-white round text-size margin-top-xxxl" form-type="submit" type="default" hover-class="none" :loading="form_submit_loading" :disabled="form_submit_loading">确认登录</button>
|
||||
|
|
@ -192,7 +192,7 @@
|
|||
</radio-group>
|
||||
</view>
|
||||
<view class="dis-inline-block va-m">
|
||||
阅读并同意 《<text class="cr-main" @tap="agreement_event" data-value="userregister">服务协议</text>》 与 《<text class="cr-main" @tap="agreement_event" data-value="userprivacy">隐私政策</text>》
|
||||
阅读并同意 《<text class="cr-main" @tap="agreement_event" data-value="userregister">服务协议</text>》 与 《<text class="cr-main" @tap="agreement_event" data-value="userprivacy">隐私权政策</text>》
|
||||
</view>
|
||||
</view>
|
||||
<button class="bg-main br-main cr-white round text-size margin-top-xxxl" form-type="submit" type="default" hover-class="none" :loading="form_submit_loading" :disabled="form_submit_loading">确认注册</button>
|
||||
|
|
@ -262,7 +262,7 @@
|
|||
</radio-group>
|
||||
</view>
|
||||
<view class="dis-inline-block va-m">
|
||||
阅读并同意 《<text class="cr-main" @tap="agreement_event" data-value="userregister">服务协议</text>》 与 《<text class="cr-main" @tap="agreement_event" data-value="userprivacy">隐私政策</text>》
|
||||
阅读并同意 《<text class="cr-main" @tap="agreement_event" data-value="userregister">服务协议</text>》 与 《<text class="cr-main" @tap="agreement_event" data-value="userprivacy">隐私权政策</text>》
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-xxl">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* 秒杀导航
|
||||
*/
|
||||
.nav_seckill .item {
|
||||
width: 176rpx;
|
||||
padding: 26rpx 0;
|
||||
}
|
||||
|
||||
.nav_seckill .item .time {
|
||||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
.nav_seckill .item .state {
|
||||
margin-top: 4rpx;
|
||||
padding: 0 14rpx;
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.nav_seckill .item .state.active {
|
||||
font-size: 22rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
|
@ -1,176 +1,198 @@
|
|||
<template>
|
||||
<view>
|
||||
<view v-if="(data_base || null) != null" :style="seckill_bg">
|
||||
<view class="padding-horizontal-main padding-top-main">
|
||||
<!-- 公告信息 -->
|
||||
<view v-if="(data_base.content_notice || null) != null && data_base.content_notice.length > 0" class="spacing-mb">
|
||||
<view class="notice-content">
|
||||
<view v-for="(item, index) in data_base.content_notice" :key="index" class="item">{{item}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view v-if="(data_base || null) != null" :style="seckill_bg">
|
||||
<!-- 秒杀时段 -->
|
||||
<scroll-view :scroll-x="true" :scroll-with-animation="true" :scroll-into-view="'one-nav-item-'+nav_active_index" class="top-nav-scroll">
|
||||
<view class="nav_seckill flex-row flex-nowrap bg-main cr-white">
|
||||
<view v-for="(item, index) in periods_list" :key="index" class="item tc cp text-size-xss" :id="'one-nav-item-'+index" :data-index="index" @tap="nav_event">
|
||||
<view class="time text-size-lg">{{item.name}}</view>
|
||||
<view class="state text-size-xs round" :class="item.time.status === 1 ? 'active cr-main' : ''">{{item.time.msg}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="padding-horizontal-main padding-top-main">
|
||||
<!-- 公告信息 -->
|
||||
<view v-if="(data_base.content_notice || null) != null && data_base.content_notice.length > 0" class="spacing-mb">
|
||||
<view class="notice-content">
|
||||
<view v-for="(item, index) in data_base.content_notice" :key="index" class="item">{{item}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 基础信息、倒计时 -->
|
||||
<view class="oh spacing-mb">
|
||||
<text :class="'va-m '+(is_valid == 1 ? 'cr-base' : 'cr-red')">{{time.msg}}</text>
|
||||
<view v-if="is_valid == 1" class="dis-inline-block va-m margin-left-sm">
|
||||
<component-countdown :propHour="time.hours" :propMinute="time.minutes" :propSecond="time.seconds"></component-countdown>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 基础信息、倒计时 -->
|
||||
<view class="oh spacing-mb">
|
||||
<text :class="'va-m '+(is_valid == 1 ? 'cr-base' : 'cr-red')">{{time.msg}}</text>
|
||||
<view v-if="is_valid == 1" class="dis-inline-block va-m margin-left-sm">
|
||||
<component-countdown :propHour="time.hours" :propMinute="time.minutes" :propSecond="time.seconds"></component-countdown>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品 -->
|
||||
<view v-if="goods.length > 0">
|
||||
<component-goods-list :propData="{style_type: 1, goods_list: goods}" :propCurrencySymbol="currency_symbol" :propIsShowPriceIcon="true" propPriceField="seckill_min_price"></component-goods-list>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0" propMsg="没有相关商品"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 商品 -->
|
||||
<view v-if="goods.length > 0">
|
||||
<component-goods-list :propData="{style_type: 1, goods_list: goods}" :propCurrencySymbol="currency_symbol" propPriceField="seckill_min_price"></component-goods-list>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0" propMsg="没有相关商品"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCountdown from "../../../../components/countdown/countdown";
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
|
||||
import componentGoodsList from "../../../../components/goods-list/goods-list";
|
||||
const app = getApp();
|
||||
import componentCountdown from "../../../../components/countdown/countdown";
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
|
||||
import componentGoodsList from "../../../../components/goods-list/goods-list";
|
||||
|
||||
var seckill_static_url = app.globalData.get_static_url('seckill', true);
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
seckill_bg: 'background: url('+seckill_static_url+'header-bg.png) top/100% no-repeat;',
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
currency_symbol: app.globalData.data.currency_symbol,
|
||||
data_base: null,
|
||||
current: null,
|
||||
time: null,
|
||||
goods: [],
|
||||
is_valid: 0,
|
||||
// 自定义分享信息
|
||||
share_info: {}
|
||||
};
|
||||
},
|
||||
var seckill_static_url = app.globalData.get_static_url('seckill', true);
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
seckill_bg: 'background: url(' + seckill_static_url + 'header-bg.png) top/100% no-repeat;',
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
currency_symbol: app.globalData.data.currency_symbol,
|
||||
data_base: null,
|
||||
// 秒杀时段
|
||||
periods_list: [],
|
||||
current: null,
|
||||
time: null,
|
||||
goods: [],
|
||||
is_valid: 0,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
// nav滚动下标
|
||||
nav_active_index: 0
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCountdown,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentGoodsList
|
||||
},
|
||||
props: {},
|
||||
components: {
|
||||
componentCountdown,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentGoodsList
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad() {},
|
||||
onLoad() {},
|
||||
|
||||
onShow() {
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
onShow() {
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
},
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if ((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.globalData.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if ((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.globalData.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "index", "seckill"),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var data_base = data.config || null;
|
||||
var current = data.current || null;
|
||||
var time = (current == null) ? null : current.time || null;
|
||||
var goods = (current == null) ? [] : (current.goods || []);
|
||||
var is_valid = (time == null) ? 0 : (time.status == 1 ? 1 : 0);
|
||||
if(goods.length > 0) {
|
||||
for(var i in goods) {
|
||||
goods[i]['price_icon'] = (is_valid == 1) ? (current.goods_detail_icon || '秒杀价') : '';
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data_base: data_base,
|
||||
current: current,
|
||||
time: time,
|
||||
goods: goods,
|
||||
is_valid: is_valid,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: (goods.length > 0)
|
||||
});
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "index", "seckill"),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var data_base = data.config || null;
|
||||
var current = data.current || null;
|
||||
var time = (current == null) ? null : current.time || null;
|
||||
var goods = (current == null) ? [] : (current.goods || []);
|
||||
var is_valid = (time == null) ? 0 : (time.status == 1 ? 1 : 0);
|
||||
if (goods.length > 0) {
|
||||
for (var i in goods) {
|
||||
goods[i]['price_icon'] = (is_valid == 1) ? (current.goods_detail_icon || '秒杀价') : '';
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
periods_list: data.periods_list,
|
||||
data_base: data_base,
|
||||
current: current,
|
||||
time: time,
|
||||
goods: goods,
|
||||
is_valid: is_valid,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: (goods.length > 0)
|
||||
});
|
||||
console.log(this.periods_list);
|
||||
|
||||
if ((this.data_base || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data_base.seo_title || this.data_base.application_name,
|
||||
desc: this.data_base.seo_desc,
|
||||
path: '/pages/plugins/seckill/index/index',
|
||||
img: ((this.slider || null) != null && this.slider.length > 0) ? this.slider[0]['images_url'] : ''
|
||||
}
|
||||
});
|
||||
if ((this.data_base || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data_base.seo_title || this.data_base.application_name,
|
||||
desc: this.data_base.seo_desc,
|
||||
path: '/pages/plugins/seckill/index/index',
|
||||
img: ((this.slider || null) != null && this.slider.length > 0) ? this.slider[0]['images_url'] : ''
|
||||
}
|
||||
});
|
||||
|
||||
// 导航名称
|
||||
if((this.data_base.application_name || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data_base.application_name
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg
|
||||
});
|
||||
}
|
||||
// 导航名称
|
||||
if ((this.data_base.application_name || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data_base.application_name
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg
|
||||
});
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错'
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错'
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
}
|
||||
});
|
||||
},
|
||||
nav_event(e) {
|
||||
let index = e.currentTarget.dataset.index;
|
||||
this.setData({
|
||||
nav_active_index: index
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
<style scoped>
|
||||
@import './index.css';
|
||||
</style>
|
||||
Loading…
Reference in New Issue