Merge branch 'dev' of gitee.com:zongzhige/shopxo-uniapp into dev-sws

master
sws 2023-09-09 17:43:07 +08:00
commit cc2319dd5c
8 changed files with 3110 additions and 2875 deletions

3414
App.vue

File diff suppressed because it is too large Load Diff

View File

@ -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);
}
},

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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>

View File

@ -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">

View File

@ -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;
}

View File

@ -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>