Browse Source

Merge branch 'master' of http://8.134.10.79:3000/Leadfyy.co/ec.uniapp-master

# Conflicts:
#	pages.json
master
Enzo 4 years ago
parent
commit
c5dc2357d3
  1. 6
      App.vue
  2. 14
      components/lf-adModal/lf-adModal.vue
  3. 4
      main.js
  4. 78
      pages.json
  5. 2
      pages/address/add/add.less
  6. 42
      pages/address/add/add.vue
  7. 73
      pages/address/list/list.less
  8. 226
      pages/address/list/list.vue
  9. 158
      pages/index/category/category.vue
  10. 33
      pages/index/index/index.vue
  11. 44
      pages/index/openScreenAd/openScreenAd.vue
  12. 185
      pages/user/register/register.vue

6
App.vue

@ -5,11 +5,10 @@ export default {
globalData:{
giftLogin:false,
share: false, // false
app_first_full: true,
app_first_alert: true
},
onLaunch: function(e) {
// 广 TODO
// this.$url('/pages/index/openScreenAd/openScreenAd', {type: 'redirect'});
// #ifdef MP-WEIXIN
var referrerInfo = e.referrerInfo;
if (referrerInfo.appId) {
@ -50,7 +49,6 @@ export default {
// #endif
}
};
</script>

14
components/lf-adModal/lf-adModal.vue

@ -1,12 +1,12 @@
<template>
<view class="content" v-if="value">
<view class="content" v-if="value && list.length">
<view class="box">
<swiper class="swiper" :circular="true"
indicator-active-color="#0091ff"
:current="current"
:indicator-dots="list.length > 1">
<swiper-item v-for="(item, index) in list" :key="index">
<image class="img" :src="item" mode="aspectFill" @click="clickAd"></image>
<image class="img" :src="item.image" mode="aspectFill" @click="clickAd(item)"></image>
</swiper-item>
</swiper>
<view class="close" @click="close">
@ -22,19 +22,23 @@
value: {
type: Boolean,
default: true
},
list: {
type: Array,
default: []
}
},
data(){
return {
list: ['https://picsum.photos/200', 'https://picsum.photos/200']
}
},
created(){
},
methods: {
clickAd(){
this.$msg('您点击了广告图')
clickAd(item){
this.$url(item.url);
},
close(){
this.$emit('update:value', false);

4
main.js

@ -29,7 +29,9 @@ Vue.prototype.$cookieStorage = cookieStorage;
Vue.prototype.$config = config;
Vue.prototype.$store = store;
App.mpType = 'app'
Vue.prototype.getToken = function(){
return "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjczYTViNTA1NDNlYmNmMjFkNmZiMGJlNzc0NmJmMDE4MDc3MTRkY2Y1MjBiMjM3MGQyZDAyYzQxMTlmMDU4ZTkwMTUxNDQwOTk4MjJhODFhIn0.eyJhdWQiOiIzIiwianRpIjoiNzNhNWI1MDU0M2ViY2YyMWQ2ZmIwYmU3NzQ2YmYwMTgwNzcxNGRjZjUyMGIyMzcwZDJkMDJjNDExOWYwNThlOTAxNTE0NDA5OTgyMmE4MWEiLCJpYXQiOjE2MzExNjk1MDIsIm5iZiI6MTYzMTE2OTUwMiwiZXhwIjoxNjYyNzA1NTAyLCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.p0YoIC_bhOxIOugYxDQTOFIK9t2ORiHQq9H6JWzdByBJKWkFDBisKaXZJvzn1HdU5cjNQnHaBfWpG1Ed15cQlB2LdpXxxc38iaaGW2J6WhlLhVkehloii-TtlZTOeqNrpAHbSe5DRrmm_L07Llm9wr1T1A6pP3MhzdHiZ9d6748j3_cJjK4CJUl3WfYRTaozLFlI00OCW4zzGfgivSighjSFyhqMoHnQ2iSoeWdcJnYpXzXQdc5AXvXOt6eIIa7o2F6Ma1tUseTYVijEVfngdfd21JI1eH6tHrSqUItkQHAart9o74dJn9micI3WrN5yEBXgzemqWkQGV4QzFHLyd3wk-XvP1s2GhCeWlJZOQADzgzhLoxzFUbgM5xULWHp3yfpePGISlM4ZpBwTHcqQt1i_UkNX_zCxa3RYQbZFDfWW0-UPbvHw40t5BY6X7nTPMhPjPGnnPq18jyYBrWBbC9vBWs2o2IHAe5VlkHtmy_v5fymFJLfFzS784Nxp2qPJFWxI7IfrpNckHxohhs5LoieQivw2MyU2shFOUjgwe0xQgyg6UBg5PwNknGTTmzYdavCM4BiQ7moqOuoI15ccIEmc_uMiuLVEfDPlzejP9PQv6mj6IlkJ8HSu4KZU-LxKmtLnGeEwMjVAZBIhsOwzMkaMF1nZ70pgv2YYwBQyVVs"
}
const app = new Vue({
...App,
store

78
pages.json

@ -51,13 +51,15 @@
{
"path": "pages/store/list/list",
"style": {
"navigationBarTitleText": "商品列表"
"navigationBarTitleText": "商品列表",
"navigationStyle":"custom"
}
},
{
"path": "pages/store/comment/comment",
"style": {
"navigationBarTitleText": "商品评论"
"navigationBarTitleText": "商品评论" ,
"navigationStyle":"custom"
}
},
{
@ -70,7 +72,8 @@
{
"path": "pages/article/details",
"style": {
"navigationBarTitleText": ""
"navigationBarTitleText": "",
"navigationStyle":"custom"
}
},
{
@ -189,9 +192,12 @@
{
"path": "pages/address/add/add",
"style": {
"navigationBarTitleText": "收货地址"
"navigationBarTitleText": "收货地址",
"navigationStyle":"custom"
}
},
{ "path": "pages/address/list/list", "style": { "navigationBarTitleText": "收货地址列表",
"navigationStyle":"custom" } },
{
"path": "pages/order/evaluate/evaluate",
"style": {
@ -344,13 +350,6 @@
"navigationStyle": "custom"
}
},
{
"path" : "pages/order/newdetail/carrybyself",
"style" : {
"navigationBarTitleText": "订单详情",
"navigationStyle": "custom"
}
},
{
"path" : "pages/order/newdetail/newdetail",
"style" : {
@ -482,58 +481,7 @@
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
// "tabBar": {
// "backgroundColor": "#fff",
// "color": "#9B9B9B",
// "selectedColor": "#ff2741",
// "borderStyle": "white",
// "list": [
// {
// "pagePath": "pages/index/index/index",
// "text": "首页",
// "iconPath": "static/shop.png",
// "selectedIconPath": "static/shop-r.png"
// },
// {
// "pagePath": "pages/index/classification/classification",
// "text": "分类",
// "iconPath": "static/class.png",
// "selectedIconPath": "static/class-r.png"
// },
// {
// "pagePath": "pages/store/cart/cart",
// "text": "购物车",
// "iconPath": "static/card.png",
// "selectedIconPath": "static/card-r.png"
// },
// {
// "pagePath": "pages/user/personal/personal",
// "text": "我的",
// "iconPath": "static/user.png",
// "selectedIconPath": "static/user-r.png"
// }
// ]
// },
"condition" : { //
"current": 0, //(list )
"list": [
{
"name": "首页", //
"path": "pages/index/index/index", //
"query": "" //onLoad
},
{
"name": "测试",
"path": "pages/user/personal/personal",
"query": ""
}
]
}
"backgroundColor": "#F8F8F8",
"navigationStyle":"custom"
}
}

2
pages/address/add/add.less

@ -111,7 +111,7 @@
width:45px;
text-align: center;
border-radius:11px;
background-color: #FB5054;
background-color: #15706f;
}
}

42
pages/address/add/add.vue

@ -1,5 +1,6 @@
<template>
<view id="address-add">
<lf-nav :title="page_title" :showIcon="true" bgColor="#fff"></lf-nav>
<view class="indetify-img" v-show="parseResult" @tap="closeImg">
<image src="https://cdn.guojiang.club/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20200403161800.png" mode="widthFix"></image>
</view>
@ -13,11 +14,15 @@
<view class="info-item">
<radio-group class="lf-flex">
<label>
<radio></radio>
<radio-group @change="radioChange">
<radio :checked="detail.sex == 0" value="0"></radio>
</radio-group>
<text class="lf-m-l-15">女士</text>
</label>
<label>
<radio></radio>
<radio-group @change="radioChange">
<radio :checked="detail.sex == 1" value="1"></radio>
</radio-group>
<text class="lf-m-l-15">先生</text>
</label>
</radio-group>
@ -25,7 +30,7 @@
<view class="info-item">
<label for="phone">联系电话:</label>
<view class="form-control">
<input type="number" id="phone" data-type="mobile" :value="detail.mobile" @input="input" />
<input type="number" maxlength="11" id="phone" data-type="mobile" :value="detail.mobile" @input="input" />
</view>
</view>
@ -72,7 +77,7 @@
<view class="info-item">
<label for="name">门牌号:</label>
<view class="form-control">
<input type="text" id="name" data-type="accept_name" :value="detail.accept_name" @input="input" />
<input type="text" id="name" data-type="house_num" :value="house_num" @input="input" />
</view>
</view>
<view class="info-item">
@ -129,6 +134,8 @@ export default {
area: 430105,
city: 430100,
province: 430000,
sex: '',
house_num: ''
},
order_no: '',
id: '',
@ -165,7 +172,8 @@ export default {
pickerValueDefault: [0],
pickerValueArray: [],
address_text:'',
parseResult:''
parseResult:'',
page_title: ''
};
},
@ -197,24 +205,29 @@ export default {
this.setData({
config: config
});
pageLogin(getUrl());
// pageLogin(getUrl());
this.setData({
id: e.id
});
if (e.id) {
wx.setNavigationBarTitle({
title: '修改收货地址'
});
// wx.setNavigationBarTitle({
// title: ''
// });
this.page_title = '修改收货地址';
this.queryAddress(e.id);
} else {
wx.setNavigationBarTitle({
title: '新增收货地址'
});
this.page_title = '新增收货地址';
// wx.setNavigationBarTitle({
// title: ''
// });
}
},
methods: {
radioChange(e){
this.detail['sex'] = e.target.value;
},
//
closeImg(){
this.parseResult = '';
@ -362,10 +375,11 @@ export default {
//
queryAddress(id) {
var token = this.$cookieStorage.get('user_token');
console.log(this.getToken)
this.$http.get({
api: 'api/address/' + id,
header: {
Authorization: token
Authorization: token || this.getToken()
}
}).then(res => {
if (res.statusCode == 200) {
@ -412,6 +426,7 @@ export default {
area: data.area,
address_name: data.address_name.join(" "),
address: data.address,
sex: data.sex,
is_default: data.is_default ? 1 : 0
};
var token = this.$cookieStorage.get('user_token');
@ -481,6 +496,7 @@ export default {
area: data.area,
address_name: data.address_name.join(" "),
address: data.address,
house_num: data.house_num,
is_default: data.is_default ? 1 : 0
};
var token = this.$cookieStorage.get('user_token');

73
pages/address/list/list.less

@ -0,0 +1,73 @@
#address-list{
.list-box{
// padding-bottom: 20px;
padding: 30rpx 32rpx;
width: 750rpx;
height: max-content;
box-sizing: border-box;
.list-item{
font-size:14px;
background:#FFFFFF;
// padding:15px 40px 15px 15px;
// background-image:url("https://uto.ibrand.cc/m/static/img/ic_forward.png");
// background-repeat:no-repeat;
// background-position:100%;
// background-size:20px;
width: 686rpx;
height: max-content;
background: #FFFFFF;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
margin-bottom: 30rpx;
.user{
display: flex;
align-items: center;
justify-content: space-between;
.name{
.phone{
margin-left: 10px;
}
}
.default{
color: #099fff;
}
}
.address{
display: flex;
-webkit-box-pack: justify;
justify-content: space-between;
}
}
}
.add-address{
display: flex;
justify-content: center;
// background-color: #ffffff;
padding:10px 12px;
position: fixed;
bottom: 130rpx;
left: calc(50% - 281rpx);
.small-btn{
display: flex;
align-items: center;
justify-content:center;
// background-color:#FB5054;
color: #FFFFFF;
// border-radius:4px;
// height: 40px;
line-height: 40rpx;
width: 550rpx;
height: 100rpx;
background: #15716E;
border-radius: 50rpx;
.icon{
margin-right: 15px;
}
}
}
}

226
pages/address/list/list.vue

@ -0,0 +1,226 @@
<template>
<view id="address-list">
<lf-nav title="地址管理" :showIcon="true" bgColor="#fff"></lf-nav>
<view class="list-box">
<view class="list-item" :data-info="JSON.stringify(item)" :data-id="item.id" v-for="(item, index) in list" :key="index">
<!-- <view class="user">
<view class="name">
<text>{{item.accept_name}}</text>
<text class="phone">{{item.mobile}}</text>
</view>
<view class="default" v-if="item.is_default">
默认
</view>
</view>
<view class="address">{{item.address_name}} {{item.address}}</view> -->
<view class="lf-font-28 user-item">
<text class="lf-color-black lf-font-bold">{{item.accept_name}}</text>
<text class="lf-color-777 lf-m-l-20">{{item.mobile}}</text>
</view>
<view class="address-item lf-line-2">
<text>{{item.address_name}}</text>
<text>{{item.address}}</text>
</view>
<view class="menu-item lf-row-between lf-m-t-30">
<view class="lf-row-center">
<radio-group @change="radioChange">
<radio :checked="item.is_default" :value="index"></radio>
</radio-group>
<text class="lf-m-l-15 lf-font-24 lf-color-777">默认地址</text>
</view>
<view class="lf-row-between">
<view @tap="setInfo(item)">
<text class="lf-iconfont icon--1"></text>
<text class="lf-m-l-10">编辑</text>
</view>
<view class="lf-m-l-50" @click="deleteAddress(item)">
<text class="lf-iconfont icon--1"></text>
<text class="lf-m-l-10">删除</text>
</view>
</view>
</view>
</view>
</view>
<view style="height: 230rpx;"></view>
<view class="add-address" @tap="add">
<view class="small-btn">
<text class="lf-iconfont icon--2"></text>
<text class="lf-m-l-10">新增收货地址</text>
</view>
</view>
</view>
</template>
<script>
import {pageLogin, getUrl,config,is} from '@/common/js/utils.js';
export default {
data() {
return {
list: [],
order_no: '',
url: '',
id:''
};
},
onShow() {
this.queryAddressList(); // let app =getApp();
// app.isBirthday().then(()=>{
// if(this.$cookieStorage.get("birthday_gift")){
// var giftData=this.$cookieStorage.get("birthday_gift").data;
// new app.ToastPannel().__page.showText(giftData);
// }
// });
},
onLoad(e) {
//
// pageLogin(getUrl());
this.setData({
order_no: e.order_no,
url: e.url
});
},
components: {},
props: {},
methods: {
//
deleteAddress(item){
console.log("item", item)
this.$http.ajax({
api: '/api/address/'+ item.id,
method: 'DELETE',
header: {
Authorization: this.getToken()
}
}).then(res => {
console.log("删除地址", res);
})
},
//
radioChange(e){
let current = e.target.value;
this.list.forEach((item, index) => {
if(current == index){
item.is_default = 1;
}else{
item.is_default = 0;
}
})
},
setInfo(e) {
// var from = e.currentTarget.dataset.info;
var from = e;
var data = this.$cookieStorage.get('order_form');
// var from=JSON.parse(from);
if (!data) {
return this.view(from.id);
}
var order_no = this.order_no;
if (order_no && data.order_no === order_no) {
data.address = from;
this.$cookieStorage.set('order_form', data);
wx.navigateBack({
url: '/' + this.url
});
} else {
return this.view(from.id);
}
},
view(id) {
wx.navigateTo({
url: '/pages/address/add/add?id=' + id
});
},
add() {
wx.navigateTo({
url: '/pages/address/add/add'
});
},
//
queryAddressList() {
var token = this.$cookieStorage.get('user_token');
this.$http.get({
api: 'api/address',
header: {
Authorization: token || this.getToken()
}
}).then(res => {
if (res.statusCode == 200) {
res = res.data;
if (res.status) {
this.setData({
list: res.data
});
} else {
wx.showToast({
title: res.message,
image: '../../../static/error.png'
});
}
} else {
wx.showToast({
title: '获取信息失败',
image: '../../../static/error.png'
});
}
});
},
setData: function (obj) {
let that = this;
let keys = [];
let val, data;
Object.keys(obj).forEach(function (key) {
keys = key.split('.');
val = obj[key];
data = that.$data;
keys.forEach(function (key2, index) {
if (index + 1 == keys.length) {
that.$set(data, key2, val);
} else {
if (!data[key2]) {
that.$set(data, key2, {});
}
}
data = data[key2];
});
});
}
},
computed: {},
watch: {}
};
</script>
<style>
page{
background-color: #F8F8F8;
}
</style>
<style rel="stylesheet/less" lang="less">
@import "list";
.user-item, .menu-item{
height: 50rpx;
width: 100%;
}
.address-item{
width: 100%;
margin-top: 10rpx;
font-size: 28rpx;
color: #333333;
}
</style>

158
pages/index/category/category.vue

@ -10,7 +10,7 @@
</view>
</view>
<!-- 分类 -->
<view class="page" v-if="current == 0">
<view class="page" v-if="current == 0 && dataArr.length">
<scroll-view class="left_view p_r" scroll-y :style="{ height: autoHeight }">
<block v-for="(item, index) in dataArr" :key="index">
<view :class="[left_selectIndex == index ? 'left_item_s' : '', 'left_item']" :id="'left_' + index" @click="leftTap({ item, index })">{{ item.name }}</view>
@ -23,9 +23,9 @@
<view :ref="'left_' + index" class="right_item " :id="'left_' + index">
<text class="right_item_title ">{{ item.name }}</text>
<view class="right_item_view">
<view class="item" v-for="(item, index) in item.subArr" :key="index" @click="rightTap(item)">
<image :src="item.img" :style="{ width: '100%', height: subItemW + 'px', background: '#999999' }"></image>
<text class="lf-font-24">{{ item.name }}</text>
<view class="item" v-for="(c_item, c_index) in item.sub_category" :key="c_index" @click="rightTap(c_item)">
<image :src="c_item.image" :style="{ width: '100%', height: subItemW + 'px', background: '#999999' }"></image>
<text class="lf-font-24">{{ c_item.name }}</text>
</view>
</view>
</view>
@ -36,37 +36,52 @@
<!-- 品牌 -->
<view class="brand" v-else-if="current == 1" :style="{height: autoHeight}">
<!-- 筛选 -->
<view class="lf-filter-box">
<view class="lf-filter-box" :style="{'z-index': filter_active == '' ? 1 : 99}">
<view class="lf-filter" :class="{'lf-filter-after': filter_active == ''}">
<view :class="{'filter-active': filter_active == 'floor'}" @click="filter_active = 'floor'">楼层</view>
<view :class="{'filter-active': filter_active == 'class'}" @click="filter_active = 'class'">分类</view>
<view v-for="(value, key) in filter_list" :key="key"
:class="{'filter-active': filter_active == key}"
@click="filter_active = key">{{ value.name }}
</view>
</view>
<view class="filter-modal-mask" :style="{height: otherHeight}" v-if="filter_active != ''" @click="filter_active = ''">
<view class="filter-modal">
<view class="filter-item" v-for="(item, index) in 6" :key="index">{{ '哈哈'+ item }}</view>
<view class="filter-modal" @click.stop>
<view class="filter-item"
:class="{'filter-item-active': filter_list[filter_active].current == index}"
@click="selectFilter(item, index)"
v-for="(item, index) in filter_list[filter_active].list"
:key="index">{{ item.name || item }}
</view>
</view>
</view>
</view>
<!-- 内容 -->
<scroll-view class="brand-scroll" :scroll-into-view="scrollAnchorId" :scroll-y="true" :style="{height: otherHeight}">
<view class="lf-flex brand-item"
:id="'anchor-'+ index"
@click="$url('/pages/shop/shopdetail')"
v-for="(item, index) in point_list" :key="index">
<image class="img" src="https://picsum.photos/200"></image>
:id="'anchor-'+ item.initial"
@click="$url('/pages/shop/shopdetail?id='+ item.id)"
v-for="(item, index) in brand_list" :key="index">
<image class="img" :src="item.logo"></image>
<view class="info">
<view class="lf-font-36 lf-font-bold lf-color-black">luckin coffee 瑞幸咖啡 {{ item }}</view>
<view class="lf-font-24 lf-color-gray">餐饮·美食18件在售</view>
<view class="lf-font-36 lf-font-bold lf-color-black">{{ item.name }}</view>
<view class="lf-font-24 lf-color-gray">{{ item.category }}{{ item.goods_count || 0 }}件在售</view>
<view class="lf-font-24">
<text class="lf-iconfont icon--1 lf-font-24"></text>
<text class="lf-color-gray lf-m-l-10">L2</text>
<text class="lf-iconfont icon-dizhi lf-font-24"></text>
<text class="lf-color-gray lf-m-l-10">{{ item.floor }}</text>
</view>
</view>
</view>
</scroll-view>
<!-- 锚点定位 -->
<view class="fixed-point" @touchmove="pointTouchmove">
<view class="point-item" @click="pointClick" :id="'point-'+index" :style="{height: 100 / 26 +'%'}" v-for="(item, index) in point_list" :key="index">{{ item }}</view>
<view class="fixed-point" v-if="point_list.length">
<view class="fixed-content" @touchmove="pointTouchmove">
<view class="point-item"
@click="pointClick"
:id="'point-'+ item"
:style="{height: 100 / 26 +'%'}"
v-for="(item, index) in point_list"
:key="index">{{ item }}
</view>
</view>
</view>
</view>
<lf-tabbar></lf-tabbar>
@ -89,7 +104,7 @@
ttscrollH: 0, //
placeholderH: 0, //
heighArr: [],
dataArr: testdata,
dataArr: [],
current: 1,
nav_height: 0,
tabs: [{
@ -97,7 +112,20 @@
},{
name: '品牌'
}],
filter_list: {
'floor': {
name: '楼层',
list: [],
current: null
},
'class': {
name: '分类',
list: [],
current: null
}
},
filter_active: '',
brand_list: [],
point_list: [],
scrollAnchorId: ''
};
@ -120,23 +148,55 @@
},
onLoad(options) {
// https://ext.dcloud.net.cn/plugin?id=5031
this.getBrandList();
if(this.$isRight(options)){
this.current = options.current || 1;
this.left_selectIndex = options.type || 0;
this.right_selectIndex = options.type || 0;
}
let info = uni.getSystemInfoSync();
let self = this;
self.scrollH = info.screenHeight;
self.subItemW = parseInt((info.screenWidth * (2 / 3) - 15 * 2 - 24) / 3);
setTimeout(function() {
this.getCategoryList().then(() => {
self.computerH();
}, 100);
this.createAtoZ();
});
// setTimeout(function() {
// self.computerH();
// }, 100);
// this.createAtoZ();
},
methods: {
// A-Z
getBrandList(){
this.$http.get({
api: '/api/brand'
}).then(res => {
console.log("getBrandList", res);
let category = res.data.data.category;
let floor = res.data.data.floor;
this.filter_list['floor'].list = floor;
this.filter_list['class'].list = category;
this.brand_list = res.data.data.list;
this.autoCreateAtoZ(res.data.data.list);
});
},
getCategoryList(){
return new Promise((resolve, reject) => {
this.$http.get({
api: '/api/category/list'
}).then(res => {
console.log("getCategoryList", res);
this.dataArr = res.data.data;
resolve(res);
}).catch(err => reject(err));
}) },
//
selectFilter(item, index){
console.log(item, index);
this.filter_list[this.filter_active].current = index;
this.filter_active = '';
},
// A-Z
createAtoZ(){
let point_list = [];
for(var i=0; i<26; i++){
@ -144,16 +204,29 @@
}
this.point_list = point_list;
},
// A-Z
autoCreateAtoZ(list){
let letters = Array.from(new Set(list.map(item => item.initial)));
letters.sort(function(a1, b1){
let a = a1.toLowerCase();
let b = b1.toLowerCase();
if (a < b) return -1;
if (a > b) return 1;
return 0;
})
this.point_list = letters;
},
pointTouchmove(event){
console.log(event);
},
pointClick(event){
let index = (event.target.id).replace('point-', '');
let letter = this.point_list[index];
// let index = (event.target.id).replace('point-', '');
// let letter = this.point_list[index];
let letter = (event.target.id).replace('point-', '');
this.scrollAnchorId = '';
this.$msg(letter);
this.$nextTick(() => {
this.scrollAnchorId = 'anchor-'+ index;
this.scrollAnchorId = 'anchor-'+ letter;
})
},
leftTap: function(e) {
@ -161,8 +234,8 @@
this.right_selectIndex = e.index;
},
//
rightTap: function() {
this.$msg('敬请期待')
rightTap: function(item) {
this.$url(item.path);
},
rightScroll: function(e) {
let scrollH = e.detail.scrollTop + 30;
@ -183,7 +256,7 @@
this.ttscrollH = 0;
for (let item of this.dataArr) {
let title_lineH = 49; //rpx
let subNum = item.subArr.length;
let subNum = item.sub_category.length;
let subImgH = this.subItemW; //rpx
let subTitleH = 40; //rpx
let rowSpecH = 8; //rpx
@ -380,6 +453,7 @@
left: 0;
width: 100%;
background-color: rgba(0,0,0,0.5);
z-index: 99;
.filter-modal{
width: 750rpx;
height: max-content;
@ -389,7 +463,7 @@
display: flex;
flex-wrap: wrap;
position: relative;
z-index: 1;
z-index: 102;
.filter-item{
width: 215rpx;
height: 65rpx;
@ -408,6 +482,10 @@
margin-top: 21rpx;
}
}
.filter-item-active{
background-color: #15716E;
color: #FFFFFF;
}
}
}
}
@ -441,17 +519,25 @@
.fixed-point{
position: fixed;
right: 0;
top: 18vh;
height: 70vh;
top: 0;
// top: 18vh;
// height: 70vh;
height: 100vh;
width: 57rpx;
z-index: 2;
display: flex;
align-items: center;
.fixed-content{
width: 100%;
height: max-content;
padding: 14rpx 0rpx;
background-color: rgba(0,0,0,0.3);
border-radius: 30rpx 0rpx 0rpx 30rpx;
padding: 14rpx 0rpx;
z-index: 2;
.point-item{
font-size: 24rpx;
color: #FFFFFF;
text-align: center;
}
}
}
</style>

33
pages/index/index/index.vue

@ -379,7 +379,7 @@
</view>
</view>
<!-- ad广告弹出组件 TODO 暂时先注释 -->
<!-- <lf-ad-modal :value.sync="show_ad"></lf-ad-modal> -->
<lf-ad-modal :value.sync="show_ad" :list="ad_modal_list"></lf-ad-modal>
<!-- 回到顶部组件 -->
<u-back-top :scrollTop="pageScrollTop"></u-back-top>
<!-- tabbar组件 -->
@ -452,7 +452,8 @@
userInfo: '',
microData:"",
is_login:'',//
show_ad: true, // ad广
show_ad: false, // ad广
ad_modal_list: [], // ad广
nav_bg_color: 'transparent' ,//
recommend_list: [
{
@ -550,6 +551,15 @@
//
onLoad(e) {
// 广 todo
// if(app.globalData.app_first_full){
// getApp().globalData.app_first_full = false;
// this.$url('/pages/index/openScreenAd/openScreenAd', {type: 'launch'});
// }else if(app.globalData.app_first_alert){
// getApp().globalData.app_first_alert = false;
// this.getAlertAd();
// }
//
var gbConfig = this.$cookieStorage.get('globalConfig') || '';
@ -598,6 +608,25 @@
},
//
methods: {
getAlertAd(){
this.$http.get({
api: '/api/ad'
}).then(res => {
let alert = res.data.data.alert;
this.alert = alert;
if(this.$isRight(alert)){
if(this.$shared.isValueType(alert.image) == 'array'){
this.ad_modal_list = alert.image;
}else{
this.ad_modal_list.push({
image: alert.image,
url: alert.url
})
}
this.show_ad = true;
}
});
},
close(){
this.setData({
showNoGift:false

44
pages/index/openScreenAd/openScreenAd.vue

@ -1,7 +1,9 @@
<template>
<view class="content">
<image class="img" src="https://picsum.photos/200" mode="aspectFill"></image>
<block v-if="$isRight(full)">
<image class="img" :src="full.image" mode="aspectFill" @click="clickAd"></image>
<view class="tips" @click="next">跳过 {{ num }}s</view>
</block>
</view>
</template>
@ -10,28 +12,49 @@
data(){
return {
num: 5,
timer: null
timer: null,
full: {}
}
},
onLoad(){
this.timer = setInterval(() => {
this.num--;
if(this.num <= 0){
this.getAd();
},
onUnload(){
if(this.timer){
clearInterval(this.timer);
this.timer = null;
}
},
methods: {
getAd(){
this.$http.get({
api: '/api/ad'
}).then(res => {
this.full = res.data.data.full;
if(this.$isRight(res.data.data.full)){
this.startTime();
}else{
this.next();
}
}, 1000);
}).catch(rej => {
this.next();
})
},
onUnload(){
if(this.timer){
startTime(){
this.timer = setInterval(() => {
this.num--;
if(this.num <= 0){
clearInterval(this.timer);
this.timer = null;
this.next();
}
}, 1000);
},
methods: {
next(){
this.$url('/pages/index/index/index', {type: 'redirect'});
},
clickAd(){
this.$url(this.full.url, {type: 'redirect'});
}
}
}
@ -50,6 +73,8 @@
.img{
width: 100%;
height: 100%;
position: absolute;
z-index: 9;
}
.tips{
position: absolute;
@ -64,6 +89,7 @@
justify-content: center;
align-items: center;
border-radius: 28rpx;
z-index: 999;
}
}
</style>

185
pages/user/register/register.vue

@ -6,28 +6,195 @@
</view>
<view class="fixed-btn">
<button class="btn1" hover-class="lf-opacity" @click="toPhoneLogin">手机号登录</button>
<button class="btn2" hover-class="lf-opacity" @click="getUserInfo">微信授权登录</button>
<button class="btn2" hover-class="lf-opacity" @click="wxLogin">微信授权登录</button>
</view>
</view>
</template>
<script>
import { config, wechat, GetUrl } from '@/common/js/utils.js';
export default {
data(){
return {
code: '',
url: '',
logo: '',
author: config.PACKAGES.author,
config: '',
showAgreement: false,
agreement: '',
open_id: '',
h5_url: ''
}
},
onShow(){
var token = this.$cookieStorage.get('user_token');
// this.setData({
// token: token
// });
this.token = token;
var initInfo = this.$cookieStorage.get('init');
if (initInfo && initInfo.shop_show_logo) {
this.setData({
logo: initInfo.shop_show_logo
});
}
if (token) {
wx.switchTab({
url: '/pages/user/personal/personal'
});
} else {
// #ifdef MP-WEIXIN
this.wxLogin();
// #endif
}
},
onLoad(e){
//
var bgConfig = this.$cookieStorage.get('globalConfig') || '';
this.setData({
config: bgConfig
});
if (e.url) {
this.url = decodeURIComponent(e.url);
console.log('this.url',this.url)
}
if (e.shop_id) {
this.$cookieStorage.set('shop_id', e.shop_id);
}
this.getGreementInfo();
},
methods: {
getUserInfo(){
uni.getUserProfile({
desc: '我们将获取到的信息用于展示',
lang: 'zh_CN',
complete: result => {
console.log(result);
if(result.errMsg == 'getUserProfile:ok'){
console.log("获取成功!");
//
getGreementInfo() {
console.log("获取协议")
// this.$http.get({
// api: 'api/user/agreement'
// }).then(res => {
// if (res.statusCode == 200) {
// res = res.data;
// if (res.status) {
// this.setData({
// agreement: res.data
// });
// }
// }
// });
},
wxLogin(){
uni.showLoading({
title: '正在自动登录',
mask: true
});
uni.login({
success: res => {
console.log(res);
if (res.code) {
this.autoLogin(res.code);
} else {
this.$msg('获取code失败');
}
},
});
// uni.getUserProfile({
// desc: '',
// lang: 'zh_CN',
// complete: result => {
// console.log(result);
// if(result.errMsg == 'getUserProfile:ok'){
// console.log("");
// }
// }
// })
},
autoLogin(code) {
this.$http.post({
api: 'api/oauth/miniprogram/login',
data: {
code: code,
open_type: 'miniprogram',
shop_id: this.$cookieStorage.get('shop_id') || '',
agent_code: this.$cookieStorage.get('coupon_agent_code') || this.$cookieStorage.get('agent_code') || '',
clerk_id: this.$cookieStorage.get('clerk_id') || '',
agent_code_time: this.$cookieStorage.get('agent_code_time') || '',
shop_id_time: this.$cookieStorage.get('shop_id_time') || ''
}
}).then(res => {
res = res.data;
if (res.data && res.data.open_id) {
this.setData({
open_id: res.data.open_id
});
} // token
if (res.data.access_token) {
console.log('已经返回给我了token');
wx.hideLoading();
var access_token = res.data.token_type + ' ' + res.data.access_token;
var expires_in = res.data.expires_in || 315360000;
this.$cookieStorage.set("user_token", access_token, expires_in);
if (this.url) {
wx.redirectTo({
url: "/" + this.url,
fail: () => {
wx.switchTab({
url: "/" + this.url
});
}
})
} else {
wx.switchTab({
url: '/pages/user/personal/personal'
});
}
} else {
wx.hideLoading();
}
}).catch(rej => {
wx.hideLoading();
wx.showModal({
content: '请求失败,请重试',
showCancel: false,
success: res => {
if (res.confirm || !res.cancel && !res.confirm) {
this.wxLogin();
}
}
});
});
},
toPhoneLogin(){
this.$url('/pages/user/loginType/loginType');
},
setData: function(obj) {
let that = this;
let keys = [];
let val, data;
Object.keys(obj).forEach(function(key) {
keys = key.split('.');
val = obj[key];
data = that.$data;
keys.forEach(function(key2, index) {
if (index + 1 == keys.length) {
that.$set(data, key2, val);
} else {
if (!data[key2]) {
that.$set(data, key2, {});
}
}
data = data[key2];
});
});
}
}
}

Loading…
Cancel
Save