Browse Source

调轮播图,常见问题,关于我们页面接口

home_hotList
ld0104 2 years ago
parent
commit
bb1d32a20c
  1. 2
      api/public.js
  2. 9
      api/store.js
  3. 26
      api/user.js
  4. 22
      pages/activity/activity/index.vue
  5. 1847
      pages/home/index.vue
  6. 26
      pages/shop/Evaluations/EvaluationDetail/index.vue
  7. 174
      pages/shop/GoodsCollection/index.vue
  8. 24
      pages/shop/brands/index.vue
  9. 21
      pages/user/AboutUs/index.vue
  10. 3
      pages/user/PersonalData/index.vue
  11. 80
      pages/user/Problem/index.vue
  12. 22
      pages/user/coupon/GetCoupon/index.vue
  13. 1
      pages/user/signIn/Sign/index.vue

2
api/public.js

@ -17,6 +17,8 @@ export function getCanvas() {
return request.get("/getCanvas?terminal=3", {}, { login: false });
}
/**
* 热门榜单
* @returns {*}

9
api/store.js

@ -1,4 +1,13 @@
import request from "@/utils/request";
/**
* 获取各类轮播图
*
*/
export function getBanner(type) {
return request.get("/menu/banner/"+type,{}, { login: false });
}
/*
* 商品分类

26
api/user.js

@ -1,4 +1,5 @@
import request from '@/utils/request'
import { dataFormat } from '../utils'
/**
* 省市区
@ -195,6 +196,17 @@ export function getCollectUser(page, limit, type) {
type,
})
}
/**
*
* 获取评测收藏
*/
export function getCollectEvaluation(page, limit, type) {
return request.get('/collectEvaluation/user', {
page: page,
limit: limit,
type,
})
}
/*
* 删除收藏产品
@ -442,3 +454,17 @@ export function setDetection() {
export function getRechargeApi() {
return request.get('recharge/index')
}
/**
* 常见问题
*/
export function getProblem() {
return request.get('/menu/problem',{})
}
/**
* 关于我们
*/
export function getAboutUs() {
return request.get('/menu/aboutUs',{})
}

22
pages/activity/activity/index.vue

@ -15,7 +15,7 @@
<view class="banner-box">
<swiper class="swiper" circular @change="swiperChange" :autoplay="true">
<swiper-item v-for="(item, index) in banner" :key="index" class="swiper-item">
<swiper-item v-for="(item, index) in banner" :key="index" class="swiper-item" @click="goBannerDetail">
<image class="swiper-image " :src="item" mode="aspectFill" lazy-load>
</image>
</swiper-item>
@ -88,6 +88,7 @@
</template>
<script>
import { getBanner} from '@/api/store';
import { getSeckillConfig, getSeckillList, getCombinationList, getBargainList } from '@/api/activity';
import CountDown from '@/components/CountDown';
export default {
@ -96,10 +97,7 @@
},
data() {
return {
banner: [
'http://video-zsw.qiniu.lotus-wallet.com/Banner1.png',
'http://video-zsw.qiniu.lotus-wallet.com/Banner1.png'
],
banner: [],
swiperCurrent: 0,
activityType: 0,
tabType: 0,
@ -132,8 +130,22 @@
this.seckillInfo();
this.getGrouponList();
this.getBargainList();
},
onLoad() {
getBanner(3).then(
res => {
console.log(res,777777777777777777);
// this.$set(this,'banner',res.data.banner)
})
},
methods: {
goBannerDetail(item){
if (item.uniapp_url) {
this.$yrouter.push(item.uniapp_url)
}
},
swiperChange(e) {
this.swiperCurrent = e.detail.current;
},

1847
pages/home/index.vue

File diff suppressed because it is too large Load Diff

26
pages/shop/Evaluations/EvaluationDetail/index.vue

@ -135,7 +135,6 @@
onLoad() {
this.id = this._route.query.id
this.getInfo(this.id);
this.getEvaluation(this.id)
},
onShareAppMessage() {
return {
@ -156,21 +155,31 @@
// this.isCollection=!this.isCollection
// console.log('++++++++');
// })
// },
//
// setCollect: function() {
// let that = this,
// id = that.storeInfo.id,
// category = 'collect'
// if (that.storeInfo.userCollect) {
// getCollectDel(id, category).then(function() {
// that.storeInfo.userCollect = !that.storeInfo.userCollect
// })
// } else {
// getCollectAdd(id, category).then(function() {
// that.storeInfo.userCollect = !that.storeInfo.userCollect
// })
// }
// },
//
getEvaluation(id){
// collectEvaluation/add
},
//
getCollection(){
var param={}
param.id=this.id
param.category= ""
param.category= "collect"
getUserCollection(param).then(res=>{
console.log(res,'==========11');
})
@ -437,6 +446,7 @@
height: 80rpx;
padding: 0;
background-color: #F1F1F1;
width: 100rpx;
}
.contacButton::after {
border: 0;

174
pages/shop/GoodsCollection/index.vue

@ -27,7 +27,7 @@
<view class="collectionGoods" v-if="collectProductList.length > 0">
<view class="item" v-for="(item, collectProductListIndex) in collectProductList" :key="collectProductListIndex" :data-index="collectProductListIndex" @touchstart="drawStart" @touchmove="drawMove" @touchend="drawEnd" :style="'right:' + item.right + 'rpx'">
<view class="info-box acea-row row-between-wrapper" @click="goGoodsCon(item)">
<view v-if="navType==0" class="info-box acea-row row-between-wrapper" @click="goGoodsCon(item)">
<view class="pictrue">
<image :src="item.image" />
</view>
@ -40,11 +40,37 @@
<view class="money" v-else>{{ item.price }}</view>
</view>
</view>
<view class="delete" @tap.stop="delCollection(collectProductListIndex)" :style="item.right?'right: -122rpx;':''">删除</view>
<!-- 评测 -->
<view v-else class="review-box acea-row row-between" @click="goEvaluation(item)">
<view class="left acea-row row-column-between">
<view class="acea-row row-column-between">
<view class="title">
BEJjjjjSII
</view>
<view class="title1">
OISJFSJIJ
</view>
<view class="title2">
给你电话和
</view>
</view>
<view @tap.stop="goMore" class="more">
MORE
</view>
</view>
<view class="right">
<image src="../../../static/images/earth-white.png" mode=""></image>
</view>
</view>
<view class="delete" @tap.stop="delCollection(collectProductListIndex)" :style="item.right?'right: -122rpx;':''" :class="{'del-height':navType==1}">删除</view>
</view>
</view>
<Loading :loaded="loadend" :loading="loading"></Loading>
</view>
@ -62,6 +88,7 @@
<script>
import Recommend from '@/components/Recommend'
import { getCollectUser, getCollectDel } from '@/api/user'
import {delUserCollection} from '@/api/store.js'
import Loading from '@/components/Loading'
export default {
name: 'GoodsCollection',
@ -86,10 +113,10 @@ export default {
}
},
mounted: function() {
this.get_user_collect_product()
this.get_user_collect_product(this.navType)
},
onReachBottom() {
!this.loading && this.get_user_collect_product()
!this.loading && this.get_user_collect_product(this.navType)
},
methods: {
changeType(i) {
@ -98,6 +125,7 @@ export default {
},
drawStart(e) {
console.log(155555);
var touch = e.touches[0];
// let index = e.currentTarget.dataset.index;
for (var index in this.collectProductList) {
@ -147,12 +175,32 @@ export default {
})
}
},
get_user_collect_product: function() {
goEvaluation(item){
this.$yrouter.push({
//
path: 'pages/shop/Evaluations/EvaluationDetail/index',
query: { id: item.pid },
})
},
goMore(){
this.$yrouter.push({
//
path: 'pages/shop/Evaluations/index',
})
},
get_user_collect_product: function(navType,clear) {
let that = this
// if(clear){
// that.collectProductList=[]
// that.page=1
// that.limit=20
// }
if (that.loading) return //false
if (that.loadend) return //false
that.loading = true
getCollectUser(that.page, that.limit, that.type).then(res => {
if(navType===0){
getCollectUser(that.page, that.limit, that.type).then(res => {
that.loading = false
//apply();js;
var arr = [];
@ -167,13 +215,34 @@ export default {
that.loadend = res.data.length < that.limit //
that.page = that.page + 1
})
}else{
// collectEvaluation/user
getCollectEvaluation(that.page, that.limit, that.type).then(res => {
that.loading = false
//apply();js;
var arr = [];
for(var i in res.data){
res.data[i].right = 0;
arr.push(res.data[i])
};
that.collectProductList.push.apply(that.collectProductList, arr)
// this.collectProductList.forEach(val => {
// val.right = 0;
// })
that.loadend = res.data.length < that.limit //
that.page = that.page + 1
})
}
},
//
delCollection: function(index) {
let that = this,
id = that.collectProductList[index].pid,
category = that.collectProductList[index].category
getCollectDel(id, category).then(function() {
if(that.navType===0){
getCollectDel(id, category).then(function() {
uni.showToast({
title: '删除成功',
icon: 'success',
@ -184,11 +253,98 @@ export default {
},
})
})
}else{
//
delUserCollection(id, category).then(function() {
uni.showToast({
title: '删除成功',
icon: 'success',
duration: 2000,
complete: () => {
that.collectProductList.splice(index, 1)
that.$set(that, 'collectProductList', that.collectProductList)
},
})
})
}
},
},
}
</script>
<style lang="less" scoped>
.review-box{
padding: 30rpx 30rpx 20rpx 30rpx;
width: 687rpx;
height: 250rpx;
border-radius: 16rpx;
background: #F5F6F8;
box-shadow: 0rpx 10rpx 16rpx 0rpx rgba(0,0,0,0.15);
.left{
max-width: 460rpx;
.title{
font-size: 36rpx;
font-weight: 500;
text-transform: uppercase;
}
.title1{
margin: 10rpx 0 5rpx 0;
font-size: 24rpx;
text-transform: uppercase;
}
.title2{
font-size: 28rpx;
}
.more{
font-size: 24rpx;
position: relative;
}
.more::before{
position: absolute;
border-bottom: 1rpx solid black;
bottom: -8rpx;
left: -4rpx;
content: '';
width: 100rpx;
background-color: black;
height: 1rpx;
}
.more::after{
margin-left: 10rpx;
content: '';
display: inline-block;
width: 0;
height: 0;
border-top: 10rpx solid transparent;
border-left: 10rpx solid black;
border-bottom: 10rpx solid transparent;
border-right: 10rpx solid transparent;
}
}
.right{
image{
width: 200rpx;
height: 100%;
}
}
}
.header {
.tab-title {
font-size: 32rpx;
@ -304,5 +460,9 @@ export default {
text-align: center;
text-shadow: 0rpx 10rpx 16rpx rgba(0,0,0,0.15);
}
.del-height{
height: 250rpx !important;
line-height: 250rpx !important;
}
</style>

24
pages/shop/brands/index.vue

@ -14,11 +14,12 @@
</view>
<view class="banner-box">
<swiper class="swiper-wrapper" @change="handleChange" :autoplay="true">
<swiper class="swiper-wrapper" @change="handleChange(item)" :autoplay="true">
<block v-for="(item, imgUrlsIndex) in imgUrls" :key="imgUrlsIndex">
<swiper-item>
<view class="image">{{item}}</view>
<swiper-item @click="goBannerDetail(item)">
<!-- <view class="image">{{item}}</view> -->
<!-- <image class="image" :src="item" class="slide-image" mode="aspectFill"/> -->
<image class="image slide-image" :src="item.pic" mode="aspectFill"></image>
</swiper-item>
</block>
</swiper>
@ -35,7 +36,7 @@
</view>
<view class="min-title acea-row row-between-wrapper">
<view class="">选品标准</view>
<image src="" mode=""></image>
<image src="../../../static/images/laba.png" mode="aspectFill"></image>
</view>
<view class="uni-notice-bar-box">
<uni-notice-bar color="#2DB5AE" backgroundColor="#F1F1F1" scrollable="true" single="true" :speed="60" text="热花今将机支物极十争才线来理始"></uni-notice-bar>
@ -96,7 +97,7 @@
<script>
import UniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar'
import { getBrands, getProducts } from '@/api/store';
import { getBrands, getProducts ,getBanner} from '@/api/store';
import Loading from '@/components/Loading';
export default {
components: {
@ -106,7 +107,7 @@
data() {
return {
currents: 0,
imgUrls: 5,
imgUrls: [],
brandList: [],
where: {
page: 1,
@ -123,6 +124,11 @@
onLoad() {
this.getBrandList();
this.getNewProducts();
getBanner(1).then(
res => {
this.$set(this,'imgUrls',res.data.banner)
})
},
onReachBottom() {
!this.loading && this.getNewProducts();
@ -131,6 +137,11 @@
handleChange(e) {
this.currents = e.mp.detail.current;
},
goBannerDetail(item){
if (item.uniapp_url) {
this.$yrouter.push(item.uniapp_url)
}
},
goDetail(item) {
this.$yrouter.push({
path: '/pages/shop/brands/brandDetail/index',
@ -292,7 +303,6 @@
image {
width: 26rpx;
height: 26rpx;
background-color: #2DB5AE;
}
}
.uni-notice-bar-box {

21
pages/user/AboutUs/index.vue

@ -12,24 +12,39 @@
</block>
</cu-custom>
</view>
<view class="">
<image class="img" src="../../../static/images/guanyu.jpg" mode="widthFix"></image>
<view class="" v-html="aboutUsDetail">
<!-- <image class="img" src="../../../static/images/guanyu.jpg" mode="widthFix"></image> -->
</view>
</view>
</template>
<script>
import {getAboutUs} from '@/api/user.js';
import Tabbar from '@/components/Tabbar';
export default {
data() {
return {
aboutUsDetail:{}
};
},
mounted() {
this.getAbout()
},
methods: {
getAbout(){
uni.showLoading({
title: '加载中',
mask: true,
})
getAboutUs().then(res=>{
uni.hideLoading()
this.aboutUsDetail=res.data.routine_aboutUs.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"')
console.log(res,'=======');
})
}
}
}

3
pages/user/PersonalData/index.vue

@ -115,6 +115,7 @@ export default {
this.$yrouter.push("/pages/user/ChangePassword/index");
},
switchAccounts: function (index) {
console.log(index,'1111111111111111188');
let that = this;
this.userIndex = index;
let userInfo = this.switchUserInfo[this.userIndex];
@ -181,7 +182,9 @@ export default {
},
submit: function () {
let userInfo = this.userInfo;
console.log(userInfo,'==============');
let data = {
nickname: '',
avatar: ''

80
pages/user/Problem/index.vue

@ -15,100 +15,60 @@
<view class="problem-box" v-for="(item,index) in problemList" :key="index">
<view class="problem-item acea-row row-between row-middle" @click="tapSwitch(index)">
<view class="text-box line2">
Q{{index+1}}{{item.title}}
{{item.problem}}
</view>
<image class="img" :src="`../../../static/images/picker-${number==index?'up':'down'}.png`" mode="">
</image>
</view>
<view class="problem-list" v-if="index==number">
<view class="item" v-for="(c,i) in item.chlidren" :key="i">
{{c}}
<view class="item">
{{item.answer}}
</view>
</view>
</view>
<!-- <Tabbar :pagePath="pagePath"></Tabbar> -->
</view>
</template>
<script>
import Tabbar from '@/components/Tabbar';
import {
getProblem
} from '@/api/user.js'
export default {
components: {
Tabbar,
},
data() {
return {
number: 0,
// problemList:[
// {
// title:"",
// chlidren:[
// ': ',
// '',
// ''
// ]
// },
// {
// title:"",
// chlidren:[
// '',
// '',
// ''
// ]
// },
// {
// title:"",
// chlidren:[
// '',
// '',
// ''
// ]
// }
// ],
problemList: [{
title: "可以在哪里买门票可以在哪里买门可以在哪里买门票可以在哪里买门可以在哪里买门票可以在哪里买门可以在哪里买门票可以在哪里买门",
chlidren: '方案一: 可以在哪里买门票可以在哪里买门可;方案二: 以在哪里买门票可以在哪里买门可以在哪里买门;方案三: 票可以在哪里买门可以在哪里买门票可以在哪里买门',
},
{
title: "可以在哪里买门票可以在哪里买门",
chlidren: '方案一: 可以在哪里买门票可以在哪里买门可;方案二: 以在哪里买门票可以在哪里买门可以在哪里买门;方案三: 票可以在哪里买门可以在哪里买门票可以在哪里买门',
},
{
title: "可以在哪里买门票可以在哪里买门",
chlidren: '方案一: 可以在哪里买门票可以在哪里买门可;方案二: 以在哪里买门票可以在哪里买门可以在哪里买门;方案三: 票可以在哪里买门可以在哪里买门票可以在哪里买门',
}
]
number: -1,
problemList:[]
};
},
onLoad() {
// uni.hideTabBar();
// let pages = getCurrentPages();
// this.pagePath = '/' + pages[pages.length - 1].route;
this.problemList.forEach(item => {
item.chlidren = item.chlidren.split(';')
console.log(item, '---------------');
})
console.log(this.problemList, '=============');
this.getMenu()
},
methods: {
getMenu() {
uni.showLoading({
title: '加载中',
mask: true,
})
getProblem().then(res => {
uni.hideLoading()
this.problemList=res.data.routine_problem
console.log(this.problemList, '======');
})
},
tapSwitch(index) {
if (this.number === index) {
this.number = -1
return
}
this.number = index
}
}
}

22
pages/user/coupon/GetCoupon/index.vue

@ -15,10 +15,10 @@
<view class="banner-box">
<swiper class="swiper-wrapper" @change="handleChange" :autoplay="true">
<block v-for="(item, imgUrlsIndex) in imgUrls" :key="imgUrlsIndex">
<swiper-item>
<view class="image">{{item}}</view>
<!-- <image class="image" :src="item" class="slide-image" mode="aspectFill"/> -->
<block v-for="(item, imgUrlsIndex) in imgUrls" :key="imgUrlsIndex" >
<swiper-item @click="goBannerDetail">
<!-- <view class="image">{{item}}</view> -->
<image class="image" :src="item.pic" mode="aspectFill"></image>
</swiper-item>
</block>
</swiper>
@ -114,6 +114,7 @@
</template>
<script>
import { getCoupon, getCouponReceive } from '@/api/user'
import { getBanner} from '@/api/store';
import Loading from '@/components/Loading'
import DataFormatT from '@/components/DataFormatT'
export default {
@ -131,16 +132,27 @@ export default {
couponsList: [],
loading: false,
loadend: false,
imgUrls: 5
imgUrls:[]
}
},
mounted: function() {
this.getUseCoupons()
getBanner(2).then(
res => {
this.$set(this,'imgUrls',res.data.banner)
})
},
onReachBottom() {
!this.loading && this.getUseCoupons()
},
methods: {
goBannerDetail(item){
console.log('----------------------------');
if (item.uniapp_url) {
this.$yrouter.push(item.uniapp_url)
}
},
handleChange(e) {
this.currents = e.mp.detail.current;
},

1
pages/user/signIn/Sign/index.vue

@ -433,6 +433,7 @@
uni.hideLoading();
res.data.integral = parseInt(res.data.integral);
var sumSginDay = res.data.sumSignDay;
that.userInfo = res.data;
that.signCount = String(res.data.sumSignDay);
// that.signCount = that.PrefixInteger(sumSginDay, 4);

Loading…
Cancel
Save